././@PaxHeader0000000000000000000000000000003100000000000010207 xustar0025 mtime=1753336711.1562 pygame_sdl2-2.1.0+renpy8.4.1/0000775000175000017500000000000015040345607013670 5ustar00tomtom././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1522804553.0 pygame_sdl2-2.1.0+renpy8.4.1/COPYING.LGPL210000644000175000017500000006364113261023511015621 0ustar00tomtom GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it!././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1415931422.0 pygame_sdl2-2.1.0+renpy8.4.1/COPYING.ZLIB0000664000175000017500000000146212431263036015461 0ustar00tomtomThis software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709833.0 pygame_sdl2-2.1.0+renpy8.4.1/MANIFEST.in0000664000175000017500000000065414760217711015435 0ustar00tomtominclude gen3/*.c include gen3/*.h include fix_virtualenv.py include COPYING.* include setup.py include setuplib.py include include/*.pxi include include/*.pxd include src/*.h include src/*.c include src/pygame_sdl2/*.h include src/pygame_sdl2/*.py include src/pygame_sdl2/*.pyx include src/pygame_sdl2/*.pxd include src/pygame_sdl2/*.txt include src/pygame_sdl2/*.ttf include src/pygame_sdl2/threads/*.py exclude test/* ././@PaxHeader0000000000000000000000000000003100000000000010207 xustar0025 mtime=1753336711.1562 pygame_sdl2-2.1.0+renpy8.4.1/PKG-INFO0000644000175000017500000000034515040345607014765 0ustar00tomtomMetadata-Version: 2.1 Name: pygame_sdl2 Version: 2.1.0+renpy8.4.1 Home-page: https://github.com/renpy/pygame_sdl2 Maintainer: Tom Rothamel Maintainer-email: tom@rothamel.us License-File: COPYING.LGPL21 License-File: COPYING.ZLIB ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709016.0 pygame_sdl2-2.1.0+renpy8.4.1/README.rst0000664000175000017500000000201114760216230015346 0ustar00tomtom=========== Pygame_sdl2 =========== Pygame_sdl2 is a reimplementation of the Pygame API using SDL2 and related libraries. While in the past it was meant to support multiple applications, it only saw adoption as technology underlying Ren'Py, and is currently being supported for that purpose. We recommend you consider: * `https://pyga.me/`_ * `https://www.pygame.org/`_ As alternatives. License ------- New code written for pygame_sdl2 is licensed under the Zlib license. Some code - including compiled code - is taken wholesale from Pygame, and is licensed under the LGPL2. Please check each module to determine its licensing status. See the COPYING.ZLIB and COPYING.LGPL21 files for details - you'll need to comply with both to distribute software containing pygame_sdl2. Current Status Credits ------- Pygame_sdl2 was written by: * Patrick Dawson * Tom Rothamel It includes some code from Pygame, and is inspired by the hundreds of contributors to the Pygame, Python, and SDL2 projects. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1670092709.0 pygame_sdl2-2.1.0+renpy8.4.1/fix_virtualenv.py0000664000175000017500000000202014342713645017306 0ustar00tomtomfrom __future__ import unicode_literals, print_function import os import argparse import sys import shutil import sysconfig def main(): venv = os.environ.get("VIRTUAL_ENV", None) if not venv: print("VIRTUAL_ENV is not set.") sys.exit(1) dn = None for dn in os.listdir(os.path.join(venv, "include")): if dn.startswith("python"): break if not dn: print("Could not find python include directory.") sys.exit(0) target = os.path.join(venv, "include", dn) try: source = os.readlink(target) except: print(target, "is not a symlink. Perhaps this script has already been run.") sys.exit(1) tmp = target + ".tmp" if os.path.exists(tmp): shutil.rmtree(tmp) os.mkdir(tmp) for i in os.listdir(source): if i == "pygame_sdl2": continue os.symlink(os.path.join(source, i), os.path.join(tmp, i)) os.unlink(target) os.rename(tmp, target) if __name__ == "__main__": main() ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1753336711.1272001 pygame_sdl2-2.1.0+renpy8.4.1/gen/0000775000175000017500000000000015040345607014441 5ustar00tomtom././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709469.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.color.c0000664000175000017500000622002214760217135020136 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__color #define __PYX_HAVE_API__pygame_sdl2__color /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/color.pyx", "src/pygame_sdl2/color.pxd", "include/color_dict.pxi", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_5color_Color; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma { PyObject_HEAD PyObject *__pyx_v_gamma; }; /* "pygame_sdl2/color.pyx":63 * out.a = color.a * * cdef class Color: # <<<<<<<<<<<<<< * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): * self.r = r */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* PyObject_Str.proto */ #define __Pyx_PyObject_Str(obj)\ (likely(PyString_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) /* pybytes_as_double.proto */ static double __Pyx_SlowPyString_AsDouble(PyObject *obj); static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length); static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) { char* as_c_string; Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS as_c_string = PyBytes_AS_STRING(obj); size = PyBytes_GET_SIZE(obj); #else if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) { return (double)-1; } #endif return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); } static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) { char* as_c_string; Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS as_c_string = PyByteArray_AS_STRING(obj); size = PyByteArray_GET_SIZE(obj); #else as_c_string = PyByteArray_AsString(obj); if (as_c_string == NULL) { return (double)-1; } size = PyByteArray_Size(obj); #endif return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); } /* pyunicode_as_double.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) { int last_was_punctuation; Py_ssize_t i; last_was_punctuation = 1; for (i=start; i <= end; i++) { Py_UCS4 chr = PyUnicode_READ(kind, data, i); int is_punctuation = (chr == '_') | (chr == '.'); *buffer = (char)chr; buffer += (chr != '_'); if (unlikely(chr > 127)) goto parse_failure; if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure; last_was_punctuation = is_punctuation; } if (unlikely(last_was_punctuation)) goto parse_failure; *buffer = '\0'; return buffer; parse_failure: return NULL; } static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) { int matches = 1; Py_UCS4 chr; Py_UCS4 sign = PyUnicode_READ(kind, data, start); int is_signed = (sign == '-') | (sign == '+'); start += is_signed; length -= is_signed; switch (PyUnicode_READ(kind, data, start)) { #ifdef Py_NAN case 'n': case 'N': if (unlikely(length != 3)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+1); matches &= (chr == 'a') | (chr == 'A'); chr = PyUnicode_READ(kind, data, start+2); matches &= (chr == 'n') | (chr == 'N'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_NAN : Py_NAN; #endif case 'i': case 'I': if (unlikely(length < 3)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+1); matches &= (chr == 'n') | (chr == 'N'); chr = PyUnicode_READ(kind, data, start+2); matches &= (chr == 'f') | (chr == 'F'); if (likely(length == 3 && matches)) return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; if (unlikely(length != 8)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+3); matches &= (chr == 'i') | (chr == 'I'); chr = PyUnicode_READ(kind, data, start+4); matches &= (chr == 'n') | (chr == 'N'); chr = PyUnicode_READ(kind, data, start+5); matches &= (chr == 'i') | (chr == 'I'); chr = PyUnicode_READ(kind, data, start+6); matches &= (chr == 't') | (chr == 'T'); chr = PyUnicode_READ(kind, data, start+7); matches &= (chr == 'y') | (chr == 'Y'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: goto parse_failure; } return 0.0; parse_failure: return -1.0; } static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) { double value; const char *last; char *end; Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj); const int kind = PyUnicode_KIND(obj); const void* data = PyUnicode_DATA(obj); start = 0; while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start))) start++; while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1))) length--; length -= start; if (unlikely(length <= 0)) goto fallback; value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length); if (unlikely(value == -1.0)) goto fallback; if (value != 0.0) return value; if (length < 40) { char number[40]; last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); if (unlikely(!last)) goto fallback; value = PyOS_string_to_double(number, &end, NULL); } else { char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char)); if (unlikely(!number)) goto fallback; last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); if (unlikely(!last)) { PyMem_Free(number); goto fallback; } value = PyOS_string_to_double(number, &end, NULL); PyMem_Free(number); } if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { return value; } fallback: return __Pyx_SlowPyString_AsDouble(obj); } #endif static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) { #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS if (unlikely(__Pyx_PyUnicode_READY(obj) == -1)) return (double)-1; if (likely(PyUnicode_IS_ASCII(obj))) { const char *s; Py_ssize_t length; s = PyUnicode_AsUTF8AndSize(obj, &length); return __Pyx__PyBytes_AsDouble(obj, s, length); } return __Pyx_PyUnicode_AsDouble_WithSpaces(obj); #else return __Pyx_SlowPyString_AsDouble(obj); #endif } /* pynumber_float.proto */ static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj); #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x)) /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_SubtractCObj(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif /* ModFloat[double].proto */ static CYTHON_INLINE double __Pyx_mod_double(double, double); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyFloatBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_RemainderObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check); #else #define __Pyx_PyFloat_RemainderObjC(op1, op2, floatval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2)) #endif /* pow2.proto */ #define __Pyx_PyNumber_Power2(a, b) PyNumber_Power(a, b, Py_None) /* PyFloatBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check); #else #define __Pyx_PyFloat_TrueDivideObjC(op1, op2, floatval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) #endif /* RaiseClosureNameError.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_rgba(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, Uint8 __pyx_v_r, Uint8 __pyx_v_g, Uint8 __pyx_v_b, Uint8 __pyx_v_a); /* proto*/ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_hex(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c); /* proto*/ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_name(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c); /* proto*/ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.color" */ static PyObject *__pyx_v_11pygame_sdl2_5color_colors = 0; /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.color" extern int __pyx_module_is_main_pygame_sdl2__color; int __pyx_module_is_main_pygame_sdl2__color = 0; /* Implementation of "pygame_sdl2.color" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_map; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_hex; static PyObject *__pyx_builtin_oct; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_round; /* #### Code section: string_decls ### */ static const char __pyx_k_L[] = ">L"; static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k_c[] = "c"; static const char __pyx_k_d[] = "d"; static const char __pyx_k_g[] = "g"; static const char __pyx_k_l[] = "l"; static const char __pyx_k_m[] = "m"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_0x[] = "0x"; static const char __pyx_k__2[] = ""; static const char __pyx_k__3[] = "#"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_08x[] = "%08x"; static const char __pyx_k_BBB[] = "BBB"; static const char __pyx_k__10[] = "*"; static const char __pyx_k_div[] = "div"; static const char __pyx_k_hex[] = "hex"; static const char __pyx_k_map[] = "map"; static const char __pyx_k_mod[] = "mod"; static const char __pyx_k_oct[] = "oct"; static const char __pyx_k_red[] = "red"; static const char __pyx_k_tan[] = "tan"; static const char __pyx_k_BBBB[] = "BBBB"; static const char __pyx_k__523[] = "?"; static const char __pyx_k_blue[] = "blue"; static const char __pyx_k_cyan[] = "cyan"; static const char __pyx_k_gold[] = "gold"; static const char __pyx_k_gray[] = "gray"; static const char __pyx_k_grey[] = "grey"; static const char __pyx_k_hsva[] = "hsva"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_navy[] = "navy"; static const char __pyx_k_pack[] = "pack"; static const char __pyx_k_peru[] = "peru"; static const char __pyx_k_pink[] = "pink"; static const char __pyx_k_plum[] = "plum"; static const char __pyx_k_red1[] = "red1"; static const char __pyx_k_red2[] = "red2"; static const char __pyx_k_red3[] = "red3"; static const char __pyx_k_red4[] = "red4"; static const char __pyx_k_rgba[] = "rgba"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_snow[] = "snow"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_tan1[] = "tan1"; static const char __pyx_k_tan2[] = "tan2"; static const char __pyx_k_tan3[] = "tan3"; static const char __pyx_k_tan4[] = "tan4"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_Color[] = "Color"; static const char __pyx_k_azure[] = "azure"; static const char __pyx_k_beige[] = "beige"; static const char __pyx_k_black[] = "black"; static const char __pyx_k_blue1[] = "blue1"; static const char __pyx_k_blue2[] = "blue2"; static const char __pyx_k_blue3[] = "blue3"; static const char __pyx_k_blue4[] = "blue4"; static const char __pyx_k_brown[] = "brown"; static const char __pyx_k_coral[] = "coral"; static const char __pyx_k_cyan1[] = "cyan1"; static const char __pyx_k_cyan2[] = "cyan2"; static const char __pyx_k_cyan3[] = "cyan3"; static const char __pyx_k_cyan4[] = "cyan4"; static const char __pyx_k_gamma[] = "gamma"; static const char __pyx_k_gold1[] = "gold1"; static const char __pyx_k_gold2[] = "gold2"; static const char __pyx_k_gold3[] = "gold3"; static const char __pyx_k_gold4[] = "gold4"; static const char __pyx_k_gray0[] = "gray0"; static const char __pyx_k_gray1[] = "gray1"; static const char __pyx_k_gray2[] = "gray2"; static const char __pyx_k_gray3[] = "gray3"; static const char __pyx_k_gray4[] = "gray4"; static const char __pyx_k_gray5[] = "gray5"; static const char __pyx_k_gray6[] = "gray6"; static const char __pyx_k_gray7[] = "gray7"; static const char __pyx_k_gray8[] = "gray8"; static const char __pyx_k_gray9[] = "gray9"; static const char __pyx_k_green[] = "green"; static const char __pyx_k_grey0[] = "grey0"; static const char __pyx_k_grey1[] = "grey1"; static const char __pyx_k_grey2[] = "grey2"; static const char __pyx_k_grey3[] = "grey3"; static const char __pyx_k_grey4[] = "grey4"; static const char __pyx_k_grey5[] = "grey5"; static const char __pyx_k_grey6[] = "grey6"; static const char __pyx_k_grey7[] = "grey7"; static const char __pyx_k_grey8[] = "grey8"; static const char __pyx_k_grey9[] = "grey9"; static const char __pyx_k_ivory[] = "ivory"; static const char __pyx_k_khaki[] = "khaki"; static const char __pyx_k_linen[] = "linen"; static const char __pyx_k_lower[] = "lower"; static const char __pyx_k_pink1[] = "pink1"; static const char __pyx_k_pink2[] = "pink2"; static const char __pyx_k_pink3[] = "pink3"; static const char __pyx_k_pink4[] = "pink4"; static const char __pyx_k_plum1[] = "plum1"; static const char __pyx_k_plum2[] = "plum2"; static const char __pyx_k_plum3[] = "plum3"; static const char __pyx_k_plum4[] = "plum4"; static const char __pyx_k_round[] = "round"; static const char __pyx_k_snow1[] = "snow1"; static const char __pyx_k_snow2[] = "snow2"; static const char __pyx_k_snow3[] = "snow3"; static const char __pyx_k_snow4[] = "snow4"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_wheat[] = "wheat"; static const char __pyx_k_white[] = "white"; static const char __pyx_k_azure1[] = "azure1"; static const char __pyx_k_azure2[] = "azure2"; static const char __pyx_k_azure3[] = "azure3"; static const char __pyx_k_azure4[] = "azure4"; static const char __pyx_k_bisque[] = "bisque"; static const char __pyx_k_brown1[] = "brown1"; static const char __pyx_k_brown2[] = "brown2"; static const char __pyx_k_brown3[] = "brown3"; static const char __pyx_k_brown4[] = "brown4"; static const char __pyx_k_coral1[] = "coral1"; static const char __pyx_k_coral2[] = "coral2"; static const char __pyx_k_coral3[] = "coral3"; static const char __pyx_k_coral4[] = "coral4"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_gray10[] = "gray10"; static const char __pyx_k_gray11[] = "gray11"; static const char __pyx_k_gray12[] = "gray12"; static const char __pyx_k_gray13[] = "gray13"; static const char __pyx_k_gray14[] = "gray14"; static const char __pyx_k_gray15[] = "gray15"; static const char __pyx_k_gray16[] = "gray16"; static const char __pyx_k_gray17[] = "gray17"; static const char __pyx_k_gray18[] = "gray18"; static const char __pyx_k_gray19[] = "gray19"; static const char __pyx_k_gray20[] = "gray20"; static const char __pyx_k_gray21[] = "gray21"; static const char __pyx_k_gray22[] = "gray22"; static const char __pyx_k_gray23[] = "gray23"; static const char __pyx_k_gray24[] = "gray24"; static const char __pyx_k_gray25[] = "gray25"; static const char __pyx_k_gray26[] = "gray26"; static const char __pyx_k_gray27[] = "gray27"; static const char __pyx_k_gray28[] = "gray28"; static const char __pyx_k_gray29[] = "gray29"; static const char __pyx_k_gray30[] = "gray30"; static const char __pyx_k_gray31[] = "gray31"; static const char __pyx_k_gray32[] = "gray32"; static const char __pyx_k_gray33[] = "gray33"; static const char __pyx_k_gray34[] = "gray34"; static const char __pyx_k_gray35[] = "gray35"; static const char __pyx_k_gray36[] = "gray36"; static const char __pyx_k_gray37[] = "gray37"; static const char __pyx_k_gray38[] = "gray38"; static const char __pyx_k_gray39[] = "gray39"; static const char __pyx_k_gray40[] = "gray40"; static const char __pyx_k_gray41[] = "gray41"; static const char __pyx_k_gray42[] = "gray42"; static const char __pyx_k_gray43[] = "gray43"; static const char __pyx_k_gray44[] = "gray44"; static const char __pyx_k_gray45[] = "gray45"; static const char __pyx_k_gray46[] = "gray46"; static const char __pyx_k_gray47[] = "gray47"; static const char __pyx_k_gray48[] = "gray48"; static const char __pyx_k_gray49[] = "gray49"; static const char __pyx_k_gray50[] = "gray50"; static const char __pyx_k_gray51[] = "gray51"; static const char __pyx_k_gray52[] = "gray52"; static const char __pyx_k_gray53[] = "gray53"; static const char __pyx_k_gray54[] = "gray54"; static const char __pyx_k_gray55[] = "gray55"; static const char __pyx_k_gray56[] = "gray56"; static const char __pyx_k_gray57[] = "gray57"; static const char __pyx_k_gray58[] = "gray58"; static const char __pyx_k_gray59[] = "gray59"; static const char __pyx_k_gray60[] = "gray60"; static const char __pyx_k_gray61[] = "gray61"; static const char __pyx_k_gray62[] = "gray62"; static const char __pyx_k_gray63[] = "gray63"; static const char __pyx_k_gray64[] = "gray64"; static const char __pyx_k_gray65[] = "gray65"; static const char __pyx_k_gray66[] = "gray66"; static const char __pyx_k_gray67[] = "gray67"; static const char __pyx_k_gray68[] = "gray68"; static const char __pyx_k_gray69[] = "gray69"; static const char __pyx_k_gray70[] = "gray70"; static const char __pyx_k_gray71[] = "gray71"; static const char __pyx_k_gray72[] = "gray72"; static const char __pyx_k_gray73[] = "gray73"; static const char __pyx_k_gray74[] = "gray74"; static const char __pyx_k_gray75[] = "gray75"; static const char __pyx_k_gray76[] = "gray76"; static const char __pyx_k_gray77[] = "gray77"; static const char __pyx_k_gray78[] = "gray78"; static const char __pyx_k_gray79[] = "gray79"; static const char __pyx_k_gray80[] = "gray80"; static const char __pyx_k_gray81[] = "gray81"; static const char __pyx_k_gray82[] = "gray82"; static const char __pyx_k_gray83[] = "gray83"; static const char __pyx_k_gray84[] = "gray84"; static const char __pyx_k_gray85[] = "gray85"; static const char __pyx_k_gray86[] = "gray86"; static const char __pyx_k_gray87[] = "gray87"; static const char __pyx_k_gray88[] = "gray88"; static const char __pyx_k_gray89[] = "gray89"; static const char __pyx_k_gray90[] = "gray90"; static const char __pyx_k_gray91[] = "gray91"; static const char __pyx_k_gray92[] = "gray92"; static const char __pyx_k_gray93[] = "gray93"; static const char __pyx_k_gray94[] = "gray94"; static const char __pyx_k_gray95[] = "gray95"; static const char __pyx_k_gray96[] = "gray96"; static const char __pyx_k_gray97[] = "gray97"; static const char __pyx_k_gray98[] = "gray98"; static const char __pyx_k_gray99[] = "gray99"; static const char __pyx_k_green1[] = "green1"; static const char __pyx_k_green2[] = "green2"; static const char __pyx_k_green3[] = "green3"; static const char __pyx_k_green4[] = "green4"; static const char __pyx_k_grey10[] = "grey10"; static const char __pyx_k_grey11[] = "grey11"; static const char __pyx_k_grey12[] = "grey12"; static const char __pyx_k_grey13[] = "grey13"; static const char __pyx_k_grey14[] = "grey14"; static const char __pyx_k_grey15[] = "grey15"; static const char __pyx_k_grey16[] = "grey16"; static const char __pyx_k_grey17[] = "grey17"; static const char __pyx_k_grey18[] = "grey18"; static const char __pyx_k_grey19[] = "grey19"; static const char __pyx_k_grey20[] = "grey20"; static const char __pyx_k_grey21[] = "grey21"; static const char __pyx_k_grey22[] = "grey22"; static const char __pyx_k_grey23[] = "grey23"; static const char __pyx_k_grey24[] = "grey24"; static const char __pyx_k_grey25[] = "grey25"; static const char __pyx_k_grey26[] = "grey26"; static const char __pyx_k_grey27[] = "grey27"; static const char __pyx_k_grey28[] = "grey28"; static const char __pyx_k_grey29[] = "grey29"; static const char __pyx_k_grey30[] = "grey30"; static const char __pyx_k_grey31[] = "grey31"; static const char __pyx_k_grey32[] = "grey32"; static const char __pyx_k_grey33[] = "grey33"; static const char __pyx_k_grey34[] = "grey34"; static const char __pyx_k_grey35[] = "grey35"; static const char __pyx_k_grey36[] = "grey36"; static const char __pyx_k_grey37[] = "grey37"; static const char __pyx_k_grey38[] = "grey38"; static const char __pyx_k_grey39[] = "grey39"; static const char __pyx_k_grey40[] = "grey40"; static const char __pyx_k_grey41[] = "grey41"; static const char __pyx_k_grey42[] = "grey42"; static const char __pyx_k_grey43[] = "grey43"; static const char __pyx_k_grey44[] = "grey44"; static const char __pyx_k_grey45[] = "grey45"; static const char __pyx_k_grey46[] = "grey46"; static const char __pyx_k_grey47[] = "grey47"; static const char __pyx_k_grey48[] = "grey48"; static const char __pyx_k_grey49[] = "grey49"; static const char __pyx_k_grey50[] = "grey50"; static const char __pyx_k_grey51[] = "grey51"; static const char __pyx_k_grey52[] = "grey52"; static const char __pyx_k_grey53[] = "grey53"; static const char __pyx_k_grey54[] = "grey54"; static const char __pyx_k_grey55[] = "grey55"; static const char __pyx_k_grey56[] = "grey56"; static const char __pyx_k_grey57[] = "grey57"; static const char __pyx_k_grey58[] = "grey58"; static const char __pyx_k_grey59[] = "grey59"; static const char __pyx_k_grey60[] = "grey60"; static const char __pyx_k_grey61[] = "grey61"; static const char __pyx_k_grey62[] = "grey62"; static const char __pyx_k_grey63[] = "grey63"; static const char __pyx_k_grey64[] = "grey64"; static const char __pyx_k_grey65[] = "grey65"; static const char __pyx_k_grey66[] = "grey66"; static const char __pyx_k_grey67[] = "grey67"; static const char __pyx_k_grey68[] = "grey68"; static const char __pyx_k_grey69[] = "grey69"; static const char __pyx_k_grey70[] = "grey70"; static const char __pyx_k_grey71[] = "grey71"; static const char __pyx_k_grey72[] = "grey72"; static const char __pyx_k_grey73[] = "grey73"; static const char __pyx_k_grey74[] = "grey74"; static const char __pyx_k_grey75[] = "grey75"; static const char __pyx_k_grey76[] = "grey76"; static const char __pyx_k_grey77[] = "grey77"; static const char __pyx_k_grey78[] = "grey78"; static const char __pyx_k_grey79[] = "grey79"; static const char __pyx_k_grey80[] = "grey80"; static const char __pyx_k_grey81[] = "grey81"; static const char __pyx_k_grey82[] = "grey82"; static const char __pyx_k_grey83[] = "grey83"; static const char __pyx_k_grey84[] = "grey84"; static const char __pyx_k_grey85[] = "grey85"; static const char __pyx_k_grey86[] = "grey86"; static const char __pyx_k_grey87[] = "grey87"; static const char __pyx_k_grey88[] = "grey88"; static const char __pyx_k_grey89[] = "grey89"; static const char __pyx_k_grey90[] = "grey90"; static const char __pyx_k_grey91[] = "grey91"; static const char __pyx_k_grey92[] = "grey92"; static const char __pyx_k_grey93[] = "grey93"; static const char __pyx_k_grey94[] = "grey94"; static const char __pyx_k_grey95[] = "grey95"; static const char __pyx_k_grey96[] = "grey96"; static const char __pyx_k_grey97[] = "grey97"; static const char __pyx_k_grey98[] = "grey98"; static const char __pyx_k_grey99[] = "grey99"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_ivory1[] = "ivory1"; static const char __pyx_k_ivory2[] = "ivory2"; static const char __pyx_k_ivory3[] = "ivory3"; static const char __pyx_k_ivory4[] = "ivory4"; static const char __pyx_k_khaki1[] = "khaki1"; static const char __pyx_k_khaki2[] = "khaki2"; static const char __pyx_k_khaki3[] = "khaki3"; static const char __pyx_k_khaki4[] = "khaki4"; static const char __pyx_k_maroon[] = "maroon"; static const char __pyx_k_orange[] = "orange"; static const char __pyx_k_orchid[] = "orchid"; static const char __pyx_k_purple[] = "purple"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_salmon[] = "salmon"; static const char __pyx_k_sienna[] = "sienna"; static const char __pyx_k_struct[] = "struct"; static const char __pyx_k_tomato[] = "tomato"; static const char __pyx_k_unpack[] = "unpack"; static const char __pyx_k_violet[] = "violet"; static const char __pyx_k_wheat1[] = "wheat1"; static const char __pyx_k_wheat2[] = "wheat2"; static const char __pyx_k_wheat3[] = "wheat3"; static const char __pyx_k_wheat4[] = "wheat4"; static const char __pyx_k_yellow[] = "yellow"; static const char __pyx_k_bisque1[] = "bisque1"; static const char __pyx_k_bisque2[] = "bisque2"; static const char __pyx_k_bisque3[] = "bisque3"; static const char __pyx_k_bisque4[] = "bisque4"; static const char __pyx_k_darkred[] = "darkred"; static const char __pyx_k_dimgray[] = "dimgray"; static const char __pyx_k_dimgrey[] = "dimgrey"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_gray100[] = "gray100"; static const char __pyx_k_grey100[] = "grey100"; static const char __pyx_k_hotpink[] = "hotpink"; static const char __pyx_k_magenta[] = "magenta"; static const char __pyx_k_maroon1[] = "maroon1"; static const char __pyx_k_maroon2[] = "maroon2"; static const char __pyx_k_maroon3[] = "maroon3"; static const char __pyx_k_maroon4[] = "maroon4"; static const char __pyx_k_oldlace[] = "oldlace"; static const char __pyx_k_orange1[] = "orange1"; static const char __pyx_k_orange2[] = "orange2"; static const char __pyx_k_orange3[] = "orange3"; static const char __pyx_k_orange4[] = "orange4"; static const char __pyx_k_orchid1[] = "orchid1"; static const char __pyx_k_orchid2[] = "orchid2"; static const char __pyx_k_orchid3[] = "orchid3"; static const char __pyx_k_orchid4[] = "orchid4"; static const char __pyx_k_purple1[] = "purple1"; static const char __pyx_k_purple2[] = "purple2"; static const char __pyx_k_purple3[] = "purple3"; static const char __pyx_k_purple4[] = "purple4"; static const char __pyx_k_salmon1[] = "salmon1"; static const char __pyx_k_salmon2[] = "salmon2"; static const char __pyx_k_salmon3[] = "salmon3"; static const char __pyx_k_salmon4[] = "salmon4"; static const char __pyx_k_sienna1[] = "sienna1"; static const char __pyx_k_sienna2[] = "sienna2"; static const char __pyx_k_sienna3[] = "sienna3"; static const char __pyx_k_sienna4[] = "sienna4"; static const char __pyx_k_skyblue[] = "skyblue"; static const char __pyx_k_thistle[] = "thistle"; static const char __pyx_k_tomato1[] = "tomato1"; static const char __pyx_k_tomato2[] = "tomato2"; static const char __pyx_k_tomato3[] = "tomato3"; static const char __pyx_k_tomato4[] = "tomato4"; static const char __pyx_k_yellow1[] = "yellow1"; static const char __pyx_k_yellow2[] = "yellow2"; static const char __pyx_k_yellow3[] = "yellow3"; static const char __pyx_k_yellow4[] = "yellow4"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_binascii[] = "binascii"; static const char __pyx_k_cornsilk[] = "cornsilk"; static const char __pyx_k_darkblue[] = "darkblue"; static const char __pyx_k_darkcyan[] = "darkcyan"; static const char __pyx_k_darkgray[] = "darkgray"; static const char __pyx_k_darkgrey[] = "darkgrey"; static const char __pyx_k_deeppink[] = "deeppink"; static const char __pyx_k_honeydew[] = "honeydew"; static const char __pyx_k_hotpink1[] = "hotpink1"; static const char __pyx_k_hotpink2[] = "hotpink2"; static const char __pyx_k_hotpink3[] = "hotpink3"; static const char __pyx_k_hotpink4[] = "hotpink4"; static const char __pyx_k_lavender[] = "lavender"; static const char __pyx_k_magenta1[] = "magenta1"; static const char __pyx_k_magenta2[] = "magenta2"; static const char __pyx_k_magenta3[] = "magenta3"; static const char __pyx_k_magenta4[] = "magenta4"; static const char __pyx_k_moccasin[] = "moccasin"; static const char __pyx_k_navyblue[] = "navyblue"; static const char __pyx_k_seagreen[] = "seagreen"; static const char __pyx_k_seashell[] = "seashell"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_skyblue1[] = "skyblue1"; static const char __pyx_k_skyblue2[] = "skyblue2"; static const char __pyx_k_skyblue3[] = "skyblue3"; static const char __pyx_k_skyblue4[] = "skyblue4"; static const char __pyx_k_thistle1[] = "thistle1"; static const char __pyx_k_thistle2[] = "thistle2"; static const char __pyx_k_thistle3[] = "thistle3"; static const char __pyx_k_thistle4[] = "thistle4"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_aliceblue[] = "aliceblue"; static const char __pyx_k_burlywood[] = "burlywood"; static const char __pyx_k_cadetblue[] = "cadetblue"; static const char __pyx_k_chocolate[] = "chocolate"; static const char __pyx_k_cornsilk1[] = "cornsilk1"; static const char __pyx_k_cornsilk2[] = "cornsilk2"; static const char __pyx_k_cornsilk3[] = "cornsilk3"; static const char __pyx_k_cornsilk4[] = "cornsilk4"; static const char __pyx_k_darkgreen[] = "darkgreen"; static const char __pyx_k_darkkhaki[] = "darkkhaki"; static const char __pyx_k_debianred[] = "debianred"; static const char __pyx_k_deeppink1[] = "deeppink1"; static const char __pyx_k_deeppink2[] = "deeppink2"; static const char __pyx_k_deeppink3[] = "deeppink3"; static const char __pyx_k_deeppink4[] = "deeppink4"; static const char __pyx_k_firebrick[] = "firebrick"; static const char __pyx_k_gainsboro[] = "gainsboro"; static const char __pyx_k_goldenrod[] = "goldenrod"; static const char __pyx_k_honeydew1[] = "honeydew1"; static const char __pyx_k_honeydew2[] = "honeydew2"; static const char __pyx_k_honeydew3[] = "honeydew3"; static const char __pyx_k_honeydew4[] = "honeydew4"; static const char __pyx_k_indianred[] = "indianred"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_lawngreen[] = "lawngreen"; static const char __pyx_k_lightblue[] = "lightblue"; static const char __pyx_k_lightcyan[] = "lightcyan"; static const char __pyx_k_lightgray[] = "lightgray"; static const char __pyx_k_lightgrey[] = "lightgrey"; static const char __pyx_k_lightpink[] = "lightpink"; static const char __pyx_k_limegreen[] = "limegreen"; static const char __pyx_k_mintcream[] = "mintcream"; static const char __pyx_k_mistyrose[] = "mistyrose"; static const char __pyx_k_normalize[] = "normalize"; static const char __pyx_k_olivedrab[] = "olivedrab"; static const char __pyx_k_orangered[] = "orangered"; static const char __pyx_k_palegreen[] = "palegreen"; static const char __pyx_k_peachpuff[] = "peachpuff"; static const char __pyx_k_rosybrown[] = "rosybrown"; static const char __pyx_k_royalblue[] = "royalblue"; static const char __pyx_k_seagreen1[] = "seagreen1"; static const char __pyx_k_seagreen2[] = "seagreen2"; static const char __pyx_k_seagreen3[] = "seagreen3"; static const char __pyx_k_seagreen4[] = "seagreen4"; static const char __pyx_k_seashell1[] = "seashell1"; static const char __pyx_k_seashell2[] = "seashell2"; static const char __pyx_k_seashell3[] = "seashell3"; static const char __pyx_k_seashell4[] = "seashell4"; static const char __pyx_k_slateblue[] = "slateblue"; static const char __pyx_k_slategray[] = "slategray"; static const char __pyx_k_slategrey[] = "slategrey"; static const char __pyx_k_steelblue[] = "steelblue"; static const char __pyx_k_turquoise[] = "turquoise"; static const char __pyx_k_unhexlify[] = "unhexlify"; static const char __pyx_k_violetred[] = "violetred"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_aquamarine[] = "aquamarine"; static const char __pyx_k_blueviolet[] = "blueviolet"; static const char __pyx_k_burlywood1[] = "burlywood1"; static const char __pyx_k_burlywood2[] = "burlywood2"; static const char __pyx_k_burlywood3[] = "burlywood3"; static const char __pyx_k_burlywood4[] = "burlywood4"; static const char __pyx_k_cadetblue1[] = "cadetblue1"; static const char __pyx_k_cadetblue2[] = "cadetblue2"; static const char __pyx_k_cadetblue3[] = "cadetblue3"; static const char __pyx_k_cadetblue4[] = "cadetblue4"; static const char __pyx_k_chartreuse[] = "chartreuse"; static const char __pyx_k_chocolate1[] = "chocolate1"; static const char __pyx_k_chocolate2[] = "chocolate2"; static const char __pyx_k_chocolate3[] = "chocolate3"; static const char __pyx_k_chocolate4[] = "chocolate4"; static const char __pyx_k_darkorange[] = "darkorange"; static const char __pyx_k_darkorchid[] = "darkorchid"; static const char __pyx_k_darksalmon[] = "darksalmon"; static const char __pyx_k_darkviolet[] = "darkviolet"; static const char __pyx_k_dodgerblue[] = "dodgerblue"; static const char __pyx_k_firebrick1[] = "firebrick1"; static const char __pyx_k_firebrick2[] = "firebrick2"; static const char __pyx_k_firebrick3[] = "firebrick3"; static const char __pyx_k_firebrick4[] = "firebrick4"; static const char __pyx_k_ghostwhite[] = "ghostwhite"; static const char __pyx_k_goldenrod1[] = "goldenrod1"; static const char __pyx_k_goldenrod2[] = "goldenrod2"; static const char __pyx_k_goldenrod3[] = "goldenrod3"; static const char __pyx_k_goldenrod4[] = "goldenrod4"; static const char __pyx_k_indianred1[] = "indianred1"; static const char __pyx_k_indianred2[] = "indianred2"; static const char __pyx_k_indianred3[] = "indianred3"; static const char __pyx_k_indianred4[] = "indianred4"; static const char __pyx_k_lightblue1[] = "lightblue1"; static const char __pyx_k_lightblue2[] = "lightblue2"; static const char __pyx_k_lightblue3[] = "lightblue3"; static const char __pyx_k_lightblue4[] = "lightblue4"; static const char __pyx_k_lightcoral[] = "lightcoral"; static const char __pyx_k_lightcyan1[] = "lightcyan1"; static const char __pyx_k_lightcyan2[] = "lightcyan2"; static const char __pyx_k_lightcyan3[] = "lightcyan3"; static const char __pyx_k_lightcyan4[] = "lightcyan4"; static const char __pyx_k_lightgreen[] = "lightgreen"; static const char __pyx_k_lightpink1[] = "lightpink1"; static const char __pyx_k_lightpink2[] = "lightpink2"; static const char __pyx_k_lightpink3[] = "lightpink3"; static const char __pyx_k_lightpink4[] = "lightpink4"; static const char __pyx_k_mediumblue[] = "mediumblue"; static const char __pyx_k_mistyrose1[] = "mistyrose1"; static const char __pyx_k_mistyrose2[] = "mistyrose2"; static const char __pyx_k_mistyrose3[] = "mistyrose3"; static const char __pyx_k_mistyrose4[] = "mistyrose4"; static const char __pyx_k_olivedrab1[] = "olivedrab1"; static const char __pyx_k_olivedrab2[] = "olivedrab2"; static const char __pyx_k_olivedrab3[] = "olivedrab3"; static const char __pyx_k_olivedrab4[] = "olivedrab4"; static const char __pyx_k_orangered1[] = "orangered1"; static const char __pyx_k_orangered2[] = "orangered2"; static const char __pyx_k_orangered3[] = "orangered3"; static const char __pyx_k_orangered4[] = "orangered4"; static const char __pyx_k_palegreen1[] = "palegreen1"; static const char __pyx_k_palegreen2[] = "palegreen2"; static const char __pyx_k_palegreen3[] = "palegreen3"; static const char __pyx_k_palegreen4[] = "palegreen4"; static const char __pyx_k_papayawhip[] = "papayawhip"; static const char __pyx_k_peachpuff1[] = "peachpuff1"; static const char __pyx_k_peachpuff2[] = "peachpuff2"; static const char __pyx_k_peachpuff3[] = "peachpuff3"; static const char __pyx_k_peachpuff4[] = "peachpuff4"; static const char __pyx_k_powderblue[] = "powderblue"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_rosybrown1[] = "rosybrown1"; static const char __pyx_k_rosybrown2[] = "rosybrown2"; static const char __pyx_k_rosybrown3[] = "rosybrown3"; static const char __pyx_k_rosybrown4[] = "rosybrown4"; static const char __pyx_k_royalblue1[] = "royalblue1"; static const char __pyx_k_royalblue2[] = "royalblue2"; static const char __pyx_k_royalblue3[] = "royalblue3"; static const char __pyx_k_royalblue4[] = "royalblue4"; static const char __pyx_k_sandybrown[] = "sandybrown"; static const char __pyx_k_set_length[] = "set_length"; static const char __pyx_k_slateblue1[] = "slateblue1"; static const char __pyx_k_slateblue2[] = "slateblue2"; static const char __pyx_k_slateblue3[] = "slateblue3"; static const char __pyx_k_slateblue4[] = "slateblue4"; static const char __pyx_k_slategray1[] = "slategray1"; static const char __pyx_k_slategray2[] = "slategray2"; static const char __pyx_k_slategray3[] = "slategray3"; static const char __pyx_k_slategray4[] = "slategray4"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_steelblue1[] = "steelblue1"; static const char __pyx_k_steelblue2[] = "steelblue2"; static const char __pyx_k_steelblue3[] = "steelblue3"; static const char __pyx_k_steelblue4[] = "steelblue4"; static const char __pyx_k_turquoise1[] = "turquoise1"; static const char __pyx_k_turquoise2[] = "turquoise2"; static const char __pyx_k_turquoise3[] = "turquoise3"; static const char __pyx_k_turquoise4[] = "turquoise4"; static const char __pyx_k_violetred1[] = "violetred1"; static const char __pyx_k_violetred2[] = "violetred2"; static const char __pyx_k_violetred3[] = "violetred3"; static const char __pyx_k_violetred4[] = "violetred4"; static const char __pyx_k_whitesmoke[] = "whitesmoke"; static const char __pyx_k_aquamarine1[] = "aquamarine1"; static const char __pyx_k_aquamarine2[] = "aquamarine2"; static const char __pyx_k_aquamarine3[] = "aquamarine3"; static const char __pyx_k_aquamarine4[] = "aquamarine4"; static const char __pyx_k_chartreuse1[] = "chartreuse1"; static const char __pyx_k_chartreuse2[] = "chartreuse2"; static const char __pyx_k_chartreuse3[] = "chartreuse3"; static const char __pyx_k_chartreuse4[] = "chartreuse4"; static const char __pyx_k_darkmagenta[] = "darkmagenta"; static const char __pyx_k_darkorange1[] = "darkorange1"; static const char __pyx_k_darkorange2[] = "darkorange2"; static const char __pyx_k_darkorange3[] = "darkorange3"; static const char __pyx_k_darkorange4[] = "darkorange4"; static const char __pyx_k_darkorchid1[] = "darkorchid1"; static const char __pyx_k_darkorchid2[] = "darkorchid2"; static const char __pyx_k_darkorchid3[] = "darkorchid3"; static const char __pyx_k_darkorchid4[] = "darkorchid4"; static const char __pyx_k_deepskyblue[] = "deepskyblue"; static const char __pyx_k_dodgerblue1[] = "dodgerblue1"; static const char __pyx_k_dodgerblue2[] = "dodgerblue2"; static const char __pyx_k_dodgerblue3[] = "dodgerblue3"; static const char __pyx_k_dodgerblue4[] = "dodgerblue4"; static const char __pyx_k_floralwhite[] = "floralwhite"; static const char __pyx_k_forestgreen[] = "forestgreen"; static const char __pyx_k_greenyellow[] = "greenyellow"; static const char __pyx_k_lightsalmon[] = "lightsalmon"; static const char __pyx_k_lightyellow[] = "lightyellow"; static const char __pyx_k_navajowhite[] = "navajowhite"; static const char __pyx_k_saddlebrown[] = "saddlebrown"; static const char __pyx_k_springgreen[] = "springgreen"; static const char __pyx_k_yellowgreen[] = "yellowgreen"; static const char __pyx_k_antiquewhite[] = "antiquewhite"; static const char __pyx_k_darkseagreen[] = "darkseagreen"; static const char __pyx_k_deepskyblue1[] = "deepskyblue1"; static const char __pyx_k_deepskyblue2[] = "deepskyblue2"; static const char __pyx_k_deepskyblue3[] = "deepskyblue3"; static const char __pyx_k_deepskyblue4[] = "deepskyblue4"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_lemonchiffon[] = "lemonchiffon"; static const char __pyx_k_lightsalmon1[] = "lightsalmon1"; static const char __pyx_k_lightsalmon2[] = "lightsalmon2"; static const char __pyx_k_lightsalmon3[] = "lightsalmon3"; static const char __pyx_k_lightsalmon4[] = "lightsalmon4"; static const char __pyx_k_lightskyblue[] = "lightskyblue"; static const char __pyx_k_lightyellow1[] = "lightyellow1"; static const char __pyx_k_lightyellow2[] = "lightyellow2"; static const char __pyx_k_lightyellow3[] = "lightyellow3"; static const char __pyx_k_lightyellow4[] = "lightyellow4"; static const char __pyx_k_mediumorchid[] = "mediumorchid"; static const char __pyx_k_mediumpurple[] = "mediumpurple"; static const char __pyx_k_midnightblue[] = "midnightblue"; static const char __pyx_k_navajowhite1[] = "navajowhite1"; static const char __pyx_k_navajowhite2[] = "navajowhite2"; static const char __pyx_k_navajowhite3[] = "navajowhite3"; static const char __pyx_k_navajowhite4[] = "navajowhite4"; static const char __pyx_k_springgreen1[] = "springgreen1"; static const char __pyx_k_springgreen2[] = "springgreen2"; static const char __pyx_k_springgreen3[] = "springgreen3"; static const char __pyx_k_springgreen4[] = "springgreen4"; static const char __pyx_k_antiquewhite1[] = "antiquewhite1"; static const char __pyx_k_antiquewhite2[] = "antiquewhite2"; static const char __pyx_k_antiquewhite3[] = "antiquewhite3"; static const char __pyx_k_antiquewhite4[] = "antiquewhite4"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_correct_gamma[] = "correct_gamma"; static const char __pyx_k_darkgoldenrod[] = "darkgoldenrod"; static const char __pyx_k_darkseagreen1[] = "darkseagreen1"; static const char __pyx_k_darkseagreen2[] = "darkseagreen2"; static const char __pyx_k_darkseagreen3[] = "darkseagreen3"; static const char __pyx_k_darkseagreen4[] = "darkseagreen4"; static const char __pyx_k_darkslateblue[] = "darkslateblue"; static const char __pyx_k_darkslategray[] = "darkslategray"; static const char __pyx_k_darkslategrey[] = "darkslategrey"; static const char __pyx_k_darkturquoise[] = "darkturquoise"; static const char __pyx_k_lavenderblush[] = "lavenderblush"; static const char __pyx_k_lemonchiffon1[] = "lemonchiffon1"; static const char __pyx_k_lemonchiffon2[] = "lemonchiffon2"; static const char __pyx_k_lemonchiffon3[] = "lemonchiffon3"; static const char __pyx_k_lemonchiffon4[] = "lemonchiffon4"; static const char __pyx_k_lightseagreen[] = "lightseagreen"; static const char __pyx_k_lightskyblue1[] = "lightskyblue1"; static const char __pyx_k_lightskyblue2[] = "lightskyblue2"; static const char __pyx_k_lightskyblue3[] = "lightskyblue3"; static const char __pyx_k_lightskyblue4[] = "lightskyblue4"; static const char __pyx_k_mediumorchid1[] = "mediumorchid1"; static const char __pyx_k_mediumorchid2[] = "mediumorchid2"; static const char __pyx_k_mediumorchid3[] = "mediumorchid3"; static const char __pyx_k_mediumorchid4[] = "mediumorchid4"; static const char __pyx_k_mediumpurple1[] = "mediumpurple1"; static const char __pyx_k_mediumpurple2[] = "mediumpurple2"; static const char __pyx_k_mediumpurple3[] = "mediumpurple3"; static const char __pyx_k_mediumpurple4[] = "mediumpurple4"; static const char __pyx_k_palegoldenrod[] = "palegoldenrod"; static const char __pyx_k_paleturquoise[] = "paleturquoise"; static const char __pyx_k_palevioletred[] = "palevioletred"; static const char __pyx_k_Color___reduce[] = "Color.__reduce__"; static const char __pyx_k_blanchedalmond[] = "blanchedalmond"; static const char __pyx_k_cornflowerblue[] = "cornflowerblue"; static const char __pyx_k_darkgoldenrod1[] = "darkgoldenrod1"; static const char __pyx_k_darkgoldenrod2[] = "darkgoldenrod2"; static const char __pyx_k_darkgoldenrod3[] = "darkgoldenrod3"; static const char __pyx_k_darkgoldenrod4[] = "darkgoldenrod4"; static const char __pyx_k_darkolivegreen[] = "darkolivegreen"; static const char __pyx_k_darkslategray1[] = "darkslategray1"; static const char __pyx_k_darkslategray2[] = "darkslategray2"; static const char __pyx_k_darkslategray3[] = "darkslategray3"; static const char __pyx_k_darkslategray4[] = "darkslategray4"; static const char __pyx_k_lavenderblush1[] = "lavenderblush1"; static const char __pyx_k_lavenderblush2[] = "lavenderblush2"; static const char __pyx_k_lavenderblush3[] = "lavenderblush3"; static const char __pyx_k_lavenderblush4[] = "lavenderblush4"; static const char __pyx_k_lightgoldenrod[] = "lightgoldenrod"; static const char __pyx_k_lightslateblue[] = "lightslateblue"; static const char __pyx_k_lightslategray[] = "lightslategray"; static const char __pyx_k_lightslategrey[] = "lightslategrey"; static const char __pyx_k_lightsteelblue[] = "lightsteelblue"; static const char __pyx_k_mediumseagreen[] = "mediumseagreen"; static const char __pyx_k_paleturquoise1[] = "paleturquoise1"; static const char __pyx_k_paleturquoise2[] = "paleturquoise2"; static const char __pyx_k_paleturquoise3[] = "paleturquoise3"; static const char __pyx_k_paleturquoise4[] = "paleturquoise4"; static const char __pyx_k_palevioletred1[] = "palevioletred1"; static const char __pyx_k_palevioletred2[] = "palevioletred2"; static const char __pyx_k_palevioletred3[] = "palevioletred3"; static const char __pyx_k_palevioletred4[] = "palevioletred4"; static const char __pyx_k_Color_normalize[] = "Color.normalize"; static const char __pyx_k_darkolivegreen1[] = "darkolivegreen1"; static const char __pyx_k_darkolivegreen2[] = "darkolivegreen2"; static const char __pyx_k_darkolivegreen3[] = "darkolivegreen3"; static const char __pyx_k_darkolivegreen4[] = "darkolivegreen4"; static const char __pyx_k_lightgoldenrod1[] = "lightgoldenrod1"; static const char __pyx_k_lightgoldenrod2[] = "lightgoldenrod2"; static const char __pyx_k_lightgoldenrod3[] = "lightgoldenrod3"; static const char __pyx_k_lightgoldenrod4[] = "lightgoldenrod4"; static const char __pyx_k_lightsteelblue1[] = "lightsteelblue1"; static const char __pyx_k_lightsteelblue2[] = "lightsteelblue2"; static const char __pyx_k_lightsteelblue3[] = "lightsteelblue3"; static const char __pyx_k_lightsteelblue4[] = "lightsteelblue4"; static const char __pyx_k_mediumslateblue[] = "mediumslateblue"; static const char __pyx_k_mediumturquoise[] = "mediumturquoise"; static const char __pyx_k_mediumvioletred[] = "mediumvioletred"; static const char __pyx_k_Color___setstate[] = "Color.__setstate__"; static const char __pyx_k_Color_set_length[] = "Color.set_length"; static const char __pyx_k_Expected_a_color[] = "Expected a color."; static const char __pyx_k_mediumaquamarine[] = "mediumaquamarine"; static const char __pyx_k_mod___locals_mod[] = "__mod__..mod"; static const char __pyx_k_mediumspringgreen[] = "mediumspringgreen"; static const char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Color_correct_gamma[] = "Color.correct_gamma"; static const char __pyx_k_lightgoldenrodyellow[] = "lightgoldenrodyellow"; static const char __pyx_k_floordiv___locals_div[] = "__floordiv__..div"; static const char __pyx_k_src_pygame_sdl2_color_pyx[] = "src/pygame_sdl2/color.pyx"; static const char __pyx_k_correct_gamma_locals_lambda[] = "correct_gamma.."; static const char __pyx_k_Color_from_hex_locals_lambda[] = "Color.from_hex.."; /* #### Code section: decls ### */ static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color___richcmp__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_2__cinit__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_4__init__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6__repr__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_8__int__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ #endif static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_14__float__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_16__reduce__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_18__setstate__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_d); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_20__setitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_22__getitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static Py_ssize_t __pyx_pf_11pygame_sdl2_5color_5Color_24__len__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_26__mul__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_28__add__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_30__sub__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_r); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_32__mod__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_34__div__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ #endif static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_36__floordiv__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_3cmy___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_3cmy_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsva___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsva_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsla___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsla_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_38normalize(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_40correct_gamma(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_gamma); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_42set_length(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1r___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1r_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1g___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1g_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1b___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1b_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1a___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1a_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_5color_Color(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_5color_Color; PyObject *__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color; PyTypeObject *__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma; PyObject *__pyx_kp_s_08x; PyObject *__pyx_kp_s_0x; PyObject *__pyx_n_s_BBB; PyObject *__pyx_n_s_BBBB; PyObject *__pyx_n_s_Color; PyObject *__pyx_n_s_Color___reduce; PyObject *__pyx_n_s_Color___setstate; PyObject *__pyx_n_s_Color_correct_gamma; PyObject *__pyx_n_s_Color_from_hex_locals_lambda; PyObject *__pyx_n_s_Color_normalize; PyObject *__pyx_n_s_Color_set_length; PyObject *__pyx_kp_s_Expected_a_color; PyObject *__pyx_n_s_IndexError; PyObject *__pyx_n_s_KeyError; PyObject *__pyx_kp_s_L; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s__10; PyObject *__pyx_kp_s__2; PyObject *__pyx_kp_s__3; PyObject *__pyx_n_s__523; PyObject *__pyx_n_s_a; PyObject *__pyx_n_s_aliceblue; PyObject *__pyx_n_s_antiquewhite; PyObject *__pyx_n_s_antiquewhite1; PyObject *__pyx_n_s_antiquewhite2; PyObject *__pyx_n_s_antiquewhite3; PyObject *__pyx_n_s_antiquewhite4; PyObject *__pyx_n_s_aquamarine; PyObject *__pyx_n_s_aquamarine1; PyObject *__pyx_n_s_aquamarine2; PyObject *__pyx_n_s_aquamarine3; PyObject *__pyx_n_s_aquamarine4; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_azure; PyObject *__pyx_n_s_azure1; PyObject *__pyx_n_s_azure2; PyObject *__pyx_n_s_azure3; PyObject *__pyx_n_s_azure4; PyObject *__pyx_n_s_b; PyObject *__pyx_n_s_beige; PyObject *__pyx_n_s_binascii; PyObject *__pyx_n_s_bisque; PyObject *__pyx_n_s_bisque1; PyObject *__pyx_n_s_bisque2; PyObject *__pyx_n_s_bisque3; PyObject *__pyx_n_s_bisque4; PyObject *__pyx_n_s_black; PyObject *__pyx_n_s_blanchedalmond; PyObject *__pyx_n_s_blue; PyObject *__pyx_n_s_blue1; PyObject *__pyx_n_s_blue2; PyObject *__pyx_n_s_blue3; PyObject *__pyx_n_s_blue4; PyObject *__pyx_n_s_blueviolet; PyObject *__pyx_n_s_brown; PyObject *__pyx_n_s_brown1; PyObject *__pyx_n_s_brown2; PyObject *__pyx_n_s_brown3; PyObject *__pyx_n_s_brown4; PyObject *__pyx_n_s_burlywood; PyObject *__pyx_n_s_burlywood1; PyObject *__pyx_n_s_burlywood2; PyObject *__pyx_n_s_burlywood3; PyObject *__pyx_n_s_burlywood4; PyObject *__pyx_n_s_c; PyObject *__pyx_n_s_cadetblue; PyObject *__pyx_n_s_cadetblue1; PyObject *__pyx_n_s_cadetblue2; PyObject *__pyx_n_s_cadetblue3; PyObject *__pyx_n_s_cadetblue4; PyObject *__pyx_n_s_chartreuse; PyObject *__pyx_n_s_chartreuse1; PyObject *__pyx_n_s_chartreuse2; PyObject *__pyx_n_s_chartreuse3; PyObject *__pyx_n_s_chartreuse4; PyObject *__pyx_n_s_chocolate; PyObject *__pyx_n_s_chocolate1; PyObject *__pyx_n_s_chocolate2; PyObject *__pyx_n_s_chocolate3; PyObject *__pyx_n_s_chocolate4; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_coral; PyObject *__pyx_n_s_coral1; PyObject *__pyx_n_s_coral2; PyObject *__pyx_n_s_coral3; PyObject *__pyx_n_s_coral4; PyObject *__pyx_n_s_cornflowerblue; PyObject *__pyx_n_s_cornsilk; PyObject *__pyx_n_s_cornsilk1; PyObject *__pyx_n_s_cornsilk2; PyObject *__pyx_n_s_cornsilk3; PyObject *__pyx_n_s_cornsilk4; PyObject *__pyx_n_s_correct_gamma; PyObject *__pyx_n_s_correct_gamma_locals_lambda; PyObject *__pyx_n_s_cyan; PyObject *__pyx_n_s_cyan1; PyObject *__pyx_n_s_cyan2; PyObject *__pyx_n_s_cyan3; PyObject *__pyx_n_s_cyan4; PyObject *__pyx_n_s_d; PyObject *__pyx_n_s_darkblue; PyObject *__pyx_n_s_darkcyan; PyObject *__pyx_n_s_darkgoldenrod; PyObject *__pyx_n_s_darkgoldenrod1; PyObject *__pyx_n_s_darkgoldenrod2; PyObject *__pyx_n_s_darkgoldenrod3; PyObject *__pyx_n_s_darkgoldenrod4; PyObject *__pyx_n_s_darkgray; PyObject *__pyx_n_s_darkgreen; PyObject *__pyx_n_s_darkgrey; PyObject *__pyx_n_s_darkkhaki; PyObject *__pyx_n_s_darkmagenta; PyObject *__pyx_n_s_darkolivegreen; PyObject *__pyx_n_s_darkolivegreen1; PyObject *__pyx_n_s_darkolivegreen2; PyObject *__pyx_n_s_darkolivegreen3; PyObject *__pyx_n_s_darkolivegreen4; PyObject *__pyx_n_s_darkorange; PyObject *__pyx_n_s_darkorange1; PyObject *__pyx_n_s_darkorange2; PyObject *__pyx_n_s_darkorange3; PyObject *__pyx_n_s_darkorange4; PyObject *__pyx_n_s_darkorchid; PyObject *__pyx_n_s_darkorchid1; PyObject *__pyx_n_s_darkorchid2; PyObject *__pyx_n_s_darkorchid3; PyObject *__pyx_n_s_darkorchid4; PyObject *__pyx_n_s_darkred; PyObject *__pyx_n_s_darksalmon; PyObject *__pyx_n_s_darkseagreen; PyObject *__pyx_n_s_darkseagreen1; PyObject *__pyx_n_s_darkseagreen2; PyObject *__pyx_n_s_darkseagreen3; PyObject *__pyx_n_s_darkseagreen4; PyObject *__pyx_n_s_darkslateblue; PyObject *__pyx_n_s_darkslategray; PyObject *__pyx_n_s_darkslategray1; PyObject *__pyx_n_s_darkslategray2; PyObject *__pyx_n_s_darkslategray3; PyObject *__pyx_n_s_darkslategray4; PyObject *__pyx_n_s_darkslategrey; PyObject *__pyx_n_s_darkturquoise; PyObject *__pyx_n_s_darkviolet; PyObject *__pyx_n_s_debianred; PyObject *__pyx_n_s_deeppink; PyObject *__pyx_n_s_deeppink1; PyObject *__pyx_n_s_deeppink2; PyObject *__pyx_n_s_deeppink3; PyObject *__pyx_n_s_deeppink4; PyObject *__pyx_n_s_deepskyblue; PyObject *__pyx_n_s_deepskyblue1; PyObject *__pyx_n_s_deepskyblue2; PyObject *__pyx_n_s_deepskyblue3; PyObject *__pyx_n_s_deepskyblue4; PyObject *__pyx_n_s_dimgray; PyObject *__pyx_n_s_dimgrey; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_div; PyObject *__pyx_n_s_dodgerblue; PyObject *__pyx_n_s_dodgerblue1; PyObject *__pyx_n_s_dodgerblue2; PyObject *__pyx_n_s_dodgerblue3; PyObject *__pyx_n_s_dodgerblue4; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_firebrick; PyObject *__pyx_n_s_firebrick1; PyObject *__pyx_n_s_firebrick2; PyObject *__pyx_n_s_firebrick3; PyObject *__pyx_n_s_firebrick4; PyObject *__pyx_n_s_floordiv___locals_div; PyObject *__pyx_n_s_floralwhite; PyObject *__pyx_n_s_forestgreen; PyObject *__pyx_n_s_g; PyObject *__pyx_n_s_gainsboro; PyObject *__pyx_n_s_gamma; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_ghostwhite; PyObject *__pyx_n_s_gold; PyObject *__pyx_n_s_gold1; PyObject *__pyx_n_s_gold2; PyObject *__pyx_n_s_gold3; PyObject *__pyx_n_s_gold4; PyObject *__pyx_n_s_goldenrod; PyObject *__pyx_n_s_goldenrod1; PyObject *__pyx_n_s_goldenrod2; PyObject *__pyx_n_s_goldenrod3; PyObject *__pyx_n_s_goldenrod4; PyObject *__pyx_n_s_gray; PyObject *__pyx_n_s_gray0; PyObject *__pyx_n_s_gray1; PyObject *__pyx_n_s_gray10; PyObject *__pyx_n_s_gray100; PyObject *__pyx_n_s_gray11; PyObject *__pyx_n_s_gray12; PyObject *__pyx_n_s_gray13; PyObject *__pyx_n_s_gray14; PyObject *__pyx_n_s_gray15; PyObject *__pyx_n_s_gray16; PyObject *__pyx_n_s_gray17; PyObject *__pyx_n_s_gray18; PyObject *__pyx_n_s_gray19; PyObject *__pyx_n_s_gray2; PyObject *__pyx_n_s_gray20; PyObject *__pyx_n_s_gray21; PyObject *__pyx_n_s_gray22; PyObject *__pyx_n_s_gray23; PyObject *__pyx_n_s_gray24; PyObject *__pyx_n_s_gray25; PyObject *__pyx_n_s_gray26; PyObject *__pyx_n_s_gray27; PyObject *__pyx_n_s_gray28; PyObject *__pyx_n_s_gray29; PyObject *__pyx_n_s_gray3; PyObject *__pyx_n_s_gray30; PyObject *__pyx_n_s_gray31; PyObject *__pyx_n_s_gray32; PyObject *__pyx_n_s_gray33; PyObject *__pyx_n_s_gray34; PyObject *__pyx_n_s_gray35; PyObject *__pyx_n_s_gray36; PyObject *__pyx_n_s_gray37; PyObject *__pyx_n_s_gray38; PyObject *__pyx_n_s_gray39; PyObject *__pyx_n_s_gray4; PyObject *__pyx_n_s_gray40; PyObject *__pyx_n_s_gray41; PyObject *__pyx_n_s_gray42; PyObject *__pyx_n_s_gray43; PyObject *__pyx_n_s_gray44; PyObject *__pyx_n_s_gray45; PyObject *__pyx_n_s_gray46; PyObject *__pyx_n_s_gray47; PyObject *__pyx_n_s_gray48; PyObject *__pyx_n_s_gray49; PyObject *__pyx_n_s_gray5; PyObject *__pyx_n_s_gray50; PyObject *__pyx_n_s_gray51; PyObject *__pyx_n_s_gray52; PyObject *__pyx_n_s_gray53; PyObject *__pyx_n_s_gray54; PyObject *__pyx_n_s_gray55; PyObject *__pyx_n_s_gray56; PyObject *__pyx_n_s_gray57; PyObject *__pyx_n_s_gray58; PyObject *__pyx_n_s_gray59; PyObject *__pyx_n_s_gray6; PyObject *__pyx_n_s_gray60; PyObject *__pyx_n_s_gray61; PyObject *__pyx_n_s_gray62; PyObject *__pyx_n_s_gray63; PyObject *__pyx_n_s_gray64; PyObject *__pyx_n_s_gray65; PyObject *__pyx_n_s_gray66; PyObject *__pyx_n_s_gray67; PyObject *__pyx_n_s_gray68; PyObject *__pyx_n_s_gray69; PyObject *__pyx_n_s_gray7; PyObject *__pyx_n_s_gray70; PyObject *__pyx_n_s_gray71; PyObject *__pyx_n_s_gray72; PyObject *__pyx_n_s_gray73; PyObject *__pyx_n_s_gray74; PyObject *__pyx_n_s_gray75; PyObject *__pyx_n_s_gray76; PyObject *__pyx_n_s_gray77; PyObject *__pyx_n_s_gray78; PyObject *__pyx_n_s_gray79; PyObject *__pyx_n_s_gray8; PyObject *__pyx_n_s_gray80; PyObject *__pyx_n_s_gray81; PyObject *__pyx_n_s_gray82; PyObject *__pyx_n_s_gray83; PyObject *__pyx_n_s_gray84; PyObject *__pyx_n_s_gray85; PyObject *__pyx_n_s_gray86; PyObject *__pyx_n_s_gray87; PyObject *__pyx_n_s_gray88; PyObject *__pyx_n_s_gray89; PyObject *__pyx_n_s_gray9; PyObject *__pyx_n_s_gray90; PyObject *__pyx_n_s_gray91; PyObject *__pyx_n_s_gray92; PyObject *__pyx_n_s_gray93; PyObject *__pyx_n_s_gray94; PyObject *__pyx_n_s_gray95; PyObject *__pyx_n_s_gray96; PyObject *__pyx_n_s_gray97; PyObject *__pyx_n_s_gray98; PyObject *__pyx_n_s_gray99; PyObject *__pyx_n_s_green; PyObject *__pyx_n_s_green1; PyObject *__pyx_n_s_green2; PyObject *__pyx_n_s_green3; PyObject *__pyx_n_s_green4; PyObject *__pyx_n_s_greenyellow; PyObject *__pyx_n_s_grey; PyObject *__pyx_n_s_grey0; PyObject *__pyx_n_s_grey1; PyObject *__pyx_n_s_grey10; PyObject *__pyx_n_s_grey100; PyObject *__pyx_n_s_grey11; PyObject *__pyx_n_s_grey12; PyObject *__pyx_n_s_grey13; PyObject *__pyx_n_s_grey14; PyObject *__pyx_n_s_grey15; PyObject *__pyx_n_s_grey16; PyObject *__pyx_n_s_grey17; PyObject *__pyx_n_s_grey18; PyObject *__pyx_n_s_grey19; PyObject *__pyx_n_s_grey2; PyObject *__pyx_n_s_grey20; PyObject *__pyx_n_s_grey21; PyObject *__pyx_n_s_grey22; PyObject *__pyx_n_s_grey23; PyObject *__pyx_n_s_grey24; PyObject *__pyx_n_s_grey25; PyObject *__pyx_n_s_grey26; PyObject *__pyx_n_s_grey27; PyObject *__pyx_n_s_grey28; PyObject *__pyx_n_s_grey29; PyObject *__pyx_n_s_grey3; PyObject *__pyx_n_s_grey30; PyObject *__pyx_n_s_grey31; PyObject *__pyx_n_s_grey32; PyObject *__pyx_n_s_grey33; PyObject *__pyx_n_s_grey34; PyObject *__pyx_n_s_grey35; PyObject *__pyx_n_s_grey36; PyObject *__pyx_n_s_grey37; PyObject *__pyx_n_s_grey38; PyObject *__pyx_n_s_grey39; PyObject *__pyx_n_s_grey4; PyObject *__pyx_n_s_grey40; PyObject *__pyx_n_s_grey41; PyObject *__pyx_n_s_grey42; PyObject *__pyx_n_s_grey43; PyObject *__pyx_n_s_grey44; PyObject *__pyx_n_s_grey45; PyObject *__pyx_n_s_grey46; PyObject *__pyx_n_s_grey47; PyObject *__pyx_n_s_grey48; PyObject *__pyx_n_s_grey49; PyObject *__pyx_n_s_grey5; PyObject *__pyx_n_s_grey50; PyObject *__pyx_n_s_grey51; PyObject *__pyx_n_s_grey52; PyObject *__pyx_n_s_grey53; PyObject *__pyx_n_s_grey54; PyObject *__pyx_n_s_grey55; PyObject *__pyx_n_s_grey56; PyObject *__pyx_n_s_grey57; PyObject *__pyx_n_s_grey58; PyObject *__pyx_n_s_grey59; PyObject *__pyx_n_s_grey6; PyObject *__pyx_n_s_grey60; PyObject *__pyx_n_s_grey61; PyObject *__pyx_n_s_grey62; PyObject *__pyx_n_s_grey63; PyObject *__pyx_n_s_grey64; PyObject *__pyx_n_s_grey65; PyObject *__pyx_n_s_grey66; PyObject *__pyx_n_s_grey67; PyObject *__pyx_n_s_grey68; PyObject *__pyx_n_s_grey69; PyObject *__pyx_n_s_grey7; PyObject *__pyx_n_s_grey70; PyObject *__pyx_n_s_grey71; PyObject *__pyx_n_s_grey72; PyObject *__pyx_n_s_grey73; PyObject *__pyx_n_s_grey74; PyObject *__pyx_n_s_grey75; PyObject *__pyx_n_s_grey76; PyObject *__pyx_n_s_grey77; PyObject *__pyx_n_s_grey78; PyObject *__pyx_n_s_grey79; PyObject *__pyx_n_s_grey8; PyObject *__pyx_n_s_grey80; PyObject *__pyx_n_s_grey81; PyObject *__pyx_n_s_grey82; PyObject *__pyx_n_s_grey83; PyObject *__pyx_n_s_grey84; PyObject *__pyx_n_s_grey85; PyObject *__pyx_n_s_grey86; PyObject *__pyx_n_s_grey87; PyObject *__pyx_n_s_grey88; PyObject *__pyx_n_s_grey89; PyObject *__pyx_n_s_grey9; PyObject *__pyx_n_s_grey90; PyObject *__pyx_n_s_grey91; PyObject *__pyx_n_s_grey92; PyObject *__pyx_n_s_grey93; PyObject *__pyx_n_s_grey94; PyObject *__pyx_n_s_grey95; PyObject *__pyx_n_s_grey96; PyObject *__pyx_n_s_grey97; PyObject *__pyx_n_s_grey98; PyObject *__pyx_n_s_grey99; PyObject *__pyx_n_s_hex; PyObject *__pyx_n_s_honeydew; PyObject *__pyx_n_s_honeydew1; PyObject *__pyx_n_s_honeydew2; PyObject *__pyx_n_s_honeydew3; PyObject *__pyx_n_s_honeydew4; PyObject *__pyx_n_s_hotpink; PyObject *__pyx_n_s_hotpink1; PyObject *__pyx_n_s_hotpink2; PyObject *__pyx_n_s_hotpink3; PyObject *__pyx_n_s_hotpink4; PyObject *__pyx_n_s_hsva; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_indianred; PyObject *__pyx_n_s_indianred1; PyObject *__pyx_n_s_indianred2; PyObject *__pyx_n_s_indianred3; PyObject *__pyx_n_s_indianred4; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_ivory; PyObject *__pyx_n_s_ivory1; PyObject *__pyx_n_s_ivory2; PyObject *__pyx_n_s_ivory3; PyObject *__pyx_n_s_ivory4; PyObject *__pyx_n_s_join; PyObject *__pyx_n_s_khaki; PyObject *__pyx_n_s_khaki1; PyObject *__pyx_n_s_khaki2; PyObject *__pyx_n_s_khaki3; PyObject *__pyx_n_s_khaki4; PyObject *__pyx_n_s_l; PyObject *__pyx_n_s_lavender; PyObject *__pyx_n_s_lavenderblush; PyObject *__pyx_n_s_lavenderblush1; PyObject *__pyx_n_s_lavenderblush2; PyObject *__pyx_n_s_lavenderblush3; PyObject *__pyx_n_s_lavenderblush4; PyObject *__pyx_n_s_lawngreen; PyObject *__pyx_n_s_lemonchiffon; PyObject *__pyx_n_s_lemonchiffon1; PyObject *__pyx_n_s_lemonchiffon2; PyObject *__pyx_n_s_lemonchiffon3; PyObject *__pyx_n_s_lemonchiffon4; PyObject *__pyx_n_s_lightblue; PyObject *__pyx_n_s_lightblue1; PyObject *__pyx_n_s_lightblue2; PyObject *__pyx_n_s_lightblue3; PyObject *__pyx_n_s_lightblue4; PyObject *__pyx_n_s_lightcoral; PyObject *__pyx_n_s_lightcyan; PyObject *__pyx_n_s_lightcyan1; PyObject *__pyx_n_s_lightcyan2; PyObject *__pyx_n_s_lightcyan3; PyObject *__pyx_n_s_lightcyan4; PyObject *__pyx_n_s_lightgoldenrod; PyObject *__pyx_n_s_lightgoldenrod1; PyObject *__pyx_n_s_lightgoldenrod2; PyObject *__pyx_n_s_lightgoldenrod3; PyObject *__pyx_n_s_lightgoldenrod4; PyObject *__pyx_n_s_lightgoldenrodyellow; PyObject *__pyx_n_s_lightgray; PyObject *__pyx_n_s_lightgreen; PyObject *__pyx_n_s_lightgrey; PyObject *__pyx_n_s_lightpink; PyObject *__pyx_n_s_lightpink1; PyObject *__pyx_n_s_lightpink2; PyObject *__pyx_n_s_lightpink3; PyObject *__pyx_n_s_lightpink4; PyObject *__pyx_n_s_lightsalmon; PyObject *__pyx_n_s_lightsalmon1; PyObject *__pyx_n_s_lightsalmon2; PyObject *__pyx_n_s_lightsalmon3; PyObject *__pyx_n_s_lightsalmon4; PyObject *__pyx_n_s_lightseagreen; PyObject *__pyx_n_s_lightskyblue; PyObject *__pyx_n_s_lightskyblue1; PyObject *__pyx_n_s_lightskyblue2; PyObject *__pyx_n_s_lightskyblue3; PyObject *__pyx_n_s_lightskyblue4; PyObject *__pyx_n_s_lightslateblue; PyObject *__pyx_n_s_lightslategray; PyObject *__pyx_n_s_lightslategrey; PyObject *__pyx_n_s_lightsteelblue; PyObject *__pyx_n_s_lightsteelblue1; PyObject *__pyx_n_s_lightsteelblue2; PyObject *__pyx_n_s_lightsteelblue3; PyObject *__pyx_n_s_lightsteelblue4; PyObject *__pyx_n_s_lightyellow; PyObject *__pyx_n_s_lightyellow1; PyObject *__pyx_n_s_lightyellow2; PyObject *__pyx_n_s_lightyellow3; PyObject *__pyx_n_s_lightyellow4; PyObject *__pyx_n_s_limegreen; PyObject *__pyx_n_s_linen; PyObject *__pyx_n_s_lower; PyObject *__pyx_n_s_m; PyObject *__pyx_n_s_magenta; PyObject *__pyx_n_s_magenta1; PyObject *__pyx_n_s_magenta2; PyObject *__pyx_n_s_magenta3; PyObject *__pyx_n_s_magenta4; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_map; PyObject *__pyx_n_s_maroon; PyObject *__pyx_n_s_maroon1; PyObject *__pyx_n_s_maroon2; PyObject *__pyx_n_s_maroon3; PyObject *__pyx_n_s_maroon4; PyObject *__pyx_n_s_mediumaquamarine; PyObject *__pyx_n_s_mediumblue; PyObject *__pyx_n_s_mediumorchid; PyObject *__pyx_n_s_mediumorchid1; PyObject *__pyx_n_s_mediumorchid2; PyObject *__pyx_n_s_mediumorchid3; PyObject *__pyx_n_s_mediumorchid4; PyObject *__pyx_n_s_mediumpurple; PyObject *__pyx_n_s_mediumpurple1; PyObject *__pyx_n_s_mediumpurple2; PyObject *__pyx_n_s_mediumpurple3; PyObject *__pyx_n_s_mediumpurple4; PyObject *__pyx_n_s_mediumseagreen; PyObject *__pyx_n_s_mediumslateblue; PyObject *__pyx_n_s_mediumspringgreen; PyObject *__pyx_n_s_mediumturquoise; PyObject *__pyx_n_s_mediumvioletred; PyObject *__pyx_n_s_midnightblue; PyObject *__pyx_n_s_mintcream; PyObject *__pyx_n_s_mistyrose; PyObject *__pyx_n_s_mistyrose1; PyObject *__pyx_n_s_mistyrose2; PyObject *__pyx_n_s_mistyrose3; PyObject *__pyx_n_s_mistyrose4; PyObject *__pyx_n_s_moccasin; PyObject *__pyx_n_s_mod; PyObject *__pyx_n_s_mod___locals_mod; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_navajowhite; PyObject *__pyx_n_s_navajowhite1; PyObject *__pyx_n_s_navajowhite2; PyObject *__pyx_n_s_navajowhite3; PyObject *__pyx_n_s_navajowhite4; PyObject *__pyx_n_s_navy; PyObject *__pyx_n_s_navyblue; PyObject *__pyx_n_s_normalize; PyObject *__pyx_n_s_oct; PyObject *__pyx_n_s_oldlace; PyObject *__pyx_n_s_olivedrab; PyObject *__pyx_n_s_olivedrab1; PyObject *__pyx_n_s_olivedrab2; PyObject *__pyx_n_s_olivedrab3; PyObject *__pyx_n_s_olivedrab4; PyObject *__pyx_n_s_orange; PyObject *__pyx_n_s_orange1; PyObject *__pyx_n_s_orange2; PyObject *__pyx_n_s_orange3; PyObject *__pyx_n_s_orange4; PyObject *__pyx_n_s_orangered; PyObject *__pyx_n_s_orangered1; PyObject *__pyx_n_s_orangered2; PyObject *__pyx_n_s_orangered3; PyObject *__pyx_n_s_orangered4; PyObject *__pyx_n_s_orchid; PyObject *__pyx_n_s_orchid1; PyObject *__pyx_n_s_orchid2; PyObject *__pyx_n_s_orchid3; PyObject *__pyx_n_s_orchid4; PyObject *__pyx_n_s_pack; PyObject *__pyx_n_s_palegoldenrod; PyObject *__pyx_n_s_palegreen; PyObject *__pyx_n_s_palegreen1; PyObject *__pyx_n_s_palegreen2; PyObject *__pyx_n_s_palegreen3; PyObject *__pyx_n_s_palegreen4; PyObject *__pyx_n_s_paleturquoise; PyObject *__pyx_n_s_paleturquoise1; PyObject *__pyx_n_s_paleturquoise2; PyObject *__pyx_n_s_paleturquoise3; PyObject *__pyx_n_s_paleturquoise4; PyObject *__pyx_n_s_palevioletred; PyObject *__pyx_n_s_palevioletred1; PyObject *__pyx_n_s_palevioletred2; PyObject *__pyx_n_s_palevioletred3; PyObject *__pyx_n_s_palevioletred4; PyObject *__pyx_n_s_papayawhip; PyObject *__pyx_n_s_peachpuff; PyObject *__pyx_n_s_peachpuff1; PyObject *__pyx_n_s_peachpuff2; PyObject *__pyx_n_s_peachpuff3; PyObject *__pyx_n_s_peachpuff4; PyObject *__pyx_n_s_peru; PyObject *__pyx_n_s_pink; PyObject *__pyx_n_s_pink1; PyObject *__pyx_n_s_pink2; PyObject *__pyx_n_s_pink3; PyObject *__pyx_n_s_pink4; PyObject *__pyx_n_s_plum; PyObject *__pyx_n_s_plum1; PyObject *__pyx_n_s_plum2; PyObject *__pyx_n_s_plum3; PyObject *__pyx_n_s_plum4; PyObject *__pyx_n_s_powderblue; PyObject *__pyx_n_s_purple; PyObject *__pyx_n_s_purple1; PyObject *__pyx_n_s_purple2; PyObject *__pyx_n_s_purple3; PyObject *__pyx_n_s_purple4; PyObject *__pyx_n_s_pygame_sdl2_color; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_red; PyObject *__pyx_n_s_red1; PyObject *__pyx_n_s_red2; PyObject *__pyx_n_s_red3; PyObject *__pyx_n_s_red4; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_rgba; PyObject *__pyx_n_s_rosybrown; PyObject *__pyx_n_s_rosybrown1; PyObject *__pyx_n_s_rosybrown2; PyObject *__pyx_n_s_rosybrown3; PyObject *__pyx_n_s_rosybrown4; PyObject *__pyx_n_s_round; PyObject *__pyx_n_s_royalblue; PyObject *__pyx_n_s_royalblue1; PyObject *__pyx_n_s_royalblue2; PyObject *__pyx_n_s_royalblue3; PyObject *__pyx_n_s_royalblue4; PyObject *__pyx_n_s_saddlebrown; PyObject *__pyx_n_s_salmon; PyObject *__pyx_n_s_salmon1; PyObject *__pyx_n_s_salmon2; PyObject *__pyx_n_s_salmon3; PyObject *__pyx_n_s_salmon4; PyObject *__pyx_n_s_sandybrown; PyObject *__pyx_n_s_seagreen; PyObject *__pyx_n_s_seagreen1; PyObject *__pyx_n_s_seagreen2; PyObject *__pyx_n_s_seagreen3; PyObject *__pyx_n_s_seagreen4; PyObject *__pyx_n_s_seashell; PyObject *__pyx_n_s_seashell1; PyObject *__pyx_n_s_seashell2; PyObject *__pyx_n_s_seashell3; PyObject *__pyx_n_s_seashell4; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_length; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_sienna; PyObject *__pyx_n_s_sienna1; PyObject *__pyx_n_s_sienna2; PyObject *__pyx_n_s_sienna3; PyObject *__pyx_n_s_sienna4; PyObject *__pyx_n_s_skyblue; PyObject *__pyx_n_s_skyblue1; PyObject *__pyx_n_s_skyblue2; PyObject *__pyx_n_s_skyblue3; PyObject *__pyx_n_s_skyblue4; PyObject *__pyx_n_s_slateblue; PyObject *__pyx_n_s_slateblue1; PyObject *__pyx_n_s_slateblue2; PyObject *__pyx_n_s_slateblue3; PyObject *__pyx_n_s_slateblue4; PyObject *__pyx_n_s_slategray; PyObject *__pyx_n_s_slategray1; PyObject *__pyx_n_s_slategray2; PyObject *__pyx_n_s_slategray3; PyObject *__pyx_n_s_slategray4; PyObject *__pyx_n_s_slategrey; PyObject *__pyx_n_s_snow; PyObject *__pyx_n_s_snow1; PyObject *__pyx_n_s_snow2; PyObject *__pyx_n_s_snow3; PyObject *__pyx_n_s_snow4; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_split; PyObject *__pyx_n_s_springgreen; PyObject *__pyx_n_s_springgreen1; PyObject *__pyx_n_s_springgreen2; PyObject *__pyx_n_s_springgreen3; PyObject *__pyx_n_s_springgreen4; PyObject *__pyx_kp_s_src_pygame_sdl2_color_pyx; PyObject *__pyx_n_s_startswith; PyObject *__pyx_n_s_steelblue; PyObject *__pyx_n_s_steelblue1; PyObject *__pyx_n_s_steelblue2; PyObject *__pyx_n_s_steelblue3; PyObject *__pyx_n_s_steelblue4; PyObject *__pyx_n_s_struct; PyObject *__pyx_n_s_tan; PyObject *__pyx_n_s_tan1; PyObject *__pyx_n_s_tan2; PyObject *__pyx_n_s_tan3; PyObject *__pyx_n_s_tan4; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_thistle; PyObject *__pyx_n_s_thistle1; PyObject *__pyx_n_s_thistle2; PyObject *__pyx_n_s_thistle3; PyObject *__pyx_n_s_thistle4; PyObject *__pyx_n_s_tomato; PyObject *__pyx_n_s_tomato1; PyObject *__pyx_n_s_tomato2; PyObject *__pyx_n_s_tomato3; PyObject *__pyx_n_s_tomato4; PyObject *__pyx_n_s_turquoise; PyObject *__pyx_n_s_turquoise1; PyObject *__pyx_n_s_turquoise2; PyObject *__pyx_n_s_turquoise3; PyObject *__pyx_n_s_turquoise4; PyObject *__pyx_n_s_unhexlify; PyObject *__pyx_n_s_unpack; PyObject *__pyx_n_s_violet; PyObject *__pyx_n_s_violetred; PyObject *__pyx_n_s_violetred1; PyObject *__pyx_n_s_violetred2; PyObject *__pyx_n_s_violetred3; PyObject *__pyx_n_s_violetred4; PyObject *__pyx_n_s_wheat; PyObject *__pyx_n_s_wheat1; PyObject *__pyx_n_s_wheat2; PyObject *__pyx_n_s_wheat3; PyObject *__pyx_n_s_wheat4; PyObject *__pyx_n_s_white; PyObject *__pyx_n_s_whitesmoke; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_yellow; PyObject *__pyx_n_s_yellow1; PyObject *__pyx_n_s_yellow2; PyObject *__pyx_n_s_yellow3; PyObject *__pyx_n_s_yellow4; PyObject *__pyx_n_s_yellowgreen; PyObject *__pyx_float_255_0; PyObject *__pyx_float_360_0; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_2; PyObject *__pyx_int_3; PyObject *__pyx_int_4; PyObject *__pyx_int_5; PyObject *__pyx_int_7; PyObject *__pyx_int_8; PyObject *__pyx_int_10; PyObject *__pyx_int_11; PyObject *__pyx_int_12; PyObject *__pyx_int_13; PyObject *__pyx_int_14; PyObject *__pyx_int_15; PyObject *__pyx_int_16; PyObject *__pyx_int_18; PyObject *__pyx_int_19; PyObject *__pyx_int_20; PyObject *__pyx_int_21; PyObject *__pyx_int_23; PyObject *__pyx_int_24; PyObject *__pyx_int_25; PyObject *__pyx_int_26; PyObject *__pyx_int_28; PyObject *__pyx_int_29; PyObject *__pyx_int_30; PyObject *__pyx_int_31; PyObject *__pyx_int_32; PyObject *__pyx_int_33; PyObject *__pyx_int_34; PyObject *__pyx_int_35; PyObject *__pyx_int_36; PyObject *__pyx_int_37; PyObject *__pyx_int_38; PyObject *__pyx_int_39; PyObject *__pyx_int_41; PyObject *__pyx_int_42; PyObject *__pyx_int_43; PyObject *__pyx_int_44; PyObject *__pyx_int_45; PyObject *__pyx_int_46; PyObject *__pyx_int_47; PyObject *__pyx_int_48; PyObject *__pyx_int_50; PyObject *__pyx_int_51; PyObject *__pyx_int_52; PyObject *__pyx_int_54; PyObject *__pyx_int_55; PyObject *__pyx_int_56; PyObject *__pyx_int_57; PyObject *__pyx_int_58; PyObject *__pyx_int_59; PyObject *__pyx_int_60; PyObject *__pyx_int_61; PyObject *__pyx_int_62; PyObject *__pyx_int_63; PyObject *__pyx_int_64; PyObject *__pyx_int_65; PyObject *__pyx_int_66; PyObject *__pyx_int_67; PyObject *__pyx_int_69; PyObject *__pyx_int_70; PyObject *__pyx_int_71; PyObject *__pyx_int_72; PyObject *__pyx_int_73; PyObject *__pyx_int_74; PyObject *__pyx_int_76; PyObject *__pyx_int_77; PyObject *__pyx_int_78; PyObject *__pyx_int_79; PyObject *__pyx_int_80; PyObject *__pyx_int_81; PyObject *__pyx_int_82; PyObject *__pyx_int_83; PyObject *__pyx_int_84; PyObject *__pyx_int_85; PyObject *__pyx_int_86; PyObject *__pyx_int_87; PyObject *__pyx_int_89; PyObject *__pyx_int_90; PyObject *__pyx_int_91; PyObject *__pyx_int_92; PyObject *__pyx_int_93; PyObject *__pyx_int_94; PyObject *__pyx_int_95; PyObject *__pyx_int_96; PyObject *__pyx_int_97; PyObject *__pyx_int_98; PyObject *__pyx_int_99; PyObject *__pyx_int_100; PyObject *__pyx_int_101; PyObject *__pyx_int_102; PyObject *__pyx_int_103; PyObject *__pyx_int_104; PyObject *__pyx_int_105; PyObject *__pyx_int_106; PyObject *__pyx_int_107; PyObject *__pyx_int_108; PyObject *__pyx_int_110; PyObject *__pyx_int_111; PyObject *__pyx_int_112; PyObject *__pyx_int_113; PyObject *__pyx_int_114; PyObject *__pyx_int_115; PyObject *__pyx_int_116; PyObject *__pyx_int_117; PyObject *__pyx_int_118; PyObject *__pyx_int_119; PyObject *__pyx_int_120; PyObject *__pyx_int_121; PyObject *__pyx_int_122; PyObject *__pyx_int_123; PyObject *__pyx_int_124; PyObject *__pyx_int_125; PyObject *__pyx_int_126; PyObject *__pyx_int_127; PyObject *__pyx_int_128; PyObject *__pyx_int_129; PyObject *__pyx_int_130; PyObject *__pyx_int_131; PyObject *__pyx_int_132; PyObject *__pyx_int_133; PyObject *__pyx_int_134; PyObject *__pyx_int_135; PyObject *__pyx_int_136; PyObject *__pyx_int_137; PyObject *__pyx_int_138; PyObject *__pyx_int_139; PyObject *__pyx_int_140; PyObject *__pyx_int_141; PyObject *__pyx_int_142; PyObject *__pyx_int_143; PyObject *__pyx_int_144; PyObject *__pyx_int_145; PyObject *__pyx_int_147; PyObject *__pyx_int_148; PyObject *__pyx_int_149; PyObject *__pyx_int_150; PyObject *__pyx_int_151; PyObject *__pyx_int_152; PyObject *__pyx_int_153; PyObject *__pyx_int_154; PyObject *__pyx_int_155; PyObject *__pyx_int_156; PyObject *__pyx_int_158; PyObject *__pyx_int_159; PyObject *__pyx_int_160; PyObject *__pyx_int_161; PyObject *__pyx_int_162; PyObject *__pyx_int_163; PyObject *__pyx_int_164; PyObject *__pyx_int_165; PyObject *__pyx_int_166; PyObject *__pyx_int_167; PyObject *__pyx_int_168; PyObject *__pyx_int_169; PyObject *__pyx_int_170; PyObject *__pyx_int_171; PyObject *__pyx_int_172; PyObject *__pyx_int_173; PyObject *__pyx_int_174; PyObject *__pyx_int_175; PyObject *__pyx_int_176; PyObject *__pyx_int_177; PyObject *__pyx_int_178; PyObject *__pyx_int_179; PyObject *__pyx_int_180; PyObject *__pyx_int_181; PyObject *__pyx_int_182; PyObject *__pyx_int_183; PyObject *__pyx_int_184; PyObject *__pyx_int_185; PyObject *__pyx_int_186; PyObject *__pyx_int_187; PyObject *__pyx_int_188; PyObject *__pyx_int_189; PyObject *__pyx_int_190; PyObject *__pyx_int_191; PyObject *__pyx_int_192; PyObject *__pyx_int_193; PyObject *__pyx_int_194; PyObject *__pyx_int_196; PyObject *__pyx_int_197; PyObject *__pyx_int_198; PyObject *__pyx_int_199; PyObject *__pyx_int_200; PyObject *__pyx_int_201; PyObject *__pyx_int_202; PyObject *__pyx_int_203; PyObject *__pyx_int_204; PyObject *__pyx_int_205; PyObject *__pyx_int_206; PyObject *__pyx_int_207; PyObject *__pyx_int_208; PyObject *__pyx_int_209; PyObject *__pyx_int_210; PyObject *__pyx_int_211; PyObject *__pyx_int_212; PyObject *__pyx_int_213; PyObject *__pyx_int_214; PyObject *__pyx_int_215; PyObject *__pyx_int_216; PyObject *__pyx_int_217; PyObject *__pyx_int_218; PyObject *__pyx_int_219; PyObject *__pyx_int_220; PyObject *__pyx_int_221; PyObject *__pyx_int_222; PyObject *__pyx_int_223; PyObject *__pyx_int_224; PyObject *__pyx_int_225; PyObject *__pyx_int_226; PyObject *__pyx_int_227; PyObject *__pyx_int_228; PyObject *__pyx_int_229; PyObject *__pyx_int_230; PyObject *__pyx_int_231; PyObject *__pyx_int_232; PyObject *__pyx_int_233; PyObject *__pyx_int_235; PyObject *__pyx_int_236; PyObject *__pyx_int_237; PyObject *__pyx_int_238; PyObject *__pyx_int_239; PyObject *__pyx_int_240; PyObject *__pyx_int_242; PyObject *__pyx_int_244; PyObject *__pyx_int_245; PyObject *__pyx_int_246; PyObject *__pyx_int_247; PyObject *__pyx_int_248; PyObject *__pyx_int_250; PyObject *__pyx_int_251; PyObject *__pyx_int_252; PyObject *__pyx_int_253; PyObject *__pyx_int_255; PyObject *__pyx_tuple_; PyObject *__pyx_slice__4; PyObject *__pyx_slice__5; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__26; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__32; PyObject *__pyx_tuple__33; PyObject *__pyx_tuple__34; PyObject *__pyx_tuple__35; PyObject *__pyx_tuple__36; PyObject *__pyx_tuple__37; PyObject *__pyx_tuple__38; PyObject *__pyx_tuple__39; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__41; PyObject *__pyx_tuple__42; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__44; PyObject *__pyx_tuple__45; PyObject *__pyx_tuple__46; PyObject *__pyx_tuple__47; PyObject *__pyx_tuple__48; PyObject *__pyx_tuple__49; PyObject *__pyx_tuple__50; PyObject *__pyx_tuple__51; PyObject *__pyx_tuple__52; PyObject *__pyx_tuple__53; PyObject *__pyx_tuple__54; PyObject *__pyx_tuple__55; PyObject *__pyx_tuple__56; PyObject *__pyx_tuple__57; PyObject *__pyx_tuple__58; PyObject *__pyx_tuple__59; PyObject *__pyx_tuple__60; PyObject *__pyx_tuple__61; PyObject *__pyx_tuple__62; PyObject *__pyx_tuple__63; PyObject *__pyx_tuple__64; PyObject *__pyx_tuple__65; PyObject *__pyx_tuple__66; PyObject *__pyx_tuple__67; PyObject *__pyx_tuple__68; PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__70; PyObject *__pyx_tuple__71; PyObject *__pyx_tuple__72; PyObject *__pyx_tuple__73; PyObject *__pyx_tuple__74; PyObject *__pyx_tuple__75; PyObject *__pyx_tuple__76; PyObject *__pyx_tuple__77; PyObject *__pyx_tuple__78; PyObject *__pyx_tuple__79; PyObject *__pyx_tuple__80; PyObject *__pyx_tuple__81; PyObject *__pyx_tuple__82; PyObject *__pyx_tuple__83; PyObject *__pyx_tuple__84; PyObject *__pyx_tuple__85; PyObject *__pyx_tuple__86; PyObject *__pyx_tuple__87; PyObject *__pyx_tuple__88; PyObject *__pyx_tuple__89; PyObject *__pyx_tuple__90; PyObject *__pyx_tuple__91; PyObject *__pyx_tuple__92; PyObject *__pyx_tuple__93; PyObject *__pyx_tuple__94; PyObject *__pyx_tuple__95; PyObject *__pyx_tuple__96; PyObject *__pyx_tuple__97; PyObject *__pyx_tuple__98; PyObject *__pyx_tuple__99; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; PyObject *__pyx_tuple__100; PyObject *__pyx_tuple__101; PyObject *__pyx_tuple__102; PyObject *__pyx_tuple__103; PyObject *__pyx_tuple__104; PyObject *__pyx_tuple__105; PyObject *__pyx_tuple__106; PyObject *__pyx_tuple__107; PyObject *__pyx_tuple__108; PyObject *__pyx_tuple__109; PyObject *__pyx_tuple__110; PyObject *__pyx_tuple__111; PyObject *__pyx_tuple__112; PyObject *__pyx_tuple__113; PyObject *__pyx_tuple__114; PyObject *__pyx_tuple__115; PyObject *__pyx_tuple__116; PyObject *__pyx_tuple__117; PyObject *__pyx_tuple__118; PyObject *__pyx_tuple__119; PyObject *__pyx_tuple__120; PyObject *__pyx_tuple__121; PyObject *__pyx_tuple__122; PyObject *__pyx_tuple__123; PyObject *__pyx_tuple__124; PyObject *__pyx_tuple__125; PyObject *__pyx_tuple__126; PyObject *__pyx_tuple__127; PyObject *__pyx_tuple__128; PyObject *__pyx_tuple__129; PyObject *__pyx_tuple__130; PyObject *__pyx_tuple__131; PyObject *__pyx_tuple__132; PyObject *__pyx_tuple__133; PyObject *__pyx_tuple__134; PyObject *__pyx_tuple__135; PyObject *__pyx_tuple__136; PyObject *__pyx_tuple__137; PyObject *__pyx_tuple__138; PyObject *__pyx_tuple__139; PyObject *__pyx_tuple__140; PyObject *__pyx_tuple__141; PyObject *__pyx_tuple__142; PyObject *__pyx_tuple__143; PyObject *__pyx_tuple__144; PyObject *__pyx_tuple__145; PyObject *__pyx_tuple__146; PyObject *__pyx_tuple__147; PyObject *__pyx_tuple__148; PyObject *__pyx_tuple__149; PyObject *__pyx_tuple__150; PyObject *__pyx_tuple__151; PyObject *__pyx_tuple__152; PyObject *__pyx_tuple__153; PyObject *__pyx_tuple__154; PyObject *__pyx_tuple__155; PyObject *__pyx_tuple__156; PyObject *__pyx_tuple__157; PyObject *__pyx_tuple__158; PyObject *__pyx_tuple__159; PyObject *__pyx_tuple__160; PyObject *__pyx_tuple__161; PyObject *__pyx_tuple__162; PyObject *__pyx_tuple__163; PyObject *__pyx_tuple__164; PyObject *__pyx_tuple__165; PyObject *__pyx_tuple__166; PyObject *__pyx_tuple__167; PyObject *__pyx_tuple__168; PyObject *__pyx_tuple__169; PyObject *__pyx_tuple__170; PyObject *__pyx_tuple__171; PyObject *__pyx_tuple__172; PyObject *__pyx_tuple__173; PyObject *__pyx_tuple__174; PyObject *__pyx_tuple__175; PyObject *__pyx_tuple__176; PyObject *__pyx_tuple__177; PyObject *__pyx_tuple__178; PyObject *__pyx_tuple__179; PyObject *__pyx_tuple__180; PyObject *__pyx_tuple__181; PyObject *__pyx_tuple__182; PyObject *__pyx_tuple__183; PyObject *__pyx_tuple__184; PyObject *__pyx_tuple__185; PyObject *__pyx_tuple__186; PyObject *__pyx_tuple__187; PyObject *__pyx_tuple__188; PyObject *__pyx_tuple__189; PyObject *__pyx_tuple__190; PyObject *__pyx_tuple__191; PyObject *__pyx_tuple__192; PyObject *__pyx_tuple__193; PyObject *__pyx_tuple__194; PyObject *__pyx_tuple__195; PyObject *__pyx_tuple__196; PyObject *__pyx_tuple__197; PyObject *__pyx_tuple__198; PyObject *__pyx_tuple__199; PyObject *__pyx_tuple__200; PyObject *__pyx_tuple__201; PyObject *__pyx_tuple__202; PyObject *__pyx_tuple__203; PyObject *__pyx_tuple__204; PyObject *__pyx_tuple__205; PyObject *__pyx_tuple__206; PyObject *__pyx_tuple__207; PyObject *__pyx_tuple__208; PyObject *__pyx_tuple__209; PyObject *__pyx_tuple__210; PyObject *__pyx_tuple__211; PyObject *__pyx_tuple__212; PyObject *__pyx_tuple__213; PyObject *__pyx_tuple__214; PyObject *__pyx_tuple__215; PyObject *__pyx_tuple__216; PyObject *__pyx_tuple__217; PyObject *__pyx_tuple__218; PyObject *__pyx_tuple__219; PyObject *__pyx_tuple__220; PyObject *__pyx_tuple__221; PyObject *__pyx_tuple__222; PyObject *__pyx_tuple__223; PyObject *__pyx_tuple__224; PyObject *__pyx_tuple__225; PyObject *__pyx_tuple__226; PyObject *__pyx_tuple__227; PyObject *__pyx_tuple__228; PyObject *__pyx_tuple__229; PyObject *__pyx_tuple__230; PyObject *__pyx_tuple__231; PyObject *__pyx_tuple__232; PyObject *__pyx_tuple__233; PyObject *__pyx_tuple__234; PyObject *__pyx_tuple__235; PyObject *__pyx_tuple__236; PyObject *__pyx_tuple__237; PyObject *__pyx_tuple__238; PyObject *__pyx_tuple__239; PyObject *__pyx_tuple__240; PyObject *__pyx_tuple__241; PyObject *__pyx_tuple__242; PyObject *__pyx_tuple__243; PyObject *__pyx_tuple__244; PyObject *__pyx_tuple__245; PyObject *__pyx_tuple__246; PyObject *__pyx_tuple__247; PyObject *__pyx_tuple__248; PyObject *__pyx_tuple__249; PyObject *__pyx_tuple__250; PyObject *__pyx_tuple__251; PyObject *__pyx_tuple__252; PyObject *__pyx_tuple__253; PyObject *__pyx_tuple__254; PyObject *__pyx_tuple__255; PyObject *__pyx_tuple__256; PyObject *__pyx_tuple__257; PyObject *__pyx_tuple__258; PyObject *__pyx_tuple__259; PyObject *__pyx_tuple__260; PyObject *__pyx_tuple__261; PyObject *__pyx_tuple__262; PyObject *__pyx_tuple__263; PyObject *__pyx_tuple__264; PyObject *__pyx_tuple__265; PyObject *__pyx_tuple__266; PyObject *__pyx_tuple__267; PyObject *__pyx_tuple__268; PyObject *__pyx_tuple__269; PyObject *__pyx_tuple__270; PyObject *__pyx_tuple__271; PyObject *__pyx_tuple__272; PyObject *__pyx_tuple__273; PyObject *__pyx_tuple__274; PyObject *__pyx_tuple__275; PyObject *__pyx_tuple__276; PyObject *__pyx_tuple__277; PyObject *__pyx_tuple__278; PyObject *__pyx_tuple__279; PyObject *__pyx_tuple__280; PyObject *__pyx_tuple__281; PyObject *__pyx_tuple__282; PyObject *__pyx_tuple__283; PyObject *__pyx_tuple__284; PyObject *__pyx_tuple__285; PyObject *__pyx_tuple__286; PyObject *__pyx_tuple__287; PyObject *__pyx_tuple__288; PyObject *__pyx_tuple__289; PyObject *__pyx_tuple__290; PyObject *__pyx_tuple__291; PyObject *__pyx_tuple__292; PyObject *__pyx_tuple__293; PyObject *__pyx_tuple__294; PyObject *__pyx_tuple__295; PyObject *__pyx_tuple__296; PyObject *__pyx_tuple__297; PyObject *__pyx_tuple__298; PyObject *__pyx_tuple__299; PyObject *__pyx_tuple__300; PyObject *__pyx_tuple__301; PyObject *__pyx_tuple__302; PyObject *__pyx_tuple__303; PyObject *__pyx_tuple__304; PyObject *__pyx_tuple__305; PyObject *__pyx_tuple__306; PyObject *__pyx_tuple__307; PyObject *__pyx_tuple__308; PyObject *__pyx_tuple__309; PyObject *__pyx_tuple__310; PyObject *__pyx_tuple__311; PyObject *__pyx_tuple__312; PyObject *__pyx_tuple__313; PyObject *__pyx_tuple__314; PyObject *__pyx_tuple__315; PyObject *__pyx_tuple__316; PyObject *__pyx_tuple__317; PyObject *__pyx_tuple__318; PyObject *__pyx_tuple__319; PyObject *__pyx_tuple__320; PyObject *__pyx_tuple__321; PyObject *__pyx_tuple__322; PyObject *__pyx_tuple__323; PyObject *__pyx_tuple__324; PyObject *__pyx_tuple__325; PyObject *__pyx_tuple__326; PyObject *__pyx_tuple__327; PyObject *__pyx_tuple__328; PyObject *__pyx_tuple__329; PyObject *__pyx_tuple__330; PyObject *__pyx_tuple__331; PyObject *__pyx_tuple__332; PyObject *__pyx_tuple__333; PyObject *__pyx_tuple__334; PyObject *__pyx_tuple__335; PyObject *__pyx_tuple__336; PyObject *__pyx_tuple__337; PyObject *__pyx_tuple__338; PyObject *__pyx_tuple__339; PyObject *__pyx_tuple__340; PyObject *__pyx_tuple__341; PyObject *__pyx_tuple__342; PyObject *__pyx_tuple__343; PyObject *__pyx_tuple__344; PyObject *__pyx_tuple__345; PyObject *__pyx_tuple__346; PyObject *__pyx_tuple__347; PyObject *__pyx_tuple__348; PyObject *__pyx_tuple__349; PyObject *__pyx_tuple__350; PyObject *__pyx_tuple__351; PyObject *__pyx_tuple__352; PyObject *__pyx_tuple__353; PyObject *__pyx_tuple__354; PyObject *__pyx_tuple__355; PyObject *__pyx_tuple__356; PyObject *__pyx_tuple__357; PyObject *__pyx_tuple__358; PyObject *__pyx_tuple__359; PyObject *__pyx_tuple__360; PyObject *__pyx_tuple__361; PyObject *__pyx_tuple__362; PyObject *__pyx_tuple__363; PyObject *__pyx_tuple__364; PyObject *__pyx_tuple__365; PyObject *__pyx_tuple__366; PyObject *__pyx_tuple__367; PyObject *__pyx_tuple__368; PyObject *__pyx_tuple__369; PyObject *__pyx_tuple__370; PyObject *__pyx_tuple__371; PyObject *__pyx_tuple__372; PyObject *__pyx_tuple__373; PyObject *__pyx_tuple__374; PyObject *__pyx_tuple__375; PyObject *__pyx_tuple__376; PyObject *__pyx_tuple__377; PyObject *__pyx_tuple__378; PyObject *__pyx_tuple__379; PyObject *__pyx_tuple__380; PyObject *__pyx_tuple__381; PyObject *__pyx_tuple__382; PyObject *__pyx_tuple__383; PyObject *__pyx_tuple__384; PyObject *__pyx_tuple__385; PyObject *__pyx_tuple__386; PyObject *__pyx_tuple__387; PyObject *__pyx_tuple__388; PyObject *__pyx_tuple__389; PyObject *__pyx_tuple__390; PyObject *__pyx_tuple__391; PyObject *__pyx_tuple__392; PyObject *__pyx_tuple__393; PyObject *__pyx_tuple__394; PyObject *__pyx_tuple__395; PyObject *__pyx_tuple__396; PyObject *__pyx_tuple__397; PyObject *__pyx_tuple__398; PyObject *__pyx_tuple__399; PyObject *__pyx_tuple__400; PyObject *__pyx_tuple__401; PyObject *__pyx_tuple__402; PyObject *__pyx_tuple__403; PyObject *__pyx_tuple__404; PyObject *__pyx_tuple__405; PyObject *__pyx_tuple__406; PyObject *__pyx_tuple__407; PyObject *__pyx_tuple__408; PyObject *__pyx_tuple__409; PyObject *__pyx_tuple__410; PyObject *__pyx_tuple__411; PyObject *__pyx_tuple__412; PyObject *__pyx_tuple__413; PyObject *__pyx_tuple__414; PyObject *__pyx_tuple__415; PyObject *__pyx_tuple__416; PyObject *__pyx_tuple__417; PyObject *__pyx_tuple__418; PyObject *__pyx_tuple__419; PyObject *__pyx_tuple__420; PyObject *__pyx_tuple__421; PyObject *__pyx_tuple__422; PyObject *__pyx_tuple__423; PyObject *__pyx_tuple__424; PyObject *__pyx_tuple__425; PyObject *__pyx_tuple__426; PyObject *__pyx_tuple__427; PyObject *__pyx_tuple__428; PyObject *__pyx_tuple__429; PyObject *__pyx_tuple__430; PyObject *__pyx_tuple__431; PyObject *__pyx_tuple__432; PyObject *__pyx_tuple__433; PyObject *__pyx_tuple__434; PyObject *__pyx_tuple__435; PyObject *__pyx_tuple__436; PyObject *__pyx_tuple__437; PyObject *__pyx_tuple__438; PyObject *__pyx_tuple__439; PyObject *__pyx_tuple__440; PyObject *__pyx_tuple__441; PyObject *__pyx_tuple__442; PyObject *__pyx_tuple__443; PyObject *__pyx_tuple__444; PyObject *__pyx_tuple__445; PyObject *__pyx_tuple__446; PyObject *__pyx_tuple__447; PyObject *__pyx_tuple__448; PyObject *__pyx_tuple__449; PyObject *__pyx_tuple__450; PyObject *__pyx_tuple__451; PyObject *__pyx_tuple__452; PyObject *__pyx_tuple__453; PyObject *__pyx_tuple__454; PyObject *__pyx_tuple__455; PyObject *__pyx_tuple__456; PyObject *__pyx_tuple__457; PyObject *__pyx_tuple__458; PyObject *__pyx_tuple__459; PyObject *__pyx_tuple__460; PyObject *__pyx_tuple__461; PyObject *__pyx_tuple__462; PyObject *__pyx_tuple__463; PyObject *__pyx_tuple__464; PyObject *__pyx_tuple__465; PyObject *__pyx_tuple__466; PyObject *__pyx_tuple__467; PyObject *__pyx_tuple__468; PyObject *__pyx_tuple__469; PyObject *__pyx_tuple__470; PyObject *__pyx_tuple__471; PyObject *__pyx_tuple__472; PyObject *__pyx_tuple__473; PyObject *__pyx_tuple__474; PyObject *__pyx_tuple__475; PyObject *__pyx_tuple__476; PyObject *__pyx_tuple__477; PyObject *__pyx_tuple__478; PyObject *__pyx_tuple__479; PyObject *__pyx_tuple__480; PyObject *__pyx_tuple__481; PyObject *__pyx_tuple__482; PyObject *__pyx_tuple__483; PyObject *__pyx_tuple__484; PyObject *__pyx_tuple__485; PyObject *__pyx_tuple__486; PyObject *__pyx_tuple__487; PyObject *__pyx_tuple__488; PyObject *__pyx_tuple__489; PyObject *__pyx_tuple__490; PyObject *__pyx_tuple__491; PyObject *__pyx_tuple__492; PyObject *__pyx_tuple__493; PyObject *__pyx_tuple__494; PyObject *__pyx_tuple__495; PyObject *__pyx_tuple__496; PyObject *__pyx_tuple__497; PyObject *__pyx_tuple__498; PyObject *__pyx_tuple__499; PyObject *__pyx_tuple__500; PyObject *__pyx_tuple__501; PyObject *__pyx_tuple__502; PyObject *__pyx_tuple__503; PyObject *__pyx_tuple__504; PyObject *__pyx_tuple__505; PyObject *__pyx_tuple__506; PyObject *__pyx_tuple__507; PyObject *__pyx_tuple__508; PyObject *__pyx_tuple__509; PyObject *__pyx_tuple__510; PyObject *__pyx_tuple__511; PyObject *__pyx_tuple__512; PyObject *__pyx_tuple__513; PyObject *__pyx_tuple__514; PyObject *__pyx_tuple__517; PyObject *__pyx_tuple__519; PyObject *__pyx_tuple__521; PyObject *__pyx_codeobj__515; PyObject *__pyx_codeobj__516; PyObject *__pyx_codeobj__518; PyObject *__pyx_codeobj__520; PyObject *__pyx_codeobj__522; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_5color_Color); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma); Py_CLEAR(clear_module_state->__pyx_kp_s_08x); Py_CLEAR(clear_module_state->__pyx_kp_s_0x); Py_CLEAR(clear_module_state->__pyx_n_s_BBB); Py_CLEAR(clear_module_state->__pyx_n_s_BBBB); Py_CLEAR(clear_module_state->__pyx_n_s_Color); Py_CLEAR(clear_module_state->__pyx_n_s_Color___reduce); Py_CLEAR(clear_module_state->__pyx_n_s_Color___setstate); Py_CLEAR(clear_module_state->__pyx_n_s_Color_correct_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_Color_from_hex_locals_lambda); Py_CLEAR(clear_module_state->__pyx_n_s_Color_normalize); Py_CLEAR(clear_module_state->__pyx_n_s_Color_set_length); Py_CLEAR(clear_module_state->__pyx_kp_s_Expected_a_color); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); Py_CLEAR(clear_module_state->__pyx_kp_s_L); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_n_s__10); Py_CLEAR(clear_module_state->__pyx_kp_s__2); Py_CLEAR(clear_module_state->__pyx_kp_s__3); Py_CLEAR(clear_module_state->__pyx_n_s__523); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_s_aliceblue); Py_CLEAR(clear_module_state->__pyx_n_s_antiquewhite); Py_CLEAR(clear_module_state->__pyx_n_s_antiquewhite1); Py_CLEAR(clear_module_state->__pyx_n_s_antiquewhite2); Py_CLEAR(clear_module_state->__pyx_n_s_antiquewhite3); Py_CLEAR(clear_module_state->__pyx_n_s_antiquewhite4); Py_CLEAR(clear_module_state->__pyx_n_s_aquamarine); Py_CLEAR(clear_module_state->__pyx_n_s_aquamarine1); Py_CLEAR(clear_module_state->__pyx_n_s_aquamarine2); Py_CLEAR(clear_module_state->__pyx_n_s_aquamarine3); Py_CLEAR(clear_module_state->__pyx_n_s_aquamarine4); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_azure); Py_CLEAR(clear_module_state->__pyx_n_s_azure1); Py_CLEAR(clear_module_state->__pyx_n_s_azure2); Py_CLEAR(clear_module_state->__pyx_n_s_azure3); Py_CLEAR(clear_module_state->__pyx_n_s_azure4); Py_CLEAR(clear_module_state->__pyx_n_s_b); Py_CLEAR(clear_module_state->__pyx_n_s_beige); Py_CLEAR(clear_module_state->__pyx_n_s_binascii); Py_CLEAR(clear_module_state->__pyx_n_s_bisque); Py_CLEAR(clear_module_state->__pyx_n_s_bisque1); Py_CLEAR(clear_module_state->__pyx_n_s_bisque2); Py_CLEAR(clear_module_state->__pyx_n_s_bisque3); Py_CLEAR(clear_module_state->__pyx_n_s_bisque4); Py_CLEAR(clear_module_state->__pyx_n_s_black); Py_CLEAR(clear_module_state->__pyx_n_s_blanchedalmond); Py_CLEAR(clear_module_state->__pyx_n_s_blue); Py_CLEAR(clear_module_state->__pyx_n_s_blue1); Py_CLEAR(clear_module_state->__pyx_n_s_blue2); Py_CLEAR(clear_module_state->__pyx_n_s_blue3); Py_CLEAR(clear_module_state->__pyx_n_s_blue4); Py_CLEAR(clear_module_state->__pyx_n_s_blueviolet); Py_CLEAR(clear_module_state->__pyx_n_s_brown); Py_CLEAR(clear_module_state->__pyx_n_s_brown1); Py_CLEAR(clear_module_state->__pyx_n_s_brown2); Py_CLEAR(clear_module_state->__pyx_n_s_brown3); Py_CLEAR(clear_module_state->__pyx_n_s_brown4); Py_CLEAR(clear_module_state->__pyx_n_s_burlywood); Py_CLEAR(clear_module_state->__pyx_n_s_burlywood1); Py_CLEAR(clear_module_state->__pyx_n_s_burlywood2); Py_CLEAR(clear_module_state->__pyx_n_s_burlywood3); Py_CLEAR(clear_module_state->__pyx_n_s_burlywood4); Py_CLEAR(clear_module_state->__pyx_n_s_c); Py_CLEAR(clear_module_state->__pyx_n_s_cadetblue); Py_CLEAR(clear_module_state->__pyx_n_s_cadetblue1); Py_CLEAR(clear_module_state->__pyx_n_s_cadetblue2); Py_CLEAR(clear_module_state->__pyx_n_s_cadetblue3); Py_CLEAR(clear_module_state->__pyx_n_s_cadetblue4); Py_CLEAR(clear_module_state->__pyx_n_s_chartreuse); Py_CLEAR(clear_module_state->__pyx_n_s_chartreuse1); Py_CLEAR(clear_module_state->__pyx_n_s_chartreuse2); Py_CLEAR(clear_module_state->__pyx_n_s_chartreuse3); Py_CLEAR(clear_module_state->__pyx_n_s_chartreuse4); Py_CLEAR(clear_module_state->__pyx_n_s_chocolate); Py_CLEAR(clear_module_state->__pyx_n_s_chocolate1); Py_CLEAR(clear_module_state->__pyx_n_s_chocolate2); Py_CLEAR(clear_module_state->__pyx_n_s_chocolate3); Py_CLEAR(clear_module_state->__pyx_n_s_chocolate4); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_coral); Py_CLEAR(clear_module_state->__pyx_n_s_coral1); Py_CLEAR(clear_module_state->__pyx_n_s_coral2); Py_CLEAR(clear_module_state->__pyx_n_s_coral3); Py_CLEAR(clear_module_state->__pyx_n_s_coral4); Py_CLEAR(clear_module_state->__pyx_n_s_cornflowerblue); Py_CLEAR(clear_module_state->__pyx_n_s_cornsilk); Py_CLEAR(clear_module_state->__pyx_n_s_cornsilk1); Py_CLEAR(clear_module_state->__pyx_n_s_cornsilk2); Py_CLEAR(clear_module_state->__pyx_n_s_cornsilk3); Py_CLEAR(clear_module_state->__pyx_n_s_cornsilk4); Py_CLEAR(clear_module_state->__pyx_n_s_correct_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_correct_gamma_locals_lambda); Py_CLEAR(clear_module_state->__pyx_n_s_cyan); Py_CLEAR(clear_module_state->__pyx_n_s_cyan1); Py_CLEAR(clear_module_state->__pyx_n_s_cyan2); Py_CLEAR(clear_module_state->__pyx_n_s_cyan3); Py_CLEAR(clear_module_state->__pyx_n_s_cyan4); Py_CLEAR(clear_module_state->__pyx_n_s_d); Py_CLEAR(clear_module_state->__pyx_n_s_darkblue); Py_CLEAR(clear_module_state->__pyx_n_s_darkcyan); Py_CLEAR(clear_module_state->__pyx_n_s_darkgoldenrod); Py_CLEAR(clear_module_state->__pyx_n_s_darkgoldenrod1); Py_CLEAR(clear_module_state->__pyx_n_s_darkgoldenrod2); Py_CLEAR(clear_module_state->__pyx_n_s_darkgoldenrod3); Py_CLEAR(clear_module_state->__pyx_n_s_darkgoldenrod4); Py_CLEAR(clear_module_state->__pyx_n_s_darkgray); Py_CLEAR(clear_module_state->__pyx_n_s_darkgreen); Py_CLEAR(clear_module_state->__pyx_n_s_darkgrey); Py_CLEAR(clear_module_state->__pyx_n_s_darkkhaki); Py_CLEAR(clear_module_state->__pyx_n_s_darkmagenta); Py_CLEAR(clear_module_state->__pyx_n_s_darkolivegreen); Py_CLEAR(clear_module_state->__pyx_n_s_darkolivegreen1); Py_CLEAR(clear_module_state->__pyx_n_s_darkolivegreen2); Py_CLEAR(clear_module_state->__pyx_n_s_darkolivegreen3); Py_CLEAR(clear_module_state->__pyx_n_s_darkolivegreen4); Py_CLEAR(clear_module_state->__pyx_n_s_darkorange); Py_CLEAR(clear_module_state->__pyx_n_s_darkorange1); Py_CLEAR(clear_module_state->__pyx_n_s_darkorange2); Py_CLEAR(clear_module_state->__pyx_n_s_darkorange3); Py_CLEAR(clear_module_state->__pyx_n_s_darkorange4); Py_CLEAR(clear_module_state->__pyx_n_s_darkorchid); Py_CLEAR(clear_module_state->__pyx_n_s_darkorchid1); Py_CLEAR(clear_module_state->__pyx_n_s_darkorchid2); Py_CLEAR(clear_module_state->__pyx_n_s_darkorchid3); Py_CLEAR(clear_module_state->__pyx_n_s_darkorchid4); Py_CLEAR(clear_module_state->__pyx_n_s_darkred); Py_CLEAR(clear_module_state->__pyx_n_s_darksalmon); Py_CLEAR(clear_module_state->__pyx_n_s_darkseagreen); Py_CLEAR(clear_module_state->__pyx_n_s_darkseagreen1); Py_CLEAR(clear_module_state->__pyx_n_s_darkseagreen2); Py_CLEAR(clear_module_state->__pyx_n_s_darkseagreen3); Py_CLEAR(clear_module_state->__pyx_n_s_darkseagreen4); Py_CLEAR(clear_module_state->__pyx_n_s_darkslateblue); Py_CLEAR(clear_module_state->__pyx_n_s_darkslategray); Py_CLEAR(clear_module_state->__pyx_n_s_darkslategray1); Py_CLEAR(clear_module_state->__pyx_n_s_darkslategray2); Py_CLEAR(clear_module_state->__pyx_n_s_darkslategray3); Py_CLEAR(clear_module_state->__pyx_n_s_darkslategray4); Py_CLEAR(clear_module_state->__pyx_n_s_darkslategrey); Py_CLEAR(clear_module_state->__pyx_n_s_darkturquoise); Py_CLEAR(clear_module_state->__pyx_n_s_darkviolet); Py_CLEAR(clear_module_state->__pyx_n_s_debianred); Py_CLEAR(clear_module_state->__pyx_n_s_deeppink); Py_CLEAR(clear_module_state->__pyx_n_s_deeppink1); Py_CLEAR(clear_module_state->__pyx_n_s_deeppink2); Py_CLEAR(clear_module_state->__pyx_n_s_deeppink3); Py_CLEAR(clear_module_state->__pyx_n_s_deeppink4); Py_CLEAR(clear_module_state->__pyx_n_s_deepskyblue); Py_CLEAR(clear_module_state->__pyx_n_s_deepskyblue1); Py_CLEAR(clear_module_state->__pyx_n_s_deepskyblue2); Py_CLEAR(clear_module_state->__pyx_n_s_deepskyblue3); Py_CLEAR(clear_module_state->__pyx_n_s_deepskyblue4); Py_CLEAR(clear_module_state->__pyx_n_s_dimgray); Py_CLEAR(clear_module_state->__pyx_n_s_dimgrey); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_div); Py_CLEAR(clear_module_state->__pyx_n_s_dodgerblue); Py_CLEAR(clear_module_state->__pyx_n_s_dodgerblue1); Py_CLEAR(clear_module_state->__pyx_n_s_dodgerblue2); Py_CLEAR(clear_module_state->__pyx_n_s_dodgerblue3); Py_CLEAR(clear_module_state->__pyx_n_s_dodgerblue4); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_firebrick); Py_CLEAR(clear_module_state->__pyx_n_s_firebrick1); Py_CLEAR(clear_module_state->__pyx_n_s_firebrick2); Py_CLEAR(clear_module_state->__pyx_n_s_firebrick3); Py_CLEAR(clear_module_state->__pyx_n_s_firebrick4); Py_CLEAR(clear_module_state->__pyx_n_s_floordiv___locals_div); Py_CLEAR(clear_module_state->__pyx_n_s_floralwhite); Py_CLEAR(clear_module_state->__pyx_n_s_forestgreen); Py_CLEAR(clear_module_state->__pyx_n_s_g); Py_CLEAR(clear_module_state->__pyx_n_s_gainsboro); Py_CLEAR(clear_module_state->__pyx_n_s_gamma); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_ghostwhite); Py_CLEAR(clear_module_state->__pyx_n_s_gold); Py_CLEAR(clear_module_state->__pyx_n_s_gold1); Py_CLEAR(clear_module_state->__pyx_n_s_gold2); Py_CLEAR(clear_module_state->__pyx_n_s_gold3); Py_CLEAR(clear_module_state->__pyx_n_s_gold4); Py_CLEAR(clear_module_state->__pyx_n_s_goldenrod); Py_CLEAR(clear_module_state->__pyx_n_s_goldenrod1); Py_CLEAR(clear_module_state->__pyx_n_s_goldenrod2); Py_CLEAR(clear_module_state->__pyx_n_s_goldenrod3); Py_CLEAR(clear_module_state->__pyx_n_s_goldenrod4); Py_CLEAR(clear_module_state->__pyx_n_s_gray); Py_CLEAR(clear_module_state->__pyx_n_s_gray0); Py_CLEAR(clear_module_state->__pyx_n_s_gray1); Py_CLEAR(clear_module_state->__pyx_n_s_gray10); Py_CLEAR(clear_module_state->__pyx_n_s_gray100); Py_CLEAR(clear_module_state->__pyx_n_s_gray11); Py_CLEAR(clear_module_state->__pyx_n_s_gray12); Py_CLEAR(clear_module_state->__pyx_n_s_gray13); Py_CLEAR(clear_module_state->__pyx_n_s_gray14); Py_CLEAR(clear_module_state->__pyx_n_s_gray15); Py_CLEAR(clear_module_state->__pyx_n_s_gray16); Py_CLEAR(clear_module_state->__pyx_n_s_gray17); Py_CLEAR(clear_module_state->__pyx_n_s_gray18); Py_CLEAR(clear_module_state->__pyx_n_s_gray19); Py_CLEAR(clear_module_state->__pyx_n_s_gray2); Py_CLEAR(clear_module_state->__pyx_n_s_gray20); Py_CLEAR(clear_module_state->__pyx_n_s_gray21); Py_CLEAR(clear_module_state->__pyx_n_s_gray22); Py_CLEAR(clear_module_state->__pyx_n_s_gray23); Py_CLEAR(clear_module_state->__pyx_n_s_gray24); Py_CLEAR(clear_module_state->__pyx_n_s_gray25); Py_CLEAR(clear_module_state->__pyx_n_s_gray26); Py_CLEAR(clear_module_state->__pyx_n_s_gray27); Py_CLEAR(clear_module_state->__pyx_n_s_gray28); Py_CLEAR(clear_module_state->__pyx_n_s_gray29); Py_CLEAR(clear_module_state->__pyx_n_s_gray3); Py_CLEAR(clear_module_state->__pyx_n_s_gray30); Py_CLEAR(clear_module_state->__pyx_n_s_gray31); Py_CLEAR(clear_module_state->__pyx_n_s_gray32); Py_CLEAR(clear_module_state->__pyx_n_s_gray33); Py_CLEAR(clear_module_state->__pyx_n_s_gray34); Py_CLEAR(clear_module_state->__pyx_n_s_gray35); Py_CLEAR(clear_module_state->__pyx_n_s_gray36); Py_CLEAR(clear_module_state->__pyx_n_s_gray37); Py_CLEAR(clear_module_state->__pyx_n_s_gray38); Py_CLEAR(clear_module_state->__pyx_n_s_gray39); Py_CLEAR(clear_module_state->__pyx_n_s_gray4); Py_CLEAR(clear_module_state->__pyx_n_s_gray40); Py_CLEAR(clear_module_state->__pyx_n_s_gray41); Py_CLEAR(clear_module_state->__pyx_n_s_gray42); Py_CLEAR(clear_module_state->__pyx_n_s_gray43); Py_CLEAR(clear_module_state->__pyx_n_s_gray44); Py_CLEAR(clear_module_state->__pyx_n_s_gray45); Py_CLEAR(clear_module_state->__pyx_n_s_gray46); Py_CLEAR(clear_module_state->__pyx_n_s_gray47); Py_CLEAR(clear_module_state->__pyx_n_s_gray48); Py_CLEAR(clear_module_state->__pyx_n_s_gray49); Py_CLEAR(clear_module_state->__pyx_n_s_gray5); Py_CLEAR(clear_module_state->__pyx_n_s_gray50); Py_CLEAR(clear_module_state->__pyx_n_s_gray51); Py_CLEAR(clear_module_state->__pyx_n_s_gray52); Py_CLEAR(clear_module_state->__pyx_n_s_gray53); Py_CLEAR(clear_module_state->__pyx_n_s_gray54); Py_CLEAR(clear_module_state->__pyx_n_s_gray55); Py_CLEAR(clear_module_state->__pyx_n_s_gray56); Py_CLEAR(clear_module_state->__pyx_n_s_gray57); Py_CLEAR(clear_module_state->__pyx_n_s_gray58); Py_CLEAR(clear_module_state->__pyx_n_s_gray59); Py_CLEAR(clear_module_state->__pyx_n_s_gray6); Py_CLEAR(clear_module_state->__pyx_n_s_gray60); Py_CLEAR(clear_module_state->__pyx_n_s_gray61); Py_CLEAR(clear_module_state->__pyx_n_s_gray62); Py_CLEAR(clear_module_state->__pyx_n_s_gray63); Py_CLEAR(clear_module_state->__pyx_n_s_gray64); Py_CLEAR(clear_module_state->__pyx_n_s_gray65); Py_CLEAR(clear_module_state->__pyx_n_s_gray66); Py_CLEAR(clear_module_state->__pyx_n_s_gray67); Py_CLEAR(clear_module_state->__pyx_n_s_gray68); Py_CLEAR(clear_module_state->__pyx_n_s_gray69); Py_CLEAR(clear_module_state->__pyx_n_s_gray7); Py_CLEAR(clear_module_state->__pyx_n_s_gray70); Py_CLEAR(clear_module_state->__pyx_n_s_gray71); Py_CLEAR(clear_module_state->__pyx_n_s_gray72); Py_CLEAR(clear_module_state->__pyx_n_s_gray73); Py_CLEAR(clear_module_state->__pyx_n_s_gray74); Py_CLEAR(clear_module_state->__pyx_n_s_gray75); Py_CLEAR(clear_module_state->__pyx_n_s_gray76); Py_CLEAR(clear_module_state->__pyx_n_s_gray77); Py_CLEAR(clear_module_state->__pyx_n_s_gray78); Py_CLEAR(clear_module_state->__pyx_n_s_gray79); Py_CLEAR(clear_module_state->__pyx_n_s_gray8); Py_CLEAR(clear_module_state->__pyx_n_s_gray80); Py_CLEAR(clear_module_state->__pyx_n_s_gray81); Py_CLEAR(clear_module_state->__pyx_n_s_gray82); Py_CLEAR(clear_module_state->__pyx_n_s_gray83); Py_CLEAR(clear_module_state->__pyx_n_s_gray84); Py_CLEAR(clear_module_state->__pyx_n_s_gray85); Py_CLEAR(clear_module_state->__pyx_n_s_gray86); Py_CLEAR(clear_module_state->__pyx_n_s_gray87); Py_CLEAR(clear_module_state->__pyx_n_s_gray88); Py_CLEAR(clear_module_state->__pyx_n_s_gray89); Py_CLEAR(clear_module_state->__pyx_n_s_gray9); Py_CLEAR(clear_module_state->__pyx_n_s_gray90); Py_CLEAR(clear_module_state->__pyx_n_s_gray91); Py_CLEAR(clear_module_state->__pyx_n_s_gray92); Py_CLEAR(clear_module_state->__pyx_n_s_gray93); Py_CLEAR(clear_module_state->__pyx_n_s_gray94); Py_CLEAR(clear_module_state->__pyx_n_s_gray95); Py_CLEAR(clear_module_state->__pyx_n_s_gray96); Py_CLEAR(clear_module_state->__pyx_n_s_gray97); Py_CLEAR(clear_module_state->__pyx_n_s_gray98); Py_CLEAR(clear_module_state->__pyx_n_s_gray99); Py_CLEAR(clear_module_state->__pyx_n_s_green); Py_CLEAR(clear_module_state->__pyx_n_s_green1); Py_CLEAR(clear_module_state->__pyx_n_s_green2); Py_CLEAR(clear_module_state->__pyx_n_s_green3); Py_CLEAR(clear_module_state->__pyx_n_s_green4); Py_CLEAR(clear_module_state->__pyx_n_s_greenyellow); Py_CLEAR(clear_module_state->__pyx_n_s_grey); Py_CLEAR(clear_module_state->__pyx_n_s_grey0); Py_CLEAR(clear_module_state->__pyx_n_s_grey1); Py_CLEAR(clear_module_state->__pyx_n_s_grey10); Py_CLEAR(clear_module_state->__pyx_n_s_grey100); Py_CLEAR(clear_module_state->__pyx_n_s_grey11); Py_CLEAR(clear_module_state->__pyx_n_s_grey12); Py_CLEAR(clear_module_state->__pyx_n_s_grey13); Py_CLEAR(clear_module_state->__pyx_n_s_grey14); Py_CLEAR(clear_module_state->__pyx_n_s_grey15); Py_CLEAR(clear_module_state->__pyx_n_s_grey16); Py_CLEAR(clear_module_state->__pyx_n_s_grey17); Py_CLEAR(clear_module_state->__pyx_n_s_grey18); Py_CLEAR(clear_module_state->__pyx_n_s_grey19); Py_CLEAR(clear_module_state->__pyx_n_s_grey2); Py_CLEAR(clear_module_state->__pyx_n_s_grey20); Py_CLEAR(clear_module_state->__pyx_n_s_grey21); Py_CLEAR(clear_module_state->__pyx_n_s_grey22); Py_CLEAR(clear_module_state->__pyx_n_s_grey23); Py_CLEAR(clear_module_state->__pyx_n_s_grey24); Py_CLEAR(clear_module_state->__pyx_n_s_grey25); Py_CLEAR(clear_module_state->__pyx_n_s_grey26); Py_CLEAR(clear_module_state->__pyx_n_s_grey27); Py_CLEAR(clear_module_state->__pyx_n_s_grey28); Py_CLEAR(clear_module_state->__pyx_n_s_grey29); Py_CLEAR(clear_module_state->__pyx_n_s_grey3); Py_CLEAR(clear_module_state->__pyx_n_s_grey30); Py_CLEAR(clear_module_state->__pyx_n_s_grey31); Py_CLEAR(clear_module_state->__pyx_n_s_grey32); Py_CLEAR(clear_module_state->__pyx_n_s_grey33); Py_CLEAR(clear_module_state->__pyx_n_s_grey34); Py_CLEAR(clear_module_state->__pyx_n_s_grey35); Py_CLEAR(clear_module_state->__pyx_n_s_grey36); Py_CLEAR(clear_module_state->__pyx_n_s_grey37); Py_CLEAR(clear_module_state->__pyx_n_s_grey38); Py_CLEAR(clear_module_state->__pyx_n_s_grey39); Py_CLEAR(clear_module_state->__pyx_n_s_grey4); Py_CLEAR(clear_module_state->__pyx_n_s_grey40); Py_CLEAR(clear_module_state->__pyx_n_s_grey41); Py_CLEAR(clear_module_state->__pyx_n_s_grey42); Py_CLEAR(clear_module_state->__pyx_n_s_grey43); Py_CLEAR(clear_module_state->__pyx_n_s_grey44); Py_CLEAR(clear_module_state->__pyx_n_s_grey45); Py_CLEAR(clear_module_state->__pyx_n_s_grey46); Py_CLEAR(clear_module_state->__pyx_n_s_grey47); Py_CLEAR(clear_module_state->__pyx_n_s_grey48); Py_CLEAR(clear_module_state->__pyx_n_s_grey49); Py_CLEAR(clear_module_state->__pyx_n_s_grey5); Py_CLEAR(clear_module_state->__pyx_n_s_grey50); Py_CLEAR(clear_module_state->__pyx_n_s_grey51); Py_CLEAR(clear_module_state->__pyx_n_s_grey52); Py_CLEAR(clear_module_state->__pyx_n_s_grey53); Py_CLEAR(clear_module_state->__pyx_n_s_grey54); Py_CLEAR(clear_module_state->__pyx_n_s_grey55); Py_CLEAR(clear_module_state->__pyx_n_s_grey56); Py_CLEAR(clear_module_state->__pyx_n_s_grey57); Py_CLEAR(clear_module_state->__pyx_n_s_grey58); Py_CLEAR(clear_module_state->__pyx_n_s_grey59); Py_CLEAR(clear_module_state->__pyx_n_s_grey6); Py_CLEAR(clear_module_state->__pyx_n_s_grey60); Py_CLEAR(clear_module_state->__pyx_n_s_grey61); Py_CLEAR(clear_module_state->__pyx_n_s_grey62); Py_CLEAR(clear_module_state->__pyx_n_s_grey63); Py_CLEAR(clear_module_state->__pyx_n_s_grey64); Py_CLEAR(clear_module_state->__pyx_n_s_grey65); Py_CLEAR(clear_module_state->__pyx_n_s_grey66); Py_CLEAR(clear_module_state->__pyx_n_s_grey67); Py_CLEAR(clear_module_state->__pyx_n_s_grey68); Py_CLEAR(clear_module_state->__pyx_n_s_grey69); Py_CLEAR(clear_module_state->__pyx_n_s_grey7); Py_CLEAR(clear_module_state->__pyx_n_s_grey70); Py_CLEAR(clear_module_state->__pyx_n_s_grey71); Py_CLEAR(clear_module_state->__pyx_n_s_grey72); Py_CLEAR(clear_module_state->__pyx_n_s_grey73); Py_CLEAR(clear_module_state->__pyx_n_s_grey74); Py_CLEAR(clear_module_state->__pyx_n_s_grey75); Py_CLEAR(clear_module_state->__pyx_n_s_grey76); Py_CLEAR(clear_module_state->__pyx_n_s_grey77); Py_CLEAR(clear_module_state->__pyx_n_s_grey78); Py_CLEAR(clear_module_state->__pyx_n_s_grey79); Py_CLEAR(clear_module_state->__pyx_n_s_grey8); Py_CLEAR(clear_module_state->__pyx_n_s_grey80); Py_CLEAR(clear_module_state->__pyx_n_s_grey81); Py_CLEAR(clear_module_state->__pyx_n_s_grey82); Py_CLEAR(clear_module_state->__pyx_n_s_grey83); Py_CLEAR(clear_module_state->__pyx_n_s_grey84); Py_CLEAR(clear_module_state->__pyx_n_s_grey85); Py_CLEAR(clear_module_state->__pyx_n_s_grey86); Py_CLEAR(clear_module_state->__pyx_n_s_grey87); Py_CLEAR(clear_module_state->__pyx_n_s_grey88); Py_CLEAR(clear_module_state->__pyx_n_s_grey89); Py_CLEAR(clear_module_state->__pyx_n_s_grey9); Py_CLEAR(clear_module_state->__pyx_n_s_grey90); Py_CLEAR(clear_module_state->__pyx_n_s_grey91); Py_CLEAR(clear_module_state->__pyx_n_s_grey92); Py_CLEAR(clear_module_state->__pyx_n_s_grey93); Py_CLEAR(clear_module_state->__pyx_n_s_grey94); Py_CLEAR(clear_module_state->__pyx_n_s_grey95); Py_CLEAR(clear_module_state->__pyx_n_s_grey96); Py_CLEAR(clear_module_state->__pyx_n_s_grey97); Py_CLEAR(clear_module_state->__pyx_n_s_grey98); Py_CLEAR(clear_module_state->__pyx_n_s_grey99); Py_CLEAR(clear_module_state->__pyx_n_s_hex); Py_CLEAR(clear_module_state->__pyx_n_s_honeydew); Py_CLEAR(clear_module_state->__pyx_n_s_honeydew1); Py_CLEAR(clear_module_state->__pyx_n_s_honeydew2); Py_CLEAR(clear_module_state->__pyx_n_s_honeydew3); Py_CLEAR(clear_module_state->__pyx_n_s_honeydew4); Py_CLEAR(clear_module_state->__pyx_n_s_hotpink); Py_CLEAR(clear_module_state->__pyx_n_s_hotpink1); Py_CLEAR(clear_module_state->__pyx_n_s_hotpink2); Py_CLEAR(clear_module_state->__pyx_n_s_hotpink3); Py_CLEAR(clear_module_state->__pyx_n_s_hotpink4); Py_CLEAR(clear_module_state->__pyx_n_s_hsva); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_indianred); Py_CLEAR(clear_module_state->__pyx_n_s_indianred1); Py_CLEAR(clear_module_state->__pyx_n_s_indianred2); Py_CLEAR(clear_module_state->__pyx_n_s_indianred3); Py_CLEAR(clear_module_state->__pyx_n_s_indianred4); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_ivory); Py_CLEAR(clear_module_state->__pyx_n_s_ivory1); Py_CLEAR(clear_module_state->__pyx_n_s_ivory2); Py_CLEAR(clear_module_state->__pyx_n_s_ivory3); Py_CLEAR(clear_module_state->__pyx_n_s_ivory4); Py_CLEAR(clear_module_state->__pyx_n_s_join); Py_CLEAR(clear_module_state->__pyx_n_s_khaki); Py_CLEAR(clear_module_state->__pyx_n_s_khaki1); Py_CLEAR(clear_module_state->__pyx_n_s_khaki2); Py_CLEAR(clear_module_state->__pyx_n_s_khaki3); Py_CLEAR(clear_module_state->__pyx_n_s_khaki4); Py_CLEAR(clear_module_state->__pyx_n_s_l); Py_CLEAR(clear_module_state->__pyx_n_s_lavender); Py_CLEAR(clear_module_state->__pyx_n_s_lavenderblush); Py_CLEAR(clear_module_state->__pyx_n_s_lavenderblush1); Py_CLEAR(clear_module_state->__pyx_n_s_lavenderblush2); Py_CLEAR(clear_module_state->__pyx_n_s_lavenderblush3); Py_CLEAR(clear_module_state->__pyx_n_s_lavenderblush4); Py_CLEAR(clear_module_state->__pyx_n_s_lawngreen); Py_CLEAR(clear_module_state->__pyx_n_s_lemonchiffon); Py_CLEAR(clear_module_state->__pyx_n_s_lemonchiffon1); Py_CLEAR(clear_module_state->__pyx_n_s_lemonchiffon2); Py_CLEAR(clear_module_state->__pyx_n_s_lemonchiffon3); Py_CLEAR(clear_module_state->__pyx_n_s_lemonchiffon4); Py_CLEAR(clear_module_state->__pyx_n_s_lightblue); Py_CLEAR(clear_module_state->__pyx_n_s_lightblue1); Py_CLEAR(clear_module_state->__pyx_n_s_lightblue2); Py_CLEAR(clear_module_state->__pyx_n_s_lightblue3); Py_CLEAR(clear_module_state->__pyx_n_s_lightblue4); Py_CLEAR(clear_module_state->__pyx_n_s_lightcoral); Py_CLEAR(clear_module_state->__pyx_n_s_lightcyan); Py_CLEAR(clear_module_state->__pyx_n_s_lightcyan1); Py_CLEAR(clear_module_state->__pyx_n_s_lightcyan2); Py_CLEAR(clear_module_state->__pyx_n_s_lightcyan3); Py_CLEAR(clear_module_state->__pyx_n_s_lightcyan4); Py_CLEAR(clear_module_state->__pyx_n_s_lightgoldenrod); Py_CLEAR(clear_module_state->__pyx_n_s_lightgoldenrod1); Py_CLEAR(clear_module_state->__pyx_n_s_lightgoldenrod2); Py_CLEAR(clear_module_state->__pyx_n_s_lightgoldenrod3); Py_CLEAR(clear_module_state->__pyx_n_s_lightgoldenrod4); Py_CLEAR(clear_module_state->__pyx_n_s_lightgoldenrodyellow); Py_CLEAR(clear_module_state->__pyx_n_s_lightgray); Py_CLEAR(clear_module_state->__pyx_n_s_lightgreen); Py_CLEAR(clear_module_state->__pyx_n_s_lightgrey); Py_CLEAR(clear_module_state->__pyx_n_s_lightpink); Py_CLEAR(clear_module_state->__pyx_n_s_lightpink1); Py_CLEAR(clear_module_state->__pyx_n_s_lightpink2); Py_CLEAR(clear_module_state->__pyx_n_s_lightpink3); Py_CLEAR(clear_module_state->__pyx_n_s_lightpink4); Py_CLEAR(clear_module_state->__pyx_n_s_lightsalmon); Py_CLEAR(clear_module_state->__pyx_n_s_lightsalmon1); Py_CLEAR(clear_module_state->__pyx_n_s_lightsalmon2); Py_CLEAR(clear_module_state->__pyx_n_s_lightsalmon3); Py_CLEAR(clear_module_state->__pyx_n_s_lightsalmon4); Py_CLEAR(clear_module_state->__pyx_n_s_lightseagreen); Py_CLEAR(clear_module_state->__pyx_n_s_lightskyblue); Py_CLEAR(clear_module_state->__pyx_n_s_lightskyblue1); Py_CLEAR(clear_module_state->__pyx_n_s_lightskyblue2); Py_CLEAR(clear_module_state->__pyx_n_s_lightskyblue3); Py_CLEAR(clear_module_state->__pyx_n_s_lightskyblue4); Py_CLEAR(clear_module_state->__pyx_n_s_lightslateblue); Py_CLEAR(clear_module_state->__pyx_n_s_lightslategray); Py_CLEAR(clear_module_state->__pyx_n_s_lightslategrey); Py_CLEAR(clear_module_state->__pyx_n_s_lightsteelblue); Py_CLEAR(clear_module_state->__pyx_n_s_lightsteelblue1); Py_CLEAR(clear_module_state->__pyx_n_s_lightsteelblue2); Py_CLEAR(clear_module_state->__pyx_n_s_lightsteelblue3); Py_CLEAR(clear_module_state->__pyx_n_s_lightsteelblue4); Py_CLEAR(clear_module_state->__pyx_n_s_lightyellow); Py_CLEAR(clear_module_state->__pyx_n_s_lightyellow1); Py_CLEAR(clear_module_state->__pyx_n_s_lightyellow2); Py_CLEAR(clear_module_state->__pyx_n_s_lightyellow3); Py_CLEAR(clear_module_state->__pyx_n_s_lightyellow4); Py_CLEAR(clear_module_state->__pyx_n_s_limegreen); Py_CLEAR(clear_module_state->__pyx_n_s_linen); Py_CLEAR(clear_module_state->__pyx_n_s_lower); Py_CLEAR(clear_module_state->__pyx_n_s_m); Py_CLEAR(clear_module_state->__pyx_n_s_magenta); Py_CLEAR(clear_module_state->__pyx_n_s_magenta1); Py_CLEAR(clear_module_state->__pyx_n_s_magenta2); Py_CLEAR(clear_module_state->__pyx_n_s_magenta3); Py_CLEAR(clear_module_state->__pyx_n_s_magenta4); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_map); Py_CLEAR(clear_module_state->__pyx_n_s_maroon); Py_CLEAR(clear_module_state->__pyx_n_s_maroon1); Py_CLEAR(clear_module_state->__pyx_n_s_maroon2); Py_CLEAR(clear_module_state->__pyx_n_s_maroon3); Py_CLEAR(clear_module_state->__pyx_n_s_maroon4); Py_CLEAR(clear_module_state->__pyx_n_s_mediumaquamarine); Py_CLEAR(clear_module_state->__pyx_n_s_mediumblue); Py_CLEAR(clear_module_state->__pyx_n_s_mediumorchid); Py_CLEAR(clear_module_state->__pyx_n_s_mediumorchid1); Py_CLEAR(clear_module_state->__pyx_n_s_mediumorchid2); Py_CLEAR(clear_module_state->__pyx_n_s_mediumorchid3); Py_CLEAR(clear_module_state->__pyx_n_s_mediumorchid4); Py_CLEAR(clear_module_state->__pyx_n_s_mediumpurple); Py_CLEAR(clear_module_state->__pyx_n_s_mediumpurple1); Py_CLEAR(clear_module_state->__pyx_n_s_mediumpurple2); Py_CLEAR(clear_module_state->__pyx_n_s_mediumpurple3); Py_CLEAR(clear_module_state->__pyx_n_s_mediumpurple4); Py_CLEAR(clear_module_state->__pyx_n_s_mediumseagreen); Py_CLEAR(clear_module_state->__pyx_n_s_mediumslateblue); Py_CLEAR(clear_module_state->__pyx_n_s_mediumspringgreen); Py_CLEAR(clear_module_state->__pyx_n_s_mediumturquoise); Py_CLEAR(clear_module_state->__pyx_n_s_mediumvioletred); Py_CLEAR(clear_module_state->__pyx_n_s_midnightblue); Py_CLEAR(clear_module_state->__pyx_n_s_mintcream); Py_CLEAR(clear_module_state->__pyx_n_s_mistyrose); Py_CLEAR(clear_module_state->__pyx_n_s_mistyrose1); Py_CLEAR(clear_module_state->__pyx_n_s_mistyrose2); Py_CLEAR(clear_module_state->__pyx_n_s_mistyrose3); Py_CLEAR(clear_module_state->__pyx_n_s_mistyrose4); Py_CLEAR(clear_module_state->__pyx_n_s_moccasin); Py_CLEAR(clear_module_state->__pyx_n_s_mod); Py_CLEAR(clear_module_state->__pyx_n_s_mod___locals_mod); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_navajowhite); Py_CLEAR(clear_module_state->__pyx_n_s_navajowhite1); Py_CLEAR(clear_module_state->__pyx_n_s_navajowhite2); Py_CLEAR(clear_module_state->__pyx_n_s_navajowhite3); Py_CLEAR(clear_module_state->__pyx_n_s_navajowhite4); Py_CLEAR(clear_module_state->__pyx_n_s_navy); Py_CLEAR(clear_module_state->__pyx_n_s_navyblue); Py_CLEAR(clear_module_state->__pyx_n_s_normalize); Py_CLEAR(clear_module_state->__pyx_n_s_oct); Py_CLEAR(clear_module_state->__pyx_n_s_oldlace); Py_CLEAR(clear_module_state->__pyx_n_s_olivedrab); Py_CLEAR(clear_module_state->__pyx_n_s_olivedrab1); Py_CLEAR(clear_module_state->__pyx_n_s_olivedrab2); Py_CLEAR(clear_module_state->__pyx_n_s_olivedrab3); Py_CLEAR(clear_module_state->__pyx_n_s_olivedrab4); Py_CLEAR(clear_module_state->__pyx_n_s_orange); Py_CLEAR(clear_module_state->__pyx_n_s_orange1); Py_CLEAR(clear_module_state->__pyx_n_s_orange2); Py_CLEAR(clear_module_state->__pyx_n_s_orange3); Py_CLEAR(clear_module_state->__pyx_n_s_orange4); Py_CLEAR(clear_module_state->__pyx_n_s_orangered); Py_CLEAR(clear_module_state->__pyx_n_s_orangered1); Py_CLEAR(clear_module_state->__pyx_n_s_orangered2); Py_CLEAR(clear_module_state->__pyx_n_s_orangered3); Py_CLEAR(clear_module_state->__pyx_n_s_orangered4); Py_CLEAR(clear_module_state->__pyx_n_s_orchid); Py_CLEAR(clear_module_state->__pyx_n_s_orchid1); Py_CLEAR(clear_module_state->__pyx_n_s_orchid2); Py_CLEAR(clear_module_state->__pyx_n_s_orchid3); Py_CLEAR(clear_module_state->__pyx_n_s_orchid4); Py_CLEAR(clear_module_state->__pyx_n_s_pack); Py_CLEAR(clear_module_state->__pyx_n_s_palegoldenrod); Py_CLEAR(clear_module_state->__pyx_n_s_palegreen); Py_CLEAR(clear_module_state->__pyx_n_s_palegreen1); Py_CLEAR(clear_module_state->__pyx_n_s_palegreen2); Py_CLEAR(clear_module_state->__pyx_n_s_palegreen3); Py_CLEAR(clear_module_state->__pyx_n_s_palegreen4); Py_CLEAR(clear_module_state->__pyx_n_s_paleturquoise); Py_CLEAR(clear_module_state->__pyx_n_s_paleturquoise1); Py_CLEAR(clear_module_state->__pyx_n_s_paleturquoise2); Py_CLEAR(clear_module_state->__pyx_n_s_paleturquoise3); Py_CLEAR(clear_module_state->__pyx_n_s_paleturquoise4); Py_CLEAR(clear_module_state->__pyx_n_s_palevioletred); Py_CLEAR(clear_module_state->__pyx_n_s_palevioletred1); Py_CLEAR(clear_module_state->__pyx_n_s_palevioletred2); Py_CLEAR(clear_module_state->__pyx_n_s_palevioletred3); Py_CLEAR(clear_module_state->__pyx_n_s_palevioletred4); Py_CLEAR(clear_module_state->__pyx_n_s_papayawhip); Py_CLEAR(clear_module_state->__pyx_n_s_peachpuff); Py_CLEAR(clear_module_state->__pyx_n_s_peachpuff1); Py_CLEAR(clear_module_state->__pyx_n_s_peachpuff2); Py_CLEAR(clear_module_state->__pyx_n_s_peachpuff3); Py_CLEAR(clear_module_state->__pyx_n_s_peachpuff4); Py_CLEAR(clear_module_state->__pyx_n_s_peru); Py_CLEAR(clear_module_state->__pyx_n_s_pink); Py_CLEAR(clear_module_state->__pyx_n_s_pink1); Py_CLEAR(clear_module_state->__pyx_n_s_pink2); Py_CLEAR(clear_module_state->__pyx_n_s_pink3); Py_CLEAR(clear_module_state->__pyx_n_s_pink4); Py_CLEAR(clear_module_state->__pyx_n_s_plum); Py_CLEAR(clear_module_state->__pyx_n_s_plum1); Py_CLEAR(clear_module_state->__pyx_n_s_plum2); Py_CLEAR(clear_module_state->__pyx_n_s_plum3); Py_CLEAR(clear_module_state->__pyx_n_s_plum4); Py_CLEAR(clear_module_state->__pyx_n_s_powderblue); Py_CLEAR(clear_module_state->__pyx_n_s_purple); Py_CLEAR(clear_module_state->__pyx_n_s_purple1); Py_CLEAR(clear_module_state->__pyx_n_s_purple2); Py_CLEAR(clear_module_state->__pyx_n_s_purple3); Py_CLEAR(clear_module_state->__pyx_n_s_purple4); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_color); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_red); Py_CLEAR(clear_module_state->__pyx_n_s_red1); Py_CLEAR(clear_module_state->__pyx_n_s_red2); Py_CLEAR(clear_module_state->__pyx_n_s_red3); Py_CLEAR(clear_module_state->__pyx_n_s_red4); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_rgba); Py_CLEAR(clear_module_state->__pyx_n_s_rosybrown); Py_CLEAR(clear_module_state->__pyx_n_s_rosybrown1); Py_CLEAR(clear_module_state->__pyx_n_s_rosybrown2); Py_CLEAR(clear_module_state->__pyx_n_s_rosybrown3); Py_CLEAR(clear_module_state->__pyx_n_s_rosybrown4); Py_CLEAR(clear_module_state->__pyx_n_s_round); Py_CLEAR(clear_module_state->__pyx_n_s_royalblue); Py_CLEAR(clear_module_state->__pyx_n_s_royalblue1); Py_CLEAR(clear_module_state->__pyx_n_s_royalblue2); Py_CLEAR(clear_module_state->__pyx_n_s_royalblue3); Py_CLEAR(clear_module_state->__pyx_n_s_royalblue4); Py_CLEAR(clear_module_state->__pyx_n_s_saddlebrown); Py_CLEAR(clear_module_state->__pyx_n_s_salmon); Py_CLEAR(clear_module_state->__pyx_n_s_salmon1); Py_CLEAR(clear_module_state->__pyx_n_s_salmon2); Py_CLEAR(clear_module_state->__pyx_n_s_salmon3); Py_CLEAR(clear_module_state->__pyx_n_s_salmon4); Py_CLEAR(clear_module_state->__pyx_n_s_sandybrown); Py_CLEAR(clear_module_state->__pyx_n_s_seagreen); Py_CLEAR(clear_module_state->__pyx_n_s_seagreen1); Py_CLEAR(clear_module_state->__pyx_n_s_seagreen2); Py_CLEAR(clear_module_state->__pyx_n_s_seagreen3); Py_CLEAR(clear_module_state->__pyx_n_s_seagreen4); Py_CLEAR(clear_module_state->__pyx_n_s_seashell); Py_CLEAR(clear_module_state->__pyx_n_s_seashell1); Py_CLEAR(clear_module_state->__pyx_n_s_seashell2); Py_CLEAR(clear_module_state->__pyx_n_s_seashell3); Py_CLEAR(clear_module_state->__pyx_n_s_seashell4); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_length); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_sienna); Py_CLEAR(clear_module_state->__pyx_n_s_sienna1); Py_CLEAR(clear_module_state->__pyx_n_s_sienna2); Py_CLEAR(clear_module_state->__pyx_n_s_sienna3); Py_CLEAR(clear_module_state->__pyx_n_s_sienna4); Py_CLEAR(clear_module_state->__pyx_n_s_skyblue); Py_CLEAR(clear_module_state->__pyx_n_s_skyblue1); Py_CLEAR(clear_module_state->__pyx_n_s_skyblue2); Py_CLEAR(clear_module_state->__pyx_n_s_skyblue3); Py_CLEAR(clear_module_state->__pyx_n_s_skyblue4); Py_CLEAR(clear_module_state->__pyx_n_s_slateblue); Py_CLEAR(clear_module_state->__pyx_n_s_slateblue1); Py_CLEAR(clear_module_state->__pyx_n_s_slateblue2); Py_CLEAR(clear_module_state->__pyx_n_s_slateblue3); Py_CLEAR(clear_module_state->__pyx_n_s_slateblue4); Py_CLEAR(clear_module_state->__pyx_n_s_slategray); Py_CLEAR(clear_module_state->__pyx_n_s_slategray1); Py_CLEAR(clear_module_state->__pyx_n_s_slategray2); Py_CLEAR(clear_module_state->__pyx_n_s_slategray3); Py_CLEAR(clear_module_state->__pyx_n_s_slategray4); Py_CLEAR(clear_module_state->__pyx_n_s_slategrey); Py_CLEAR(clear_module_state->__pyx_n_s_snow); Py_CLEAR(clear_module_state->__pyx_n_s_snow1); Py_CLEAR(clear_module_state->__pyx_n_s_snow2); Py_CLEAR(clear_module_state->__pyx_n_s_snow3); Py_CLEAR(clear_module_state->__pyx_n_s_snow4); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_split); Py_CLEAR(clear_module_state->__pyx_n_s_springgreen); Py_CLEAR(clear_module_state->__pyx_n_s_springgreen1); Py_CLEAR(clear_module_state->__pyx_n_s_springgreen2); Py_CLEAR(clear_module_state->__pyx_n_s_springgreen3); Py_CLEAR(clear_module_state->__pyx_n_s_springgreen4); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_color_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_startswith); Py_CLEAR(clear_module_state->__pyx_n_s_steelblue); Py_CLEAR(clear_module_state->__pyx_n_s_steelblue1); Py_CLEAR(clear_module_state->__pyx_n_s_steelblue2); Py_CLEAR(clear_module_state->__pyx_n_s_steelblue3); Py_CLEAR(clear_module_state->__pyx_n_s_steelblue4); Py_CLEAR(clear_module_state->__pyx_n_s_struct); Py_CLEAR(clear_module_state->__pyx_n_s_tan); Py_CLEAR(clear_module_state->__pyx_n_s_tan1); Py_CLEAR(clear_module_state->__pyx_n_s_tan2); Py_CLEAR(clear_module_state->__pyx_n_s_tan3); Py_CLEAR(clear_module_state->__pyx_n_s_tan4); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_thistle); Py_CLEAR(clear_module_state->__pyx_n_s_thistle1); Py_CLEAR(clear_module_state->__pyx_n_s_thistle2); Py_CLEAR(clear_module_state->__pyx_n_s_thistle3); Py_CLEAR(clear_module_state->__pyx_n_s_thistle4); Py_CLEAR(clear_module_state->__pyx_n_s_tomato); Py_CLEAR(clear_module_state->__pyx_n_s_tomato1); Py_CLEAR(clear_module_state->__pyx_n_s_tomato2); Py_CLEAR(clear_module_state->__pyx_n_s_tomato3); Py_CLEAR(clear_module_state->__pyx_n_s_tomato4); Py_CLEAR(clear_module_state->__pyx_n_s_turquoise); Py_CLEAR(clear_module_state->__pyx_n_s_turquoise1); Py_CLEAR(clear_module_state->__pyx_n_s_turquoise2); Py_CLEAR(clear_module_state->__pyx_n_s_turquoise3); Py_CLEAR(clear_module_state->__pyx_n_s_turquoise4); Py_CLEAR(clear_module_state->__pyx_n_s_unhexlify); Py_CLEAR(clear_module_state->__pyx_n_s_unpack); Py_CLEAR(clear_module_state->__pyx_n_s_violet); Py_CLEAR(clear_module_state->__pyx_n_s_violetred); Py_CLEAR(clear_module_state->__pyx_n_s_violetred1); Py_CLEAR(clear_module_state->__pyx_n_s_violetred2); Py_CLEAR(clear_module_state->__pyx_n_s_violetred3); Py_CLEAR(clear_module_state->__pyx_n_s_violetred4); Py_CLEAR(clear_module_state->__pyx_n_s_wheat); Py_CLEAR(clear_module_state->__pyx_n_s_wheat1); Py_CLEAR(clear_module_state->__pyx_n_s_wheat2); Py_CLEAR(clear_module_state->__pyx_n_s_wheat3); Py_CLEAR(clear_module_state->__pyx_n_s_wheat4); Py_CLEAR(clear_module_state->__pyx_n_s_white); Py_CLEAR(clear_module_state->__pyx_n_s_whitesmoke); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_yellow); Py_CLEAR(clear_module_state->__pyx_n_s_yellow1); Py_CLEAR(clear_module_state->__pyx_n_s_yellow2); Py_CLEAR(clear_module_state->__pyx_n_s_yellow3); Py_CLEAR(clear_module_state->__pyx_n_s_yellow4); Py_CLEAR(clear_module_state->__pyx_n_s_yellowgreen); Py_CLEAR(clear_module_state->__pyx_float_255_0); Py_CLEAR(clear_module_state->__pyx_float_360_0); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_3); Py_CLEAR(clear_module_state->__pyx_int_4); Py_CLEAR(clear_module_state->__pyx_int_5); Py_CLEAR(clear_module_state->__pyx_int_7); Py_CLEAR(clear_module_state->__pyx_int_8); Py_CLEAR(clear_module_state->__pyx_int_10); Py_CLEAR(clear_module_state->__pyx_int_11); Py_CLEAR(clear_module_state->__pyx_int_12); Py_CLEAR(clear_module_state->__pyx_int_13); Py_CLEAR(clear_module_state->__pyx_int_14); Py_CLEAR(clear_module_state->__pyx_int_15); Py_CLEAR(clear_module_state->__pyx_int_16); Py_CLEAR(clear_module_state->__pyx_int_18); Py_CLEAR(clear_module_state->__pyx_int_19); Py_CLEAR(clear_module_state->__pyx_int_20); Py_CLEAR(clear_module_state->__pyx_int_21); Py_CLEAR(clear_module_state->__pyx_int_23); Py_CLEAR(clear_module_state->__pyx_int_24); Py_CLEAR(clear_module_state->__pyx_int_25); Py_CLEAR(clear_module_state->__pyx_int_26); Py_CLEAR(clear_module_state->__pyx_int_28); Py_CLEAR(clear_module_state->__pyx_int_29); Py_CLEAR(clear_module_state->__pyx_int_30); Py_CLEAR(clear_module_state->__pyx_int_31); Py_CLEAR(clear_module_state->__pyx_int_32); Py_CLEAR(clear_module_state->__pyx_int_33); Py_CLEAR(clear_module_state->__pyx_int_34); Py_CLEAR(clear_module_state->__pyx_int_35); Py_CLEAR(clear_module_state->__pyx_int_36); Py_CLEAR(clear_module_state->__pyx_int_37); Py_CLEAR(clear_module_state->__pyx_int_38); Py_CLEAR(clear_module_state->__pyx_int_39); Py_CLEAR(clear_module_state->__pyx_int_41); Py_CLEAR(clear_module_state->__pyx_int_42); Py_CLEAR(clear_module_state->__pyx_int_43); Py_CLEAR(clear_module_state->__pyx_int_44); Py_CLEAR(clear_module_state->__pyx_int_45); Py_CLEAR(clear_module_state->__pyx_int_46); Py_CLEAR(clear_module_state->__pyx_int_47); Py_CLEAR(clear_module_state->__pyx_int_48); Py_CLEAR(clear_module_state->__pyx_int_50); Py_CLEAR(clear_module_state->__pyx_int_51); Py_CLEAR(clear_module_state->__pyx_int_52); Py_CLEAR(clear_module_state->__pyx_int_54); Py_CLEAR(clear_module_state->__pyx_int_55); Py_CLEAR(clear_module_state->__pyx_int_56); Py_CLEAR(clear_module_state->__pyx_int_57); Py_CLEAR(clear_module_state->__pyx_int_58); Py_CLEAR(clear_module_state->__pyx_int_59); Py_CLEAR(clear_module_state->__pyx_int_60); Py_CLEAR(clear_module_state->__pyx_int_61); Py_CLEAR(clear_module_state->__pyx_int_62); Py_CLEAR(clear_module_state->__pyx_int_63); Py_CLEAR(clear_module_state->__pyx_int_64); Py_CLEAR(clear_module_state->__pyx_int_65); Py_CLEAR(clear_module_state->__pyx_int_66); Py_CLEAR(clear_module_state->__pyx_int_67); Py_CLEAR(clear_module_state->__pyx_int_69); Py_CLEAR(clear_module_state->__pyx_int_70); Py_CLEAR(clear_module_state->__pyx_int_71); Py_CLEAR(clear_module_state->__pyx_int_72); Py_CLEAR(clear_module_state->__pyx_int_73); Py_CLEAR(clear_module_state->__pyx_int_74); Py_CLEAR(clear_module_state->__pyx_int_76); Py_CLEAR(clear_module_state->__pyx_int_77); Py_CLEAR(clear_module_state->__pyx_int_78); Py_CLEAR(clear_module_state->__pyx_int_79); Py_CLEAR(clear_module_state->__pyx_int_80); Py_CLEAR(clear_module_state->__pyx_int_81); Py_CLEAR(clear_module_state->__pyx_int_82); Py_CLEAR(clear_module_state->__pyx_int_83); Py_CLEAR(clear_module_state->__pyx_int_84); Py_CLEAR(clear_module_state->__pyx_int_85); Py_CLEAR(clear_module_state->__pyx_int_86); Py_CLEAR(clear_module_state->__pyx_int_87); Py_CLEAR(clear_module_state->__pyx_int_89); Py_CLEAR(clear_module_state->__pyx_int_90); Py_CLEAR(clear_module_state->__pyx_int_91); Py_CLEAR(clear_module_state->__pyx_int_92); Py_CLEAR(clear_module_state->__pyx_int_93); Py_CLEAR(clear_module_state->__pyx_int_94); Py_CLEAR(clear_module_state->__pyx_int_95); Py_CLEAR(clear_module_state->__pyx_int_96); Py_CLEAR(clear_module_state->__pyx_int_97); Py_CLEAR(clear_module_state->__pyx_int_98); Py_CLEAR(clear_module_state->__pyx_int_99); Py_CLEAR(clear_module_state->__pyx_int_100); Py_CLEAR(clear_module_state->__pyx_int_101); Py_CLEAR(clear_module_state->__pyx_int_102); Py_CLEAR(clear_module_state->__pyx_int_103); Py_CLEAR(clear_module_state->__pyx_int_104); Py_CLEAR(clear_module_state->__pyx_int_105); Py_CLEAR(clear_module_state->__pyx_int_106); Py_CLEAR(clear_module_state->__pyx_int_107); Py_CLEAR(clear_module_state->__pyx_int_108); Py_CLEAR(clear_module_state->__pyx_int_110); Py_CLEAR(clear_module_state->__pyx_int_111); Py_CLEAR(clear_module_state->__pyx_int_112); Py_CLEAR(clear_module_state->__pyx_int_113); Py_CLEAR(clear_module_state->__pyx_int_114); Py_CLEAR(clear_module_state->__pyx_int_115); Py_CLEAR(clear_module_state->__pyx_int_116); Py_CLEAR(clear_module_state->__pyx_int_117); Py_CLEAR(clear_module_state->__pyx_int_118); Py_CLEAR(clear_module_state->__pyx_int_119); Py_CLEAR(clear_module_state->__pyx_int_120); Py_CLEAR(clear_module_state->__pyx_int_121); Py_CLEAR(clear_module_state->__pyx_int_122); Py_CLEAR(clear_module_state->__pyx_int_123); Py_CLEAR(clear_module_state->__pyx_int_124); Py_CLEAR(clear_module_state->__pyx_int_125); Py_CLEAR(clear_module_state->__pyx_int_126); Py_CLEAR(clear_module_state->__pyx_int_127); Py_CLEAR(clear_module_state->__pyx_int_128); Py_CLEAR(clear_module_state->__pyx_int_129); Py_CLEAR(clear_module_state->__pyx_int_130); Py_CLEAR(clear_module_state->__pyx_int_131); Py_CLEAR(clear_module_state->__pyx_int_132); Py_CLEAR(clear_module_state->__pyx_int_133); Py_CLEAR(clear_module_state->__pyx_int_134); Py_CLEAR(clear_module_state->__pyx_int_135); Py_CLEAR(clear_module_state->__pyx_int_136); Py_CLEAR(clear_module_state->__pyx_int_137); Py_CLEAR(clear_module_state->__pyx_int_138); Py_CLEAR(clear_module_state->__pyx_int_139); Py_CLEAR(clear_module_state->__pyx_int_140); Py_CLEAR(clear_module_state->__pyx_int_141); Py_CLEAR(clear_module_state->__pyx_int_142); Py_CLEAR(clear_module_state->__pyx_int_143); Py_CLEAR(clear_module_state->__pyx_int_144); Py_CLEAR(clear_module_state->__pyx_int_145); Py_CLEAR(clear_module_state->__pyx_int_147); Py_CLEAR(clear_module_state->__pyx_int_148); Py_CLEAR(clear_module_state->__pyx_int_149); Py_CLEAR(clear_module_state->__pyx_int_150); Py_CLEAR(clear_module_state->__pyx_int_151); Py_CLEAR(clear_module_state->__pyx_int_152); Py_CLEAR(clear_module_state->__pyx_int_153); Py_CLEAR(clear_module_state->__pyx_int_154); Py_CLEAR(clear_module_state->__pyx_int_155); Py_CLEAR(clear_module_state->__pyx_int_156); Py_CLEAR(clear_module_state->__pyx_int_158); Py_CLEAR(clear_module_state->__pyx_int_159); Py_CLEAR(clear_module_state->__pyx_int_160); Py_CLEAR(clear_module_state->__pyx_int_161); Py_CLEAR(clear_module_state->__pyx_int_162); Py_CLEAR(clear_module_state->__pyx_int_163); Py_CLEAR(clear_module_state->__pyx_int_164); Py_CLEAR(clear_module_state->__pyx_int_165); Py_CLEAR(clear_module_state->__pyx_int_166); Py_CLEAR(clear_module_state->__pyx_int_167); Py_CLEAR(clear_module_state->__pyx_int_168); Py_CLEAR(clear_module_state->__pyx_int_169); Py_CLEAR(clear_module_state->__pyx_int_170); Py_CLEAR(clear_module_state->__pyx_int_171); Py_CLEAR(clear_module_state->__pyx_int_172); Py_CLEAR(clear_module_state->__pyx_int_173); Py_CLEAR(clear_module_state->__pyx_int_174); Py_CLEAR(clear_module_state->__pyx_int_175); Py_CLEAR(clear_module_state->__pyx_int_176); Py_CLEAR(clear_module_state->__pyx_int_177); Py_CLEAR(clear_module_state->__pyx_int_178); Py_CLEAR(clear_module_state->__pyx_int_179); Py_CLEAR(clear_module_state->__pyx_int_180); Py_CLEAR(clear_module_state->__pyx_int_181); Py_CLEAR(clear_module_state->__pyx_int_182); Py_CLEAR(clear_module_state->__pyx_int_183); Py_CLEAR(clear_module_state->__pyx_int_184); Py_CLEAR(clear_module_state->__pyx_int_185); Py_CLEAR(clear_module_state->__pyx_int_186); Py_CLEAR(clear_module_state->__pyx_int_187); Py_CLEAR(clear_module_state->__pyx_int_188); Py_CLEAR(clear_module_state->__pyx_int_189); Py_CLEAR(clear_module_state->__pyx_int_190); Py_CLEAR(clear_module_state->__pyx_int_191); Py_CLEAR(clear_module_state->__pyx_int_192); Py_CLEAR(clear_module_state->__pyx_int_193); Py_CLEAR(clear_module_state->__pyx_int_194); Py_CLEAR(clear_module_state->__pyx_int_196); Py_CLEAR(clear_module_state->__pyx_int_197); Py_CLEAR(clear_module_state->__pyx_int_198); Py_CLEAR(clear_module_state->__pyx_int_199); Py_CLEAR(clear_module_state->__pyx_int_200); Py_CLEAR(clear_module_state->__pyx_int_201); Py_CLEAR(clear_module_state->__pyx_int_202); Py_CLEAR(clear_module_state->__pyx_int_203); Py_CLEAR(clear_module_state->__pyx_int_204); Py_CLEAR(clear_module_state->__pyx_int_205); Py_CLEAR(clear_module_state->__pyx_int_206); Py_CLEAR(clear_module_state->__pyx_int_207); Py_CLEAR(clear_module_state->__pyx_int_208); Py_CLEAR(clear_module_state->__pyx_int_209); Py_CLEAR(clear_module_state->__pyx_int_210); Py_CLEAR(clear_module_state->__pyx_int_211); Py_CLEAR(clear_module_state->__pyx_int_212); Py_CLEAR(clear_module_state->__pyx_int_213); Py_CLEAR(clear_module_state->__pyx_int_214); Py_CLEAR(clear_module_state->__pyx_int_215); Py_CLEAR(clear_module_state->__pyx_int_216); Py_CLEAR(clear_module_state->__pyx_int_217); Py_CLEAR(clear_module_state->__pyx_int_218); Py_CLEAR(clear_module_state->__pyx_int_219); Py_CLEAR(clear_module_state->__pyx_int_220); Py_CLEAR(clear_module_state->__pyx_int_221); Py_CLEAR(clear_module_state->__pyx_int_222); Py_CLEAR(clear_module_state->__pyx_int_223); Py_CLEAR(clear_module_state->__pyx_int_224); Py_CLEAR(clear_module_state->__pyx_int_225); Py_CLEAR(clear_module_state->__pyx_int_226); Py_CLEAR(clear_module_state->__pyx_int_227); Py_CLEAR(clear_module_state->__pyx_int_228); Py_CLEAR(clear_module_state->__pyx_int_229); Py_CLEAR(clear_module_state->__pyx_int_230); Py_CLEAR(clear_module_state->__pyx_int_231); Py_CLEAR(clear_module_state->__pyx_int_232); Py_CLEAR(clear_module_state->__pyx_int_233); Py_CLEAR(clear_module_state->__pyx_int_235); Py_CLEAR(clear_module_state->__pyx_int_236); Py_CLEAR(clear_module_state->__pyx_int_237); Py_CLEAR(clear_module_state->__pyx_int_238); Py_CLEAR(clear_module_state->__pyx_int_239); Py_CLEAR(clear_module_state->__pyx_int_240); Py_CLEAR(clear_module_state->__pyx_int_242); Py_CLEAR(clear_module_state->__pyx_int_244); Py_CLEAR(clear_module_state->__pyx_int_245); Py_CLEAR(clear_module_state->__pyx_int_246); Py_CLEAR(clear_module_state->__pyx_int_247); Py_CLEAR(clear_module_state->__pyx_int_248); Py_CLEAR(clear_module_state->__pyx_int_250); Py_CLEAR(clear_module_state->__pyx_int_251); Py_CLEAR(clear_module_state->__pyx_int_252); Py_CLEAR(clear_module_state->__pyx_int_253); Py_CLEAR(clear_module_state->__pyx_int_255); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_slice__4); Py_CLEAR(clear_module_state->__pyx_slice__5); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__26); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__32); Py_CLEAR(clear_module_state->__pyx_tuple__33); Py_CLEAR(clear_module_state->__pyx_tuple__34); Py_CLEAR(clear_module_state->__pyx_tuple__35); Py_CLEAR(clear_module_state->__pyx_tuple__36); Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_tuple__38); Py_CLEAR(clear_module_state->__pyx_tuple__39); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__41); Py_CLEAR(clear_module_state->__pyx_tuple__42); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__44); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_tuple__46); Py_CLEAR(clear_module_state->__pyx_tuple__47); Py_CLEAR(clear_module_state->__pyx_tuple__48); Py_CLEAR(clear_module_state->__pyx_tuple__49); Py_CLEAR(clear_module_state->__pyx_tuple__50); Py_CLEAR(clear_module_state->__pyx_tuple__51); Py_CLEAR(clear_module_state->__pyx_tuple__52); Py_CLEAR(clear_module_state->__pyx_tuple__53); Py_CLEAR(clear_module_state->__pyx_tuple__54); Py_CLEAR(clear_module_state->__pyx_tuple__55); Py_CLEAR(clear_module_state->__pyx_tuple__56); Py_CLEAR(clear_module_state->__pyx_tuple__57); Py_CLEAR(clear_module_state->__pyx_tuple__58); Py_CLEAR(clear_module_state->__pyx_tuple__59); Py_CLEAR(clear_module_state->__pyx_tuple__60); Py_CLEAR(clear_module_state->__pyx_tuple__61); Py_CLEAR(clear_module_state->__pyx_tuple__62); Py_CLEAR(clear_module_state->__pyx_tuple__63); Py_CLEAR(clear_module_state->__pyx_tuple__64); Py_CLEAR(clear_module_state->__pyx_tuple__65); Py_CLEAR(clear_module_state->__pyx_tuple__66); Py_CLEAR(clear_module_state->__pyx_tuple__67); Py_CLEAR(clear_module_state->__pyx_tuple__68); Py_CLEAR(clear_module_state->__pyx_tuple__69); Py_CLEAR(clear_module_state->__pyx_tuple__70); Py_CLEAR(clear_module_state->__pyx_tuple__71); Py_CLEAR(clear_module_state->__pyx_tuple__72); Py_CLEAR(clear_module_state->__pyx_tuple__73); Py_CLEAR(clear_module_state->__pyx_tuple__74); Py_CLEAR(clear_module_state->__pyx_tuple__75); Py_CLEAR(clear_module_state->__pyx_tuple__76); Py_CLEAR(clear_module_state->__pyx_tuple__77); Py_CLEAR(clear_module_state->__pyx_tuple__78); Py_CLEAR(clear_module_state->__pyx_tuple__79); Py_CLEAR(clear_module_state->__pyx_tuple__80); Py_CLEAR(clear_module_state->__pyx_tuple__81); Py_CLEAR(clear_module_state->__pyx_tuple__82); Py_CLEAR(clear_module_state->__pyx_tuple__83); Py_CLEAR(clear_module_state->__pyx_tuple__84); Py_CLEAR(clear_module_state->__pyx_tuple__85); Py_CLEAR(clear_module_state->__pyx_tuple__86); Py_CLEAR(clear_module_state->__pyx_tuple__87); Py_CLEAR(clear_module_state->__pyx_tuple__88); Py_CLEAR(clear_module_state->__pyx_tuple__89); Py_CLEAR(clear_module_state->__pyx_tuple__90); Py_CLEAR(clear_module_state->__pyx_tuple__91); Py_CLEAR(clear_module_state->__pyx_tuple__92); Py_CLEAR(clear_module_state->__pyx_tuple__93); Py_CLEAR(clear_module_state->__pyx_tuple__94); Py_CLEAR(clear_module_state->__pyx_tuple__95); Py_CLEAR(clear_module_state->__pyx_tuple__96); Py_CLEAR(clear_module_state->__pyx_tuple__97); Py_CLEAR(clear_module_state->__pyx_tuple__98); Py_CLEAR(clear_module_state->__pyx_tuple__99); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_tuple__100); Py_CLEAR(clear_module_state->__pyx_tuple__101); Py_CLEAR(clear_module_state->__pyx_tuple__102); Py_CLEAR(clear_module_state->__pyx_tuple__103); Py_CLEAR(clear_module_state->__pyx_tuple__104); Py_CLEAR(clear_module_state->__pyx_tuple__105); Py_CLEAR(clear_module_state->__pyx_tuple__106); Py_CLEAR(clear_module_state->__pyx_tuple__107); Py_CLEAR(clear_module_state->__pyx_tuple__108); Py_CLEAR(clear_module_state->__pyx_tuple__109); Py_CLEAR(clear_module_state->__pyx_tuple__110); Py_CLEAR(clear_module_state->__pyx_tuple__111); Py_CLEAR(clear_module_state->__pyx_tuple__112); Py_CLEAR(clear_module_state->__pyx_tuple__113); Py_CLEAR(clear_module_state->__pyx_tuple__114); Py_CLEAR(clear_module_state->__pyx_tuple__115); Py_CLEAR(clear_module_state->__pyx_tuple__116); Py_CLEAR(clear_module_state->__pyx_tuple__117); Py_CLEAR(clear_module_state->__pyx_tuple__118); Py_CLEAR(clear_module_state->__pyx_tuple__119); Py_CLEAR(clear_module_state->__pyx_tuple__120); Py_CLEAR(clear_module_state->__pyx_tuple__121); Py_CLEAR(clear_module_state->__pyx_tuple__122); Py_CLEAR(clear_module_state->__pyx_tuple__123); Py_CLEAR(clear_module_state->__pyx_tuple__124); Py_CLEAR(clear_module_state->__pyx_tuple__125); Py_CLEAR(clear_module_state->__pyx_tuple__126); Py_CLEAR(clear_module_state->__pyx_tuple__127); Py_CLEAR(clear_module_state->__pyx_tuple__128); Py_CLEAR(clear_module_state->__pyx_tuple__129); Py_CLEAR(clear_module_state->__pyx_tuple__130); Py_CLEAR(clear_module_state->__pyx_tuple__131); Py_CLEAR(clear_module_state->__pyx_tuple__132); Py_CLEAR(clear_module_state->__pyx_tuple__133); Py_CLEAR(clear_module_state->__pyx_tuple__134); Py_CLEAR(clear_module_state->__pyx_tuple__135); Py_CLEAR(clear_module_state->__pyx_tuple__136); Py_CLEAR(clear_module_state->__pyx_tuple__137); Py_CLEAR(clear_module_state->__pyx_tuple__138); Py_CLEAR(clear_module_state->__pyx_tuple__139); Py_CLEAR(clear_module_state->__pyx_tuple__140); Py_CLEAR(clear_module_state->__pyx_tuple__141); Py_CLEAR(clear_module_state->__pyx_tuple__142); Py_CLEAR(clear_module_state->__pyx_tuple__143); Py_CLEAR(clear_module_state->__pyx_tuple__144); Py_CLEAR(clear_module_state->__pyx_tuple__145); Py_CLEAR(clear_module_state->__pyx_tuple__146); Py_CLEAR(clear_module_state->__pyx_tuple__147); Py_CLEAR(clear_module_state->__pyx_tuple__148); Py_CLEAR(clear_module_state->__pyx_tuple__149); Py_CLEAR(clear_module_state->__pyx_tuple__150); Py_CLEAR(clear_module_state->__pyx_tuple__151); Py_CLEAR(clear_module_state->__pyx_tuple__152); Py_CLEAR(clear_module_state->__pyx_tuple__153); Py_CLEAR(clear_module_state->__pyx_tuple__154); Py_CLEAR(clear_module_state->__pyx_tuple__155); Py_CLEAR(clear_module_state->__pyx_tuple__156); Py_CLEAR(clear_module_state->__pyx_tuple__157); Py_CLEAR(clear_module_state->__pyx_tuple__158); Py_CLEAR(clear_module_state->__pyx_tuple__159); Py_CLEAR(clear_module_state->__pyx_tuple__160); Py_CLEAR(clear_module_state->__pyx_tuple__161); Py_CLEAR(clear_module_state->__pyx_tuple__162); Py_CLEAR(clear_module_state->__pyx_tuple__163); Py_CLEAR(clear_module_state->__pyx_tuple__164); Py_CLEAR(clear_module_state->__pyx_tuple__165); Py_CLEAR(clear_module_state->__pyx_tuple__166); Py_CLEAR(clear_module_state->__pyx_tuple__167); Py_CLEAR(clear_module_state->__pyx_tuple__168); Py_CLEAR(clear_module_state->__pyx_tuple__169); Py_CLEAR(clear_module_state->__pyx_tuple__170); Py_CLEAR(clear_module_state->__pyx_tuple__171); Py_CLEAR(clear_module_state->__pyx_tuple__172); Py_CLEAR(clear_module_state->__pyx_tuple__173); Py_CLEAR(clear_module_state->__pyx_tuple__174); Py_CLEAR(clear_module_state->__pyx_tuple__175); Py_CLEAR(clear_module_state->__pyx_tuple__176); Py_CLEAR(clear_module_state->__pyx_tuple__177); Py_CLEAR(clear_module_state->__pyx_tuple__178); Py_CLEAR(clear_module_state->__pyx_tuple__179); Py_CLEAR(clear_module_state->__pyx_tuple__180); Py_CLEAR(clear_module_state->__pyx_tuple__181); Py_CLEAR(clear_module_state->__pyx_tuple__182); Py_CLEAR(clear_module_state->__pyx_tuple__183); Py_CLEAR(clear_module_state->__pyx_tuple__184); Py_CLEAR(clear_module_state->__pyx_tuple__185); Py_CLEAR(clear_module_state->__pyx_tuple__186); Py_CLEAR(clear_module_state->__pyx_tuple__187); Py_CLEAR(clear_module_state->__pyx_tuple__188); Py_CLEAR(clear_module_state->__pyx_tuple__189); Py_CLEAR(clear_module_state->__pyx_tuple__190); Py_CLEAR(clear_module_state->__pyx_tuple__191); Py_CLEAR(clear_module_state->__pyx_tuple__192); Py_CLEAR(clear_module_state->__pyx_tuple__193); Py_CLEAR(clear_module_state->__pyx_tuple__194); Py_CLEAR(clear_module_state->__pyx_tuple__195); Py_CLEAR(clear_module_state->__pyx_tuple__196); Py_CLEAR(clear_module_state->__pyx_tuple__197); Py_CLEAR(clear_module_state->__pyx_tuple__198); Py_CLEAR(clear_module_state->__pyx_tuple__199); Py_CLEAR(clear_module_state->__pyx_tuple__200); Py_CLEAR(clear_module_state->__pyx_tuple__201); Py_CLEAR(clear_module_state->__pyx_tuple__202); Py_CLEAR(clear_module_state->__pyx_tuple__203); Py_CLEAR(clear_module_state->__pyx_tuple__204); Py_CLEAR(clear_module_state->__pyx_tuple__205); Py_CLEAR(clear_module_state->__pyx_tuple__206); Py_CLEAR(clear_module_state->__pyx_tuple__207); Py_CLEAR(clear_module_state->__pyx_tuple__208); Py_CLEAR(clear_module_state->__pyx_tuple__209); Py_CLEAR(clear_module_state->__pyx_tuple__210); Py_CLEAR(clear_module_state->__pyx_tuple__211); Py_CLEAR(clear_module_state->__pyx_tuple__212); Py_CLEAR(clear_module_state->__pyx_tuple__213); Py_CLEAR(clear_module_state->__pyx_tuple__214); Py_CLEAR(clear_module_state->__pyx_tuple__215); Py_CLEAR(clear_module_state->__pyx_tuple__216); Py_CLEAR(clear_module_state->__pyx_tuple__217); Py_CLEAR(clear_module_state->__pyx_tuple__218); Py_CLEAR(clear_module_state->__pyx_tuple__219); Py_CLEAR(clear_module_state->__pyx_tuple__220); Py_CLEAR(clear_module_state->__pyx_tuple__221); Py_CLEAR(clear_module_state->__pyx_tuple__222); Py_CLEAR(clear_module_state->__pyx_tuple__223); Py_CLEAR(clear_module_state->__pyx_tuple__224); Py_CLEAR(clear_module_state->__pyx_tuple__225); Py_CLEAR(clear_module_state->__pyx_tuple__226); Py_CLEAR(clear_module_state->__pyx_tuple__227); Py_CLEAR(clear_module_state->__pyx_tuple__228); Py_CLEAR(clear_module_state->__pyx_tuple__229); Py_CLEAR(clear_module_state->__pyx_tuple__230); Py_CLEAR(clear_module_state->__pyx_tuple__231); Py_CLEAR(clear_module_state->__pyx_tuple__232); Py_CLEAR(clear_module_state->__pyx_tuple__233); Py_CLEAR(clear_module_state->__pyx_tuple__234); Py_CLEAR(clear_module_state->__pyx_tuple__235); Py_CLEAR(clear_module_state->__pyx_tuple__236); Py_CLEAR(clear_module_state->__pyx_tuple__237); Py_CLEAR(clear_module_state->__pyx_tuple__238); Py_CLEAR(clear_module_state->__pyx_tuple__239); Py_CLEAR(clear_module_state->__pyx_tuple__240); Py_CLEAR(clear_module_state->__pyx_tuple__241); Py_CLEAR(clear_module_state->__pyx_tuple__242); Py_CLEAR(clear_module_state->__pyx_tuple__243); Py_CLEAR(clear_module_state->__pyx_tuple__244); Py_CLEAR(clear_module_state->__pyx_tuple__245); Py_CLEAR(clear_module_state->__pyx_tuple__246); Py_CLEAR(clear_module_state->__pyx_tuple__247); Py_CLEAR(clear_module_state->__pyx_tuple__248); Py_CLEAR(clear_module_state->__pyx_tuple__249); Py_CLEAR(clear_module_state->__pyx_tuple__250); Py_CLEAR(clear_module_state->__pyx_tuple__251); Py_CLEAR(clear_module_state->__pyx_tuple__252); Py_CLEAR(clear_module_state->__pyx_tuple__253); Py_CLEAR(clear_module_state->__pyx_tuple__254); Py_CLEAR(clear_module_state->__pyx_tuple__255); Py_CLEAR(clear_module_state->__pyx_tuple__256); Py_CLEAR(clear_module_state->__pyx_tuple__257); Py_CLEAR(clear_module_state->__pyx_tuple__258); Py_CLEAR(clear_module_state->__pyx_tuple__259); Py_CLEAR(clear_module_state->__pyx_tuple__260); Py_CLEAR(clear_module_state->__pyx_tuple__261); Py_CLEAR(clear_module_state->__pyx_tuple__262); Py_CLEAR(clear_module_state->__pyx_tuple__263); Py_CLEAR(clear_module_state->__pyx_tuple__264); Py_CLEAR(clear_module_state->__pyx_tuple__265); Py_CLEAR(clear_module_state->__pyx_tuple__266); Py_CLEAR(clear_module_state->__pyx_tuple__267); Py_CLEAR(clear_module_state->__pyx_tuple__268); Py_CLEAR(clear_module_state->__pyx_tuple__269); Py_CLEAR(clear_module_state->__pyx_tuple__270); Py_CLEAR(clear_module_state->__pyx_tuple__271); Py_CLEAR(clear_module_state->__pyx_tuple__272); Py_CLEAR(clear_module_state->__pyx_tuple__273); Py_CLEAR(clear_module_state->__pyx_tuple__274); Py_CLEAR(clear_module_state->__pyx_tuple__275); Py_CLEAR(clear_module_state->__pyx_tuple__276); Py_CLEAR(clear_module_state->__pyx_tuple__277); Py_CLEAR(clear_module_state->__pyx_tuple__278); Py_CLEAR(clear_module_state->__pyx_tuple__279); Py_CLEAR(clear_module_state->__pyx_tuple__280); Py_CLEAR(clear_module_state->__pyx_tuple__281); Py_CLEAR(clear_module_state->__pyx_tuple__282); Py_CLEAR(clear_module_state->__pyx_tuple__283); Py_CLEAR(clear_module_state->__pyx_tuple__284); Py_CLEAR(clear_module_state->__pyx_tuple__285); Py_CLEAR(clear_module_state->__pyx_tuple__286); Py_CLEAR(clear_module_state->__pyx_tuple__287); Py_CLEAR(clear_module_state->__pyx_tuple__288); Py_CLEAR(clear_module_state->__pyx_tuple__289); Py_CLEAR(clear_module_state->__pyx_tuple__290); Py_CLEAR(clear_module_state->__pyx_tuple__291); Py_CLEAR(clear_module_state->__pyx_tuple__292); Py_CLEAR(clear_module_state->__pyx_tuple__293); Py_CLEAR(clear_module_state->__pyx_tuple__294); Py_CLEAR(clear_module_state->__pyx_tuple__295); Py_CLEAR(clear_module_state->__pyx_tuple__296); Py_CLEAR(clear_module_state->__pyx_tuple__297); Py_CLEAR(clear_module_state->__pyx_tuple__298); Py_CLEAR(clear_module_state->__pyx_tuple__299); Py_CLEAR(clear_module_state->__pyx_tuple__300); Py_CLEAR(clear_module_state->__pyx_tuple__301); Py_CLEAR(clear_module_state->__pyx_tuple__302); Py_CLEAR(clear_module_state->__pyx_tuple__303); Py_CLEAR(clear_module_state->__pyx_tuple__304); Py_CLEAR(clear_module_state->__pyx_tuple__305); Py_CLEAR(clear_module_state->__pyx_tuple__306); Py_CLEAR(clear_module_state->__pyx_tuple__307); Py_CLEAR(clear_module_state->__pyx_tuple__308); Py_CLEAR(clear_module_state->__pyx_tuple__309); Py_CLEAR(clear_module_state->__pyx_tuple__310); Py_CLEAR(clear_module_state->__pyx_tuple__311); Py_CLEAR(clear_module_state->__pyx_tuple__312); Py_CLEAR(clear_module_state->__pyx_tuple__313); Py_CLEAR(clear_module_state->__pyx_tuple__314); Py_CLEAR(clear_module_state->__pyx_tuple__315); Py_CLEAR(clear_module_state->__pyx_tuple__316); Py_CLEAR(clear_module_state->__pyx_tuple__317); Py_CLEAR(clear_module_state->__pyx_tuple__318); Py_CLEAR(clear_module_state->__pyx_tuple__319); Py_CLEAR(clear_module_state->__pyx_tuple__320); Py_CLEAR(clear_module_state->__pyx_tuple__321); Py_CLEAR(clear_module_state->__pyx_tuple__322); Py_CLEAR(clear_module_state->__pyx_tuple__323); Py_CLEAR(clear_module_state->__pyx_tuple__324); Py_CLEAR(clear_module_state->__pyx_tuple__325); Py_CLEAR(clear_module_state->__pyx_tuple__326); Py_CLEAR(clear_module_state->__pyx_tuple__327); Py_CLEAR(clear_module_state->__pyx_tuple__328); Py_CLEAR(clear_module_state->__pyx_tuple__329); Py_CLEAR(clear_module_state->__pyx_tuple__330); Py_CLEAR(clear_module_state->__pyx_tuple__331); Py_CLEAR(clear_module_state->__pyx_tuple__332); Py_CLEAR(clear_module_state->__pyx_tuple__333); Py_CLEAR(clear_module_state->__pyx_tuple__334); Py_CLEAR(clear_module_state->__pyx_tuple__335); Py_CLEAR(clear_module_state->__pyx_tuple__336); Py_CLEAR(clear_module_state->__pyx_tuple__337); Py_CLEAR(clear_module_state->__pyx_tuple__338); Py_CLEAR(clear_module_state->__pyx_tuple__339); Py_CLEAR(clear_module_state->__pyx_tuple__340); Py_CLEAR(clear_module_state->__pyx_tuple__341); Py_CLEAR(clear_module_state->__pyx_tuple__342); Py_CLEAR(clear_module_state->__pyx_tuple__343); Py_CLEAR(clear_module_state->__pyx_tuple__344); Py_CLEAR(clear_module_state->__pyx_tuple__345); Py_CLEAR(clear_module_state->__pyx_tuple__346); Py_CLEAR(clear_module_state->__pyx_tuple__347); Py_CLEAR(clear_module_state->__pyx_tuple__348); Py_CLEAR(clear_module_state->__pyx_tuple__349); Py_CLEAR(clear_module_state->__pyx_tuple__350); Py_CLEAR(clear_module_state->__pyx_tuple__351); Py_CLEAR(clear_module_state->__pyx_tuple__352); Py_CLEAR(clear_module_state->__pyx_tuple__353); Py_CLEAR(clear_module_state->__pyx_tuple__354); Py_CLEAR(clear_module_state->__pyx_tuple__355); Py_CLEAR(clear_module_state->__pyx_tuple__356); Py_CLEAR(clear_module_state->__pyx_tuple__357); Py_CLEAR(clear_module_state->__pyx_tuple__358); Py_CLEAR(clear_module_state->__pyx_tuple__359); Py_CLEAR(clear_module_state->__pyx_tuple__360); Py_CLEAR(clear_module_state->__pyx_tuple__361); Py_CLEAR(clear_module_state->__pyx_tuple__362); Py_CLEAR(clear_module_state->__pyx_tuple__363); Py_CLEAR(clear_module_state->__pyx_tuple__364); Py_CLEAR(clear_module_state->__pyx_tuple__365); Py_CLEAR(clear_module_state->__pyx_tuple__366); Py_CLEAR(clear_module_state->__pyx_tuple__367); Py_CLEAR(clear_module_state->__pyx_tuple__368); Py_CLEAR(clear_module_state->__pyx_tuple__369); Py_CLEAR(clear_module_state->__pyx_tuple__370); Py_CLEAR(clear_module_state->__pyx_tuple__371); Py_CLEAR(clear_module_state->__pyx_tuple__372); Py_CLEAR(clear_module_state->__pyx_tuple__373); Py_CLEAR(clear_module_state->__pyx_tuple__374); Py_CLEAR(clear_module_state->__pyx_tuple__375); Py_CLEAR(clear_module_state->__pyx_tuple__376); Py_CLEAR(clear_module_state->__pyx_tuple__377); Py_CLEAR(clear_module_state->__pyx_tuple__378); Py_CLEAR(clear_module_state->__pyx_tuple__379); Py_CLEAR(clear_module_state->__pyx_tuple__380); Py_CLEAR(clear_module_state->__pyx_tuple__381); Py_CLEAR(clear_module_state->__pyx_tuple__382); Py_CLEAR(clear_module_state->__pyx_tuple__383); Py_CLEAR(clear_module_state->__pyx_tuple__384); Py_CLEAR(clear_module_state->__pyx_tuple__385); Py_CLEAR(clear_module_state->__pyx_tuple__386); Py_CLEAR(clear_module_state->__pyx_tuple__387); Py_CLEAR(clear_module_state->__pyx_tuple__388); Py_CLEAR(clear_module_state->__pyx_tuple__389); Py_CLEAR(clear_module_state->__pyx_tuple__390); Py_CLEAR(clear_module_state->__pyx_tuple__391); Py_CLEAR(clear_module_state->__pyx_tuple__392); Py_CLEAR(clear_module_state->__pyx_tuple__393); Py_CLEAR(clear_module_state->__pyx_tuple__394); Py_CLEAR(clear_module_state->__pyx_tuple__395); Py_CLEAR(clear_module_state->__pyx_tuple__396); Py_CLEAR(clear_module_state->__pyx_tuple__397); Py_CLEAR(clear_module_state->__pyx_tuple__398); Py_CLEAR(clear_module_state->__pyx_tuple__399); Py_CLEAR(clear_module_state->__pyx_tuple__400); Py_CLEAR(clear_module_state->__pyx_tuple__401); Py_CLEAR(clear_module_state->__pyx_tuple__402); Py_CLEAR(clear_module_state->__pyx_tuple__403); Py_CLEAR(clear_module_state->__pyx_tuple__404); Py_CLEAR(clear_module_state->__pyx_tuple__405); Py_CLEAR(clear_module_state->__pyx_tuple__406); Py_CLEAR(clear_module_state->__pyx_tuple__407); Py_CLEAR(clear_module_state->__pyx_tuple__408); Py_CLEAR(clear_module_state->__pyx_tuple__409); Py_CLEAR(clear_module_state->__pyx_tuple__410); Py_CLEAR(clear_module_state->__pyx_tuple__411); Py_CLEAR(clear_module_state->__pyx_tuple__412); Py_CLEAR(clear_module_state->__pyx_tuple__413); Py_CLEAR(clear_module_state->__pyx_tuple__414); Py_CLEAR(clear_module_state->__pyx_tuple__415); Py_CLEAR(clear_module_state->__pyx_tuple__416); Py_CLEAR(clear_module_state->__pyx_tuple__417); Py_CLEAR(clear_module_state->__pyx_tuple__418); Py_CLEAR(clear_module_state->__pyx_tuple__419); Py_CLEAR(clear_module_state->__pyx_tuple__420); Py_CLEAR(clear_module_state->__pyx_tuple__421); Py_CLEAR(clear_module_state->__pyx_tuple__422); Py_CLEAR(clear_module_state->__pyx_tuple__423); Py_CLEAR(clear_module_state->__pyx_tuple__424); Py_CLEAR(clear_module_state->__pyx_tuple__425); Py_CLEAR(clear_module_state->__pyx_tuple__426); Py_CLEAR(clear_module_state->__pyx_tuple__427); Py_CLEAR(clear_module_state->__pyx_tuple__428); Py_CLEAR(clear_module_state->__pyx_tuple__429); Py_CLEAR(clear_module_state->__pyx_tuple__430); Py_CLEAR(clear_module_state->__pyx_tuple__431); Py_CLEAR(clear_module_state->__pyx_tuple__432); Py_CLEAR(clear_module_state->__pyx_tuple__433); Py_CLEAR(clear_module_state->__pyx_tuple__434); Py_CLEAR(clear_module_state->__pyx_tuple__435); Py_CLEAR(clear_module_state->__pyx_tuple__436); Py_CLEAR(clear_module_state->__pyx_tuple__437); Py_CLEAR(clear_module_state->__pyx_tuple__438); Py_CLEAR(clear_module_state->__pyx_tuple__439); Py_CLEAR(clear_module_state->__pyx_tuple__440); Py_CLEAR(clear_module_state->__pyx_tuple__441); Py_CLEAR(clear_module_state->__pyx_tuple__442); Py_CLEAR(clear_module_state->__pyx_tuple__443); Py_CLEAR(clear_module_state->__pyx_tuple__444); Py_CLEAR(clear_module_state->__pyx_tuple__445); Py_CLEAR(clear_module_state->__pyx_tuple__446); Py_CLEAR(clear_module_state->__pyx_tuple__447); Py_CLEAR(clear_module_state->__pyx_tuple__448); Py_CLEAR(clear_module_state->__pyx_tuple__449); Py_CLEAR(clear_module_state->__pyx_tuple__450); Py_CLEAR(clear_module_state->__pyx_tuple__451); Py_CLEAR(clear_module_state->__pyx_tuple__452); Py_CLEAR(clear_module_state->__pyx_tuple__453); Py_CLEAR(clear_module_state->__pyx_tuple__454); Py_CLEAR(clear_module_state->__pyx_tuple__455); Py_CLEAR(clear_module_state->__pyx_tuple__456); Py_CLEAR(clear_module_state->__pyx_tuple__457); Py_CLEAR(clear_module_state->__pyx_tuple__458); Py_CLEAR(clear_module_state->__pyx_tuple__459); Py_CLEAR(clear_module_state->__pyx_tuple__460); Py_CLEAR(clear_module_state->__pyx_tuple__461); Py_CLEAR(clear_module_state->__pyx_tuple__462); Py_CLEAR(clear_module_state->__pyx_tuple__463); Py_CLEAR(clear_module_state->__pyx_tuple__464); Py_CLEAR(clear_module_state->__pyx_tuple__465); Py_CLEAR(clear_module_state->__pyx_tuple__466); Py_CLEAR(clear_module_state->__pyx_tuple__467); Py_CLEAR(clear_module_state->__pyx_tuple__468); Py_CLEAR(clear_module_state->__pyx_tuple__469); Py_CLEAR(clear_module_state->__pyx_tuple__470); Py_CLEAR(clear_module_state->__pyx_tuple__471); Py_CLEAR(clear_module_state->__pyx_tuple__472); Py_CLEAR(clear_module_state->__pyx_tuple__473); Py_CLEAR(clear_module_state->__pyx_tuple__474); Py_CLEAR(clear_module_state->__pyx_tuple__475); Py_CLEAR(clear_module_state->__pyx_tuple__476); Py_CLEAR(clear_module_state->__pyx_tuple__477); Py_CLEAR(clear_module_state->__pyx_tuple__478); Py_CLEAR(clear_module_state->__pyx_tuple__479); Py_CLEAR(clear_module_state->__pyx_tuple__480); Py_CLEAR(clear_module_state->__pyx_tuple__481); Py_CLEAR(clear_module_state->__pyx_tuple__482); Py_CLEAR(clear_module_state->__pyx_tuple__483); Py_CLEAR(clear_module_state->__pyx_tuple__484); Py_CLEAR(clear_module_state->__pyx_tuple__485); Py_CLEAR(clear_module_state->__pyx_tuple__486); Py_CLEAR(clear_module_state->__pyx_tuple__487); Py_CLEAR(clear_module_state->__pyx_tuple__488); Py_CLEAR(clear_module_state->__pyx_tuple__489); Py_CLEAR(clear_module_state->__pyx_tuple__490); Py_CLEAR(clear_module_state->__pyx_tuple__491); Py_CLEAR(clear_module_state->__pyx_tuple__492); Py_CLEAR(clear_module_state->__pyx_tuple__493); Py_CLEAR(clear_module_state->__pyx_tuple__494); Py_CLEAR(clear_module_state->__pyx_tuple__495); Py_CLEAR(clear_module_state->__pyx_tuple__496); Py_CLEAR(clear_module_state->__pyx_tuple__497); Py_CLEAR(clear_module_state->__pyx_tuple__498); Py_CLEAR(clear_module_state->__pyx_tuple__499); Py_CLEAR(clear_module_state->__pyx_tuple__500); Py_CLEAR(clear_module_state->__pyx_tuple__501); Py_CLEAR(clear_module_state->__pyx_tuple__502); Py_CLEAR(clear_module_state->__pyx_tuple__503); Py_CLEAR(clear_module_state->__pyx_tuple__504); Py_CLEAR(clear_module_state->__pyx_tuple__505); Py_CLEAR(clear_module_state->__pyx_tuple__506); Py_CLEAR(clear_module_state->__pyx_tuple__507); Py_CLEAR(clear_module_state->__pyx_tuple__508); Py_CLEAR(clear_module_state->__pyx_tuple__509); Py_CLEAR(clear_module_state->__pyx_tuple__510); Py_CLEAR(clear_module_state->__pyx_tuple__511); Py_CLEAR(clear_module_state->__pyx_tuple__512); Py_CLEAR(clear_module_state->__pyx_tuple__513); Py_CLEAR(clear_module_state->__pyx_tuple__514); Py_CLEAR(clear_module_state->__pyx_tuple__517); Py_CLEAR(clear_module_state->__pyx_tuple__519); Py_CLEAR(clear_module_state->__pyx_tuple__521); Py_CLEAR(clear_module_state->__pyx_codeobj__515); Py_CLEAR(clear_module_state->__pyx_codeobj__516); Py_CLEAR(clear_module_state->__pyx_codeobj__518); Py_CLEAR(clear_module_state->__pyx_codeobj__520); Py_CLEAR(clear_module_state->__pyx_codeobj__522); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_5color_Color); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma); Py_VISIT(traverse_module_state->__pyx_kp_s_08x); Py_VISIT(traverse_module_state->__pyx_kp_s_0x); Py_VISIT(traverse_module_state->__pyx_n_s_BBB); Py_VISIT(traverse_module_state->__pyx_n_s_BBBB); Py_VISIT(traverse_module_state->__pyx_n_s_Color); Py_VISIT(traverse_module_state->__pyx_n_s_Color___reduce); Py_VISIT(traverse_module_state->__pyx_n_s_Color___setstate); Py_VISIT(traverse_module_state->__pyx_n_s_Color_correct_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_Color_from_hex_locals_lambda); Py_VISIT(traverse_module_state->__pyx_n_s_Color_normalize); Py_VISIT(traverse_module_state->__pyx_n_s_Color_set_length); Py_VISIT(traverse_module_state->__pyx_kp_s_Expected_a_color); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); Py_VISIT(traverse_module_state->__pyx_kp_s_L); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_n_s__10); Py_VISIT(traverse_module_state->__pyx_kp_s__2); Py_VISIT(traverse_module_state->__pyx_kp_s__3); Py_VISIT(traverse_module_state->__pyx_n_s__523); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_s_aliceblue); Py_VISIT(traverse_module_state->__pyx_n_s_antiquewhite); Py_VISIT(traverse_module_state->__pyx_n_s_antiquewhite1); Py_VISIT(traverse_module_state->__pyx_n_s_antiquewhite2); Py_VISIT(traverse_module_state->__pyx_n_s_antiquewhite3); Py_VISIT(traverse_module_state->__pyx_n_s_antiquewhite4); Py_VISIT(traverse_module_state->__pyx_n_s_aquamarine); Py_VISIT(traverse_module_state->__pyx_n_s_aquamarine1); Py_VISIT(traverse_module_state->__pyx_n_s_aquamarine2); Py_VISIT(traverse_module_state->__pyx_n_s_aquamarine3); Py_VISIT(traverse_module_state->__pyx_n_s_aquamarine4); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_azure); Py_VISIT(traverse_module_state->__pyx_n_s_azure1); Py_VISIT(traverse_module_state->__pyx_n_s_azure2); Py_VISIT(traverse_module_state->__pyx_n_s_azure3); Py_VISIT(traverse_module_state->__pyx_n_s_azure4); Py_VISIT(traverse_module_state->__pyx_n_s_b); Py_VISIT(traverse_module_state->__pyx_n_s_beige); Py_VISIT(traverse_module_state->__pyx_n_s_binascii); Py_VISIT(traverse_module_state->__pyx_n_s_bisque); Py_VISIT(traverse_module_state->__pyx_n_s_bisque1); Py_VISIT(traverse_module_state->__pyx_n_s_bisque2); Py_VISIT(traverse_module_state->__pyx_n_s_bisque3); Py_VISIT(traverse_module_state->__pyx_n_s_bisque4); Py_VISIT(traverse_module_state->__pyx_n_s_black); Py_VISIT(traverse_module_state->__pyx_n_s_blanchedalmond); Py_VISIT(traverse_module_state->__pyx_n_s_blue); Py_VISIT(traverse_module_state->__pyx_n_s_blue1); Py_VISIT(traverse_module_state->__pyx_n_s_blue2); Py_VISIT(traverse_module_state->__pyx_n_s_blue3); Py_VISIT(traverse_module_state->__pyx_n_s_blue4); Py_VISIT(traverse_module_state->__pyx_n_s_blueviolet); Py_VISIT(traverse_module_state->__pyx_n_s_brown); Py_VISIT(traverse_module_state->__pyx_n_s_brown1); Py_VISIT(traverse_module_state->__pyx_n_s_brown2); Py_VISIT(traverse_module_state->__pyx_n_s_brown3); Py_VISIT(traverse_module_state->__pyx_n_s_brown4); Py_VISIT(traverse_module_state->__pyx_n_s_burlywood); Py_VISIT(traverse_module_state->__pyx_n_s_burlywood1); Py_VISIT(traverse_module_state->__pyx_n_s_burlywood2); Py_VISIT(traverse_module_state->__pyx_n_s_burlywood3); Py_VISIT(traverse_module_state->__pyx_n_s_burlywood4); Py_VISIT(traverse_module_state->__pyx_n_s_c); Py_VISIT(traverse_module_state->__pyx_n_s_cadetblue); Py_VISIT(traverse_module_state->__pyx_n_s_cadetblue1); Py_VISIT(traverse_module_state->__pyx_n_s_cadetblue2); Py_VISIT(traverse_module_state->__pyx_n_s_cadetblue3); Py_VISIT(traverse_module_state->__pyx_n_s_cadetblue4); Py_VISIT(traverse_module_state->__pyx_n_s_chartreuse); Py_VISIT(traverse_module_state->__pyx_n_s_chartreuse1); Py_VISIT(traverse_module_state->__pyx_n_s_chartreuse2); Py_VISIT(traverse_module_state->__pyx_n_s_chartreuse3); Py_VISIT(traverse_module_state->__pyx_n_s_chartreuse4); Py_VISIT(traverse_module_state->__pyx_n_s_chocolate); Py_VISIT(traverse_module_state->__pyx_n_s_chocolate1); Py_VISIT(traverse_module_state->__pyx_n_s_chocolate2); Py_VISIT(traverse_module_state->__pyx_n_s_chocolate3); Py_VISIT(traverse_module_state->__pyx_n_s_chocolate4); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_coral); Py_VISIT(traverse_module_state->__pyx_n_s_coral1); Py_VISIT(traverse_module_state->__pyx_n_s_coral2); Py_VISIT(traverse_module_state->__pyx_n_s_coral3); Py_VISIT(traverse_module_state->__pyx_n_s_coral4); Py_VISIT(traverse_module_state->__pyx_n_s_cornflowerblue); Py_VISIT(traverse_module_state->__pyx_n_s_cornsilk); Py_VISIT(traverse_module_state->__pyx_n_s_cornsilk1); Py_VISIT(traverse_module_state->__pyx_n_s_cornsilk2); Py_VISIT(traverse_module_state->__pyx_n_s_cornsilk3); Py_VISIT(traverse_module_state->__pyx_n_s_cornsilk4); Py_VISIT(traverse_module_state->__pyx_n_s_correct_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_correct_gamma_locals_lambda); Py_VISIT(traverse_module_state->__pyx_n_s_cyan); Py_VISIT(traverse_module_state->__pyx_n_s_cyan1); Py_VISIT(traverse_module_state->__pyx_n_s_cyan2); Py_VISIT(traverse_module_state->__pyx_n_s_cyan3); Py_VISIT(traverse_module_state->__pyx_n_s_cyan4); Py_VISIT(traverse_module_state->__pyx_n_s_d); Py_VISIT(traverse_module_state->__pyx_n_s_darkblue); Py_VISIT(traverse_module_state->__pyx_n_s_darkcyan); Py_VISIT(traverse_module_state->__pyx_n_s_darkgoldenrod); Py_VISIT(traverse_module_state->__pyx_n_s_darkgoldenrod1); Py_VISIT(traverse_module_state->__pyx_n_s_darkgoldenrod2); Py_VISIT(traverse_module_state->__pyx_n_s_darkgoldenrod3); Py_VISIT(traverse_module_state->__pyx_n_s_darkgoldenrod4); Py_VISIT(traverse_module_state->__pyx_n_s_darkgray); Py_VISIT(traverse_module_state->__pyx_n_s_darkgreen); Py_VISIT(traverse_module_state->__pyx_n_s_darkgrey); Py_VISIT(traverse_module_state->__pyx_n_s_darkkhaki); Py_VISIT(traverse_module_state->__pyx_n_s_darkmagenta); Py_VISIT(traverse_module_state->__pyx_n_s_darkolivegreen); Py_VISIT(traverse_module_state->__pyx_n_s_darkolivegreen1); Py_VISIT(traverse_module_state->__pyx_n_s_darkolivegreen2); Py_VISIT(traverse_module_state->__pyx_n_s_darkolivegreen3); Py_VISIT(traverse_module_state->__pyx_n_s_darkolivegreen4); Py_VISIT(traverse_module_state->__pyx_n_s_darkorange); Py_VISIT(traverse_module_state->__pyx_n_s_darkorange1); Py_VISIT(traverse_module_state->__pyx_n_s_darkorange2); Py_VISIT(traverse_module_state->__pyx_n_s_darkorange3); Py_VISIT(traverse_module_state->__pyx_n_s_darkorange4); Py_VISIT(traverse_module_state->__pyx_n_s_darkorchid); Py_VISIT(traverse_module_state->__pyx_n_s_darkorchid1); Py_VISIT(traverse_module_state->__pyx_n_s_darkorchid2); Py_VISIT(traverse_module_state->__pyx_n_s_darkorchid3); Py_VISIT(traverse_module_state->__pyx_n_s_darkorchid4); Py_VISIT(traverse_module_state->__pyx_n_s_darkred); Py_VISIT(traverse_module_state->__pyx_n_s_darksalmon); Py_VISIT(traverse_module_state->__pyx_n_s_darkseagreen); Py_VISIT(traverse_module_state->__pyx_n_s_darkseagreen1); Py_VISIT(traverse_module_state->__pyx_n_s_darkseagreen2); Py_VISIT(traverse_module_state->__pyx_n_s_darkseagreen3); Py_VISIT(traverse_module_state->__pyx_n_s_darkseagreen4); Py_VISIT(traverse_module_state->__pyx_n_s_darkslateblue); Py_VISIT(traverse_module_state->__pyx_n_s_darkslategray); Py_VISIT(traverse_module_state->__pyx_n_s_darkslategray1); Py_VISIT(traverse_module_state->__pyx_n_s_darkslategray2); Py_VISIT(traverse_module_state->__pyx_n_s_darkslategray3); Py_VISIT(traverse_module_state->__pyx_n_s_darkslategray4); Py_VISIT(traverse_module_state->__pyx_n_s_darkslategrey); Py_VISIT(traverse_module_state->__pyx_n_s_darkturquoise); Py_VISIT(traverse_module_state->__pyx_n_s_darkviolet); Py_VISIT(traverse_module_state->__pyx_n_s_debianred); Py_VISIT(traverse_module_state->__pyx_n_s_deeppink); Py_VISIT(traverse_module_state->__pyx_n_s_deeppink1); Py_VISIT(traverse_module_state->__pyx_n_s_deeppink2); Py_VISIT(traverse_module_state->__pyx_n_s_deeppink3); Py_VISIT(traverse_module_state->__pyx_n_s_deeppink4); Py_VISIT(traverse_module_state->__pyx_n_s_deepskyblue); Py_VISIT(traverse_module_state->__pyx_n_s_deepskyblue1); Py_VISIT(traverse_module_state->__pyx_n_s_deepskyblue2); Py_VISIT(traverse_module_state->__pyx_n_s_deepskyblue3); Py_VISIT(traverse_module_state->__pyx_n_s_deepskyblue4); Py_VISIT(traverse_module_state->__pyx_n_s_dimgray); Py_VISIT(traverse_module_state->__pyx_n_s_dimgrey); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_div); Py_VISIT(traverse_module_state->__pyx_n_s_dodgerblue); Py_VISIT(traverse_module_state->__pyx_n_s_dodgerblue1); Py_VISIT(traverse_module_state->__pyx_n_s_dodgerblue2); Py_VISIT(traverse_module_state->__pyx_n_s_dodgerblue3); Py_VISIT(traverse_module_state->__pyx_n_s_dodgerblue4); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_firebrick); Py_VISIT(traverse_module_state->__pyx_n_s_firebrick1); Py_VISIT(traverse_module_state->__pyx_n_s_firebrick2); Py_VISIT(traverse_module_state->__pyx_n_s_firebrick3); Py_VISIT(traverse_module_state->__pyx_n_s_firebrick4); Py_VISIT(traverse_module_state->__pyx_n_s_floordiv___locals_div); Py_VISIT(traverse_module_state->__pyx_n_s_floralwhite); Py_VISIT(traverse_module_state->__pyx_n_s_forestgreen); Py_VISIT(traverse_module_state->__pyx_n_s_g); Py_VISIT(traverse_module_state->__pyx_n_s_gainsboro); Py_VISIT(traverse_module_state->__pyx_n_s_gamma); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_ghostwhite); Py_VISIT(traverse_module_state->__pyx_n_s_gold); Py_VISIT(traverse_module_state->__pyx_n_s_gold1); Py_VISIT(traverse_module_state->__pyx_n_s_gold2); Py_VISIT(traverse_module_state->__pyx_n_s_gold3); Py_VISIT(traverse_module_state->__pyx_n_s_gold4); Py_VISIT(traverse_module_state->__pyx_n_s_goldenrod); Py_VISIT(traverse_module_state->__pyx_n_s_goldenrod1); Py_VISIT(traverse_module_state->__pyx_n_s_goldenrod2); Py_VISIT(traverse_module_state->__pyx_n_s_goldenrod3); Py_VISIT(traverse_module_state->__pyx_n_s_goldenrod4); Py_VISIT(traverse_module_state->__pyx_n_s_gray); Py_VISIT(traverse_module_state->__pyx_n_s_gray0); Py_VISIT(traverse_module_state->__pyx_n_s_gray1); Py_VISIT(traverse_module_state->__pyx_n_s_gray10); Py_VISIT(traverse_module_state->__pyx_n_s_gray100); Py_VISIT(traverse_module_state->__pyx_n_s_gray11); Py_VISIT(traverse_module_state->__pyx_n_s_gray12); Py_VISIT(traverse_module_state->__pyx_n_s_gray13); Py_VISIT(traverse_module_state->__pyx_n_s_gray14); Py_VISIT(traverse_module_state->__pyx_n_s_gray15); Py_VISIT(traverse_module_state->__pyx_n_s_gray16); Py_VISIT(traverse_module_state->__pyx_n_s_gray17); Py_VISIT(traverse_module_state->__pyx_n_s_gray18); Py_VISIT(traverse_module_state->__pyx_n_s_gray19); Py_VISIT(traverse_module_state->__pyx_n_s_gray2); Py_VISIT(traverse_module_state->__pyx_n_s_gray20); Py_VISIT(traverse_module_state->__pyx_n_s_gray21); Py_VISIT(traverse_module_state->__pyx_n_s_gray22); Py_VISIT(traverse_module_state->__pyx_n_s_gray23); Py_VISIT(traverse_module_state->__pyx_n_s_gray24); Py_VISIT(traverse_module_state->__pyx_n_s_gray25); Py_VISIT(traverse_module_state->__pyx_n_s_gray26); Py_VISIT(traverse_module_state->__pyx_n_s_gray27); Py_VISIT(traverse_module_state->__pyx_n_s_gray28); Py_VISIT(traverse_module_state->__pyx_n_s_gray29); Py_VISIT(traverse_module_state->__pyx_n_s_gray3); Py_VISIT(traverse_module_state->__pyx_n_s_gray30); Py_VISIT(traverse_module_state->__pyx_n_s_gray31); Py_VISIT(traverse_module_state->__pyx_n_s_gray32); Py_VISIT(traverse_module_state->__pyx_n_s_gray33); Py_VISIT(traverse_module_state->__pyx_n_s_gray34); Py_VISIT(traverse_module_state->__pyx_n_s_gray35); Py_VISIT(traverse_module_state->__pyx_n_s_gray36); Py_VISIT(traverse_module_state->__pyx_n_s_gray37); Py_VISIT(traverse_module_state->__pyx_n_s_gray38); Py_VISIT(traverse_module_state->__pyx_n_s_gray39); Py_VISIT(traverse_module_state->__pyx_n_s_gray4); Py_VISIT(traverse_module_state->__pyx_n_s_gray40); Py_VISIT(traverse_module_state->__pyx_n_s_gray41); Py_VISIT(traverse_module_state->__pyx_n_s_gray42); Py_VISIT(traverse_module_state->__pyx_n_s_gray43); Py_VISIT(traverse_module_state->__pyx_n_s_gray44); Py_VISIT(traverse_module_state->__pyx_n_s_gray45); Py_VISIT(traverse_module_state->__pyx_n_s_gray46); Py_VISIT(traverse_module_state->__pyx_n_s_gray47); Py_VISIT(traverse_module_state->__pyx_n_s_gray48); Py_VISIT(traverse_module_state->__pyx_n_s_gray49); Py_VISIT(traverse_module_state->__pyx_n_s_gray5); Py_VISIT(traverse_module_state->__pyx_n_s_gray50); Py_VISIT(traverse_module_state->__pyx_n_s_gray51); Py_VISIT(traverse_module_state->__pyx_n_s_gray52); Py_VISIT(traverse_module_state->__pyx_n_s_gray53); Py_VISIT(traverse_module_state->__pyx_n_s_gray54); Py_VISIT(traverse_module_state->__pyx_n_s_gray55); Py_VISIT(traverse_module_state->__pyx_n_s_gray56); Py_VISIT(traverse_module_state->__pyx_n_s_gray57); Py_VISIT(traverse_module_state->__pyx_n_s_gray58); Py_VISIT(traverse_module_state->__pyx_n_s_gray59); Py_VISIT(traverse_module_state->__pyx_n_s_gray6); Py_VISIT(traverse_module_state->__pyx_n_s_gray60); Py_VISIT(traverse_module_state->__pyx_n_s_gray61); Py_VISIT(traverse_module_state->__pyx_n_s_gray62); Py_VISIT(traverse_module_state->__pyx_n_s_gray63); Py_VISIT(traverse_module_state->__pyx_n_s_gray64); Py_VISIT(traverse_module_state->__pyx_n_s_gray65); Py_VISIT(traverse_module_state->__pyx_n_s_gray66); Py_VISIT(traverse_module_state->__pyx_n_s_gray67); Py_VISIT(traverse_module_state->__pyx_n_s_gray68); Py_VISIT(traverse_module_state->__pyx_n_s_gray69); Py_VISIT(traverse_module_state->__pyx_n_s_gray7); Py_VISIT(traverse_module_state->__pyx_n_s_gray70); Py_VISIT(traverse_module_state->__pyx_n_s_gray71); Py_VISIT(traverse_module_state->__pyx_n_s_gray72); Py_VISIT(traverse_module_state->__pyx_n_s_gray73); Py_VISIT(traverse_module_state->__pyx_n_s_gray74); Py_VISIT(traverse_module_state->__pyx_n_s_gray75); Py_VISIT(traverse_module_state->__pyx_n_s_gray76); Py_VISIT(traverse_module_state->__pyx_n_s_gray77); Py_VISIT(traverse_module_state->__pyx_n_s_gray78); Py_VISIT(traverse_module_state->__pyx_n_s_gray79); Py_VISIT(traverse_module_state->__pyx_n_s_gray8); Py_VISIT(traverse_module_state->__pyx_n_s_gray80); Py_VISIT(traverse_module_state->__pyx_n_s_gray81); Py_VISIT(traverse_module_state->__pyx_n_s_gray82); Py_VISIT(traverse_module_state->__pyx_n_s_gray83); Py_VISIT(traverse_module_state->__pyx_n_s_gray84); Py_VISIT(traverse_module_state->__pyx_n_s_gray85); Py_VISIT(traverse_module_state->__pyx_n_s_gray86); Py_VISIT(traverse_module_state->__pyx_n_s_gray87); Py_VISIT(traverse_module_state->__pyx_n_s_gray88); Py_VISIT(traverse_module_state->__pyx_n_s_gray89); Py_VISIT(traverse_module_state->__pyx_n_s_gray9); Py_VISIT(traverse_module_state->__pyx_n_s_gray90); Py_VISIT(traverse_module_state->__pyx_n_s_gray91); Py_VISIT(traverse_module_state->__pyx_n_s_gray92); Py_VISIT(traverse_module_state->__pyx_n_s_gray93); Py_VISIT(traverse_module_state->__pyx_n_s_gray94); Py_VISIT(traverse_module_state->__pyx_n_s_gray95); Py_VISIT(traverse_module_state->__pyx_n_s_gray96); Py_VISIT(traverse_module_state->__pyx_n_s_gray97); Py_VISIT(traverse_module_state->__pyx_n_s_gray98); Py_VISIT(traverse_module_state->__pyx_n_s_gray99); Py_VISIT(traverse_module_state->__pyx_n_s_green); Py_VISIT(traverse_module_state->__pyx_n_s_green1); Py_VISIT(traverse_module_state->__pyx_n_s_green2); Py_VISIT(traverse_module_state->__pyx_n_s_green3); Py_VISIT(traverse_module_state->__pyx_n_s_green4); Py_VISIT(traverse_module_state->__pyx_n_s_greenyellow); Py_VISIT(traverse_module_state->__pyx_n_s_grey); Py_VISIT(traverse_module_state->__pyx_n_s_grey0); Py_VISIT(traverse_module_state->__pyx_n_s_grey1); Py_VISIT(traverse_module_state->__pyx_n_s_grey10); Py_VISIT(traverse_module_state->__pyx_n_s_grey100); Py_VISIT(traverse_module_state->__pyx_n_s_grey11); Py_VISIT(traverse_module_state->__pyx_n_s_grey12); Py_VISIT(traverse_module_state->__pyx_n_s_grey13); Py_VISIT(traverse_module_state->__pyx_n_s_grey14); Py_VISIT(traverse_module_state->__pyx_n_s_grey15); Py_VISIT(traverse_module_state->__pyx_n_s_grey16); Py_VISIT(traverse_module_state->__pyx_n_s_grey17); Py_VISIT(traverse_module_state->__pyx_n_s_grey18); Py_VISIT(traverse_module_state->__pyx_n_s_grey19); Py_VISIT(traverse_module_state->__pyx_n_s_grey2); Py_VISIT(traverse_module_state->__pyx_n_s_grey20); Py_VISIT(traverse_module_state->__pyx_n_s_grey21); Py_VISIT(traverse_module_state->__pyx_n_s_grey22); Py_VISIT(traverse_module_state->__pyx_n_s_grey23); Py_VISIT(traverse_module_state->__pyx_n_s_grey24); Py_VISIT(traverse_module_state->__pyx_n_s_grey25); Py_VISIT(traverse_module_state->__pyx_n_s_grey26); Py_VISIT(traverse_module_state->__pyx_n_s_grey27); Py_VISIT(traverse_module_state->__pyx_n_s_grey28); Py_VISIT(traverse_module_state->__pyx_n_s_grey29); Py_VISIT(traverse_module_state->__pyx_n_s_grey3); Py_VISIT(traverse_module_state->__pyx_n_s_grey30); Py_VISIT(traverse_module_state->__pyx_n_s_grey31); Py_VISIT(traverse_module_state->__pyx_n_s_grey32); Py_VISIT(traverse_module_state->__pyx_n_s_grey33); Py_VISIT(traverse_module_state->__pyx_n_s_grey34); Py_VISIT(traverse_module_state->__pyx_n_s_grey35); Py_VISIT(traverse_module_state->__pyx_n_s_grey36); Py_VISIT(traverse_module_state->__pyx_n_s_grey37); Py_VISIT(traverse_module_state->__pyx_n_s_grey38); Py_VISIT(traverse_module_state->__pyx_n_s_grey39); Py_VISIT(traverse_module_state->__pyx_n_s_grey4); Py_VISIT(traverse_module_state->__pyx_n_s_grey40); Py_VISIT(traverse_module_state->__pyx_n_s_grey41); Py_VISIT(traverse_module_state->__pyx_n_s_grey42); Py_VISIT(traverse_module_state->__pyx_n_s_grey43); Py_VISIT(traverse_module_state->__pyx_n_s_grey44); Py_VISIT(traverse_module_state->__pyx_n_s_grey45); Py_VISIT(traverse_module_state->__pyx_n_s_grey46); Py_VISIT(traverse_module_state->__pyx_n_s_grey47); Py_VISIT(traverse_module_state->__pyx_n_s_grey48); Py_VISIT(traverse_module_state->__pyx_n_s_grey49); Py_VISIT(traverse_module_state->__pyx_n_s_grey5); Py_VISIT(traverse_module_state->__pyx_n_s_grey50); Py_VISIT(traverse_module_state->__pyx_n_s_grey51); Py_VISIT(traverse_module_state->__pyx_n_s_grey52); Py_VISIT(traverse_module_state->__pyx_n_s_grey53); Py_VISIT(traverse_module_state->__pyx_n_s_grey54); Py_VISIT(traverse_module_state->__pyx_n_s_grey55); Py_VISIT(traverse_module_state->__pyx_n_s_grey56); Py_VISIT(traverse_module_state->__pyx_n_s_grey57); Py_VISIT(traverse_module_state->__pyx_n_s_grey58); Py_VISIT(traverse_module_state->__pyx_n_s_grey59); Py_VISIT(traverse_module_state->__pyx_n_s_grey6); Py_VISIT(traverse_module_state->__pyx_n_s_grey60); Py_VISIT(traverse_module_state->__pyx_n_s_grey61); Py_VISIT(traverse_module_state->__pyx_n_s_grey62); Py_VISIT(traverse_module_state->__pyx_n_s_grey63); Py_VISIT(traverse_module_state->__pyx_n_s_grey64); Py_VISIT(traverse_module_state->__pyx_n_s_grey65); Py_VISIT(traverse_module_state->__pyx_n_s_grey66); Py_VISIT(traverse_module_state->__pyx_n_s_grey67); Py_VISIT(traverse_module_state->__pyx_n_s_grey68); Py_VISIT(traverse_module_state->__pyx_n_s_grey69); Py_VISIT(traverse_module_state->__pyx_n_s_grey7); Py_VISIT(traverse_module_state->__pyx_n_s_grey70); Py_VISIT(traverse_module_state->__pyx_n_s_grey71); Py_VISIT(traverse_module_state->__pyx_n_s_grey72); Py_VISIT(traverse_module_state->__pyx_n_s_grey73); Py_VISIT(traverse_module_state->__pyx_n_s_grey74); Py_VISIT(traverse_module_state->__pyx_n_s_grey75); Py_VISIT(traverse_module_state->__pyx_n_s_grey76); Py_VISIT(traverse_module_state->__pyx_n_s_grey77); Py_VISIT(traverse_module_state->__pyx_n_s_grey78); Py_VISIT(traverse_module_state->__pyx_n_s_grey79); Py_VISIT(traverse_module_state->__pyx_n_s_grey8); Py_VISIT(traverse_module_state->__pyx_n_s_grey80); Py_VISIT(traverse_module_state->__pyx_n_s_grey81); Py_VISIT(traverse_module_state->__pyx_n_s_grey82); Py_VISIT(traverse_module_state->__pyx_n_s_grey83); Py_VISIT(traverse_module_state->__pyx_n_s_grey84); Py_VISIT(traverse_module_state->__pyx_n_s_grey85); Py_VISIT(traverse_module_state->__pyx_n_s_grey86); Py_VISIT(traverse_module_state->__pyx_n_s_grey87); Py_VISIT(traverse_module_state->__pyx_n_s_grey88); Py_VISIT(traverse_module_state->__pyx_n_s_grey89); Py_VISIT(traverse_module_state->__pyx_n_s_grey9); Py_VISIT(traverse_module_state->__pyx_n_s_grey90); Py_VISIT(traverse_module_state->__pyx_n_s_grey91); Py_VISIT(traverse_module_state->__pyx_n_s_grey92); Py_VISIT(traverse_module_state->__pyx_n_s_grey93); Py_VISIT(traverse_module_state->__pyx_n_s_grey94); Py_VISIT(traverse_module_state->__pyx_n_s_grey95); Py_VISIT(traverse_module_state->__pyx_n_s_grey96); Py_VISIT(traverse_module_state->__pyx_n_s_grey97); Py_VISIT(traverse_module_state->__pyx_n_s_grey98); Py_VISIT(traverse_module_state->__pyx_n_s_grey99); Py_VISIT(traverse_module_state->__pyx_n_s_hex); Py_VISIT(traverse_module_state->__pyx_n_s_honeydew); Py_VISIT(traverse_module_state->__pyx_n_s_honeydew1); Py_VISIT(traverse_module_state->__pyx_n_s_honeydew2); Py_VISIT(traverse_module_state->__pyx_n_s_honeydew3); Py_VISIT(traverse_module_state->__pyx_n_s_honeydew4); Py_VISIT(traverse_module_state->__pyx_n_s_hotpink); Py_VISIT(traverse_module_state->__pyx_n_s_hotpink1); Py_VISIT(traverse_module_state->__pyx_n_s_hotpink2); Py_VISIT(traverse_module_state->__pyx_n_s_hotpink3); Py_VISIT(traverse_module_state->__pyx_n_s_hotpink4); Py_VISIT(traverse_module_state->__pyx_n_s_hsva); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_indianred); Py_VISIT(traverse_module_state->__pyx_n_s_indianred1); Py_VISIT(traverse_module_state->__pyx_n_s_indianred2); Py_VISIT(traverse_module_state->__pyx_n_s_indianred3); Py_VISIT(traverse_module_state->__pyx_n_s_indianred4); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_ivory); Py_VISIT(traverse_module_state->__pyx_n_s_ivory1); Py_VISIT(traverse_module_state->__pyx_n_s_ivory2); Py_VISIT(traverse_module_state->__pyx_n_s_ivory3); Py_VISIT(traverse_module_state->__pyx_n_s_ivory4); Py_VISIT(traverse_module_state->__pyx_n_s_join); Py_VISIT(traverse_module_state->__pyx_n_s_khaki); Py_VISIT(traverse_module_state->__pyx_n_s_khaki1); Py_VISIT(traverse_module_state->__pyx_n_s_khaki2); Py_VISIT(traverse_module_state->__pyx_n_s_khaki3); Py_VISIT(traverse_module_state->__pyx_n_s_khaki4); Py_VISIT(traverse_module_state->__pyx_n_s_l); Py_VISIT(traverse_module_state->__pyx_n_s_lavender); Py_VISIT(traverse_module_state->__pyx_n_s_lavenderblush); Py_VISIT(traverse_module_state->__pyx_n_s_lavenderblush1); Py_VISIT(traverse_module_state->__pyx_n_s_lavenderblush2); Py_VISIT(traverse_module_state->__pyx_n_s_lavenderblush3); Py_VISIT(traverse_module_state->__pyx_n_s_lavenderblush4); Py_VISIT(traverse_module_state->__pyx_n_s_lawngreen); Py_VISIT(traverse_module_state->__pyx_n_s_lemonchiffon); Py_VISIT(traverse_module_state->__pyx_n_s_lemonchiffon1); Py_VISIT(traverse_module_state->__pyx_n_s_lemonchiffon2); Py_VISIT(traverse_module_state->__pyx_n_s_lemonchiffon3); Py_VISIT(traverse_module_state->__pyx_n_s_lemonchiffon4); Py_VISIT(traverse_module_state->__pyx_n_s_lightblue); Py_VISIT(traverse_module_state->__pyx_n_s_lightblue1); Py_VISIT(traverse_module_state->__pyx_n_s_lightblue2); Py_VISIT(traverse_module_state->__pyx_n_s_lightblue3); Py_VISIT(traverse_module_state->__pyx_n_s_lightblue4); Py_VISIT(traverse_module_state->__pyx_n_s_lightcoral); Py_VISIT(traverse_module_state->__pyx_n_s_lightcyan); Py_VISIT(traverse_module_state->__pyx_n_s_lightcyan1); Py_VISIT(traverse_module_state->__pyx_n_s_lightcyan2); Py_VISIT(traverse_module_state->__pyx_n_s_lightcyan3); Py_VISIT(traverse_module_state->__pyx_n_s_lightcyan4); Py_VISIT(traverse_module_state->__pyx_n_s_lightgoldenrod); Py_VISIT(traverse_module_state->__pyx_n_s_lightgoldenrod1); Py_VISIT(traverse_module_state->__pyx_n_s_lightgoldenrod2); Py_VISIT(traverse_module_state->__pyx_n_s_lightgoldenrod3); Py_VISIT(traverse_module_state->__pyx_n_s_lightgoldenrod4); Py_VISIT(traverse_module_state->__pyx_n_s_lightgoldenrodyellow); Py_VISIT(traverse_module_state->__pyx_n_s_lightgray); Py_VISIT(traverse_module_state->__pyx_n_s_lightgreen); Py_VISIT(traverse_module_state->__pyx_n_s_lightgrey); Py_VISIT(traverse_module_state->__pyx_n_s_lightpink); Py_VISIT(traverse_module_state->__pyx_n_s_lightpink1); Py_VISIT(traverse_module_state->__pyx_n_s_lightpink2); Py_VISIT(traverse_module_state->__pyx_n_s_lightpink3); Py_VISIT(traverse_module_state->__pyx_n_s_lightpink4); Py_VISIT(traverse_module_state->__pyx_n_s_lightsalmon); Py_VISIT(traverse_module_state->__pyx_n_s_lightsalmon1); Py_VISIT(traverse_module_state->__pyx_n_s_lightsalmon2); Py_VISIT(traverse_module_state->__pyx_n_s_lightsalmon3); Py_VISIT(traverse_module_state->__pyx_n_s_lightsalmon4); Py_VISIT(traverse_module_state->__pyx_n_s_lightseagreen); Py_VISIT(traverse_module_state->__pyx_n_s_lightskyblue); Py_VISIT(traverse_module_state->__pyx_n_s_lightskyblue1); Py_VISIT(traverse_module_state->__pyx_n_s_lightskyblue2); Py_VISIT(traverse_module_state->__pyx_n_s_lightskyblue3); Py_VISIT(traverse_module_state->__pyx_n_s_lightskyblue4); Py_VISIT(traverse_module_state->__pyx_n_s_lightslateblue); Py_VISIT(traverse_module_state->__pyx_n_s_lightslategray); Py_VISIT(traverse_module_state->__pyx_n_s_lightslategrey); Py_VISIT(traverse_module_state->__pyx_n_s_lightsteelblue); Py_VISIT(traverse_module_state->__pyx_n_s_lightsteelblue1); Py_VISIT(traverse_module_state->__pyx_n_s_lightsteelblue2); Py_VISIT(traverse_module_state->__pyx_n_s_lightsteelblue3); Py_VISIT(traverse_module_state->__pyx_n_s_lightsteelblue4); Py_VISIT(traverse_module_state->__pyx_n_s_lightyellow); Py_VISIT(traverse_module_state->__pyx_n_s_lightyellow1); Py_VISIT(traverse_module_state->__pyx_n_s_lightyellow2); Py_VISIT(traverse_module_state->__pyx_n_s_lightyellow3); Py_VISIT(traverse_module_state->__pyx_n_s_lightyellow4); Py_VISIT(traverse_module_state->__pyx_n_s_limegreen); Py_VISIT(traverse_module_state->__pyx_n_s_linen); Py_VISIT(traverse_module_state->__pyx_n_s_lower); Py_VISIT(traverse_module_state->__pyx_n_s_m); Py_VISIT(traverse_module_state->__pyx_n_s_magenta); Py_VISIT(traverse_module_state->__pyx_n_s_magenta1); Py_VISIT(traverse_module_state->__pyx_n_s_magenta2); Py_VISIT(traverse_module_state->__pyx_n_s_magenta3); Py_VISIT(traverse_module_state->__pyx_n_s_magenta4); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_map); Py_VISIT(traverse_module_state->__pyx_n_s_maroon); Py_VISIT(traverse_module_state->__pyx_n_s_maroon1); Py_VISIT(traverse_module_state->__pyx_n_s_maroon2); Py_VISIT(traverse_module_state->__pyx_n_s_maroon3); Py_VISIT(traverse_module_state->__pyx_n_s_maroon4); Py_VISIT(traverse_module_state->__pyx_n_s_mediumaquamarine); Py_VISIT(traverse_module_state->__pyx_n_s_mediumblue); Py_VISIT(traverse_module_state->__pyx_n_s_mediumorchid); Py_VISIT(traverse_module_state->__pyx_n_s_mediumorchid1); Py_VISIT(traverse_module_state->__pyx_n_s_mediumorchid2); Py_VISIT(traverse_module_state->__pyx_n_s_mediumorchid3); Py_VISIT(traverse_module_state->__pyx_n_s_mediumorchid4); Py_VISIT(traverse_module_state->__pyx_n_s_mediumpurple); Py_VISIT(traverse_module_state->__pyx_n_s_mediumpurple1); Py_VISIT(traverse_module_state->__pyx_n_s_mediumpurple2); Py_VISIT(traverse_module_state->__pyx_n_s_mediumpurple3); Py_VISIT(traverse_module_state->__pyx_n_s_mediumpurple4); Py_VISIT(traverse_module_state->__pyx_n_s_mediumseagreen); Py_VISIT(traverse_module_state->__pyx_n_s_mediumslateblue); Py_VISIT(traverse_module_state->__pyx_n_s_mediumspringgreen); Py_VISIT(traverse_module_state->__pyx_n_s_mediumturquoise); Py_VISIT(traverse_module_state->__pyx_n_s_mediumvioletred); Py_VISIT(traverse_module_state->__pyx_n_s_midnightblue); Py_VISIT(traverse_module_state->__pyx_n_s_mintcream); Py_VISIT(traverse_module_state->__pyx_n_s_mistyrose); Py_VISIT(traverse_module_state->__pyx_n_s_mistyrose1); Py_VISIT(traverse_module_state->__pyx_n_s_mistyrose2); Py_VISIT(traverse_module_state->__pyx_n_s_mistyrose3); Py_VISIT(traverse_module_state->__pyx_n_s_mistyrose4); Py_VISIT(traverse_module_state->__pyx_n_s_moccasin); Py_VISIT(traverse_module_state->__pyx_n_s_mod); Py_VISIT(traverse_module_state->__pyx_n_s_mod___locals_mod); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_navajowhite); Py_VISIT(traverse_module_state->__pyx_n_s_navajowhite1); Py_VISIT(traverse_module_state->__pyx_n_s_navajowhite2); Py_VISIT(traverse_module_state->__pyx_n_s_navajowhite3); Py_VISIT(traverse_module_state->__pyx_n_s_navajowhite4); Py_VISIT(traverse_module_state->__pyx_n_s_navy); Py_VISIT(traverse_module_state->__pyx_n_s_navyblue); Py_VISIT(traverse_module_state->__pyx_n_s_normalize); Py_VISIT(traverse_module_state->__pyx_n_s_oct); Py_VISIT(traverse_module_state->__pyx_n_s_oldlace); Py_VISIT(traverse_module_state->__pyx_n_s_olivedrab); Py_VISIT(traverse_module_state->__pyx_n_s_olivedrab1); Py_VISIT(traverse_module_state->__pyx_n_s_olivedrab2); Py_VISIT(traverse_module_state->__pyx_n_s_olivedrab3); Py_VISIT(traverse_module_state->__pyx_n_s_olivedrab4); Py_VISIT(traverse_module_state->__pyx_n_s_orange); Py_VISIT(traverse_module_state->__pyx_n_s_orange1); Py_VISIT(traverse_module_state->__pyx_n_s_orange2); Py_VISIT(traverse_module_state->__pyx_n_s_orange3); Py_VISIT(traverse_module_state->__pyx_n_s_orange4); Py_VISIT(traverse_module_state->__pyx_n_s_orangered); Py_VISIT(traverse_module_state->__pyx_n_s_orangered1); Py_VISIT(traverse_module_state->__pyx_n_s_orangered2); Py_VISIT(traverse_module_state->__pyx_n_s_orangered3); Py_VISIT(traverse_module_state->__pyx_n_s_orangered4); Py_VISIT(traverse_module_state->__pyx_n_s_orchid); Py_VISIT(traverse_module_state->__pyx_n_s_orchid1); Py_VISIT(traverse_module_state->__pyx_n_s_orchid2); Py_VISIT(traverse_module_state->__pyx_n_s_orchid3); Py_VISIT(traverse_module_state->__pyx_n_s_orchid4); Py_VISIT(traverse_module_state->__pyx_n_s_pack); Py_VISIT(traverse_module_state->__pyx_n_s_palegoldenrod); Py_VISIT(traverse_module_state->__pyx_n_s_palegreen); Py_VISIT(traverse_module_state->__pyx_n_s_palegreen1); Py_VISIT(traverse_module_state->__pyx_n_s_palegreen2); Py_VISIT(traverse_module_state->__pyx_n_s_palegreen3); Py_VISIT(traverse_module_state->__pyx_n_s_palegreen4); Py_VISIT(traverse_module_state->__pyx_n_s_paleturquoise); Py_VISIT(traverse_module_state->__pyx_n_s_paleturquoise1); Py_VISIT(traverse_module_state->__pyx_n_s_paleturquoise2); Py_VISIT(traverse_module_state->__pyx_n_s_paleturquoise3); Py_VISIT(traverse_module_state->__pyx_n_s_paleturquoise4); Py_VISIT(traverse_module_state->__pyx_n_s_palevioletred); Py_VISIT(traverse_module_state->__pyx_n_s_palevioletred1); Py_VISIT(traverse_module_state->__pyx_n_s_palevioletred2); Py_VISIT(traverse_module_state->__pyx_n_s_palevioletred3); Py_VISIT(traverse_module_state->__pyx_n_s_palevioletred4); Py_VISIT(traverse_module_state->__pyx_n_s_papayawhip); Py_VISIT(traverse_module_state->__pyx_n_s_peachpuff); Py_VISIT(traverse_module_state->__pyx_n_s_peachpuff1); Py_VISIT(traverse_module_state->__pyx_n_s_peachpuff2); Py_VISIT(traverse_module_state->__pyx_n_s_peachpuff3); Py_VISIT(traverse_module_state->__pyx_n_s_peachpuff4); Py_VISIT(traverse_module_state->__pyx_n_s_peru); Py_VISIT(traverse_module_state->__pyx_n_s_pink); Py_VISIT(traverse_module_state->__pyx_n_s_pink1); Py_VISIT(traverse_module_state->__pyx_n_s_pink2); Py_VISIT(traverse_module_state->__pyx_n_s_pink3); Py_VISIT(traverse_module_state->__pyx_n_s_pink4); Py_VISIT(traverse_module_state->__pyx_n_s_plum); Py_VISIT(traverse_module_state->__pyx_n_s_plum1); Py_VISIT(traverse_module_state->__pyx_n_s_plum2); Py_VISIT(traverse_module_state->__pyx_n_s_plum3); Py_VISIT(traverse_module_state->__pyx_n_s_plum4); Py_VISIT(traverse_module_state->__pyx_n_s_powderblue); Py_VISIT(traverse_module_state->__pyx_n_s_purple); Py_VISIT(traverse_module_state->__pyx_n_s_purple1); Py_VISIT(traverse_module_state->__pyx_n_s_purple2); Py_VISIT(traverse_module_state->__pyx_n_s_purple3); Py_VISIT(traverse_module_state->__pyx_n_s_purple4); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_color); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_red); Py_VISIT(traverse_module_state->__pyx_n_s_red1); Py_VISIT(traverse_module_state->__pyx_n_s_red2); Py_VISIT(traverse_module_state->__pyx_n_s_red3); Py_VISIT(traverse_module_state->__pyx_n_s_red4); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_rgba); Py_VISIT(traverse_module_state->__pyx_n_s_rosybrown); Py_VISIT(traverse_module_state->__pyx_n_s_rosybrown1); Py_VISIT(traverse_module_state->__pyx_n_s_rosybrown2); Py_VISIT(traverse_module_state->__pyx_n_s_rosybrown3); Py_VISIT(traverse_module_state->__pyx_n_s_rosybrown4); Py_VISIT(traverse_module_state->__pyx_n_s_round); Py_VISIT(traverse_module_state->__pyx_n_s_royalblue); Py_VISIT(traverse_module_state->__pyx_n_s_royalblue1); Py_VISIT(traverse_module_state->__pyx_n_s_royalblue2); Py_VISIT(traverse_module_state->__pyx_n_s_royalblue3); Py_VISIT(traverse_module_state->__pyx_n_s_royalblue4); Py_VISIT(traverse_module_state->__pyx_n_s_saddlebrown); Py_VISIT(traverse_module_state->__pyx_n_s_salmon); Py_VISIT(traverse_module_state->__pyx_n_s_salmon1); Py_VISIT(traverse_module_state->__pyx_n_s_salmon2); Py_VISIT(traverse_module_state->__pyx_n_s_salmon3); Py_VISIT(traverse_module_state->__pyx_n_s_salmon4); Py_VISIT(traverse_module_state->__pyx_n_s_sandybrown); Py_VISIT(traverse_module_state->__pyx_n_s_seagreen); Py_VISIT(traverse_module_state->__pyx_n_s_seagreen1); Py_VISIT(traverse_module_state->__pyx_n_s_seagreen2); Py_VISIT(traverse_module_state->__pyx_n_s_seagreen3); Py_VISIT(traverse_module_state->__pyx_n_s_seagreen4); Py_VISIT(traverse_module_state->__pyx_n_s_seashell); Py_VISIT(traverse_module_state->__pyx_n_s_seashell1); Py_VISIT(traverse_module_state->__pyx_n_s_seashell2); Py_VISIT(traverse_module_state->__pyx_n_s_seashell3); Py_VISIT(traverse_module_state->__pyx_n_s_seashell4); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_length); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_sienna); Py_VISIT(traverse_module_state->__pyx_n_s_sienna1); Py_VISIT(traverse_module_state->__pyx_n_s_sienna2); Py_VISIT(traverse_module_state->__pyx_n_s_sienna3); Py_VISIT(traverse_module_state->__pyx_n_s_sienna4); Py_VISIT(traverse_module_state->__pyx_n_s_skyblue); Py_VISIT(traverse_module_state->__pyx_n_s_skyblue1); Py_VISIT(traverse_module_state->__pyx_n_s_skyblue2); Py_VISIT(traverse_module_state->__pyx_n_s_skyblue3); Py_VISIT(traverse_module_state->__pyx_n_s_skyblue4); Py_VISIT(traverse_module_state->__pyx_n_s_slateblue); Py_VISIT(traverse_module_state->__pyx_n_s_slateblue1); Py_VISIT(traverse_module_state->__pyx_n_s_slateblue2); Py_VISIT(traverse_module_state->__pyx_n_s_slateblue3); Py_VISIT(traverse_module_state->__pyx_n_s_slateblue4); Py_VISIT(traverse_module_state->__pyx_n_s_slategray); Py_VISIT(traverse_module_state->__pyx_n_s_slategray1); Py_VISIT(traverse_module_state->__pyx_n_s_slategray2); Py_VISIT(traverse_module_state->__pyx_n_s_slategray3); Py_VISIT(traverse_module_state->__pyx_n_s_slategray4); Py_VISIT(traverse_module_state->__pyx_n_s_slategrey); Py_VISIT(traverse_module_state->__pyx_n_s_snow); Py_VISIT(traverse_module_state->__pyx_n_s_snow1); Py_VISIT(traverse_module_state->__pyx_n_s_snow2); Py_VISIT(traverse_module_state->__pyx_n_s_snow3); Py_VISIT(traverse_module_state->__pyx_n_s_snow4); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_split); Py_VISIT(traverse_module_state->__pyx_n_s_springgreen); Py_VISIT(traverse_module_state->__pyx_n_s_springgreen1); Py_VISIT(traverse_module_state->__pyx_n_s_springgreen2); Py_VISIT(traverse_module_state->__pyx_n_s_springgreen3); Py_VISIT(traverse_module_state->__pyx_n_s_springgreen4); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_color_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_startswith); Py_VISIT(traverse_module_state->__pyx_n_s_steelblue); Py_VISIT(traverse_module_state->__pyx_n_s_steelblue1); Py_VISIT(traverse_module_state->__pyx_n_s_steelblue2); Py_VISIT(traverse_module_state->__pyx_n_s_steelblue3); Py_VISIT(traverse_module_state->__pyx_n_s_steelblue4); Py_VISIT(traverse_module_state->__pyx_n_s_struct); Py_VISIT(traverse_module_state->__pyx_n_s_tan); Py_VISIT(traverse_module_state->__pyx_n_s_tan1); Py_VISIT(traverse_module_state->__pyx_n_s_tan2); Py_VISIT(traverse_module_state->__pyx_n_s_tan3); Py_VISIT(traverse_module_state->__pyx_n_s_tan4); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_thistle); Py_VISIT(traverse_module_state->__pyx_n_s_thistle1); Py_VISIT(traverse_module_state->__pyx_n_s_thistle2); Py_VISIT(traverse_module_state->__pyx_n_s_thistle3); Py_VISIT(traverse_module_state->__pyx_n_s_thistle4); Py_VISIT(traverse_module_state->__pyx_n_s_tomato); Py_VISIT(traverse_module_state->__pyx_n_s_tomato1); Py_VISIT(traverse_module_state->__pyx_n_s_tomato2); Py_VISIT(traverse_module_state->__pyx_n_s_tomato3); Py_VISIT(traverse_module_state->__pyx_n_s_tomato4); Py_VISIT(traverse_module_state->__pyx_n_s_turquoise); Py_VISIT(traverse_module_state->__pyx_n_s_turquoise1); Py_VISIT(traverse_module_state->__pyx_n_s_turquoise2); Py_VISIT(traverse_module_state->__pyx_n_s_turquoise3); Py_VISIT(traverse_module_state->__pyx_n_s_turquoise4); Py_VISIT(traverse_module_state->__pyx_n_s_unhexlify); Py_VISIT(traverse_module_state->__pyx_n_s_unpack); Py_VISIT(traverse_module_state->__pyx_n_s_violet); Py_VISIT(traverse_module_state->__pyx_n_s_violetred); Py_VISIT(traverse_module_state->__pyx_n_s_violetred1); Py_VISIT(traverse_module_state->__pyx_n_s_violetred2); Py_VISIT(traverse_module_state->__pyx_n_s_violetred3); Py_VISIT(traverse_module_state->__pyx_n_s_violetred4); Py_VISIT(traverse_module_state->__pyx_n_s_wheat); Py_VISIT(traverse_module_state->__pyx_n_s_wheat1); Py_VISIT(traverse_module_state->__pyx_n_s_wheat2); Py_VISIT(traverse_module_state->__pyx_n_s_wheat3); Py_VISIT(traverse_module_state->__pyx_n_s_wheat4); Py_VISIT(traverse_module_state->__pyx_n_s_white); Py_VISIT(traverse_module_state->__pyx_n_s_whitesmoke); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_yellow); Py_VISIT(traverse_module_state->__pyx_n_s_yellow1); Py_VISIT(traverse_module_state->__pyx_n_s_yellow2); Py_VISIT(traverse_module_state->__pyx_n_s_yellow3); Py_VISIT(traverse_module_state->__pyx_n_s_yellow4); Py_VISIT(traverse_module_state->__pyx_n_s_yellowgreen); Py_VISIT(traverse_module_state->__pyx_float_255_0); Py_VISIT(traverse_module_state->__pyx_float_360_0); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_3); Py_VISIT(traverse_module_state->__pyx_int_4); Py_VISIT(traverse_module_state->__pyx_int_5); Py_VISIT(traverse_module_state->__pyx_int_7); Py_VISIT(traverse_module_state->__pyx_int_8); Py_VISIT(traverse_module_state->__pyx_int_10); Py_VISIT(traverse_module_state->__pyx_int_11); Py_VISIT(traverse_module_state->__pyx_int_12); Py_VISIT(traverse_module_state->__pyx_int_13); Py_VISIT(traverse_module_state->__pyx_int_14); Py_VISIT(traverse_module_state->__pyx_int_15); Py_VISIT(traverse_module_state->__pyx_int_16); Py_VISIT(traverse_module_state->__pyx_int_18); Py_VISIT(traverse_module_state->__pyx_int_19); Py_VISIT(traverse_module_state->__pyx_int_20); Py_VISIT(traverse_module_state->__pyx_int_21); Py_VISIT(traverse_module_state->__pyx_int_23); Py_VISIT(traverse_module_state->__pyx_int_24); Py_VISIT(traverse_module_state->__pyx_int_25); Py_VISIT(traverse_module_state->__pyx_int_26); Py_VISIT(traverse_module_state->__pyx_int_28); Py_VISIT(traverse_module_state->__pyx_int_29); Py_VISIT(traverse_module_state->__pyx_int_30); Py_VISIT(traverse_module_state->__pyx_int_31); Py_VISIT(traverse_module_state->__pyx_int_32); Py_VISIT(traverse_module_state->__pyx_int_33); Py_VISIT(traverse_module_state->__pyx_int_34); Py_VISIT(traverse_module_state->__pyx_int_35); Py_VISIT(traverse_module_state->__pyx_int_36); Py_VISIT(traverse_module_state->__pyx_int_37); Py_VISIT(traverse_module_state->__pyx_int_38); Py_VISIT(traverse_module_state->__pyx_int_39); Py_VISIT(traverse_module_state->__pyx_int_41); Py_VISIT(traverse_module_state->__pyx_int_42); Py_VISIT(traverse_module_state->__pyx_int_43); Py_VISIT(traverse_module_state->__pyx_int_44); Py_VISIT(traverse_module_state->__pyx_int_45); Py_VISIT(traverse_module_state->__pyx_int_46); Py_VISIT(traverse_module_state->__pyx_int_47); Py_VISIT(traverse_module_state->__pyx_int_48); Py_VISIT(traverse_module_state->__pyx_int_50); Py_VISIT(traverse_module_state->__pyx_int_51); Py_VISIT(traverse_module_state->__pyx_int_52); Py_VISIT(traverse_module_state->__pyx_int_54); Py_VISIT(traverse_module_state->__pyx_int_55); Py_VISIT(traverse_module_state->__pyx_int_56); Py_VISIT(traverse_module_state->__pyx_int_57); Py_VISIT(traverse_module_state->__pyx_int_58); Py_VISIT(traverse_module_state->__pyx_int_59); Py_VISIT(traverse_module_state->__pyx_int_60); Py_VISIT(traverse_module_state->__pyx_int_61); Py_VISIT(traverse_module_state->__pyx_int_62); Py_VISIT(traverse_module_state->__pyx_int_63); Py_VISIT(traverse_module_state->__pyx_int_64); Py_VISIT(traverse_module_state->__pyx_int_65); Py_VISIT(traverse_module_state->__pyx_int_66); Py_VISIT(traverse_module_state->__pyx_int_67); Py_VISIT(traverse_module_state->__pyx_int_69); Py_VISIT(traverse_module_state->__pyx_int_70); Py_VISIT(traverse_module_state->__pyx_int_71); Py_VISIT(traverse_module_state->__pyx_int_72); Py_VISIT(traverse_module_state->__pyx_int_73); Py_VISIT(traverse_module_state->__pyx_int_74); Py_VISIT(traverse_module_state->__pyx_int_76); Py_VISIT(traverse_module_state->__pyx_int_77); Py_VISIT(traverse_module_state->__pyx_int_78); Py_VISIT(traverse_module_state->__pyx_int_79); Py_VISIT(traverse_module_state->__pyx_int_80); Py_VISIT(traverse_module_state->__pyx_int_81); Py_VISIT(traverse_module_state->__pyx_int_82); Py_VISIT(traverse_module_state->__pyx_int_83); Py_VISIT(traverse_module_state->__pyx_int_84); Py_VISIT(traverse_module_state->__pyx_int_85); Py_VISIT(traverse_module_state->__pyx_int_86); Py_VISIT(traverse_module_state->__pyx_int_87); Py_VISIT(traverse_module_state->__pyx_int_89); Py_VISIT(traverse_module_state->__pyx_int_90); Py_VISIT(traverse_module_state->__pyx_int_91); Py_VISIT(traverse_module_state->__pyx_int_92); Py_VISIT(traverse_module_state->__pyx_int_93); Py_VISIT(traverse_module_state->__pyx_int_94); Py_VISIT(traverse_module_state->__pyx_int_95); Py_VISIT(traverse_module_state->__pyx_int_96); Py_VISIT(traverse_module_state->__pyx_int_97); Py_VISIT(traverse_module_state->__pyx_int_98); Py_VISIT(traverse_module_state->__pyx_int_99); Py_VISIT(traverse_module_state->__pyx_int_100); Py_VISIT(traverse_module_state->__pyx_int_101); Py_VISIT(traverse_module_state->__pyx_int_102); Py_VISIT(traverse_module_state->__pyx_int_103); Py_VISIT(traverse_module_state->__pyx_int_104); Py_VISIT(traverse_module_state->__pyx_int_105); Py_VISIT(traverse_module_state->__pyx_int_106); Py_VISIT(traverse_module_state->__pyx_int_107); Py_VISIT(traverse_module_state->__pyx_int_108); Py_VISIT(traverse_module_state->__pyx_int_110); Py_VISIT(traverse_module_state->__pyx_int_111); Py_VISIT(traverse_module_state->__pyx_int_112); Py_VISIT(traverse_module_state->__pyx_int_113); Py_VISIT(traverse_module_state->__pyx_int_114); Py_VISIT(traverse_module_state->__pyx_int_115); Py_VISIT(traverse_module_state->__pyx_int_116); Py_VISIT(traverse_module_state->__pyx_int_117); Py_VISIT(traverse_module_state->__pyx_int_118); Py_VISIT(traverse_module_state->__pyx_int_119); Py_VISIT(traverse_module_state->__pyx_int_120); Py_VISIT(traverse_module_state->__pyx_int_121); Py_VISIT(traverse_module_state->__pyx_int_122); Py_VISIT(traverse_module_state->__pyx_int_123); Py_VISIT(traverse_module_state->__pyx_int_124); Py_VISIT(traverse_module_state->__pyx_int_125); Py_VISIT(traverse_module_state->__pyx_int_126); Py_VISIT(traverse_module_state->__pyx_int_127); Py_VISIT(traverse_module_state->__pyx_int_128); Py_VISIT(traverse_module_state->__pyx_int_129); Py_VISIT(traverse_module_state->__pyx_int_130); Py_VISIT(traverse_module_state->__pyx_int_131); Py_VISIT(traverse_module_state->__pyx_int_132); Py_VISIT(traverse_module_state->__pyx_int_133); Py_VISIT(traverse_module_state->__pyx_int_134); Py_VISIT(traverse_module_state->__pyx_int_135); Py_VISIT(traverse_module_state->__pyx_int_136); Py_VISIT(traverse_module_state->__pyx_int_137); Py_VISIT(traverse_module_state->__pyx_int_138); Py_VISIT(traverse_module_state->__pyx_int_139); Py_VISIT(traverse_module_state->__pyx_int_140); Py_VISIT(traverse_module_state->__pyx_int_141); Py_VISIT(traverse_module_state->__pyx_int_142); Py_VISIT(traverse_module_state->__pyx_int_143); Py_VISIT(traverse_module_state->__pyx_int_144); Py_VISIT(traverse_module_state->__pyx_int_145); Py_VISIT(traverse_module_state->__pyx_int_147); Py_VISIT(traverse_module_state->__pyx_int_148); Py_VISIT(traverse_module_state->__pyx_int_149); Py_VISIT(traverse_module_state->__pyx_int_150); Py_VISIT(traverse_module_state->__pyx_int_151); Py_VISIT(traverse_module_state->__pyx_int_152); Py_VISIT(traverse_module_state->__pyx_int_153); Py_VISIT(traverse_module_state->__pyx_int_154); Py_VISIT(traverse_module_state->__pyx_int_155); Py_VISIT(traverse_module_state->__pyx_int_156); Py_VISIT(traverse_module_state->__pyx_int_158); Py_VISIT(traverse_module_state->__pyx_int_159); Py_VISIT(traverse_module_state->__pyx_int_160); Py_VISIT(traverse_module_state->__pyx_int_161); Py_VISIT(traverse_module_state->__pyx_int_162); Py_VISIT(traverse_module_state->__pyx_int_163); Py_VISIT(traverse_module_state->__pyx_int_164); Py_VISIT(traverse_module_state->__pyx_int_165); Py_VISIT(traverse_module_state->__pyx_int_166); Py_VISIT(traverse_module_state->__pyx_int_167); Py_VISIT(traverse_module_state->__pyx_int_168); Py_VISIT(traverse_module_state->__pyx_int_169); Py_VISIT(traverse_module_state->__pyx_int_170); Py_VISIT(traverse_module_state->__pyx_int_171); Py_VISIT(traverse_module_state->__pyx_int_172); Py_VISIT(traverse_module_state->__pyx_int_173); Py_VISIT(traverse_module_state->__pyx_int_174); Py_VISIT(traverse_module_state->__pyx_int_175); Py_VISIT(traverse_module_state->__pyx_int_176); Py_VISIT(traverse_module_state->__pyx_int_177); Py_VISIT(traverse_module_state->__pyx_int_178); Py_VISIT(traverse_module_state->__pyx_int_179); Py_VISIT(traverse_module_state->__pyx_int_180); Py_VISIT(traverse_module_state->__pyx_int_181); Py_VISIT(traverse_module_state->__pyx_int_182); Py_VISIT(traverse_module_state->__pyx_int_183); Py_VISIT(traverse_module_state->__pyx_int_184); Py_VISIT(traverse_module_state->__pyx_int_185); Py_VISIT(traverse_module_state->__pyx_int_186); Py_VISIT(traverse_module_state->__pyx_int_187); Py_VISIT(traverse_module_state->__pyx_int_188); Py_VISIT(traverse_module_state->__pyx_int_189); Py_VISIT(traverse_module_state->__pyx_int_190); Py_VISIT(traverse_module_state->__pyx_int_191); Py_VISIT(traverse_module_state->__pyx_int_192); Py_VISIT(traverse_module_state->__pyx_int_193); Py_VISIT(traverse_module_state->__pyx_int_194); Py_VISIT(traverse_module_state->__pyx_int_196); Py_VISIT(traverse_module_state->__pyx_int_197); Py_VISIT(traverse_module_state->__pyx_int_198); Py_VISIT(traverse_module_state->__pyx_int_199); Py_VISIT(traverse_module_state->__pyx_int_200); Py_VISIT(traverse_module_state->__pyx_int_201); Py_VISIT(traverse_module_state->__pyx_int_202); Py_VISIT(traverse_module_state->__pyx_int_203); Py_VISIT(traverse_module_state->__pyx_int_204); Py_VISIT(traverse_module_state->__pyx_int_205); Py_VISIT(traverse_module_state->__pyx_int_206); Py_VISIT(traverse_module_state->__pyx_int_207); Py_VISIT(traverse_module_state->__pyx_int_208); Py_VISIT(traverse_module_state->__pyx_int_209); Py_VISIT(traverse_module_state->__pyx_int_210); Py_VISIT(traverse_module_state->__pyx_int_211); Py_VISIT(traverse_module_state->__pyx_int_212); Py_VISIT(traverse_module_state->__pyx_int_213); Py_VISIT(traverse_module_state->__pyx_int_214); Py_VISIT(traverse_module_state->__pyx_int_215); Py_VISIT(traverse_module_state->__pyx_int_216); Py_VISIT(traverse_module_state->__pyx_int_217); Py_VISIT(traverse_module_state->__pyx_int_218); Py_VISIT(traverse_module_state->__pyx_int_219); Py_VISIT(traverse_module_state->__pyx_int_220); Py_VISIT(traverse_module_state->__pyx_int_221); Py_VISIT(traverse_module_state->__pyx_int_222); Py_VISIT(traverse_module_state->__pyx_int_223); Py_VISIT(traverse_module_state->__pyx_int_224); Py_VISIT(traverse_module_state->__pyx_int_225); Py_VISIT(traverse_module_state->__pyx_int_226); Py_VISIT(traverse_module_state->__pyx_int_227); Py_VISIT(traverse_module_state->__pyx_int_228); Py_VISIT(traverse_module_state->__pyx_int_229); Py_VISIT(traverse_module_state->__pyx_int_230); Py_VISIT(traverse_module_state->__pyx_int_231); Py_VISIT(traverse_module_state->__pyx_int_232); Py_VISIT(traverse_module_state->__pyx_int_233); Py_VISIT(traverse_module_state->__pyx_int_235); Py_VISIT(traverse_module_state->__pyx_int_236); Py_VISIT(traverse_module_state->__pyx_int_237); Py_VISIT(traverse_module_state->__pyx_int_238); Py_VISIT(traverse_module_state->__pyx_int_239); Py_VISIT(traverse_module_state->__pyx_int_240); Py_VISIT(traverse_module_state->__pyx_int_242); Py_VISIT(traverse_module_state->__pyx_int_244); Py_VISIT(traverse_module_state->__pyx_int_245); Py_VISIT(traverse_module_state->__pyx_int_246); Py_VISIT(traverse_module_state->__pyx_int_247); Py_VISIT(traverse_module_state->__pyx_int_248); Py_VISIT(traverse_module_state->__pyx_int_250); Py_VISIT(traverse_module_state->__pyx_int_251); Py_VISIT(traverse_module_state->__pyx_int_252); Py_VISIT(traverse_module_state->__pyx_int_253); Py_VISIT(traverse_module_state->__pyx_int_255); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_slice__4); Py_VISIT(traverse_module_state->__pyx_slice__5); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__26); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__32); Py_VISIT(traverse_module_state->__pyx_tuple__33); Py_VISIT(traverse_module_state->__pyx_tuple__34); Py_VISIT(traverse_module_state->__pyx_tuple__35); Py_VISIT(traverse_module_state->__pyx_tuple__36); Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_tuple__38); Py_VISIT(traverse_module_state->__pyx_tuple__39); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__41); Py_VISIT(traverse_module_state->__pyx_tuple__42); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__44); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_tuple__46); Py_VISIT(traverse_module_state->__pyx_tuple__47); Py_VISIT(traverse_module_state->__pyx_tuple__48); Py_VISIT(traverse_module_state->__pyx_tuple__49); Py_VISIT(traverse_module_state->__pyx_tuple__50); Py_VISIT(traverse_module_state->__pyx_tuple__51); Py_VISIT(traverse_module_state->__pyx_tuple__52); Py_VISIT(traverse_module_state->__pyx_tuple__53); Py_VISIT(traverse_module_state->__pyx_tuple__54); Py_VISIT(traverse_module_state->__pyx_tuple__55); Py_VISIT(traverse_module_state->__pyx_tuple__56); Py_VISIT(traverse_module_state->__pyx_tuple__57); Py_VISIT(traverse_module_state->__pyx_tuple__58); Py_VISIT(traverse_module_state->__pyx_tuple__59); Py_VISIT(traverse_module_state->__pyx_tuple__60); Py_VISIT(traverse_module_state->__pyx_tuple__61); Py_VISIT(traverse_module_state->__pyx_tuple__62); Py_VISIT(traverse_module_state->__pyx_tuple__63); Py_VISIT(traverse_module_state->__pyx_tuple__64); Py_VISIT(traverse_module_state->__pyx_tuple__65); Py_VISIT(traverse_module_state->__pyx_tuple__66); Py_VISIT(traverse_module_state->__pyx_tuple__67); Py_VISIT(traverse_module_state->__pyx_tuple__68); Py_VISIT(traverse_module_state->__pyx_tuple__69); Py_VISIT(traverse_module_state->__pyx_tuple__70); Py_VISIT(traverse_module_state->__pyx_tuple__71); Py_VISIT(traverse_module_state->__pyx_tuple__72); Py_VISIT(traverse_module_state->__pyx_tuple__73); Py_VISIT(traverse_module_state->__pyx_tuple__74); Py_VISIT(traverse_module_state->__pyx_tuple__75); Py_VISIT(traverse_module_state->__pyx_tuple__76); Py_VISIT(traverse_module_state->__pyx_tuple__77); Py_VISIT(traverse_module_state->__pyx_tuple__78); Py_VISIT(traverse_module_state->__pyx_tuple__79); Py_VISIT(traverse_module_state->__pyx_tuple__80); Py_VISIT(traverse_module_state->__pyx_tuple__81); Py_VISIT(traverse_module_state->__pyx_tuple__82); Py_VISIT(traverse_module_state->__pyx_tuple__83); Py_VISIT(traverse_module_state->__pyx_tuple__84); Py_VISIT(traverse_module_state->__pyx_tuple__85); Py_VISIT(traverse_module_state->__pyx_tuple__86); Py_VISIT(traverse_module_state->__pyx_tuple__87); Py_VISIT(traverse_module_state->__pyx_tuple__88); Py_VISIT(traverse_module_state->__pyx_tuple__89); Py_VISIT(traverse_module_state->__pyx_tuple__90); Py_VISIT(traverse_module_state->__pyx_tuple__91); Py_VISIT(traverse_module_state->__pyx_tuple__92); Py_VISIT(traverse_module_state->__pyx_tuple__93); Py_VISIT(traverse_module_state->__pyx_tuple__94); Py_VISIT(traverse_module_state->__pyx_tuple__95); Py_VISIT(traverse_module_state->__pyx_tuple__96); Py_VISIT(traverse_module_state->__pyx_tuple__97); Py_VISIT(traverse_module_state->__pyx_tuple__98); Py_VISIT(traverse_module_state->__pyx_tuple__99); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_tuple__100); Py_VISIT(traverse_module_state->__pyx_tuple__101); Py_VISIT(traverse_module_state->__pyx_tuple__102); Py_VISIT(traverse_module_state->__pyx_tuple__103); Py_VISIT(traverse_module_state->__pyx_tuple__104); Py_VISIT(traverse_module_state->__pyx_tuple__105); Py_VISIT(traverse_module_state->__pyx_tuple__106); Py_VISIT(traverse_module_state->__pyx_tuple__107); Py_VISIT(traverse_module_state->__pyx_tuple__108); Py_VISIT(traverse_module_state->__pyx_tuple__109); Py_VISIT(traverse_module_state->__pyx_tuple__110); Py_VISIT(traverse_module_state->__pyx_tuple__111); Py_VISIT(traverse_module_state->__pyx_tuple__112); Py_VISIT(traverse_module_state->__pyx_tuple__113); Py_VISIT(traverse_module_state->__pyx_tuple__114); Py_VISIT(traverse_module_state->__pyx_tuple__115); Py_VISIT(traverse_module_state->__pyx_tuple__116); Py_VISIT(traverse_module_state->__pyx_tuple__117); Py_VISIT(traverse_module_state->__pyx_tuple__118); Py_VISIT(traverse_module_state->__pyx_tuple__119); Py_VISIT(traverse_module_state->__pyx_tuple__120); Py_VISIT(traverse_module_state->__pyx_tuple__121); Py_VISIT(traverse_module_state->__pyx_tuple__122); Py_VISIT(traverse_module_state->__pyx_tuple__123); Py_VISIT(traverse_module_state->__pyx_tuple__124); Py_VISIT(traverse_module_state->__pyx_tuple__125); Py_VISIT(traverse_module_state->__pyx_tuple__126); Py_VISIT(traverse_module_state->__pyx_tuple__127); Py_VISIT(traverse_module_state->__pyx_tuple__128); Py_VISIT(traverse_module_state->__pyx_tuple__129); Py_VISIT(traverse_module_state->__pyx_tuple__130); Py_VISIT(traverse_module_state->__pyx_tuple__131); Py_VISIT(traverse_module_state->__pyx_tuple__132); Py_VISIT(traverse_module_state->__pyx_tuple__133); Py_VISIT(traverse_module_state->__pyx_tuple__134); Py_VISIT(traverse_module_state->__pyx_tuple__135); Py_VISIT(traverse_module_state->__pyx_tuple__136); Py_VISIT(traverse_module_state->__pyx_tuple__137); Py_VISIT(traverse_module_state->__pyx_tuple__138); Py_VISIT(traverse_module_state->__pyx_tuple__139); Py_VISIT(traverse_module_state->__pyx_tuple__140); Py_VISIT(traverse_module_state->__pyx_tuple__141); Py_VISIT(traverse_module_state->__pyx_tuple__142); Py_VISIT(traverse_module_state->__pyx_tuple__143); Py_VISIT(traverse_module_state->__pyx_tuple__144); Py_VISIT(traverse_module_state->__pyx_tuple__145); Py_VISIT(traverse_module_state->__pyx_tuple__146); Py_VISIT(traverse_module_state->__pyx_tuple__147); Py_VISIT(traverse_module_state->__pyx_tuple__148); Py_VISIT(traverse_module_state->__pyx_tuple__149); Py_VISIT(traverse_module_state->__pyx_tuple__150); Py_VISIT(traverse_module_state->__pyx_tuple__151); Py_VISIT(traverse_module_state->__pyx_tuple__152); Py_VISIT(traverse_module_state->__pyx_tuple__153); Py_VISIT(traverse_module_state->__pyx_tuple__154); Py_VISIT(traverse_module_state->__pyx_tuple__155); Py_VISIT(traverse_module_state->__pyx_tuple__156); Py_VISIT(traverse_module_state->__pyx_tuple__157); Py_VISIT(traverse_module_state->__pyx_tuple__158); Py_VISIT(traverse_module_state->__pyx_tuple__159); Py_VISIT(traverse_module_state->__pyx_tuple__160); Py_VISIT(traverse_module_state->__pyx_tuple__161); Py_VISIT(traverse_module_state->__pyx_tuple__162); Py_VISIT(traverse_module_state->__pyx_tuple__163); Py_VISIT(traverse_module_state->__pyx_tuple__164); Py_VISIT(traverse_module_state->__pyx_tuple__165); Py_VISIT(traverse_module_state->__pyx_tuple__166); Py_VISIT(traverse_module_state->__pyx_tuple__167); Py_VISIT(traverse_module_state->__pyx_tuple__168); Py_VISIT(traverse_module_state->__pyx_tuple__169); Py_VISIT(traverse_module_state->__pyx_tuple__170); Py_VISIT(traverse_module_state->__pyx_tuple__171); Py_VISIT(traverse_module_state->__pyx_tuple__172); Py_VISIT(traverse_module_state->__pyx_tuple__173); Py_VISIT(traverse_module_state->__pyx_tuple__174); Py_VISIT(traverse_module_state->__pyx_tuple__175); Py_VISIT(traverse_module_state->__pyx_tuple__176); Py_VISIT(traverse_module_state->__pyx_tuple__177); Py_VISIT(traverse_module_state->__pyx_tuple__178); Py_VISIT(traverse_module_state->__pyx_tuple__179); Py_VISIT(traverse_module_state->__pyx_tuple__180); Py_VISIT(traverse_module_state->__pyx_tuple__181); Py_VISIT(traverse_module_state->__pyx_tuple__182); Py_VISIT(traverse_module_state->__pyx_tuple__183); Py_VISIT(traverse_module_state->__pyx_tuple__184); Py_VISIT(traverse_module_state->__pyx_tuple__185); Py_VISIT(traverse_module_state->__pyx_tuple__186); Py_VISIT(traverse_module_state->__pyx_tuple__187); Py_VISIT(traverse_module_state->__pyx_tuple__188); Py_VISIT(traverse_module_state->__pyx_tuple__189); Py_VISIT(traverse_module_state->__pyx_tuple__190); Py_VISIT(traverse_module_state->__pyx_tuple__191); Py_VISIT(traverse_module_state->__pyx_tuple__192); Py_VISIT(traverse_module_state->__pyx_tuple__193); Py_VISIT(traverse_module_state->__pyx_tuple__194); Py_VISIT(traverse_module_state->__pyx_tuple__195); Py_VISIT(traverse_module_state->__pyx_tuple__196); Py_VISIT(traverse_module_state->__pyx_tuple__197); Py_VISIT(traverse_module_state->__pyx_tuple__198); Py_VISIT(traverse_module_state->__pyx_tuple__199); Py_VISIT(traverse_module_state->__pyx_tuple__200); Py_VISIT(traverse_module_state->__pyx_tuple__201); Py_VISIT(traverse_module_state->__pyx_tuple__202); Py_VISIT(traverse_module_state->__pyx_tuple__203); Py_VISIT(traverse_module_state->__pyx_tuple__204); Py_VISIT(traverse_module_state->__pyx_tuple__205); Py_VISIT(traverse_module_state->__pyx_tuple__206); Py_VISIT(traverse_module_state->__pyx_tuple__207); Py_VISIT(traverse_module_state->__pyx_tuple__208); Py_VISIT(traverse_module_state->__pyx_tuple__209); Py_VISIT(traverse_module_state->__pyx_tuple__210); Py_VISIT(traverse_module_state->__pyx_tuple__211); Py_VISIT(traverse_module_state->__pyx_tuple__212); Py_VISIT(traverse_module_state->__pyx_tuple__213); Py_VISIT(traverse_module_state->__pyx_tuple__214); Py_VISIT(traverse_module_state->__pyx_tuple__215); Py_VISIT(traverse_module_state->__pyx_tuple__216); Py_VISIT(traverse_module_state->__pyx_tuple__217); Py_VISIT(traverse_module_state->__pyx_tuple__218); Py_VISIT(traverse_module_state->__pyx_tuple__219); Py_VISIT(traverse_module_state->__pyx_tuple__220); Py_VISIT(traverse_module_state->__pyx_tuple__221); Py_VISIT(traverse_module_state->__pyx_tuple__222); Py_VISIT(traverse_module_state->__pyx_tuple__223); Py_VISIT(traverse_module_state->__pyx_tuple__224); Py_VISIT(traverse_module_state->__pyx_tuple__225); Py_VISIT(traverse_module_state->__pyx_tuple__226); Py_VISIT(traverse_module_state->__pyx_tuple__227); Py_VISIT(traverse_module_state->__pyx_tuple__228); Py_VISIT(traverse_module_state->__pyx_tuple__229); Py_VISIT(traverse_module_state->__pyx_tuple__230); Py_VISIT(traverse_module_state->__pyx_tuple__231); Py_VISIT(traverse_module_state->__pyx_tuple__232); Py_VISIT(traverse_module_state->__pyx_tuple__233); Py_VISIT(traverse_module_state->__pyx_tuple__234); Py_VISIT(traverse_module_state->__pyx_tuple__235); Py_VISIT(traverse_module_state->__pyx_tuple__236); Py_VISIT(traverse_module_state->__pyx_tuple__237); Py_VISIT(traverse_module_state->__pyx_tuple__238); Py_VISIT(traverse_module_state->__pyx_tuple__239); Py_VISIT(traverse_module_state->__pyx_tuple__240); Py_VISIT(traverse_module_state->__pyx_tuple__241); Py_VISIT(traverse_module_state->__pyx_tuple__242); Py_VISIT(traverse_module_state->__pyx_tuple__243); Py_VISIT(traverse_module_state->__pyx_tuple__244); Py_VISIT(traverse_module_state->__pyx_tuple__245); Py_VISIT(traverse_module_state->__pyx_tuple__246); Py_VISIT(traverse_module_state->__pyx_tuple__247); Py_VISIT(traverse_module_state->__pyx_tuple__248); Py_VISIT(traverse_module_state->__pyx_tuple__249); Py_VISIT(traverse_module_state->__pyx_tuple__250); Py_VISIT(traverse_module_state->__pyx_tuple__251); Py_VISIT(traverse_module_state->__pyx_tuple__252); Py_VISIT(traverse_module_state->__pyx_tuple__253); Py_VISIT(traverse_module_state->__pyx_tuple__254); Py_VISIT(traverse_module_state->__pyx_tuple__255); Py_VISIT(traverse_module_state->__pyx_tuple__256); Py_VISIT(traverse_module_state->__pyx_tuple__257); Py_VISIT(traverse_module_state->__pyx_tuple__258); Py_VISIT(traverse_module_state->__pyx_tuple__259); Py_VISIT(traverse_module_state->__pyx_tuple__260); Py_VISIT(traverse_module_state->__pyx_tuple__261); Py_VISIT(traverse_module_state->__pyx_tuple__262); Py_VISIT(traverse_module_state->__pyx_tuple__263); Py_VISIT(traverse_module_state->__pyx_tuple__264); Py_VISIT(traverse_module_state->__pyx_tuple__265); Py_VISIT(traverse_module_state->__pyx_tuple__266); Py_VISIT(traverse_module_state->__pyx_tuple__267); Py_VISIT(traverse_module_state->__pyx_tuple__268); Py_VISIT(traverse_module_state->__pyx_tuple__269); Py_VISIT(traverse_module_state->__pyx_tuple__270); Py_VISIT(traverse_module_state->__pyx_tuple__271); Py_VISIT(traverse_module_state->__pyx_tuple__272); Py_VISIT(traverse_module_state->__pyx_tuple__273); Py_VISIT(traverse_module_state->__pyx_tuple__274); Py_VISIT(traverse_module_state->__pyx_tuple__275); Py_VISIT(traverse_module_state->__pyx_tuple__276); Py_VISIT(traverse_module_state->__pyx_tuple__277); Py_VISIT(traverse_module_state->__pyx_tuple__278); Py_VISIT(traverse_module_state->__pyx_tuple__279); Py_VISIT(traverse_module_state->__pyx_tuple__280); Py_VISIT(traverse_module_state->__pyx_tuple__281); Py_VISIT(traverse_module_state->__pyx_tuple__282); Py_VISIT(traverse_module_state->__pyx_tuple__283); Py_VISIT(traverse_module_state->__pyx_tuple__284); Py_VISIT(traverse_module_state->__pyx_tuple__285); Py_VISIT(traverse_module_state->__pyx_tuple__286); Py_VISIT(traverse_module_state->__pyx_tuple__287); Py_VISIT(traverse_module_state->__pyx_tuple__288); Py_VISIT(traverse_module_state->__pyx_tuple__289); Py_VISIT(traverse_module_state->__pyx_tuple__290); Py_VISIT(traverse_module_state->__pyx_tuple__291); Py_VISIT(traverse_module_state->__pyx_tuple__292); Py_VISIT(traverse_module_state->__pyx_tuple__293); Py_VISIT(traverse_module_state->__pyx_tuple__294); Py_VISIT(traverse_module_state->__pyx_tuple__295); Py_VISIT(traverse_module_state->__pyx_tuple__296); Py_VISIT(traverse_module_state->__pyx_tuple__297); Py_VISIT(traverse_module_state->__pyx_tuple__298); Py_VISIT(traverse_module_state->__pyx_tuple__299); Py_VISIT(traverse_module_state->__pyx_tuple__300); Py_VISIT(traverse_module_state->__pyx_tuple__301); Py_VISIT(traverse_module_state->__pyx_tuple__302); Py_VISIT(traverse_module_state->__pyx_tuple__303); Py_VISIT(traverse_module_state->__pyx_tuple__304); Py_VISIT(traverse_module_state->__pyx_tuple__305); Py_VISIT(traverse_module_state->__pyx_tuple__306); Py_VISIT(traverse_module_state->__pyx_tuple__307); Py_VISIT(traverse_module_state->__pyx_tuple__308); Py_VISIT(traverse_module_state->__pyx_tuple__309); Py_VISIT(traverse_module_state->__pyx_tuple__310); Py_VISIT(traverse_module_state->__pyx_tuple__311); Py_VISIT(traverse_module_state->__pyx_tuple__312); Py_VISIT(traverse_module_state->__pyx_tuple__313); Py_VISIT(traverse_module_state->__pyx_tuple__314); Py_VISIT(traverse_module_state->__pyx_tuple__315); Py_VISIT(traverse_module_state->__pyx_tuple__316); Py_VISIT(traverse_module_state->__pyx_tuple__317); Py_VISIT(traverse_module_state->__pyx_tuple__318); Py_VISIT(traverse_module_state->__pyx_tuple__319); Py_VISIT(traverse_module_state->__pyx_tuple__320); Py_VISIT(traverse_module_state->__pyx_tuple__321); Py_VISIT(traverse_module_state->__pyx_tuple__322); Py_VISIT(traverse_module_state->__pyx_tuple__323); Py_VISIT(traverse_module_state->__pyx_tuple__324); Py_VISIT(traverse_module_state->__pyx_tuple__325); Py_VISIT(traverse_module_state->__pyx_tuple__326); Py_VISIT(traverse_module_state->__pyx_tuple__327); Py_VISIT(traverse_module_state->__pyx_tuple__328); Py_VISIT(traverse_module_state->__pyx_tuple__329); Py_VISIT(traverse_module_state->__pyx_tuple__330); Py_VISIT(traverse_module_state->__pyx_tuple__331); Py_VISIT(traverse_module_state->__pyx_tuple__332); Py_VISIT(traverse_module_state->__pyx_tuple__333); Py_VISIT(traverse_module_state->__pyx_tuple__334); Py_VISIT(traverse_module_state->__pyx_tuple__335); Py_VISIT(traverse_module_state->__pyx_tuple__336); Py_VISIT(traverse_module_state->__pyx_tuple__337); Py_VISIT(traverse_module_state->__pyx_tuple__338); Py_VISIT(traverse_module_state->__pyx_tuple__339); Py_VISIT(traverse_module_state->__pyx_tuple__340); Py_VISIT(traverse_module_state->__pyx_tuple__341); Py_VISIT(traverse_module_state->__pyx_tuple__342); Py_VISIT(traverse_module_state->__pyx_tuple__343); Py_VISIT(traverse_module_state->__pyx_tuple__344); Py_VISIT(traverse_module_state->__pyx_tuple__345); Py_VISIT(traverse_module_state->__pyx_tuple__346); Py_VISIT(traverse_module_state->__pyx_tuple__347); Py_VISIT(traverse_module_state->__pyx_tuple__348); Py_VISIT(traverse_module_state->__pyx_tuple__349); Py_VISIT(traverse_module_state->__pyx_tuple__350); Py_VISIT(traverse_module_state->__pyx_tuple__351); Py_VISIT(traverse_module_state->__pyx_tuple__352); Py_VISIT(traverse_module_state->__pyx_tuple__353); Py_VISIT(traverse_module_state->__pyx_tuple__354); Py_VISIT(traverse_module_state->__pyx_tuple__355); Py_VISIT(traverse_module_state->__pyx_tuple__356); Py_VISIT(traverse_module_state->__pyx_tuple__357); Py_VISIT(traverse_module_state->__pyx_tuple__358); Py_VISIT(traverse_module_state->__pyx_tuple__359); Py_VISIT(traverse_module_state->__pyx_tuple__360); Py_VISIT(traverse_module_state->__pyx_tuple__361); Py_VISIT(traverse_module_state->__pyx_tuple__362); Py_VISIT(traverse_module_state->__pyx_tuple__363); Py_VISIT(traverse_module_state->__pyx_tuple__364); Py_VISIT(traverse_module_state->__pyx_tuple__365); Py_VISIT(traverse_module_state->__pyx_tuple__366); Py_VISIT(traverse_module_state->__pyx_tuple__367); Py_VISIT(traverse_module_state->__pyx_tuple__368); Py_VISIT(traverse_module_state->__pyx_tuple__369); Py_VISIT(traverse_module_state->__pyx_tuple__370); Py_VISIT(traverse_module_state->__pyx_tuple__371); Py_VISIT(traverse_module_state->__pyx_tuple__372); Py_VISIT(traverse_module_state->__pyx_tuple__373); Py_VISIT(traverse_module_state->__pyx_tuple__374); Py_VISIT(traverse_module_state->__pyx_tuple__375); Py_VISIT(traverse_module_state->__pyx_tuple__376); Py_VISIT(traverse_module_state->__pyx_tuple__377); Py_VISIT(traverse_module_state->__pyx_tuple__378); Py_VISIT(traverse_module_state->__pyx_tuple__379); Py_VISIT(traverse_module_state->__pyx_tuple__380); Py_VISIT(traverse_module_state->__pyx_tuple__381); Py_VISIT(traverse_module_state->__pyx_tuple__382); Py_VISIT(traverse_module_state->__pyx_tuple__383); Py_VISIT(traverse_module_state->__pyx_tuple__384); Py_VISIT(traverse_module_state->__pyx_tuple__385); Py_VISIT(traverse_module_state->__pyx_tuple__386); Py_VISIT(traverse_module_state->__pyx_tuple__387); Py_VISIT(traverse_module_state->__pyx_tuple__388); Py_VISIT(traverse_module_state->__pyx_tuple__389); Py_VISIT(traverse_module_state->__pyx_tuple__390); Py_VISIT(traverse_module_state->__pyx_tuple__391); Py_VISIT(traverse_module_state->__pyx_tuple__392); Py_VISIT(traverse_module_state->__pyx_tuple__393); Py_VISIT(traverse_module_state->__pyx_tuple__394); Py_VISIT(traverse_module_state->__pyx_tuple__395); Py_VISIT(traverse_module_state->__pyx_tuple__396); Py_VISIT(traverse_module_state->__pyx_tuple__397); Py_VISIT(traverse_module_state->__pyx_tuple__398); Py_VISIT(traverse_module_state->__pyx_tuple__399); Py_VISIT(traverse_module_state->__pyx_tuple__400); Py_VISIT(traverse_module_state->__pyx_tuple__401); Py_VISIT(traverse_module_state->__pyx_tuple__402); Py_VISIT(traverse_module_state->__pyx_tuple__403); Py_VISIT(traverse_module_state->__pyx_tuple__404); Py_VISIT(traverse_module_state->__pyx_tuple__405); Py_VISIT(traverse_module_state->__pyx_tuple__406); Py_VISIT(traverse_module_state->__pyx_tuple__407); Py_VISIT(traverse_module_state->__pyx_tuple__408); Py_VISIT(traverse_module_state->__pyx_tuple__409); Py_VISIT(traverse_module_state->__pyx_tuple__410); Py_VISIT(traverse_module_state->__pyx_tuple__411); Py_VISIT(traverse_module_state->__pyx_tuple__412); Py_VISIT(traverse_module_state->__pyx_tuple__413); Py_VISIT(traverse_module_state->__pyx_tuple__414); Py_VISIT(traverse_module_state->__pyx_tuple__415); Py_VISIT(traverse_module_state->__pyx_tuple__416); Py_VISIT(traverse_module_state->__pyx_tuple__417); Py_VISIT(traverse_module_state->__pyx_tuple__418); Py_VISIT(traverse_module_state->__pyx_tuple__419); Py_VISIT(traverse_module_state->__pyx_tuple__420); Py_VISIT(traverse_module_state->__pyx_tuple__421); Py_VISIT(traverse_module_state->__pyx_tuple__422); Py_VISIT(traverse_module_state->__pyx_tuple__423); Py_VISIT(traverse_module_state->__pyx_tuple__424); Py_VISIT(traverse_module_state->__pyx_tuple__425); Py_VISIT(traverse_module_state->__pyx_tuple__426); Py_VISIT(traverse_module_state->__pyx_tuple__427); Py_VISIT(traverse_module_state->__pyx_tuple__428); Py_VISIT(traverse_module_state->__pyx_tuple__429); Py_VISIT(traverse_module_state->__pyx_tuple__430); Py_VISIT(traverse_module_state->__pyx_tuple__431); Py_VISIT(traverse_module_state->__pyx_tuple__432); Py_VISIT(traverse_module_state->__pyx_tuple__433); Py_VISIT(traverse_module_state->__pyx_tuple__434); Py_VISIT(traverse_module_state->__pyx_tuple__435); Py_VISIT(traverse_module_state->__pyx_tuple__436); Py_VISIT(traverse_module_state->__pyx_tuple__437); Py_VISIT(traverse_module_state->__pyx_tuple__438); Py_VISIT(traverse_module_state->__pyx_tuple__439); Py_VISIT(traverse_module_state->__pyx_tuple__440); Py_VISIT(traverse_module_state->__pyx_tuple__441); Py_VISIT(traverse_module_state->__pyx_tuple__442); Py_VISIT(traverse_module_state->__pyx_tuple__443); Py_VISIT(traverse_module_state->__pyx_tuple__444); Py_VISIT(traverse_module_state->__pyx_tuple__445); Py_VISIT(traverse_module_state->__pyx_tuple__446); Py_VISIT(traverse_module_state->__pyx_tuple__447); Py_VISIT(traverse_module_state->__pyx_tuple__448); Py_VISIT(traverse_module_state->__pyx_tuple__449); Py_VISIT(traverse_module_state->__pyx_tuple__450); Py_VISIT(traverse_module_state->__pyx_tuple__451); Py_VISIT(traverse_module_state->__pyx_tuple__452); Py_VISIT(traverse_module_state->__pyx_tuple__453); Py_VISIT(traverse_module_state->__pyx_tuple__454); Py_VISIT(traverse_module_state->__pyx_tuple__455); Py_VISIT(traverse_module_state->__pyx_tuple__456); Py_VISIT(traverse_module_state->__pyx_tuple__457); Py_VISIT(traverse_module_state->__pyx_tuple__458); Py_VISIT(traverse_module_state->__pyx_tuple__459); Py_VISIT(traverse_module_state->__pyx_tuple__460); Py_VISIT(traverse_module_state->__pyx_tuple__461); Py_VISIT(traverse_module_state->__pyx_tuple__462); Py_VISIT(traverse_module_state->__pyx_tuple__463); Py_VISIT(traverse_module_state->__pyx_tuple__464); Py_VISIT(traverse_module_state->__pyx_tuple__465); Py_VISIT(traverse_module_state->__pyx_tuple__466); Py_VISIT(traverse_module_state->__pyx_tuple__467); Py_VISIT(traverse_module_state->__pyx_tuple__468); Py_VISIT(traverse_module_state->__pyx_tuple__469); Py_VISIT(traverse_module_state->__pyx_tuple__470); Py_VISIT(traverse_module_state->__pyx_tuple__471); Py_VISIT(traverse_module_state->__pyx_tuple__472); Py_VISIT(traverse_module_state->__pyx_tuple__473); Py_VISIT(traverse_module_state->__pyx_tuple__474); Py_VISIT(traverse_module_state->__pyx_tuple__475); Py_VISIT(traverse_module_state->__pyx_tuple__476); Py_VISIT(traverse_module_state->__pyx_tuple__477); Py_VISIT(traverse_module_state->__pyx_tuple__478); Py_VISIT(traverse_module_state->__pyx_tuple__479); Py_VISIT(traverse_module_state->__pyx_tuple__480); Py_VISIT(traverse_module_state->__pyx_tuple__481); Py_VISIT(traverse_module_state->__pyx_tuple__482); Py_VISIT(traverse_module_state->__pyx_tuple__483); Py_VISIT(traverse_module_state->__pyx_tuple__484); Py_VISIT(traverse_module_state->__pyx_tuple__485); Py_VISIT(traverse_module_state->__pyx_tuple__486); Py_VISIT(traverse_module_state->__pyx_tuple__487); Py_VISIT(traverse_module_state->__pyx_tuple__488); Py_VISIT(traverse_module_state->__pyx_tuple__489); Py_VISIT(traverse_module_state->__pyx_tuple__490); Py_VISIT(traverse_module_state->__pyx_tuple__491); Py_VISIT(traverse_module_state->__pyx_tuple__492); Py_VISIT(traverse_module_state->__pyx_tuple__493); Py_VISIT(traverse_module_state->__pyx_tuple__494); Py_VISIT(traverse_module_state->__pyx_tuple__495); Py_VISIT(traverse_module_state->__pyx_tuple__496); Py_VISIT(traverse_module_state->__pyx_tuple__497); Py_VISIT(traverse_module_state->__pyx_tuple__498); Py_VISIT(traverse_module_state->__pyx_tuple__499); Py_VISIT(traverse_module_state->__pyx_tuple__500); Py_VISIT(traverse_module_state->__pyx_tuple__501); Py_VISIT(traverse_module_state->__pyx_tuple__502); Py_VISIT(traverse_module_state->__pyx_tuple__503); Py_VISIT(traverse_module_state->__pyx_tuple__504); Py_VISIT(traverse_module_state->__pyx_tuple__505); Py_VISIT(traverse_module_state->__pyx_tuple__506); Py_VISIT(traverse_module_state->__pyx_tuple__507); Py_VISIT(traverse_module_state->__pyx_tuple__508); Py_VISIT(traverse_module_state->__pyx_tuple__509); Py_VISIT(traverse_module_state->__pyx_tuple__510); Py_VISIT(traverse_module_state->__pyx_tuple__511); Py_VISIT(traverse_module_state->__pyx_tuple__512); Py_VISIT(traverse_module_state->__pyx_tuple__513); Py_VISIT(traverse_module_state->__pyx_tuple__514); Py_VISIT(traverse_module_state->__pyx_tuple__517); Py_VISIT(traverse_module_state->__pyx_tuple__519); Py_VISIT(traverse_module_state->__pyx_tuple__521); Py_VISIT(traverse_module_state->__pyx_codeobj__515); Py_VISIT(traverse_module_state->__pyx_codeobj__516); Py_VISIT(traverse_module_state->__pyx_codeobj__518); Py_VISIT(traverse_module_state->__pyx_codeobj__520); Py_VISIT(traverse_module_state->__pyx_codeobj__522); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_5color_Color __pyx_mstate_global->__pyx_type_11pygame_sdl2_5color_Color #define __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma __pyx_mstate_global->__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma #endif #define __pyx_ptype_11pygame_sdl2_5color_Color __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5color_Color #define __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma #define __pyx_kp_s_08x __pyx_mstate_global->__pyx_kp_s_08x #define __pyx_kp_s_0x __pyx_mstate_global->__pyx_kp_s_0x #define __pyx_n_s_BBB __pyx_mstate_global->__pyx_n_s_BBB #define __pyx_n_s_BBBB __pyx_mstate_global->__pyx_n_s_BBBB #define __pyx_n_s_Color __pyx_mstate_global->__pyx_n_s_Color #define __pyx_n_s_Color___reduce __pyx_mstate_global->__pyx_n_s_Color___reduce #define __pyx_n_s_Color___setstate __pyx_mstate_global->__pyx_n_s_Color___setstate #define __pyx_n_s_Color_correct_gamma __pyx_mstate_global->__pyx_n_s_Color_correct_gamma #define __pyx_n_s_Color_from_hex_locals_lambda __pyx_mstate_global->__pyx_n_s_Color_from_hex_locals_lambda #define __pyx_n_s_Color_normalize __pyx_mstate_global->__pyx_n_s_Color_normalize #define __pyx_n_s_Color_set_length __pyx_mstate_global->__pyx_n_s_Color_set_length #define __pyx_kp_s_Expected_a_color __pyx_mstate_global->__pyx_kp_s_Expected_a_color #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError #define __pyx_kp_s_L __pyx_mstate_global->__pyx_kp_s_L #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_n_s__10 __pyx_mstate_global->__pyx_n_s__10 #define __pyx_kp_s__2 __pyx_mstate_global->__pyx_kp_s__2 #define __pyx_kp_s__3 __pyx_mstate_global->__pyx_kp_s__3 #define __pyx_n_s__523 __pyx_mstate_global->__pyx_n_s__523 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_n_s_aliceblue __pyx_mstate_global->__pyx_n_s_aliceblue #define __pyx_n_s_antiquewhite __pyx_mstate_global->__pyx_n_s_antiquewhite #define __pyx_n_s_antiquewhite1 __pyx_mstate_global->__pyx_n_s_antiquewhite1 #define __pyx_n_s_antiquewhite2 __pyx_mstate_global->__pyx_n_s_antiquewhite2 #define __pyx_n_s_antiquewhite3 __pyx_mstate_global->__pyx_n_s_antiquewhite3 #define __pyx_n_s_antiquewhite4 __pyx_mstate_global->__pyx_n_s_antiquewhite4 #define __pyx_n_s_aquamarine __pyx_mstate_global->__pyx_n_s_aquamarine #define __pyx_n_s_aquamarine1 __pyx_mstate_global->__pyx_n_s_aquamarine1 #define __pyx_n_s_aquamarine2 __pyx_mstate_global->__pyx_n_s_aquamarine2 #define __pyx_n_s_aquamarine3 __pyx_mstate_global->__pyx_n_s_aquamarine3 #define __pyx_n_s_aquamarine4 __pyx_mstate_global->__pyx_n_s_aquamarine4 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_azure __pyx_mstate_global->__pyx_n_s_azure #define __pyx_n_s_azure1 __pyx_mstate_global->__pyx_n_s_azure1 #define __pyx_n_s_azure2 __pyx_mstate_global->__pyx_n_s_azure2 #define __pyx_n_s_azure3 __pyx_mstate_global->__pyx_n_s_azure3 #define __pyx_n_s_azure4 __pyx_mstate_global->__pyx_n_s_azure4 #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b #define __pyx_n_s_beige __pyx_mstate_global->__pyx_n_s_beige #define __pyx_n_s_binascii __pyx_mstate_global->__pyx_n_s_binascii #define __pyx_n_s_bisque __pyx_mstate_global->__pyx_n_s_bisque #define __pyx_n_s_bisque1 __pyx_mstate_global->__pyx_n_s_bisque1 #define __pyx_n_s_bisque2 __pyx_mstate_global->__pyx_n_s_bisque2 #define __pyx_n_s_bisque3 __pyx_mstate_global->__pyx_n_s_bisque3 #define __pyx_n_s_bisque4 __pyx_mstate_global->__pyx_n_s_bisque4 #define __pyx_n_s_black __pyx_mstate_global->__pyx_n_s_black #define __pyx_n_s_blanchedalmond __pyx_mstate_global->__pyx_n_s_blanchedalmond #define __pyx_n_s_blue __pyx_mstate_global->__pyx_n_s_blue #define __pyx_n_s_blue1 __pyx_mstate_global->__pyx_n_s_blue1 #define __pyx_n_s_blue2 __pyx_mstate_global->__pyx_n_s_blue2 #define __pyx_n_s_blue3 __pyx_mstate_global->__pyx_n_s_blue3 #define __pyx_n_s_blue4 __pyx_mstate_global->__pyx_n_s_blue4 #define __pyx_n_s_blueviolet __pyx_mstate_global->__pyx_n_s_blueviolet #define __pyx_n_s_brown __pyx_mstate_global->__pyx_n_s_brown #define __pyx_n_s_brown1 __pyx_mstate_global->__pyx_n_s_brown1 #define __pyx_n_s_brown2 __pyx_mstate_global->__pyx_n_s_brown2 #define __pyx_n_s_brown3 __pyx_mstate_global->__pyx_n_s_brown3 #define __pyx_n_s_brown4 __pyx_mstate_global->__pyx_n_s_brown4 #define __pyx_n_s_burlywood __pyx_mstate_global->__pyx_n_s_burlywood #define __pyx_n_s_burlywood1 __pyx_mstate_global->__pyx_n_s_burlywood1 #define __pyx_n_s_burlywood2 __pyx_mstate_global->__pyx_n_s_burlywood2 #define __pyx_n_s_burlywood3 __pyx_mstate_global->__pyx_n_s_burlywood3 #define __pyx_n_s_burlywood4 __pyx_mstate_global->__pyx_n_s_burlywood4 #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c #define __pyx_n_s_cadetblue __pyx_mstate_global->__pyx_n_s_cadetblue #define __pyx_n_s_cadetblue1 __pyx_mstate_global->__pyx_n_s_cadetblue1 #define __pyx_n_s_cadetblue2 __pyx_mstate_global->__pyx_n_s_cadetblue2 #define __pyx_n_s_cadetblue3 __pyx_mstate_global->__pyx_n_s_cadetblue3 #define __pyx_n_s_cadetblue4 __pyx_mstate_global->__pyx_n_s_cadetblue4 #define __pyx_n_s_chartreuse __pyx_mstate_global->__pyx_n_s_chartreuse #define __pyx_n_s_chartreuse1 __pyx_mstate_global->__pyx_n_s_chartreuse1 #define __pyx_n_s_chartreuse2 __pyx_mstate_global->__pyx_n_s_chartreuse2 #define __pyx_n_s_chartreuse3 __pyx_mstate_global->__pyx_n_s_chartreuse3 #define __pyx_n_s_chartreuse4 __pyx_mstate_global->__pyx_n_s_chartreuse4 #define __pyx_n_s_chocolate __pyx_mstate_global->__pyx_n_s_chocolate #define __pyx_n_s_chocolate1 __pyx_mstate_global->__pyx_n_s_chocolate1 #define __pyx_n_s_chocolate2 __pyx_mstate_global->__pyx_n_s_chocolate2 #define __pyx_n_s_chocolate3 __pyx_mstate_global->__pyx_n_s_chocolate3 #define __pyx_n_s_chocolate4 __pyx_mstate_global->__pyx_n_s_chocolate4 #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_coral __pyx_mstate_global->__pyx_n_s_coral #define __pyx_n_s_coral1 __pyx_mstate_global->__pyx_n_s_coral1 #define __pyx_n_s_coral2 __pyx_mstate_global->__pyx_n_s_coral2 #define __pyx_n_s_coral3 __pyx_mstate_global->__pyx_n_s_coral3 #define __pyx_n_s_coral4 __pyx_mstate_global->__pyx_n_s_coral4 #define __pyx_n_s_cornflowerblue __pyx_mstate_global->__pyx_n_s_cornflowerblue #define __pyx_n_s_cornsilk __pyx_mstate_global->__pyx_n_s_cornsilk #define __pyx_n_s_cornsilk1 __pyx_mstate_global->__pyx_n_s_cornsilk1 #define __pyx_n_s_cornsilk2 __pyx_mstate_global->__pyx_n_s_cornsilk2 #define __pyx_n_s_cornsilk3 __pyx_mstate_global->__pyx_n_s_cornsilk3 #define __pyx_n_s_cornsilk4 __pyx_mstate_global->__pyx_n_s_cornsilk4 #define __pyx_n_s_correct_gamma __pyx_mstate_global->__pyx_n_s_correct_gamma #define __pyx_n_s_correct_gamma_locals_lambda __pyx_mstate_global->__pyx_n_s_correct_gamma_locals_lambda #define __pyx_n_s_cyan __pyx_mstate_global->__pyx_n_s_cyan #define __pyx_n_s_cyan1 __pyx_mstate_global->__pyx_n_s_cyan1 #define __pyx_n_s_cyan2 __pyx_mstate_global->__pyx_n_s_cyan2 #define __pyx_n_s_cyan3 __pyx_mstate_global->__pyx_n_s_cyan3 #define __pyx_n_s_cyan4 __pyx_mstate_global->__pyx_n_s_cyan4 #define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d #define __pyx_n_s_darkblue __pyx_mstate_global->__pyx_n_s_darkblue #define __pyx_n_s_darkcyan __pyx_mstate_global->__pyx_n_s_darkcyan #define __pyx_n_s_darkgoldenrod __pyx_mstate_global->__pyx_n_s_darkgoldenrod #define __pyx_n_s_darkgoldenrod1 __pyx_mstate_global->__pyx_n_s_darkgoldenrod1 #define __pyx_n_s_darkgoldenrod2 __pyx_mstate_global->__pyx_n_s_darkgoldenrod2 #define __pyx_n_s_darkgoldenrod3 __pyx_mstate_global->__pyx_n_s_darkgoldenrod3 #define __pyx_n_s_darkgoldenrod4 __pyx_mstate_global->__pyx_n_s_darkgoldenrod4 #define __pyx_n_s_darkgray __pyx_mstate_global->__pyx_n_s_darkgray #define __pyx_n_s_darkgreen __pyx_mstate_global->__pyx_n_s_darkgreen #define __pyx_n_s_darkgrey __pyx_mstate_global->__pyx_n_s_darkgrey #define __pyx_n_s_darkkhaki __pyx_mstate_global->__pyx_n_s_darkkhaki #define __pyx_n_s_darkmagenta __pyx_mstate_global->__pyx_n_s_darkmagenta #define __pyx_n_s_darkolivegreen __pyx_mstate_global->__pyx_n_s_darkolivegreen #define __pyx_n_s_darkolivegreen1 __pyx_mstate_global->__pyx_n_s_darkolivegreen1 #define __pyx_n_s_darkolivegreen2 __pyx_mstate_global->__pyx_n_s_darkolivegreen2 #define __pyx_n_s_darkolivegreen3 __pyx_mstate_global->__pyx_n_s_darkolivegreen3 #define __pyx_n_s_darkolivegreen4 __pyx_mstate_global->__pyx_n_s_darkolivegreen4 #define __pyx_n_s_darkorange __pyx_mstate_global->__pyx_n_s_darkorange #define __pyx_n_s_darkorange1 __pyx_mstate_global->__pyx_n_s_darkorange1 #define __pyx_n_s_darkorange2 __pyx_mstate_global->__pyx_n_s_darkorange2 #define __pyx_n_s_darkorange3 __pyx_mstate_global->__pyx_n_s_darkorange3 #define __pyx_n_s_darkorange4 __pyx_mstate_global->__pyx_n_s_darkorange4 #define __pyx_n_s_darkorchid __pyx_mstate_global->__pyx_n_s_darkorchid #define __pyx_n_s_darkorchid1 __pyx_mstate_global->__pyx_n_s_darkorchid1 #define __pyx_n_s_darkorchid2 __pyx_mstate_global->__pyx_n_s_darkorchid2 #define __pyx_n_s_darkorchid3 __pyx_mstate_global->__pyx_n_s_darkorchid3 #define __pyx_n_s_darkorchid4 __pyx_mstate_global->__pyx_n_s_darkorchid4 #define __pyx_n_s_darkred __pyx_mstate_global->__pyx_n_s_darkred #define __pyx_n_s_darksalmon __pyx_mstate_global->__pyx_n_s_darksalmon #define __pyx_n_s_darkseagreen __pyx_mstate_global->__pyx_n_s_darkseagreen #define __pyx_n_s_darkseagreen1 __pyx_mstate_global->__pyx_n_s_darkseagreen1 #define __pyx_n_s_darkseagreen2 __pyx_mstate_global->__pyx_n_s_darkseagreen2 #define __pyx_n_s_darkseagreen3 __pyx_mstate_global->__pyx_n_s_darkseagreen3 #define __pyx_n_s_darkseagreen4 __pyx_mstate_global->__pyx_n_s_darkseagreen4 #define __pyx_n_s_darkslateblue __pyx_mstate_global->__pyx_n_s_darkslateblue #define __pyx_n_s_darkslategray __pyx_mstate_global->__pyx_n_s_darkslategray #define __pyx_n_s_darkslategray1 __pyx_mstate_global->__pyx_n_s_darkslategray1 #define __pyx_n_s_darkslategray2 __pyx_mstate_global->__pyx_n_s_darkslategray2 #define __pyx_n_s_darkslategray3 __pyx_mstate_global->__pyx_n_s_darkslategray3 #define __pyx_n_s_darkslategray4 __pyx_mstate_global->__pyx_n_s_darkslategray4 #define __pyx_n_s_darkslategrey __pyx_mstate_global->__pyx_n_s_darkslategrey #define __pyx_n_s_darkturquoise __pyx_mstate_global->__pyx_n_s_darkturquoise #define __pyx_n_s_darkviolet __pyx_mstate_global->__pyx_n_s_darkviolet #define __pyx_n_s_debianred __pyx_mstate_global->__pyx_n_s_debianred #define __pyx_n_s_deeppink __pyx_mstate_global->__pyx_n_s_deeppink #define __pyx_n_s_deeppink1 __pyx_mstate_global->__pyx_n_s_deeppink1 #define __pyx_n_s_deeppink2 __pyx_mstate_global->__pyx_n_s_deeppink2 #define __pyx_n_s_deeppink3 __pyx_mstate_global->__pyx_n_s_deeppink3 #define __pyx_n_s_deeppink4 __pyx_mstate_global->__pyx_n_s_deeppink4 #define __pyx_n_s_deepskyblue __pyx_mstate_global->__pyx_n_s_deepskyblue #define __pyx_n_s_deepskyblue1 __pyx_mstate_global->__pyx_n_s_deepskyblue1 #define __pyx_n_s_deepskyblue2 __pyx_mstate_global->__pyx_n_s_deepskyblue2 #define __pyx_n_s_deepskyblue3 __pyx_mstate_global->__pyx_n_s_deepskyblue3 #define __pyx_n_s_deepskyblue4 __pyx_mstate_global->__pyx_n_s_deepskyblue4 #define __pyx_n_s_dimgray __pyx_mstate_global->__pyx_n_s_dimgray #define __pyx_n_s_dimgrey __pyx_mstate_global->__pyx_n_s_dimgrey #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_div __pyx_mstate_global->__pyx_n_s_div #define __pyx_n_s_dodgerblue __pyx_mstate_global->__pyx_n_s_dodgerblue #define __pyx_n_s_dodgerblue1 __pyx_mstate_global->__pyx_n_s_dodgerblue1 #define __pyx_n_s_dodgerblue2 __pyx_mstate_global->__pyx_n_s_dodgerblue2 #define __pyx_n_s_dodgerblue3 __pyx_mstate_global->__pyx_n_s_dodgerblue3 #define __pyx_n_s_dodgerblue4 __pyx_mstate_global->__pyx_n_s_dodgerblue4 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_firebrick __pyx_mstate_global->__pyx_n_s_firebrick #define __pyx_n_s_firebrick1 __pyx_mstate_global->__pyx_n_s_firebrick1 #define __pyx_n_s_firebrick2 __pyx_mstate_global->__pyx_n_s_firebrick2 #define __pyx_n_s_firebrick3 __pyx_mstate_global->__pyx_n_s_firebrick3 #define __pyx_n_s_firebrick4 __pyx_mstate_global->__pyx_n_s_firebrick4 #define __pyx_n_s_floordiv___locals_div __pyx_mstate_global->__pyx_n_s_floordiv___locals_div #define __pyx_n_s_floralwhite __pyx_mstate_global->__pyx_n_s_floralwhite #define __pyx_n_s_forestgreen __pyx_mstate_global->__pyx_n_s_forestgreen #define __pyx_n_s_g __pyx_mstate_global->__pyx_n_s_g #define __pyx_n_s_gainsboro __pyx_mstate_global->__pyx_n_s_gainsboro #define __pyx_n_s_gamma __pyx_mstate_global->__pyx_n_s_gamma #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_ghostwhite __pyx_mstate_global->__pyx_n_s_ghostwhite #define __pyx_n_s_gold __pyx_mstate_global->__pyx_n_s_gold #define __pyx_n_s_gold1 __pyx_mstate_global->__pyx_n_s_gold1 #define __pyx_n_s_gold2 __pyx_mstate_global->__pyx_n_s_gold2 #define __pyx_n_s_gold3 __pyx_mstate_global->__pyx_n_s_gold3 #define __pyx_n_s_gold4 __pyx_mstate_global->__pyx_n_s_gold4 #define __pyx_n_s_goldenrod __pyx_mstate_global->__pyx_n_s_goldenrod #define __pyx_n_s_goldenrod1 __pyx_mstate_global->__pyx_n_s_goldenrod1 #define __pyx_n_s_goldenrod2 __pyx_mstate_global->__pyx_n_s_goldenrod2 #define __pyx_n_s_goldenrod3 __pyx_mstate_global->__pyx_n_s_goldenrod3 #define __pyx_n_s_goldenrod4 __pyx_mstate_global->__pyx_n_s_goldenrod4 #define __pyx_n_s_gray __pyx_mstate_global->__pyx_n_s_gray #define __pyx_n_s_gray0 __pyx_mstate_global->__pyx_n_s_gray0 #define __pyx_n_s_gray1 __pyx_mstate_global->__pyx_n_s_gray1 #define __pyx_n_s_gray10 __pyx_mstate_global->__pyx_n_s_gray10 #define __pyx_n_s_gray100 __pyx_mstate_global->__pyx_n_s_gray100 #define __pyx_n_s_gray11 __pyx_mstate_global->__pyx_n_s_gray11 #define __pyx_n_s_gray12 __pyx_mstate_global->__pyx_n_s_gray12 #define __pyx_n_s_gray13 __pyx_mstate_global->__pyx_n_s_gray13 #define __pyx_n_s_gray14 __pyx_mstate_global->__pyx_n_s_gray14 #define __pyx_n_s_gray15 __pyx_mstate_global->__pyx_n_s_gray15 #define __pyx_n_s_gray16 __pyx_mstate_global->__pyx_n_s_gray16 #define __pyx_n_s_gray17 __pyx_mstate_global->__pyx_n_s_gray17 #define __pyx_n_s_gray18 __pyx_mstate_global->__pyx_n_s_gray18 #define __pyx_n_s_gray19 __pyx_mstate_global->__pyx_n_s_gray19 #define __pyx_n_s_gray2 __pyx_mstate_global->__pyx_n_s_gray2 #define __pyx_n_s_gray20 __pyx_mstate_global->__pyx_n_s_gray20 #define __pyx_n_s_gray21 __pyx_mstate_global->__pyx_n_s_gray21 #define __pyx_n_s_gray22 __pyx_mstate_global->__pyx_n_s_gray22 #define __pyx_n_s_gray23 __pyx_mstate_global->__pyx_n_s_gray23 #define __pyx_n_s_gray24 __pyx_mstate_global->__pyx_n_s_gray24 #define __pyx_n_s_gray25 __pyx_mstate_global->__pyx_n_s_gray25 #define __pyx_n_s_gray26 __pyx_mstate_global->__pyx_n_s_gray26 #define __pyx_n_s_gray27 __pyx_mstate_global->__pyx_n_s_gray27 #define __pyx_n_s_gray28 __pyx_mstate_global->__pyx_n_s_gray28 #define __pyx_n_s_gray29 __pyx_mstate_global->__pyx_n_s_gray29 #define __pyx_n_s_gray3 __pyx_mstate_global->__pyx_n_s_gray3 #define __pyx_n_s_gray30 __pyx_mstate_global->__pyx_n_s_gray30 #define __pyx_n_s_gray31 __pyx_mstate_global->__pyx_n_s_gray31 #define __pyx_n_s_gray32 __pyx_mstate_global->__pyx_n_s_gray32 #define __pyx_n_s_gray33 __pyx_mstate_global->__pyx_n_s_gray33 #define __pyx_n_s_gray34 __pyx_mstate_global->__pyx_n_s_gray34 #define __pyx_n_s_gray35 __pyx_mstate_global->__pyx_n_s_gray35 #define __pyx_n_s_gray36 __pyx_mstate_global->__pyx_n_s_gray36 #define __pyx_n_s_gray37 __pyx_mstate_global->__pyx_n_s_gray37 #define __pyx_n_s_gray38 __pyx_mstate_global->__pyx_n_s_gray38 #define __pyx_n_s_gray39 __pyx_mstate_global->__pyx_n_s_gray39 #define __pyx_n_s_gray4 __pyx_mstate_global->__pyx_n_s_gray4 #define __pyx_n_s_gray40 __pyx_mstate_global->__pyx_n_s_gray40 #define __pyx_n_s_gray41 __pyx_mstate_global->__pyx_n_s_gray41 #define __pyx_n_s_gray42 __pyx_mstate_global->__pyx_n_s_gray42 #define __pyx_n_s_gray43 __pyx_mstate_global->__pyx_n_s_gray43 #define __pyx_n_s_gray44 __pyx_mstate_global->__pyx_n_s_gray44 #define __pyx_n_s_gray45 __pyx_mstate_global->__pyx_n_s_gray45 #define __pyx_n_s_gray46 __pyx_mstate_global->__pyx_n_s_gray46 #define __pyx_n_s_gray47 __pyx_mstate_global->__pyx_n_s_gray47 #define __pyx_n_s_gray48 __pyx_mstate_global->__pyx_n_s_gray48 #define __pyx_n_s_gray49 __pyx_mstate_global->__pyx_n_s_gray49 #define __pyx_n_s_gray5 __pyx_mstate_global->__pyx_n_s_gray5 #define __pyx_n_s_gray50 __pyx_mstate_global->__pyx_n_s_gray50 #define __pyx_n_s_gray51 __pyx_mstate_global->__pyx_n_s_gray51 #define __pyx_n_s_gray52 __pyx_mstate_global->__pyx_n_s_gray52 #define __pyx_n_s_gray53 __pyx_mstate_global->__pyx_n_s_gray53 #define __pyx_n_s_gray54 __pyx_mstate_global->__pyx_n_s_gray54 #define __pyx_n_s_gray55 __pyx_mstate_global->__pyx_n_s_gray55 #define __pyx_n_s_gray56 __pyx_mstate_global->__pyx_n_s_gray56 #define __pyx_n_s_gray57 __pyx_mstate_global->__pyx_n_s_gray57 #define __pyx_n_s_gray58 __pyx_mstate_global->__pyx_n_s_gray58 #define __pyx_n_s_gray59 __pyx_mstate_global->__pyx_n_s_gray59 #define __pyx_n_s_gray6 __pyx_mstate_global->__pyx_n_s_gray6 #define __pyx_n_s_gray60 __pyx_mstate_global->__pyx_n_s_gray60 #define __pyx_n_s_gray61 __pyx_mstate_global->__pyx_n_s_gray61 #define __pyx_n_s_gray62 __pyx_mstate_global->__pyx_n_s_gray62 #define __pyx_n_s_gray63 __pyx_mstate_global->__pyx_n_s_gray63 #define __pyx_n_s_gray64 __pyx_mstate_global->__pyx_n_s_gray64 #define __pyx_n_s_gray65 __pyx_mstate_global->__pyx_n_s_gray65 #define __pyx_n_s_gray66 __pyx_mstate_global->__pyx_n_s_gray66 #define __pyx_n_s_gray67 __pyx_mstate_global->__pyx_n_s_gray67 #define __pyx_n_s_gray68 __pyx_mstate_global->__pyx_n_s_gray68 #define __pyx_n_s_gray69 __pyx_mstate_global->__pyx_n_s_gray69 #define __pyx_n_s_gray7 __pyx_mstate_global->__pyx_n_s_gray7 #define __pyx_n_s_gray70 __pyx_mstate_global->__pyx_n_s_gray70 #define __pyx_n_s_gray71 __pyx_mstate_global->__pyx_n_s_gray71 #define __pyx_n_s_gray72 __pyx_mstate_global->__pyx_n_s_gray72 #define __pyx_n_s_gray73 __pyx_mstate_global->__pyx_n_s_gray73 #define __pyx_n_s_gray74 __pyx_mstate_global->__pyx_n_s_gray74 #define __pyx_n_s_gray75 __pyx_mstate_global->__pyx_n_s_gray75 #define __pyx_n_s_gray76 __pyx_mstate_global->__pyx_n_s_gray76 #define __pyx_n_s_gray77 __pyx_mstate_global->__pyx_n_s_gray77 #define __pyx_n_s_gray78 __pyx_mstate_global->__pyx_n_s_gray78 #define __pyx_n_s_gray79 __pyx_mstate_global->__pyx_n_s_gray79 #define __pyx_n_s_gray8 __pyx_mstate_global->__pyx_n_s_gray8 #define __pyx_n_s_gray80 __pyx_mstate_global->__pyx_n_s_gray80 #define __pyx_n_s_gray81 __pyx_mstate_global->__pyx_n_s_gray81 #define __pyx_n_s_gray82 __pyx_mstate_global->__pyx_n_s_gray82 #define __pyx_n_s_gray83 __pyx_mstate_global->__pyx_n_s_gray83 #define __pyx_n_s_gray84 __pyx_mstate_global->__pyx_n_s_gray84 #define __pyx_n_s_gray85 __pyx_mstate_global->__pyx_n_s_gray85 #define __pyx_n_s_gray86 __pyx_mstate_global->__pyx_n_s_gray86 #define __pyx_n_s_gray87 __pyx_mstate_global->__pyx_n_s_gray87 #define __pyx_n_s_gray88 __pyx_mstate_global->__pyx_n_s_gray88 #define __pyx_n_s_gray89 __pyx_mstate_global->__pyx_n_s_gray89 #define __pyx_n_s_gray9 __pyx_mstate_global->__pyx_n_s_gray9 #define __pyx_n_s_gray90 __pyx_mstate_global->__pyx_n_s_gray90 #define __pyx_n_s_gray91 __pyx_mstate_global->__pyx_n_s_gray91 #define __pyx_n_s_gray92 __pyx_mstate_global->__pyx_n_s_gray92 #define __pyx_n_s_gray93 __pyx_mstate_global->__pyx_n_s_gray93 #define __pyx_n_s_gray94 __pyx_mstate_global->__pyx_n_s_gray94 #define __pyx_n_s_gray95 __pyx_mstate_global->__pyx_n_s_gray95 #define __pyx_n_s_gray96 __pyx_mstate_global->__pyx_n_s_gray96 #define __pyx_n_s_gray97 __pyx_mstate_global->__pyx_n_s_gray97 #define __pyx_n_s_gray98 __pyx_mstate_global->__pyx_n_s_gray98 #define __pyx_n_s_gray99 __pyx_mstate_global->__pyx_n_s_gray99 #define __pyx_n_s_green __pyx_mstate_global->__pyx_n_s_green #define __pyx_n_s_green1 __pyx_mstate_global->__pyx_n_s_green1 #define __pyx_n_s_green2 __pyx_mstate_global->__pyx_n_s_green2 #define __pyx_n_s_green3 __pyx_mstate_global->__pyx_n_s_green3 #define __pyx_n_s_green4 __pyx_mstate_global->__pyx_n_s_green4 #define __pyx_n_s_greenyellow __pyx_mstate_global->__pyx_n_s_greenyellow #define __pyx_n_s_grey __pyx_mstate_global->__pyx_n_s_grey #define __pyx_n_s_grey0 __pyx_mstate_global->__pyx_n_s_grey0 #define __pyx_n_s_grey1 __pyx_mstate_global->__pyx_n_s_grey1 #define __pyx_n_s_grey10 __pyx_mstate_global->__pyx_n_s_grey10 #define __pyx_n_s_grey100 __pyx_mstate_global->__pyx_n_s_grey100 #define __pyx_n_s_grey11 __pyx_mstate_global->__pyx_n_s_grey11 #define __pyx_n_s_grey12 __pyx_mstate_global->__pyx_n_s_grey12 #define __pyx_n_s_grey13 __pyx_mstate_global->__pyx_n_s_grey13 #define __pyx_n_s_grey14 __pyx_mstate_global->__pyx_n_s_grey14 #define __pyx_n_s_grey15 __pyx_mstate_global->__pyx_n_s_grey15 #define __pyx_n_s_grey16 __pyx_mstate_global->__pyx_n_s_grey16 #define __pyx_n_s_grey17 __pyx_mstate_global->__pyx_n_s_grey17 #define __pyx_n_s_grey18 __pyx_mstate_global->__pyx_n_s_grey18 #define __pyx_n_s_grey19 __pyx_mstate_global->__pyx_n_s_grey19 #define __pyx_n_s_grey2 __pyx_mstate_global->__pyx_n_s_grey2 #define __pyx_n_s_grey20 __pyx_mstate_global->__pyx_n_s_grey20 #define __pyx_n_s_grey21 __pyx_mstate_global->__pyx_n_s_grey21 #define __pyx_n_s_grey22 __pyx_mstate_global->__pyx_n_s_grey22 #define __pyx_n_s_grey23 __pyx_mstate_global->__pyx_n_s_grey23 #define __pyx_n_s_grey24 __pyx_mstate_global->__pyx_n_s_grey24 #define __pyx_n_s_grey25 __pyx_mstate_global->__pyx_n_s_grey25 #define __pyx_n_s_grey26 __pyx_mstate_global->__pyx_n_s_grey26 #define __pyx_n_s_grey27 __pyx_mstate_global->__pyx_n_s_grey27 #define __pyx_n_s_grey28 __pyx_mstate_global->__pyx_n_s_grey28 #define __pyx_n_s_grey29 __pyx_mstate_global->__pyx_n_s_grey29 #define __pyx_n_s_grey3 __pyx_mstate_global->__pyx_n_s_grey3 #define __pyx_n_s_grey30 __pyx_mstate_global->__pyx_n_s_grey30 #define __pyx_n_s_grey31 __pyx_mstate_global->__pyx_n_s_grey31 #define __pyx_n_s_grey32 __pyx_mstate_global->__pyx_n_s_grey32 #define __pyx_n_s_grey33 __pyx_mstate_global->__pyx_n_s_grey33 #define __pyx_n_s_grey34 __pyx_mstate_global->__pyx_n_s_grey34 #define __pyx_n_s_grey35 __pyx_mstate_global->__pyx_n_s_grey35 #define __pyx_n_s_grey36 __pyx_mstate_global->__pyx_n_s_grey36 #define __pyx_n_s_grey37 __pyx_mstate_global->__pyx_n_s_grey37 #define __pyx_n_s_grey38 __pyx_mstate_global->__pyx_n_s_grey38 #define __pyx_n_s_grey39 __pyx_mstate_global->__pyx_n_s_grey39 #define __pyx_n_s_grey4 __pyx_mstate_global->__pyx_n_s_grey4 #define __pyx_n_s_grey40 __pyx_mstate_global->__pyx_n_s_grey40 #define __pyx_n_s_grey41 __pyx_mstate_global->__pyx_n_s_grey41 #define __pyx_n_s_grey42 __pyx_mstate_global->__pyx_n_s_grey42 #define __pyx_n_s_grey43 __pyx_mstate_global->__pyx_n_s_grey43 #define __pyx_n_s_grey44 __pyx_mstate_global->__pyx_n_s_grey44 #define __pyx_n_s_grey45 __pyx_mstate_global->__pyx_n_s_grey45 #define __pyx_n_s_grey46 __pyx_mstate_global->__pyx_n_s_grey46 #define __pyx_n_s_grey47 __pyx_mstate_global->__pyx_n_s_grey47 #define __pyx_n_s_grey48 __pyx_mstate_global->__pyx_n_s_grey48 #define __pyx_n_s_grey49 __pyx_mstate_global->__pyx_n_s_grey49 #define __pyx_n_s_grey5 __pyx_mstate_global->__pyx_n_s_grey5 #define __pyx_n_s_grey50 __pyx_mstate_global->__pyx_n_s_grey50 #define __pyx_n_s_grey51 __pyx_mstate_global->__pyx_n_s_grey51 #define __pyx_n_s_grey52 __pyx_mstate_global->__pyx_n_s_grey52 #define __pyx_n_s_grey53 __pyx_mstate_global->__pyx_n_s_grey53 #define __pyx_n_s_grey54 __pyx_mstate_global->__pyx_n_s_grey54 #define __pyx_n_s_grey55 __pyx_mstate_global->__pyx_n_s_grey55 #define __pyx_n_s_grey56 __pyx_mstate_global->__pyx_n_s_grey56 #define __pyx_n_s_grey57 __pyx_mstate_global->__pyx_n_s_grey57 #define __pyx_n_s_grey58 __pyx_mstate_global->__pyx_n_s_grey58 #define __pyx_n_s_grey59 __pyx_mstate_global->__pyx_n_s_grey59 #define __pyx_n_s_grey6 __pyx_mstate_global->__pyx_n_s_grey6 #define __pyx_n_s_grey60 __pyx_mstate_global->__pyx_n_s_grey60 #define __pyx_n_s_grey61 __pyx_mstate_global->__pyx_n_s_grey61 #define __pyx_n_s_grey62 __pyx_mstate_global->__pyx_n_s_grey62 #define __pyx_n_s_grey63 __pyx_mstate_global->__pyx_n_s_grey63 #define __pyx_n_s_grey64 __pyx_mstate_global->__pyx_n_s_grey64 #define __pyx_n_s_grey65 __pyx_mstate_global->__pyx_n_s_grey65 #define __pyx_n_s_grey66 __pyx_mstate_global->__pyx_n_s_grey66 #define __pyx_n_s_grey67 __pyx_mstate_global->__pyx_n_s_grey67 #define __pyx_n_s_grey68 __pyx_mstate_global->__pyx_n_s_grey68 #define __pyx_n_s_grey69 __pyx_mstate_global->__pyx_n_s_grey69 #define __pyx_n_s_grey7 __pyx_mstate_global->__pyx_n_s_grey7 #define __pyx_n_s_grey70 __pyx_mstate_global->__pyx_n_s_grey70 #define __pyx_n_s_grey71 __pyx_mstate_global->__pyx_n_s_grey71 #define __pyx_n_s_grey72 __pyx_mstate_global->__pyx_n_s_grey72 #define __pyx_n_s_grey73 __pyx_mstate_global->__pyx_n_s_grey73 #define __pyx_n_s_grey74 __pyx_mstate_global->__pyx_n_s_grey74 #define __pyx_n_s_grey75 __pyx_mstate_global->__pyx_n_s_grey75 #define __pyx_n_s_grey76 __pyx_mstate_global->__pyx_n_s_grey76 #define __pyx_n_s_grey77 __pyx_mstate_global->__pyx_n_s_grey77 #define __pyx_n_s_grey78 __pyx_mstate_global->__pyx_n_s_grey78 #define __pyx_n_s_grey79 __pyx_mstate_global->__pyx_n_s_grey79 #define __pyx_n_s_grey8 __pyx_mstate_global->__pyx_n_s_grey8 #define __pyx_n_s_grey80 __pyx_mstate_global->__pyx_n_s_grey80 #define __pyx_n_s_grey81 __pyx_mstate_global->__pyx_n_s_grey81 #define __pyx_n_s_grey82 __pyx_mstate_global->__pyx_n_s_grey82 #define __pyx_n_s_grey83 __pyx_mstate_global->__pyx_n_s_grey83 #define __pyx_n_s_grey84 __pyx_mstate_global->__pyx_n_s_grey84 #define __pyx_n_s_grey85 __pyx_mstate_global->__pyx_n_s_grey85 #define __pyx_n_s_grey86 __pyx_mstate_global->__pyx_n_s_grey86 #define __pyx_n_s_grey87 __pyx_mstate_global->__pyx_n_s_grey87 #define __pyx_n_s_grey88 __pyx_mstate_global->__pyx_n_s_grey88 #define __pyx_n_s_grey89 __pyx_mstate_global->__pyx_n_s_grey89 #define __pyx_n_s_grey9 __pyx_mstate_global->__pyx_n_s_grey9 #define __pyx_n_s_grey90 __pyx_mstate_global->__pyx_n_s_grey90 #define __pyx_n_s_grey91 __pyx_mstate_global->__pyx_n_s_grey91 #define __pyx_n_s_grey92 __pyx_mstate_global->__pyx_n_s_grey92 #define __pyx_n_s_grey93 __pyx_mstate_global->__pyx_n_s_grey93 #define __pyx_n_s_grey94 __pyx_mstate_global->__pyx_n_s_grey94 #define __pyx_n_s_grey95 __pyx_mstate_global->__pyx_n_s_grey95 #define __pyx_n_s_grey96 __pyx_mstate_global->__pyx_n_s_grey96 #define __pyx_n_s_grey97 __pyx_mstate_global->__pyx_n_s_grey97 #define __pyx_n_s_grey98 __pyx_mstate_global->__pyx_n_s_grey98 #define __pyx_n_s_grey99 __pyx_mstate_global->__pyx_n_s_grey99 #define __pyx_n_s_hex __pyx_mstate_global->__pyx_n_s_hex #define __pyx_n_s_honeydew __pyx_mstate_global->__pyx_n_s_honeydew #define __pyx_n_s_honeydew1 __pyx_mstate_global->__pyx_n_s_honeydew1 #define __pyx_n_s_honeydew2 __pyx_mstate_global->__pyx_n_s_honeydew2 #define __pyx_n_s_honeydew3 __pyx_mstate_global->__pyx_n_s_honeydew3 #define __pyx_n_s_honeydew4 __pyx_mstate_global->__pyx_n_s_honeydew4 #define __pyx_n_s_hotpink __pyx_mstate_global->__pyx_n_s_hotpink #define __pyx_n_s_hotpink1 __pyx_mstate_global->__pyx_n_s_hotpink1 #define __pyx_n_s_hotpink2 __pyx_mstate_global->__pyx_n_s_hotpink2 #define __pyx_n_s_hotpink3 __pyx_mstate_global->__pyx_n_s_hotpink3 #define __pyx_n_s_hotpink4 __pyx_mstate_global->__pyx_n_s_hotpink4 #define __pyx_n_s_hsva __pyx_mstate_global->__pyx_n_s_hsva #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_indianred __pyx_mstate_global->__pyx_n_s_indianred #define __pyx_n_s_indianred1 __pyx_mstate_global->__pyx_n_s_indianred1 #define __pyx_n_s_indianred2 __pyx_mstate_global->__pyx_n_s_indianred2 #define __pyx_n_s_indianred3 __pyx_mstate_global->__pyx_n_s_indianred3 #define __pyx_n_s_indianred4 __pyx_mstate_global->__pyx_n_s_indianred4 #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_ivory __pyx_mstate_global->__pyx_n_s_ivory #define __pyx_n_s_ivory1 __pyx_mstate_global->__pyx_n_s_ivory1 #define __pyx_n_s_ivory2 __pyx_mstate_global->__pyx_n_s_ivory2 #define __pyx_n_s_ivory3 __pyx_mstate_global->__pyx_n_s_ivory3 #define __pyx_n_s_ivory4 __pyx_mstate_global->__pyx_n_s_ivory4 #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join #define __pyx_n_s_khaki __pyx_mstate_global->__pyx_n_s_khaki #define __pyx_n_s_khaki1 __pyx_mstate_global->__pyx_n_s_khaki1 #define __pyx_n_s_khaki2 __pyx_mstate_global->__pyx_n_s_khaki2 #define __pyx_n_s_khaki3 __pyx_mstate_global->__pyx_n_s_khaki3 #define __pyx_n_s_khaki4 __pyx_mstate_global->__pyx_n_s_khaki4 #define __pyx_n_s_l __pyx_mstate_global->__pyx_n_s_l #define __pyx_n_s_lavender __pyx_mstate_global->__pyx_n_s_lavender #define __pyx_n_s_lavenderblush __pyx_mstate_global->__pyx_n_s_lavenderblush #define __pyx_n_s_lavenderblush1 __pyx_mstate_global->__pyx_n_s_lavenderblush1 #define __pyx_n_s_lavenderblush2 __pyx_mstate_global->__pyx_n_s_lavenderblush2 #define __pyx_n_s_lavenderblush3 __pyx_mstate_global->__pyx_n_s_lavenderblush3 #define __pyx_n_s_lavenderblush4 __pyx_mstate_global->__pyx_n_s_lavenderblush4 #define __pyx_n_s_lawngreen __pyx_mstate_global->__pyx_n_s_lawngreen #define __pyx_n_s_lemonchiffon __pyx_mstate_global->__pyx_n_s_lemonchiffon #define __pyx_n_s_lemonchiffon1 __pyx_mstate_global->__pyx_n_s_lemonchiffon1 #define __pyx_n_s_lemonchiffon2 __pyx_mstate_global->__pyx_n_s_lemonchiffon2 #define __pyx_n_s_lemonchiffon3 __pyx_mstate_global->__pyx_n_s_lemonchiffon3 #define __pyx_n_s_lemonchiffon4 __pyx_mstate_global->__pyx_n_s_lemonchiffon4 #define __pyx_n_s_lightblue __pyx_mstate_global->__pyx_n_s_lightblue #define __pyx_n_s_lightblue1 __pyx_mstate_global->__pyx_n_s_lightblue1 #define __pyx_n_s_lightblue2 __pyx_mstate_global->__pyx_n_s_lightblue2 #define __pyx_n_s_lightblue3 __pyx_mstate_global->__pyx_n_s_lightblue3 #define __pyx_n_s_lightblue4 __pyx_mstate_global->__pyx_n_s_lightblue4 #define __pyx_n_s_lightcoral __pyx_mstate_global->__pyx_n_s_lightcoral #define __pyx_n_s_lightcyan __pyx_mstate_global->__pyx_n_s_lightcyan #define __pyx_n_s_lightcyan1 __pyx_mstate_global->__pyx_n_s_lightcyan1 #define __pyx_n_s_lightcyan2 __pyx_mstate_global->__pyx_n_s_lightcyan2 #define __pyx_n_s_lightcyan3 __pyx_mstate_global->__pyx_n_s_lightcyan3 #define __pyx_n_s_lightcyan4 __pyx_mstate_global->__pyx_n_s_lightcyan4 #define __pyx_n_s_lightgoldenrod __pyx_mstate_global->__pyx_n_s_lightgoldenrod #define __pyx_n_s_lightgoldenrod1 __pyx_mstate_global->__pyx_n_s_lightgoldenrod1 #define __pyx_n_s_lightgoldenrod2 __pyx_mstate_global->__pyx_n_s_lightgoldenrod2 #define __pyx_n_s_lightgoldenrod3 __pyx_mstate_global->__pyx_n_s_lightgoldenrod3 #define __pyx_n_s_lightgoldenrod4 __pyx_mstate_global->__pyx_n_s_lightgoldenrod4 #define __pyx_n_s_lightgoldenrodyellow __pyx_mstate_global->__pyx_n_s_lightgoldenrodyellow #define __pyx_n_s_lightgray __pyx_mstate_global->__pyx_n_s_lightgray #define __pyx_n_s_lightgreen __pyx_mstate_global->__pyx_n_s_lightgreen #define __pyx_n_s_lightgrey __pyx_mstate_global->__pyx_n_s_lightgrey #define __pyx_n_s_lightpink __pyx_mstate_global->__pyx_n_s_lightpink #define __pyx_n_s_lightpink1 __pyx_mstate_global->__pyx_n_s_lightpink1 #define __pyx_n_s_lightpink2 __pyx_mstate_global->__pyx_n_s_lightpink2 #define __pyx_n_s_lightpink3 __pyx_mstate_global->__pyx_n_s_lightpink3 #define __pyx_n_s_lightpink4 __pyx_mstate_global->__pyx_n_s_lightpink4 #define __pyx_n_s_lightsalmon __pyx_mstate_global->__pyx_n_s_lightsalmon #define __pyx_n_s_lightsalmon1 __pyx_mstate_global->__pyx_n_s_lightsalmon1 #define __pyx_n_s_lightsalmon2 __pyx_mstate_global->__pyx_n_s_lightsalmon2 #define __pyx_n_s_lightsalmon3 __pyx_mstate_global->__pyx_n_s_lightsalmon3 #define __pyx_n_s_lightsalmon4 __pyx_mstate_global->__pyx_n_s_lightsalmon4 #define __pyx_n_s_lightseagreen __pyx_mstate_global->__pyx_n_s_lightseagreen #define __pyx_n_s_lightskyblue __pyx_mstate_global->__pyx_n_s_lightskyblue #define __pyx_n_s_lightskyblue1 __pyx_mstate_global->__pyx_n_s_lightskyblue1 #define __pyx_n_s_lightskyblue2 __pyx_mstate_global->__pyx_n_s_lightskyblue2 #define __pyx_n_s_lightskyblue3 __pyx_mstate_global->__pyx_n_s_lightskyblue3 #define __pyx_n_s_lightskyblue4 __pyx_mstate_global->__pyx_n_s_lightskyblue4 #define __pyx_n_s_lightslateblue __pyx_mstate_global->__pyx_n_s_lightslateblue #define __pyx_n_s_lightslategray __pyx_mstate_global->__pyx_n_s_lightslategray #define __pyx_n_s_lightslategrey __pyx_mstate_global->__pyx_n_s_lightslategrey #define __pyx_n_s_lightsteelblue __pyx_mstate_global->__pyx_n_s_lightsteelblue #define __pyx_n_s_lightsteelblue1 __pyx_mstate_global->__pyx_n_s_lightsteelblue1 #define __pyx_n_s_lightsteelblue2 __pyx_mstate_global->__pyx_n_s_lightsteelblue2 #define __pyx_n_s_lightsteelblue3 __pyx_mstate_global->__pyx_n_s_lightsteelblue3 #define __pyx_n_s_lightsteelblue4 __pyx_mstate_global->__pyx_n_s_lightsteelblue4 #define __pyx_n_s_lightyellow __pyx_mstate_global->__pyx_n_s_lightyellow #define __pyx_n_s_lightyellow1 __pyx_mstate_global->__pyx_n_s_lightyellow1 #define __pyx_n_s_lightyellow2 __pyx_mstate_global->__pyx_n_s_lightyellow2 #define __pyx_n_s_lightyellow3 __pyx_mstate_global->__pyx_n_s_lightyellow3 #define __pyx_n_s_lightyellow4 __pyx_mstate_global->__pyx_n_s_lightyellow4 #define __pyx_n_s_limegreen __pyx_mstate_global->__pyx_n_s_limegreen #define __pyx_n_s_linen __pyx_mstate_global->__pyx_n_s_linen #define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower #define __pyx_n_s_m __pyx_mstate_global->__pyx_n_s_m #define __pyx_n_s_magenta __pyx_mstate_global->__pyx_n_s_magenta #define __pyx_n_s_magenta1 __pyx_mstate_global->__pyx_n_s_magenta1 #define __pyx_n_s_magenta2 __pyx_mstate_global->__pyx_n_s_magenta2 #define __pyx_n_s_magenta3 __pyx_mstate_global->__pyx_n_s_magenta3 #define __pyx_n_s_magenta4 __pyx_mstate_global->__pyx_n_s_magenta4 #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_map __pyx_mstate_global->__pyx_n_s_map #define __pyx_n_s_maroon __pyx_mstate_global->__pyx_n_s_maroon #define __pyx_n_s_maroon1 __pyx_mstate_global->__pyx_n_s_maroon1 #define __pyx_n_s_maroon2 __pyx_mstate_global->__pyx_n_s_maroon2 #define __pyx_n_s_maroon3 __pyx_mstate_global->__pyx_n_s_maroon3 #define __pyx_n_s_maroon4 __pyx_mstate_global->__pyx_n_s_maroon4 #define __pyx_n_s_mediumaquamarine __pyx_mstate_global->__pyx_n_s_mediumaquamarine #define __pyx_n_s_mediumblue __pyx_mstate_global->__pyx_n_s_mediumblue #define __pyx_n_s_mediumorchid __pyx_mstate_global->__pyx_n_s_mediumorchid #define __pyx_n_s_mediumorchid1 __pyx_mstate_global->__pyx_n_s_mediumorchid1 #define __pyx_n_s_mediumorchid2 __pyx_mstate_global->__pyx_n_s_mediumorchid2 #define __pyx_n_s_mediumorchid3 __pyx_mstate_global->__pyx_n_s_mediumorchid3 #define __pyx_n_s_mediumorchid4 __pyx_mstate_global->__pyx_n_s_mediumorchid4 #define __pyx_n_s_mediumpurple __pyx_mstate_global->__pyx_n_s_mediumpurple #define __pyx_n_s_mediumpurple1 __pyx_mstate_global->__pyx_n_s_mediumpurple1 #define __pyx_n_s_mediumpurple2 __pyx_mstate_global->__pyx_n_s_mediumpurple2 #define __pyx_n_s_mediumpurple3 __pyx_mstate_global->__pyx_n_s_mediumpurple3 #define __pyx_n_s_mediumpurple4 __pyx_mstate_global->__pyx_n_s_mediumpurple4 #define __pyx_n_s_mediumseagreen __pyx_mstate_global->__pyx_n_s_mediumseagreen #define __pyx_n_s_mediumslateblue __pyx_mstate_global->__pyx_n_s_mediumslateblue #define __pyx_n_s_mediumspringgreen __pyx_mstate_global->__pyx_n_s_mediumspringgreen #define __pyx_n_s_mediumturquoise __pyx_mstate_global->__pyx_n_s_mediumturquoise #define __pyx_n_s_mediumvioletred __pyx_mstate_global->__pyx_n_s_mediumvioletred #define __pyx_n_s_midnightblue __pyx_mstate_global->__pyx_n_s_midnightblue #define __pyx_n_s_mintcream __pyx_mstate_global->__pyx_n_s_mintcream #define __pyx_n_s_mistyrose __pyx_mstate_global->__pyx_n_s_mistyrose #define __pyx_n_s_mistyrose1 __pyx_mstate_global->__pyx_n_s_mistyrose1 #define __pyx_n_s_mistyrose2 __pyx_mstate_global->__pyx_n_s_mistyrose2 #define __pyx_n_s_mistyrose3 __pyx_mstate_global->__pyx_n_s_mistyrose3 #define __pyx_n_s_mistyrose4 __pyx_mstate_global->__pyx_n_s_mistyrose4 #define __pyx_n_s_moccasin __pyx_mstate_global->__pyx_n_s_moccasin #define __pyx_n_s_mod __pyx_mstate_global->__pyx_n_s_mod #define __pyx_n_s_mod___locals_mod __pyx_mstate_global->__pyx_n_s_mod___locals_mod #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_navajowhite __pyx_mstate_global->__pyx_n_s_navajowhite #define __pyx_n_s_navajowhite1 __pyx_mstate_global->__pyx_n_s_navajowhite1 #define __pyx_n_s_navajowhite2 __pyx_mstate_global->__pyx_n_s_navajowhite2 #define __pyx_n_s_navajowhite3 __pyx_mstate_global->__pyx_n_s_navajowhite3 #define __pyx_n_s_navajowhite4 __pyx_mstate_global->__pyx_n_s_navajowhite4 #define __pyx_n_s_navy __pyx_mstate_global->__pyx_n_s_navy #define __pyx_n_s_navyblue __pyx_mstate_global->__pyx_n_s_navyblue #define __pyx_n_s_normalize __pyx_mstate_global->__pyx_n_s_normalize #define __pyx_n_s_oct __pyx_mstate_global->__pyx_n_s_oct #define __pyx_n_s_oldlace __pyx_mstate_global->__pyx_n_s_oldlace #define __pyx_n_s_olivedrab __pyx_mstate_global->__pyx_n_s_olivedrab #define __pyx_n_s_olivedrab1 __pyx_mstate_global->__pyx_n_s_olivedrab1 #define __pyx_n_s_olivedrab2 __pyx_mstate_global->__pyx_n_s_olivedrab2 #define __pyx_n_s_olivedrab3 __pyx_mstate_global->__pyx_n_s_olivedrab3 #define __pyx_n_s_olivedrab4 __pyx_mstate_global->__pyx_n_s_olivedrab4 #define __pyx_n_s_orange __pyx_mstate_global->__pyx_n_s_orange #define __pyx_n_s_orange1 __pyx_mstate_global->__pyx_n_s_orange1 #define __pyx_n_s_orange2 __pyx_mstate_global->__pyx_n_s_orange2 #define __pyx_n_s_orange3 __pyx_mstate_global->__pyx_n_s_orange3 #define __pyx_n_s_orange4 __pyx_mstate_global->__pyx_n_s_orange4 #define __pyx_n_s_orangered __pyx_mstate_global->__pyx_n_s_orangered #define __pyx_n_s_orangered1 __pyx_mstate_global->__pyx_n_s_orangered1 #define __pyx_n_s_orangered2 __pyx_mstate_global->__pyx_n_s_orangered2 #define __pyx_n_s_orangered3 __pyx_mstate_global->__pyx_n_s_orangered3 #define __pyx_n_s_orangered4 __pyx_mstate_global->__pyx_n_s_orangered4 #define __pyx_n_s_orchid __pyx_mstate_global->__pyx_n_s_orchid #define __pyx_n_s_orchid1 __pyx_mstate_global->__pyx_n_s_orchid1 #define __pyx_n_s_orchid2 __pyx_mstate_global->__pyx_n_s_orchid2 #define __pyx_n_s_orchid3 __pyx_mstate_global->__pyx_n_s_orchid3 #define __pyx_n_s_orchid4 __pyx_mstate_global->__pyx_n_s_orchid4 #define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack #define __pyx_n_s_palegoldenrod __pyx_mstate_global->__pyx_n_s_palegoldenrod #define __pyx_n_s_palegreen __pyx_mstate_global->__pyx_n_s_palegreen #define __pyx_n_s_palegreen1 __pyx_mstate_global->__pyx_n_s_palegreen1 #define __pyx_n_s_palegreen2 __pyx_mstate_global->__pyx_n_s_palegreen2 #define __pyx_n_s_palegreen3 __pyx_mstate_global->__pyx_n_s_palegreen3 #define __pyx_n_s_palegreen4 __pyx_mstate_global->__pyx_n_s_palegreen4 #define __pyx_n_s_paleturquoise __pyx_mstate_global->__pyx_n_s_paleturquoise #define __pyx_n_s_paleturquoise1 __pyx_mstate_global->__pyx_n_s_paleturquoise1 #define __pyx_n_s_paleturquoise2 __pyx_mstate_global->__pyx_n_s_paleturquoise2 #define __pyx_n_s_paleturquoise3 __pyx_mstate_global->__pyx_n_s_paleturquoise3 #define __pyx_n_s_paleturquoise4 __pyx_mstate_global->__pyx_n_s_paleturquoise4 #define __pyx_n_s_palevioletred __pyx_mstate_global->__pyx_n_s_palevioletred #define __pyx_n_s_palevioletred1 __pyx_mstate_global->__pyx_n_s_palevioletred1 #define __pyx_n_s_palevioletred2 __pyx_mstate_global->__pyx_n_s_palevioletred2 #define __pyx_n_s_palevioletred3 __pyx_mstate_global->__pyx_n_s_palevioletred3 #define __pyx_n_s_palevioletred4 __pyx_mstate_global->__pyx_n_s_palevioletred4 #define __pyx_n_s_papayawhip __pyx_mstate_global->__pyx_n_s_papayawhip #define __pyx_n_s_peachpuff __pyx_mstate_global->__pyx_n_s_peachpuff #define __pyx_n_s_peachpuff1 __pyx_mstate_global->__pyx_n_s_peachpuff1 #define __pyx_n_s_peachpuff2 __pyx_mstate_global->__pyx_n_s_peachpuff2 #define __pyx_n_s_peachpuff3 __pyx_mstate_global->__pyx_n_s_peachpuff3 #define __pyx_n_s_peachpuff4 __pyx_mstate_global->__pyx_n_s_peachpuff4 #define __pyx_n_s_peru __pyx_mstate_global->__pyx_n_s_peru #define __pyx_n_s_pink __pyx_mstate_global->__pyx_n_s_pink #define __pyx_n_s_pink1 __pyx_mstate_global->__pyx_n_s_pink1 #define __pyx_n_s_pink2 __pyx_mstate_global->__pyx_n_s_pink2 #define __pyx_n_s_pink3 __pyx_mstate_global->__pyx_n_s_pink3 #define __pyx_n_s_pink4 __pyx_mstate_global->__pyx_n_s_pink4 #define __pyx_n_s_plum __pyx_mstate_global->__pyx_n_s_plum #define __pyx_n_s_plum1 __pyx_mstate_global->__pyx_n_s_plum1 #define __pyx_n_s_plum2 __pyx_mstate_global->__pyx_n_s_plum2 #define __pyx_n_s_plum3 __pyx_mstate_global->__pyx_n_s_plum3 #define __pyx_n_s_plum4 __pyx_mstate_global->__pyx_n_s_plum4 #define __pyx_n_s_powderblue __pyx_mstate_global->__pyx_n_s_powderblue #define __pyx_n_s_purple __pyx_mstate_global->__pyx_n_s_purple #define __pyx_n_s_purple1 __pyx_mstate_global->__pyx_n_s_purple1 #define __pyx_n_s_purple2 __pyx_mstate_global->__pyx_n_s_purple2 #define __pyx_n_s_purple3 __pyx_mstate_global->__pyx_n_s_purple3 #define __pyx_n_s_purple4 __pyx_mstate_global->__pyx_n_s_purple4 #define __pyx_n_s_pygame_sdl2_color __pyx_mstate_global->__pyx_n_s_pygame_sdl2_color #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_red __pyx_mstate_global->__pyx_n_s_red #define __pyx_n_s_red1 __pyx_mstate_global->__pyx_n_s_red1 #define __pyx_n_s_red2 __pyx_mstate_global->__pyx_n_s_red2 #define __pyx_n_s_red3 __pyx_mstate_global->__pyx_n_s_red3 #define __pyx_n_s_red4 __pyx_mstate_global->__pyx_n_s_red4 #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_rgba __pyx_mstate_global->__pyx_n_s_rgba #define __pyx_n_s_rosybrown __pyx_mstate_global->__pyx_n_s_rosybrown #define __pyx_n_s_rosybrown1 __pyx_mstate_global->__pyx_n_s_rosybrown1 #define __pyx_n_s_rosybrown2 __pyx_mstate_global->__pyx_n_s_rosybrown2 #define __pyx_n_s_rosybrown3 __pyx_mstate_global->__pyx_n_s_rosybrown3 #define __pyx_n_s_rosybrown4 __pyx_mstate_global->__pyx_n_s_rosybrown4 #define __pyx_n_s_round __pyx_mstate_global->__pyx_n_s_round #define __pyx_n_s_royalblue __pyx_mstate_global->__pyx_n_s_royalblue #define __pyx_n_s_royalblue1 __pyx_mstate_global->__pyx_n_s_royalblue1 #define __pyx_n_s_royalblue2 __pyx_mstate_global->__pyx_n_s_royalblue2 #define __pyx_n_s_royalblue3 __pyx_mstate_global->__pyx_n_s_royalblue3 #define __pyx_n_s_royalblue4 __pyx_mstate_global->__pyx_n_s_royalblue4 #define __pyx_n_s_saddlebrown __pyx_mstate_global->__pyx_n_s_saddlebrown #define __pyx_n_s_salmon __pyx_mstate_global->__pyx_n_s_salmon #define __pyx_n_s_salmon1 __pyx_mstate_global->__pyx_n_s_salmon1 #define __pyx_n_s_salmon2 __pyx_mstate_global->__pyx_n_s_salmon2 #define __pyx_n_s_salmon3 __pyx_mstate_global->__pyx_n_s_salmon3 #define __pyx_n_s_salmon4 __pyx_mstate_global->__pyx_n_s_salmon4 #define __pyx_n_s_sandybrown __pyx_mstate_global->__pyx_n_s_sandybrown #define __pyx_n_s_seagreen __pyx_mstate_global->__pyx_n_s_seagreen #define __pyx_n_s_seagreen1 __pyx_mstate_global->__pyx_n_s_seagreen1 #define __pyx_n_s_seagreen2 __pyx_mstate_global->__pyx_n_s_seagreen2 #define __pyx_n_s_seagreen3 __pyx_mstate_global->__pyx_n_s_seagreen3 #define __pyx_n_s_seagreen4 __pyx_mstate_global->__pyx_n_s_seagreen4 #define __pyx_n_s_seashell __pyx_mstate_global->__pyx_n_s_seashell #define __pyx_n_s_seashell1 __pyx_mstate_global->__pyx_n_s_seashell1 #define __pyx_n_s_seashell2 __pyx_mstate_global->__pyx_n_s_seashell2 #define __pyx_n_s_seashell3 __pyx_mstate_global->__pyx_n_s_seashell3 #define __pyx_n_s_seashell4 __pyx_mstate_global->__pyx_n_s_seashell4 #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_length __pyx_mstate_global->__pyx_n_s_set_length #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_sienna __pyx_mstate_global->__pyx_n_s_sienna #define __pyx_n_s_sienna1 __pyx_mstate_global->__pyx_n_s_sienna1 #define __pyx_n_s_sienna2 __pyx_mstate_global->__pyx_n_s_sienna2 #define __pyx_n_s_sienna3 __pyx_mstate_global->__pyx_n_s_sienna3 #define __pyx_n_s_sienna4 __pyx_mstate_global->__pyx_n_s_sienna4 #define __pyx_n_s_skyblue __pyx_mstate_global->__pyx_n_s_skyblue #define __pyx_n_s_skyblue1 __pyx_mstate_global->__pyx_n_s_skyblue1 #define __pyx_n_s_skyblue2 __pyx_mstate_global->__pyx_n_s_skyblue2 #define __pyx_n_s_skyblue3 __pyx_mstate_global->__pyx_n_s_skyblue3 #define __pyx_n_s_skyblue4 __pyx_mstate_global->__pyx_n_s_skyblue4 #define __pyx_n_s_slateblue __pyx_mstate_global->__pyx_n_s_slateblue #define __pyx_n_s_slateblue1 __pyx_mstate_global->__pyx_n_s_slateblue1 #define __pyx_n_s_slateblue2 __pyx_mstate_global->__pyx_n_s_slateblue2 #define __pyx_n_s_slateblue3 __pyx_mstate_global->__pyx_n_s_slateblue3 #define __pyx_n_s_slateblue4 __pyx_mstate_global->__pyx_n_s_slateblue4 #define __pyx_n_s_slategray __pyx_mstate_global->__pyx_n_s_slategray #define __pyx_n_s_slategray1 __pyx_mstate_global->__pyx_n_s_slategray1 #define __pyx_n_s_slategray2 __pyx_mstate_global->__pyx_n_s_slategray2 #define __pyx_n_s_slategray3 __pyx_mstate_global->__pyx_n_s_slategray3 #define __pyx_n_s_slategray4 __pyx_mstate_global->__pyx_n_s_slategray4 #define __pyx_n_s_slategrey __pyx_mstate_global->__pyx_n_s_slategrey #define __pyx_n_s_snow __pyx_mstate_global->__pyx_n_s_snow #define __pyx_n_s_snow1 __pyx_mstate_global->__pyx_n_s_snow1 #define __pyx_n_s_snow2 __pyx_mstate_global->__pyx_n_s_snow2 #define __pyx_n_s_snow3 __pyx_mstate_global->__pyx_n_s_snow3 #define __pyx_n_s_snow4 __pyx_mstate_global->__pyx_n_s_snow4 #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split #define __pyx_n_s_springgreen __pyx_mstate_global->__pyx_n_s_springgreen #define __pyx_n_s_springgreen1 __pyx_mstate_global->__pyx_n_s_springgreen1 #define __pyx_n_s_springgreen2 __pyx_mstate_global->__pyx_n_s_springgreen2 #define __pyx_n_s_springgreen3 __pyx_mstate_global->__pyx_n_s_springgreen3 #define __pyx_n_s_springgreen4 __pyx_mstate_global->__pyx_n_s_springgreen4 #define __pyx_kp_s_src_pygame_sdl2_color_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_color_pyx #define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith #define __pyx_n_s_steelblue __pyx_mstate_global->__pyx_n_s_steelblue #define __pyx_n_s_steelblue1 __pyx_mstate_global->__pyx_n_s_steelblue1 #define __pyx_n_s_steelblue2 __pyx_mstate_global->__pyx_n_s_steelblue2 #define __pyx_n_s_steelblue3 __pyx_mstate_global->__pyx_n_s_steelblue3 #define __pyx_n_s_steelblue4 __pyx_mstate_global->__pyx_n_s_steelblue4 #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct #define __pyx_n_s_tan __pyx_mstate_global->__pyx_n_s_tan #define __pyx_n_s_tan1 __pyx_mstate_global->__pyx_n_s_tan1 #define __pyx_n_s_tan2 __pyx_mstate_global->__pyx_n_s_tan2 #define __pyx_n_s_tan3 __pyx_mstate_global->__pyx_n_s_tan3 #define __pyx_n_s_tan4 __pyx_mstate_global->__pyx_n_s_tan4 #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_thistle __pyx_mstate_global->__pyx_n_s_thistle #define __pyx_n_s_thistle1 __pyx_mstate_global->__pyx_n_s_thistle1 #define __pyx_n_s_thistle2 __pyx_mstate_global->__pyx_n_s_thistle2 #define __pyx_n_s_thistle3 __pyx_mstate_global->__pyx_n_s_thistle3 #define __pyx_n_s_thistle4 __pyx_mstate_global->__pyx_n_s_thistle4 #define __pyx_n_s_tomato __pyx_mstate_global->__pyx_n_s_tomato #define __pyx_n_s_tomato1 __pyx_mstate_global->__pyx_n_s_tomato1 #define __pyx_n_s_tomato2 __pyx_mstate_global->__pyx_n_s_tomato2 #define __pyx_n_s_tomato3 __pyx_mstate_global->__pyx_n_s_tomato3 #define __pyx_n_s_tomato4 __pyx_mstate_global->__pyx_n_s_tomato4 #define __pyx_n_s_turquoise __pyx_mstate_global->__pyx_n_s_turquoise #define __pyx_n_s_turquoise1 __pyx_mstate_global->__pyx_n_s_turquoise1 #define __pyx_n_s_turquoise2 __pyx_mstate_global->__pyx_n_s_turquoise2 #define __pyx_n_s_turquoise3 __pyx_mstate_global->__pyx_n_s_turquoise3 #define __pyx_n_s_turquoise4 __pyx_mstate_global->__pyx_n_s_turquoise4 #define __pyx_n_s_unhexlify __pyx_mstate_global->__pyx_n_s_unhexlify #define __pyx_n_s_unpack __pyx_mstate_global->__pyx_n_s_unpack #define __pyx_n_s_violet __pyx_mstate_global->__pyx_n_s_violet #define __pyx_n_s_violetred __pyx_mstate_global->__pyx_n_s_violetred #define __pyx_n_s_violetred1 __pyx_mstate_global->__pyx_n_s_violetred1 #define __pyx_n_s_violetred2 __pyx_mstate_global->__pyx_n_s_violetred2 #define __pyx_n_s_violetred3 __pyx_mstate_global->__pyx_n_s_violetred3 #define __pyx_n_s_violetred4 __pyx_mstate_global->__pyx_n_s_violetred4 #define __pyx_n_s_wheat __pyx_mstate_global->__pyx_n_s_wheat #define __pyx_n_s_wheat1 __pyx_mstate_global->__pyx_n_s_wheat1 #define __pyx_n_s_wheat2 __pyx_mstate_global->__pyx_n_s_wheat2 #define __pyx_n_s_wheat3 __pyx_mstate_global->__pyx_n_s_wheat3 #define __pyx_n_s_wheat4 __pyx_mstate_global->__pyx_n_s_wheat4 #define __pyx_n_s_white __pyx_mstate_global->__pyx_n_s_white #define __pyx_n_s_whitesmoke __pyx_mstate_global->__pyx_n_s_whitesmoke #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_yellow __pyx_mstate_global->__pyx_n_s_yellow #define __pyx_n_s_yellow1 __pyx_mstate_global->__pyx_n_s_yellow1 #define __pyx_n_s_yellow2 __pyx_mstate_global->__pyx_n_s_yellow2 #define __pyx_n_s_yellow3 __pyx_mstate_global->__pyx_n_s_yellow3 #define __pyx_n_s_yellow4 __pyx_mstate_global->__pyx_n_s_yellow4 #define __pyx_n_s_yellowgreen __pyx_mstate_global->__pyx_n_s_yellowgreen #define __pyx_float_255_0 __pyx_mstate_global->__pyx_float_255_0 #define __pyx_float_360_0 __pyx_mstate_global->__pyx_float_360_0 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 #define __pyx_int_5 __pyx_mstate_global->__pyx_int_5 #define __pyx_int_7 __pyx_mstate_global->__pyx_int_7 #define __pyx_int_8 __pyx_mstate_global->__pyx_int_8 #define __pyx_int_10 __pyx_mstate_global->__pyx_int_10 #define __pyx_int_11 __pyx_mstate_global->__pyx_int_11 #define __pyx_int_12 __pyx_mstate_global->__pyx_int_12 #define __pyx_int_13 __pyx_mstate_global->__pyx_int_13 #define __pyx_int_14 __pyx_mstate_global->__pyx_int_14 #define __pyx_int_15 __pyx_mstate_global->__pyx_int_15 #define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 #define __pyx_int_18 __pyx_mstate_global->__pyx_int_18 #define __pyx_int_19 __pyx_mstate_global->__pyx_int_19 #define __pyx_int_20 __pyx_mstate_global->__pyx_int_20 #define __pyx_int_21 __pyx_mstate_global->__pyx_int_21 #define __pyx_int_23 __pyx_mstate_global->__pyx_int_23 #define __pyx_int_24 __pyx_mstate_global->__pyx_int_24 #define __pyx_int_25 __pyx_mstate_global->__pyx_int_25 #define __pyx_int_26 __pyx_mstate_global->__pyx_int_26 #define __pyx_int_28 __pyx_mstate_global->__pyx_int_28 #define __pyx_int_29 __pyx_mstate_global->__pyx_int_29 #define __pyx_int_30 __pyx_mstate_global->__pyx_int_30 #define __pyx_int_31 __pyx_mstate_global->__pyx_int_31 #define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 #define __pyx_int_33 __pyx_mstate_global->__pyx_int_33 #define __pyx_int_34 __pyx_mstate_global->__pyx_int_34 #define __pyx_int_35 __pyx_mstate_global->__pyx_int_35 #define __pyx_int_36 __pyx_mstate_global->__pyx_int_36 #define __pyx_int_37 __pyx_mstate_global->__pyx_int_37 #define __pyx_int_38 __pyx_mstate_global->__pyx_int_38 #define __pyx_int_39 __pyx_mstate_global->__pyx_int_39 #define __pyx_int_41 __pyx_mstate_global->__pyx_int_41 #define __pyx_int_42 __pyx_mstate_global->__pyx_int_42 #define __pyx_int_43 __pyx_mstate_global->__pyx_int_43 #define __pyx_int_44 __pyx_mstate_global->__pyx_int_44 #define __pyx_int_45 __pyx_mstate_global->__pyx_int_45 #define __pyx_int_46 __pyx_mstate_global->__pyx_int_46 #define __pyx_int_47 __pyx_mstate_global->__pyx_int_47 #define __pyx_int_48 __pyx_mstate_global->__pyx_int_48 #define __pyx_int_50 __pyx_mstate_global->__pyx_int_50 #define __pyx_int_51 __pyx_mstate_global->__pyx_int_51 #define __pyx_int_52 __pyx_mstate_global->__pyx_int_52 #define __pyx_int_54 __pyx_mstate_global->__pyx_int_54 #define __pyx_int_55 __pyx_mstate_global->__pyx_int_55 #define __pyx_int_56 __pyx_mstate_global->__pyx_int_56 #define __pyx_int_57 __pyx_mstate_global->__pyx_int_57 #define __pyx_int_58 __pyx_mstate_global->__pyx_int_58 #define __pyx_int_59 __pyx_mstate_global->__pyx_int_59 #define __pyx_int_60 __pyx_mstate_global->__pyx_int_60 #define __pyx_int_61 __pyx_mstate_global->__pyx_int_61 #define __pyx_int_62 __pyx_mstate_global->__pyx_int_62 #define __pyx_int_63 __pyx_mstate_global->__pyx_int_63 #define __pyx_int_64 __pyx_mstate_global->__pyx_int_64 #define __pyx_int_65 __pyx_mstate_global->__pyx_int_65 #define __pyx_int_66 __pyx_mstate_global->__pyx_int_66 #define __pyx_int_67 __pyx_mstate_global->__pyx_int_67 #define __pyx_int_69 __pyx_mstate_global->__pyx_int_69 #define __pyx_int_70 __pyx_mstate_global->__pyx_int_70 #define __pyx_int_71 __pyx_mstate_global->__pyx_int_71 #define __pyx_int_72 __pyx_mstate_global->__pyx_int_72 #define __pyx_int_73 __pyx_mstate_global->__pyx_int_73 #define __pyx_int_74 __pyx_mstate_global->__pyx_int_74 #define __pyx_int_76 __pyx_mstate_global->__pyx_int_76 #define __pyx_int_77 __pyx_mstate_global->__pyx_int_77 #define __pyx_int_78 __pyx_mstate_global->__pyx_int_78 #define __pyx_int_79 __pyx_mstate_global->__pyx_int_79 #define __pyx_int_80 __pyx_mstate_global->__pyx_int_80 #define __pyx_int_81 __pyx_mstate_global->__pyx_int_81 #define __pyx_int_82 __pyx_mstate_global->__pyx_int_82 #define __pyx_int_83 __pyx_mstate_global->__pyx_int_83 #define __pyx_int_84 __pyx_mstate_global->__pyx_int_84 #define __pyx_int_85 __pyx_mstate_global->__pyx_int_85 #define __pyx_int_86 __pyx_mstate_global->__pyx_int_86 #define __pyx_int_87 __pyx_mstate_global->__pyx_int_87 #define __pyx_int_89 __pyx_mstate_global->__pyx_int_89 #define __pyx_int_90 __pyx_mstate_global->__pyx_int_90 #define __pyx_int_91 __pyx_mstate_global->__pyx_int_91 #define __pyx_int_92 __pyx_mstate_global->__pyx_int_92 #define __pyx_int_93 __pyx_mstate_global->__pyx_int_93 #define __pyx_int_94 __pyx_mstate_global->__pyx_int_94 #define __pyx_int_95 __pyx_mstate_global->__pyx_int_95 #define __pyx_int_96 __pyx_mstate_global->__pyx_int_96 #define __pyx_int_97 __pyx_mstate_global->__pyx_int_97 #define __pyx_int_98 __pyx_mstate_global->__pyx_int_98 #define __pyx_int_99 __pyx_mstate_global->__pyx_int_99 #define __pyx_int_100 __pyx_mstate_global->__pyx_int_100 #define __pyx_int_101 __pyx_mstate_global->__pyx_int_101 #define __pyx_int_102 __pyx_mstate_global->__pyx_int_102 #define __pyx_int_103 __pyx_mstate_global->__pyx_int_103 #define __pyx_int_104 __pyx_mstate_global->__pyx_int_104 #define __pyx_int_105 __pyx_mstate_global->__pyx_int_105 #define __pyx_int_106 __pyx_mstate_global->__pyx_int_106 #define __pyx_int_107 __pyx_mstate_global->__pyx_int_107 #define __pyx_int_108 __pyx_mstate_global->__pyx_int_108 #define __pyx_int_110 __pyx_mstate_global->__pyx_int_110 #define __pyx_int_111 __pyx_mstate_global->__pyx_int_111 #define __pyx_int_112 __pyx_mstate_global->__pyx_int_112 #define __pyx_int_113 __pyx_mstate_global->__pyx_int_113 #define __pyx_int_114 __pyx_mstate_global->__pyx_int_114 #define __pyx_int_115 __pyx_mstate_global->__pyx_int_115 #define __pyx_int_116 __pyx_mstate_global->__pyx_int_116 #define __pyx_int_117 __pyx_mstate_global->__pyx_int_117 #define __pyx_int_118 __pyx_mstate_global->__pyx_int_118 #define __pyx_int_119 __pyx_mstate_global->__pyx_int_119 #define __pyx_int_120 __pyx_mstate_global->__pyx_int_120 #define __pyx_int_121 __pyx_mstate_global->__pyx_int_121 #define __pyx_int_122 __pyx_mstate_global->__pyx_int_122 #define __pyx_int_123 __pyx_mstate_global->__pyx_int_123 #define __pyx_int_124 __pyx_mstate_global->__pyx_int_124 #define __pyx_int_125 __pyx_mstate_global->__pyx_int_125 #define __pyx_int_126 __pyx_mstate_global->__pyx_int_126 #define __pyx_int_127 __pyx_mstate_global->__pyx_int_127 #define __pyx_int_128 __pyx_mstate_global->__pyx_int_128 #define __pyx_int_129 __pyx_mstate_global->__pyx_int_129 #define __pyx_int_130 __pyx_mstate_global->__pyx_int_130 #define __pyx_int_131 __pyx_mstate_global->__pyx_int_131 #define __pyx_int_132 __pyx_mstate_global->__pyx_int_132 #define __pyx_int_133 __pyx_mstate_global->__pyx_int_133 #define __pyx_int_134 __pyx_mstate_global->__pyx_int_134 #define __pyx_int_135 __pyx_mstate_global->__pyx_int_135 #define __pyx_int_136 __pyx_mstate_global->__pyx_int_136 #define __pyx_int_137 __pyx_mstate_global->__pyx_int_137 #define __pyx_int_138 __pyx_mstate_global->__pyx_int_138 #define __pyx_int_139 __pyx_mstate_global->__pyx_int_139 #define __pyx_int_140 __pyx_mstate_global->__pyx_int_140 #define __pyx_int_141 __pyx_mstate_global->__pyx_int_141 #define __pyx_int_142 __pyx_mstate_global->__pyx_int_142 #define __pyx_int_143 __pyx_mstate_global->__pyx_int_143 #define __pyx_int_144 __pyx_mstate_global->__pyx_int_144 #define __pyx_int_145 __pyx_mstate_global->__pyx_int_145 #define __pyx_int_147 __pyx_mstate_global->__pyx_int_147 #define __pyx_int_148 __pyx_mstate_global->__pyx_int_148 #define __pyx_int_149 __pyx_mstate_global->__pyx_int_149 #define __pyx_int_150 __pyx_mstate_global->__pyx_int_150 #define __pyx_int_151 __pyx_mstate_global->__pyx_int_151 #define __pyx_int_152 __pyx_mstate_global->__pyx_int_152 #define __pyx_int_153 __pyx_mstate_global->__pyx_int_153 #define __pyx_int_154 __pyx_mstate_global->__pyx_int_154 #define __pyx_int_155 __pyx_mstate_global->__pyx_int_155 #define __pyx_int_156 __pyx_mstate_global->__pyx_int_156 #define __pyx_int_158 __pyx_mstate_global->__pyx_int_158 #define __pyx_int_159 __pyx_mstate_global->__pyx_int_159 #define __pyx_int_160 __pyx_mstate_global->__pyx_int_160 #define __pyx_int_161 __pyx_mstate_global->__pyx_int_161 #define __pyx_int_162 __pyx_mstate_global->__pyx_int_162 #define __pyx_int_163 __pyx_mstate_global->__pyx_int_163 #define __pyx_int_164 __pyx_mstate_global->__pyx_int_164 #define __pyx_int_165 __pyx_mstate_global->__pyx_int_165 #define __pyx_int_166 __pyx_mstate_global->__pyx_int_166 #define __pyx_int_167 __pyx_mstate_global->__pyx_int_167 #define __pyx_int_168 __pyx_mstate_global->__pyx_int_168 #define __pyx_int_169 __pyx_mstate_global->__pyx_int_169 #define __pyx_int_170 __pyx_mstate_global->__pyx_int_170 #define __pyx_int_171 __pyx_mstate_global->__pyx_int_171 #define __pyx_int_172 __pyx_mstate_global->__pyx_int_172 #define __pyx_int_173 __pyx_mstate_global->__pyx_int_173 #define __pyx_int_174 __pyx_mstate_global->__pyx_int_174 #define __pyx_int_175 __pyx_mstate_global->__pyx_int_175 #define __pyx_int_176 __pyx_mstate_global->__pyx_int_176 #define __pyx_int_177 __pyx_mstate_global->__pyx_int_177 #define __pyx_int_178 __pyx_mstate_global->__pyx_int_178 #define __pyx_int_179 __pyx_mstate_global->__pyx_int_179 #define __pyx_int_180 __pyx_mstate_global->__pyx_int_180 #define __pyx_int_181 __pyx_mstate_global->__pyx_int_181 #define __pyx_int_182 __pyx_mstate_global->__pyx_int_182 #define __pyx_int_183 __pyx_mstate_global->__pyx_int_183 #define __pyx_int_184 __pyx_mstate_global->__pyx_int_184 #define __pyx_int_185 __pyx_mstate_global->__pyx_int_185 #define __pyx_int_186 __pyx_mstate_global->__pyx_int_186 #define __pyx_int_187 __pyx_mstate_global->__pyx_int_187 #define __pyx_int_188 __pyx_mstate_global->__pyx_int_188 #define __pyx_int_189 __pyx_mstate_global->__pyx_int_189 #define __pyx_int_190 __pyx_mstate_global->__pyx_int_190 #define __pyx_int_191 __pyx_mstate_global->__pyx_int_191 #define __pyx_int_192 __pyx_mstate_global->__pyx_int_192 #define __pyx_int_193 __pyx_mstate_global->__pyx_int_193 #define __pyx_int_194 __pyx_mstate_global->__pyx_int_194 #define __pyx_int_196 __pyx_mstate_global->__pyx_int_196 #define __pyx_int_197 __pyx_mstate_global->__pyx_int_197 #define __pyx_int_198 __pyx_mstate_global->__pyx_int_198 #define __pyx_int_199 __pyx_mstate_global->__pyx_int_199 #define __pyx_int_200 __pyx_mstate_global->__pyx_int_200 #define __pyx_int_201 __pyx_mstate_global->__pyx_int_201 #define __pyx_int_202 __pyx_mstate_global->__pyx_int_202 #define __pyx_int_203 __pyx_mstate_global->__pyx_int_203 #define __pyx_int_204 __pyx_mstate_global->__pyx_int_204 #define __pyx_int_205 __pyx_mstate_global->__pyx_int_205 #define __pyx_int_206 __pyx_mstate_global->__pyx_int_206 #define __pyx_int_207 __pyx_mstate_global->__pyx_int_207 #define __pyx_int_208 __pyx_mstate_global->__pyx_int_208 #define __pyx_int_209 __pyx_mstate_global->__pyx_int_209 #define __pyx_int_210 __pyx_mstate_global->__pyx_int_210 #define __pyx_int_211 __pyx_mstate_global->__pyx_int_211 #define __pyx_int_212 __pyx_mstate_global->__pyx_int_212 #define __pyx_int_213 __pyx_mstate_global->__pyx_int_213 #define __pyx_int_214 __pyx_mstate_global->__pyx_int_214 #define __pyx_int_215 __pyx_mstate_global->__pyx_int_215 #define __pyx_int_216 __pyx_mstate_global->__pyx_int_216 #define __pyx_int_217 __pyx_mstate_global->__pyx_int_217 #define __pyx_int_218 __pyx_mstate_global->__pyx_int_218 #define __pyx_int_219 __pyx_mstate_global->__pyx_int_219 #define __pyx_int_220 __pyx_mstate_global->__pyx_int_220 #define __pyx_int_221 __pyx_mstate_global->__pyx_int_221 #define __pyx_int_222 __pyx_mstate_global->__pyx_int_222 #define __pyx_int_223 __pyx_mstate_global->__pyx_int_223 #define __pyx_int_224 __pyx_mstate_global->__pyx_int_224 #define __pyx_int_225 __pyx_mstate_global->__pyx_int_225 #define __pyx_int_226 __pyx_mstate_global->__pyx_int_226 #define __pyx_int_227 __pyx_mstate_global->__pyx_int_227 #define __pyx_int_228 __pyx_mstate_global->__pyx_int_228 #define __pyx_int_229 __pyx_mstate_global->__pyx_int_229 #define __pyx_int_230 __pyx_mstate_global->__pyx_int_230 #define __pyx_int_231 __pyx_mstate_global->__pyx_int_231 #define __pyx_int_232 __pyx_mstate_global->__pyx_int_232 #define __pyx_int_233 __pyx_mstate_global->__pyx_int_233 #define __pyx_int_235 __pyx_mstate_global->__pyx_int_235 #define __pyx_int_236 __pyx_mstate_global->__pyx_int_236 #define __pyx_int_237 __pyx_mstate_global->__pyx_int_237 #define __pyx_int_238 __pyx_mstate_global->__pyx_int_238 #define __pyx_int_239 __pyx_mstate_global->__pyx_int_239 #define __pyx_int_240 __pyx_mstate_global->__pyx_int_240 #define __pyx_int_242 __pyx_mstate_global->__pyx_int_242 #define __pyx_int_244 __pyx_mstate_global->__pyx_int_244 #define __pyx_int_245 __pyx_mstate_global->__pyx_int_245 #define __pyx_int_246 __pyx_mstate_global->__pyx_int_246 #define __pyx_int_247 __pyx_mstate_global->__pyx_int_247 #define __pyx_int_248 __pyx_mstate_global->__pyx_int_248 #define __pyx_int_250 __pyx_mstate_global->__pyx_int_250 #define __pyx_int_251 __pyx_mstate_global->__pyx_int_251 #define __pyx_int_252 __pyx_mstate_global->__pyx_int_252 #define __pyx_int_253 __pyx_mstate_global->__pyx_int_253 #define __pyx_int_255 __pyx_mstate_global->__pyx_int_255 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_slice__4 __pyx_mstate_global->__pyx_slice__4 #define __pyx_slice__5 __pyx_mstate_global->__pyx_slice__5 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 #define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 #define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46 #define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 #define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48 #define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 #define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50 #define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 #define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 #define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 #define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 #define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57 #define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58 #define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59 #define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60 #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 #define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 #define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 #define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 #define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 #define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 #define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 #define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70 #define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 #define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72 #define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 #define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 #define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75 #define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 #define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77 #define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 #define __pyx_tuple__80 __pyx_mstate_global->__pyx_tuple__80 #define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81 #define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82 #define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83 #define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 #define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85 #define __pyx_tuple__86 __pyx_mstate_global->__pyx_tuple__86 #define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 #define __pyx_tuple__88 __pyx_mstate_global->__pyx_tuple__88 #define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 #define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90 #define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 #define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92 #define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93 #define __pyx_tuple__94 __pyx_mstate_global->__pyx_tuple__94 #define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95 #define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96 #define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97 #define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98 #define __pyx_tuple__99 __pyx_mstate_global->__pyx_tuple__99 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100 #define __pyx_tuple__101 __pyx_mstate_global->__pyx_tuple__101 #define __pyx_tuple__102 __pyx_mstate_global->__pyx_tuple__102 #define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103 #define __pyx_tuple__104 __pyx_mstate_global->__pyx_tuple__104 #define __pyx_tuple__105 __pyx_mstate_global->__pyx_tuple__105 #define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106 #define __pyx_tuple__107 __pyx_mstate_global->__pyx_tuple__107 #define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108 #define __pyx_tuple__109 __pyx_mstate_global->__pyx_tuple__109 #define __pyx_tuple__110 __pyx_mstate_global->__pyx_tuple__110 #define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111 #define __pyx_tuple__112 __pyx_mstate_global->__pyx_tuple__112 #define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113 #define __pyx_tuple__114 __pyx_mstate_global->__pyx_tuple__114 #define __pyx_tuple__115 __pyx_mstate_global->__pyx_tuple__115 #define __pyx_tuple__116 __pyx_mstate_global->__pyx_tuple__116 #define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117 #define __pyx_tuple__118 __pyx_mstate_global->__pyx_tuple__118 #define __pyx_tuple__119 __pyx_mstate_global->__pyx_tuple__119 #define __pyx_tuple__120 __pyx_mstate_global->__pyx_tuple__120 #define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121 #define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122 #define __pyx_tuple__123 __pyx_mstate_global->__pyx_tuple__123 #define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124 #define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125 #define __pyx_tuple__126 __pyx_mstate_global->__pyx_tuple__126 #define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127 #define __pyx_tuple__128 __pyx_mstate_global->__pyx_tuple__128 #define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129 #define __pyx_tuple__130 __pyx_mstate_global->__pyx_tuple__130 #define __pyx_tuple__131 __pyx_mstate_global->__pyx_tuple__131 #define __pyx_tuple__132 __pyx_mstate_global->__pyx_tuple__132 #define __pyx_tuple__133 __pyx_mstate_global->__pyx_tuple__133 #define __pyx_tuple__134 __pyx_mstate_global->__pyx_tuple__134 #define __pyx_tuple__135 __pyx_mstate_global->__pyx_tuple__135 #define __pyx_tuple__136 __pyx_mstate_global->__pyx_tuple__136 #define __pyx_tuple__137 __pyx_mstate_global->__pyx_tuple__137 #define __pyx_tuple__138 __pyx_mstate_global->__pyx_tuple__138 #define __pyx_tuple__139 __pyx_mstate_global->__pyx_tuple__139 #define __pyx_tuple__140 __pyx_mstate_global->__pyx_tuple__140 #define __pyx_tuple__141 __pyx_mstate_global->__pyx_tuple__141 #define __pyx_tuple__142 __pyx_mstate_global->__pyx_tuple__142 #define __pyx_tuple__143 __pyx_mstate_global->__pyx_tuple__143 #define __pyx_tuple__144 __pyx_mstate_global->__pyx_tuple__144 #define __pyx_tuple__145 __pyx_mstate_global->__pyx_tuple__145 #define __pyx_tuple__146 __pyx_mstate_global->__pyx_tuple__146 #define __pyx_tuple__147 __pyx_mstate_global->__pyx_tuple__147 #define __pyx_tuple__148 __pyx_mstate_global->__pyx_tuple__148 #define __pyx_tuple__149 __pyx_mstate_global->__pyx_tuple__149 #define __pyx_tuple__150 __pyx_mstate_global->__pyx_tuple__150 #define __pyx_tuple__151 __pyx_mstate_global->__pyx_tuple__151 #define __pyx_tuple__152 __pyx_mstate_global->__pyx_tuple__152 #define __pyx_tuple__153 __pyx_mstate_global->__pyx_tuple__153 #define __pyx_tuple__154 __pyx_mstate_global->__pyx_tuple__154 #define __pyx_tuple__155 __pyx_mstate_global->__pyx_tuple__155 #define __pyx_tuple__156 __pyx_mstate_global->__pyx_tuple__156 #define __pyx_tuple__157 __pyx_mstate_global->__pyx_tuple__157 #define __pyx_tuple__158 __pyx_mstate_global->__pyx_tuple__158 #define __pyx_tuple__159 __pyx_mstate_global->__pyx_tuple__159 #define __pyx_tuple__160 __pyx_mstate_global->__pyx_tuple__160 #define __pyx_tuple__161 __pyx_mstate_global->__pyx_tuple__161 #define __pyx_tuple__162 __pyx_mstate_global->__pyx_tuple__162 #define __pyx_tuple__163 __pyx_mstate_global->__pyx_tuple__163 #define __pyx_tuple__164 __pyx_mstate_global->__pyx_tuple__164 #define __pyx_tuple__165 __pyx_mstate_global->__pyx_tuple__165 #define __pyx_tuple__166 __pyx_mstate_global->__pyx_tuple__166 #define __pyx_tuple__167 __pyx_mstate_global->__pyx_tuple__167 #define __pyx_tuple__168 __pyx_mstate_global->__pyx_tuple__168 #define __pyx_tuple__169 __pyx_mstate_global->__pyx_tuple__169 #define __pyx_tuple__170 __pyx_mstate_global->__pyx_tuple__170 #define __pyx_tuple__171 __pyx_mstate_global->__pyx_tuple__171 #define __pyx_tuple__172 __pyx_mstate_global->__pyx_tuple__172 #define __pyx_tuple__173 __pyx_mstate_global->__pyx_tuple__173 #define __pyx_tuple__174 __pyx_mstate_global->__pyx_tuple__174 #define __pyx_tuple__175 __pyx_mstate_global->__pyx_tuple__175 #define __pyx_tuple__176 __pyx_mstate_global->__pyx_tuple__176 #define __pyx_tuple__177 __pyx_mstate_global->__pyx_tuple__177 #define __pyx_tuple__178 __pyx_mstate_global->__pyx_tuple__178 #define __pyx_tuple__179 __pyx_mstate_global->__pyx_tuple__179 #define __pyx_tuple__180 __pyx_mstate_global->__pyx_tuple__180 #define __pyx_tuple__181 __pyx_mstate_global->__pyx_tuple__181 #define __pyx_tuple__182 __pyx_mstate_global->__pyx_tuple__182 #define __pyx_tuple__183 __pyx_mstate_global->__pyx_tuple__183 #define __pyx_tuple__184 __pyx_mstate_global->__pyx_tuple__184 #define __pyx_tuple__185 __pyx_mstate_global->__pyx_tuple__185 #define __pyx_tuple__186 __pyx_mstate_global->__pyx_tuple__186 #define __pyx_tuple__187 __pyx_mstate_global->__pyx_tuple__187 #define __pyx_tuple__188 __pyx_mstate_global->__pyx_tuple__188 #define __pyx_tuple__189 __pyx_mstate_global->__pyx_tuple__189 #define __pyx_tuple__190 __pyx_mstate_global->__pyx_tuple__190 #define __pyx_tuple__191 __pyx_mstate_global->__pyx_tuple__191 #define __pyx_tuple__192 __pyx_mstate_global->__pyx_tuple__192 #define __pyx_tuple__193 __pyx_mstate_global->__pyx_tuple__193 #define __pyx_tuple__194 __pyx_mstate_global->__pyx_tuple__194 #define __pyx_tuple__195 __pyx_mstate_global->__pyx_tuple__195 #define __pyx_tuple__196 __pyx_mstate_global->__pyx_tuple__196 #define __pyx_tuple__197 __pyx_mstate_global->__pyx_tuple__197 #define __pyx_tuple__198 __pyx_mstate_global->__pyx_tuple__198 #define __pyx_tuple__199 __pyx_mstate_global->__pyx_tuple__199 #define __pyx_tuple__200 __pyx_mstate_global->__pyx_tuple__200 #define __pyx_tuple__201 __pyx_mstate_global->__pyx_tuple__201 #define __pyx_tuple__202 __pyx_mstate_global->__pyx_tuple__202 #define __pyx_tuple__203 __pyx_mstate_global->__pyx_tuple__203 #define __pyx_tuple__204 __pyx_mstate_global->__pyx_tuple__204 #define __pyx_tuple__205 __pyx_mstate_global->__pyx_tuple__205 #define __pyx_tuple__206 __pyx_mstate_global->__pyx_tuple__206 #define __pyx_tuple__207 __pyx_mstate_global->__pyx_tuple__207 #define __pyx_tuple__208 __pyx_mstate_global->__pyx_tuple__208 #define __pyx_tuple__209 __pyx_mstate_global->__pyx_tuple__209 #define __pyx_tuple__210 __pyx_mstate_global->__pyx_tuple__210 #define __pyx_tuple__211 __pyx_mstate_global->__pyx_tuple__211 #define __pyx_tuple__212 __pyx_mstate_global->__pyx_tuple__212 #define __pyx_tuple__213 __pyx_mstate_global->__pyx_tuple__213 #define __pyx_tuple__214 __pyx_mstate_global->__pyx_tuple__214 #define __pyx_tuple__215 __pyx_mstate_global->__pyx_tuple__215 #define __pyx_tuple__216 __pyx_mstate_global->__pyx_tuple__216 #define __pyx_tuple__217 __pyx_mstate_global->__pyx_tuple__217 #define __pyx_tuple__218 __pyx_mstate_global->__pyx_tuple__218 #define __pyx_tuple__219 __pyx_mstate_global->__pyx_tuple__219 #define __pyx_tuple__220 __pyx_mstate_global->__pyx_tuple__220 #define __pyx_tuple__221 __pyx_mstate_global->__pyx_tuple__221 #define __pyx_tuple__222 __pyx_mstate_global->__pyx_tuple__222 #define __pyx_tuple__223 __pyx_mstate_global->__pyx_tuple__223 #define __pyx_tuple__224 __pyx_mstate_global->__pyx_tuple__224 #define __pyx_tuple__225 __pyx_mstate_global->__pyx_tuple__225 #define __pyx_tuple__226 __pyx_mstate_global->__pyx_tuple__226 #define __pyx_tuple__227 __pyx_mstate_global->__pyx_tuple__227 #define __pyx_tuple__228 __pyx_mstate_global->__pyx_tuple__228 #define __pyx_tuple__229 __pyx_mstate_global->__pyx_tuple__229 #define __pyx_tuple__230 __pyx_mstate_global->__pyx_tuple__230 #define __pyx_tuple__231 __pyx_mstate_global->__pyx_tuple__231 #define __pyx_tuple__232 __pyx_mstate_global->__pyx_tuple__232 #define __pyx_tuple__233 __pyx_mstate_global->__pyx_tuple__233 #define __pyx_tuple__234 __pyx_mstate_global->__pyx_tuple__234 #define __pyx_tuple__235 __pyx_mstate_global->__pyx_tuple__235 #define __pyx_tuple__236 __pyx_mstate_global->__pyx_tuple__236 #define __pyx_tuple__237 __pyx_mstate_global->__pyx_tuple__237 #define __pyx_tuple__238 __pyx_mstate_global->__pyx_tuple__238 #define __pyx_tuple__239 __pyx_mstate_global->__pyx_tuple__239 #define __pyx_tuple__240 __pyx_mstate_global->__pyx_tuple__240 #define __pyx_tuple__241 __pyx_mstate_global->__pyx_tuple__241 #define __pyx_tuple__242 __pyx_mstate_global->__pyx_tuple__242 #define __pyx_tuple__243 __pyx_mstate_global->__pyx_tuple__243 #define __pyx_tuple__244 __pyx_mstate_global->__pyx_tuple__244 #define __pyx_tuple__245 __pyx_mstate_global->__pyx_tuple__245 #define __pyx_tuple__246 __pyx_mstate_global->__pyx_tuple__246 #define __pyx_tuple__247 __pyx_mstate_global->__pyx_tuple__247 #define __pyx_tuple__248 __pyx_mstate_global->__pyx_tuple__248 #define __pyx_tuple__249 __pyx_mstate_global->__pyx_tuple__249 #define __pyx_tuple__250 __pyx_mstate_global->__pyx_tuple__250 #define __pyx_tuple__251 __pyx_mstate_global->__pyx_tuple__251 #define __pyx_tuple__252 __pyx_mstate_global->__pyx_tuple__252 #define __pyx_tuple__253 __pyx_mstate_global->__pyx_tuple__253 #define __pyx_tuple__254 __pyx_mstate_global->__pyx_tuple__254 #define __pyx_tuple__255 __pyx_mstate_global->__pyx_tuple__255 #define __pyx_tuple__256 __pyx_mstate_global->__pyx_tuple__256 #define __pyx_tuple__257 __pyx_mstate_global->__pyx_tuple__257 #define __pyx_tuple__258 __pyx_mstate_global->__pyx_tuple__258 #define __pyx_tuple__259 __pyx_mstate_global->__pyx_tuple__259 #define __pyx_tuple__260 __pyx_mstate_global->__pyx_tuple__260 #define __pyx_tuple__261 __pyx_mstate_global->__pyx_tuple__261 #define __pyx_tuple__262 __pyx_mstate_global->__pyx_tuple__262 #define __pyx_tuple__263 __pyx_mstate_global->__pyx_tuple__263 #define __pyx_tuple__264 __pyx_mstate_global->__pyx_tuple__264 #define __pyx_tuple__265 __pyx_mstate_global->__pyx_tuple__265 #define __pyx_tuple__266 __pyx_mstate_global->__pyx_tuple__266 #define __pyx_tuple__267 __pyx_mstate_global->__pyx_tuple__267 #define __pyx_tuple__268 __pyx_mstate_global->__pyx_tuple__268 #define __pyx_tuple__269 __pyx_mstate_global->__pyx_tuple__269 #define __pyx_tuple__270 __pyx_mstate_global->__pyx_tuple__270 #define __pyx_tuple__271 __pyx_mstate_global->__pyx_tuple__271 #define __pyx_tuple__272 __pyx_mstate_global->__pyx_tuple__272 #define __pyx_tuple__273 __pyx_mstate_global->__pyx_tuple__273 #define __pyx_tuple__274 __pyx_mstate_global->__pyx_tuple__274 #define __pyx_tuple__275 __pyx_mstate_global->__pyx_tuple__275 #define __pyx_tuple__276 __pyx_mstate_global->__pyx_tuple__276 #define __pyx_tuple__277 __pyx_mstate_global->__pyx_tuple__277 #define __pyx_tuple__278 __pyx_mstate_global->__pyx_tuple__278 #define __pyx_tuple__279 __pyx_mstate_global->__pyx_tuple__279 #define __pyx_tuple__280 __pyx_mstate_global->__pyx_tuple__280 #define __pyx_tuple__281 __pyx_mstate_global->__pyx_tuple__281 #define __pyx_tuple__282 __pyx_mstate_global->__pyx_tuple__282 #define __pyx_tuple__283 __pyx_mstate_global->__pyx_tuple__283 #define __pyx_tuple__284 __pyx_mstate_global->__pyx_tuple__284 #define __pyx_tuple__285 __pyx_mstate_global->__pyx_tuple__285 #define __pyx_tuple__286 __pyx_mstate_global->__pyx_tuple__286 #define __pyx_tuple__287 __pyx_mstate_global->__pyx_tuple__287 #define __pyx_tuple__288 __pyx_mstate_global->__pyx_tuple__288 #define __pyx_tuple__289 __pyx_mstate_global->__pyx_tuple__289 #define __pyx_tuple__290 __pyx_mstate_global->__pyx_tuple__290 #define __pyx_tuple__291 __pyx_mstate_global->__pyx_tuple__291 #define __pyx_tuple__292 __pyx_mstate_global->__pyx_tuple__292 #define __pyx_tuple__293 __pyx_mstate_global->__pyx_tuple__293 #define __pyx_tuple__294 __pyx_mstate_global->__pyx_tuple__294 #define __pyx_tuple__295 __pyx_mstate_global->__pyx_tuple__295 #define __pyx_tuple__296 __pyx_mstate_global->__pyx_tuple__296 #define __pyx_tuple__297 __pyx_mstate_global->__pyx_tuple__297 #define __pyx_tuple__298 __pyx_mstate_global->__pyx_tuple__298 #define __pyx_tuple__299 __pyx_mstate_global->__pyx_tuple__299 #define __pyx_tuple__300 __pyx_mstate_global->__pyx_tuple__300 #define __pyx_tuple__301 __pyx_mstate_global->__pyx_tuple__301 #define __pyx_tuple__302 __pyx_mstate_global->__pyx_tuple__302 #define __pyx_tuple__303 __pyx_mstate_global->__pyx_tuple__303 #define __pyx_tuple__304 __pyx_mstate_global->__pyx_tuple__304 #define __pyx_tuple__305 __pyx_mstate_global->__pyx_tuple__305 #define __pyx_tuple__306 __pyx_mstate_global->__pyx_tuple__306 #define __pyx_tuple__307 __pyx_mstate_global->__pyx_tuple__307 #define __pyx_tuple__308 __pyx_mstate_global->__pyx_tuple__308 #define __pyx_tuple__309 __pyx_mstate_global->__pyx_tuple__309 #define __pyx_tuple__310 __pyx_mstate_global->__pyx_tuple__310 #define __pyx_tuple__311 __pyx_mstate_global->__pyx_tuple__311 #define __pyx_tuple__312 __pyx_mstate_global->__pyx_tuple__312 #define __pyx_tuple__313 __pyx_mstate_global->__pyx_tuple__313 #define __pyx_tuple__314 __pyx_mstate_global->__pyx_tuple__314 #define __pyx_tuple__315 __pyx_mstate_global->__pyx_tuple__315 #define __pyx_tuple__316 __pyx_mstate_global->__pyx_tuple__316 #define __pyx_tuple__317 __pyx_mstate_global->__pyx_tuple__317 #define __pyx_tuple__318 __pyx_mstate_global->__pyx_tuple__318 #define __pyx_tuple__319 __pyx_mstate_global->__pyx_tuple__319 #define __pyx_tuple__320 __pyx_mstate_global->__pyx_tuple__320 #define __pyx_tuple__321 __pyx_mstate_global->__pyx_tuple__321 #define __pyx_tuple__322 __pyx_mstate_global->__pyx_tuple__322 #define __pyx_tuple__323 __pyx_mstate_global->__pyx_tuple__323 #define __pyx_tuple__324 __pyx_mstate_global->__pyx_tuple__324 #define __pyx_tuple__325 __pyx_mstate_global->__pyx_tuple__325 #define __pyx_tuple__326 __pyx_mstate_global->__pyx_tuple__326 #define __pyx_tuple__327 __pyx_mstate_global->__pyx_tuple__327 #define __pyx_tuple__328 __pyx_mstate_global->__pyx_tuple__328 #define __pyx_tuple__329 __pyx_mstate_global->__pyx_tuple__329 #define __pyx_tuple__330 __pyx_mstate_global->__pyx_tuple__330 #define __pyx_tuple__331 __pyx_mstate_global->__pyx_tuple__331 #define __pyx_tuple__332 __pyx_mstate_global->__pyx_tuple__332 #define __pyx_tuple__333 __pyx_mstate_global->__pyx_tuple__333 #define __pyx_tuple__334 __pyx_mstate_global->__pyx_tuple__334 #define __pyx_tuple__335 __pyx_mstate_global->__pyx_tuple__335 #define __pyx_tuple__336 __pyx_mstate_global->__pyx_tuple__336 #define __pyx_tuple__337 __pyx_mstate_global->__pyx_tuple__337 #define __pyx_tuple__338 __pyx_mstate_global->__pyx_tuple__338 #define __pyx_tuple__339 __pyx_mstate_global->__pyx_tuple__339 #define __pyx_tuple__340 __pyx_mstate_global->__pyx_tuple__340 #define __pyx_tuple__341 __pyx_mstate_global->__pyx_tuple__341 #define __pyx_tuple__342 __pyx_mstate_global->__pyx_tuple__342 #define __pyx_tuple__343 __pyx_mstate_global->__pyx_tuple__343 #define __pyx_tuple__344 __pyx_mstate_global->__pyx_tuple__344 #define __pyx_tuple__345 __pyx_mstate_global->__pyx_tuple__345 #define __pyx_tuple__346 __pyx_mstate_global->__pyx_tuple__346 #define __pyx_tuple__347 __pyx_mstate_global->__pyx_tuple__347 #define __pyx_tuple__348 __pyx_mstate_global->__pyx_tuple__348 #define __pyx_tuple__349 __pyx_mstate_global->__pyx_tuple__349 #define __pyx_tuple__350 __pyx_mstate_global->__pyx_tuple__350 #define __pyx_tuple__351 __pyx_mstate_global->__pyx_tuple__351 #define __pyx_tuple__352 __pyx_mstate_global->__pyx_tuple__352 #define __pyx_tuple__353 __pyx_mstate_global->__pyx_tuple__353 #define __pyx_tuple__354 __pyx_mstate_global->__pyx_tuple__354 #define __pyx_tuple__355 __pyx_mstate_global->__pyx_tuple__355 #define __pyx_tuple__356 __pyx_mstate_global->__pyx_tuple__356 #define __pyx_tuple__357 __pyx_mstate_global->__pyx_tuple__357 #define __pyx_tuple__358 __pyx_mstate_global->__pyx_tuple__358 #define __pyx_tuple__359 __pyx_mstate_global->__pyx_tuple__359 #define __pyx_tuple__360 __pyx_mstate_global->__pyx_tuple__360 #define __pyx_tuple__361 __pyx_mstate_global->__pyx_tuple__361 #define __pyx_tuple__362 __pyx_mstate_global->__pyx_tuple__362 #define __pyx_tuple__363 __pyx_mstate_global->__pyx_tuple__363 #define __pyx_tuple__364 __pyx_mstate_global->__pyx_tuple__364 #define __pyx_tuple__365 __pyx_mstate_global->__pyx_tuple__365 #define __pyx_tuple__366 __pyx_mstate_global->__pyx_tuple__366 #define __pyx_tuple__367 __pyx_mstate_global->__pyx_tuple__367 #define __pyx_tuple__368 __pyx_mstate_global->__pyx_tuple__368 #define __pyx_tuple__369 __pyx_mstate_global->__pyx_tuple__369 #define __pyx_tuple__370 __pyx_mstate_global->__pyx_tuple__370 #define __pyx_tuple__371 __pyx_mstate_global->__pyx_tuple__371 #define __pyx_tuple__372 __pyx_mstate_global->__pyx_tuple__372 #define __pyx_tuple__373 __pyx_mstate_global->__pyx_tuple__373 #define __pyx_tuple__374 __pyx_mstate_global->__pyx_tuple__374 #define __pyx_tuple__375 __pyx_mstate_global->__pyx_tuple__375 #define __pyx_tuple__376 __pyx_mstate_global->__pyx_tuple__376 #define __pyx_tuple__377 __pyx_mstate_global->__pyx_tuple__377 #define __pyx_tuple__378 __pyx_mstate_global->__pyx_tuple__378 #define __pyx_tuple__379 __pyx_mstate_global->__pyx_tuple__379 #define __pyx_tuple__380 __pyx_mstate_global->__pyx_tuple__380 #define __pyx_tuple__381 __pyx_mstate_global->__pyx_tuple__381 #define __pyx_tuple__382 __pyx_mstate_global->__pyx_tuple__382 #define __pyx_tuple__383 __pyx_mstate_global->__pyx_tuple__383 #define __pyx_tuple__384 __pyx_mstate_global->__pyx_tuple__384 #define __pyx_tuple__385 __pyx_mstate_global->__pyx_tuple__385 #define __pyx_tuple__386 __pyx_mstate_global->__pyx_tuple__386 #define __pyx_tuple__387 __pyx_mstate_global->__pyx_tuple__387 #define __pyx_tuple__388 __pyx_mstate_global->__pyx_tuple__388 #define __pyx_tuple__389 __pyx_mstate_global->__pyx_tuple__389 #define __pyx_tuple__390 __pyx_mstate_global->__pyx_tuple__390 #define __pyx_tuple__391 __pyx_mstate_global->__pyx_tuple__391 #define __pyx_tuple__392 __pyx_mstate_global->__pyx_tuple__392 #define __pyx_tuple__393 __pyx_mstate_global->__pyx_tuple__393 #define __pyx_tuple__394 __pyx_mstate_global->__pyx_tuple__394 #define __pyx_tuple__395 __pyx_mstate_global->__pyx_tuple__395 #define __pyx_tuple__396 __pyx_mstate_global->__pyx_tuple__396 #define __pyx_tuple__397 __pyx_mstate_global->__pyx_tuple__397 #define __pyx_tuple__398 __pyx_mstate_global->__pyx_tuple__398 #define __pyx_tuple__399 __pyx_mstate_global->__pyx_tuple__399 #define __pyx_tuple__400 __pyx_mstate_global->__pyx_tuple__400 #define __pyx_tuple__401 __pyx_mstate_global->__pyx_tuple__401 #define __pyx_tuple__402 __pyx_mstate_global->__pyx_tuple__402 #define __pyx_tuple__403 __pyx_mstate_global->__pyx_tuple__403 #define __pyx_tuple__404 __pyx_mstate_global->__pyx_tuple__404 #define __pyx_tuple__405 __pyx_mstate_global->__pyx_tuple__405 #define __pyx_tuple__406 __pyx_mstate_global->__pyx_tuple__406 #define __pyx_tuple__407 __pyx_mstate_global->__pyx_tuple__407 #define __pyx_tuple__408 __pyx_mstate_global->__pyx_tuple__408 #define __pyx_tuple__409 __pyx_mstate_global->__pyx_tuple__409 #define __pyx_tuple__410 __pyx_mstate_global->__pyx_tuple__410 #define __pyx_tuple__411 __pyx_mstate_global->__pyx_tuple__411 #define __pyx_tuple__412 __pyx_mstate_global->__pyx_tuple__412 #define __pyx_tuple__413 __pyx_mstate_global->__pyx_tuple__413 #define __pyx_tuple__414 __pyx_mstate_global->__pyx_tuple__414 #define __pyx_tuple__415 __pyx_mstate_global->__pyx_tuple__415 #define __pyx_tuple__416 __pyx_mstate_global->__pyx_tuple__416 #define __pyx_tuple__417 __pyx_mstate_global->__pyx_tuple__417 #define __pyx_tuple__418 __pyx_mstate_global->__pyx_tuple__418 #define __pyx_tuple__419 __pyx_mstate_global->__pyx_tuple__419 #define __pyx_tuple__420 __pyx_mstate_global->__pyx_tuple__420 #define __pyx_tuple__421 __pyx_mstate_global->__pyx_tuple__421 #define __pyx_tuple__422 __pyx_mstate_global->__pyx_tuple__422 #define __pyx_tuple__423 __pyx_mstate_global->__pyx_tuple__423 #define __pyx_tuple__424 __pyx_mstate_global->__pyx_tuple__424 #define __pyx_tuple__425 __pyx_mstate_global->__pyx_tuple__425 #define __pyx_tuple__426 __pyx_mstate_global->__pyx_tuple__426 #define __pyx_tuple__427 __pyx_mstate_global->__pyx_tuple__427 #define __pyx_tuple__428 __pyx_mstate_global->__pyx_tuple__428 #define __pyx_tuple__429 __pyx_mstate_global->__pyx_tuple__429 #define __pyx_tuple__430 __pyx_mstate_global->__pyx_tuple__430 #define __pyx_tuple__431 __pyx_mstate_global->__pyx_tuple__431 #define __pyx_tuple__432 __pyx_mstate_global->__pyx_tuple__432 #define __pyx_tuple__433 __pyx_mstate_global->__pyx_tuple__433 #define __pyx_tuple__434 __pyx_mstate_global->__pyx_tuple__434 #define __pyx_tuple__435 __pyx_mstate_global->__pyx_tuple__435 #define __pyx_tuple__436 __pyx_mstate_global->__pyx_tuple__436 #define __pyx_tuple__437 __pyx_mstate_global->__pyx_tuple__437 #define __pyx_tuple__438 __pyx_mstate_global->__pyx_tuple__438 #define __pyx_tuple__439 __pyx_mstate_global->__pyx_tuple__439 #define __pyx_tuple__440 __pyx_mstate_global->__pyx_tuple__440 #define __pyx_tuple__441 __pyx_mstate_global->__pyx_tuple__441 #define __pyx_tuple__442 __pyx_mstate_global->__pyx_tuple__442 #define __pyx_tuple__443 __pyx_mstate_global->__pyx_tuple__443 #define __pyx_tuple__444 __pyx_mstate_global->__pyx_tuple__444 #define __pyx_tuple__445 __pyx_mstate_global->__pyx_tuple__445 #define __pyx_tuple__446 __pyx_mstate_global->__pyx_tuple__446 #define __pyx_tuple__447 __pyx_mstate_global->__pyx_tuple__447 #define __pyx_tuple__448 __pyx_mstate_global->__pyx_tuple__448 #define __pyx_tuple__449 __pyx_mstate_global->__pyx_tuple__449 #define __pyx_tuple__450 __pyx_mstate_global->__pyx_tuple__450 #define __pyx_tuple__451 __pyx_mstate_global->__pyx_tuple__451 #define __pyx_tuple__452 __pyx_mstate_global->__pyx_tuple__452 #define __pyx_tuple__453 __pyx_mstate_global->__pyx_tuple__453 #define __pyx_tuple__454 __pyx_mstate_global->__pyx_tuple__454 #define __pyx_tuple__455 __pyx_mstate_global->__pyx_tuple__455 #define __pyx_tuple__456 __pyx_mstate_global->__pyx_tuple__456 #define __pyx_tuple__457 __pyx_mstate_global->__pyx_tuple__457 #define __pyx_tuple__458 __pyx_mstate_global->__pyx_tuple__458 #define __pyx_tuple__459 __pyx_mstate_global->__pyx_tuple__459 #define __pyx_tuple__460 __pyx_mstate_global->__pyx_tuple__460 #define __pyx_tuple__461 __pyx_mstate_global->__pyx_tuple__461 #define __pyx_tuple__462 __pyx_mstate_global->__pyx_tuple__462 #define __pyx_tuple__463 __pyx_mstate_global->__pyx_tuple__463 #define __pyx_tuple__464 __pyx_mstate_global->__pyx_tuple__464 #define __pyx_tuple__465 __pyx_mstate_global->__pyx_tuple__465 #define __pyx_tuple__466 __pyx_mstate_global->__pyx_tuple__466 #define __pyx_tuple__467 __pyx_mstate_global->__pyx_tuple__467 #define __pyx_tuple__468 __pyx_mstate_global->__pyx_tuple__468 #define __pyx_tuple__469 __pyx_mstate_global->__pyx_tuple__469 #define __pyx_tuple__470 __pyx_mstate_global->__pyx_tuple__470 #define __pyx_tuple__471 __pyx_mstate_global->__pyx_tuple__471 #define __pyx_tuple__472 __pyx_mstate_global->__pyx_tuple__472 #define __pyx_tuple__473 __pyx_mstate_global->__pyx_tuple__473 #define __pyx_tuple__474 __pyx_mstate_global->__pyx_tuple__474 #define __pyx_tuple__475 __pyx_mstate_global->__pyx_tuple__475 #define __pyx_tuple__476 __pyx_mstate_global->__pyx_tuple__476 #define __pyx_tuple__477 __pyx_mstate_global->__pyx_tuple__477 #define __pyx_tuple__478 __pyx_mstate_global->__pyx_tuple__478 #define __pyx_tuple__479 __pyx_mstate_global->__pyx_tuple__479 #define __pyx_tuple__480 __pyx_mstate_global->__pyx_tuple__480 #define __pyx_tuple__481 __pyx_mstate_global->__pyx_tuple__481 #define __pyx_tuple__482 __pyx_mstate_global->__pyx_tuple__482 #define __pyx_tuple__483 __pyx_mstate_global->__pyx_tuple__483 #define __pyx_tuple__484 __pyx_mstate_global->__pyx_tuple__484 #define __pyx_tuple__485 __pyx_mstate_global->__pyx_tuple__485 #define __pyx_tuple__486 __pyx_mstate_global->__pyx_tuple__486 #define __pyx_tuple__487 __pyx_mstate_global->__pyx_tuple__487 #define __pyx_tuple__488 __pyx_mstate_global->__pyx_tuple__488 #define __pyx_tuple__489 __pyx_mstate_global->__pyx_tuple__489 #define __pyx_tuple__490 __pyx_mstate_global->__pyx_tuple__490 #define __pyx_tuple__491 __pyx_mstate_global->__pyx_tuple__491 #define __pyx_tuple__492 __pyx_mstate_global->__pyx_tuple__492 #define __pyx_tuple__493 __pyx_mstate_global->__pyx_tuple__493 #define __pyx_tuple__494 __pyx_mstate_global->__pyx_tuple__494 #define __pyx_tuple__495 __pyx_mstate_global->__pyx_tuple__495 #define __pyx_tuple__496 __pyx_mstate_global->__pyx_tuple__496 #define __pyx_tuple__497 __pyx_mstate_global->__pyx_tuple__497 #define __pyx_tuple__498 __pyx_mstate_global->__pyx_tuple__498 #define __pyx_tuple__499 __pyx_mstate_global->__pyx_tuple__499 #define __pyx_tuple__500 __pyx_mstate_global->__pyx_tuple__500 #define __pyx_tuple__501 __pyx_mstate_global->__pyx_tuple__501 #define __pyx_tuple__502 __pyx_mstate_global->__pyx_tuple__502 #define __pyx_tuple__503 __pyx_mstate_global->__pyx_tuple__503 #define __pyx_tuple__504 __pyx_mstate_global->__pyx_tuple__504 #define __pyx_tuple__505 __pyx_mstate_global->__pyx_tuple__505 #define __pyx_tuple__506 __pyx_mstate_global->__pyx_tuple__506 #define __pyx_tuple__507 __pyx_mstate_global->__pyx_tuple__507 #define __pyx_tuple__508 __pyx_mstate_global->__pyx_tuple__508 #define __pyx_tuple__509 __pyx_mstate_global->__pyx_tuple__509 #define __pyx_tuple__510 __pyx_mstate_global->__pyx_tuple__510 #define __pyx_tuple__511 __pyx_mstate_global->__pyx_tuple__511 #define __pyx_tuple__512 __pyx_mstate_global->__pyx_tuple__512 #define __pyx_tuple__513 __pyx_mstate_global->__pyx_tuple__513 #define __pyx_tuple__514 __pyx_mstate_global->__pyx_tuple__514 #define __pyx_tuple__517 __pyx_mstate_global->__pyx_tuple__517 #define __pyx_tuple__519 __pyx_mstate_global->__pyx_tuple__519 #define __pyx_tuple__521 __pyx_mstate_global->__pyx_tuple__521 #define __pyx_codeobj__515 __pyx_mstate_global->__pyx_codeobj__515 #define __pyx_codeobj__516 __pyx_mstate_global->__pyx_codeobj__516 #define __pyx_codeobj__518 __pyx_mstate_global->__pyx_codeobj__518 #define __pyx_codeobj__520 __pyx_mstate_global->__pyx_codeobj__520 #define __pyx_codeobj__522 __pyx_mstate_global->__pyx_codeobj__522 /* #### Code section: module_code ### */ /* "pygame_sdl2/color.pyx":26 * include "color_dict.pxi" * * cdef Uint32 map_color(SDL_Surface *surface, color) except? 0xaabbccdd: # <<<<<<<<<<<<<< * """ * Maps `color` into an RGBA color value that can be used with `surface`. */ static Uint32 __pyx_f_11pygame_sdl2_5color_map_color(SDL_Surface *__pyx_v_surface, PyObject *__pyx_v_color) { Uint8 __pyx_v_r; Uint8 __pyx_v_g; Uint8 __pyx_v_b; Uint8 __pyx_v_a; Uint32 __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); Uint8 __pyx_t_11; Uint8 __pyx_t_12; Uint8 __pyx_t_13; Uint8 __pyx_t_14; Uint32 __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("map_color", 1); /* "pygame_sdl2/color.pyx":33 * cdef Uint8 r, g, b, a * * if isinstance(color, (tuple, list, Color)) and len(color) == 4: # <<<<<<<<<<<<<< * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: */ __pyx_t_3 = PyTuple_Check(__pyx_v_color); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = PyList_Check(__pyx_v_color); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_color, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = PyObject_Length(__pyx_v_color); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 33, __pyx_L1_error) __pyx_t_2 = (__pyx_t_4 == 4); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":34 * * if isinstance(color, (tuple, list, Color)) and len(color) == 4: * r, g, b, a = color # <<<<<<<<<<<<<< * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: * r, g, b = color */ if ((likely(PyTuple_CheckExact(__pyx_v_color))) || (PyList_CheckExact(__pyx_v_color))) { PyObject* sequence = __pyx_v_color; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 34, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); __pyx_t_8 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8}; __pyx_t_9 = PyObject_GetIter(__pyx_v_color); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 4) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 34, __pyx_L1_error) __pyx_L10_unpacking_done:; } __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_t_5); if (unlikely((__pyx_t_11 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_12 = __Pyx_PyInt_As_uint8_t(__pyx_t_6); if (unlikely((__pyx_t_12 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint8_t(__pyx_t_7); if (unlikely((__pyx_t_13 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = __Pyx_PyInt_As_uint8_t(__pyx_t_8); if (unlikely((__pyx_t_14 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_r = __pyx_t_11; __pyx_v_g = __pyx_t_12; __pyx_v_b = __pyx_t_13; __pyx_v_a = __pyx_t_14; /* "pygame_sdl2/color.pyx":33 * cdef Uint8 r, g, b, a * * if isinstance(color, (tuple, list, Color)) and len(color) == 4: # <<<<<<<<<<<<<< * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":35 * if isinstance(color, (tuple, list, Color)) and len(color) == 4: * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: # <<<<<<<<<<<<<< * r, g, b = color * a = 255 */ __pyx_t_3 = PyTuple_Check(__pyx_v_color); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L13_bool_binop_done; } __pyx_t_3 = PyList_Check(__pyx_v_color); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L13_bool_binop_done; } __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_color, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_2 = __pyx_t_3; __pyx_L13_bool_binop_done:; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L11_bool_binop_done; } __pyx_t_4 = PyObject_Length(__pyx_v_color); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_t_2 = (__pyx_t_4 == 3); __pyx_t_1 = __pyx_t_2; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":36 * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: * r, g, b = color # <<<<<<<<<<<<<< * a = 255 * elif isinstance(color, int): */ if ((likely(PyTuple_CheckExact(__pyx_v_color))) || (PyList_CheckExact(__pyx_v_color))) { PyObject* sequence = __pyx_v_color; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 36, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_8 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_color); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_8 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 2; __pyx_t_6 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_5), 3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L17_unpacking_done; __pyx_L16_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 36, __pyx_L1_error) __pyx_L17_unpacking_done:; } __pyx_t_14 = __Pyx_PyInt_As_uint8_t(__pyx_t_8); if (unlikely((__pyx_t_14 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint8_t(__pyx_t_7); if (unlikely((__pyx_t_13 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_12 = __Pyx_PyInt_As_uint8_t(__pyx_t_6); if (unlikely((__pyx_t_12 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_r = __pyx_t_14; __pyx_v_g = __pyx_t_13; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":37 * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: * r, g, b = color * a = 255 # <<<<<<<<<<<<<< * elif isinstance(color, int): * return color */ __pyx_v_a = 0xFF; /* "pygame_sdl2/color.pyx":35 * if isinstance(color, (tuple, list, Color)) and len(color) == 4: * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: # <<<<<<<<<<<<<< * r, g, b = color * a = 255 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":38 * r, g, b = color * a = 255 * elif isinstance(color, int): # <<<<<<<<<<<<<< * return color * else: */ __pyx_t_1 = PyInt_Check(__pyx_v_color); if (likely(__pyx_t_1)) { /* "pygame_sdl2/color.pyx":39 * a = 255 * elif isinstance(color, int): * return color # <<<<<<<<<<<<<< * else: * raise TypeError("Expected a color.") */ __pyx_t_15 = __Pyx_PyInt_As_uint32_t(__pyx_v_color); if (unlikely((__pyx_t_15 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error) __pyx_r = __pyx_t_15; goto __pyx_L0; /* "pygame_sdl2/color.pyx":38 * r, g, b = color * a = 255 * elif isinstance(color, int): # <<<<<<<<<<<<<< * return color * else: */ } /* "pygame_sdl2/color.pyx":41 * return color * else: * raise TypeError("Expected a color.") # <<<<<<<<<<<<<< * * return SDL_MapRGBA(surface.format, r, g, b, a) */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 41, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/color.pyx":43 * raise TypeError("Expected a color.") * * return SDL_MapRGBA(surface.format, r, g, b, a) # <<<<<<<<<<<<<< * * cdef object get_color(Uint32 pixel, SDL_Surface *surface): */ __pyx_r = SDL_MapRGBA(__pyx_v_surface->format, __pyx_v_r, __pyx_v_g, __pyx_v_b, __pyx_v_a); goto __pyx_L0; /* "pygame_sdl2/color.pyx":26 * include "color_dict.pxi" * * cdef Uint32 map_color(SDL_Surface *surface, color) except? 0xaabbccdd: # <<<<<<<<<<<<<< * """ * Maps `color` into an RGBA color value that can be used with `surface`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.color.map_color", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0xaabbccdd; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":45 * return SDL_MapRGBA(surface.format, r, g, b, a) * * cdef object get_color(Uint32 pixel, SDL_Surface *surface): # <<<<<<<<<<<<<< * cdef Uint8 r * cdef Uint8 g */ static PyObject *__pyx_f_11pygame_sdl2_5color_get_color(Uint32 __pyx_v_pixel, SDL_Surface *__pyx_v_surface) { Uint8 __pyx_v_r; Uint8 __pyx_v_g; Uint8 __pyx_v_b; Uint8 __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_color", 1); /* "pygame_sdl2/color.pyx":51 * cdef Uint8 a * * SDL_GetRGBA(pixel, surface.format, &r, &g, &b, &a) # <<<<<<<<<<<<<< * * return Color(r, g, b, a) */ SDL_GetRGBA(__pyx_v_pixel, __pyx_v_surface->format, (&__pyx_v_r), (&__pyx_v_g), (&__pyx_v_b), (&__pyx_v_a)); /* "pygame_sdl2/color.pyx":53 * SDL_GetRGBA(pixel, surface.format, &r, &g, &b, &a) * * return Color(r, g, b, a) # <<<<<<<<<<<<<< * * cdef to_sdl_color(color, SDL_Color *out): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":45 * return SDL_MapRGBA(surface.format, r, g, b, a) * * cdef object get_color(Uint32 pixel, SDL_Surface *surface): # <<<<<<<<<<<<<< * cdef Uint8 r * cdef Uint8 g */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.get_color", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":55 * return Color(r, g, b, a) * * cdef to_sdl_color(color, SDL_Color *out): # <<<<<<<<<<<<<< * if not isinstance(color, Color): * color = Color(color) */ static PyObject *__pyx_f_11pygame_sdl2_5color_to_sdl_color(PyObject *__pyx_v_color, SDL_Color *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Uint8 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_sdl_color", 0); __Pyx_INCREF(__pyx_v_color); /* "pygame_sdl2/color.pyx":56 * * cdef to_sdl_color(color, SDL_Color *out): * if not isinstance(color, Color): # <<<<<<<<<<<<<< * color = Color(color) * out.r = color.r */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_color, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":57 * cdef to_sdl_color(color, SDL_Color *out): * if not isinstance(color, Color): * color = Color(color) # <<<<<<<<<<<<<< * out.r = color.r * out.g = color.g */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_color, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":56 * * cdef to_sdl_color(color, SDL_Color *out): * if not isinstance(color, Color): # <<<<<<<<<<<<<< * color = Color(color) * out.r = color.r */ } /* "pygame_sdl2/color.pyx":58 * if not isinstance(color, Color): * color = Color(color) * out.r = color.r # <<<<<<<<<<<<<< * out.g = color.g * out.b = color.b */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_out->r = __pyx_t_4; /* "pygame_sdl2/color.pyx":59 * color = Color(color) * out.r = color.r * out.g = color.g # <<<<<<<<<<<<<< * out.b = color.b * out.a = color.a */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_out->g = __pyx_t_4; /* "pygame_sdl2/color.pyx":60 * out.r = color.r * out.g = color.g * out.b = color.b # <<<<<<<<<<<<<< * out.a = color.a * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_out->b = __pyx_t_4; /* "pygame_sdl2/color.pyx":61 * out.g = color.g * out.b = color.b * out.a = color.a # <<<<<<<<<<<<<< * * cdef class Color: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_out->a = __pyx_t_4; /* "pygame_sdl2/color.pyx":55 * return Color(r, g, b, a) * * cdef to_sdl_color(color, SDL_Color *out): # <<<<<<<<<<<<<< * if not isinstance(color, Color): * color = Color(color) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.color.to_sdl_color", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_color); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":64 * * cdef class Color: * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): # <<<<<<<<<<<<<< * self.r = r * self.g = g */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_rgba(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, Uint8 __pyx_v_r, Uint8 __pyx_v_g, Uint8 __pyx_v_b, Uint8 __pyx_v_a) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("from_rgba", 1); /* "pygame_sdl2/color.pyx":65 * cdef class Color: * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): * self.r = r # <<<<<<<<<<<<<< * self.g = g * self.b = b */ __pyx_v_self->r = __pyx_v_r; /* "pygame_sdl2/color.pyx":66 * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): * self.r = r * self.g = g # <<<<<<<<<<<<<< * self.b = b * self.a = a */ __pyx_v_self->g = __pyx_v_g; /* "pygame_sdl2/color.pyx":67 * self.r = r * self.g = g * self.b = b # <<<<<<<<<<<<<< * self.a = a * */ __pyx_v_self->b = __pyx_v_b; /* "pygame_sdl2/color.pyx":68 * self.g = g * self.b = b * self.a = a # <<<<<<<<<<<<<< * * cdef from_hex(self, c): */ __pyx_v_self->a = __pyx_v_a; /* "pygame_sdl2/color.pyx":64 * * cdef class Color: * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): # <<<<<<<<<<<<<< * self.r = r * self.g = g */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":73 * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: * c = "".join(map(lambda x: x*2, c)) # <<<<<<<<<<<<<< * * try: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_8from_hex_lambda(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_8from_hex_lambda = {"lambda", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_8from_hex_lambda, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_8from_hex_lambda(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda") < 0)) __PYX_ERR(0, 73, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_x = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lambda", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 73, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_v_x, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":70 * self.a = a * * cdef from_hex(self, c): # <<<<<<<<<<<<<< * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_hex(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; CYTHON_UNUSED PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; PyObject *(*__pyx_t_13)(PyObject *); PyObject *__pyx_t_14 = NULL; int __pyx_t_15; char const *__pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; Uint8 __pyx_t_23; Uint8 __pyx_t_24; Uint8 __pyx_t_25; Uint8 __pyx_t_26; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_hex", 0); __Pyx_INCREF(__pyx_v_c); /* "pygame_sdl2/color.pyx":72 * cdef from_hex(self, c): * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: # <<<<<<<<<<<<<< * c = "".join(map(lambda x: x*2, c)) * */ __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 == 3); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 == 4); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":73 * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: * c = "".join(map(lambda x: x*2, c)) # <<<<<<<<<<<<<< * * try: */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_8from_hex_lambda, 0, __pyx_n_s_Color_from_hex_locals_lambda, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_c)) __PYX_ERR(0, 73, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":72 * cdef from_hex(self, c): * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: # <<<<<<<<<<<<<< * c = "".join(map(lambda x: x*2, c)) * */ } /* "pygame_sdl2/color.pyx":75 * c = "".join(map(lambda x: x*2, c)) * * try: # <<<<<<<<<<<<<< * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/color.pyx":76 * * try: * if len(c) == 6: # <<<<<<<<<<<<<< * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 */ __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 76, __pyx_L6_error) __pyx_t_1 = (__pyx_t_2 == 6); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":77 * try: * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) # <<<<<<<<<<<<<< * a = 255 * elif len(c) == 8: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_struct); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unpack); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_binascii); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_unhexlify); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_c}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_n_s_BBB, __pyx_t_4}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_12, 2+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 77, __pyx_L6_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_11 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_11); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); index = 0; __pyx_t_9 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_11)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_10), 3) < 0) __PYX_ERR(0, 77, __pyx_L6_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L14_unpacking_done; __pyx_L13_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 77, __pyx_L6_error) __pyx_L14_unpacking_done:; } __pyx_v_r = __pyx_t_9; __pyx_t_9 = 0; __pyx_v_g = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_b = __pyx_t_11; __pyx_t_11 = 0; /* "pygame_sdl2/color.pyx":78 * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 # <<<<<<<<<<<<<< * elif len(c) == 8: * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) */ __Pyx_INCREF(__pyx_int_255); __pyx_v_a = __pyx_int_255; /* "pygame_sdl2/color.pyx":76 * * try: * if len(c) == 6: # <<<<<<<<<<<<<< * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 */ goto __pyx_L12; } /* "pygame_sdl2/color.pyx":79 * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 * elif len(c) == 8: # <<<<<<<<<<<<<< * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) * else: */ __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 79, __pyx_L6_error) __pyx_t_1 = (__pyx_t_2 == 8); if (likely(__pyx_t_1)) { /* "pygame_sdl2/color.pyx":80 * a = 255 * elif len(c) == 8: * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) # <<<<<<<<<<<<<< * else: * raise ValueError(c) */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_struct); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_unpack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_binascii); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_unhexlify); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_c}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_t_10 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_n_s_BBBB, __pyx_t_11}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_12, 2+__pyx_t_12); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 80, __pyx_L6_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_11 = PyList_GET_ITEM(sequence, 1); __pyx_t_10 = PyList_GET_ITEM(sequence, 2); __pyx_t_9 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_11,&__pyx_t_10,&__pyx_t_9}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_11,&__pyx_t_10,&__pyx_t_9}; __pyx_t_14 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_13(__pyx_t_14); if (unlikely(!item)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_14), 4) < 0) __PYX_ERR(0, 80, __pyx_L6_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L16_unpacking_done; __pyx_L15_unpacking_failed:; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 80, __pyx_L6_error) __pyx_L16_unpacking_done:; } __pyx_v_r = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_g = __pyx_t_11; __pyx_t_11 = 0; __pyx_v_b = __pyx_t_10; __pyx_t_10 = 0; __pyx_v_a = __pyx_t_9; __pyx_t_9 = 0; /* "pygame_sdl2/color.pyx":79 * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 * elif len(c) == 8: # <<<<<<<<<<<<<< * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) * else: */ goto __pyx_L12; } /* "pygame_sdl2/color.pyx":82 * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) * else: * raise ValueError(c) # <<<<<<<<<<<<<< * except TypeError as e: * raise ValueError(c) */ /*else*/ { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 82, __pyx_L6_error) } __pyx_L12:; /* "pygame_sdl2/color.pyx":75 * c = "".join(map(lambda x: x*2, c)) * * try: # <<<<<<<<<<<<<< * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L11_try_end; __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/color.pyx":83 * else: * raise ValueError(c) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * */ __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_12) { __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 83, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_v_e = __pyx_t_9; /*try:*/ { /* "pygame_sdl2/color.pyx":84 * raise ValueError(c) * except TypeError as e: * raise ValueError(c) # <<<<<<<<<<<<<< * * self.from_rgba(r, g, b, a) */ __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_c); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 84, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(0, 84, __pyx_L22_error) } /* "pygame_sdl2/color.pyx":83 * else: * raise ValueError(c) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * */ /*finally:*/ { __pyx_L22_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_12 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L8_except_error; } } } goto __pyx_L8_except_error; /* "pygame_sdl2/color.pyx":75 * c = "".join(map(lambda x: x*2, c)) * * try: # <<<<<<<<<<<<<< * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) */ __pyx_L8_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_end:; } /* "pygame_sdl2/color.pyx":86 * raise ValueError(c) * * self.from_rgba(r, g, b, a) # <<<<<<<<<<<<<< * * cdef from_name(self, c): */ __pyx_t_23 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_23 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_24 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_24 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_25 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_25 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_26 = __Pyx_PyInt_As_uint8_t(__pyx_v_a); if (unlikely((__pyx_t_26 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_10 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_23, __pyx_t_24, __pyx_t_25, __pyx_t_26); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "pygame_sdl2/color.pyx":70 * self.a = a * * cdef from_hex(self, c): # <<<<<<<<<<<<<< * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":88 * self.from_rgba(r, g, b, a) * * cdef from_name(self, c): # <<<<<<<<<<<<<< * # Remove all whitespace. * c = "".join(c.split()).lower() */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_name(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; CYTHON_UNUSED PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_t_11; char const *__pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; Uint8 __pyx_t_19; Uint8 __pyx_t_20; Uint8 __pyx_t_21; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_name", 0); __Pyx_INCREF(__pyx_v_c); /* "pygame_sdl2/color.pyx":90 * cdef from_name(self, c): * # Remove all whitespace. * c = "".join(c.split()).lower() # <<<<<<<<<<<<<< * * try: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":92 * c = "".join(c.split()).lower() * * try: # <<<<<<<<<<<<<< * r, g, b = colors[c] * except KeyError as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/color.pyx":93 * * try: * r, g, b = colors[c] # <<<<<<<<<<<<<< * except KeyError as e: * raise ValueError(c) */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_11pygame_sdl2_5color_colors, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 93, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(0, 93, __pyx_L3_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 93, __pyx_L3_error) __pyx_L10_unpacking_done:; } __pyx_v_r = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_g = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_b = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":92 * c = "".join(c.split()).lower() * * try: # <<<<<<<<<<<<<< * r, g, b = colors[c] * except KeyError as e: */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/color.pyx":94 * try: * r, g, b = colors[c] * except KeyError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * self.from_rgba(r, g, b, 255) */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_5) { __Pyx_AddTraceback("pygame_sdl2.color.Color.from_name", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 94, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_v_e = __pyx_t_4; /*try:*/ { /* "pygame_sdl2/color.pyx":95 * r, g, b = colors[c] * except KeyError as e: * raise ValueError(c) # <<<<<<<<<<<<<< * self.from_rgba(r, g, b, 255) * */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 95, __pyx_L16_error) } /* "pygame_sdl2/color.pyx":94 * try: * r, g, b = colors[c] * except KeyError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * self.from_rgba(r, g, b, 255) */ /*finally:*/ { __pyx_L16_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __pyx_t_5 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); } __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; /* "pygame_sdl2/color.pyx":92 * c = "".join(c.split()).lower() * * try: # <<<<<<<<<<<<<< * r, g, b = colors[c] * except KeyError as e: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_try_end:; } /* "pygame_sdl2/color.pyx":96 * except KeyError as e: * raise ValueError(c) * self.from_rgba(r, g, b, 255) # <<<<<<<<<<<<<< * * def __richcmp__(Color x, y, int op): */ __pyx_t_19 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_19 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_20 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_20 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_21 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_21 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_19, __pyx_t_20, __pyx_t_21, 0xFF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":88 * self.from_rgba(r, g, b, a) * * cdef from_name(self, c): # <<<<<<<<<<<<<< * # Remove all whitespace. * c = "".join(c.split()).lower() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.color.Color.from_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":98 * self.from_rgba(r, g, b, 255) * * def __richcmp__(Color x, y, int op): # <<<<<<<<<<<<<< * if op == 3: * return not (x == y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color___richcmp__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_x), ((PyObject *)__pyx_v_y), ((int)__pyx_v_op)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color___richcmp__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 0); __Pyx_INCREF(__pyx_v_y); /* "pygame_sdl2/color.pyx":99 * * def __richcmp__(Color x, y, int op): * if op == 3: # <<<<<<<<<<<<<< * return not (x == y) * */ __pyx_t_1 = (__pyx_v_op == 3); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":100 * def __richcmp__(Color x, y, int op): * if op == 3: * return not (x == y) # <<<<<<<<<<<<<< * * if isinstance(y, tuple): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_x), __pyx_v_y, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong((!__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":99 * * def __richcmp__(Color x, y, int op): * if op == 3: # <<<<<<<<<<<<<< * return not (x == y) * */ } /* "pygame_sdl2/color.pyx":102 * return not (x == y) * * if isinstance(y, tuple): # <<<<<<<<<<<<<< * y = Color(y) * if not isinstance(y, Color): */ __pyx_t_1 = PyTuple_Check(__pyx_v_y); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":103 * * if isinstance(y, tuple): * y = Color(y) # <<<<<<<<<<<<<< * if not isinstance(y, Color): * return False */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":102 * return not (x == y) * * if isinstance(y, tuple): # <<<<<<<<<<<<<< * y = Color(y) * if not isinstance(y, Color): */ } /* "pygame_sdl2/color.pyx":104 * if isinstance(y, tuple): * y = Color(y) * if not isinstance(y, Color): # <<<<<<<<<<<<<< * return False * if op == 2: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_y, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_3 = (!__pyx_t_1); if (__pyx_t_3) { /* "pygame_sdl2/color.pyx":105 * y = Color(y) * if not isinstance(y, Color): * return False # <<<<<<<<<<<<<< * if op == 2: * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/color.pyx":104 * if isinstance(y, tuple): * y = Color(y) * if not isinstance(y, Color): # <<<<<<<<<<<<<< * return False * if op == 2: */ } /* "pygame_sdl2/color.pyx":106 * if not isinstance(y, Color): * return False * if op == 2: # <<<<<<<<<<<<<< * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * */ __pyx_t_3 = (__pyx_v_op == 2); if (__pyx_t_3) { /* "pygame_sdl2/color.pyx":107 * return False * if op == 2: * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 107, __pyx_L1_error) if (__pyx_t_3) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_2 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->g); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_g); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 107, __pyx_L1_error) if (__pyx_t_3) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 107, __pyx_L1_error) if (__pyx_t_3) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_2 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->a); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_a); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_L7_bool_binop_done:; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":106 * if not isinstance(y, Color): * return False * if op == 2: # <<<<<<<<<<<<<< * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * */ } /* "pygame_sdl2/color.pyx":98 * self.from_rgba(r, g, b, 255) * * def __richcmp__(Color x, y, int op): # <<<<<<<<<<<<<< * if op == 3: * return not (x == y) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.color.Color.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":109 * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * * def __cinit__(self): # <<<<<<<<<<<<<< * self.length = 4 * self.r = 0 */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_2__cinit__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_2__cinit__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/color.pyx":110 * * def __cinit__(self): * self.length = 4 # <<<<<<<<<<<<<< * self.r = 0 * self.g = 0 */ __pyx_v_self->length = 4; /* "pygame_sdl2/color.pyx":111 * def __cinit__(self): * self.length = 4 * self.r = 0 # <<<<<<<<<<<<<< * self.g = 0 * self.b = 0 */ __pyx_v_self->r = 0; /* "pygame_sdl2/color.pyx":112 * self.length = 4 * self.r = 0 * self.g = 0 # <<<<<<<<<<<<<< * self.b = 0 * self.a = 255 */ __pyx_v_self->g = 0; /* "pygame_sdl2/color.pyx":113 * self.r = 0 * self.g = 0 * self.b = 0 # <<<<<<<<<<<<<< * self.a = 255 * */ __pyx_v_self->b = 0; /* "pygame_sdl2/color.pyx":114 * self.g = 0 * self.b = 0 * self.a = 255 # <<<<<<<<<<<<<< * * def __init__(self, *args): */ __pyx_v_self->a = 0xFF; /* "pygame_sdl2/color.pyx":109 * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * * def __cinit__(self): # <<<<<<<<<<<<<< * self.length = 4 * self.r = 0 */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/color.pyx":116 * self.a = 255 * * def __init__(self, *args): # <<<<<<<<<<<<<< * self.length = 4 * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4__init__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_4__init__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_c = NULL; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; Uint8 __pyx_t_8; Uint8 __pyx_t_9; Uint8 __pyx_t_10; Uint8 __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/color.pyx":117 * * def __init__(self, *args): * self.length = 4 # <<<<<<<<<<<<<< * * if len(args) == 1: */ __pyx_v_self->length = 4; /* "pygame_sdl2/color.pyx":119 * self.length = 4 * * if len(args) == 1: # <<<<<<<<<<<<<< * c = args[0] * if isinstance(c, basestring): */ __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 119, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 1); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":120 * * if len(args) == 1: * c = args[0] # <<<<<<<<<<<<<< * if isinstance(c, basestring): * if c.startswith('#'): */ __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_c = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":121 * if len(args) == 1: * c = args[0] * if isinstance(c, basestring): # <<<<<<<<<<<<<< * if c.startswith('#'): * self.from_hex(c[1:]) */ __pyx_t_2 = __Pyx_PyBaseString_Check(__pyx_v_c); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":122 * c = args[0] * if isinstance(c, basestring): * if c.startswith('#'): # <<<<<<<<<<<<<< * self.from_hex(c[1:]) * elif c.startswith('0x'): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s__3}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":123 * if isinstance(c, basestring): * if c.startswith('#'): * self.from_hex(c[1:]) # <<<<<<<<<<<<<< * elif c.startswith('0x'): * self.from_hex(c[2:]) */ __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_c, 1, 0, NULL, NULL, &__pyx_slice__4, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":122 * c = args[0] * if isinstance(c, basestring): * if c.startswith('#'): # <<<<<<<<<<<<<< * self.from_hex(c[1:]) * elif c.startswith('0x'): */ goto __pyx_L5; } /* "pygame_sdl2/color.pyx":124 * if c.startswith('#'): * self.from_hex(c[1:]) * elif c.startswith('0x'): # <<<<<<<<<<<<<< * self.from_hex(c[2:]) * else: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_0x}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":125 * self.from_hex(c[1:]) * elif c.startswith('0x'): * self.from_hex(c[2:]) # <<<<<<<<<<<<<< * else: * self.from_name(c) */ __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_c, 2, 0, NULL, NULL, &__pyx_slice__5, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":124 * if c.startswith('#'): * self.from_hex(c[1:]) * elif c.startswith('0x'): # <<<<<<<<<<<<<< * self.from_hex(c[2:]) * else: */ goto __pyx_L5; } /* "pygame_sdl2/color.pyx":127 * self.from_hex(c[2:]) * else: * self.from_name(c) # <<<<<<<<<<<<<< * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: */ /*else*/ { __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_name(__pyx_v_self, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L5:; /* "pygame_sdl2/color.pyx":121 * if len(args) == 1: * c = args[0] * if isinstance(c, basestring): # <<<<<<<<<<<<<< * if c.startswith('#'): * self.from_hex(c[1:]) */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":128 * else: * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): # <<<<<<<<<<<<<< * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) */ __pyx_t_7 = PyTuple_Check(__pyx_v_c); if (!__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L6_bool_binop_done; } __pyx_t_7 = PyList_Check(__pyx_v_c); if (!__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L6_bool_binop_done; } __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_c, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_2 = __pyx_t_7; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":129 * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: */ __pyx_t_1 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 129, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 4); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":130 * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) # <<<<<<<<<<<<<< * elif len(c) == 3: * self.from_rgba(c[0], c[1], c[2], 255) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_8 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_10 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":129 * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: */ goto __pyx_L9; } /* "pygame_sdl2/color.pyx":131 * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], 255) * else: */ __pyx_t_1 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 131, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 3); if (likely(__pyx_t_2)) { /* "pygame_sdl2/color.pyx":132 * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: * self.from_rgba(c[0], c[1], c[2], 255) # <<<<<<<<<<<<<< * else: * raise ValueError(c) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_10 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_11, __pyx_t_10, __pyx_t_9, 0xFF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":131 * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], 255) * else: */ goto __pyx_L9; } /* "pygame_sdl2/color.pyx":134 * self.from_rgba(c[0], c[1], c[2], 255) * else: * raise ValueError(c) # <<<<<<<<<<<<<< * else: * self.from_hex("%08x" % c) */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 134, __pyx_L1_error) } __pyx_L9:; /* "pygame_sdl2/color.pyx":128 * else: * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): # <<<<<<<<<<<<<< * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":136 * raise ValueError(c) * else: * self.from_hex("%08x" % c) # <<<<<<<<<<<<<< * * elif len(args) == 3: */ /*else*/ { __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_08x, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L4:; /* "pygame_sdl2/color.pyx":119 * self.length = 4 * * if len(args) == 1: # <<<<<<<<<<<<<< * c = args[0] * if isinstance(c, basestring): */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":138 * self.from_hex("%08x" % c) * * elif len(args) == 3: # <<<<<<<<<<<<<< * r, g, b = args * self.from_rgba(r, g, b, 255) */ __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 138, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 3); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":139 * * elif len(args) == 3: * r, g, b = args # <<<<<<<<<<<<<< * self.from_rgba(r, g, b, 255) * elif len(args) == 4: */ if (1) { PyObject* sequence = __pyx_v_args; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 139, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } __pyx_v_r = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_g = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_b = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":140 * elif len(args) == 3: * r, g, b = args * self.from_rgba(r, g, b, 255) # <<<<<<<<<<<<<< * elif len(args) == 4: * r, g, b, a = args */ __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_9 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_10 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_11 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_5 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_9, __pyx_t_10, __pyx_t_11, 0xFF); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":138 * self.from_hex("%08x" % c) * * elif len(args) == 3: # <<<<<<<<<<<<<< * r, g, b = args * self.from_rgba(r, g, b, 255) */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":141 * r, g, b = args * self.from_rgba(r, g, b, 255) * elif len(args) == 4: # <<<<<<<<<<<<<< * r, g, b, a = args * self.from_rgba(r, g, b, a) */ __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 141, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 4); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":142 * self.from_rgba(r, g, b, 255) * elif len(args) == 4: * r, g, b, a = args # <<<<<<<<<<<<<< * self.from_rgba(r, g, b, a) * */ if (1) { PyObject* sequence = __pyx_v_args; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 142, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_12); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_3,&__pyx_t_4,&__pyx_t_12}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } __pyx_v_r = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_g = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_b = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_a = __pyx_t_12; __pyx_t_12 = 0; /* "pygame_sdl2/color.pyx":143 * elif len(args) == 4: * r, g, b, a = args * self.from_rgba(r, g, b, a) # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_11 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_10 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_9 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_v_a); if (unlikely((__pyx_t_8 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_t_12 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_11, __pyx_t_10, __pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "pygame_sdl2/color.pyx":141 * r, g, b = args * self.from_rgba(r, g, b, 255) * elif len(args) == 4: # <<<<<<<<<<<<<< * r, g, b, a = args * self.from_rgba(r, g, b, a) */ } __pyx_L3:; /* "pygame_sdl2/color.pyx":116 * self.a = 255 * * def __init__(self, *args): # <<<<<<<<<<<<<< * self.length = 4 * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.color.Color.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":145 * self.from_rgba(r, g, b, a) * * def __repr__(self): # <<<<<<<<<<<<<< * return str((self.r, self.g, self.b, self.a)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__repr__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_6__repr__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6__repr__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/color.pyx":146 * * def __repr__(self): * return str((self.r, self.g, self.b, self.a)) # <<<<<<<<<<<<<< * * def __int__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Str(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":145 * self.from_rgba(r, g, b, a) * * def __repr__(self): # <<<<<<<<<<<<<< * return str((self.r, self.g, self.b, self.a)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":148 * return str((self.r, self.g, self.b, self.a)) * * def __int__(self): # <<<<<<<<<<<<<< * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) * return struct.unpack('>L', packed)[0] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_9__int__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_9__int__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__int__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_8__int__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_8__int__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_v_packed = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__int__", 1); /* "pygame_sdl2/color.pyx":149 * * def __int__(self): * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) # <<<<<<<<<<<<<< * return struct.unpack('>L', packed)[0] * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_struct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pack); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_7, __pyx_n_s_BBBB, __pyx_t_2, __pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 5+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_packed = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":150 * def __int__(self): * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) * return struct.unpack('>L', packed)[0] # <<<<<<<<<<<<<< * * def __hex__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_struct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_unpack); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_kp_s_L, __pyx_v_packed}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":148 * return str((self.r, self.g, self.b, self.a)) * * def __int__(self): # <<<<<<<<<<<<<< * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) * return struct.unpack('>L', packed)[0] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.color.Color.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_packed); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":152 * return struct.unpack('>L', packed)[0] * * def __hex__(self): # <<<<<<<<<<<<<< * return hex(int(self)) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_11__hex__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_11__hex__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hex__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__hex__", 1); /* "pygame_sdl2/color.pyx":153 * * def __hex__(self): * return hex(int(self)) # <<<<<<<<<<<<<< * * def __oct__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":152 * return struct.unpack('>L', packed)[0] * * def __hex__(self): # <<<<<<<<<<<<<< * return hex(int(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.__hex__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "pygame_sdl2/color.pyx":155 * return hex(int(self)) * * def __oct__(self): # <<<<<<<<<<<<<< * return oct(int(self)) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13__oct__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13__oct__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__oct__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__oct__", 1); /* "pygame_sdl2/color.pyx":156 * * def __oct__(self): * return oct(int(self)) # <<<<<<<<<<<<<< * * def __float__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_oct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":155 * return hex(int(self)) * * def __oct__(self): # <<<<<<<<<<<<<< * return oct(int(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.__oct__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "pygame_sdl2/color.pyx":158 * return oct(int(self)) * * def __float__(self): # <<<<<<<<<<<<<< * return float(int(self)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_15__float__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_15__float__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__float__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_14__float__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_14__float__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__float__", 1); /* "pygame_sdl2/color.pyx":159 * * def __float__(self): * return float(int(self)) # <<<<<<<<<<<<<< * * def __reduce__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":158 * return oct(int(self)) * * def __float__(self): # <<<<<<<<<<<<<< * return float(int(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.__float__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":161 * return float(int(self)) * * def __reduce__(self): # <<<<<<<<<<<<<< * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5color_5Color_16__reduce__, "Color.__reduce__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_17__reduce__ = {"__reduce__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_16__reduce__}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_16__reduce__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_16__reduce__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_v_d = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 1); /* "pygame_sdl2/color.pyx":162 * * def __reduce__(self): * d = {} # <<<<<<<<<<<<<< * d['rgba'] = (self.r, self.g, self.b, self.a) * return (Color, (), d) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_d = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":163 * def __reduce__(self): * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) # <<<<<<<<<<<<<< * return (Color, (), d) * */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; if (unlikely((PyDict_SetItem(__pyx_v_d, __pyx_n_s_rgba, __pyx_t_5) < 0))) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":164 * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) * return (Color, (), d) # <<<<<<<<<<<<<< * * def __setstate__(self, d): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color); __Pyx_GIVEREF((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color))) __PYX_ERR(0, 164, __pyx_L1_error); __Pyx_INCREF(__pyx_empty_tuple); __Pyx_GIVEREF(__pyx_empty_tuple); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_empty_tuple)) __PYX_ERR(0, 164, __pyx_L1_error); __Pyx_INCREF(__pyx_v_d); __Pyx_GIVEREF(__pyx_v_d); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_d)) __PYX_ERR(0, 164, __pyx_L1_error); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":161 * return float(int(self)) * * def __reduce__(self): # <<<<<<<<<<<<<< * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":166 * return (Color, (), d) * * def __setstate__(self, d): # <<<<<<<<<<<<<< * self.r, self.g, self.b, self.a = d['rgba'] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5color_5Color_18__setstate__, "Color.__setstate__(self, d)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_19__setstate__ = {"__setstate__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_18__setstate__}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_d = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_d,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_d)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate__") < 0)) __PYX_ERR(0, 166, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_d = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 166, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_18__setstate__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), __pyx_v_d); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_18__setstate__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_d) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); Uint8 __pyx_t_8; Uint8 __pyx_t_9; Uint8 __pyx_t_10; Uint8 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate__", 1); /* "pygame_sdl2/color.pyx":167 * * def __setstate__(self, d): * self.r, self.g, self.b, self.a = d['rgba'] # <<<<<<<<<<<<<< * * def __setitem__(self, key, val): */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_d, __pyx_n_s_rgba); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 167, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_5 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) __PYX_ERR(0, 167, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 167, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_10 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_t_5); if (unlikely((__pyx_t_11 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->r = __pyx_t_8; __pyx_v_self->g = __pyx_t_9; __pyx_v_self->b = __pyx_t_10; __pyx_v_self->a = __pyx_t_11; /* "pygame_sdl2/color.pyx":166 * return (Color, (), d) * * def __setstate__(self, d): # <<<<<<<<<<<<<< * self.r, self.g, self.b, self.a = d['rgba'] * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.color.Color.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":169 * self.r, self.g, self.b, self.a = d['rgba'] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if not isinstance(val, int): * raise ValueError(val) */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_21__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_21__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_20__setitem__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_20__setitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Uint8 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); /* "pygame_sdl2/color.pyx":170 * * def __setitem__(self, key, val): * if not isinstance(val, int): # <<<<<<<<<<<<<< * raise ValueError(val) * if key >= self.length: */ __pyx_t_1 = PyInt_Check(__pyx_v_val); __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/color.pyx":171 * def __setitem__(self, key, val): * if not isinstance(val, int): * raise ValueError(val) # <<<<<<<<<<<<<< * if key >= self.length: * raise IndexError(key) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 171, __pyx_L1_error) /* "pygame_sdl2/color.pyx":170 * * def __setitem__(self, key, val): * if not isinstance(val, int): # <<<<<<<<<<<<<< * raise ValueError(val) * if key >= self.length: */ } /* "pygame_sdl2/color.pyx":172 * if not isinstance(val, int): * raise ValueError(val) * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if val < 0 or val > 255: */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_key, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/color.pyx":173 * raise ValueError(val) * if key >= self.length: * raise IndexError(key) # <<<<<<<<<<<<<< * if val < 0 or val > 255: * raise ValueError(val) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 173, __pyx_L1_error) /* "pygame_sdl2/color.pyx":172 * if not isinstance(val, int): * raise ValueError(val) * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if val < 0 or val > 255: */ } /* "pygame_sdl2/color.pyx":174 * if key >= self.length: * raise IndexError(key) * if val < 0 or val > 255: # <<<<<<<<<<<<<< * raise ValueError(val) * */ __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/color.pyx":175 * raise IndexError(key) * if val < 0 or val > 255: * raise ValueError(val) # <<<<<<<<<<<<<< * * if key == 0: self.r = val */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 175, __pyx_L1_error) /* "pygame_sdl2/color.pyx":174 * if key >= self.length: * raise IndexError(key) * if val < 0 or val > 255: # <<<<<<<<<<<<<< * raise ValueError(val) * */ } /* "pygame_sdl2/color.pyx":177 * raise ValueError(val) * * if key == 0: self.r = val # <<<<<<<<<<<<<< * elif key == 1: self.g = val * elif key == 2: self.b = val */ __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_v_self->r = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":178 * * if key == 0: self.r = val * elif key == 1: self.g = val # <<<<<<<<<<<<<< * elif key == 2: self.b = val * elif key == 3: self.a = val */ __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error) __pyx_v_self->g = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":179 * if key == 0: self.r = val * elif key == 1: self.g = val * elif key == 2: self.b = val # <<<<<<<<<<<<<< * elif key == 3: self.a = val * else: */ __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 179, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error) __pyx_v_self->b = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":180 * elif key == 1: self.g = val * elif key == 2: self.b = val * elif key == 3: self.a = val # <<<<<<<<<<<<<< * else: * raise IndexError(key) */ __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_3, 3, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) if (likely(__pyx_t_2)) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error) __pyx_v_self->a = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":182 * elif key == 3: self.a = val * else: * raise IndexError(key) # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 182, __pyx_L1_error) } __pyx_L8:; /* "pygame_sdl2/color.pyx":169 * self.r, self.g, self.b, self.a = d['rgba'] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if not isinstance(val, int): * raise ValueError(val) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":184 * raise IndexError(key) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * if isinstance(key, slice): * return tuple(self)[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_22__getitem__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_22__getitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "pygame_sdl2/color.pyx":185 * * def __getitem__(self, key): * if isinstance(key, slice): # <<<<<<<<<<<<<< * return tuple(self)[key] * if key >= self.length: */ __pyx_t_1 = PySlice_Check(__pyx_v_key); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":186 * def __getitem__(self, key): * if isinstance(key, slice): * return tuple(self)[key] # <<<<<<<<<<<<<< * if key >= self.length: * raise IndexError(key) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PySequence_Tuple(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":185 * * def __getitem__(self, key): * if isinstance(key, slice): # <<<<<<<<<<<<<< * return tuple(self)[key] * if key >= self.length: */ } /* "pygame_sdl2/color.pyx":187 * if isinstance(key, slice): * return tuple(self)[key] * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if key == 0: return self.r */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_v_key, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/color.pyx":188 * return tuple(self)[key] * if key >= self.length: * raise IndexError(key) # <<<<<<<<<<<<<< * if key == 0: return self.r * elif key == 1: return self.g */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 188, __pyx_L1_error) /* "pygame_sdl2/color.pyx":187 * if isinstance(key, slice): * return tuple(self)[key] * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if key == 0: return self.r */ } /* "pygame_sdl2/color.pyx":189 * if key >= self.length: * raise IndexError(key) * if key == 0: return self.r # <<<<<<<<<<<<<< * elif key == 1: return self.g * elif key == 2: return self.b */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 189, __pyx_L1_error) if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":190 * raise IndexError(key) * if key == 0: return self.r * elif key == 1: return self.g # <<<<<<<<<<<<<< * elif key == 2: return self.b * elif key == 3: return self.a */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 190, __pyx_L1_error) if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":191 * if key == 0: return self.r * elif key == 1: return self.g * elif key == 2: return self.b # <<<<<<<<<<<<<< * elif key == 3: return self.a * else: */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":192 * elif key == 1: return self.g * elif key == 2: return self.b * elif key == 3: return self.a # <<<<<<<<<<<<<< * else: * raise IndexError(key) */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_3, 3, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 192, __pyx_L1_error) if (likely(__pyx_t_1)) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":194 * elif key == 3: return self.a * else: * raise IndexError(key) # <<<<<<<<<<<<<< * * def __len__(self): */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 194, __pyx_L1_error) } /* "pygame_sdl2/color.pyx":184 * raise IndexError(key) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * if isinstance(key, slice): * return tuple(self)[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.color.Color.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":196 * raise IndexError(key) * * def __len__(self): # <<<<<<<<<<<<<< * return self.length * */ /* Python wrapper */ static Py_ssize_t __pyx_pw_11pygame_sdl2_5color_5Color_25__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_11pygame_sdl2_5color_5Color_25__len__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_24__len__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_11pygame_sdl2_5color_5Color_24__len__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { Py_ssize_t __pyx_r; /* "pygame_sdl2/color.pyx":197 * * def __len__(self): * return self.length # <<<<<<<<<<<<<< * * def __mul__(self not None, Color rhs not None): */ __pyx_r = __pyx_v_self->length; goto __pyx_L0; /* "pygame_sdl2/color.pyx":196 * raise IndexError(key) * * def __len__(self): # <<<<<<<<<<<<<< * return self.length * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/color.pyx":199 * return self.length * * def __mul__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * # Multiplying this way doesn't make much sense, * # but it's how pygame does it. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 199, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 199, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_26__mul__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_26__mul__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { long __pyx_v_r; long __pyx_v_g; long __pyx_v_b; long __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; long __pyx_t_2; long __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__mul__", 1); /* "pygame_sdl2/color.pyx":203 * # but it's how pygame does it. * * r = min(255, self.r * rhs.r) # <<<<<<<<<<<<<< * g = min(255, self.g * rhs.g) * b = min(255, self.b * rhs.b) */ __pyx_t_1 = (__pyx_v_self->r * __pyx_v_rhs->r); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_r = __pyx_t_3; /* "pygame_sdl2/color.pyx":204 * * r = min(255, self.r * rhs.r) * g = min(255, self.g * rhs.g) # <<<<<<<<<<<<<< * b = min(255, self.b * rhs.b) * a = min(255, self.a * rhs.a) */ __pyx_t_1 = (__pyx_v_self->g * __pyx_v_rhs->g); __pyx_t_3 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_1; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_g = __pyx_t_2; /* "pygame_sdl2/color.pyx":205 * r = min(255, self.r * rhs.r) * g = min(255, self.g * rhs.g) * b = min(255, self.b * rhs.b) # <<<<<<<<<<<<<< * a = min(255, self.a * rhs.a) * */ __pyx_t_1 = (__pyx_v_self->b * __pyx_v_rhs->b); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_b = __pyx_t_3; /* "pygame_sdl2/color.pyx":206 * g = min(255, self.g * rhs.g) * b = min(255, self.b * rhs.b) * a = min(255, self.a * rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = (__pyx_v_self->a * __pyx_v_rhs->a); __pyx_t_3 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_1; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_a = __pyx_t_2; /* "pygame_sdl2/color.pyx":208 * a = min(255, self.a * rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __add__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_g); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_b); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_10 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_11 = NULL; __pyx_t_1 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_1 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_1, 4+__pyx_t_1); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":199 * return self.length * * def __mul__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * # Multiplying this way doesn't make much sense, * # but it's how pygame does it. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":210 * return type(self)(r, g, b, a) * * def __add__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_29__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_29__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 210, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 210, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_28__add__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_28__add__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { long __pyx_v_r; long __pyx_v_g; long __pyx_v_b; long __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; long __pyx_t_2; long __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__add__", 1); /* "pygame_sdl2/color.pyx":211 * * def __add__(self not None, Color rhs not None): * r = min(255, self.r + rhs.r) # <<<<<<<<<<<<<< * g = min(255, self.g + rhs.g) * b = min(255, self.b + rhs.b) */ __pyx_t_1 = (__pyx_v_self->r + __pyx_v_rhs->r); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_r = __pyx_t_3; /* "pygame_sdl2/color.pyx":212 * def __add__(self not None, Color rhs not None): * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) # <<<<<<<<<<<<<< * b = min(255, self.b + rhs.b) * a = min(255, self.a + rhs.a) */ __pyx_t_1 = (__pyx_v_self->g + __pyx_v_rhs->g); __pyx_t_3 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_1; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_g = __pyx_t_2; /* "pygame_sdl2/color.pyx":213 * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) * b = min(255, self.b + rhs.b) # <<<<<<<<<<<<<< * a = min(255, self.a + rhs.a) * */ __pyx_t_1 = (__pyx_v_self->b + __pyx_v_rhs->b); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_b = __pyx_t_3; /* "pygame_sdl2/color.pyx":214 * g = min(255, self.g + rhs.g) * b = min(255, self.b + rhs.b) * a = min(255, self.a + rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = (__pyx_v_self->a + __pyx_v_rhs->a); __pyx_t_3 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_1; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_a = __pyx_t_2; /* "pygame_sdl2/color.pyx":216 * a = min(255, self.a + rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __sub__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_g); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_b); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_10 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_11 = NULL; __pyx_t_1 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_1 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_1, 4+__pyx_t_1); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":210 * return type(self)(r, g, b, a) * * def __add__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":218 * return type(self)(r, g, b, a) * * def __sub__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_31__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_31__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 218, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 218, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_30__sub__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_30__sub__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { long __pyx_v_r; long __pyx_v_g; long __pyx_v_b; long __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; long __pyx_t_2; long __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__sub__", 1); /* "pygame_sdl2/color.pyx":219 * * def __sub__(self not None, Color rhs not None): * r = max(0, self.r - rhs.r) # <<<<<<<<<<<<<< * g = max(0, self.g - rhs.g) * b = max(0, self.b - rhs.b) */ __pyx_t_1 = (__pyx_v_self->r - __pyx_v_rhs->r); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_1 > __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_r = __pyx_t_3; /* "pygame_sdl2/color.pyx":220 * def __sub__(self not None, Color rhs not None): * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) # <<<<<<<<<<<<<< * b = max(0, self.b - rhs.b) * a = max(0, self.a - rhs.a) */ __pyx_t_1 = (__pyx_v_self->g - __pyx_v_rhs->g); __pyx_t_3 = 0; __pyx_t_4 = (__pyx_t_1 > __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_1; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_g = __pyx_t_2; /* "pygame_sdl2/color.pyx":221 * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) * b = max(0, self.b - rhs.b) # <<<<<<<<<<<<<< * a = max(0, self.a - rhs.a) * */ __pyx_t_1 = (__pyx_v_self->b - __pyx_v_rhs->b); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_1 > __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_b = __pyx_t_3; /* "pygame_sdl2/color.pyx":222 * g = max(0, self.g - rhs.g) * b = max(0, self.b - rhs.b) * a = max(0, self.a - rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = (__pyx_v_self->a - __pyx_v_rhs->a); __pyx_t_3 = 0; __pyx_t_4 = (__pyx_t_1 > __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_1; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_a = __pyx_t_2; /* "pygame_sdl2/color.pyx":224 * a = max(0, self.a - rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __mod__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_g); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_b); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_10 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_11 = NULL; __pyx_t_1 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_1 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_1, 4+__pyx_t_1); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":218 * return type(self)(r, g, b, a) * * def __sub__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":226 * return type(self)(r, g, b, a) * * def __mod__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def mod(l, r): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_33__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_33__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__mod__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 226, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 226, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_32__mod__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__mod___1mod(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_7__mod___1mod = {"mod", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_7__mod___1mod, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__mod___1mod(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_l = 0; PyObject *__pyx_v_r = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mod (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_l,&__pyx_n_s_r,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_l)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("mod", 1, 2, 2, 1); __PYX_ERR(0, 228, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mod") < 0)) __PYX_ERR(0, 228, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_l = values[0]; __pyx_v_r = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mod", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 228, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.__mod__.mod", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_self, __pyx_v_l, __pyx_v_r); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_r) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mod", 1); /* "pygame_sdl2/color.pyx":229 * * def mod(l, r): * if r == 0: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_r, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 229, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":230 * def mod(l, r): * if r == 0: * return 0 # <<<<<<<<<<<<<< * * return l % r */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":229 * * def mod(l, r): * if r == 0: # <<<<<<<<<<<<<< * return 0 * */ } /* "pygame_sdl2/color.pyx":232 * return 0 * * return l % r # <<<<<<<<<<<<<< * * r = mod(self.r, rhs.r) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyNumber_Remainder(__pyx_v_l, __pyx_v_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.__mod__.mod", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":226 * return type(self)(r, g, b, a) * * def __mod__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def mod(l, r): */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_32__mod__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_mod = 0; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__mod__", 1); /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_7__mod___1mod, 0, __pyx_n_s_mod___locals_mod, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mod = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":234 * return l % r * * r = mod(self.r, rhs.r) # <<<<<<<<<<<<<< * g = mod(self.g, rhs.g) * b = mod(self.b, rhs.b) */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":235 * * r = mod(self.r, rhs.r) * g = mod(self.g, rhs.g) # <<<<<<<<<<<<<< * b = mod(self.b, rhs.b) * a = mod(self.a, rhs.a) */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":236 * r = mod(self.r, rhs.r) * g = mod(self.g, rhs.g) * b = mod(self.b, rhs.b) # <<<<<<<<<<<<<< * a = mod(self.a, rhs.a) * */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":237 * g = mod(self.g, rhs.g) * b = mod(self.b, rhs.b) * a = mod(self.a, rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":239 * a = mod(self.a, rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __div__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_r, __pyx_v_g, __pyx_v_b, __pyx_v_a}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":226 * return type(self)(r, g, b, a) * * def __mod__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def mod(l, r): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.color.Color.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mod); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":241 * return type(self)(r, g, b, a) * * def __div__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_35__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_35__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__div__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 241, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_34__div__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_34__div__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; double __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; long __pyx_t_2; double __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__div__", 1); /* "pygame_sdl2/color.pyx":242 * * def __div__(self not None, Color rhs not None): * r = min(255, self.r / rhs.r) # <<<<<<<<<<<<<< * g = min(255, self.g / rhs.g) * b = min(255, self.b / rhs.b) */ if (unlikely(__pyx_v_rhs->r == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 242, __pyx_L1_error) } __pyx_t_1 = (((double)__pyx_v_self->r) / ((double)__pyx_v_rhs->r)); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_r = __pyx_t_3; /* "pygame_sdl2/color.pyx":243 * def __div__(self not None, Color rhs not None): * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) # <<<<<<<<<<<<<< * b = min(255, self.b / rhs.b) * a = min(255, self.a / rhs.a) */ if (unlikely(__pyx_v_rhs->g == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 243, __pyx_L1_error) } __pyx_t_3 = (((double)__pyx_v_self->g) / ((double)__pyx_v_rhs->g)); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_3 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_1 = __pyx_t_3; } else { __pyx_t_1 = __pyx_t_2; } __pyx_v_g = __pyx_t_1; /* "pygame_sdl2/color.pyx":244 * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) * b = min(255, self.b / rhs.b) # <<<<<<<<<<<<<< * a = min(255, self.a / rhs.a) * */ if (unlikely(__pyx_v_rhs->b == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 244, __pyx_L1_error) } __pyx_t_1 = (((double)__pyx_v_self->b) / ((double)__pyx_v_rhs->b)); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_b = __pyx_t_3; /* "pygame_sdl2/color.pyx":245 * g = min(255, self.g / rhs.g) * b = min(255, self.b / rhs.b) * a = min(255, self.a / rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ if (unlikely(__pyx_v_rhs->a == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 245, __pyx_L1_error) } __pyx_t_3 = (((double)__pyx_v_self->a) / ((double)__pyx_v_rhs->a)); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_3 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_1 = __pyx_t_3; } else { __pyx_t_1 = __pyx_t_2; } __pyx_v_a = __pyx_t_1; /* "pygame_sdl2/color.pyx":247 * a = min(255, self.a / rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __floordiv__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_g); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyFloat_FromDouble(__pyx_v_b); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_10 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 4+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":241 * return type(self)(r, g, b, a) * * def __div__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "pygame_sdl2/color.pyx":249 * return type(self)(r, g, b, a) * * def __floordiv__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def div(a, b): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_37__floordiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_37__floordiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__floordiv__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 249, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 249, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_36__floordiv__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_12__floordiv___1div(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_12__floordiv___1div = {"div", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_12__floordiv___1div, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_12__floordiv___1div(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_a = 0; PyObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("div (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("div", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "div") < 0)) __PYX_ERR(0, 251, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_a = values[0]; __pyx_v_b = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("div", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 251, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.__floordiv__.div", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_self, __pyx_v_a, __pyx_v_b); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; long __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("div", 1); /* "pygame_sdl2/color.pyx":252 * * def div(a, b): * if b == 0: # <<<<<<<<<<<<<< * return b * */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_b, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":253 * def div(a, b): * if b == 0: * return b # <<<<<<<<<<<<<< * * return min(255, a // b) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_b); __pyx_r = __pyx_v_b; goto __pyx_L0; /* "pygame_sdl2/color.pyx":252 * * def div(a, b): * if b == 0: # <<<<<<<<<<<<<< * return b * */ } /* "pygame_sdl2/color.pyx":255 * return b * * return min(255, a // b) # <<<<<<<<<<<<<< * * r = div(self.r, rhs.r) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyNumber_FloorDivide(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = 0xFF; __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = __pyx_t_2; } else { __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_r = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.color.Color.__floordiv__.div", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":249 * return type(self)(r, g, b, a) * * def __floordiv__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def div(a, b): */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_36__floordiv__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_div = 0; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__floordiv__", 1); /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_12__floordiv___1div, 0, __pyx_n_s_floordiv___locals_div, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_div = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":257 * return min(255, a // b) * * r = div(self.r, rhs.r) # <<<<<<<<<<<<<< * g = div(self.g, rhs.g) * b = div(self.b, rhs.b) */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":258 * * r = div(self.r, rhs.r) * g = div(self.g, rhs.g) # <<<<<<<<<<<<<< * b = div(self.b, rhs.b) * a = div(self.a, rhs.a) */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":259 * r = div(self.r, rhs.r) * g = div(self.g, rhs.g) * b = div(self.b, rhs.b) # <<<<<<<<<<<<<< * a = div(self.a, rhs.a) * */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":260 * g = div(self.g, rhs.g) * b = div(self.b, rhs.b) * a = div(self.a, rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":262 * a = div(self.a, rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * property cmy: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_r, __pyx_v_g, __pyx_v_b, __pyx_v_a}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":249 * return type(self)(r, g, b, a) * * def __floordiv__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def div(a, b): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.color.Color.__floordiv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_div); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":265 * * property cmy: * def __get__(self): # <<<<<<<<<<<<<< * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_3cmy_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_3cmy_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_3cmy___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_3cmy___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/color.pyx":266 * property cmy: * def __get__(self): * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((1.0 - (((double)__pyx_v_self->r) / 255.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble((1.0 - (((double)__pyx_v_self->g) / 255.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble((1.0 - (((double)__pyx_v_self->b) / 255.0))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":265 * * property cmy: * def __get__(self): # <<<<<<<<<<<<<< * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.cmy.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":268 * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * * def __set__(self, val): # <<<<<<<<<<<<<< * c, m, y = val * self.r = (1 - c) * 255 */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_3cmy_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_3cmy_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { PyObject *__pyx_v_c = NULL; PyObject *__pyx_v_m = NULL; PyObject *__pyx_v_y = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); Uint8 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/color.pyx":269 * * def __set__(self, val): * c, m, y = val # <<<<<<<<<<<<<< * self.r = (1 - c) * 255 * self.g = (1 - m) * 255 */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 269, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) __PYX_ERR(0, 269, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 269, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_c = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_m = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":270 * def __set__(self, val): * c, m, y = val * self.r = (1 - c) * 255 # <<<<<<<<<<<<<< * self.g = (1 - m) * 255 * self.b = (1 - y) * 255 */ __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_c, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_255, 0xFF, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->r = __pyx_t_6; /* "pygame_sdl2/color.pyx":271 * c, m, y = val * self.r = (1 - c) * 255 * self.g = (1 - m) * 255 # <<<<<<<<<<<<<< * self.b = (1 - y) * 255 * */ __pyx_t_2 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_m, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_t_2, __pyx_int_255, 0xFF, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_6 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->g = __pyx_t_6; /* "pygame_sdl2/color.pyx":272 * self.r = (1 - c) * 255 * self.g = (1 - m) * 255 * self.b = (1 - y) * 255 # <<<<<<<<<<<<<< * * property hsva: */ __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_y, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_255, 0xFF, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->b = __pyx_t_6; /* "pygame_sdl2/color.pyx":268 * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * * def __set__(self, val): # <<<<<<<<<<<<<< * c, m, y = val * self.r = (1 - c) * 255 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.cmy.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF(__pyx_v_m); __Pyx_XDECREF(__pyx_v_y); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":275 * * property hsva: * def __get__(self): # <<<<<<<<<<<<<< * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsva_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsva_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsva___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsva___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; double __pyx_v_cmax; double __pyx_v_cmin; double __pyx_v_delta; double __pyx_v_h; double __pyx_v_s; double __pyx_v_v; double __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; double __pyx_t_2; double __pyx_t_3; double __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/color.pyx":276 * property hsva: * def __get__(self): * cdef double r = self.r / 255.0 # <<<<<<<<<<<<<< * cdef double g = self.g / 255.0 * cdef double b = self.b / 255.0 */ __pyx_v_r = (((double)__pyx_v_self->r) / 255.0); /* "pygame_sdl2/color.pyx":277 * def __get__(self): * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 # <<<<<<<<<<<<<< * cdef double b = self.b / 255.0 * */ __pyx_v_g = (((double)__pyx_v_self->g) / 255.0); /* "pygame_sdl2/color.pyx":278 * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 * cdef double b = self.b / 255.0 # <<<<<<<<<<<<<< * * cdef double cmax = max(r, g, b) */ __pyx_v_b = (((double)__pyx_v_self->b) / 255.0); /* "pygame_sdl2/color.pyx":280 * cdef double b = self.b / 255.0 * * cdef double cmax = max(r, g, b) # <<<<<<<<<<<<<< * cdef double cmin = min(r, g, b) * cdef double delta = cmax - cmin */ __pyx_t_1 = __pyx_v_g; __pyx_t_2 = __pyx_v_b; __pyx_t_3 = __pyx_v_r; __pyx_t_5 = (__pyx_t_1 > __pyx_t_3); if (__pyx_t_5) { __pyx_t_4 = __pyx_t_1; } else { __pyx_t_4 = __pyx_t_3; } __pyx_t_3 = __pyx_t_4; __pyx_t_5 = (__pyx_t_2 > __pyx_t_3); if (__pyx_t_5) { __pyx_t_4 = __pyx_t_2; } else { __pyx_t_4 = __pyx_t_3; } __pyx_v_cmax = __pyx_t_4; /* "pygame_sdl2/color.pyx":281 * * cdef double cmax = max(r, g, b) * cdef double cmin = min(r, g, b) # <<<<<<<<<<<<<< * cdef double delta = cmax - cmin * */ __pyx_t_4 = __pyx_v_g; __pyx_t_1 = __pyx_v_b; __pyx_t_2 = __pyx_v_r; __pyx_t_5 = (__pyx_t_4 < __pyx_t_2); if (__pyx_t_5) { __pyx_t_3 = __pyx_t_4; } else { __pyx_t_3 = __pyx_t_2; } __pyx_t_2 = __pyx_t_3; __pyx_t_5 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_5) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_cmin = __pyx_t_3; /* "pygame_sdl2/color.pyx":282 * cdef double cmax = max(r, g, b) * cdef double cmin = min(r, g, b) * cdef double delta = cmax - cmin # <<<<<<<<<<<<<< * * cdef double h, s, v, a */ __pyx_v_delta = (__pyx_v_cmax - __pyx_v_cmin); /* "pygame_sdl2/color.pyx":286 * cdef double h, s, v, a * * if r == g == b: # <<<<<<<<<<<<<< * h = 0.0 * s = 0.0 */ __pyx_t_5 = (__pyx_v_r == __pyx_v_g); if (__pyx_t_5) { __pyx_t_5 = (__pyx_v_g == __pyx_v_b); } if (__pyx_t_5) { /* "pygame_sdl2/color.pyx":287 * * if r == g == b: * h = 0.0 # <<<<<<<<<<<<<< * s = 0.0 * else: */ __pyx_v_h = 0.0; /* "pygame_sdl2/color.pyx":288 * if r == g == b: * h = 0.0 * s = 0.0 # <<<<<<<<<<<<<< * else: * if cmax == r: */ __pyx_v_s = 0.0; /* "pygame_sdl2/color.pyx":286 * cdef double h, s, v, a * * if r == g == b: # <<<<<<<<<<<<<< * h = 0.0 * s = 0.0 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":290 * s = 0.0 * else: * if cmax == r: # <<<<<<<<<<<<<< * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: */ /*else*/ { __pyx_t_5 = (__pyx_v_cmax == __pyx_v_r); if (__pyx_t_5) { /* "pygame_sdl2/color.pyx":291 * else: * if cmax == r: * h = 60.0 * ((g - b) / delta % 6) # <<<<<<<<<<<<<< * elif cmax == g: * h = 60.0 * ((b - r) / delta + 2) */ __pyx_t_3 = (__pyx_v_g - __pyx_v_b); if (unlikely(__pyx_v_delta == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 291, __pyx_L1_error) } __pyx_v_h = (60.0 * __Pyx_mod_double((__pyx_t_3 / __pyx_v_delta), 6.0)); /* "pygame_sdl2/color.pyx":290 * s = 0.0 * else: * if cmax == r: # <<<<<<<<<<<<<< * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":292 * if cmax == r: * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: # <<<<<<<<<<<<<< * h = 60.0 * ((b - r) / delta + 2) * else: */ __pyx_t_5 = (__pyx_v_cmax == __pyx_v_g); if (__pyx_t_5) { /* "pygame_sdl2/color.pyx":293 * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: * h = 60.0 * ((b - r) / delta + 2) # <<<<<<<<<<<<<< * else: * h = 60.0 * ((r - g) / delta + 4) */ __pyx_t_3 = (__pyx_v_b - __pyx_v_r); if (unlikely(__pyx_v_delta == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 293, __pyx_L1_error) } __pyx_v_h = (60.0 * ((__pyx_t_3 / __pyx_v_delta) + 2.0)); /* "pygame_sdl2/color.pyx":292 * if cmax == r: * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: # <<<<<<<<<<<<<< * h = 60.0 * ((b - r) / delta + 2) * else: */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":295 * h = 60.0 * ((b - r) / delta + 2) * else: * h = 60.0 * ((r - g) / delta + 4) # <<<<<<<<<<<<<< * * if cmax == 0.0: */ /*else*/ { __pyx_t_3 = (__pyx_v_r - __pyx_v_g); if (unlikely(__pyx_v_delta == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 295, __pyx_L1_error) } __pyx_v_h = (60.0 * ((__pyx_t_3 / __pyx_v_delta) + 4.0)); } __pyx_L4:; /* "pygame_sdl2/color.pyx":297 * h = 60.0 * ((r - g) / delta + 4) * * if cmax == 0.0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ __pyx_t_5 = (__pyx_v_cmax == 0.0); if (__pyx_t_5) { /* "pygame_sdl2/color.pyx":298 * * if cmax == 0.0: * s = 0.0 # <<<<<<<<<<<<<< * else: * s = delta / cmax * 100 */ __pyx_v_s = 0.0; /* "pygame_sdl2/color.pyx":297 * h = 60.0 * ((r - g) / delta + 4) * * if cmax == 0.0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ goto __pyx_L5; } /* "pygame_sdl2/color.pyx":300 * s = 0.0 * else: * s = delta / cmax * 100 # <<<<<<<<<<<<<< * * v = cmax * 100 */ /*else*/ { if (unlikely(__pyx_v_cmax == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 300, __pyx_L1_error) } __pyx_v_s = ((__pyx_v_delta / __pyx_v_cmax) * 100.0); } __pyx_L5:; } __pyx_L3:; /* "pygame_sdl2/color.pyx":302 * s = delta / cmax * 100 * * v = cmax * 100 # <<<<<<<<<<<<<< * a = self.a / 255.0 * 100 * return h, s, v, a */ __pyx_v_v = (__pyx_v_cmax * 100.0); /* "pygame_sdl2/color.pyx":303 * * v = cmax * 100 * a = self.a / 255.0 * 100 # <<<<<<<<<<<<<< * return h, s, v, a * */ __pyx_v_a = ((((double)__pyx_v_self->a) / 255.0) * 100.0); /* "pygame_sdl2/color.pyx":304 * v = cmax * 100 * a = self.a / 255.0 * 100 * return h, s, v, a # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_8)) __PYX_ERR(0, 304, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_9)) __PYX_ERR(0, 304, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":275 * * property hsva: * def __get__(self): # <<<<<<<<<<<<<< * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsva.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":306 * return h, s, v, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, v, a * if len(val) == 3: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsva_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsva_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { double __pyx_v_h; double __pyx_v_s; double __pyx_v_v; double __pyx_v_a; double __pyx_v_c; double __pyx_v_x; double __pyx_v_m; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); double __pyx_t_8; double __pyx_t_9; double __pyx_t_10; PyObject *__pyx_t_11 = NULL; double __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/color.pyx":308 * def __set__(self, val): * cdef double h, s, v, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, v = val * a = 0.0 */ __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 308, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 3); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":309 * cdef double h, s, v, a * if len(val) == 3: * h, s, v = val # <<<<<<<<<<<<<< * a = 0.0 * else: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 309, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 309, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 309, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_h = __pyx_t_8; __pyx_v_s = __pyx_t_9; __pyx_v_v = __pyx_t_10; /* "pygame_sdl2/color.pyx":310 * if len(val) == 3: * h, s, v = val * a = 0.0 # <<<<<<<<<<<<<< * else: * h, s, v, a = val */ __pyx_v_a = 0.0; /* "pygame_sdl2/color.pyx":308 * def __set__(self, val): * cdef double h, s, v, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, v = val * a = 0.0 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":312 * a = 0.0 * else: * h, s, v, a = val # <<<<<<<<<<<<<< * * h = h % 360.0 */ /*else*/ { if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 312, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; __pyx_t_11 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_11); if (unlikely(!item)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_11), 4) < 0) __PYX_ERR(0, 312, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 312, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_h = __pyx_t_10; __pyx_v_s = __pyx_t_9; __pyx_v_v = __pyx_t_8; __pyx_v_a = __pyx_t_12; } __pyx_L3:; /* "pygame_sdl2/color.pyx":314 * h, s, v, a = val * * h = h % 360.0 # <<<<<<<<<<<<<< * * # These should be in a range of [0.0, 1.0] */ __pyx_v_h = __Pyx_mod_double(__pyx_v_h, 360.0); /* "pygame_sdl2/color.pyx":317 * * # These should be in a range of [0.0, 1.0] * s /= 100.0 # <<<<<<<<<<<<<< * v /= 100.0 * a /= 100.0 */ __pyx_v_s = (__pyx_v_s / 100.0); /* "pygame_sdl2/color.pyx":318 * # These should be in a range of [0.0, 1.0] * s /= 100.0 * v /= 100.0 # <<<<<<<<<<<<<< * a /= 100.0 * */ __pyx_v_v = (__pyx_v_v / 100.0); /* "pygame_sdl2/color.pyx":319 * s /= 100.0 * v /= 100.0 * a /= 100.0 # <<<<<<<<<<<<<< * * cdef double c = v * s */ __pyx_v_a = (__pyx_v_a / 100.0); /* "pygame_sdl2/color.pyx":321 * a /= 100.0 * * cdef double c = v * s # <<<<<<<<<<<<<< * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = v - c */ __pyx_v_c = (__pyx_v_v * __pyx_v_s); /* "pygame_sdl2/color.pyx":322 * * cdef double c = v * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) # <<<<<<<<<<<<<< * cdef double m = v - c * */ __pyx_v_x = (__pyx_v_c * (1.0 - fabs((__Pyx_mod_double((__pyx_v_h / 60.0), 2.0) - 1.0)))); /* "pygame_sdl2/color.pyx":323 * cdef double c = v * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = v - c # <<<<<<<<<<<<<< * * cdef double r, g, b */ __pyx_v_m = (__pyx_v_v - __pyx_v_c); /* "pygame_sdl2/color.pyx":327 * cdef double r, g, b * * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ __pyx_t_2 = (0.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 60.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":328 * * if 0 <= h < 60: * r, g, b = c, x, 0 # <<<<<<<<<<<<<< * elif 60 <= h < 120: * r, g, b = x, c, 0 */ __pyx_t_12 = __pyx_v_c; __pyx_t_8 = __pyx_v_x; __pyx_t_9 = 0.0; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":327 * cdef double r, g, b * * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":329 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ __pyx_t_2 = (60.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 120.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":330 * r, g, b = c, x, 0 * elif 60 <= h < 120: * r, g, b = x, c, 0 # <<<<<<<<<<<<<< * elif 120 <= h < 180: * r, g, b = 0, c, x */ __pyx_t_9 = __pyx_v_x; __pyx_t_8 = __pyx_v_c; __pyx_t_12 = 0.0; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":329 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":331 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ __pyx_t_2 = (120.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 180.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":332 * r, g, b = x, c, 0 * elif 120 <= h < 180: * r, g, b = 0, c, x # <<<<<<<<<<<<<< * elif 180 <= h < 240: * r, g, b = 0, x, c */ __pyx_t_12 = 0.0; __pyx_t_8 = __pyx_v_c; __pyx_t_9 = __pyx_v_x; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":331 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":333 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ __pyx_t_2 = (180.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 240.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":334 * r, g, b = 0, c, x * elif 180 <= h < 240: * r, g, b = 0, x, c # <<<<<<<<<<<<<< * elif 240 <= h < 300: * r, g, b = x, 0, c */ __pyx_t_9 = 0.0; __pyx_t_8 = __pyx_v_x; __pyx_t_12 = __pyx_v_c; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":333 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":335 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ __pyx_t_2 = (240.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 300.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":336 * r, g, b = 0, x, c * elif 240 <= h < 300: * r, g, b = x, 0, c # <<<<<<<<<<<<<< * elif 300 <= h < 360: * r, g, b = c, 0, x */ __pyx_t_12 = __pyx_v_x; __pyx_t_8 = 0.0; __pyx_t_9 = __pyx_v_c; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":335 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":337 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ __pyx_t_2 = (300.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 360.0); } if (likely(__pyx_t_2)) { /* "pygame_sdl2/color.pyx":338 * r, g, b = x, 0, c * elif 300 <= h < 360: * r, g, b = c, 0, x # <<<<<<<<<<<<<< * else: * raise ValueError() */ __pyx_t_9 = __pyx_v_c; __pyx_t_8 = 0.0; __pyx_t_12 = __pyx_v_x; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":337 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":340 * r, g, b = c, 0, x * else: * raise ValueError() # <<<<<<<<<<<<<< * * self.r = int(255 * (r + m)) */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_builtin_ValueError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 340, __pyx_L1_error) } __pyx_L8:; /* "pygame_sdl2/color.pyx":342 * raise ValueError() * * self.r = int(255 * (r + m)) # <<<<<<<<<<<<<< * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) */ __pyx_v_self->r = ((Uint8)(255.0 * (__pyx_v_r + __pyx_v_m))); /* "pygame_sdl2/color.pyx":343 * * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) # <<<<<<<<<<<<<< * self.b = int(255 * (b + m)) * self.a = int(255 * a) */ __pyx_v_self->g = ((Uint8)(255.0 * (__pyx_v_g + __pyx_v_m))); /* "pygame_sdl2/color.pyx":344 * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) # <<<<<<<<<<<<<< * self.a = int(255 * a) * */ __pyx_v_self->b = ((Uint8)(255.0 * (__pyx_v_b + __pyx_v_m))); /* "pygame_sdl2/color.pyx":345 * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) * self.a = int(255 * a) # <<<<<<<<<<<<<< * * property hsla: */ __pyx_v_self->a = ((Uint8)(255.0 * __pyx_v_a)); /* "pygame_sdl2/color.pyx":306 * return h, s, v, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, v, a * if len(val) == 3: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsva.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":348 * * property hsla: * def __get__(self): # <<<<<<<<<<<<<< * cdef double h, s, l, a * cdef double r, g, b */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsla_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsla_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsla___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsla___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { double __pyx_v_h; double __pyx_v_s; double __pyx_v_l; double __pyx_v_a; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; double __pyx_v_cmin; double __pyx_v_cmax; double __pyx_v_delta; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; double __pyx_t_3; double __pyx_t_4; double __pyx_t_5; double __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/color.pyx":353 * cdef double cmin, cmax, delta * * h = self.hsva[0] % 360.0 # <<<<<<<<<<<<<< * * r = self.r / 255.0 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hsva); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyFloat_RemainderObjC(__pyx_t_2, __pyx_float_360_0, 360.0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_h = __pyx_t_3; /* "pygame_sdl2/color.pyx":355 * h = self.hsva[0] % 360.0 * * r = self.r / 255.0 # <<<<<<<<<<<<<< * g = self.g / 255.0 * b = self.b / 255.0 */ __pyx_v_r = (((double)__pyx_v_self->r) / 255.0); /* "pygame_sdl2/color.pyx":356 * * r = self.r / 255.0 * g = self.g / 255.0 # <<<<<<<<<<<<<< * b = self.b / 255.0 * */ __pyx_v_g = (((double)__pyx_v_self->g) / 255.0); /* "pygame_sdl2/color.pyx":357 * r = self.r / 255.0 * g = self.g / 255.0 * b = self.b / 255.0 # <<<<<<<<<<<<<< * * cmin = min(r, g, b) */ __pyx_v_b = (((double)__pyx_v_self->b) / 255.0); /* "pygame_sdl2/color.pyx":359 * b = self.b / 255.0 * * cmin = min(r, g, b) # <<<<<<<<<<<<<< * cmax = max(r, g, b) * delta = cmax - cmin */ __pyx_t_3 = __pyx_v_g; __pyx_t_4 = __pyx_v_b; __pyx_t_5 = __pyx_v_r; __pyx_t_7 = (__pyx_t_3 < __pyx_t_5); if (__pyx_t_7) { __pyx_t_6 = __pyx_t_3; } else { __pyx_t_6 = __pyx_t_5; } __pyx_t_5 = __pyx_t_6; __pyx_t_7 = (__pyx_t_4 < __pyx_t_5); if (__pyx_t_7) { __pyx_t_6 = __pyx_t_4; } else { __pyx_t_6 = __pyx_t_5; } __pyx_v_cmin = __pyx_t_6; /* "pygame_sdl2/color.pyx":360 * * cmin = min(r, g, b) * cmax = max(r, g, b) # <<<<<<<<<<<<<< * delta = cmax - cmin * */ __pyx_t_6 = __pyx_v_g; __pyx_t_3 = __pyx_v_b; __pyx_t_4 = __pyx_v_r; __pyx_t_7 = (__pyx_t_6 > __pyx_t_4); if (__pyx_t_7) { __pyx_t_5 = __pyx_t_6; } else { __pyx_t_5 = __pyx_t_4; } __pyx_t_4 = __pyx_t_5; __pyx_t_7 = (__pyx_t_3 > __pyx_t_4); if (__pyx_t_7) { __pyx_t_5 = __pyx_t_3; } else { __pyx_t_5 = __pyx_t_4; } __pyx_v_cmax = __pyx_t_5; /* "pygame_sdl2/color.pyx":361 * cmin = min(r, g, b) * cmax = max(r, g, b) * delta = cmax - cmin # <<<<<<<<<<<<<< * * l = (cmax + cmin) / 2.0 */ __pyx_v_delta = (__pyx_v_cmax - __pyx_v_cmin); /* "pygame_sdl2/color.pyx":363 * delta = cmax - cmin * * l = (cmax + cmin) / 2.0 # <<<<<<<<<<<<<< * * if delta == 0: */ __pyx_v_l = ((__pyx_v_cmax + __pyx_v_cmin) / 2.0); /* "pygame_sdl2/color.pyx":365 * l = (cmax + cmin) / 2.0 * * if delta == 0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ __pyx_t_7 = (__pyx_v_delta == 0.0); if (__pyx_t_7) { /* "pygame_sdl2/color.pyx":366 * * if delta == 0: * s = 0.0 # <<<<<<<<<<<<<< * else: * s = delta / (1 - abs(2 * l - 1)) */ __pyx_v_s = 0.0; /* "pygame_sdl2/color.pyx":365 * l = (cmax + cmin) / 2.0 * * if delta == 0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":368 * s = 0.0 * else: * s = delta / (1 - abs(2 * l - 1)) # <<<<<<<<<<<<<< * * a = self.a / 255.0 * 100 */ /*else*/ { __pyx_t_5 = (1.0 - fabs(((2.0 * __pyx_v_l) - 1.0))); if (unlikely(__pyx_t_5 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 368, __pyx_L1_error) } __pyx_v_s = (__pyx_v_delta / __pyx_t_5); } __pyx_L3:; /* "pygame_sdl2/color.pyx":370 * s = delta / (1 - abs(2 * l - 1)) * * a = self.a / 255.0 * 100 # <<<<<<<<<<<<<< * * s = min(100.0, s * 100) */ __pyx_v_a = ((((double)__pyx_v_self->a) / 255.0) * 100.0); /* "pygame_sdl2/color.pyx":372 * a = self.a / 255.0 * 100 * * s = min(100.0, s * 100) # <<<<<<<<<<<<<< * l = min(100.0, l * 100) * */ __pyx_t_5 = (__pyx_v_s * 100.0); __pyx_t_6 = 100.0; __pyx_t_7 = (__pyx_t_5 < __pyx_t_6); if (__pyx_t_7) { __pyx_t_3 = __pyx_t_5; } else { __pyx_t_3 = __pyx_t_6; } __pyx_v_s = __pyx_t_3; /* "pygame_sdl2/color.pyx":373 * * s = min(100.0, s * 100) * l = min(100.0, l * 100) # <<<<<<<<<<<<<< * * return h, s, l, a */ __pyx_t_3 = (__pyx_v_l * 100.0); __pyx_t_5 = 100.0; __pyx_t_7 = (__pyx_t_3 < __pyx_t_5); if (__pyx_t_7) { __pyx_t_6 = __pyx_t_3; } else { __pyx_t_6 = __pyx_t_5; } __pyx_v_l = __pyx_t_6; /* "pygame_sdl2/color.pyx":375 * l = min(100.0, l * 100) * * return h, s, l, a # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = PyFloat_FromDouble(__pyx_v_l); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_9)) __PYX_ERR(0, 375, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":348 * * property hsla: * def __get__(self): # <<<<<<<<<<<<<< * cdef double h, s, l, a * cdef double r, g, b */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsla.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":377 * return h, s, l, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, l, a * if len(val) == 3: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsla_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsla_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { double __pyx_v_h; double __pyx_v_s; double __pyx_v_l; double __pyx_v_a; double __pyx_v_c; double __pyx_v_x; double __pyx_v_m; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); double __pyx_t_8; double __pyx_t_9; double __pyx_t_10; PyObject *__pyx_t_11 = NULL; double __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/color.pyx":379 * def __set__(self, val): * cdef double h, s, l, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, l = val * a = 0.0 */ __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 379, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 3); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":380 * cdef double h, s, l, a * if len(val) == 3: * h, s, l = val # <<<<<<<<<<<<<< * a = 0.0 * else: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 380, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 380, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 380, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_h = __pyx_t_8; __pyx_v_s = __pyx_t_9; __pyx_v_l = __pyx_t_10; /* "pygame_sdl2/color.pyx":381 * if len(val) == 3: * h, s, l = val * a = 0.0 # <<<<<<<<<<<<<< * else: * h, s, l, a = val */ __pyx_v_a = 0.0; /* "pygame_sdl2/color.pyx":379 * def __set__(self, val): * cdef double h, s, l, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, l = val * a = 0.0 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":383 * a = 0.0 * else: * h, s, l, a = val # <<<<<<<<<<<<<< * * s /= 100.0 */ /*else*/ { if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 383, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; __pyx_t_11 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_11); if (unlikely(!item)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_11), 4) < 0) __PYX_ERR(0, 383, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 383, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_h = __pyx_t_10; __pyx_v_s = __pyx_t_9; __pyx_v_l = __pyx_t_8; __pyx_v_a = __pyx_t_12; } __pyx_L3:; /* "pygame_sdl2/color.pyx":385 * h, s, l, a = val * * s /= 100.0 # <<<<<<<<<<<<<< * l /= 100.0 * a /= 100.0 */ __pyx_v_s = (__pyx_v_s / 100.0); /* "pygame_sdl2/color.pyx":386 * * s /= 100.0 * l /= 100.0 # <<<<<<<<<<<<<< * a /= 100.0 * */ __pyx_v_l = (__pyx_v_l / 100.0); /* "pygame_sdl2/color.pyx":387 * s /= 100.0 * l /= 100.0 * a /= 100.0 # <<<<<<<<<<<<<< * * cdef double c = (1 - abs(2*l - 1)) * s */ __pyx_v_a = (__pyx_v_a / 100.0); /* "pygame_sdl2/color.pyx":389 * a /= 100.0 * * cdef double c = (1 - abs(2*l - 1)) * s # <<<<<<<<<<<<<< * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = l - c / 2.0 */ __pyx_v_c = ((1.0 - fabs(((2.0 * __pyx_v_l) - 1.0))) * __pyx_v_s); /* "pygame_sdl2/color.pyx":390 * * cdef double c = (1 - abs(2*l - 1)) * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) # <<<<<<<<<<<<<< * cdef double m = l - c / 2.0 * */ __pyx_v_x = (__pyx_v_c * (1.0 - fabs((__Pyx_mod_double((__pyx_v_h / 60.0), 2.0) - 1.0)))); /* "pygame_sdl2/color.pyx":391 * cdef double c = (1 - abs(2*l - 1)) * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = l - c / 2.0 # <<<<<<<<<<<<<< * * cdef double r, g, b */ __pyx_v_m = (__pyx_v_l - (__pyx_v_c / 2.0)); /* "pygame_sdl2/color.pyx":394 * * cdef double r, g, b * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ __pyx_t_2 = (0.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 60.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":395 * cdef double r, g, b * if 0 <= h < 60: * r, g, b = c, x, 0 # <<<<<<<<<<<<<< * elif 60 <= h < 120: * r, g, b = x, c, 0 */ __pyx_t_12 = __pyx_v_c; __pyx_t_8 = __pyx_v_x; __pyx_t_9 = 0.0; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":394 * * cdef double r, g, b * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":396 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ __pyx_t_2 = (60.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 120.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":397 * r, g, b = c, x, 0 * elif 60 <= h < 120: * r, g, b = x, c, 0 # <<<<<<<<<<<<<< * elif 120 <= h < 180: * r, g, b = 0, c, x */ __pyx_t_9 = __pyx_v_x; __pyx_t_8 = __pyx_v_c; __pyx_t_12 = 0.0; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":396 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":398 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ __pyx_t_2 = (120.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 180.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":399 * r, g, b = x, c, 0 * elif 120 <= h < 180: * r, g, b = 0, c, x # <<<<<<<<<<<<<< * elif 180 <= h < 240: * r, g, b = 0, x, c */ __pyx_t_12 = 0.0; __pyx_t_8 = __pyx_v_c; __pyx_t_9 = __pyx_v_x; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":398 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":400 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ __pyx_t_2 = (180.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 240.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":401 * r, g, b = 0, c, x * elif 180 <= h < 240: * r, g, b = 0, x, c # <<<<<<<<<<<<<< * elif 240 <= h < 300: * r, g, b = x, 0, c */ __pyx_t_9 = 0.0; __pyx_t_8 = __pyx_v_x; __pyx_t_12 = __pyx_v_c; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":400 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":402 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ __pyx_t_2 = (240.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 300.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":403 * r, g, b = 0, x, c * elif 240 <= h < 300: * r, g, b = x, 0, c # <<<<<<<<<<<<<< * elif 300 <= h < 360: * r, g, b = c, 0, x */ __pyx_t_12 = __pyx_v_x; __pyx_t_8 = 0.0; __pyx_t_9 = __pyx_v_c; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":402 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":404 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ __pyx_t_2 = (300.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 360.0); } if (likely(__pyx_t_2)) { /* "pygame_sdl2/color.pyx":405 * r, g, b = x, 0, c * elif 300 <= h < 360: * r, g, b = c, 0, x # <<<<<<<<<<<<<< * else: * raise ValueError() */ __pyx_t_9 = __pyx_v_c; __pyx_t_8 = 0.0; __pyx_t_12 = __pyx_v_x; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":404 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":407 * r, g, b = c, 0, x * else: * raise ValueError() # <<<<<<<<<<<<<< * * self.r = int(255 * (r + m)) */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_builtin_ValueError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 407, __pyx_L1_error) } __pyx_L8:; /* "pygame_sdl2/color.pyx":409 * raise ValueError() * * self.r = int(255 * (r + m)) # <<<<<<<<<<<<<< * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) */ __pyx_v_self->r = ((Uint8)(255.0 * (__pyx_v_r + __pyx_v_m))); /* "pygame_sdl2/color.pyx":410 * * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) # <<<<<<<<<<<<<< * self.b = int(255 * (b + m)) * self.a = int(255 * a) */ __pyx_v_self->g = ((Uint8)(255.0 * (__pyx_v_g + __pyx_v_m))); /* "pygame_sdl2/color.pyx":411 * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) # <<<<<<<<<<<<<< * self.a = int(255 * a) * */ __pyx_v_self->b = ((Uint8)(255.0 * (__pyx_v_b + __pyx_v_m))); /* "pygame_sdl2/color.pyx":412 * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) * self.a = int(255 * a) # <<<<<<<<<<<<<< * * property i1i2i3: */ __pyx_v_self->a = ((Uint8)(255.0 * __pyx_v_a)); /* "pygame_sdl2/color.pyx":377 * return h, s, l, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, l, a * if len(val) == 3: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsla.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":415 * * property i1i2i3: * def __get__(self): # <<<<<<<<<<<<<< * # Take the dot product as described here: * # http://de.wikipedia.org/wiki/I1I2I3-Farbraum */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { double __pyx_v_i1; double __pyx_v_i2; double __pyx_v_i3; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/color.pyx":422 * cdef double r, g, b * * r = self.r / 255.0 # <<<<<<<<<<<<<< * g = self.g / 255.0 * b = self.b / 255.0 */ __pyx_v_r = (((double)__pyx_v_self->r) / 255.0); /* "pygame_sdl2/color.pyx":423 * * r = self.r / 255.0 * g = self.g / 255.0 # <<<<<<<<<<<<<< * b = self.b / 255.0 * */ __pyx_v_g = (((double)__pyx_v_self->g) / 255.0); /* "pygame_sdl2/color.pyx":424 * r = self.r / 255.0 * g = self.g / 255.0 * b = self.b / 255.0 # <<<<<<<<<<<<<< * * i1 = (r + g + b) / 3.0 */ __pyx_v_b = (((double)__pyx_v_self->b) / 255.0); /* "pygame_sdl2/color.pyx":426 * b = self.b / 255.0 * * i1 = (r + g + b) / 3.0 # <<<<<<<<<<<<<< * i2 = (r - b) / 2.0 * i3 = (2*g - r - b) / 4.0 */ __pyx_v_i1 = (((__pyx_v_r + __pyx_v_g) + __pyx_v_b) / 3.0); /* "pygame_sdl2/color.pyx":427 * * i1 = (r + g + b) / 3.0 * i2 = (r - b) / 2.0 # <<<<<<<<<<<<<< * i3 = (2*g - r - b) / 4.0 * */ __pyx_v_i2 = ((__pyx_v_r - __pyx_v_b) / 2.0); /* "pygame_sdl2/color.pyx":428 * i1 = (r + g + b) / 3.0 * i2 = (r - b) / 2.0 * i3 = (2*g - r - b) / 4.0 # <<<<<<<<<<<<<< * * return i1, i2, i3 */ __pyx_v_i3 = ((((2.0 * __pyx_v_g) - __pyx_v_r) - __pyx_v_b) / 4.0); /* "pygame_sdl2/color.pyx":430 * i3 = (2*g - r - b) / 4.0 * * return i1, i2, i3 # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_i1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_i2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_i3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":415 * * property i1i2i3: * def __get__(self): # <<<<<<<<<<<<<< * # Take the dot product as described here: * # http://de.wikipedia.org/wiki/I1I2I3-Farbraum */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.i1i2i3.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":432 * return i1, i2, i3 * * def __set__(self, val): # <<<<<<<<<<<<<< * # Dot product with the inverted matrix. * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { double __pyx_v_i1; double __pyx_v_i2; double __pyx_v_i3; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); double __pyx_t_6; double __pyx_t_7; double __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/color.pyx":438 * cdef double r, g, b * * i1, i2, i3 = val # <<<<<<<<<<<<<< * * r = i1 + i2 - (2.0/3.0 * i3) */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 438, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) __PYX_ERR(0, 438, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 438, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_i1 = __pyx_t_6; __pyx_v_i2 = __pyx_t_7; __pyx_v_i3 = __pyx_t_8; /* "pygame_sdl2/color.pyx":440 * i1, i2, i3 = val * * r = i1 + i2 - (2.0/3.0 * i3) # <<<<<<<<<<<<<< * g = i1 + (4.0/3.0 * i3) * b = i1 - i2 - (2.0/3.0 * i3) */ __pyx_v_r = ((__pyx_v_i1 + __pyx_v_i2) - ((2.0 / 3.0) * __pyx_v_i3)); /* "pygame_sdl2/color.pyx":441 * * r = i1 + i2 - (2.0/3.0 * i3) * g = i1 + (4.0/3.0 * i3) # <<<<<<<<<<<<<< * b = i1 - i2 - (2.0/3.0 * i3) * */ __pyx_v_g = (__pyx_v_i1 + ((4.0 / 3.0) * __pyx_v_i3)); /* "pygame_sdl2/color.pyx":442 * r = i1 + i2 - (2.0/3.0 * i3) * g = i1 + (4.0/3.0 * i3) * b = i1 - i2 - (2.0/3.0 * i3) # <<<<<<<<<<<<<< * * # Don't change alpha. */ __pyx_v_b = ((__pyx_v_i1 - __pyx_v_i2) - ((2.0 / 3.0) * __pyx_v_i3)); /* "pygame_sdl2/color.pyx":445 * * # Don't change alpha. * self.r = int(r * 255) # <<<<<<<<<<<<<< * self.g = int(g * 255) * self.b = int(b * 255) */ __pyx_v_self->r = ((Uint8)(__pyx_v_r * 255.0)); /* "pygame_sdl2/color.pyx":446 * # Don't change alpha. * self.r = int(r * 255) * self.g = int(g * 255) # <<<<<<<<<<<<<< * self.b = int(b * 255) * */ __pyx_v_self->g = ((Uint8)(__pyx_v_g * 255.0)); /* "pygame_sdl2/color.pyx":447 * self.r = int(r * 255) * self.g = int(g * 255) * self.b = int(b * 255) # <<<<<<<<<<<<<< * * def normalize(self): */ __pyx_v_self->b = ((Uint8)(__pyx_v_b * 255.0)); /* "pygame_sdl2/color.pyx":432 * return i1, i2, i3 * * def __set__(self, val): # <<<<<<<<<<<<<< * # Dot product with the inverted matrix. * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.i1i2i3.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":449 * self.b = int(b * 255) * * def normalize(self): # <<<<<<<<<<<<<< * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_39normalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5color_5Color_38normalize, "Color.normalize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_39normalize = {"normalize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_39normalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_38normalize}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_39normalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normalize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("normalize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "normalize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_38normalize(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_38normalize(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("normalize", 1); /* "pygame_sdl2/color.pyx":450 * * def normalize(self): * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 # <<<<<<<<<<<<<< * * def correct_gamma(self, gamma): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((((double)__pyx_v_self->r) / 255.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble((((double)__pyx_v_self->g) / 255.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble((((double)__pyx_v_self->b) / 255.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyFloat_FromDouble((((double)__pyx_v_self->a) / 255.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":449 * self.b = int(b * 255) * * def normalize(self): # <<<<<<<<<<<<<< * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.normalize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5color_5Color_40correct_gamma, "Color.correct_gamma(self, gamma)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_41correct_gamma = {"correct_gamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_40correct_gamma}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_gamma = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("correct_gamma (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gamma,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gamma)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "correct_gamma") < 0)) __PYX_ERR(0, 452, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_gamma = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("correct_gamma", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 452, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.correct_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_40correct_gamma(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), __pyx_v_gamma); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":453 * * def correct_gamma(self, gamma): * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) # <<<<<<<<<<<<<< * c = type(self)(tuple(m)) * return c */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1 = {"lambda1", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda1") < 0)) __PYX_ERR(0, 453, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_x = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lambda1", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 453, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.correct_gamma.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_cur_scope; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda1", 1); __pyx_outer_scope = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyFloat_TrueDivideObjC(__pyx_v_x, __pyx_float_255_0, 255.0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(!__pyx_cur_scope->__pyx_v_gamma)) { __Pyx_RaiseClosureNameError("gamma"); __PYX_ERR(0, 453, __pyx_L1_error) } __pyx_t_2 = __pyx_cur_scope->__pyx_v_gamma; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Power2(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_255, 0xFF, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_round, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.color.Color.correct_gamma.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_40correct_gamma(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_gamma) { struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_cur_scope; PyObject *__pyx_v_m = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("correct_gamma", 0); __pyx_cur_scope = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 452, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_gamma = __pyx_v_gamma; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_gamma); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_gamma); /* "pygame_sdl2/color.pyx":453 * * def correct_gamma(self, gamma): * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) # <<<<<<<<<<<<<< * c = type(self)(tuple(m)) * return c */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1, 0, __pyx_n_s_correct_gamma_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pygame_sdl2_color, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_Tuple(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_m = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":454 * def correct_gamma(self, gamma): * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) # <<<<<<<<<<<<<< * return c * */ __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_1 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_c = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":455 * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) * return c # <<<<<<<<<<<<<< * * def set_length(self, n): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_c); __pyx_r = __pyx_v_c; goto __pyx_L0; /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.correct_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_m); __Pyx_XDECREF(__pyx_v_c); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":457 * return c * * def set_length(self, n): # <<<<<<<<<<<<<< * if n > 4 or n < 1: * raise ValueError(n) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_43set_length(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5color_5Color_42set_length, "Color.set_length(self, n)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_43set_length = {"set_length", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_43set_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_42set_length}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_43set_length(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_n = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_length (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_length") < 0)) __PYX_ERR(0, 457, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_n = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_length", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 457, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_42set_length(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), __pyx_v_n); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_42set_length(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_n) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; uint8_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_length", 1); /* "pygame_sdl2/color.pyx":458 * * def set_length(self, n): * if n > 4 or n < 1: # <<<<<<<<<<<<<< * raise ValueError(n) * self.length = n */ __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_int_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/color.pyx":459 * def set_length(self, n): * if n > 4 or n < 1: * raise ValueError(n) # <<<<<<<<<<<<<< * self.length = n */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 459, __pyx_L1_error) /* "pygame_sdl2/color.pyx":458 * * def set_length(self, n): * if n > 4 or n < 1: # <<<<<<<<<<<<<< * raise ValueError(n) * self.length = n */ } /* "pygame_sdl2/color.pyx":460 * if n > 4 or n < 1: * raise ValueError(n) * self.length = n # <<<<<<<<<<<<<< */ __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_v_n); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_v_self->length = __pyx_t_4; /* "pygame_sdl2/color.pyx":457 * return c * * def set_length(self, n): # <<<<<<<<<<<<<< * if n > 4 or n < 1: * raise ValueError(n) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pxd":30 * cdef object __weakref__ * * cdef public Uint8 r, g, b, a # <<<<<<<<<<<<<< * cdef uint8_t length * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1r_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1r_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1r___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1r___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.r.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1r_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1r_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1r_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1r_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_self->r = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.r.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1g_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1g_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1g___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1g___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.g.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1g_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1g_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1g_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1g_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_self->g = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.g.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1b_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1b_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1b___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1b___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.b.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1b_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1b_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1b_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1b_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_self->b = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.b.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1a_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1a_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1a___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1a___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.a.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1a_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1a_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1a_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1a_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_self->a = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.a.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color __pyx_vtable_11pygame_sdl2_5color_Color; static PyObject *__pyx_tp_new_11pygame_sdl2_5color_Color(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_5color_Color *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_5color_Color; if (unlikely(__pyx_pw_11pygame_sdl2_5color_5Color_3__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_5color_Color(PyObject *o) { struct __pyx_obj_11pygame_sdl2_5color_Color *p = (struct __pyx_obj_11pygame_sdl2_5color_Color *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_5color_Color) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_sq_item_11pygame_sdl2_5color_Color(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_11pygame_sdl2_5color_Color(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_21__setitem__(o, i, v); } else { __Pyx_TypeName o_type_name; o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); return -1; } } static CYTHON_INLINE PyObject *__pyx_nb_add_11pygame_sdl2_5color_Color_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_add : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_add); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_add_11pygame_sdl2_5color_Color(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_add == &__pyx_nb_add_11pygame_sdl2_5color_Color) #endif || __Pyx_TypeCheck(left, __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_11pygame_sdl2_5color_5Color_29__add__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_add == &__pyx_nb_add_11pygame_sdl2_5color_Color) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_right) { return __pyx_nb_add_11pygame_sdl2_5color_Color_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_11pygame_sdl2_5color_Color, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } static CYTHON_INLINE PyObject *__pyx_nb_subtract_11pygame_sdl2_5color_Color_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_subtract : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_subtract); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_subtract_11pygame_sdl2_5color_Color(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_subtract == &__pyx_nb_subtract_11pygame_sdl2_5color_Color) #endif || __Pyx_TypeCheck(left, __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_11pygame_sdl2_5color_5Color_31__sub__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_subtract == &__pyx_nb_subtract_11pygame_sdl2_5color_Color) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_right) { return __pyx_nb_subtract_11pygame_sdl2_5color_Color_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_11pygame_sdl2_5color_Color, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } static CYTHON_INLINE PyObject *__pyx_nb_multiply_11pygame_sdl2_5color_Color_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_multiply : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_multiply); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_multiply_11pygame_sdl2_5color_Color(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_multiply == &__pyx_nb_multiply_11pygame_sdl2_5color_Color) #endif || __Pyx_TypeCheck(left, __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_11pygame_sdl2_5color_5Color_27__mul__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_multiply == &__pyx_nb_multiply_11pygame_sdl2_5color_Color) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_right) { return __pyx_nb_multiply_11pygame_sdl2_5color_Color_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_11pygame_sdl2_5color_Color, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static CYTHON_INLINE PyObject *__pyx_nb_divide_11pygame_sdl2_5color_Color_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_divide : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_divide); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_divide_11pygame_sdl2_5color_Color(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_divide == &__pyx_nb_divide_11pygame_sdl2_5color_Color) #endif || __Pyx_TypeCheck(left, __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_11pygame_sdl2_5color_5Color_35__div__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_divide == &__pyx_nb_divide_11pygame_sdl2_5color_Color) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_right) { return __pyx_nb_divide_11pygame_sdl2_5color_Color_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_11pygame_sdl2_5color_Color, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } #endif static CYTHON_INLINE PyObject *__pyx_nb_remainder_11pygame_sdl2_5color_Color_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_remainder : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_remainder); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_remainder_11pygame_sdl2_5color_Color(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_remainder == &__pyx_nb_remainder_11pygame_sdl2_5color_Color) #endif || __Pyx_TypeCheck(left, __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_11pygame_sdl2_5color_5Color_33__mod__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_remainder == &__pyx_nb_remainder_11pygame_sdl2_5color_Color) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_right) { return __pyx_nb_remainder_11pygame_sdl2_5color_Color_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_11pygame_sdl2_5color_Color, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } static CYTHON_INLINE PyObject *__pyx_nb_floor_divide_11pygame_sdl2_5color_Color_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_floor_divide : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_floor_divide); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_floor_divide_11pygame_sdl2_5color_Color(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_floor_divide == &__pyx_nb_floor_divide_11pygame_sdl2_5color_Color) #endif || __Pyx_TypeCheck(left, __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_11pygame_sdl2_5color_5Color_37__floordiv__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_floor_divide == &__pyx_nb_floor_divide_11pygame_sdl2_5color_Color) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_right) { return __pyx_nb_floor_divide_11pygame_sdl2_5color_Color_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_11pygame_sdl2_5color_Color, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_cmy(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_cmy(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_hsva(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_hsva(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_hsla(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_hsla(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_i1i2i3(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_i1i2i3(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_r(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1r_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_r(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1r_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_g(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1g_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_g(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1g_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_b(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1b_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_b(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1b_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_a(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1a_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_a(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1a_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_specialmethod___pyx_pw_11pygame_sdl2_5color_5Color_7__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __pyx_pw_11pygame_sdl2_5color_5Color_7__repr__(self); } static PyMethodDef __pyx_methods_11pygame_sdl2_5color_Color[] = { {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_11pygame_sdl2_5color_5Color_7__repr__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_16__reduce__}, {"__setstate__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_18__setstate__}, {"normalize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_39normalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_38normalize}, {"correct_gamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_40correct_gamma}, {"set_length", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_43set_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_42set_length}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_5color_Color[] = { {(char *)"cmy", __pyx_getprop_11pygame_sdl2_5color_5Color_cmy, __pyx_setprop_11pygame_sdl2_5color_5Color_cmy, (char *)0, 0}, {(char *)"hsva", __pyx_getprop_11pygame_sdl2_5color_5Color_hsva, __pyx_setprop_11pygame_sdl2_5color_5Color_hsva, (char *)0, 0}, {(char *)"hsla", __pyx_getprop_11pygame_sdl2_5color_5Color_hsla, __pyx_setprop_11pygame_sdl2_5color_5Color_hsla, (char *)0, 0}, {(char *)"i1i2i3", __pyx_getprop_11pygame_sdl2_5color_5Color_i1i2i3, __pyx_setprop_11pygame_sdl2_5color_5Color_i1i2i3, (char *)0, 0}, {(char *)"r", __pyx_getprop_11pygame_sdl2_5color_5Color_r, __pyx_setprop_11pygame_sdl2_5color_5Color_r, (char *)PyDoc_STR("r: 'Uint8'"), 0}, {(char *)"g", __pyx_getprop_11pygame_sdl2_5color_5Color_g, __pyx_setprop_11pygame_sdl2_5color_5Color_g, (char *)PyDoc_STR("g: 'Uint8'"), 0}, {(char *)"b", __pyx_getprop_11pygame_sdl2_5color_5Color_b, __pyx_setprop_11pygame_sdl2_5color_5Color_b, (char *)PyDoc_STR("b: 'Uint8'"), 0}, {(char *)"a", __pyx_getprop_11pygame_sdl2_5color_5Color_a, __pyx_setprop_11pygame_sdl2_5color_5Color_a, (char *)PyDoc_STR("a: 'Uint8'"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_5color_Color_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_5color_Color}, {Py_tp_repr, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_7__repr__}, {Py_nb_add, (void *)__pyx_nb_add_11pygame_sdl2_5color_Color}, {Py_nb_subtract, (void *)__pyx_nb_subtract_11pygame_sdl2_5color_Color}, {Py_nb_multiply, (void *)__pyx_nb_multiply_11pygame_sdl2_5color_Color}, #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) {Py_nb_divide, (void *)__pyx_nb_divide_11pygame_sdl2_5color_Color}, #endif {Py_nb_remainder, (void *)__pyx_nb_remainder_11pygame_sdl2_5color_Color}, {Py_nb_int, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_9__int__}, #if PY_MAJOR_VERSION < 3 {Py_nb_long, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_9__int__}, #endif {Py_nb_float, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_15__float__}, #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) {Py_nb_oct, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_13__oct__}, #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) {Py_nb_hex, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_11__hex__}, #endif {Py_nb_floor_divide, (void *)__pyx_nb_floor_divide_11pygame_sdl2_5color_Color}, {Py_sq_length, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_25__len__}, {Py_sq_item, (void *)__pyx_sq_item_11pygame_sdl2_5color_Color}, {Py_mp_length, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_25__len__}, {Py_mp_subscript, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_11pygame_sdl2_5color_Color}, {Py_tp_doc, (void *)PyDoc_STR("Color(*args)")}, {Py_tp_richcompare, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_5color_Color}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_5color_Color}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_5__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_5color_Color}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_5color_Color_spec = { "pygame_sdl2.color.Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_5color_Color_slots, }; #else static PyNumberMethods __pyx_tp_as_number_Color = { __pyx_nb_add_11pygame_sdl2_5color_Color, /*nb_add*/ __pyx_nb_subtract_11pygame_sdl2_5color_Color, /*nb_subtract*/ __pyx_nb_multiply_11pygame_sdl2_5color_Color, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_nb_divide_11pygame_sdl2_5color_Color, /*nb_divide*/ #endif __pyx_nb_remainder_11pygame_sdl2_5color_Color, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_bool*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_9__int__, /*nb_int*/ #if PY_MAJOR_VERSION < 3 __pyx_pw_11pygame_sdl2_5color_5Color_9__int__, /*nb_long*/ #else 0, /*reserved*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_15__float__, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_pw_11pygame_sdl2_5color_5Color_13__oct__, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_pw_11pygame_sdl2_5color_5Color_11__hex__, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ __pyx_nb_floor_divide_11pygame_sdl2_5color_Color, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_Color = { __pyx_pw_11pygame_sdl2_5color_5Color_25__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_5color_Color, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Color = { __pyx_pw_11pygame_sdl2_5color_5Color_25__len__, /*mp_length*/ __pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_11pygame_sdl2_5color_Color, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_5color_Color = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.color.""Color", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5color_Color, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_7__repr__, /*tp_repr*/ &__pyx_tp_as_number_Color, /*tp_as_number*/ &__pyx_tp_as_sequence_Color, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Color, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Color(*args)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ __pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5color_Color, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_5color_Color, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5color_Color, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_freelist_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma[8]; static int __pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = 0; static PyObject *__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_COMPILING_IN_CPYTHON if (likely((int)(__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)))) { o = (PyObject*)__pyx_freelist_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma[--__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma]; memset(o, 0, sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyObject *o) { struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *p = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_gamma); #if CYTHON_COMPILING_IN_CPYTHON if (((int)(__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)))) { __pyx_freelist_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma[__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma++] = ((struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *p = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o; if (p->__pyx_v_gamma) { e = (*v)(p->__pyx_v_gamma, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *p = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o; tmp = ((PyObject*)p->__pyx_v_gamma); p->__pyx_v_gamma = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma_spec = { "pygame_sdl2.color.__pyx_scope_struct__correct_gamma", sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.color.""__pyx_scope_struct__correct_gamma", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_08x, __pyx_k_08x, sizeof(__pyx_k_08x), 0, 0, 1, 0}, {&__pyx_kp_s_0x, __pyx_k_0x, sizeof(__pyx_k_0x), 0, 0, 1, 0}, {&__pyx_n_s_BBB, __pyx_k_BBB, sizeof(__pyx_k_BBB), 0, 0, 1, 1}, {&__pyx_n_s_BBBB, __pyx_k_BBBB, sizeof(__pyx_k_BBBB), 0, 0, 1, 1}, {&__pyx_n_s_Color, __pyx_k_Color, sizeof(__pyx_k_Color), 0, 0, 1, 1}, {&__pyx_n_s_Color___reduce, __pyx_k_Color___reduce, sizeof(__pyx_k_Color___reduce), 0, 0, 1, 1}, {&__pyx_n_s_Color___setstate, __pyx_k_Color___setstate, sizeof(__pyx_k_Color___setstate), 0, 0, 1, 1}, {&__pyx_n_s_Color_correct_gamma, __pyx_k_Color_correct_gamma, sizeof(__pyx_k_Color_correct_gamma), 0, 0, 1, 1}, {&__pyx_n_s_Color_from_hex_locals_lambda, __pyx_k_Color_from_hex_locals_lambda, sizeof(__pyx_k_Color_from_hex_locals_lambda), 0, 0, 1, 1}, {&__pyx_n_s_Color_normalize, __pyx_k_Color_normalize, sizeof(__pyx_k_Color_normalize), 0, 0, 1, 1}, {&__pyx_n_s_Color_set_length, __pyx_k_Color_set_length, sizeof(__pyx_k_Color_set_length), 0, 0, 1, 1}, {&__pyx_kp_s_Expected_a_color, __pyx_k_Expected_a_color, sizeof(__pyx_k_Expected_a_color), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_kp_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, {&__pyx_n_s__523, __pyx_k__523, sizeof(__pyx_k__523), 0, 0, 1, 1}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_aliceblue, __pyx_k_aliceblue, sizeof(__pyx_k_aliceblue), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite, __pyx_k_antiquewhite, sizeof(__pyx_k_antiquewhite), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite1, __pyx_k_antiquewhite1, sizeof(__pyx_k_antiquewhite1), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite2, __pyx_k_antiquewhite2, sizeof(__pyx_k_antiquewhite2), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite3, __pyx_k_antiquewhite3, sizeof(__pyx_k_antiquewhite3), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite4, __pyx_k_antiquewhite4, sizeof(__pyx_k_antiquewhite4), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine, __pyx_k_aquamarine, sizeof(__pyx_k_aquamarine), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine1, __pyx_k_aquamarine1, sizeof(__pyx_k_aquamarine1), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine2, __pyx_k_aquamarine2, sizeof(__pyx_k_aquamarine2), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine3, __pyx_k_aquamarine3, sizeof(__pyx_k_aquamarine3), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine4, __pyx_k_aquamarine4, sizeof(__pyx_k_aquamarine4), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_azure, __pyx_k_azure, sizeof(__pyx_k_azure), 0, 0, 1, 1}, {&__pyx_n_s_azure1, __pyx_k_azure1, sizeof(__pyx_k_azure1), 0, 0, 1, 1}, {&__pyx_n_s_azure2, __pyx_k_azure2, sizeof(__pyx_k_azure2), 0, 0, 1, 1}, {&__pyx_n_s_azure3, __pyx_k_azure3, sizeof(__pyx_k_azure3), 0, 0, 1, 1}, {&__pyx_n_s_azure4, __pyx_k_azure4, sizeof(__pyx_k_azure4), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_beige, __pyx_k_beige, sizeof(__pyx_k_beige), 0, 0, 1, 1}, {&__pyx_n_s_binascii, __pyx_k_binascii, sizeof(__pyx_k_binascii), 0, 0, 1, 1}, {&__pyx_n_s_bisque, __pyx_k_bisque, sizeof(__pyx_k_bisque), 0, 0, 1, 1}, {&__pyx_n_s_bisque1, __pyx_k_bisque1, sizeof(__pyx_k_bisque1), 0, 0, 1, 1}, {&__pyx_n_s_bisque2, __pyx_k_bisque2, sizeof(__pyx_k_bisque2), 0, 0, 1, 1}, {&__pyx_n_s_bisque3, __pyx_k_bisque3, sizeof(__pyx_k_bisque3), 0, 0, 1, 1}, {&__pyx_n_s_bisque4, __pyx_k_bisque4, sizeof(__pyx_k_bisque4), 0, 0, 1, 1}, {&__pyx_n_s_black, __pyx_k_black, sizeof(__pyx_k_black), 0, 0, 1, 1}, {&__pyx_n_s_blanchedalmond, __pyx_k_blanchedalmond, sizeof(__pyx_k_blanchedalmond), 0, 0, 1, 1}, {&__pyx_n_s_blue, __pyx_k_blue, sizeof(__pyx_k_blue), 0, 0, 1, 1}, {&__pyx_n_s_blue1, __pyx_k_blue1, sizeof(__pyx_k_blue1), 0, 0, 1, 1}, {&__pyx_n_s_blue2, __pyx_k_blue2, sizeof(__pyx_k_blue2), 0, 0, 1, 1}, {&__pyx_n_s_blue3, __pyx_k_blue3, sizeof(__pyx_k_blue3), 0, 0, 1, 1}, {&__pyx_n_s_blue4, __pyx_k_blue4, sizeof(__pyx_k_blue4), 0, 0, 1, 1}, {&__pyx_n_s_blueviolet, __pyx_k_blueviolet, sizeof(__pyx_k_blueviolet), 0, 0, 1, 1}, {&__pyx_n_s_brown, __pyx_k_brown, sizeof(__pyx_k_brown), 0, 0, 1, 1}, {&__pyx_n_s_brown1, __pyx_k_brown1, sizeof(__pyx_k_brown1), 0, 0, 1, 1}, {&__pyx_n_s_brown2, __pyx_k_brown2, sizeof(__pyx_k_brown2), 0, 0, 1, 1}, {&__pyx_n_s_brown3, __pyx_k_brown3, sizeof(__pyx_k_brown3), 0, 0, 1, 1}, {&__pyx_n_s_brown4, __pyx_k_brown4, sizeof(__pyx_k_brown4), 0, 0, 1, 1}, {&__pyx_n_s_burlywood, __pyx_k_burlywood, sizeof(__pyx_k_burlywood), 0, 0, 1, 1}, {&__pyx_n_s_burlywood1, __pyx_k_burlywood1, sizeof(__pyx_k_burlywood1), 0, 0, 1, 1}, {&__pyx_n_s_burlywood2, __pyx_k_burlywood2, sizeof(__pyx_k_burlywood2), 0, 0, 1, 1}, {&__pyx_n_s_burlywood3, __pyx_k_burlywood3, sizeof(__pyx_k_burlywood3), 0, 0, 1, 1}, {&__pyx_n_s_burlywood4, __pyx_k_burlywood4, sizeof(__pyx_k_burlywood4), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue, __pyx_k_cadetblue, sizeof(__pyx_k_cadetblue), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue1, __pyx_k_cadetblue1, sizeof(__pyx_k_cadetblue1), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue2, __pyx_k_cadetblue2, sizeof(__pyx_k_cadetblue2), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue3, __pyx_k_cadetblue3, sizeof(__pyx_k_cadetblue3), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue4, __pyx_k_cadetblue4, sizeof(__pyx_k_cadetblue4), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse, __pyx_k_chartreuse, sizeof(__pyx_k_chartreuse), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse1, __pyx_k_chartreuse1, sizeof(__pyx_k_chartreuse1), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse2, __pyx_k_chartreuse2, sizeof(__pyx_k_chartreuse2), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse3, __pyx_k_chartreuse3, sizeof(__pyx_k_chartreuse3), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse4, __pyx_k_chartreuse4, sizeof(__pyx_k_chartreuse4), 0, 0, 1, 1}, {&__pyx_n_s_chocolate, __pyx_k_chocolate, sizeof(__pyx_k_chocolate), 0, 0, 1, 1}, {&__pyx_n_s_chocolate1, __pyx_k_chocolate1, sizeof(__pyx_k_chocolate1), 0, 0, 1, 1}, {&__pyx_n_s_chocolate2, __pyx_k_chocolate2, sizeof(__pyx_k_chocolate2), 0, 0, 1, 1}, {&__pyx_n_s_chocolate3, __pyx_k_chocolate3, sizeof(__pyx_k_chocolate3), 0, 0, 1, 1}, {&__pyx_n_s_chocolate4, __pyx_k_chocolate4, sizeof(__pyx_k_chocolate4), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_coral, __pyx_k_coral, sizeof(__pyx_k_coral), 0, 0, 1, 1}, {&__pyx_n_s_coral1, __pyx_k_coral1, sizeof(__pyx_k_coral1), 0, 0, 1, 1}, {&__pyx_n_s_coral2, __pyx_k_coral2, sizeof(__pyx_k_coral2), 0, 0, 1, 1}, {&__pyx_n_s_coral3, __pyx_k_coral3, sizeof(__pyx_k_coral3), 0, 0, 1, 1}, {&__pyx_n_s_coral4, __pyx_k_coral4, sizeof(__pyx_k_coral4), 0, 0, 1, 1}, {&__pyx_n_s_cornflowerblue, __pyx_k_cornflowerblue, sizeof(__pyx_k_cornflowerblue), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk, __pyx_k_cornsilk, sizeof(__pyx_k_cornsilk), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk1, __pyx_k_cornsilk1, sizeof(__pyx_k_cornsilk1), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk2, __pyx_k_cornsilk2, sizeof(__pyx_k_cornsilk2), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk3, __pyx_k_cornsilk3, sizeof(__pyx_k_cornsilk3), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk4, __pyx_k_cornsilk4, sizeof(__pyx_k_cornsilk4), 0, 0, 1, 1}, {&__pyx_n_s_correct_gamma, __pyx_k_correct_gamma, sizeof(__pyx_k_correct_gamma), 0, 0, 1, 1}, {&__pyx_n_s_correct_gamma_locals_lambda, __pyx_k_correct_gamma_locals_lambda, sizeof(__pyx_k_correct_gamma_locals_lambda), 0, 0, 1, 1}, {&__pyx_n_s_cyan, __pyx_k_cyan, sizeof(__pyx_k_cyan), 0, 0, 1, 1}, {&__pyx_n_s_cyan1, __pyx_k_cyan1, sizeof(__pyx_k_cyan1), 0, 0, 1, 1}, {&__pyx_n_s_cyan2, __pyx_k_cyan2, sizeof(__pyx_k_cyan2), 0, 0, 1, 1}, {&__pyx_n_s_cyan3, __pyx_k_cyan3, sizeof(__pyx_k_cyan3), 0, 0, 1, 1}, {&__pyx_n_s_cyan4, __pyx_k_cyan4, sizeof(__pyx_k_cyan4), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_darkblue, __pyx_k_darkblue, sizeof(__pyx_k_darkblue), 0, 0, 1, 1}, {&__pyx_n_s_darkcyan, __pyx_k_darkcyan, sizeof(__pyx_k_darkcyan), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod, __pyx_k_darkgoldenrod, sizeof(__pyx_k_darkgoldenrod), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod1, __pyx_k_darkgoldenrod1, sizeof(__pyx_k_darkgoldenrod1), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod2, __pyx_k_darkgoldenrod2, sizeof(__pyx_k_darkgoldenrod2), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod3, __pyx_k_darkgoldenrod3, sizeof(__pyx_k_darkgoldenrod3), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod4, __pyx_k_darkgoldenrod4, sizeof(__pyx_k_darkgoldenrod4), 0, 0, 1, 1}, {&__pyx_n_s_darkgray, __pyx_k_darkgray, sizeof(__pyx_k_darkgray), 0, 0, 1, 1}, {&__pyx_n_s_darkgreen, __pyx_k_darkgreen, sizeof(__pyx_k_darkgreen), 0, 0, 1, 1}, {&__pyx_n_s_darkgrey, __pyx_k_darkgrey, sizeof(__pyx_k_darkgrey), 0, 0, 1, 1}, {&__pyx_n_s_darkkhaki, __pyx_k_darkkhaki, sizeof(__pyx_k_darkkhaki), 0, 0, 1, 1}, {&__pyx_n_s_darkmagenta, __pyx_k_darkmagenta, sizeof(__pyx_k_darkmagenta), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen, __pyx_k_darkolivegreen, sizeof(__pyx_k_darkolivegreen), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen1, __pyx_k_darkolivegreen1, sizeof(__pyx_k_darkolivegreen1), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen2, __pyx_k_darkolivegreen2, sizeof(__pyx_k_darkolivegreen2), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen3, __pyx_k_darkolivegreen3, sizeof(__pyx_k_darkolivegreen3), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen4, __pyx_k_darkolivegreen4, sizeof(__pyx_k_darkolivegreen4), 0, 0, 1, 1}, {&__pyx_n_s_darkorange, __pyx_k_darkorange, sizeof(__pyx_k_darkorange), 0, 0, 1, 1}, {&__pyx_n_s_darkorange1, __pyx_k_darkorange1, sizeof(__pyx_k_darkorange1), 0, 0, 1, 1}, {&__pyx_n_s_darkorange2, __pyx_k_darkorange2, sizeof(__pyx_k_darkorange2), 0, 0, 1, 1}, {&__pyx_n_s_darkorange3, __pyx_k_darkorange3, sizeof(__pyx_k_darkorange3), 0, 0, 1, 1}, {&__pyx_n_s_darkorange4, __pyx_k_darkorange4, sizeof(__pyx_k_darkorange4), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid, __pyx_k_darkorchid, sizeof(__pyx_k_darkorchid), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid1, __pyx_k_darkorchid1, sizeof(__pyx_k_darkorchid1), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid2, __pyx_k_darkorchid2, sizeof(__pyx_k_darkorchid2), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid3, __pyx_k_darkorchid3, sizeof(__pyx_k_darkorchid3), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid4, __pyx_k_darkorchid4, sizeof(__pyx_k_darkorchid4), 0, 0, 1, 1}, {&__pyx_n_s_darkred, __pyx_k_darkred, sizeof(__pyx_k_darkred), 0, 0, 1, 1}, {&__pyx_n_s_darksalmon, __pyx_k_darksalmon, sizeof(__pyx_k_darksalmon), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen, __pyx_k_darkseagreen, sizeof(__pyx_k_darkseagreen), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen1, __pyx_k_darkseagreen1, sizeof(__pyx_k_darkseagreen1), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen2, __pyx_k_darkseagreen2, sizeof(__pyx_k_darkseagreen2), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen3, __pyx_k_darkseagreen3, sizeof(__pyx_k_darkseagreen3), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen4, __pyx_k_darkseagreen4, sizeof(__pyx_k_darkseagreen4), 0, 0, 1, 1}, {&__pyx_n_s_darkslateblue, __pyx_k_darkslateblue, sizeof(__pyx_k_darkslateblue), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray, __pyx_k_darkslategray, sizeof(__pyx_k_darkslategray), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray1, __pyx_k_darkslategray1, sizeof(__pyx_k_darkslategray1), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray2, __pyx_k_darkslategray2, sizeof(__pyx_k_darkslategray2), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray3, __pyx_k_darkslategray3, sizeof(__pyx_k_darkslategray3), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray4, __pyx_k_darkslategray4, sizeof(__pyx_k_darkslategray4), 0, 0, 1, 1}, {&__pyx_n_s_darkslategrey, __pyx_k_darkslategrey, sizeof(__pyx_k_darkslategrey), 0, 0, 1, 1}, {&__pyx_n_s_darkturquoise, __pyx_k_darkturquoise, sizeof(__pyx_k_darkturquoise), 0, 0, 1, 1}, {&__pyx_n_s_darkviolet, __pyx_k_darkviolet, sizeof(__pyx_k_darkviolet), 0, 0, 1, 1}, {&__pyx_n_s_debianred, __pyx_k_debianred, sizeof(__pyx_k_debianred), 0, 0, 1, 1}, {&__pyx_n_s_deeppink, __pyx_k_deeppink, sizeof(__pyx_k_deeppink), 0, 0, 1, 1}, {&__pyx_n_s_deeppink1, __pyx_k_deeppink1, sizeof(__pyx_k_deeppink1), 0, 0, 1, 1}, {&__pyx_n_s_deeppink2, __pyx_k_deeppink2, sizeof(__pyx_k_deeppink2), 0, 0, 1, 1}, {&__pyx_n_s_deeppink3, __pyx_k_deeppink3, sizeof(__pyx_k_deeppink3), 0, 0, 1, 1}, {&__pyx_n_s_deeppink4, __pyx_k_deeppink4, sizeof(__pyx_k_deeppink4), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue, __pyx_k_deepskyblue, sizeof(__pyx_k_deepskyblue), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue1, __pyx_k_deepskyblue1, sizeof(__pyx_k_deepskyblue1), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue2, __pyx_k_deepskyblue2, sizeof(__pyx_k_deepskyblue2), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue3, __pyx_k_deepskyblue3, sizeof(__pyx_k_deepskyblue3), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue4, __pyx_k_deepskyblue4, sizeof(__pyx_k_deepskyblue4), 0, 0, 1, 1}, {&__pyx_n_s_dimgray, __pyx_k_dimgray, sizeof(__pyx_k_dimgray), 0, 0, 1, 1}, {&__pyx_n_s_dimgrey, __pyx_k_dimgrey, sizeof(__pyx_k_dimgrey), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_div, __pyx_k_div, sizeof(__pyx_k_div), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue, __pyx_k_dodgerblue, sizeof(__pyx_k_dodgerblue), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue1, __pyx_k_dodgerblue1, sizeof(__pyx_k_dodgerblue1), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue2, __pyx_k_dodgerblue2, sizeof(__pyx_k_dodgerblue2), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue3, __pyx_k_dodgerblue3, sizeof(__pyx_k_dodgerblue3), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue4, __pyx_k_dodgerblue4, sizeof(__pyx_k_dodgerblue4), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_firebrick, __pyx_k_firebrick, sizeof(__pyx_k_firebrick), 0, 0, 1, 1}, {&__pyx_n_s_firebrick1, __pyx_k_firebrick1, sizeof(__pyx_k_firebrick1), 0, 0, 1, 1}, {&__pyx_n_s_firebrick2, __pyx_k_firebrick2, sizeof(__pyx_k_firebrick2), 0, 0, 1, 1}, {&__pyx_n_s_firebrick3, __pyx_k_firebrick3, sizeof(__pyx_k_firebrick3), 0, 0, 1, 1}, {&__pyx_n_s_firebrick4, __pyx_k_firebrick4, sizeof(__pyx_k_firebrick4), 0, 0, 1, 1}, {&__pyx_n_s_floordiv___locals_div, __pyx_k_floordiv___locals_div, sizeof(__pyx_k_floordiv___locals_div), 0, 0, 1, 1}, {&__pyx_n_s_floralwhite, __pyx_k_floralwhite, sizeof(__pyx_k_floralwhite), 0, 0, 1, 1}, {&__pyx_n_s_forestgreen, __pyx_k_forestgreen, sizeof(__pyx_k_forestgreen), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_gainsboro, __pyx_k_gainsboro, sizeof(__pyx_k_gainsboro), 0, 0, 1, 1}, {&__pyx_n_s_gamma, __pyx_k_gamma, sizeof(__pyx_k_gamma), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_ghostwhite, __pyx_k_ghostwhite, sizeof(__pyx_k_ghostwhite), 0, 0, 1, 1}, {&__pyx_n_s_gold, __pyx_k_gold, sizeof(__pyx_k_gold), 0, 0, 1, 1}, {&__pyx_n_s_gold1, __pyx_k_gold1, sizeof(__pyx_k_gold1), 0, 0, 1, 1}, {&__pyx_n_s_gold2, __pyx_k_gold2, sizeof(__pyx_k_gold2), 0, 0, 1, 1}, {&__pyx_n_s_gold3, __pyx_k_gold3, sizeof(__pyx_k_gold3), 0, 0, 1, 1}, {&__pyx_n_s_gold4, __pyx_k_gold4, sizeof(__pyx_k_gold4), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod, __pyx_k_goldenrod, sizeof(__pyx_k_goldenrod), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod1, __pyx_k_goldenrod1, sizeof(__pyx_k_goldenrod1), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod2, __pyx_k_goldenrod2, sizeof(__pyx_k_goldenrod2), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod3, __pyx_k_goldenrod3, sizeof(__pyx_k_goldenrod3), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod4, __pyx_k_goldenrod4, sizeof(__pyx_k_goldenrod4), 0, 0, 1, 1}, {&__pyx_n_s_gray, __pyx_k_gray, sizeof(__pyx_k_gray), 0, 0, 1, 1}, {&__pyx_n_s_gray0, __pyx_k_gray0, sizeof(__pyx_k_gray0), 0, 0, 1, 1}, {&__pyx_n_s_gray1, __pyx_k_gray1, sizeof(__pyx_k_gray1), 0, 0, 1, 1}, {&__pyx_n_s_gray10, __pyx_k_gray10, sizeof(__pyx_k_gray10), 0, 0, 1, 1}, {&__pyx_n_s_gray100, __pyx_k_gray100, sizeof(__pyx_k_gray100), 0, 0, 1, 1}, {&__pyx_n_s_gray11, __pyx_k_gray11, sizeof(__pyx_k_gray11), 0, 0, 1, 1}, {&__pyx_n_s_gray12, __pyx_k_gray12, sizeof(__pyx_k_gray12), 0, 0, 1, 1}, {&__pyx_n_s_gray13, __pyx_k_gray13, sizeof(__pyx_k_gray13), 0, 0, 1, 1}, {&__pyx_n_s_gray14, __pyx_k_gray14, sizeof(__pyx_k_gray14), 0, 0, 1, 1}, {&__pyx_n_s_gray15, __pyx_k_gray15, sizeof(__pyx_k_gray15), 0, 0, 1, 1}, {&__pyx_n_s_gray16, __pyx_k_gray16, sizeof(__pyx_k_gray16), 0, 0, 1, 1}, {&__pyx_n_s_gray17, __pyx_k_gray17, sizeof(__pyx_k_gray17), 0, 0, 1, 1}, {&__pyx_n_s_gray18, __pyx_k_gray18, sizeof(__pyx_k_gray18), 0, 0, 1, 1}, {&__pyx_n_s_gray19, __pyx_k_gray19, sizeof(__pyx_k_gray19), 0, 0, 1, 1}, {&__pyx_n_s_gray2, __pyx_k_gray2, sizeof(__pyx_k_gray2), 0, 0, 1, 1}, {&__pyx_n_s_gray20, __pyx_k_gray20, sizeof(__pyx_k_gray20), 0, 0, 1, 1}, {&__pyx_n_s_gray21, __pyx_k_gray21, sizeof(__pyx_k_gray21), 0, 0, 1, 1}, {&__pyx_n_s_gray22, __pyx_k_gray22, sizeof(__pyx_k_gray22), 0, 0, 1, 1}, {&__pyx_n_s_gray23, __pyx_k_gray23, sizeof(__pyx_k_gray23), 0, 0, 1, 1}, {&__pyx_n_s_gray24, __pyx_k_gray24, sizeof(__pyx_k_gray24), 0, 0, 1, 1}, {&__pyx_n_s_gray25, __pyx_k_gray25, sizeof(__pyx_k_gray25), 0, 0, 1, 1}, {&__pyx_n_s_gray26, __pyx_k_gray26, sizeof(__pyx_k_gray26), 0, 0, 1, 1}, {&__pyx_n_s_gray27, __pyx_k_gray27, sizeof(__pyx_k_gray27), 0, 0, 1, 1}, {&__pyx_n_s_gray28, __pyx_k_gray28, sizeof(__pyx_k_gray28), 0, 0, 1, 1}, {&__pyx_n_s_gray29, __pyx_k_gray29, sizeof(__pyx_k_gray29), 0, 0, 1, 1}, {&__pyx_n_s_gray3, __pyx_k_gray3, sizeof(__pyx_k_gray3), 0, 0, 1, 1}, {&__pyx_n_s_gray30, __pyx_k_gray30, sizeof(__pyx_k_gray30), 0, 0, 1, 1}, {&__pyx_n_s_gray31, __pyx_k_gray31, sizeof(__pyx_k_gray31), 0, 0, 1, 1}, {&__pyx_n_s_gray32, __pyx_k_gray32, sizeof(__pyx_k_gray32), 0, 0, 1, 1}, {&__pyx_n_s_gray33, __pyx_k_gray33, sizeof(__pyx_k_gray33), 0, 0, 1, 1}, {&__pyx_n_s_gray34, __pyx_k_gray34, sizeof(__pyx_k_gray34), 0, 0, 1, 1}, {&__pyx_n_s_gray35, __pyx_k_gray35, sizeof(__pyx_k_gray35), 0, 0, 1, 1}, {&__pyx_n_s_gray36, __pyx_k_gray36, sizeof(__pyx_k_gray36), 0, 0, 1, 1}, {&__pyx_n_s_gray37, __pyx_k_gray37, sizeof(__pyx_k_gray37), 0, 0, 1, 1}, {&__pyx_n_s_gray38, __pyx_k_gray38, sizeof(__pyx_k_gray38), 0, 0, 1, 1}, {&__pyx_n_s_gray39, __pyx_k_gray39, sizeof(__pyx_k_gray39), 0, 0, 1, 1}, {&__pyx_n_s_gray4, __pyx_k_gray4, sizeof(__pyx_k_gray4), 0, 0, 1, 1}, {&__pyx_n_s_gray40, __pyx_k_gray40, sizeof(__pyx_k_gray40), 0, 0, 1, 1}, {&__pyx_n_s_gray41, __pyx_k_gray41, sizeof(__pyx_k_gray41), 0, 0, 1, 1}, {&__pyx_n_s_gray42, __pyx_k_gray42, sizeof(__pyx_k_gray42), 0, 0, 1, 1}, {&__pyx_n_s_gray43, __pyx_k_gray43, sizeof(__pyx_k_gray43), 0, 0, 1, 1}, {&__pyx_n_s_gray44, __pyx_k_gray44, sizeof(__pyx_k_gray44), 0, 0, 1, 1}, {&__pyx_n_s_gray45, __pyx_k_gray45, sizeof(__pyx_k_gray45), 0, 0, 1, 1}, {&__pyx_n_s_gray46, __pyx_k_gray46, sizeof(__pyx_k_gray46), 0, 0, 1, 1}, {&__pyx_n_s_gray47, __pyx_k_gray47, sizeof(__pyx_k_gray47), 0, 0, 1, 1}, {&__pyx_n_s_gray48, __pyx_k_gray48, sizeof(__pyx_k_gray48), 0, 0, 1, 1}, {&__pyx_n_s_gray49, __pyx_k_gray49, sizeof(__pyx_k_gray49), 0, 0, 1, 1}, {&__pyx_n_s_gray5, __pyx_k_gray5, sizeof(__pyx_k_gray5), 0, 0, 1, 1}, {&__pyx_n_s_gray50, __pyx_k_gray50, sizeof(__pyx_k_gray50), 0, 0, 1, 1}, {&__pyx_n_s_gray51, __pyx_k_gray51, sizeof(__pyx_k_gray51), 0, 0, 1, 1}, {&__pyx_n_s_gray52, __pyx_k_gray52, sizeof(__pyx_k_gray52), 0, 0, 1, 1}, {&__pyx_n_s_gray53, __pyx_k_gray53, sizeof(__pyx_k_gray53), 0, 0, 1, 1}, {&__pyx_n_s_gray54, __pyx_k_gray54, sizeof(__pyx_k_gray54), 0, 0, 1, 1}, {&__pyx_n_s_gray55, __pyx_k_gray55, sizeof(__pyx_k_gray55), 0, 0, 1, 1}, {&__pyx_n_s_gray56, __pyx_k_gray56, sizeof(__pyx_k_gray56), 0, 0, 1, 1}, {&__pyx_n_s_gray57, __pyx_k_gray57, sizeof(__pyx_k_gray57), 0, 0, 1, 1}, {&__pyx_n_s_gray58, __pyx_k_gray58, sizeof(__pyx_k_gray58), 0, 0, 1, 1}, {&__pyx_n_s_gray59, __pyx_k_gray59, sizeof(__pyx_k_gray59), 0, 0, 1, 1}, {&__pyx_n_s_gray6, __pyx_k_gray6, sizeof(__pyx_k_gray6), 0, 0, 1, 1}, {&__pyx_n_s_gray60, __pyx_k_gray60, sizeof(__pyx_k_gray60), 0, 0, 1, 1}, {&__pyx_n_s_gray61, __pyx_k_gray61, sizeof(__pyx_k_gray61), 0, 0, 1, 1}, {&__pyx_n_s_gray62, __pyx_k_gray62, sizeof(__pyx_k_gray62), 0, 0, 1, 1}, {&__pyx_n_s_gray63, __pyx_k_gray63, sizeof(__pyx_k_gray63), 0, 0, 1, 1}, {&__pyx_n_s_gray64, __pyx_k_gray64, sizeof(__pyx_k_gray64), 0, 0, 1, 1}, {&__pyx_n_s_gray65, __pyx_k_gray65, sizeof(__pyx_k_gray65), 0, 0, 1, 1}, {&__pyx_n_s_gray66, __pyx_k_gray66, sizeof(__pyx_k_gray66), 0, 0, 1, 1}, {&__pyx_n_s_gray67, __pyx_k_gray67, sizeof(__pyx_k_gray67), 0, 0, 1, 1}, {&__pyx_n_s_gray68, __pyx_k_gray68, sizeof(__pyx_k_gray68), 0, 0, 1, 1}, {&__pyx_n_s_gray69, __pyx_k_gray69, sizeof(__pyx_k_gray69), 0, 0, 1, 1}, {&__pyx_n_s_gray7, __pyx_k_gray7, sizeof(__pyx_k_gray7), 0, 0, 1, 1}, {&__pyx_n_s_gray70, __pyx_k_gray70, sizeof(__pyx_k_gray70), 0, 0, 1, 1}, {&__pyx_n_s_gray71, __pyx_k_gray71, sizeof(__pyx_k_gray71), 0, 0, 1, 1}, {&__pyx_n_s_gray72, __pyx_k_gray72, sizeof(__pyx_k_gray72), 0, 0, 1, 1}, {&__pyx_n_s_gray73, __pyx_k_gray73, sizeof(__pyx_k_gray73), 0, 0, 1, 1}, {&__pyx_n_s_gray74, __pyx_k_gray74, sizeof(__pyx_k_gray74), 0, 0, 1, 1}, {&__pyx_n_s_gray75, __pyx_k_gray75, sizeof(__pyx_k_gray75), 0, 0, 1, 1}, {&__pyx_n_s_gray76, __pyx_k_gray76, sizeof(__pyx_k_gray76), 0, 0, 1, 1}, {&__pyx_n_s_gray77, __pyx_k_gray77, sizeof(__pyx_k_gray77), 0, 0, 1, 1}, {&__pyx_n_s_gray78, __pyx_k_gray78, sizeof(__pyx_k_gray78), 0, 0, 1, 1}, {&__pyx_n_s_gray79, __pyx_k_gray79, sizeof(__pyx_k_gray79), 0, 0, 1, 1}, {&__pyx_n_s_gray8, __pyx_k_gray8, sizeof(__pyx_k_gray8), 0, 0, 1, 1}, {&__pyx_n_s_gray80, __pyx_k_gray80, sizeof(__pyx_k_gray80), 0, 0, 1, 1}, {&__pyx_n_s_gray81, __pyx_k_gray81, sizeof(__pyx_k_gray81), 0, 0, 1, 1}, {&__pyx_n_s_gray82, __pyx_k_gray82, sizeof(__pyx_k_gray82), 0, 0, 1, 1}, {&__pyx_n_s_gray83, __pyx_k_gray83, sizeof(__pyx_k_gray83), 0, 0, 1, 1}, {&__pyx_n_s_gray84, __pyx_k_gray84, sizeof(__pyx_k_gray84), 0, 0, 1, 1}, {&__pyx_n_s_gray85, __pyx_k_gray85, sizeof(__pyx_k_gray85), 0, 0, 1, 1}, {&__pyx_n_s_gray86, __pyx_k_gray86, sizeof(__pyx_k_gray86), 0, 0, 1, 1}, {&__pyx_n_s_gray87, __pyx_k_gray87, sizeof(__pyx_k_gray87), 0, 0, 1, 1}, {&__pyx_n_s_gray88, __pyx_k_gray88, sizeof(__pyx_k_gray88), 0, 0, 1, 1}, {&__pyx_n_s_gray89, __pyx_k_gray89, sizeof(__pyx_k_gray89), 0, 0, 1, 1}, {&__pyx_n_s_gray9, __pyx_k_gray9, sizeof(__pyx_k_gray9), 0, 0, 1, 1}, {&__pyx_n_s_gray90, __pyx_k_gray90, sizeof(__pyx_k_gray90), 0, 0, 1, 1}, {&__pyx_n_s_gray91, __pyx_k_gray91, sizeof(__pyx_k_gray91), 0, 0, 1, 1}, {&__pyx_n_s_gray92, __pyx_k_gray92, sizeof(__pyx_k_gray92), 0, 0, 1, 1}, {&__pyx_n_s_gray93, __pyx_k_gray93, sizeof(__pyx_k_gray93), 0, 0, 1, 1}, {&__pyx_n_s_gray94, __pyx_k_gray94, sizeof(__pyx_k_gray94), 0, 0, 1, 1}, {&__pyx_n_s_gray95, __pyx_k_gray95, sizeof(__pyx_k_gray95), 0, 0, 1, 1}, {&__pyx_n_s_gray96, __pyx_k_gray96, sizeof(__pyx_k_gray96), 0, 0, 1, 1}, {&__pyx_n_s_gray97, __pyx_k_gray97, sizeof(__pyx_k_gray97), 0, 0, 1, 1}, {&__pyx_n_s_gray98, __pyx_k_gray98, sizeof(__pyx_k_gray98), 0, 0, 1, 1}, {&__pyx_n_s_gray99, __pyx_k_gray99, sizeof(__pyx_k_gray99), 0, 0, 1, 1}, {&__pyx_n_s_green, __pyx_k_green, sizeof(__pyx_k_green), 0, 0, 1, 1}, {&__pyx_n_s_green1, __pyx_k_green1, sizeof(__pyx_k_green1), 0, 0, 1, 1}, {&__pyx_n_s_green2, __pyx_k_green2, sizeof(__pyx_k_green2), 0, 0, 1, 1}, {&__pyx_n_s_green3, __pyx_k_green3, sizeof(__pyx_k_green3), 0, 0, 1, 1}, {&__pyx_n_s_green4, __pyx_k_green4, sizeof(__pyx_k_green4), 0, 0, 1, 1}, {&__pyx_n_s_greenyellow, __pyx_k_greenyellow, sizeof(__pyx_k_greenyellow), 0, 0, 1, 1}, {&__pyx_n_s_grey, __pyx_k_grey, sizeof(__pyx_k_grey), 0, 0, 1, 1}, {&__pyx_n_s_grey0, __pyx_k_grey0, sizeof(__pyx_k_grey0), 0, 0, 1, 1}, {&__pyx_n_s_grey1, __pyx_k_grey1, sizeof(__pyx_k_grey1), 0, 0, 1, 1}, {&__pyx_n_s_grey10, __pyx_k_grey10, sizeof(__pyx_k_grey10), 0, 0, 1, 1}, {&__pyx_n_s_grey100, __pyx_k_grey100, sizeof(__pyx_k_grey100), 0, 0, 1, 1}, {&__pyx_n_s_grey11, __pyx_k_grey11, sizeof(__pyx_k_grey11), 0, 0, 1, 1}, {&__pyx_n_s_grey12, __pyx_k_grey12, sizeof(__pyx_k_grey12), 0, 0, 1, 1}, {&__pyx_n_s_grey13, __pyx_k_grey13, sizeof(__pyx_k_grey13), 0, 0, 1, 1}, {&__pyx_n_s_grey14, __pyx_k_grey14, sizeof(__pyx_k_grey14), 0, 0, 1, 1}, {&__pyx_n_s_grey15, __pyx_k_grey15, sizeof(__pyx_k_grey15), 0, 0, 1, 1}, {&__pyx_n_s_grey16, __pyx_k_grey16, sizeof(__pyx_k_grey16), 0, 0, 1, 1}, {&__pyx_n_s_grey17, __pyx_k_grey17, sizeof(__pyx_k_grey17), 0, 0, 1, 1}, {&__pyx_n_s_grey18, __pyx_k_grey18, sizeof(__pyx_k_grey18), 0, 0, 1, 1}, {&__pyx_n_s_grey19, __pyx_k_grey19, sizeof(__pyx_k_grey19), 0, 0, 1, 1}, {&__pyx_n_s_grey2, __pyx_k_grey2, sizeof(__pyx_k_grey2), 0, 0, 1, 1}, {&__pyx_n_s_grey20, __pyx_k_grey20, sizeof(__pyx_k_grey20), 0, 0, 1, 1}, {&__pyx_n_s_grey21, __pyx_k_grey21, sizeof(__pyx_k_grey21), 0, 0, 1, 1}, {&__pyx_n_s_grey22, __pyx_k_grey22, sizeof(__pyx_k_grey22), 0, 0, 1, 1}, {&__pyx_n_s_grey23, __pyx_k_grey23, sizeof(__pyx_k_grey23), 0, 0, 1, 1}, {&__pyx_n_s_grey24, __pyx_k_grey24, sizeof(__pyx_k_grey24), 0, 0, 1, 1}, {&__pyx_n_s_grey25, __pyx_k_grey25, sizeof(__pyx_k_grey25), 0, 0, 1, 1}, {&__pyx_n_s_grey26, __pyx_k_grey26, sizeof(__pyx_k_grey26), 0, 0, 1, 1}, {&__pyx_n_s_grey27, __pyx_k_grey27, sizeof(__pyx_k_grey27), 0, 0, 1, 1}, {&__pyx_n_s_grey28, __pyx_k_grey28, sizeof(__pyx_k_grey28), 0, 0, 1, 1}, {&__pyx_n_s_grey29, __pyx_k_grey29, sizeof(__pyx_k_grey29), 0, 0, 1, 1}, {&__pyx_n_s_grey3, __pyx_k_grey3, sizeof(__pyx_k_grey3), 0, 0, 1, 1}, {&__pyx_n_s_grey30, __pyx_k_grey30, sizeof(__pyx_k_grey30), 0, 0, 1, 1}, {&__pyx_n_s_grey31, __pyx_k_grey31, sizeof(__pyx_k_grey31), 0, 0, 1, 1}, {&__pyx_n_s_grey32, __pyx_k_grey32, sizeof(__pyx_k_grey32), 0, 0, 1, 1}, {&__pyx_n_s_grey33, __pyx_k_grey33, sizeof(__pyx_k_grey33), 0, 0, 1, 1}, {&__pyx_n_s_grey34, __pyx_k_grey34, sizeof(__pyx_k_grey34), 0, 0, 1, 1}, {&__pyx_n_s_grey35, __pyx_k_grey35, sizeof(__pyx_k_grey35), 0, 0, 1, 1}, {&__pyx_n_s_grey36, __pyx_k_grey36, sizeof(__pyx_k_grey36), 0, 0, 1, 1}, {&__pyx_n_s_grey37, __pyx_k_grey37, sizeof(__pyx_k_grey37), 0, 0, 1, 1}, {&__pyx_n_s_grey38, __pyx_k_grey38, sizeof(__pyx_k_grey38), 0, 0, 1, 1}, {&__pyx_n_s_grey39, __pyx_k_grey39, sizeof(__pyx_k_grey39), 0, 0, 1, 1}, {&__pyx_n_s_grey4, __pyx_k_grey4, sizeof(__pyx_k_grey4), 0, 0, 1, 1}, {&__pyx_n_s_grey40, __pyx_k_grey40, sizeof(__pyx_k_grey40), 0, 0, 1, 1}, {&__pyx_n_s_grey41, __pyx_k_grey41, sizeof(__pyx_k_grey41), 0, 0, 1, 1}, {&__pyx_n_s_grey42, __pyx_k_grey42, sizeof(__pyx_k_grey42), 0, 0, 1, 1}, {&__pyx_n_s_grey43, __pyx_k_grey43, sizeof(__pyx_k_grey43), 0, 0, 1, 1}, {&__pyx_n_s_grey44, __pyx_k_grey44, sizeof(__pyx_k_grey44), 0, 0, 1, 1}, {&__pyx_n_s_grey45, __pyx_k_grey45, sizeof(__pyx_k_grey45), 0, 0, 1, 1}, {&__pyx_n_s_grey46, __pyx_k_grey46, sizeof(__pyx_k_grey46), 0, 0, 1, 1}, {&__pyx_n_s_grey47, __pyx_k_grey47, sizeof(__pyx_k_grey47), 0, 0, 1, 1}, {&__pyx_n_s_grey48, __pyx_k_grey48, sizeof(__pyx_k_grey48), 0, 0, 1, 1}, {&__pyx_n_s_grey49, __pyx_k_grey49, sizeof(__pyx_k_grey49), 0, 0, 1, 1}, {&__pyx_n_s_grey5, __pyx_k_grey5, sizeof(__pyx_k_grey5), 0, 0, 1, 1}, {&__pyx_n_s_grey50, __pyx_k_grey50, sizeof(__pyx_k_grey50), 0, 0, 1, 1}, {&__pyx_n_s_grey51, __pyx_k_grey51, sizeof(__pyx_k_grey51), 0, 0, 1, 1}, {&__pyx_n_s_grey52, __pyx_k_grey52, sizeof(__pyx_k_grey52), 0, 0, 1, 1}, {&__pyx_n_s_grey53, __pyx_k_grey53, sizeof(__pyx_k_grey53), 0, 0, 1, 1}, {&__pyx_n_s_grey54, __pyx_k_grey54, sizeof(__pyx_k_grey54), 0, 0, 1, 1}, {&__pyx_n_s_grey55, __pyx_k_grey55, sizeof(__pyx_k_grey55), 0, 0, 1, 1}, {&__pyx_n_s_grey56, __pyx_k_grey56, sizeof(__pyx_k_grey56), 0, 0, 1, 1}, {&__pyx_n_s_grey57, __pyx_k_grey57, sizeof(__pyx_k_grey57), 0, 0, 1, 1}, {&__pyx_n_s_grey58, __pyx_k_grey58, sizeof(__pyx_k_grey58), 0, 0, 1, 1}, {&__pyx_n_s_grey59, __pyx_k_grey59, sizeof(__pyx_k_grey59), 0, 0, 1, 1}, {&__pyx_n_s_grey6, __pyx_k_grey6, sizeof(__pyx_k_grey6), 0, 0, 1, 1}, {&__pyx_n_s_grey60, __pyx_k_grey60, sizeof(__pyx_k_grey60), 0, 0, 1, 1}, {&__pyx_n_s_grey61, __pyx_k_grey61, sizeof(__pyx_k_grey61), 0, 0, 1, 1}, {&__pyx_n_s_grey62, __pyx_k_grey62, sizeof(__pyx_k_grey62), 0, 0, 1, 1}, {&__pyx_n_s_grey63, __pyx_k_grey63, sizeof(__pyx_k_grey63), 0, 0, 1, 1}, {&__pyx_n_s_grey64, __pyx_k_grey64, sizeof(__pyx_k_grey64), 0, 0, 1, 1}, {&__pyx_n_s_grey65, __pyx_k_grey65, sizeof(__pyx_k_grey65), 0, 0, 1, 1}, {&__pyx_n_s_grey66, __pyx_k_grey66, sizeof(__pyx_k_grey66), 0, 0, 1, 1}, {&__pyx_n_s_grey67, __pyx_k_grey67, sizeof(__pyx_k_grey67), 0, 0, 1, 1}, {&__pyx_n_s_grey68, __pyx_k_grey68, sizeof(__pyx_k_grey68), 0, 0, 1, 1}, {&__pyx_n_s_grey69, __pyx_k_grey69, sizeof(__pyx_k_grey69), 0, 0, 1, 1}, {&__pyx_n_s_grey7, __pyx_k_grey7, sizeof(__pyx_k_grey7), 0, 0, 1, 1}, {&__pyx_n_s_grey70, __pyx_k_grey70, sizeof(__pyx_k_grey70), 0, 0, 1, 1}, {&__pyx_n_s_grey71, __pyx_k_grey71, sizeof(__pyx_k_grey71), 0, 0, 1, 1}, {&__pyx_n_s_grey72, __pyx_k_grey72, sizeof(__pyx_k_grey72), 0, 0, 1, 1}, {&__pyx_n_s_grey73, __pyx_k_grey73, sizeof(__pyx_k_grey73), 0, 0, 1, 1}, {&__pyx_n_s_grey74, __pyx_k_grey74, sizeof(__pyx_k_grey74), 0, 0, 1, 1}, {&__pyx_n_s_grey75, __pyx_k_grey75, sizeof(__pyx_k_grey75), 0, 0, 1, 1}, {&__pyx_n_s_grey76, __pyx_k_grey76, sizeof(__pyx_k_grey76), 0, 0, 1, 1}, {&__pyx_n_s_grey77, __pyx_k_grey77, sizeof(__pyx_k_grey77), 0, 0, 1, 1}, {&__pyx_n_s_grey78, __pyx_k_grey78, sizeof(__pyx_k_grey78), 0, 0, 1, 1}, {&__pyx_n_s_grey79, __pyx_k_grey79, sizeof(__pyx_k_grey79), 0, 0, 1, 1}, {&__pyx_n_s_grey8, __pyx_k_grey8, sizeof(__pyx_k_grey8), 0, 0, 1, 1}, {&__pyx_n_s_grey80, __pyx_k_grey80, sizeof(__pyx_k_grey80), 0, 0, 1, 1}, {&__pyx_n_s_grey81, __pyx_k_grey81, sizeof(__pyx_k_grey81), 0, 0, 1, 1}, {&__pyx_n_s_grey82, __pyx_k_grey82, sizeof(__pyx_k_grey82), 0, 0, 1, 1}, {&__pyx_n_s_grey83, __pyx_k_grey83, sizeof(__pyx_k_grey83), 0, 0, 1, 1}, {&__pyx_n_s_grey84, __pyx_k_grey84, sizeof(__pyx_k_grey84), 0, 0, 1, 1}, {&__pyx_n_s_grey85, __pyx_k_grey85, sizeof(__pyx_k_grey85), 0, 0, 1, 1}, {&__pyx_n_s_grey86, __pyx_k_grey86, sizeof(__pyx_k_grey86), 0, 0, 1, 1}, {&__pyx_n_s_grey87, __pyx_k_grey87, sizeof(__pyx_k_grey87), 0, 0, 1, 1}, {&__pyx_n_s_grey88, __pyx_k_grey88, sizeof(__pyx_k_grey88), 0, 0, 1, 1}, {&__pyx_n_s_grey89, __pyx_k_grey89, sizeof(__pyx_k_grey89), 0, 0, 1, 1}, {&__pyx_n_s_grey9, __pyx_k_grey9, sizeof(__pyx_k_grey9), 0, 0, 1, 1}, {&__pyx_n_s_grey90, __pyx_k_grey90, sizeof(__pyx_k_grey90), 0, 0, 1, 1}, {&__pyx_n_s_grey91, __pyx_k_grey91, sizeof(__pyx_k_grey91), 0, 0, 1, 1}, {&__pyx_n_s_grey92, __pyx_k_grey92, sizeof(__pyx_k_grey92), 0, 0, 1, 1}, {&__pyx_n_s_grey93, __pyx_k_grey93, sizeof(__pyx_k_grey93), 0, 0, 1, 1}, {&__pyx_n_s_grey94, __pyx_k_grey94, sizeof(__pyx_k_grey94), 0, 0, 1, 1}, {&__pyx_n_s_grey95, __pyx_k_grey95, sizeof(__pyx_k_grey95), 0, 0, 1, 1}, {&__pyx_n_s_grey96, __pyx_k_grey96, sizeof(__pyx_k_grey96), 0, 0, 1, 1}, {&__pyx_n_s_grey97, __pyx_k_grey97, sizeof(__pyx_k_grey97), 0, 0, 1, 1}, {&__pyx_n_s_grey98, __pyx_k_grey98, sizeof(__pyx_k_grey98), 0, 0, 1, 1}, {&__pyx_n_s_grey99, __pyx_k_grey99, sizeof(__pyx_k_grey99), 0, 0, 1, 1}, {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, {&__pyx_n_s_honeydew, __pyx_k_honeydew, sizeof(__pyx_k_honeydew), 0, 0, 1, 1}, {&__pyx_n_s_honeydew1, __pyx_k_honeydew1, sizeof(__pyx_k_honeydew1), 0, 0, 1, 1}, {&__pyx_n_s_honeydew2, __pyx_k_honeydew2, sizeof(__pyx_k_honeydew2), 0, 0, 1, 1}, {&__pyx_n_s_honeydew3, __pyx_k_honeydew3, sizeof(__pyx_k_honeydew3), 0, 0, 1, 1}, {&__pyx_n_s_honeydew4, __pyx_k_honeydew4, sizeof(__pyx_k_honeydew4), 0, 0, 1, 1}, {&__pyx_n_s_hotpink, __pyx_k_hotpink, sizeof(__pyx_k_hotpink), 0, 0, 1, 1}, {&__pyx_n_s_hotpink1, __pyx_k_hotpink1, sizeof(__pyx_k_hotpink1), 0, 0, 1, 1}, {&__pyx_n_s_hotpink2, __pyx_k_hotpink2, sizeof(__pyx_k_hotpink2), 0, 0, 1, 1}, {&__pyx_n_s_hotpink3, __pyx_k_hotpink3, sizeof(__pyx_k_hotpink3), 0, 0, 1, 1}, {&__pyx_n_s_hotpink4, __pyx_k_hotpink4, sizeof(__pyx_k_hotpink4), 0, 0, 1, 1}, {&__pyx_n_s_hsva, __pyx_k_hsva, sizeof(__pyx_k_hsva), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_indianred, __pyx_k_indianred, sizeof(__pyx_k_indianred), 0, 0, 1, 1}, {&__pyx_n_s_indianred1, __pyx_k_indianred1, sizeof(__pyx_k_indianred1), 0, 0, 1, 1}, {&__pyx_n_s_indianred2, __pyx_k_indianred2, sizeof(__pyx_k_indianred2), 0, 0, 1, 1}, {&__pyx_n_s_indianred3, __pyx_k_indianred3, sizeof(__pyx_k_indianred3), 0, 0, 1, 1}, {&__pyx_n_s_indianred4, __pyx_k_indianred4, sizeof(__pyx_k_indianred4), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_ivory, __pyx_k_ivory, sizeof(__pyx_k_ivory), 0, 0, 1, 1}, {&__pyx_n_s_ivory1, __pyx_k_ivory1, sizeof(__pyx_k_ivory1), 0, 0, 1, 1}, {&__pyx_n_s_ivory2, __pyx_k_ivory2, sizeof(__pyx_k_ivory2), 0, 0, 1, 1}, {&__pyx_n_s_ivory3, __pyx_k_ivory3, sizeof(__pyx_k_ivory3), 0, 0, 1, 1}, {&__pyx_n_s_ivory4, __pyx_k_ivory4, sizeof(__pyx_k_ivory4), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_khaki, __pyx_k_khaki, sizeof(__pyx_k_khaki), 0, 0, 1, 1}, {&__pyx_n_s_khaki1, __pyx_k_khaki1, sizeof(__pyx_k_khaki1), 0, 0, 1, 1}, {&__pyx_n_s_khaki2, __pyx_k_khaki2, sizeof(__pyx_k_khaki2), 0, 0, 1, 1}, {&__pyx_n_s_khaki3, __pyx_k_khaki3, sizeof(__pyx_k_khaki3), 0, 0, 1, 1}, {&__pyx_n_s_khaki4, __pyx_k_khaki4, sizeof(__pyx_k_khaki4), 0, 0, 1, 1}, {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1}, {&__pyx_n_s_lavender, __pyx_k_lavender, sizeof(__pyx_k_lavender), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush, __pyx_k_lavenderblush, sizeof(__pyx_k_lavenderblush), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush1, __pyx_k_lavenderblush1, sizeof(__pyx_k_lavenderblush1), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush2, __pyx_k_lavenderblush2, sizeof(__pyx_k_lavenderblush2), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush3, __pyx_k_lavenderblush3, sizeof(__pyx_k_lavenderblush3), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush4, __pyx_k_lavenderblush4, sizeof(__pyx_k_lavenderblush4), 0, 0, 1, 1}, {&__pyx_n_s_lawngreen, __pyx_k_lawngreen, sizeof(__pyx_k_lawngreen), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon, __pyx_k_lemonchiffon, sizeof(__pyx_k_lemonchiffon), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon1, __pyx_k_lemonchiffon1, sizeof(__pyx_k_lemonchiffon1), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon2, __pyx_k_lemonchiffon2, sizeof(__pyx_k_lemonchiffon2), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon3, __pyx_k_lemonchiffon3, sizeof(__pyx_k_lemonchiffon3), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon4, __pyx_k_lemonchiffon4, sizeof(__pyx_k_lemonchiffon4), 0, 0, 1, 1}, {&__pyx_n_s_lightblue, __pyx_k_lightblue, sizeof(__pyx_k_lightblue), 0, 0, 1, 1}, {&__pyx_n_s_lightblue1, __pyx_k_lightblue1, sizeof(__pyx_k_lightblue1), 0, 0, 1, 1}, {&__pyx_n_s_lightblue2, __pyx_k_lightblue2, sizeof(__pyx_k_lightblue2), 0, 0, 1, 1}, {&__pyx_n_s_lightblue3, __pyx_k_lightblue3, sizeof(__pyx_k_lightblue3), 0, 0, 1, 1}, {&__pyx_n_s_lightblue4, __pyx_k_lightblue4, sizeof(__pyx_k_lightblue4), 0, 0, 1, 1}, {&__pyx_n_s_lightcoral, __pyx_k_lightcoral, sizeof(__pyx_k_lightcoral), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan, __pyx_k_lightcyan, sizeof(__pyx_k_lightcyan), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan1, __pyx_k_lightcyan1, sizeof(__pyx_k_lightcyan1), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan2, __pyx_k_lightcyan2, sizeof(__pyx_k_lightcyan2), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan3, __pyx_k_lightcyan3, sizeof(__pyx_k_lightcyan3), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan4, __pyx_k_lightcyan4, sizeof(__pyx_k_lightcyan4), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod, __pyx_k_lightgoldenrod, sizeof(__pyx_k_lightgoldenrod), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod1, __pyx_k_lightgoldenrod1, sizeof(__pyx_k_lightgoldenrod1), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod2, __pyx_k_lightgoldenrod2, sizeof(__pyx_k_lightgoldenrod2), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod3, __pyx_k_lightgoldenrod3, sizeof(__pyx_k_lightgoldenrod3), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod4, __pyx_k_lightgoldenrod4, sizeof(__pyx_k_lightgoldenrod4), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrodyellow, __pyx_k_lightgoldenrodyellow, sizeof(__pyx_k_lightgoldenrodyellow), 0, 0, 1, 1}, {&__pyx_n_s_lightgray, __pyx_k_lightgray, sizeof(__pyx_k_lightgray), 0, 0, 1, 1}, {&__pyx_n_s_lightgreen, __pyx_k_lightgreen, sizeof(__pyx_k_lightgreen), 0, 0, 1, 1}, {&__pyx_n_s_lightgrey, __pyx_k_lightgrey, sizeof(__pyx_k_lightgrey), 0, 0, 1, 1}, {&__pyx_n_s_lightpink, __pyx_k_lightpink, sizeof(__pyx_k_lightpink), 0, 0, 1, 1}, {&__pyx_n_s_lightpink1, __pyx_k_lightpink1, sizeof(__pyx_k_lightpink1), 0, 0, 1, 1}, {&__pyx_n_s_lightpink2, __pyx_k_lightpink2, sizeof(__pyx_k_lightpink2), 0, 0, 1, 1}, {&__pyx_n_s_lightpink3, __pyx_k_lightpink3, sizeof(__pyx_k_lightpink3), 0, 0, 1, 1}, {&__pyx_n_s_lightpink4, __pyx_k_lightpink4, sizeof(__pyx_k_lightpink4), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon, __pyx_k_lightsalmon, sizeof(__pyx_k_lightsalmon), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon1, __pyx_k_lightsalmon1, sizeof(__pyx_k_lightsalmon1), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon2, __pyx_k_lightsalmon2, sizeof(__pyx_k_lightsalmon2), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon3, __pyx_k_lightsalmon3, sizeof(__pyx_k_lightsalmon3), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon4, __pyx_k_lightsalmon4, sizeof(__pyx_k_lightsalmon4), 0, 0, 1, 1}, {&__pyx_n_s_lightseagreen, __pyx_k_lightseagreen, sizeof(__pyx_k_lightseagreen), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue, __pyx_k_lightskyblue, sizeof(__pyx_k_lightskyblue), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue1, __pyx_k_lightskyblue1, sizeof(__pyx_k_lightskyblue1), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue2, __pyx_k_lightskyblue2, sizeof(__pyx_k_lightskyblue2), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue3, __pyx_k_lightskyblue3, sizeof(__pyx_k_lightskyblue3), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue4, __pyx_k_lightskyblue4, sizeof(__pyx_k_lightskyblue4), 0, 0, 1, 1}, {&__pyx_n_s_lightslateblue, __pyx_k_lightslateblue, sizeof(__pyx_k_lightslateblue), 0, 0, 1, 1}, {&__pyx_n_s_lightslategray, __pyx_k_lightslategray, sizeof(__pyx_k_lightslategray), 0, 0, 1, 1}, {&__pyx_n_s_lightslategrey, __pyx_k_lightslategrey, sizeof(__pyx_k_lightslategrey), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue, __pyx_k_lightsteelblue, sizeof(__pyx_k_lightsteelblue), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue1, __pyx_k_lightsteelblue1, sizeof(__pyx_k_lightsteelblue1), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue2, __pyx_k_lightsteelblue2, sizeof(__pyx_k_lightsteelblue2), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue3, __pyx_k_lightsteelblue3, sizeof(__pyx_k_lightsteelblue3), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue4, __pyx_k_lightsteelblue4, sizeof(__pyx_k_lightsteelblue4), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow, __pyx_k_lightyellow, sizeof(__pyx_k_lightyellow), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow1, __pyx_k_lightyellow1, sizeof(__pyx_k_lightyellow1), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow2, __pyx_k_lightyellow2, sizeof(__pyx_k_lightyellow2), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow3, __pyx_k_lightyellow3, sizeof(__pyx_k_lightyellow3), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow4, __pyx_k_lightyellow4, sizeof(__pyx_k_lightyellow4), 0, 0, 1, 1}, {&__pyx_n_s_limegreen, __pyx_k_limegreen, sizeof(__pyx_k_limegreen), 0, 0, 1, 1}, {&__pyx_n_s_linen, __pyx_k_linen, sizeof(__pyx_k_linen), 0, 0, 1, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1}, {&__pyx_n_s_magenta, __pyx_k_magenta, sizeof(__pyx_k_magenta), 0, 0, 1, 1}, {&__pyx_n_s_magenta1, __pyx_k_magenta1, sizeof(__pyx_k_magenta1), 0, 0, 1, 1}, {&__pyx_n_s_magenta2, __pyx_k_magenta2, sizeof(__pyx_k_magenta2), 0, 0, 1, 1}, {&__pyx_n_s_magenta3, __pyx_k_magenta3, sizeof(__pyx_k_magenta3), 0, 0, 1, 1}, {&__pyx_n_s_magenta4, __pyx_k_magenta4, sizeof(__pyx_k_magenta4), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, {&__pyx_n_s_maroon, __pyx_k_maroon, sizeof(__pyx_k_maroon), 0, 0, 1, 1}, {&__pyx_n_s_maroon1, __pyx_k_maroon1, sizeof(__pyx_k_maroon1), 0, 0, 1, 1}, {&__pyx_n_s_maroon2, __pyx_k_maroon2, sizeof(__pyx_k_maroon2), 0, 0, 1, 1}, {&__pyx_n_s_maroon3, __pyx_k_maroon3, sizeof(__pyx_k_maroon3), 0, 0, 1, 1}, {&__pyx_n_s_maroon4, __pyx_k_maroon4, sizeof(__pyx_k_maroon4), 0, 0, 1, 1}, {&__pyx_n_s_mediumaquamarine, __pyx_k_mediumaquamarine, sizeof(__pyx_k_mediumaquamarine), 0, 0, 1, 1}, {&__pyx_n_s_mediumblue, __pyx_k_mediumblue, sizeof(__pyx_k_mediumblue), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid, __pyx_k_mediumorchid, sizeof(__pyx_k_mediumorchid), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid1, __pyx_k_mediumorchid1, sizeof(__pyx_k_mediumorchid1), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid2, __pyx_k_mediumorchid2, sizeof(__pyx_k_mediumorchid2), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid3, __pyx_k_mediumorchid3, sizeof(__pyx_k_mediumorchid3), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid4, __pyx_k_mediumorchid4, sizeof(__pyx_k_mediumorchid4), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple, __pyx_k_mediumpurple, sizeof(__pyx_k_mediumpurple), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple1, __pyx_k_mediumpurple1, sizeof(__pyx_k_mediumpurple1), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple2, __pyx_k_mediumpurple2, sizeof(__pyx_k_mediumpurple2), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple3, __pyx_k_mediumpurple3, sizeof(__pyx_k_mediumpurple3), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple4, __pyx_k_mediumpurple4, sizeof(__pyx_k_mediumpurple4), 0, 0, 1, 1}, {&__pyx_n_s_mediumseagreen, __pyx_k_mediumseagreen, sizeof(__pyx_k_mediumseagreen), 0, 0, 1, 1}, {&__pyx_n_s_mediumslateblue, __pyx_k_mediumslateblue, sizeof(__pyx_k_mediumslateblue), 0, 0, 1, 1}, {&__pyx_n_s_mediumspringgreen, __pyx_k_mediumspringgreen, sizeof(__pyx_k_mediumspringgreen), 0, 0, 1, 1}, {&__pyx_n_s_mediumturquoise, __pyx_k_mediumturquoise, sizeof(__pyx_k_mediumturquoise), 0, 0, 1, 1}, {&__pyx_n_s_mediumvioletred, __pyx_k_mediumvioletred, sizeof(__pyx_k_mediumvioletred), 0, 0, 1, 1}, {&__pyx_n_s_midnightblue, __pyx_k_midnightblue, sizeof(__pyx_k_midnightblue), 0, 0, 1, 1}, {&__pyx_n_s_mintcream, __pyx_k_mintcream, sizeof(__pyx_k_mintcream), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose, __pyx_k_mistyrose, sizeof(__pyx_k_mistyrose), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose1, __pyx_k_mistyrose1, sizeof(__pyx_k_mistyrose1), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose2, __pyx_k_mistyrose2, sizeof(__pyx_k_mistyrose2), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose3, __pyx_k_mistyrose3, sizeof(__pyx_k_mistyrose3), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose4, __pyx_k_mistyrose4, sizeof(__pyx_k_mistyrose4), 0, 0, 1, 1}, {&__pyx_n_s_moccasin, __pyx_k_moccasin, sizeof(__pyx_k_moccasin), 0, 0, 1, 1}, {&__pyx_n_s_mod, __pyx_k_mod, sizeof(__pyx_k_mod), 0, 0, 1, 1}, {&__pyx_n_s_mod___locals_mod, __pyx_k_mod___locals_mod, sizeof(__pyx_k_mod___locals_mod), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite, __pyx_k_navajowhite, sizeof(__pyx_k_navajowhite), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite1, __pyx_k_navajowhite1, sizeof(__pyx_k_navajowhite1), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite2, __pyx_k_navajowhite2, sizeof(__pyx_k_navajowhite2), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite3, __pyx_k_navajowhite3, sizeof(__pyx_k_navajowhite3), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite4, __pyx_k_navajowhite4, sizeof(__pyx_k_navajowhite4), 0, 0, 1, 1}, {&__pyx_n_s_navy, __pyx_k_navy, sizeof(__pyx_k_navy), 0, 0, 1, 1}, {&__pyx_n_s_navyblue, __pyx_k_navyblue, sizeof(__pyx_k_navyblue), 0, 0, 1, 1}, {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1}, {&__pyx_n_s_oct, __pyx_k_oct, sizeof(__pyx_k_oct), 0, 0, 1, 1}, {&__pyx_n_s_oldlace, __pyx_k_oldlace, sizeof(__pyx_k_oldlace), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab, __pyx_k_olivedrab, sizeof(__pyx_k_olivedrab), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab1, __pyx_k_olivedrab1, sizeof(__pyx_k_olivedrab1), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab2, __pyx_k_olivedrab2, sizeof(__pyx_k_olivedrab2), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab3, __pyx_k_olivedrab3, sizeof(__pyx_k_olivedrab3), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab4, __pyx_k_olivedrab4, sizeof(__pyx_k_olivedrab4), 0, 0, 1, 1}, {&__pyx_n_s_orange, __pyx_k_orange, sizeof(__pyx_k_orange), 0, 0, 1, 1}, {&__pyx_n_s_orange1, __pyx_k_orange1, sizeof(__pyx_k_orange1), 0, 0, 1, 1}, {&__pyx_n_s_orange2, __pyx_k_orange2, sizeof(__pyx_k_orange2), 0, 0, 1, 1}, {&__pyx_n_s_orange3, __pyx_k_orange3, sizeof(__pyx_k_orange3), 0, 0, 1, 1}, {&__pyx_n_s_orange4, __pyx_k_orange4, sizeof(__pyx_k_orange4), 0, 0, 1, 1}, {&__pyx_n_s_orangered, __pyx_k_orangered, sizeof(__pyx_k_orangered), 0, 0, 1, 1}, {&__pyx_n_s_orangered1, __pyx_k_orangered1, sizeof(__pyx_k_orangered1), 0, 0, 1, 1}, {&__pyx_n_s_orangered2, __pyx_k_orangered2, sizeof(__pyx_k_orangered2), 0, 0, 1, 1}, {&__pyx_n_s_orangered3, __pyx_k_orangered3, sizeof(__pyx_k_orangered3), 0, 0, 1, 1}, {&__pyx_n_s_orangered4, __pyx_k_orangered4, sizeof(__pyx_k_orangered4), 0, 0, 1, 1}, {&__pyx_n_s_orchid, __pyx_k_orchid, sizeof(__pyx_k_orchid), 0, 0, 1, 1}, {&__pyx_n_s_orchid1, __pyx_k_orchid1, sizeof(__pyx_k_orchid1), 0, 0, 1, 1}, {&__pyx_n_s_orchid2, __pyx_k_orchid2, sizeof(__pyx_k_orchid2), 0, 0, 1, 1}, {&__pyx_n_s_orchid3, __pyx_k_orchid3, sizeof(__pyx_k_orchid3), 0, 0, 1, 1}, {&__pyx_n_s_orchid4, __pyx_k_orchid4, sizeof(__pyx_k_orchid4), 0, 0, 1, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_palegoldenrod, __pyx_k_palegoldenrod, sizeof(__pyx_k_palegoldenrod), 0, 0, 1, 1}, {&__pyx_n_s_palegreen, __pyx_k_palegreen, sizeof(__pyx_k_palegreen), 0, 0, 1, 1}, {&__pyx_n_s_palegreen1, __pyx_k_palegreen1, sizeof(__pyx_k_palegreen1), 0, 0, 1, 1}, {&__pyx_n_s_palegreen2, __pyx_k_palegreen2, sizeof(__pyx_k_palegreen2), 0, 0, 1, 1}, {&__pyx_n_s_palegreen3, __pyx_k_palegreen3, sizeof(__pyx_k_palegreen3), 0, 0, 1, 1}, {&__pyx_n_s_palegreen4, __pyx_k_palegreen4, sizeof(__pyx_k_palegreen4), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise, __pyx_k_paleturquoise, sizeof(__pyx_k_paleturquoise), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise1, __pyx_k_paleturquoise1, sizeof(__pyx_k_paleturquoise1), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise2, __pyx_k_paleturquoise2, sizeof(__pyx_k_paleturquoise2), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise3, __pyx_k_paleturquoise3, sizeof(__pyx_k_paleturquoise3), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise4, __pyx_k_paleturquoise4, sizeof(__pyx_k_paleturquoise4), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred, __pyx_k_palevioletred, sizeof(__pyx_k_palevioletred), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred1, __pyx_k_palevioletred1, sizeof(__pyx_k_palevioletred1), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred2, __pyx_k_palevioletred2, sizeof(__pyx_k_palevioletred2), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred3, __pyx_k_palevioletred3, sizeof(__pyx_k_palevioletred3), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred4, __pyx_k_palevioletred4, sizeof(__pyx_k_palevioletred4), 0, 0, 1, 1}, {&__pyx_n_s_papayawhip, __pyx_k_papayawhip, sizeof(__pyx_k_papayawhip), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff, __pyx_k_peachpuff, sizeof(__pyx_k_peachpuff), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff1, __pyx_k_peachpuff1, sizeof(__pyx_k_peachpuff1), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff2, __pyx_k_peachpuff2, sizeof(__pyx_k_peachpuff2), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff3, __pyx_k_peachpuff3, sizeof(__pyx_k_peachpuff3), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff4, __pyx_k_peachpuff4, sizeof(__pyx_k_peachpuff4), 0, 0, 1, 1}, {&__pyx_n_s_peru, __pyx_k_peru, sizeof(__pyx_k_peru), 0, 0, 1, 1}, {&__pyx_n_s_pink, __pyx_k_pink, sizeof(__pyx_k_pink), 0, 0, 1, 1}, {&__pyx_n_s_pink1, __pyx_k_pink1, sizeof(__pyx_k_pink1), 0, 0, 1, 1}, {&__pyx_n_s_pink2, __pyx_k_pink2, sizeof(__pyx_k_pink2), 0, 0, 1, 1}, {&__pyx_n_s_pink3, __pyx_k_pink3, sizeof(__pyx_k_pink3), 0, 0, 1, 1}, {&__pyx_n_s_pink4, __pyx_k_pink4, sizeof(__pyx_k_pink4), 0, 0, 1, 1}, {&__pyx_n_s_plum, __pyx_k_plum, sizeof(__pyx_k_plum), 0, 0, 1, 1}, {&__pyx_n_s_plum1, __pyx_k_plum1, sizeof(__pyx_k_plum1), 0, 0, 1, 1}, {&__pyx_n_s_plum2, __pyx_k_plum2, sizeof(__pyx_k_plum2), 0, 0, 1, 1}, {&__pyx_n_s_plum3, __pyx_k_plum3, sizeof(__pyx_k_plum3), 0, 0, 1, 1}, {&__pyx_n_s_plum4, __pyx_k_plum4, sizeof(__pyx_k_plum4), 0, 0, 1, 1}, {&__pyx_n_s_powderblue, __pyx_k_powderblue, sizeof(__pyx_k_powderblue), 0, 0, 1, 1}, {&__pyx_n_s_purple, __pyx_k_purple, sizeof(__pyx_k_purple), 0, 0, 1, 1}, {&__pyx_n_s_purple1, __pyx_k_purple1, sizeof(__pyx_k_purple1), 0, 0, 1, 1}, {&__pyx_n_s_purple2, __pyx_k_purple2, sizeof(__pyx_k_purple2), 0, 0, 1, 1}, {&__pyx_n_s_purple3, __pyx_k_purple3, sizeof(__pyx_k_purple3), 0, 0, 1, 1}, {&__pyx_n_s_purple4, __pyx_k_purple4, sizeof(__pyx_k_purple4), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_red, __pyx_k_red, sizeof(__pyx_k_red), 0, 0, 1, 1}, {&__pyx_n_s_red1, __pyx_k_red1, sizeof(__pyx_k_red1), 0, 0, 1, 1}, {&__pyx_n_s_red2, __pyx_k_red2, sizeof(__pyx_k_red2), 0, 0, 1, 1}, {&__pyx_n_s_red3, __pyx_k_red3, sizeof(__pyx_k_red3), 0, 0, 1, 1}, {&__pyx_n_s_red4, __pyx_k_red4, sizeof(__pyx_k_red4), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_rgba, __pyx_k_rgba, sizeof(__pyx_k_rgba), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown, __pyx_k_rosybrown, sizeof(__pyx_k_rosybrown), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown1, __pyx_k_rosybrown1, sizeof(__pyx_k_rosybrown1), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown2, __pyx_k_rosybrown2, sizeof(__pyx_k_rosybrown2), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown3, __pyx_k_rosybrown3, sizeof(__pyx_k_rosybrown3), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown4, __pyx_k_rosybrown4, sizeof(__pyx_k_rosybrown4), 0, 0, 1, 1}, {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1}, {&__pyx_n_s_royalblue, __pyx_k_royalblue, sizeof(__pyx_k_royalblue), 0, 0, 1, 1}, {&__pyx_n_s_royalblue1, __pyx_k_royalblue1, sizeof(__pyx_k_royalblue1), 0, 0, 1, 1}, {&__pyx_n_s_royalblue2, __pyx_k_royalblue2, sizeof(__pyx_k_royalblue2), 0, 0, 1, 1}, {&__pyx_n_s_royalblue3, __pyx_k_royalblue3, sizeof(__pyx_k_royalblue3), 0, 0, 1, 1}, {&__pyx_n_s_royalblue4, __pyx_k_royalblue4, sizeof(__pyx_k_royalblue4), 0, 0, 1, 1}, {&__pyx_n_s_saddlebrown, __pyx_k_saddlebrown, sizeof(__pyx_k_saddlebrown), 0, 0, 1, 1}, {&__pyx_n_s_salmon, __pyx_k_salmon, sizeof(__pyx_k_salmon), 0, 0, 1, 1}, {&__pyx_n_s_salmon1, __pyx_k_salmon1, sizeof(__pyx_k_salmon1), 0, 0, 1, 1}, {&__pyx_n_s_salmon2, __pyx_k_salmon2, sizeof(__pyx_k_salmon2), 0, 0, 1, 1}, {&__pyx_n_s_salmon3, __pyx_k_salmon3, sizeof(__pyx_k_salmon3), 0, 0, 1, 1}, {&__pyx_n_s_salmon4, __pyx_k_salmon4, sizeof(__pyx_k_salmon4), 0, 0, 1, 1}, {&__pyx_n_s_sandybrown, __pyx_k_sandybrown, sizeof(__pyx_k_sandybrown), 0, 0, 1, 1}, {&__pyx_n_s_seagreen, __pyx_k_seagreen, sizeof(__pyx_k_seagreen), 0, 0, 1, 1}, {&__pyx_n_s_seagreen1, __pyx_k_seagreen1, sizeof(__pyx_k_seagreen1), 0, 0, 1, 1}, {&__pyx_n_s_seagreen2, __pyx_k_seagreen2, sizeof(__pyx_k_seagreen2), 0, 0, 1, 1}, {&__pyx_n_s_seagreen3, __pyx_k_seagreen3, sizeof(__pyx_k_seagreen3), 0, 0, 1, 1}, {&__pyx_n_s_seagreen4, __pyx_k_seagreen4, sizeof(__pyx_k_seagreen4), 0, 0, 1, 1}, {&__pyx_n_s_seashell, __pyx_k_seashell, sizeof(__pyx_k_seashell), 0, 0, 1, 1}, {&__pyx_n_s_seashell1, __pyx_k_seashell1, sizeof(__pyx_k_seashell1), 0, 0, 1, 1}, {&__pyx_n_s_seashell2, __pyx_k_seashell2, sizeof(__pyx_k_seashell2), 0, 0, 1, 1}, {&__pyx_n_s_seashell3, __pyx_k_seashell3, sizeof(__pyx_k_seashell3), 0, 0, 1, 1}, {&__pyx_n_s_seashell4, __pyx_k_seashell4, sizeof(__pyx_k_seashell4), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_length, __pyx_k_set_length, sizeof(__pyx_k_set_length), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_sienna, __pyx_k_sienna, sizeof(__pyx_k_sienna), 0, 0, 1, 1}, {&__pyx_n_s_sienna1, __pyx_k_sienna1, sizeof(__pyx_k_sienna1), 0, 0, 1, 1}, {&__pyx_n_s_sienna2, __pyx_k_sienna2, sizeof(__pyx_k_sienna2), 0, 0, 1, 1}, {&__pyx_n_s_sienna3, __pyx_k_sienna3, sizeof(__pyx_k_sienna3), 0, 0, 1, 1}, {&__pyx_n_s_sienna4, __pyx_k_sienna4, sizeof(__pyx_k_sienna4), 0, 0, 1, 1}, {&__pyx_n_s_skyblue, __pyx_k_skyblue, sizeof(__pyx_k_skyblue), 0, 0, 1, 1}, {&__pyx_n_s_skyblue1, __pyx_k_skyblue1, sizeof(__pyx_k_skyblue1), 0, 0, 1, 1}, {&__pyx_n_s_skyblue2, __pyx_k_skyblue2, sizeof(__pyx_k_skyblue2), 0, 0, 1, 1}, {&__pyx_n_s_skyblue3, __pyx_k_skyblue3, sizeof(__pyx_k_skyblue3), 0, 0, 1, 1}, {&__pyx_n_s_skyblue4, __pyx_k_skyblue4, sizeof(__pyx_k_skyblue4), 0, 0, 1, 1}, {&__pyx_n_s_slateblue, __pyx_k_slateblue, sizeof(__pyx_k_slateblue), 0, 0, 1, 1}, {&__pyx_n_s_slateblue1, __pyx_k_slateblue1, sizeof(__pyx_k_slateblue1), 0, 0, 1, 1}, {&__pyx_n_s_slateblue2, __pyx_k_slateblue2, sizeof(__pyx_k_slateblue2), 0, 0, 1, 1}, {&__pyx_n_s_slateblue3, __pyx_k_slateblue3, sizeof(__pyx_k_slateblue3), 0, 0, 1, 1}, {&__pyx_n_s_slateblue4, __pyx_k_slateblue4, sizeof(__pyx_k_slateblue4), 0, 0, 1, 1}, {&__pyx_n_s_slategray, __pyx_k_slategray, sizeof(__pyx_k_slategray), 0, 0, 1, 1}, {&__pyx_n_s_slategray1, __pyx_k_slategray1, sizeof(__pyx_k_slategray1), 0, 0, 1, 1}, {&__pyx_n_s_slategray2, __pyx_k_slategray2, sizeof(__pyx_k_slategray2), 0, 0, 1, 1}, {&__pyx_n_s_slategray3, __pyx_k_slategray3, sizeof(__pyx_k_slategray3), 0, 0, 1, 1}, {&__pyx_n_s_slategray4, __pyx_k_slategray4, sizeof(__pyx_k_slategray4), 0, 0, 1, 1}, {&__pyx_n_s_slategrey, __pyx_k_slategrey, sizeof(__pyx_k_slategrey), 0, 0, 1, 1}, {&__pyx_n_s_snow, __pyx_k_snow, sizeof(__pyx_k_snow), 0, 0, 1, 1}, {&__pyx_n_s_snow1, __pyx_k_snow1, sizeof(__pyx_k_snow1), 0, 0, 1, 1}, {&__pyx_n_s_snow2, __pyx_k_snow2, sizeof(__pyx_k_snow2), 0, 0, 1, 1}, {&__pyx_n_s_snow3, __pyx_k_snow3, sizeof(__pyx_k_snow3), 0, 0, 1, 1}, {&__pyx_n_s_snow4, __pyx_k_snow4, sizeof(__pyx_k_snow4), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_n_s_springgreen, __pyx_k_springgreen, sizeof(__pyx_k_springgreen), 0, 0, 1, 1}, {&__pyx_n_s_springgreen1, __pyx_k_springgreen1, sizeof(__pyx_k_springgreen1), 0, 0, 1, 1}, {&__pyx_n_s_springgreen2, __pyx_k_springgreen2, sizeof(__pyx_k_springgreen2), 0, 0, 1, 1}, {&__pyx_n_s_springgreen3, __pyx_k_springgreen3, sizeof(__pyx_k_springgreen3), 0, 0, 1, 1}, {&__pyx_n_s_springgreen4, __pyx_k_springgreen4, sizeof(__pyx_k_springgreen4), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_k_src_pygame_sdl2_color_pyx, sizeof(__pyx_k_src_pygame_sdl2_color_pyx), 0, 0, 1, 0}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_steelblue, __pyx_k_steelblue, sizeof(__pyx_k_steelblue), 0, 0, 1, 1}, {&__pyx_n_s_steelblue1, __pyx_k_steelblue1, sizeof(__pyx_k_steelblue1), 0, 0, 1, 1}, {&__pyx_n_s_steelblue2, __pyx_k_steelblue2, sizeof(__pyx_k_steelblue2), 0, 0, 1, 1}, {&__pyx_n_s_steelblue3, __pyx_k_steelblue3, sizeof(__pyx_k_steelblue3), 0, 0, 1, 1}, {&__pyx_n_s_steelblue4, __pyx_k_steelblue4, sizeof(__pyx_k_steelblue4), 0, 0, 1, 1}, {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, {&__pyx_n_s_tan, __pyx_k_tan, sizeof(__pyx_k_tan), 0, 0, 1, 1}, {&__pyx_n_s_tan1, __pyx_k_tan1, sizeof(__pyx_k_tan1), 0, 0, 1, 1}, {&__pyx_n_s_tan2, __pyx_k_tan2, sizeof(__pyx_k_tan2), 0, 0, 1, 1}, {&__pyx_n_s_tan3, __pyx_k_tan3, sizeof(__pyx_k_tan3), 0, 0, 1, 1}, {&__pyx_n_s_tan4, __pyx_k_tan4, sizeof(__pyx_k_tan4), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_thistle, __pyx_k_thistle, sizeof(__pyx_k_thistle), 0, 0, 1, 1}, {&__pyx_n_s_thistle1, __pyx_k_thistle1, sizeof(__pyx_k_thistle1), 0, 0, 1, 1}, {&__pyx_n_s_thistle2, __pyx_k_thistle2, sizeof(__pyx_k_thistle2), 0, 0, 1, 1}, {&__pyx_n_s_thistle3, __pyx_k_thistle3, sizeof(__pyx_k_thistle3), 0, 0, 1, 1}, {&__pyx_n_s_thistle4, __pyx_k_thistle4, sizeof(__pyx_k_thistle4), 0, 0, 1, 1}, {&__pyx_n_s_tomato, __pyx_k_tomato, sizeof(__pyx_k_tomato), 0, 0, 1, 1}, {&__pyx_n_s_tomato1, __pyx_k_tomato1, sizeof(__pyx_k_tomato1), 0, 0, 1, 1}, {&__pyx_n_s_tomato2, __pyx_k_tomato2, sizeof(__pyx_k_tomato2), 0, 0, 1, 1}, {&__pyx_n_s_tomato3, __pyx_k_tomato3, sizeof(__pyx_k_tomato3), 0, 0, 1, 1}, {&__pyx_n_s_tomato4, __pyx_k_tomato4, sizeof(__pyx_k_tomato4), 0, 0, 1, 1}, {&__pyx_n_s_turquoise, __pyx_k_turquoise, sizeof(__pyx_k_turquoise), 0, 0, 1, 1}, {&__pyx_n_s_turquoise1, __pyx_k_turquoise1, sizeof(__pyx_k_turquoise1), 0, 0, 1, 1}, {&__pyx_n_s_turquoise2, __pyx_k_turquoise2, sizeof(__pyx_k_turquoise2), 0, 0, 1, 1}, {&__pyx_n_s_turquoise3, __pyx_k_turquoise3, sizeof(__pyx_k_turquoise3), 0, 0, 1, 1}, {&__pyx_n_s_turquoise4, __pyx_k_turquoise4, sizeof(__pyx_k_turquoise4), 0, 0, 1, 1}, {&__pyx_n_s_unhexlify, __pyx_k_unhexlify, sizeof(__pyx_k_unhexlify), 0, 0, 1, 1}, {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, {&__pyx_n_s_violet, __pyx_k_violet, sizeof(__pyx_k_violet), 0, 0, 1, 1}, {&__pyx_n_s_violetred, __pyx_k_violetred, sizeof(__pyx_k_violetred), 0, 0, 1, 1}, {&__pyx_n_s_violetred1, __pyx_k_violetred1, sizeof(__pyx_k_violetred1), 0, 0, 1, 1}, {&__pyx_n_s_violetred2, __pyx_k_violetred2, sizeof(__pyx_k_violetred2), 0, 0, 1, 1}, {&__pyx_n_s_violetred3, __pyx_k_violetred3, sizeof(__pyx_k_violetred3), 0, 0, 1, 1}, {&__pyx_n_s_violetred4, __pyx_k_violetred4, sizeof(__pyx_k_violetred4), 0, 0, 1, 1}, {&__pyx_n_s_wheat, __pyx_k_wheat, sizeof(__pyx_k_wheat), 0, 0, 1, 1}, {&__pyx_n_s_wheat1, __pyx_k_wheat1, sizeof(__pyx_k_wheat1), 0, 0, 1, 1}, {&__pyx_n_s_wheat2, __pyx_k_wheat2, sizeof(__pyx_k_wheat2), 0, 0, 1, 1}, {&__pyx_n_s_wheat3, __pyx_k_wheat3, sizeof(__pyx_k_wheat3), 0, 0, 1, 1}, {&__pyx_n_s_wheat4, __pyx_k_wheat4, sizeof(__pyx_k_wheat4), 0, 0, 1, 1}, {&__pyx_n_s_white, __pyx_k_white, sizeof(__pyx_k_white), 0, 0, 1, 1}, {&__pyx_n_s_whitesmoke, __pyx_k_whitesmoke, sizeof(__pyx_k_whitesmoke), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_yellow, __pyx_k_yellow, sizeof(__pyx_k_yellow), 0, 0, 1, 1}, {&__pyx_n_s_yellow1, __pyx_k_yellow1, sizeof(__pyx_k_yellow1), 0, 0, 1, 1}, {&__pyx_n_s_yellow2, __pyx_k_yellow2, sizeof(__pyx_k_yellow2), 0, 0, 1, 1}, {&__pyx_n_s_yellow3, __pyx_k_yellow3, sizeof(__pyx_k_yellow3), 0, 0, 1, 1}, {&__pyx_n_s_yellow4, __pyx_k_yellow4, sizeof(__pyx_k_yellow4), 0, 0, 1, 1}, {&__pyx_n_s_yellowgreen, __pyx_k_yellowgreen, sizeof(__pyx_k_yellowgreen), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 41, __pyx_L1_error) __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 94, __pyx_L1_error) __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_builtin_oct = __Pyx_GetBuiltinName(__pyx_n_s_oct); if (!__pyx_builtin_oct) __PYX_ERR(0, 156, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 173, __pyx_L1_error) __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 453, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/color.pyx":41 * return color * else: * raise TypeError("Expected a color.") # <<<<<<<<<<<<<< * * return SDL_MapRGBA(surface.format, r, g, b, a) */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Expected_a_color); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/color.pyx":123 * if isinstance(c, basestring): * if c.startswith('#'): * self.from_hex(c[1:]) # <<<<<<<<<<<<<< * elif c.startswith('0x'): * self.from_hex(c[2:]) */ __pyx_slice__4 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__4); __Pyx_GIVEREF(__pyx_slice__4); /* "pygame_sdl2/color.pyx":125 * self.from_hex(c[1:]) * elif c.startswith('0x'): * self.from_hex(c[2:]) # <<<<<<<<<<<<<< * else: * self.from_name(c) */ __pyx_slice__5 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__5); __Pyx_GIVEREF(__pyx_slice__5); /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_l, __pyx_n_s_r); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_mod, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 228, __pyx_L1_error) /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_div, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 251, __pyx_L1_error) /* "include/color_dict.pxi":5 * * cdef object colors = { * 'aliceblue' : (240, 248, 255), # <<<<<<<<<<<<<< * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), */ __pyx_tuple__11 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_248, __pyx_int_255); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "include/color_dict.pxi":6 * cdef object colors = { * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), # <<<<<<<<<<<<<< * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), */ __pyx_tuple__12 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_235, __pyx_int_215); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "include/color_dict.pxi":7 * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), # <<<<<<<<<<<<<< * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), */ __pyx_tuple__13 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_239, __pyx_int_219); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "include/color_dict.pxi":8 * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), # <<<<<<<<<<<<<< * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), */ __pyx_tuple__14 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_223, __pyx_int_204); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "include/color_dict.pxi":9 * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), # <<<<<<<<<<<<<< * 'antiquewhite4' : (139, 131, 120), * 'aquamarine' : (127, 255, 212), */ __pyx_tuple__15 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_192, __pyx_int_176); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "include/color_dict.pxi":10 * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), # <<<<<<<<<<<<<< * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), */ __pyx_tuple__16 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_131, __pyx_int_120); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "include/color_dict.pxi":11 * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), * 'aquamarine' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), */ __pyx_tuple__17 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_255, __pyx_int_212); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "include/color_dict.pxi":13 * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), # <<<<<<<<<<<<<< * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), */ __pyx_tuple__18 = PyTuple_Pack(3, __pyx_int_118, __pyx_int_238, __pyx_int_198); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "include/color_dict.pxi":14 * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), # <<<<<<<<<<<<<< * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), */ __pyx_tuple__19 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_205, __pyx_int_170); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "include/color_dict.pxi":15 * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), # <<<<<<<<<<<<<< * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), */ __pyx_tuple__20 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_139, __pyx_int_116); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); /* "include/color_dict.pxi":16 * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), */ __pyx_tuple__21 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "include/color_dict.pxi":18 * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), # <<<<<<<<<<<<<< * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), */ __pyx_tuple__22 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "include/color_dict.pxi":19 * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), # <<<<<<<<<<<<<< * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), */ __pyx_tuple__23 = PyTuple_Pack(3, __pyx_int_193, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); /* "include/color_dict.pxi":20 * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), # <<<<<<<<<<<<<< * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), */ __pyx_tuple__24 = PyTuple_Pack(3, __pyx_int_131, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "include/color_dict.pxi":21 * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), # <<<<<<<<<<<<<< * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), */ __pyx_tuple__25 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_245, __pyx_int_220); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "include/color_dict.pxi":22 * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), */ __pyx_tuple__26 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_196); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); /* "include/color_dict.pxi":24 * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), # <<<<<<<<<<<<<< * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), */ __pyx_tuple__27 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_213, __pyx_int_183); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "include/color_dict.pxi":25 * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), # <<<<<<<<<<<<<< * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), */ __pyx_tuple__28 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_183, __pyx_int_158); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); /* "include/color_dict.pxi":26 * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), # <<<<<<<<<<<<<< * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), */ __pyx_tuple__29 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_125, __pyx_int_107); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "include/color_dict.pxi":27 * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), # <<<<<<<<<<<<<< * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), */ __pyx_tuple__30 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "include/color_dict.pxi":28 * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), # <<<<<<<<<<<<<< * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), */ __pyx_tuple__31 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_235, __pyx_int_205); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "include/color_dict.pxi":29 * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), */ __pyx_tuple__32 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); /* "include/color_dict.pxi":31 * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), # <<<<<<<<<<<<<< * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), */ __pyx_tuple__33 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_238); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); /* "include/color_dict.pxi":32 * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), # <<<<<<<<<<<<<< * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), */ __pyx_tuple__34 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_205); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); /* "include/color_dict.pxi":33 * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), # <<<<<<<<<<<<<< * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), */ __pyx_tuple__35 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_139); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); /* "include/color_dict.pxi":34 * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), # <<<<<<<<<<<<<< * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), */ __pyx_tuple__36 = PyTuple_Pack(3, __pyx_int_138, __pyx_int_43, __pyx_int_226); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "include/color_dict.pxi":35 * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), # <<<<<<<<<<<<<< * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), */ __pyx_tuple__37 = PyTuple_Pack(3, __pyx_int_165, __pyx_int_42, __pyx_int_42); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); /* "include/color_dict.pxi":36 * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), # <<<<<<<<<<<<<< * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), */ __pyx_tuple__38 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_64, __pyx_int_64); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(2, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); /* "include/color_dict.pxi":37 * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), # <<<<<<<<<<<<<< * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), */ __pyx_tuple__39 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_59, __pyx_int_59); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(2, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); /* "include/color_dict.pxi":38 * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), # <<<<<<<<<<<<<< * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), */ __pyx_tuple__40 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_51, __pyx_int_51); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); /* "include/color_dict.pxi":39 * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), # <<<<<<<<<<<<<< * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), */ __pyx_tuple__41 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_35, __pyx_int_35); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); /* "include/color_dict.pxi":40 * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), # <<<<<<<<<<<<<< * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), */ __pyx_tuple__42 = PyTuple_Pack(3, __pyx_int_222, __pyx_int_184, __pyx_int_135); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); /* "include/color_dict.pxi":41 * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), # <<<<<<<<<<<<<< * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), */ __pyx_tuple__43 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_211, __pyx_int_155); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); /* "include/color_dict.pxi":42 * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), # <<<<<<<<<<<<<< * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), */ __pyx_tuple__44 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_197, __pyx_int_145); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); /* "include/color_dict.pxi":43 * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), # <<<<<<<<<<<<<< * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), */ __pyx_tuple__45 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_170, __pyx_int_125); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); /* "include/color_dict.pxi":44 * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), # <<<<<<<<<<<<<< * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), */ __pyx_tuple__46 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_115, __pyx_int_85); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); /* "include/color_dict.pxi":45 * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), # <<<<<<<<<<<<<< * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), */ __pyx_tuple__47 = PyTuple_Pack(3, __pyx_int_95, __pyx_int_158, __pyx_int_160); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); /* "include/color_dict.pxi":46 * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), # <<<<<<<<<<<<<< * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), */ __pyx_tuple__48 = PyTuple_Pack(3, __pyx_int_152, __pyx_int_245, __pyx_int_255); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(2, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); /* "include/color_dict.pxi":47 * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), # <<<<<<<<<<<<<< * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), */ __pyx_tuple__49 = PyTuple_Pack(3, __pyx_int_142, __pyx_int_229, __pyx_int_238); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); /* "include/color_dict.pxi":48 * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), # <<<<<<<<<<<<<< * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), */ __pyx_tuple__50 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_197, __pyx_int_205); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(2, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); /* "include/color_dict.pxi":49 * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), # <<<<<<<<<<<<<< * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), */ __pyx_tuple__51 = PyTuple_Pack(3, __pyx_int_83, __pyx_int_134, __pyx_int_139); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(2, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); /* "include/color_dict.pxi":50 * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), */ __pyx_tuple__52 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(2, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); /* "include/color_dict.pxi":52 * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), # <<<<<<<<<<<<<< * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), */ __pyx_tuple__53 = PyTuple_Pack(3, __pyx_int_118, __pyx_int_238, __pyx_int_0); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(2, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); /* "include/color_dict.pxi":53 * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), # <<<<<<<<<<<<<< * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), */ __pyx_tuple__54 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_205, __pyx_int_0); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(2, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); /* "include/color_dict.pxi":54 * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), # <<<<<<<<<<<<<< * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), */ __pyx_tuple__55 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_139, __pyx_int_0); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(2, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); /* "include/color_dict.pxi":55 * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), # <<<<<<<<<<<<<< * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), */ __pyx_tuple__56 = PyTuple_Pack(3, __pyx_int_210, __pyx_int_105, __pyx_int_30); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(2, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); /* "include/color_dict.pxi":56 * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), # <<<<<<<<<<<<<< * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), */ __pyx_tuple__57 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_127, __pyx_int_36); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(2, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); /* "include/color_dict.pxi":57 * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), # <<<<<<<<<<<<<< * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), */ __pyx_tuple__58 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_118, __pyx_int_33); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(2, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); /* "include/color_dict.pxi":58 * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), # <<<<<<<<<<<<<< * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), */ __pyx_tuple__59 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_102, __pyx_int_29); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(2, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); /* "include/color_dict.pxi":59 * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), # <<<<<<<<<<<<<< * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), */ __pyx_tuple__60 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_69, __pyx_int_19); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(2, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); /* "include/color_dict.pxi":60 * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), # <<<<<<<<<<<<<< * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), */ __pyx_tuple__61 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_127, __pyx_int_80); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(2, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); /* "include/color_dict.pxi":61 * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), # <<<<<<<<<<<<<< * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), */ __pyx_tuple__62 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_114, __pyx_int_86); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(2, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); /* "include/color_dict.pxi":62 * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), # <<<<<<<<<<<<<< * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), */ __pyx_tuple__63 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_106, __pyx_int_80); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(2, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); /* "include/color_dict.pxi":63 * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), # <<<<<<<<<<<<<< * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), */ __pyx_tuple__64 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_91, __pyx_int_69); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(2, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); /* "include/color_dict.pxi":64 * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), # <<<<<<<<<<<<<< * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), */ __pyx_tuple__65 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_62, __pyx_int_47); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(2, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); /* "include/color_dict.pxi":65 * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), # <<<<<<<<<<<<<< * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), */ __pyx_tuple__66 = PyTuple_Pack(3, __pyx_int_100, __pyx_int_149, __pyx_int_237); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); /* "include/color_dict.pxi":66 * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), */ __pyx_tuple__67 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_248, __pyx_int_220); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(2, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); /* "include/color_dict.pxi":68 * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), # <<<<<<<<<<<<<< * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), */ __pyx_tuple__68 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_232, __pyx_int_205); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(2, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); /* "include/color_dict.pxi":69 * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), # <<<<<<<<<<<<<< * 'cornsilk4' : (139, 136, 120), * 'cyan' : (0, 255, 255), */ __pyx_tuple__69 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_200, __pyx_int_177); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(2, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); /* "include/color_dict.pxi":70 * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), # <<<<<<<<<<<<<< * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), */ __pyx_tuple__70 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_136, __pyx_int_120); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(2, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70); /* "include/color_dict.pxi":71 * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), * 'cyan' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), */ __pyx_tuple__71 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(2, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); /* "include/color_dict.pxi":73 * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), # <<<<<<<<<<<<<< * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), */ __pyx_tuple__72 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(2, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); /* "include/color_dict.pxi":74 * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), # <<<<<<<<<<<<<< * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), */ __pyx_tuple__73 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(2, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73); /* "include/color_dict.pxi":75 * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), */ __pyx_tuple__74 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(2, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); /* "include/color_dict.pxi":78 * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), # <<<<<<<<<<<<<< * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), */ __pyx_tuple__75 = PyTuple_Pack(3, __pyx_int_184, __pyx_int_134, __pyx_int_11); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(2, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); /* "include/color_dict.pxi":79 * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), # <<<<<<<<<<<<<< * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), */ __pyx_tuple__76 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_185, __pyx_int_15); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(2, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); /* "include/color_dict.pxi":80 * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), # <<<<<<<<<<<<<< * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), */ __pyx_tuple__77 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_173, __pyx_int_14); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(2, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__77); __Pyx_GIVEREF(__pyx_tuple__77); /* "include/color_dict.pxi":81 * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), # <<<<<<<<<<<<<< * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), */ __pyx_tuple__78 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_149, __pyx_int_12); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(2, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); /* "include/color_dict.pxi":82 * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), # <<<<<<<<<<<<<< * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), */ __pyx_tuple__79 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_101, __pyx_int_8); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(2, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); /* "include/color_dict.pxi":83 * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), */ __pyx_tuple__80 = PyTuple_Pack(3, __pyx_int_169, __pyx_int_169, __pyx_int_169); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(2, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__80); __Pyx_GIVEREF(__pyx_tuple__80); /* "include/color_dict.pxi":84 * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), # <<<<<<<<<<<<<< * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), */ __pyx_tuple__81 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_100, __pyx_int_0); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(2, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); /* "include/color_dict.pxi":86 * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), # <<<<<<<<<<<<<< * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), */ __pyx_tuple__82 = PyTuple_Pack(3, __pyx_int_189, __pyx_int_183, __pyx_int_107); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(2, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__82); __Pyx_GIVEREF(__pyx_tuple__82); /* "include/color_dict.pxi":87 * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), # <<<<<<<<<<<<<< * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), */ __pyx_tuple__83 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_0, __pyx_int_139); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(2, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); /* "include/color_dict.pxi":88 * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), # <<<<<<<<<<<<<< * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), */ __pyx_tuple__84 = PyTuple_Pack(3, __pyx_int_85, __pyx_int_107, __pyx_int_47); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(2, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84); /* "include/color_dict.pxi":89 * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), # <<<<<<<<<<<<<< * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), */ __pyx_tuple__85 = PyTuple_Pack(3, __pyx_int_202, __pyx_int_255, __pyx_int_112); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(2, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__85); __Pyx_GIVEREF(__pyx_tuple__85); /* "include/color_dict.pxi":90 * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), # <<<<<<<<<<<<<< * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), */ __pyx_tuple__86 = PyTuple_Pack(3, __pyx_int_188, __pyx_int_238, __pyx_int_104); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(2, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__86); __Pyx_GIVEREF(__pyx_tuple__86); /* "include/color_dict.pxi":91 * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), # <<<<<<<<<<<<<< * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), */ __pyx_tuple__87 = PyTuple_Pack(3, __pyx_int_162, __pyx_int_205, __pyx_int_90); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(2, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87); /* "include/color_dict.pxi":92 * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), # <<<<<<<<<<<<<< * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), */ __pyx_tuple__88 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_139, __pyx_int_61); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(2, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__88); __Pyx_GIVEREF(__pyx_tuple__88); /* "include/color_dict.pxi":93 * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), # <<<<<<<<<<<<<< * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), */ __pyx_tuple__89 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_140, __pyx_int_0); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(2, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89); /* "include/color_dict.pxi":94 * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), # <<<<<<<<<<<<<< * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), */ __pyx_tuple__90 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_127, __pyx_int_0); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(2, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__90); __Pyx_GIVEREF(__pyx_tuple__90); /* "include/color_dict.pxi":95 * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), # <<<<<<<<<<<<<< * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), */ __pyx_tuple__91 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_118, __pyx_int_0); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(2, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__91); __Pyx_GIVEREF(__pyx_tuple__91); /* "include/color_dict.pxi":96 * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), # <<<<<<<<<<<<<< * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), */ __pyx_tuple__92 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_102, __pyx_int_0); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(2, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__92); __Pyx_GIVEREF(__pyx_tuple__92); /* "include/color_dict.pxi":97 * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), # <<<<<<<<<<<<<< * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), */ __pyx_tuple__93 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_69, __pyx_int_0); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(2, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__93); __Pyx_GIVEREF(__pyx_tuple__93); /* "include/color_dict.pxi":98 * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), # <<<<<<<<<<<<<< * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), */ __pyx_tuple__94 = PyTuple_Pack(3, __pyx_int_153, __pyx_int_50, __pyx_int_204); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(2, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__94); __Pyx_GIVEREF(__pyx_tuple__94); /* "include/color_dict.pxi":99 * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), # <<<<<<<<<<<<<< * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), */ __pyx_tuple__95 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_62, __pyx_int_255); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(2, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__95); __Pyx_GIVEREF(__pyx_tuple__95); /* "include/color_dict.pxi":100 * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), # <<<<<<<<<<<<<< * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), */ __pyx_tuple__96 = PyTuple_Pack(3, __pyx_int_178, __pyx_int_58, __pyx_int_238); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(2, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__96); __Pyx_GIVEREF(__pyx_tuple__96); /* "include/color_dict.pxi":101 * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), # <<<<<<<<<<<<<< * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), */ __pyx_tuple__97 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_50, __pyx_int_205); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(2, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__97); __Pyx_GIVEREF(__pyx_tuple__97); /* "include/color_dict.pxi":102 * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), # <<<<<<<<<<<<<< * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), */ __pyx_tuple__98 = PyTuple_Pack(3, __pyx_int_104, __pyx_int_34, __pyx_int_139); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(2, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__98); __Pyx_GIVEREF(__pyx_tuple__98); /* "include/color_dict.pxi":103 * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), # <<<<<<<<<<<<<< * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), */ __pyx_tuple__99 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(2, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__99); __Pyx_GIVEREF(__pyx_tuple__99); /* "include/color_dict.pxi":104 * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), # <<<<<<<<<<<<<< * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), */ __pyx_tuple__100 = PyTuple_Pack(3, __pyx_int_233, __pyx_int_150, __pyx_int_122); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(2, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__100); __Pyx_GIVEREF(__pyx_tuple__100); /* "include/color_dict.pxi":105 * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), # <<<<<<<<<<<<<< * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), */ __pyx_tuple__101 = PyTuple_Pack(3, __pyx_int_143, __pyx_int_188, __pyx_int_143); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(2, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__101); __Pyx_GIVEREF(__pyx_tuple__101); /* "include/color_dict.pxi":106 * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), # <<<<<<<<<<<<<< * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), */ __pyx_tuple__102 = PyTuple_Pack(3, __pyx_int_193, __pyx_int_255, __pyx_int_193); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(2, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__102); __Pyx_GIVEREF(__pyx_tuple__102); /* "include/color_dict.pxi":107 * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), # <<<<<<<<<<<<<< * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), */ __pyx_tuple__103 = PyTuple_Pack(3, __pyx_int_180, __pyx_int_238, __pyx_int_180); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(2, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__103); __Pyx_GIVEREF(__pyx_tuple__103); /* "include/color_dict.pxi":108 * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), # <<<<<<<<<<<<<< * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), */ __pyx_tuple__104 = PyTuple_Pack(3, __pyx_int_155, __pyx_int_205, __pyx_int_155); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(2, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__104); __Pyx_GIVEREF(__pyx_tuple__104); /* "include/color_dict.pxi":109 * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), # <<<<<<<<<<<<<< * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), */ __pyx_tuple__105 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_139, __pyx_int_105); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(2, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__105); __Pyx_GIVEREF(__pyx_tuple__105); /* "include/color_dict.pxi":110 * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), # <<<<<<<<<<<<<< * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), */ __pyx_tuple__106 = PyTuple_Pack(3, __pyx_int_72, __pyx_int_61, __pyx_int_139); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(2, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__106); __Pyx_GIVEREF(__pyx_tuple__106); /* "include/color_dict.pxi":111 * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), */ __pyx_tuple__107 = PyTuple_Pack(3, __pyx_int_47, __pyx_int_79, __pyx_int_79); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(2, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__107); __Pyx_GIVEREF(__pyx_tuple__107); /* "include/color_dict.pxi":112 * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), # <<<<<<<<<<<<<< * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), */ __pyx_tuple__108 = PyTuple_Pack(3, __pyx_int_151, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(2, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__108); __Pyx_GIVEREF(__pyx_tuple__108); /* "include/color_dict.pxi":113 * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), # <<<<<<<<<<<<<< * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), */ __pyx_tuple__109 = PyTuple_Pack(3, __pyx_int_141, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(2, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__109); __Pyx_GIVEREF(__pyx_tuple__109); /* "include/color_dict.pxi":114 * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), # <<<<<<<<<<<<<< * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), */ __pyx_tuple__110 = PyTuple_Pack(3, __pyx_int_121, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(2, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__110); __Pyx_GIVEREF(__pyx_tuple__110); /* "include/color_dict.pxi":115 * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), # <<<<<<<<<<<<<< * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), */ __pyx_tuple__111 = PyTuple_Pack(3, __pyx_int_82, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(2, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__111); __Pyx_GIVEREF(__pyx_tuple__111); /* "include/color_dict.pxi":117 * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), # <<<<<<<<<<<<<< * 'darkviolet' : (148, 0, 211), * 'debianred' : (215, 7, 81), */ __pyx_tuple__112 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_206, __pyx_int_209); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(2, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__112); __Pyx_GIVEREF(__pyx_tuple__112); /* "include/color_dict.pxi":118 * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), # <<<<<<<<<<<<<< * 'debianred' : (215, 7, 81), * 'deeppink' : (255, 20, 147), */ __pyx_tuple__113 = PyTuple_Pack(3, __pyx_int_148, __pyx_int_0, __pyx_int_211); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(2, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__113); __Pyx_GIVEREF(__pyx_tuple__113); /* "include/color_dict.pxi":119 * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), * 'debianred' : (215, 7, 81), # <<<<<<<<<<<<<< * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), */ __pyx_tuple__114 = PyTuple_Pack(3, __pyx_int_215, __pyx_int_7, __pyx_int_81); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(2, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__114); __Pyx_GIVEREF(__pyx_tuple__114); /* "include/color_dict.pxi":120 * 'darkviolet' : (148, 0, 211), * 'debianred' : (215, 7, 81), * 'deeppink' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), */ __pyx_tuple__115 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_20, __pyx_int_147); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(2, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__115); __Pyx_GIVEREF(__pyx_tuple__115); /* "include/color_dict.pxi":122 * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), # <<<<<<<<<<<<<< * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), */ __pyx_tuple__116 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_18, __pyx_int_137); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(2, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__116); __Pyx_GIVEREF(__pyx_tuple__116); /* "include/color_dict.pxi":123 * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), # <<<<<<<<<<<<<< * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), */ __pyx_tuple__117 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_16, __pyx_int_118); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(2, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__117); __Pyx_GIVEREF(__pyx_tuple__117); /* "include/color_dict.pxi":124 * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), # <<<<<<<<<<<<<< * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), */ __pyx_tuple__118 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_10, __pyx_int_80); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(2, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__118); __Pyx_GIVEREF(__pyx_tuple__118); /* "include/color_dict.pxi":125 * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), */ __pyx_tuple__119 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_191, __pyx_int_255); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(2, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__119); __Pyx_GIVEREF(__pyx_tuple__119); /* "include/color_dict.pxi":127 * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), # <<<<<<<<<<<<<< * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), */ __pyx_tuple__120 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_178, __pyx_int_238); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(2, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__120); __Pyx_GIVEREF(__pyx_tuple__120); /* "include/color_dict.pxi":128 * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), # <<<<<<<<<<<<<< * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), */ __pyx_tuple__121 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_154, __pyx_int_205); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(2, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__121); __Pyx_GIVEREF(__pyx_tuple__121); /* "include/color_dict.pxi":129 * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), # <<<<<<<<<<<<<< * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), */ __pyx_tuple__122 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_104, __pyx_int_139); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(2, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__122); __Pyx_GIVEREF(__pyx_tuple__122); /* "include/color_dict.pxi":130 * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), */ __pyx_tuple__123 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(2, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__123); __Pyx_GIVEREF(__pyx_tuple__123); /* "include/color_dict.pxi":132 * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), */ __pyx_tuple__124 = PyTuple_Pack(3, __pyx_int_30, __pyx_int_144, __pyx_int_255); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(2, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__124); __Pyx_GIVEREF(__pyx_tuple__124); /* "include/color_dict.pxi":134 * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), # <<<<<<<<<<<<<< * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), */ __pyx_tuple__125 = PyTuple_Pack(3, __pyx_int_28, __pyx_int_134, __pyx_int_238); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__125); __Pyx_GIVEREF(__pyx_tuple__125); /* "include/color_dict.pxi":135 * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), # <<<<<<<<<<<<<< * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), */ __pyx_tuple__126 = PyTuple_Pack(3, __pyx_int_24, __pyx_int_116, __pyx_int_205); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(2, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__126); __Pyx_GIVEREF(__pyx_tuple__126); /* "include/color_dict.pxi":136 * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), # <<<<<<<<<<<<<< * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), */ __pyx_tuple__127 = PyTuple_Pack(3, __pyx_int_16, __pyx_int_78, __pyx_int_139); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(2, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__127); __Pyx_GIVEREF(__pyx_tuple__127); /* "include/color_dict.pxi":137 * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), # <<<<<<<<<<<<<< * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), */ __pyx_tuple__128 = PyTuple_Pack(3, __pyx_int_178, __pyx_int_34, __pyx_int_34); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__128); __Pyx_GIVEREF(__pyx_tuple__128); /* "include/color_dict.pxi":138 * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), # <<<<<<<<<<<<<< * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), */ __pyx_tuple__129 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_48, __pyx_int_48); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__129); __Pyx_GIVEREF(__pyx_tuple__129); /* "include/color_dict.pxi":139 * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), # <<<<<<<<<<<<<< * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), */ __pyx_tuple__130 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_44, __pyx_int_44); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(2, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__130); __Pyx_GIVEREF(__pyx_tuple__130); /* "include/color_dict.pxi":140 * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), # <<<<<<<<<<<<<< * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), */ __pyx_tuple__131 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_38, __pyx_int_38); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__131); __Pyx_GIVEREF(__pyx_tuple__131); /* "include/color_dict.pxi":141 * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), # <<<<<<<<<<<<<< * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), */ __pyx_tuple__132 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_26, __pyx_int_26); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(2, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__132); __Pyx_GIVEREF(__pyx_tuple__132); /* "include/color_dict.pxi":142 * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), # <<<<<<<<<<<<<< * 'forestgreen' : (34, 139, 34), * 'gainsboro' : (220, 220, 220), */ __pyx_tuple__133 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_240); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(2, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__133); __Pyx_GIVEREF(__pyx_tuple__133); /* "include/color_dict.pxi":143 * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), # <<<<<<<<<<<<<< * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), */ __pyx_tuple__134 = PyTuple_Pack(3, __pyx_int_34, __pyx_int_139, __pyx_int_34); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(2, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__134); __Pyx_GIVEREF(__pyx_tuple__134); /* "include/color_dict.pxi":144 * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), * 'gainsboro' : (220, 220, 220), # <<<<<<<<<<<<<< * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), */ __pyx_tuple__135 = PyTuple_Pack(3, __pyx_int_220, __pyx_int_220, __pyx_int_220); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__135); __Pyx_GIVEREF(__pyx_tuple__135); /* "include/color_dict.pxi":145 * 'forestgreen' : (34, 139, 34), * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), # <<<<<<<<<<<<<< * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), */ __pyx_tuple__136 = PyTuple_Pack(3, __pyx_int_248, __pyx_int_248, __pyx_int_255); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(2, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__136); __Pyx_GIVEREF(__pyx_tuple__136); /* "include/color_dict.pxi":146 * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), */ __pyx_tuple__137 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_215, __pyx_int_0); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(2, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__137); __Pyx_GIVEREF(__pyx_tuple__137); /* "include/color_dict.pxi":148 * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), # <<<<<<<<<<<<<< * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), */ __pyx_tuple__138 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_201, __pyx_int_0); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__138); __Pyx_GIVEREF(__pyx_tuple__138); /* "include/color_dict.pxi":149 * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), # <<<<<<<<<<<<<< * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), */ __pyx_tuple__139 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_173, __pyx_int_0); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__139); __Pyx_GIVEREF(__pyx_tuple__139); /* "include/color_dict.pxi":150 * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), # <<<<<<<<<<<<<< * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), */ __pyx_tuple__140 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_117, __pyx_int_0); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(2, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__140); __Pyx_GIVEREF(__pyx_tuple__140); /* "include/color_dict.pxi":151 * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), # <<<<<<<<<<<<<< * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), */ __pyx_tuple__141 = PyTuple_Pack(3, __pyx_int_218, __pyx_int_165, __pyx_int_32); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__141); __Pyx_GIVEREF(__pyx_tuple__141); /* "include/color_dict.pxi":152 * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), # <<<<<<<<<<<<<< * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), */ __pyx_tuple__142 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_193, __pyx_int_37); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__142); __Pyx_GIVEREF(__pyx_tuple__142); /* "include/color_dict.pxi":153 * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), # <<<<<<<<<<<<<< * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), */ __pyx_tuple__143 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_180, __pyx_int_34); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(2, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__143); __Pyx_GIVEREF(__pyx_tuple__143); /* "include/color_dict.pxi":154 * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), # <<<<<<<<<<<<<< * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), */ __pyx_tuple__144 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_155, __pyx_int_29); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__144); __Pyx_GIVEREF(__pyx_tuple__144); /* "include/color_dict.pxi":155 * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), # <<<<<<<<<<<<<< * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), */ __pyx_tuple__145 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_105, __pyx_int_20); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(2, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__145); __Pyx_GIVEREF(__pyx_tuple__145); /* "include/color_dict.pxi":156 * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), # <<<<<<<<<<<<<< * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), */ __pyx_tuple__146 = PyTuple_Pack(3, __pyx_int_190, __pyx_int_190, __pyx_int_190); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(2, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__146); __Pyx_GIVEREF(__pyx_tuple__146); /* "include/color_dict.pxi":158 * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), */ __pyx_tuple__147 = PyTuple_Pack(3, __pyx_int_3, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(2, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__147); __Pyx_GIVEREF(__pyx_tuple__147); /* "include/color_dict.pxi":159 * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), */ __pyx_tuple__148 = PyTuple_Pack(3, __pyx_int_26, __pyx_int_26, __pyx_int_26); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(2, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__148); __Pyx_GIVEREF(__pyx_tuple__148); /* "include/color_dict.pxi":160 * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), */ __pyx_tuple__149 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(2, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__149); __Pyx_GIVEREF(__pyx_tuple__149); /* "include/color_dict.pxi":161 * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), */ __pyx_tuple__150 = PyTuple_Pack(3, __pyx_int_28, __pyx_int_28, __pyx_int_28); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(2, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__150); __Pyx_GIVEREF(__pyx_tuple__150); /* "include/color_dict.pxi":162 * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), */ __pyx_tuple__151 = PyTuple_Pack(3, __pyx_int_31, __pyx_int_31, __pyx_int_31); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(2, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__151); __Pyx_GIVEREF(__pyx_tuple__151); /* "include/color_dict.pxi":163 * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), */ __pyx_tuple__152 = PyTuple_Pack(3, __pyx_int_33, __pyx_int_33, __pyx_int_33); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(2, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__152); __Pyx_GIVEREF(__pyx_tuple__152); /* "include/color_dict.pxi":164 * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), */ __pyx_tuple__153 = PyTuple_Pack(3, __pyx_int_36, __pyx_int_36, __pyx_int_36); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(2, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__153); __Pyx_GIVEREF(__pyx_tuple__153); /* "include/color_dict.pxi":165 * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), */ __pyx_tuple__154 = PyTuple_Pack(3, __pyx_int_38, __pyx_int_38, __pyx_int_38); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__154); __Pyx_GIVEREF(__pyx_tuple__154); /* "include/color_dict.pxi":166 * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), */ __pyx_tuple__155 = PyTuple_Pack(3, __pyx_int_41, __pyx_int_41, __pyx_int_41); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(2, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__155); __Pyx_GIVEREF(__pyx_tuple__155); /* "include/color_dict.pxi":167 * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), */ __pyx_tuple__156 = PyTuple_Pack(3, __pyx_int_43, __pyx_int_43, __pyx_int_43); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(2, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__156); __Pyx_GIVEREF(__pyx_tuple__156); /* "include/color_dict.pxi":168 * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), */ __pyx_tuple__157 = PyTuple_Pack(3, __pyx_int_46, __pyx_int_46, __pyx_int_46); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(2, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__157); __Pyx_GIVEREF(__pyx_tuple__157); /* "include/color_dict.pxi":169 * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), */ __pyx_tuple__158 = PyTuple_Pack(3, __pyx_int_48, __pyx_int_48, __pyx_int_48); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(2, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__158); __Pyx_GIVEREF(__pyx_tuple__158); /* "include/color_dict.pxi":170 * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), */ __pyx_tuple__159 = PyTuple_Pack(3, __pyx_int_5, __pyx_int_5, __pyx_int_5); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(2, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__159); __Pyx_GIVEREF(__pyx_tuple__159); /* "include/color_dict.pxi":171 * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), */ __pyx_tuple__160 = PyTuple_Pack(3, __pyx_int_51, __pyx_int_51, __pyx_int_51); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(2, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__160); __Pyx_GIVEREF(__pyx_tuple__160); /* "include/color_dict.pxi":172 * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), */ __pyx_tuple__161 = PyTuple_Pack(3, __pyx_int_54, __pyx_int_54, __pyx_int_54); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(2, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__161); __Pyx_GIVEREF(__pyx_tuple__161); /* "include/color_dict.pxi":173 * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), */ __pyx_tuple__162 = PyTuple_Pack(3, __pyx_int_56, __pyx_int_56, __pyx_int_56); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__162); __Pyx_GIVEREF(__pyx_tuple__162); /* "include/color_dict.pxi":174 * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), */ __pyx_tuple__163 = PyTuple_Pack(3, __pyx_int_59, __pyx_int_59, __pyx_int_59); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(2, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__163); __Pyx_GIVEREF(__pyx_tuple__163); /* "include/color_dict.pxi":175 * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), */ __pyx_tuple__164 = PyTuple_Pack(3, __pyx_int_61, __pyx_int_61, __pyx_int_61); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(2, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__164); __Pyx_GIVEREF(__pyx_tuple__164); /* "include/color_dict.pxi":176 * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), */ __pyx_tuple__165 = PyTuple_Pack(3, __pyx_int_64, __pyx_int_64, __pyx_int_64); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__165); __Pyx_GIVEREF(__pyx_tuple__165); /* "include/color_dict.pxi":177 * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), */ __pyx_tuple__166 = PyTuple_Pack(3, __pyx_int_66, __pyx_int_66, __pyx_int_66); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__166); __Pyx_GIVEREF(__pyx_tuple__166); /* "include/color_dict.pxi":178 * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), */ __pyx_tuple__167 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_69, __pyx_int_69); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(2, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__167); __Pyx_GIVEREF(__pyx_tuple__167); /* "include/color_dict.pxi":179 * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), */ __pyx_tuple__168 = PyTuple_Pack(3, __pyx_int_71, __pyx_int_71, __pyx_int_71); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(2, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__168); __Pyx_GIVEREF(__pyx_tuple__168); /* "include/color_dict.pxi":180 * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), */ __pyx_tuple__169 = PyTuple_Pack(3, __pyx_int_74, __pyx_int_74, __pyx_int_74); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(2, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__169); __Pyx_GIVEREF(__pyx_tuple__169); /* "include/color_dict.pxi":181 * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), */ __pyx_tuple__170 = PyTuple_Pack(3, __pyx_int_8, __pyx_int_8, __pyx_int_8); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(2, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__170); __Pyx_GIVEREF(__pyx_tuple__170); /* "include/color_dict.pxi":182 * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), */ __pyx_tuple__171 = PyTuple_Pack(3, __pyx_int_77, __pyx_int_77, __pyx_int_77); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(2, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__171); __Pyx_GIVEREF(__pyx_tuple__171); /* "include/color_dict.pxi":183 * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), */ __pyx_tuple__172 = PyTuple_Pack(3, __pyx_int_79, __pyx_int_79, __pyx_int_79); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(2, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__172); __Pyx_GIVEREF(__pyx_tuple__172); /* "include/color_dict.pxi":184 * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), */ __pyx_tuple__173 = PyTuple_Pack(3, __pyx_int_82, __pyx_int_82, __pyx_int_82); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(2, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__173); __Pyx_GIVEREF(__pyx_tuple__173); /* "include/color_dict.pxi":185 * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), */ __pyx_tuple__174 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_84, __pyx_int_84); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(2, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__174); __Pyx_GIVEREF(__pyx_tuple__174); /* "include/color_dict.pxi":186 * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), */ __pyx_tuple__175 = PyTuple_Pack(3, __pyx_int_87, __pyx_int_87, __pyx_int_87); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(2, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__175); __Pyx_GIVEREF(__pyx_tuple__175); /* "include/color_dict.pxi":187 * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), */ __pyx_tuple__176 = PyTuple_Pack(3, __pyx_int_89, __pyx_int_89, __pyx_int_89); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(2, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__176); __Pyx_GIVEREF(__pyx_tuple__176); /* "include/color_dict.pxi":188 * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), */ __pyx_tuple__177 = PyTuple_Pack(3, __pyx_int_92, __pyx_int_92, __pyx_int_92); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(2, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__177); __Pyx_GIVEREF(__pyx_tuple__177); /* "include/color_dict.pxi":189 * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), */ __pyx_tuple__178 = PyTuple_Pack(3, __pyx_int_94, __pyx_int_94, __pyx_int_94); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(2, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__178); __Pyx_GIVEREF(__pyx_tuple__178); /* "include/color_dict.pxi":190 * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), */ __pyx_tuple__179 = PyTuple_Pack(3, __pyx_int_97, __pyx_int_97, __pyx_int_97); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(2, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__179); __Pyx_GIVEREF(__pyx_tuple__179); /* "include/color_dict.pxi":191 * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), */ __pyx_tuple__180 = PyTuple_Pack(3, __pyx_int_99, __pyx_int_99, __pyx_int_99); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__180); __Pyx_GIVEREF(__pyx_tuple__180); /* "include/color_dict.pxi":192 * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), */ __pyx_tuple__181 = PyTuple_Pack(3, __pyx_int_10, __pyx_int_10, __pyx_int_10); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(2, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__181); __Pyx_GIVEREF(__pyx_tuple__181); /* "include/color_dict.pxi":193 * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), */ __pyx_tuple__182 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_102, __pyx_int_102); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__182); __Pyx_GIVEREF(__pyx_tuple__182); /* "include/color_dict.pxi":195 * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), */ __pyx_tuple__183 = PyTuple_Pack(3, __pyx_int_107, __pyx_int_107, __pyx_int_107); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(2, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__183); __Pyx_GIVEREF(__pyx_tuple__183); /* "include/color_dict.pxi":196 * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), */ __pyx_tuple__184 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_110, __pyx_int_110); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(2, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__184); __Pyx_GIVEREF(__pyx_tuple__184); /* "include/color_dict.pxi":197 * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), */ __pyx_tuple__185 = PyTuple_Pack(3, __pyx_int_112, __pyx_int_112, __pyx_int_112); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(2, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__185); __Pyx_GIVEREF(__pyx_tuple__185); /* "include/color_dict.pxi":198 * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), */ __pyx_tuple__186 = PyTuple_Pack(3, __pyx_int_115, __pyx_int_115, __pyx_int_115); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(2, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__186); __Pyx_GIVEREF(__pyx_tuple__186); /* "include/color_dict.pxi":199 * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), */ __pyx_tuple__187 = PyTuple_Pack(3, __pyx_int_117, __pyx_int_117, __pyx_int_117); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(2, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__187); __Pyx_GIVEREF(__pyx_tuple__187); /* "include/color_dict.pxi":200 * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), */ __pyx_tuple__188 = PyTuple_Pack(3, __pyx_int_120, __pyx_int_120, __pyx_int_120); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(2, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__188); __Pyx_GIVEREF(__pyx_tuple__188); /* "include/color_dict.pxi":201 * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), */ __pyx_tuple__189 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_122, __pyx_int_122); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(2, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__189); __Pyx_GIVEREF(__pyx_tuple__189); /* "include/color_dict.pxi":202 * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), */ __pyx_tuple__190 = PyTuple_Pack(3, __pyx_int_125, __pyx_int_125, __pyx_int_125); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__190); __Pyx_GIVEREF(__pyx_tuple__190); /* "include/color_dict.pxi":203 * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), */ __pyx_tuple__191 = PyTuple_Pack(3, __pyx_int_13, __pyx_int_13, __pyx_int_13); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(2, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__191); __Pyx_GIVEREF(__pyx_tuple__191); /* "include/color_dict.pxi":204 * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), */ __pyx_tuple__192 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_127, __pyx_int_127); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(2, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__192); __Pyx_GIVEREF(__pyx_tuple__192); /* "include/color_dict.pxi":205 * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), */ __pyx_tuple__193 = PyTuple_Pack(3, __pyx_int_130, __pyx_int_130, __pyx_int_130); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(2, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__193); __Pyx_GIVEREF(__pyx_tuple__193); /* "include/color_dict.pxi":206 * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), */ __pyx_tuple__194 = PyTuple_Pack(3, __pyx_int_133, __pyx_int_133, __pyx_int_133); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(2, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__194); __Pyx_GIVEREF(__pyx_tuple__194); /* "include/color_dict.pxi":207 * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), */ __pyx_tuple__195 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_135, __pyx_int_135); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__195); __Pyx_GIVEREF(__pyx_tuple__195); /* "include/color_dict.pxi":208 * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), */ __pyx_tuple__196 = PyTuple_Pack(3, __pyx_int_138, __pyx_int_138, __pyx_int_138); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(2, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__196); __Pyx_GIVEREF(__pyx_tuple__196); /* "include/color_dict.pxi":209 * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), */ __pyx_tuple__197 = PyTuple_Pack(3, __pyx_int_140, __pyx_int_140, __pyx_int_140); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(2, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__197); __Pyx_GIVEREF(__pyx_tuple__197); /* "include/color_dict.pxi":210 * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), */ __pyx_tuple__198 = PyTuple_Pack(3, __pyx_int_143, __pyx_int_143, __pyx_int_143); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__198); __Pyx_GIVEREF(__pyx_tuple__198); /* "include/color_dict.pxi":211 * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), */ __pyx_tuple__199 = PyTuple_Pack(3, __pyx_int_145, __pyx_int_145, __pyx_int_145); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(2, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__199); __Pyx_GIVEREF(__pyx_tuple__199); /* "include/color_dict.pxi":212 * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), */ __pyx_tuple__200 = PyTuple_Pack(3, __pyx_int_148, __pyx_int_148, __pyx_int_148); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(2, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__200); __Pyx_GIVEREF(__pyx_tuple__200); /* "include/color_dict.pxi":213 * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), */ __pyx_tuple__201 = PyTuple_Pack(3, __pyx_int_150, __pyx_int_150, __pyx_int_150); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(2, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__201); __Pyx_GIVEREF(__pyx_tuple__201); /* "include/color_dict.pxi":214 * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), */ __pyx_tuple__202 = PyTuple_Pack(3, __pyx_int_15, __pyx_int_15, __pyx_int_15); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(2, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__202); __Pyx_GIVEREF(__pyx_tuple__202); /* "include/color_dict.pxi":215 * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), */ __pyx_tuple__203 = PyTuple_Pack(3, __pyx_int_153, __pyx_int_153, __pyx_int_153); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(2, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__203); __Pyx_GIVEREF(__pyx_tuple__203); /* "include/color_dict.pxi":216 * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), */ __pyx_tuple__204 = PyTuple_Pack(3, __pyx_int_156, __pyx_int_156, __pyx_int_156); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(2, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__204); __Pyx_GIVEREF(__pyx_tuple__204); /* "include/color_dict.pxi":217 * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), */ __pyx_tuple__205 = PyTuple_Pack(3, __pyx_int_158, __pyx_int_158, __pyx_int_158); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(2, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__205); __Pyx_GIVEREF(__pyx_tuple__205); /* "include/color_dict.pxi":218 * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), */ __pyx_tuple__206 = PyTuple_Pack(3, __pyx_int_161, __pyx_int_161, __pyx_int_161); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__206); __Pyx_GIVEREF(__pyx_tuple__206); /* "include/color_dict.pxi":219 * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), */ __pyx_tuple__207 = PyTuple_Pack(3, __pyx_int_163, __pyx_int_163, __pyx_int_163); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(2, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__207); __Pyx_GIVEREF(__pyx_tuple__207); /* "include/color_dict.pxi":220 * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), */ __pyx_tuple__208 = PyTuple_Pack(3, __pyx_int_166, __pyx_int_166, __pyx_int_166); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(2, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__208); __Pyx_GIVEREF(__pyx_tuple__208); /* "include/color_dict.pxi":221 * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), */ __pyx_tuple__209 = PyTuple_Pack(3, __pyx_int_168, __pyx_int_168, __pyx_int_168); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(2, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__209); __Pyx_GIVEREF(__pyx_tuple__209); /* "include/color_dict.pxi":222 * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), */ __pyx_tuple__210 = PyTuple_Pack(3, __pyx_int_171, __pyx_int_171, __pyx_int_171); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__210); __Pyx_GIVEREF(__pyx_tuple__210); /* "include/color_dict.pxi":223 * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), */ __pyx_tuple__211 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_173, __pyx_int_173); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(2, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__211); __Pyx_GIVEREF(__pyx_tuple__211); /* "include/color_dict.pxi":224 * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), */ __pyx_tuple__212 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_176, __pyx_int_176); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(2, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__212); __Pyx_GIVEREF(__pyx_tuple__212); /* "include/color_dict.pxi":225 * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), */ __pyx_tuple__213 = PyTuple_Pack(3, __pyx_int_18, __pyx_int_18, __pyx_int_18); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(2, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__213); __Pyx_GIVEREF(__pyx_tuple__213); /* "include/color_dict.pxi":226 * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), */ __pyx_tuple__214 = PyTuple_Pack(3, __pyx_int_179, __pyx_int_179, __pyx_int_179); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__214); __Pyx_GIVEREF(__pyx_tuple__214); /* "include/color_dict.pxi":227 * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), */ __pyx_tuple__215 = PyTuple_Pack(3, __pyx_int_181, __pyx_int_181, __pyx_int_181); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(2, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__215); __Pyx_GIVEREF(__pyx_tuple__215); /* "include/color_dict.pxi":228 * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), */ __pyx_tuple__216 = PyTuple_Pack(3, __pyx_int_184, __pyx_int_184, __pyx_int_184); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(2, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__216); __Pyx_GIVEREF(__pyx_tuple__216); /* "include/color_dict.pxi":229 * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), */ __pyx_tuple__217 = PyTuple_Pack(3, __pyx_int_186, __pyx_int_186, __pyx_int_186); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__217); __Pyx_GIVEREF(__pyx_tuple__217); /* "include/color_dict.pxi":230 * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), */ __pyx_tuple__218 = PyTuple_Pack(3, __pyx_int_189, __pyx_int_189, __pyx_int_189); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__218); __Pyx_GIVEREF(__pyx_tuple__218); /* "include/color_dict.pxi":231 * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), */ __pyx_tuple__219 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_191, __pyx_int_191); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(2, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__219); __Pyx_GIVEREF(__pyx_tuple__219); /* "include/color_dict.pxi":232 * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), */ __pyx_tuple__220 = PyTuple_Pack(3, __pyx_int_194, __pyx_int_194, __pyx_int_194); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(2, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__220); __Pyx_GIVEREF(__pyx_tuple__220); /* "include/color_dict.pxi":233 * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), */ __pyx_tuple__221 = PyTuple_Pack(3, __pyx_int_196, __pyx_int_196, __pyx_int_196); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(2, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__221); __Pyx_GIVEREF(__pyx_tuple__221); /* "include/color_dict.pxi":234 * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), */ __pyx_tuple__222 = PyTuple_Pack(3, __pyx_int_199, __pyx_int_199, __pyx_int_199); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(2, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__222); __Pyx_GIVEREF(__pyx_tuple__222); /* "include/color_dict.pxi":235 * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), */ __pyx_tuple__223 = PyTuple_Pack(3, __pyx_int_201, __pyx_int_201, __pyx_int_201); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__223); __Pyx_GIVEREF(__pyx_tuple__223); /* "include/color_dict.pxi":236 * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), */ __pyx_tuple__224 = PyTuple_Pack(3, __pyx_int_20, __pyx_int_20, __pyx_int_20); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(2, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__224); __Pyx_GIVEREF(__pyx_tuple__224); /* "include/color_dict.pxi":237 * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), */ __pyx_tuple__225 = PyTuple_Pack(3, __pyx_int_204, __pyx_int_204, __pyx_int_204); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__225); __Pyx_GIVEREF(__pyx_tuple__225); /* "include/color_dict.pxi":238 * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), */ __pyx_tuple__226 = PyTuple_Pack(3, __pyx_int_207, __pyx_int_207, __pyx_int_207); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__226); __Pyx_GIVEREF(__pyx_tuple__226); /* "include/color_dict.pxi":239 * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), */ __pyx_tuple__227 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_209, __pyx_int_209); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(2, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__227); __Pyx_GIVEREF(__pyx_tuple__227); /* "include/color_dict.pxi":240 * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), */ __pyx_tuple__228 = PyTuple_Pack(3, __pyx_int_212, __pyx_int_212, __pyx_int_212); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(2, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__228); __Pyx_GIVEREF(__pyx_tuple__228); /* "include/color_dict.pxi":241 * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), */ __pyx_tuple__229 = PyTuple_Pack(3, __pyx_int_214, __pyx_int_214, __pyx_int_214); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(2, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__229); __Pyx_GIVEREF(__pyx_tuple__229); /* "include/color_dict.pxi":242 * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), */ __pyx_tuple__230 = PyTuple_Pack(3, __pyx_int_217, __pyx_int_217, __pyx_int_217); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(2, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__230); __Pyx_GIVEREF(__pyx_tuple__230); /* "include/color_dict.pxi":243 * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), */ __pyx_tuple__231 = PyTuple_Pack(3, __pyx_int_219, __pyx_int_219, __pyx_int_219); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(2, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__231); __Pyx_GIVEREF(__pyx_tuple__231); /* "include/color_dict.pxi":244 * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), */ __pyx_tuple__232 = PyTuple_Pack(3, __pyx_int_222, __pyx_int_222, __pyx_int_222); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(2, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__232); __Pyx_GIVEREF(__pyx_tuple__232); /* "include/color_dict.pxi":245 * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), */ __pyx_tuple__233 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_224, __pyx_int_224); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(2, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__233); __Pyx_GIVEREF(__pyx_tuple__233); /* "include/color_dict.pxi":246 * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), */ __pyx_tuple__234 = PyTuple_Pack(3, __pyx_int_227, __pyx_int_227, __pyx_int_227); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(2, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__234); __Pyx_GIVEREF(__pyx_tuple__234); /* "include/color_dict.pxi":247 * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), */ __pyx_tuple__235 = PyTuple_Pack(3, __pyx_int_23, __pyx_int_23, __pyx_int_23); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__235); __Pyx_GIVEREF(__pyx_tuple__235); /* "include/color_dict.pxi":248 * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), */ __pyx_tuple__236 = PyTuple_Pack(3, __pyx_int_229, __pyx_int_229, __pyx_int_229); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(2, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__236); __Pyx_GIVEREF(__pyx_tuple__236); /* "include/color_dict.pxi":249 * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), */ __pyx_tuple__237 = PyTuple_Pack(3, __pyx_int_232, __pyx_int_232, __pyx_int_232); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(2, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__237); __Pyx_GIVEREF(__pyx_tuple__237); /* "include/color_dict.pxi":250 * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), */ __pyx_tuple__238 = PyTuple_Pack(3, __pyx_int_235, __pyx_int_235, __pyx_int_235); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__238); __Pyx_GIVEREF(__pyx_tuple__238); /* "include/color_dict.pxi":251 * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), */ __pyx_tuple__239 = PyTuple_Pack(3, __pyx_int_237, __pyx_int_237, __pyx_int_237); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(2, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__239); __Pyx_GIVEREF(__pyx_tuple__239); /* "include/color_dict.pxi":252 * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), */ __pyx_tuple__240 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_240, __pyx_int_240); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__240); __Pyx_GIVEREF(__pyx_tuple__240); /* "include/color_dict.pxi":253 * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), */ __pyx_tuple__241 = PyTuple_Pack(3, __pyx_int_242, __pyx_int_242, __pyx_int_242); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(2, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__241); __Pyx_GIVEREF(__pyx_tuple__241); /* "include/color_dict.pxi":254 * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), */ __pyx_tuple__242 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_245, __pyx_int_245); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(2, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__242); __Pyx_GIVEREF(__pyx_tuple__242); /* "include/color_dict.pxi":255 * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), */ __pyx_tuple__243 = PyTuple_Pack(3, __pyx_int_247, __pyx_int_247, __pyx_int_247); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(2, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__243); __Pyx_GIVEREF(__pyx_tuple__243); /* "include/color_dict.pxi":256 * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), */ __pyx_tuple__244 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_250, __pyx_int_250); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(2, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__244); __Pyx_GIVEREF(__pyx_tuple__244); /* "include/color_dict.pxi":257 * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), */ __pyx_tuple__245 = PyTuple_Pack(3, __pyx_int_252, __pyx_int_252, __pyx_int_252); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(2, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__245); __Pyx_GIVEREF(__pyx_tuple__245); /* "include/color_dict.pxi":258 * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), */ __pyx_tuple__246 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(2, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__246); __Pyx_GIVEREF(__pyx_tuple__246); /* "include/color_dict.pxi":260 * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), # <<<<<<<<<<<<<< * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), */ __pyx_tuple__247 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_238, __pyx_int_0); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(2, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__247); __Pyx_GIVEREF(__pyx_tuple__247); /* "include/color_dict.pxi":261 * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), # <<<<<<<<<<<<<< * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), */ __pyx_tuple__248 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_205, __pyx_int_0); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(2, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__248); __Pyx_GIVEREF(__pyx_tuple__248); /* "include/color_dict.pxi":262 * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), # <<<<<<<<<<<<<< * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), */ __pyx_tuple__249 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_0); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(2, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__249); __Pyx_GIVEREF(__pyx_tuple__249); /* "include/color_dict.pxi":263 * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), # <<<<<<<<<<<<<< * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), */ __pyx_tuple__250 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_255, __pyx_int_47); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(2, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__250); __Pyx_GIVEREF(__pyx_tuple__250); /* "include/color_dict.pxi":366 * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), */ __pyx_tuple__251 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_255, __pyx_int_240); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(2, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__251); __Pyx_GIVEREF(__pyx_tuple__251); /* "include/color_dict.pxi":368 * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), # <<<<<<<<<<<<<< * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), */ __pyx_tuple__252 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_238, __pyx_int_224); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(2, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__252); __Pyx_GIVEREF(__pyx_tuple__252); /* "include/color_dict.pxi":369 * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), # <<<<<<<<<<<<<< * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), */ __pyx_tuple__253 = PyTuple_Pack(3, __pyx_int_193, __pyx_int_205, __pyx_int_193); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(2, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__253); __Pyx_GIVEREF(__pyx_tuple__253); /* "include/color_dict.pxi":370 * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), # <<<<<<<<<<<<<< * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), */ __pyx_tuple__254 = PyTuple_Pack(3, __pyx_int_131, __pyx_int_139, __pyx_int_131); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(2, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__254); __Pyx_GIVEREF(__pyx_tuple__254); /* "include/color_dict.pxi":371 * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), # <<<<<<<<<<<<<< * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), */ __pyx_tuple__255 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_105, __pyx_int_180); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(2, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__255); __Pyx_GIVEREF(__pyx_tuple__255); /* "include/color_dict.pxi":372 * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), # <<<<<<<<<<<<<< * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), */ __pyx_tuple__256 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_110, __pyx_int_180); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(2, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__256); __Pyx_GIVEREF(__pyx_tuple__256); /* "include/color_dict.pxi":373 * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), # <<<<<<<<<<<<<< * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), */ __pyx_tuple__257 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_106, __pyx_int_167); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(2, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__257); __Pyx_GIVEREF(__pyx_tuple__257); /* "include/color_dict.pxi":374 * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), # <<<<<<<<<<<<<< * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), */ __pyx_tuple__258 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_96, __pyx_int_144); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(2, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__258); __Pyx_GIVEREF(__pyx_tuple__258); /* "include/color_dict.pxi":375 * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), # <<<<<<<<<<<<<< * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), */ __pyx_tuple__259 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_58, __pyx_int_98); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(2, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__259); __Pyx_GIVEREF(__pyx_tuple__259); /* "include/color_dict.pxi":376 * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), # <<<<<<<<<<<<<< * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), */ __pyx_tuple__260 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_92, __pyx_int_92); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(2, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__260); __Pyx_GIVEREF(__pyx_tuple__260); /* "include/color_dict.pxi":377 * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), # <<<<<<<<<<<<<< * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), */ __pyx_tuple__261 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_106, __pyx_int_106); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(2, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__261); __Pyx_GIVEREF(__pyx_tuple__261); /* "include/color_dict.pxi":378 * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), # <<<<<<<<<<<<<< * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), */ __pyx_tuple__262 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_99, __pyx_int_99); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(2, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__262); __Pyx_GIVEREF(__pyx_tuple__262); /* "include/color_dict.pxi":379 * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), # <<<<<<<<<<<<<< * 'indianred4' : (139, 58, 58), * 'ivory' : (255, 255, 240), */ __pyx_tuple__263 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_85, __pyx_int_85); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(2, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__263); __Pyx_GIVEREF(__pyx_tuple__263); /* "include/color_dict.pxi":380 * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), # <<<<<<<<<<<<<< * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), */ __pyx_tuple__264 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_58, __pyx_int_58); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(2, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__264); __Pyx_GIVEREF(__pyx_tuple__264); /* "include/color_dict.pxi":381 * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), * 'ivory' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), */ __pyx_tuple__265 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_240); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(2, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__265); __Pyx_GIVEREF(__pyx_tuple__265); /* "include/color_dict.pxi":383 * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), # <<<<<<<<<<<<<< * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), */ __pyx_tuple__266 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_238, __pyx_int_224); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(2, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__266); __Pyx_GIVEREF(__pyx_tuple__266); /* "include/color_dict.pxi":384 * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), # <<<<<<<<<<<<<< * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), */ __pyx_tuple__267 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_205, __pyx_int_193); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(2, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__267); __Pyx_GIVEREF(__pyx_tuple__267); /* "include/color_dict.pxi":385 * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), # <<<<<<<<<<<<<< * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), */ __pyx_tuple__268 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_139, __pyx_int_131); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(2, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__268); __Pyx_GIVEREF(__pyx_tuple__268); /* "include/color_dict.pxi":386 * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), # <<<<<<<<<<<<<< * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), */ __pyx_tuple__269 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_230, __pyx_int_140); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(2, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__269); __Pyx_GIVEREF(__pyx_tuple__269); /* "include/color_dict.pxi":387 * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), # <<<<<<<<<<<<<< * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), */ __pyx_tuple__270 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_246, __pyx_int_143); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(2, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__270); __Pyx_GIVEREF(__pyx_tuple__270); /* "include/color_dict.pxi":388 * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), # <<<<<<<<<<<<<< * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), */ __pyx_tuple__271 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_230, __pyx_int_133); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(2, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__271); __Pyx_GIVEREF(__pyx_tuple__271); /* "include/color_dict.pxi":389 * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), # <<<<<<<<<<<<<< * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), */ __pyx_tuple__272 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_198, __pyx_int_115); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(2, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__272); __Pyx_GIVEREF(__pyx_tuple__272); /* "include/color_dict.pxi":390 * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), # <<<<<<<<<<<<<< * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), */ __pyx_tuple__273 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_134, __pyx_int_78); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(2, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__273); __Pyx_GIVEREF(__pyx_tuple__273); /* "include/color_dict.pxi":391 * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), # <<<<<<<<<<<<<< * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), */ __pyx_tuple__274 = PyTuple_Pack(3, __pyx_int_230, __pyx_int_230, __pyx_int_250); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(2, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__274); __Pyx_GIVEREF(__pyx_tuple__274); /* "include/color_dict.pxi":392 * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), */ __pyx_tuple__275 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_240, __pyx_int_245); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(2, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__275); __Pyx_GIVEREF(__pyx_tuple__275); /* "include/color_dict.pxi":394 * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), # <<<<<<<<<<<<<< * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), */ __pyx_tuple__276 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_224, __pyx_int_229); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(2, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__276); __Pyx_GIVEREF(__pyx_tuple__276); /* "include/color_dict.pxi":395 * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), # <<<<<<<<<<<<<< * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), */ __pyx_tuple__277 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_193, __pyx_int_197); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(2, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__277); __Pyx_GIVEREF(__pyx_tuple__277); /* "include/color_dict.pxi":396 * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), # <<<<<<<<<<<<<< * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), */ __pyx_tuple__278 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_131, __pyx_int_134); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(2, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__278); __Pyx_GIVEREF(__pyx_tuple__278); /* "include/color_dict.pxi":397 * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), # <<<<<<<<<<<<<< * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), */ __pyx_tuple__279 = PyTuple_Pack(3, __pyx_int_124, __pyx_int_252, __pyx_int_0); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(2, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__279); __Pyx_GIVEREF(__pyx_tuple__279); /* "include/color_dict.pxi":398 * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), */ __pyx_tuple__280 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_205); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(2, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__280); __Pyx_GIVEREF(__pyx_tuple__280); /* "include/color_dict.pxi":400 * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), # <<<<<<<<<<<<<< * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), */ __pyx_tuple__281 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_233, __pyx_int_191); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(2, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__281); __Pyx_GIVEREF(__pyx_tuple__281); /* "include/color_dict.pxi":401 * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), # <<<<<<<<<<<<<< * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), */ __pyx_tuple__282 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_201, __pyx_int_165); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(2, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__282); __Pyx_GIVEREF(__pyx_tuple__282); /* "include/color_dict.pxi":402 * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), # <<<<<<<<<<<<<< * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), */ __pyx_tuple__283 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_137, __pyx_int_112); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(2, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__283); __Pyx_GIVEREF(__pyx_tuple__283); /* "include/color_dict.pxi":403 * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), # <<<<<<<<<<<<<< * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), */ __pyx_tuple__284 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_216, __pyx_int_230); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(2, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__284); __Pyx_GIVEREF(__pyx_tuple__284); /* "include/color_dict.pxi":404 * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), # <<<<<<<<<<<<<< * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), */ __pyx_tuple__285 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_239, __pyx_int_255); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(2, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__285); __Pyx_GIVEREF(__pyx_tuple__285); /* "include/color_dict.pxi":405 * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), # <<<<<<<<<<<<<< * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), */ __pyx_tuple__286 = PyTuple_Pack(3, __pyx_int_178, __pyx_int_223, __pyx_int_238); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(2, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__286); __Pyx_GIVEREF(__pyx_tuple__286); /* "include/color_dict.pxi":406 * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), # <<<<<<<<<<<<<< * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), */ __pyx_tuple__287 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_192, __pyx_int_205); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(2, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__287); __Pyx_GIVEREF(__pyx_tuple__287); /* "include/color_dict.pxi":407 * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), # <<<<<<<<<<<<<< * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), */ __pyx_tuple__288 = PyTuple_Pack(3, __pyx_int_104, __pyx_int_131, __pyx_int_139); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(2, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__288); __Pyx_GIVEREF(__pyx_tuple__288); /* "include/color_dict.pxi":408 * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), # <<<<<<<<<<<<<< * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), */ __pyx_tuple__289 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_128, __pyx_int_128); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(2, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__289); __Pyx_GIVEREF(__pyx_tuple__289); /* "include/color_dict.pxi":409 * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), */ __pyx_tuple__290 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__290); __Pyx_GIVEREF(__pyx_tuple__290); /* "include/color_dict.pxi":411 * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), # <<<<<<<<<<<<<< * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), */ __pyx_tuple__291 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(2, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__291); __Pyx_GIVEREF(__pyx_tuple__291); /* "include/color_dict.pxi":412 * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), # <<<<<<<<<<<<<< * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), */ __pyx_tuple__292 = PyTuple_Pack(3, __pyx_int_180, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(2, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__292); __Pyx_GIVEREF(__pyx_tuple__292); /* "include/color_dict.pxi":413 * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), */ __pyx_tuple__293 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(2, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__293); __Pyx_GIVEREF(__pyx_tuple__293); /* "include/color_dict.pxi":414 * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), */ __pyx_tuple__294 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_221, __pyx_int_130); if (unlikely(!__pyx_tuple__294)) __PYX_ERR(2, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__294); __Pyx_GIVEREF(__pyx_tuple__294); /* "include/color_dict.pxi":415 * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), */ __pyx_tuple__295 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_236, __pyx_int_139); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(2, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__295); __Pyx_GIVEREF(__pyx_tuple__295); /* "include/color_dict.pxi":416 * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), */ __pyx_tuple__296 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_220, __pyx_int_130); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(2, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__296); __Pyx_GIVEREF(__pyx_tuple__296); /* "include/color_dict.pxi":417 * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), # <<<<<<<<<<<<<< * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), */ __pyx_tuple__297 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_190, __pyx_int_112); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(2, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__297); __Pyx_GIVEREF(__pyx_tuple__297); /* "include/color_dict.pxi":418 * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), # <<<<<<<<<<<<<< * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), */ __pyx_tuple__298 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_129, __pyx_int_76); if (unlikely(!__pyx_tuple__298)) __PYX_ERR(2, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__298); __Pyx_GIVEREF(__pyx_tuple__298); /* "include/color_dict.pxi":419 * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), # <<<<<<<<<<<<<< * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), */ __pyx_tuple__299 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_250, __pyx_int_210); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(2, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__299); __Pyx_GIVEREF(__pyx_tuple__299); /* "include/color_dict.pxi":420 * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), */ __pyx_tuple__300 = PyTuple_Pack(3, __pyx_int_211, __pyx_int_211, __pyx_int_211); if (unlikely(!__pyx_tuple__300)) __PYX_ERR(2, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__300); __Pyx_GIVEREF(__pyx_tuple__300); /* "include/color_dict.pxi":421 * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), # <<<<<<<<<<<<<< * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), */ __pyx_tuple__301 = PyTuple_Pack(3, __pyx_int_144, __pyx_int_238, __pyx_int_144); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(2, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__301); __Pyx_GIVEREF(__pyx_tuple__301); /* "include/color_dict.pxi":423 * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), # <<<<<<<<<<<<<< * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), */ __pyx_tuple__302 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_182, __pyx_int_193); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(2, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__302); __Pyx_GIVEREF(__pyx_tuple__302); /* "include/color_dict.pxi":424 * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), # <<<<<<<<<<<<<< * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), */ __pyx_tuple__303 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_174, __pyx_int_185); if (unlikely(!__pyx_tuple__303)) __PYX_ERR(2, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__303); __Pyx_GIVEREF(__pyx_tuple__303); /* "include/color_dict.pxi":425 * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), # <<<<<<<<<<<<<< * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), */ __pyx_tuple__304 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_162, __pyx_int_173); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(2, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__304); __Pyx_GIVEREF(__pyx_tuple__304); /* "include/color_dict.pxi":426 * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), # <<<<<<<<<<<<<< * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), */ __pyx_tuple__305 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_140, __pyx_int_149); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(2, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__305); __Pyx_GIVEREF(__pyx_tuple__305); /* "include/color_dict.pxi":427 * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), # <<<<<<<<<<<<<< * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), */ __pyx_tuple__306 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_95, __pyx_int_101); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(2, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__306); __Pyx_GIVEREF(__pyx_tuple__306); /* "include/color_dict.pxi":428 * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), */ __pyx_tuple__307 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_160, __pyx_int_122); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(2, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__307); __Pyx_GIVEREF(__pyx_tuple__307); /* "include/color_dict.pxi":430 * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), # <<<<<<<<<<<<<< * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), */ __pyx_tuple__308 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_149, __pyx_int_114); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(2, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__308); __Pyx_GIVEREF(__pyx_tuple__308); /* "include/color_dict.pxi":431 * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), # <<<<<<<<<<<<<< * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), */ __pyx_tuple__309 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_129, __pyx_int_98); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(2, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__309); __Pyx_GIVEREF(__pyx_tuple__309); /* "include/color_dict.pxi":432 * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), # <<<<<<<<<<<<<< * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), */ __pyx_tuple__310 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_87, __pyx_int_66); if (unlikely(!__pyx_tuple__310)) __PYX_ERR(2, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__310); __Pyx_GIVEREF(__pyx_tuple__310); /* "include/color_dict.pxi":433 * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), # <<<<<<<<<<<<<< * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), */ __pyx_tuple__311 = PyTuple_Pack(3, __pyx_int_32, __pyx_int_178, __pyx_int_170); if (unlikely(!__pyx_tuple__311)) __PYX_ERR(2, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__311); __Pyx_GIVEREF(__pyx_tuple__311); /* "include/color_dict.pxi":434 * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), # <<<<<<<<<<<<<< * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), */ __pyx_tuple__312 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_206, __pyx_int_250); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(2, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__312); __Pyx_GIVEREF(__pyx_tuple__312); /* "include/color_dict.pxi":435 * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), # <<<<<<<<<<<<<< * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), */ __pyx_tuple__313 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_226, __pyx_int_255); if (unlikely(!__pyx_tuple__313)) __PYX_ERR(2, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__313); __Pyx_GIVEREF(__pyx_tuple__313); /* "include/color_dict.pxi":436 * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), # <<<<<<<<<<<<<< * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), */ __pyx_tuple__314 = PyTuple_Pack(3, __pyx_int_164, __pyx_int_211, __pyx_int_238); if (unlikely(!__pyx_tuple__314)) __PYX_ERR(2, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__314); __Pyx_GIVEREF(__pyx_tuple__314); /* "include/color_dict.pxi":437 * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), # <<<<<<<<<<<<<< * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), */ __pyx_tuple__315 = PyTuple_Pack(3, __pyx_int_141, __pyx_int_182, __pyx_int_205); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(2, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__315); __Pyx_GIVEREF(__pyx_tuple__315); /* "include/color_dict.pxi":438 * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), # <<<<<<<<<<<<<< * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), */ __pyx_tuple__316 = PyTuple_Pack(3, __pyx_int_96, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__316)) __PYX_ERR(2, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__316); __Pyx_GIVEREF(__pyx_tuple__316); /* "include/color_dict.pxi":439 * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), # <<<<<<<<<<<<<< * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), */ __pyx_tuple__317 = PyTuple_Pack(3, __pyx_int_132, __pyx_int_112, __pyx_int_255); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(2, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__317); __Pyx_GIVEREF(__pyx_tuple__317); /* "include/color_dict.pxi":440 * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), */ __pyx_tuple__318 = PyTuple_Pack(3, __pyx_int_119, __pyx_int_136, __pyx_int_153); if (unlikely(!__pyx_tuple__318)) __PYX_ERR(2, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__318); __Pyx_GIVEREF(__pyx_tuple__318); /* "include/color_dict.pxi":442 * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), # <<<<<<<<<<<<<< * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), */ __pyx_tuple__319 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_196, __pyx_int_222); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(2, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__319); __Pyx_GIVEREF(__pyx_tuple__319); /* "include/color_dict.pxi":443 * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), # <<<<<<<<<<<<<< * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), */ __pyx_tuple__320 = PyTuple_Pack(3, __pyx_int_202, __pyx_int_225, __pyx_int_255); if (unlikely(!__pyx_tuple__320)) __PYX_ERR(2, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__320); __Pyx_GIVEREF(__pyx_tuple__320); /* "include/color_dict.pxi":444 * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), # <<<<<<<<<<<<<< * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), */ __pyx_tuple__321 = PyTuple_Pack(3, __pyx_int_188, __pyx_int_210, __pyx_int_238); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(2, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__321); __Pyx_GIVEREF(__pyx_tuple__321); /* "include/color_dict.pxi":445 * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), # <<<<<<<<<<<<<< * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), */ __pyx_tuple__322 = PyTuple_Pack(3, __pyx_int_162, __pyx_int_181, __pyx_int_205); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(2, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__322); __Pyx_GIVEREF(__pyx_tuple__322); /* "include/color_dict.pxi":446 * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), # <<<<<<<<<<<<<< * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), */ __pyx_tuple__323 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(2, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__323); __Pyx_GIVEREF(__pyx_tuple__323); /* "include/color_dict.pxi":447 * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), */ __pyx_tuple__324 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_224); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(2, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__324); __Pyx_GIVEREF(__pyx_tuple__324); /* "include/color_dict.pxi":449 * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), # <<<<<<<<<<<<<< * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), */ __pyx_tuple__325 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_238, __pyx_int_209); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__325); __Pyx_GIVEREF(__pyx_tuple__325); /* "include/color_dict.pxi":450 * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), # <<<<<<<<<<<<<< * 'lightyellow4' : (139, 139, 122), * 'limegreen' : (50, 205, 50), */ __pyx_tuple__326 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_205, __pyx_int_180); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(2, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__326); __Pyx_GIVEREF(__pyx_tuple__326); /* "include/color_dict.pxi":451 * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), # <<<<<<<<<<<<<< * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), */ __pyx_tuple__327 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_139, __pyx_int_122); if (unlikely(!__pyx_tuple__327)) __PYX_ERR(2, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__327); __Pyx_GIVEREF(__pyx_tuple__327); /* "include/color_dict.pxi":452 * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), * 'limegreen' : (50, 205, 50), # <<<<<<<<<<<<<< * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), */ __pyx_tuple__328 = PyTuple_Pack(3, __pyx_int_50, __pyx_int_205, __pyx_int_50); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(2, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__328); __Pyx_GIVEREF(__pyx_tuple__328); /* "include/color_dict.pxi":453 * 'lightyellow4' : (139, 139, 122), * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), # <<<<<<<<<<<<<< * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), */ __pyx_tuple__329 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_240, __pyx_int_230); if (unlikely(!__pyx_tuple__329)) __PYX_ERR(2, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__329); __Pyx_GIVEREF(__pyx_tuple__329); /* "include/color_dict.pxi":454 * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), */ __pyx_tuple__330 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(2, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__330); __Pyx_GIVEREF(__pyx_tuple__330); /* "include/color_dict.pxi":456 * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), # <<<<<<<<<<<<<< * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), */ __pyx_tuple__331 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_0, __pyx_int_238); if (unlikely(!__pyx_tuple__331)) __PYX_ERR(2, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__331); __Pyx_GIVEREF(__pyx_tuple__331); /* "include/color_dict.pxi":457 * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), # <<<<<<<<<<<<<< * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), */ __pyx_tuple__332 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_0, __pyx_int_205); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(2, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__332); __Pyx_GIVEREF(__pyx_tuple__332); /* "include/color_dict.pxi":459 * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), # <<<<<<<<<<<<<< * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), */ __pyx_tuple__333 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_48, __pyx_int_96); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(2, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__333); __Pyx_GIVEREF(__pyx_tuple__333); /* "include/color_dict.pxi":460 * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), # <<<<<<<<<<<<<< * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), */ __pyx_tuple__334 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_52, __pyx_int_179); if (unlikely(!__pyx_tuple__334)) __PYX_ERR(2, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__334); __Pyx_GIVEREF(__pyx_tuple__334); /* "include/color_dict.pxi":461 * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), # <<<<<<<<<<<<<< * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), */ __pyx_tuple__335 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_48, __pyx_int_167); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(2, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__335); __Pyx_GIVEREF(__pyx_tuple__335); /* "include/color_dict.pxi":462 * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), # <<<<<<<<<<<<<< * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), */ __pyx_tuple__336 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_41, __pyx_int_144); if (unlikely(!__pyx_tuple__336)) __PYX_ERR(2, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__336); __Pyx_GIVEREF(__pyx_tuple__336); /* "include/color_dict.pxi":463 * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), # <<<<<<<<<<<<<< * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), */ __pyx_tuple__337 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_28, __pyx_int_98); if (unlikely(!__pyx_tuple__337)) __PYX_ERR(2, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__337); __Pyx_GIVEREF(__pyx_tuple__337); /* "include/color_dict.pxi":466 * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), # <<<<<<<<<<<<<< * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), */ __pyx_tuple__338 = PyTuple_Pack(3, __pyx_int_186, __pyx_int_85, __pyx_int_211); if (unlikely(!__pyx_tuple__338)) __PYX_ERR(2, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__338); __Pyx_GIVEREF(__pyx_tuple__338); /* "include/color_dict.pxi":467 * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), # <<<<<<<<<<<<<< * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), */ __pyx_tuple__339 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_102, __pyx_int_255); if (unlikely(!__pyx_tuple__339)) __PYX_ERR(2, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__339); __Pyx_GIVEREF(__pyx_tuple__339); /* "include/color_dict.pxi":468 * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), # <<<<<<<<<<<<<< * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), */ __pyx_tuple__340 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_95, __pyx_int_238); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(2, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__340); __Pyx_GIVEREF(__pyx_tuple__340); /* "include/color_dict.pxi":469 * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), # <<<<<<<<<<<<<< * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), */ __pyx_tuple__341 = PyTuple_Pack(3, __pyx_int_180, __pyx_int_82, __pyx_int_205); if (unlikely(!__pyx_tuple__341)) __PYX_ERR(2, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__341); __Pyx_GIVEREF(__pyx_tuple__341); /* "include/color_dict.pxi":470 * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), # <<<<<<<<<<<<<< * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), */ __pyx_tuple__342 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_55, __pyx_int_139); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(2, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__342); __Pyx_GIVEREF(__pyx_tuple__342); /* "include/color_dict.pxi":471 * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), # <<<<<<<<<<<<<< * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), */ __pyx_tuple__343 = PyTuple_Pack(3, __pyx_int_147, __pyx_int_112, __pyx_int_219); if (unlikely(!__pyx_tuple__343)) __PYX_ERR(2, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__343); __Pyx_GIVEREF(__pyx_tuple__343); /* "include/color_dict.pxi":472 * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), # <<<<<<<<<<<<<< * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), */ __pyx_tuple__344 = PyTuple_Pack(3, __pyx_int_171, __pyx_int_130, __pyx_int_255); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(2, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__344); __Pyx_GIVEREF(__pyx_tuple__344); /* "include/color_dict.pxi":473 * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), # <<<<<<<<<<<<<< * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), */ __pyx_tuple__345 = PyTuple_Pack(3, __pyx_int_159, __pyx_int_121, __pyx_int_238); if (unlikely(!__pyx_tuple__345)) __PYX_ERR(2, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__345); __Pyx_GIVEREF(__pyx_tuple__345); /* "include/color_dict.pxi":474 * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), # <<<<<<<<<<<<<< * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), */ __pyx_tuple__346 = PyTuple_Pack(3, __pyx_int_137, __pyx_int_104, __pyx_int_205); if (unlikely(!__pyx_tuple__346)) __PYX_ERR(2, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__346); __Pyx_GIVEREF(__pyx_tuple__346); /* "include/color_dict.pxi":475 * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), # <<<<<<<<<<<<<< * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), */ __pyx_tuple__347 = PyTuple_Pack(3, __pyx_int_93, __pyx_int_71, __pyx_int_139); if (unlikely(!__pyx_tuple__347)) __PYX_ERR(2, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__347); __Pyx_GIVEREF(__pyx_tuple__347); /* "include/color_dict.pxi":476 * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), # <<<<<<<<<<<<<< * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), */ __pyx_tuple__348 = PyTuple_Pack(3, __pyx_int_60, __pyx_int_179, __pyx_int_113); if (unlikely(!__pyx_tuple__348)) __PYX_ERR(2, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__348); __Pyx_GIVEREF(__pyx_tuple__348); /* "include/color_dict.pxi":477 * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), # <<<<<<<<<<<<<< * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), */ __pyx_tuple__349 = PyTuple_Pack(3, __pyx_int_123, __pyx_int_104, __pyx_int_238); if (unlikely(!__pyx_tuple__349)) __PYX_ERR(2, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__349); __Pyx_GIVEREF(__pyx_tuple__349); /* "include/color_dict.pxi":478 * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), # <<<<<<<<<<<<<< * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), */ __pyx_tuple__350 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_250, __pyx_int_154); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(2, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__350); __Pyx_GIVEREF(__pyx_tuple__350); /* "include/color_dict.pxi":479 * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), # <<<<<<<<<<<<<< * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), */ __pyx_tuple__351 = PyTuple_Pack(3, __pyx_int_72, __pyx_int_209, __pyx_int_204); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(2, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__351); __Pyx_GIVEREF(__pyx_tuple__351); /* "include/color_dict.pxi":480 * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), # <<<<<<<<<<<<<< * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), */ __pyx_tuple__352 = PyTuple_Pack(3, __pyx_int_199, __pyx_int_21, __pyx_int_133); if (unlikely(!__pyx_tuple__352)) __PYX_ERR(2, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__352); __Pyx_GIVEREF(__pyx_tuple__352); /* "include/color_dict.pxi":481 * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), # <<<<<<<<<<<<<< * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), */ __pyx_tuple__353 = PyTuple_Pack(3, __pyx_int_25, __pyx_int_25, __pyx_int_112); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(2, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__353); __Pyx_GIVEREF(__pyx_tuple__353); /* "include/color_dict.pxi":482 * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), # <<<<<<<<<<<<<< * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), */ __pyx_tuple__354 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_255, __pyx_int_250); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(2, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__354); __Pyx_GIVEREF(__pyx_tuple__354); /* "include/color_dict.pxi":483 * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), */ __pyx_tuple__355 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_225); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(2, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__355); __Pyx_GIVEREF(__pyx_tuple__355); /* "include/color_dict.pxi":485 * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), # <<<<<<<<<<<<<< * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), */ __pyx_tuple__356 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_213, __pyx_int_210); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(2, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__356); __Pyx_GIVEREF(__pyx_tuple__356); /* "include/color_dict.pxi":486 * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), # <<<<<<<<<<<<<< * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), */ __pyx_tuple__357 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_183, __pyx_int_181); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(2, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__357); __Pyx_GIVEREF(__pyx_tuple__357); /* "include/color_dict.pxi":487 * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), # <<<<<<<<<<<<<< * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), */ __pyx_tuple__358 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_125, __pyx_int_123); if (unlikely(!__pyx_tuple__358)) __PYX_ERR(2, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__358); __Pyx_GIVEREF(__pyx_tuple__358); /* "include/color_dict.pxi":488 * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), # <<<<<<<<<<<<<< * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), */ __pyx_tuple__359 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_181); if (unlikely(!__pyx_tuple__359)) __PYX_ERR(2, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__359); __Pyx_GIVEREF(__pyx_tuple__359); /* "include/color_dict.pxi":489 * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), */ __pyx_tuple__360 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_222, __pyx_int_173); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(2, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__360); __Pyx_GIVEREF(__pyx_tuple__360); /* "include/color_dict.pxi":491 * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), # <<<<<<<<<<<<<< * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), */ __pyx_tuple__361 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_207, __pyx_int_161); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(2, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__361); __Pyx_GIVEREF(__pyx_tuple__361); /* "include/color_dict.pxi":492 * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), # <<<<<<<<<<<<<< * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), */ __pyx_tuple__362 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_179, __pyx_int_139); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(2, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__362); __Pyx_GIVEREF(__pyx_tuple__362); /* "include/color_dict.pxi":493 * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), # <<<<<<<<<<<<<< * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), */ __pyx_tuple__363 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_121, __pyx_int_94); if (unlikely(!__pyx_tuple__363)) __PYX_ERR(2, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__363); __Pyx_GIVEREF(__pyx_tuple__363); /* "include/color_dict.pxi":494 * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), # <<<<<<<<<<<<<< * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), */ __pyx_tuple__364 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_128); if (unlikely(!__pyx_tuple__364)) __PYX_ERR(2, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__364); __Pyx_GIVEREF(__pyx_tuple__364); /* "include/color_dict.pxi":496 * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), # <<<<<<<<<<<<<< * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), */ __pyx_tuple__365 = PyTuple_Pack(3, __pyx_int_253, __pyx_int_245, __pyx_int_230); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(2, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__365); __Pyx_GIVEREF(__pyx_tuple__365); /* "include/color_dict.pxi":497 * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), * 'olivedrab' : (107, 142, 35), # <<<<<<<<<<<<<< * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), */ __pyx_tuple__366 = PyTuple_Pack(3, __pyx_int_107, __pyx_int_142, __pyx_int_35); if (unlikely(!__pyx_tuple__366)) __PYX_ERR(2, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__366); __Pyx_GIVEREF(__pyx_tuple__366); /* "include/color_dict.pxi":498 * 'oldlace' : (253, 245, 230), * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), # <<<<<<<<<<<<<< * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), */ __pyx_tuple__367 = PyTuple_Pack(3, __pyx_int_192, __pyx_int_255, __pyx_int_62); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(2, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__367); __Pyx_GIVEREF(__pyx_tuple__367); /* "include/color_dict.pxi":499 * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), # <<<<<<<<<<<<<< * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), */ __pyx_tuple__368 = PyTuple_Pack(3, __pyx_int_179, __pyx_int_238, __pyx_int_58); if (unlikely(!__pyx_tuple__368)) __PYX_ERR(2, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__368); __Pyx_GIVEREF(__pyx_tuple__368); /* "include/color_dict.pxi":500 * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), # <<<<<<<<<<<<<< * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), */ __pyx_tuple__369 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_205, __pyx_int_50); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(2, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__369); __Pyx_GIVEREF(__pyx_tuple__369); /* "include/color_dict.pxi":501 * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), # <<<<<<<<<<<<<< * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), */ __pyx_tuple__370 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_139, __pyx_int_34); if (unlikely(!__pyx_tuple__370)) __PYX_ERR(2, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__370); __Pyx_GIVEREF(__pyx_tuple__370); /* "include/color_dict.pxi":502 * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), */ __pyx_tuple__371 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_165, __pyx_int_0); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(2, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__371); __Pyx_GIVEREF(__pyx_tuple__371); /* "include/color_dict.pxi":504 * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), # <<<<<<<<<<<<<< * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), */ __pyx_tuple__372 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_154, __pyx_int_0); if (unlikely(!__pyx_tuple__372)) __PYX_ERR(2, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__372); __Pyx_GIVEREF(__pyx_tuple__372); /* "include/color_dict.pxi":505 * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), # <<<<<<<<<<<<<< * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), */ __pyx_tuple__373 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_133, __pyx_int_0); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(2, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__373); __Pyx_GIVEREF(__pyx_tuple__373); /* "include/color_dict.pxi":506 * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), # <<<<<<<<<<<<<< * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), */ __pyx_tuple__374 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_90, __pyx_int_0); if (unlikely(!__pyx_tuple__374)) __PYX_ERR(2, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__374); __Pyx_GIVEREF(__pyx_tuple__374); /* "include/color_dict.pxi":507 * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), */ __pyx_tuple__375 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_69, __pyx_int_0); if (unlikely(!__pyx_tuple__375)) __PYX_ERR(2, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__375); __Pyx_GIVEREF(__pyx_tuple__375); /* "include/color_dict.pxi":509 * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), # <<<<<<<<<<<<<< * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), */ __pyx_tuple__376 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_64, __pyx_int_0); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(2, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__376); __Pyx_GIVEREF(__pyx_tuple__376); /* "include/color_dict.pxi":510 * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), # <<<<<<<<<<<<<< * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), */ __pyx_tuple__377 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_55, __pyx_int_0); if (unlikely(!__pyx_tuple__377)) __PYX_ERR(2, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__377); __Pyx_GIVEREF(__pyx_tuple__377); /* "include/color_dict.pxi":511 * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), # <<<<<<<<<<<<<< * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), */ __pyx_tuple__378 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_37, __pyx_int_0); if (unlikely(!__pyx_tuple__378)) __PYX_ERR(2, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__378); __Pyx_GIVEREF(__pyx_tuple__378); /* "include/color_dict.pxi":512 * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), # <<<<<<<<<<<<<< * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), */ __pyx_tuple__379 = PyTuple_Pack(3, __pyx_int_218, __pyx_int_112, __pyx_int_214); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__379); __Pyx_GIVEREF(__pyx_tuple__379); /* "include/color_dict.pxi":513 * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), # <<<<<<<<<<<<<< * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), */ __pyx_tuple__380 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_131, __pyx_int_250); if (unlikely(!__pyx_tuple__380)) __PYX_ERR(2, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__380); __Pyx_GIVEREF(__pyx_tuple__380); /* "include/color_dict.pxi":514 * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), # <<<<<<<<<<<<<< * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), */ __pyx_tuple__381 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_122, __pyx_int_233); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__381); __Pyx_GIVEREF(__pyx_tuple__381); /* "include/color_dict.pxi":515 * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), # <<<<<<<<<<<<<< * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), */ __pyx_tuple__382 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_105, __pyx_int_201); if (unlikely(!__pyx_tuple__382)) __PYX_ERR(2, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__382); __Pyx_GIVEREF(__pyx_tuple__382); /* "include/color_dict.pxi":516 * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), # <<<<<<<<<<<<<< * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), */ __pyx_tuple__383 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_71, __pyx_int_137); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(2, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__383); __Pyx_GIVEREF(__pyx_tuple__383); /* "include/color_dict.pxi":517 * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), # <<<<<<<<<<<<<< * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), */ __pyx_tuple__384 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_232, __pyx_int_170); if (unlikely(!__pyx_tuple__384)) __PYX_ERR(2, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__384); __Pyx_GIVEREF(__pyx_tuple__384); /* "include/color_dict.pxi":518 * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), # <<<<<<<<<<<<<< * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), */ __pyx_tuple__385 = PyTuple_Pack(3, __pyx_int_152, __pyx_int_251, __pyx_int_152); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(2, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__385); __Pyx_GIVEREF(__pyx_tuple__385); /* "include/color_dict.pxi":519 * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), # <<<<<<<<<<<<<< * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), */ __pyx_tuple__386 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_255, __pyx_int_154); if (unlikely(!__pyx_tuple__386)) __PYX_ERR(2, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__386); __Pyx_GIVEREF(__pyx_tuple__386); /* "include/color_dict.pxi":521 * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), # <<<<<<<<<<<<<< * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), */ __pyx_tuple__387 = PyTuple_Pack(3, __pyx_int_124, __pyx_int_205, __pyx_int_124); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(2, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__387); __Pyx_GIVEREF(__pyx_tuple__387); /* "include/color_dict.pxi":522 * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), # <<<<<<<<<<<<<< * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), */ __pyx_tuple__388 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_139, __pyx_int_84); if (unlikely(!__pyx_tuple__388)) __PYX_ERR(2, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__388); __Pyx_GIVEREF(__pyx_tuple__388); /* "include/color_dict.pxi":523 * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), */ __pyx_tuple__389 = PyTuple_Pack(3, __pyx_int_175, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(2, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__389); __Pyx_GIVEREF(__pyx_tuple__389); /* "include/color_dict.pxi":524 * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), # <<<<<<<<<<<<<< * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), */ __pyx_tuple__390 = PyTuple_Pack(3, __pyx_int_187, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__390)) __PYX_ERR(2, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__390); __Pyx_GIVEREF(__pyx_tuple__390); /* "include/color_dict.pxi":525 * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), */ __pyx_tuple__391 = PyTuple_Pack(3, __pyx_int_174, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(2, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__391); __Pyx_GIVEREF(__pyx_tuple__391); /* "include/color_dict.pxi":526 * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), # <<<<<<<<<<<<<< * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), */ __pyx_tuple__392 = PyTuple_Pack(3, __pyx_int_150, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__392)) __PYX_ERR(2, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__392); __Pyx_GIVEREF(__pyx_tuple__392); /* "include/color_dict.pxi":527 * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), # <<<<<<<<<<<<<< * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), */ __pyx_tuple__393 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(2, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__393); __Pyx_GIVEREF(__pyx_tuple__393); /* "include/color_dict.pxi":528 * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), # <<<<<<<<<<<<<< * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), */ __pyx_tuple__394 = PyTuple_Pack(3, __pyx_int_219, __pyx_int_112, __pyx_int_147); if (unlikely(!__pyx_tuple__394)) __PYX_ERR(2, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__394); __Pyx_GIVEREF(__pyx_tuple__394); /* "include/color_dict.pxi":529 * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), # <<<<<<<<<<<<<< * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), */ __pyx_tuple__395 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_130, __pyx_int_171); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(2, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__395); __Pyx_GIVEREF(__pyx_tuple__395); /* "include/color_dict.pxi":530 * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), # <<<<<<<<<<<<<< * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), */ __pyx_tuple__396 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_121, __pyx_int_159); if (unlikely(!__pyx_tuple__396)) __PYX_ERR(2, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__396); __Pyx_GIVEREF(__pyx_tuple__396); /* "include/color_dict.pxi":531 * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), # <<<<<<<<<<<<<< * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), */ __pyx_tuple__397 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_104, __pyx_int_137); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(2, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__397); __Pyx_GIVEREF(__pyx_tuple__397); /* "include/color_dict.pxi":532 * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), # <<<<<<<<<<<<<< * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), */ __pyx_tuple__398 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_71, __pyx_int_93); if (unlikely(!__pyx_tuple__398)) __PYX_ERR(2, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__398); __Pyx_GIVEREF(__pyx_tuple__398); /* "include/color_dict.pxi":533 * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), # <<<<<<<<<<<<<< * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), */ __pyx_tuple__399 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_239, __pyx_int_213); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(2, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__399); __Pyx_GIVEREF(__pyx_tuple__399); /* "include/color_dict.pxi":534 * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), */ __pyx_tuple__400 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_218, __pyx_int_185); if (unlikely(!__pyx_tuple__400)) __PYX_ERR(2, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__400); __Pyx_GIVEREF(__pyx_tuple__400); /* "include/color_dict.pxi":536 * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), # <<<<<<<<<<<<<< * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), */ __pyx_tuple__401 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_203, __pyx_int_173); if (unlikely(!__pyx_tuple__401)) __PYX_ERR(2, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__401); __Pyx_GIVEREF(__pyx_tuple__401); /* "include/color_dict.pxi":537 * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), # <<<<<<<<<<<<<< * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), */ __pyx_tuple__402 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_175, __pyx_int_149); if (unlikely(!__pyx_tuple__402)) __PYX_ERR(2, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__402); __Pyx_GIVEREF(__pyx_tuple__402); /* "include/color_dict.pxi":538 * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), # <<<<<<<<<<<<<< * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), */ __pyx_tuple__403 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_119, __pyx_int_101); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(2, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__403); __Pyx_GIVEREF(__pyx_tuple__403); /* "include/color_dict.pxi":539 * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), # <<<<<<<<<<<<<< * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), */ __pyx_tuple__404 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_133, __pyx_int_63); if (unlikely(!__pyx_tuple__404)) __PYX_ERR(2, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__404); __Pyx_GIVEREF(__pyx_tuple__404); /* "include/color_dict.pxi":540 * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), # <<<<<<<<<<<<<< * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), */ __pyx_tuple__405 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_192, __pyx_int_203); if (unlikely(!__pyx_tuple__405)) __PYX_ERR(2, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__405); __Pyx_GIVEREF(__pyx_tuple__405); /* "include/color_dict.pxi":541 * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), # <<<<<<<<<<<<<< * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), */ __pyx_tuple__406 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_181, __pyx_int_197); if (unlikely(!__pyx_tuple__406)) __PYX_ERR(2, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__406); __Pyx_GIVEREF(__pyx_tuple__406); /* "include/color_dict.pxi":542 * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), # <<<<<<<<<<<<<< * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), */ __pyx_tuple__407 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_169, __pyx_int_184); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(2, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__407); __Pyx_GIVEREF(__pyx_tuple__407); /* "include/color_dict.pxi":543 * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), # <<<<<<<<<<<<<< * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), */ __pyx_tuple__408 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_145, __pyx_int_158); if (unlikely(!__pyx_tuple__408)) __PYX_ERR(2, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__408); __Pyx_GIVEREF(__pyx_tuple__408); /* "include/color_dict.pxi":544 * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), # <<<<<<<<<<<<<< * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), */ __pyx_tuple__409 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_99, __pyx_int_108); if (unlikely(!__pyx_tuple__409)) __PYX_ERR(2, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__409); __Pyx_GIVEREF(__pyx_tuple__409); /* "include/color_dict.pxi":545 * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), # <<<<<<<<<<<<<< * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), */ __pyx_tuple__410 = PyTuple_Pack(3, __pyx_int_221, __pyx_int_160, __pyx_int_221); if (unlikely(!__pyx_tuple__410)) __PYX_ERR(2, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__410); __Pyx_GIVEREF(__pyx_tuple__410); /* "include/color_dict.pxi":546 * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), # <<<<<<<<<<<<<< * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), */ __pyx_tuple__411 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_187, __pyx_int_255); if (unlikely(!__pyx_tuple__411)) __PYX_ERR(2, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__411); __Pyx_GIVEREF(__pyx_tuple__411); /* "include/color_dict.pxi":547 * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), # <<<<<<<<<<<<<< * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), */ __pyx_tuple__412 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_174, __pyx_int_238); if (unlikely(!__pyx_tuple__412)) __PYX_ERR(2, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__412); __Pyx_GIVEREF(__pyx_tuple__412); /* "include/color_dict.pxi":548 * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), # <<<<<<<<<<<<<< * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), */ __pyx_tuple__413 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_150, __pyx_int_205); if (unlikely(!__pyx_tuple__413)) __PYX_ERR(2, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__413); __Pyx_GIVEREF(__pyx_tuple__413); /* "include/color_dict.pxi":549 * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), # <<<<<<<<<<<<<< * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), */ __pyx_tuple__414 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_102, __pyx_int_139); if (unlikely(!__pyx_tuple__414)) __PYX_ERR(2, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__414); __Pyx_GIVEREF(__pyx_tuple__414); /* "include/color_dict.pxi":550 * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), # <<<<<<<<<<<<<< * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), */ __pyx_tuple__415 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_224, __pyx_int_230); if (unlikely(!__pyx_tuple__415)) __PYX_ERR(2, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__415); __Pyx_GIVEREF(__pyx_tuple__415); /* "include/color_dict.pxi":551 * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), # <<<<<<<<<<<<<< * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), */ __pyx_tuple__416 = PyTuple_Pack(3, __pyx_int_160, __pyx_int_32, __pyx_int_240); if (unlikely(!__pyx_tuple__416)) __PYX_ERR(2, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__416); __Pyx_GIVEREF(__pyx_tuple__416); /* "include/color_dict.pxi":552 * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), # <<<<<<<<<<<<<< * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), */ __pyx_tuple__417 = PyTuple_Pack(3, __pyx_int_155, __pyx_int_48, __pyx_int_255); if (unlikely(!__pyx_tuple__417)) __PYX_ERR(2, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__417); __Pyx_GIVEREF(__pyx_tuple__417); /* "include/color_dict.pxi":553 * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), # <<<<<<<<<<<<<< * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), */ __pyx_tuple__418 = PyTuple_Pack(3, __pyx_int_145, __pyx_int_44, __pyx_int_238); if (unlikely(!__pyx_tuple__418)) __PYX_ERR(2, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__418); __Pyx_GIVEREF(__pyx_tuple__418); /* "include/color_dict.pxi":554 * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), # <<<<<<<<<<<<<< * 'purple4' : (85, 26, 139), * 'red' : (255, 0, 0), */ __pyx_tuple__419 = PyTuple_Pack(3, __pyx_int_125, __pyx_int_38, __pyx_int_205); if (unlikely(!__pyx_tuple__419)) __PYX_ERR(2, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__419); __Pyx_GIVEREF(__pyx_tuple__419); /* "include/color_dict.pxi":555 * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), # <<<<<<<<<<<<<< * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), */ __pyx_tuple__420 = PyTuple_Pack(3, __pyx_int_85, __pyx_int_26, __pyx_int_139); if (unlikely(!__pyx_tuple__420)) __PYX_ERR(2, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__420); __Pyx_GIVEREF(__pyx_tuple__420); /* "include/color_dict.pxi":556 * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), * 'red' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), */ __pyx_tuple__421 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__421)) __PYX_ERR(2, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__421); __Pyx_GIVEREF(__pyx_tuple__421); /* "include/color_dict.pxi":558 * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), # <<<<<<<<<<<<<< * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), */ __pyx_tuple__422 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__422)) __PYX_ERR(2, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__422); __Pyx_GIVEREF(__pyx_tuple__422); /* "include/color_dict.pxi":559 * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), # <<<<<<<<<<<<<< * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), */ __pyx_tuple__423 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__423)) __PYX_ERR(2, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__423); __Pyx_GIVEREF(__pyx_tuple__423); /* "include/color_dict.pxi":561 * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), # <<<<<<<<<<<<<< * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), */ __pyx_tuple__424 = PyTuple_Pack(3, __pyx_int_188, __pyx_int_143, __pyx_int_143); if (unlikely(!__pyx_tuple__424)) __PYX_ERR(2, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__424); __Pyx_GIVEREF(__pyx_tuple__424); /* "include/color_dict.pxi":562 * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), # <<<<<<<<<<<<<< * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), */ __pyx_tuple__425 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_193, __pyx_int_193); if (unlikely(!__pyx_tuple__425)) __PYX_ERR(2, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__425); __Pyx_GIVEREF(__pyx_tuple__425); /* "include/color_dict.pxi":563 * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), # <<<<<<<<<<<<<< * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), */ __pyx_tuple__426 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_180, __pyx_int_180); if (unlikely(!__pyx_tuple__426)) __PYX_ERR(2, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__426); __Pyx_GIVEREF(__pyx_tuple__426); /* "include/color_dict.pxi":564 * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), # <<<<<<<<<<<<<< * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), */ __pyx_tuple__427 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_155, __pyx_int_155); if (unlikely(!__pyx_tuple__427)) __PYX_ERR(2, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__427); __Pyx_GIVEREF(__pyx_tuple__427); /* "include/color_dict.pxi":565 * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), # <<<<<<<<<<<<<< * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), */ __pyx_tuple__428 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__428)) __PYX_ERR(2, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__428); __Pyx_GIVEREF(__pyx_tuple__428); /* "include/color_dict.pxi":566 * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), # <<<<<<<<<<<<<< * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), */ __pyx_tuple__429 = PyTuple_Pack(3, __pyx_int_65, __pyx_int_105, __pyx_int_225); if (unlikely(!__pyx_tuple__429)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__429); __Pyx_GIVEREF(__pyx_tuple__429); /* "include/color_dict.pxi":567 * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), # <<<<<<<<<<<<<< * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), */ __pyx_tuple__430 = PyTuple_Pack(3, __pyx_int_72, __pyx_int_118, __pyx_int_255); if (unlikely(!__pyx_tuple__430)) __PYX_ERR(2, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__430); __Pyx_GIVEREF(__pyx_tuple__430); /* "include/color_dict.pxi":568 * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), # <<<<<<<<<<<<<< * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), */ __pyx_tuple__431 = PyTuple_Pack(3, __pyx_int_67, __pyx_int_110, __pyx_int_238); if (unlikely(!__pyx_tuple__431)) __PYX_ERR(2, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__431); __Pyx_GIVEREF(__pyx_tuple__431); /* "include/color_dict.pxi":569 * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), # <<<<<<<<<<<<<< * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), */ __pyx_tuple__432 = PyTuple_Pack(3, __pyx_int_58, __pyx_int_95, __pyx_int_205); if (unlikely(!__pyx_tuple__432)) __PYX_ERR(2, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__432); __Pyx_GIVEREF(__pyx_tuple__432); /* "include/color_dict.pxi":570 * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), # <<<<<<<<<<<<<< * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), */ __pyx_tuple__433 = PyTuple_Pack(3, __pyx_int_39, __pyx_int_64, __pyx_int_139); if (unlikely(!__pyx_tuple__433)) __PYX_ERR(2, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__433); __Pyx_GIVEREF(__pyx_tuple__433); /* "include/color_dict.pxi":572 * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), # <<<<<<<<<<<<<< * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), */ __pyx_tuple__434 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_128, __pyx_int_114); if (unlikely(!__pyx_tuple__434)) __PYX_ERR(2, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__434); __Pyx_GIVEREF(__pyx_tuple__434); /* "include/color_dict.pxi":573 * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), # <<<<<<<<<<<<<< * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), */ __pyx_tuple__435 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_140, __pyx_int_105); if (unlikely(!__pyx_tuple__435)) __PYX_ERR(2, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__435); __Pyx_GIVEREF(__pyx_tuple__435); /* "include/color_dict.pxi":574 * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), # <<<<<<<<<<<<<< * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), */ __pyx_tuple__436 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_130, __pyx_int_98); if (unlikely(!__pyx_tuple__436)) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__436); __Pyx_GIVEREF(__pyx_tuple__436); /* "include/color_dict.pxi":575 * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), # <<<<<<<<<<<<<< * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), */ __pyx_tuple__437 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_112, __pyx_int_84); if (unlikely(!__pyx_tuple__437)) __PYX_ERR(2, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__437); __Pyx_GIVEREF(__pyx_tuple__437); /* "include/color_dict.pxi":576 * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), # <<<<<<<<<<<<<< * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), */ __pyx_tuple__438 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_76, __pyx_int_57); if (unlikely(!__pyx_tuple__438)) __PYX_ERR(2, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__438); __Pyx_GIVEREF(__pyx_tuple__438); /* "include/color_dict.pxi":577 * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), # <<<<<<<<<<<<<< * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), */ __pyx_tuple__439 = PyTuple_Pack(3, __pyx_int_244, __pyx_int_164, __pyx_int_96); if (unlikely(!__pyx_tuple__439)) __PYX_ERR(2, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__439); __Pyx_GIVEREF(__pyx_tuple__439); /* "include/color_dict.pxi":578 * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), */ __pyx_tuple__440 = PyTuple_Pack(3, __pyx_int_46, __pyx_int_139, __pyx_int_87); if (unlikely(!__pyx_tuple__440)) __PYX_ERR(2, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__440); __Pyx_GIVEREF(__pyx_tuple__440); /* "include/color_dict.pxi":579 * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), # <<<<<<<<<<<<<< * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), */ __pyx_tuple__441 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_255, __pyx_int_159); if (unlikely(!__pyx_tuple__441)) __PYX_ERR(2, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__441); __Pyx_GIVEREF(__pyx_tuple__441); /* "include/color_dict.pxi":580 * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), # <<<<<<<<<<<<<< * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), */ __pyx_tuple__442 = PyTuple_Pack(3, __pyx_int_78, __pyx_int_238, __pyx_int_148); if (unlikely(!__pyx_tuple__442)) __PYX_ERR(2, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__442); __Pyx_GIVEREF(__pyx_tuple__442); /* "include/color_dict.pxi":581 * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), # <<<<<<<<<<<<<< * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), */ __pyx_tuple__443 = PyTuple_Pack(3, __pyx_int_67, __pyx_int_205, __pyx_int_128); if (unlikely(!__pyx_tuple__443)) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__443); __Pyx_GIVEREF(__pyx_tuple__443); /* "include/color_dict.pxi":583 * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), */ __pyx_tuple__444 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_245, __pyx_int_238); if (unlikely(!__pyx_tuple__444)) __PYX_ERR(2, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__444); __Pyx_GIVEREF(__pyx_tuple__444); /* "include/color_dict.pxi":585 * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), # <<<<<<<<<<<<<< * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), */ __pyx_tuple__445 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_229, __pyx_int_222); if (unlikely(!__pyx_tuple__445)) __PYX_ERR(2, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__445); __Pyx_GIVEREF(__pyx_tuple__445); /* "include/color_dict.pxi":586 * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), # <<<<<<<<<<<<<< * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), */ __pyx_tuple__446 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_197, __pyx_int_191); if (unlikely(!__pyx_tuple__446)) __PYX_ERR(2, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__446); __Pyx_GIVEREF(__pyx_tuple__446); /* "include/color_dict.pxi":587 * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), # <<<<<<<<<<<<<< * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), */ __pyx_tuple__447 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_134, __pyx_int_130); if (unlikely(!__pyx_tuple__447)) __PYX_ERR(2, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__447); __Pyx_GIVEREF(__pyx_tuple__447); /* "include/color_dict.pxi":588 * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), # <<<<<<<<<<<<<< * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), */ __pyx_tuple__448 = PyTuple_Pack(3, __pyx_int_160, __pyx_int_82, __pyx_int_45); if (unlikely(!__pyx_tuple__448)) __PYX_ERR(2, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__448); __Pyx_GIVEREF(__pyx_tuple__448); /* "include/color_dict.pxi":589 * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), # <<<<<<<<<<<<<< * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), */ __pyx_tuple__449 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_130, __pyx_int_71); if (unlikely(!__pyx_tuple__449)) __PYX_ERR(2, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__449); __Pyx_GIVEREF(__pyx_tuple__449); /* "include/color_dict.pxi":590 * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), # <<<<<<<<<<<<<< * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), */ __pyx_tuple__450 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_121, __pyx_int_66); if (unlikely(!__pyx_tuple__450)) __PYX_ERR(2, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__450); __Pyx_GIVEREF(__pyx_tuple__450); /* "include/color_dict.pxi":591 * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), # <<<<<<<<<<<<<< * 'sienna4' : (139, 71, 38), * 'skyblue' : (135, 206, 235), */ __pyx_tuple__451 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_104, __pyx_int_57); if (unlikely(!__pyx_tuple__451)) __PYX_ERR(2, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__451); __Pyx_GIVEREF(__pyx_tuple__451); /* "include/color_dict.pxi":592 * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), # <<<<<<<<<<<<<< * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), */ __pyx_tuple__452 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_71, __pyx_int_38); if (unlikely(!__pyx_tuple__452)) __PYX_ERR(2, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__452); __Pyx_GIVEREF(__pyx_tuple__452); /* "include/color_dict.pxi":593 * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), * 'skyblue' : (135, 206, 235), # <<<<<<<<<<<<<< * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), */ __pyx_tuple__453 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_206, __pyx_int_235); if (unlikely(!__pyx_tuple__453)) __PYX_ERR(2, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__453); __Pyx_GIVEREF(__pyx_tuple__453); /* "include/color_dict.pxi":594 * 'sienna4' : (139, 71, 38), * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), # <<<<<<<<<<<<<< * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), */ __pyx_tuple__454 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_206, __pyx_int_255); if (unlikely(!__pyx_tuple__454)) __PYX_ERR(2, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__454); __Pyx_GIVEREF(__pyx_tuple__454); /* "include/color_dict.pxi":595 * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), # <<<<<<<<<<<<<< * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), */ __pyx_tuple__455 = PyTuple_Pack(3, __pyx_int_126, __pyx_int_192, __pyx_int_238); if (unlikely(!__pyx_tuple__455)) __PYX_ERR(2, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__455); __Pyx_GIVEREF(__pyx_tuple__455); /* "include/color_dict.pxi":596 * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), # <<<<<<<<<<<<<< * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), */ __pyx_tuple__456 = PyTuple_Pack(3, __pyx_int_108, __pyx_int_166, __pyx_int_205); if (unlikely(!__pyx_tuple__456)) __PYX_ERR(2, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__456); __Pyx_GIVEREF(__pyx_tuple__456); /* "include/color_dict.pxi":597 * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), # <<<<<<<<<<<<<< * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), */ __pyx_tuple__457 = PyTuple_Pack(3, __pyx_int_74, __pyx_int_112, __pyx_int_139); if (unlikely(!__pyx_tuple__457)) __PYX_ERR(2, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__457); __Pyx_GIVEREF(__pyx_tuple__457); /* "include/color_dict.pxi":598 * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), # <<<<<<<<<<<<<< * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), */ __pyx_tuple__458 = PyTuple_Pack(3, __pyx_int_106, __pyx_int_90, __pyx_int_205); if (unlikely(!__pyx_tuple__458)) __PYX_ERR(2, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__458); __Pyx_GIVEREF(__pyx_tuple__458); /* "include/color_dict.pxi":599 * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), # <<<<<<<<<<<<<< * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), */ __pyx_tuple__459 = PyTuple_Pack(3, __pyx_int_131, __pyx_int_111, __pyx_int_255); if (unlikely(!__pyx_tuple__459)) __PYX_ERR(2, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__459); __Pyx_GIVEREF(__pyx_tuple__459); /* "include/color_dict.pxi":600 * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), # <<<<<<<<<<<<<< * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), */ __pyx_tuple__460 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_103, __pyx_int_238); if (unlikely(!__pyx_tuple__460)) __PYX_ERR(2, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__460); __Pyx_GIVEREF(__pyx_tuple__460); /* "include/color_dict.pxi":601 * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), # <<<<<<<<<<<<<< * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), */ __pyx_tuple__461 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_89, __pyx_int_205); if (unlikely(!__pyx_tuple__461)) __PYX_ERR(2, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__461); __Pyx_GIVEREF(__pyx_tuple__461); /* "include/color_dict.pxi":602 * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), # <<<<<<<<<<<<<< * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), */ __pyx_tuple__462 = PyTuple_Pack(3, __pyx_int_71, __pyx_int_60, __pyx_int_139); if (unlikely(!__pyx_tuple__462)) __PYX_ERR(2, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__462); __Pyx_GIVEREF(__pyx_tuple__462); /* "include/color_dict.pxi":603 * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), # <<<<<<<<<<<<<< * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), */ __pyx_tuple__463 = PyTuple_Pack(3, __pyx_int_112, __pyx_int_128, __pyx_int_144); if (unlikely(!__pyx_tuple__463)) __PYX_ERR(2, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__463); __Pyx_GIVEREF(__pyx_tuple__463); /* "include/color_dict.pxi":604 * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), # <<<<<<<<<<<<<< * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), */ __pyx_tuple__464 = PyTuple_Pack(3, __pyx_int_198, __pyx_int_226, __pyx_int_255); if (unlikely(!__pyx_tuple__464)) __PYX_ERR(2, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__464); __Pyx_GIVEREF(__pyx_tuple__464); /* "include/color_dict.pxi":605 * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), # <<<<<<<<<<<<<< * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), */ __pyx_tuple__465 = PyTuple_Pack(3, __pyx_int_185, __pyx_int_211, __pyx_int_238); if (unlikely(!__pyx_tuple__465)) __PYX_ERR(2, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__465); __Pyx_GIVEREF(__pyx_tuple__465); /* "include/color_dict.pxi":606 * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), # <<<<<<<<<<<<<< * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), */ __pyx_tuple__466 = PyTuple_Pack(3, __pyx_int_159, __pyx_int_182, __pyx_int_205); if (unlikely(!__pyx_tuple__466)) __PYX_ERR(2, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__466); __Pyx_GIVEREF(__pyx_tuple__466); /* "include/color_dict.pxi":607 * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), # <<<<<<<<<<<<<< * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), */ __pyx_tuple__467 = PyTuple_Pack(3, __pyx_int_108, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__467)) __PYX_ERR(2, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__467); __Pyx_GIVEREF(__pyx_tuple__467); /* "include/color_dict.pxi":609 * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), */ __pyx_tuple__468 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_250); if (unlikely(!__pyx_tuple__468)) __PYX_ERR(2, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__468); __Pyx_GIVEREF(__pyx_tuple__468); /* "include/color_dict.pxi":611 * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), # <<<<<<<<<<<<<< * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), */ __pyx_tuple__469 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_233, __pyx_int_233); if (unlikely(!__pyx_tuple__469)) __PYX_ERR(2, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__469); __Pyx_GIVEREF(__pyx_tuple__469); /* "include/color_dict.pxi":612 * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), # <<<<<<<<<<<<<< * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), */ __pyx_tuple__470 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_201, __pyx_int_201); if (unlikely(!__pyx_tuple__470)) __PYX_ERR(2, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__470); __Pyx_GIVEREF(__pyx_tuple__470); /* "include/color_dict.pxi":613 * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), # <<<<<<<<<<<<<< * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), */ __pyx_tuple__471 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_137, __pyx_int_137); if (unlikely(!__pyx_tuple__471)) __PYX_ERR(2, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__471); __Pyx_GIVEREF(__pyx_tuple__471); /* "include/color_dict.pxi":614 * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), */ __pyx_tuple__472 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_127); if (unlikely(!__pyx_tuple__472)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__472); __Pyx_GIVEREF(__pyx_tuple__472); /* "include/color_dict.pxi":616 * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), # <<<<<<<<<<<<<< * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), */ __pyx_tuple__473 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_238, __pyx_int_118); if (unlikely(!__pyx_tuple__473)) __PYX_ERR(2, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__473); __Pyx_GIVEREF(__pyx_tuple__473); /* "include/color_dict.pxi":617 * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), # <<<<<<<<<<<<<< * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), */ __pyx_tuple__474 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_205, __pyx_int_102); if (unlikely(!__pyx_tuple__474)) __PYX_ERR(2, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__474); __Pyx_GIVEREF(__pyx_tuple__474); /* "include/color_dict.pxi":618 * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), # <<<<<<<<<<<<<< * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), */ __pyx_tuple__475 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_69); if (unlikely(!__pyx_tuple__475)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__475); __Pyx_GIVEREF(__pyx_tuple__475); /* "include/color_dict.pxi":619 * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), # <<<<<<<<<<<<<< * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), */ __pyx_tuple__476 = PyTuple_Pack(3, __pyx_int_70, __pyx_int_130, __pyx_int_180); if (unlikely(!__pyx_tuple__476)) __PYX_ERR(2, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__476); __Pyx_GIVEREF(__pyx_tuple__476); /* "include/color_dict.pxi":620 * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), # <<<<<<<<<<<<<< * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), */ __pyx_tuple__477 = PyTuple_Pack(3, __pyx_int_99, __pyx_int_184, __pyx_int_255); if (unlikely(!__pyx_tuple__477)) __PYX_ERR(2, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__477); __Pyx_GIVEREF(__pyx_tuple__477); /* "include/color_dict.pxi":621 * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), # <<<<<<<<<<<<<< * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), */ __pyx_tuple__478 = PyTuple_Pack(3, __pyx_int_92, __pyx_int_172, __pyx_int_238); if (unlikely(!__pyx_tuple__478)) __PYX_ERR(2, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__478); __Pyx_GIVEREF(__pyx_tuple__478); /* "include/color_dict.pxi":622 * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), # <<<<<<<<<<<<<< * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), */ __pyx_tuple__479 = PyTuple_Pack(3, __pyx_int_79, __pyx_int_148, __pyx_int_205); if (unlikely(!__pyx_tuple__479)) __PYX_ERR(2, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__479); __Pyx_GIVEREF(__pyx_tuple__479); /* "include/color_dict.pxi":623 * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), # <<<<<<<<<<<<<< * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), */ __pyx_tuple__480 = PyTuple_Pack(3, __pyx_int_54, __pyx_int_100, __pyx_int_139); if (unlikely(!__pyx_tuple__480)) __PYX_ERR(2, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__480); __Pyx_GIVEREF(__pyx_tuple__480); /* "include/color_dict.pxi":624 * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), # <<<<<<<<<<<<<< * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), */ __pyx_tuple__481 = PyTuple_Pack(3, __pyx_int_210, __pyx_int_180, __pyx_int_140); if (unlikely(!__pyx_tuple__481)) __PYX_ERR(2, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__481); __Pyx_GIVEREF(__pyx_tuple__481); /* "include/color_dict.pxi":625 * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), # <<<<<<<<<<<<<< * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), */ __pyx_tuple__482 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_165, __pyx_int_79); if (unlikely(!__pyx_tuple__482)) __PYX_ERR(2, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__482); __Pyx_GIVEREF(__pyx_tuple__482); /* "include/color_dict.pxi":626 * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), # <<<<<<<<<<<<<< * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), */ __pyx_tuple__483 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_154, __pyx_int_73); if (unlikely(!__pyx_tuple__483)) __PYX_ERR(2, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__483); __Pyx_GIVEREF(__pyx_tuple__483); /* "include/color_dict.pxi":628 * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), # <<<<<<<<<<<<<< * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), */ __pyx_tuple__484 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_90, __pyx_int_43); if (unlikely(!__pyx_tuple__484)) __PYX_ERR(2, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__484); __Pyx_GIVEREF(__pyx_tuple__484); /* "include/color_dict.pxi":629 * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), * 'thistle' : (216, 191, 216), # <<<<<<<<<<<<<< * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), */ __pyx_tuple__485 = PyTuple_Pack(3, __pyx_int_216, __pyx_int_191, __pyx_int_216); if (unlikely(!__pyx_tuple__485)) __PYX_ERR(2, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__485); __Pyx_GIVEREF(__pyx_tuple__485); /* "include/color_dict.pxi":630 * 'tan4' : (139, 90, 43), * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), # <<<<<<<<<<<<<< * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), */ __pyx_tuple__486 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_225, __pyx_int_255); if (unlikely(!__pyx_tuple__486)) __PYX_ERR(2, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__486); __Pyx_GIVEREF(__pyx_tuple__486); /* "include/color_dict.pxi":631 * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), # <<<<<<<<<<<<<< * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), */ __pyx_tuple__487 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_210, __pyx_int_238); if (unlikely(!__pyx_tuple__487)) __PYX_ERR(2, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__487); __Pyx_GIVEREF(__pyx_tuple__487); /* "include/color_dict.pxi":632 * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), # <<<<<<<<<<<<<< * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), */ __pyx_tuple__488 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_181, __pyx_int_205); if (unlikely(!__pyx_tuple__488)) __PYX_ERR(2, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__488); __Pyx_GIVEREF(__pyx_tuple__488); /* "include/color_dict.pxi":633 * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), # <<<<<<<<<<<<<< * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), */ __pyx_tuple__489 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__489)) __PYX_ERR(2, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__489); __Pyx_GIVEREF(__pyx_tuple__489); /* "include/color_dict.pxi":634 * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), */ __pyx_tuple__490 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_99, __pyx_int_71); if (unlikely(!__pyx_tuple__490)) __PYX_ERR(2, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__490); __Pyx_GIVEREF(__pyx_tuple__490); /* "include/color_dict.pxi":636 * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), # <<<<<<<<<<<<<< * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), */ __pyx_tuple__491 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_92, __pyx_int_66); if (unlikely(!__pyx_tuple__491)) __PYX_ERR(2, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__491); __Pyx_GIVEREF(__pyx_tuple__491); /* "include/color_dict.pxi":637 * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), # <<<<<<<<<<<<<< * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), */ __pyx_tuple__492 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_79, __pyx_int_57); if (unlikely(!__pyx_tuple__492)) __PYX_ERR(2, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__492); __Pyx_GIVEREF(__pyx_tuple__492); /* "include/color_dict.pxi":638 * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), # <<<<<<<<<<<<<< * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), */ __pyx_tuple__493 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_54, __pyx_int_38); if (unlikely(!__pyx_tuple__493)) __PYX_ERR(2, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__493); __Pyx_GIVEREF(__pyx_tuple__493); /* "include/color_dict.pxi":639 * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), # <<<<<<<<<<<<<< * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), */ __pyx_tuple__494 = PyTuple_Pack(3, __pyx_int_64, __pyx_int_224, __pyx_int_208); if (unlikely(!__pyx_tuple__494)) __PYX_ERR(2, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__494); __Pyx_GIVEREF(__pyx_tuple__494); /* "include/color_dict.pxi":640 * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), # <<<<<<<<<<<<<< * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), */ __pyx_tuple__495 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_245, __pyx_int_255); if (unlikely(!__pyx_tuple__495)) __PYX_ERR(2, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__495); __Pyx_GIVEREF(__pyx_tuple__495); /* "include/color_dict.pxi":641 * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), # <<<<<<<<<<<<<< * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), */ __pyx_tuple__496 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_229, __pyx_int_238); if (unlikely(!__pyx_tuple__496)) __PYX_ERR(2, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__496); __Pyx_GIVEREF(__pyx_tuple__496); /* "include/color_dict.pxi":642 * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), # <<<<<<<<<<<<<< * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), */ __pyx_tuple__497 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_197, __pyx_int_205); if (unlikely(!__pyx_tuple__497)) __PYX_ERR(2, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__497); __Pyx_GIVEREF(__pyx_tuple__497); /* "include/color_dict.pxi":643 * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), # <<<<<<<<<<<<<< * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), */ __pyx_tuple__498 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_134, __pyx_int_139); if (unlikely(!__pyx_tuple__498)) __PYX_ERR(2, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__498); __Pyx_GIVEREF(__pyx_tuple__498); /* "include/color_dict.pxi":644 * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), # <<<<<<<<<<<<<< * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), */ __pyx_tuple__499 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_130, __pyx_int_238); if (unlikely(!__pyx_tuple__499)) __PYX_ERR(2, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__499); __Pyx_GIVEREF(__pyx_tuple__499); /* "include/color_dict.pxi":645 * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), # <<<<<<<<<<<<<< * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), */ __pyx_tuple__500 = PyTuple_Pack(3, __pyx_int_208, __pyx_int_32, __pyx_int_144); if (unlikely(!__pyx_tuple__500)) __PYX_ERR(2, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__500); __Pyx_GIVEREF(__pyx_tuple__500); /* "include/color_dict.pxi":646 * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), # <<<<<<<<<<<<<< * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), */ __pyx_tuple__501 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_62, __pyx_int_150); if (unlikely(!__pyx_tuple__501)) __PYX_ERR(2, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__501); __Pyx_GIVEREF(__pyx_tuple__501); /* "include/color_dict.pxi":647 * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), # <<<<<<<<<<<<<< * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), */ __pyx_tuple__502 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_58, __pyx_int_140); if (unlikely(!__pyx_tuple__502)) __PYX_ERR(2, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__502); __Pyx_GIVEREF(__pyx_tuple__502); /* "include/color_dict.pxi":648 * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), # <<<<<<<<<<<<<< * 'violetred4' : (139, 34, 82), * 'wheat' : (245, 222, 179), */ __pyx_tuple__503 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_50, __pyx_int_120); if (unlikely(!__pyx_tuple__503)) __PYX_ERR(2, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__503); __Pyx_GIVEREF(__pyx_tuple__503); /* "include/color_dict.pxi":649 * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), # <<<<<<<<<<<<<< * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), */ __pyx_tuple__504 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_34, __pyx_int_82); if (unlikely(!__pyx_tuple__504)) __PYX_ERR(2, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__504); __Pyx_GIVEREF(__pyx_tuple__504); /* "include/color_dict.pxi":650 * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), * 'wheat' : (245, 222, 179), # <<<<<<<<<<<<<< * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), */ __pyx_tuple__505 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_222, __pyx_int_179); if (unlikely(!__pyx_tuple__505)) __PYX_ERR(2, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__505); __Pyx_GIVEREF(__pyx_tuple__505); /* "include/color_dict.pxi":651 * 'violetred4' : (139, 34, 82), * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), # <<<<<<<<<<<<<< * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), */ __pyx_tuple__506 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_231, __pyx_int_186); if (unlikely(!__pyx_tuple__506)) __PYX_ERR(2, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__506); __Pyx_GIVEREF(__pyx_tuple__506); /* "include/color_dict.pxi":652 * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), # <<<<<<<<<<<<<< * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), */ __pyx_tuple__507 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_216, __pyx_int_174); if (unlikely(!__pyx_tuple__507)) __PYX_ERR(2, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__507); __Pyx_GIVEREF(__pyx_tuple__507); /* "include/color_dict.pxi":653 * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), # <<<<<<<<<<<<<< * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), */ __pyx_tuple__508 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_186, __pyx_int_150); if (unlikely(!__pyx_tuple__508)) __PYX_ERR(2, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__508); __Pyx_GIVEREF(__pyx_tuple__508); /* "include/color_dict.pxi":654 * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), # <<<<<<<<<<<<<< * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), */ __pyx_tuple__509 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_126, __pyx_int_102); if (unlikely(!__pyx_tuple__509)) __PYX_ERR(2, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__509); __Pyx_GIVEREF(__pyx_tuple__509); /* "include/color_dict.pxi":657 * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), * 'yellow' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), */ __pyx_tuple__510 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__510)) __PYX_ERR(2, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__510); __Pyx_GIVEREF(__pyx_tuple__510); /* "include/color_dict.pxi":659 * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), # <<<<<<<<<<<<<< * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), */ __pyx_tuple__511 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_238, __pyx_int_0); if (unlikely(!__pyx_tuple__511)) __PYX_ERR(2, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__511); __Pyx_GIVEREF(__pyx_tuple__511); /* "include/color_dict.pxi":660 * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), # <<<<<<<<<<<<<< * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), */ __pyx_tuple__512 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_205, __pyx_int_0); if (unlikely(!__pyx_tuple__512)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__512); __Pyx_GIVEREF(__pyx_tuple__512); /* "include/color_dict.pxi":661 * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), # <<<<<<<<<<<<<< * 'yellowgreen' : (154, 205, 50), * } */ __pyx_tuple__513 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_139, __pyx_int_0); if (unlikely(!__pyx_tuple__513)) __PYX_ERR(2, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__513); __Pyx_GIVEREF(__pyx_tuple__513); /* "pygame_sdl2/color.pyx":161 * return float(int(self)) * * def __reduce__(self): # <<<<<<<<<<<<<< * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) */ __pyx_tuple__514 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_d); if (unlikely(!__pyx_tuple__514)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__514); __Pyx_GIVEREF(__pyx_tuple__514); __pyx_codeobj__515 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__514, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_reduce, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__515)) __PYX_ERR(0, 161, __pyx_L1_error) /* "pygame_sdl2/color.pyx":166 * return (Color, (), d) * * def __setstate__(self, d): # <<<<<<<<<<<<<< * self.r, self.g, self.b, self.a = d['rgba'] * */ __pyx_codeobj__516 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__514, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_setstate, 166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__516)) __PYX_ERR(0, 166, __pyx_L1_error) /* "pygame_sdl2/color.pyx":449 * self.b = int(b * 255) * * def normalize(self): # <<<<<<<<<<<<<< * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * */ __pyx_tuple__517 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__517)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__517); __Pyx_GIVEREF(__pyx_tuple__517); __pyx_codeobj__518 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__517, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_normalize, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__518)) __PYX_ERR(0, 449, __pyx_L1_error) /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ __pyx_tuple__519 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_gamma, __pyx_n_s_m, __pyx_n_s_c); if (unlikely(!__pyx_tuple__519)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__519); __Pyx_GIVEREF(__pyx_tuple__519); __pyx_codeobj__520 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__519, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_correct_gamma, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__520)) __PYX_ERR(0, 452, __pyx_L1_error) /* "pygame_sdl2/color.pyx":457 * return c * * def set_length(self, n): # <<<<<<<<<<<<<< * if n > 4 or n < 1: * raise ValueError(n) */ __pyx_tuple__521 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_n); if (unlikely(!__pyx_tuple__521)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__521); __Pyx_GIVEREF(__pyx_tuple__521); __pyx_codeobj__522 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__521, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_set_length, 457, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__522)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_float_255_0 = PyFloat_FromDouble(255.0); if (unlikely(!__pyx_float_255_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_360_0 = PyFloat_FromDouble(360.0); if (unlikely(!__pyx_float_360_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_28 = PyInt_FromLong(28); if (unlikely(!__pyx_int_28)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_29 = PyInt_FromLong(29); if (unlikely(!__pyx_int_29)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_33 = PyInt_FromLong(33); if (unlikely(!__pyx_int_33)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_34 = PyInt_FromLong(34); if (unlikely(!__pyx_int_34)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_35 = PyInt_FromLong(35); if (unlikely(!__pyx_int_35)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_36 = PyInt_FromLong(36); if (unlikely(!__pyx_int_36)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_37 = PyInt_FromLong(37); if (unlikely(!__pyx_int_37)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_38 = PyInt_FromLong(38); if (unlikely(!__pyx_int_38)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_39 = PyInt_FromLong(39); if (unlikely(!__pyx_int_39)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_41 = PyInt_FromLong(41); if (unlikely(!__pyx_int_41)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_42 = PyInt_FromLong(42); if (unlikely(!__pyx_int_42)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_43 = PyInt_FromLong(43); if (unlikely(!__pyx_int_43)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_44 = PyInt_FromLong(44); if (unlikely(!__pyx_int_44)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_45 = PyInt_FromLong(45); if (unlikely(!__pyx_int_45)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_46 = PyInt_FromLong(46); if (unlikely(!__pyx_int_46)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_47 = PyInt_FromLong(47); if (unlikely(!__pyx_int_47)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_48 = PyInt_FromLong(48); if (unlikely(!__pyx_int_48)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_51 = PyInt_FromLong(51); if (unlikely(!__pyx_int_51)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_52 = PyInt_FromLong(52); if (unlikely(!__pyx_int_52)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_54 = PyInt_FromLong(54); if (unlikely(!__pyx_int_54)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_55 = PyInt_FromLong(55); if (unlikely(!__pyx_int_55)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_56 = PyInt_FromLong(56); if (unlikely(!__pyx_int_56)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_57 = PyInt_FromLong(57); if (unlikely(!__pyx_int_57)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_58 = PyInt_FromLong(58); if (unlikely(!__pyx_int_58)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_61 = PyInt_FromLong(61); if (unlikely(!__pyx_int_61)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_62 = PyInt_FromLong(62); if (unlikely(!__pyx_int_62)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_63 = PyInt_FromLong(63); if (unlikely(!__pyx_int_63)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_65 = PyInt_FromLong(65); if (unlikely(!__pyx_int_65)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_66 = PyInt_FromLong(66); if (unlikely(!__pyx_int_66)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_67 = PyInt_FromLong(67); if (unlikely(!__pyx_int_67)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_69 = PyInt_FromLong(69); if (unlikely(!__pyx_int_69)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_70 = PyInt_FromLong(70); if (unlikely(!__pyx_int_70)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_71 = PyInt_FromLong(71); if (unlikely(!__pyx_int_71)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_72 = PyInt_FromLong(72); if (unlikely(!__pyx_int_72)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_73 = PyInt_FromLong(73); if (unlikely(!__pyx_int_73)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_74 = PyInt_FromLong(74); if (unlikely(!__pyx_int_74)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_76 = PyInt_FromLong(76); if (unlikely(!__pyx_int_76)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_77 = PyInt_FromLong(77); if (unlikely(!__pyx_int_77)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_78 = PyInt_FromLong(78); if (unlikely(!__pyx_int_78)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_79 = PyInt_FromLong(79); if (unlikely(!__pyx_int_79)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_80 = PyInt_FromLong(80); if (unlikely(!__pyx_int_80)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_81 = PyInt_FromLong(81); if (unlikely(!__pyx_int_81)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_82 = PyInt_FromLong(82); if (unlikely(!__pyx_int_82)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_83 = PyInt_FromLong(83); if (unlikely(!__pyx_int_83)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_84 = PyInt_FromLong(84); if (unlikely(!__pyx_int_84)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_85 = PyInt_FromLong(85); if (unlikely(!__pyx_int_85)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_86 = PyInt_FromLong(86); if (unlikely(!__pyx_int_86)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_87 = PyInt_FromLong(87); if (unlikely(!__pyx_int_87)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_89 = PyInt_FromLong(89); if (unlikely(!__pyx_int_89)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_91 = PyInt_FromLong(91); if (unlikely(!__pyx_int_91)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_92 = PyInt_FromLong(92); if (unlikely(!__pyx_int_92)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_93 = PyInt_FromLong(93); if (unlikely(!__pyx_int_93)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_94 = PyInt_FromLong(94); if (unlikely(!__pyx_int_94)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_95 = PyInt_FromLong(95); if (unlikely(!__pyx_int_95)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_96 = PyInt_FromLong(96); if (unlikely(!__pyx_int_96)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_97 = PyInt_FromLong(97); if (unlikely(!__pyx_int_97)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_98 = PyInt_FromLong(98); if (unlikely(!__pyx_int_98)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_99 = PyInt_FromLong(99); if (unlikely(!__pyx_int_99)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_101 = PyInt_FromLong(101); if (unlikely(!__pyx_int_101)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_102 = PyInt_FromLong(102); if (unlikely(!__pyx_int_102)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_103 = PyInt_FromLong(103); if (unlikely(!__pyx_int_103)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_104 = PyInt_FromLong(104); if (unlikely(!__pyx_int_104)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_105 = PyInt_FromLong(105); if (unlikely(!__pyx_int_105)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_106 = PyInt_FromLong(106); if (unlikely(!__pyx_int_106)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_107 = PyInt_FromLong(107); if (unlikely(!__pyx_int_107)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_108 = PyInt_FromLong(108); if (unlikely(!__pyx_int_108)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_110 = PyInt_FromLong(110); if (unlikely(!__pyx_int_110)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_111 = PyInt_FromLong(111); if (unlikely(!__pyx_int_111)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_112 = PyInt_FromLong(112); if (unlikely(!__pyx_int_112)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_113 = PyInt_FromLong(113); if (unlikely(!__pyx_int_113)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_114 = PyInt_FromLong(114); if (unlikely(!__pyx_int_114)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_115 = PyInt_FromLong(115); if (unlikely(!__pyx_int_115)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_116 = PyInt_FromLong(116); if (unlikely(!__pyx_int_116)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_117 = PyInt_FromLong(117); if (unlikely(!__pyx_int_117)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_118 = PyInt_FromLong(118); if (unlikely(!__pyx_int_118)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_119 = PyInt_FromLong(119); if (unlikely(!__pyx_int_119)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_120 = PyInt_FromLong(120); if (unlikely(!__pyx_int_120)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_121 = PyInt_FromLong(121); if (unlikely(!__pyx_int_121)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_122 = PyInt_FromLong(122); if (unlikely(!__pyx_int_122)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_123 = PyInt_FromLong(123); if (unlikely(!__pyx_int_123)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_124 = PyInt_FromLong(124); if (unlikely(!__pyx_int_124)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_125 = PyInt_FromLong(125); if (unlikely(!__pyx_int_125)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_126 = PyInt_FromLong(126); if (unlikely(!__pyx_int_126)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_127 = PyInt_FromLong(127); if (unlikely(!__pyx_int_127)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_129 = PyInt_FromLong(129); if (unlikely(!__pyx_int_129)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_130 = PyInt_FromLong(130); if (unlikely(!__pyx_int_130)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_131 = PyInt_FromLong(131); if (unlikely(!__pyx_int_131)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_132 = PyInt_FromLong(132); if (unlikely(!__pyx_int_132)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_133 = PyInt_FromLong(133); if (unlikely(!__pyx_int_133)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_134 = PyInt_FromLong(134); if (unlikely(!__pyx_int_134)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_135 = PyInt_FromLong(135); if (unlikely(!__pyx_int_135)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_136 = PyInt_FromLong(136); if (unlikely(!__pyx_int_136)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_137 = PyInt_FromLong(137); if (unlikely(!__pyx_int_137)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_138 = PyInt_FromLong(138); if (unlikely(!__pyx_int_138)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_139 = PyInt_FromLong(139); if (unlikely(!__pyx_int_139)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_140 = PyInt_FromLong(140); if (unlikely(!__pyx_int_140)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_141 = PyInt_FromLong(141); if (unlikely(!__pyx_int_141)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_142 = PyInt_FromLong(142); if (unlikely(!__pyx_int_142)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_143 = PyInt_FromLong(143); if (unlikely(!__pyx_int_143)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_144 = PyInt_FromLong(144); if (unlikely(!__pyx_int_144)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_145 = PyInt_FromLong(145); if (unlikely(!__pyx_int_145)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_147 = PyInt_FromLong(147); if (unlikely(!__pyx_int_147)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_148 = PyInt_FromLong(148); if (unlikely(!__pyx_int_148)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_149 = PyInt_FromLong(149); if (unlikely(!__pyx_int_149)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_150 = PyInt_FromLong(150); if (unlikely(!__pyx_int_150)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_151 = PyInt_FromLong(151); if (unlikely(!__pyx_int_151)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_152 = PyInt_FromLong(152); if (unlikely(!__pyx_int_152)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_153 = PyInt_FromLong(153); if (unlikely(!__pyx_int_153)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_154 = PyInt_FromLong(154); if (unlikely(!__pyx_int_154)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_155 = PyInt_FromLong(155); if (unlikely(!__pyx_int_155)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_156 = PyInt_FromLong(156); if (unlikely(!__pyx_int_156)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_158 = PyInt_FromLong(158); if (unlikely(!__pyx_int_158)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_159 = PyInt_FromLong(159); if (unlikely(!__pyx_int_159)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_160 = PyInt_FromLong(160); if (unlikely(!__pyx_int_160)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_161 = PyInt_FromLong(161); if (unlikely(!__pyx_int_161)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_162 = PyInt_FromLong(162); if (unlikely(!__pyx_int_162)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_163 = PyInt_FromLong(163); if (unlikely(!__pyx_int_163)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_164 = PyInt_FromLong(164); if (unlikely(!__pyx_int_164)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_165 = PyInt_FromLong(165); if (unlikely(!__pyx_int_165)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_166 = PyInt_FromLong(166); if (unlikely(!__pyx_int_166)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_167 = PyInt_FromLong(167); if (unlikely(!__pyx_int_167)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_168 = PyInt_FromLong(168); if (unlikely(!__pyx_int_168)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_169 = PyInt_FromLong(169); if (unlikely(!__pyx_int_169)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_170 = PyInt_FromLong(170); if (unlikely(!__pyx_int_170)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_171 = PyInt_FromLong(171); if (unlikely(!__pyx_int_171)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_172 = PyInt_FromLong(172); if (unlikely(!__pyx_int_172)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_173 = PyInt_FromLong(173); if (unlikely(!__pyx_int_173)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_174 = PyInt_FromLong(174); if (unlikely(!__pyx_int_174)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_175 = PyInt_FromLong(175); if (unlikely(!__pyx_int_175)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_176 = PyInt_FromLong(176); if (unlikely(!__pyx_int_176)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_177 = PyInt_FromLong(177); if (unlikely(!__pyx_int_177)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_178 = PyInt_FromLong(178); if (unlikely(!__pyx_int_178)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_179 = PyInt_FromLong(179); if (unlikely(!__pyx_int_179)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_180 = PyInt_FromLong(180); if (unlikely(!__pyx_int_180)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_181 = PyInt_FromLong(181); if (unlikely(!__pyx_int_181)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_182 = PyInt_FromLong(182); if (unlikely(!__pyx_int_182)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_183 = PyInt_FromLong(183); if (unlikely(!__pyx_int_183)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_184 = PyInt_FromLong(184); if (unlikely(!__pyx_int_184)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_185 = PyInt_FromLong(185); if (unlikely(!__pyx_int_185)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_186 = PyInt_FromLong(186); if (unlikely(!__pyx_int_186)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_187 = PyInt_FromLong(187); if (unlikely(!__pyx_int_187)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_188 = PyInt_FromLong(188); if (unlikely(!__pyx_int_188)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_189 = PyInt_FromLong(189); if (unlikely(!__pyx_int_189)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_190 = PyInt_FromLong(190); if (unlikely(!__pyx_int_190)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_191 = PyInt_FromLong(191); if (unlikely(!__pyx_int_191)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_192 = PyInt_FromLong(192); if (unlikely(!__pyx_int_192)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_193 = PyInt_FromLong(193); if (unlikely(!__pyx_int_193)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_194 = PyInt_FromLong(194); if (unlikely(!__pyx_int_194)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_196 = PyInt_FromLong(196); if (unlikely(!__pyx_int_196)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_197 = PyInt_FromLong(197); if (unlikely(!__pyx_int_197)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_198 = PyInt_FromLong(198); if (unlikely(!__pyx_int_198)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_199 = PyInt_FromLong(199); if (unlikely(!__pyx_int_199)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_200 = PyInt_FromLong(200); if (unlikely(!__pyx_int_200)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_201 = PyInt_FromLong(201); if (unlikely(!__pyx_int_201)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_202 = PyInt_FromLong(202); if (unlikely(!__pyx_int_202)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_203 = PyInt_FromLong(203); if (unlikely(!__pyx_int_203)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_204 = PyInt_FromLong(204); if (unlikely(!__pyx_int_204)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_205 = PyInt_FromLong(205); if (unlikely(!__pyx_int_205)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_206 = PyInt_FromLong(206); if (unlikely(!__pyx_int_206)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_207 = PyInt_FromLong(207); if (unlikely(!__pyx_int_207)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_208 = PyInt_FromLong(208); if (unlikely(!__pyx_int_208)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_209 = PyInt_FromLong(209); if (unlikely(!__pyx_int_209)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_210 = PyInt_FromLong(210); if (unlikely(!__pyx_int_210)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_211 = PyInt_FromLong(211); if (unlikely(!__pyx_int_211)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_212 = PyInt_FromLong(212); if (unlikely(!__pyx_int_212)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_213 = PyInt_FromLong(213); if (unlikely(!__pyx_int_213)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_214 = PyInt_FromLong(214); if (unlikely(!__pyx_int_214)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_215 = PyInt_FromLong(215); if (unlikely(!__pyx_int_215)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_216 = PyInt_FromLong(216); if (unlikely(!__pyx_int_216)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_217 = PyInt_FromLong(217); if (unlikely(!__pyx_int_217)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_218 = PyInt_FromLong(218); if (unlikely(!__pyx_int_218)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_219 = PyInt_FromLong(219); if (unlikely(!__pyx_int_219)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_220 = PyInt_FromLong(220); if (unlikely(!__pyx_int_220)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_221 = PyInt_FromLong(221); if (unlikely(!__pyx_int_221)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_222 = PyInt_FromLong(222); if (unlikely(!__pyx_int_222)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_223 = PyInt_FromLong(223); if (unlikely(!__pyx_int_223)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_224 = PyInt_FromLong(224); if (unlikely(!__pyx_int_224)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_225 = PyInt_FromLong(225); if (unlikely(!__pyx_int_225)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_226 = PyInt_FromLong(226); if (unlikely(!__pyx_int_226)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_227 = PyInt_FromLong(227); if (unlikely(!__pyx_int_227)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_228 = PyInt_FromLong(228); if (unlikely(!__pyx_int_228)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_229 = PyInt_FromLong(229); if (unlikely(!__pyx_int_229)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_230 = PyInt_FromLong(230); if (unlikely(!__pyx_int_230)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_231 = PyInt_FromLong(231); if (unlikely(!__pyx_int_231)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_232 = PyInt_FromLong(232); if (unlikely(!__pyx_int_232)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_233 = PyInt_FromLong(233); if (unlikely(!__pyx_int_233)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_235 = PyInt_FromLong(235); if (unlikely(!__pyx_int_235)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_236 = PyInt_FromLong(236); if (unlikely(!__pyx_int_236)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_237 = PyInt_FromLong(237); if (unlikely(!__pyx_int_237)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_238 = PyInt_FromLong(238); if (unlikely(!__pyx_int_238)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_239 = PyInt_FromLong(239); if (unlikely(!__pyx_int_239)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_240 = PyInt_FromLong(240); if (unlikely(!__pyx_int_240)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_242 = PyInt_FromLong(242); if (unlikely(!__pyx_int_242)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_244 = PyInt_FromLong(244); if (unlikely(!__pyx_int_244)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_245 = PyInt_FromLong(245); if (unlikely(!__pyx_int_245)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_246 = PyInt_FromLong(246); if (unlikely(!__pyx_int_246)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_247 = PyInt_FromLong(247); if (unlikely(!__pyx_int_247)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_248 = PyInt_FromLong(248); if (unlikely(!__pyx_int_248)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_250 = PyInt_FromLong(250); if (unlikely(!__pyx_int_250)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_251 = PyInt_FromLong(251); if (unlikely(!__pyx_int_251)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_252 = PyInt_FromLong(252); if (unlikely(!__pyx_int_252)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_253 = PyInt_FromLong(253); if (unlikely(!__pyx_int_253)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_5color_colors = Py_None; Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("map_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_map_color, "Uint32 (SDL_Surface *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("get_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_get_color, "PyObject *(Uint32, SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("to_sdl_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_to_sdl_color, "PyObject *(PyObject *, SDL_Color *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_5color_Color = &__pyx_vtable_11pygame_sdl2_5color_Color; __pyx_vtable_11pygame_sdl2_5color_Color.from_rgba = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8))__pyx_f_11pygame_sdl2_5color_5Color_from_rgba; __pyx_vtable_11pygame_sdl2_5color_Color.from_name = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *))__pyx_f_11pygame_sdl2_5color_5Color_from_name; __pyx_vtable_11pygame_sdl2_5color_Color.from_hex = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *))__pyx_f_11pygame_sdl2_5color_5Color_from_hex; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_5color_Color = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_5color_Color_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) __PYX_ERR(0, 63, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_5color_Color_spec, __pyx_ptype_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_5color_Color = &__pyx_type_11pygame_sdl2_5color_Color; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_5color_Color->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_5color_Color->tp_dictoffset && __pyx_ptype_11pygame_sdl2_5color_Color->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_5color_Color->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_11pygame_sdl2_5color_Color, __pyx_vtabptr_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Color, (PyObject *) __pyx_ptype_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_5color_Color->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_5color_Color->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_5color_Color, __weakref__); #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)) __PYX_ERR(0, 452, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma_spec, __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma) < 0) __PYX_ERR(0, 452, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = &__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma) < 0) __PYX_ERR(0, 452, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma->tp_dictoffset && __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_color(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_color}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "color", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initcolor(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initcolor(void) #else __Pyx_PyMODINIT_FUNC PyInit_color(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_color(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_color(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'color' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("color", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "color" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_color(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__color) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.color")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.color", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/color.pyx":21 * * from sdl2 cimport * * import binascii # <<<<<<<<<<<<<< * import struct * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_binascii, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_binascii, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":22 * from sdl2 cimport * * import binascii * import struct # <<<<<<<<<<<<<< * * include "color_dict.pxi" */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/color_dict.pxi":5 * * cdef object colors = { * 'aliceblue' : (240, 248, 255), # <<<<<<<<<<<<<< * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), */ __pyx_t_2 = __Pyx_PyDict_NewPresized(658); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_aliceblue, __pyx_tuple__11) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":6 * cdef object colors = { * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), # <<<<<<<<<<<<<< * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_antiquewhite, __pyx_tuple__12) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":7 * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), # <<<<<<<<<<<<<< * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_antiquewhite1, __pyx_tuple__13) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":8 * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), # <<<<<<<<<<<<<< * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_antiquewhite2, __pyx_tuple__14) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":9 * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), # <<<<<<<<<<<<<< * 'antiquewhite4' : (139, 131, 120), * 'aquamarine' : (127, 255, 212), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_antiquewhite3, __pyx_tuple__15) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":10 * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), # <<<<<<<<<<<<<< * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_antiquewhite4, __pyx_tuple__16) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":11 * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), * 'aquamarine' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_aquamarine, __pyx_tuple__17) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":12 * 'antiquewhite4' : (139, 131, 120), * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_aquamarine1, __pyx_tuple__17) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":13 * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), # <<<<<<<<<<<<<< * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_aquamarine2, __pyx_tuple__18) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":14 * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), # <<<<<<<<<<<<<< * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_aquamarine3, __pyx_tuple__19) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":15 * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), # <<<<<<<<<<<<<< * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_aquamarine4, __pyx_tuple__20) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":16 * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_azure, __pyx_tuple__21) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":17 * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_azure1, __pyx_tuple__21) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":18 * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), # <<<<<<<<<<<<<< * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_azure2, __pyx_tuple__22) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":19 * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), # <<<<<<<<<<<<<< * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_azure3, __pyx_tuple__23) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":20 * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), # <<<<<<<<<<<<<< * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_azure4, __pyx_tuple__24) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":21 * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), # <<<<<<<<<<<<<< * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_beige, __pyx_tuple__25) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":22 * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bisque, __pyx_tuple__26) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":23 * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bisque1, __pyx_tuple__26) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":24 * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), # <<<<<<<<<<<<<< * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bisque2, __pyx_tuple__27) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":25 * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), # <<<<<<<<<<<<<< * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bisque3, __pyx_tuple__28) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":26 * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), # <<<<<<<<<<<<<< * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bisque4, __pyx_tuple__29) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":27 * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), # <<<<<<<<<<<<<< * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_black, __pyx_tuple__30) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":28 * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), # <<<<<<<<<<<<<< * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blanchedalmond, __pyx_tuple__31) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":29 * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blue, __pyx_tuple__32) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":30 * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blue1, __pyx_tuple__32) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":31 * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), # <<<<<<<<<<<<<< * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blue2, __pyx_tuple__33) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":32 * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), # <<<<<<<<<<<<<< * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blue3, __pyx_tuple__34) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":33 * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), # <<<<<<<<<<<<<< * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blue4, __pyx_tuple__35) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":34 * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), # <<<<<<<<<<<<<< * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blueviolet, __pyx_tuple__36) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":35 * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), # <<<<<<<<<<<<<< * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_brown, __pyx_tuple__37) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":36 * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), # <<<<<<<<<<<<<< * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_brown1, __pyx_tuple__38) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":37 * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), # <<<<<<<<<<<<<< * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_brown2, __pyx_tuple__39) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":38 * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), # <<<<<<<<<<<<<< * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_brown3, __pyx_tuple__40) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":39 * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), # <<<<<<<<<<<<<< * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_brown4, __pyx_tuple__41) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":40 * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), # <<<<<<<<<<<<<< * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_burlywood, __pyx_tuple__42) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":41 * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), # <<<<<<<<<<<<<< * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_burlywood1, __pyx_tuple__43) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":42 * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), # <<<<<<<<<<<<<< * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_burlywood2, __pyx_tuple__44) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":43 * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), # <<<<<<<<<<<<<< * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_burlywood3, __pyx_tuple__45) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":44 * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), # <<<<<<<<<<<<<< * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_burlywood4, __pyx_tuple__46) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":45 * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), # <<<<<<<<<<<<<< * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cadetblue, __pyx_tuple__47) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":46 * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), # <<<<<<<<<<<<<< * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cadetblue1, __pyx_tuple__48) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":47 * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), # <<<<<<<<<<<<<< * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cadetblue2, __pyx_tuple__49) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":48 * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), # <<<<<<<<<<<<<< * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cadetblue3, __pyx_tuple__50) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":49 * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), # <<<<<<<<<<<<<< * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cadetblue4, __pyx_tuple__51) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":50 * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chartreuse, __pyx_tuple__52) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":51 * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chartreuse1, __pyx_tuple__52) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":52 * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), # <<<<<<<<<<<<<< * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chartreuse2, __pyx_tuple__53) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":53 * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), # <<<<<<<<<<<<<< * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chartreuse3, __pyx_tuple__54) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":54 * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), # <<<<<<<<<<<<<< * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chartreuse4, __pyx_tuple__55) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":55 * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), # <<<<<<<<<<<<<< * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chocolate, __pyx_tuple__56) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":56 * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), # <<<<<<<<<<<<<< * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chocolate1, __pyx_tuple__57) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":57 * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), # <<<<<<<<<<<<<< * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chocolate2, __pyx_tuple__58) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":58 * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), # <<<<<<<<<<<<<< * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chocolate3, __pyx_tuple__59) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":59 * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), # <<<<<<<<<<<<<< * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chocolate4, __pyx_tuple__60) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":60 * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), # <<<<<<<<<<<<<< * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_coral, __pyx_tuple__61) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":61 * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), # <<<<<<<<<<<<<< * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_coral1, __pyx_tuple__62) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":62 * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), # <<<<<<<<<<<<<< * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_coral2, __pyx_tuple__63) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":63 * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), # <<<<<<<<<<<<<< * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_coral3, __pyx_tuple__64) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":64 * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), # <<<<<<<<<<<<<< * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_coral4, __pyx_tuple__65) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":65 * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), # <<<<<<<<<<<<<< * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cornflowerblue, __pyx_tuple__66) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":66 * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cornsilk, __pyx_tuple__67) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":67 * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cornsilk1, __pyx_tuple__67) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":68 * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), # <<<<<<<<<<<<<< * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cornsilk2, __pyx_tuple__68) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":69 * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), # <<<<<<<<<<<<<< * 'cornsilk4' : (139, 136, 120), * 'cyan' : (0, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cornsilk3, __pyx_tuple__69) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":70 * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), # <<<<<<<<<<<<<< * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cornsilk4, __pyx_tuple__70) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":71 * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), * 'cyan' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cyan, __pyx_tuple__71) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":72 * 'cornsilk4' : (139, 136, 120), * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cyan1, __pyx_tuple__71) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":73 * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), # <<<<<<<<<<<<<< * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cyan2, __pyx_tuple__72) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":74 * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), # <<<<<<<<<<<<<< * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cyan3, __pyx_tuple__73) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":75 * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cyan4, __pyx_tuple__74) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":76 * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), # <<<<<<<<<<<<<< * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkblue, __pyx_tuple__35) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":77 * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkcyan, __pyx_tuple__74) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":78 * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), # <<<<<<<<<<<<<< * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgoldenrod, __pyx_tuple__75) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":79 * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), # <<<<<<<<<<<<<< * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgoldenrod1, __pyx_tuple__76) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":80 * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), # <<<<<<<<<<<<<< * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgoldenrod2, __pyx_tuple__77) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":81 * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), # <<<<<<<<<<<<<< * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgoldenrod3, __pyx_tuple__78) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":82 * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), # <<<<<<<<<<<<<< * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgoldenrod4, __pyx_tuple__79) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":83 * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgray, __pyx_tuple__80) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":84 * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), # <<<<<<<<<<<<<< * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgreen, __pyx_tuple__81) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":85 * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgrey, __pyx_tuple__80) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":86 * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), # <<<<<<<<<<<<<< * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkkhaki, __pyx_tuple__82) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":87 * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), # <<<<<<<<<<<<<< * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkmagenta, __pyx_tuple__83) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":88 * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), # <<<<<<<<<<<<<< * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkolivegreen, __pyx_tuple__84) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":89 * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), # <<<<<<<<<<<<<< * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkolivegreen1, __pyx_tuple__85) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":90 * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), # <<<<<<<<<<<<<< * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkolivegreen2, __pyx_tuple__86) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":91 * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), # <<<<<<<<<<<<<< * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkolivegreen3, __pyx_tuple__87) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":92 * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), # <<<<<<<<<<<<<< * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkolivegreen4, __pyx_tuple__88) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":93 * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), # <<<<<<<<<<<<<< * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorange, __pyx_tuple__89) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":94 * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), # <<<<<<<<<<<<<< * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorange1, __pyx_tuple__90) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":95 * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), # <<<<<<<<<<<<<< * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorange2, __pyx_tuple__91) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":96 * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), # <<<<<<<<<<<<<< * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorange3, __pyx_tuple__92) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":97 * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), # <<<<<<<<<<<<<< * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorange4, __pyx_tuple__93) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":98 * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), # <<<<<<<<<<<<<< * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorchid, __pyx_tuple__94) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":99 * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), # <<<<<<<<<<<<<< * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorchid1, __pyx_tuple__95) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":100 * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), # <<<<<<<<<<<<<< * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorchid2, __pyx_tuple__96) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":101 * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), # <<<<<<<<<<<<<< * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorchid3, __pyx_tuple__97) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":102 * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), # <<<<<<<<<<<<<< * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorchid4, __pyx_tuple__98) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":103 * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), # <<<<<<<<<<<<<< * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkred, __pyx_tuple__99) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":104 * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), # <<<<<<<<<<<<<< * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darksalmon, __pyx_tuple__100) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":105 * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), # <<<<<<<<<<<<<< * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkseagreen, __pyx_tuple__101) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":106 * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), # <<<<<<<<<<<<<< * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkseagreen1, __pyx_tuple__102) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":107 * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), # <<<<<<<<<<<<<< * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkseagreen2, __pyx_tuple__103) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":108 * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), # <<<<<<<<<<<<<< * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkseagreen3, __pyx_tuple__104) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":109 * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), # <<<<<<<<<<<<<< * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkseagreen4, __pyx_tuple__105) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":110 * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), # <<<<<<<<<<<<<< * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslateblue, __pyx_tuple__106) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":111 * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslategray, __pyx_tuple__107) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":112 * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), # <<<<<<<<<<<<<< * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslategray1, __pyx_tuple__108) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":113 * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), # <<<<<<<<<<<<<< * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslategray2, __pyx_tuple__109) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":114 * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), # <<<<<<<<<<<<<< * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslategray3, __pyx_tuple__110) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":115 * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), # <<<<<<<<<<<<<< * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslategray4, __pyx_tuple__111) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":116 * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslategrey, __pyx_tuple__107) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":117 * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), # <<<<<<<<<<<<<< * 'darkviolet' : (148, 0, 211), * 'debianred' : (215, 7, 81), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkturquoise, __pyx_tuple__112) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":118 * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), # <<<<<<<<<<<<<< * 'debianred' : (215, 7, 81), * 'deeppink' : (255, 20, 147), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkviolet, __pyx_tuple__113) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":119 * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), * 'debianred' : (215, 7, 81), # <<<<<<<<<<<<<< * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_debianred, __pyx_tuple__114) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":120 * 'darkviolet' : (148, 0, 211), * 'debianred' : (215, 7, 81), * 'deeppink' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deeppink, __pyx_tuple__115) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":121 * 'debianred' : (215, 7, 81), * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deeppink1, __pyx_tuple__115) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":122 * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), # <<<<<<<<<<<<<< * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deeppink2, __pyx_tuple__116) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":123 * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), # <<<<<<<<<<<<<< * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deeppink3, __pyx_tuple__117) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":124 * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), # <<<<<<<<<<<<<< * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deeppink4, __pyx_tuple__118) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":125 * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deepskyblue, __pyx_tuple__119) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":126 * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deepskyblue1, __pyx_tuple__119) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":127 * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), # <<<<<<<<<<<<<< * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deepskyblue2, __pyx_tuple__120) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":128 * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), # <<<<<<<<<<<<<< * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deepskyblue3, __pyx_tuple__121) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":129 * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), # <<<<<<<<<<<<<< * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deepskyblue4, __pyx_tuple__122) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":130 * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dimgray, __pyx_tuple__123) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":131 * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dimgrey, __pyx_tuple__123) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":132 * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dodgerblue, __pyx_tuple__124) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":133 * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dodgerblue1, __pyx_tuple__124) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":134 * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), # <<<<<<<<<<<<<< * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dodgerblue2, __pyx_tuple__125) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":135 * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), # <<<<<<<<<<<<<< * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dodgerblue3, __pyx_tuple__126) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":136 * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), # <<<<<<<<<<<<<< * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dodgerblue4, __pyx_tuple__127) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":137 * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), # <<<<<<<<<<<<<< * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_firebrick, __pyx_tuple__128) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":138 * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), # <<<<<<<<<<<<<< * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_firebrick1, __pyx_tuple__129) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":139 * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), # <<<<<<<<<<<<<< * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_firebrick2, __pyx_tuple__130) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":140 * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), # <<<<<<<<<<<<<< * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_firebrick3, __pyx_tuple__131) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":141 * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), # <<<<<<<<<<<<<< * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_firebrick4, __pyx_tuple__132) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":142 * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), # <<<<<<<<<<<<<< * 'forestgreen' : (34, 139, 34), * 'gainsboro' : (220, 220, 220), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_floralwhite, __pyx_tuple__133) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":143 * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), # <<<<<<<<<<<<<< * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_forestgreen, __pyx_tuple__134) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":144 * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), * 'gainsboro' : (220, 220, 220), # <<<<<<<<<<<<<< * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gainsboro, __pyx_tuple__135) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":145 * 'forestgreen' : (34, 139, 34), * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), # <<<<<<<<<<<<<< * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ghostwhite, __pyx_tuple__136) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":146 * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gold, __pyx_tuple__137) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":147 * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gold1, __pyx_tuple__137) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":148 * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), # <<<<<<<<<<<<<< * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gold2, __pyx_tuple__138) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":149 * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), # <<<<<<<<<<<<<< * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gold3, __pyx_tuple__139) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":150 * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), # <<<<<<<<<<<<<< * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gold4, __pyx_tuple__140) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":151 * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), # <<<<<<<<<<<<<< * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_goldenrod, __pyx_tuple__141) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":152 * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), # <<<<<<<<<<<<<< * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_goldenrod1, __pyx_tuple__142) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":153 * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), # <<<<<<<<<<<<<< * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_goldenrod2, __pyx_tuple__143) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":154 * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), # <<<<<<<<<<<<<< * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_goldenrod3, __pyx_tuple__144) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":155 * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), # <<<<<<<<<<<<<< * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_goldenrod4, __pyx_tuple__145) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":156 * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), # <<<<<<<<<<<<<< * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray, __pyx_tuple__146) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":157 * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), # <<<<<<<<<<<<<< * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray0, __pyx_tuple__30) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":158 * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray1, __pyx_tuple__147) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":159 * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray10, __pyx_tuple__148) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":160 * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray100, __pyx_tuple__149) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":161 * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray11, __pyx_tuple__150) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":162 * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray12, __pyx_tuple__151) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":163 * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray13, __pyx_tuple__152) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":164 * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray14, __pyx_tuple__153) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":165 * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray15, __pyx_tuple__154) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":166 * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray16, __pyx_tuple__155) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":167 * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray17, __pyx_tuple__156) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":168 * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray18, __pyx_tuple__157) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":169 * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray19, __pyx_tuple__158) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":170 * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray2, __pyx_tuple__159) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":171 * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray20, __pyx_tuple__160) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":172 * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray21, __pyx_tuple__161) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":173 * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray22, __pyx_tuple__162) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":174 * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray23, __pyx_tuple__163) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":175 * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray24, __pyx_tuple__164) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":176 * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray25, __pyx_tuple__165) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":177 * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray26, __pyx_tuple__166) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":178 * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray27, __pyx_tuple__167) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":179 * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray28, __pyx_tuple__168) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":180 * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray29, __pyx_tuple__169) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":181 * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray3, __pyx_tuple__170) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":182 * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray30, __pyx_tuple__171) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":183 * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray31, __pyx_tuple__172) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":184 * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray32, __pyx_tuple__173) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":185 * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray33, __pyx_tuple__174) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":186 * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray34, __pyx_tuple__175) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":187 * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray35, __pyx_tuple__176) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":188 * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray36, __pyx_tuple__177) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":189 * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray37, __pyx_tuple__178) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":190 * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray38, __pyx_tuple__179) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":191 * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray39, __pyx_tuple__180) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":192 * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray4, __pyx_tuple__181) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":193 * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray40, __pyx_tuple__182) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":194 * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), # <<<<<<<<<<<<<< * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray41, __pyx_tuple__123) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":195 * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray42, __pyx_tuple__183) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":196 * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray43, __pyx_tuple__184) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":197 * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray44, __pyx_tuple__185) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":198 * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray45, __pyx_tuple__186) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":199 * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray46, __pyx_tuple__187) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":200 * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray47, __pyx_tuple__188) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":201 * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray48, __pyx_tuple__189) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":202 * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray49, __pyx_tuple__190) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":203 * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray5, __pyx_tuple__191) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":204 * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray50, __pyx_tuple__192) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":205 * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray51, __pyx_tuple__193) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":206 * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray52, __pyx_tuple__194) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":207 * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray53, __pyx_tuple__195) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":208 * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray54, __pyx_tuple__196) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":209 * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray55, __pyx_tuple__197) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":210 * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray56, __pyx_tuple__198) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":211 * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray57, __pyx_tuple__199) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":212 * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray58, __pyx_tuple__200) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":213 * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray59, __pyx_tuple__201) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":214 * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray6, __pyx_tuple__202) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":215 * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray60, __pyx_tuple__203) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":216 * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray61, __pyx_tuple__204) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":217 * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray62, __pyx_tuple__205) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":218 * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray63, __pyx_tuple__206) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":219 * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray64, __pyx_tuple__207) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":220 * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray65, __pyx_tuple__208) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":221 * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray66, __pyx_tuple__209) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":222 * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray67, __pyx_tuple__210) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":223 * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray68, __pyx_tuple__211) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":224 * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray69, __pyx_tuple__212) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":225 * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray7, __pyx_tuple__213) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":226 * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray70, __pyx_tuple__214) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":227 * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray71, __pyx_tuple__215) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":228 * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray72, __pyx_tuple__216) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":229 * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray73, __pyx_tuple__217) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":230 * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray74, __pyx_tuple__218) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":231 * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray75, __pyx_tuple__219) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":232 * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray76, __pyx_tuple__220) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":233 * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray77, __pyx_tuple__221) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":234 * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray78, __pyx_tuple__222) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":235 * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray79, __pyx_tuple__223) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":236 * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray8, __pyx_tuple__224) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":237 * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray80, __pyx_tuple__225) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":238 * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray81, __pyx_tuple__226) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":239 * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray82, __pyx_tuple__227) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":240 * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray83, __pyx_tuple__228) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":241 * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray84, __pyx_tuple__229) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":242 * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray85, __pyx_tuple__230) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":243 * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray86, __pyx_tuple__231) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":244 * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray87, __pyx_tuple__232) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":245 * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray88, __pyx_tuple__233) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":246 * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray89, __pyx_tuple__234) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":247 * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray9, __pyx_tuple__235) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":248 * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray90, __pyx_tuple__236) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":249 * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray91, __pyx_tuple__237) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":250 * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray92, __pyx_tuple__238) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":251 * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray93, __pyx_tuple__239) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":252 * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray94, __pyx_tuple__240) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":253 * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray95, __pyx_tuple__241) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":254 * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray96, __pyx_tuple__242) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":255 * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray97, __pyx_tuple__243) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":256 * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray98, __pyx_tuple__244) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":257 * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray99, __pyx_tuple__245) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":258 * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_green, __pyx_tuple__246) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":259 * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_green1, __pyx_tuple__246) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":260 * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), # <<<<<<<<<<<<<< * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_green2, __pyx_tuple__247) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":261 * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), # <<<<<<<<<<<<<< * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_green3, __pyx_tuple__248) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":262 * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), # <<<<<<<<<<<<<< * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_green4, __pyx_tuple__249) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":263 * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), # <<<<<<<<<<<<<< * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_greenyellow, __pyx_tuple__250) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":264 * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), # <<<<<<<<<<<<<< * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey, __pyx_tuple__146) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":265 * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), # <<<<<<<<<<<<<< * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey0, __pyx_tuple__30) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":266 * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey1, __pyx_tuple__147) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":267 * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey10, __pyx_tuple__148) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":268 * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey100, __pyx_tuple__149) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":269 * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey11, __pyx_tuple__150) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":270 * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey12, __pyx_tuple__151) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":271 * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey13, __pyx_tuple__152) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":272 * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey14, __pyx_tuple__153) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":273 * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey15, __pyx_tuple__154) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":274 * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey16, __pyx_tuple__155) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":275 * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey17, __pyx_tuple__156) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":276 * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey18, __pyx_tuple__157) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":277 * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey19, __pyx_tuple__158) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":278 * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey2, __pyx_tuple__159) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":279 * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey20, __pyx_tuple__160) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":280 * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey21, __pyx_tuple__161) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":281 * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey22, __pyx_tuple__162) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":282 * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey23, __pyx_tuple__163) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":283 * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey24, __pyx_tuple__164) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":284 * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey25, __pyx_tuple__165) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":285 * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey26, __pyx_tuple__166) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":286 * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey27, __pyx_tuple__167) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":287 * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey28, __pyx_tuple__168) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":288 * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey29, __pyx_tuple__169) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":289 * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey3, __pyx_tuple__170) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":290 * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey30, __pyx_tuple__171) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":291 * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey31, __pyx_tuple__172) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":292 * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey32, __pyx_tuple__173) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":293 * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey33, __pyx_tuple__174) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":294 * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey34, __pyx_tuple__175) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":295 * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey35, __pyx_tuple__176) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":296 * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey36, __pyx_tuple__177) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":297 * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey37, __pyx_tuple__178) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":298 * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey38, __pyx_tuple__179) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":299 * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey39, __pyx_tuple__180) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":300 * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey4, __pyx_tuple__181) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":301 * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey40, __pyx_tuple__182) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":302 * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), # <<<<<<<<<<<<<< * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey41, __pyx_tuple__123) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":303 * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey42, __pyx_tuple__183) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":304 * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey43, __pyx_tuple__184) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":305 * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey44, __pyx_tuple__185) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":306 * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey45, __pyx_tuple__186) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":307 * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey46, __pyx_tuple__187) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":308 * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey47, __pyx_tuple__188) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":309 * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey48, __pyx_tuple__189) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":310 * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey49, __pyx_tuple__190) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":311 * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey5, __pyx_tuple__191) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":312 * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey50, __pyx_tuple__192) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":313 * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey51, __pyx_tuple__193) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":314 * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey52, __pyx_tuple__194) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":315 * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey53, __pyx_tuple__195) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":316 * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey54, __pyx_tuple__196) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":317 * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey55, __pyx_tuple__197) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":318 * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey56, __pyx_tuple__198) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":319 * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey57, __pyx_tuple__199) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":320 * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey58, __pyx_tuple__200) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":321 * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey59, __pyx_tuple__201) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":322 * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey6, __pyx_tuple__202) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":323 * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey60, __pyx_tuple__203) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":324 * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey61, __pyx_tuple__204) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":325 * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey62, __pyx_tuple__205) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":326 * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey63, __pyx_tuple__206) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":327 * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey64, __pyx_tuple__207) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":328 * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey65, __pyx_tuple__208) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":329 * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey66, __pyx_tuple__209) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":330 * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey67, __pyx_tuple__210) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":331 * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey68, __pyx_tuple__211) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":332 * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey69, __pyx_tuple__212) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":333 * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey7, __pyx_tuple__213) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":334 * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey70, __pyx_tuple__214) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":335 * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey71, __pyx_tuple__215) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":336 * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey72, __pyx_tuple__216) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":337 * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey73, __pyx_tuple__217) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":338 * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey74, __pyx_tuple__218) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":339 * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey75, __pyx_tuple__219) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":340 * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey76, __pyx_tuple__220) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":341 * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey77, __pyx_tuple__221) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":342 * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey78, __pyx_tuple__222) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":343 * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey79, __pyx_tuple__223) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":344 * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey8, __pyx_tuple__224) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":345 * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey80, __pyx_tuple__225) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":346 * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey81, __pyx_tuple__226) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":347 * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey82, __pyx_tuple__227) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":348 * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey83, __pyx_tuple__228) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":349 * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey84, __pyx_tuple__229) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":350 * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey85, __pyx_tuple__230) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":351 * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey86, __pyx_tuple__231) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":352 * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey87, __pyx_tuple__232) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":353 * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey88, __pyx_tuple__233) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":354 * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey89, __pyx_tuple__234) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":355 * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey9, __pyx_tuple__235) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":356 * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey90, __pyx_tuple__236) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":357 * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey91, __pyx_tuple__237) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":358 * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey92, __pyx_tuple__238) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":359 * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey93, __pyx_tuple__239) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":360 * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey94, __pyx_tuple__240) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":361 * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey95, __pyx_tuple__241) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":362 * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey96, __pyx_tuple__242) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":363 * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey97, __pyx_tuple__243) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":364 * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey98, __pyx_tuple__244) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":365 * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey99, __pyx_tuple__245) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":366 * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_honeydew, __pyx_tuple__251) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":367 * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_honeydew1, __pyx_tuple__251) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":368 * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), # <<<<<<<<<<<<<< * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_honeydew2, __pyx_tuple__252) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":369 * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), # <<<<<<<<<<<<<< * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_honeydew3, __pyx_tuple__253) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":370 * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), # <<<<<<<<<<<<<< * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_honeydew4, __pyx_tuple__254) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":371 * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), # <<<<<<<<<<<<<< * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hotpink, __pyx_tuple__255) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":372 * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), # <<<<<<<<<<<<<< * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hotpink1, __pyx_tuple__256) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":373 * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), # <<<<<<<<<<<<<< * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hotpink2, __pyx_tuple__257) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":374 * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), # <<<<<<<<<<<<<< * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hotpink3, __pyx_tuple__258) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":375 * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), # <<<<<<<<<<<<<< * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hotpink4, __pyx_tuple__259) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":376 * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), # <<<<<<<<<<<<<< * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_indianred, __pyx_tuple__260) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":377 * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), # <<<<<<<<<<<<<< * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_indianred1, __pyx_tuple__261) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":378 * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), # <<<<<<<<<<<<<< * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_indianred2, __pyx_tuple__262) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":379 * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), # <<<<<<<<<<<<<< * 'indianred4' : (139, 58, 58), * 'ivory' : (255, 255, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_indianred3, __pyx_tuple__263) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":380 * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), # <<<<<<<<<<<<<< * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_indianred4, __pyx_tuple__264) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":381 * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), * 'ivory' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ivory, __pyx_tuple__265) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":382 * 'indianred4' : (139, 58, 58), * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ivory1, __pyx_tuple__265) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":383 * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), # <<<<<<<<<<<<<< * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ivory2, __pyx_tuple__266) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":384 * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), # <<<<<<<<<<<<<< * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ivory3, __pyx_tuple__267) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":385 * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), # <<<<<<<<<<<<<< * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ivory4, __pyx_tuple__268) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":386 * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), # <<<<<<<<<<<<<< * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_khaki, __pyx_tuple__269) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":387 * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), # <<<<<<<<<<<<<< * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_khaki1, __pyx_tuple__270) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":388 * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), # <<<<<<<<<<<<<< * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_khaki2, __pyx_tuple__271) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":389 * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), # <<<<<<<<<<<<<< * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_khaki3, __pyx_tuple__272) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":390 * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), # <<<<<<<<<<<<<< * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_khaki4, __pyx_tuple__273) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":391 * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), # <<<<<<<<<<<<<< * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lavender, __pyx_tuple__274) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":392 * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lavenderblush, __pyx_tuple__275) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":393 * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lavenderblush1, __pyx_tuple__275) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":394 * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), # <<<<<<<<<<<<<< * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lavenderblush2, __pyx_tuple__276) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":395 * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), # <<<<<<<<<<<<<< * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lavenderblush3, __pyx_tuple__277) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":396 * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), # <<<<<<<<<<<<<< * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lavenderblush4, __pyx_tuple__278) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":397 * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), # <<<<<<<<<<<<<< * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lawngreen, __pyx_tuple__279) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":398 * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lemonchiffon, __pyx_tuple__280) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":399 * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lemonchiffon1, __pyx_tuple__280) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":400 * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), # <<<<<<<<<<<<<< * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lemonchiffon2, __pyx_tuple__281) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":401 * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), # <<<<<<<<<<<<<< * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lemonchiffon3, __pyx_tuple__282) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":402 * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), # <<<<<<<<<<<<<< * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lemonchiffon4, __pyx_tuple__283) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":403 * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), # <<<<<<<<<<<<<< * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightblue, __pyx_tuple__284) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":404 * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), # <<<<<<<<<<<<<< * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightblue1, __pyx_tuple__285) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":405 * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), # <<<<<<<<<<<<<< * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightblue2, __pyx_tuple__286) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":406 * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), # <<<<<<<<<<<<<< * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightblue3, __pyx_tuple__287) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":407 * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), # <<<<<<<<<<<<<< * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightblue4, __pyx_tuple__288) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":408 * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), # <<<<<<<<<<<<<< * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightcoral, __pyx_tuple__289) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":409 * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightcyan, __pyx_tuple__290) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":410 * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightcyan1, __pyx_tuple__290) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":411 * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), # <<<<<<<<<<<<<< * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightcyan2, __pyx_tuple__291) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":412 * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), # <<<<<<<<<<<<<< * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightcyan3, __pyx_tuple__292) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":413 * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightcyan4, __pyx_tuple__293) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":414 * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgoldenrod, __pyx_tuple__294) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":415 * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgoldenrod1, __pyx_tuple__295) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":416 * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgoldenrod2, __pyx_tuple__296) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":417 * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), # <<<<<<<<<<<<<< * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgoldenrod3, __pyx_tuple__297) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":418 * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), # <<<<<<<<<<<<<< * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgoldenrod4, __pyx_tuple__298) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":419 * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), # <<<<<<<<<<<<<< * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgoldenrodyellow, __pyx_tuple__299) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":420 * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgray, __pyx_tuple__300) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":421 * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), # <<<<<<<<<<<<<< * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgreen, __pyx_tuple__301) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":422 * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgrey, __pyx_tuple__300) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":423 * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), # <<<<<<<<<<<<<< * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightpink, __pyx_tuple__302) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":424 * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), # <<<<<<<<<<<<<< * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightpink1, __pyx_tuple__303) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":425 * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), # <<<<<<<<<<<<<< * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightpink2, __pyx_tuple__304) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":426 * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), # <<<<<<<<<<<<<< * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightpink3, __pyx_tuple__305) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":427 * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), # <<<<<<<<<<<<<< * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightpink4, __pyx_tuple__306) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":428 * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsalmon, __pyx_tuple__307) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":429 * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsalmon1, __pyx_tuple__307) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":430 * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), # <<<<<<<<<<<<<< * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsalmon2, __pyx_tuple__308) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":431 * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), # <<<<<<<<<<<<<< * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsalmon3, __pyx_tuple__309) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":432 * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), # <<<<<<<<<<<<<< * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsalmon4, __pyx_tuple__310) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":433 * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), # <<<<<<<<<<<<<< * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightseagreen, __pyx_tuple__311) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":434 * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), # <<<<<<<<<<<<<< * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightskyblue, __pyx_tuple__312) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":435 * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), # <<<<<<<<<<<<<< * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightskyblue1, __pyx_tuple__313) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":436 * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), # <<<<<<<<<<<<<< * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightskyblue2, __pyx_tuple__314) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":437 * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), # <<<<<<<<<<<<<< * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightskyblue3, __pyx_tuple__315) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":438 * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), # <<<<<<<<<<<<<< * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightskyblue4, __pyx_tuple__316) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":439 * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), # <<<<<<<<<<<<<< * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightslateblue, __pyx_tuple__317) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":440 * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightslategray, __pyx_tuple__318) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":441 * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightslategrey, __pyx_tuple__318) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":442 * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), # <<<<<<<<<<<<<< * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsteelblue, __pyx_tuple__319) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":443 * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), # <<<<<<<<<<<<<< * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsteelblue1, __pyx_tuple__320) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":444 * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), # <<<<<<<<<<<<<< * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsteelblue2, __pyx_tuple__321) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":445 * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), # <<<<<<<<<<<<<< * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsteelblue3, __pyx_tuple__322) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":446 * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), # <<<<<<<<<<<<<< * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsteelblue4, __pyx_tuple__323) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":447 * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightyellow, __pyx_tuple__324) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":448 * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightyellow1, __pyx_tuple__324) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":449 * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), # <<<<<<<<<<<<<< * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightyellow2, __pyx_tuple__325) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":450 * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), # <<<<<<<<<<<<<< * 'lightyellow4' : (139, 139, 122), * 'limegreen' : (50, 205, 50), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightyellow3, __pyx_tuple__326) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":451 * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), # <<<<<<<<<<<<<< * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightyellow4, __pyx_tuple__327) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":452 * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), * 'limegreen' : (50, 205, 50), # <<<<<<<<<<<<<< * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_limegreen, __pyx_tuple__328) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":453 * 'lightyellow4' : (139, 139, 122), * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), # <<<<<<<<<<<<<< * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_linen, __pyx_tuple__329) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":454 * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_magenta, __pyx_tuple__330) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":455 * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_magenta1, __pyx_tuple__330) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":456 * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), # <<<<<<<<<<<<<< * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_magenta2, __pyx_tuple__331) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":457 * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), # <<<<<<<<<<<<<< * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_magenta3, __pyx_tuple__332) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":458 * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), # <<<<<<<<<<<<<< * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_magenta4, __pyx_tuple__83) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":459 * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), # <<<<<<<<<<<<<< * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maroon, __pyx_tuple__333) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":460 * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), # <<<<<<<<<<<<<< * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maroon1, __pyx_tuple__334) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":461 * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), # <<<<<<<<<<<<<< * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maroon2, __pyx_tuple__335) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":462 * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), # <<<<<<<<<<<<<< * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maroon3, __pyx_tuple__336) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":463 * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), # <<<<<<<<<<<<<< * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maroon4, __pyx_tuple__337) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":464 * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), # <<<<<<<<<<<<<< * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumaquamarine, __pyx_tuple__19) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":465 * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), # <<<<<<<<<<<<<< * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumblue, __pyx_tuple__34) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":466 * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), # <<<<<<<<<<<<<< * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumorchid, __pyx_tuple__338) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":467 * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), # <<<<<<<<<<<<<< * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumorchid1, __pyx_tuple__339) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":468 * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), # <<<<<<<<<<<<<< * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumorchid2, __pyx_tuple__340) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":469 * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), # <<<<<<<<<<<<<< * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumorchid3, __pyx_tuple__341) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":470 * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), # <<<<<<<<<<<<<< * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumorchid4, __pyx_tuple__342) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":471 * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), # <<<<<<<<<<<<<< * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumpurple, __pyx_tuple__343) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":472 * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), # <<<<<<<<<<<<<< * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumpurple1, __pyx_tuple__344) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":473 * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), # <<<<<<<<<<<<<< * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumpurple2, __pyx_tuple__345) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":474 * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), # <<<<<<<<<<<<<< * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumpurple3, __pyx_tuple__346) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":475 * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), # <<<<<<<<<<<<<< * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumpurple4, __pyx_tuple__347) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":476 * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), # <<<<<<<<<<<<<< * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumseagreen, __pyx_tuple__348) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":477 * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), # <<<<<<<<<<<<<< * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumslateblue, __pyx_tuple__349) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":478 * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), # <<<<<<<<<<<<<< * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumspringgreen, __pyx_tuple__350) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":479 * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), # <<<<<<<<<<<<<< * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumturquoise, __pyx_tuple__351) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":480 * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), # <<<<<<<<<<<<<< * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumvioletred, __pyx_tuple__352) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":481 * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), # <<<<<<<<<<<<<< * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_midnightblue, __pyx_tuple__353) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":482 * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), # <<<<<<<<<<<<<< * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mintcream, __pyx_tuple__354) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":483 * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mistyrose, __pyx_tuple__355) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":484 * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mistyrose1, __pyx_tuple__355) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":485 * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), # <<<<<<<<<<<<<< * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mistyrose2, __pyx_tuple__356) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":486 * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), # <<<<<<<<<<<<<< * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mistyrose3, __pyx_tuple__357) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":487 * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), # <<<<<<<<<<<<<< * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mistyrose4, __pyx_tuple__358) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":488 * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), # <<<<<<<<<<<<<< * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_moccasin, __pyx_tuple__359) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":489 * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navajowhite, __pyx_tuple__360) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":490 * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navajowhite1, __pyx_tuple__360) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":491 * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), # <<<<<<<<<<<<<< * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navajowhite2, __pyx_tuple__361) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":492 * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), # <<<<<<<<<<<<<< * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navajowhite3, __pyx_tuple__362) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":493 * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), # <<<<<<<<<<<<<< * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navajowhite4, __pyx_tuple__363) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":494 * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), # <<<<<<<<<<<<<< * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navy, __pyx_tuple__364) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":495 * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), # <<<<<<<<<<<<<< * 'oldlace' : (253, 245, 230), * 'olivedrab' : (107, 142, 35), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navyblue, __pyx_tuple__364) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":496 * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), # <<<<<<<<<<<<<< * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_oldlace, __pyx_tuple__365) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":497 * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), * 'olivedrab' : (107, 142, 35), # <<<<<<<<<<<<<< * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_olivedrab, __pyx_tuple__366) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":498 * 'oldlace' : (253, 245, 230), * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), # <<<<<<<<<<<<<< * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_olivedrab1, __pyx_tuple__367) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":499 * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), # <<<<<<<<<<<<<< * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_olivedrab2, __pyx_tuple__368) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":500 * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), # <<<<<<<<<<<<<< * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_olivedrab3, __pyx_tuple__369) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":501 * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), # <<<<<<<<<<<<<< * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_olivedrab4, __pyx_tuple__370) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":502 * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orange, __pyx_tuple__371) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":503 * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orange1, __pyx_tuple__371) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":504 * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), # <<<<<<<<<<<<<< * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orange2, __pyx_tuple__372) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":505 * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), # <<<<<<<<<<<<<< * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orange3, __pyx_tuple__373) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":506 * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), # <<<<<<<<<<<<<< * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orange4, __pyx_tuple__374) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":507 * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orangered, __pyx_tuple__375) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":508 * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orangered1, __pyx_tuple__375) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":509 * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), # <<<<<<<<<<<<<< * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orangered2, __pyx_tuple__376) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":510 * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), # <<<<<<<<<<<<<< * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orangered3, __pyx_tuple__377) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":511 * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), # <<<<<<<<<<<<<< * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orangered4, __pyx_tuple__378) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":512 * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), # <<<<<<<<<<<<<< * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orchid, __pyx_tuple__379) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":513 * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), # <<<<<<<<<<<<<< * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orchid1, __pyx_tuple__380) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":514 * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), # <<<<<<<<<<<<<< * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orchid2, __pyx_tuple__381) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":515 * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), # <<<<<<<<<<<<<< * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orchid3, __pyx_tuple__382) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":516 * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), # <<<<<<<<<<<<<< * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orchid4, __pyx_tuple__383) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":517 * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), # <<<<<<<<<<<<<< * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palegoldenrod, __pyx_tuple__384) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":518 * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), # <<<<<<<<<<<<<< * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palegreen, __pyx_tuple__385) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":519 * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), # <<<<<<<<<<<<<< * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palegreen1, __pyx_tuple__386) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":520 * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), # <<<<<<<<<<<<<< * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palegreen2, __pyx_tuple__301) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":521 * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), # <<<<<<<<<<<<<< * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palegreen3, __pyx_tuple__387) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":522 * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), # <<<<<<<<<<<<<< * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palegreen4, __pyx_tuple__388) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":523 * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_paleturquoise, __pyx_tuple__389) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":524 * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), # <<<<<<<<<<<<<< * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_paleturquoise1, __pyx_tuple__390) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":525 * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_paleturquoise2, __pyx_tuple__391) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":526 * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), # <<<<<<<<<<<<<< * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_paleturquoise3, __pyx_tuple__392) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":527 * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), # <<<<<<<<<<<<<< * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_paleturquoise4, __pyx_tuple__393) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":528 * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), # <<<<<<<<<<<<<< * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palevioletred, __pyx_tuple__394) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":529 * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), # <<<<<<<<<<<<<< * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palevioletred1, __pyx_tuple__395) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":530 * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), # <<<<<<<<<<<<<< * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palevioletred2, __pyx_tuple__396) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":531 * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), # <<<<<<<<<<<<<< * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palevioletred3, __pyx_tuple__397) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":532 * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), # <<<<<<<<<<<<<< * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palevioletred4, __pyx_tuple__398) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":533 * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), # <<<<<<<<<<<<<< * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_papayawhip, __pyx_tuple__399) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":534 * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_peachpuff, __pyx_tuple__400) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":535 * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_peachpuff1, __pyx_tuple__400) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":536 * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), # <<<<<<<<<<<<<< * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_peachpuff2, __pyx_tuple__401) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":537 * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), # <<<<<<<<<<<<<< * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_peachpuff3, __pyx_tuple__402) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":538 * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), # <<<<<<<<<<<<<< * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_peachpuff4, __pyx_tuple__403) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":539 * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), # <<<<<<<<<<<<<< * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_peru, __pyx_tuple__404) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":540 * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), # <<<<<<<<<<<<<< * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pink, __pyx_tuple__405) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":541 * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), # <<<<<<<<<<<<<< * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pink1, __pyx_tuple__406) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":542 * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), # <<<<<<<<<<<<<< * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pink2, __pyx_tuple__407) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":543 * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), # <<<<<<<<<<<<<< * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pink3, __pyx_tuple__408) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":544 * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), # <<<<<<<<<<<<<< * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pink4, __pyx_tuple__409) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":545 * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), # <<<<<<<<<<<<<< * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_plum, __pyx_tuple__410) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":546 * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), # <<<<<<<<<<<<<< * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_plum1, __pyx_tuple__411) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":547 * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), # <<<<<<<<<<<<<< * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_plum2, __pyx_tuple__412) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":548 * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), # <<<<<<<<<<<<<< * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_plum3, __pyx_tuple__413) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":549 * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), # <<<<<<<<<<<<<< * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_plum4, __pyx_tuple__414) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":550 * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), # <<<<<<<<<<<<<< * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_powderblue, __pyx_tuple__415) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":551 * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), # <<<<<<<<<<<<<< * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_purple, __pyx_tuple__416) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":552 * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), # <<<<<<<<<<<<<< * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_purple1, __pyx_tuple__417) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":553 * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), # <<<<<<<<<<<<<< * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_purple2, __pyx_tuple__418) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":554 * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), # <<<<<<<<<<<<<< * 'purple4' : (85, 26, 139), * 'red' : (255, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_purple3, __pyx_tuple__419) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":555 * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), # <<<<<<<<<<<<<< * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_purple4, __pyx_tuple__420) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":556 * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), * 'red' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_red, __pyx_tuple__421) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":557 * 'purple4' : (85, 26, 139), * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_red1, __pyx_tuple__421) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":558 * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), # <<<<<<<<<<<<<< * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_red2, __pyx_tuple__422) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":559 * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), # <<<<<<<<<<<<<< * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_red3, __pyx_tuple__423) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":560 * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), # <<<<<<<<<<<<<< * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_red4, __pyx_tuple__99) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":561 * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), # <<<<<<<<<<<<<< * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rosybrown, __pyx_tuple__424) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":562 * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), # <<<<<<<<<<<<<< * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rosybrown1, __pyx_tuple__425) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":563 * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), # <<<<<<<<<<<<<< * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rosybrown2, __pyx_tuple__426) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":564 * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), # <<<<<<<<<<<<<< * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rosybrown3, __pyx_tuple__427) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":565 * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), # <<<<<<<<<<<<<< * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rosybrown4, __pyx_tuple__428) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":566 * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), # <<<<<<<<<<<<<< * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_royalblue, __pyx_tuple__429) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":567 * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), # <<<<<<<<<<<<<< * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_royalblue1, __pyx_tuple__430) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":568 * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), # <<<<<<<<<<<<<< * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_royalblue2, __pyx_tuple__431) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":569 * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), # <<<<<<<<<<<<<< * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_royalblue3, __pyx_tuple__432) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":570 * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), # <<<<<<<<<<<<<< * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_royalblue4, __pyx_tuple__433) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":571 * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), # <<<<<<<<<<<<<< * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_saddlebrown, __pyx_tuple__60) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":572 * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), # <<<<<<<<<<<<<< * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_salmon, __pyx_tuple__434) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":573 * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), # <<<<<<<<<<<<<< * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_salmon1, __pyx_tuple__435) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":574 * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), # <<<<<<<<<<<<<< * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_salmon2, __pyx_tuple__436) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":575 * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), # <<<<<<<<<<<<<< * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_salmon3, __pyx_tuple__437) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":576 * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), # <<<<<<<<<<<<<< * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_salmon4, __pyx_tuple__438) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":577 * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), # <<<<<<<<<<<<<< * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sandybrown, __pyx_tuple__439) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":578 * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seagreen, __pyx_tuple__440) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":579 * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), # <<<<<<<<<<<<<< * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seagreen1, __pyx_tuple__441) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":580 * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), # <<<<<<<<<<<<<< * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seagreen2, __pyx_tuple__442) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":581 * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), # <<<<<<<<<<<<<< * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seagreen3, __pyx_tuple__443) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":582 * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seagreen4, __pyx_tuple__440) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":583 * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seashell, __pyx_tuple__444) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":584 * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seashell1, __pyx_tuple__444) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":585 * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), # <<<<<<<<<<<<<< * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seashell2, __pyx_tuple__445) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":586 * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), # <<<<<<<<<<<<<< * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seashell3, __pyx_tuple__446) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":587 * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), # <<<<<<<<<<<<<< * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seashell4, __pyx_tuple__447) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":588 * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), # <<<<<<<<<<<<<< * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sienna, __pyx_tuple__448) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":589 * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), # <<<<<<<<<<<<<< * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sienna1, __pyx_tuple__449) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":590 * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), # <<<<<<<<<<<<<< * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sienna2, __pyx_tuple__450) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":591 * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), # <<<<<<<<<<<<<< * 'sienna4' : (139, 71, 38), * 'skyblue' : (135, 206, 235), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sienna3, __pyx_tuple__451) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":592 * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), # <<<<<<<<<<<<<< * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sienna4, __pyx_tuple__452) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":593 * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), * 'skyblue' : (135, 206, 235), # <<<<<<<<<<<<<< * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_skyblue, __pyx_tuple__453) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":594 * 'sienna4' : (139, 71, 38), * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), # <<<<<<<<<<<<<< * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_skyblue1, __pyx_tuple__454) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":595 * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), # <<<<<<<<<<<<<< * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_skyblue2, __pyx_tuple__455) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":596 * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), # <<<<<<<<<<<<<< * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_skyblue3, __pyx_tuple__456) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":597 * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), # <<<<<<<<<<<<<< * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_skyblue4, __pyx_tuple__457) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":598 * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), # <<<<<<<<<<<<<< * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slateblue, __pyx_tuple__458) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":599 * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), # <<<<<<<<<<<<<< * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slateblue1, __pyx_tuple__459) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":600 * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), # <<<<<<<<<<<<<< * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slateblue2, __pyx_tuple__460) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":601 * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), # <<<<<<<<<<<<<< * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slateblue3, __pyx_tuple__461) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":602 * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), # <<<<<<<<<<<<<< * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slateblue4, __pyx_tuple__462) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":603 * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), # <<<<<<<<<<<<<< * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slategray, __pyx_tuple__463) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":604 * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), # <<<<<<<<<<<<<< * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slategray1, __pyx_tuple__464) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":605 * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), # <<<<<<<<<<<<<< * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slategray2, __pyx_tuple__465) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":606 * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), # <<<<<<<<<<<<<< * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slategray3, __pyx_tuple__466) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":607 * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), # <<<<<<<<<<<<<< * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slategray4, __pyx_tuple__467) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":608 * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), # <<<<<<<<<<<<<< * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slategrey, __pyx_tuple__463) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":609 * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_snow, __pyx_tuple__468) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":610 * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_snow1, __pyx_tuple__468) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":611 * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), # <<<<<<<<<<<<<< * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_snow2, __pyx_tuple__469) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":612 * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), # <<<<<<<<<<<<<< * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_snow3, __pyx_tuple__470) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":613 * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), # <<<<<<<<<<<<<< * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_snow4, __pyx_tuple__471) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":614 * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_springgreen, __pyx_tuple__472) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":615 * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_springgreen1, __pyx_tuple__472) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":616 * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), # <<<<<<<<<<<<<< * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_springgreen2, __pyx_tuple__473) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":617 * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), # <<<<<<<<<<<<<< * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_springgreen3, __pyx_tuple__474) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":618 * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), # <<<<<<<<<<<<<< * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_springgreen4, __pyx_tuple__475) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":619 * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), # <<<<<<<<<<<<<< * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_steelblue, __pyx_tuple__476) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":620 * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), # <<<<<<<<<<<<<< * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_steelblue1, __pyx_tuple__477) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":621 * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), # <<<<<<<<<<<<<< * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_steelblue2, __pyx_tuple__478) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":622 * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), # <<<<<<<<<<<<<< * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_steelblue3, __pyx_tuple__479) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":623 * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), # <<<<<<<<<<<<<< * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_steelblue4, __pyx_tuple__480) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":624 * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), # <<<<<<<<<<<<<< * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tan, __pyx_tuple__481) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":625 * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), # <<<<<<<<<<<<<< * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tan1, __pyx_tuple__482) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":626 * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), # <<<<<<<<<<<<<< * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tan2, __pyx_tuple__483) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":627 * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), # <<<<<<<<<<<<<< * 'tan4' : (139, 90, 43), * 'thistle' : (216, 191, 216), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tan3, __pyx_tuple__404) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":628 * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), # <<<<<<<<<<<<<< * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tan4, __pyx_tuple__484) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":629 * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), * 'thistle' : (216, 191, 216), # <<<<<<<<<<<<<< * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_thistle, __pyx_tuple__485) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":630 * 'tan4' : (139, 90, 43), * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), # <<<<<<<<<<<<<< * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_thistle1, __pyx_tuple__486) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":631 * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), # <<<<<<<<<<<<<< * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_thistle2, __pyx_tuple__487) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":632 * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), # <<<<<<<<<<<<<< * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_thistle3, __pyx_tuple__488) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":633 * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), # <<<<<<<<<<<<<< * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_thistle4, __pyx_tuple__489) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":634 * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tomato, __pyx_tuple__490) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":635 * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tomato1, __pyx_tuple__490) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":636 * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), # <<<<<<<<<<<<<< * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tomato2, __pyx_tuple__491) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":637 * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), # <<<<<<<<<<<<<< * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tomato3, __pyx_tuple__492) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":638 * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), # <<<<<<<<<<<<<< * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tomato4, __pyx_tuple__493) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":639 * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), # <<<<<<<<<<<<<< * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_turquoise, __pyx_tuple__494) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":640 * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), # <<<<<<<<<<<<<< * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_turquoise1, __pyx_tuple__495) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":641 * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), # <<<<<<<<<<<<<< * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_turquoise2, __pyx_tuple__496) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":642 * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), # <<<<<<<<<<<<<< * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_turquoise3, __pyx_tuple__497) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":643 * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), # <<<<<<<<<<<<<< * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_turquoise4, __pyx_tuple__498) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":644 * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), # <<<<<<<<<<<<<< * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_violet, __pyx_tuple__499) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":645 * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), # <<<<<<<<<<<<<< * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_violetred, __pyx_tuple__500) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":646 * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), # <<<<<<<<<<<<<< * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_violetred1, __pyx_tuple__501) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":647 * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), # <<<<<<<<<<<<<< * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_violetred2, __pyx_tuple__502) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":648 * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), # <<<<<<<<<<<<<< * 'violetred4' : (139, 34, 82), * 'wheat' : (245, 222, 179), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_violetred3, __pyx_tuple__503) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":649 * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), # <<<<<<<<<<<<<< * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_violetred4, __pyx_tuple__504) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":650 * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), * 'wheat' : (245, 222, 179), # <<<<<<<<<<<<<< * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_wheat, __pyx_tuple__505) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":651 * 'violetred4' : (139, 34, 82), * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), # <<<<<<<<<<<<<< * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_wheat1, __pyx_tuple__506) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":652 * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), # <<<<<<<<<<<<<< * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_wheat2, __pyx_tuple__507) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":653 * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), # <<<<<<<<<<<<<< * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_wheat3, __pyx_tuple__508) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":654 * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), # <<<<<<<<<<<<<< * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_wheat4, __pyx_tuple__509) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":655 * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), # <<<<<<<<<<<<<< * 'whitesmoke' : (245, 245, 245), * 'yellow' : (255, 255, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_white, __pyx_tuple__149) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":656 * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), # <<<<<<<<<<<<<< * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_whitesmoke, __pyx_tuple__242) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":657 * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), * 'yellow' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_yellow, __pyx_tuple__510) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":658 * 'whitesmoke' : (245, 245, 245), * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_yellow1, __pyx_tuple__510) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":659 * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), # <<<<<<<<<<<<<< * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_yellow2, __pyx_tuple__511) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":660 * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), # <<<<<<<<<<<<<< * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_yellow3, __pyx_tuple__512) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":661 * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), # <<<<<<<<<<<<<< * 'yellowgreen' : (154, 205, 50), * } */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_yellow4, __pyx_tuple__513) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":662 * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), # <<<<<<<<<<<<<< * } */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_yellowgreen, __pyx_tuple__369) < 0) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5color_colors); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5color_colors, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":161 * return float(int(self)) * * def __reduce__(self): # <<<<<<<<<<<<<< * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_17__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Color___reduce, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__515)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color, __pyx_n_s_reduce, __pyx_t_2) < 0) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5color_Color); /* "pygame_sdl2/color.pyx":166 * return (Color, (), d) * * def __setstate__(self, d): # <<<<<<<<<<<<<< * self.r, self.g, self.b, self.a = d['rgba'] * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_19__setstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Color___setstate, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__516)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color, __pyx_n_s_setstate, __pyx_t_2) < 0) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5color_Color); /* "pygame_sdl2/color.pyx":449 * self.b = int(b * 255) * * def normalize(self): # <<<<<<<<<<<<<< * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_39normalize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Color_normalize, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__518)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color, __pyx_n_s_normalize, __pyx_t_2) < 0) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5color_Color); /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_41correct_gamma, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Color_correct_gamma, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__520)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color, __pyx_n_s_correct_gamma, __pyx_t_2) < 0) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5color_Color); /* "pygame_sdl2/color.pyx":457 * return c * * def set_length(self, n): # <<<<<<<<<<<<<< * if n > 4 or n < 1: * raise ValueError(n) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_43set_length, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Color_set_length, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__522)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color, __pyx_n_s_set_length, __pyx_t_2) < 0) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5color_Color); /* "pygame_sdl2/color.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # Copyright 2014 Patrick Dawson * # */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.color", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.color"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); #ifdef HAVE_LONG_LONG if (sizeof(PY_LONG_LONG) > sizeof(long)) { PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; return (result >= LONG_MIN && result <= LONG_MAX) ? PyInt_FromLong((long)result) : PyLong_FromLongLong(result); } #endif #if CYTHON_USE_TYPE_SLOTS return PyInt_Type.tp_as_number->nb_multiply(op1, op2); #else return PyNumber_Multiply(op1, op2); #endif } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } } CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); #ifdef HAVE_LONG_LONG lla = a; goto long_long; #else return PyLong_Type.tp_as_number->nb_multiply(op1, op2); #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla * llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("multiply", return NULL) result = ((double)a) * (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #endif /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* StringJoin */ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { (void) __Pyx_PyObject_CallMethod1; #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION < 3 return _PyString_Join(sep, values); #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 return _PyBytes_Join(sep, values); #else return __Pyx_PyObject_CallMethod1(sep, __pyx_n_s_join, values); #endif } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* pybytes_as_double */ static double __Pyx_SlowPyString_AsDouble(PyObject *obj) { PyObject *float_value; #if PY_MAJOR_VERSION >= 3 float_value = PyFloat_FromString(obj); #else float_value = PyFloat_FromString(obj, 0); #endif if (likely(float_value)) { #if CYTHON_ASSUME_SAFE_MACROS double value = PyFloat_AS_DOUBLE(float_value); #else double value = PyFloat_AsDouble(float_value); #endif Py_DECREF(float_value); return value; } return (double)-1; } static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) { int last_was_punctuation = 1; Py_ssize_t i; for (i=0; i < length; i++) { char chr = start[i]; int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E'); *buffer = chr; buffer += (chr != '_'); if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure; last_was_punctuation = is_punctuation; } if (unlikely(last_was_punctuation)) goto parse_failure; *buffer = '\0'; return buffer; parse_failure: return NULL; } static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) { int matches = 1; char sign = start[0]; int is_signed = (sign == '+') | (sign == '-'); start += is_signed; length -= is_signed; switch (start[0]) { #ifdef Py_NAN case 'n': case 'N': if (unlikely(length != 3)) goto parse_failure; matches &= (start[1] == 'a' || start[1] == 'A'); matches &= (start[2] == 'n' || start[2] == 'N'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_NAN : Py_NAN; #endif case 'i': case 'I': if (unlikely(length < 3)) goto parse_failure; matches &= (start[1] == 'n' || start[1] == 'N'); matches &= (start[2] == 'f' || start[2] == 'F'); if (likely(length == 3 && matches)) return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; if (unlikely(length != 8)) goto parse_failure; matches &= (start[3] == 'i' || start[3] == 'I'); matches &= (start[4] == 'n' || start[4] == 'N'); matches &= (start[5] == 'i' || start[5] == 'I'); matches &= (start[6] == 't' || start[6] == 'T'); matches &= (start[7] == 'y' || start[7] == 'Y'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: goto parse_failure; } return 0.0; parse_failure: return -1.0; } static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) { return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd)); } CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) { double value; Py_ssize_t i, digits; const char *last = start + length; char *end; while (__Pyx__PyBytes_AsDouble_IsSpace(*start)) start++; while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1])) last--; length = last - start; if (unlikely(length <= 0)) goto fallback; value = __Pyx__PyBytes_AsDouble_inf_nan(start, length); if (unlikely(value == -1.0)) goto fallback; if (value != 0.0) return value; digits = 0; for (i=0; i < length; digits += start[i++] != '_'); if (likely(digits == length)) { value = PyOS_string_to_double(start, &end, NULL); } else if (digits < 40) { char number[40]; last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); if (unlikely(!last)) goto fallback; value = PyOS_string_to_double(number, &end, NULL); } else { char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char)); if (unlikely(!number)) goto fallback; last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); if (unlikely(!last)) { PyMem_Free(number); goto fallback; } value = PyOS_string_to_double(number, &end, NULL); PyMem_Free(number); } if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { return value; } fallback: return __Pyx_SlowPyString_AsDouble(obj); } /* pynumber_float */ static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) { double val; if (PyLong_CheckExact(obj)) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(obj))) { val = (double) __Pyx_PyLong_CompactValue(obj); goto no_error; } #endif val = PyLong_AsDouble(obj); } else if (PyUnicode_CheckExact(obj)) { val = __Pyx_PyUnicode_AsDouble(obj); } else if (PyBytes_CheckExact(obj)) { val = __Pyx_PyBytes_AsDouble(obj); } else if (PyByteArray_CheckExact(obj)) { val = __Pyx_PyByteArray_AsDouble(obj); } else { return PyNumber_Float(obj); } if (unlikely(val == -1 && PyErr_Occurred())) { return NULL; } #if CYTHON_USE_PYLONG_INTERNALS no_error: #endif return PyFloat_FromDouble(val); } /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 1; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a == b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) == 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 0; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 0; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal == 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a == (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_EQ)); } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { const long a = intval; long x; long b = PyInt_AS_LONG(op2); x = (long)((unsigned long)a - (unsigned long)b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op2))) { const long a = intval; long b, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG lla = intval; PY_LONG_LONG llb, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op2))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op2))) { b = __Pyx_PyLong_CompactValue(op2); } else { const digit* digits = __Pyx_PyLong_Digits(op2); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla - llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op2)) { const long a = intval; #if CYTHON_COMPILING_IN_LIMITED_API double b = __pyx_PyFloat_AsDouble(op2); #else double b = PyFloat_AS_DOUBLE(op2); #endif double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif /* ModFloat[double] */ static CYTHON_INLINE double __Pyx_mod_double(double a, double b) { double r = fmod(a, b); r += ((r != 0) & ((r < 0) ^ (b < 0))) * b; return r; } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyFloatBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_RemainderObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) { const double b = floatval; double a, result; CYTHON_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); if (likely(PyFloat_CheckExact(op1))) { #if CYTHON_COMPILING_IN_LIMITED_API a = __pyx_PyFloat_AsDouble(op1); #else a = PyFloat_AS_DOUBLE(op1); #endif } else #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { a = (double) PyInt_AS_LONG(op1); } else #endif if (likely(PyLong_CheckExact(op1))) { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsZero(op1)) { a = 0.0; } else if (__Pyx_PyLong_IsCompact(op1)) { a = (double) __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -2) a = -a; break; } } CYTHON_FALLTHROUGH; case -3: case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -3) a = -a; break; } } CYTHON_FALLTHROUGH; case -4: case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -4) a = -a; break; } } CYTHON_FALLTHROUGH; default: #endif a = PyLong_AsDouble(op1); if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL; #if CYTHON_USE_PYLONG_INTERNALS } } #endif } else { return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2); } PyFPE_START_PROTECT("remainder", return NULL) result = fmod(a, b); if (result) result += ((result < 0) ^ (b < 0)) * b; else result = copysign(0.0, b); PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } #endif /* PyFloatBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) { const double b = floatval; double a, result; CYTHON_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); if (likely(PyFloat_CheckExact(op1))) { #if CYTHON_COMPILING_IN_LIMITED_API a = __pyx_PyFloat_AsDouble(op1); #else a = PyFloat_AS_DOUBLE(op1); #endif } else #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { a = (double) PyInt_AS_LONG(op1); } else #endif if (likely(PyLong_CheckExact(op1))) { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsZero(op1)) { a = 0.0; } else if (__Pyx_PyLong_IsCompact(op1)) { a = (double) __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -2) a = -a; break; } } CYTHON_FALLTHROUGH; case -3: case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -3) a = -a; break; } } CYTHON_FALLTHROUGH; case -4: case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -4) a = -a; break; } } CYTHON_FALLTHROUGH; default: #endif a = PyLong_AsDouble(op1); if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL; #if CYTHON_USE_PYLONG_INTERNALS } } #endif } else { return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); } PyFPE_START_PROTECT("divide", return NULL) result = a / b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } #endif /* RaiseClosureNameError */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetVTable */ static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { PyObject *ob = PyCapsule_New(vtable, 0, 0); if (unlikely(!ob)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* MergeVTables */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type) { int i; void** base_vtables; __Pyx_TypeName tp_base_name; __Pyx_TypeName base_name; void* unknown = (void*)-1; PyObject* bases = type->tp_bases; int base_depth = 0; { PyTypeObject* base = type->tp_base; while (base) { base_depth += 1; base = base->tp_base; } } base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); if (base_vtable != NULL) { int j; PyTypeObject* base = type->tp_base; for (j = 0; j < base_depth; j++) { if (base_vtables[j] == unknown) { base_vtables[j] = __Pyx_GetVtable(base); base_vtables[j + 1] = unknown; } if (base_vtables[j] == base_vtable) { break; } else if (base_vtables[j] == NULL) { goto bad; } base = base->tp_base; } } } PyErr_Clear(); free(base_vtables); return 0; bad: tp_base_name = __Pyx_PyType_GetName(type->tp_base); base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); free(base_vtables); return -1; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__10; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint8_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT)) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT)) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT)) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint8_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } } #endif if ((sizeof(uint8_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint8_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint8_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint8_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint8_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint8_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint8_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint8_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint8_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint8_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint8_t) 1) << (sizeof(uint8_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint8_t) -1; } } else { uint8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint32_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint32_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__523); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; cobj = PyCapsule_New(tmp.p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709469.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.controller.c0000664000175000017500000175544714760217135021226 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__controller #define __PYX_HAVE_API__pygame_sdl2__controller /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "", "src/pygame_sdl2/controller.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_10controller_Controller; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; /* "pygame_sdl2/controller.pyx":140 * * * cdef class Controller: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_10controller_Controller { PyObject_HEAD PyObject *__weakref__; SDL_GameController *controller; int index; int instance_id; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_GameControllerAxis __Pyx_PyInt_As_SDL_GameControllerAxis(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_GameControllerButton __Pyx_PyInt_As_SDL_GameControllerButton(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.controller" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.controller" extern int __pyx_module_is_main_pygame_sdl2__controller; int __pyx_module_is_main_pygame_sdl2__controller = 0; /* Implementation of "pygame_sdl2.controller" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; static const char __pyx_k_s[] = "s"; static const char __pyx_k__2[] = "*"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__34[] = "?"; static const char __pyx_k_axis[] = "axis"; static const char __pyx_k_guid[] = "guid"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_index[] = "index"; static const char __pyx_k_rwops[] = "rwops"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_button[] = "button"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_mapping[] = "mapping"; static const char __pyx_k_get_axis[] = "get_axis"; static const char __pyx_k_get_init[] = "get_init"; static const char __pyx_k_get_name[] = "get_name"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_get_count[] = "get_count"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_Controller[] = "Controller"; static const char __pyx_k_get_button[] = "get_button"; static const char __pyx_k_add_mapping[] = "add_mapping"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_add_mappings[] = "add_mappings"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_mapping_file[] = "mapping_file"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_is_controller[] = "is_controller"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_sdl_main_init[] = "sdl_main_init"; static const char __pyx_k_Controller_init[] = "Controller.init"; static const char __pyx_k_Controller_quit[] = "Controller.quit"; static const char __pyx_k_get_guid_string[] = "get_guid_string"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Controller_get_axis[] = "Controller.get_axis"; static const char __pyx_k_Controller_get_init[] = "Controller.get_init"; static const char __pyx_k_Controller_get_name[] = "Controller.get_name"; static const char __pyx_k_get_string_for_axis[] = "get_string_for_axis"; static const char __pyx_k_get_axis_from_string[] = "get_axis_from_string"; static const char __pyx_k_Controller_get_button[] = "Controller.get_button"; static const char __pyx_k_get_string_for_button[] = "get_string_for_button"; static const char __pyx_k_get_button_from_string[] = "get_button_from_string"; static const char __pyx_k_pygame_sdl2_controller[] = "pygame_sdl2.controller"; static const char __pyx_k_Controller_is_controller[] = "Controller.is_controller"; static const char __pyx_k_Controller___reduce_cython[] = "Controller.__reduce_cython__"; static const char __pyx_k_Controller_get_guid_string[] = "Controller.get_guid_string"; static const char __pyx_k_controller_not_initialized[] = "controller not initialized."; static const char __pyx_k_Controller___setstate_cython[] = "Controller.__setstate_cython__"; static const char __pyx_k_src_pygame_sdl2_controller_pyx[] = "src/pygame_sdl2/controller.pyx"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_4get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_6get_count(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_8add_mapping(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10add_mappings(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping_file); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_12get_axis_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_14get_button_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_16get_string_for_axis(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_axis); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_18get_string_for_button(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_button); /* proto */ static int __pyx_pf_11pygame_sdl2_10controller_10Controller___cinit__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_10controller_10Controller_2__init__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_4init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_6quit(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_8get_init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_10get_axis(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_axis); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_12get_button(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_button); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_14get_name(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_16is_controller(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_18get_guid_string(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_11instance_id___get__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_10controller_10Controller_11instance_id_2__set__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_10controller_Controller(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_10controller_Controller; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_10controller_Controller; PyObject *__pyx_kp_u_; PyObject *__pyx_n_s_Controller; PyObject *__pyx_n_s_Controller___reduce_cython; PyObject *__pyx_n_s_Controller___setstate_cython; PyObject *__pyx_n_s_Controller_get_axis; PyObject *__pyx_n_s_Controller_get_button; PyObject *__pyx_n_s_Controller_get_guid_string; PyObject *__pyx_n_s_Controller_get_init; PyObject *__pyx_n_s_Controller_get_name; PyObject *__pyx_n_s_Controller_init; PyObject *__pyx_n_s_Controller_is_controller; PyObject *__pyx_n_s_Controller_quit; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s__2; PyObject *__pyx_n_s__34; PyObject *__pyx_n_s_add_mapping; PyObject *__pyx_n_s_add_mappings; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_axis; PyObject *__pyx_n_s_button; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_kp_s_controller_not_initialized; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_display; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_error; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_axis; PyObject *__pyx_n_s_get_axis_from_string; PyObject *__pyx_n_s_get_button; PyObject *__pyx_n_s_get_button_from_string; PyObject *__pyx_n_s_get_count; PyObject *__pyx_n_s_get_guid_string; PyObject *__pyx_n_s_get_init; PyObject *__pyx_n_s_get_name; PyObject *__pyx_n_s_get_string_for_axis; PyObject *__pyx_n_s_get_string_for_button; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_guid; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_index; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_controller; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_mapping; PyObject *__pyx_n_s_mapping_file; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_controller; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_register_init; PyObject *__pyx_n_s_register_quit; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_rwops; PyObject *__pyx_n_s_s; PyObject *__pyx_n_s_sdl_main_init; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_controller_pyx; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_test; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__26; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__32; PyObject *__pyx_codeobj__3; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__31; PyObject *__pyx_codeobj__33; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_10controller_Controller); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_10controller_Controller); Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_n_s_Controller); Py_CLEAR(clear_module_state->__pyx_n_s_Controller___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Controller___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_get_axis); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_get_button); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_get_guid_string); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_get_name); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_init); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_is_controller); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_quit); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s__2); Py_CLEAR(clear_module_state->__pyx_n_s__34); Py_CLEAR(clear_module_state->__pyx_n_s_add_mapping); Py_CLEAR(clear_module_state->__pyx_n_s_add_mappings); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_axis); Py_CLEAR(clear_module_state->__pyx_n_s_button); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_kp_s_controller_not_initialized); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_display); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_axis); Py_CLEAR(clear_module_state->__pyx_n_s_get_axis_from_string); Py_CLEAR(clear_module_state->__pyx_n_s_get_button); Py_CLEAR(clear_module_state->__pyx_n_s_get_button_from_string); Py_CLEAR(clear_module_state->__pyx_n_s_get_count); Py_CLEAR(clear_module_state->__pyx_n_s_get_guid_string); Py_CLEAR(clear_module_state->__pyx_n_s_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_get_name); Py_CLEAR(clear_module_state->__pyx_n_s_get_string_for_axis); Py_CLEAR(clear_module_state->__pyx_n_s_get_string_for_button); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_guid); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_index); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_controller); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_mapping); Py_CLEAR(clear_module_state->__pyx_n_s_mapping_file); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_controller); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_register_init); Py_CLEAR(clear_module_state->__pyx_n_s_register_quit); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_rwops); Py_CLEAR(clear_module_state->__pyx_n_s_s); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_main_init); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_controller_pyx); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__26); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__32); Py_CLEAR(clear_module_state->__pyx_codeobj__3); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__31); Py_CLEAR(clear_module_state->__pyx_codeobj__33); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_10controller_Controller); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_10controller_Controller); Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_n_s_Controller); Py_VISIT(traverse_module_state->__pyx_n_s_Controller___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Controller___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_get_axis); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_get_button); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_get_guid_string); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_get_name); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_init); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_is_controller); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_quit); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s__2); Py_VISIT(traverse_module_state->__pyx_n_s__34); Py_VISIT(traverse_module_state->__pyx_n_s_add_mapping); Py_VISIT(traverse_module_state->__pyx_n_s_add_mappings); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_axis); Py_VISIT(traverse_module_state->__pyx_n_s_button); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_kp_s_controller_not_initialized); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_display); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_axis); Py_VISIT(traverse_module_state->__pyx_n_s_get_axis_from_string); Py_VISIT(traverse_module_state->__pyx_n_s_get_button); Py_VISIT(traverse_module_state->__pyx_n_s_get_button_from_string); Py_VISIT(traverse_module_state->__pyx_n_s_get_count); Py_VISIT(traverse_module_state->__pyx_n_s_get_guid_string); Py_VISIT(traverse_module_state->__pyx_n_s_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_get_name); Py_VISIT(traverse_module_state->__pyx_n_s_get_string_for_axis); Py_VISIT(traverse_module_state->__pyx_n_s_get_string_for_button); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_guid); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_index); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_controller); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_mapping); Py_VISIT(traverse_module_state->__pyx_n_s_mapping_file); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_controller); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_register_init); Py_VISIT(traverse_module_state->__pyx_n_s_register_quit); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_rwops); Py_VISIT(traverse_module_state->__pyx_n_s_s); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_main_init); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_controller_pyx); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__26); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__32); Py_VISIT(traverse_module_state->__pyx_codeobj__3); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__31); Py_VISIT(traverse_module_state->__pyx_codeobj__33); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_10controller_Controller __pyx_mstate_global->__pyx_type_11pygame_sdl2_10controller_Controller #endif #define __pyx_ptype_11pygame_sdl2_10controller_Controller __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_10controller_Controller #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_n_s_Controller __pyx_mstate_global->__pyx_n_s_Controller #define __pyx_n_s_Controller___reduce_cython __pyx_mstate_global->__pyx_n_s_Controller___reduce_cython #define __pyx_n_s_Controller___setstate_cython __pyx_mstate_global->__pyx_n_s_Controller___setstate_cython #define __pyx_n_s_Controller_get_axis __pyx_mstate_global->__pyx_n_s_Controller_get_axis #define __pyx_n_s_Controller_get_button __pyx_mstate_global->__pyx_n_s_Controller_get_button #define __pyx_n_s_Controller_get_guid_string __pyx_mstate_global->__pyx_n_s_Controller_get_guid_string #define __pyx_n_s_Controller_get_init __pyx_mstate_global->__pyx_n_s_Controller_get_init #define __pyx_n_s_Controller_get_name __pyx_mstate_global->__pyx_n_s_Controller_get_name #define __pyx_n_s_Controller_init __pyx_mstate_global->__pyx_n_s_Controller_init #define __pyx_n_s_Controller_is_controller __pyx_mstate_global->__pyx_n_s_Controller_is_controller #define __pyx_n_s_Controller_quit __pyx_mstate_global->__pyx_n_s_Controller_quit #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s__2 __pyx_mstate_global->__pyx_n_s__2 #define __pyx_n_s__34 __pyx_mstate_global->__pyx_n_s__34 #define __pyx_n_s_add_mapping __pyx_mstate_global->__pyx_n_s_add_mapping #define __pyx_n_s_add_mappings __pyx_mstate_global->__pyx_n_s_add_mappings #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_axis __pyx_mstate_global->__pyx_n_s_axis #define __pyx_n_s_button __pyx_mstate_global->__pyx_n_s_button #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_kp_s_controller_not_initialized __pyx_mstate_global->__pyx_kp_s_controller_not_initialized #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_axis __pyx_mstate_global->__pyx_n_s_get_axis #define __pyx_n_s_get_axis_from_string __pyx_mstate_global->__pyx_n_s_get_axis_from_string #define __pyx_n_s_get_button __pyx_mstate_global->__pyx_n_s_get_button #define __pyx_n_s_get_button_from_string __pyx_mstate_global->__pyx_n_s_get_button_from_string #define __pyx_n_s_get_count __pyx_mstate_global->__pyx_n_s_get_count #define __pyx_n_s_get_guid_string __pyx_mstate_global->__pyx_n_s_get_guid_string #define __pyx_n_s_get_init __pyx_mstate_global->__pyx_n_s_get_init #define __pyx_n_s_get_name __pyx_mstate_global->__pyx_n_s_get_name #define __pyx_n_s_get_string_for_axis __pyx_mstate_global->__pyx_n_s_get_string_for_axis #define __pyx_n_s_get_string_for_button __pyx_mstate_global->__pyx_n_s_get_string_for_button #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_guid __pyx_mstate_global->__pyx_n_s_guid #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_controller __pyx_mstate_global->__pyx_n_s_is_controller #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_mapping __pyx_mstate_global->__pyx_n_s_mapping #define __pyx_n_s_mapping_file __pyx_mstate_global->__pyx_n_s_mapping_file #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_controller __pyx_mstate_global->__pyx_n_s_pygame_sdl2_controller #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_register_init __pyx_mstate_global->__pyx_n_s_register_init #define __pyx_n_s_register_quit __pyx_mstate_global->__pyx_n_s_register_quit #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_rwops __pyx_mstate_global->__pyx_n_s_rwops #define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s #define __pyx_n_s_sdl_main_init __pyx_mstate_global->__pyx_n_s_sdl_main_init #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_controller_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_controller_pyx #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 /* #### Code section: module_code ### */ /* "pygame_sdl2/controller.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_init, "init()\n\n Initializes game controller support.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_init}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/controller.pyx":31 * """ * * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/controller.pyx":33 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = (SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) != 0); if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/controller.pyx":34 * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): * raise error() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 34, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":33 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":36 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_2quit, "quit()\n\n Shuts down game controller support.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_3quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_2quit}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/controller.pyx":42 * """ * * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) # <<<<<<<<<<<<<< * * def get_init(): */ SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); /* "pygame_sdl2/controller.pyx":36 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_4get_init, "get_init()\n\n Returns true if game controller support has been initialized.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_5get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_5get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_4get_init}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_4get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_4get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/controller.pyx":49 * """ * * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 # <<<<<<<<<<<<<< * * def get_count(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_6get_count, "get_count()\n\n Returns the number of joysticks and game controllers connected to the\n system. This is one more than the maximum index that can be passed to\n Controller. While every game controller is a joystick, not every joystick\n is a game controller. To check that index `i` corresponds to a game\n controller, use code such as::\n\n if pygame_sdl2.controller.Controller(i).is_controller():\n ...\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_7get_count = {"get_count", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_7get_count, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_6get_count}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_count (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_6get_count(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_6get_count(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_count", 1); /* "pygame_sdl2/controller.pyx":63 * """ * * return SDL_NumJoysticks() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(SDL_NumJoysticks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_9add_mapping(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_8add_mapping, "add_mapping(mapping)\n\n Adds a game controller mapping from the string in `mapping`.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_9add_mapping = {"add_mapping", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_9add_mapping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_8add_mapping}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_9add_mapping(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mapping = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_mapping (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mapping,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mapping)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 66, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_mapping") < 0)) __PYX_ERR(1, 66, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mapping = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_mapping", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 66, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.add_mapping", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_8add_mapping(__pyx_self, __pyx_v_mapping); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_8add_mapping(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_mapping", 1); /* "pygame_sdl2/controller.pyx":71 * """ * * if SDL_GameControllerAddMapping(mapping) == -1: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_mapping); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(1, 71, __pyx_L1_error) __pyx_t_2 = (SDL_GameControllerAddMapping(__pyx_t_1) == -1L); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/controller.pyx":72 * * if SDL_GameControllerAddMapping(mapping) == -1: * raise error() # <<<<<<<<<<<<<< * * def add_mappings(mapping_file): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 72, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":71 * """ * * if SDL_GameControllerAddMapping(mapping) == -1: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.controller.add_mapping", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_11add_mappings(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10add_mappings, "add_mappings(mapping_file)\n\n Adds game controller mappings from `mapping_file`, which can be a string\n filename or a file-like object. This file should be gamecontrollerdb.txt,\n downloaded from:\n\n https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt\n\n This should be called before creating a Controller object. It can be called\n multiple times to add multiple database files.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_11add_mappings = {"add_mappings", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_11add_mappings, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10add_mappings}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_11add_mappings(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mapping_file = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_mappings (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mapping_file,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mapping_file)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 74, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_mappings") < 0)) __PYX_ERR(1, 74, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mapping_file = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_mappings", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 74, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.add_mappings", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10add_mappings(__pyx_self, __pyx_v_mapping_file); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10add_mappings(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping_file) { SDL_RWops *__pyx_v_rwops; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_RWops *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_mappings", 1); /* "pygame_sdl2/controller.pyx":86 * """ * * cdef SDL_RWops *rwops = to_rwops(mapping_file) # <<<<<<<<<<<<<< * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: */ __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_mapping_file, NULL); if (unlikely(__pyx_t_1 == ((SDL_RWops *)NULL))) __PYX_ERR(1, 86, __pyx_L1_error) __pyx_v_rwops = __pyx_t_1; /* "pygame_sdl2/controller.pyx":88 * cdef SDL_RWops *rwops = to_rwops(mapping_file) * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (SDL_GameControllerAddMappingsFromRW(__pyx_v_rwops, 1) == -1L); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/controller.pyx":89 * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: * raise error() # <<<<<<<<<<<<<< * * def get_axis_from_string(name): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 89, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":88 * cdef SDL_RWops *rwops = to_rwops(mapping_file) * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.controller.add_mappings", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_13get_axis_from_string(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_12get_axis_from_string, "get_axis_from_string(name)\n\n Returns the axis number of the controller axis with `name`, or\n pygame.CONTROLLER_AXIS_INVALID if `name` is not known.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_13get_axis_from_string = {"get_axis_from_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_13get_axis_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_12get_axis_from_string}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_13get_axis_from_string(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_axis_from_string (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 91, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_axis_from_string") < 0)) __PYX_ERR(1, 91, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_axis_from_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 91, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.get_axis_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_12get_axis_from_string(__pyx_self, __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_12get_axis_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; char const *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_axis_from_string", 0); __Pyx_INCREF(__pyx_v_name); /* "pygame_sdl2/controller.pyx":97 * """ * * if not isinstance(name, bytes): # <<<<<<<<<<<<<< * name = name.encode("utf-8") * */ __pyx_t_1 = PyBytes_Check(__pyx_v_name); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":98 * * if not isinstance(name, bytes): * name = name.encode("utf-8") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetAxisFromString(name) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_utf_8}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":97 * """ * * if not isinstance(name, bytes): # <<<<<<<<<<<<<< * name = name.encode("utf-8") * */ } /* "pygame_sdl2/controller.pyx":100 * name = name.encode("utf-8") * * return SDL_GameControllerGetAxisFromString(name) # <<<<<<<<<<<<<< * * def get_button_from_string(name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 100, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerGetAxisFromString(__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.controller.get_axis_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":102 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_15get_button_from_string(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_14get_button_from_string, "get_button_from_string(name)\n\n Returns the button number of the controller button with `name`, or\n pygame.CONTROLLER_BUTTON_INVALID if `name` is not known.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_15get_button_from_string = {"get_button_from_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_15get_button_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_14get_button_from_string}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_15get_button_from_string(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_button_from_string (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 102, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_button_from_string") < 0)) __PYX_ERR(1, 102, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_button_from_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 102, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.get_button_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_14get_button_from_string(__pyx_self, __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_14get_button_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; char const *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_button_from_string", 0); __Pyx_INCREF(__pyx_v_name); /* "pygame_sdl2/controller.pyx":108 * """ * * if not isinstance(name, bytes): # <<<<<<<<<<<<<< * name = name.encode("utf-8") * */ __pyx_t_1 = PyBytes_Check(__pyx_v_name); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":109 * * if not isinstance(name, bytes): * name = name.encode("utf-8") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetButtonFromString(name) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_utf_8}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":108 * """ * * if not isinstance(name, bytes): # <<<<<<<<<<<<<< * name = name.encode("utf-8") * */ } /* "pygame_sdl2/controller.pyx":111 * name = name.encode("utf-8") * * return SDL_GameControllerGetButtonFromString(name) # <<<<<<<<<<<<<< * * def get_string_for_axis(axis): */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 111, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerGetButtonFromString(__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":102 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.controller.get_button_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":113 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_17get_string_for_axis(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_16get_string_for_axis, "get_string_for_axis(axis)\n\n Returns a string describing the controller axis `axis`, which must be\n an integer. Returns None if the axis is not known.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_17get_string_for_axis = {"get_string_for_axis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_17get_string_for_axis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_16get_string_for_axis}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_17get_string_for_axis(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_axis = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_string_for_axis (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_axis,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_axis)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 113, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_string_for_axis") < 0)) __PYX_ERR(1, 113, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_axis = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_string_for_axis", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 113, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.get_string_for_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_16get_string_for_axis(__pyx_self, __pyx_v_axis); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_16get_string_for_axis(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_axis) { char const *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_GameControllerAxis __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_string_for_axis", 1); /* "pygame_sdl2/controller.pyx":119 * """ * * cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) # <<<<<<<<<<<<<< * * if rv != NULL: */ __pyx_t_1 = ((SDL_GameControllerAxis)__Pyx_PyInt_As_SDL_GameControllerAxis(__pyx_v_axis)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 119, __pyx_L1_error) __pyx_v_rv = SDL_GameControllerGetStringForAxis(__pyx_t_1); /* "pygame_sdl2/controller.pyx":121 * cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv.decode("utf-8") * else: */ __pyx_t_2 = (__pyx_v_rv != NULL); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":122 * * if rv != NULL: * return rv.decode("utf-8") # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_rv); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 122, __pyx_L1_error) __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_rv, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":121 * cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv.decode("utf-8") * else: */ } /* "pygame_sdl2/controller.pyx":124 * return rv.decode("utf-8") * else: * return None # <<<<<<<<<<<<<< * * def get_string_for_button(button): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "pygame_sdl2/controller.pyx":113 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.controller.get_string_for_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":126 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_19get_string_for_button(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_18get_string_for_button, "get_string_for_button(button)\n\n Returns a string describing the controller button `button`, which must be\n an integer. Returns None if the button is not known.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_19get_string_for_button = {"get_string_for_button", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_19get_string_for_button, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_18get_string_for_button}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_19get_string_for_button(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_button = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_string_for_button (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_button,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_button)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 126, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_string_for_button") < 0)) __PYX_ERR(1, 126, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_button = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_string_for_button", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 126, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.get_string_for_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_18get_string_for_button(__pyx_self, __pyx_v_button); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_18get_string_for_button(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_button) { char const *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_GameControllerButton __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_string_for_button", 1); /* "pygame_sdl2/controller.pyx":132 * """ * * cdef const char *rv = SDL_GameControllerGetStringForButton(button) # <<<<<<<<<<<<<< * * if rv != NULL: */ __pyx_t_1 = ((SDL_GameControllerButton)__Pyx_PyInt_As_SDL_GameControllerButton(__pyx_v_button)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L1_error) __pyx_v_rv = SDL_GameControllerGetStringForButton(__pyx_t_1); /* "pygame_sdl2/controller.pyx":134 * cdef const char *rv = SDL_GameControllerGetStringForButton(button) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv.decode("utf-8") * else: */ __pyx_t_2 = (__pyx_v_rv != NULL); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":135 * * if rv != NULL: * return rv.decode("utf-8") # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_rv); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 135, __pyx_L1_error) __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_rv, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":134 * cdef const char *rv = SDL_GameControllerGetStringForButton(button) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv.decode("utf-8") * else: */ } /* "pygame_sdl2/controller.pyx":137 * return rv.decode("utf-8") * else: * return None # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "pygame_sdl2/controller.pyx":126 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.controller.get_string_for_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":148 * cdef public int instance_id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.controller = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller___cinit__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_10controller_10Controller___cinit__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/controller.pyx":149 * * def __cinit__(self): * self.controller = NULL # <<<<<<<<<<<<<< * * def __init__(self, index): */ __pyx_v_self->controller = NULL; /* "pygame_sdl2/controller.pyx":148 * cdef public int instance_id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.controller = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/controller.pyx":151 * self.controller = NULL * * def __init__(self, index): # <<<<<<<<<<<<<< * """ * Represents a game controller object corresponding to the joystick */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_2__init__, "\n Represents a game controller object corresponding to the joystick\n with `index`.\n "); #if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__; #endif static int __pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_index = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 151, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 151, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_2__init__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), __pyx_v_index); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_10controller_10Controller_2__init__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_index) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/controller.pyx":157 * """ * * self.index = index # <<<<<<<<<<<<<< * * def init(self): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 157, __pyx_L1_error) __pyx_v_self->index = __pyx_t_1; /* "pygame_sdl2/controller.pyx":151 * self.controller = NULL * * def __init__(self, index): # <<<<<<<<<<<<<< * """ * Represents a game controller object corresponding to the joystick */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/controller.pyx":159 * self.index = index * * def init(self): # <<<<<<<<<<<<<< * """ * Opens the game controller, causing it to begin sending events. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_5init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_4init, "Controller.init(self)\n\n Opens the game controller, causing it to begin sending events.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_5init = {"init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_5init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_4init}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_5init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("init", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "init", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_4init(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_4init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/controller.pyx":164 * """ * * self.instance_id = SDL_JoystickGetDeviceInstanceID(self.index) # <<<<<<<<<<<<<< * * if self.controller == NULL: */ __pyx_v_self->instance_id = SDL_JoystickGetDeviceInstanceID(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":166 * self.instance_id = SDL_JoystickGetDeviceInstanceID(self.index) * * if self.controller == NULL: # <<<<<<<<<<<<<< * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: */ __pyx_t_1 = (__pyx_v_self->controller == NULL); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":167 * * if self.controller == NULL: * self.controller = SDL_GameControllerOpen(self.index) # <<<<<<<<<<<<<< * if self.controller == NULL: * raise error() */ __pyx_v_self->controller = SDL_GameControllerOpen(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":168 * if self.controller == NULL: * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_self->controller == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/controller.pyx":169 * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: * raise error() # <<<<<<<<<<<<<< * * def quit(self): # @ReservedAssignment */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 169, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":168 * if self.controller == NULL: * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":166 * self.instance_id = SDL_JoystickGetDeviceInstanceID(self.index) * * if self.controller == NULL: # <<<<<<<<<<<<<< * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: */ } /* "pygame_sdl2/controller.pyx":159 * self.index = index * * def init(self): # <<<<<<<<<<<<<< * """ * Opens the game controller, causing it to begin sending events. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":171 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Closes the game controller, preventing it from sending events. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_6quit, "Controller.quit(self)\n\n Closes the game controller, preventing it from sending events.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_7quit = {"quit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_6quit}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("quit", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "quit", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_6quit(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_6quit(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; SDL_bool __pyx_t_3; __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/controller.pyx":176 * """ * * if self.controller and SDL_GameControllerGetAttached(self.controller): # <<<<<<<<<<<<<< * SDL_GameControllerClose(self.controller) * self.controller = NULL */ __pyx_t_2 = (__pyx_v_self->controller != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = SDL_GameControllerGetAttached(__pyx_v_self->controller); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":177 * * if self.controller and SDL_GameControllerGetAttached(self.controller): * SDL_GameControllerClose(self.controller) # <<<<<<<<<<<<<< * self.controller = NULL * */ SDL_GameControllerClose(__pyx_v_self->controller); /* "pygame_sdl2/controller.pyx":178 * if self.controller and SDL_GameControllerGetAttached(self.controller): * SDL_GameControllerClose(self.controller) * self.controller = NULL # <<<<<<<<<<<<<< * * def get_init(self): */ __pyx_v_self->controller = NULL; /* "pygame_sdl2/controller.pyx":176 * """ * * if self.controller and SDL_GameControllerGetAttached(self.controller): # <<<<<<<<<<<<<< * SDL_GameControllerClose(self.controller) * self.controller = NULL */ } /* "pygame_sdl2/controller.pyx":171 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Closes the game controller, preventing it from sending events. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":180 * self.controller = NULL * * def get_init(self): # <<<<<<<<<<<<<< * """ * Returns true if the controller has been initialized, false otherwise. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_8get_init, "Controller.get_init(self)\n\n Returns true if the controller has been initialized, false otherwise.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_9get_init = {"get_init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_8get_init}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_init", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_init", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_8get_init(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_8get_init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/controller.pyx":185 * """ * * if self.controller: # <<<<<<<<<<<<<< * return True * else: */ __pyx_t_1 = (__pyx_v_self->controller != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":186 * * if self.controller: * return True # <<<<<<<<<<<<<< * else: * return False */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":185 * """ * * if self.controller: # <<<<<<<<<<<<<< * return True * else: */ } /* "pygame_sdl2/controller.pyx":188 * return True * else: * return False # <<<<<<<<<<<<<< * * def get_axis(self, axis): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "pygame_sdl2/controller.pyx":180 * self.controller = NULL * * def get_init(self): # <<<<<<<<<<<<<< * """ * Returns true if the controller has been initialized, false otherwise. */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":190 * return False * * def get_axis(self, axis): # <<<<<<<<<<<<<< * """ * Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_10get_axis, "Controller.get_axis(self, axis)\n\n Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS\n constants.\n\n Axes return values from -32768 to 32678, triggers return 0 to 32768. 0 is\n returned on failure.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_11get_axis = {"get_axis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_10get_axis}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_axis = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_axis (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_axis,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_axis)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 190, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_axis") < 0)) __PYX_ERR(1, 190, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_axis = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_axis", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 190, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_10get_axis(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), __pyx_v_axis); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_10get_axis(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_axis) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; SDL_GameControllerAxis __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_axis", 1); /* "pygame_sdl2/controller.pyx":199 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ __pyx_t_1 = (__pyx_v_self->controller == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/controller.pyx":200 * * if self.controller == NULL: * raise error("controller not initialized.") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetAxis(self.controller, axis) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_controller_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 200, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":199 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ } /* "pygame_sdl2/controller.pyx":202 * raise error("controller not initialized.") * * return SDL_GameControllerGetAxis(self.controller, axis) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = ((SDL_GameControllerAxis)__Pyx_PyInt_As_SDL_GameControllerAxis(__pyx_v_axis)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 202, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_From_int16_t(SDL_GameControllerGetAxis(__pyx_v_self->controller, __pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":190 * return False * * def get_axis(self, axis): # <<<<<<<<<<<<<< * """ * Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":205 * * * def get_button(self, button): # <<<<<<<<<<<<<< * """ * Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_12get_button, "Controller.get_button(self, button)\n\n Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON\n constants.\n\n Returns 1 if the button is pressed, 0 if not or the button does not exist.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_13get_button = {"get_button", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_12get_button}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_button = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_button (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_button,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_button)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 205, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_button") < 0)) __PYX_ERR(1, 205, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_button = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_button", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 205, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_12get_button(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), __pyx_v_button); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_12get_button(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; SDL_GameControllerButton __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_button", 1); /* "pygame_sdl2/controller.pyx":213 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ __pyx_t_1 = (__pyx_v_self->controller == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/controller.pyx":214 * * if self.controller == NULL: * raise error("controller not initialized.") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetButton(self.controller, button) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_controller_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 214, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":213 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ } /* "pygame_sdl2/controller.pyx":216 * raise error("controller not initialized.") * * return SDL_GameControllerGetButton(self.controller, button) # <<<<<<<<<<<<<< * * def get_name(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = ((SDL_GameControllerButton)__Pyx_PyInt_As_SDL_GameControllerButton(__pyx_v_button)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 216, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_From_uint8_t(SDL_GameControllerGetButton(__pyx_v_self->controller, __pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":205 * * * def get_button(self, button): # <<<<<<<<<<<<<< * """ * Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":218 * return SDL_GameControllerGetButton(self.controller, button) * * def get_name(self): # <<<<<<<<<<<<<< * """ * Returns an implementation-dependent name for this game controller, */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_14get_name, "Controller.get_name(self)\n\n Returns an implementation-dependent name for this game controller,\n or None if no name could be found.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_15get_name = {"get_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_14get_name}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_name (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_name", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_name", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_14get_name(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_14get_name(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { char const *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_name", 1); /* "pygame_sdl2/controller.pyx":224 * """ * * cdef const char *rv = SDL_GameControllerNameForIndex(self.index) # <<<<<<<<<<<<<< * * if rv == NULL: */ __pyx_v_rv = SDL_GameControllerNameForIndex(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":226 * cdef const char *rv = SDL_GameControllerNameForIndex(self.index) * * if rv == NULL: # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = (__pyx_v_rv == NULL); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":227 * * if rv == NULL: * return None # <<<<<<<<<<<<<< * * return rv.decode("utf-8") */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/controller.pyx":226 * cdef const char *rv = SDL_GameControllerNameForIndex(self.index) * * if rv == NULL: # <<<<<<<<<<<<<< * return None * */ } /* "pygame_sdl2/controller.pyx":229 * return None * * return rv.decode("utf-8") # <<<<<<<<<<<<<< * * def is_controller(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_ssize_strlen(__pyx_v_rv); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 229, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_rv, 0, __pyx_t_2, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":218 * return SDL_GameControllerGetButton(self.controller, button) * * def get_name(self): # <<<<<<<<<<<<<< * """ * Returns an implementation-dependent name for this game controller, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":231 * return rv.decode("utf-8") * * def is_controller(self): # <<<<<<<<<<<<<< * """ * Returns true if this Controller object corresponds to a supported */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_16is_controller, "Controller.is_controller(self)\n\n Returns true if this Controller object corresponds to a supported\n game controller, or False otherwise.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_17is_controller = {"is_controller", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_16is_controller}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_controller (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_controller", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_controller", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_16is_controller(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_16is_controller(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_controller", 1); /* "pygame_sdl2/controller.pyx":237 * """ * * return SDL_IsGameController(self.index) # <<<<<<<<<<<<<< * * def get_guid_string(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_IsGameController(__pyx_v_self->index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":231 * return rv.decode("utf-8") * * def is_controller(self): # <<<<<<<<<<<<<< * """ * Returns true if this Controller object corresponds to a supported */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.is_controller", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":239 * return SDL_IsGameController(self.index) * * def get_guid_string(self): # <<<<<<<<<<<<<< * """ * Returns the guid string corresponding to this controller. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_18get_guid_string, "Controller.get_guid_string(self)\n\n Returns the guid string corresponding to this controller.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_19get_guid_string = {"get_guid_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_18get_guid_string}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_guid_string (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_guid_string", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_guid_string", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_18get_guid_string(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_18get_guid_string(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { SDL_JoystickGUID __pyx_v_guid; char __pyx_v_s[33]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_guid_string", 1); /* "pygame_sdl2/controller.pyx":247 * cdef char s[33] * * guid = SDL_JoystickGetDeviceGUID(self.index) # <<<<<<<<<<<<<< * SDL_JoystickGetGUIDString(guid, s, 33) * */ __pyx_v_guid = SDL_JoystickGetDeviceGUID(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":248 * * guid = SDL_JoystickGetDeviceGUID(self.index) * SDL_JoystickGetGUIDString(guid, s, 33) # <<<<<<<<<<<<<< * * return s.decode("utf-8") */ SDL_JoystickGetGUIDString(__pyx_v_guid, __pyx_v_s, 33); /* "pygame_sdl2/controller.pyx":250 * SDL_JoystickGetGUIDString(guid, s, 33) * * return s.decode("utf-8") # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_ssize_strlen(__pyx_v_s); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 250, __pyx_L1_error) __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_s, 0, __pyx_t_1, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":239 * return SDL_IsGameController(self.index) * * def get_guid_string(self): # <<<<<<<<<<<<<< * """ * Returns the guid string corresponding to this controller. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_guid_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":146 * cdef SDL_GameController *controller * cdef int index * cdef public int instance_id # <<<<<<<<<<<<<< * * def __cinit__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_11instance_id_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_11instance_id_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_11instance_id___get__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_11instance_id___get__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.instance_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_11instance_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_11instance_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_11instance_id_2__set__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_10controller_10Controller_11instance_id_2__set__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 146, __pyx_L1_error) __pyx_v_self->instance_id = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.controller.Controller.instance_id.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_21__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_20__reduce_cython__, "Controller.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_21__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_20__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_21__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_20__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_23__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_22__setstate_cython__, "Controller.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_23__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_22__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_23__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_22__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_10controller_Controller(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_11pygame_sdl2_10controller_10Controller_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_10controller_Controller(PyObject *o) { struct __pyx_obj_11pygame_sdl2_10controller_Controller *p = (struct __pyx_obj_11pygame_sdl2_10controller_Controller *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_10controller_Controller) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_getprop_11pygame_sdl2_10controller_10Controller_instance_id(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_10controller_10Controller_11instance_id_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_10controller_10Controller_instance_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_10controller_10Controller_11instance_id_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_10controller_Controller[] = { {"init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_5init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_4init}, {"quit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_6quit}, {"get_init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_8get_init}, {"get_axis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_10get_axis}, {"get_button", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_12get_button}, {"get_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_14get_name}, {"is_controller", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_16is_controller}, {"get_guid_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_18get_guid_string}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_20__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_22__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_10controller_Controller[] = { {(char *)"instance_id", __pyx_getprop_11pygame_sdl2_10controller_10Controller_instance_id, __pyx_setprop_11pygame_sdl2_10controller_10Controller_instance_id, (char *)PyDoc_STR("instance_id: 'int'"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_10controller_Controller_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_10controller_Controller}, {Py_tp_doc, (void *)PyDoc_STR("Controller(index)")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_10controller_Controller}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_10controller_Controller}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_10controller_Controller}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_10controller_Controller_spec = { "pygame_sdl2.controller.Controller", sizeof(struct __pyx_obj_11pygame_sdl2_10controller_Controller), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_10controller_Controller_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_10controller_Controller = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.controller.""Controller", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_10controller_Controller), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_10controller_Controller, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Controller(index)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_10controller_Controller, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_10controller_Controller, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_10controller_Controller, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_Controller, __pyx_k_Controller, sizeof(__pyx_k_Controller), 0, 0, 1, 1}, {&__pyx_n_s_Controller___reduce_cython, __pyx_k_Controller___reduce_cython, sizeof(__pyx_k_Controller___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Controller___setstate_cython, __pyx_k_Controller___setstate_cython, sizeof(__pyx_k_Controller___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Controller_get_axis, __pyx_k_Controller_get_axis, sizeof(__pyx_k_Controller_get_axis), 0, 0, 1, 1}, {&__pyx_n_s_Controller_get_button, __pyx_k_Controller_get_button, sizeof(__pyx_k_Controller_get_button), 0, 0, 1, 1}, {&__pyx_n_s_Controller_get_guid_string, __pyx_k_Controller_get_guid_string, sizeof(__pyx_k_Controller_get_guid_string), 0, 0, 1, 1}, {&__pyx_n_s_Controller_get_init, __pyx_k_Controller_get_init, sizeof(__pyx_k_Controller_get_init), 0, 0, 1, 1}, {&__pyx_n_s_Controller_get_name, __pyx_k_Controller_get_name, sizeof(__pyx_k_Controller_get_name), 0, 0, 1, 1}, {&__pyx_n_s_Controller_init, __pyx_k_Controller_init, sizeof(__pyx_k_Controller_init), 0, 0, 1, 1}, {&__pyx_n_s_Controller_is_controller, __pyx_k_Controller_is_controller, sizeof(__pyx_k_Controller_is_controller), 0, 0, 1, 1}, {&__pyx_n_s_Controller_quit, __pyx_k_Controller_quit, sizeof(__pyx_k_Controller_quit), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, {&__pyx_n_s__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 1, 1}, {&__pyx_n_s_add_mapping, __pyx_k_add_mapping, sizeof(__pyx_k_add_mapping), 0, 0, 1, 1}, {&__pyx_n_s_add_mappings, __pyx_k_add_mappings, sizeof(__pyx_k_add_mappings), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, {&__pyx_n_s_button, __pyx_k_button, sizeof(__pyx_k_button), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_kp_s_controller_not_initialized, __pyx_k_controller_not_initialized, sizeof(__pyx_k_controller_not_initialized), 0, 0, 1, 0}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_axis, __pyx_k_get_axis, sizeof(__pyx_k_get_axis), 0, 0, 1, 1}, {&__pyx_n_s_get_axis_from_string, __pyx_k_get_axis_from_string, sizeof(__pyx_k_get_axis_from_string), 0, 0, 1, 1}, {&__pyx_n_s_get_button, __pyx_k_get_button, sizeof(__pyx_k_get_button), 0, 0, 1, 1}, {&__pyx_n_s_get_button_from_string, __pyx_k_get_button_from_string, sizeof(__pyx_k_get_button_from_string), 0, 0, 1, 1}, {&__pyx_n_s_get_count, __pyx_k_get_count, sizeof(__pyx_k_get_count), 0, 0, 1, 1}, {&__pyx_n_s_get_guid_string, __pyx_k_get_guid_string, sizeof(__pyx_k_get_guid_string), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_name, __pyx_k_get_name, sizeof(__pyx_k_get_name), 0, 0, 1, 1}, {&__pyx_n_s_get_string_for_axis, __pyx_k_get_string_for_axis, sizeof(__pyx_k_get_string_for_axis), 0, 0, 1, 1}, {&__pyx_n_s_get_string_for_button, __pyx_k_get_string_for_button, sizeof(__pyx_k_get_string_for_button), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_guid, __pyx_k_guid, sizeof(__pyx_k_guid), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_controller, __pyx_k_is_controller, sizeof(__pyx_k_is_controller), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_mapping, __pyx_k_mapping, sizeof(__pyx_k_mapping), 0, 0, 1, 1}, {&__pyx_n_s_mapping_file, __pyx_k_mapping_file, sizeof(__pyx_k_mapping_file), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_controller, __pyx_k_pygame_sdl2_controller, sizeof(__pyx_k_pygame_sdl2_controller), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_rwops, __pyx_k_rwops, sizeof(__pyx_k_rwops), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_k_src_pygame_sdl2_controller_pyx, sizeof(__pyx_k_src_pygame_sdl2_controller_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/controller.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * """ */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_init, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 25, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":36 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * """ */ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_quit, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(1, 36, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_init, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 44, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_count, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 51, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_mapping); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_add_mapping, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 66, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_mapping_file, __pyx_n_s_rwops); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_add_mappings, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 74, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_name); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_axis_from_string, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 91, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":102 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_button_from_string, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(1, 102, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":113 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_axis, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_string_for_axis, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 113, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":126 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_button, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_string_for_button, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 126, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":159 * self.index = index * * def init(self): # <<<<<<<<<<<<<< * """ * Opens the game controller, causing it to begin sending events. */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_init, 159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(1, 159, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":171 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Closes the game controller, preventing it from sending events. */ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_quit, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 171, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":180 * self.controller = NULL * * def get_init(self): # <<<<<<<<<<<<<< * """ * Returns true if the controller has been initialized, false otherwise. */ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_init, 180, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 180, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":190 * return False * * def get_axis(self, axis): # <<<<<<<<<<<<<< * """ * Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS */ __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_axis); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_axis, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 190, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":205 * * * def get_button(self, button): # <<<<<<<<<<<<<< * """ * Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON */ __pyx_tuple__24 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_button); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_button, 205, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 205, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":218 * return SDL_GameControllerGetButton(self.controller, button) * * def get_name(self): # <<<<<<<<<<<<<< * """ * Returns an implementation-dependent name for this game controller, */ __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_name, 218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(1, 218, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":231 * return rv.decode("utf-8") * * def is_controller(self): # <<<<<<<<<<<<<< * """ * Returns true if this Controller object corresponds to a supported */ __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_is_controller, 231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(1, 231, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":239 * return SDL_IsGameController(self.index) * * def get_guid_string(self): # <<<<<<<<<<<<<< * """ * Returns the guid string corresponding to this controller. */ __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_guid, __pyx_n_s_s); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_guid_string, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(1, 239, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_10controller_Controller = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_10controller_Controller_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_10controller_Controller)) __PYX_ERR(1, 140, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_10controller_Controller_spec, __pyx_ptype_11pygame_sdl2_10controller_Controller) < 0) __PYX_ERR(1, 140, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_10controller_Controller = &__pyx_type_11pygame_sdl2_10controller_Controller; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_10controller_Controller) < 0) __PYX_ERR(1, 140, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_10controller_Controller->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_10controller_Controller->tp_dictoffset && __pyx_ptype_11pygame_sdl2_10controller_Controller->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_10controller_Controller->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 140, __pyx_L1_error) if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__.doc = __pyx_doc_11pygame_sdl2_10controller_10Controller_2__init__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__; } } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Controller, (PyObject *) __pyx_ptype_11pygame_sdl2_10controller_Controller) < 0) __PYX_ERR(1, 140, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_10controller_Controller->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_10controller_Controller->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_10controller_Controller, __weakref__); #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_10controller_Controller) < 0) __PYX_ERR(1, 140, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_8(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_controller(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_controller}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "controller", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initcontroller(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initcontroller(void) #else __Pyx_PyMODINIT_FUNC PyInit_controller(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_controller(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_controller(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'controller' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("controller", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "controller" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_controller(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__controller) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.controller")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.controller", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "pygame_sdl2/controller.pyx":20 * * from sdl2 cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(1, 20, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":21 * from sdl2 cimport * * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * from pygame_sdl2.rwobject cimport to_rwops */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * """ */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/controller.pyx":36 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * """ */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_3quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_5get_init, 0, __pyx_n_s_get_init, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(1, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_7get_count, 0, __pyx_n_s_get_count, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_count, __pyx_t_2) < 0) __PYX_ERR(1, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_9add_mapping, 0, __pyx_n_s_add_mapping, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_mapping, __pyx_t_2) < 0) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_11add_mappings, 0, __pyx_n_s_add_mappings, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_mappings, __pyx_t_2) < 0) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_13get_axis_from_string, 0, __pyx_n_s_get_axis_from_string, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_axis_from_string, __pyx_t_2) < 0) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":102 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_15get_button_from_string, 0, __pyx_n_s_get_button_from_string, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_button_from_string, __pyx_t_2) < 0) __PYX_ERR(1, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":113 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_17get_string_for_axis, 0, __pyx_n_s_get_string_for_axis, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_string_for_axis, __pyx_t_2) < 0) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":126 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_19get_string_for_button, 0, __pyx_n_s_get_string_for_button, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_string_for_button, __pyx_t_2) < 0) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":159 * self.index = index * * def init(self): # <<<<<<<<<<<<<< * """ * Opens the game controller, causing it to begin sending events. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_5init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_init, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(1, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":171 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Closes the game controller, preventing it from sending events. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_7quit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_quit, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":180 * self.controller = NULL * * def get_init(self): # <<<<<<<<<<<<<< * """ * Returns true if the controller has been initialized, false otherwise. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_9get_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_get_init, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(1, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":190 * return False * * def get_axis(self, axis): # <<<<<<<<<<<<<< * """ * Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_11get_axis, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_get_axis, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_get_axis, __pyx_t_2) < 0) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":205 * * * def get_button(self, button): # <<<<<<<<<<<<<< * """ * Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_13get_button, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_get_button, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_get_button, __pyx_t_2) < 0) __PYX_ERR(1, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":218 * return SDL_GameControllerGetButton(self.controller, button) * * def get_name(self): # <<<<<<<<<<<<<< * """ * Returns an implementation-dependent name for this game controller, */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_15get_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_get_name, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_get_name, __pyx_t_2) < 0) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":231 * return rv.decode("utf-8") * * def is_controller(self): # <<<<<<<<<<<<<< * """ * Returns true if this Controller object corresponds to a supported */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_17is_controller, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_is_controller, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_is_controller, __pyx_t_2) < 0) __PYX_ERR(1, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":239 * return SDL_IsGameController(self.index) * * def get_guid_string(self): # <<<<<<<<<<<<<< * """ * Returns the guid string corresponding to this controller. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_19get_guid_string, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_get_guid_string, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_get_guid_string, __pyx_t_2) < 0) __PYX_ERR(1, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":1 * # Copyright 2015 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.controller", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.controller"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__2; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerAxis) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_GameControllerAxis) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerAxis) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerAxis), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_GameControllerAxis)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerButton) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_GameControllerButton) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerButton) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerButton), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_GameControllerButton)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE SDL_GameControllerAxis __Pyx_PyInt_As_SDL_GameControllerAxis(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SDL_GameControllerAxis) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_GameControllerAxis) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SDL_GameControllerAxis) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) >= 2 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) (((((SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0])); } } break; case 3: if ((8 * sizeof(SDL_GameControllerAxis) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) >= 3 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) (((((((SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0])); } } break; case 4: if ((8 * sizeof(SDL_GameControllerAxis) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) >= 4 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) (((((((((SDL_GameControllerAxis)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_GameControllerAxis) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SDL_GameControllerAxis) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_GameControllerAxis) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 2 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) (((SDL_GameControllerAxis)-1)*(((((SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case 2: if ((8 * sizeof(SDL_GameControllerAxis) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 2 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) ((((((SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case -3: if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 3 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) (((SDL_GameControllerAxis)-1)*(((((((SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case 3: if ((8 * sizeof(SDL_GameControllerAxis) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 3 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) ((((((((SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case -4: if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 4 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) (((SDL_GameControllerAxis)-1)*(((((((((SDL_GameControllerAxis)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case 4: if ((8 * sizeof(SDL_GameControllerAxis) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 4 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) ((((((((((SDL_GameControllerAxis)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; } } #endif if ((sizeof(SDL_GameControllerAxis) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_GameControllerAxis) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (SDL_GameControllerAxis) -1; } else { SDL_GameControllerAxis val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_GameControllerAxis) -1; val = __Pyx_PyInt_As_SDL_GameControllerAxis(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_GameControllerAxis"); return (SDL_GameControllerAxis) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_GameControllerAxis"); return (SDL_GameControllerAxis) -1; } /* CIntFromPy */ static CYTHON_INLINE SDL_GameControllerButton __Pyx_PyInt_As_SDL_GameControllerButton(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SDL_GameControllerButton) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_GameControllerButton) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SDL_GameControllerButton) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) >= 2 * PyLong_SHIFT)) { return (SDL_GameControllerButton) (((((SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0])); } } break; case 3: if ((8 * sizeof(SDL_GameControllerButton) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) >= 3 * PyLong_SHIFT)) { return (SDL_GameControllerButton) (((((((SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0])); } } break; case 4: if ((8 * sizeof(SDL_GameControllerButton) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) >= 4 * PyLong_SHIFT)) { return (SDL_GameControllerButton) (((((((((SDL_GameControllerButton)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_GameControllerButton) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SDL_GameControllerButton) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_GameControllerButton) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SDL_GameControllerButton) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) - 1 > 2 * PyLong_SHIFT)) { return (SDL_GameControllerButton) (((SDL_GameControllerButton)-1)*(((((SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case 2: if ((8 * sizeof(SDL_GameControllerButton) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) - 1 > 2 * PyLong_SHIFT)) { return (SDL_GameControllerButton) ((((((SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case -3: if ((8 * sizeof(SDL_GameControllerButton) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) - 1 > 3 * PyLong_SHIFT)) { return (SDL_GameControllerButton) (((SDL_GameControllerButton)-1)*(((((((SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case 3: if ((8 * sizeof(SDL_GameControllerButton) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) - 1 > 3 * PyLong_SHIFT)) { return (SDL_GameControllerButton) ((((((((SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case -4: if ((8 * sizeof(SDL_GameControllerButton) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) - 1 > 4 * PyLong_SHIFT)) { return (SDL_GameControllerButton) (((SDL_GameControllerButton)-1)*(((((((((SDL_GameControllerButton)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case 4: if ((8 * sizeof(SDL_GameControllerButton) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) - 1 > 4 * PyLong_SHIFT)) { return (SDL_GameControllerButton) ((((((((((SDL_GameControllerButton)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; } } #endif if ((sizeof(SDL_GameControllerButton) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_GameControllerButton) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (SDL_GameControllerButton) -1; } else { SDL_GameControllerButton val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_GameControllerButton) -1; val = __Pyx_PyInt_As_SDL_GameControllerButton(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_GameControllerButton"); return (SDL_GameControllerButton) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_GameControllerButton"); return (SDL_GameControllerButton) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int16_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int16_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_bool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_bool) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_bool), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_bool)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__34); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_8 #define __PYX_HAVE_RT_ImportFunction_3_0_8 static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709471.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.display.c0000664000175000017500000432235614760217137020502 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__display #define __PYX_HAVE_API__pygame_sdl2__display /* Early includes */ #include #include #include #include #include "SDL.h" #include #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/display.pyx", "", "src/pygame_sdl2/display.pxd", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/rect.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; struct __pyx_defaults; typedef struct __pyx_defaults __pyx_defaults; struct __pyx_defaults { PyObject *__pyx_arg_pos; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* PyObject_Str.proto */ #define __Pyx_PyObject_Str(obj)\ (likely(PyString_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 #define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_8 { __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_HintPriority __Pyx_PyInt_As_SDL_HintPriority(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_GLattr __Pyx_PyInt_As_SDL_GLattr(PyObject *); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* VoidPtrExport.proto */ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.rect" */ static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from "libc.stdlib" */ /* Module declarations from "pygame_sdl2.display" */ static struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_11pygame_sdl2_7display_main_window = 0; static SDL_Window *__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow(PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.display" extern int __pyx_module_is_main_pygame_sdl2__display; int __pyx_module_is_main_pygame_sdl2__display = 0; /* Implementation of "pygame_sdl2.display" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_0[] = "0"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_t[] = "t"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__6[] = "*"; static const char __pyx_k__7[] = "."; static const char __pyx_k_dm[] = "dm"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_hw[] = "hw"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k_wm[] = "wm"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_err[] = "err"; static const char __pyx_k_ios[] = "ios"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_red[] = "red"; static const char __pyx_k_Info[] = "Info"; static const char __pyx_k__116[] = "?"; static const char __pyx_k_blue[] = "blue"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_flag[] = "flag"; static const char __pyx_k_flip[] = "flip"; static const char __pyx_k_hint[] = "hint"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_count[] = "count"; static const char __pyx_k_depth[] = "depth"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_event[] = "event"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_green[] = "green"; static const char __pyx_k_index[] = "index"; static const char __pyx_k_masks[] = "masks"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_rects[] = "rects"; static const char __pyx_k_shape[] = "shape"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_title[] = "title"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_Info_r[] = ""; static const char __pyx_k_Window[] = "Window"; static const char __pyx_k_always[] = "always"; static const char __pyx_k_ctypes[] = "ctypes"; static const char __pyx_k_driver[] = "driver"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_height[] = "height"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_init_2[] = "__init__"; static const char __pyx_k_losses[] = "losses"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_opengl[] = "opengl"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_resize[] = "resize"; static const char __pyx_k_shifts[] = "shifts"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_bitsize[] = "bitsize"; static const char __pyx_k_blit_hw[] = "blit_hw"; static const char __pyx_k_blit_sw[] = "blit_sw"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_destroy[] = "destroy"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_environ[] = "environ"; static const char __pyx_k_iconify[] = "iconify"; static const char __pyx_k_mode_ok[] = "mode_ok"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_restore[] = "restore"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_SRCALPHA[] = "SRCALPHA"; static const char __pyx_k_bytesize[] = "bytesize"; static const char __pyx_k_c_void_p[] = "c_void_p"; static const char __pyx_k_get_hint[] = "_get_hint"; static const char __pyx_k_get_init[] = "get_init"; static const char __pyx_k_get_size[] = "get_size"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_maximize[] = "maximize"; static const char __pyx_k_minimize[] = "minimize"; static const char __pyx_k_priority[] = "priority"; static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_icon[] = "set_icon"; static const char __pyx_k_set_mode[] = "set_mode"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_warnings[] = "warnings"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_blit_hw_A[] = "blit_hw_A"; static const char __pyx_k_blit_sw_A[] = "blit_sw_A"; static const char __pyx_k_cur_width[] = "cur_width"; static const char __pyx_k_current_h[] = "current_h"; static const char __pyx_k_current_w[] = "current_w"; static const char __pyx_k_icontitle[] = "icontitle"; static const char __pyx_k_init_done[] = "init_done"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_main_done[] = "main_done"; static const char __pyx_k_maximized[] = "maximized"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_num_modes[] = "num_modes"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_red_gamma[] = "red_gamma"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_set_gamma[] = "set_gamma"; static const char __pyx_k_video_mem[] = "video_mem"; static const char __pyx_k_PYGAME_IOS[] = "PYGAME_IOS"; static const char __pyx_k_blit_hw_CC[] = "blit_hw_CC"; static const char __pyx_k_blit_sw_CC[] = "blit_sw_CC"; static const char __pyx_k_blue_gamma[] = "blue_gamma"; static const char __pyx_k_cur_height[] = "cur_height"; static const char __pyx_k_fullscreen[] = "fullscreen"; static const char __pyx_k_get_active[] = "get_active"; static const char __pyx_k_get_driver[] = "get_driver"; static const char __pyx_k_get_window[] = "get_window"; static const char __pyx_k_list_modes[] = "list_modes"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_rectangles[] = "rectangles"; static const char __pyx_k_resolution[] = "resolution"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_Info___init[] = "Info.__init__"; static const char __pyx_k_Info___repr[] = "Info.__repr__"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_PYGAME_SDL2[] = "PYGAME_SDL2"; static const char __pyx_k_Window_flip[] = "Window.flip"; static const char __pyx_k_get_caption[] = "get_caption"; static const char __pyx_k_get_surface[] = "get_surface"; static const char __pyx_k_get_wm_info[] = "get_wm_info"; static const char __pyx_k_green_gamma[] = "green_gamma"; static const char __pyx_k_main_window[] = "main_window"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_set_caption[] = "set_caption"; static const char __pyx_k_RESIZE_FLAGS[] = "RESIZE_FLAGS"; static const char __pyx_k_androidembed[] = "androidembed"; static const char __pyx_k_default_icon[] = "default_icon"; static const char __pyx_k_get_platform[] = "get_platform"; static const char __pyx_k_get_position[] = "get_position"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_pygame_hints[] = "_pygame_hints"; static const char __pyx_k_refresh_rate[] = "refresh_rate"; static const char __pyx_k_set_position[] = "set_position"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_Window_resize[] = "Window.resize"; static const char __pyx_k_Window_update[] = "Window.update"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_default_title[] = "default_title"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_pygame_window[] = "pygame window"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_sdl_main_init[] = "sdl_main_init"; static const char __pyx_k_Window_destroy[] = "Window.destroy"; static const char __pyx_k_Window_iconify[] = "Window.iconify"; static const char __pyx_k_Window_restore[] = "Window.restore"; static const char __pyx_k_create_surface[] = "create_surface"; static const char __pyx_k_set_gamma_ramp[] = "set_gamma_ramp"; static const char __pyx_k_GL_SWAP_CONTROL[] = "GL_SWAP_CONTROL"; static const char __pyx_k_Window_get_size[] = "Window.get_size"; static const char __pyx_k_Window_maximize[] = "Window.maximize"; static const char __pyx_k_Window_minimize[] = "Window.minimize"; static const char __pyx_k_Window_set_icon[] = "Window.set_icon"; static const char __pyx_k_gl_load_library[] = "gl_load_library"; static const char __pyx_k_set_screensaver[] = "set_screensaver"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Window_set_gamma[] = "Window.set_gamma"; static const char __pyx_k_get_window_flags[] = "get_window_flags"; static const char __pyx_k_gl_get_attribute[] = "gl_get_attribute"; static const char __pyx_k_gl_set_attribute[] = "gl_set_attribute"; static const char __pyx_k_Window_get_active[] = "Window.get_active"; static const char __pyx_k_get_drawable_size[] = "get_drawable_size"; static const char __pyx_k_gl_unload_library[] = "gl_unload_library"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_toggle_fullscreen[] = "toggle_fullscreen"; static const char __pyx_k_Window_get_surface[] = "Window.get_surface"; static const char __pyx_k_Window_get_wm_info[] = "Window.get_wm_info"; static const char __pyx_k_Window_set_caption[] = "Window.set_caption"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_get_display_bounds[] = "get_display_bounds"; static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static const char __pyx_k_Window_get_position[] = "Window.get_position"; static const char __pyx_k_Window_set_position[] = "Window.set_position"; static const char __pyx_k_gl_reset_attributes[] = "gl_reset_attributes"; static const char __pyx_k_pygame_sdl2_display[] = "pygame_sdl2.display"; static const char __pyx_k_recreate_gl_context[] = "recreate_gl_context"; static const char __pyx_k_PYGAME_SDL2_AVOID_GL[] = "PYGAME_SDL2_AVOID_GL"; static const char __pyx_k_default_swap_control[] = "default_swap_control"; static const char __pyx_k_proxy_window_surface[] = "proxy_window_surface"; static const char __pyx_k_Window_create_surface[] = "Window.create_surface"; static const char __pyx_k_Window_set_gamma_ramp[] = "Window.set_gamma_ramp"; static const char __pyx_k_Window___reduce_cython[] = "Window.__reduce_cython__"; static const char __pyx_k_get_num_video_displays[] = "get_num_video_displays"; static const char __pyx_k_get_sdl_window_pointer[] = "get_sdl_window_pointer"; static const char __pyx_k_Window_get_window_flags[] = "Window.get_window_flags"; static const char __pyx_k_Window___setstate_cython[] = "Window.__setstate_cython__"; static const char __pyx_k_Window_get_drawable_size[] = "Window.get_drawable_size"; static const char __pyx_k_Window_toggle_fullscreen[] = "Window.toggle_fullscreen"; static const char __pyx_k_Window_recreate_gl_context[] = "Window.recreate_gl_context"; static const char __pyx_k_Window_proxy_window_surface[] = "Window.proxy_window_surface"; static const char __pyx_k_src_pygame_sdl2_display_pyx[] = "src/pygame_sdl2/display.pyx"; static const char __pyx_k_Couldn_t_allocate_rectangles[] = "Couldn't allocate rectangles."; static const char __pyx_k_Window_get_sdl_window_pointer[] = "Window.get_sdl_window_pointer"; static const char __pyx_k_self_gl_context_self_window_self[] = "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_7display_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_value, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_2_get_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_4sdl_main_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_8quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_10get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_7display_6Window___init__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth, PyObject *__pyx_v_pos, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_shape); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_4destroy(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_6resize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_opengl, PyObject *__pyx_v_fullscreen, PyObject *__pyx_v_maximized); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_8recreate_gl_context(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_always); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_10get_window_flags(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_12proxy_window_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_14flip(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_16get_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_18update(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_rectangles); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_20get_wm_info(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_22get_active(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_24iconify(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_26toggle_fullscreen(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_28set_gamma(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_30set_gamma_ramp(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_32set_icon(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_34set_caption(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_36get_drawable_size(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_38get_size(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_40restore(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_42maximize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_44minimize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48get_position(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_50set_position(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_52__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_54__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_76__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_14destroy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_16get_surface(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_18get_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_20flip(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_22update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rectangles); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_24get_driver(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_26get_wm_info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_28get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_30list_modes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_depth, CYTHON_UNUSED PyObject *__pyx_v_flags, PyObject *__pyx_v_display); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_32mode_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_34gl_reset_attributes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_36gl_set_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_38gl_get_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_40gl_load_library(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_42gl_unload_library(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_44get_active(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_46iconify(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_48toggle_fullscreen(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_50set_gamma(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_52set_gamma_ramp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_54set_icon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_56set_caption(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_title, CYTHON_UNUSED PyObject *__pyx_v_icontitle); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_58get_caption(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_60get_drawable_size(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_62get_size(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_64get_position(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_66set_position(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_68get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_70get_display_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_72set_screensaver(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_74get_platform(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_7display_Window(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_7display_Window; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window; PyObject *__pyx_kp_s_0; PyObject *__pyx_kp_s_Couldn_t_allocate_rectangles; PyObject *__pyx_n_s_GL_SWAP_CONTROL; PyObject *__pyx_n_s_ImportError; PyObject *__pyx_n_s_Info; PyObject *__pyx_n_s_Info___init; PyObject *__pyx_n_s_Info___repr; PyObject *__pyx_kp_s_Info_r; PyObject *__pyx_n_s_MemoryError; PyObject *__pyx_n_s_PYGAME_IOS; PyObject *__pyx_n_s_PYGAME_SDL2; PyObject *__pyx_n_s_PYGAME_SDL2_AVOID_GL; PyObject *__pyx_n_s_RESIZE_FLAGS; PyObject *__pyx_n_s_SRCALPHA; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_Window; PyObject *__pyx_n_s_Window___reduce_cython; PyObject *__pyx_n_s_Window___setstate_cython; PyObject *__pyx_n_s_Window_create_surface; PyObject *__pyx_n_s_Window_destroy; PyObject *__pyx_n_s_Window_flip; PyObject *__pyx_n_s_Window_get_active; PyObject *__pyx_n_s_Window_get_drawable_size; PyObject *__pyx_n_s_Window_get_position; PyObject *__pyx_n_s_Window_get_sdl_window_pointer; PyObject *__pyx_n_s_Window_get_size; PyObject *__pyx_n_s_Window_get_surface; PyObject *__pyx_n_s_Window_get_window_flags; PyObject *__pyx_n_s_Window_get_wm_info; PyObject *__pyx_n_s_Window_iconify; PyObject *__pyx_n_s_Window_maximize; PyObject *__pyx_n_s_Window_minimize; PyObject *__pyx_n_s_Window_proxy_window_surface; PyObject *__pyx_n_s_Window_recreate_gl_context; PyObject *__pyx_n_s_Window_resize; PyObject *__pyx_n_s_Window_restore; PyObject *__pyx_n_s_Window_set_caption; PyObject *__pyx_n_s_Window_set_gamma; PyObject *__pyx_n_s_Window_set_gamma_ramp; PyObject *__pyx_n_s_Window_set_icon; PyObject *__pyx_n_s_Window_set_position; PyObject *__pyx_n_s_Window_toggle_fullscreen; PyObject *__pyx_n_s_Window_update; PyObject *__pyx_n_s__116; PyObject *__pyx_n_s__6; PyObject *__pyx_kp_u__7; PyObject *__pyx_n_s_always; PyObject *__pyx_n_s_androidembed; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_bitsize; PyObject *__pyx_n_s_blit_hw; PyObject *__pyx_n_s_blit_hw_A; PyObject *__pyx_n_s_blit_hw_CC; PyObject *__pyx_n_s_blit_sw; PyObject *__pyx_n_s_blit_sw_A; PyObject *__pyx_n_s_blit_sw_CC; PyObject *__pyx_n_s_blue; PyObject *__pyx_n_s_blue_gamma; PyObject *__pyx_n_s_bytesize; PyObject *__pyx_n_s_c_void_p; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_copy; PyObject *__pyx_n_s_count; PyObject *__pyx_n_s_create_surface; PyObject *__pyx_n_s_ctypes; PyObject *__pyx_n_s_cur_height; PyObject *__pyx_n_s_cur_width; PyObject *__pyx_n_s_current_h; PyObject *__pyx_n_s_current_w; PyObject *__pyx_n_s_default; PyObject *__pyx_n_s_default_icon; PyObject *__pyx_n_s_default_swap_control; PyObject *__pyx_n_s_default_title; PyObject *__pyx_n_s_depth; PyObject *__pyx_n_s_destroy; PyObject *__pyx_n_s_dict; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_display; PyObject *__pyx_n_s_dm; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_driver; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_environ; PyObject *__pyx_n_s_err; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_event; PyObject *__pyx_n_s_flag; PyObject *__pyx_n_s_flags; PyObject *__pyx_n_s_flip; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_fullscreen; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_active; PyObject *__pyx_n_s_get_caption; PyObject *__pyx_n_s_get_display_bounds; PyObject *__pyx_n_s_get_drawable_size; PyObject *__pyx_n_s_get_driver; PyObject *__pyx_n_s_get_hint; PyObject *__pyx_n_s_get_init; PyObject *__pyx_n_s_get_num_video_displays; PyObject *__pyx_n_s_get_platform; PyObject *__pyx_n_s_get_position; PyObject *__pyx_n_s_get_sdl_window_pointer; PyObject *__pyx_n_s_get_size; PyObject *__pyx_n_s_get_surface; PyObject *__pyx_n_s_get_window; PyObject *__pyx_n_s_get_window_flags; PyObject *__pyx_n_s_get_wm_info; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_gl_get_attribute; PyObject *__pyx_n_s_gl_load_library; PyObject *__pyx_n_s_gl_reset_attributes; PyObject *__pyx_n_s_gl_set_attribute; PyObject *__pyx_n_s_gl_unload_library; PyObject *__pyx_n_s_green; PyObject *__pyx_n_s_green_gamma; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_height; PyObject *__pyx_n_s_hint; PyObject *__pyx_n_s_hw; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_iconify; PyObject *__pyx_n_s_icontitle; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_index; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_2; PyObject *__pyx_n_s_init_done; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_ios; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_list_modes; PyObject *__pyx_n_s_losses; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_main_done; PyObject *__pyx_n_s_main_window; PyObject *__pyx_n_s_masks; PyObject *__pyx_n_s_maximize; PyObject *__pyx_n_s_maximized; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_minimize; PyObject *__pyx_n_s_mode; PyObject *__pyx_n_s_mode_ok; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_num_modes; PyObject *__pyx_n_s_object; PyObject *__pyx_n_s_opengl; PyObject *__pyx_n_s_os; PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_priority; PyObject *__pyx_n_s_proxy_window_surface; PyObject *__pyx_n_s_pygame_hints; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_display; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_locals; PyObject *__pyx_kp_s_pygame_window; PyObject *__pyx_n_s_pyx_capi; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_range; PyObject *__pyx_n_s_recreate_gl_context; PyObject *__pyx_n_s_rect; PyObject *__pyx_n_s_rectangles; PyObject *__pyx_n_s_rects; PyObject *__pyx_n_s_red; PyObject *__pyx_n_s_red_gamma; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_refresh_rate; PyObject *__pyx_n_s_register_init; PyObject *__pyx_n_s_register_quit; PyObject *__pyx_n_s_repr; PyObject *__pyx_n_s_resize; PyObject *__pyx_n_s_resolution; PyObject *__pyx_n_s_restore; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_sdl_main_init; PyObject *__pyx_n_s_self; PyObject *__pyx_kp_s_self_gl_context_self_window_self; PyObject *__pyx_n_s_set_caption; PyObject *__pyx_n_s_set_gamma; PyObject *__pyx_n_s_set_gamma_ramp; PyObject *__pyx_n_s_set_icon; PyObject *__pyx_n_s_set_mode; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_set_position; PyObject *__pyx_n_s_set_screensaver; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_shape; PyObject *__pyx_n_s_shifts; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_display_pyx; PyObject *__pyx_n_s_startswith; PyObject *__pyx_n_s_state; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_t; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_title; PyObject *__pyx_n_s_toggle_fullscreen; PyObject *__pyx_n_s_update; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_video_mem; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_warnings; PyObject *__pyx_n_s_width; PyObject *__pyx_n_s_wm; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_y; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_32; PyObject *__pyx_int_268435456; PyObject *__pyx_k__2; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__26; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__33; PyObject *__pyx_tuple__35; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__42; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__45; PyObject *__pyx_tuple__47; PyObject *__pyx_tuple__54; PyObject *__pyx_tuple__56; PyObject *__pyx_tuple__58; PyObject *__pyx_tuple__61; PyObject *__pyx_tuple__63; PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__71; PyObject *__pyx_tuple__73; PyObject *__pyx_tuple__74; PyObject *__pyx_tuple__75; PyObject *__pyx_tuple__79; PyObject *__pyx_tuple__81; PyObject *__pyx_tuple__83; PyObject *__pyx_tuple__84; PyObject *__pyx_tuple__87; PyObject *__pyx_tuple__89; PyObject *__pyx_tuple__91; PyObject *__pyx_tuple__97; PyObject *__pyx_codeobj__9; PyObject *__pyx_tuple__100; PyObject *__pyx_tuple__102; PyObject *__pyx_tuple__108; PyObject *__pyx_tuple__111; PyObject *__pyx_tuple__113; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__31; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__37; PyObject *__pyx_codeobj__38; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__48; PyObject *__pyx_codeobj__49; PyObject *__pyx_codeobj__50; PyObject *__pyx_codeobj__51; PyObject *__pyx_codeobj__52; PyObject *__pyx_codeobj__53; PyObject *__pyx_codeobj__55; PyObject *__pyx_codeobj__57; PyObject *__pyx_codeobj__59; PyObject *__pyx_codeobj__60; PyObject *__pyx_codeobj__62; PyObject *__pyx_codeobj__64; PyObject *__pyx_codeobj__65; PyObject *__pyx_codeobj__66; PyObject *__pyx_codeobj__67; PyObject *__pyx_codeobj__68; PyObject *__pyx_codeobj__70; PyObject *__pyx_codeobj__72; PyObject *__pyx_codeobj__76; PyObject *__pyx_codeobj__77; PyObject *__pyx_codeobj__78; PyObject *__pyx_codeobj__80; PyObject *__pyx_codeobj__82; PyObject *__pyx_codeobj__85; PyObject *__pyx_codeobj__86; PyObject *__pyx_codeobj__88; PyObject *__pyx_codeobj__90; PyObject *__pyx_codeobj__92; PyObject *__pyx_codeobj__93; PyObject *__pyx_codeobj__94; PyObject *__pyx_codeobj__95; PyObject *__pyx_codeobj__96; PyObject *__pyx_codeobj__98; PyObject *__pyx_codeobj__99; PyObject *__pyx_codeobj__101; PyObject *__pyx_codeobj__103; PyObject *__pyx_codeobj__104; PyObject *__pyx_codeobj__105; PyObject *__pyx_codeobj__106; PyObject *__pyx_codeobj__107; PyObject *__pyx_codeobj__109; PyObject *__pyx_codeobj__110; PyObject *__pyx_codeobj__112; PyObject *__pyx_codeobj__114; PyObject *__pyx_codeobj__115; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_7display_Window); Py_CLEAR(clear_module_state->__pyx_kp_s_0); Py_CLEAR(clear_module_state->__pyx_kp_s_Couldn_t_allocate_rectangles); Py_CLEAR(clear_module_state->__pyx_n_s_GL_SWAP_CONTROL); Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); Py_CLEAR(clear_module_state->__pyx_n_s_Info); Py_CLEAR(clear_module_state->__pyx_n_s_Info___init); Py_CLEAR(clear_module_state->__pyx_n_s_Info___repr); Py_CLEAR(clear_module_state->__pyx_kp_s_Info_r); Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); Py_CLEAR(clear_module_state->__pyx_n_s_PYGAME_IOS); Py_CLEAR(clear_module_state->__pyx_n_s_PYGAME_SDL2); Py_CLEAR(clear_module_state->__pyx_n_s_PYGAME_SDL2_AVOID_GL); Py_CLEAR(clear_module_state->__pyx_n_s_RESIZE_FLAGS); Py_CLEAR(clear_module_state->__pyx_n_s_SRCALPHA); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_Window); Py_CLEAR(clear_module_state->__pyx_n_s_Window___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Window___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Window_create_surface); Py_CLEAR(clear_module_state->__pyx_n_s_Window_destroy); Py_CLEAR(clear_module_state->__pyx_n_s_Window_flip); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_active); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_drawable_size); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_position); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_sdl_window_pointer); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_size); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_surface); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_window_flags); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_wm_info); Py_CLEAR(clear_module_state->__pyx_n_s_Window_iconify); Py_CLEAR(clear_module_state->__pyx_n_s_Window_maximize); Py_CLEAR(clear_module_state->__pyx_n_s_Window_minimize); Py_CLEAR(clear_module_state->__pyx_n_s_Window_proxy_window_surface); Py_CLEAR(clear_module_state->__pyx_n_s_Window_recreate_gl_context); Py_CLEAR(clear_module_state->__pyx_n_s_Window_resize); Py_CLEAR(clear_module_state->__pyx_n_s_Window_restore); Py_CLEAR(clear_module_state->__pyx_n_s_Window_set_caption); Py_CLEAR(clear_module_state->__pyx_n_s_Window_set_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_Window_set_gamma_ramp); Py_CLEAR(clear_module_state->__pyx_n_s_Window_set_icon); Py_CLEAR(clear_module_state->__pyx_n_s_Window_set_position); Py_CLEAR(clear_module_state->__pyx_n_s_Window_toggle_fullscreen); Py_CLEAR(clear_module_state->__pyx_n_s_Window_update); Py_CLEAR(clear_module_state->__pyx_n_s__116); Py_CLEAR(clear_module_state->__pyx_n_s__6); Py_CLEAR(clear_module_state->__pyx_kp_u__7); Py_CLEAR(clear_module_state->__pyx_n_s_always); Py_CLEAR(clear_module_state->__pyx_n_s_androidembed); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_bitsize); Py_CLEAR(clear_module_state->__pyx_n_s_blit_hw); Py_CLEAR(clear_module_state->__pyx_n_s_blit_hw_A); Py_CLEAR(clear_module_state->__pyx_n_s_blit_hw_CC); Py_CLEAR(clear_module_state->__pyx_n_s_blit_sw); Py_CLEAR(clear_module_state->__pyx_n_s_blit_sw_A); Py_CLEAR(clear_module_state->__pyx_n_s_blit_sw_CC); Py_CLEAR(clear_module_state->__pyx_n_s_blue); Py_CLEAR(clear_module_state->__pyx_n_s_blue_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_bytesize); Py_CLEAR(clear_module_state->__pyx_n_s_c_void_p); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_copy); Py_CLEAR(clear_module_state->__pyx_n_s_count); Py_CLEAR(clear_module_state->__pyx_n_s_create_surface); Py_CLEAR(clear_module_state->__pyx_n_s_ctypes); Py_CLEAR(clear_module_state->__pyx_n_s_cur_height); Py_CLEAR(clear_module_state->__pyx_n_s_cur_width); Py_CLEAR(clear_module_state->__pyx_n_s_current_h); Py_CLEAR(clear_module_state->__pyx_n_s_current_w); Py_CLEAR(clear_module_state->__pyx_n_s_default); Py_CLEAR(clear_module_state->__pyx_n_s_default_icon); Py_CLEAR(clear_module_state->__pyx_n_s_default_swap_control); Py_CLEAR(clear_module_state->__pyx_n_s_default_title); Py_CLEAR(clear_module_state->__pyx_n_s_depth); Py_CLEAR(clear_module_state->__pyx_n_s_destroy); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_display); Py_CLEAR(clear_module_state->__pyx_n_s_dm); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_driver); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_environ); Py_CLEAR(clear_module_state->__pyx_n_s_err); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_event); Py_CLEAR(clear_module_state->__pyx_n_s_flag); Py_CLEAR(clear_module_state->__pyx_n_s_flags); Py_CLEAR(clear_module_state->__pyx_n_s_flip); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_fullscreen); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_active); Py_CLEAR(clear_module_state->__pyx_n_s_get_caption); Py_CLEAR(clear_module_state->__pyx_n_s_get_display_bounds); Py_CLEAR(clear_module_state->__pyx_n_s_get_drawable_size); Py_CLEAR(clear_module_state->__pyx_n_s_get_driver); Py_CLEAR(clear_module_state->__pyx_n_s_get_hint); Py_CLEAR(clear_module_state->__pyx_n_s_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_get_num_video_displays); Py_CLEAR(clear_module_state->__pyx_n_s_get_platform); Py_CLEAR(clear_module_state->__pyx_n_s_get_position); Py_CLEAR(clear_module_state->__pyx_n_s_get_sdl_window_pointer); Py_CLEAR(clear_module_state->__pyx_n_s_get_size); Py_CLEAR(clear_module_state->__pyx_n_s_get_surface); Py_CLEAR(clear_module_state->__pyx_n_s_get_window); Py_CLEAR(clear_module_state->__pyx_n_s_get_window_flags); Py_CLEAR(clear_module_state->__pyx_n_s_get_wm_info); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_gl_get_attribute); Py_CLEAR(clear_module_state->__pyx_n_s_gl_load_library); Py_CLEAR(clear_module_state->__pyx_n_s_gl_reset_attributes); Py_CLEAR(clear_module_state->__pyx_n_s_gl_set_attribute); Py_CLEAR(clear_module_state->__pyx_n_s_gl_unload_library); Py_CLEAR(clear_module_state->__pyx_n_s_green); Py_CLEAR(clear_module_state->__pyx_n_s_green_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_height); Py_CLEAR(clear_module_state->__pyx_n_s_hint); Py_CLEAR(clear_module_state->__pyx_n_s_hw); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_iconify); Py_CLEAR(clear_module_state->__pyx_n_s_icontitle); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_index); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_2); Py_CLEAR(clear_module_state->__pyx_n_s_init_done); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_ios); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_list_modes); Py_CLEAR(clear_module_state->__pyx_n_s_losses); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_main_done); Py_CLEAR(clear_module_state->__pyx_n_s_main_window); Py_CLEAR(clear_module_state->__pyx_n_s_masks); Py_CLEAR(clear_module_state->__pyx_n_s_maximize); Py_CLEAR(clear_module_state->__pyx_n_s_maximized); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_minimize); Py_CLEAR(clear_module_state->__pyx_n_s_mode); Py_CLEAR(clear_module_state->__pyx_n_s_mode_ok); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_num_modes); Py_CLEAR(clear_module_state->__pyx_n_s_object); Py_CLEAR(clear_module_state->__pyx_n_s_opengl); Py_CLEAR(clear_module_state->__pyx_n_s_os); Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_priority); Py_CLEAR(clear_module_state->__pyx_n_s_proxy_window_surface); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_hints); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_display); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_locals); Py_CLEAR(clear_module_state->__pyx_kp_s_pygame_window); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_capi); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_s_recreate_gl_context); Py_CLEAR(clear_module_state->__pyx_n_s_rect); Py_CLEAR(clear_module_state->__pyx_n_s_rectangles); Py_CLEAR(clear_module_state->__pyx_n_s_rects); Py_CLEAR(clear_module_state->__pyx_n_s_red); Py_CLEAR(clear_module_state->__pyx_n_s_red_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_refresh_rate); Py_CLEAR(clear_module_state->__pyx_n_s_register_init); Py_CLEAR(clear_module_state->__pyx_n_s_register_quit); Py_CLEAR(clear_module_state->__pyx_n_s_repr); Py_CLEAR(clear_module_state->__pyx_n_s_resize); Py_CLEAR(clear_module_state->__pyx_n_s_resolution); Py_CLEAR(clear_module_state->__pyx_n_s_restore); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_main_init); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_kp_s_self_gl_context_self_window_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_caption); Py_CLEAR(clear_module_state->__pyx_n_s_set_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_set_gamma_ramp); Py_CLEAR(clear_module_state->__pyx_n_s_set_icon); Py_CLEAR(clear_module_state->__pyx_n_s_set_mode); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_set_position); Py_CLEAR(clear_module_state->__pyx_n_s_set_screensaver); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_shape); Py_CLEAR(clear_module_state->__pyx_n_s_shifts); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_display_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_startswith); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_t); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_title); Py_CLEAR(clear_module_state->__pyx_n_s_toggle_fullscreen); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_video_mem); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_warnings); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_n_s_wm); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_32); Py_CLEAR(clear_module_state->__pyx_int_268435456); Py_CLEAR(clear_module_state->__pyx_k__2); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__26); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__33); Py_CLEAR(clear_module_state->__pyx_tuple__35); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__42); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_tuple__47); Py_CLEAR(clear_module_state->__pyx_tuple__54); Py_CLEAR(clear_module_state->__pyx_tuple__56); Py_CLEAR(clear_module_state->__pyx_tuple__58); Py_CLEAR(clear_module_state->__pyx_tuple__61); Py_CLEAR(clear_module_state->__pyx_tuple__63); Py_CLEAR(clear_module_state->__pyx_tuple__69); Py_CLEAR(clear_module_state->__pyx_tuple__71); Py_CLEAR(clear_module_state->__pyx_tuple__73); Py_CLEAR(clear_module_state->__pyx_tuple__74); Py_CLEAR(clear_module_state->__pyx_tuple__75); Py_CLEAR(clear_module_state->__pyx_tuple__79); Py_CLEAR(clear_module_state->__pyx_tuple__81); Py_CLEAR(clear_module_state->__pyx_tuple__83); Py_CLEAR(clear_module_state->__pyx_tuple__84); Py_CLEAR(clear_module_state->__pyx_tuple__87); Py_CLEAR(clear_module_state->__pyx_tuple__89); Py_CLEAR(clear_module_state->__pyx_tuple__91); Py_CLEAR(clear_module_state->__pyx_tuple__97); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_tuple__100); Py_CLEAR(clear_module_state->__pyx_tuple__102); Py_CLEAR(clear_module_state->__pyx_tuple__108); Py_CLEAR(clear_module_state->__pyx_tuple__111); Py_CLEAR(clear_module_state->__pyx_tuple__113); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__31); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__37); Py_CLEAR(clear_module_state->__pyx_codeobj__38); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__48); Py_CLEAR(clear_module_state->__pyx_codeobj__49); Py_CLEAR(clear_module_state->__pyx_codeobj__50); Py_CLEAR(clear_module_state->__pyx_codeobj__51); Py_CLEAR(clear_module_state->__pyx_codeobj__52); Py_CLEAR(clear_module_state->__pyx_codeobj__53); Py_CLEAR(clear_module_state->__pyx_codeobj__55); Py_CLEAR(clear_module_state->__pyx_codeobj__57); Py_CLEAR(clear_module_state->__pyx_codeobj__59); Py_CLEAR(clear_module_state->__pyx_codeobj__60); Py_CLEAR(clear_module_state->__pyx_codeobj__62); Py_CLEAR(clear_module_state->__pyx_codeobj__64); Py_CLEAR(clear_module_state->__pyx_codeobj__65); Py_CLEAR(clear_module_state->__pyx_codeobj__66); Py_CLEAR(clear_module_state->__pyx_codeobj__67); Py_CLEAR(clear_module_state->__pyx_codeobj__68); Py_CLEAR(clear_module_state->__pyx_codeobj__70); Py_CLEAR(clear_module_state->__pyx_codeobj__72); Py_CLEAR(clear_module_state->__pyx_codeobj__76); Py_CLEAR(clear_module_state->__pyx_codeobj__77); Py_CLEAR(clear_module_state->__pyx_codeobj__78); Py_CLEAR(clear_module_state->__pyx_codeobj__80); Py_CLEAR(clear_module_state->__pyx_codeobj__82); Py_CLEAR(clear_module_state->__pyx_codeobj__85); Py_CLEAR(clear_module_state->__pyx_codeobj__86); Py_CLEAR(clear_module_state->__pyx_codeobj__88); Py_CLEAR(clear_module_state->__pyx_codeobj__90); Py_CLEAR(clear_module_state->__pyx_codeobj__92); Py_CLEAR(clear_module_state->__pyx_codeobj__93); Py_CLEAR(clear_module_state->__pyx_codeobj__94); Py_CLEAR(clear_module_state->__pyx_codeobj__95); Py_CLEAR(clear_module_state->__pyx_codeobj__96); Py_CLEAR(clear_module_state->__pyx_codeobj__98); Py_CLEAR(clear_module_state->__pyx_codeobj__99); Py_CLEAR(clear_module_state->__pyx_codeobj__101); Py_CLEAR(clear_module_state->__pyx_codeobj__103); Py_CLEAR(clear_module_state->__pyx_codeobj__104); Py_CLEAR(clear_module_state->__pyx_codeobj__105); Py_CLEAR(clear_module_state->__pyx_codeobj__106); Py_CLEAR(clear_module_state->__pyx_codeobj__107); Py_CLEAR(clear_module_state->__pyx_codeobj__109); Py_CLEAR(clear_module_state->__pyx_codeobj__110); Py_CLEAR(clear_module_state->__pyx_codeobj__112); Py_CLEAR(clear_module_state->__pyx_codeobj__114); Py_CLEAR(clear_module_state->__pyx_codeobj__115); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_7display_Window); Py_VISIT(traverse_module_state->__pyx_kp_s_0); Py_VISIT(traverse_module_state->__pyx_kp_s_Couldn_t_allocate_rectangles); Py_VISIT(traverse_module_state->__pyx_n_s_GL_SWAP_CONTROL); Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); Py_VISIT(traverse_module_state->__pyx_n_s_Info); Py_VISIT(traverse_module_state->__pyx_n_s_Info___init); Py_VISIT(traverse_module_state->__pyx_n_s_Info___repr); Py_VISIT(traverse_module_state->__pyx_kp_s_Info_r); Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); Py_VISIT(traverse_module_state->__pyx_n_s_PYGAME_IOS); Py_VISIT(traverse_module_state->__pyx_n_s_PYGAME_SDL2); Py_VISIT(traverse_module_state->__pyx_n_s_PYGAME_SDL2_AVOID_GL); Py_VISIT(traverse_module_state->__pyx_n_s_RESIZE_FLAGS); Py_VISIT(traverse_module_state->__pyx_n_s_SRCALPHA); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_Window); Py_VISIT(traverse_module_state->__pyx_n_s_Window___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Window___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Window_create_surface); Py_VISIT(traverse_module_state->__pyx_n_s_Window_destroy); Py_VISIT(traverse_module_state->__pyx_n_s_Window_flip); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_active); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_drawable_size); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_position); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_sdl_window_pointer); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_size); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_surface); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_window_flags); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_wm_info); Py_VISIT(traverse_module_state->__pyx_n_s_Window_iconify); Py_VISIT(traverse_module_state->__pyx_n_s_Window_maximize); Py_VISIT(traverse_module_state->__pyx_n_s_Window_minimize); Py_VISIT(traverse_module_state->__pyx_n_s_Window_proxy_window_surface); Py_VISIT(traverse_module_state->__pyx_n_s_Window_recreate_gl_context); Py_VISIT(traverse_module_state->__pyx_n_s_Window_resize); Py_VISIT(traverse_module_state->__pyx_n_s_Window_restore); Py_VISIT(traverse_module_state->__pyx_n_s_Window_set_caption); Py_VISIT(traverse_module_state->__pyx_n_s_Window_set_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_Window_set_gamma_ramp); Py_VISIT(traverse_module_state->__pyx_n_s_Window_set_icon); Py_VISIT(traverse_module_state->__pyx_n_s_Window_set_position); Py_VISIT(traverse_module_state->__pyx_n_s_Window_toggle_fullscreen); Py_VISIT(traverse_module_state->__pyx_n_s_Window_update); Py_VISIT(traverse_module_state->__pyx_n_s__116); Py_VISIT(traverse_module_state->__pyx_n_s__6); Py_VISIT(traverse_module_state->__pyx_kp_u__7); Py_VISIT(traverse_module_state->__pyx_n_s_always); Py_VISIT(traverse_module_state->__pyx_n_s_androidembed); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_bitsize); Py_VISIT(traverse_module_state->__pyx_n_s_blit_hw); Py_VISIT(traverse_module_state->__pyx_n_s_blit_hw_A); Py_VISIT(traverse_module_state->__pyx_n_s_blit_hw_CC); Py_VISIT(traverse_module_state->__pyx_n_s_blit_sw); Py_VISIT(traverse_module_state->__pyx_n_s_blit_sw_A); Py_VISIT(traverse_module_state->__pyx_n_s_blit_sw_CC); Py_VISIT(traverse_module_state->__pyx_n_s_blue); Py_VISIT(traverse_module_state->__pyx_n_s_blue_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_bytesize); Py_VISIT(traverse_module_state->__pyx_n_s_c_void_p); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_copy); Py_VISIT(traverse_module_state->__pyx_n_s_count); Py_VISIT(traverse_module_state->__pyx_n_s_create_surface); Py_VISIT(traverse_module_state->__pyx_n_s_ctypes); Py_VISIT(traverse_module_state->__pyx_n_s_cur_height); Py_VISIT(traverse_module_state->__pyx_n_s_cur_width); Py_VISIT(traverse_module_state->__pyx_n_s_current_h); Py_VISIT(traverse_module_state->__pyx_n_s_current_w); Py_VISIT(traverse_module_state->__pyx_n_s_default); Py_VISIT(traverse_module_state->__pyx_n_s_default_icon); Py_VISIT(traverse_module_state->__pyx_n_s_default_swap_control); Py_VISIT(traverse_module_state->__pyx_n_s_default_title); Py_VISIT(traverse_module_state->__pyx_n_s_depth); Py_VISIT(traverse_module_state->__pyx_n_s_destroy); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_display); Py_VISIT(traverse_module_state->__pyx_n_s_dm); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_driver); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_environ); Py_VISIT(traverse_module_state->__pyx_n_s_err); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_event); Py_VISIT(traverse_module_state->__pyx_n_s_flag); Py_VISIT(traverse_module_state->__pyx_n_s_flags); Py_VISIT(traverse_module_state->__pyx_n_s_flip); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_fullscreen); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_active); Py_VISIT(traverse_module_state->__pyx_n_s_get_caption); Py_VISIT(traverse_module_state->__pyx_n_s_get_display_bounds); Py_VISIT(traverse_module_state->__pyx_n_s_get_drawable_size); Py_VISIT(traverse_module_state->__pyx_n_s_get_driver); Py_VISIT(traverse_module_state->__pyx_n_s_get_hint); Py_VISIT(traverse_module_state->__pyx_n_s_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_get_num_video_displays); Py_VISIT(traverse_module_state->__pyx_n_s_get_platform); Py_VISIT(traverse_module_state->__pyx_n_s_get_position); Py_VISIT(traverse_module_state->__pyx_n_s_get_sdl_window_pointer); Py_VISIT(traverse_module_state->__pyx_n_s_get_size); Py_VISIT(traverse_module_state->__pyx_n_s_get_surface); Py_VISIT(traverse_module_state->__pyx_n_s_get_window); Py_VISIT(traverse_module_state->__pyx_n_s_get_window_flags); Py_VISIT(traverse_module_state->__pyx_n_s_get_wm_info); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_gl_get_attribute); Py_VISIT(traverse_module_state->__pyx_n_s_gl_load_library); Py_VISIT(traverse_module_state->__pyx_n_s_gl_reset_attributes); Py_VISIT(traverse_module_state->__pyx_n_s_gl_set_attribute); Py_VISIT(traverse_module_state->__pyx_n_s_gl_unload_library); Py_VISIT(traverse_module_state->__pyx_n_s_green); Py_VISIT(traverse_module_state->__pyx_n_s_green_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_height); Py_VISIT(traverse_module_state->__pyx_n_s_hint); Py_VISIT(traverse_module_state->__pyx_n_s_hw); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_iconify); Py_VISIT(traverse_module_state->__pyx_n_s_icontitle); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_index); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_2); Py_VISIT(traverse_module_state->__pyx_n_s_init_done); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_ios); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_list_modes); Py_VISIT(traverse_module_state->__pyx_n_s_losses); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_main_done); Py_VISIT(traverse_module_state->__pyx_n_s_main_window); Py_VISIT(traverse_module_state->__pyx_n_s_masks); Py_VISIT(traverse_module_state->__pyx_n_s_maximize); Py_VISIT(traverse_module_state->__pyx_n_s_maximized); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_minimize); Py_VISIT(traverse_module_state->__pyx_n_s_mode); Py_VISIT(traverse_module_state->__pyx_n_s_mode_ok); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_num_modes); Py_VISIT(traverse_module_state->__pyx_n_s_object); Py_VISIT(traverse_module_state->__pyx_n_s_opengl); Py_VISIT(traverse_module_state->__pyx_n_s_os); Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_priority); Py_VISIT(traverse_module_state->__pyx_n_s_proxy_window_surface); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_hints); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_display); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_locals); Py_VISIT(traverse_module_state->__pyx_kp_s_pygame_window); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_capi); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_s_recreate_gl_context); Py_VISIT(traverse_module_state->__pyx_n_s_rect); Py_VISIT(traverse_module_state->__pyx_n_s_rectangles); Py_VISIT(traverse_module_state->__pyx_n_s_rects); Py_VISIT(traverse_module_state->__pyx_n_s_red); Py_VISIT(traverse_module_state->__pyx_n_s_red_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_refresh_rate); Py_VISIT(traverse_module_state->__pyx_n_s_register_init); Py_VISIT(traverse_module_state->__pyx_n_s_register_quit); Py_VISIT(traverse_module_state->__pyx_n_s_repr); Py_VISIT(traverse_module_state->__pyx_n_s_resize); Py_VISIT(traverse_module_state->__pyx_n_s_resolution); Py_VISIT(traverse_module_state->__pyx_n_s_restore); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_main_init); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_kp_s_self_gl_context_self_window_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_caption); Py_VISIT(traverse_module_state->__pyx_n_s_set_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_set_gamma_ramp); Py_VISIT(traverse_module_state->__pyx_n_s_set_icon); Py_VISIT(traverse_module_state->__pyx_n_s_set_mode); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_set_position); Py_VISIT(traverse_module_state->__pyx_n_s_set_screensaver); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_shape); Py_VISIT(traverse_module_state->__pyx_n_s_shifts); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_display_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_startswith); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_t); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_title); Py_VISIT(traverse_module_state->__pyx_n_s_toggle_fullscreen); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_video_mem); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_warnings); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_n_s_wm); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_32); Py_VISIT(traverse_module_state->__pyx_int_268435456); Py_VISIT(traverse_module_state->__pyx_k__2); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__26); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__33); Py_VISIT(traverse_module_state->__pyx_tuple__35); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__42); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_tuple__47); Py_VISIT(traverse_module_state->__pyx_tuple__54); Py_VISIT(traverse_module_state->__pyx_tuple__56); Py_VISIT(traverse_module_state->__pyx_tuple__58); Py_VISIT(traverse_module_state->__pyx_tuple__61); Py_VISIT(traverse_module_state->__pyx_tuple__63); Py_VISIT(traverse_module_state->__pyx_tuple__69); Py_VISIT(traverse_module_state->__pyx_tuple__71); Py_VISIT(traverse_module_state->__pyx_tuple__73); Py_VISIT(traverse_module_state->__pyx_tuple__74); Py_VISIT(traverse_module_state->__pyx_tuple__75); Py_VISIT(traverse_module_state->__pyx_tuple__79); Py_VISIT(traverse_module_state->__pyx_tuple__81); Py_VISIT(traverse_module_state->__pyx_tuple__83); Py_VISIT(traverse_module_state->__pyx_tuple__84); Py_VISIT(traverse_module_state->__pyx_tuple__87); Py_VISIT(traverse_module_state->__pyx_tuple__89); Py_VISIT(traverse_module_state->__pyx_tuple__91); Py_VISIT(traverse_module_state->__pyx_tuple__97); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_tuple__100); Py_VISIT(traverse_module_state->__pyx_tuple__102); Py_VISIT(traverse_module_state->__pyx_tuple__108); Py_VISIT(traverse_module_state->__pyx_tuple__111); Py_VISIT(traverse_module_state->__pyx_tuple__113); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__31); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__37); Py_VISIT(traverse_module_state->__pyx_codeobj__38); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__48); Py_VISIT(traverse_module_state->__pyx_codeobj__49); Py_VISIT(traverse_module_state->__pyx_codeobj__50); Py_VISIT(traverse_module_state->__pyx_codeobj__51); Py_VISIT(traverse_module_state->__pyx_codeobj__52); Py_VISIT(traverse_module_state->__pyx_codeobj__53); Py_VISIT(traverse_module_state->__pyx_codeobj__55); Py_VISIT(traverse_module_state->__pyx_codeobj__57); Py_VISIT(traverse_module_state->__pyx_codeobj__59); Py_VISIT(traverse_module_state->__pyx_codeobj__60); Py_VISIT(traverse_module_state->__pyx_codeobj__62); Py_VISIT(traverse_module_state->__pyx_codeobj__64); Py_VISIT(traverse_module_state->__pyx_codeobj__65); Py_VISIT(traverse_module_state->__pyx_codeobj__66); Py_VISIT(traverse_module_state->__pyx_codeobj__67); Py_VISIT(traverse_module_state->__pyx_codeobj__68); Py_VISIT(traverse_module_state->__pyx_codeobj__70); Py_VISIT(traverse_module_state->__pyx_codeobj__72); Py_VISIT(traverse_module_state->__pyx_codeobj__76); Py_VISIT(traverse_module_state->__pyx_codeobj__77); Py_VISIT(traverse_module_state->__pyx_codeobj__78); Py_VISIT(traverse_module_state->__pyx_codeobj__80); Py_VISIT(traverse_module_state->__pyx_codeobj__82); Py_VISIT(traverse_module_state->__pyx_codeobj__85); Py_VISIT(traverse_module_state->__pyx_codeobj__86); Py_VISIT(traverse_module_state->__pyx_codeobj__88); Py_VISIT(traverse_module_state->__pyx_codeobj__90); Py_VISIT(traverse_module_state->__pyx_codeobj__92); Py_VISIT(traverse_module_state->__pyx_codeobj__93); Py_VISIT(traverse_module_state->__pyx_codeobj__94); Py_VISIT(traverse_module_state->__pyx_codeobj__95); Py_VISIT(traverse_module_state->__pyx_codeobj__96); Py_VISIT(traverse_module_state->__pyx_codeobj__98); Py_VISIT(traverse_module_state->__pyx_codeobj__99); Py_VISIT(traverse_module_state->__pyx_codeobj__101); Py_VISIT(traverse_module_state->__pyx_codeobj__103); Py_VISIT(traverse_module_state->__pyx_codeobj__104); Py_VISIT(traverse_module_state->__pyx_codeobj__105); Py_VISIT(traverse_module_state->__pyx_codeobj__106); Py_VISIT(traverse_module_state->__pyx_codeobj__107); Py_VISIT(traverse_module_state->__pyx_codeobj__109); Py_VISIT(traverse_module_state->__pyx_codeobj__110); Py_VISIT(traverse_module_state->__pyx_codeobj__112); Py_VISIT(traverse_module_state->__pyx_codeobj__114); Py_VISIT(traverse_module_state->__pyx_codeobj__115); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_4rect_Rect __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_4rect_Rect #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_7display_Window __pyx_mstate_global->__pyx_type_11pygame_sdl2_7display_Window #endif #define __pyx_ptype_11pygame_sdl2_7display_Window __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7display_Window #define __pyx_kp_s_0 __pyx_mstate_global->__pyx_kp_s_0 #define __pyx_kp_s_Couldn_t_allocate_rectangles __pyx_mstate_global->__pyx_kp_s_Couldn_t_allocate_rectangles #define __pyx_n_s_GL_SWAP_CONTROL __pyx_mstate_global->__pyx_n_s_GL_SWAP_CONTROL #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError #define __pyx_n_s_Info __pyx_mstate_global->__pyx_n_s_Info #define __pyx_n_s_Info___init __pyx_mstate_global->__pyx_n_s_Info___init #define __pyx_n_s_Info___repr __pyx_mstate_global->__pyx_n_s_Info___repr #define __pyx_kp_s_Info_r __pyx_mstate_global->__pyx_kp_s_Info_r #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError #define __pyx_n_s_PYGAME_IOS __pyx_mstate_global->__pyx_n_s_PYGAME_IOS #define __pyx_n_s_PYGAME_SDL2 __pyx_mstate_global->__pyx_n_s_PYGAME_SDL2 #define __pyx_n_s_PYGAME_SDL2_AVOID_GL __pyx_mstate_global->__pyx_n_s_PYGAME_SDL2_AVOID_GL #define __pyx_n_s_RESIZE_FLAGS __pyx_mstate_global->__pyx_n_s_RESIZE_FLAGS #define __pyx_n_s_SRCALPHA __pyx_mstate_global->__pyx_n_s_SRCALPHA #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_Window __pyx_mstate_global->__pyx_n_s_Window #define __pyx_n_s_Window___reduce_cython __pyx_mstate_global->__pyx_n_s_Window___reduce_cython #define __pyx_n_s_Window___setstate_cython __pyx_mstate_global->__pyx_n_s_Window___setstate_cython #define __pyx_n_s_Window_create_surface __pyx_mstate_global->__pyx_n_s_Window_create_surface #define __pyx_n_s_Window_destroy __pyx_mstate_global->__pyx_n_s_Window_destroy #define __pyx_n_s_Window_flip __pyx_mstate_global->__pyx_n_s_Window_flip #define __pyx_n_s_Window_get_active __pyx_mstate_global->__pyx_n_s_Window_get_active #define __pyx_n_s_Window_get_drawable_size __pyx_mstate_global->__pyx_n_s_Window_get_drawable_size #define __pyx_n_s_Window_get_position __pyx_mstate_global->__pyx_n_s_Window_get_position #define __pyx_n_s_Window_get_sdl_window_pointer __pyx_mstate_global->__pyx_n_s_Window_get_sdl_window_pointer #define __pyx_n_s_Window_get_size __pyx_mstate_global->__pyx_n_s_Window_get_size #define __pyx_n_s_Window_get_surface __pyx_mstate_global->__pyx_n_s_Window_get_surface #define __pyx_n_s_Window_get_window_flags __pyx_mstate_global->__pyx_n_s_Window_get_window_flags #define __pyx_n_s_Window_get_wm_info __pyx_mstate_global->__pyx_n_s_Window_get_wm_info #define __pyx_n_s_Window_iconify __pyx_mstate_global->__pyx_n_s_Window_iconify #define __pyx_n_s_Window_maximize __pyx_mstate_global->__pyx_n_s_Window_maximize #define __pyx_n_s_Window_minimize __pyx_mstate_global->__pyx_n_s_Window_minimize #define __pyx_n_s_Window_proxy_window_surface __pyx_mstate_global->__pyx_n_s_Window_proxy_window_surface #define __pyx_n_s_Window_recreate_gl_context __pyx_mstate_global->__pyx_n_s_Window_recreate_gl_context #define __pyx_n_s_Window_resize __pyx_mstate_global->__pyx_n_s_Window_resize #define __pyx_n_s_Window_restore __pyx_mstate_global->__pyx_n_s_Window_restore #define __pyx_n_s_Window_set_caption __pyx_mstate_global->__pyx_n_s_Window_set_caption #define __pyx_n_s_Window_set_gamma __pyx_mstate_global->__pyx_n_s_Window_set_gamma #define __pyx_n_s_Window_set_gamma_ramp __pyx_mstate_global->__pyx_n_s_Window_set_gamma_ramp #define __pyx_n_s_Window_set_icon __pyx_mstate_global->__pyx_n_s_Window_set_icon #define __pyx_n_s_Window_set_position __pyx_mstate_global->__pyx_n_s_Window_set_position #define __pyx_n_s_Window_toggle_fullscreen __pyx_mstate_global->__pyx_n_s_Window_toggle_fullscreen #define __pyx_n_s_Window_update __pyx_mstate_global->__pyx_n_s_Window_update #define __pyx_n_s__116 __pyx_mstate_global->__pyx_n_s__116 #define __pyx_n_s__6 __pyx_mstate_global->__pyx_n_s__6 #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 #define __pyx_n_s_always __pyx_mstate_global->__pyx_n_s_always #define __pyx_n_s_androidembed __pyx_mstate_global->__pyx_n_s_androidembed #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_bitsize __pyx_mstate_global->__pyx_n_s_bitsize #define __pyx_n_s_blit_hw __pyx_mstate_global->__pyx_n_s_blit_hw #define __pyx_n_s_blit_hw_A __pyx_mstate_global->__pyx_n_s_blit_hw_A #define __pyx_n_s_blit_hw_CC __pyx_mstate_global->__pyx_n_s_blit_hw_CC #define __pyx_n_s_blit_sw __pyx_mstate_global->__pyx_n_s_blit_sw #define __pyx_n_s_blit_sw_A __pyx_mstate_global->__pyx_n_s_blit_sw_A #define __pyx_n_s_blit_sw_CC __pyx_mstate_global->__pyx_n_s_blit_sw_CC #define __pyx_n_s_blue __pyx_mstate_global->__pyx_n_s_blue #define __pyx_n_s_blue_gamma __pyx_mstate_global->__pyx_n_s_blue_gamma #define __pyx_n_s_bytesize __pyx_mstate_global->__pyx_n_s_bytesize #define __pyx_n_s_c_void_p __pyx_mstate_global->__pyx_n_s_c_void_p #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy #define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count #define __pyx_n_s_create_surface __pyx_mstate_global->__pyx_n_s_create_surface #define __pyx_n_s_ctypes __pyx_mstate_global->__pyx_n_s_ctypes #define __pyx_n_s_cur_height __pyx_mstate_global->__pyx_n_s_cur_height #define __pyx_n_s_cur_width __pyx_mstate_global->__pyx_n_s_cur_width #define __pyx_n_s_current_h __pyx_mstate_global->__pyx_n_s_current_h #define __pyx_n_s_current_w __pyx_mstate_global->__pyx_n_s_current_w #define __pyx_n_s_default __pyx_mstate_global->__pyx_n_s_default #define __pyx_n_s_default_icon __pyx_mstate_global->__pyx_n_s_default_icon #define __pyx_n_s_default_swap_control __pyx_mstate_global->__pyx_n_s_default_swap_control #define __pyx_n_s_default_title __pyx_mstate_global->__pyx_n_s_default_title #define __pyx_n_s_depth __pyx_mstate_global->__pyx_n_s_depth #define __pyx_n_s_destroy __pyx_mstate_global->__pyx_n_s_destroy #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display #define __pyx_n_s_dm __pyx_mstate_global->__pyx_n_s_dm #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_driver __pyx_mstate_global->__pyx_n_s_driver #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_environ __pyx_mstate_global->__pyx_n_s_environ #define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_event __pyx_mstate_global->__pyx_n_s_event #define __pyx_n_s_flag __pyx_mstate_global->__pyx_n_s_flag #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags #define __pyx_n_s_flip __pyx_mstate_global->__pyx_n_s_flip #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_fullscreen __pyx_mstate_global->__pyx_n_s_fullscreen #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_active __pyx_mstate_global->__pyx_n_s_get_active #define __pyx_n_s_get_caption __pyx_mstate_global->__pyx_n_s_get_caption #define __pyx_n_s_get_display_bounds __pyx_mstate_global->__pyx_n_s_get_display_bounds #define __pyx_n_s_get_drawable_size __pyx_mstate_global->__pyx_n_s_get_drawable_size #define __pyx_n_s_get_driver __pyx_mstate_global->__pyx_n_s_get_driver #define __pyx_n_s_get_hint __pyx_mstate_global->__pyx_n_s_get_hint #define __pyx_n_s_get_init __pyx_mstate_global->__pyx_n_s_get_init #define __pyx_n_s_get_num_video_displays __pyx_mstate_global->__pyx_n_s_get_num_video_displays #define __pyx_n_s_get_platform __pyx_mstate_global->__pyx_n_s_get_platform #define __pyx_n_s_get_position __pyx_mstate_global->__pyx_n_s_get_position #define __pyx_n_s_get_sdl_window_pointer __pyx_mstate_global->__pyx_n_s_get_sdl_window_pointer #define __pyx_n_s_get_size __pyx_mstate_global->__pyx_n_s_get_size #define __pyx_n_s_get_surface __pyx_mstate_global->__pyx_n_s_get_surface #define __pyx_n_s_get_window __pyx_mstate_global->__pyx_n_s_get_window #define __pyx_n_s_get_window_flags __pyx_mstate_global->__pyx_n_s_get_window_flags #define __pyx_n_s_get_wm_info __pyx_mstate_global->__pyx_n_s_get_wm_info #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_gl_get_attribute __pyx_mstate_global->__pyx_n_s_gl_get_attribute #define __pyx_n_s_gl_load_library __pyx_mstate_global->__pyx_n_s_gl_load_library #define __pyx_n_s_gl_reset_attributes __pyx_mstate_global->__pyx_n_s_gl_reset_attributes #define __pyx_n_s_gl_set_attribute __pyx_mstate_global->__pyx_n_s_gl_set_attribute #define __pyx_n_s_gl_unload_library __pyx_mstate_global->__pyx_n_s_gl_unload_library #define __pyx_n_s_green __pyx_mstate_global->__pyx_n_s_green #define __pyx_n_s_green_gamma __pyx_mstate_global->__pyx_n_s_green_gamma #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_height __pyx_mstate_global->__pyx_n_s_height #define __pyx_n_s_hint __pyx_mstate_global->__pyx_n_s_hint #define __pyx_n_s_hw __pyx_mstate_global->__pyx_n_s_hw #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_iconify __pyx_mstate_global->__pyx_n_s_iconify #define __pyx_n_s_icontitle __pyx_mstate_global->__pyx_n_s_icontitle #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_2 __pyx_mstate_global->__pyx_n_s_init_2 #define __pyx_n_s_init_done __pyx_mstate_global->__pyx_n_s_init_done #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_ios __pyx_mstate_global->__pyx_n_s_ios #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_list_modes __pyx_mstate_global->__pyx_n_s_list_modes #define __pyx_n_s_losses __pyx_mstate_global->__pyx_n_s_losses #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_main_done __pyx_mstate_global->__pyx_n_s_main_done #define __pyx_n_s_main_window __pyx_mstate_global->__pyx_n_s_main_window #define __pyx_n_s_masks __pyx_mstate_global->__pyx_n_s_masks #define __pyx_n_s_maximize __pyx_mstate_global->__pyx_n_s_maximize #define __pyx_n_s_maximized __pyx_mstate_global->__pyx_n_s_maximized #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_minimize __pyx_mstate_global->__pyx_n_s_minimize #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode #define __pyx_n_s_mode_ok __pyx_mstate_global->__pyx_n_s_mode_ok #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_num_modes __pyx_mstate_global->__pyx_n_s_num_modes #define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object #define __pyx_n_s_opengl __pyx_mstate_global->__pyx_n_s_opengl #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_priority __pyx_mstate_global->__pyx_n_s_priority #define __pyx_n_s_proxy_window_surface __pyx_mstate_global->__pyx_n_s_proxy_window_surface #define __pyx_n_s_pygame_hints __pyx_mstate_global->__pyx_n_s_pygame_hints #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_display __pyx_mstate_global->__pyx_n_s_pygame_sdl2_display #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_locals __pyx_mstate_global->__pyx_n_s_pygame_sdl2_locals #define __pyx_kp_s_pygame_window __pyx_mstate_global->__pyx_kp_s_pygame_window #define __pyx_n_s_pyx_capi __pyx_mstate_global->__pyx_n_s_pyx_capi #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_n_s_recreate_gl_context __pyx_mstate_global->__pyx_n_s_recreate_gl_context #define __pyx_n_s_rect __pyx_mstate_global->__pyx_n_s_rect #define __pyx_n_s_rectangles __pyx_mstate_global->__pyx_n_s_rectangles #define __pyx_n_s_rects __pyx_mstate_global->__pyx_n_s_rects #define __pyx_n_s_red __pyx_mstate_global->__pyx_n_s_red #define __pyx_n_s_red_gamma __pyx_mstate_global->__pyx_n_s_red_gamma #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_refresh_rate __pyx_mstate_global->__pyx_n_s_refresh_rate #define __pyx_n_s_register_init __pyx_mstate_global->__pyx_n_s_register_init #define __pyx_n_s_register_quit __pyx_mstate_global->__pyx_n_s_register_quit #define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr #define __pyx_n_s_resize __pyx_mstate_global->__pyx_n_s_resize #define __pyx_n_s_resolution __pyx_mstate_global->__pyx_n_s_resolution #define __pyx_n_s_restore __pyx_mstate_global->__pyx_n_s_restore #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_sdl_main_init __pyx_mstate_global->__pyx_n_s_sdl_main_init #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_kp_s_self_gl_context_self_window_self __pyx_mstate_global->__pyx_kp_s_self_gl_context_self_window_self #define __pyx_n_s_set_caption __pyx_mstate_global->__pyx_n_s_set_caption #define __pyx_n_s_set_gamma __pyx_mstate_global->__pyx_n_s_set_gamma #define __pyx_n_s_set_gamma_ramp __pyx_mstate_global->__pyx_n_s_set_gamma_ramp #define __pyx_n_s_set_icon __pyx_mstate_global->__pyx_n_s_set_icon #define __pyx_n_s_set_mode __pyx_mstate_global->__pyx_n_s_set_mode #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_set_position __pyx_mstate_global->__pyx_n_s_set_position #define __pyx_n_s_set_screensaver __pyx_mstate_global->__pyx_n_s_set_screensaver #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape #define __pyx_n_s_shifts __pyx_mstate_global->__pyx_n_s_shifts #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_display_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_display_pyx #define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_title __pyx_mstate_global->__pyx_n_s_title #define __pyx_n_s_toggle_fullscreen __pyx_mstate_global->__pyx_n_s_toggle_fullscreen #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_video_mem __pyx_mstate_global->__pyx_n_s_video_mem #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_n_s_wm __pyx_mstate_global->__pyx_n_s_wm #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 #define __pyx_int_268435456 __pyx_mstate_global->__pyx_int_268435456 #define __pyx_k__2 __pyx_mstate_global->__pyx_k__2 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 #define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 #define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58 #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 #define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 #define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 #define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 #define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 #define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 #define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81 #define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83 #define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 #define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 #define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 #define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 #define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100 #define __pyx_tuple__102 __pyx_mstate_global->__pyx_tuple__102 #define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108 #define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111 #define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 #define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 #define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 #define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 #define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 #define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 #define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62 #define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64 #define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 #define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 #define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 #define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68 #define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 #define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72 #define __pyx_codeobj__76 __pyx_mstate_global->__pyx_codeobj__76 #define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 #define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78 #define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 #define __pyx_codeobj__82 __pyx_mstate_global->__pyx_codeobj__82 #define __pyx_codeobj__85 __pyx_mstate_global->__pyx_codeobj__85 #define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86 #define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88 #define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90 #define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92 #define __pyx_codeobj__93 __pyx_mstate_global->__pyx_codeobj__93 #define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94 #define __pyx_codeobj__95 __pyx_mstate_global->__pyx_codeobj__95 #define __pyx_codeobj__96 __pyx_mstate_global->__pyx_codeobj__96 #define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98 #define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99 #define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101 #define __pyx_codeobj__103 __pyx_mstate_global->__pyx_codeobj__103 #define __pyx_codeobj__104 __pyx_mstate_global->__pyx_codeobj__104 #define __pyx_codeobj__105 __pyx_mstate_global->__pyx_codeobj__105 #define __pyx_codeobj__106 __pyx_mstate_global->__pyx_codeobj__106 #define __pyx_codeobj__107 __pyx_mstate_global->__pyx_codeobj__107 #define __pyx_codeobj__109 __pyx_mstate_global->__pyx_codeobj__109 #define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110 #define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112 #define __pyx_codeobj__114 __pyx_mstate_global->__pyx_codeobj__114 #define __pyx_codeobj__115 __pyx_mstate_global->__pyx_codeobj__115 /* #### Code section: module_code ### */ /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value, priority=1): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_1hint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_hint, "hint(hint, value, priority=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_1hint = {"hint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_1hint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_hint}; static PyObject *__pyx_pw_11pygame_sdl2_7display_1hint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_hint = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_priority = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hint,&__pyx_n_s_value,&__pyx_n_s_priority,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hint)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 40, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 40, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hint", 0, 2, 3, 1); __PYX_ERR(0, 40, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_priority); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 40, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hint") < 0)) __PYX_ERR(0, 40, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_hint = values[0]; __pyx_v_value = values[1]; __pyx_v_priority = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hint", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 40, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_hint(__pyx_self, __pyx_v_hint, __pyx_v_value, __pyx_v_priority); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_value, PyObject *__pyx_v_priority) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; char const *__pyx_t_8; SDL_HintPriority __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hint", 0); __Pyx_INCREF(__pyx_v_hint); __Pyx_INCREF(__pyx_v_value); /* "pygame_sdl2/display.pyx":42 * def hint(hint, value, priority=1): * * if str(hint).startswith("PYGAME_SDL2"): # <<<<<<<<<<<<<< * _pygame_hints[str(hint)] = str(value) * return */ __pyx_t_2 = __Pyx_PyObject_Str(__pyx_v_hint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_n_s_PYGAME_SDL2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/display.pyx":43 * * if str(hint).startswith("PYGAME_SDL2"): * _pygame_hints[str(hint)] = str(value) # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = __Pyx_PyObject_Str(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Str(__pyx_v_hint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_t_1) < 0))) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":44 * if str(hint).startswith("PYGAME_SDL2"): * _pygame_hints[str(hint)] = str(value) * return # <<<<<<<<<<<<<< * * if not isinstance(hint, bytes): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":42 * def hint(hint, value, priority=1): * * if str(hint).startswith("PYGAME_SDL2"): # <<<<<<<<<<<<<< * _pygame_hints[str(hint)] = str(value) * return */ } /* "pygame_sdl2/display.pyx":46 * return * * if not isinstance(hint, bytes): # <<<<<<<<<<<<<< * hint = hint.encode("utf-8") * */ __pyx_t_5 = PyBytes_Check(__pyx_v_hint); __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { /* "pygame_sdl2/display.pyx":47 * * if not isinstance(hint, bytes): * hint = hint.encode("utf-8") # <<<<<<<<<<<<<< * * if not isinstance(value, bytes): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hint, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_hint, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":46 * return * * if not isinstance(hint, bytes): # <<<<<<<<<<<<<< * hint = hint.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":49 * hint = hint.encode("utf-8") * * if not isinstance(value, bytes): # <<<<<<<<<<<<<< * value = value.encode("utf-8") * */ __pyx_t_6 = PyBytes_Check(__pyx_v_value); __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { /* "pygame_sdl2/display.pyx":50 * * if not isinstance(value, bytes): * value = value.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetHintWithPriority(hint, value, priority) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":49 * hint = hint.encode("utf-8") * * if not isinstance(value, bytes): # <<<<<<<<<<<<<< * value = value.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":52 * value = value.encode("utf-8") * * SDL_SetHintWithPriority(hint, value, priority) # <<<<<<<<<<<<<< * * def _get_hint(hint, default): */ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_hint); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) __pyx_t_9 = ((SDL_HintPriority)__Pyx_PyInt_As_SDL_HintPriority(__pyx_v_priority)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) (void)(SDL_SetHintWithPriority(__pyx_t_7, __pyx_t_8, __pyx_t_9)); /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value, priority=1): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_hint); __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":54 * SDL_SetHintWithPriority(hint, value, priority) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_3_get_hint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_2_get_hint, "_get_hint(hint, default)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_3_get_hint = {"_get_hint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_3_get_hint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_2_get_hint}; static PyObject *__pyx_pw_11pygame_sdl2_7display_3_get_hint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_hint = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_hint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hint,&__pyx_n_s_default,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hint)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_get_hint", 1, 2, 2, 1); __PYX_ERR(0, 54, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_hint") < 0)) __PYX_ERR(0, 54, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_hint = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_get_hint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 54, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display._get_hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_2_get_hint(__pyx_self, __pyx_v_hint, __pyx_v_default); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_2_get_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_hint", 0); __Pyx_INCREF(__pyx_v_hint); /* "pygame_sdl2/display.pyx":55 * * def _get_hint(hint, default): * hint = str(hint) # <<<<<<<<<<<<<< * * if hint in _pygame_hints: */ __pyx_t_1 = __Pyx_PyObject_Str(__pyx_v_hint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_hint, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":57 * hint = str(hint) * * if hint in _pygame_hints: # <<<<<<<<<<<<<< * return _pygame_hints[hint] * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_hint, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":58 * * if hint in _pygame_hints: * return _pygame_hints[hint] # <<<<<<<<<<<<<< * * if hint in os.environ: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_hint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":57 * hint = str(hint) * * if hint in _pygame_hints: # <<<<<<<<<<<<<< * return _pygame_hints[hint] * */ } /* "pygame_sdl2/display.pyx":60 * return _pygame_hints[hint] * * if hint in os.environ: # <<<<<<<<<<<<<< * return os.environ[hint] * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_hint, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":61 * * if hint in os.environ: * return os.environ[hint] # <<<<<<<<<<<<<< * * return default */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_hint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":60 * return _pygame_hints[hint] * * if hint in os.environ: # <<<<<<<<<<<<<< * return os.environ[hint] * */ } /* "pygame_sdl2/display.pyx":63 * return os.environ[hint] * * return default # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; /* "pygame_sdl2/display.pyx":54 * SDL_SetHintWithPriority(hint, value, priority) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display._get_hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_hint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":68 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_5sdl_main_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_4sdl_main_init, "sdl_main_init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_5sdl_main_init = {"sdl_main_init", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_5sdl_main_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_4sdl_main_init}; static PyObject *__pyx_pw_11pygame_sdl2_7display_5sdl_main_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sdl_main_init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_4sdl_main_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_4sdl_main_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sdl_main_init", 1); /* "pygame_sdl2/display.pyx":71 * global main_done * * if main_done: # <<<<<<<<<<<<<< * return * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_main_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":72 * * if main_done: * return # <<<<<<<<<<<<<< * * SDL_SetMainReady() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":71 * global main_done * * if main_done: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":74 * return * * SDL_SetMainReady() # <<<<<<<<<<<<<< * * if SDL_Init(0): */ SDL_SetMainReady(); /* "pygame_sdl2/display.pyx":76 * SDL_SetMainReady() * * if SDL_Init(0): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (SDL_Init(0) != 0); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/display.pyx":77 * * if SDL_Init(0): * raise error() # <<<<<<<<<<<<<< * * main_done = True */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 77, __pyx_L1_error) /* "pygame_sdl2/display.pyx":76 * SDL_SetMainReady() * * if SDL_Init(0): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":79 * raise error() * * main_done = True # <<<<<<<<<<<<<< * * # True if init has been called without quit being called. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_main_done, Py_True) < 0) __PYX_ERR(0, 79, __pyx_L1_error) /* "pygame_sdl2/display.pyx":68 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.sdl_main_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":84 * init_done = False * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_7init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_7init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_7init, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_6init}; static PyObject *__pyx_pw_11pygame_sdl2_7display_7init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/display.pyx":87 * def init(): * * if init_done: # <<<<<<<<<<<<<< * return * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_init_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":88 * * if init_done: * return # <<<<<<<<<<<<<< * * sdl_main_init() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":87 * def init(): * * if init_done: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":90 * return * * sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_VIDEO): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":92 * sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_VIDEO): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (SDL_InitSubSystem(SDL_INIT_VIDEO) != 0); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/display.pyx":93 * * if SDL_InitSubSystem(SDL_INIT_VIDEO): * raise error() # <<<<<<<<<<<<<< * * pygame_sdl2.event.init() */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 93, __pyx_L1_error) /* "pygame_sdl2/display.pyx":92 * sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_VIDEO): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":95 * raise error() * * pygame_sdl2.event.init() # <<<<<<<<<<<<<< * * global init_done */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_event); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":98 * * global init_done * init_done = True # <<<<<<<<<<<<<< * * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_done, Py_True) < 0) __PYX_ERR(0, 98, __pyx_L1_error) /* "pygame_sdl2/display.pyx":84 * init_done = False * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":102 * * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_9quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_8quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_9quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_9quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_8quit}; static PyObject *__pyx_pw_11pygame_sdl2_7display_9quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_8quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_8quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/display.pyx":108 * global main_window * * if main_window: # <<<<<<<<<<<<<< * main_window.destroy() * main_window = None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 108, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":109 * * if main_window: * main_window.destroy() # <<<<<<<<<<<<<< * main_window = None * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":110 * if main_window: * main_window.destroy() * main_window = None # <<<<<<<<<<<<<< * * */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/display.pyx":108 * global main_window * * if main_window: # <<<<<<<<<<<<<< * main_window.destroy() * main_window = None */ } /* "pygame_sdl2/display.pyx":113 * * * SDL_QuitSubSystem(SDL_INIT_VIDEO) # <<<<<<<<<<<<<< * * init_done = False */ SDL_QuitSubSystem(SDL_INIT_VIDEO); /* "pygame_sdl2/display.pyx":115 * SDL_QuitSubSystem(SDL_INIT_VIDEO) * * init_done = False # <<<<<<<<<<<<<< * * def get_init(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_done, Py_False) < 0) __PYX_ERR(0, 115, __pyx_L1_error) /* "pygame_sdl2/display.pyx":102 * * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.quit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_11get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_10get_init, "get_init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_11get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_11get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_10get_init}; static PyObject *__pyx_pw_11pygame_sdl2_7display_11get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_10get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_10get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/display.pyx":118 * * def get_init(): * return init_done # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_init_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":131 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED), Surface shape=None): # <<<<<<<<<<<<<< * cdef SDL_WindowShapeMode shape_mode * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7display_6Window_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_7display_6Window_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_title = 0; PyObject *__pyx_v_resolution = 0; PyObject *__pyx_v_flags = 0; CYTHON_UNUSED PyObject *__pyx_v_depth = 0; PyObject *__pyx_v_pos = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_shape = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_title,&__pyx_n_s_resolution,&__pyx_n_s_flags,&__pyx_n_s_depth,&__pyx_n_s_pos,&__pyx_n_s_shape,0}; values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_tuple_)); values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_0)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_0)); values[4] = __Pyx_Arg_NewRef_VARARGS(__pyx_k__2); values[5] = __Pyx_Arg_NewRef_VARARGS((PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_title)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_resolution); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depth); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos); if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shape); if (value) { values[5] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 131, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_title = values[0]; __pyx_v_resolution = values[1]; __pyx_v_flags = values[2]; __pyx_v_depth = values[3]; __pyx_v_pos = values[4]; __pyx_v_shape = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[5]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 131, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "shape", 0))) __PYX_ERR(0, 131, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window___init__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_title, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos, __pyx_v_shape); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7display_6Window___init__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth, PyObject *__pyx_v_pos, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_shape) { SDL_WindowShapeMode __pyx_v_shape_mode; long __pyx_v_gl_flag; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Uint32 __pyx_t_7; char const *__pyx_t_8; char const *__pyx_t_9; unsigned int __pyx_t_10; unsigned int __pyx_t_11; unsigned int __pyx_t_12; unsigned int __pyx_t_13; char const *__pyx_t_14; int __pyx_t_15; int __pyx_t_16; int __pyx_t_17; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_title); __Pyx_INCREF(__pyx_v_flags); /* "pygame_sdl2/display.pyx":134 * cdef SDL_WindowShapeMode shape_mode * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ __pyx_t_1 = PyBytes_Check(__pyx_v_title); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":135 * * if not isinstance(title, bytes): * title = title.encode("utf-8") # <<<<<<<<<<<<<< * * self.create_flags = flags */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_utf_8}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":134 * cdef SDL_WindowShapeMode shape_mode * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":137 * title = title.encode("utf-8") * * self.create_flags = flags # <<<<<<<<<<<<<< * * # If we do not get the AVOID_GL hint, we always create a GL-compatible */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_flags); if (unlikely((__pyx_t_7 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error) __pyx_v_self->create_flags = __pyx_t_7; /* "pygame_sdl2/display.pyx":141 * # If we do not get the AVOID_GL hint, we always create a GL-compatible * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<< * gl_flag = 0 * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_hint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":142 * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): * gl_flag = 0 # <<<<<<<<<<<<<< * else: * gl_flag = SDL_WINDOW_OPENGL */ __pyx_v_gl_flag = 0; /* "pygame_sdl2/display.pyx":141 * # If we do not get the AVOID_GL hint, we always create a GL-compatible * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<< * gl_flag = 0 * else: */ goto __pyx_L4; } /* "pygame_sdl2/display.pyx":144 * gl_flag = 0 * else: * gl_flag = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * * self.window = NULL */ /*else*/ { __pyx_v_gl_flag = SDL_WINDOW_OPENGL; } __pyx_L4:; /* "pygame_sdl2/display.pyx":146 * gl_flag = SDL_WINDOW_OPENGL * * self.window = NULL # <<<<<<<<<<<<<< * * if androidembed is not None: */ __pyx_v_self->window = NULL; /* "pygame_sdl2/display.pyx":148 * self.window = NULL * * if androidembed is not None: # <<<<<<<<<<<<<< * self.window = SDL_GL_GetCurrentWindow() * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_androidembed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__pyx_t_3 != Py_None); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":149 * * if androidembed is not None: * self.window = SDL_GL_GetCurrentWindow() # <<<<<<<<<<<<<< * * if self.window: */ __pyx_v_self->window = SDL_GL_GetCurrentWindow(); /* "pygame_sdl2/display.pyx":151 * self.window = SDL_GL_GetCurrentWindow() * * if self.window: # <<<<<<<<<<<<<< * * # Android bug - a RGB_565 format is likely to mean the window */ __pyx_t_2 = (__pyx_v_self->window != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":155 * # Android bug - a RGB_565 format is likely to mean the window * # wasn't created properly, so re-make it. * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: # <<<<<<<<<<<<<< * SDL_DestroyWindow(self.window) * self.window = NULL */ __pyx_t_2 = (SDL_GetWindowPixelFormat(__pyx_v_self->window) == SDL_PIXELFORMAT_RGB565); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":156 * # wasn't created properly, so re-make it. * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: * SDL_DestroyWindow(self.window) # <<<<<<<<<<<<<< * self.window = NULL * else: */ SDL_DestroyWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":157 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: * SDL_DestroyWindow(self.window) * self.window = NULL # <<<<<<<<<<<<<< * else: * SDL_SetWindowTitle(self.window, title) */ __pyx_v_self->window = NULL; /* "pygame_sdl2/display.pyx":155 * # Android bug - a RGB_565 format is likely to mean the window * # wasn't created properly, so re-make it. * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: # <<<<<<<<<<<<<< * SDL_DestroyWindow(self.window) * self.window = NULL */ goto __pyx_L7; } /* "pygame_sdl2/display.pyx":159 * self.window = NULL * else: * SDL_SetWindowTitle(self.window, title) # <<<<<<<<<<<<<< * * if not self.window: */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) SDL_SetWindowTitle(__pyx_v_self->window, __pyx_t_8); } __pyx_L7:; /* "pygame_sdl2/display.pyx":151 * self.window = SDL_GL_GetCurrentWindow() * * if self.window: # <<<<<<<<<<<<<< * * # Android bug - a RGB_565 format is likely to mean the window */ } /* "pygame_sdl2/display.pyx":148 * self.window = NULL * * if androidembed is not None: # <<<<<<<<<<<<<< * self.window = SDL_GL_GetCurrentWindow() * */ } /* "pygame_sdl2/display.pyx":161 * SDL_SetWindowTitle(self.window, title) * * if not self.window: # <<<<<<<<<<<<<< * * flags |= SDL_WINDOW_HIDDEN */ __pyx_t_2 = (!(__pyx_v_self->window != 0)); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":163 * if not self.window: * * flags |= SDL_WINDOW_HIDDEN # <<<<<<<<<<<<<< * * if shape is not None: */ __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_HIDDEN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_InPlaceOr(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":165 * flags |= SDL_WINDOW_HIDDEN * * if shape is not None: # <<<<<<<<<<<<<< * * shape_mode.mode = ShapeModeDefault */ __pyx_t_2 = (((PyObject *)__pyx_v_shape) != Py_None); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":167 * if shape is not None: * * shape_mode.mode = ShapeModeDefault # <<<<<<<<<<<<<< * * self.window = SDL_CreateShapedWindow( */ __pyx_v_shape_mode.mode = ShapeModeDefault; /* "pygame_sdl2/display.pyx":170 * * self.window = SDL_CreateShapedWindow( * title, # <<<<<<<<<<<<<< * pos[0], pos[1], * resolution[0], resolution[1], flags | gl_flag) */ __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L1_error) /* "pygame_sdl2/display.pyx":171 * self.window = SDL_CreateShapedWindow( * title, * pos[0], pos[1], # <<<<<<<<<<<<<< * resolution[0], resolution[1], flags | gl_flag) * */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_11 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":172 * title, * pos[0], pos[1], * resolution[0], resolution[1], flags | gl_flag) # <<<<<<<<<<<<<< * * SDL_SetWindowShape(self.window, shape.surface, &shape_mode) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_resolution, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_12 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_resolution, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_gl_flag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Or(__pyx_v_flags, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_7 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":169 * shape_mode.mode = ShapeModeDefault * * self.window = SDL_CreateShapedWindow( # <<<<<<<<<<<<<< * title, * pos[0], pos[1], */ __pyx_v_self->window = SDL_CreateShapedWindow(__pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_7); /* "pygame_sdl2/display.pyx":174 * resolution[0], resolution[1], flags | gl_flag) * * SDL_SetWindowShape(self.window, shape.surface, &shape_mode) # <<<<<<<<<<<<<< * * else: */ (void)(SDL_SetWindowShape(__pyx_v_self->window, __pyx_v_shape->surface, (&__pyx_v_shape_mode))); /* "pygame_sdl2/display.pyx":165 * flags |= SDL_WINDOW_HIDDEN * * if shape is not None: # <<<<<<<<<<<<<< * * shape_mode.mode = ShapeModeDefault */ goto __pyx_L9; } /* "pygame_sdl2/display.pyx":178 * else: * * self.window = SDL_CreateWindow( # <<<<<<<<<<<<<< * title, * pos[0], pos[1], */ /*else*/ { /* "pygame_sdl2/display.pyx":179 * * self.window = SDL_CreateWindow( * title, # <<<<<<<<<<<<<< * pos[0], pos[1], * resolution[0], resolution[1], flags | gl_flag) */ __pyx_t_14 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error) /* "pygame_sdl2/display.pyx":180 * self.window = SDL_CreateWindow( * title, * pos[0], pos[1], # <<<<<<<<<<<<<< * resolution[0], resolution[1], flags | gl_flag) * */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":181 * title, * pos[0], pos[1], * resolution[0], resolution[1], flags | gl_flag) # <<<<<<<<<<<<<< * * if pos != (SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED): */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_gl_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Or(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_7 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":178 * else: * * self.window = SDL_CreateWindow( # <<<<<<<<<<<<<< * title, * pos[0], pos[1], */ __pyx_v_self->window = SDL_CreateWindow(__pyx_t_14, __pyx_t_6, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_7); } __pyx_L9:; /* "pygame_sdl2/display.pyx":183 * resolution[0], resolution[1], flags | gl_flag) * * if pos != (SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED): # <<<<<<<<<<<<<< * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * */ __pyx_t_4 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_v_pos, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":184 * * if pos != (SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED): * SDL_SetWindowPosition(self.window, pos[0], pos[1]) # <<<<<<<<<<<<<< * * SDL_ShowWindow(self.window) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; SDL_SetWindowPosition(__pyx_v_self->window, __pyx_t_17, __pyx_t_16); /* "pygame_sdl2/display.pyx":183 * resolution[0], resolution[1], flags | gl_flag) * * if pos != (SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED): # <<<<<<<<<<<<<< * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * */ } /* "pygame_sdl2/display.pyx":186 * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * * SDL_ShowWindow(self.window) # <<<<<<<<<<<<<< * * if not self.window: */ SDL_ShowWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":161 * SDL_SetWindowTitle(self.window, title) * * if not self.window: # <<<<<<<<<<<<<< * * flags |= SDL_WINDOW_HIDDEN */ } /* "pygame_sdl2/display.pyx":188 * SDL_ShowWindow(self.window) * * if not self.window: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (!(__pyx_v_self->window != 0)); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/display.pyx":189 * * if not self.window: * raise error() # <<<<<<<<<<<<<< * * # From here on, the window exists. So we have to call self.destroy if */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_16 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_16 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_16, 0+__pyx_t_16); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 189, __pyx_L1_error) /* "pygame_sdl2/display.pyx":188 * SDL_ShowWindow(self.window) * * if not self.window: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":194 * # an exception occurs. * * try: # <<<<<<<<<<<<<< * * if flags & SDL_WINDOW_OPENGL: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); /*try:*/ { /* "pygame_sdl2/display.pyx":196 * try: * * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<< * * self.gl_context = SDL_GL_CreateContext(self.window) */ __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 196, __pyx_L12_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":198 * if flags & SDL_WINDOW_OPENGL: * * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<< * * if self.gl_context == NULL: */ __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":200 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_self->gl_context == NULL); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/display.pyx":201 * * if self.gl_context == NULL: * raise error() # <<<<<<<<<<<<<< * * SDL_GL_MakeCurrent(self.window, self.gl_context) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_16 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_16 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_16, 0+__pyx_t_16); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 201, __pyx_L12_error) /* "pygame_sdl2/display.pyx":200 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":203 * raise error() * * SDL_GL_MakeCurrent(self.window, self.gl_context) # <<<<<<<<<<<<<< * * if not ios: */ (void)(SDL_GL_MakeCurrent(__pyx_v_self->window, __pyx_v_self->gl_context)); /* "pygame_sdl2/display.pyx":205 * SDL_GL_MakeCurrent(self.window, self.gl_context) * * if not ios: # <<<<<<<<<<<<<< * # Try setting the swap interval - first positive, then negated * # to deal with the case where the negative interval isn't */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ios); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 205, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 205, __pyx_L12_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = (!__pyx_t_2); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":209 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<< * if default_swap_control < 0: * SDL_GL_SetSwapInterval(-default_swap_control) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L12_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = (SDL_GL_SetSwapInterval(__pyx_t_16) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":210 * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): * if default_swap_control < 0: # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-default_swap_control) * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L12_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 210, __pyx_L12_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":211 * if SDL_GL_SetSwapInterval(default_swap_control): * if default_swap_control < 0: * SDL_GL_SetSwapInterval(-default_swap_control) # <<<<<<<<<<<<<< * * self.create_surface() */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 211, __pyx_L12_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (void)(SDL_GL_SetSwapInterval(__pyx_t_16)); /* "pygame_sdl2/display.pyx":210 * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): * if default_swap_control < 0: # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-default_swap_control) * */ } /* "pygame_sdl2/display.pyx":209 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<< * if default_swap_control < 0: * SDL_GL_SetSwapInterval(-default_swap_control) */ } /* "pygame_sdl2/display.pyx":205 * SDL_GL_MakeCurrent(self.window, self.gl_context) * * if not ios: # <<<<<<<<<<<<<< * # Try setting the swap interval - first positive, then negated * # to deal with the case where the negative interval isn't */ } /* "pygame_sdl2/display.pyx":196 * try: * * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<< * * self.gl_context = SDL_GL_CreateContext(self.window) */ } /* "pygame_sdl2/display.pyx":213 * SDL_GL_SetSwapInterval(-default_swap_control) * * self.create_surface() # <<<<<<<<<<<<<< * * except: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_16 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_16 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_16, 0+__pyx_t_16); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":194 * # an exception occurs. * * try: # <<<<<<<<<<<<<< * * if flags & SDL_WINDOW_OPENGL: */ } __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; goto __pyx_L17_try_end; __pyx_L12_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":215 * self.create_surface() * * except: # <<<<<<<<<<<<<< * self.destroy() * raise */ /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 215, __pyx_L14_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":216 * * except: * self.destroy() # <<<<<<<<<<<<<< * raise * */ __pyx_t_22 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 216, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_23 = NULL; __pyx_t_16 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_22))) { __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_22); if (likely(__pyx_t_23)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22); __Pyx_INCREF(__pyx_t_23); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_22, function); __pyx_t_16 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_23, NULL}; __pyx_t_21 = __Pyx_PyObject_FastCall(__pyx_t_22, __pyx_callargs+1-__pyx_t_16, 0+__pyx_t_16); __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 216, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; } __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; /* "pygame_sdl2/display.pyx":217 * except: * self.destroy() * raise # <<<<<<<<<<<<<< * * def create_surface(self): */ __Pyx_GIVEREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_3, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 217, __pyx_L14_except_error) } /* "pygame_sdl2/display.pyx":194 * # an exception occurs. * * try: # <<<<<<<<<<<<<< * * if flags & SDL_WINDOW_OPENGL: */ __pyx_L14_except_error:; __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); goto __pyx_L1_error; __pyx_L17_try_end:; } /* "pygame_sdl2/display.pyx":131 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED), Surface shape=None): # <<<<<<<<<<<<<< * cdef SDL_WindowShapeMode shape_mode * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_21); __Pyx_XDECREF(__pyx_t_22); __Pyx_XDECREF(__pyx_t_23); __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_title); __Pyx_XDECREF(__pyx_v_flags); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":219 * raise * * def create_surface(self): # <<<<<<<<<<<<<< * """ * Creates the surface associated with this window. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_2create_surface, "Window.create_surface(self)\n\n Creates the surface associated with this window.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_3create_surface = {"create_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_2create_surface}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create_surface (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("create_surface", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "create_surface", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; SDL_Surface *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_surface", 1); /* "pygame_sdl2/display.pyx":225 * * cdef int w, h * SDL_GetWindowSize(self.window, &w, &h) # <<<<<<<<<<<<<< * * if self.gl_context: */ SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h)); /* "pygame_sdl2/display.pyx":227 * SDL_GetWindowSize(self.window, &w, &h) * * if self.gl_context: # <<<<<<<<<<<<<< * * # For now, make this the size of the window so get_size() works. */ __pyx_t_1 = (__pyx_v_self->gl_context != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":232 * # TODO: Make this a bit less wasteful of memory, even if it means * # we lie about the actual size of the pixel array. * self.surface = Surface((w, h), SRCALPHA, 32) # <<<<<<<<<<<<<< * * else: */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error); __Pyx_INCREF(__pyx_int_32); __Pyx_GIVEREF(__pyx_int_32); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32)) __PYX_ERR(0, 232, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF((PyObject *)__pyx_v_self->surface); __Pyx_DECREF((PyObject *)__pyx_v_self->surface); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":227 * SDL_GetWindowSize(self.window, &w, &h) * * if self.gl_context: # <<<<<<<<<<<<<< * * # For now, make this the size of the window so get_size() works. */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":236 * else: * * self.window_surface = SDL_GetWindowSurface(self.window) # <<<<<<<<<<<<<< * * # If the surface is 32-bit, we can use it directly. Otherwise, */ /*else*/ { __pyx_v_self->window_surface = SDL_GetWindowSurface(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":240 * # If the surface is 32-bit, we can use it directly. Otherwise, * # we need to create a 32-bit proxy surface. * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * * self.surface = Surface(()) */ __pyx_t_1 = (__pyx_v_self->window_surface->format->BitsPerPixel == 32); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":242 * if self.window_surface.format.BitsPerPixel == 32: * * self.surface = Surface(()) # <<<<<<<<<<<<<< * self.surface.surface = self.window_surface * self.surface.owns_surface = False */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF((PyObject *)__pyx_v_self->surface); __Pyx_DECREF((PyObject *)__pyx_v_self->surface); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":243 * * self.surface = Surface(()) * self.surface.surface = self.window_surface # <<<<<<<<<<<<<< * self.surface.owns_surface = False * self.surface.window_surface = True */ __pyx_t_5 = __pyx_v_self->window_surface; __pyx_v_self->surface->surface = __pyx_t_5; /* "pygame_sdl2/display.pyx":244 * self.surface = Surface(()) * self.surface.surface = self.window_surface * self.surface.owns_surface = False # <<<<<<<<<<<<<< * self.surface.window_surface = True * */ __pyx_v_self->surface->owns_surface = 0; /* "pygame_sdl2/display.pyx":245 * self.surface.surface = self.window_surface * self.surface.owns_surface = False * self.surface.window_surface = True # <<<<<<<<<<<<<< * * else: */ __pyx_v_self->surface->window_surface = 1; /* "pygame_sdl2/display.pyx":240 * # If the surface is 32-bit, we can use it directly. Otherwise, * # we need to create a 32-bit proxy surface. * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * * self.surface = Surface(()) */ goto __pyx_L4; } /* "pygame_sdl2/display.pyx":248 * * else: * self.surface = Surface((w, h), 0, 32) # <<<<<<<<<<<<<< * * self.surface.get_window_flags = self.get_window_flags */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0)) __PYX_ERR(0, 248, __pyx_L1_error); __Pyx_INCREF(__pyx_int_32); __Pyx_GIVEREF(__pyx_int_32); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32)) __PYX_ERR(0, 248, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF((PyObject *)__pyx_v_self->surface); __Pyx_DECREF((PyObject *)__pyx_v_self->surface); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L4:; } __pyx_L3:; /* "pygame_sdl2/display.pyx":250 * self.surface = Surface((w, h), 0, 32) * * self.surface.get_window_flags = self.get_window_flags # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_window_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags); __Pyx_DECREF(__pyx_v_self->surface->get_window_flags); __pyx_v_self->surface->get_window_flags = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":219 * raise * * def create_surface(self): # <<<<<<<<<<<<<< * """ * Creates the surface associated with this window. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.create_surface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":253 * * * def destroy(self): # <<<<<<<<<<<<<< * """ * This should be called before the window is deleted. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_4destroy, "Window.destroy(self)\n\n This should be called before the window is deleted.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_5destroy = {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_4destroy}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_4destroy(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_4destroy(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "pygame_sdl2/display.pyx":258 * """ * * if self.gl_context != NULL: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * */ __pyx_t_1 = (__pyx_v_self->gl_context != NULL); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":259 * * if self.gl_context != NULL: * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<< * * if self.surface: */ SDL_GL_DeleteContext(__pyx_v_self->gl_context); /* "pygame_sdl2/display.pyx":258 * """ * * if self.gl_context != NULL: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * */ } /* "pygame_sdl2/display.pyx":261 * SDL_GL_DeleteContext(self.gl_context) * * if self.surface: # <<<<<<<<<<<<<< * * # Break the cycle that prevents refcounting from collecting this */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->surface)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 261, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":265 * # Break the cycle that prevents refcounting from collecting this * # object. * self.surface.get_window_flags = None # <<<<<<<<<<<<<< * * # Necessary to collect the GL surface, doesn't hurt the window surface. */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags); __Pyx_DECREF(__pyx_v_self->surface->get_window_flags); __pyx_v_self->surface->get_window_flags = Py_None; /* "pygame_sdl2/display.pyx":268 * * # Necessary to collect the GL surface, doesn't hurt the window surface. * self.surface = None # <<<<<<<<<<<<<< * * SDL_DestroyWindow(self.window) */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF((PyObject *)__pyx_v_self->surface); __Pyx_DECREF((PyObject *)__pyx_v_self->surface); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); /* "pygame_sdl2/display.pyx":261 * SDL_GL_DeleteContext(self.gl_context) * * if self.surface: # <<<<<<<<<<<<<< * * # Break the cycle that prevents refcounting from collecting this */ } /* "pygame_sdl2/display.pyx":270 * self.surface = None * * SDL_DestroyWindow(self.window) # <<<<<<<<<<<<<< * * def resize(self, size, opengl=False, fullscreen=None, maximized=None): */ SDL_DestroyWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":253 * * * def destroy(self): # <<<<<<<<<<<<<< * """ * This should be called before the window is deleted. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":272 * SDL_DestroyWindow(self.window) * * def resize(self, size, opengl=False, fullscreen=None, maximized=None): # <<<<<<<<<<<<<< * """ * Resizes the window to `size`, which must be a width, height tuple. If opengl */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7resize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_6resize, "Window.resize(self, size, opengl=False, fullscreen=None, maximized=None)\n\n Resizes the window to `size`, which must be a width, height tuple. If opengl\n is true, adds an OpenGL context, if it's missing. Otherwise, removes the\n opengl context if present.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_7resize = {"resize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_7resize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_6resize}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7resize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_opengl = 0; PyObject *__pyx_v_fullscreen = 0; PyObject *__pyx_v_maximized = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("resize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_opengl,&__pyx_n_s_fullscreen,&__pyx_n_s_maximized,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_opengl); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fullscreen); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maximized); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "resize") < 0)) __PYX_ERR(0, 272, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_opengl = values[1]; __pyx_v_fullscreen = values[2]; __pyx_v_maximized = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("resize", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 272, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.resize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_6resize(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_size, __pyx_v_opengl, __pyx_v_fullscreen, __pyx_v_maximized); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_6resize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_opengl, PyObject *__pyx_v_fullscreen, PyObject *__pyx_v_maximized) { Uint32 __pyx_v_flags; int __pyx_v_cur_width; int __pyx_v_cur_height; PyObject *__pyx_v_width = NULL; PyObject *__pyx_v_height = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("resize", 0); __Pyx_INCREF(__pyx_v_fullscreen); __Pyx_INCREF(__pyx_v_maximized); /* "pygame_sdl2/display.pyx":279 * """ * * flags = SDL_GetWindowFlags(self.window) # <<<<<<<<<<<<<< * * if fullscreen is None: */ __pyx_v_flags = SDL_GetWindowFlags(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":281 * flags = SDL_GetWindowFlags(self.window) * * if fullscreen is None: # <<<<<<<<<<<<<< * fullscreen = flags & SDL_WINDOW_FULLSCREEN_DESKTOP * */ __pyx_t_1 = (__pyx_v_fullscreen == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":282 * * if fullscreen is None: * fullscreen = flags & SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<< * * if maximized is None: */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_flags & SDL_WINDOW_FULLSCREEN_DESKTOP)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_fullscreen, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":281 * flags = SDL_GetWindowFlags(self.window) * * if fullscreen is None: # <<<<<<<<<<<<<< * fullscreen = flags & SDL_WINDOW_FULLSCREEN_DESKTOP * */ } /* "pygame_sdl2/display.pyx":284 * fullscreen = flags & SDL_WINDOW_FULLSCREEN_DESKTOP * * if maximized is None: # <<<<<<<<<<<<<< * maximized = flags & SDL_WINDOW_MAXIMIZED * */ __pyx_t_1 = (__pyx_v_maximized == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":285 * * if maximized is None: * maximized = flags & SDL_WINDOW_MAXIMIZED # <<<<<<<<<<<<<< * * if fullscreen: */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_flags & SDL_WINDOW_MAXIMIZED)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_maximized, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":284 * fullscreen = flags & SDL_WINDOW_FULLSCREEN_DESKTOP * * if maximized is None: # <<<<<<<<<<<<<< * maximized = flags & SDL_WINDOW_MAXIMIZED * */ } /* "pygame_sdl2/display.pyx":287 * maximized = flags & SDL_WINDOW_MAXIMIZED * * if fullscreen: # <<<<<<<<<<<<<< * maximized = False * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 287, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":288 * * if fullscreen: * maximized = False # <<<<<<<<<<<<<< * * # Prevents a loop between the surface and this object. */ __Pyx_INCREF(Py_False); __Pyx_DECREF_SET(__pyx_v_maximized, Py_False); /* "pygame_sdl2/display.pyx":287 * maximized = flags & SDL_WINDOW_MAXIMIZED * * if fullscreen: # <<<<<<<<<<<<<< * maximized = False * */ } /* "pygame_sdl2/display.pyx":291 * * # Prevents a loop between the surface and this object. * self.surface.get_window_flags = None # <<<<<<<<<<<<<< * * if self.gl_context and not opengl: */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags); __Pyx_DECREF(__pyx_v_self->surface->get_window_flags); __pyx_v_self->surface->get_window_flags = Py_None; /* "pygame_sdl2/display.pyx":293 * self.surface.get_window_flags = None * * if self.gl_context and not opengl: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * self.gl_context = NULL */ __pyx_t_3 = (__pyx_v_self->gl_context != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L7_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 293, __pyx_L1_error) __pyx_t_4 = (!__pyx_t_3); __pyx_t_1 = __pyx_t_4; __pyx_L7_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":294 * * if self.gl_context and not opengl: * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<< * self.gl_context = NULL * */ SDL_GL_DeleteContext(__pyx_v_self->gl_context); /* "pygame_sdl2/display.pyx":295 * if self.gl_context and not opengl: * SDL_GL_DeleteContext(self.gl_context) * self.gl_context = NULL # <<<<<<<<<<<<<< * * cdef int cur_width = 0 */ __pyx_v_self->gl_context = NULL; /* "pygame_sdl2/display.pyx":293 * self.surface.get_window_flags = None * * if self.gl_context and not opengl: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * self.gl_context = NULL */ } /* "pygame_sdl2/display.pyx":297 * self.gl_context = NULL * * cdef int cur_width = 0 # <<<<<<<<<<<<<< * cdef int cur_height = 0 * */ __pyx_v_cur_width = 0; /* "pygame_sdl2/display.pyx":298 * * cdef int cur_width = 0 * cdef int cur_height = 0 # <<<<<<<<<<<<<< * * if (not fullscreen) and (not maximized) and (flags & SDL_WINDOW_MAXIMIZED): */ __pyx_v_cur_height = 0; /* "pygame_sdl2/display.pyx":300 * cdef int cur_height = 0 * * if (not fullscreen) and (not maximized) and (flags & SDL_WINDOW_MAXIMIZED): # <<<<<<<<<<<<<< * SDL_RestoreWindow(self.window) * */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 300, __pyx_L1_error) __pyx_t_3 = (!__pyx_t_4); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L10_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_maximized); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 300, __pyx_L1_error) __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L10_bool_binop_done; } __pyx_t_4 = ((__pyx_v_flags & SDL_WINDOW_MAXIMIZED) != 0); __pyx_t_1 = __pyx_t_4; __pyx_L10_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":301 * * if (not fullscreen) and (not maximized) and (flags & SDL_WINDOW_MAXIMIZED): * SDL_RestoreWindow(self.window) # <<<<<<<<<<<<<< * * if fullscreen: */ SDL_RestoreWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":300 * cdef int cur_height = 0 * * if (not fullscreen) and (not maximized) and (flags & SDL_WINDOW_MAXIMIZED): # <<<<<<<<<<<<<< * SDL_RestoreWindow(self.window) * */ } /* "pygame_sdl2/display.pyx":303 * SDL_RestoreWindow(self.window) * * if fullscreen: # <<<<<<<<<<<<<< * * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 303, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":305 * if fullscreen: * * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * fullscreen = False * */ __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":306 * * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): * fullscreen = False # <<<<<<<<<<<<<< * * if not fullscreen: */ __Pyx_INCREF(Py_False); __Pyx_DECREF_SET(__pyx_v_fullscreen, Py_False); /* "pygame_sdl2/display.pyx":305 * if fullscreen: * * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * fullscreen = False * */ } /* "pygame_sdl2/display.pyx":303 * SDL_RestoreWindow(self.window) * * if fullscreen: # <<<<<<<<<<<<<< * * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): */ } /* "pygame_sdl2/display.pyx":308 * fullscreen = False * * if not fullscreen: # <<<<<<<<<<<<<< * SDL_SetWindowFullscreen(self.window, 0) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) __pyx_t_4 = (!__pyx_t_1); if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":309 * * if not fullscreen: * SDL_SetWindowFullscreen(self.window, 0) # <<<<<<<<<<<<<< * * if (not fullscreen) and (not maximized): */ (void)(SDL_SetWindowFullscreen(__pyx_v_self->window, 0)); /* "pygame_sdl2/display.pyx":308 * fullscreen = False * * if not fullscreen: # <<<<<<<<<<<<<< * SDL_SetWindowFullscreen(self.window, 0) * */ } /* "pygame_sdl2/display.pyx":311 * SDL_SetWindowFullscreen(self.window, 0) * * if (not fullscreen) and (not maximized): # <<<<<<<<<<<<<< * * width, height = size */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 311, __pyx_L1_error) __pyx_t_3 = (!__pyx_t_1); if (__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L17_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_maximized); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 311, __pyx_L1_error) __pyx_t_1 = (!__pyx_t_3); __pyx_t_4 = __pyx_t_1; __pyx_L17_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":313 * if (not fullscreen) and (not maximized): * * width, height = size # <<<<<<<<<<<<<< * * SDL_GetWindowSize(self.window, &cur_width, &cur_height) */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 313, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 313, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L20_unpacking_done; __pyx_L19_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 313, __pyx_L1_error) __pyx_L20_unpacking_done:; } __pyx_v_width = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_height = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":315 * width, height = size * * SDL_GetWindowSize(self.window, &cur_width, &cur_height) # <<<<<<<<<<<<<< * * if (cur_width != width) or (cur_height != height): */ SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_cur_width), (&__pyx_v_cur_height)); /* "pygame_sdl2/display.pyx":317 * SDL_GetWindowSize(self.window, &cur_width, &cur_height) * * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<< * SDL_SetWindowSize(self.window, width, height) * */ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_cur_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_v_width, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_1) { } else { __pyx_t_4 = __pyx_t_1; goto __pyx_L22_bool_binop_done; } __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_cur_height); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_v_height, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __pyx_t_1; __pyx_L22_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":318 * * if (cur_width != width) or (cur_height != height): * SDL_SetWindowSize(self.window, width, height) # <<<<<<<<<<<<<< * * if maximized: */ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L1_error) __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_height); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L1_error) SDL_SetWindowSize(__pyx_v_self->window, __pyx_t_8, __pyx_t_9); /* "pygame_sdl2/display.pyx":317 * SDL_GetWindowSize(self.window, &cur_width, &cur_height) * * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<< * SDL_SetWindowSize(self.window, width, height) * */ } /* "pygame_sdl2/display.pyx":311 * SDL_SetWindowFullscreen(self.window, 0) * * if (not fullscreen) and (not maximized): # <<<<<<<<<<<<<< * * width, height = size */ } /* "pygame_sdl2/display.pyx":320 * SDL_SetWindowSize(self.window, width, height) * * if maximized: # <<<<<<<<<<<<<< * SDL_MaximizeWindow(self.window) * */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_maximized); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 320, __pyx_L1_error) if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":321 * * if maximized: * SDL_MaximizeWindow(self.window) # <<<<<<<<<<<<<< * * # Create a missing GL context. */ SDL_MaximizeWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":320 * SDL_SetWindowSize(self.window, width, height) * * if maximized: # <<<<<<<<<<<<<< * SDL_MaximizeWindow(self.window) * */ } /* "pygame_sdl2/display.pyx":324 * * # Create a missing GL context. * if opengl and not self.gl_context: # <<<<<<<<<<<<<< * self.gl_context = SDL_GL_CreateContext(self.window) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 324, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_4 = __pyx_t_1; goto __pyx_L26_bool_binop_done; } __pyx_t_1 = (!(__pyx_v_self->gl_context != 0)); __pyx_t_4 = __pyx_t_1; __pyx_L26_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":325 * # Create a missing GL context. * if opengl and not self.gl_context: * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<< * * if self.gl_context == NULL: */ __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":327 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = (__pyx_v_self->gl_context == NULL); if (unlikely(__pyx_t_4)) { /* "pygame_sdl2/display.pyx":328 * * if self.gl_context == NULL: * raise error() # <<<<<<<<<<<<<< * * self.create_surface() */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 328, __pyx_L1_error) /* "pygame_sdl2/display.pyx":327 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":324 * * # Create a missing GL context. * if opengl and not self.gl_context: # <<<<<<<<<<<<<< * self.gl_context = SDL_GL_CreateContext(self.window) * */ } /* "pygame_sdl2/display.pyx":330 * raise error() * * self.create_surface() # <<<<<<<<<<<<<< * * def recreate_gl_context(self, always=False): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":272 * SDL_DestroyWindow(self.window) * * def resize(self, size, opengl=False, fullscreen=None, maximized=None): # <<<<<<<<<<<<<< * """ * Resizes the window to `size`, which must be a width, height tuple. If opengl */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.Window.resize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_width); __Pyx_XDECREF(__pyx_v_height); __Pyx_XDECREF(__pyx_v_fullscreen); __Pyx_XDECREF(__pyx_v_maximized); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":332 * self.create_surface() * * def recreate_gl_context(self, always=False): # <<<<<<<<<<<<<< * """ * Check to see if the GL context was lost, and re-create it if it was. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_9recreate_gl_context(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_8recreate_gl_context, "Window.recreate_gl_context(self, always=False)\n\n Check to see if the GL context was lost, and re-create it if it was.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_9recreate_gl_context = {"recreate_gl_context", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_9recreate_gl_context, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_8recreate_gl_context}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_9recreate_gl_context(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_always = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("recreate_gl_context (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_always,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_always); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "recreate_gl_context") < 0)) __PYX_ERR(0, 332, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_always = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("recreate_gl_context", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 332, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.recreate_gl_context", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_8recreate_gl_context(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_always); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_8recreate_gl_context(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_always) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("recreate_gl_context", 1); /* "pygame_sdl2/display.pyx":337 * """ * * if not always: # <<<<<<<<<<<<<< * if SDL_GL_GetCurrentContext(): * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_always); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 337, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":338 * * if not always: * if SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<< * return False * */ __pyx_t_2 = (((unsigned long)SDL_GL_GetCurrentContext()) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":339 * if not always: * if SDL_GL_GetCurrentContext(): * return False # <<<<<<<<<<<<<< * * self.gl_context = SDL_GL_CreateContext(self.window) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":338 * * if not always: * if SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/display.pyx":337 * """ * * if not always: # <<<<<<<<<<<<<< * if SDL_GL_GetCurrentContext(): * return False */ } /* "pygame_sdl2/display.pyx":341 * return False * * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<< * * if self.gl_context == NULL: */ __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":343 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_self->gl_context == NULL); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/display.pyx":344 * * if self.gl_context == NULL: * raise error() # <<<<<<<<<<<<<< * * SDL_GL_MakeCurrent(self.window, self.gl_context) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 344, __pyx_L1_error) /* "pygame_sdl2/display.pyx":343 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":346 * raise error() * * SDL_GL_MakeCurrent(self.window, self.gl_context) # <<<<<<<<<<<<<< * * return True */ (void)(SDL_GL_MakeCurrent(__pyx_v_self->window, __pyx_v_self->gl_context)); /* "pygame_sdl2/display.pyx":348 * SDL_GL_MakeCurrent(self.window, self.gl_context) * * return True # <<<<<<<<<<<<<< * * def get_window_flags(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":332 * self.create_surface() * * def recreate_gl_context(self, always=False): # <<<<<<<<<<<<<< * """ * Check to see if the GL context was lost, and re-create it if it was. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.Window.recreate_gl_context", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":350 * return True * * def get_window_flags(self): # <<<<<<<<<<<<<< * rv = SDL_GetWindowFlags(self.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_11get_window_flags(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_10get_window_flags, "Window.get_window_flags(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_11get_window_flags = {"get_window_flags", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_11get_window_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_10get_window_flags}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_11get_window_flags(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_window_flags (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_window_flags", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_window_flags", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_10get_window_flags(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_10get_window_flags(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_window_flags", 1); /* "pygame_sdl2/display.pyx":351 * * def get_window_flags(self): * rv = SDL_GetWindowFlags(self.window) # <<<<<<<<<<<<<< * * if self.gl_context: */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetWindowFlags(__pyx_v_self->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":353 * rv = SDL_GetWindowFlags(self.window) * * if self.gl_context: # <<<<<<<<<<<<<< * rv |= SDL_WINDOW_OPENGL * else: */ __pyx_t_2 = (__pyx_v_self->gl_context != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":354 * * if self.gl_context: * rv |= SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * else: * rv &= ~SDL_WINDOW_OPENGL */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_rv, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":353 * rv = SDL_GetWindowFlags(self.window) * * if self.gl_context: # <<<<<<<<<<<<<< * rv |= SDL_WINDOW_OPENGL * else: */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":356 * rv |= SDL_WINDOW_OPENGL * else: * rv &= ~SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * * return rv */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int((~SDL_WINDOW_OPENGL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceAnd(__pyx_v_rv, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/display.pyx":358 * rv &= ~SDL_WINDOW_OPENGL * * return rv # <<<<<<<<<<<<<< * * def proxy_window_surface(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/display.pyx":350 * return True * * def get_window_flags(self): # <<<<<<<<<<<<<< * rv = SDL_GetWindowFlags(self.window) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_window_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":360 * return rv * * def proxy_window_surface(self): # <<<<<<<<<<<<<< * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_13proxy_window_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_12proxy_window_surface, "Window.proxy_window_surface(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_13proxy_window_surface = {"proxy_window_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_13proxy_window_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_12proxy_window_surface}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_13proxy_window_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("proxy_window_surface (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("proxy_window_surface", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "proxy_window_surface", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_12proxy_window_surface(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_12proxy_window_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("proxy_window_surface", 1); /* "pygame_sdl2/display.pyx":361 * * def proxy_window_surface(self): * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) # <<<<<<<<<<<<<< * * def flip(self): */ (void)(SDL_UpperBlit(__pyx_v_self->surface->surface, NULL, __pyx_v_self->window_surface, NULL)); /* "pygame_sdl2/display.pyx":360 * return rv * * def proxy_window_surface(self): # <<<<<<<<<<<<<< * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":363 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * * def flip(self): # <<<<<<<<<<<<<< * cdef const char *err * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_15flip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_14flip, "Window.flip(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_15flip = {"flip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_15flip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_14flip}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_15flip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("flip", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "flip", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_14flip(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_14flip(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { char const *__pyx_v_err; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flip", 1); /* "pygame_sdl2/display.pyx":366 * cdef const char *err * * if self.gl_context != NULL: # <<<<<<<<<<<<<< * with nogil: * SDL_ClearError(); */ __pyx_t_1 = (__pyx_v_self->gl_context != NULL); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":367 * * if self.gl_context != NULL: * with nogil: # <<<<<<<<<<<<<< * SDL_ClearError(); * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/display.pyx":368 * if self.gl_context != NULL: * with nogil: * SDL_ClearError(); # <<<<<<<<<<<<<< * * SDL_GL_SwapWindow(self.window) */ SDL_ClearError(); /* "pygame_sdl2/display.pyx":370 * SDL_ClearError(); * * SDL_GL_SwapWindow(self.window) # <<<<<<<<<<<<<< * * err = SDL_GetError() */ SDL_GL_SwapWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":372 * SDL_GL_SwapWindow(self.window) * * err = SDL_GetError() # <<<<<<<<<<<<<< * * if err[0]: */ __pyx_v_err = SDL_GetError(); } /* "pygame_sdl2/display.pyx":367 * * if self.gl_context != NULL: * with nogil: # <<<<<<<<<<<<<< * SDL_ClearError(); * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/display.pyx":374 * err = SDL_GetError() * * if err[0]: # <<<<<<<<<<<<<< * raise error(err) * */ __pyx_t_1 = ((__pyx_v_err[0]) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":375 * * if err[0]: * raise error(err) # <<<<<<<<<<<<<< * * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 375, __pyx_L1_error) /* "pygame_sdl2/display.pyx":374 * err = SDL_GetError() * * if err[0]: # <<<<<<<<<<<<<< * raise error(err) * */ } /* "pygame_sdl2/display.pyx":366 * cdef const char *err * * if self.gl_context != NULL: # <<<<<<<<<<<<<< * with nogil: * SDL_ClearError(); */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":379 * else: * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ /*else*/ { __pyx_t_1 = (__pyx_v_self->surface->surface != __pyx_v_self->window_surface); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":380 * * if self.surface.surface != self.window_surface: * self.proxy_window_surface() # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":379 * else: * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ } /* "pygame_sdl2/display.pyx":382 * self.proxy_window_surface() * * with nogil: # <<<<<<<<<<<<<< * SDL_UpdateWindowSurface(self.window) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/display.pyx":383 * * with nogil: * SDL_UpdateWindowSurface(self.window) # <<<<<<<<<<<<<< * * def get_surface(self): */ (void)(SDL_UpdateWindowSurface(__pyx_v_self->window)); } /* "pygame_sdl2/display.pyx":382 * self.proxy_window_surface() * * with nogil: # <<<<<<<<<<<<<< * SDL_UpdateWindowSurface(self.window) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } } __pyx_L3:; /* "pygame_sdl2/display.pyx":363 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * * def flip(self): # <<<<<<<<<<<<<< * cdef const char *err * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.Window.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":385 * SDL_UpdateWindowSurface(self.window) * * def get_surface(self): # <<<<<<<<<<<<<< * return self.surface * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_17get_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_16get_surface, "Window.get_surface(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_17get_surface = {"get_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_17get_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_16get_surface}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_17get_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_surface (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_surface", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_surface", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_16get_surface(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_16get_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_surface", 1); /* "pygame_sdl2/display.pyx":386 * * def get_surface(self): * return self.surface # <<<<<<<<<<<<<< * * def update(self, rectangles=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->surface); __pyx_r = ((PyObject *)__pyx_v_self->surface); goto __pyx_L0; /* "pygame_sdl2/display.pyx":385 * SDL_UpdateWindowSurface(self.window) * * def get_surface(self): # <<<<<<<<<<<<<< * return self.surface * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":388 * return self.surface * * def update(self, rectangles=None): # <<<<<<<<<<<<<< * * cdef SDL_Rect *rects */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_19update(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_18update, "Window.update(self, rectangles=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_19update = {"update", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_19update, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_18update}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_19update(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rectangles = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rectangles,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rectangles); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "update") < 0)) __PYX_ERR(0, 388, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rectangles = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 388, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_18update(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_rectangles); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_18update(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_rectangles) { SDL_Rect *__pyx_v_rects; int __pyx_v_count; PyObject *__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; char const *__pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update", 0); __Pyx_INCREF(__pyx_v_rectangles); /* "pygame_sdl2/display.pyx":391 * * cdef SDL_Rect *rects * cdef int count = 0 # <<<<<<<<<<<<<< * * if rectangles is None: */ __pyx_v_count = 0; /* "pygame_sdl2/display.pyx":393 * cdef int count = 0 * * if rectangles is None: # <<<<<<<<<<<<<< * self.flip() * return */ __pyx_t_1 = (__pyx_v_rectangles == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":394 * * if rectangles is None: * self.flip() # <<<<<<<<<<<<<< * return * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":395 * if rectangles is None: * self.flip() * return # <<<<<<<<<<<<<< * * if self.surface.surface != self.window_surface: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":393 * cdef int count = 0 * * if rectangles is None: # <<<<<<<<<<<<<< * self.flip() * return */ } /* "pygame_sdl2/display.pyx":397 * return * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ __pyx_t_1 = (__pyx_v_self->surface->surface != __pyx_v_self->window_surface); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":398 * * if self.surface.surface != self.window_surface: * self.proxy_window_surface() # <<<<<<<<<<<<<< * * if not isinstance(rectangles, list): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":397 * return * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ } /* "pygame_sdl2/display.pyx":400 * self.proxy_window_surface() * * if not isinstance(rectangles, list): # <<<<<<<<<<<<<< * rectangles = [ rectangles ] * */ __pyx_t_1 = PyList_Check(__pyx_v_rectangles); __pyx_t_6 = (!__pyx_t_1); if (__pyx_t_6) { /* "pygame_sdl2/display.pyx":401 * * if not isinstance(rectangles, list): * rectangles = [ rectangles ] # <<<<<<<<<<<<<< * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_rectangles); __Pyx_GIVEREF(__pyx_v_rectangles); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_rectangles)) __PYX_ERR(0, 401, __pyx_L1_error); __Pyx_DECREF_SET(__pyx_v_rectangles, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":400 * self.proxy_window_surface() * * if not isinstance(rectangles, list): # <<<<<<<<<<<<<< * rectangles = [ rectangles ] * */ } /* "pygame_sdl2/display.pyx":403 * rectangles = [ rectangles ] * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * if rects == NULL: * raise MemoryError("Couldn't allocate rectangles.") */ __pyx_t_7 = PyObject_Length(__pyx_v_rectangles); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 403, __pyx_L1_error) __pyx_v_rects = ((SDL_Rect *)calloc(__pyx_t_7, (sizeof(SDL_Rect)))); /* "pygame_sdl2/display.pyx":404 * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: # <<<<<<<<<<<<<< * raise MemoryError("Couldn't allocate rectangles.") * */ __pyx_t_6 = (__pyx_v_rects == NULL); if (unlikely(__pyx_t_6)) { /* "pygame_sdl2/display.pyx":405 * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 405, __pyx_L1_error) /* "pygame_sdl2/display.pyx":404 * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: # <<<<<<<<<<<<<< * raise MemoryError("Couldn't allocate rectangles.") * */ } /* "pygame_sdl2/display.pyx":407 * raise MemoryError("Couldn't allocate rectangles.") * * try: # <<<<<<<<<<<<<< * * for i in rectangles: */ /*try:*/ { /* "pygame_sdl2/display.pyx":409 * try: * * for i in rectangles: # <<<<<<<<<<<<<< * if i is None: * continue */ if (likely(PyList_CheckExact(__pyx_v_rectangles)) || PyTuple_CheckExact(__pyx_v_rectangles)) { __pyx_t_2 = __pyx_v_rectangles; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_rectangles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 409, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 409, __pyx_L8_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 409, __pyx_L8_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 409, __pyx_L8_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 409, __pyx_L8_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_8(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 409, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":410 * * for i in rectangles: * if i is None: # <<<<<<<<<<<<<< * continue * */ __pyx_t_6 = (__pyx_v_i == Py_None); if (__pyx_t_6) { /* "pygame_sdl2/display.pyx":411 * for i in rectangles: * if i is None: * continue # <<<<<<<<<<<<<< * * to_sdl_rect(i, &rects[count]) */ goto __pyx_L10_continue; /* "pygame_sdl2/display.pyx":410 * * for i in rectangles: * if i is None: # <<<<<<<<<<<<<< * continue * */ } /* "pygame_sdl2/display.pyx":413 * continue * * to_sdl_rect(i, &rects[count]) # <<<<<<<<<<<<<< * count += 1 * */ __pyx_t_5 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_i, (&(__pyx_v_rects[__pyx_v_count])), NULL); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 413, __pyx_L8_error) /* "pygame_sdl2/display.pyx":414 * * to_sdl_rect(i, &rects[count]) * count += 1 # <<<<<<<<<<<<<< * * SDL_UpdateWindowSurfaceRects(self.window, rects, count) */ __pyx_v_count = (__pyx_v_count + 1); /* "pygame_sdl2/display.pyx":409 * try: * * for i in rectangles: # <<<<<<<<<<<<<< * if i is None: * continue */ __pyx_L10_continue:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":416 * count += 1 * * SDL_UpdateWindowSurfaceRects(self.window, rects, count) # <<<<<<<<<<<<<< * * finally: */ (void)(SDL_UpdateWindowSurfaceRects(__pyx_v_self->window, __pyx_v_rects, __pyx_v_count)); } /* "pygame_sdl2/display.pyx":419 * * finally: * free(rects) # <<<<<<<<<<<<<< * * def get_wm_info(self): */ /*finally:*/ { /*normal exit:*/{ free(__pyx_v_rects); goto __pyx_L9; } __pyx_L8_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_5 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { free(__pyx_v_rects); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L1_error; } __pyx_L9:; } /* "pygame_sdl2/display.pyx":388 * return self.surface * * def update(self, rectangles=None): # <<<<<<<<<<<<<< * * cdef SDL_Rect *rects */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_rectangles); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":421 * free(rects) * * def get_wm_info(self): # <<<<<<<<<<<<<< * return { } * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_21get_wm_info(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_20get_wm_info, "Window.get_wm_info(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_21get_wm_info = {"get_wm_info", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_21get_wm_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_20get_wm_info}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_21get_wm_info(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_wm_info (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_wm_info", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_wm_info", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_20get_wm_info(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_20get_wm_info(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_wm_info", 1); /* "pygame_sdl2/display.pyx":422 * * def get_wm_info(self): * return { } # <<<<<<<<<<<<<< * * def get_active(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":421 * free(rects) * * def get_wm_info(self): # <<<<<<<<<<<<<< * return { } * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_wm_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":424 * return { } * * def get_active(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_23get_active(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_22get_active, "Window.get_active(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_23get_active = {"get_active", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_23get_active, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_22get_active}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_23get_active(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_active (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_active", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_active", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_22get_active(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_22get_active(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_active", 1); /* "pygame_sdl2/display.pyx":425 * * def get_active(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<< * return False * else: */ __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":426 * def get_active(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False # <<<<<<<<<<<<<< * else: * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":425 * * def get_active(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<< * return False * else: */ } /* "pygame_sdl2/display.pyx":428 * return False * else: * return True # <<<<<<<<<<<<<< * * def iconify(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; } /* "pygame_sdl2/display.pyx":424 * return { } * * def get_active(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":430 * return True * * def iconify(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_25iconify(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_24iconify, "Window.iconify(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_25iconify = {"iconify", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_25iconify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_24iconify}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_25iconify(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iconify (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("iconify", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "iconify", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_24iconify(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_24iconify(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iconify", 1); /* "pygame_sdl2/display.pyx":431 * * def iconify(self): * SDL_MinimizeWindow(self.window) # <<<<<<<<<<<<<< * return True * */ SDL_MinimizeWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":432 * def iconify(self): * SDL_MinimizeWindow(self.window) * return True # <<<<<<<<<<<<<< * * def toggle_fullscreen(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":430 * return True * * def iconify(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * return True */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":434 * return True * * def toggle_fullscreen(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_27toggle_fullscreen(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_26toggle_fullscreen, "Window.toggle_fullscreen(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_27toggle_fullscreen = {"toggle_fullscreen", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_27toggle_fullscreen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_26toggle_fullscreen}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_27toggle_fullscreen(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toggle_fullscreen (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("toggle_fullscreen", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "toggle_fullscreen", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_26toggle_fullscreen(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_26toggle_fullscreen(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toggle_fullscreen", 1); /* "pygame_sdl2/display.pyx":435 * * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * if SDL_SetWindowFullscreen(self.window, 0): * raise error() */ __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":436 * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<< * raise error() * else: */ __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, 0) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":437 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): * raise error() # <<<<<<<<<<<<<< * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 437, __pyx_L1_error) /* "pygame_sdl2/display.pyx":436 * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<< * raise error() * else: */ } /* "pygame_sdl2/display.pyx":435 * * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * if SDL_SetWindowFullscreen(self.window, 0): * raise error() */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":439 * raise error() * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":440 * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): * raise error() # <<<<<<<<<<<<<< * * return True */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 440, __pyx_L1_error) /* "pygame_sdl2/display.pyx":439 * raise error() * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L3:; /* "pygame_sdl2/display.pyx":442 * raise error() * * return True # <<<<<<<<<<<<<< * * def set_gamma(self, red, green=None, blue=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":434 * return True * * def toggle_fullscreen(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.toggle_fullscreen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":444 * return True * * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<< * if green is None: * green = red */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_28set_gamma, "Window.set_gamma(self, red, green=None, blue=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_29set_gamma = {"set_gamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_28set_gamma}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_red)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_green); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blue); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_gamma") < 0)) __PYX_ERR(0, 444, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 444, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_28set_gamma(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_28set_gamma(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { Uint16 __pyx_v_red_gamma[0x100]; Uint16 __pyx_v_green_gamma[0x100]; Uint16 __pyx_v_blue_gamma[0x100]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; float __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_gamma", 0); __Pyx_INCREF(__pyx_v_green); __Pyx_INCREF(__pyx_v_blue); /* "pygame_sdl2/display.pyx":445 * * def set_gamma(self, red, green=None, blue=None): * if green is None: # <<<<<<<<<<<<<< * green = red * if blue is None: */ __pyx_t_1 = (__pyx_v_green == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":446 * def set_gamma(self, red, green=None, blue=None): * if green is None: * green = red # <<<<<<<<<<<<<< * if blue is None: * blue = red */ __Pyx_INCREF(__pyx_v_red); __Pyx_DECREF_SET(__pyx_v_green, __pyx_v_red); /* "pygame_sdl2/display.pyx":445 * * def set_gamma(self, red, green=None, blue=None): * if green is None: # <<<<<<<<<<<<<< * green = red * if blue is None: */ } /* "pygame_sdl2/display.pyx":447 * if green is None: * green = red * if blue is None: # <<<<<<<<<<<<<< * blue = red * */ __pyx_t_1 = (__pyx_v_blue == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":448 * green = red * if blue is None: * blue = red # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ __Pyx_INCREF(__pyx_v_red); __Pyx_DECREF_SET(__pyx_v_blue, __pyx_v_red); /* "pygame_sdl2/display.pyx":447 * if green is None: * green = red * if blue is None: # <<<<<<<<<<<<<< * blue = red * */ } /* "pygame_sdl2/display.pyx":454 * cdef Uint16 blue_gamma[256] * * SDL_CalculateGammaRamp(red, red_gamma) # <<<<<<<<<<<<<< * SDL_CalculateGammaRamp(green, green_gamma) * SDL_CalculateGammaRamp(blue, blue_gamma) */ __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_red); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L1_error) SDL_CalculateGammaRamp(__pyx_t_2, __pyx_v_red_gamma); /* "pygame_sdl2/display.pyx":455 * * SDL_CalculateGammaRamp(red, red_gamma) * SDL_CalculateGammaRamp(green, green_gamma) # <<<<<<<<<<<<<< * SDL_CalculateGammaRamp(blue, blue_gamma) * */ __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_green); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L1_error) SDL_CalculateGammaRamp(__pyx_t_2, __pyx_v_green_gamma); /* "pygame_sdl2/display.pyx":456 * SDL_CalculateGammaRamp(red, red_gamma) * SDL_CalculateGammaRamp(green, green_gamma) * SDL_CalculateGammaRamp(blue, blue_gamma) # <<<<<<<<<<<<<< * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): */ __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_blue); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) SDL_CalculateGammaRamp(__pyx_t_2, __pyx_v_blue_gamma); /* "pygame_sdl2/display.pyx":458 * SDL_CalculateGammaRamp(blue, blue_gamma) * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ __pyx_t_1 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":459 * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): * return False # <<<<<<<<<<<<<< * * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":458 * SDL_CalculateGammaRamp(blue, blue_gamma) * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/display.pyx":461 * return False * * return True # <<<<<<<<<<<<<< * * def set_gamma_ramp(self, red, green, blue): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":444 * return True * * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<< * if green is None: * green = red */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_green); __Pyx_XDECREF(__pyx_v_blue); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":463 * return True * * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_31set_gamma_ramp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_30set_gamma_ramp, "Window.set_gamma_ramp(self, red, green, blue)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_31set_gamma_ramp = {"set_gamma_ramp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_31set_gamma_ramp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_30set_gamma_ramp}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_31set_gamma_ramp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma_ramp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_red)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_green)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 463, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blue)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 463, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 463, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 463, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_30set_gamma_ramp(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_30set_gamma_ramp(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { Uint16 __pyx_v_red_gamma[0x100]; Uint16 __pyx_v_green_gamma[0x100]; Uint16 __pyx_v_blue_gamma[0x100]; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations long __pyx_t_1; PyObject *__pyx_t_2 = NULL; Uint16 __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_gamma_ramp", 1); /* "pygame_sdl2/display.pyx":469 * cdef Uint16 blue_gamma[256] * * for i in range(256): # <<<<<<<<<<<<<< * red_gamma[i] = red[i] * green_gamma[i] = green[i] */ for (__pyx_t_1 = 0; __pyx_t_1 < 0x100; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; /* "pygame_sdl2/display.pyx":470 * * for i in range(256): * red_gamma[i] = red[i] # <<<<<<<<<<<<<< * green_gamma[i] = green[i] * blue_gamma[i] = blue[i] */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_red, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_red_gamma[__pyx_v_i]) = __pyx_t_3; /* "pygame_sdl2/display.pyx":471 * for i in range(256): * red_gamma[i] = red[i] * green_gamma[i] = green[i] # <<<<<<<<<<<<<< * blue_gamma[i] = blue[i] * */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_green, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_green_gamma[__pyx_v_i]) = __pyx_t_3; /* "pygame_sdl2/display.pyx":472 * red_gamma[i] = red[i] * green_gamma[i] = green[i] * blue_gamma[i] = blue[i] # <<<<<<<<<<<<<< * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_blue, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_blue_gamma[__pyx_v_i]) = __pyx_t_3; } /* "pygame_sdl2/display.pyx":474 * blue_gamma[i] = blue[i] * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ __pyx_t_4 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0); if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":475 * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): * return False # <<<<<<<<<<<<<< * * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":474 * blue_gamma[i] = blue[i] * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/display.pyx":477 * return False * * return True # <<<<<<<<<<<<<< * * def set_icon(self, Surface surface): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":463 * return True * * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":479 * return True * * def set_icon(self, Surface surface): # <<<<<<<<<<<<<< * SDL_SetWindowIcon(self.window, surface.surface) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_33set_icon(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_32set_icon, "Window.set_icon(self, Surface surface)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_33set_icon = {"set_icon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_33set_icon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_32set_icon}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_33set_icon(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_icon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_icon") < 0)) __PYX_ERR(0, 479, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_icon", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 479, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.set_icon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 479, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_32set_icon(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_surface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_32set_icon(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_icon", 1); /* "pygame_sdl2/display.pyx":480 * * def set_icon(self, Surface surface): * SDL_SetWindowIcon(self.window, surface.surface) # <<<<<<<<<<<<<< * * def set_caption(self, title): */ SDL_SetWindowIcon(__pyx_v_self->window, __pyx_v_surface->surface); /* "pygame_sdl2/display.pyx":479 * return True * * def set_icon(self, Surface surface): # <<<<<<<<<<<<<< * SDL_SetWindowIcon(self.window, surface.surface) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":482 * SDL_SetWindowIcon(self.window, surface.surface) * * def set_caption(self, title): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_35set_caption(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_34set_caption, "Window.set_caption(self, title)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_35set_caption = {"set_caption", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_35set_caption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_34set_caption}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_35set_caption(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_title = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_caption (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_title,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_title)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 482, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_caption") < 0)) __PYX_ERR(0, 482, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_title = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_caption", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 482, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_34set_caption(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_title); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_34set_caption(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; char const *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_caption", 0); __Pyx_INCREF(__pyx_v_title); /* "pygame_sdl2/display.pyx":484 * def set_caption(self, title): * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ __pyx_t_1 = PyBytes_Check(__pyx_v_title); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":485 * * if not isinstance(title, bytes): * title = title.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetWindowTitle(self.window, title) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_utf_8}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":484 * def set_caption(self, title): * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":487 * title = title.encode("utf-8") * * SDL_SetWindowTitle(self.window, title) # <<<<<<<<<<<<<< * * def get_drawable_size(self): */ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L1_error) SDL_SetWindowTitle(__pyx_v_self->window, __pyx_t_7); /* "pygame_sdl2/display.pyx":482 * SDL_SetWindowIcon(self.window, surface.surface) * * def set_caption(self, title): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.Window.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_title); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":489 * SDL_SetWindowTitle(self.window, title) * * def get_drawable_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_37get_drawable_size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_36get_drawable_size, "Window.get_drawable_size(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_37get_drawable_size = {"get_drawable_size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_37get_drawable_size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_36get_drawable_size}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_37get_drawable_size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_drawable_size (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_drawable_size", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_drawable_size", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_36get_drawable_size(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_36get_drawable_size(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_drawable_size", 1); /* "pygame_sdl2/display.pyx":492 * cdef int w, h * * SDL_GL_GetDrawableSize(self.window, &w, &h) # <<<<<<<<<<<<<< * return w, h * */ SDL_GL_GetDrawableSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h)); /* "pygame_sdl2/display.pyx":493 * * SDL_GL_GetDrawableSize(self.window, &w, &h) * return w, h # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":489 * SDL_SetWindowTitle(self.window, title) * * def get_drawable_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_drawable_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":496 * * * def get_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_39get_size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_38get_size, "Window.get_size(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_39get_size = {"get_size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_39get_size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_38get_size}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_39get_size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_size (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_size", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_size", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_38get_size(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_38get_size(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_size", 1); /* "pygame_sdl2/display.pyx":499 * cdef int w, h * * SDL_GetWindowSize(self.window, &w, &h) # <<<<<<<<<<<<<< * return w, h * */ SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h)); /* "pygame_sdl2/display.pyx":500 * * SDL_GetWindowSize(self.window, &w, &h) * return w, h # <<<<<<<<<<<<<< * * def restore(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":496 * * * def get_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":502 * return w, h * * def restore(self): # <<<<<<<<<<<<<< * SDL_RestoreWindow(self.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_41restore(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_40restore, "Window.restore(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_41restore = {"restore", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_41restore, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_40restore}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_41restore(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restore (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("restore", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "restore", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_40restore(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_40restore(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restore", 1); /* "pygame_sdl2/display.pyx":503 * * def restore(self): * SDL_RestoreWindow(self.window) # <<<<<<<<<<<<<< * * def maximize(self): */ SDL_RestoreWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":502 * return w, h * * def restore(self): # <<<<<<<<<<<<<< * SDL_RestoreWindow(self.window) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":505 * SDL_RestoreWindow(self.window) * * def maximize(self): # <<<<<<<<<<<<<< * SDL_MaximizeWindow(self.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_43maximize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_42maximize, "Window.maximize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_43maximize = {"maximize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_43maximize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_42maximize}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_43maximize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("maximize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("maximize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "maximize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_42maximize(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_42maximize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("maximize", 1); /* "pygame_sdl2/display.pyx":506 * * def maximize(self): * SDL_MaximizeWindow(self.window) # <<<<<<<<<<<<<< * * def minimize(self): */ SDL_MaximizeWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":505 * SDL_RestoreWindow(self.window) * * def maximize(self): # <<<<<<<<<<<<<< * SDL_MaximizeWindow(self.window) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":508 * SDL_MaximizeWindow(self.window) * * def minimize(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_45minimize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_44minimize, "Window.minimize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_45minimize = {"minimize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_45minimize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_44minimize}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_45minimize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("minimize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("minimize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "minimize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_44minimize(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_44minimize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("minimize", 1); /* "pygame_sdl2/display.pyx":509 * * def minimize(self): * SDL_MinimizeWindow(self.window) # <<<<<<<<<<<<<< * * def get_sdl_window_pointer(self): */ SDL_MinimizeWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":508 * SDL_MaximizeWindow(self.window) * * def minimize(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":511 * SDL_MinimizeWindow(self.window) * * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<< * """ * Returns the pointer to the SDL_Window corresponding to this window. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer, "Window.get_sdl_window_pointer(self)\n\n Returns the pointer to the SDL_Window corresponding to this window.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer = {"get_sdl_window_pointer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_sdl_window_pointer (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_sdl_window_pointer", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_sdl_window_pointer", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_v_ctypes = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sdl_window_pointer", 1); /* "pygame_sdl2/display.pyx":516 * """ * * import ctypes # <<<<<<<<<<<<<< * return ctypes.c_void_p( self.window) * */ __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_ctypes, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ctypes = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":517 * * import ctypes * return ctypes.c_void_p( self.window) # <<<<<<<<<<<<<< * * def get_position(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ctypes, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_unsigned_long(((unsigned long)__pyx_v_self->window)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":511 * SDL_MinimizeWindow(self.window) * * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<< * """ * Returns the pointer to the SDL_Window corresponding to this window. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_sdl_window_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctypes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":519 * return ctypes.c_void_p( self.window) * * def get_position(self): # <<<<<<<<<<<<<< * cdef int x, y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49get_position(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_48get_position, "Window.get_position(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_49get_position = {"get_position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_49get_position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_48get_position}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49get_position(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_position (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_position", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_position", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_48get_position(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48get_position(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_v_x; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_position", 1); /* "pygame_sdl2/display.pyx":522 * cdef int x, y * * SDL_GetWindowPosition(self.window, &x, &y) # <<<<<<<<<<<<<< * return x, y * */ SDL_GetWindowPosition(__pyx_v_self->window, (&__pyx_v_x), (&__pyx_v_y)); /* "pygame_sdl2/display.pyx":523 * * SDL_GetWindowPosition(self.window, &x, &y) * return x, y # <<<<<<<<<<<<<< * * def set_position(self, pos): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":519 * return ctypes.c_void_p( self.window) * * def get_position(self): # <<<<<<<<<<<<<< * cdef int x, y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_position", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":525 * return x, y * * def set_position(self, pos): # <<<<<<<<<<<<<< * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_51set_position(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_50set_position, "Window.set_position(self, pos)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_51set_position = {"set_position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_51set_position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_50set_position}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_51set_position(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pos = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_position (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 525, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_position") < 0)) __PYX_ERR(0, 525, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pos = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_position", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 525, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.set_position", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_50set_position(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_50set_position(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_pos) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_position", 1); /* "pygame_sdl2/display.pyx":526 * * def set_position(self, pos): * SDL_SetWindowPosition(self.window, pos[0], pos[1]) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; SDL_SetWindowPosition(__pyx_v_self->window, __pyx_t_2, __pyx_t_3); /* "pygame_sdl2/display.pyx":525 * return x, y * * def set_position(self, pos): # <<<<<<<<<<<<<< * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.Window.set_position", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pxd":29 * cdef SDL_Window *window * cdef SDL_Surface *window_surface * cdef public Surface surface # <<<<<<<<<<<<<< * * # The OpenGL context corresponding to this window. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7surface_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7surface_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->surface); __pyx_r = ((PyObject *)__pyx_v_self->surface); goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(2, 29, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->surface); __Pyx_DECREF((PyObject *)__pyx_v_self->surface); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.Window.surface.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_5__del__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF((PyObject *)__pyx_v_self->surface); __Pyx_DECREF((PyObject *)__pyx_v_self->surface); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_53__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_52__reduce_cython__, "Window.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_53__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_53__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_52__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_53__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_52__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_52__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_gl_context_self_window_self, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_55__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_54__setstate_cython__, "Window.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_55__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_55__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_54__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_55__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_54__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_54__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_gl_context_self_window_self, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":539 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ static PyObject *__pyx_pf_11pygame_sdl2_7display_76__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject*)__pyx_tuple_)); __Pyx_GIVEREF(((PyObject*)__pyx_tuple_)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)__pyx_tuple_))) __PYX_ERR(0, 539, __pyx_L1_error); __Pyx_INCREF(((PyObject *)__pyx_int_0)); __Pyx_GIVEREF(((PyObject *)__pyx_int_0)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_int_0))) __PYX_ERR(0, 539, __pyx_L1_error); __Pyx_INCREF(((PyObject *)__pyx_int_0)); __Pyx_GIVEREF(((PyObject *)__pyx_int_0)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_0))) __PYX_ERR(0, 539, __pyx_L1_error); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_pos); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_pos); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_pos)) __PYX_ERR(0, 539, __pyx_L1_error); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 539, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.display.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_13set_mode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_12set_mode, "set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED))"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_13set_mode = {"set_mode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_13set_mode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_12set_mode}; static PyObject *__pyx_pw_11pygame_sdl2_7display_13set_mode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_resolution = 0; PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_depth = 0; PyObject *__pyx_v_pos = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mode (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_resolution,&__pyx_n_s_flags,&__pyx_n_s_depth,&__pyx_n_s_pos,0}; __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_tuple_))); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); values[3] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_pos); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_resolution); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depth); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_mode") < 0)) __PYX_ERR(0, 539, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_resolution = values[0]; __pyx_v_flags = values[1]; __pyx_v_depth = values[2]; __pyx_v_pos = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_mode", 0, 0, 4, __pyx_nargs); __PYX_ERR(0, 539, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_12set_mode(__pyx_self, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos) { int __pyx_v_RESIZE_FLAGS; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_mode", 1); /* "pygame_sdl2/display.pyx":542 * global main_window * * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<< * * if main_window: */ __pyx_v_RESIZE_FLAGS = (SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP); /* "pygame_sdl2/display.pyx":544 * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP * * if main_window: # <<<<<<<<<<<<<< * * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":546 * if main_window: * * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): # <<<<<<<<<<<<<< * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP) * return main_window.surface */ __pyx_t_2 = __Pyx_PyInt_From_int((~__pyx_v_RESIZE_FLAGS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_11pygame_sdl2_7display_main_window->create_flags & (~__pyx_v_RESIZE_FLAGS))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":547 * * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP) # <<<<<<<<<<<<<< * return main_window.surface * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN_DESKTOP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_resolution, __pyx_t_5, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":548 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP) * return main_window.surface # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface); __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface); goto __pyx_L0; /* "pygame_sdl2/display.pyx":546 * if main_window: * * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): # <<<<<<<<<<<<<< * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP) * return main_window.surface */ } /* "pygame_sdl2/display.pyx":551 * * else: * main_window.destroy() # <<<<<<<<<<<<<< * * main_window = Window(default_title, resolution, flags, depth, pos=pos) */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "pygame_sdl2/display.pyx":544 * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP * * if main_window: # <<<<<<<<<<<<<< * * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): */ } /* "pygame_sdl2/display.pyx":553 * main_window.destroy() * * main_window = Window(default_title, resolution, flags, depth, pos=pos) # <<<<<<<<<<<<<< * * if default_icon is not None: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error); __Pyx_INCREF(__pyx_v_resolution); __Pyx_GIVEREF(__pyx_v_resolution); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_resolution)) __PYX_ERR(0, 553, __pyx_L1_error); __Pyx_INCREF(__pyx_v_flags); __Pyx_GIVEREF(__pyx_v_flags); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_flags)) __PYX_ERR(0, 553, __pyx_L1_error); __Pyx_INCREF(__pyx_v_depth); __Pyx_GIVEREF(__pyx_v_depth); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_depth)) __PYX_ERR(0, 553, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 553, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window), __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_t_6)); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":555 * main_window = Window(default_title, resolution, flags, depth, pos=pos) * * if default_icon is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = (__pyx_t_6 != Py_None); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":556 * * if default_icon is not None: * main_window.set_icon(default_icon) # <<<<<<<<<<<<<< * * return main_window.surface */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":555 * main_window = Window(default_title, resolution, flags, depth, pos=pos) * * if default_icon is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ } /* "pygame_sdl2/display.pyx":558 * main_window.set_icon(default_icon) * * return main_window.surface # <<<<<<<<<<<<<< * * def destroy(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface); __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface); goto __pyx_L0; /* "pygame_sdl2/display.pyx":539 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":560 * return main_window.surface * * def destroy(): # <<<<<<<<<<<<<< * global main_window * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_15destroy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_14destroy, "destroy()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_15destroy = {"destroy", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_15destroy, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_14destroy}; static PyObject *__pyx_pw_11pygame_sdl2_7display_15destroy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_14destroy(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_14destroy(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "pygame_sdl2/display.pyx":563 * global main_window * * if main_window is not None: # <<<<<<<<<<<<<< * main_window.destroy() * main_window = None */ __pyx_t_1 = (((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window) != Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":564 * * if main_window is not None: * main_window.destroy() # <<<<<<<<<<<<<< * main_window = None * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":565 * if main_window is not None: * main_window.destroy() * main_window = None # <<<<<<<<<<<<<< * * def get_surface(): */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/display.pyx":563 * global main_window * * if main_window is not None: # <<<<<<<<<<<<<< * main_window.destroy() * main_window = None */ } /* "pygame_sdl2/display.pyx":560 * return main_window.surface * * def destroy(): # <<<<<<<<<<<<<< * global main_window * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":567 * main_window = None * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_17get_surface(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_16get_surface, "get_surface()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_17get_surface = {"get_surface", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_17get_surface, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_16get_surface}; static PyObject *__pyx_pw_11pygame_sdl2_7display_17get_surface(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_surface (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_16get_surface(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_16get_surface(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_surface", 1); /* "pygame_sdl2/display.pyx":568 * * def get_surface(): * if main_window is None: # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = (((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window) == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":569 * def get_surface(): * if main_window is None: * return None # <<<<<<<<<<<<<< * * return main_window.get_surface() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":568 * * def get_surface(): * if main_window is None: # <<<<<<<<<<<<<< * return None * */ } /* "pygame_sdl2/display.pyx":571 * return None * * return main_window.get_surface() # <<<<<<<<<<<<<< * * def get_window(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":567 * main_window = None * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_surface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":573 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_19get_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_18get_window, "get_window()\n\n Returns the Window created by set_mode, or None if no such window\n exists.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_19get_window = {"get_window", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_19get_window, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_18get_window}; static PyObject *__pyx_pw_11pygame_sdl2_7display_19get_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_window (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_18get_window(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_18get_window(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_window", 1); /* "pygame_sdl2/display.pyx":579 * """ * * return main_window # <<<<<<<<<<<<<< * * def flip(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); goto __pyx_L0; /* "pygame_sdl2/display.pyx":573 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":581 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_21flip(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_20flip, "flip()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_21flip = {"flip", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_21flip, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_20flip}; static PyObject *__pyx_pw_11pygame_sdl2_7display_21flip(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flip (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_20flip(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_20flip(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flip", 1); /* "pygame_sdl2/display.pyx":582 * * def flip(): * if main_window: # <<<<<<<<<<<<<< * main_window.flip() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 582, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":583 * def flip(): * if main_window: * main_window.flip() # <<<<<<<<<<<<<< * * def update(rectangles=None): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_flip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":582 * * def flip(): * if main_window: # <<<<<<<<<<<<<< * main_window.flip() * */ } /* "pygame_sdl2/display.pyx":581 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":585 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_23update(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_22update, "update(rectangles=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_23update = {"update", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_23update, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_22update}; static PyObject *__pyx_pw_11pygame_sdl2_7display_23update(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rectangles = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rectangles,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rectangles); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "update") < 0)) __PYX_ERR(0, 585, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rectangles = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 585, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_22update(__pyx_self, __pyx_v_rectangles); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_22update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rectangles) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update", 1); /* "pygame_sdl2/display.pyx":586 * * def update(rectangles=None): * if main_window: # <<<<<<<<<<<<<< * main_window.update(rectangles) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 586, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":587 * def update(rectangles=None): * if main_window: * main_window.update(rectangles) # <<<<<<<<<<<<<< * * def get_driver(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_rectangles}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":586 * * def update(rectangles=None): * if main_window: # <<<<<<<<<<<<<< * main_window.update(rectangles) * */ } /* "pygame_sdl2/display.pyx":585 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":589 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_25get_driver(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_24get_driver, "get_driver()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_25get_driver = {"get_driver", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_25get_driver, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_24get_driver}; static PyObject *__pyx_pw_11pygame_sdl2_7display_25get_driver(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_driver (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_24get_driver(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_24get_driver(CYTHON_UNUSED PyObject *__pyx_self) { char const *__pyx_v_driver; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_driver", 1); /* "pygame_sdl2/display.pyx":590 * * def get_driver(): * cdef const char *driver = SDL_GetCurrentVideoDriver() # <<<<<<<<<<<<<< * * if driver == NULL: */ __pyx_v_driver = SDL_GetCurrentVideoDriver(); /* "pygame_sdl2/display.pyx":592 * cdef const char *driver = SDL_GetCurrentVideoDriver() * * if driver == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_driver == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":593 * * if driver == NULL: * raise error() # <<<<<<<<<<<<<< * * return driver */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 593, __pyx_L1_error) /* "pygame_sdl2/display.pyx":592 * cdef const char *driver = SDL_GetCurrentVideoDriver() * * if driver == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":595 * raise error() * * return driver # <<<<<<<<<<<<<< * * class Info(object): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":589 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_driver", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":599 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_4Info___init__, "Info.__init__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_4Info_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_4Info_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_4Info___init__}; static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 599, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 599, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Info.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_4Info___init__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { SDL_DisplayMode __pyx_v_dm; SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/display.pyx":603 * cdef SDL_PixelFormat *format * * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetCurrentDisplayMode(0, (&__pyx_v_dm)) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":604 * * if SDL_GetCurrentDisplayMode(0, &dm): * raise error() # <<<<<<<<<<<<<< * * format = SDL_AllocFormat(dm.format) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 604, __pyx_L1_error) /* "pygame_sdl2/display.pyx":603 * cdef SDL_PixelFormat *format * * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":606 * raise error() * * format = SDL_AllocFormat(dm.format) # <<<<<<<<<<<<<< * if format == NULL: * raise error() */ __pyx_v_format = SDL_AllocFormat(__pyx_v_dm.format); /* "pygame_sdl2/display.pyx":607 * * format = SDL_AllocFormat(dm.format) * if format == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_format == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":608 * format = SDL_AllocFormat(dm.format) * if format == NULL: * raise error() # <<<<<<<<<<<<<< * * self.bitsize = format.BitsPerPixel */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 608, __pyx_L1_error) /* "pygame_sdl2/display.pyx":607 * * format = SDL_AllocFormat(dm.format) * if format == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":610 * raise error() * * self.bitsize = format.BitsPerPixel # <<<<<<<<<<<<<< * self.bytesize = format.BytesPerPixel * */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BitsPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bitsize, __pyx_t_2) < 0) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":611 * * self.bitsize = format.BitsPerPixel * self.bytesize = format.BytesPerPixel # <<<<<<<<<<<<<< * * self.masks = ( */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BytesPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bytesize, __pyx_t_2) < 0) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":614 * * self.masks = ( * format.Rmask, # <<<<<<<<<<<<<< * format.Gmask, * format.Bmask, */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/display.pyx":615 * self.masks = ( * format.Rmask, * format.Gmask, # <<<<<<<<<<<<<< * format.Bmask, * format.Amask, */ __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":616 * format.Rmask, * format.Gmask, * format.Bmask, # <<<<<<<<<<<<<< * format.Amask, * ) */ __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":617 * format.Gmask, * format.Bmask, * format.Amask, # <<<<<<<<<<<<<< * ) * */ __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "pygame_sdl2/display.pyx":614 * * self.masks = ( * format.Rmask, # <<<<<<<<<<<<<< * format.Gmask, * format.Bmask, */ __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 614, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6)) __PYX_ERR(0, 614, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":613 * self.bytesize = format.BytesPerPixel * * self.masks = ( # <<<<<<<<<<<<<< * format.Rmask, * format.Gmask, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_masks, __pyx_t_7) < 0) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/display.pyx":621 * * self.shifts = ( * format.Rshift, # <<<<<<<<<<<<<< * format.Gshift, * format.Bshift, */ __pyx_t_7 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "pygame_sdl2/display.pyx":622 * self.shifts = ( * format.Rshift, * format.Gshift, # <<<<<<<<<<<<<< * format.Bshift, * format.Ashift, */ __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "pygame_sdl2/display.pyx":623 * format.Rshift, * format.Gshift, * format.Bshift, # <<<<<<<<<<<<<< * format.Ashift, * ) */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":624 * format.Gshift, * format.Bshift, * format.Ashift, # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":621 * * self.shifts = ( * format.Rshift, # <<<<<<<<<<<<<< * format.Gshift, * format.Bshift, */ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7)) __PYX_ERR(0, 621, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6)) __PYX_ERR(0, 621, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3)) __PYX_ERR(0, 621, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":620 * ) * * self.shifts = ( # <<<<<<<<<<<<<< * format.Rshift, * format.Gshift, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shifts, __pyx_t_2) < 0) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":628 * * self.losses = ( * format.Rloss, # <<<<<<<<<<<<<< * format.Gloss, * format.Bloss, */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/display.pyx":629 * self.losses = ( * format.Rloss, * format.Gloss, # <<<<<<<<<<<<<< * format.Bloss, * format.Aloss, */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":630 * format.Rloss, * format.Gloss, * format.Bloss, # <<<<<<<<<<<<<< * format.Aloss, * ) */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":631 * format.Gloss, * format.Bloss, * format.Aloss, # <<<<<<<<<<<<<< * ) * */ __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "pygame_sdl2/display.pyx":628 * * self.losses = ( * format.Rloss, # <<<<<<<<<<<<<< * format.Gloss, * format.Bloss, */ __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6)) __PYX_ERR(0, 628, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":627 * ) * * self.losses = ( # <<<<<<<<<<<<<< * format.Rloss, * format.Gloss, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_losses, __pyx_t_7) < 0) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/display.pyx":634 * ) * * SDL_FreeFormat(format) # <<<<<<<<<<<<<< * * if main_window: */ SDL_FreeFormat(__pyx_v_format); /* "pygame_sdl2/display.pyx":636 * SDL_FreeFormat(format) * * if main_window: # <<<<<<<<<<<<<< * self.current_w, self.current_h = main_window.surface.get_size() * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 636, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":637 * * if main_window: * self.current_w, self.current_h = main_window.surface.get_size() # <<<<<<<<<<<<<< * else: * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { PyObject* sequence = __pyx_t_7; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 637, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) __PYX_ERR(0, 637, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 637, __pyx_L1_error) __pyx_L7_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_6) < 0) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_4) < 0) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":636 * SDL_FreeFormat(format) * * if main_window: # <<<<<<<<<<<<<< * self.current_w, self.current_h = main_window.surface.get_size() * else: */ goto __pyx_L5; } /* "pygame_sdl2/display.pyx":640 * else: * * self.current_w = dm.w # <<<<<<<<<<<<<< * self.current_h = dm.h * */ /*else*/ { __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_dm.w); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_7) < 0) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/display.pyx":641 * * self.current_w = dm.w * self.current_h = dm.h # <<<<<<<<<<<<<< * * self.refresh_rate = dm.refresh_rate */ __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_dm.h); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_7) < 0) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_L5:; /* "pygame_sdl2/display.pyx":643 * self.current_h = dm.h * * self.refresh_rate = dm.refresh_rate # <<<<<<<<<<<<<< * * # The rest of these are just guesses. */ __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_dm.refresh_rate); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_refresh_rate, __pyx_t_7) < 0) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/display.pyx":646 * * # The rest of these are just guesses. * self.hw = False # <<<<<<<<<<<<<< * self.wm = True * self.video_mem = 256 * 1024 * 1024 */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hw, Py_False) < 0) __PYX_ERR(0, 646, __pyx_L1_error) /* "pygame_sdl2/display.pyx":647 * # The rest of these are just guesses. * self.hw = False * self.wm = True # <<<<<<<<<<<<<< * self.video_mem = 256 * 1024 * 1024 * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wm, Py_True) < 0) __PYX_ERR(0, 647, __pyx_L1_error) /* "pygame_sdl2/display.pyx":648 * self.hw = False * self.wm = True * self.video_mem = 256 * 1024 * 1024 # <<<<<<<<<<<<<< * * self.blit_hw = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_video_mem, __pyx_int_268435456) < 0) __PYX_ERR(0, 648, __pyx_L1_error) /* "pygame_sdl2/display.pyx":650 * self.video_mem = 256 * 1024 * 1024 * * self.blit_hw = False # <<<<<<<<<<<<<< * self.blit_hw_CC = False * self.blit_hw_A = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw, Py_False) < 0) __PYX_ERR(0, 650, __pyx_L1_error) /* "pygame_sdl2/display.pyx":651 * * self.blit_hw = False * self.blit_hw_CC = False # <<<<<<<<<<<<<< * self.blit_hw_A = False * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_CC, Py_False) < 0) __PYX_ERR(0, 651, __pyx_L1_error) /* "pygame_sdl2/display.pyx":652 * self.blit_hw = False * self.blit_hw_CC = False * self.blit_hw_A = False # <<<<<<<<<<<<<< * * self.blit_sw = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_A, Py_False) < 0) __PYX_ERR(0, 652, __pyx_L1_error) /* "pygame_sdl2/display.pyx":654 * self.blit_hw_A = False * * self.blit_sw = False # <<<<<<<<<<<<<< * self.blit_sw_CC = False * self.blit_sw_A = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw, Py_False) < 0) __PYX_ERR(0, 654, __pyx_L1_error) /* "pygame_sdl2/display.pyx":655 * * self.blit_sw = False * self.blit_sw_CC = False # <<<<<<<<<<<<<< * self.blit_sw_A = False * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_CC, Py_False) < 0) __PYX_ERR(0, 655, __pyx_L1_error) /* "pygame_sdl2/display.pyx":656 * self.blit_sw = False * self.blit_sw_CC = False * self.blit_sw_A = False # <<<<<<<<<<<<<< * * def __repr__(self): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_A, Py_False) < 0) __PYX_ERR(0, 656, __pyx_L1_error) /* "pygame_sdl2/display.pyx":599 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.display.Info.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":658 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_3__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_4Info_2__repr__, "Info.__repr__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_4Info_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_4Info_2__repr__}; static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_3__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 658, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 658, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Info.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_4Info_2__repr__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/display.pyx":659 * * def __repr__(self): * return "".format(self.__dict__) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Info_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":658 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Info.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":662 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_27get_wm_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_26get_wm_info, "get_wm_info()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_27get_wm_info = {"get_wm_info", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_27get_wm_info, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_26get_wm_info}; static PyObject *__pyx_pw_11pygame_sdl2_7display_27get_wm_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_wm_info (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_26get_wm_info(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_26get_wm_info(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_wm_info", 1); /* "pygame_sdl2/display.pyx":663 * * def get_wm_info(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_wm_info() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 663, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":664 * def get_wm_info(): * if main_window: * return main_window.get_wm_info() # <<<<<<<<<<<<<< * * return {} */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_wm_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":663 * * def get_wm_info(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_wm_info() * */ } /* "pygame_sdl2/display.pyx":666 * return main_window.get_wm_info() * * return {} # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":662 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_wm_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":669 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_29get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_28get_num_video_displays, "get_num_video_displays()\n\n Returns the number of video displays connected to the system.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays = {"get_num_video_displays", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_29get_num_video_displays, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_28get_num_video_displays}; static PyObject *__pyx_pw_11pygame_sdl2_7display_29get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_video_displays (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_28get_num_video_displays(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_28get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_num_video_displays", 1); /* "pygame_sdl2/display.pyx":674 * """ * * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<< * * if rv < 0: */ __pyx_v_rv = SDL_GetNumVideoDisplays(); /* "pygame_sdl2/display.pyx":676 * rv = SDL_GetNumVideoDisplays() * * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_rv < 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":677 * * if rv < 0: * raise error() # <<<<<<<<<<<<<< * * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 677, __pyx_L1_error) /* "pygame_sdl2/display.pyx":676 * rv = SDL_GetNumVideoDisplays() * * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":679 * raise error() * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":669 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_num_video_displays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":682 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_31list_modes(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_30list_modes, "list_modes(depth=0, flags=0, display=0)\n\n Returns a list of possible display modes for the display `display`.\n\n `depth` and `flags` are ignored.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_31list_modes = {"list_modes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_31list_modes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_30list_modes}; static PyObject *__pyx_pw_11pygame_sdl2_7display_31list_modes(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_depth = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_display = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("list_modes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depth,&__pyx_n_s_flags,&__pyx_n_s_display,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depth); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_display); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "list_modes") < 0)) __PYX_ERR(0, 682, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_depth = values[0]; __pyx_v_flags = values[1]; __pyx_v_display = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("list_modes", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 682, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.list_modes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_30list_modes(__pyx_self, __pyx_v_depth, __pyx_v_flags, __pyx_v_display); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_30list_modes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_depth, CYTHON_UNUSED PyObject *__pyx_v_flags, PyObject *__pyx_v_display) { int __pyx_v_num_modes; int __pyx_v_i; SDL_DisplayMode __pyx_v_mode; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_t = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("list_modes", 1); /* "pygame_sdl2/display.pyx":692 * cdef SDL_DisplayMode mode * * rv = [ ] # <<<<<<<<<<<<<< * * num_modes = SDL_GetNumDisplayModes(display) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":694 * rv = [ ] * * num_modes = SDL_GetNumDisplayModes(display) # <<<<<<<<<<<<<< * if num_modes < 0: * raise error() */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 694, __pyx_L1_error) __pyx_v_num_modes = SDL_GetNumDisplayModes(__pyx_t_2); /* "pygame_sdl2/display.pyx":695 * * num_modes = SDL_GetNumDisplayModes(display) * if num_modes < 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = (__pyx_v_num_modes < 0); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/display.pyx":696 * num_modes = SDL_GetNumDisplayModes(display) * if num_modes < 0: * raise error() # <<<<<<<<<<<<<< * * for 0 <= i < num_modes: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_2, 0+__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 696, __pyx_L1_error) /* "pygame_sdl2/display.pyx":695 * * num_modes = SDL_GetNumDisplayModes(display) * if num_modes < 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":698 * raise error() * * for 0 <= i < num_modes: # <<<<<<<<<<<<<< * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) */ __pyx_t_2 = __pyx_v_num_modes; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { /* "pygame_sdl2/display.pyx":699 * * for 0 <= i < num_modes: * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<< * t = (mode.w, mode.h) * if t not in rv: */ __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L1_error) __pyx_t_3 = (SDL_GetDisplayMode(__pyx_t_6, __pyx_v_i, (&__pyx_v_mode)) == 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":700 * for 0 <= i < num_modes: * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) # <<<<<<<<<<<<<< * if t not in rv: * rv.append(t) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mode.w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_mode.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":701 * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) * if t not in rv: # <<<<<<<<<<<<<< * rv.append(t) * */ __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_t, __pyx_v_rv, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 701, __pyx_L1_error) if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":702 * t = (mode.w, mode.h) * if t not in rv: * rv.append(t) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_t); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 702, __pyx_L1_error) /* "pygame_sdl2/display.pyx":701 * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) * if t not in rv: # <<<<<<<<<<<<<< * rv.append(t) * */ } /* "pygame_sdl2/display.pyx":699 * * for 0 <= i < num_modes: * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<< * t = (mode.w, mode.h) * if t not in rv: */ } } /* "pygame_sdl2/display.pyx":704 * rv.append(t) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/display.pyx":682 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.list_modes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_t); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":707 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_33mode_ok(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_32mode_ok, "mode_ok(size, flags=0, depth=0)\n\n Returns true if size is in the result of list_modes().\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_33mode_ok = {"mode_ok", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_33mode_ok, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_32mode_ok}; static PyObject *__pyx_pw_11pygame_sdl2_7display_33mode_ok(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; CYTHON_UNUSED PyObject *__pyx_v_depth = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mode_ok (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_flags,&__pyx_n_s_depth,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depth); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mode_ok") < 0)) __PYX_ERR(0, 707, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_flags = values[1]; __pyx_v_depth = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mode_ok", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 707, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.mode_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_32mode_ok(__pyx_self, __pyx_v_size, __pyx_v_flags, __pyx_v_depth); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_32mode_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mode_ok", 1); /* "pygame_sdl2/display.pyx":712 * """ * * return tuple(size) in list_modes() # <<<<<<<<<<<<<< * * def gl_reset_attributes(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_list_modes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":707 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.mode_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":714 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_35gl_reset_attributes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_34gl_reset_attributes, "gl_reset_attributes()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes = {"gl_reset_attributes", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_35gl_reset_attributes, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_34gl_reset_attributes}; static PyObject *__pyx_pw_11pygame_sdl2_7display_35gl_reset_attributes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_reset_attributes (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_34gl_reset_attributes(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_34gl_reset_attributes(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_reset_attributes", 1); /* "pygame_sdl2/display.pyx":715 * * def gl_reset_attributes(): * SDL_GL_ResetAttributes() # <<<<<<<<<<<<<< * * def gl_set_attribute(flag, value): */ SDL_GL_ResetAttributes(); /* "pygame_sdl2/display.pyx":714 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":717 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_37gl_set_attribute(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_36gl_set_attribute, "gl_set_attribute(flag, value)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute = {"gl_set_attribute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_37gl_set_attribute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_36gl_set_attribute}; static PyObject *__pyx_pw_11pygame_sdl2_7display_37gl_set_attribute(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_set_attribute (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, 1); __PYX_ERR(0, 717, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gl_set_attribute") < 0)) __PYX_ERR(0, 717, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_flag = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 717, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.gl_set_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_36gl_set_attribute(__pyx_self, __pyx_v_flag, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_36gl_set_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; SDL_GLattr __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gl_set_attribute", 1); /* "pygame_sdl2/display.pyx":719 * def gl_set_attribute(flag, value): * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * if ios: * return */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":720 * * if flag == GL_SWAP_CONTROL: * if ios: # <<<<<<<<<<<<<< * return * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ios); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":721 * if flag == GL_SWAP_CONTROL: * if ios: * return # <<<<<<<<<<<<<< * * global default_swap_control */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":720 * * if flag == GL_SWAP_CONTROL: * if ios: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":728 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-value) * */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L1_error) __pyx_t_3 = (SDL_GL_SetSwapInterval(__pyx_t_4) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":729 * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(value): * SDL_GL_SetSwapInterval(-value) # <<<<<<<<<<<<<< * * default_swap_control = value */ __pyx_t_2 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (void)(SDL_GL_SetSwapInterval(__pyx_t_4)); /* "pygame_sdl2/display.pyx":728 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-value) * */ } /* "pygame_sdl2/display.pyx":731 * SDL_GL_SetSwapInterval(-value) * * default_swap_control = value # <<<<<<<<<<<<<< * return * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_v_value) < 0) __PYX_ERR(0, 731, __pyx_L1_error) /* "pygame_sdl2/display.pyx":732 * * default_swap_control = value * return # <<<<<<<<<<<<<< * * if SDL_GL_SetAttribute(flag, value): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":719 * def gl_set_attribute(flag, value): * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * if ios: * return */ } /* "pygame_sdl2/display.pyx":734 * return * * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L1_error) __pyx_t_3 = (SDL_GL_SetAttribute(__pyx_t_5, __pyx_t_4) != 0); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/display.pyx":735 * * if SDL_GL_SetAttribute(flag, value): * raise error() # <<<<<<<<<<<<<< * * def gl_get_attribute(flag): */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 735, __pyx_L1_error) /* "pygame_sdl2/display.pyx":734 * return * * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":717 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.gl_set_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":737 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_39gl_get_attribute(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_38gl_get_attribute, "gl_get_attribute(flag)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute = {"gl_get_attribute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_39gl_get_attribute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_38gl_get_attribute}; static PyObject *__pyx_pw_11pygame_sdl2_7display_39gl_get_attribute(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_get_attribute (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gl_get_attribute") < 0)) __PYX_ERR(0, 737, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gl_get_attribute", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 737, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.gl_get_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_38gl_get_attribute(__pyx_self, __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_38gl_get_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag) { int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; SDL_GLattr __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gl_get_attribute", 1); /* "pygame_sdl2/display.pyx":740 * cdef int rv * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * return SDL_GL_GetSwapInterval() * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":741 * * if flag == GL_SWAP_CONTROL: * return SDL_GL_GetSwapInterval() # <<<<<<<<<<<<<< * * if SDL_GL_GetAttribute(flag, &rv): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_GL_GetSwapInterval()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":740 * cdef int rv * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * return SDL_GL_GetSwapInterval() * */ } /* "pygame_sdl2/display.pyx":743 * return SDL_GL_GetSwapInterval() * * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 743, __pyx_L1_error) __pyx_t_3 = (SDL_GL_GetAttribute(__pyx_t_4, (&__pyx_v_rv)) != 0); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/display.pyx":744 * * if SDL_GL_GetAttribute(flag, &rv): * raise error() # <<<<<<<<<<<<<< * * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 744, __pyx_L1_error) /* "pygame_sdl2/display.pyx":743 * return SDL_GL_GetSwapInterval() * * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":746 * raise error() * * return rv # <<<<<<<<<<<<<< * * def gl_load_library(path): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":737 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.gl_get_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":748 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_41gl_load_library(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_40gl_load_library, "gl_load_library(path)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_41gl_load_library = {"gl_load_library", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_41gl_load_library, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_40gl_load_library}; static PyObject *__pyx_pw_11pygame_sdl2_7display_41gl_load_library(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_load_library (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gl_load_library") < 0)) __PYX_ERR(0, 748, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_path = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gl_load_library", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 748, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.gl_load_library", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_40gl_load_library(__pyx_self, __pyx_v_path); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_40gl_load_library(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; char const *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gl_load_library", 1); /* "pygame_sdl2/display.pyx":749 * * def gl_load_library(path): * if path is None: # <<<<<<<<<<<<<< * if SDL_GL_LoadLibrary(NULL): * raise error() */ __pyx_t_1 = (__pyx_v_path == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":750 * def gl_load_library(path): * if path is None: * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<< * raise error() * else: */ __pyx_t_1 = (SDL_GL_LoadLibrary(NULL) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":751 * if path is None: * if SDL_GL_LoadLibrary(NULL): * raise error() # <<<<<<<<<<<<<< * else: * if SDL_GL_LoadLibrary(path): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 751, __pyx_L1_error) /* "pygame_sdl2/display.pyx":750 * def gl_load_library(path): * if path is None: * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<< * raise error() * else: */ } /* "pygame_sdl2/display.pyx":749 * * def gl_load_library(path): * if path is None: # <<<<<<<<<<<<<< * if SDL_GL_LoadLibrary(NULL): * raise error() */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":753 * raise error() * else: * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L1_error) __pyx_t_1 = (SDL_GL_LoadLibrary(__pyx_t_6) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":754 * else: * if SDL_GL_LoadLibrary(path): * raise error() # <<<<<<<<<<<<<< * * def gl_unload_library(): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 754, __pyx_L1_error) /* "pygame_sdl2/display.pyx":753 * raise error() * else: * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L3:; /* "pygame_sdl2/display.pyx":748 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.gl_load_library", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":756 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_43gl_unload_library(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_42gl_unload_library, "gl_unload_library()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_43gl_unload_library = {"gl_unload_library", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_43gl_unload_library, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_42gl_unload_library}; static PyObject *__pyx_pw_11pygame_sdl2_7display_43gl_unload_library(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_unload_library (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_42gl_unload_library(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_42gl_unload_library(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_unload_library", 1); /* "pygame_sdl2/display.pyx":757 * * def gl_unload_library(): * SDL_GL_UnloadLibrary() # <<<<<<<<<<<<<< * * def get_active(): */ SDL_GL_UnloadLibrary(); /* "pygame_sdl2/display.pyx":756 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":759 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_45get_active(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_44get_active, "get_active()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_45get_active = {"get_active", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_45get_active, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_44get_active}; static PyObject *__pyx_pw_11pygame_sdl2_7display_45get_active(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_active (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_44get_active(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_44get_active(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_active", 1); /* "pygame_sdl2/display.pyx":760 * * def get_active(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_active() * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 760, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":761 * def get_active(): * if main_window: * return main_window.get_active() # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_active); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":760 * * def get_active(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_active() * return False */ } /* "pygame_sdl2/display.pyx":762 * if main_window: * return main_window.get_active() * return False # <<<<<<<<<<<<<< * * def iconify(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":759 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_active", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":764 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_47iconify(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_46iconify, "iconify()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_47iconify = {"iconify", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_47iconify, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_46iconify}; static PyObject *__pyx_pw_11pygame_sdl2_7display_47iconify(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iconify (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_46iconify(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_46iconify(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iconify", 1); /* "pygame_sdl2/display.pyx":765 * * def iconify(): * if main_window: # <<<<<<<<<<<<<< * return main_window.iconify() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 765, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":766 * def iconify(): * if main_window: * return main_window.iconify() # <<<<<<<<<<<<<< * * return False */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_iconify); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":765 * * def iconify(): * if main_window: # <<<<<<<<<<<<<< * return main_window.iconify() * */ } /* "pygame_sdl2/display.pyx":768 * return main_window.iconify() * * return False # <<<<<<<<<<<<<< * * def toggle_fullscreen(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":764 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.iconify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":770 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_49toggle_fullscreen(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_48toggle_fullscreen, "toggle_fullscreen()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen = {"toggle_fullscreen", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_49toggle_fullscreen, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_48toggle_fullscreen}; static PyObject *__pyx_pw_11pygame_sdl2_7display_49toggle_fullscreen(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toggle_fullscreen (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_48toggle_fullscreen(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_48toggle_fullscreen(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toggle_fullscreen", 1); /* "pygame_sdl2/display.pyx":771 * * def toggle_fullscreen(): * if main_window: # <<<<<<<<<<<<<< * return main_window.toggle_fullscreen() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 771, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":772 * def toggle_fullscreen(): * if main_window: * return main_window.toggle_fullscreen() # <<<<<<<<<<<<<< * * return True */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_toggle_fullscreen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":771 * * def toggle_fullscreen(): * if main_window: # <<<<<<<<<<<<<< * return main_window.toggle_fullscreen() * */ } /* "pygame_sdl2/display.pyx":774 * return main_window.toggle_fullscreen() * * return True # <<<<<<<<<<<<<< * * def set_gamma(red, green=None, blue=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":770 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.toggle_fullscreen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":776 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_51set_gamma(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_50set_gamma, "set_gamma(red, green=None, blue=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_51set_gamma = {"set_gamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_51set_gamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_50set_gamma}; static PyObject *__pyx_pw_11pygame_sdl2_7display_51set_gamma(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_red)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_green); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blue); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_gamma") < 0)) __PYX_ERR(0, 776, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 776, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_50set_gamma(__pyx_self, __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_50set_gamma(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_gamma", 1); /* "pygame_sdl2/display.pyx":777 * * def set_gamma(red, green=None, blue=None): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma(red, green, blue) * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":778 * def set_gamma(red, green=None, blue=None): * if main_window: * return main_window.set_gamma(red, green, blue) # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":777 * * def set_gamma(red, green=None, blue=None): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma(red, green, blue) * return False */ } /* "pygame_sdl2/display.pyx":779 * if main_window: * return main_window.set_gamma(red, green, blue) * return False # <<<<<<<<<<<<<< * * def set_gamma_ramp(red, green, blue): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":776 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":781 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_53set_gamma_ramp(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_52set_gamma_ramp, "set_gamma_ramp(red, green, blue)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp = {"set_gamma_ramp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_53set_gamma_ramp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_52set_gamma_ramp}; static PyObject *__pyx_pw_11pygame_sdl2_7display_53set_gamma_ramp(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma_ramp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_red)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_green)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 781, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blue)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 781, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 781, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 781, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_52set_gamma_ramp(__pyx_self, __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_52set_gamma_ramp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_gamma_ramp", 1); /* "pygame_sdl2/display.pyx":782 * * def set_gamma_ramp(red, green, blue): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma_ramp(red, green, blue) * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 782, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":783 * def set_gamma_ramp(red, green, blue): * if main_window: * return main_window.set_gamma_ramp(red, green, blue) # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma_ramp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":782 * * def set_gamma_ramp(red, green, blue): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma_ramp(red, green, blue) * return False */ } /* "pygame_sdl2/display.pyx":784 * if main_window: * return main_window.set_gamma_ramp(red, green, blue) * return False # <<<<<<<<<<<<<< * * def set_icon(surface): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":781 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":786 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_55set_icon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_54set_icon, "set_icon(surface)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_55set_icon = {"set_icon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_55set_icon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_54set_icon}; static PyObject *__pyx_pw_11pygame_sdl2_7display_55set_icon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_surface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_icon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 786, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_icon") < 0)) __PYX_ERR(0, 786, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_surface = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_icon", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 786, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_icon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_54set_icon(__pyx_self, __pyx_v_surface); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_54set_icon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_surface) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_icon", 1); /* "pygame_sdl2/display.pyx":789 * global default_icon * * default_icon = surface.copy() # <<<<<<<<<<<<<< * * if main_window is not None: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_surface, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, __pyx_t_1) < 0) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":791 * default_icon = surface.copy() * * if main_window is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ __pyx_t_5 = (((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window) != Py_None); if (__pyx_t_5) { /* "pygame_sdl2/display.pyx":792 * * if main_window is not None: * main_window.set_icon(default_icon) # <<<<<<<<<<<<<< * * def set_caption(title, icontitle = None): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":791 * default_icon = surface.copy() * * if main_window is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ } /* "pygame_sdl2/display.pyx":786 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.set_icon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":794 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_57set_caption(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_56set_caption, "set_caption(title, icontitle=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_57set_caption = {"set_caption", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_57set_caption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_56set_caption}; static PyObject *__pyx_pw_11pygame_sdl2_7display_57set_caption(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_title = 0; CYTHON_UNUSED PyObject *__pyx_v_icontitle = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_caption (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_title,&__pyx_n_s_icontitle,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_title)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 794, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_icontitle); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 794, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_caption") < 0)) __PYX_ERR(0, 794, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_title = values[0]; __pyx_v_icontitle = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_caption", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 794, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_56set_caption(__pyx_self, __pyx_v_title, __pyx_v_icontitle); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_56set_caption(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_title, CYTHON_UNUSED PyObject *__pyx_v_icontitle) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_caption", 1); /* "pygame_sdl2/display.pyx":797 * global default_title * * default_title = title # <<<<<<<<<<<<<< * * if main_window: */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_v_title) < 0) __PYX_ERR(0, 797, __pyx_L1_error) /* "pygame_sdl2/display.pyx":799 * default_title = title * * if main_window: # <<<<<<<<<<<<<< * main_window.set_caption(default_title) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 799, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":800 * * if main_window: * main_window.set_caption(default_title) # <<<<<<<<<<<<<< * * def get_caption(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_caption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":799 * default_title = title * * if main_window: # <<<<<<<<<<<<<< * main_window.set_caption(default_title) * */ } /* "pygame_sdl2/display.pyx":794 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":802 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_59get_caption(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_58get_caption, "get_caption()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_59get_caption = {"get_caption", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_59get_caption, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_58get_caption}; static PyObject *__pyx_pw_11pygame_sdl2_7display_59get_caption(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_caption (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_58get_caption(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_58get_caption(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_caption", 1); /* "pygame_sdl2/display.pyx":803 * * def get_caption(): * return default_title # <<<<<<<<<<<<<< * * def get_drawable_size(): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_title); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":802 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.get_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":805 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_61get_drawable_size(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_60get_drawable_size, "get_drawable_size()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_61get_drawable_size = {"get_drawable_size", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_61get_drawable_size, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_60get_drawable_size}; static PyObject *__pyx_pw_11pygame_sdl2_7display_61get_drawable_size(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_drawable_size (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_60get_drawable_size(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_60get_drawable_size(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_drawable_size", 1); /* "pygame_sdl2/display.pyx":806 * * def get_drawable_size(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_drawable_size() * return None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 806, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":807 * def get_drawable_size(): * if main_window: * return main_window.get_drawable_size() # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_drawable_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":806 * * def get_drawable_size(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_drawable_size() * return None */ } /* "pygame_sdl2/display.pyx":808 * if main_window: * return main_window.get_drawable_size() * return None # <<<<<<<<<<<<<< * * def get_size(): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":805 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_drawable_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":810 * return None * * def get_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_size() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_63get_size(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_62get_size, "get_size()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_63get_size = {"get_size", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_63get_size, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_62get_size}; static PyObject *__pyx_pw_11pygame_sdl2_7display_63get_size(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_size (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_62get_size(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_62get_size(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_size", 1); /* "pygame_sdl2/display.pyx":811 * * def get_size(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_size() * return None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 811, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":812 * def get_size(): * if main_window: * return main_window.get_size() # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":811 * * def get_size(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_size() * return None */ } /* "pygame_sdl2/display.pyx":813 * if main_window: * return main_window.get_size() * return None # <<<<<<<<<<<<<< * * def get_position(): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":810 * return None * * def get_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_size() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":815 * return None * * def get_position(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_position() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_65get_position(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_64get_position, "get_position()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_65get_position = {"get_position", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_65get_position, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_64get_position}; static PyObject *__pyx_pw_11pygame_sdl2_7display_65get_position(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_position (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_64get_position(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_64get_position(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_position", 1); /* "pygame_sdl2/display.pyx":816 * * def get_position(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_position() * return None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":817 * def get_position(): * if main_window: * return main_window.get_position() # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_position); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":816 * * def get_position(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_position() * return None */ } /* "pygame_sdl2/display.pyx":818 * if main_window: * return main_window.get_position() * return None # <<<<<<<<<<<<<< * * def set_position(pos): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":815 * return None * * def get_position(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_position() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_position", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":820 * return None * * def set_position(pos): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_position(pos) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_67set_position(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_66set_position, "set_position(pos)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_67set_position = {"set_position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_67set_position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_66set_position}; static PyObject *__pyx_pw_11pygame_sdl2_7display_67set_position(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pos = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_position (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_position") < 0)) __PYX_ERR(0, 820, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pos = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_position", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 820, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_position", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_66set_position(__pyx_self, __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_66set_position(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_position", 1); /* "pygame_sdl2/display.pyx":821 * * def set_position(pos): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_position(pos) * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 821, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":822 * def set_position(pos): * if main_window: * return main_window.set_position(pos) # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_position); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_pos}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":821 * * def set_position(pos): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_position(pos) * return False */ } /* "pygame_sdl2/display.pyx":823 * if main_window: * return main_window.set_position(pos) * return False # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":820 * return None * * def set_position(pos): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_position(pos) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.set_position", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":826 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_69get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_68get_num_video_displays, "get_num_video_displays()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_69get_num_video_displays = {"get_num_video_displays", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_69get_num_video_displays, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_68get_num_video_displays}; static PyObject *__pyx_pw_11pygame_sdl2_7display_69get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_video_displays (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_68get_num_video_displays(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_68get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_num_video_displays", 1); /* "pygame_sdl2/display.pyx":827 * * def get_num_video_displays(): * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<< * if rv < 0: * raise error() */ __pyx_v_rv = SDL_GetNumVideoDisplays(); /* "pygame_sdl2/display.pyx":828 * def get_num_video_displays(): * rv = SDL_GetNumVideoDisplays() * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_rv < 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":829 * rv = SDL_GetNumVideoDisplays() * if rv < 0: * raise error() # <<<<<<<<<<<<<< * * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 829, __pyx_L1_error) /* "pygame_sdl2/display.pyx":828 * def get_num_video_displays(): * rv = SDL_GetNumVideoDisplays() * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":831 * raise error() * * return rv # <<<<<<<<<<<<<< * * def get_display_bounds(index): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":826 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_num_video_displays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":833 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_71get_display_bounds(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_70get_display_bounds, "get_display_bounds(index)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_71get_display_bounds = {"get_display_bounds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_71get_display_bounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_70get_display_bounds}; static PyObject *__pyx_pw_11pygame_sdl2_7display_71get_display_bounds(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_index = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_display_bounds (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 833, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_display_bounds") < 0)) __PYX_ERR(0, 833, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_display_bounds", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 833, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.get_display_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_70get_display_bounds(__pyx_self, __pyx_v_index); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_70get_display_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index) { SDL_Rect __pyx_v_rect; CYTHON_UNUSED int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_display_bounds", 1); /* "pygame_sdl2/display.pyx":835 * def get_display_bounds(index): * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) # <<<<<<<<<<<<<< * * return (rect.x, rect.y, rect.w, rect.h) */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 835, __pyx_L1_error) __pyx_v_rv = SDL_GetDisplayBounds(__pyx_t_1, (&__pyx_v_rect)); /* "pygame_sdl2/display.pyx":837 * rv = SDL_GetDisplayBounds(index, &rect) * * return (rect.x, rect.y, rect.w, rect.h) # <<<<<<<<<<<<<< * * def set_screensaver(state): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rect.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rect.y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rect.w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rect.h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":833 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.get_display_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":839 * return (rect.x, rect.y, rect.w, rect.h) * * def set_screensaver(state): # <<<<<<<<<<<<<< * """ * Sets the screenslaver to `state`. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_73set_screensaver(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_72set_screensaver, "set_screensaver(state)\n\n Sets the screenslaver to `state`.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_73set_screensaver = {"set_screensaver", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_73set_screensaver, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_72set_screensaver}; static PyObject *__pyx_pw_11pygame_sdl2_7display_73set_screensaver(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_screensaver (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 839, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_screensaver") < 0)) __PYX_ERR(0, 839, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_screensaver", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 839, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_screensaver", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_72set_screensaver(__pyx_self, __pyx_v_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_72set_screensaver(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_screensaver", 1); /* "pygame_sdl2/display.pyx":844 * """ * * if state: # <<<<<<<<<<<<<< * SDL_EnableScreenSaver() * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_state); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 844, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":845 * * if state: * SDL_EnableScreenSaver() # <<<<<<<<<<<<<< * else: * SDL_DisableScreenSaver() */ SDL_EnableScreenSaver(); /* "pygame_sdl2/display.pyx":844 * """ * * if state: # <<<<<<<<<<<<<< * SDL_EnableScreenSaver() * else: */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":847 * SDL_EnableScreenSaver() * else: * SDL_DisableScreenSaver() # <<<<<<<<<<<<<< * * def get_platform(): */ /*else*/ { SDL_DisableScreenSaver(); } __pyx_L3:; /* "pygame_sdl2/display.pyx":839 * return (rect.x, rect.y, rect.w, rect.h) * * def set_screensaver(state): # <<<<<<<<<<<<<< * """ * Sets the screenslaver to `state`. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.set_screensaver", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":849 * SDL_DisableScreenSaver() * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform().decode("utf-8") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_75get_platform(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_74get_platform, "get_platform()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_75get_platform = {"get_platform", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_75get_platform, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_74get_platform}; static PyObject *__pyx_pw_11pygame_sdl2_7display_75get_platform(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_platform (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_74get_platform(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_74get_platform(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_platform", 1); /* "pygame_sdl2/display.pyx":850 * * def get_platform(): * return SDL_GetPlatform().decode("utf-8") # <<<<<<<<<<<<<< * * cdef api SDL_Window *PyWindow_AsWindow(window): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = SDL_GetPlatform(); __pyx_t_2 = __Pyx_ssize_strlen(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 850, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_1, 0, __pyx_t_2, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_r = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":849 * SDL_DisableScreenSaver() * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform().decode("utf-8") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.get_platform", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":852 * return SDL_GetPlatform().decode("utf-8") * * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<< * """ * Returns a pointer to the SDL_Window corresponding to `window`. If `window` */ static SDL_Window *__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow(PyObject *__pyx_v_window) { SDL_Window *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("PyWindow_AsWindow", 0); __Pyx_INCREF(__pyx_v_window); /* "pygame_sdl2/display.pyx":859 * """ * * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ __pyx_t_1 = (__pyx_v_window == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":860 * * if window is None: * window = main_window # <<<<<<<<<<<<<< * * if window is None: */ __Pyx_INCREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_window, ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); /* "pygame_sdl2/display.pyx":859 * """ * * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ } /* "pygame_sdl2/display.pyx":862 * window = main_window * * if window is None: # <<<<<<<<<<<<<< * return NULL * */ __pyx_t_1 = (__pyx_v_window == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":863 * * if window is None: * return NULL # <<<<<<<<<<<<<< * * return ( window).window */ __pyx_r = NULL; goto __pyx_L0; /* "pygame_sdl2/display.pyx":862 * window = main_window * * if window is None: # <<<<<<<<<<<<<< * return NULL * */ } /* "pygame_sdl2/display.pyx":865 * return NULL * * return ( window).window # <<<<<<<<<<<<<< */ __pyx_r = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_window)->window; goto __pyx_L0; /* "pygame_sdl2/display.pyx":852 * return SDL_GetPlatform().decode("utf-8") * * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<< * """ * Returns a pointer to the SDL_Window corresponding to `window`. If `window` */ /* function exit code */ __pyx_L0:; __Pyx_XDECREF(__pyx_v_window); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_7display_Window(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_7display_Window *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)o); p->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_7display_Window(PyObject *o) { struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_7display_Window) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); if (p->__weakref__) PyObject_ClearWeakRefs(o); Py_CLEAR(p->surface); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_7display_Window(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o; if (p->surface) { e = (*v)(((PyObject *)p->surface), a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_7display_Window(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o; tmp = ((PyObject*)p->surface); p->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_7display_6Window_surface(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_7display_6Window_7surface_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_7display_6Window_surface(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_7display_6Window_7surface_3__set__(o, v); } else { return __pyx_pw_11pygame_sdl2_7display_6Window_7surface_5__del__(o); } } static PyMethodDef __pyx_methods_11pygame_sdl2_7display_Window[] = { {"create_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_2create_surface}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_4destroy}, {"resize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_7resize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_6resize}, {"recreate_gl_context", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_9recreate_gl_context, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_8recreate_gl_context}, {"get_window_flags", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_11get_window_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_10get_window_flags}, {"proxy_window_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_13proxy_window_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_12proxy_window_surface}, {"flip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_15flip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_14flip}, {"get_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_17get_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_16get_surface}, {"update", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_19update, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_18update}, {"get_wm_info", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_21get_wm_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_20get_wm_info}, {"get_active", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_23get_active, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_22get_active}, {"iconify", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_25iconify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_24iconify}, {"toggle_fullscreen", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_27toggle_fullscreen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_26toggle_fullscreen}, {"set_gamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_28set_gamma}, {"set_gamma_ramp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_31set_gamma_ramp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_30set_gamma_ramp}, {"set_icon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_33set_icon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_32set_icon}, {"set_caption", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_35set_caption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_34set_caption}, {"get_drawable_size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_37get_drawable_size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_36get_drawable_size}, {"get_size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_39get_size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_38get_size}, {"restore", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_41restore, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_40restore}, {"maximize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_43maximize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_42maximize}, {"minimize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_45minimize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_44minimize}, {"get_sdl_window_pointer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer}, {"get_position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_49get_position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_48get_position}, {"set_position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_51set_position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_50set_position}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_53__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_52__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_55__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_54__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_7display_Window[] = { {(char *)"surface", __pyx_getprop_11pygame_sdl2_7display_6Window_surface, __pyx_setprop_11pygame_sdl2_7display_6Window_surface, (char *)PyDoc_STR("surface: pygame_sdl2.surface.Surface"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_7display_Window_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_7display_Window}, {Py_tp_doc, (void *)PyDoc_STR("Window(title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED), Surface shape=None)")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_7display_Window}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_7display_Window}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_7display_Window}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_7display_Window}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_7display_6Window_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_7display_Window}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_7display_Window_spec = { "pygame_sdl2.display.Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_7display_Window_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_7display_Window = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.display.""Window", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_7display_Window, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Window(title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED), Surface shape=None)"), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_7display_Window, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_7display_Window, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_7display_Window, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_7display_Window, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_7display_6Window_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_7display_Window, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 1, 0}, {&__pyx_kp_s_Couldn_t_allocate_rectangles, __pyx_k_Couldn_t_allocate_rectangles, sizeof(__pyx_k_Couldn_t_allocate_rectangles), 0, 0, 1, 0}, {&__pyx_n_s_GL_SWAP_CONTROL, __pyx_k_GL_SWAP_CONTROL, sizeof(__pyx_k_GL_SWAP_CONTROL), 0, 0, 1, 1}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_n_s_Info, __pyx_k_Info, sizeof(__pyx_k_Info), 0, 0, 1, 1}, {&__pyx_n_s_Info___init, __pyx_k_Info___init, sizeof(__pyx_k_Info___init), 0, 0, 1, 1}, {&__pyx_n_s_Info___repr, __pyx_k_Info___repr, sizeof(__pyx_k_Info___repr), 0, 0, 1, 1}, {&__pyx_kp_s_Info_r, __pyx_k_Info_r, sizeof(__pyx_k_Info_r), 0, 0, 1, 0}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_n_s_PYGAME_IOS, __pyx_k_PYGAME_IOS, sizeof(__pyx_k_PYGAME_IOS), 0, 0, 1, 1}, {&__pyx_n_s_PYGAME_SDL2, __pyx_k_PYGAME_SDL2, sizeof(__pyx_k_PYGAME_SDL2), 0, 0, 1, 1}, {&__pyx_n_s_PYGAME_SDL2_AVOID_GL, __pyx_k_PYGAME_SDL2_AVOID_GL, sizeof(__pyx_k_PYGAME_SDL2_AVOID_GL), 0, 0, 1, 1}, {&__pyx_n_s_RESIZE_FLAGS, __pyx_k_RESIZE_FLAGS, sizeof(__pyx_k_RESIZE_FLAGS), 0, 0, 1, 1}, {&__pyx_n_s_SRCALPHA, __pyx_k_SRCALPHA, sizeof(__pyx_k_SRCALPHA), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_Window, __pyx_k_Window, sizeof(__pyx_k_Window), 0, 0, 1, 1}, {&__pyx_n_s_Window___reduce_cython, __pyx_k_Window___reduce_cython, sizeof(__pyx_k_Window___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Window___setstate_cython, __pyx_k_Window___setstate_cython, sizeof(__pyx_k_Window___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Window_create_surface, __pyx_k_Window_create_surface, sizeof(__pyx_k_Window_create_surface), 0, 0, 1, 1}, {&__pyx_n_s_Window_destroy, __pyx_k_Window_destroy, sizeof(__pyx_k_Window_destroy), 0, 0, 1, 1}, {&__pyx_n_s_Window_flip, __pyx_k_Window_flip, sizeof(__pyx_k_Window_flip), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_active, __pyx_k_Window_get_active, sizeof(__pyx_k_Window_get_active), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_drawable_size, __pyx_k_Window_get_drawable_size, sizeof(__pyx_k_Window_get_drawable_size), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_position, __pyx_k_Window_get_position, sizeof(__pyx_k_Window_get_position), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_sdl_window_pointer, __pyx_k_Window_get_sdl_window_pointer, sizeof(__pyx_k_Window_get_sdl_window_pointer), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_size, __pyx_k_Window_get_size, sizeof(__pyx_k_Window_get_size), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_surface, __pyx_k_Window_get_surface, sizeof(__pyx_k_Window_get_surface), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_window_flags, __pyx_k_Window_get_window_flags, sizeof(__pyx_k_Window_get_window_flags), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_wm_info, __pyx_k_Window_get_wm_info, sizeof(__pyx_k_Window_get_wm_info), 0, 0, 1, 1}, {&__pyx_n_s_Window_iconify, __pyx_k_Window_iconify, sizeof(__pyx_k_Window_iconify), 0, 0, 1, 1}, {&__pyx_n_s_Window_maximize, __pyx_k_Window_maximize, sizeof(__pyx_k_Window_maximize), 0, 0, 1, 1}, {&__pyx_n_s_Window_minimize, __pyx_k_Window_minimize, sizeof(__pyx_k_Window_minimize), 0, 0, 1, 1}, {&__pyx_n_s_Window_proxy_window_surface, __pyx_k_Window_proxy_window_surface, sizeof(__pyx_k_Window_proxy_window_surface), 0, 0, 1, 1}, {&__pyx_n_s_Window_recreate_gl_context, __pyx_k_Window_recreate_gl_context, sizeof(__pyx_k_Window_recreate_gl_context), 0, 0, 1, 1}, {&__pyx_n_s_Window_resize, __pyx_k_Window_resize, sizeof(__pyx_k_Window_resize), 0, 0, 1, 1}, {&__pyx_n_s_Window_restore, __pyx_k_Window_restore, sizeof(__pyx_k_Window_restore), 0, 0, 1, 1}, {&__pyx_n_s_Window_set_caption, __pyx_k_Window_set_caption, sizeof(__pyx_k_Window_set_caption), 0, 0, 1, 1}, {&__pyx_n_s_Window_set_gamma, __pyx_k_Window_set_gamma, sizeof(__pyx_k_Window_set_gamma), 0, 0, 1, 1}, {&__pyx_n_s_Window_set_gamma_ramp, __pyx_k_Window_set_gamma_ramp, sizeof(__pyx_k_Window_set_gamma_ramp), 0, 0, 1, 1}, {&__pyx_n_s_Window_set_icon, __pyx_k_Window_set_icon, sizeof(__pyx_k_Window_set_icon), 0, 0, 1, 1}, {&__pyx_n_s_Window_set_position, __pyx_k_Window_set_position, sizeof(__pyx_k_Window_set_position), 0, 0, 1, 1}, {&__pyx_n_s_Window_toggle_fullscreen, __pyx_k_Window_toggle_fullscreen, sizeof(__pyx_k_Window_toggle_fullscreen), 0, 0, 1, 1}, {&__pyx_n_s_Window_update, __pyx_k_Window_update, sizeof(__pyx_k_Window_update), 0, 0, 1, 1}, {&__pyx_n_s__116, __pyx_k__116, sizeof(__pyx_k__116), 0, 0, 1, 1}, {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, {&__pyx_n_s_always, __pyx_k_always, sizeof(__pyx_k_always), 0, 0, 1, 1}, {&__pyx_n_s_androidembed, __pyx_k_androidembed, sizeof(__pyx_k_androidembed), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_bitsize, __pyx_k_bitsize, sizeof(__pyx_k_bitsize), 0, 0, 1, 1}, {&__pyx_n_s_blit_hw, __pyx_k_blit_hw, sizeof(__pyx_k_blit_hw), 0, 0, 1, 1}, {&__pyx_n_s_blit_hw_A, __pyx_k_blit_hw_A, sizeof(__pyx_k_blit_hw_A), 0, 0, 1, 1}, {&__pyx_n_s_blit_hw_CC, __pyx_k_blit_hw_CC, sizeof(__pyx_k_blit_hw_CC), 0, 0, 1, 1}, {&__pyx_n_s_blit_sw, __pyx_k_blit_sw, sizeof(__pyx_k_blit_sw), 0, 0, 1, 1}, {&__pyx_n_s_blit_sw_A, __pyx_k_blit_sw_A, sizeof(__pyx_k_blit_sw_A), 0, 0, 1, 1}, {&__pyx_n_s_blit_sw_CC, __pyx_k_blit_sw_CC, sizeof(__pyx_k_blit_sw_CC), 0, 0, 1, 1}, {&__pyx_n_s_blue, __pyx_k_blue, sizeof(__pyx_k_blue), 0, 0, 1, 1}, {&__pyx_n_s_blue_gamma, __pyx_k_blue_gamma, sizeof(__pyx_k_blue_gamma), 0, 0, 1, 1}, {&__pyx_n_s_bytesize, __pyx_k_bytesize, sizeof(__pyx_k_bytesize), 0, 0, 1, 1}, {&__pyx_n_s_c_void_p, __pyx_k_c_void_p, sizeof(__pyx_k_c_void_p), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, {&__pyx_n_s_create_surface, __pyx_k_create_surface, sizeof(__pyx_k_create_surface), 0, 0, 1, 1}, {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1}, {&__pyx_n_s_cur_height, __pyx_k_cur_height, sizeof(__pyx_k_cur_height), 0, 0, 1, 1}, {&__pyx_n_s_cur_width, __pyx_k_cur_width, sizeof(__pyx_k_cur_width), 0, 0, 1, 1}, {&__pyx_n_s_current_h, __pyx_k_current_h, sizeof(__pyx_k_current_h), 0, 0, 1, 1}, {&__pyx_n_s_current_w, __pyx_k_current_w, sizeof(__pyx_k_current_w), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_default_icon, __pyx_k_default_icon, sizeof(__pyx_k_default_icon), 0, 0, 1, 1}, {&__pyx_n_s_default_swap_control, __pyx_k_default_swap_control, sizeof(__pyx_k_default_swap_control), 0, 0, 1, 1}, {&__pyx_n_s_default_title, __pyx_k_default_title, sizeof(__pyx_k_default_title), 0, 0, 1, 1}, {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1}, {&__pyx_n_s_destroy, __pyx_k_destroy, sizeof(__pyx_k_destroy), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_dm, __pyx_k_dm, sizeof(__pyx_k_dm), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 0, 0, 1, 1}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_flip, __pyx_k_flip, sizeof(__pyx_k_flip), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_fullscreen, __pyx_k_fullscreen, sizeof(__pyx_k_fullscreen), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_active, __pyx_k_get_active, sizeof(__pyx_k_get_active), 0, 0, 1, 1}, {&__pyx_n_s_get_caption, __pyx_k_get_caption, sizeof(__pyx_k_get_caption), 0, 0, 1, 1}, {&__pyx_n_s_get_display_bounds, __pyx_k_get_display_bounds, sizeof(__pyx_k_get_display_bounds), 0, 0, 1, 1}, {&__pyx_n_s_get_drawable_size, __pyx_k_get_drawable_size, sizeof(__pyx_k_get_drawable_size), 0, 0, 1, 1}, {&__pyx_n_s_get_driver, __pyx_k_get_driver, sizeof(__pyx_k_get_driver), 0, 0, 1, 1}, {&__pyx_n_s_get_hint, __pyx_k_get_hint, sizeof(__pyx_k_get_hint), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_num_video_displays, __pyx_k_get_num_video_displays, sizeof(__pyx_k_get_num_video_displays), 0, 0, 1, 1}, {&__pyx_n_s_get_platform, __pyx_k_get_platform, sizeof(__pyx_k_get_platform), 0, 0, 1, 1}, {&__pyx_n_s_get_position, __pyx_k_get_position, sizeof(__pyx_k_get_position), 0, 0, 1, 1}, {&__pyx_n_s_get_sdl_window_pointer, __pyx_k_get_sdl_window_pointer, sizeof(__pyx_k_get_sdl_window_pointer), 0, 0, 1, 1}, {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1}, {&__pyx_n_s_get_surface, __pyx_k_get_surface, sizeof(__pyx_k_get_surface), 0, 0, 1, 1}, {&__pyx_n_s_get_window, __pyx_k_get_window, sizeof(__pyx_k_get_window), 0, 0, 1, 1}, {&__pyx_n_s_get_window_flags, __pyx_k_get_window_flags, sizeof(__pyx_k_get_window_flags), 0, 0, 1, 1}, {&__pyx_n_s_get_wm_info, __pyx_k_get_wm_info, sizeof(__pyx_k_get_wm_info), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_gl_get_attribute, __pyx_k_gl_get_attribute, sizeof(__pyx_k_gl_get_attribute), 0, 0, 1, 1}, {&__pyx_n_s_gl_load_library, __pyx_k_gl_load_library, sizeof(__pyx_k_gl_load_library), 0, 0, 1, 1}, {&__pyx_n_s_gl_reset_attributes, __pyx_k_gl_reset_attributes, sizeof(__pyx_k_gl_reset_attributes), 0, 0, 1, 1}, {&__pyx_n_s_gl_set_attribute, __pyx_k_gl_set_attribute, sizeof(__pyx_k_gl_set_attribute), 0, 0, 1, 1}, {&__pyx_n_s_gl_unload_library, __pyx_k_gl_unload_library, sizeof(__pyx_k_gl_unload_library), 0, 0, 1, 1}, {&__pyx_n_s_green, __pyx_k_green, sizeof(__pyx_k_green), 0, 0, 1, 1}, {&__pyx_n_s_green_gamma, __pyx_k_green_gamma, sizeof(__pyx_k_green_gamma), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_n_s_hint, __pyx_k_hint, sizeof(__pyx_k_hint), 0, 0, 1, 1}, {&__pyx_n_s_hw, __pyx_k_hw, sizeof(__pyx_k_hw), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_iconify, __pyx_k_iconify, sizeof(__pyx_k_iconify), 0, 0, 1, 1}, {&__pyx_n_s_icontitle, __pyx_k_icontitle, sizeof(__pyx_k_icontitle), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_init_done, __pyx_k_init_done, sizeof(__pyx_k_init_done), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_ios, __pyx_k_ios, sizeof(__pyx_k_ios), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_list_modes, __pyx_k_list_modes, sizeof(__pyx_k_list_modes), 0, 0, 1, 1}, {&__pyx_n_s_losses, __pyx_k_losses, sizeof(__pyx_k_losses), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_main_done, __pyx_k_main_done, sizeof(__pyx_k_main_done), 0, 0, 1, 1}, {&__pyx_n_s_main_window, __pyx_k_main_window, sizeof(__pyx_k_main_window), 0, 0, 1, 1}, {&__pyx_n_s_masks, __pyx_k_masks, sizeof(__pyx_k_masks), 0, 0, 1, 1}, {&__pyx_n_s_maximize, __pyx_k_maximize, sizeof(__pyx_k_maximize), 0, 0, 1, 1}, {&__pyx_n_s_maximized, __pyx_k_maximized, sizeof(__pyx_k_maximized), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_minimize, __pyx_k_minimize, sizeof(__pyx_k_minimize), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_mode_ok, __pyx_k_mode_ok, sizeof(__pyx_k_mode_ok), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_num_modes, __pyx_k_num_modes, sizeof(__pyx_k_num_modes), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_opengl, __pyx_k_opengl, sizeof(__pyx_k_opengl), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1}, {&__pyx_n_s_proxy_window_surface, __pyx_k_proxy_window_surface, sizeof(__pyx_k_proxy_window_surface), 0, 0, 1, 1}, {&__pyx_n_s_pygame_hints, __pyx_k_pygame_hints, sizeof(__pyx_k_pygame_hints), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_display, __pyx_k_pygame_sdl2_display, sizeof(__pyx_k_pygame_sdl2_display), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_kp_s_pygame_window, __pyx_k_pygame_window, sizeof(__pyx_k_pygame_window), 0, 0, 1, 0}, {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_recreate_gl_context, __pyx_k_recreate_gl_context, sizeof(__pyx_k_recreate_gl_context), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_rectangles, __pyx_k_rectangles, sizeof(__pyx_k_rectangles), 0, 0, 1, 1}, {&__pyx_n_s_rects, __pyx_k_rects, sizeof(__pyx_k_rects), 0, 0, 1, 1}, {&__pyx_n_s_red, __pyx_k_red, sizeof(__pyx_k_red), 0, 0, 1, 1}, {&__pyx_n_s_red_gamma, __pyx_k_red_gamma, sizeof(__pyx_k_red_gamma), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_refresh_rate, __pyx_k_refresh_rate, sizeof(__pyx_k_refresh_rate), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1}, {&__pyx_n_s_resolution, __pyx_k_resolution, sizeof(__pyx_k_resolution), 0, 0, 1, 1}, {&__pyx_n_s_restore, __pyx_k_restore, sizeof(__pyx_k_restore), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_kp_s_self_gl_context_self_window_self, __pyx_k_self_gl_context_self_window_self, sizeof(__pyx_k_self_gl_context_self_window_self), 0, 0, 1, 0}, {&__pyx_n_s_set_caption, __pyx_k_set_caption, sizeof(__pyx_k_set_caption), 0, 0, 1, 1}, {&__pyx_n_s_set_gamma, __pyx_k_set_gamma, sizeof(__pyx_k_set_gamma), 0, 0, 1, 1}, {&__pyx_n_s_set_gamma_ramp, __pyx_k_set_gamma_ramp, sizeof(__pyx_k_set_gamma_ramp), 0, 0, 1, 1}, {&__pyx_n_s_set_icon, __pyx_k_set_icon, sizeof(__pyx_k_set_icon), 0, 0, 1, 1}, {&__pyx_n_s_set_mode, __pyx_k_set_mode, sizeof(__pyx_k_set_mode), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_set_position, __pyx_k_set_position, sizeof(__pyx_k_set_position), 0, 0, 1, 1}, {&__pyx_n_s_set_screensaver, __pyx_k_set_screensaver, sizeof(__pyx_k_set_screensaver), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, {&__pyx_n_s_shifts, __pyx_k_shifts, sizeof(__pyx_k_shifts), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_k_src_pygame_sdl2_display_pyx, sizeof(__pyx_k_src_pygame_sdl2_display_pyx), 0, 0, 1, 0}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_title, __pyx_k_title, sizeof(__pyx_k_title), 0, 0, 1, 1}, {&__pyx_n_s_toggle_fullscreen, __pyx_k_toggle_fullscreen, sizeof(__pyx_k_toggle_fullscreen), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_video_mem, __pyx_k_video_mem, sizeof(__pyx_k_video_mem), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_wm, __pyx_k_wm, sizeof(__pyx_k_wm), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 126, __pyx_L1_error) __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 597, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 405, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 469, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/display.pyx":131 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED), Surface shape=None): # <<<<<<<<<<<<<< * cdef SDL_WindowShapeMode shape_mode * */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/display.pyx":141 * # If we do not get the AVOID_GL hint, we always create a GL-compatible * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<< * gl_flag = 0 * else: */ __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_PYGAME_SDL2_AVOID_GL, __pyx_kp_s_0); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/display.pyx":242 * if self.window_surface.format.BitsPerPixel == 32: * * self.surface = Surface(()) # <<<<<<<<<<<<<< * self.surface.surface = self.window_surface * self.surface.owns_surface = False */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/display.pyx":405 * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<< * * try: */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Couldn_t_allocate_rectangles); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value, priority=1): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ __pyx_tuple__8 = PyTuple_Pack(3, __pyx_n_s_hint, __pyx_n_s_value, __pyx_n_s_priority); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_hint, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 40, __pyx_L1_error) __pyx_tuple__10 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "pygame_sdl2/display.pyx":54 * SDL_SetHintWithPriority(hint, value, priority) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_hint, __pyx_n_s_default); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_hint, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 54, __pyx_L1_error) /* "pygame_sdl2/display.pyx":68 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_sdl_main_init, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 68, __pyx_L1_error) /* "pygame_sdl2/display.pyx":84 * init_done = False * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * */ __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 84, __pyx_L1_error) /* "pygame_sdl2/display.pyx":102 * * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_quit, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 102, __pyx_L1_error) /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_init, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 117, __pyx_L1_error) /* "pygame_sdl2/display.pyx":219 * raise * * def create_surface(self): # <<<<<<<<<<<<<< * """ * Creates the surface associated with this window. */ __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_w, __pyx_n_s_h); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_create_surface, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 219, __pyx_L1_error) /* "pygame_sdl2/display.pyx":253 * * * def destroy(self): # <<<<<<<<<<<<<< * """ * This should be called before the window is deleted. */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_destroy, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 253, __pyx_L1_error) /* "pygame_sdl2/display.pyx":272 * SDL_DestroyWindow(self.window) * * def resize(self, size, opengl=False, fullscreen=None, maximized=None): # <<<<<<<<<<<<<< * """ * Resizes the window to `size`, which must be a width, height tuple. If opengl */ __pyx_tuple__21 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_size, __pyx_n_s_opengl, __pyx_n_s_fullscreen, __pyx_n_s_maximized, __pyx_n_s_flags, __pyx_n_s_cur_width, __pyx_n_s_cur_height, __pyx_n_s_width, __pyx_n_s_height); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_resize, 272, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 272, __pyx_L1_error) __pyx_tuple__23 = PyTuple_Pack(3, Py_False, Py_None, Py_None); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); /* "pygame_sdl2/display.pyx":332 * self.create_surface() * * def recreate_gl_context(self, always=False): # <<<<<<<<<<<<<< * """ * Check to see if the GL context was lost, and re-create it if it was. */ __pyx_tuple__24 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_always); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_recreate_gl_context, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 332, __pyx_L1_error) __pyx_tuple__26 = PyTuple_Pack(1, Py_False); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); /* "pygame_sdl2/display.pyx":350 * return True * * def get_window_flags(self): # <<<<<<<<<<<<<< * rv = SDL_GetWindowFlags(self.window) * */ __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_window_flags, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 350, __pyx_L1_error) /* "pygame_sdl2/display.pyx":360 * return rv * * def proxy_window_surface(self): # <<<<<<<<<<<<<< * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * */ __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_proxy_window_surface, 360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 360, __pyx_L1_error) /* "pygame_sdl2/display.pyx":363 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * * def flip(self): # <<<<<<<<<<<<<< * cdef const char *err * */ __pyx_tuple__30 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_err); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_flip, 363, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 363, __pyx_L1_error) /* "pygame_sdl2/display.pyx":385 * SDL_UpdateWindowSurface(self.window) * * def get_surface(self): # <<<<<<<<<<<<<< * return self.surface * */ __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_surface, 385, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 385, __pyx_L1_error) /* "pygame_sdl2/display.pyx":388 * return self.surface * * def update(self, rectangles=None): # <<<<<<<<<<<<<< * * cdef SDL_Rect *rects */ __pyx_tuple__33 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_rectangles, __pyx_n_s_rects, __pyx_n_s_count, __pyx_n_s_i); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_update, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 388, __pyx_L1_error) __pyx_tuple__35 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); /* "pygame_sdl2/display.pyx":421 * free(rects) * * def get_wm_info(self): # <<<<<<<<<<<<<< * return { } * */ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_wm_info, 421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 421, __pyx_L1_error) /* "pygame_sdl2/display.pyx":424 * return { } * * def get_active(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False */ __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_active, 424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 424, __pyx_L1_error) /* "pygame_sdl2/display.pyx":430 * return True * * def iconify(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * return True */ __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_iconify, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 430, __pyx_L1_error) /* "pygame_sdl2/display.pyx":434 * return True * * def toggle_fullscreen(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): */ __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_toggle_fullscreen, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 434, __pyx_L1_error) /* "pygame_sdl2/display.pyx":444 * return True * * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<< * if green is None: * green = red */ __pyx_tuple__40 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue, __pyx_n_s_red_gamma, __pyx_n_s_green_gamma, __pyx_n_s_blue_gamma); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma, 444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 444, __pyx_L1_error) __pyx_tuple__42 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); /* "pygame_sdl2/display.pyx":463 * return True * * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ __pyx_tuple__43 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue, __pyx_n_s_red_gamma, __pyx_n_s_green_gamma, __pyx_n_s_blue_gamma, __pyx_n_s_i); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma_ramp, 463, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 463, __pyx_L1_error) /* "pygame_sdl2/display.pyx":479 * return True * * def set_icon(self, Surface surface): # <<<<<<<<<<<<<< * SDL_SetWindowIcon(self.window, surface.surface) * */ __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_icon, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 479, __pyx_L1_error) /* "pygame_sdl2/display.pyx":482 * SDL_SetWindowIcon(self.window, surface.surface) * * def set_caption(self, title): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_title); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_caption, 482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 482, __pyx_L1_error) /* "pygame_sdl2/display.pyx":489 * SDL_SetWindowTitle(self.window, title) * * def get_drawable_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_drawable_size, 489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 489, __pyx_L1_error) /* "pygame_sdl2/display.pyx":496 * * * def get_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_size, 496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 496, __pyx_L1_error) /* "pygame_sdl2/display.pyx":502 * return w, h * * def restore(self): # <<<<<<<<<<<<<< * SDL_RestoreWindow(self.window) * */ __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_restore, 502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 502, __pyx_L1_error) /* "pygame_sdl2/display.pyx":505 * SDL_RestoreWindow(self.window) * * def maximize(self): # <<<<<<<<<<<<<< * SDL_MaximizeWindow(self.window) * */ __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_maximize, 505, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 505, __pyx_L1_error) /* "pygame_sdl2/display.pyx":508 * SDL_MaximizeWindow(self.window) * * def minimize(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * */ __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_minimize, 508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 508, __pyx_L1_error) /* "pygame_sdl2/display.pyx":511 * SDL_MinimizeWindow(self.window) * * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<< * """ * Returns the pointer to the SDL_Window corresponding to this window. */ __pyx_tuple__54 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctypes); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_sdl_window_pointer, 511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 511, __pyx_L1_error) /* "pygame_sdl2/display.pyx":519 * return ctypes.c_void_p( self.window) * * def get_position(self): # <<<<<<<<<<<<<< * cdef int x, y * */ __pyx_tuple__56 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_position, 519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 519, __pyx_L1_error) /* "pygame_sdl2/display.pyx":525 * return x, y * * def set_position(self, pos): # <<<<<<<<<<<<<< * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * */ __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_position, 525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 525, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" */ __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(1, 3, __pyx_L1_error) /* "pygame_sdl2/display.pyx":539 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ __pyx_tuple__63 = PyTuple_Pack(5, __pyx_n_s_resolution, __pyx_n_s_flags, __pyx_n_s_depth, __pyx_n_s_pos, __pyx_n_s_RESIZE_FLAGS); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_mode, 539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 539, __pyx_L1_error) /* "pygame_sdl2/display.pyx":560 * return main_window.surface * * def destroy(): # <<<<<<<<<<<<<< * global main_window * */ __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_destroy, 560, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 560, __pyx_L1_error) /* "pygame_sdl2/display.pyx":567 * main_window = None * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_surface, 567, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 567, __pyx_L1_error) /* "pygame_sdl2/display.pyx":573 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_window, 573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 573, __pyx_L1_error) /* "pygame_sdl2/display.pyx":581 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_flip, 581, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 581, __pyx_L1_error) /* "pygame_sdl2/display.pyx":585 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_rectangles); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_update, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 585, __pyx_L1_error) /* "pygame_sdl2/display.pyx":589 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_driver); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_driver, 589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 589, __pyx_L1_error) /* "pygame_sdl2/display.pyx":597 * return driver * * class Info(object): # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_tuple__73 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73); __pyx_tuple__74 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); /* "pygame_sdl2/display.pyx":599 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ __pyx_tuple__75 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dm, __pyx_n_s_format); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init_2, 599, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 599, __pyx_L1_error) /* "pygame_sdl2/display.pyx":658 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_repr, 658, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 658, __pyx_L1_error) /* "pygame_sdl2/display.pyx":662 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_wm_info, 662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 662, __pyx_L1_error) /* "pygame_sdl2/display.pyx":669 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ __pyx_tuple__79 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 669, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 669, __pyx_L1_error) /* "pygame_sdl2/display.pyx":682 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ __pyx_tuple__81 = PyTuple_Pack(8, __pyx_n_s_depth, __pyx_n_s_flags, __pyx_n_s_display, __pyx_n_s_num_modes, __pyx_n_s_i, __pyx_n_s_mode, __pyx_n_s_rv, __pyx_n_s_t); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_list_modes, 682, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 682, __pyx_L1_error) __pyx_tuple__83 = PyTuple_Pack(3, ((PyObject *)__pyx_int_0), ((PyObject *)__pyx_int_0), ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); /* "pygame_sdl2/display.pyx":707 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ __pyx_tuple__84 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_flags, __pyx_n_s_depth); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84); __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_mode_ok, 707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 707, __pyx_L1_error) /* "pygame_sdl2/display.pyx":714 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_reset_attributes, 714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 714, __pyx_L1_error) /* "pygame_sdl2/display.pyx":717 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ __pyx_tuple__87 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87); __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_set_attribute, 717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 717, __pyx_L1_error) /* "pygame_sdl2/display.pyx":737 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ __pyx_tuple__89 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89); __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_get_attribute, 737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 737, __pyx_L1_error) /* "pygame_sdl2/display.pyx":748 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ __pyx_tuple__91 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__91); __Pyx_GIVEREF(__pyx_tuple__91); __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_load_library, 748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 748, __pyx_L1_error) /* "pygame_sdl2/display.pyx":756 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_unload_library, 756, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 756, __pyx_L1_error) /* "pygame_sdl2/display.pyx":759 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_active, 759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 759, __pyx_L1_error) /* "pygame_sdl2/display.pyx":764 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_iconify, 764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 764, __pyx_L1_error) /* "pygame_sdl2/display.pyx":770 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_toggle_fullscreen, 770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 770, __pyx_L1_error) /* "pygame_sdl2/display.pyx":776 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ __pyx_tuple__97 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__97); __Pyx_GIVEREF(__pyx_tuple__97); __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma, 776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 776, __pyx_L1_error) /* "pygame_sdl2/display.pyx":781 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma_ramp, 781, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 781, __pyx_L1_error) /* "pygame_sdl2/display.pyx":786 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ __pyx_tuple__100 = PyTuple_Pack(1, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__100); __Pyx_GIVEREF(__pyx_tuple__100); __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_icon, 786, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 786, __pyx_L1_error) /* "pygame_sdl2/display.pyx":794 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ __pyx_tuple__102 = PyTuple_Pack(2, __pyx_n_s_title, __pyx_n_s_icontitle); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__102); __Pyx_GIVEREF(__pyx_tuple__102); __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_caption, 794, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 794, __pyx_L1_error) /* "pygame_sdl2/display.pyx":802 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_caption, 802, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 802, __pyx_L1_error) /* "pygame_sdl2/display.pyx":805 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_drawable_size, 805, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 805, __pyx_L1_error) /* "pygame_sdl2/display.pyx":810 * return None * * def get_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_size() */ __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_size, 810, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 810, __pyx_L1_error) /* "pygame_sdl2/display.pyx":815 * return None * * def get_position(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_position() */ __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_position, 815, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 815, __pyx_L1_error) /* "pygame_sdl2/display.pyx":820 * return None * * def set_position(pos): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_position(pos) */ __pyx_tuple__108 = PyTuple_Pack(1, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__108); __Pyx_GIVEREF(__pyx_tuple__108); __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_position, 820, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 820, __pyx_L1_error) /* "pygame_sdl2/display.pyx":826 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 826, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 826, __pyx_L1_error) /* "pygame_sdl2/display.pyx":833 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ __pyx_tuple__111 = PyTuple_Pack(3, __pyx_n_s_index, __pyx_n_s_rect, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__111); __Pyx_GIVEREF(__pyx_tuple__111); __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_display_bounds, 833, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 833, __pyx_L1_error) /* "pygame_sdl2/display.pyx":839 * return (rect.x, rect.y, rect.w, rect.h) * * def set_screensaver(state): # <<<<<<<<<<<<<< * """ * Sets the screenslaver to `state`. */ __pyx_tuple__113 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__113); __Pyx_GIVEREF(__pyx_tuple__113); __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_screensaver, 839, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 839, __pyx_L1_error) /* "pygame_sdl2/display.pyx":849 * SDL_DisableScreenSaver() * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform().decode("utf-8") * */ __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_platform, 849, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_268435456 = PyInt_FromLong(268435456L); if (unlikely(!__pyx_int_268435456)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_7display_main_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None); Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ if (__Pyx_ExportVoidPtr(__pyx_n_s_main_window, (void *)&__pyx_v_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("PyWindow_AsWindow", (void (*)(void))__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow, "SDL_Window *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_7display_Window = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_7display_Window_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) __PYX_ERR(0, 130, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_7display_Window_spec, __pyx_ptype_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 130, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_7display_Window = &__pyx_type_11pygame_sdl2_7display_Window; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 130, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_7display_Window->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_7display_Window->tp_dictoffset && __pyx_ptype_11pygame_sdl2_7display_Window->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_7display_Window->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Window, (PyObject *) __pyx_ptype_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 130, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_7display_Window->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_7display_Window->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7display_Window, __weakref__); #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 130, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(3, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_4rect_Rect),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_4rect_Rect) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_8(__pyx_t_1, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_display(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_display}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "display", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initdisplay(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initdisplay(void) #else __Pyx_PyMODINIT_FUNC PyInit_display(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_display(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_display(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'display' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("display", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "display" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_display(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__display) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.display")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.display", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); if (unlikely((__Pyx_modinit_variable_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/display.pyx":25 * * from libc.stdlib cimport calloc, free * from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * import pygame_sdl2 */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_SRCALPHA); __Pyx_GIVEREF(__pyx_n_s_SRCALPHA); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SRCALPHA)) __PYX_ERR(0, 25, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_GL_SWAP_CONTROL); __Pyx_GIVEREF(__pyx_n_s_GL_SWAP_CONTROL); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_GL_SWAP_CONTROL)) __PYX_ERR(0, 25, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SWAP_CONTROL, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":26 * from libc.stdlib cimport calloc, free * from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error)) __PYX_ERR(0, 26, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":27 * from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * import warnings */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":29 * import pygame_sdl2 * * import warnings # <<<<<<<<<<<<<< * import os * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":30 * * import warnings * import os # <<<<<<<<<<<<<< * * # True if we are on ios. */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":33 * * # True if we are on ios. * ios = ("PYGAME_IOS" in os.environ) # <<<<<<<<<<<<<< * * # This inits SDL proper, and should be called by the other init methods. */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_PYGAME_IOS, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ios, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":38 * * # A map from a PYGAME_SDL2 hint to what it was set to. * _pygame_hints = { } # <<<<<<<<<<<<<< * * def hint(hint, value, priority=1): */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_hints, __pyx_t_3) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value, priority=1): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_1hint, 0, __pyx_n_s_hint, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hint, __pyx_t_3) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":54 * SDL_SetHintWithPriority(hint, value, priority) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_3_get_hint, 0, __pyx_n_s_get_hint, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hint, __pyx_t_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":66 * * * main_done = False # <<<<<<<<<<<<<< * * def sdl_main_init(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_main_done, Py_False) < 0) __PYX_ERR(0, 66, __pyx_L1_error) /* "pygame_sdl2/display.pyx":68 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_5sdl_main_init, 0, __pyx_n_s_sdl_main_init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sdl_main_init, __pyx_t_3) < 0) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":82 * * # True if init has been called without quit being called. * init_done = False # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_done, Py_False) < 0) __PYX_ERR(0, 82, __pyx_L1_error) /* "pygame_sdl2/display.pyx":84 * init_done = False * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_7init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":102 * * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_9quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_11get_init, 0, __pyx_n_s_get_init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":122 * * # The window that is used by the various module globals. * main_window = None # <<<<<<<<<<<<<< * * try: */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/display.pyx":124 * main_window = None * * try: # <<<<<<<<<<<<<< * import androidembed * except ImportError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { /* "pygame_sdl2/display.pyx":125 * * try: * import androidembed # <<<<<<<<<<<<<< * except ImportError: * androidembed = None */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_androidembed, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_androidembed, __pyx_t_2) < 0) __PYX_ERR(0, 125, __pyx_L2_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":124 * main_window = None * * try: # <<<<<<<<<<<<<< * import androidembed * except ImportError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_try_end; __pyx_L2_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":126 * try: * import androidembed * except ImportError: # <<<<<<<<<<<<<< * androidembed = None * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); if (__pyx_t_8) { __Pyx_AddTraceback("pygame_sdl2.display", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_3) < 0) __PYX_ERR(0, 126, __pyx_L4_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":127 * import androidembed * except ImportError: * androidembed = None # <<<<<<<<<<<<<< * * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_androidembed, Py_None) < 0) __PYX_ERR(0, 127, __pyx_L4_except_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L3_exception_handled; } goto __pyx_L4_except_error; /* "pygame_sdl2/display.pyx":124 * main_window = None * * try: # <<<<<<<<<<<<<< * import androidembed * except ImportError: */ __pyx_L4_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_6, __pyx_t_7); goto __pyx_L1_error; __pyx_L3_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_6, __pyx_t_7); __pyx_L7_try_end:; } /* "pygame_sdl2/display.pyx":131 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED), Surface shape=None): # <<<<<<<<<<<<<< * cdef SDL_WindowShapeMode shape_mode * */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_k__2 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":219 * raise * * def create_surface(self): # <<<<<<<<<<<<<< * """ * Creates the surface associated with this window. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_3create_surface, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_create_surface, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_create_surface, __pyx_t_2) < 0) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":253 * * * def destroy(self): # <<<<<<<<<<<<<< * """ * This should be called before the window is deleted. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_destroy, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_destroy, __pyx_t_2) < 0) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":272 * SDL_DestroyWindow(self.window) * * def resize(self, size, opengl=False, fullscreen=None, maximized=None): # <<<<<<<<<<<<<< * """ * Resizes the window to `size`, which must be a width, height tuple. If opengl */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_7resize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_resize, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__23); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_resize, __pyx_t_2) < 0) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":332 * self.create_surface() * * def recreate_gl_context(self, always=False): # <<<<<<<<<<<<<< * """ * Check to see if the GL context was lost, and re-create it if it was. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_9recreate_gl_context, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_recreate_gl_context, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__26); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_recreate_gl_context, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":350 * return True * * def get_window_flags(self): # <<<<<<<<<<<<<< * rv = SDL_GetWindowFlags(self.window) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_11get_window_flags, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_window_flags, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_window_flags, __pyx_t_2) < 0) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":360 * return rv * * def proxy_window_surface(self): # <<<<<<<<<<<<<< * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_13proxy_window_surface, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_proxy_window_surface, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_proxy_window_surface, __pyx_t_2) < 0) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":363 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * * def flip(self): # <<<<<<<<<<<<<< * cdef const char *err * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_15flip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_flip, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_flip, __pyx_t_2) < 0) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":385 * SDL_UpdateWindowSurface(self.window) * * def get_surface(self): # <<<<<<<<<<<<<< * return self.surface * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_17get_surface, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_surface, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_surface, __pyx_t_2) < 0) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":388 * return self.surface * * def update(self, rectangles=None): # <<<<<<<<<<<<<< * * cdef SDL_Rect *rects */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_19update, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_update, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__35); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_update, __pyx_t_2) < 0) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":421 * free(rects) * * def get_wm_info(self): # <<<<<<<<<<<<<< * return { } * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_21get_wm_info, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_wm_info, __pyx_t_2) < 0) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":424 * return { } * * def get_active(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_23get_active, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_active, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_active, __pyx_t_2) < 0) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":430 * return True * * def iconify(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * return True */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_25iconify, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_iconify, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_iconify, __pyx_t_2) < 0) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":434 * return True * * def toggle_fullscreen(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_27toggle_fullscreen, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_toggle_fullscreen, __pyx_t_2) < 0) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":444 * return True * * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<< * if green is None: * green = red */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_29set_gamma, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_set_gamma, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__42); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_set_gamma, __pyx_t_2) < 0) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":463 * return True * * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_31set_gamma_ramp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_set_gamma_ramp, __pyx_t_2) < 0) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":479 * return True * * def set_icon(self, Surface surface): # <<<<<<<<<<<<<< * SDL_SetWindowIcon(self.window, surface.surface) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_33set_icon, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_set_icon, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_set_icon, __pyx_t_2) < 0) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":482 * SDL_SetWindowIcon(self.window, surface.surface) * * def set_caption(self, title): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_35set_caption, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_set_caption, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_set_caption, __pyx_t_2) < 0) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":489 * SDL_SetWindowTitle(self.window, title) * * def get_drawable_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_37get_drawable_size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_drawable_size, __pyx_t_2) < 0) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":496 * * * def get_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_39get_size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_size, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_size, __pyx_t_2) < 0) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":502 * return w, h * * def restore(self): # <<<<<<<<<<<<<< * SDL_RestoreWindow(self.window) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_41restore, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_restore, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_restore, __pyx_t_2) < 0) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":505 * SDL_RestoreWindow(self.window) * * def maximize(self): # <<<<<<<<<<<<<< * SDL_MaximizeWindow(self.window) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_43maximize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_maximize, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_maximize, __pyx_t_2) < 0) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":508 * SDL_MaximizeWindow(self.window) * * def minimize(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_45minimize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_minimize, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_minimize, __pyx_t_2) < 0) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":511 * SDL_MinimizeWindow(self.window) * * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<< * """ * Returns the pointer to the SDL_Window corresponding to this window. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_sdl_window_pointer, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_sdl_window_pointer, __pyx_t_2) < 0) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":519 * return ctypes.c_void_p( self.window) * * def get_position(self): # <<<<<<<<<<<<<< * cdef int x, y * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_49get_position, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_position, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_position, __pyx_t_2) < 0) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":525 * return x, y * * def set_position(self, pos): # <<<<<<<<<<<<<< * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_51set_position, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_set_position, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_set_position, __pyx_t_2) < 0) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_53__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_55__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":531 * * # The icon that's used for new windows. * default_icon = None # <<<<<<<<<<<<<< * * # The title that's used for new windows. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, Py_None) < 0) __PYX_ERR(0, 531, __pyx_L1_error) /* "pygame_sdl2/display.pyx":534 * * # The title that's used for new windows. * default_title = "pygame window" # <<<<<<<<<<<<<< * * # The default gl_swap_control */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_kp_s_pygame_window) < 0) __PYX_ERR(0, 534, __pyx_L1_error) /* "pygame_sdl2/display.pyx":537 * * # The default gl_swap_control * default_swap_control = 1 # <<<<<<<<<<<<<< * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_int_1) < 0) __PYX_ERR(0, 537, __pyx_L1_error) /* "pygame_sdl2/display.pyx":539 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_13set_mode, 0, __pyx_n_s_set_mode, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 539, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_3 = 0; __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_2)->__pyx_arg_pos = __pyx_t_9; __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_11pygame_sdl2_7display_76__defaults__); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_2) < 0) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":560 * return main_window.surface * * def destroy(): # <<<<<<<<<<<<<< * global main_window * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_15destroy, 0, __pyx_n_s_destroy, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_destroy, __pyx_t_2) < 0) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":567 * main_window = None * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_17get_surface, 0, __pyx_n_s_get_surface, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_surface, __pyx_t_2) < 0) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":573 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_19get_window, 0, __pyx_n_s_get_window, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_window, __pyx_t_2) < 0) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":581 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_21flip, 0, __pyx_n_s_flip, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_2) < 0) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":585 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_23update, 0, __pyx_n_s_update, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__35); if (PyDict_SetItem(__pyx_d, __pyx_n_s_update, __pyx_t_2) < 0) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":589 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_25get_driver, 0, __pyx_n_s_get_driver, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver, __pyx_t_2) < 0) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":597 * return driver * * class Info(object): # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_tuple__74); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_9, __pyx_t_2, __pyx_n_s_Info, __pyx_n_s_Info, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_display, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_2 != __pyx_tuple__74) { if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_tuple__74) < 0))) __PYX_ERR(0, 597, __pyx_L1_error) } /* "pygame_sdl2/display.pyx":599 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_1__init__, 0, __pyx_n_s_Info___init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init_2, __pyx_t_5) < 0) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":658 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__, 0, __pyx_n_s_Info___repr, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_5) < 0) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":597 * return driver * * class Info(object): # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_9, __pyx_n_s_Info, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Info, __pyx_t_5) < 0) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":662 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_27get_wm_info, 0, __pyx_n_s_get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_wm_info, __pyx_t_2) < 0) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":669 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays, 0, __pyx_n_s_get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_2) < 0) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":682 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_31list_modes, 0, __pyx_n_s_list_modes, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__83); if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_modes, __pyx_t_2) < 0) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":707 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_33mode_ok, 0, __pyx_n_s_mode_ok, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple_); if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_ok, __pyx_t_2) < 0) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":714 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes, 0, __pyx_n_s_gl_reset_attributes, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_reset_attributes, __pyx_t_2) < 0) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":717 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute, 0, __pyx_n_s_gl_set_attribute, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_set_attribute, __pyx_t_2) < 0) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":737 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute, 0, __pyx_n_s_gl_get_attribute, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_get_attribute, __pyx_t_2) < 0) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":748 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_41gl_load_library, 0, __pyx_n_s_gl_load_library, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_load_library, __pyx_t_2) < 0) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":756 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_43gl_unload_library, 0, __pyx_n_s_gl_unload_library, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_unload_library, __pyx_t_2) < 0) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":759 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_45get_active, 0, __pyx_n_s_get_active, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_active, __pyx_t_2) < 0) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":764 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_47iconify, 0, __pyx_n_s_iconify, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_iconify, __pyx_t_2) < 0) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":770 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen, 0, __pyx_n_s_toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_toggle_fullscreen, __pyx_t_2) < 0) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":776 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_51set_gamma, 0, __pyx_n_s_set_gamma, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__42); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma, __pyx_t_2) < 0) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":781 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp, 0, __pyx_n_s_set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma_ramp, __pyx_t_2) < 0) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":786 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_55set_icon, 0, __pyx_n_s_set_icon, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_icon, __pyx_t_2) < 0) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":794 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_57set_caption, 0, __pyx_n_s_set_caption, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__35); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_caption, __pyx_t_2) < 0) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":802 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_59get_caption, 0, __pyx_n_s_get_caption, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_caption, __pyx_t_2) < 0) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":805 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_61get_drawable_size, 0, __pyx_n_s_get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drawable_size, __pyx_t_2) < 0) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":810 * return None * * def get_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_size() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_63get_size, 0, __pyx_n_s_get_size, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_size, __pyx_t_2) < 0) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":815 * return None * * def get_position(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_position() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_65get_position, 0, __pyx_n_s_get_position, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_position, __pyx_t_2) < 0) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":820 * return None * * def set_position(pos): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_position(pos) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_67set_position, 0, __pyx_n_s_set_position, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_position, __pyx_t_2) < 0) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":826 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_69get_num_video_displays, 0, __pyx_n_s_get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_2) < 0) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":833 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_71get_display_bounds, 0, __pyx_n_s_get_display_bounds, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_display_bounds, __pyx_t_2) < 0) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":839 * return (rect.x, rect.y, rect.w, rect.h) * * def set_screensaver(state): # <<<<<<<<<<<<<< * """ * Sets the screenslaver to `state`. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_73set_screensaver, 0, __pyx_n_s_set_screensaver, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_screensaver, __pyx_t_2) < 0) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":849 * SDL_DisableScreenSaver() * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform().decode("utf-8") * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_75get_platform, 0, __pyx_n_s_get_platform, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_platform, __pyx_t_2) < 0) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Copyright 2014 Tom Rothamel * # */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.display", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.display"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__6; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_8 #define __PYX_HAVE_RT_ImportType_3_0_8 static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__7); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE SDL_HintPriority __Pyx_PyInt_As_SDL_HintPriority(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_HintPriority neg_one = (SDL_HintPriority) -1, const_zero = (SDL_HintPriority) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SDL_HintPriority) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_HintPriority) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SDL_HintPriority) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) >= 2 * PyLong_SHIFT)) { return (SDL_HintPriority) (((((SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0])); } } break; case 3: if ((8 * sizeof(SDL_HintPriority) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) >= 3 * PyLong_SHIFT)) { return (SDL_HintPriority) (((((((SDL_HintPriority)digits[2]) << PyLong_SHIFT) | (SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0])); } } break; case 4: if ((8 * sizeof(SDL_HintPriority) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) >= 4 * PyLong_SHIFT)) { return (SDL_HintPriority) (((((((((SDL_HintPriority)digits[3]) << PyLong_SHIFT) | (SDL_HintPriority)digits[2]) << PyLong_SHIFT) | (SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_HintPriority) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SDL_HintPriority) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_HintPriority, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_HintPriority) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_HintPriority, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SDL_HintPriority) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) - 1 > 2 * PyLong_SHIFT)) { return (SDL_HintPriority) (((SDL_HintPriority)-1)*(((((SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0]))); } } break; case 2: if ((8 * sizeof(SDL_HintPriority) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) - 1 > 2 * PyLong_SHIFT)) { return (SDL_HintPriority) ((((((SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0]))); } } break; case -3: if ((8 * sizeof(SDL_HintPriority) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) - 1 > 3 * PyLong_SHIFT)) { return (SDL_HintPriority) (((SDL_HintPriority)-1)*(((((((SDL_HintPriority)digits[2]) << PyLong_SHIFT) | (SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0]))); } } break; case 3: if ((8 * sizeof(SDL_HintPriority) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) - 1 > 3 * PyLong_SHIFT)) { return (SDL_HintPriority) ((((((((SDL_HintPriority)digits[2]) << PyLong_SHIFT) | (SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0]))); } } break; case -4: if ((8 * sizeof(SDL_HintPriority) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) - 1 > 4 * PyLong_SHIFT)) { return (SDL_HintPriority) (((SDL_HintPriority)-1)*(((((((((SDL_HintPriority)digits[3]) << PyLong_SHIFT) | (SDL_HintPriority)digits[2]) << PyLong_SHIFT) | (SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0]))); } } break; case 4: if ((8 * sizeof(SDL_HintPriority) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) - 1 > 4 * PyLong_SHIFT)) { return (SDL_HintPriority) ((((((((((SDL_HintPriority)digits[3]) << PyLong_SHIFT) | (SDL_HintPriority)digits[2]) << PyLong_SHIFT) | (SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0]))); } } break; } } #endif if ((sizeof(SDL_HintPriority) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_HintPriority, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_HintPriority) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_HintPriority, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (SDL_HintPriority) -1; } else { SDL_HintPriority val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_HintPriority) -1; val = __Pyx_PyInt_As_SDL_HintPriority(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_HintPriority"); return (SDL_HintPriority) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_HintPriority"); return (SDL_HintPriority) -1; } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint32_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint32_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(unsigned int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (unsigned int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT)) { return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); } } break; case 3: if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT)) { return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); } } break; case 4: if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT)) { return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(unsigned int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) { return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case 2: if ((8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) { return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case -3: if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) { return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case 3: if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) { return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case -4: if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT)) { return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case 4: if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT)) { return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; } } #endif if ((sizeof(unsigned int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { unsigned int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (unsigned int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (unsigned int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (unsigned int) -1; } else { stepval = __Pyx_NewRef(v); } val = (unsigned int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(unsigned int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((unsigned int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(unsigned int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((unsigned int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((unsigned int) 1) << (sizeof(unsigned int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (unsigned int) -1; } } else { unsigned int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (unsigned int) -1; val = __Pyx_PyInt_As_unsigned_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned int"); return (unsigned int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned int"); return (unsigned int) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_WindowFlags neg_one = (SDL_WindowFlags) -1, const_zero = (SDL_WindowFlags) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_WindowFlags) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_WindowFlags) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_WindowFlags) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_WindowFlags), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_WindowFlags)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint16_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint16_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) >= 2 * PyLong_SHIFT)) { return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) >= 3 * PyLong_SHIFT)) { return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) >= 4 * PyLong_SHIFT)) { return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint16_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint16_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint16_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { return (uint16_t) (((uint16_t)-1)*(((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { return (uint16_t) ((((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { return (uint16_t) (((uint16_t)-1)*(((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { return (uint16_t) ((((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) { return (uint16_t) (((uint16_t)-1)*(((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) { return (uint16_t) ((((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; } } #endif if ((sizeof(uint16_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint16_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint16_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint16_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint16_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint16_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint16_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint16_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint16_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint16_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint16_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint16_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint16_t) 1) << (sizeof(uint16_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint16_t) -1; } } else { uint16_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint16_t) -1; val = __Pyx_PyInt_As_uint16_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint16_t"); return (uint16_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint16_t"); return (uint16_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(unsigned long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(unsigned long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(unsigned long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(unsigned long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE SDL_GLattr __Pyx_PyInt_As_SDL_GLattr(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GLattr neg_one = (SDL_GLattr) -1, const_zero = (SDL_GLattr) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SDL_GLattr) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_GLattr) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SDL_GLattr) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) >= 2 * PyLong_SHIFT)) { return (SDL_GLattr) (((((SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0])); } } break; case 3: if ((8 * sizeof(SDL_GLattr) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) >= 3 * PyLong_SHIFT)) { return (SDL_GLattr) (((((((SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0])); } } break; case 4: if ((8 * sizeof(SDL_GLattr) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) >= 4 * PyLong_SHIFT)) { return (SDL_GLattr) (((((((((SDL_GLattr)digits[3]) << PyLong_SHIFT) | (SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_GLattr) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SDL_GLattr) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_GLattr) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SDL_GLattr) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) - 1 > 2 * PyLong_SHIFT)) { return (SDL_GLattr) (((SDL_GLattr)-1)*(((((SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case 2: if ((8 * sizeof(SDL_GLattr) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) - 1 > 2 * PyLong_SHIFT)) { return (SDL_GLattr) ((((((SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case -3: if ((8 * sizeof(SDL_GLattr) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) - 1 > 3 * PyLong_SHIFT)) { return (SDL_GLattr) (((SDL_GLattr)-1)*(((((((SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case 3: if ((8 * sizeof(SDL_GLattr) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) - 1 > 3 * PyLong_SHIFT)) { return (SDL_GLattr) ((((((((SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case -4: if ((8 * sizeof(SDL_GLattr) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) - 1 > 4 * PyLong_SHIFT)) { return (SDL_GLattr) (((SDL_GLattr)-1)*(((((((((SDL_GLattr)digits[3]) << PyLong_SHIFT) | (SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case 4: if ((8 * sizeof(SDL_GLattr) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) - 1 > 4 * PyLong_SHIFT)) { return (SDL_GLattr) ((((((((((SDL_GLattr)digits[3]) << PyLong_SHIFT) | (SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; } } #endif if ((sizeof(SDL_GLattr) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_GLattr) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (SDL_GLattr) -1; } else { SDL_GLattr val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_GLattr) -1; val = __Pyx_PyInt_As_SDL_GLattr(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_GLattr"); return (SDL_GLattr) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_GLattr"); return (SDL_GLattr) -1; } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__116); } return name; } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* VoidPtrExport */ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { PyObject *d; PyObject *cobj = 0; d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); Py_XINCREF(d); if (!d) { d = PyDict_New(); if (!d) goto bad; if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) goto bad; } cobj = PyCapsule_New(p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItem(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; cobj = PyCapsule_New(tmp.p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_8 #define __PYX_HAVE_RT_ImportFunction_3_0_8 static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709471.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.display_api.h0000664000175000017500000000361214760217137021323 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef __PYX_HAVE_API__pygame_sdl2__display #define __PYX_HAVE_API__pygame_sdl2__display #ifdef __MINGW64__ #define MS_WIN64 #endif #include "Python.h" static SDL_Window *(*__pyx_api_f_11pygame_sdl2_7display_PyWindow_AsWindow)(PyObject *) = 0; #define PyWindow_AsWindow __pyx_api_f_11pygame_sdl2_7display_PyWindow_AsWindow #ifndef __PYX_HAVE_RT_ImportFunction_3_0_8 #define __PYX_HAVE_RT_ImportFunction_3_0_8 static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int import_pygame_sdl2__display(void) { PyObject *module = 0; module = PyImport_ImportModule("pygame_sdl2.display"); if (!module) goto bad; if (__Pyx_ImportFunction_3_0_8(module, "PyWindow_AsWindow", (void (**)(void))&__pyx_api_f_11pygame_sdl2_7display_PyWindow_AsWindow, "SDL_Window *(PyObject *)") < 0) goto bad; Py_DECREF(module); module = 0; return 0; bad: Py_XDECREF(module); return -1; } #endif /* !__PYX_HAVE_API__pygame_sdl2__display */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709475.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.draw.c0000664000175000017500000204037214760217143017760 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__draw #define __PYX_HAVE_API__pygame_sdl2__draw /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/draw.pyx", "src/pygame_sdl2/surface.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 #define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_8 { __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.draw" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.draw" extern int __pyx_module_is_main_pygame_sdl2__draw; int __pyx_module_is_main_pygame_sdl2__draw = 0; /* Implementation of "pygame_sdl2.draw" */ /* #### Code section: global_var ### */ /* #### Code section: string_decls ### */ static const char __pyx_k_h[] = "h"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__3[] = "*"; static const char __pyx_k__4[] = "."; static const char __pyx_k_rx[] = "rx"; static const char __pyx_k_ry[] = "ry"; static const char __pyx_k_x1[] = "x1"; static const char __pyx_k_x2[] = "x2"; static const char __pyx_k_y1[] = "y1"; static const char __pyx_k_y2[] = "y2"; static const char __pyx_k__25[] = "?"; static const char __pyx_k_arc[] = "arc"; static const char __pyx_k_box[] = "box"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_clip[] = "clip"; static const char __pyx_k_line[] = "line"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_blend[] = "blend"; static const char __pyx_k_color[] = "color"; static const char __pyx_k_dirty[] = "dirty"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_lines[] = "lines"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_aaline[] = "aaline"; static const char __pyx_k_circle[] = "circle"; static const char __pyx_k_closed[] = "closed"; static const char __pyx_k_endpos[] = "endpos"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_radius[] = "radius"; static const char __pyx_k_aalines[] = "aalines"; static const char __pyx_k_ellipse[] = "ellipse"; static const char __pyx_k_end_pos[] = "end_pos"; static const char __pyx_k_gfxdraw[] = "gfxdraw"; static const char __pyx_k_polygon[] = "polygon"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_get_rect[] = "get_rect"; static const char __pyx_k_startpos[] = "startpos"; static const char __pyx_k_union_ip[] = "union_ip"; static const char __pyx_k_pointlist[] = "pointlist"; static const char __pyx_k_rectangle[] = "rectangle"; static const char __pyx_k_start_pos[] = "start_pos"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_stop_angle[] = "stop_angle"; static const char __pyx_k_thick_line[] = "thick_line"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_start_angle[] = "start_angle"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_filled_circle[] = "filled_circle"; static const char __pyx_k_filled_ellipse[] = "filled_ellipse"; static const char __pyx_k_filled_polygon[] = "filled_polygon"; static const char __pyx_k_Not_implemented[] = "Not implemented."; static const char __pyx_k_pygame_sdl2_draw[] = "pygame_sdl2.draw"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_gfxdraw[] = "pygame_sdl2.gfxdraw"; static const char __pyx_k_src_pygame_sdl2_draw_pyx[] = "src/pygame_sdl2/draw.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_rect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_2polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_4circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pos, PyObject *__pyx_v_radius, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_6ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_8arc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, CYTHON_UNUSED PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_start_angle, CYTHON_UNUSED PyObject *__pyx_v_stop_angle, CYTHON_UNUSED PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_10line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_start_pos, PyObject *__pyx_v_end_pos, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_12lines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_14aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_startpos, PyObject *__pyx_v_endpos, CYTHON_UNUSED PyObject *__pyx_v_blend); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_16aalines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, CYTHON_UNUSED PyObject *__pyx_v_blend); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_s_Not_implemented; PyObject *__pyx_n_s_Rect; PyObject *__pyx_n_s__25; PyObject *__pyx_n_s__3; PyObject *__pyx_kp_u__4; PyObject *__pyx_n_s_aaline; PyObject *__pyx_n_s_aalines; PyObject *__pyx_n_s_arc; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_blend; PyObject *__pyx_n_s_box; PyObject *__pyx_n_s_circle; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_clip; PyObject *__pyx_n_s_closed; PyObject *__pyx_n_s_color; PyObject *__pyx_n_s_dirty; PyObject *__pyx_n_s_ellipse; PyObject *__pyx_n_s_end_pos; PyObject *__pyx_n_s_endpos; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_filled_circle; PyObject *__pyx_n_s_filled_ellipse; PyObject *__pyx_n_s_filled_polygon; PyObject *__pyx_n_s_get_rect; PyObject *__pyx_n_s_gfxdraw; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_line; PyObject *__pyx_n_s_lines; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_pointlist; PyObject *__pyx_n_s_polygon; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_draw; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_gfxdraw; PyObject *__pyx_n_s_pygame_sdl2_rect; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_radius; PyObject *__pyx_n_s_rect; PyObject *__pyx_n_s_rectangle; PyObject *__pyx_n_s_rx; PyObject *__pyx_n_s_ry; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_draw_pyx; PyObject *__pyx_n_s_start_angle; PyObject *__pyx_n_s_start_pos; PyObject *__pyx_n_s_startpos; PyObject *__pyx_n_s_stop_angle; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_thick_line; PyObject *__pyx_n_s_union_ip; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_width; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_x1; PyObject *__pyx_n_s_x2; PyObject *__pyx_n_s_y; PyObject *__pyx_n_s_y1; PyObject *__pyx_n_s_y2; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_2; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__23; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__24; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_kp_s_Not_implemented); Py_CLEAR(clear_module_state->__pyx_n_s_Rect); Py_CLEAR(clear_module_state->__pyx_n_s__25); Py_CLEAR(clear_module_state->__pyx_n_s__3); Py_CLEAR(clear_module_state->__pyx_kp_u__4); Py_CLEAR(clear_module_state->__pyx_n_s_aaline); Py_CLEAR(clear_module_state->__pyx_n_s_aalines); Py_CLEAR(clear_module_state->__pyx_n_s_arc); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_blend); Py_CLEAR(clear_module_state->__pyx_n_s_box); Py_CLEAR(clear_module_state->__pyx_n_s_circle); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_clip); Py_CLEAR(clear_module_state->__pyx_n_s_closed); Py_CLEAR(clear_module_state->__pyx_n_s_color); Py_CLEAR(clear_module_state->__pyx_n_s_dirty); Py_CLEAR(clear_module_state->__pyx_n_s_ellipse); Py_CLEAR(clear_module_state->__pyx_n_s_end_pos); Py_CLEAR(clear_module_state->__pyx_n_s_endpos); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_filled_circle); Py_CLEAR(clear_module_state->__pyx_n_s_filled_ellipse); Py_CLEAR(clear_module_state->__pyx_n_s_filled_polygon); Py_CLEAR(clear_module_state->__pyx_n_s_get_rect); Py_CLEAR(clear_module_state->__pyx_n_s_gfxdraw); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_line); Py_CLEAR(clear_module_state->__pyx_n_s_lines); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_pointlist); Py_CLEAR(clear_module_state->__pyx_n_s_polygon); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_draw); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_gfxdraw); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rect); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_radius); Py_CLEAR(clear_module_state->__pyx_n_s_rect); Py_CLEAR(clear_module_state->__pyx_n_s_rectangle); Py_CLEAR(clear_module_state->__pyx_n_s_rx); Py_CLEAR(clear_module_state->__pyx_n_s_ry); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_draw_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start_angle); Py_CLEAR(clear_module_state->__pyx_n_s_start_pos); Py_CLEAR(clear_module_state->__pyx_n_s_startpos); Py_CLEAR(clear_module_state->__pyx_n_s_stop_angle); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_thick_line); Py_CLEAR(clear_module_state->__pyx_n_s_union_ip); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_x1); Py_CLEAR(clear_module_state->__pyx_n_s_x2); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_n_s_y1); Py_CLEAR(clear_module_state->__pyx_n_s_y2); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__24); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_kp_s_Not_implemented); Py_VISIT(traverse_module_state->__pyx_n_s_Rect); Py_VISIT(traverse_module_state->__pyx_n_s__25); Py_VISIT(traverse_module_state->__pyx_n_s__3); Py_VISIT(traverse_module_state->__pyx_kp_u__4); Py_VISIT(traverse_module_state->__pyx_n_s_aaline); Py_VISIT(traverse_module_state->__pyx_n_s_aalines); Py_VISIT(traverse_module_state->__pyx_n_s_arc); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_blend); Py_VISIT(traverse_module_state->__pyx_n_s_box); Py_VISIT(traverse_module_state->__pyx_n_s_circle); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_clip); Py_VISIT(traverse_module_state->__pyx_n_s_closed); Py_VISIT(traverse_module_state->__pyx_n_s_color); Py_VISIT(traverse_module_state->__pyx_n_s_dirty); Py_VISIT(traverse_module_state->__pyx_n_s_ellipse); Py_VISIT(traverse_module_state->__pyx_n_s_end_pos); Py_VISIT(traverse_module_state->__pyx_n_s_endpos); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_filled_circle); Py_VISIT(traverse_module_state->__pyx_n_s_filled_ellipse); Py_VISIT(traverse_module_state->__pyx_n_s_filled_polygon); Py_VISIT(traverse_module_state->__pyx_n_s_get_rect); Py_VISIT(traverse_module_state->__pyx_n_s_gfxdraw); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_line); Py_VISIT(traverse_module_state->__pyx_n_s_lines); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_pointlist); Py_VISIT(traverse_module_state->__pyx_n_s_polygon); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_draw); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_gfxdraw); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rect); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_radius); Py_VISIT(traverse_module_state->__pyx_n_s_rect); Py_VISIT(traverse_module_state->__pyx_n_s_rectangle); Py_VISIT(traverse_module_state->__pyx_n_s_rx); Py_VISIT(traverse_module_state->__pyx_n_s_ry); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_draw_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start_angle); Py_VISIT(traverse_module_state->__pyx_n_s_start_pos); Py_VISIT(traverse_module_state->__pyx_n_s_startpos); Py_VISIT(traverse_module_state->__pyx_n_s_stop_angle); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_thick_line); Py_VISIT(traverse_module_state->__pyx_n_s_union_ip); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_x1); Py_VISIT(traverse_module_state->__pyx_n_s_x2); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_n_s_y1); Py_VISIT(traverse_module_state->__pyx_n_s_y2); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__24); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_s_Not_implemented __pyx_mstate_global->__pyx_kp_s_Not_implemented #define __pyx_n_s_Rect __pyx_mstate_global->__pyx_n_s_Rect #define __pyx_n_s__25 __pyx_mstate_global->__pyx_n_s__25 #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3 #define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 #define __pyx_n_s_aaline __pyx_mstate_global->__pyx_n_s_aaline #define __pyx_n_s_aalines __pyx_mstate_global->__pyx_n_s_aalines #define __pyx_n_s_arc __pyx_mstate_global->__pyx_n_s_arc #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_blend __pyx_mstate_global->__pyx_n_s_blend #define __pyx_n_s_box __pyx_mstate_global->__pyx_n_s_box #define __pyx_n_s_circle __pyx_mstate_global->__pyx_n_s_circle #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_clip __pyx_mstate_global->__pyx_n_s_clip #define __pyx_n_s_closed __pyx_mstate_global->__pyx_n_s_closed #define __pyx_n_s_color __pyx_mstate_global->__pyx_n_s_color #define __pyx_n_s_dirty __pyx_mstate_global->__pyx_n_s_dirty #define __pyx_n_s_ellipse __pyx_mstate_global->__pyx_n_s_ellipse #define __pyx_n_s_end_pos __pyx_mstate_global->__pyx_n_s_end_pos #define __pyx_n_s_endpos __pyx_mstate_global->__pyx_n_s_endpos #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_filled_circle __pyx_mstate_global->__pyx_n_s_filled_circle #define __pyx_n_s_filled_ellipse __pyx_mstate_global->__pyx_n_s_filled_ellipse #define __pyx_n_s_filled_polygon __pyx_mstate_global->__pyx_n_s_filled_polygon #define __pyx_n_s_get_rect __pyx_mstate_global->__pyx_n_s_get_rect #define __pyx_n_s_gfxdraw __pyx_mstate_global->__pyx_n_s_gfxdraw #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_line __pyx_mstate_global->__pyx_n_s_line #define __pyx_n_s_lines __pyx_mstate_global->__pyx_n_s_lines #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_pointlist __pyx_mstate_global->__pyx_n_s_pointlist #define __pyx_n_s_polygon __pyx_mstate_global->__pyx_n_s_polygon #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_draw __pyx_mstate_global->__pyx_n_s_pygame_sdl2_draw #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_gfxdraw __pyx_mstate_global->__pyx_n_s_pygame_sdl2_gfxdraw #define __pyx_n_s_pygame_sdl2_rect __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rect #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_radius __pyx_mstate_global->__pyx_n_s_radius #define __pyx_n_s_rect __pyx_mstate_global->__pyx_n_s_rect #define __pyx_n_s_rectangle __pyx_mstate_global->__pyx_n_s_rectangle #define __pyx_n_s_rx __pyx_mstate_global->__pyx_n_s_rx #define __pyx_n_s_ry __pyx_mstate_global->__pyx_n_s_ry #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_draw_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_draw_pyx #define __pyx_n_s_start_angle __pyx_mstate_global->__pyx_n_s_start_angle #define __pyx_n_s_start_pos __pyx_mstate_global->__pyx_n_s_start_pos #define __pyx_n_s_startpos __pyx_mstate_global->__pyx_n_s_startpos #define __pyx_n_s_stop_angle __pyx_mstate_global->__pyx_n_s_stop_angle #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_thick_line __pyx_mstate_global->__pyx_n_s_thick_line #define __pyx_n_s_union_ip __pyx_mstate_global->__pyx_n_s_union_ip #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_x1 __pyx_mstate_global->__pyx_n_s_x1 #define __pyx_n_s_x2 __pyx_mstate_global->__pyx_n_s_x2 #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_n_s_y1 __pyx_mstate_global->__pyx_n_s_y1 #define __pyx_n_s_y2 __pyx_mstate_global->__pyx_n_s_y2 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 /* #### Code section: module_code ### */ /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_1rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_rect, "rect(Surface surface, color, rect, width=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_1rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_1rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_rect}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_1rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_width,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, 1); __PYX_ERR(0, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, 2); __PYX_ERR(0, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 26, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_rect = values[2]; __pyx_v_width = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 26, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 26, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_rect(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_rect, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_rect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/draw.pyx":27 * * def rect(Surface surface, color, rect, width=0): * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/draw.pyx":28 * def rect(Surface surface, color, rect, width=0): * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * * if width == 0: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_rect}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":27 * * def rect(Surface surface, color, rect, width=0): * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * */ } /* "pygame_sdl2/draw.pyx":30 * rect = Rect(rect) * * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.box(surface, rect, color) * else: */ __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_width, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 30, __pyx_L1_error) if (__pyx_t_3) { /* "pygame_sdl2/draw.pyx":31 * * if width == 0: * gfxdraw.box(surface, rect, color) # <<<<<<<<<<<<<< * else: * gfxdraw.rectangle(surface, rect, color) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_box); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, ((PyObject *)__pyx_v_surface), __pyx_v_rect, __pyx_v_color}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":30 * rect = Rect(rect) * * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.box(surface, rect, color) * else: */ goto __pyx_L4; } /* "pygame_sdl2/draw.pyx":33 * gfxdraw.box(surface, rect, color) * else: * gfxdraw.rectangle(surface, rect, color) # <<<<<<<<<<<<<< * n = 1 * while n < width: */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_rectangle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, ((PyObject *)__pyx_v_surface), __pyx_v_rect, __pyx_v_color}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":34 * else: * gfxdraw.rectangle(surface, rect, color) * n = 1 # <<<<<<<<<<<<<< * while n < width: * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":35 * gfxdraw.rectangle(surface, rect, color) * n = 1 * while n < width: # <<<<<<<<<<<<<< * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) * gfxdraw.rectangle(surface, r, color) */ while (1) { __pyx_t_1 = PyObject_RichCompare(__pyx_v_n, __pyx_v_width, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_3) break; /* "pygame_sdl2/draw.pyx":36 * n = 1 * while n < width: * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) # <<<<<<<<<<<<<< * gfxdraw.rectangle(surface, r, color) * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyNumber_Subtract(__pyx_t_5, __pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PyNumber_Subtract(__pyx_t_5, __pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_v_n, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyNumber_Add(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = __Pyx_PyInt_MultiplyObjC(__pyx_v_n, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = PyNumber_Add(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_t_7, __pyx_t_8, __pyx_t_10, __pyx_t_11}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":37 * while n < width: * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) * gfxdraw.rectangle(surface, r, color) # <<<<<<<<<<<<<< * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) * gfxdraw.rectangle(surface, r, color) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_rectangle); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, ((PyObject *)__pyx_v_surface), __pyx_v_r, __pyx_v_color}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":38 * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) * gfxdraw.rectangle(surface, r, color) * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) # <<<<<<<<<<<<<< * gfxdraw.rectangle(surface, r, color) * n += 1 */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Rect); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = PyNumber_Add(__pyx_t_4, __pyx_v_n); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_n, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyInt_MultiplyObjC(__pyx_v_n, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyNumber_Subtract(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_t_10, __pyx_t_8, __pyx_t_5, __pyx_t_9}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF_SET(__pyx_v_r, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":39 * gfxdraw.rectangle(surface, r, color) * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) * gfxdraw.rectangle(surface, r, color) # <<<<<<<<<<<<<< * n += 1 * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_rectangle); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_11, ((PyObject *)__pyx_v_surface), __pyx_v_r, __pyx_v_color}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":40 * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) * gfxdraw.rectangle(surface, r, color) * n += 1 # <<<<<<<<<<<<<< * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) * return dirty.clip(surface.get_rect()) */ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_1); __pyx_t_1 = 0; } } __pyx_L4:; /* "pygame_sdl2/draw.pyx":41 * gfxdraw.rectangle(surface, r, color) * n += 1 * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Rect); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = PyNumber_Subtract(__pyx_t_11, __pyx_v_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = PyNumber_Subtract(__pyx_t_11, __pyx_v_width); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyInt_MultiplyObjC(__pyx_v_width, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = PyNumber_Add(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyInt_MultiplyObjC(__pyx_v_width, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_t_5, __pyx_t_8, __pyx_t_4, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":42 * n += 1 * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def polygon(Surface surface, color, pointlist, width=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.draw.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_3polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_2polygon, "polygon(Surface surface, color, pointlist, width=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_3polygon = {"polygon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_3polygon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_2polygon}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_3polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_pointlist = 0; PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("polygon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_pointlist,&__pyx_n_s_width,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, 1); __PYX_ERR(0, 44, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointlist)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, 2); __PYX_ERR(0, 44, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "polygon") < 0)) __PYX_ERR(0, 44, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_pointlist = values[2]; __pyx_v_width = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 44, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 44, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_2polygon(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_pointlist, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_2polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width) { PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("polygon", 1); /* "pygame_sdl2/draw.pyx":45 * * def polygon(Surface surface, color, pointlist, width=0): * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_width, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 45, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/draw.pyx":46 * def polygon(Surface surface, color, pointlist, width=0): * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) # <<<<<<<<<<<<<< * dirty = Rect(pointlist[0], (1, 1)) * n = 1 */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filled_polygon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_pointlist, __pyx_v_color}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":47 * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) # <<<<<<<<<<<<<< * n = 1 * while n < len(pointlist): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_3, __pyx_tuple_}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_dirty = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":48 * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) * n = 1 # <<<<<<<<<<<<<< * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":49 * dirty = Rect(pointlist[0], (1, 1)) * n = 1 * while n < len(pointlist): # <<<<<<<<<<<<<< * dirty.union_ip(Rect(pointlist[n], (1,1))) * n += 1 */ while (1) { __pyx_t_7 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 49, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_RichCompare(__pyx_v_n, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_1) break; /* "pygame_sdl2/draw.pyx":50 * n = 1 * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) # <<<<<<<<<<<<<< * n += 1 * return dirty.clip(surface.get_rect()) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Rect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_8, __pyx_tuple_}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":51 * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) * n += 1 # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * else: */ __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_4); __pyx_t_4 = 0; } /* "pygame_sdl2/draw.pyx":52 * dirty.union_ip(Rect(pointlist[n], (1,1))) * n += 1 * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * else: * return lines(surface, color, True, pointlist, width) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":45 * * def polygon(Surface surface, color, pointlist, width=0): * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) */ } /* "pygame_sdl2/draw.pyx":54 * return dirty.clip(surface.get_rect()) * else: * return lines(surface, color, True, pointlist, width) # <<<<<<<<<<<<<< * * def circle(Surface surface, color, pos, radius, width=0): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_lines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_color, Py_True, __pyx_v_pointlist, __pyx_v_width}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 5+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.draw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_5circle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_4circle, "circle(Surface surface, color, pos, radius, width=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_5circle = {"circle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_5circle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_4circle}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_5circle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_pos = 0; PyObject *__pyx_v_radius = 0; PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("circle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_pos,&__pyx_n_s_radius,&__pyx_n_s_width,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 1); __PYX_ERR(0, 56, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 2); __PYX_ERR(0, 56, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radius)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 3); __PYX_ERR(0, 56, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "circle") < 0)) __PYX_ERR(0, 56, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_pos = values[2]; __pyx_v_radius = values[3]; __pyx_v_width = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 56, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 56, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_4circle(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_pos, __pyx_v_radius, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_4circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pos, PyObject *__pyx_v_radius, PyObject *__pyx_v_width) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("circle", 1); /* "pygame_sdl2/draw.pyx":57 * * def circle(Surface surface, color, pos, radius, width=0): * x, y = pos # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_circle(surface, x, y, radius, color) */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 57, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 57, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":58 * def circle(Surface surface, color, pos, radius, width=0): * x, y = pos * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) */ __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_width, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 58, __pyx_L1_error) if (__pyx_t_5) { /* "pygame_sdl2/draw.pyx":59 * x, y = pos * if width == 0: * gfxdraw.filled_circle(surface, x, y, radius, color) # <<<<<<<<<<<<<< * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) * return dirty.clip(surface.get_rect()) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_filled_circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_1, ((PyObject *)__pyx_v_surface), __pyx_v_x, __pyx_v_y, __pyx_v_radius, __pyx_v_color}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":60 * if width == 0: * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_v_x, __pyx_v_radius); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyNumber_Subtract(__pyx_v_y, __pyx_v_radius); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_radius, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_v_radius, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_8, __pyx_t_9}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_dirty = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":61 * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * else: * gfxdraw.circle(surface, x, y, radius, color) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":58 * def circle(Surface surface, color, pos, radius, width=0): * x, y = pos * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) */ } /* "pygame_sdl2/draw.pyx":63 * return dirty.clip(surface.get_rect()) * else: * gfxdraw.circle(surface, x, y, radius, color) # <<<<<<<<<<<<<< * n = 1 * while n < width: */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_circle); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_x, __pyx_v_y, __pyx_v_radius, __pyx_v_color}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":64 * else: * gfxdraw.circle(surface, x, y, radius, color) * n = 1 # <<<<<<<<<<<<<< * while n < width: * gfxdraw.circle(surface, x, y, radius - n, color) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":65 * gfxdraw.circle(surface, x, y, radius, color) * n = 1 * while n < width: # <<<<<<<<<<<<<< * gfxdraw.circle(surface, x, y, radius - n, color) * gfxdraw.circle(surface, x + 1, y, radius - n, color) */ while (1) { __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_v_width, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_5) break; /* "pygame_sdl2/draw.pyx":66 * n = 1 * while n < width: * gfxdraw.circle(surface, x, y, radius - n, color) # <<<<<<<<<<<<<< * gfxdraw.circle(surface, x + 1, y, radius - n, color) * gfxdraw.circle(surface, x - 1, y, radius - n, color) */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyNumber_Subtract(__pyx_v_radius, __pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_8, ((PyObject *)__pyx_v_surface), __pyx_v_x, __pyx_v_y, __pyx_t_9, __pyx_v_color}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":67 * while n < width: * gfxdraw.circle(surface, x, y, radius - n, color) * gfxdraw.circle(surface, x + 1, y, radius - n, color) # <<<<<<<<<<<<<< * gfxdraw.circle(surface, x - 1, y, radius - n, color) * n += 1 */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_circle); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_x, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PyNumber_Subtract(__pyx_v_radius, __pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_1, ((PyObject *)__pyx_v_surface), __pyx_t_3, __pyx_v_y, __pyx_t_8, __pyx_v_color}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":68 * gfxdraw.circle(surface, x, y, radius - n, color) * gfxdraw.circle(surface, x + 1, y, radius - n, color) * gfxdraw.circle(surface, x - 1, y, radius - n, color) # <<<<<<<<<<<<<< * n += 1 * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_v_x, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = PyNumber_Subtract(__pyx_v_radius, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_1, ((PyObject *)__pyx_v_surface), __pyx_t_9, __pyx_v_y, __pyx_t_3, __pyx_v_color}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":69 * gfxdraw.circle(surface, x + 1, y, radius - n, color) * gfxdraw.circle(surface, x - 1, y, radius - n, color) * n += 1 # <<<<<<<<<<<<<< * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) * return dirty.clip(surface.get_rect()) */ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/draw.pyx":70 * gfxdraw.circle(surface, x - 1, y, radius - n, color) * n += 1 * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = PyNumber_Subtract(__pyx_v_x, __pyx_v_radius); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyNumber_Subtract(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Subtract(__pyx_v_y, __pyx_v_radius); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_radius, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_radius, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = PyNumber_Add(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_t_9, __pyx_t_1, __pyx_t_7, __pyx_t_10}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_v_dirty = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":71 * n += 1 * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def ellipse(Surface surface, color, rect, width=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_10}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.draw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":73 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * x, y, rx, ry = rect * if width == 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_7ellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_6ellipse, "ellipse(Surface surface, color, rect, width=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_7ellipse = {"ellipse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_7ellipse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_6ellipse}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_7ellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ellipse (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_width,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, 1); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, 2); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ellipse") < 0)) __PYX_ERR(0, 73, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_rect = values[2]; __pyx_v_width = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 73, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_6ellipse(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_rect, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_6ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_rx = NULL; PyObject *__pyx_v_ry = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ellipse", 1); /* "pygame_sdl2/draw.pyx":74 * * def ellipse(Surface surface, color, rect, width=0): * x, y, rx, ry = rect # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_ellipse(surface, x, y, rx, ry, color) */ if ((likely(PyTuple_CheckExact(__pyx_v_rect))) || (PyList_CheckExact(__pyx_v_rect))) { PyObject* sequence = __pyx_v_rect; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 74, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_4 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4}; __pyx_t_5 = PyObject_GetIter(__pyx_v_rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_6(__pyx_t_5); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 4) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 74, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_rx = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_ry = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":75 * def ellipse(Surface surface, color, rect, width=0): * x, y, rx, ry = rect * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_ellipse(surface, x, y, rx, ry, color) * dirty = Rect((x - rx, y - ry), (rx*2, ry*2)) */ __pyx_t_7 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_width, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 75, __pyx_L1_error) if (__pyx_t_7) { /* "pygame_sdl2/draw.pyx":76 * x, y, rx, ry = rect * if width == 0: * gfxdraw.filled_ellipse(surface, x, y, rx, ry, color) # <<<<<<<<<<<<<< * dirty = Rect((x - rx, y - ry), (rx*2, ry*2)) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filled_ellipse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 6+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":77 * if width == 0: * gfxdraw.filled_ellipse(surface, x, y, rx, ry, color) * dirty = Rect((x - rx, y - ry), (rx*2, ry*2)) # <<<<<<<<<<<<<< * else: * gfxdraw.ellipse(surface, x, y, rx, ry, color) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_x, __pyx_v_rx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_v_y, __pyx_v_ry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_v_rx, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ry, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_5, __pyx_t_9}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_dirty = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":75 * def ellipse(Surface surface, color, rect, width=0): * x, y, rx, ry = rect * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_ellipse(surface, x, y, rx, ry, color) * dirty = Rect((x - rx, y - ry), (rx*2, ry*2)) */ goto __pyx_L5; } /* "pygame_sdl2/draw.pyx":79 * dirty = Rect((x - rx, y - ry), (rx*2, ry*2)) * else: * gfxdraw.ellipse(surface, x, y, rx, ry, color) # <<<<<<<<<<<<<< * n = 1 * while n < width: */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ellipse); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_2, ((PyObject *)__pyx_v_surface), __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_8, 6+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":80 * else: * gfxdraw.ellipse(surface, x, y, rx, ry, color) * n = 1 # <<<<<<<<<<<<<< * while n < width: * gfxdraw.ellipse(surface, x, y, rx - n, ry - n, color) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":81 * gfxdraw.ellipse(surface, x, y, rx, ry, color) * n = 1 * while n < width: # <<<<<<<<<<<<<< * gfxdraw.ellipse(surface, x, y, rx - n, ry - n, color) * gfxdraw.ellipse(surface, x + 1, y, rx - n, ry - n, color) */ while (1) { __pyx_t_4 = PyObject_RichCompare(__pyx_v_n, __pyx_v_width, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error) __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_7) break; /* "pygame_sdl2/draw.pyx":82 * n = 1 * while n < width: * gfxdraw.ellipse(surface, x, y, rx - n, ry - n, color) # <<<<<<<<<<<<<< * gfxdraw.ellipse(surface, x + 1, y, rx - n, ry - n, color) * gfxdraw.ellipse(surface, x - 1, y, rx - n, ry - n, color) */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ellipse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyNumber_Subtract(__pyx_v_rx, __pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = PyNumber_Subtract(__pyx_v_ry, __pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_x, __pyx_v_y, __pyx_t_9, __pyx_t_5, __pyx_v_color}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 6+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":83 * while n < width: * gfxdraw.ellipse(surface, x, y, rx - n, ry - n, color) * gfxdraw.ellipse(surface, x + 1, y, rx - n, ry - n, color) # <<<<<<<<<<<<<< * gfxdraw.ellipse(surface, x - 1, y, rx - n, ry - n, color) * n += 1 */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ellipse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_x, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = PyNumber_Subtract(__pyx_v_rx, __pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = PyNumber_Subtract(__pyx_v_ry, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_1, ((PyObject *)__pyx_v_surface), __pyx_t_2, __pyx_v_y, __pyx_t_9, __pyx_t_3, __pyx_v_color}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 6+__pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":84 * gfxdraw.ellipse(surface, x, y, rx - n, ry - n, color) * gfxdraw.ellipse(surface, x + 1, y, rx - n, ry - n, color) * gfxdraw.ellipse(surface, x - 1, y, rx - n, ry - n, color) # <<<<<<<<<<<<<< * n += 1 * dirty = Rect(x - rx - width, y - ry - width, (rx*2) + width, (ry*2) + width) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ellipse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_x, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = PyNumber_Subtract(__pyx_v_rx, __pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = PyNumber_Subtract(__pyx_v_ry, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_1, ((PyObject *)__pyx_v_surface), __pyx_t_5, __pyx_v_y, __pyx_t_9, __pyx_t_2, __pyx_v_color}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 6+__pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":85 * gfxdraw.ellipse(surface, x + 1, y, rx - n, ry - n, color) * gfxdraw.ellipse(surface, x - 1, y, rx - n, ry - n, color) * n += 1 # <<<<<<<<<<<<<< * dirty = Rect(x - rx - width, y - ry - width, (rx*2) + width, (ry*2) + width) * return dirty.clip(surface.get_rect()) */ __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_4); __pyx_t_4 = 0; } /* "pygame_sdl2/draw.pyx":86 * gfxdraw.ellipse(surface, x - 1, y, rx - n, ry - n, color) * n += 1 * dirty = Rect(x - rx - width, y - ry - width, (rx*2) + width, (ry*2) + width) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Subtract(__pyx_v_x, __pyx_v_rx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = PyNumber_Subtract(__pyx_t_2, __pyx_v_width); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Subtract(__pyx_v_y, __pyx_v_ry); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_v_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_v_rx, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ry, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_v_width); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_t_9, __pyx_t_5, __pyx_t_1, __pyx_t_10}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_dirty = __pyx_t_4; __pyx_t_4 = 0; } __pyx_L5:; /* "pygame_sdl2/draw.pyx":87 * n += 1 * dirty = Rect(x - rx - width, y - ry - width, (rx*2) + width, (ry*2) + width) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_10}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":73 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * x, y, rx, ry = rect * if width == 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.draw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_rx); __Pyx_XDECREF(__pyx_v_ry); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":89 * return dirty.clip(surface.get_rect()) * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_9arc(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_8arc, "arc(Surface surface, color, rect, start_angle, stop_angle, width=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_9arc = {"arc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_9arc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_8arc}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_9arc(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; CYTHON_UNUSED PyObject *__pyx_v_color = 0; CYTHON_UNUSED PyObject *__pyx_v_rect = 0; CYTHON_UNUSED PyObject *__pyx_v_start_angle = 0; CYTHON_UNUSED PyObject *__pyx_v_stop_angle = 0; CYTHON_UNUSED PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("arc (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_start_angle,&__pyx_n_s_stop_angle,&__pyx_n_s_width,0}; values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 1); __PYX_ERR(0, 89, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 2); __PYX_ERR(0, 89, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start_angle)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 3); __PYX_ERR(0, 89, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stop_angle)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 4); __PYX_ERR(0, 89, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "arc") < 0)) __PYX_ERR(0, 89, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_rect = values[2]; __pyx_v_start_angle = values[3]; __pyx_v_stop_angle = values[4]; __pyx_v_width = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, __pyx_nargs); __PYX_ERR(0, 89, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 89, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_8arc(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_rect, __pyx_v_start_angle, __pyx_v_stop_angle, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_8arc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, CYTHON_UNUSED PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_start_angle, CYTHON_UNUSED PyObject *__pyx_v_stop_angle, CYTHON_UNUSED PyObject *__pyx_v_width) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arc", 1); /* "pygame_sdl2/draw.pyx":90 * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def line(Surface surface, color, start_pos, end_pos, width=1): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Not_implemented}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 90, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":89 * return dirty.clip(surface.get_rect()) * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.draw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":92 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_11line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_10line, "line(Surface surface, color, start_pos, end_pos, width=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_11line = {"line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_11line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_10line}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_11line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_start_pos = 0; PyObject *__pyx_v_end_pos = 0; PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("line (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_start_pos,&__pyx_n_s_end_pos,&__pyx_n_s_width,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 1); __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 2); __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 3); __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "line") < 0)) __PYX_ERR(0, 92, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_start_pos = values[2]; __pyx_v_end_pos = values[3]; __pyx_v_width = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 92, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 92, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_10line(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_start_pos, __pyx_v_end_pos, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_10line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_start_pos, PyObject *__pyx_v_end_pos, PyObject *__pyx_v_width) { PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("line", 1); /* "pygame_sdl2/draw.pyx":93 * * def line(Surface surface, color, start_pos, end_pos, width=1): * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], # <<<<<<<<<<<<<< * end_pos[0], end_pos[1], width, color) * dirty = Rect(start_pos, (width, width)) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_thick_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_start_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_start_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/draw.pyx":94 * def line(Surface surface, color, start_pos, end_pos, width=1): * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) # <<<<<<<<<<<<<< * dirty = Rect(start_pos, (width, width)) * dirty.union_ip(Rect(end_pos, (width, width))) */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_end_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_end_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_7, ((PyObject *)__pyx_v_surface), __pyx_t_2, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_width, __pyx_v_color}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 7+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":95 * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) * dirty = Rect(start_pos, (width, width)) # <<<<<<<<<<<<<< * dirty.union_ip(Rect(end_pos, (width, width))) * return dirty.clip(surface.get_rect()) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_width)) __PYX_ERR(0, 95, __pyx_L1_error); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_width)) __PYX_ERR(0, 95, __pyx_L1_error); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_start_pos, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":96 * end_pos[0], end_pos[1], width, color) * dirty = Rect(start_pos, (width, width)) * dirty.union_ip(Rect(end_pos, (width, width))) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_width)) __PYX_ERR(0, 96, __pyx_L1_error); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_width)) __PYX_ERR(0, 96, __pyx_L1_error); __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_end_pos, __pyx_t_4}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":97 * dirty = Rect(start_pos, (width, width)) * dirty.union_ip(Rect(end_pos, (width, width))) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def lines(Surface surface, color, closed, pointlist, width=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":92 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.draw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":99 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_13lines(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_12lines, "lines(Surface surface, color, closed, pointlist, width=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_13lines = {"lines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_13lines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_12lines}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_13lines(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_closed = 0; PyObject *__pyx_v_pointlist = 0; PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lines (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_closed,&__pyx_n_s_pointlist,&__pyx_n_s_width,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 1); __PYX_ERR(0, 99, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_closed)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 2); __PYX_ERR(0, 99, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointlist)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 3); __PYX_ERR(0, 99, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lines") < 0)) __PYX_ERR(0, 99, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_closed = values[2]; __pyx_v_pointlist = values[3]; __pyx_v_width = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 99, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.lines", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 99, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_12lines(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_closed, __pyx_v_pointlist, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_12lines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lines", 1); /* "pygame_sdl2/draw.pyx":100 * * def lines(Surface surface, color, closed, pointlist, width=1): * n = 0 # <<<<<<<<<<<<<< * dirty = Rect(pointlist[0], (width, width)) * while n < len(pointlist) - 1: */ __Pyx_INCREF(__pyx_int_0); __pyx_v_n = __pyx_int_0; /* "pygame_sdl2/draw.pyx":101 * def lines(Surface surface, color, closed, pointlist, width=1): * n = 0 * dirty = Rect(pointlist[0], (width, width)) # <<<<<<<<<<<<<< * while n < len(pointlist) - 1: * line(surface, color, pointlist[n], pointlist[n+1], width) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_width)) __PYX_ERR(0, 101, __pyx_L1_error); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_width)) __PYX_ERR(0, 101, __pyx_L1_error); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":102 * n = 0 * dirty = Rect(pointlist[0], (width, width)) * while n < len(pointlist) - 1: # <<<<<<<<<<<<<< * line(surface, color, pointlist[n], pointlist[n+1], width) * dirty.union_ip(Rect(pointlist[n+1], (width, width))) */ while (1) { __pyx_t_7 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_7 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_8) break; /* "pygame_sdl2/draw.pyx":103 * dirty = Rect(pointlist[0], (width, width)) * while n < len(pointlist) - 1: * line(surface, color, pointlist[n], pointlist[n+1], width) # <<<<<<<<<<<<<< * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_color, __pyx_t_4, __pyx_t_5, __pyx_v_width}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":104 * while n < len(pointlist) - 1: * line(surface, color, pointlist[n], pointlist[n+1], width) * dirty.union_ip(Rect(pointlist[n+1], (width, width))) # <<<<<<<<<<<<<< * n += 1 * if closed: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_width)) __PYX_ERR(0, 104, __pyx_L1_error); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_width)) __PYX_ERR(0, 104, __pyx_L1_error); __pyx_t_10 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_9, __pyx_t_3}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":105 * line(surface, color, pointlist[n], pointlist[n+1], width) * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 # <<<<<<<<<<<<<< * if closed: * line(surface, color, pointlist[n], pointlist[0], width) */ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/draw.pyx":106 * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 * if closed: # <<<<<<<<<<<<<< * line(surface, color, pointlist[n], pointlist[0], width) * return dirty.clip(surface.get_rect()) */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_closed); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 106, __pyx_L1_error) if (__pyx_t_8) { /* "pygame_sdl2/draw.pyx":107 * n += 1 * if closed: * line(surface, color, pointlist[n], pointlist[0], width) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_color, __pyx_t_5, __pyx_t_4, __pyx_v_width}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":106 * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 * if closed: # <<<<<<<<<<<<<< * line(surface, color, pointlist[n], pointlist[0], width) * return dirty.clip(surface.get_rect()) */ } /* "pygame_sdl2/draw.pyx":108 * if closed: * line(surface, color, pointlist[n], pointlist[0], width) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def aaline(Surface surface, color, startpos, endpos, blend=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":99 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.draw.lines", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":110 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_15aaline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_14aaline, "aaline(Surface surface, color, startpos, endpos, blend=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_15aaline = {"aaline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_15aaline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_14aaline}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_15aaline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_startpos = 0; PyObject *__pyx_v_endpos = 0; CYTHON_UNUSED PyObject *__pyx_v_blend = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aaline (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_startpos,&__pyx_n_s_endpos,&__pyx_n_s_blend,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 1); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_startpos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 2); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_endpos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 3); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blend); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aaline") < 0)) __PYX_ERR(0, 110, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_startpos = values[2]; __pyx_v_endpos = values[3]; __pyx_v_blend = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 110, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 110, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_14aaline(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_startpos, __pyx_v_endpos, __pyx_v_blend); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_14aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_startpos, PyObject *__pyx_v_endpos, CYTHON_UNUSED PyObject *__pyx_v_blend) { PyObject *__pyx_v_x1 = NULL; PyObject *__pyx_v_y1 = NULL; PyObject *__pyx_v_x2 = NULL; PyObject *__pyx_v_y2 = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aaline", 1); /* "pygame_sdl2/draw.pyx":111 * * def aaline(Surface surface, color, startpos, endpos, blend=1): * x1, y1 = startpos # <<<<<<<<<<<<<< * x2, y2 = endpos * gfxdraw.aaline(surface, x1, y1, x2, y2, color) */ if ((likely(PyTuple_CheckExact(__pyx_v_startpos))) || (PyList_CheckExact(__pyx_v_startpos))) { PyObject* sequence = __pyx_v_startpos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 111, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_startpos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 111, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x1 = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y1 = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":112 * def aaline(Surface surface, color, startpos, endpos, blend=1): * x1, y1 = startpos * x2, y2 = endpos # <<<<<<<<<<<<<< * gfxdraw.aaline(surface, x1, y1, x2, y2, color) * dirty = Rect(x1, y1, x2 - x1, y2 - y1) */ if ((likely(PyTuple_CheckExact(__pyx_v_endpos))) || (PyList_CheckExact(__pyx_v_endpos))) { PyObject* sequence = __pyx_v_endpos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 112, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_endpos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 112, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_x2 = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y2 = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":113 * x1, y1 = startpos * x2, y2 = endpos * gfxdraw.aaline(surface, x1, y1, x2, y2, color) # <<<<<<<<<<<<<< * dirty = Rect(x1, y1, x2 - x1, y2 - y1) * return dirty.clip(surface.get_rect()) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_aaline); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_2, ((PyObject *)__pyx_v_surface), __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_color}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":114 * x2, y2 = endpos * gfxdraw.aaline(surface, x1, y1, x2, y2, color) * dirty = Rect(x1, y1, x2 - x1, y2 - y1) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Subtract(__pyx_v_x2, __pyx_v_x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyNumber_Subtract(__pyx_v_y2, __pyx_v_y1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_x1, __pyx_v_y1, __pyx_t_2, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":115 * gfxdraw.aaline(surface, x1, y1, x2, y2, color) * dirty = Rect(x1, y1, x2 - x1, y2 - y1) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def aalines(Surface surface, color, closed, pointlist, blend=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":110 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.draw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x1); __Pyx_XDECREF(__pyx_v_y1); __Pyx_XDECREF(__pyx_v_x2); __Pyx_XDECREF(__pyx_v_y2); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":117 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_17aalines(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_16aalines, "aalines(Surface surface, color, closed, pointlist, blend=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_17aalines = {"aalines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_17aalines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_16aalines}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_17aalines(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_closed = 0; PyObject *__pyx_v_pointlist = 0; CYTHON_UNUSED PyObject *__pyx_v_blend = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aalines (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_closed,&__pyx_n_s_pointlist,&__pyx_n_s_blend,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 1); __PYX_ERR(0, 117, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_closed)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 2); __PYX_ERR(0, 117, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointlist)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 3); __PYX_ERR(0, 117, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blend); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aalines") < 0)) __PYX_ERR(0, 117, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_closed = values[2]; __pyx_v_pointlist = values[3]; __pyx_v_blend = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 117, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.aalines", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 117, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_16aalines(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_closed, __pyx_v_pointlist, __pyx_v_blend); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_16aalines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, CYTHON_UNUSED PyObject *__pyx_v_blend) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aalines", 1); /* "pygame_sdl2/draw.pyx":118 * * def aalines(Surface surface, color, closed, pointlist, blend=1): * n = 0 # <<<<<<<<<<<<<< * dirty = Rect(pointlist[0], (1,1)) * while n < len(pointlist) - 1: */ __Pyx_INCREF(__pyx_int_0); __pyx_v_n = __pyx_int_0; /* "pygame_sdl2/draw.pyx":119 * def aalines(Surface surface, color, closed, pointlist, blend=1): * n = 0 * dirty = Rect(pointlist[0], (1,1)) # <<<<<<<<<<<<<< * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_tuple_}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":120 * n = 0 * dirty = Rect(pointlist[0], (1,1)) * while n < len(pointlist) - 1: # <<<<<<<<<<<<<< * r = aaline(surface, color, pointlist[n], pointlist[n+1]) * dirty.union_ip(r) */ while (1) { __pyx_t_6 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_7) break; /* "pygame_sdl2/draw.pyx":121 * dirty = Rect(pointlist[0], (1,1)) * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) # <<<<<<<<<<<<<< * dirty.union_ip(r) * n += 1 */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_aaline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, ((PyObject *)__pyx_v_surface), __pyx_v_color, __pyx_t_3, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":122 * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) * dirty.union_ip(r) # <<<<<<<<<<<<<< * n += 1 * if closed: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_r}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":123 * r = aaline(surface, color, pointlist[n], pointlist[n+1]) * dirty.union_ip(r) * n += 1 # <<<<<<<<<<<<<< * if closed: * aaline(surface, color, pointlist[n], pointlist[0]) */ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/draw.pyx":124 * dirty.union_ip(r) * n += 1 * if closed: # <<<<<<<<<<<<<< * aaline(surface, color, pointlist[n], pointlist[0]) * return dirty.clip(surface.get_rect()) */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_closed); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 124, __pyx_L1_error) if (__pyx_t_7) { /* "pygame_sdl2/draw.pyx":125 * n += 1 * if closed: * aaline(surface, color, pointlist[n], pointlist[0]) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_aaline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, ((PyObject *)__pyx_v_surface), __pyx_v_color, __pyx_t_8, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":124 * dirty.union_ip(r) * n += 1 * if closed: # <<<<<<<<<<<<<< * aaline(surface, color, pointlist[n], pointlist[0]) * return dirty.clip(surface.get_rect()) */ } /* "pygame_sdl2/draw.pyx":126 * if closed: * aaline(surface, color, pointlist[n], pointlist[0]) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":117 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.draw.aalines", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 0, 1, 1}, {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1}, {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, {&__pyx_n_s_aaline, __pyx_k_aaline, sizeof(__pyx_k_aaline), 0, 0, 1, 1}, {&__pyx_n_s_aalines, __pyx_k_aalines, sizeof(__pyx_k_aalines), 0, 0, 1, 1}, {&__pyx_n_s_arc, __pyx_k_arc, sizeof(__pyx_k_arc), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_blend, __pyx_k_blend, sizeof(__pyx_k_blend), 0, 0, 1, 1}, {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1}, {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_dirty, __pyx_k_dirty, sizeof(__pyx_k_dirty), 0, 0, 1, 1}, {&__pyx_n_s_ellipse, __pyx_k_ellipse, sizeof(__pyx_k_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_end_pos, __pyx_k_end_pos, sizeof(__pyx_k_end_pos), 0, 0, 1, 1}, {&__pyx_n_s_endpos, __pyx_k_endpos, sizeof(__pyx_k_endpos), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_filled_circle, __pyx_k_filled_circle, sizeof(__pyx_k_filled_circle), 0, 0, 1, 1}, {&__pyx_n_s_filled_ellipse, __pyx_k_filled_ellipse, sizeof(__pyx_k_filled_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_filled_polygon, __pyx_k_filled_polygon, sizeof(__pyx_k_filled_polygon), 0, 0, 1, 1}, {&__pyx_n_s_get_rect, __pyx_k_get_rect, sizeof(__pyx_k_get_rect), 0, 0, 1, 1}, {&__pyx_n_s_gfxdraw, __pyx_k_gfxdraw, sizeof(__pyx_k_gfxdraw), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, {&__pyx_n_s_lines, __pyx_k_lines, sizeof(__pyx_k_lines), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pointlist, __pyx_k_pointlist, sizeof(__pyx_k_pointlist), 0, 0, 1, 1}, {&__pyx_n_s_polygon, __pyx_k_polygon, sizeof(__pyx_k_polygon), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_draw, __pyx_k_pygame_sdl2_draw, sizeof(__pyx_k_pygame_sdl2_draw), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_gfxdraw, __pyx_k_pygame_sdl2_gfxdraw, sizeof(__pyx_k_pygame_sdl2_gfxdraw), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_radius, __pyx_k_radius, sizeof(__pyx_k_radius), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_rectangle, __pyx_k_rectangle, sizeof(__pyx_k_rectangle), 0, 0, 1, 1}, {&__pyx_n_s_rx, __pyx_k_rx, sizeof(__pyx_k_rx), 0, 0, 1, 1}, {&__pyx_n_s_ry, __pyx_k_ry, sizeof(__pyx_k_ry), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_k_src_pygame_sdl2_draw_pyx, sizeof(__pyx_k_src_pygame_sdl2_draw_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start_angle, __pyx_k_start_angle, sizeof(__pyx_k_start_angle), 0, 0, 1, 1}, {&__pyx_n_s_start_pos, __pyx_k_start_pos, sizeof(__pyx_k_start_pos), 0, 0, 1, 1}, {&__pyx_n_s_startpos, __pyx_k_startpos, sizeof(__pyx_k_startpos), 0, 0, 1, 1}, {&__pyx_n_s_stop_angle, __pyx_k_stop_angle, sizeof(__pyx_k_stop_angle), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_thick_line, __pyx_k_thick_line, sizeof(__pyx_k_thick_line), 0, 0, 1, 1}, {&__pyx_n_s_union_ip, __pyx_k_union_ip, sizeof(__pyx_k_union_ip), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { return 0; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/draw.pyx":47 * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) # <<<<<<<<<<<<<< * n = 1 * while n < len(pointlist): */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/draw.pyx":22 * from pygame_sdl2.surface cimport Surface * * import pygame_sdl2.gfxdraw as gfxdraw # <<<<<<<<<<<<<< * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error */ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_pygame_sdl2, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_tuple__5 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_width, __pyx_n_s_n, __pyx_n_s_r, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_rect, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 26, __pyx_L1_error) __pyx_tuple__7 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ __pyx_tuple__8 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_pointlist, __pyx_n_s_width, __pyx_n_s_dirty, __pyx_n_s_n); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_polygon, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 44, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ __pyx_tuple__10 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_pos, __pyx_n_s_radius, __pyx_n_s_width, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_dirty, __pyx_n_s_n); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_circle, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 56, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":73 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * x, y, rx, ry = rect * if width == 0: */ __pyx_tuple__12 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_width, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_dirty, __pyx_n_s_n); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_ellipse, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 73, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":89 * return dirty.clip(surface.get_rect()) * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_tuple__14 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_start_angle, __pyx_n_s_stop_angle, __pyx_n_s_width); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_arc, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 89, __pyx_L1_error) __pyx_tuple__16 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "pygame_sdl2/draw.pyx":92 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ __pyx_tuple__17 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_start_pos, __pyx_n_s_end_pos, __pyx_n_s_width, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_line, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 92, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":99 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ __pyx_tuple__19 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_closed, __pyx_n_s_pointlist, __pyx_n_s_width, __pyx_n_s_n, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_lines, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 99, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":110 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ __pyx_tuple__21 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_startpos, __pyx_n_s_endpos, __pyx_n_s_blend, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_aaline, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 110, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":117 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ __pyx_tuple__23 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_closed, __pyx_n_s_pointlist, __pyx_n_s_blend, __pyx_n_s_n, __pyx_n_s_dirty, __pyx_n_s_r); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_aalines, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(1, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_draw(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_draw}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "draw", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initdraw(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initdraw(void) #else __Pyx_PyMODINIT_FUNC PyInit_draw(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_draw(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_draw(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'draw' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("draw", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "draw" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_draw(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__draw) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.draw")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.draw", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/draw.pyx":22 * from pygame_sdl2.surface cimport Surface * * import pygame_sdl2.gfxdraw as gfxdraw # <<<<<<<<<<<<<< * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2_gfxdraw, __pyx_tuple__2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gfxdraw, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":23 * * import pygame_sdl2.gfxdraw as gfxdraw * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Rect)) __PYX_ERR(0, 23, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/draw.pyx":24 * import pygame_sdl2.gfxdraw as gfxdraw * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * def rect(Surface surface, color, rect, width=0): */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error)) __PYX_ERR(0, 24, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_1rect, 0, __pyx_n_s_rect, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rect, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_3polygon, 0, __pyx_n_s_polygon, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_polygon, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_5circle, 0, __pyx_n_s_circle, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_circle, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":73 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * x, y, rx, ry = rect * if width == 0: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_7ellipse, 0, __pyx_n_s_ellipse, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ellipse, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":89 * return dirty.clip(surface.get_rect()) * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_9arc, 0, __pyx_n_s_arc, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_arc, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":92 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_11line, 0, __pyx_n_s_line, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_line, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":99 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_13lines, 0, __pyx_n_s_lines, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_lines, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":110 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_15aaline, 0, __pyx_n_s_aaline, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaline, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":117 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_17aalines, 0, __pyx_n_s_aalines, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aalines, __pyx_t_2) < 0) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.draw", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.draw"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 1; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a == b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) == 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 0; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 0; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal == 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a == (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_EQ)); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); #ifdef HAVE_LONG_LONG if (sizeof(PY_LONG_LONG) > sizeof(long)) { PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; return (result >= LONG_MIN && result <= LONG_MAX) ? PyInt_FromLong((long)result) : PyLong_FromLongLong(result); } #endif #if CYTHON_USE_TYPE_SLOTS return PyInt_Type.tp_as_number->nb_multiply(op1, op2); #else return PyNumber_Multiply(op1, op2); #endif } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } } CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); #ifdef HAVE_LONG_LONG lla = a; goto long_long; #else return PyLong_Type.tp_as_number->nb_multiply(op1, op2); #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla * llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("multiply", return NULL) result = ((double)a) * (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + (unsigned long)b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a - (unsigned long)b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return PyLong_FromLong(-intval); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla - llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_8 #define __PYX_HAVE_RT_ImportType_3_0_8 static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__3; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__4); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__25); } return name; } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709468.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.error.c0000664000175000017500000106304414760217134020154 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__error #define __PYX_HAVE_API__pygame_sdl2__error /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/error.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.error" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.error" extern int __pyx_module_is_main_pygame_sdl2__error; int __pyx_module_is_main_pygame_sdl2__error = 0; /* Implementation of "pygame_sdl2.error" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_RuntimeError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = ""; static const char __pyx_k__10[] = "?"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_message[] = "message"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_get_error[] = "get_error"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_set_error[] = "set_error"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_error___init[] = "error.__init__"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_src_pygame_sdl2_error_pyx[] = "src/pygame_sdl2/error.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5error_5error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5error_get_error(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5error_2set_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_message); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_s_; PyObject *__pyx_n_s_RuntimeError; PyObject *__pyx_n_s__10; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_decode; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_error___init; PyObject *__pyx_n_s_get_error; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_message; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_error; PyObject *__pyx_n_s_set_name; PyObject *__pyx_kp_s_src_pygame_sdl2_error_pyx; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_test; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__7; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__9; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_kp_s_); Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError); Py_CLEAR(clear_module_state->__pyx_n_s__10); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_decode); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_error___init); Py_CLEAR(clear_module_state->__pyx_n_s_get_error); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_message); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_error); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_error_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__9); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_kp_s_); Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError); Py_VISIT(traverse_module_state->__pyx_n_s__10); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_decode); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_error___init); Py_VISIT(traverse_module_state->__pyx_n_s_get_error); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_message); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_error); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_error_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__9); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_s_ __pyx_mstate_global->__pyx_kp_s_ #define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError #define __pyx_n_s__10 __pyx_mstate_global->__pyx_n_s__10 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_error___init __pyx_mstate_global->__pyx_n_s_error___init #define __pyx_n_s_get_error __pyx_mstate_global->__pyx_n_s_get_error #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_message __pyx_mstate_global->__pyx_n_s_message #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_error __pyx_mstate_global->__pyx_n_s_set_error #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_kp_s_src_pygame_sdl2_error_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_error_pyx #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 /* #### Code section: module_code ### */ /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = bytes(SDL_GetError()) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5error_5error_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5error_5error___init__, "error.__init__(self, message=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5error_5error_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5error_5error_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5error_5error___init__}; static PyObject *__pyx_pw_11pygame_sdl2_5error_5error_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_message = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_message); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 23, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_message = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 23, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.error.error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5error_5error___init__(__pyx_self, __pyx_v_self, __pyx_v_message); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5error_5error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_message); /* "pygame_sdl2/error.pyx":24 * * def __init__(self, message=None): * if message is None: # <<<<<<<<<<<<<< * message = bytes(SDL_GetError()) * message = message.decode("utf-8") */ __pyx_t_1 = (__pyx_v_message == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/error.pyx":25 * def __init__(self, message=None): * if message is None: * message = bytes(SDL_GetError()) # <<<<<<<<<<<<<< * message = message.decode("utf-8") * */ __pyx_t_2 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/error.pyx":26 * if message is None: * message = bytes(SDL_GetError()) * message = message.decode("utf-8") # <<<<<<<<<<<<<< * * RuntimeError.__init__(self, message) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_utf_8}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/error.pyx":24 * * def __init__(self, message=None): * if message is None: # <<<<<<<<<<<<<< * message = bytes(SDL_GetError()) * message = message.decode("utf-8") */ } /* "pygame_sdl2/error.pyx":28 * message = message.decode("utf-8") * * RuntimeError.__init__(self, message) # <<<<<<<<<<<<<< * * def get_error(): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_RuntimeError, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_self, __pyx_v_message}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = bytes(SDL_GetError()) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.error.error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/error.pyx":30 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5error_1get_error(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5error_get_error, "get_error()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5error_1get_error = {"get_error", (PyCFunction)__pyx_pw_11pygame_sdl2_5error_1get_error, METH_NOARGS, __pyx_doc_11pygame_sdl2_5error_get_error}; static PyObject *__pyx_pw_11pygame_sdl2_5error_1get_error(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_error (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5error_get_error(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5error_get_error(CYTHON_UNUSED PyObject *__pyx_self) { char const *__pyx_v_message; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_error", 1); /* "pygame_sdl2/error.pyx":31 * * def get_error(): * cdef const char *message = SDL_GetError() # <<<<<<<<<<<<<< * * if message: */ __pyx_v_message = SDL_GetError(); /* "pygame_sdl2/error.pyx":33 * cdef const char *message = SDL_GetError() * * if message: # <<<<<<<<<<<<<< * return message.decode("utf-8") * else: */ __pyx_t_1 = (__pyx_v_message != 0); if (__pyx_t_1) { /* "pygame_sdl2/error.pyx":34 * * if message: * return message.decode("utf-8") # <<<<<<<<<<<<<< * else: * return '' */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_2, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/error.pyx":33 * cdef const char *message = SDL_GetError() * * if message: # <<<<<<<<<<<<<< * return message.decode("utf-8") * else: */ } /* "pygame_sdl2/error.pyx":36 * return message.decode("utf-8") * else: * return '' # <<<<<<<<<<<<<< * * def set_error(message): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_s_); __pyx_r = __pyx_kp_s_; goto __pyx_L0; } /* "pygame_sdl2/error.pyx":30 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.error.get_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/error.pyx":38 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * if isinstance(message, unicode): * message = message.encode("utf-8") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5error_3set_error(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5error_2set_error, "set_error(message)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5error_3set_error = {"set_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5error_3set_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5error_2set_error}; static PyObject *__pyx_pw_11pygame_sdl2_5error_3set_error(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_message = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_error (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_message,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_message)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_error") < 0)) __PYX_ERR(0, 38, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_message = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_error", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 38, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.error.set_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5error_2set_error(__pyx_self, __pyx_v_message); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5error_2set_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_message) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; char *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_error", 0); __Pyx_INCREF(__pyx_v_message); /* "pygame_sdl2/error.pyx":39 * * def set_error(message): * if isinstance(message, unicode): # <<<<<<<<<<<<<< * message = message.encode("utf-8") * */ __pyx_t_1 = PyUnicode_Check(__pyx_v_message); if (__pyx_t_1) { /* "pygame_sdl2/error.pyx":40 * def set_error(message): * if isinstance(message, unicode): * message = message.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetError("%s", message) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_utf_8}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/error.pyx":39 * * def set_error(message): * if isinstance(message, unicode): # <<<<<<<<<<<<<< * message = message.encode("utf-8") * */ } /* "pygame_sdl2/error.pyx":42 * message = message.encode("utf-8") * * SDL_SetError("%s", message) # <<<<<<<<<<<<<< */ __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_message); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L1_error) (void)(SDL_SetError(((char const *)"%s"), ((char *)__pyx_t_6))); /* "pygame_sdl2/error.pyx":38 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * if isinstance(message, unicode): * message = message.encode("utf-8") */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.error.set_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_error___init, __pyx_k_error___init, sizeof(__pyx_k_error___init), 0, 0, 1, 1}, {&__pyx_n_s_get_error, __pyx_k_get_error, sizeof(__pyx_k_get_error), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_error, __pyx_k_set_error, sizeof(__pyx_k_set_error), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_k_src_pygame_sdl2_error_pyx, sizeof(__pyx_k_src_pygame_sdl2_error_pyx), 0, 0, 1, 0}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 21, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/error.pyx":21 * from sdl2 cimport * * * class error(RuntimeError): # <<<<<<<<<<<<<< * * def __init__(self, message=None): */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); __pyx_tuple__3 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = bytes(SDL_GetError()) */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_n_s_init, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 23, __pyx_L1_error) __pyx_tuple__6 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/error.pyx":30 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_message); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_n_s_get_error, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 30, __pyx_L1_error) /* "pygame_sdl2/error.pyx":38 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * if isinstance(message, unicode): * message = message.encode("utf-8") */ __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_n_s_set_error, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_error(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_error}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "error", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initerror(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initerror(void) #else __Pyx_PyMODINIT_FUNC PyInit_error(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_error(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_error(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'error' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("error", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "error" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_error(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__error) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.error")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.error", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/error.pyx":21 * from sdl2 cimport * * * class error(RuntimeError): # <<<<<<<<<<<<<< * * def __init__(self, message=None): */ __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_tuple__3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_error, __pyx_n_s_error, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_error, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_2 != __pyx_tuple__3) { if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_tuple__3) < 0))) __PYX_ERR(0, 21, __pyx_L1_error) } /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = bytes(SDL_GetError()) */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5error_5error_1__init__, 0, __pyx_n_s_error___init, NULL, __pyx_n_s_pygame_sdl2_error, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__6); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/error.pyx":21 * from sdl2 cimport * * * class error(RuntimeError): # <<<<<<<<<<<<<< * * def __init__(self, message=None): */ __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_error, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_5) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/error.pyx":30 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5error_1get_error, 0, __pyx_n_s_get_error, NULL, __pyx_n_s_pygame_sdl2_error, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_error, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/error.pyx":38 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * if isinstance(message, unicode): * message = message.encode("utf-8") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5error_3set_error, 0, __pyx_n_s_set_error, NULL, __pyx_n_s_pygame_sdl2_error, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_error, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/error.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.error", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.error"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__10); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709471.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.event.c0000664000175000017500000343661314760217137020157 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__event #define __PYX_HAVE_API__pygame_sdl2__event /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/event.pyx", "type.pxd", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", "include/event_names.pxi", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /* PyIntCompare.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* RaiseUnboundLocalError.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); /* pop_index.proto */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #else #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix)) #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ (likely(is_tuple || PyTuple_Check(tuple)) ?\ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* SetItemInt.proto */ #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 #define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_8 { __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Scancode(SDL_Scancode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_bool __Pyx_PyInt_As_SDL_bool(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* VoidPtrImport.proto */ static int __Pyx_ImportVoidPtr_3_0_8(PyObject *module, const char *name, void **p, const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.type" */ /* Module declarations from "cpython" */ /* Module declarations from "cpython.object" */ /* Module declarations from "cpython.ref" */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.display" */ static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from "pygame_sdl2.event" */ static unsigned int __pyx_v_11pygame_sdl2_5event_POSTEDEVENT; static int __pyx_v_11pygame_sdl2_5event_mousewheel_buttons; static unsigned int __pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID; __PYX_EXTERN_C DL_EXPORT(PyObject) *event_queue; static PyObject *__pyx_f_11pygame_sdl2_5event_get_textinput(void); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_keyboard_event(SDL_KeyboardEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousemotion_event(SDL_MouseMotionEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousebtn_event(SDL_MouseButtonEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousewheel_event(SDL_MouseWheelEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyaxis_event(SDL_JoyAxisEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyball_event(SDL_JoyBallEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyhat_event(SDL_JoyHatEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joybtn_event(SDL_JoyButtonEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textinput_event(SDL_TextInputEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textediting_event(SDL_TextEditingEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_drop_event(SDL_DropEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_window_event(SDL_WindowEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_event(SDL_Event *); /*proto*/ static int __pyx_f_11pygame_sdl2_5event_has_event(PyObject *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_get_events(PyObject *); /*proto*/ static int __pyx_f_11pygame_sdl2_5event_poll_sdl(void); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.event" extern int __pyx_module_is_main_pygame_sdl2__event; int __pyx_module_is_main_pygame_sdl2__event = 0; /* Implementation of "pygame_sdl2.event" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_chr; static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_UnicodeDecodeError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = ", "; static const char __pyx_k_e[] = "e"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_k[] = "k"; static const char __pyx_k_t[] = "t"; static const char __pyx_k_v[] = "v"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__2[] = ""; static const char __pyx_k__5[] = "*"; static const char __pyx_k_dx[] = "dx"; static const char __pyx_k_dy[] = "dy"; static const char __pyx_k_eq[] = "__eq__"; static const char __pyx_k_et[] = "et"; static const char __pyx_k_ne[] = "__ne__"; static const char __pyx_k_on[] = "on"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__49[] = "?"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_evt[] = "evt"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_hat[] = "hat"; static const char __pyx_k_joy[] = "joy"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_mod[] = "mod"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_rel[] = "rel"; static const char __pyx_k_s_r[] = "%s=%r"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_QUIT[] = "QUIT"; static const char __pyx_k_axis[] = "axis"; static const char __pyx_k_ball[] = "ball"; static const char __pyx_k_code[] = "code"; static const char __pyx_k_dict[] = "dict"; static const char __pyx_k_exit[] = "__exit__"; static const char __pyx_k_file[] = "file"; static const char __pyx_k_flag[] = "flag"; static const char __pyx_k_gain[] = "gain"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_lock[] = "lock"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_peek[] = "peek"; static const char __pyx_k_poll[] = "poll"; static const char __pyx_k_post[] = "post"; static const char __pyx_k_pump[] = "pump"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_rest[] = "rest"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_text[] = "text"; static const char __pyx_k_type[] = "type"; static const char __pyx_k_wait[] = "wait"; static const char __pyx_k_Event[] = "Event"; static const char __pyx_k_KEYUP[] = "KEYUP"; static const char __pyx_k_RLock[] = "RLock"; static const char __pyx_k_clear[] = "clear"; static const char __pyx_k_dDist[] = "dDist"; static const char __pyx_k_data1[] = "data1"; static const char __pyx_k_data2[] = "data2"; static const char __pyx_k_ename[] = "ename"; static const char __pyx_k_enter[] = "__enter__"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_event[] = "event"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_other[] = "other"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_touch[] = "touch"; static const char __pyx_k_types[] = "_types"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_which[] = "which"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_button[] = "button"; static const char __pyx_k_dTheta[] = "dTheta"; static const char __pyx_k_dict_2[] = "__dict__"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_init_2[] = "init"; static const char __pyx_k_insert[] = "insert"; static const char __pyx_k_kwargs[] = "kwargs"; static const char __pyx_k_length[] = "length"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_repeat[] = "repeat"; static const char __pyx_k_result[] = "result"; static const char __pyx_k_type_2[] = "_type"; static const char __pyx_k_unichr[] = "unichr"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_KEYDOWN[] = "KEYDOWN"; static const char __pyx_k_NOEVENT[] = "NOEVENT"; static const char __pyx_k_UNKNOWN[] = "UNKNOWN"; static const char __pyx_k_buttons[] = "buttons"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_nonzero[] = "__nonzero__"; static const char __pyx_k_pinched[] = "pinched"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_rotated[] = "rotated"; static const char __pyx_k_touchId[] = "touchId"; static const char __pyx_k_unicode[] = "unicode"; static const char __pyx_k_DROPFILE[] = "DROPFILE"; static const char __pyx_k_DROPTEXT[] = "DROPTEXT"; static const char __pyx_k_FINGERUP[] = "FINGERUP"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_fingerId[] = "fingerId"; static const char __pyx_k_get_grab[] = "get_grab"; static const char __pyx_k_pressure[] = "pressure"; static const char __pyx_k_property[] = "property"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_register[] = "register"; static const char __pyx_k_scancode[] = "scancode"; static const char __pyx_k_set_grab[] = "set_grab"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_touch_id[] = "touch_id"; static const char __pyx_k_DROPBEGIN[] = "DROPBEGIN"; static const char __pyx_k_EventType[] = "EventType"; static const char __pyx_k_LASTEVENT[] = "LASTEVENT"; static const char __pyx_k_TEXTINPUT[] = "TEXTINPUT"; static const char __pyx_k_USEREVENT[] = "USEREVENT"; static const char __pyx_k_finger_id[] = "finger_id"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_threading[] = "threading"; static const char __pyx_k_timestamp[] = "timestamp"; static const char __pyx_k_window_id[] = "window_id"; static const char __pyx_k_FINGERDOWN[] = "FINGERDOWN"; static const char __pyx_k_MOUSEWHEEL[] = "MOUSEWHEEL"; static const char __pyx_k_SYSWMEVENT[] = "SYSWMEVENT"; static const char __pyx_k_event_name[] = "event_name"; static const char __pyx_k_numFingers[] = "numFingers"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_text_input[] = "text_input"; static const char __pyx_k_ACTIVEEVENT[] = "ACTIVEEVENT"; static const char __pyx_k_Event_d_s_s[] = ""; static const char __pyx_k_JOYBUTTONUP[] = "JOYBUTTONUP"; static const char __pyx_k_MOUSEMOTION[] = "MOUSEMOTION"; static const char __pyx_k_TEXTEDITING[] = "TEXTEDITING"; static const char __pyx_k_UserEvent_d[] = "UserEvent%d"; static const char __pyx_k_VIDEOEXPOSE[] = "VIDEOEXPOSE"; static const char __pyx_k_VIDEORESIZE[] = "VIDEORESIZE"; static const char __pyx_k_WINDOWEVENT[] = "WINDOWEVENT"; static const char __pyx_k_WINDOWMOVED[] = "WINDOWMOVED"; static const char __pyx_k_event_names[] = "event_names"; static const char __pyx_k_get_blocked[] = "get_blocked"; static const char __pyx_k_instance_id[] = "instance_id"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_num_fingers[] = "num_fingers"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_set_allowed[] = "set_allowed"; static const char __pyx_k_set_blocked[] = "set_blocked"; static const char __pyx_k_DISPLAYEVENT[] = "DISPLAYEVENT"; static const char __pyx_k_DOLLARRECORD[] = "DOLLARRECORD"; static const char __pyx_k_DROPCOMPLETE[] = "DROPCOMPLETE"; static const char __pyx_k_FINGERMOTION[] = "FINGERMOTION"; static const char __pyx_k_JOYHATMOTION[] = "JOYHATMOTION"; static const char __pyx_k_MULTIGESTURE[] = "MULTIGESTURE"; static const char __pyx_k_SENSORUPDATE[] = "SENSORUPDATE"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_version_info[] = "version_info"; static const char __pyx_k_APP_LOWMEMORY[] = "APP_LOWMEMORY"; static const char __pyx_k_DOLLARGESTURE[] = "DOLLARGESTURE"; static const char __pyx_k_JOYAXISMOTION[] = "JOYAXISMOTION"; static const char __pyx_k_JOYBALLMOTION[] = "JOYBALLMOTION"; static const char __pyx_k_JOYBUTTONDOWN[] = "JOYBUTTONDOWN"; static const char __pyx_k_KEYMAPCHANGED[] = "KEYMAPCHANGED"; static const char __pyx_k_MOUSEBUTTONUP[] = "MOUSEBUTTONUP"; static const char __pyx_k_NOEVENT_EVENT[] = "NOEVENT_EVENT"; static const char __pyx_k_USEREVENT_MAX[] = "USEREVENT_MAX"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_sdl_main_init[] = "sdl_main_init"; static const char __pyx_k_EventType___eq[] = "EventType.__eq__"; static const char __pyx_k_EventType___ne[] = "EventType.__ne__"; static const char __pyx_k_EventType_dict[] = "EventType.dict"; static const char __pyx_k_EventType_type[] = "EventType.type"; static const char __pyx_k_JOYDEVICEADDED[] = "JOYDEVICEADDED"; static const char __pyx_k_APP_TERMINATING[] = "APP_TERMINATING"; static const char __pyx_k_CLIPBOARDUPDATE[] = "CLIPBOARDUPDATE"; static const char __pyx_k_Event_EventType[] = "\nEvent = EventType\n"; static const char __pyx_k_MOUSEBUTTONDOWN[] = "MOUSEBUTTONDOWN"; static const char __pyx_k_AUDIODEVICEADDED[] = "AUDIODEVICEADDED"; static const char __pyx_k_EventType___init[] = "EventType.__init__"; static const char __pyx_k_EventType___repr[] = "EventType.__repr__"; static const char __pyx_k_JOYDEVICEREMOVED[] = "JOYDEVICEREMOVED"; static const char __pyx_k_copy_event_queue[] = "copy_event_queue"; static const char __pyx_k_pygame_sdl2_event[] = "pygame_sdl2.event"; static const char __pyx_k_AUDIODEVICEREMOVED[] = "AUDIODEVICEREMOVED"; static const char __pyx_k_CONTROLLERBUTTONUP[] = "CONTROLLERBUTTONUP"; static const char __pyx_k_UnicodeDecodeError[] = "UnicodeDecodeError"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_EventType___nonzero[] = "EventType.__nonzero__"; static const char __pyx_k_RENDER_DEVICE_RESET[] = "RENDER_DEVICE_RESET"; static const char __pyx_k_get_standard_events[] = "get_standard_events"; static const char __pyx_k_CONTROLLERAXISMOTION[] = "CONTROLLERAXISMOTION"; static const char __pyx_k_CONTROLLERBUTTONDOWN[] = "CONTROLLERBUTTONDOWN"; static const char __pyx_k_RENDER_TARGETS_RESET[] = "RENDER_TARGETS_RESET"; static const char __pyx_k_CONTROLLERDEVICEADDED[] = "CONTROLLERDEVICEADDED"; static const char __pyx_k_APP_DIDENTERBACKGROUND[] = "APP_DIDENTERBACKGROUND"; static const char __pyx_k_APP_DIDENTERFOREGROUND[] = "APP_DIDENTERFOREGROUND"; static const char __pyx_k_get_mousewheel_buttons[] = "get_mousewheel_buttons"; static const char __pyx_k_set_mousewheel_buttons[] = "set_mousewheel_buttons"; static const char __pyx_k_APP_WILLENTERBACKGROUND[] = "APP_WILLENTERBACKGROUND"; static const char __pyx_k_APP_WILLENTERFOREGROUND[] = "APP_WILLENTERFOREGROUND"; static const char __pyx_k_CONTROLLERDEVICEREMOVED[] = "CONTROLLERDEVICEREMOVED"; static const char __pyx_k_CONTROLLERDEVICEREMAPPED[] = "CONTROLLERDEVICEREMAPPED"; static const char __pyx_k_src_pygame_sdl2_event_pyx[] = "src/pygame_sdl2/event.pyx"; static const char __pyx_k_event_post_must_be_called_with_a[] = "event.post must be called with an Event."; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_dict, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_4dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_6type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_12__nonzero__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_pump(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_4poll(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_6wait(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_8peek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_10clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_12get_standard_events(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_14event_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_16set_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_18set_allowed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_20get_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_22set_grab(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_24get_grab(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_26set_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_28get_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_30post(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_32register(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_34copy_event_queue(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_36init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window; #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_s_; PyObject *__pyx_n_s_ACTIVEEVENT; PyObject *__pyx_n_s_APP_DIDENTERBACKGROUND; PyObject *__pyx_n_s_APP_DIDENTERFOREGROUND; PyObject *__pyx_n_s_APP_LOWMEMORY; PyObject *__pyx_n_s_APP_TERMINATING; PyObject *__pyx_n_s_APP_WILLENTERBACKGROUND; PyObject *__pyx_n_s_APP_WILLENTERFOREGROUND; PyObject *__pyx_n_s_AUDIODEVICEADDED; PyObject *__pyx_n_s_AUDIODEVICEREMOVED; PyObject *__pyx_n_s_CLIPBOARDUPDATE; PyObject *__pyx_n_s_CONTROLLERAXISMOTION; PyObject *__pyx_n_s_CONTROLLERBUTTONDOWN; PyObject *__pyx_n_s_CONTROLLERBUTTONUP; PyObject *__pyx_n_s_CONTROLLERDEVICEADDED; PyObject *__pyx_n_s_CONTROLLERDEVICEREMAPPED; PyObject *__pyx_n_s_CONTROLLERDEVICEREMOVED; PyObject *__pyx_n_s_DISPLAYEVENT; PyObject *__pyx_n_s_DOLLARGESTURE; PyObject *__pyx_n_s_DOLLARRECORD; PyObject *__pyx_n_s_DROPBEGIN; PyObject *__pyx_n_s_DROPCOMPLETE; PyObject *__pyx_n_s_DROPFILE; PyObject *__pyx_n_s_DROPTEXT; PyObject *__pyx_n_s_Event; PyObject *__pyx_n_s_EventType; PyObject *__pyx_n_s_EventType___eq; PyObject *__pyx_n_s_EventType___init; PyObject *__pyx_n_s_EventType___ne; PyObject *__pyx_n_s_EventType___nonzero; PyObject *__pyx_n_s_EventType___repr; PyObject *__pyx_n_s_EventType_dict; PyObject *__pyx_n_s_EventType_type; PyObject *__pyx_kp_s_Event_EventType; PyObject *__pyx_kp_s_Event_d_s_s; PyObject *__pyx_n_s_FINGERDOWN; PyObject *__pyx_n_s_FINGERMOTION; PyObject *__pyx_n_s_FINGERUP; PyObject *__pyx_n_s_JOYAXISMOTION; PyObject *__pyx_n_s_JOYBALLMOTION; PyObject *__pyx_n_s_JOYBUTTONDOWN; PyObject *__pyx_n_s_JOYBUTTONUP; PyObject *__pyx_n_s_JOYDEVICEADDED; PyObject *__pyx_n_s_JOYDEVICEREMOVED; PyObject *__pyx_n_s_JOYHATMOTION; PyObject *__pyx_n_s_KEYDOWN; PyObject *__pyx_n_s_KEYMAPCHANGED; PyObject *__pyx_n_s_KEYUP; PyObject *__pyx_n_s_KeyError; PyObject *__pyx_n_s_LASTEVENT; PyObject *__pyx_n_s_MOUSEBUTTONDOWN; PyObject *__pyx_n_s_MOUSEBUTTONUP; PyObject *__pyx_n_s_MOUSEMOTION; PyObject *__pyx_n_s_MOUSEWHEEL; PyObject *__pyx_n_s_MULTIGESTURE; PyObject *__pyx_n_u_NOEVENT; PyObject *__pyx_n_s_NOEVENT_EVENT; PyObject *__pyx_n_s_QUIT; PyObject *__pyx_n_s_RENDER_DEVICE_RESET; PyObject *__pyx_n_s_RENDER_TARGETS_RESET; PyObject *__pyx_n_s_RLock; PyObject *__pyx_n_s_SENSORUPDATE; PyObject *__pyx_n_s_SYSWMEVENT; PyObject *__pyx_n_s_TEXTEDITING; PyObject *__pyx_n_s_TEXTINPUT; PyObject *__pyx_n_s_UNKNOWN; PyObject *__pyx_n_s_USEREVENT; PyObject *__pyx_n_s_USEREVENT_MAX; PyObject *__pyx_n_s_UnicodeDecodeError; PyObject *__pyx_kp_s_UserEvent_d; PyObject *__pyx_n_s_VIDEOEXPOSE; PyObject *__pyx_n_s_VIDEORESIZE; PyObject *__pyx_n_s_WINDOWEVENT; PyObject *__pyx_n_s_WINDOWMOVED; PyObject *__pyx_kp_s__2; PyObject *__pyx_kp_u__2; PyObject *__pyx_n_s__49; PyObject *__pyx_n_s__5; PyObject *__pyx_n_s_append; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_axis; PyObject *__pyx_n_s_ball; PyObject *__pyx_n_s_button; PyObject *__pyx_n_s_buttons; PyObject *__pyx_n_s_chr; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_clear; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_code; PyObject *__pyx_n_s_copy_event_queue; PyObject *__pyx_n_s_dDist; PyObject *__pyx_n_s_dTheta; PyObject *__pyx_n_s_data1; PyObject *__pyx_n_s_data2; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_dict_2; PyObject *__pyx_n_s_display; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_dx; PyObject *__pyx_n_s_dy; PyObject *__pyx_n_s_e; PyObject *__pyx_n_s_ename; PyObject *__pyx_n_s_enter; PyObject *__pyx_n_s_eq; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_et; PyObject *__pyx_n_s_event; PyObject *__pyx_n_s_event_name; PyObject *__pyx_n_s_event_names; PyObject *__pyx_kp_s_event_post_must_be_called_with_a; PyObject *__pyx_n_s_evt; PyObject *__pyx_n_s_exit; PyObject *__pyx_n_s_file; PyObject *__pyx_n_s_fingerId; PyObject *__pyx_n_s_finger_id; PyObject *__pyx_n_s_flag; PyObject *__pyx_n_s_gain; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_blocked; PyObject *__pyx_n_s_get_grab; PyObject *__pyx_n_s_get_mousewheel_buttons; PyObject *__pyx_n_s_get_standard_events; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_hat; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_2; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_insert; PyObject *__pyx_n_s_instance_id; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_items; PyObject *__pyx_n_s_join; PyObject *__pyx_n_s_joy; PyObject *__pyx_n_s_k; PyObject *__pyx_n_s_key; PyObject *__pyx_n_s_keys; PyObject *__pyx_n_s_kwargs; PyObject *__pyx_n_s_length; PyObject *__pyx_n_s_lock; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_mod; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_n_s_ne; PyObject *__pyx_n_s_nonzero; PyObject *__pyx_n_s_numFingers; PyObject *__pyx_n_s_num_fingers; PyObject *__pyx_n_s_object; PyObject *__pyx_n_s_on; PyObject *__pyx_n_s_other; PyObject *__pyx_n_s_peek; PyObject *__pyx_n_s_pinched; PyObject *__pyx_n_s_poll; PyObject *__pyx_n_s_pop; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_post; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_pressure; PyObject *__pyx_n_s_property; PyObject *__pyx_n_s_pump; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_event; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_register; PyObject *__pyx_n_s_rel; PyObject *__pyx_n_s_repeat; PyObject *__pyx_n_s_repr; PyObject *__pyx_n_s_rest; PyObject *__pyx_n_s_result; PyObject *__pyx_n_s_rotated; PyObject *__pyx_n_s_rv; PyObject *__pyx_kp_s_s_r; PyObject *__pyx_n_s_scancode; PyObject *__pyx_n_s_sdl_main_init; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_allowed; PyObject *__pyx_n_s_set_blocked; PyObject *__pyx_n_s_set_grab; PyObject *__pyx_n_s_set_mousewheel_buttons; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_event_pyx; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_sys; PyObject *__pyx_n_s_t; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_text; PyObject *__pyx_n_s_text_input; PyObject *__pyx_n_s_threading; PyObject *__pyx_n_s_timestamp; PyObject *__pyx_n_s_touch; PyObject *__pyx_n_s_touchId; PyObject *__pyx_n_s_touch_id; PyObject *__pyx_n_s_type; PyObject *__pyx_n_s_type_2; PyObject *__pyx_n_s_types; PyObject *__pyx_n_s_unichr; PyObject *__pyx_n_s_unicode; PyObject *__pyx_n_s_update; PyObject *__pyx_n_s_v; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_version_info; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_wait; PyObject *__pyx_n_s_which; PyObject *__pyx_n_s_window_id; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_y; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_2; PyObject *__pyx_int_3; PyObject *__pyx_int_4; PyObject *__pyx_slice__4; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__33; PyObject *__pyx_tuple__37; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__45; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__24; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__31; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__38; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__42; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__47; PyObject *__pyx_codeobj__48; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_CLEAR(clear_module_state->__pyx_kp_s_); Py_CLEAR(clear_module_state->__pyx_n_s_ACTIVEEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_APP_DIDENTERBACKGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_APP_DIDENTERFOREGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_APP_LOWMEMORY); Py_CLEAR(clear_module_state->__pyx_n_s_APP_TERMINATING); Py_CLEAR(clear_module_state->__pyx_n_s_APP_WILLENTERBACKGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_APP_WILLENTERFOREGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_AUDIODEVICEADDED); Py_CLEAR(clear_module_state->__pyx_n_s_AUDIODEVICEREMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_CLIPBOARDUPDATE); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERAXISMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERBUTTONDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERBUTTONUP); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERDEVICEADDED); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERDEVICEREMAPPED); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERDEVICEREMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_DISPLAYEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_DOLLARGESTURE); Py_CLEAR(clear_module_state->__pyx_n_s_DOLLARRECORD); Py_CLEAR(clear_module_state->__pyx_n_s_DROPBEGIN); Py_CLEAR(clear_module_state->__pyx_n_s_DROPCOMPLETE); Py_CLEAR(clear_module_state->__pyx_n_s_DROPFILE); Py_CLEAR(clear_module_state->__pyx_n_s_DROPTEXT); Py_CLEAR(clear_module_state->__pyx_n_s_Event); Py_CLEAR(clear_module_state->__pyx_n_s_EventType); Py_CLEAR(clear_module_state->__pyx_n_s_EventType___eq); Py_CLEAR(clear_module_state->__pyx_n_s_EventType___init); Py_CLEAR(clear_module_state->__pyx_n_s_EventType___ne); Py_CLEAR(clear_module_state->__pyx_n_s_EventType___nonzero); Py_CLEAR(clear_module_state->__pyx_n_s_EventType___repr); Py_CLEAR(clear_module_state->__pyx_n_s_EventType_dict); Py_CLEAR(clear_module_state->__pyx_n_s_EventType_type); Py_CLEAR(clear_module_state->__pyx_kp_s_Event_EventType); Py_CLEAR(clear_module_state->__pyx_kp_s_Event_d_s_s); Py_CLEAR(clear_module_state->__pyx_n_s_FINGERDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_FINGERMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_FINGERUP); Py_CLEAR(clear_module_state->__pyx_n_s_JOYAXISMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_JOYBALLMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_JOYBUTTONDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_JOYBUTTONUP); Py_CLEAR(clear_module_state->__pyx_n_s_JOYDEVICEADDED); Py_CLEAR(clear_module_state->__pyx_n_s_JOYDEVICEREMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_JOYHATMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_KEYDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_KEYMAPCHANGED); Py_CLEAR(clear_module_state->__pyx_n_s_KEYUP); Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); Py_CLEAR(clear_module_state->__pyx_n_s_LASTEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEBUTTONDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEBUTTONUP); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEWHEEL); Py_CLEAR(clear_module_state->__pyx_n_s_MULTIGESTURE); Py_CLEAR(clear_module_state->__pyx_n_u_NOEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_NOEVENT_EVENT); Py_CLEAR(clear_module_state->__pyx_n_s_QUIT); Py_CLEAR(clear_module_state->__pyx_n_s_RENDER_DEVICE_RESET); Py_CLEAR(clear_module_state->__pyx_n_s_RENDER_TARGETS_RESET); Py_CLEAR(clear_module_state->__pyx_n_s_RLock); Py_CLEAR(clear_module_state->__pyx_n_s_SENSORUPDATE); Py_CLEAR(clear_module_state->__pyx_n_s_SYSWMEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_TEXTEDITING); Py_CLEAR(clear_module_state->__pyx_n_s_TEXTINPUT); Py_CLEAR(clear_module_state->__pyx_n_s_UNKNOWN); Py_CLEAR(clear_module_state->__pyx_n_s_USEREVENT); Py_CLEAR(clear_module_state->__pyx_n_s_USEREVENT_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_UnicodeDecodeError); Py_CLEAR(clear_module_state->__pyx_kp_s_UserEvent_d); Py_CLEAR(clear_module_state->__pyx_n_s_VIDEOEXPOSE); Py_CLEAR(clear_module_state->__pyx_n_s_VIDEORESIZE); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOWEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOWMOVED); Py_CLEAR(clear_module_state->__pyx_kp_s__2); Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_n_s__49); Py_CLEAR(clear_module_state->__pyx_n_s__5); Py_CLEAR(clear_module_state->__pyx_n_s_append); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_axis); Py_CLEAR(clear_module_state->__pyx_n_s_ball); Py_CLEAR(clear_module_state->__pyx_n_s_button); Py_CLEAR(clear_module_state->__pyx_n_s_buttons); Py_CLEAR(clear_module_state->__pyx_n_s_chr); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_clear); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_code); Py_CLEAR(clear_module_state->__pyx_n_s_copy_event_queue); Py_CLEAR(clear_module_state->__pyx_n_s_dDist); Py_CLEAR(clear_module_state->__pyx_n_s_dTheta); Py_CLEAR(clear_module_state->__pyx_n_s_data1); Py_CLEAR(clear_module_state->__pyx_n_s_data2); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); Py_CLEAR(clear_module_state->__pyx_n_s_display); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_dx); Py_CLEAR(clear_module_state->__pyx_n_s_dy); Py_CLEAR(clear_module_state->__pyx_n_s_e); Py_CLEAR(clear_module_state->__pyx_n_s_ename); Py_CLEAR(clear_module_state->__pyx_n_s_enter); Py_CLEAR(clear_module_state->__pyx_n_s_eq); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_et); Py_CLEAR(clear_module_state->__pyx_n_s_event); Py_CLEAR(clear_module_state->__pyx_n_s_event_name); Py_CLEAR(clear_module_state->__pyx_n_s_event_names); Py_CLEAR(clear_module_state->__pyx_kp_s_event_post_must_be_called_with_a); Py_CLEAR(clear_module_state->__pyx_n_s_evt); Py_CLEAR(clear_module_state->__pyx_n_s_exit); Py_CLEAR(clear_module_state->__pyx_n_s_file); Py_CLEAR(clear_module_state->__pyx_n_s_fingerId); Py_CLEAR(clear_module_state->__pyx_n_s_finger_id); Py_CLEAR(clear_module_state->__pyx_n_s_flag); Py_CLEAR(clear_module_state->__pyx_n_s_gain); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_blocked); Py_CLEAR(clear_module_state->__pyx_n_s_get_grab); Py_CLEAR(clear_module_state->__pyx_n_s_get_mousewheel_buttons); Py_CLEAR(clear_module_state->__pyx_n_s_get_standard_events); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_hat); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_2); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_insert); Py_CLEAR(clear_module_state->__pyx_n_s_instance_id); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_items); Py_CLEAR(clear_module_state->__pyx_n_s_join); Py_CLEAR(clear_module_state->__pyx_n_s_joy); Py_CLEAR(clear_module_state->__pyx_n_s_k); Py_CLEAR(clear_module_state->__pyx_n_s_key); Py_CLEAR(clear_module_state->__pyx_n_s_keys); Py_CLEAR(clear_module_state->__pyx_n_s_kwargs); Py_CLEAR(clear_module_state->__pyx_n_s_length); Py_CLEAR(clear_module_state->__pyx_n_s_lock); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_mod); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_n_s_ne); Py_CLEAR(clear_module_state->__pyx_n_s_nonzero); Py_CLEAR(clear_module_state->__pyx_n_s_numFingers); Py_CLEAR(clear_module_state->__pyx_n_s_num_fingers); Py_CLEAR(clear_module_state->__pyx_n_s_object); Py_CLEAR(clear_module_state->__pyx_n_s_on); Py_CLEAR(clear_module_state->__pyx_n_s_other); Py_CLEAR(clear_module_state->__pyx_n_s_peek); Py_CLEAR(clear_module_state->__pyx_n_s_pinched); Py_CLEAR(clear_module_state->__pyx_n_s_poll); Py_CLEAR(clear_module_state->__pyx_n_s_pop); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_post); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_pressure); Py_CLEAR(clear_module_state->__pyx_n_s_property); Py_CLEAR(clear_module_state->__pyx_n_s_pump); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_event); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_register); Py_CLEAR(clear_module_state->__pyx_n_s_rel); Py_CLEAR(clear_module_state->__pyx_n_s_repeat); Py_CLEAR(clear_module_state->__pyx_n_s_repr); Py_CLEAR(clear_module_state->__pyx_n_s_rest); Py_CLEAR(clear_module_state->__pyx_n_s_result); Py_CLEAR(clear_module_state->__pyx_n_s_rotated); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_kp_s_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_scancode); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_main_init); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_allowed); Py_CLEAR(clear_module_state->__pyx_n_s_set_blocked); Py_CLEAR(clear_module_state->__pyx_n_s_set_grab); Py_CLEAR(clear_module_state->__pyx_n_s_set_mousewheel_buttons); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_event_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_sys); Py_CLEAR(clear_module_state->__pyx_n_s_t); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_text); Py_CLEAR(clear_module_state->__pyx_n_s_text_input); Py_CLEAR(clear_module_state->__pyx_n_s_threading); Py_CLEAR(clear_module_state->__pyx_n_s_timestamp); Py_CLEAR(clear_module_state->__pyx_n_s_touch); Py_CLEAR(clear_module_state->__pyx_n_s_touchId); Py_CLEAR(clear_module_state->__pyx_n_s_touch_id); Py_CLEAR(clear_module_state->__pyx_n_s_type); Py_CLEAR(clear_module_state->__pyx_n_s_type_2); Py_CLEAR(clear_module_state->__pyx_n_s_types); Py_CLEAR(clear_module_state->__pyx_n_s_unichr); Py_CLEAR(clear_module_state->__pyx_n_s_unicode); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_n_s_v); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_version_info); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_wait); Py_CLEAR(clear_module_state->__pyx_n_s_which); Py_CLEAR(clear_module_state->__pyx_n_s_window_id); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_3); Py_CLEAR(clear_module_state->__pyx_int_4); Py_CLEAR(clear_module_state->__pyx_slice__4); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__33); Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__24); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__31); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__38); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__42); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__47); Py_CLEAR(clear_module_state->__pyx_codeobj__48); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_VISIT(traverse_module_state->__pyx_kp_s_); Py_VISIT(traverse_module_state->__pyx_n_s_ACTIVEEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_APP_DIDENTERBACKGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_APP_DIDENTERFOREGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_APP_LOWMEMORY); Py_VISIT(traverse_module_state->__pyx_n_s_APP_TERMINATING); Py_VISIT(traverse_module_state->__pyx_n_s_APP_WILLENTERBACKGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_APP_WILLENTERFOREGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_AUDIODEVICEADDED); Py_VISIT(traverse_module_state->__pyx_n_s_AUDIODEVICEREMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_CLIPBOARDUPDATE); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERAXISMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERBUTTONDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERBUTTONUP); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERDEVICEADDED); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERDEVICEREMAPPED); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERDEVICEREMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_DISPLAYEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_DOLLARGESTURE); Py_VISIT(traverse_module_state->__pyx_n_s_DOLLARRECORD); Py_VISIT(traverse_module_state->__pyx_n_s_DROPBEGIN); Py_VISIT(traverse_module_state->__pyx_n_s_DROPCOMPLETE); Py_VISIT(traverse_module_state->__pyx_n_s_DROPFILE); Py_VISIT(traverse_module_state->__pyx_n_s_DROPTEXT); Py_VISIT(traverse_module_state->__pyx_n_s_Event); Py_VISIT(traverse_module_state->__pyx_n_s_EventType); Py_VISIT(traverse_module_state->__pyx_n_s_EventType___eq); Py_VISIT(traverse_module_state->__pyx_n_s_EventType___init); Py_VISIT(traverse_module_state->__pyx_n_s_EventType___ne); Py_VISIT(traverse_module_state->__pyx_n_s_EventType___nonzero); Py_VISIT(traverse_module_state->__pyx_n_s_EventType___repr); Py_VISIT(traverse_module_state->__pyx_n_s_EventType_dict); Py_VISIT(traverse_module_state->__pyx_n_s_EventType_type); Py_VISIT(traverse_module_state->__pyx_kp_s_Event_EventType); Py_VISIT(traverse_module_state->__pyx_kp_s_Event_d_s_s); Py_VISIT(traverse_module_state->__pyx_n_s_FINGERDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_FINGERMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_FINGERUP); Py_VISIT(traverse_module_state->__pyx_n_s_JOYAXISMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_JOYBALLMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_JOYBUTTONDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_JOYBUTTONUP); Py_VISIT(traverse_module_state->__pyx_n_s_JOYDEVICEADDED); Py_VISIT(traverse_module_state->__pyx_n_s_JOYDEVICEREMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_JOYHATMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_KEYDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_KEYMAPCHANGED); Py_VISIT(traverse_module_state->__pyx_n_s_KEYUP); Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); Py_VISIT(traverse_module_state->__pyx_n_s_LASTEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEBUTTONDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEBUTTONUP); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEWHEEL); Py_VISIT(traverse_module_state->__pyx_n_s_MULTIGESTURE); Py_VISIT(traverse_module_state->__pyx_n_u_NOEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_NOEVENT_EVENT); Py_VISIT(traverse_module_state->__pyx_n_s_QUIT); Py_VISIT(traverse_module_state->__pyx_n_s_RENDER_DEVICE_RESET); Py_VISIT(traverse_module_state->__pyx_n_s_RENDER_TARGETS_RESET); Py_VISIT(traverse_module_state->__pyx_n_s_RLock); Py_VISIT(traverse_module_state->__pyx_n_s_SENSORUPDATE); Py_VISIT(traverse_module_state->__pyx_n_s_SYSWMEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_TEXTEDITING); Py_VISIT(traverse_module_state->__pyx_n_s_TEXTINPUT); Py_VISIT(traverse_module_state->__pyx_n_s_UNKNOWN); Py_VISIT(traverse_module_state->__pyx_n_s_USEREVENT); Py_VISIT(traverse_module_state->__pyx_n_s_USEREVENT_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_UnicodeDecodeError); Py_VISIT(traverse_module_state->__pyx_kp_s_UserEvent_d); Py_VISIT(traverse_module_state->__pyx_n_s_VIDEOEXPOSE); Py_VISIT(traverse_module_state->__pyx_n_s_VIDEORESIZE); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOWEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOWMOVED); Py_VISIT(traverse_module_state->__pyx_kp_s__2); Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_n_s__49); Py_VISIT(traverse_module_state->__pyx_n_s__5); Py_VISIT(traverse_module_state->__pyx_n_s_append); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_axis); Py_VISIT(traverse_module_state->__pyx_n_s_ball); Py_VISIT(traverse_module_state->__pyx_n_s_button); Py_VISIT(traverse_module_state->__pyx_n_s_buttons); Py_VISIT(traverse_module_state->__pyx_n_s_chr); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_clear); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_code); Py_VISIT(traverse_module_state->__pyx_n_s_copy_event_queue); Py_VISIT(traverse_module_state->__pyx_n_s_dDist); Py_VISIT(traverse_module_state->__pyx_n_s_dTheta); Py_VISIT(traverse_module_state->__pyx_n_s_data1); Py_VISIT(traverse_module_state->__pyx_n_s_data2); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); Py_VISIT(traverse_module_state->__pyx_n_s_display); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_dx); Py_VISIT(traverse_module_state->__pyx_n_s_dy); Py_VISIT(traverse_module_state->__pyx_n_s_e); Py_VISIT(traverse_module_state->__pyx_n_s_ename); Py_VISIT(traverse_module_state->__pyx_n_s_enter); Py_VISIT(traverse_module_state->__pyx_n_s_eq); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_et); Py_VISIT(traverse_module_state->__pyx_n_s_event); Py_VISIT(traverse_module_state->__pyx_n_s_event_name); Py_VISIT(traverse_module_state->__pyx_n_s_event_names); Py_VISIT(traverse_module_state->__pyx_kp_s_event_post_must_be_called_with_a); Py_VISIT(traverse_module_state->__pyx_n_s_evt); Py_VISIT(traverse_module_state->__pyx_n_s_exit); Py_VISIT(traverse_module_state->__pyx_n_s_file); Py_VISIT(traverse_module_state->__pyx_n_s_fingerId); Py_VISIT(traverse_module_state->__pyx_n_s_finger_id); Py_VISIT(traverse_module_state->__pyx_n_s_flag); Py_VISIT(traverse_module_state->__pyx_n_s_gain); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_blocked); Py_VISIT(traverse_module_state->__pyx_n_s_get_grab); Py_VISIT(traverse_module_state->__pyx_n_s_get_mousewheel_buttons); Py_VISIT(traverse_module_state->__pyx_n_s_get_standard_events); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_hat); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_2); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_insert); Py_VISIT(traverse_module_state->__pyx_n_s_instance_id); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_items); Py_VISIT(traverse_module_state->__pyx_n_s_join); Py_VISIT(traverse_module_state->__pyx_n_s_joy); Py_VISIT(traverse_module_state->__pyx_n_s_k); Py_VISIT(traverse_module_state->__pyx_n_s_key); Py_VISIT(traverse_module_state->__pyx_n_s_keys); Py_VISIT(traverse_module_state->__pyx_n_s_kwargs); Py_VISIT(traverse_module_state->__pyx_n_s_length); Py_VISIT(traverse_module_state->__pyx_n_s_lock); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_mod); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_n_s_ne); Py_VISIT(traverse_module_state->__pyx_n_s_nonzero); Py_VISIT(traverse_module_state->__pyx_n_s_numFingers); Py_VISIT(traverse_module_state->__pyx_n_s_num_fingers); Py_VISIT(traverse_module_state->__pyx_n_s_object); Py_VISIT(traverse_module_state->__pyx_n_s_on); Py_VISIT(traverse_module_state->__pyx_n_s_other); Py_VISIT(traverse_module_state->__pyx_n_s_peek); Py_VISIT(traverse_module_state->__pyx_n_s_pinched); Py_VISIT(traverse_module_state->__pyx_n_s_poll); Py_VISIT(traverse_module_state->__pyx_n_s_pop); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_post); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_pressure); Py_VISIT(traverse_module_state->__pyx_n_s_property); Py_VISIT(traverse_module_state->__pyx_n_s_pump); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_event); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_register); Py_VISIT(traverse_module_state->__pyx_n_s_rel); Py_VISIT(traverse_module_state->__pyx_n_s_repeat); Py_VISIT(traverse_module_state->__pyx_n_s_repr); Py_VISIT(traverse_module_state->__pyx_n_s_rest); Py_VISIT(traverse_module_state->__pyx_n_s_result); Py_VISIT(traverse_module_state->__pyx_n_s_rotated); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_kp_s_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_scancode); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_main_init); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_allowed); Py_VISIT(traverse_module_state->__pyx_n_s_set_blocked); Py_VISIT(traverse_module_state->__pyx_n_s_set_grab); Py_VISIT(traverse_module_state->__pyx_n_s_set_mousewheel_buttons); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_event_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_sys); Py_VISIT(traverse_module_state->__pyx_n_s_t); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_text); Py_VISIT(traverse_module_state->__pyx_n_s_text_input); Py_VISIT(traverse_module_state->__pyx_n_s_threading); Py_VISIT(traverse_module_state->__pyx_n_s_timestamp); Py_VISIT(traverse_module_state->__pyx_n_s_touch); Py_VISIT(traverse_module_state->__pyx_n_s_touchId); Py_VISIT(traverse_module_state->__pyx_n_s_touch_id); Py_VISIT(traverse_module_state->__pyx_n_s_type); Py_VISIT(traverse_module_state->__pyx_n_s_type_2); Py_VISIT(traverse_module_state->__pyx_n_s_types); Py_VISIT(traverse_module_state->__pyx_n_s_unichr); Py_VISIT(traverse_module_state->__pyx_n_s_unicode); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_n_s_v); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_version_info); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_wait); Py_VISIT(traverse_module_state->__pyx_n_s_which); Py_VISIT(traverse_module_state->__pyx_n_s_window_id); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_3); Py_VISIT(traverse_module_state->__pyx_int_4); Py_VISIT(traverse_module_state->__pyx_slice__4); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__33); Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__24); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__31); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__38); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__42); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__47); Py_VISIT(traverse_module_state->__pyx_codeobj__48); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7display_Window __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7display_Window #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_s_ __pyx_mstate_global->__pyx_kp_s_ #define __pyx_n_s_ACTIVEEVENT __pyx_mstate_global->__pyx_n_s_ACTIVEEVENT #define __pyx_n_s_APP_DIDENTERBACKGROUND __pyx_mstate_global->__pyx_n_s_APP_DIDENTERBACKGROUND #define __pyx_n_s_APP_DIDENTERFOREGROUND __pyx_mstate_global->__pyx_n_s_APP_DIDENTERFOREGROUND #define __pyx_n_s_APP_LOWMEMORY __pyx_mstate_global->__pyx_n_s_APP_LOWMEMORY #define __pyx_n_s_APP_TERMINATING __pyx_mstate_global->__pyx_n_s_APP_TERMINATING #define __pyx_n_s_APP_WILLENTERBACKGROUND __pyx_mstate_global->__pyx_n_s_APP_WILLENTERBACKGROUND #define __pyx_n_s_APP_WILLENTERFOREGROUND __pyx_mstate_global->__pyx_n_s_APP_WILLENTERFOREGROUND #define __pyx_n_s_AUDIODEVICEADDED __pyx_mstate_global->__pyx_n_s_AUDIODEVICEADDED #define __pyx_n_s_AUDIODEVICEREMOVED __pyx_mstate_global->__pyx_n_s_AUDIODEVICEREMOVED #define __pyx_n_s_CLIPBOARDUPDATE __pyx_mstate_global->__pyx_n_s_CLIPBOARDUPDATE #define __pyx_n_s_CONTROLLERAXISMOTION __pyx_mstate_global->__pyx_n_s_CONTROLLERAXISMOTION #define __pyx_n_s_CONTROLLERBUTTONDOWN __pyx_mstate_global->__pyx_n_s_CONTROLLERBUTTONDOWN #define __pyx_n_s_CONTROLLERBUTTONUP __pyx_mstate_global->__pyx_n_s_CONTROLLERBUTTONUP #define __pyx_n_s_CONTROLLERDEVICEADDED __pyx_mstate_global->__pyx_n_s_CONTROLLERDEVICEADDED #define __pyx_n_s_CONTROLLERDEVICEREMAPPED __pyx_mstate_global->__pyx_n_s_CONTROLLERDEVICEREMAPPED #define __pyx_n_s_CONTROLLERDEVICEREMOVED __pyx_mstate_global->__pyx_n_s_CONTROLLERDEVICEREMOVED #define __pyx_n_s_DISPLAYEVENT __pyx_mstate_global->__pyx_n_s_DISPLAYEVENT #define __pyx_n_s_DOLLARGESTURE __pyx_mstate_global->__pyx_n_s_DOLLARGESTURE #define __pyx_n_s_DOLLARRECORD __pyx_mstate_global->__pyx_n_s_DOLLARRECORD #define __pyx_n_s_DROPBEGIN __pyx_mstate_global->__pyx_n_s_DROPBEGIN #define __pyx_n_s_DROPCOMPLETE __pyx_mstate_global->__pyx_n_s_DROPCOMPLETE #define __pyx_n_s_DROPFILE __pyx_mstate_global->__pyx_n_s_DROPFILE #define __pyx_n_s_DROPTEXT __pyx_mstate_global->__pyx_n_s_DROPTEXT #define __pyx_n_s_Event __pyx_mstate_global->__pyx_n_s_Event #define __pyx_n_s_EventType __pyx_mstate_global->__pyx_n_s_EventType #define __pyx_n_s_EventType___eq __pyx_mstate_global->__pyx_n_s_EventType___eq #define __pyx_n_s_EventType___init __pyx_mstate_global->__pyx_n_s_EventType___init #define __pyx_n_s_EventType___ne __pyx_mstate_global->__pyx_n_s_EventType___ne #define __pyx_n_s_EventType___nonzero __pyx_mstate_global->__pyx_n_s_EventType___nonzero #define __pyx_n_s_EventType___repr __pyx_mstate_global->__pyx_n_s_EventType___repr #define __pyx_n_s_EventType_dict __pyx_mstate_global->__pyx_n_s_EventType_dict #define __pyx_n_s_EventType_type __pyx_mstate_global->__pyx_n_s_EventType_type #define __pyx_kp_s_Event_EventType __pyx_mstate_global->__pyx_kp_s_Event_EventType #define __pyx_kp_s_Event_d_s_s __pyx_mstate_global->__pyx_kp_s_Event_d_s_s #define __pyx_n_s_FINGERDOWN __pyx_mstate_global->__pyx_n_s_FINGERDOWN #define __pyx_n_s_FINGERMOTION __pyx_mstate_global->__pyx_n_s_FINGERMOTION #define __pyx_n_s_FINGERUP __pyx_mstate_global->__pyx_n_s_FINGERUP #define __pyx_n_s_JOYAXISMOTION __pyx_mstate_global->__pyx_n_s_JOYAXISMOTION #define __pyx_n_s_JOYBALLMOTION __pyx_mstate_global->__pyx_n_s_JOYBALLMOTION #define __pyx_n_s_JOYBUTTONDOWN __pyx_mstate_global->__pyx_n_s_JOYBUTTONDOWN #define __pyx_n_s_JOYBUTTONUP __pyx_mstate_global->__pyx_n_s_JOYBUTTONUP #define __pyx_n_s_JOYDEVICEADDED __pyx_mstate_global->__pyx_n_s_JOYDEVICEADDED #define __pyx_n_s_JOYDEVICEREMOVED __pyx_mstate_global->__pyx_n_s_JOYDEVICEREMOVED #define __pyx_n_s_JOYHATMOTION __pyx_mstate_global->__pyx_n_s_JOYHATMOTION #define __pyx_n_s_KEYDOWN __pyx_mstate_global->__pyx_n_s_KEYDOWN #define __pyx_n_s_KEYMAPCHANGED __pyx_mstate_global->__pyx_n_s_KEYMAPCHANGED #define __pyx_n_s_KEYUP __pyx_mstate_global->__pyx_n_s_KEYUP #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError #define __pyx_n_s_LASTEVENT __pyx_mstate_global->__pyx_n_s_LASTEVENT #define __pyx_n_s_MOUSEBUTTONDOWN __pyx_mstate_global->__pyx_n_s_MOUSEBUTTONDOWN #define __pyx_n_s_MOUSEBUTTONUP __pyx_mstate_global->__pyx_n_s_MOUSEBUTTONUP #define __pyx_n_s_MOUSEMOTION __pyx_mstate_global->__pyx_n_s_MOUSEMOTION #define __pyx_n_s_MOUSEWHEEL __pyx_mstate_global->__pyx_n_s_MOUSEWHEEL #define __pyx_n_s_MULTIGESTURE __pyx_mstate_global->__pyx_n_s_MULTIGESTURE #define __pyx_n_u_NOEVENT __pyx_mstate_global->__pyx_n_u_NOEVENT #define __pyx_n_s_NOEVENT_EVENT __pyx_mstate_global->__pyx_n_s_NOEVENT_EVENT #define __pyx_n_s_QUIT __pyx_mstate_global->__pyx_n_s_QUIT #define __pyx_n_s_RENDER_DEVICE_RESET __pyx_mstate_global->__pyx_n_s_RENDER_DEVICE_RESET #define __pyx_n_s_RENDER_TARGETS_RESET __pyx_mstate_global->__pyx_n_s_RENDER_TARGETS_RESET #define __pyx_n_s_RLock __pyx_mstate_global->__pyx_n_s_RLock #define __pyx_n_s_SENSORUPDATE __pyx_mstate_global->__pyx_n_s_SENSORUPDATE #define __pyx_n_s_SYSWMEVENT __pyx_mstate_global->__pyx_n_s_SYSWMEVENT #define __pyx_n_s_TEXTEDITING __pyx_mstate_global->__pyx_n_s_TEXTEDITING #define __pyx_n_s_TEXTINPUT __pyx_mstate_global->__pyx_n_s_TEXTINPUT #define __pyx_n_s_UNKNOWN __pyx_mstate_global->__pyx_n_s_UNKNOWN #define __pyx_n_s_USEREVENT __pyx_mstate_global->__pyx_n_s_USEREVENT #define __pyx_n_s_USEREVENT_MAX __pyx_mstate_global->__pyx_n_s_USEREVENT_MAX #define __pyx_n_s_UnicodeDecodeError __pyx_mstate_global->__pyx_n_s_UnicodeDecodeError #define __pyx_kp_s_UserEvent_d __pyx_mstate_global->__pyx_kp_s_UserEvent_d #define __pyx_n_s_VIDEOEXPOSE __pyx_mstate_global->__pyx_n_s_VIDEOEXPOSE #define __pyx_n_s_VIDEORESIZE __pyx_mstate_global->__pyx_n_s_VIDEORESIZE #define __pyx_n_s_WINDOWEVENT __pyx_mstate_global->__pyx_n_s_WINDOWEVENT #define __pyx_n_s_WINDOWMOVED __pyx_mstate_global->__pyx_n_s_WINDOWMOVED #define __pyx_kp_s__2 __pyx_mstate_global->__pyx_kp_s__2 #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_n_s__49 __pyx_mstate_global->__pyx_n_s__49 #define __pyx_n_s__5 __pyx_mstate_global->__pyx_n_s__5 #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_axis __pyx_mstate_global->__pyx_n_s_axis #define __pyx_n_s_ball __pyx_mstate_global->__pyx_n_s_ball #define __pyx_n_s_button __pyx_mstate_global->__pyx_n_s_button #define __pyx_n_s_buttons __pyx_mstate_global->__pyx_n_s_buttons #define __pyx_n_s_chr __pyx_mstate_global->__pyx_n_s_chr #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_clear __pyx_mstate_global->__pyx_n_s_clear #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_code __pyx_mstate_global->__pyx_n_s_code #define __pyx_n_s_copy_event_queue __pyx_mstate_global->__pyx_n_s_copy_event_queue #define __pyx_n_s_dDist __pyx_mstate_global->__pyx_n_s_dDist #define __pyx_n_s_dTheta __pyx_mstate_global->__pyx_n_s_dTheta #define __pyx_n_s_data1 __pyx_mstate_global->__pyx_n_s_data1 #define __pyx_n_s_data2 __pyx_mstate_global->__pyx_n_s_data2 #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 #define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_dx __pyx_mstate_global->__pyx_n_s_dx #define __pyx_n_s_dy __pyx_mstate_global->__pyx_n_s_dy #define __pyx_n_s_e __pyx_mstate_global->__pyx_n_s_e #define __pyx_n_s_ename __pyx_mstate_global->__pyx_n_s_ename #define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter #define __pyx_n_s_eq __pyx_mstate_global->__pyx_n_s_eq #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_et __pyx_mstate_global->__pyx_n_s_et #define __pyx_n_s_event __pyx_mstate_global->__pyx_n_s_event #define __pyx_n_s_event_name __pyx_mstate_global->__pyx_n_s_event_name #define __pyx_n_s_event_names __pyx_mstate_global->__pyx_n_s_event_names #define __pyx_kp_s_event_post_must_be_called_with_a __pyx_mstate_global->__pyx_kp_s_event_post_must_be_called_with_a #define __pyx_n_s_evt __pyx_mstate_global->__pyx_n_s_evt #define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit #define __pyx_n_s_file __pyx_mstate_global->__pyx_n_s_file #define __pyx_n_s_fingerId __pyx_mstate_global->__pyx_n_s_fingerId #define __pyx_n_s_finger_id __pyx_mstate_global->__pyx_n_s_finger_id #define __pyx_n_s_flag __pyx_mstate_global->__pyx_n_s_flag #define __pyx_n_s_gain __pyx_mstate_global->__pyx_n_s_gain #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_blocked __pyx_mstate_global->__pyx_n_s_get_blocked #define __pyx_n_s_get_grab __pyx_mstate_global->__pyx_n_s_get_grab #define __pyx_n_s_get_mousewheel_buttons __pyx_mstate_global->__pyx_n_s_get_mousewheel_buttons #define __pyx_n_s_get_standard_events __pyx_mstate_global->__pyx_n_s_get_standard_events #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_hat __pyx_mstate_global->__pyx_n_s_hat #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_2 __pyx_mstate_global->__pyx_n_s_init_2 #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_insert __pyx_mstate_global->__pyx_n_s_insert #define __pyx_n_s_instance_id __pyx_mstate_global->__pyx_n_s_instance_id #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join #define __pyx_n_s_joy __pyx_mstate_global->__pyx_n_s_joy #define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k #define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key #define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys #define __pyx_n_s_kwargs __pyx_mstate_global->__pyx_n_s_kwargs #define __pyx_n_s_length __pyx_mstate_global->__pyx_n_s_length #define __pyx_n_s_lock __pyx_mstate_global->__pyx_n_s_lock #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_mod __pyx_mstate_global->__pyx_n_s_mod #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_n_s_ne __pyx_mstate_global->__pyx_n_s_ne #define __pyx_n_s_nonzero __pyx_mstate_global->__pyx_n_s_nonzero #define __pyx_n_s_numFingers __pyx_mstate_global->__pyx_n_s_numFingers #define __pyx_n_s_num_fingers __pyx_mstate_global->__pyx_n_s_num_fingers #define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object #define __pyx_n_s_on __pyx_mstate_global->__pyx_n_s_on #define __pyx_n_s_other __pyx_mstate_global->__pyx_n_s_other #define __pyx_n_s_peek __pyx_mstate_global->__pyx_n_s_peek #define __pyx_n_s_pinched __pyx_mstate_global->__pyx_n_s_pinched #define __pyx_n_s_poll __pyx_mstate_global->__pyx_n_s_poll #define __pyx_n_s_pop __pyx_mstate_global->__pyx_n_s_pop #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_post __pyx_mstate_global->__pyx_n_s_post #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_pressure __pyx_mstate_global->__pyx_n_s_pressure #define __pyx_n_s_property __pyx_mstate_global->__pyx_n_s_property #define __pyx_n_s_pump __pyx_mstate_global->__pyx_n_s_pump #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_event __pyx_mstate_global->__pyx_n_s_pygame_sdl2_event #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_register __pyx_mstate_global->__pyx_n_s_register #define __pyx_n_s_rel __pyx_mstate_global->__pyx_n_s_rel #define __pyx_n_s_repeat __pyx_mstate_global->__pyx_n_s_repeat #define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr #define __pyx_n_s_rest __pyx_mstate_global->__pyx_n_s_rest #define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result #define __pyx_n_s_rotated __pyx_mstate_global->__pyx_n_s_rotated #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_kp_s_s_r __pyx_mstate_global->__pyx_kp_s_s_r #define __pyx_n_s_scancode __pyx_mstate_global->__pyx_n_s_scancode #define __pyx_n_s_sdl_main_init __pyx_mstate_global->__pyx_n_s_sdl_main_init #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_allowed __pyx_mstate_global->__pyx_n_s_set_allowed #define __pyx_n_s_set_blocked __pyx_mstate_global->__pyx_n_s_set_blocked #define __pyx_n_s_set_grab __pyx_mstate_global->__pyx_n_s_set_grab #define __pyx_n_s_set_mousewheel_buttons __pyx_mstate_global->__pyx_n_s_set_mousewheel_buttons #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_event_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_event_pyx #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys #define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_text __pyx_mstate_global->__pyx_n_s_text #define __pyx_n_s_text_input __pyx_mstate_global->__pyx_n_s_text_input #define __pyx_n_s_threading __pyx_mstate_global->__pyx_n_s_threading #define __pyx_n_s_timestamp __pyx_mstate_global->__pyx_n_s_timestamp #define __pyx_n_s_touch __pyx_mstate_global->__pyx_n_s_touch #define __pyx_n_s_touchId __pyx_mstate_global->__pyx_n_s_touchId #define __pyx_n_s_touch_id __pyx_mstate_global->__pyx_n_s_touch_id #define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type #define __pyx_n_s_type_2 __pyx_mstate_global->__pyx_n_s_type_2 #define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types #define __pyx_n_s_unichr __pyx_mstate_global->__pyx_n_s_unichr #define __pyx_n_s_unicode __pyx_mstate_global->__pyx_n_s_unicode #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_version_info __pyx_mstate_global->__pyx_n_s_version_info #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_wait __pyx_mstate_global->__pyx_n_s_wait #define __pyx_n_s_which __pyx_mstate_global->__pyx_n_s_which #define __pyx_n_s_window_id __pyx_mstate_global->__pyx_n_s_window_id #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 #define __pyx_slice__4 __pyx_mstate_global->__pyx_slice__4 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 /* #### Code section: module_code ### */ PyObject *event_queue = 0; /* "pygame_sdl2/event.pyx":63 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType___init__, "EventType.__init__(self, type, dict=None, **kwargs)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType___init__}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_type = 0; PyObject *__pyx_v_dict = 0; PyObject *__pyx_v_kwargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_type,&__pyx_n_s_dict,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 63, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dict); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 63, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_type = values[1]; __pyx_v_dict = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 63, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("pygame_sdl2.event.EventType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType___init__(__pyx_self, __pyx_v_self, __pyx_v_type, __pyx_v_dict, __pyx_v_kwargs); /* function exit code */ __Pyx_DECREF(__pyx_v_kwargs); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_dict, PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/event.pyx":64 * * def __init__(self, type, dict=None, **kwargs): * self._type = type # <<<<<<<<<<<<<< * * if dict: */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_type_2, __pyx_v_type) < 0) __PYX_ERR(0, 64, __pyx_L1_error) /* "pygame_sdl2/event.pyx":66 * self._type = type * * if dict: # <<<<<<<<<<<<<< * self.__dict__.update(dict) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dict); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 66, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":67 * * if dict: * self.__dict__.update(dict) # <<<<<<<<<<<<<< * * self.__dict__.update(kwargs) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_dict}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":66 * self._type = type * * if dict: # <<<<<<<<<<<<<< * self.__dict__.update(dict) * */ } /* "pygame_sdl2/event.pyx":69 * self.__dict__.update(dict) * * self.__dict__.update(kwargs) # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_kwargs}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":63 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":71 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < WINDOWMOVED: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_3__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType_2__repr__, "EventType.__repr__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_3__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType_2__repr__}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_3__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 71, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 71, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.EventType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_2__repr__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_ename = NULL; PyObject *__pyx_v_rest = NULL; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; Py_ssize_t __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *(*__pyx_t_13)(PyObject *); int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/event.pyx":72 * * def __repr__(self): * if SDL_USEREVENT <= self.type < WINDOWMOVED: # <<<<<<<<<<<<<< * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_3)) { __Pyx_DECREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_WINDOWMOVED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { /* "pygame_sdl2/event.pyx":73 * def __repr__(self): * if SDL_USEREVENT <= self.type < WINDOWMOVED: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) # <<<<<<<<<<<<<< * else: * try: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_UserEvent_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ename = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":72 * * def __repr__(self): * if SDL_USEREVENT <= self.type < WINDOWMOVED: # <<<<<<<<<<<<<< * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":75 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: * try: # <<<<<<<<<<<<<< * ename = event_names[self.type] * except KeyError: */ /*else*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":76 * else: * try: * ename = event_names[self.type] # <<<<<<<<<<<<<< * except KeyError: * ename = "UNKNOWN" */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_event_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ename = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":75 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: * try: # <<<<<<<<<<<<<< * ename = event_names[self.type] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":77 * try: * ename = event_names[self.type] * except KeyError: # <<<<<<<<<<<<<< * ename = "UNKNOWN" * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_9) { __Pyx_AddTraceback("pygame_sdl2.event.EventType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); /* "pygame_sdl2/event.pyx":78 * ename = event_names[self.type] * except KeyError: * ename = "UNKNOWN" # <<<<<<<<<<<<<< * * rest = [ ] */ __Pyx_INCREF(__pyx_n_s_UNKNOWN); __Pyx_XDECREF_SET(__pyx_v_ename, __pyx_n_s_UNKNOWN); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; /* "pygame_sdl2/event.pyx":75 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: * try: # <<<<<<<<<<<<<< * ename = event_names[self.type] * except KeyError: */ __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L5_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L9_try_end:; } } __pyx_L3:; /* "pygame_sdl2/event.pyx":80 * ename = "UNKNOWN" * * rest = [ ] # <<<<<<<<<<<<<< * * for k, v in sorted(self.__dict__.items()): */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_rest = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":82 * rest = [ ] * * for k, v in sorted(self.__dict__.items()): # <<<<<<<<<<<<<< * if k == "_type" or k == "timestamp": * continue */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = PyList_Sort(__pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 82, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 82, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 82, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); index = 0; __pyx_t_1 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_1)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 82, __pyx_L1_error) __pyx_L15_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":83 * * for k, v in sorted(self.__dict__.items()): * if k == "_type" or k == "timestamp": # <<<<<<<<<<<<<< * continue * */ __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_v_k, __pyx_n_s_type_2, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 83, __pyx_L1_error) if (!__pyx_t_14) { } else { __pyx_t_5 = __pyx_t_14; goto __pyx_L17_bool_binop_done; } __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_v_k, __pyx_n_s_timestamp, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 83, __pyx_L1_error) __pyx_t_5 = __pyx_t_14; __pyx_L17_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/event.pyx":84 * for k, v in sorted(self.__dict__.items()): * if k == "_type" or k == "timestamp": * continue # <<<<<<<<<<<<<< * * rest.append("%s=%r" % (k, v)) */ goto __pyx_L12_continue; /* "pygame_sdl2/event.pyx":83 * * for k, v in sorted(self.__dict__.items()): * if k == "_type" or k == "timestamp": # <<<<<<<<<<<<<< * continue * */ } /* "pygame_sdl2/event.pyx":86 * continue * * rest.append("%s=%r" % (k, v)) # <<<<<<<<<<<<<< * * return '' % (self.type, ename, ", ".join(rest)) */ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_k)) __PYX_ERR(0, 86, __pyx_L1_error); __Pyx_INCREF(__pyx_v_v); __Pyx_GIVEREF(__pyx_v_v); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_v)) __PYX_ERR(0, 86, __pyx_L1_error); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_rest, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":82 * rest = [ ] * * for k, v in sorted(self.__dict__.items()): # <<<<<<<<<<<<<< * if k == "_type" or k == "timestamp": * continue */ __pyx_L12_continue:; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":88 * rest.append("%s=%r" % (k, v)) * * return '' % (self.type, ename, ", ".join(rest)) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s_, __pyx_v_rest); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ename); __Pyx_GIVEREF(__pyx_v_ename); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ename)) __PYX_ERR(0, 88, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Event_d_s_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":71 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < WINDOWMOVED: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ename); __Pyx_XDECREF(__pyx_v_rest); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":90 * return '' % (self.type, ename, ", ".join(rest)) * * @property # <<<<<<<<<<<<<< * def dict(self): * return self.__dict__ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_5dict(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType_4dict, "EventType.dict(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_5dict = {"dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_5dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType_4dict}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_5dict(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dict (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dict") < 0)) __PYX_ERR(0, 90, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dict", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 90, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.EventType.dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_4dict(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_4dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dict", 1); /* "pygame_sdl2/event.pyx":92 * @property * def dict(self): * return self.__dict__ # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":90 * return '' % (self.type, ename, ", ".join(rest)) * * @property # <<<<<<<<<<<<<< * def dict(self): * return self.__dict__ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.EventType.dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":94 * return self.__dict__ * * @property # <<<<<<<<<<<<<< * def type(self): * return self._type */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_7type(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType_6type, "EventType.type(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_7type = {"type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_7type, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType_6type}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_7type(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("type (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "type") < 0)) __PYX_ERR(0, 94, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("type", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 94, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.EventType.type", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_6type(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_6type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("type", 1); /* "pygame_sdl2/event.pyx":96 * @property * def type(self): * return self._type # <<<<<<<<<<<<<< * * def __eq__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":94 * return self.__dict__ * * @property # <<<<<<<<<<<<<< * def type(self): * return self._type */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.EventType.type", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":98 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_9__eq__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType_8__eq__, "EventType.__eq__(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_9__eq__ = {"__eq__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_9__eq__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType_8__eq__}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_9__eq__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 98, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__eq__") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_other = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.EventType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_8__eq__(__pyx_self, __pyx_v_self, __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__eq__", 1); /* "pygame_sdl2/event.pyx":99 * * def __eq__(self, other): * return self.__dict__ == other.__dict__ # <<<<<<<<<<<<<< * * def __ne__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":98 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":101 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_11__ne__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType_10__ne__, "EventType.__ne__(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_11__ne__ = {"__ne__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_11__ne__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType_10__ne__}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_11__ne__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); __PYX_ERR(0, 101, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__ne__") < 0)) __PYX_ERR(0, 101, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_other = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 101, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.EventType.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_10__ne__(__pyx_self, __pyx_v_self, __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__ne__", 1); /* "pygame_sdl2/event.pyx":102 * * def __ne__(self, other): * return not (self == other) # <<<<<<<<<<<<<< * * def __nonzero__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_RichCompare(__pyx_v_self, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":101 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":104 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_13__nonzero__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType_12__nonzero__, "EventType.__nonzero__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_13__nonzero__ = {"__nonzero__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_13__nonzero__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType_12__nonzero__}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_13__nonzero__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__nonzero__") < 0)) __PYX_ERR(0, 104, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__nonzero__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 104, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.EventType.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_12__nonzero__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_12__nonzero__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__nonzero__", 1); /* "pygame_sdl2/event.pyx":105 * * def __nonzero__(self): * return self.type != 0 # <<<<<<<<<<<<<< * * Event = EventType */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":104 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":109 * Event = EventType * * cdef get_textinput(): # <<<<<<<<<<<<<< * cdef SDL_Event evt * */ static PyObject *__pyx_f_11pygame_sdl2_5event_get_textinput(void) { SDL_Event __pyx_v_evt; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_textinput", 1); /* "pygame_sdl2/event.pyx":112 * cdef SDL_Event evt * * SDL_PumpEvents() # <<<<<<<<<<<<<< * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: */ SDL_PumpEvents(); /* "pygame_sdl2/event.pyx":114 * SDL_PumpEvents() * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: # <<<<<<<<<<<<<< * return evt.text.text.decode('utf-8') * return u'' */ __pyx_t_1 = (SDL_PeepEvents((&__pyx_v_evt), 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":115 * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: * return evt.text.text.decode('utf-8') # <<<<<<<<<<<<<< * return u'' * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_v_evt.text.text; __pyx_t_3 = __Pyx_ssize_strlen(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 115, __pyx_L1_error) __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_2, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_4); __pyx_r = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":114 * SDL_PumpEvents() * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: # <<<<<<<<<<<<<< * return evt.text.text.decode('utf-8') * return u'' */ } /* "pygame_sdl2/event.pyx":116 * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: * return evt.text.text.decode('utf-8') * return u'' # <<<<<<<<<<<<<< * * cdef make_keyboard_event(SDL_KeyboardEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_u__2); __pyx_r = __pyx_kp_u__2; goto __pyx_L0; /* "pygame_sdl2/event.pyx":109 * Event = EventType * * cdef get_textinput(): # <<<<<<<<<<<<<< * cdef SDL_Event evt * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.get_textinput", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":118 * return u'' * * cdef make_keyboard_event(SDL_KeyboardEvent *e): # <<<<<<<<<<<<<< * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_keyboard_event(SDL_KeyboardEvent *__pyx_v_e) { PyObject *__pyx_v_dargs = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_keyboard_event", 1); /* "pygame_sdl2/event.pyx":119 * * cdef make_keyboard_event(SDL_KeyboardEvent *e): * dargs = { 'scancode' : e.keysym.scancode, # <<<<<<<<<<<<<< * 'key' : e.keysym.sym, * 'mod' : e.keysym.mod, */ __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_SDL_Scancode(__pyx_v_e->keysym.scancode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_scancode, __pyx_t_2) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":120 * cdef make_keyboard_event(SDL_KeyboardEvent *e): * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, # <<<<<<<<<<<<<< * 'mod' : e.keysym.mod, * 'unicode' : '', */ __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->keysym.sym); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":121 * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, * 'mod' : e.keysym.mod, # <<<<<<<<<<<<<< * 'unicode' : '', * 'repeat' : e.repeat, */ __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_e->keysym.mod); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mod, __pyx_t_2) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_unicode, __pyx_kp_s__2) < 0) __PYX_ERR(0, 119, __pyx_L1_error) /* "pygame_sdl2/event.pyx":123 * 'mod' : e.keysym.mod, * 'unicode' : '', * 'repeat' : e.repeat, # <<<<<<<<<<<<<< * } * */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_repeat, __pyx_t_2) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dargs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":126 * } * * if not pygame_sdl2.key.text_input: # <<<<<<<<<<<<<< * * if e.type == SDL_KEYDOWN: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_text_input); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":128 * if not pygame_sdl2.key.text_input: * * if e.type == SDL_KEYDOWN: # <<<<<<<<<<<<<< * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. */ __pyx_t_4 = (__pyx_v_e->type == SDL_KEYDOWN); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":131 * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. * if e.keysym.sym < 0x20: # <<<<<<<<<<<<<< * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: */ __pyx_t_4 = (__pyx_v_e->keysym.sym < 0x20); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":132 * # there will be one associated with this KEYDOWN event. * if e.keysym.sym < 0x20: * dargs['unicode'] = unichr(e.keysym.sym) # <<<<<<<<<<<<<< * elif e.keysym.sym <= 0xFFFF: * dargs['unicode'] = get_textinput() */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_unichr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->keysym.sym); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (unlikely((PyDict_SetItem(__pyx_v_dargs, __pyx_n_s_unicode, __pyx_t_1) < 0))) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":131 * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. * if e.keysym.sym < 0x20: # <<<<<<<<<<<<<< * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: */ goto __pyx_L5; } /* "pygame_sdl2/event.pyx":133 * if e.keysym.sym < 0x20: * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: # <<<<<<<<<<<<<< * dargs['unicode'] = get_textinput() * */ __pyx_t_4 = (__pyx_v_e->keysym.sym <= 0xFFFF); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":134 * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: * dargs['unicode'] = get_textinput() # <<<<<<<<<<<<<< * * else: */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5event_get_textinput(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((PyDict_SetItem(__pyx_v_dargs, __pyx_n_s_unicode, __pyx_t_1) < 0))) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":133 * if e.keysym.sym < 0x20: * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: # <<<<<<<<<<<<<< * dargs['unicode'] = get_textinput() * */ } __pyx_L5:; /* "pygame_sdl2/event.pyx":128 * if not pygame_sdl2.key.text_input: * * if e.type == SDL_KEYDOWN: # <<<<<<<<<<<<<< * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. */ } /* "pygame_sdl2/event.pyx":126 * } * * if not pygame_sdl2.key.text_input: # <<<<<<<<<<<<<< * * if e.type == SDL_KEYDOWN: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":137 * * else: * if e.type == SDL_KEYDOWN and not(e.keysym.mod & KMOD_NUM): # <<<<<<<<<<<<<< * if SDLK_KP_1 <= e.keysym.sym <= SDLK_KP_0: * get_textinput() */ /*else*/ { __pyx_t_3 = (__pyx_v_e->type == SDL_KEYDOWN); if (__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L7_bool_binop_done; } __pyx_t_3 = (!((__pyx_v_e->keysym.mod & KMOD_NUM) != 0)); __pyx_t_4 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":138 * else: * if e.type == SDL_KEYDOWN and not(e.keysym.mod & KMOD_NUM): * if SDLK_KP_1 <= e.keysym.sym <= SDLK_KP_0: # <<<<<<<<<<<<<< * get_textinput() * dargs['unicode'] = '' */ __pyx_t_4 = (SDLK_KP_1 <= __pyx_v_e->keysym.sym); if (__pyx_t_4) { __pyx_t_4 = (__pyx_v_e->keysym.sym <= SDLK_KP_0); } if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":139 * if e.type == SDL_KEYDOWN and not(e.keysym.mod & KMOD_NUM): * if SDLK_KP_1 <= e.keysym.sym <= SDLK_KP_0: * get_textinput() # <<<<<<<<<<<<<< * dargs['unicode'] = '' * */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5event_get_textinput(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":140 * if SDLK_KP_1 <= e.keysym.sym <= SDLK_KP_0: * get_textinput() * dargs['unicode'] = '' # <<<<<<<<<<<<<< * * return EventType(e.type, dict=dargs, repeat=e.repeat) */ if (unlikely((PyDict_SetItem(__pyx_v_dargs, __pyx_n_s_unicode, __pyx_kp_s__2) < 0))) __PYX_ERR(0, 140, __pyx_L1_error) /* "pygame_sdl2/event.pyx":138 * else: * if e.type == SDL_KEYDOWN and not(e.keysym.mod & KMOD_NUM): * if SDLK_KP_1 <= e.keysym.sym <= SDLK_KP_0: # <<<<<<<<<<<<<< * get_textinput() * dargs['unicode'] = '' */ } /* "pygame_sdl2/event.pyx":137 * * else: * if e.type == SDL_KEYDOWN and not(e.keysym.mod & KMOD_NUM): # <<<<<<<<<<<<<< * if SDLK_KP_1 <= e.keysym.sym <= SDLK_KP_0: * get_textinput() */ } } __pyx_L3:; /* "pygame_sdl2/event.pyx":142 * dargs['unicode'] = '' * * return EventType(e.type, dict=dargs, repeat=e.repeat) # <<<<<<<<<<<<<< * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dict, __pyx_v_dargs) < 0) __PYX_ERR(0, 142, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->repeat); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_repeat, __pyx_t_6) < 0) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":118 * return u'' * * cdef make_keyboard_event(SDL_KeyboardEvent *e): # <<<<<<<<<<<<<< * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_keyboard_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":144 * return EventType(e.type, dict=dargs, repeat=e.repeat) * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): # <<<<<<<<<<<<<< * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousemotion_event(SDL_MouseMotionEvent *__pyx_v_e) { PyObject *__pyx_v_buttons = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_mousemotion_event", 1); /* "pygame_sdl2/event.pyx":145 * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) */ __pyx_t_2 = ((__pyx_v_e->state & SDL_BUTTON_LMASK) != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_int_1); __pyx_t_1 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; } /* "pygame_sdl2/event.pyx":146 * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, # <<<<<<<<<<<<<< * 1 if e.state & SDL_BUTTON_RMASK else 0) * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons, touch=(SDL_TOUCH_MOUSEID == e.which)) */ __pyx_t_2 = ((__pyx_v_e->state & SDL_BUTTON_MMASK) != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_int_1); __pyx_t_3 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_3 = __pyx_int_0; } /* "pygame_sdl2/event.pyx":147 * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) # <<<<<<<<<<<<<< * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons, touch=(SDL_TOUCH_MOUSEID == e.which)) * */ __pyx_t_2 = ((__pyx_v_e->state & SDL_BUTTON_RMASK) != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_int_1); __pyx_t_4 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_4 = __pyx_int_0; } /* "pygame_sdl2/event.pyx":145 * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_v_buttons = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":148 * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons, touch=(SDL_TOUCH_MOUSEID == e.which)) # <<<<<<<<<<<<<< * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_EventType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_t_7) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_int32_t(__pyx_v_e->xrel); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->yrel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_rel, __pyx_t_1) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_1) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_buttons, __pyx_v_buttons) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID == __pyx_v_e->which)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touch, __pyx_t_1) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":144 * return EventType(e.type, dict=dargs, repeat=e.repeat) * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): # <<<<<<<<<<<<<< * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.make_mousemotion_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buttons); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":150 * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons, touch=(SDL_TOUCH_MOUSEID == e.which)) * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): # <<<<<<<<<<<<<< * btn = e.button * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousebtn_event(SDL_MouseButtonEvent *__pyx_v_e) { PyObject *__pyx_v_btn = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_mousebtn_event", 1); /* "pygame_sdl2/event.pyx":151 * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): * btn = e.button # <<<<<<<<<<<<<< * * # SDL 1.x maps wheel to buttons 4/5 */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->button); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_btn = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":154 * * # SDL 1.x maps wheel to buttons 4/5 * if mousewheel_buttons and btn >= 4: # <<<<<<<<<<<<<< * btn += 2 * */ if (__pyx_v_11pygame_sdl2_5event_mousewheel_buttons) { } else { __pyx_t_2 = __pyx_v_11pygame_sdl2_5event_mousewheel_buttons; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = PyObject_RichCompare(__pyx_v_btn, __pyx_int_4, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":155 * # SDL 1.x maps wheel to buttons 4/5 * if mousewheel_buttons and btn >= 4: * btn += 2 # <<<<<<<<<<<<<< * * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which, touch=(SDL_TOUCH_MOUSEID == e.which)) */ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_btn, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_btn, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":154 * * # SDL 1.x maps wheel to buttons 4/5 * if mousewheel_buttons and btn >= 4: # <<<<<<<<<<<<<< * btn += 2 * */ } /* "pygame_sdl2/event.pyx":157 * btn += 2 * * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which, touch=(SDL_TOUCH_MOUSEID == e.which)) # <<<<<<<<<<<<<< * * cdef make_mousewheel_event(SDL_MouseWheelEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_button, __pyx_v_btn) < 0) __PYX_ERR(0, 157, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(0, 157, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_t_8) < 0) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_8) < 0) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyBool_FromLong((__pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID == __pyx_v_e->which)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touch, __pyx_t_8) < 0) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":150 * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons, touch=(SDL_TOUCH_MOUSEID == e.which)) * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): # <<<<<<<<<<<<<< * btn = e.button * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.event.make_mousebtn_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_btn); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":159 * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which, touch=(SDL_TOUCH_MOUSEID == e.which)) * * cdef make_mousewheel_event(SDL_MouseWheelEvent *e): # <<<<<<<<<<<<<< * * cdef int x, y */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousewheel_event(SDL_MouseWheelEvent *__pyx_v_e) { int __pyx_v_x; int __pyx_v_y; long __pyx_v_btn; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Sint32 __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_mousewheel_event", 1); /* "pygame_sdl2/event.pyx":164 * * # SDL2-style, if the user has opted-in. * if not mousewheel_buttons: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.which, x=e.x, y=e.y, touch=(SDL_TOUCH_MOUSEID == e.which)) * */ __pyx_t_1 = (!__pyx_v_11pygame_sdl2_5event_mousewheel_buttons); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":165 * # SDL2-style, if the user has opted-in. * if not mousewheel_buttons: * return EventType(e.type, which=e.which, x=e.x, y=e.y, touch=(SDL_TOUCH_MOUSEID == e.which)) # <<<<<<<<<<<<<< * * # Otherwise, follow the SDL1 approach. */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_which, __pyx_t_5) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_x, __pyx_t_5) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_y, __pyx_t_5) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID == __pyx_v_e->which)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_touch, __pyx_t_5) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":164 * * # SDL2-style, if the user has opted-in. * if not mousewheel_buttons: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.which, x=e.x, y=e.y, touch=(SDL_TOUCH_MOUSEID == e.which)) * */ } /* "pygame_sdl2/event.pyx":169 * # Otherwise, follow the SDL1 approach. * * y = e.y # <<<<<<<<<<<<<< * * # TODO: Implement when 2.0.4 becomes widespread. */ __pyx_t_6 = __pyx_v_e->y; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/event.pyx":175 * # y = -y * * if y > 0: # <<<<<<<<<<<<<< * btn = 4 * elif y < 0: */ __pyx_t_1 = (__pyx_v_y > 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":176 * * if y > 0: * btn = 4 # <<<<<<<<<<<<<< * elif y < 0: * btn = 5 */ __pyx_v_btn = 4; /* "pygame_sdl2/event.pyx":175 * # y = -y * * if y > 0: # <<<<<<<<<<<<<< * btn = 4 * elif y < 0: */ goto __pyx_L4; } /* "pygame_sdl2/event.pyx":177 * if y > 0: * btn = 4 * elif y < 0: # <<<<<<<<<<<<<< * btn = 5 * else: */ __pyx_t_1 = (__pyx_v_y < 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":178 * btn = 4 * elif y < 0: * btn = 5 # <<<<<<<<<<<<<< * else: * return EventType(0) # x axis scrolling produces no event in pygame */ __pyx_v_btn = 5; /* "pygame_sdl2/event.pyx":177 * if y > 0: * btn = 4 * elif y < 0: # <<<<<<<<<<<<<< * btn = 5 * else: */ goto __pyx_L4; } /* "pygame_sdl2/event.pyx":180 * btn = 5 * else: * return EventType(0) # x axis scrolling produces no event in pygame # <<<<<<<<<<<<<< * * # This is not the mouse position at the time of the event */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_EventType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_int_0}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } __pyx_L4:; /* "pygame_sdl2/event.pyx":183 * * # This is not the mouse position at the time of the event * SDL_GetMouseState(&x, &y) # <<<<<<<<<<<<<< * * # MOUSEBUTTONUP event should follow immediately after */ (void)(SDL_GetMouseState((&__pyx_v_x), (&__pyx_v_y))); /* "pygame_sdl2/event.pyx":186 * * # MOUSEBUTTONUP event should follow immediately after * event_queue.insert(0, EventType(SDL_MOUSEBUTTONUP, which=e.which, button=btn, pos=(x,y), touch=(SDL_TOUCH_MOUSEID == e.which))) # <<<<<<<<<<<<<< * return EventType(SDL_MOUSEBUTTONDOWN, which=e.which, button=btn, pos=(x,y), touch=(SDL_TOUCH_MOUSEID == e.which)) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(event_queue, __pyx_n_s_insert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_which, __pyx_t_9) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_btn); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_button, __pyx_t_9) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9)) __PYX_ERR(0, 186, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10)) __PYX_ERR(0, 186, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_10 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pos, __pyx_t_11) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyBool_FromLong((__pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID == __pyx_v_e->which)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_touch, __pyx_t_11) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_int_0, __pyx_t_11}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":187 * # MOUSEBUTTONUP event should follow immediately after * event_queue.insert(0, EventType(SDL_MOUSEBUTTONUP, which=e.which, button=btn, pos=(x,y), touch=(SDL_TOUCH_MOUSEID == e.which))) * return EventType(SDL_MOUSEBUTTONDOWN, which=e.which, button=btn, pos=(x,y), touch=(SDL_TOUCH_MOUSEID == e.which)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_EventType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_which, __pyx_t_2) < 0) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_btn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_button, __pyx_t_2) < 0) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8)) __PYX_ERR(0, 187, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_8 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_pos, __pyx_t_4) < 0) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID == __pyx_v_e->which)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_touch, __pyx_t_4) < 0) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":159 * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which, touch=(SDL_TOUCH_MOUSEID == e.which)) * * cdef make_mousewheel_event(SDL_MouseWheelEvent *e): # <<<<<<<<<<<<<< * * cdef int x, y */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.event.make_mousewheel_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":190 * * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, axis=e.axis, value=e.value/32768.0) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyaxis_event(SDL_JoyAxisEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_joyaxis_event", 1); /* "pygame_sdl2/event.pyx":191 * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): * return EventType(e.type, joy=e.which, instance_id=e.which, axis=e.axis, value=e.value/32768.0) # <<<<<<<<<<<<<< * * cdef make_joyball_event(SDL_JoyBallEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_instance_id, __pyx_t_4) < 0) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->axis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_axis, __pyx_t_4) < 0) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyFloat_FromDouble((((double)__pyx_v_e->value) / 32768.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_t_4) < 0) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":190 * * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, axis=e.axis, value=e.value/32768.0) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_joyaxis_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":193 * return EventType(e.type, joy=e.which, instance_id=e.which, axis=e.axis, value=e.value/32768.0) * * cdef make_joyball_event(SDL_JoyBallEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyball_event(SDL_JoyBallEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_joyball_event", 1); /* "pygame_sdl2/event.pyx":194 * * cdef make_joyball_event(SDL_JoyBallEvent *e): * return EventType(e.type, joy=e.which, instance_id=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) # <<<<<<<<<<<<<< * * cdef make_joyhat_event(SDL_JoyHatEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_instance_id, __pyx_t_4) < 0) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->ball); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ball, __pyx_t_4) < 0) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int16_t(__pyx_v_e->xrel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int16_t(__pyx_v_e->yrel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rel, __pyx_t_6) < 0) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":193 * return EventType(e.type, joy=e.which, instance_id=e.which, axis=e.axis, value=e.value/32768.0) * * cdef make_joyball_event(SDL_JoyBallEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_joyball_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":196 * return EventType(e.type, joy=e.which, instance_id=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * * cdef make_joyhat_event(SDL_JoyHatEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, hat=e.hat, value=e.value) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyhat_event(SDL_JoyHatEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_joyhat_event", 1); /* "pygame_sdl2/event.pyx":197 * * cdef make_joyhat_event(SDL_JoyHatEvent *e): * return EventType(e.type, joy=e.which, instance_id=e.which, hat=e.hat, value=e.value) # <<<<<<<<<<<<<< * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_instance_id, __pyx_t_4) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->hat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hat, __pyx_t_4) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_t_4) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":196 * return EventType(e.type, joy=e.which, instance_id=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * * cdef make_joyhat_event(SDL_JoyHatEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, hat=e.hat, value=e.value) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_joyhat_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":199 * return EventType(e.type, joy=e.which, instance_id=e.which, hat=e.hat, value=e.value) * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, button=e.button) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joybtn_event(SDL_JoyButtonEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_joybtn_event", 1); /* "pygame_sdl2/event.pyx":200 * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): * return EventType(e.type, joy=e.which, instance_id=e.which, button=e.button) # <<<<<<<<<<<<<< * * cdef make_textinput_event(SDL_TextInputEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_instance_id, __pyx_t_4) < 0) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->button); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_button, __pyx_t_4) < 0) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":199 * return EventType(e.type, joy=e.which, instance_id=e.which, hat=e.hat, value=e.value) * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, button=e.button) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_joybtn_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":202 * return EventType(e.type, joy=e.which, instance_id=e.which, button=e.button) * * cdef make_textinput_event(SDL_TextInputEvent *e): # <<<<<<<<<<<<<< * try: * return EventType(e.type, text=e.text.decode("utf-8")) */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textinput_event(SDL_TextInputEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; char *__pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_textinput_event", 1); /* "pygame_sdl2/event.pyx":203 * * cdef make_textinput_event(SDL_TextInputEvent *e): * try: # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8")) * except UnicodeDecodeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "pygame_sdl2/event.pyx":204 * cdef make_textinput_event(SDL_TextInputEvent *e): * try: * return EventType(e.type, text=e.text.decode("utf-8")) # <<<<<<<<<<<<<< * except UnicodeDecodeError: * return EventType(e.type, text='') */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 204, __pyx_L3_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __pyx_v_e->text; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 204, __pyx_L3_error) __pyx_t_9 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_text, __pyx_t_9) < 0) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/event.pyx":203 * * cdef make_textinput_event(SDL_TextInputEvent *e): * try: # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8")) * except UnicodeDecodeError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/event.pyx":205 * try: * return EventType(e.type, text=e.text.decode("utf-8")) * except UnicodeDecodeError: # <<<<<<<<<<<<<< * return EventType(e.type, text='') * */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError); if (__pyx_t_10) { __Pyx_AddTraceback("pygame_sdl2.event.make_textinput_event", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 205, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /* "pygame_sdl2/event.pyx":206 * return EventType(e.type, text=e.text.decode("utf-8")) * except UnicodeDecodeError: * return EventType(e.type, text='') # <<<<<<<<<<<<<< * * cdef make_textediting_event(SDL_TextEditingEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 206, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 206, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11)) __PYX_ERR(0, 206, __pyx_L5_except_error); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 206, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_text, __pyx_kp_s__2) < 0) __PYX_ERR(0, 206, __pyx_L5_except_error) __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 206, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_r = __pyx_t_13; __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; /* "pygame_sdl2/event.pyx":203 * * cdef make_textinput_event(SDL_TextInputEvent *e): * try: # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8")) * except UnicodeDecodeError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "pygame_sdl2/event.pyx":202 * return EventType(e.type, joy=e.which, instance_id=e.which, button=e.button) * * cdef make_textinput_event(SDL_TextInputEvent *e): # <<<<<<<<<<<<<< * try: * return EventType(e.type, text=e.text.decode("utf-8")) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("pygame_sdl2.event.make_textinput_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":208 * return EventType(e.type, text='') * * cdef make_textediting_event(SDL_TextEditingEvent *e): # <<<<<<<<<<<<<< * try: * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textediting_event(SDL_TextEditingEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; char *__pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_textediting_event", 1); /* "pygame_sdl2/event.pyx":209 * * cdef make_textediting_event(SDL_TextEditingEvent *e): * try: # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * except UnicodeDecodeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "pygame_sdl2/event.pyx":210 * cdef make_textediting_event(SDL_TextEditingEvent *e): * try: * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) # <<<<<<<<<<<<<< * except UnicodeDecodeError: * return EventType(e.type, text='', start=e.start, length=e.length) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 210, __pyx_L3_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __pyx_v_e->text; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 210, __pyx_L3_error) __pyx_t_9 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_text, __pyx_t_9) < 0) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyInt_From_int32_t(__pyx_v_e->start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_start, __pyx_t_9) < 0) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyInt_From_int32_t(__pyx_v_e->length); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_length, __pyx_t_9) < 0) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/event.pyx":209 * * cdef make_textediting_event(SDL_TextEditingEvent *e): * try: # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * except UnicodeDecodeError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/event.pyx":211 * try: * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * except UnicodeDecodeError: # <<<<<<<<<<<<<< * return EventType(e.type, text='', start=e.start, length=e.length) * */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError); if (__pyx_t_10) { __Pyx_AddTraceback("pygame_sdl2.event.make_textediting_event", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 211, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /* "pygame_sdl2/event.pyx":212 * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * except UnicodeDecodeError: * return EventType(e.type, text='', start=e.start, length=e.length) # <<<<<<<<<<<<<< * * cdef make_drop_event(SDL_DropEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11)) __PYX_ERR(0, 212, __pyx_L5_except_error); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_text, __pyx_kp_s__2) < 0) __PYX_ERR(0, 212, __pyx_L5_except_error) __pyx_t_13 = __Pyx_PyInt_From_int32_t(__pyx_v_e->start); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_start, __pyx_t_13) < 0) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = __Pyx_PyInt_From_int32_t(__pyx_v_e->length); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_length, __pyx_t_13) < 0) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_r = __pyx_t_13; __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; /* "pygame_sdl2/event.pyx":209 * * cdef make_textediting_event(SDL_TextEditingEvent *e): * try: # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * except UnicodeDecodeError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "pygame_sdl2/event.pyx":208 * return EventType(e.type, text='') * * cdef make_textediting_event(SDL_TextEditingEvent *e): # <<<<<<<<<<<<<< * try: * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("pygame_sdl2.event.make_textediting_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":214 * return EventType(e.type, text='', start=e.start, length=e.length) * * cdef make_drop_event(SDL_DropEvent *e): # <<<<<<<<<<<<<< * if e.file: * file = e.file.decode("utf-8") */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_drop_event(SDL_DropEvent *__pyx_v_e) { PyObject *__pyx_v_file = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_drop_event", 1); /* "pygame_sdl2/event.pyx":215 * * cdef make_drop_event(SDL_DropEvent *e): * if e.file: # <<<<<<<<<<<<<< * file = e.file.decode("utf-8") * SDL_free(e.file) */ __pyx_t_1 = (__pyx_v_e->file != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":216 * cdef make_drop_event(SDL_DropEvent *e): * if e.file: * file = e.file.decode("utf-8") # <<<<<<<<<<<<<< * SDL_free(e.file) * else: */ __pyx_t_2 = __pyx_v_e->file; __pyx_t_3 = __Pyx_ssize_strlen(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 216, __pyx_L1_error) __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_2, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_4); __pyx_v_file = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":217 * if e.file: * file = e.file.decode("utf-8") * SDL_free(e.file) # <<<<<<<<<<<<<< * else: * file = None */ SDL_free(__pyx_v_e->file); /* "pygame_sdl2/event.pyx":215 * * cdef make_drop_event(SDL_DropEvent *e): * if e.file: # <<<<<<<<<<<<<< * file = e.file.decode("utf-8") * SDL_free(e.file) */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":219 * SDL_free(e.file) * else: * file = None # <<<<<<<<<<<<<< * * return EventType(e.type, file=file, window_id=e.windowID) */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_file = Py_None; } __pyx_L3:; /* "pygame_sdl2/event.pyx":221 * file = None * * return EventType(e.type, file=file, window_id=e.windowID) # <<<<<<<<<<<<<< * * cdef make_window_event(SDL_WindowEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_file, __pyx_v_file) < 0) __PYX_ERR(0, 221, __pyx_L1_error) __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->windowID); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_window_id, __pyx_t_7) < 0) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":214 * return EventType(e.type, text='', start=e.start, length=e.length) * * cdef make_drop_event(SDL_DropEvent *e): # <<<<<<<<<<<<<< * if e.file: * file = e.file.decode("utf-8") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.make_drop_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_file); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":223 * return EventType(e.type, file=file, window_id=e.windowID) * * cdef make_window_event(SDL_WindowEvent *e): # <<<<<<<<<<<<<< * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_window_event(SDL_WindowEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_window_event", 1); /* "pygame_sdl2/event.pyx":225 * cdef make_window_event(SDL_WindowEvent *e): * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: */ switch (__pyx_v_e->event) { case SDL_WINDOWEVENT_ENTER: /* "pygame_sdl2/event.pyx":226 * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: * return EventType(ACTIVEEVENT, state=1, gain=1) # <<<<<<<<<<<<<< * elif e.event == SDL_WINDOWEVENT_LEAVE: * return EventType(ACTIVEEVENT, state=1, gain=0) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_1) < 0) __PYX_ERR(0, 226, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) __PYX_ERR(0, 226, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":225 * cdef make_window_event(SDL_WindowEvent *e): * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: */ break; case SDL_WINDOWEVENT_LEAVE: /* "pygame_sdl2/event.pyx":228 * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: * return EventType(ACTIVEEVENT, state=1, gain=0) # <<<<<<<<<<<<<< * * # SDL_APPINPUTFOCUS */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_1) < 0) __PYX_ERR(0, 228, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) __PYX_ERR(0, 228, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":227 * if e.event == SDL_WINDOWEVENT_ENTER: * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=0) * */ break; case SDL_WINDOWEVENT_FOCUS_GAINED: /* "pygame_sdl2/event.pyx":232 * # SDL_APPINPUTFOCUS * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: * return EventType(ACTIVEEVENT, state=2, gain=1) # <<<<<<<<<<<<<< * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: * return EventType(ACTIVEEVENT, state=2, gain=0) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_2) < 0) __PYX_ERR(0, 232, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) __PYX_ERR(0, 232, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":231 * * # SDL_APPINPUTFOCUS * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: */ break; case SDL_WINDOWEVENT_FOCUS_LOST: /* "pygame_sdl2/event.pyx":234 * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: * return EventType(ACTIVEEVENT, state=2, gain=0) # <<<<<<<<<<<<<< * * # SDL_APPACTIVE */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_2) < 0) __PYX_ERR(0, 234, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) __PYX_ERR(0, 234, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":233 * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=2, gain=0) * */ break; case SDL_WINDOWEVENT_RESTORED: /* "pygame_sdl2/event.pyx":238 * # SDL_APPACTIVE * elif e.event == SDL_WINDOWEVENT_RESTORED: * return EventType(ACTIVEEVENT, state=4, gain=1) # <<<<<<<<<<<<<< * elif e.event == SDL_WINDOWEVENT_MINIMIZED: * return EventType(ACTIVEEVENT, state=4, gain=0) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_4) < 0) __PYX_ERR(0, 238, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) __PYX_ERR(0, 238, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":237 * * # SDL_APPACTIVE * elif e.event == SDL_WINDOWEVENT_RESTORED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: */ break; case SDL_WINDOWEVENT_MINIMIZED: /* "pygame_sdl2/event.pyx":240 * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: * return EventType(ACTIVEEVENT, state=4, gain=0) # <<<<<<<<<<<<<< * * elif e.event == SDL_WINDOWEVENT_RESIZED: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_4) < 0) __PYX_ERR(0, 240, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) __PYX_ERR(0, 240, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":239 * elif e.event == SDL_WINDOWEVENT_RESTORED: * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=4, gain=0) * */ break; case SDL_WINDOWEVENT_RESIZED: /* "pygame_sdl2/event.pyx":243 * * elif e.event == SDL_WINDOWEVENT_RESIZED: * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) # <<<<<<<<<<<<<< * * elif e.event == SDL_WINDOWEVENT_EXPOSED: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_VIDEORESIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_t_6) < 0) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_w, __pyx_t_6) < 0) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_h, __pyx_t_6) < 0) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":242 * return EventType(ACTIVEEVENT, state=4, gain=0) * * elif e.event == SDL_WINDOWEVENT_RESIZED: # <<<<<<<<<<<<<< * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) * */ break; case SDL_WINDOWEVENT_EXPOSED: /* "pygame_sdl2/event.pyx":246 * * elif e.event == SDL_WINDOWEVENT_EXPOSED: * return EventType(VIDEOEXPOSE) # <<<<<<<<<<<<<< * * elif e.event == SDL_WINDOWEVENT_MOVED: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_VIDEOEXPOSE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":245 * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) * * elif e.event == SDL_WINDOWEVENT_EXPOSED: # <<<<<<<<<<<<<< * return EventType(VIDEOEXPOSE) * */ break; case SDL_WINDOWEVENT_MOVED: /* "pygame_sdl2/event.pyx":249 * * elif e.event == SDL_WINDOWEVENT_MOVED: * return EventType(WINDOWMOVED, pos=(e.data1, e.data2), x=e.data1, y=e.data2) # <<<<<<<<<<<<<< * * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_WINDOWMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pos, __pyx_t_4) < 0) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_x, __pyx_t_4) < 0) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_y, __pyx_t_4) < 0) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":248 * return EventType(VIDEOEXPOSE) * * elif e.event == SDL_WINDOWEVENT_MOVED: # <<<<<<<<<<<<<< * return EventType(WINDOWMOVED, pos=(e.data1, e.data2), x=e.data1, y=e.data2) * */ break; default: break; } /* "pygame_sdl2/event.pyx":251 * return EventType(WINDOWMOVED, pos=(e.data1, e.data2), x=e.data1, y=e.data2) * * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) # <<<<<<<<<<<<<< * * cdef make_event(SDL_Event *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->event); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_event, __pyx_t_6) < 0) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data1, __pyx_t_6) < 0) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data2, __pyx_t_6) < 0) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":223 * return EventType(e.type, file=file, window_id=e.windowID) * * cdef make_window_event(SDL_WindowEvent *e): # <<<<<<<<<<<<<< * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_window_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":253 * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) * * cdef make_event(SDL_Event *e): # <<<<<<<<<<<<<< * cdef object o * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_event(SDL_Event *__pyx_v_e) { PyObject *__pyx_v_o = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_event", 1); /* "pygame_sdl2/event.pyx":256 * cdef object o * * if e.type == SDL_MOUSEMOTION: # <<<<<<<<<<<<<< * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): */ __pyx_t_1 = (__pyx_v_e->type == SDL_MOUSEMOTION); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":257 * * if e.type == SDL_MOUSEMOTION: * return make_mousemotion_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): * return make_mousebtn_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_mousemotion_event(((SDL_MouseMotionEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":256 * cdef object o * * if e.type == SDL_MOUSEMOTION: # <<<<<<<<<<<<<< * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): */ } /* "pygame_sdl2/event.pyx":258 * if e.type == SDL_MOUSEMOTION: * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): # <<<<<<<<<<<<<< * return make_mousebtn_event(e) * */ switch (__pyx_v_e->type) { case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = __pyx_t_1; if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":259 * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): * return make_mousebtn_event(e) # <<<<<<<<<<<<<< * * elif e.type == SDL_MOUSEWHEEL: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_mousebtn_event(((SDL_MouseButtonEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":258 * if e.type == SDL_MOUSEMOTION: * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): # <<<<<<<<<<<<<< * return make_mousebtn_event(e) * */ } /* "pygame_sdl2/event.pyx":261 * return make_mousebtn_event(e) * * elif e.type == SDL_MOUSEWHEEL: # <<<<<<<<<<<<<< * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): */ __pyx_t_3 = (__pyx_v_e->type == SDL_MOUSEWHEEL); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":262 * * elif e.type == SDL_MOUSEWHEEL: * return make_mousewheel_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_mousewheel_event(((SDL_MouseWheelEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":261 * return make_mousebtn_event(e) * * elif e.type == SDL_MOUSEWHEEL: # <<<<<<<<<<<<<< * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): */ } /* "pygame_sdl2/event.pyx":263 * elif e.type == SDL_MOUSEWHEEL: * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): # <<<<<<<<<<<<<< * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: */ switch (__pyx_v_e->type) { case SDL_KEYDOWN: case SDL_KEYUP: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = __pyx_t_3; if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":264 * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_keyboard_event(((SDL_KeyboardEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":263 * elif e.type == SDL_MOUSEWHEEL: * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): # <<<<<<<<<<<<<< * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: */ } /* "pygame_sdl2/event.pyx":265 * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: # <<<<<<<<<<<<<< * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: */ __pyx_t_1 = (__pyx_v_e->type == SDL_JOYAXISMOTION); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":266 * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joyaxis_event(((SDL_JoyAxisEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":265 * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: # <<<<<<<<<<<<<< * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: */ } /* "pygame_sdl2/event.pyx":267 * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: # <<<<<<<<<<<<<< * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: */ __pyx_t_1 = (__pyx_v_e->type == SDL_JOYBALLMOTION); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":268 * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joyball_event(((SDL_JoyBallEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":267 * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: # <<<<<<<<<<<<<< * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: */ } /* "pygame_sdl2/event.pyx":269 * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: # <<<<<<<<<<<<<< * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): */ __pyx_t_1 = (__pyx_v_e->type == SDL_JOYHATMOTION); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":270 * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joyhat_event(((SDL_JoyHatEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":269 * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: # <<<<<<<<<<<<<< * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): */ } /* "pygame_sdl2/event.pyx":271 * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): # <<<<<<<<<<<<<< * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): */ switch (__pyx_v_e->type) { case SDL_JOYBUTTONDOWN: case SDL_JOYBUTTONUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = __pyx_t_1; if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":272 * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joybtn_event(((SDL_JoyButtonEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":271 * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): # <<<<<<<<<<<<<< * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): */ } /* "pygame_sdl2/event.pyx":273 * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: */ switch (__pyx_v_e->type) { case SDL_JOYDEVICEADDED: case SDL_JOYDEVICEREMOVED: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = __pyx_t_3; if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":274 * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) # <<<<<<<<<<<<<< * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->jdevice.which); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_6) < 0) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":273 * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: */ } /* "pygame_sdl2/event.pyx":275 * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: # <<<<<<<<<<<<<< * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: */ __pyx_t_1 = (__pyx_v_e->type == SDL_WINDOWEVENT); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":276 * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_make_window_event(((SDL_WindowEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":275 * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: # <<<<<<<<<<<<<< * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: */ } /* "pygame_sdl2/event.pyx":277 * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: # <<<<<<<<<<<<<< * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: */ __pyx_t_1 = (__pyx_v_e->type == SDL_TEXTINPUT); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":278 * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) # <<<<<<<<<<<<<< * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_make_textinput_event(((SDL_TextInputEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":277 * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: # <<<<<<<<<<<<<< * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: */ } /* "pygame_sdl2/event.pyx":279 * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: # <<<<<<<<<<<<<< * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: */ __pyx_t_1 = (__pyx_v_e->type == SDL_TEXTEDITING); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":280 * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) # <<<<<<<<<<<<<< * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_make_textediting_event(((SDL_TextEditingEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":279 * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: # <<<<<<<<<<<<<< * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: */ } /* "pygame_sdl2/event.pyx":281 * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): */ __pyx_t_1 = (__pyx_v_e->type == SDL_CONTROLLERAXISMOTION); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":282 * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) # <<<<<<<<<<<<<< * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->caxis.which); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_2) < 0) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->caxis.axis); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_t_2) < 0) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_e->caxis.value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_value, __pyx_t_2) < 0) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":281 * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): */ } /* "pygame_sdl2/event.pyx":283 * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): */ switch (__pyx_v_e->type) { case SDL_CONTROLLERBUTTONDOWN: case SDL_CONTROLLERBUTTONUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = __pyx_t_1; if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":284 * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) # <<<<<<<<<<<<<< * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->cbutton.which); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_6) < 0) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->cbutton.button); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_button, __pyx_t_6) < 0) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->cbutton.state); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_state, __pyx_t_6) < 0) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":283 * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): */ } /* "pygame_sdl2/event.pyx":285 * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): */ switch (__pyx_v_e->type) { case SDL_CONTROLLERDEVICEADDED: case SDL_CONTROLLERDEVICEREMOVED: case SDL_CONTROLLERDEVICEREMAPPED: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = __pyx_t_3; if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":286 * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) # <<<<<<<<<<<<<< * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->cdevice.which); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_2) < 0) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":285 * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): */ } /* "pygame_sdl2/event.pyx":287 * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: */ switch (__pyx_v_e->type) { case SDL_FINGERMOTION: case SDL_FINGERDOWN: case SDL_FINGERUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = __pyx_t_1; if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":288 * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) # <<<<<<<<<<<<<< * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_e->tfinger.touchId); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touchId, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_e->tfinger.fingerId); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fingerId, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_e->tfinger.touchId); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touch_id, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_e->tfinger.fingerId); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_finger_id, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_x, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_y, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.dx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dx, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.dy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dy, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.pressure); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pressure, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":287 * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: */ } /* "pygame_sdl2/event.pyx":289 * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): */ __pyx_t_3 = (__pyx_v_e->type == SDL_MULTIGESTURE); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":290 * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) # <<<<<<<<<<<<<< * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): * return make_drop_event( e) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_e->mgesture.touchId); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touchId, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.dTheta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dTheta, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.dDist); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dDist, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_y, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_e->mgesture.numFingers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_numFingers, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_e->mgesture.touchId); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touch_id, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.dTheta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_rotated, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.dDist); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pinched, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_e->mgesture.numFingers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_num_fingers, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":289 * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): */ } /* "pygame_sdl2/event.pyx":291 * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): # <<<<<<<<<<<<<< * return make_drop_event( e) * elif e.type == POSTEDEVENT: */ switch (__pyx_v_e->type) { case SDL_DROPFILE: case SDL_DROPTEXT: case SDL_DROPBEGIN: case SDL_DROPCOMPLETE: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = __pyx_t_3; if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":292 * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): * return make_drop_event( e) # <<<<<<<<<<<<<< * elif e.type == POSTEDEVENT: * o = e.user.data1 */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_drop_event(((SDL_DropEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":291 * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): # <<<<<<<<<<<<<< * return make_drop_event( e) * elif e.type == POSTEDEVENT: */ } /* "pygame_sdl2/event.pyx":293 * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): * return make_drop_event( e) * elif e.type == POSTEDEVENT: # <<<<<<<<<<<<<< * o = e.user.data1 * Py_DECREF(o) */ __pyx_t_1 = (__pyx_v_e->type == __pyx_v_11pygame_sdl2_5event_POSTEDEVENT); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":294 * return make_drop_event( e) * elif e.type == POSTEDEVENT: * o = e.user.data1 # <<<<<<<<<<<<<< * Py_DECREF(o) * return o */ __pyx_t_2 = ((PyObject *)__pyx_v_e->user.data1); __Pyx_INCREF(__pyx_t_2); __pyx_v_o = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":295 * elif e.type == POSTEDEVENT: * o = e.user.data1 * Py_DECREF(o) # <<<<<<<<<<<<<< * return o * elif e.type >= SDL_USEREVENT: */ Py_DECREF(__pyx_v_o); /* "pygame_sdl2/event.pyx":296 * o = e.user.data1 * Py_DECREF(o) * return o # <<<<<<<<<<<<<< * elif e.type >= SDL_USEREVENT: * # Can't do anything useful with data1 and data2 here. */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_o); __pyx_r = __pyx_v_o; goto __pyx_L0; /* "pygame_sdl2/event.pyx":293 * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): * return make_drop_event( e) * elif e.type == POSTEDEVENT: # <<<<<<<<<<<<<< * o = e.user.data1 * Py_DECREF(o) */ } /* "pygame_sdl2/event.pyx":297 * Py_DECREF(o) * return o * elif e.type >= SDL_USEREVENT: # <<<<<<<<<<<<<< * # Can't do anything useful with data1 and data2 here. * return EventType(e.type, code=e.user.code) */ __pyx_t_1 = (__pyx_v_e->type >= SDL_USEREVENT); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":299 * elif e.type >= SDL_USEREVENT: * # Can't do anything useful with data1 and data2 here. * return EventType(e.type, code=e.user.code) # <<<<<<<<<<<<<< * * return EventType(e.type) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->user.code); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code, __pyx_t_6) < 0) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":297 * Py_DECREF(o) * return o * elif e.type >= SDL_USEREVENT: # <<<<<<<<<<<<<< * # Can't do anything useful with data1 and data2 here. * return EventType(e.type, code=e.user.code) */ } /* "pygame_sdl2/event.pyx":301 * return EventType(e.type, code=e.user.code) * * return EventType(e.type) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":253 * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) * * cdef make_event(SDL_Event *e): # <<<<<<<<<<<<<< * cdef object o * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":314 * * * cdef bint has_event(kinds): # <<<<<<<<<<<<<< * """ * Returns true if at least one event in the queue has a type in `kinds`, */ static int __pyx_f_11pygame_sdl2_5event_has_event(PyObject *__pyx_v_kinds) { PyObject *__pyx_v_i = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_event", 1); /* "pygame_sdl2/event.pyx":322 * """ * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * return True */ if (likely(PyList_CheckExact(event_queue)) || PyTuple_CheckExact(event_queue)) { __pyx_t_1 = event_queue; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(event_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 322, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 322, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 322, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 322, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 322, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":323 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * return True * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_type_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_kinds, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { /* "pygame_sdl2/event.pyx":324 * for i in event_queue: * if i._type in kinds: * return True # <<<<<<<<<<<<<< * * */ __pyx_r = 1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":323 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * return True * */ } /* "pygame_sdl2/event.pyx":322 * """ * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * return True */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":314 * * * cdef bint has_event(kinds): # <<<<<<<<<<<<<< * """ * Returns true if at least one event in the queue has a type in `kinds`, */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.has_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":327 * * * cdef object get_events(kinds): # <<<<<<<<<<<<<< * """ * Returns a list containing all events in the event queue with type `kinds`. */ static PyObject *__pyx_f_11pygame_sdl2_5event_get_events(PyObject *__pyx_v_kinds) { PyObject *__pyx_v_rv = 0; PyObject *__pyx_v_new_queue = 0; PyObject *__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_events", 0); __Pyx_INCREF(__pyx_v_kinds); /* "pygame_sdl2/event.pyx":335 * """ * * if isinstance(kinds, (int, long)): # <<<<<<<<<<<<<< * kinds = [ kinds ] * */ __pyx_t_2 = PyInt_Check(__pyx_v_kinds); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyLong_Check(__pyx_v_kinds); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":336 * * if isinstance(kinds, (int, long)): * kinds = [ kinds ] # <<<<<<<<<<<<<< * * global event_queue */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_kinds); __Pyx_GIVEREF(__pyx_v_kinds); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_kinds)) __PYX_ERR(0, 336, __pyx_L1_error); __Pyx_DECREF_SET(__pyx_v_kinds, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":335 * """ * * if isinstance(kinds, (int, long)): # <<<<<<<<<<<<<< * kinds = [ kinds ] * */ } /* "pygame_sdl2/event.pyx":340 * global event_queue * * cdef list rv = [ ] # <<<<<<<<<<<<<< * cdef list new_queue = [ ] * */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":341 * * cdef list rv = [ ] * cdef list new_queue = [ ] # <<<<<<<<<<<<<< * * for i in event_queue: */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_new_queue = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":343 * cdef list new_queue = [ ] * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * rv.append(i) */ if (likely(PyList_CheckExact(event_queue)) || PyTuple_CheckExact(event_queue)) { __pyx_t_3 = event_queue; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(event_queue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 343, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":344 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * rv.append(i) * else: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_type_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_6, __pyx_v_kinds, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":345 * for i in event_queue: * if i._type in kinds: * rv.append(i) # <<<<<<<<<<<<<< * else: * new_queue.append(i) */ __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_i); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 345, __pyx_L1_error) /* "pygame_sdl2/event.pyx":344 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * rv.append(i) * else: */ goto __pyx_L8; } /* "pygame_sdl2/event.pyx":347 * rv.append(i) * else: * new_queue.append(i) # <<<<<<<<<<<<<< * * event_queue = new_queue */ /*else*/ { __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_new_queue, __pyx_v_i); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 347, __pyx_L1_error) } __pyx_L8:; /* "pygame_sdl2/event.pyx":343 * cdef list new_queue = [ ] * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * rv.append(i) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":349 * new_queue.append(i) * * event_queue = new_queue # <<<<<<<<<<<<<< * * return rv */ __Pyx_INCREF(__pyx_v_new_queue); __Pyx_XGOTREF(event_queue); __Pyx_DECREF_SET(event_queue, __pyx_v_new_queue); __Pyx_GIVEREF(__pyx_v_new_queue); /* "pygame_sdl2/event.pyx":351 * event_queue = new_queue * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/event.pyx":327 * * * cdef object get_events(kinds): # <<<<<<<<<<<<<< * """ * Returns a list containing all events in the event queue with type `kinds`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.get_events", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_new_queue); __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_kinds); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":354 * * * cdef int poll_sdl() except 1: # <<<<<<<<<<<<<< * """ * Polls SDL for pending events, and places those events onto the event q */ static int __pyx_f_11pygame_sdl2_5event_poll_sdl(void) { SDL_Event __pyx_v_evt; PyObject *__pyx_v_e = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("poll_sdl", 1); /* "pygame_sdl2/event.pyx":362 * cdef SDL_Event evt * * with lock: # <<<<<<<<<<<<<< * while SDL_PollEvent(&evt): * e = make_event(&evt) */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/event.pyx":363 * * with lock: * while SDL_PollEvent(&evt): # <<<<<<<<<<<<<< * e = make_event(&evt) * e.timestamp = evt.common.timestamp */ while (1) { __pyx_t_10 = (SDL_PollEvent((&__pyx_v_evt)) != 0); if (!__pyx_t_10) break; /* "pygame_sdl2/event.pyx":364 * with lock: * while SDL_PollEvent(&evt): * e = make_event(&evt) # <<<<<<<<<<<<<< * e.timestamp = evt.common.timestamp * event_queue.append(e) */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5event_make_event((&__pyx_v_evt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":365 * while SDL_PollEvent(&evt): * e = make_event(&evt) * e.timestamp = evt.common.timestamp # <<<<<<<<<<<<<< * event_queue.append(e) * */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_evt.common.timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_e, __pyx_n_s_timestamp, __pyx_t_1) < 0) __PYX_ERR(0, 365, __pyx_L7_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":366 * e = make_event(&evt) * e.timestamp = evt.common.timestamp * event_queue.append(e) # <<<<<<<<<<<<<< * * return 0 */ __pyx_t_11 = __Pyx_PyObject_Append(event_queue, __pyx_v_e); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 366, __pyx_L7_error) } /* "pygame_sdl2/event.pyx":362 * cdef SDL_Event evt * * with lock: # <<<<<<<<<<<<<< * while SDL_PollEvent(&evt): * e = make_event(&evt) */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.poll_sdl", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 362, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 362, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_10 < 0) __PYX_ERR(0, 362, __pyx_L9_except_error) __pyx_t_13 = (!__pyx_t_10); if (unlikely(__pyx_t_13)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 362, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L12_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L18; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L18:; } /* "pygame_sdl2/event.pyx":368 * event_queue.append(e) * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":354 * * * cdef int poll_sdl() except 1: # <<<<<<<<<<<<<< * """ * Polls SDL for pending events, and places those events onto the event q */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.poll_sdl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":371 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_1pump(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_pump, "pump()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_1pump = {"pump", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_1pump, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_pump}; static PyObject *__pyx_pw_11pygame_sdl2_5event_1pump(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pump (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_pump(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_pump(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pump", 1); /* "pygame_sdl2/event.pyx":372 * * def pump(): * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/event.pyx":373 * def pump(): * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * */ __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_6 == ((int)1))) __PYX_ERR(0, 373, __pyx_L7_error) /* "pygame_sdl2/event.pyx":372 * * def pump(): * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.pump", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 372, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 372, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 372, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_11 < 0) __PYX_ERR(0, 372, __pyx_L9_except_error) __pyx_t_12 = (!__pyx_t_11); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 372, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L12_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L16; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L16:; } /* "pygame_sdl2/event.pyx":371 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.pump", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":376 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_3get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_2get, "get(t=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_3get = {"get", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_3get, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_2get}; static PyObject *__pyx_pw_11pygame_sdl2_5event_3get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 376, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get") < 0)) __PYX_ERR(0, 376, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 376, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_2get(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get", 1); /* "pygame_sdl2/event.pyx":380 * global event_queue * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/event.pyx":381 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if t is None: */ __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_6 == ((int)1))) __PYX_ERR(0, 381, __pyx_L7_error) /* "pygame_sdl2/event.pyx":383 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * rv = event_queue * event_queue = [ ] */ __pyx_t_10 = (__pyx_v_t == Py_None); if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":384 * * if t is None: * rv = event_queue # <<<<<<<<<<<<<< * event_queue = [ ] * */ __Pyx_INCREF(event_queue); __pyx_v_rv = event_queue; /* "pygame_sdl2/event.pyx":385 * if t is None: * rv = event_queue * event_queue = [ ] # <<<<<<<<<<<<<< * * elif isinstance(t, int): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(event_queue); __Pyx_DECREF_SET(event_queue, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":383 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * rv = event_queue * event_queue = [ ] */ goto __pyx_L13; } /* "pygame_sdl2/event.pyx":387 * event_queue = [ ] * * elif isinstance(t, int): # <<<<<<<<<<<<<< * rv = get_events(( t, )) * */ __pyx_t_10 = PyInt_Check(__pyx_v_t); if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":388 * * elif isinstance(t, int): * rv = get_events(( t, )) # <<<<<<<<<<<<<< * * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_t)) __PYX_ERR(0, 388, __pyx_L7_error); __pyx_t_3 = __pyx_f_11pygame_sdl2_5event_get_events(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_rv = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":387 * event_queue = [ ] * * elif isinstance(t, int): # <<<<<<<<<<<<<< * rv = get_events(( t, )) * */ goto __pyx_L13; } /* "pygame_sdl2/event.pyx":391 * * else: * rv = get_events(t) # <<<<<<<<<<<<<< * * return rv */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_5event_get_events(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L13:; /* "pygame_sdl2/event.pyx":380 * global event_queue * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.get", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 380, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 380, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_10 < 0) __PYX_ERR(0, 380, __pyx_L9_except_error) __pyx_t_12 = (!__pyx_t_10); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 380, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L12_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L17; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L17:; } /* "pygame_sdl2/event.pyx":393 * rv = get_events(t) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_v_rv)) { __Pyx_RaiseUnboundLocalError("rv"); __PYX_ERR(0, 393, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/event.pyx":376 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":396 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_5poll(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_4poll, "poll()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_5poll = {"poll", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_5poll, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_4poll}; static PyObject *__pyx_pw_11pygame_sdl2_5event_5poll(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("poll (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_4poll(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_4poll(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("poll", 1); /* "pygame_sdl2/event.pyx":398 * def poll(): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/event.pyx":399 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if event_queue: */ __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_6 == ((int)1))) __PYX_ERR(0, 399, __pyx_L7_error) /* "pygame_sdl2/event.pyx":401 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ __pyx_t_10 = __Pyx_PyObject_IsTrue(event_queue); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 401, __pyx_L7_error) if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":402 * * if event_queue: * return event_queue.pop(0) # <<<<<<<<<<<<<< * * return NOEVENT_EVENT */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_PopIndex(event_queue, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":401 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ } /* "pygame_sdl2/event.pyx":404 * return event_queue.pop(0) * * return NOEVENT_EVENT # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NOEVENT_EVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":398 * def poll(): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.poll", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 398, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 398, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_10 < 0) __PYX_ERR(0, 398, __pyx_L9_except_error) __pyx_t_12 = (!__pyx_t_10); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 398, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_9 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L17; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L17:; } /* "pygame_sdl2/event.pyx":396 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.poll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":407 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_7wait(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_6wait, "wait()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_7wait = {"wait", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_7wait, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_6wait}; static PyObject *__pyx_pw_11pygame_sdl2_5event_7wait(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wait (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_6wait(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_6wait(CYTHON_UNUSED PyObject *__pyx_self) { SDL_Event __pyx_v_evt; int __pyx_v_result; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("wait", 1); /* "pygame_sdl2/event.pyx":412 * cdef int result * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/event.pyx":413 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if event_queue: */ __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_6 == ((int)1))) __PYX_ERR(0, 413, __pyx_L7_error) /* "pygame_sdl2/event.pyx":415 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ __pyx_t_10 = __Pyx_PyObject_IsTrue(event_queue); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 415, __pyx_L7_error) if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":416 * * if event_queue: * return event_queue.pop(0) # <<<<<<<<<<<<<< * * with nogil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_PopIndex(event_queue, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":415 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ } /* "pygame_sdl2/event.pyx":412 * cdef int result * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 412, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 412, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_10 < 0) __PYX_ERR(0, 412, __pyx_L9_except_error) __pyx_t_12 = (!__pyx_t_10); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 412, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L12_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_9 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L17; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L17:; } /* "pygame_sdl2/event.pyx":418 * return event_queue.pop(0) * * with nogil: # <<<<<<<<<<<<<< * result = SDL_WaitEvent(&evt) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/event.pyx":419 * * with nogil: * result = SDL_WaitEvent(&evt) # <<<<<<<<<<<<<< * * if result: */ __pyx_v_result = SDL_WaitEvent((&__pyx_v_evt)); } /* "pygame_sdl2/event.pyx":418 * return event_queue.pop(0) * * with nogil: # <<<<<<<<<<<<<< * result = SDL_WaitEvent(&evt) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L20; } __pyx_L20:; } } /* "pygame_sdl2/event.pyx":421 * result = SDL_WaitEvent(&evt) * * if result: # <<<<<<<<<<<<<< * return make_event(&evt) * else: */ __pyx_t_12 = (__pyx_v_result != 0); if (__pyx_t_12) { /* "pygame_sdl2/event.pyx":422 * * if result: * return make_event(&evt) # <<<<<<<<<<<<<< * else: * return NOEVENT_EVENT */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_11pygame_sdl2_5event_make_event((&__pyx_v_evt)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":421 * result = SDL_WaitEvent(&evt) * * if result: # <<<<<<<<<<<<<< * return make_event(&evt) * else: */ } /* "pygame_sdl2/event.pyx":424 * return make_event(&evt) * else: * return NOEVENT_EVENT # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NOEVENT_EVENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/event.pyx":407 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":427 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9peek(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_8peek, "peek(t=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9peek = {"peek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9peek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_8peek}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9peek(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("peek (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "peek") < 0)) __PYX_ERR(0, 427, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("peek", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 427, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_8peek(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_8peek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; Py_ssize_t __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("peek", 1); /* "pygame_sdl2/event.pyx":429 * def peek(t=None): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/event.pyx":430 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if t is None: */ __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_6 == ((int)1))) __PYX_ERR(0, 430, __pyx_L7_error) /* "pygame_sdl2/event.pyx":432 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * return len(event_queue) != 0 * elif isinstance(t, int): */ __pyx_t_10 = (__pyx_v_t == Py_None); if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":433 * * if t is None: * return len(event_queue) != 0 # <<<<<<<<<<<<<< * elif isinstance(t, int): * return has_event(( t, )) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = event_queue; __Pyx_INCREF(__pyx_t_1); __pyx_t_11 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 433, __pyx_L7_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_t_11 != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":432 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * return len(event_queue) != 0 * elif isinstance(t, int): */ } /* "pygame_sdl2/event.pyx":434 * if t is None: * return len(event_queue) != 0 * elif isinstance(t, int): # <<<<<<<<<<<<<< * return has_event(( t, )) * else: */ __pyx_t_10 = PyInt_Check(__pyx_v_t); if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":435 * return len(event_queue) != 0 * elif isinstance(t, int): * return has_event(( t, )) # <<<<<<<<<<<<<< * else: * return has_event(t) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_t)) __PYX_ERR(0, 435, __pyx_L7_error); __pyx_t_10 = __pyx_f_11pygame_sdl2_5event_has_event(__pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L7_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":434 * if t is None: * return len(event_queue) != 0 * elif isinstance(t, int): # <<<<<<<<<<<<<< * return has_event(( t, )) * else: */ } /* "pygame_sdl2/event.pyx":437 * return has_event(( t, )) * else: * return has_event(t) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_10 = __pyx_f_11pygame_sdl2_5event_has_event(__pyx_v_t); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L7_error) __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; } /* "pygame_sdl2/event.pyx":429 * def peek(t=None): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 429, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 429, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_10 < 0) __PYX_ERR(0, 429, __pyx_L9_except_error) __pyx_t_13 = (!__pyx_t_10); if (unlikely(__pyx_t_13)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 429, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_9 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L17; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L17:; } /* "pygame_sdl2/event.pyx":427 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":440 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_11clear(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_10clear, "clear(t=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_11clear = {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_11clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_10clear}; static PyObject *__pyx_pw_11pygame_sdl2_5event_11clear(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clear") < 0)) __PYX_ERR(0, 440, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clear", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 440, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_10clear(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_10clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear", 1); /* "pygame_sdl2/event.pyx":443 * * # Clear is implemented in terms of get. * get(t) # <<<<<<<<<<<<<< * * def get_standard_events(): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_t}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":440 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.event.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":445 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_13get_standard_events(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_12get_standard_events, "get_standard_events()\n\n Returns a list of standard events that pygame_sdl2 knows about.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_13get_standard_events = {"get_standard_events", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_13get_standard_events, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_12get_standard_events}; static PyObject *__pyx_pw_11pygame_sdl2_5event_13get_standard_events(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_standard_events (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_12get_standard_events(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_12get_standard_events(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_7genexpr__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_standard_events", 1); /* "pygame_sdl2/event.pyx":450 * """ * * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] # <<<<<<<<<<<<<< * * def event_name(t): */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_event_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_t_6 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); __PYX_ERR(0, 450, __pyx_L5_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_7, NULL, NULL, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_i, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyObject_RichCompare(__pyx_7genexpr__pyx_v_i, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L9_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_USEREVENT_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_RichCompare(__pyx_7genexpr__pyx_v_i, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L9_bool_binop_done:; if (__pyx_t_9) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_i))) __PYX_ERR(0, 450, __pyx_L5_error) } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __pyx_7genexpr__pyx_v_i = 0; goto __pyx_L11_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __pyx_7genexpr__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L11_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":445 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.get_standard_events", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":452 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_15event_name(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_14event_name, "event_name(t)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_15event_name = {"event_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_15event_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_14event_name}; static PyObject *__pyx_pw_11pygame_sdl2_5event_15event_name(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("event_name (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "event_name") < 0)) __PYX_ERR(0, 452, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("event_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 452, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.event_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_14event_name(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_14event_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("event_name", 1); /* "pygame_sdl2/event.pyx":453 * * def event_name(t): * try: # <<<<<<<<<<<<<< * return event_names[t] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "pygame_sdl2/event.pyx":454 * def event_name(t): * try: * return event_names[t] # <<<<<<<<<<<<<< * except KeyError: * return "UNKNOWN" */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_event_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 454, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/event.pyx":453 * * def event_name(t): * try: # <<<<<<<<<<<<<< * return event_names[t] * except KeyError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":455 * try: * return event_names[t] * except KeyError: # <<<<<<<<<<<<<< * return "UNKNOWN" * */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("pygame_sdl2.event.event_name", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 455, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_7); /* "pygame_sdl2/event.pyx":456 * return event_names[t] * except KeyError: * return "UNKNOWN" # <<<<<<<<<<<<<< * * def set_blocked(t=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_UNKNOWN); __pyx_r = __pyx_n_s_UNKNOWN; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; /* "pygame_sdl2/event.pyx":453 * * def event_name(t): * try: # <<<<<<<<<<<<<< * return event_names[t] * except KeyError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "pygame_sdl2/event.pyx":452 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.event_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":458 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_17set_blocked(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_16set_blocked, "set_blocked(t=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_17set_blocked = {"set_blocked", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_17set_blocked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_16set_blocked}; static PyObject *__pyx_pw_11pygame_sdl2_5event_17set_blocked(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_blocked (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_blocked") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_blocked", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.set_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_16set_blocked(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_16set_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_v_et = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; Uint32 __pyx_t_9; int __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_blocked", 1); /* "pygame_sdl2/event.pyx":459 * * def set_blocked(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_t, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":460 * def set_blocked(t=None): * if t == None: * for et in event_names.keys(): # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, (int, long)): */ __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_event_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_t_6 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); __PYX_ERR(0, 460, __pyx_L1_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_7, NULL, NULL, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":461 * if t == None: * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) # <<<<<<<<<<<<<< * elif isinstance(t, (int, long)): * SDL_EventState(t, SDL_IGNORE) */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L1_error) (void)(SDL_EventState(__pyx_t_9, SDL_ENABLE)); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":459 * * def set_blocked(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":462 * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, (int, long)): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_IGNORE) * else: */ __pyx_t_10 = PyInt_Check(__pyx_v_t); if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L6_bool_binop_done; } __pyx_t_10 = PyLong_Check(__pyx_v_t); __pyx_t_2 = __pyx_t_10; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":463 * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, (int, long)): * SDL_EventState(t, SDL_IGNORE) # <<<<<<<<<<<<<< * else: * for et in t: */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error) (void)(SDL_EventState(__pyx_t_9, SDL_IGNORE)); /* "pygame_sdl2/event.pyx":462 * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, (int, long)): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_IGNORE) * else: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":465 * SDL_EventState(t, SDL_IGNORE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_IGNORE) * */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_t)) || PyTuple_CheckExact(__pyx_v_t)) { __pyx_t_1 = __pyx_v_t; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_11 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 465, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 465, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 465, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 465, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 465, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 465, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":466 * else: * for et in t: * SDL_EventState(et, SDL_IGNORE) # <<<<<<<<<<<<<< * * def set_allowed(t=None): */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L1_error) (void)(SDL_EventState(__pyx_t_9, SDL_IGNORE)); /* "pygame_sdl2/event.pyx":465 * SDL_EventState(t, SDL_IGNORE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_IGNORE) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/event.pyx":458 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.set_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_et); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":468 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_19set_allowed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_18set_allowed, "set_allowed(t=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_19set_allowed = {"set_allowed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_19set_allowed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_18set_allowed}; static PyObject *__pyx_pw_11pygame_sdl2_5event_19set_allowed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_allowed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_allowed") < 0)) __PYX_ERR(0, 468, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_allowed", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 468, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.set_allowed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_18set_allowed(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_18set_allowed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_v_et = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; Uint32 __pyx_t_9; int __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_allowed", 1); /* "pygame_sdl2/event.pyx":469 * * def set_allowed(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_t, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":470 * def set_allowed(t=None): * if t == None: * for et in event_names.keys(): # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, (int, long)): */ __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_event_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_t_6 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); __PYX_ERR(0, 470, __pyx_L1_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_7, NULL, NULL, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":471 * if t == None: * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) # <<<<<<<<<<<<<< * elif isinstance(t, (int, long)): * SDL_EventState(t, SDL_ENABLE) */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L1_error) (void)(SDL_EventState(__pyx_t_9, SDL_IGNORE)); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":469 * * def set_allowed(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":472 * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, (int, long)): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_ENABLE) * else: */ __pyx_t_10 = PyInt_Check(__pyx_v_t); if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L6_bool_binop_done; } __pyx_t_10 = PyLong_Check(__pyx_v_t); __pyx_t_2 = __pyx_t_10; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":473 * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, (int, long)): * SDL_EventState(t, SDL_ENABLE) # <<<<<<<<<<<<<< * else: * for et in t: */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) (void)(SDL_EventState(__pyx_t_9, SDL_ENABLE)); /* "pygame_sdl2/event.pyx":472 * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, (int, long)): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_ENABLE) * else: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":475 * SDL_EventState(t, SDL_ENABLE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_ENABLE) * */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_t)) || PyTuple_CheckExact(__pyx_v_t)) { __pyx_t_1 = __pyx_v_t; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_11 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 475, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 475, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 475, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 475, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 475, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 475, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":476 * else: * for et in t: * SDL_EventState(et, SDL_ENABLE) # <<<<<<<<<<<<<< * * def get_blocked(t): */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L1_error) (void)(SDL_EventState(__pyx_t_9, SDL_ENABLE)); /* "pygame_sdl2/event.pyx":475 * SDL_EventState(t, SDL_ENABLE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_ENABLE) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/event.pyx":468 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.set_allowed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_et); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":478 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_21get_blocked(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_20get_blocked, "get_blocked(t)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_21get_blocked = {"get_blocked", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_21get_blocked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_20get_blocked}; static PyObject *__pyx_pw_11pygame_sdl2_5event_21get_blocked(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_blocked (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_blocked") < 0)) __PYX_ERR(0, 478, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_blocked", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 478, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.get_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_20get_blocked(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_20get_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_blocked", 1); /* "pygame_sdl2/event.pyx":479 * * def get_blocked(t): * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE # <<<<<<<<<<<<<< * * def set_grab(on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_1 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) __pyx_t_2 = __Pyx_PyBool_FromLong((SDL_EventState(__pyx_t_1, SDL_QUERY) == SDL_IGNORE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":478 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.event.get_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":481 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_23set_grab(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_22set_grab, "set_grab(on)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_23set_grab = {"set_grab", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_23set_grab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_22set_grab}; static PyObject *__pyx_pw_11pygame_sdl2_5event_23set_grab(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_on = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_grab (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_on,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_on)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_grab") < 0)) __PYX_ERR(0, 481, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_on = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_grab", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 481, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.set_grab", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_22set_grab(__pyx_self, __pyx_v_on); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_22set_grab(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_bool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_grab", 1); /* "pygame_sdl2/event.pyx":482 * * def set_grab(on): * SDL_SetWindowGrab(main_window.window, on) # <<<<<<<<<<<<<< * * if SDL_ShowCursor(SDL_QUERY) == SDL_DISABLE: */ __pyx_t_1 = ((SDL_bool)__Pyx_PyInt_As_SDL_bool(__pyx_v_on)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 482, __pyx_L1_error) SDL_SetWindowGrab(__pyx_v_11pygame_sdl2_7display_main_window->window, __pyx_t_1); /* "pygame_sdl2/event.pyx":484 * SDL_SetWindowGrab(main_window.window, on) * * if SDL_ShowCursor(SDL_QUERY) == SDL_DISABLE: # <<<<<<<<<<<<<< * SDL_SetRelativeMouseMode(on) * */ __pyx_t_2 = (SDL_ShowCursor(SDL_QUERY) == SDL_DISABLE); if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":485 * * if SDL_ShowCursor(SDL_QUERY) == SDL_DISABLE: * SDL_SetRelativeMouseMode(on) # <<<<<<<<<<<<<< * * def get_grab(): */ __pyx_t_1 = ((SDL_bool)__Pyx_PyInt_As_SDL_bool(__pyx_v_on)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 485, __pyx_L1_error) (void)(SDL_SetRelativeMouseMode(__pyx_t_1)); /* "pygame_sdl2/event.pyx":484 * SDL_SetWindowGrab(main_window.window, on) * * if SDL_ShowCursor(SDL_QUERY) == SDL_DISABLE: # <<<<<<<<<<<<<< * SDL_SetRelativeMouseMode(on) * */ } /* "pygame_sdl2/event.pyx":481 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.event.set_grab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":487 * SDL_SetRelativeMouseMode(on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_25get_grab(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_24get_grab, "get_grab()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_25get_grab = {"get_grab", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_25get_grab, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_24get_grab}; static PyObject *__pyx_pw_11pygame_sdl2_5event_25get_grab(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_grab (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_24get_grab(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_24get_grab(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_grab", 1); /* "pygame_sdl2/event.pyx":488 * * def get_grab(): * return SDL_GetWindowGrab(main_window.window) # <<<<<<<<<<<<<< * * def set_mousewheel_buttons(flag): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_GetWindowGrab(__pyx_v_11pygame_sdl2_7display_main_window->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":487 * SDL_SetRelativeMouseMode(on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.get_grab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":490 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_27set_mousewheel_buttons(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_26set_mousewheel_buttons, "set_mousewheel_buttons(flag)\n\n If true (the default), the mousewheel will generate events involving\n mouse buttons 4 and 5, and mousebuttons 4 and higher will be mapped to 6 and higher.\n\n If false, MOUSEWHEEL events are generated, and the mousebuttons are\n not remapped.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_27set_mousewheel_buttons = {"set_mousewheel_buttons", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_27set_mousewheel_buttons, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_26set_mousewheel_buttons}; static PyObject *__pyx_pw_11pygame_sdl2_5event_27set_mousewheel_buttons(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mousewheel_buttons (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_mousewheel_buttons") < 0)) __PYX_ERR(0, 490, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_mousewheel_buttons", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 490, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.set_mousewheel_buttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_26set_mousewheel_buttons(__pyx_self, __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_26set_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_mousewheel_buttons", 1); /* "pygame_sdl2/event.pyx":500 * * global mousewheel_buttons * mousewheel_buttons = flag # <<<<<<<<<<<<<< * * def get_mousewheel_buttons(): */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error) __pyx_v_11pygame_sdl2_5event_mousewheel_buttons = __pyx_t_1; /* "pygame_sdl2/event.pyx":490 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.event.set_mousewheel_buttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":502 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_29get_mousewheel_buttons(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_28get_mousewheel_buttons, "get_mousewheel_buttons()\n\n Returns the value set by mousehweel buttons,.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_29get_mousewheel_buttons = {"get_mousewheel_buttons", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_29get_mousewheel_buttons, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_28get_mousewheel_buttons}; static PyObject *__pyx_pw_11pygame_sdl2_5event_29get_mousewheel_buttons(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_mousewheel_buttons (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_28get_mousewheel_buttons(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_28get_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_mousewheel_buttons", 1); /* "pygame_sdl2/event.pyx":507 * """ * * return mousewheel_buttons # <<<<<<<<<<<<<< * * def post(e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_11pygame_sdl2_5event_mousewheel_buttons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":502 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.get_mousewheel_buttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":509 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_31post(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_30post, "post(e)\n\n Posts event object `e` to the event queue.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_31post = {"post", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_31post, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_30post}; static PyObject *__pyx_pw_11pygame_sdl2_5event_31post(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_e = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("post (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_e,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_e)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "post") < 0)) __PYX_ERR(0, 509, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_e = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("post", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 509, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.post", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_30post(__pyx_self, __pyx_v_e); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_30post(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e) { SDL_Event __pyx_v_event; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("post", 1); /* "pygame_sdl2/event.pyx":516 * cdef SDL_Event event; * * if not isinstance(e, EventType): # <<<<<<<<<<<<<< * raise pygame_sdl2.error("event.post must be called with an Event.") * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_e, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/event.pyx":517 * * if not isinstance(e, EventType): * raise pygame_sdl2.error("event.post must be called with an Event.") # <<<<<<<<<<<<<< * * if get_blocked(e.type): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_event_post_must_be_called_with_a}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 517, __pyx_L1_error) /* "pygame_sdl2/event.pyx":516 * cdef SDL_Event event; * * if not isinstance(e, EventType): # <<<<<<<<<<<<<< * raise pygame_sdl2.error("event.post must be called with an Event.") * */ } /* "pygame_sdl2/event.pyx":519 * raise pygame_sdl2.error("event.post must be called with an Event.") * * if get_blocked(e.type): # <<<<<<<<<<<<<< * return * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_blocked); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":520 * * if get_blocked(e.type): * return # <<<<<<<<<<<<<< * * Py_INCREF(e) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/event.pyx":519 * raise pygame_sdl2.error("event.post must be called with an Event.") * * if get_blocked(e.type): # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/event.pyx":522 * return * * Py_INCREF(e) # <<<<<<<<<<<<<< * * event.type = POSTEDEVENT */ Py_INCREF(__pyx_v_e); /* "pygame_sdl2/event.pyx":524 * Py_INCREF(e) * * event.type = POSTEDEVENT # <<<<<<<<<<<<<< * event.user.data1 = e * */ __pyx_v_event.type = __pyx_v_11pygame_sdl2_5event_POSTEDEVENT; /* "pygame_sdl2/event.pyx":525 * * event.type = POSTEDEVENT * event.user.data1 = e # <<<<<<<<<<<<<< * * SDL_PushEvent(&event) */ __pyx_v_event.user.data1 = ((void *)__pyx_v_e); /* "pygame_sdl2/event.pyx":527 * event.user.data1 = e * * SDL_PushEvent(&event) # <<<<<<<<<<<<<< * * def register(name): */ (void)(SDL_PushEvent((&__pyx_v_event))); /* "pygame_sdl2/event.pyx":509 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.post", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":529 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_33register(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_32register, "register(name)\n\n Registers a unique event number and returns that number.\n\n `name`\n A string name for the event. This is used when calling `repr` on\n the event.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_33register = {"register", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_33register, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_32register}; static PyObject *__pyx_pw_11pygame_sdl2_5event_33register(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("register (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 529, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "register") < 0)) __PYX_ERR(0, 529, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("register", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 529, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.register", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_32register(__pyx_self, __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_32register(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { Uint32 __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("register", 1); /* "pygame_sdl2/event.pyx":538 * """ * * rv = SDL_RegisterEvents(1) # <<<<<<<<<<<<<< * * event_names[rv] = name */ __pyx_v_rv = SDL_RegisterEvents(1); /* "pygame_sdl2/event.pyx":540 * rv = SDL_RegisterEvents(1) * * event_names[rv] = name # <<<<<<<<<<<<<< * return rv * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_event_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((__Pyx_SetItemInt(__pyx_t_1, __pyx_v_rv, __pyx_v_name, Uint32, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 1) < 0))) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":541 * * event_names[rv] = name * return rv # <<<<<<<<<<<<<< * * def copy_event_queue(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":529 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.register", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":543 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_35copy_event_queue(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_34copy_event_queue, "copy_event_queue()\n\n Returns a copy of the event queue. The copy cannot be used for modifying\n the event queue.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_35copy_event_queue = {"copy_event_queue", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_35copy_event_queue, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_34copy_event_queue}; static PyObject *__pyx_pw_11pygame_sdl2_5event_35copy_event_queue(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_event_queue (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_34copy_event_queue(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_34copy_event_queue(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy_event_queue", 1); /* "pygame_sdl2/event.pyx":549 * """ * * return event_queue[:] # <<<<<<<<<<<<<< * * # Usually called by display.init. */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetSlice(event_queue, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":543 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.copy_event_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":552 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_37init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_36init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_37init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_37init, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_36init}; static PyObject *__pyx_pw_11pygame_sdl2_5event_37init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_36init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_36init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/event.pyx":553 * # Usually called by display.init. * def init(): * if not SDL_WasInit(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * * pygame_sdl2.display.sdl_main_init() */ __pyx_t_1 = (!(SDL_WasInit(SDL_INIT_EVENTS) != 0)); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":555 * if not SDL_WasInit(SDL_INIT_EVENTS): * * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_EVENTS): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":557 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * raise pygame_sdl2.error.error() * */ __pyx_t_1 = (SDL_InitSubSystem(SDL_INIT_EVENTS) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/event.pyx":558 * * if SDL_InitSubSystem(SDL_INIT_EVENTS): * raise pygame_sdl2.error.error() # <<<<<<<<<<<<<< * * _types = """ */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 558, __pyx_L1_error) /* "pygame_sdl2/event.pyx":557 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * raise pygame_sdl2.error.error() * */ } /* "pygame_sdl2/event.pyx":553 * # Usually called by display.init. * def init(): * if not SDL_WasInit(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * * pygame_sdl2.display.sdl_main_init() */ } /* "pygame_sdl2/event.pyx":552 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, {&__pyx_n_s_ACTIVEEVENT, __pyx_k_ACTIVEEVENT, sizeof(__pyx_k_ACTIVEEVENT), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERBACKGROUND, __pyx_k_APP_DIDENTERBACKGROUND, sizeof(__pyx_k_APP_DIDENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERFOREGROUND, __pyx_k_APP_DIDENTERFOREGROUND, sizeof(__pyx_k_APP_DIDENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_LOWMEMORY, __pyx_k_APP_LOWMEMORY, sizeof(__pyx_k_APP_LOWMEMORY), 0, 0, 1, 1}, {&__pyx_n_s_APP_TERMINATING, __pyx_k_APP_TERMINATING, sizeof(__pyx_k_APP_TERMINATING), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERBACKGROUND, __pyx_k_APP_WILLENTERBACKGROUND, sizeof(__pyx_k_APP_WILLENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERFOREGROUND, __pyx_k_APP_WILLENTERFOREGROUND, sizeof(__pyx_k_APP_WILLENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_AUDIODEVICEADDED, __pyx_k_AUDIODEVICEADDED, sizeof(__pyx_k_AUDIODEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_AUDIODEVICEREMOVED, __pyx_k_AUDIODEVICEREMOVED, sizeof(__pyx_k_AUDIODEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_CLIPBOARDUPDATE, __pyx_k_CLIPBOARDUPDATE, sizeof(__pyx_k_CLIPBOARDUPDATE), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERAXISMOTION, __pyx_k_CONTROLLERAXISMOTION, sizeof(__pyx_k_CONTROLLERAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONDOWN, __pyx_k_CONTROLLERBUTTONDOWN, sizeof(__pyx_k_CONTROLLERBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONUP, __pyx_k_CONTROLLERBUTTONUP, sizeof(__pyx_k_CONTROLLERBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEADDED, __pyx_k_CONTROLLERDEVICEADDED, sizeof(__pyx_k_CONTROLLERDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMAPPED, __pyx_k_CONTROLLERDEVICEREMAPPED, sizeof(__pyx_k_CONTROLLERDEVICEREMAPPED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMOVED, __pyx_k_CONTROLLERDEVICEREMOVED, sizeof(__pyx_k_CONTROLLERDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_DISPLAYEVENT, __pyx_k_DISPLAYEVENT, sizeof(__pyx_k_DISPLAYEVENT), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARGESTURE, __pyx_k_DOLLARGESTURE, sizeof(__pyx_k_DOLLARGESTURE), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARRECORD, __pyx_k_DOLLARRECORD, sizeof(__pyx_k_DOLLARRECORD), 0, 0, 1, 1}, {&__pyx_n_s_DROPBEGIN, __pyx_k_DROPBEGIN, sizeof(__pyx_k_DROPBEGIN), 0, 0, 1, 1}, {&__pyx_n_s_DROPCOMPLETE, __pyx_k_DROPCOMPLETE, sizeof(__pyx_k_DROPCOMPLETE), 0, 0, 1, 1}, {&__pyx_n_s_DROPFILE, __pyx_k_DROPFILE, sizeof(__pyx_k_DROPFILE), 0, 0, 1, 1}, {&__pyx_n_s_DROPTEXT, __pyx_k_DROPTEXT, sizeof(__pyx_k_DROPTEXT), 0, 0, 1, 1}, {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1}, {&__pyx_n_s_EventType, __pyx_k_EventType, sizeof(__pyx_k_EventType), 0, 0, 1, 1}, {&__pyx_n_s_EventType___eq, __pyx_k_EventType___eq, sizeof(__pyx_k_EventType___eq), 0, 0, 1, 1}, {&__pyx_n_s_EventType___init, __pyx_k_EventType___init, sizeof(__pyx_k_EventType___init), 0, 0, 1, 1}, {&__pyx_n_s_EventType___ne, __pyx_k_EventType___ne, sizeof(__pyx_k_EventType___ne), 0, 0, 1, 1}, {&__pyx_n_s_EventType___nonzero, __pyx_k_EventType___nonzero, sizeof(__pyx_k_EventType___nonzero), 0, 0, 1, 1}, {&__pyx_n_s_EventType___repr, __pyx_k_EventType___repr, sizeof(__pyx_k_EventType___repr), 0, 0, 1, 1}, {&__pyx_n_s_EventType_dict, __pyx_k_EventType_dict, sizeof(__pyx_k_EventType_dict), 0, 0, 1, 1}, {&__pyx_n_s_EventType_type, __pyx_k_EventType_type, sizeof(__pyx_k_EventType_type), 0, 0, 1, 1}, {&__pyx_kp_s_Event_EventType, __pyx_k_Event_EventType, sizeof(__pyx_k_Event_EventType), 0, 0, 1, 0}, {&__pyx_kp_s_Event_d_s_s, __pyx_k_Event_d_s_s, sizeof(__pyx_k_Event_d_s_s), 0, 0, 1, 0}, {&__pyx_n_s_FINGERDOWN, __pyx_k_FINGERDOWN, sizeof(__pyx_k_FINGERDOWN), 0, 0, 1, 1}, {&__pyx_n_s_FINGERMOTION, __pyx_k_FINGERMOTION, sizeof(__pyx_k_FINGERMOTION), 0, 0, 1, 1}, {&__pyx_n_s_FINGERUP, __pyx_k_FINGERUP, sizeof(__pyx_k_FINGERUP), 0, 0, 1, 1}, {&__pyx_n_s_JOYAXISMOTION, __pyx_k_JOYAXISMOTION, sizeof(__pyx_k_JOYAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBALLMOTION, __pyx_k_JOYBALLMOTION, sizeof(__pyx_k_JOYBALLMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONDOWN, __pyx_k_JOYBUTTONDOWN, sizeof(__pyx_k_JOYBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONUP, __pyx_k_JOYBUTTONUP, sizeof(__pyx_k_JOYBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEADDED, __pyx_k_JOYDEVICEADDED, sizeof(__pyx_k_JOYDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEREMOVED, __pyx_k_JOYDEVICEREMOVED, sizeof(__pyx_k_JOYDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_JOYHATMOTION, __pyx_k_JOYHATMOTION, sizeof(__pyx_k_JOYHATMOTION), 0, 0, 1, 1}, {&__pyx_n_s_KEYDOWN, __pyx_k_KEYDOWN, sizeof(__pyx_k_KEYDOWN), 0, 0, 1, 1}, {&__pyx_n_s_KEYMAPCHANGED, __pyx_k_KEYMAPCHANGED, sizeof(__pyx_k_KEYMAPCHANGED), 0, 0, 1, 1}, {&__pyx_n_s_KEYUP, __pyx_k_KEYUP, sizeof(__pyx_k_KEYUP), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_s_LASTEVENT, __pyx_k_LASTEVENT, sizeof(__pyx_k_LASTEVENT), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONDOWN, __pyx_k_MOUSEBUTTONDOWN, sizeof(__pyx_k_MOUSEBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONUP, __pyx_k_MOUSEBUTTONUP, sizeof(__pyx_k_MOUSEBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEMOTION, __pyx_k_MOUSEMOTION, sizeof(__pyx_k_MOUSEMOTION), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEWHEEL, __pyx_k_MOUSEWHEEL, sizeof(__pyx_k_MOUSEWHEEL), 0, 0, 1, 1}, {&__pyx_n_s_MULTIGESTURE, __pyx_k_MULTIGESTURE, sizeof(__pyx_k_MULTIGESTURE), 0, 0, 1, 1}, {&__pyx_n_u_NOEVENT, __pyx_k_NOEVENT, sizeof(__pyx_k_NOEVENT), 0, 1, 0, 1}, {&__pyx_n_s_NOEVENT_EVENT, __pyx_k_NOEVENT_EVENT, sizeof(__pyx_k_NOEVENT_EVENT), 0, 0, 1, 1}, {&__pyx_n_s_QUIT, __pyx_k_QUIT, sizeof(__pyx_k_QUIT), 0, 0, 1, 1}, {&__pyx_n_s_RENDER_DEVICE_RESET, __pyx_k_RENDER_DEVICE_RESET, sizeof(__pyx_k_RENDER_DEVICE_RESET), 0, 0, 1, 1}, {&__pyx_n_s_RENDER_TARGETS_RESET, __pyx_k_RENDER_TARGETS_RESET, sizeof(__pyx_k_RENDER_TARGETS_RESET), 0, 0, 1, 1}, {&__pyx_n_s_RLock, __pyx_k_RLock, sizeof(__pyx_k_RLock), 0, 0, 1, 1}, {&__pyx_n_s_SENSORUPDATE, __pyx_k_SENSORUPDATE, sizeof(__pyx_k_SENSORUPDATE), 0, 0, 1, 1}, {&__pyx_n_s_SYSWMEVENT, __pyx_k_SYSWMEVENT, sizeof(__pyx_k_SYSWMEVENT), 0, 0, 1, 1}, {&__pyx_n_s_TEXTEDITING, __pyx_k_TEXTEDITING, sizeof(__pyx_k_TEXTEDITING), 0, 0, 1, 1}, {&__pyx_n_s_TEXTINPUT, __pyx_k_TEXTINPUT, sizeof(__pyx_k_TEXTINPUT), 0, 0, 1, 1}, {&__pyx_n_s_UNKNOWN, __pyx_k_UNKNOWN, sizeof(__pyx_k_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_USEREVENT, __pyx_k_USEREVENT, sizeof(__pyx_k_USEREVENT), 0, 0, 1, 1}, {&__pyx_n_s_USEREVENT_MAX, __pyx_k_USEREVENT_MAX, sizeof(__pyx_k_USEREVENT_MAX), 0, 0, 1, 1}, {&__pyx_n_s_UnicodeDecodeError, __pyx_k_UnicodeDecodeError, sizeof(__pyx_k_UnicodeDecodeError), 0, 0, 1, 1}, {&__pyx_kp_s_UserEvent_d, __pyx_k_UserEvent_d, sizeof(__pyx_k_UserEvent_d), 0, 0, 1, 0}, {&__pyx_n_s_VIDEOEXPOSE, __pyx_k_VIDEOEXPOSE, sizeof(__pyx_k_VIDEOEXPOSE), 0, 0, 1, 1}, {&__pyx_n_s_VIDEORESIZE, __pyx_k_VIDEORESIZE, sizeof(__pyx_k_VIDEORESIZE), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWEVENT, __pyx_k_WINDOWEVENT, sizeof(__pyx_k_WINDOWEVENT), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWMOVED, __pyx_k_WINDOWMOVED, sizeof(__pyx_k_WINDOWMOVED), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s__49, __pyx_k__49, sizeof(__pyx_k__49), 0, 0, 1, 1}, {&__pyx_n_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, {&__pyx_n_s_ball, __pyx_k_ball, sizeof(__pyx_k_ball), 0, 0, 1, 1}, {&__pyx_n_s_button, __pyx_k_button, sizeof(__pyx_k_button), 0, 0, 1, 1}, {&__pyx_n_s_buttons, __pyx_k_buttons, sizeof(__pyx_k_buttons), 0, 0, 1, 1}, {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1}, {&__pyx_n_s_copy_event_queue, __pyx_k_copy_event_queue, sizeof(__pyx_k_copy_event_queue), 0, 0, 1, 1}, {&__pyx_n_s_dDist, __pyx_k_dDist, sizeof(__pyx_k_dDist), 0, 0, 1, 1}, {&__pyx_n_s_dTheta, __pyx_k_dTheta, sizeof(__pyx_k_dTheta), 0, 0, 1, 1}, {&__pyx_n_s_data1, __pyx_k_data1, sizeof(__pyx_k_data1), 0, 0, 1, 1}, {&__pyx_n_s_data2, __pyx_k_data2, sizeof(__pyx_k_data2), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1}, {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_ename, __pyx_k_ename, sizeof(__pyx_k_ename), 0, 0, 1, 1}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_et, __pyx_k_et, sizeof(__pyx_k_et), 0, 0, 1, 1}, {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, {&__pyx_n_s_event_name, __pyx_k_event_name, sizeof(__pyx_k_event_name), 0, 0, 1, 1}, {&__pyx_n_s_event_names, __pyx_k_event_names, sizeof(__pyx_k_event_names), 0, 0, 1, 1}, {&__pyx_kp_s_event_post_must_be_called_with_a, __pyx_k_event_post_must_be_called_with_a, sizeof(__pyx_k_event_post_must_be_called_with_a), 0, 0, 1, 0}, {&__pyx_n_s_evt, __pyx_k_evt, sizeof(__pyx_k_evt), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_fingerId, __pyx_k_fingerId, sizeof(__pyx_k_fingerId), 0, 0, 1, 1}, {&__pyx_n_s_finger_id, __pyx_k_finger_id, sizeof(__pyx_k_finger_id), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_gain, __pyx_k_gain, sizeof(__pyx_k_gain), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_blocked, __pyx_k_get_blocked, sizeof(__pyx_k_get_blocked), 0, 0, 1, 1}, {&__pyx_n_s_get_grab, __pyx_k_get_grab, sizeof(__pyx_k_get_grab), 0, 0, 1, 1}, {&__pyx_n_s_get_mousewheel_buttons, __pyx_k_get_mousewheel_buttons, sizeof(__pyx_k_get_mousewheel_buttons), 0, 0, 1, 1}, {&__pyx_n_s_get_standard_events, __pyx_k_get_standard_events, sizeof(__pyx_k_get_standard_events), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_hat, __pyx_k_hat, sizeof(__pyx_k_hat), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, {&__pyx_n_s_instance_id, __pyx_k_instance_id, sizeof(__pyx_k_instance_id), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_joy, __pyx_k_joy, sizeof(__pyx_k_joy), 0, 0, 1, 1}, {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_mod, __pyx_k_mod, sizeof(__pyx_k_mod), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1}, {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1}, {&__pyx_n_s_numFingers, __pyx_k_numFingers, sizeof(__pyx_k_numFingers), 0, 0, 1, 1}, {&__pyx_n_s_num_fingers, __pyx_k_num_fingers, sizeof(__pyx_k_num_fingers), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_on, __pyx_k_on, sizeof(__pyx_k_on), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_peek, __pyx_k_peek, sizeof(__pyx_k_peek), 0, 0, 1, 1}, {&__pyx_n_s_pinched, __pyx_k_pinched, sizeof(__pyx_k_pinched), 0, 0, 1, 1}, {&__pyx_n_s_poll, __pyx_k_poll, sizeof(__pyx_k_poll), 0, 0, 1, 1}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_post, __pyx_k_post, sizeof(__pyx_k_post), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pressure, __pyx_k_pressure, sizeof(__pyx_k_pressure), 0, 0, 1, 1}, {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_pump, __pyx_k_pump, sizeof(__pyx_k_pump), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_event, __pyx_k_pygame_sdl2_event, sizeof(__pyx_k_pygame_sdl2_event), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1}, {&__pyx_n_s_rel, __pyx_k_rel, sizeof(__pyx_k_rel), 0, 0, 1, 1}, {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_rest, __pyx_k_rest, sizeof(__pyx_k_rest), 0, 0, 1, 1}, {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_rotated, __pyx_k_rotated, sizeof(__pyx_k_rotated), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_kp_s_s_r, __pyx_k_s_r, sizeof(__pyx_k_s_r), 0, 0, 1, 0}, {&__pyx_n_s_scancode, __pyx_k_scancode, sizeof(__pyx_k_scancode), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_allowed, __pyx_k_set_allowed, sizeof(__pyx_k_set_allowed), 0, 0, 1, 1}, {&__pyx_n_s_set_blocked, __pyx_k_set_blocked, sizeof(__pyx_k_set_blocked), 0, 0, 1, 1}, {&__pyx_n_s_set_grab, __pyx_k_set_grab, sizeof(__pyx_k_set_grab), 0, 0, 1, 1}, {&__pyx_n_s_set_mousewheel_buttons, __pyx_k_set_mousewheel_buttons, sizeof(__pyx_k_set_mousewheel_buttons), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_k_src_pygame_sdl2_event_pyx, sizeof(__pyx_k_src_pygame_sdl2_event_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_n_s_text_input, __pyx_k_text_input, sizeof(__pyx_k_text_input), 0, 0, 1, 1}, {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1}, {&__pyx_n_s_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 0, 1, 1}, {&__pyx_n_s_touch, __pyx_k_touch, sizeof(__pyx_k_touch), 0, 0, 1, 1}, {&__pyx_n_s_touchId, __pyx_k_touchId, sizeof(__pyx_k_touchId), 0, 0, 1, 1}, {&__pyx_n_s_touch_id, __pyx_k_touch_id, sizeof(__pyx_k_touch_id), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 0, 1, 1}, {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, {&__pyx_n_s_unichr, __pyx_k_unichr, sizeof(__pyx_k_unichr), 0, 0, 1, 1}, {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, {&__pyx_n_s_which, __pyx_k_which, sizeof(__pyx_k_which), 0, 0, 1, 1}, {&__pyx_n_s_window_id, __pyx_k_window_id, sizeof(__pyx_k_window_id), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 29, __pyx_L1_error) __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 61, __pyx_L1_error) __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 90, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(0, 205, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/event.pyx":362 * cdef SDL_Event evt * * with lock: # <<<<<<<<<<<<<< * while SDL_PollEvent(&evt): * e = make_event(&evt) */ __pyx_tuple__3 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/event.pyx":549 * """ * * return event_queue[:] # <<<<<<<<<<<<<< * * # Usually called by display.init. */ __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__4); __Pyx_GIVEREF(__pyx_slice__4); /* "pygame_sdl2/event.pyx":61 * SDL_TOUCH_MOUSEID = -1 * * class EventType(object): # <<<<<<<<<<<<<< * * def __init__(self, type, dict=None, **kwargs): */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_tuple__7 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/event.pyx":63 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ __pyx_tuple__8 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_type, __pyx_n_s_dict, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_init, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_tuple__10 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "pygame_sdl2/event.pyx":71 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < WINDOWMOVED: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ __pyx_tuple__11 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_ename, __pyx_n_s_rest, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_repr, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 71, __pyx_L1_error) /* "pygame_sdl2/event.pyx":90 * return '' % (self.type, ename, ", ".join(rest)) * * @property # <<<<<<<<<<<<<< * def dict(self): * return self.__dict__ */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_dict, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 90, __pyx_L1_error) /* "pygame_sdl2/event.pyx":94 * return self.__dict__ * * @property # <<<<<<<<<<<<<< * def type(self): * return self._type */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_type, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 94, __pyx_L1_error) /* "pygame_sdl2/event.pyx":98 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_eq, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 98, __pyx_L1_error) /* "pygame_sdl2/event.pyx":101 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_ne, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 101, __pyx_L1_error) /* "pygame_sdl2/event.pyx":104 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_nonzero, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 104, __pyx_L1_error) /* "pygame_sdl2/event.pyx":311 * * # This is the object that is returned when no event exists. * NOEVENT_EVENT = EventType(0) # <<<<<<<<<<<<<< * * */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); /* "pygame_sdl2/event.pyx":371 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_pump, 371, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 371, __pyx_L1_error) /* "pygame_sdl2/event.pyx":376 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get, 376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 376, __pyx_L1_error) /* "pygame_sdl2/event.pyx":396 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_poll, 396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 396, __pyx_L1_error) /* "pygame_sdl2/event.pyx":407 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_evt, __pyx_n_s_result); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_wait, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 407, __pyx_L1_error) /* "pygame_sdl2/event.pyx":427 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_peek, 427, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 427, __pyx_L1_error) /* "pygame_sdl2/event.pyx":440 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_clear, 440, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 440, __pyx_L1_error) /* "pygame_sdl2/event.pyx":445 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_i); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_standard_events, 445, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 445, __pyx_L1_error) /* "pygame_sdl2/event.pyx":452 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_event_name, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 452, __pyx_L1_error) /* "pygame_sdl2/event.pyx":458 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_et); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_blocked, 458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 458, __pyx_L1_error) /* "pygame_sdl2/event.pyx":468 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_allowed, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 468, __pyx_L1_error) /* "pygame_sdl2/event.pyx":478 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_blocked, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 478, __pyx_L1_error) /* "pygame_sdl2/event.pyx":481 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_on); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_grab, 481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 481, __pyx_L1_error) /* "pygame_sdl2/event.pyx":487 * SDL_SetRelativeMouseMode(on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_grab, 487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 487, __pyx_L1_error) /* "pygame_sdl2/event.pyx":490 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_mousewheel_buttons, 490, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 490, __pyx_L1_error) /* "pygame_sdl2/event.pyx":502 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_mousewheel_buttons, 502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 502, __pyx_L1_error) /* "pygame_sdl2/event.pyx":509 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_e, __pyx_n_s_event); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_post, 509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 509, __pyx_L1_error) /* "pygame_sdl2/event.pyx":529 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_name, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_register, 529, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 529, __pyx_L1_error) /* "pygame_sdl2/event.pyx":543 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_copy_event_queue, 543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 543, __pyx_L1_error) /* "pygame_sdl2/event.pyx":552 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_init_2, 552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ event_queue = Py_None; Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_8(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyTypeObject), #else sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7display_Window),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7display_Window) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportVoidPtr_3_0_8(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_event(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_event}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "event", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initevent(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initevent(void) #else __Pyx_PyMODINIT_FUNC PyInit_event(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_event(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_event(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'event' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("event", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "event" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_event(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__event) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.event")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.event", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_variable_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/event.pyx":24 * from sdl2 cimport * * from pygame_sdl2.display cimport Window, main_window * import threading # <<<<<<<<<<<<<< * import pygame_sdl2 * import sys */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_threading, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":25 * from pygame_sdl2.display cimport Window, main_window * import threading * import pygame_sdl2 # <<<<<<<<<<<<<< * import sys * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":26 * import threading * import pygame_sdl2 * import sys # <<<<<<<<<<<<<< * * if sys.version_info[0] >= 3: */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":28 * import sys * * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<< * unichr = chr * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":29 * * if sys.version_info[0] >= 3: * unichr = chr # <<<<<<<<<<<<<< * * include "event_names.pxi" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_unichr, __pyx_builtin_chr) < 0) __PYX_ERR(0, 29, __pyx_L1_error) /* "pygame_sdl2/event.pyx":28 * import sys * * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<< * unichr = chr * */ } /* "include/event_names.pxi":5 * * event_names = { * SDL_FIRSTEVENT : u'NOEVENT', # <<<<<<<<<<<<<< * SDL_QUIT : 'QUIT', * SDL_APP_TERMINATING : 'APP_TERMINATING', */ __pyx_t_3 = __Pyx_PyDict_NewPresized(51); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FIRSTEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_NOEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":6 * event_names = { * SDL_FIRSTEVENT : u'NOEVENT', * SDL_QUIT : 'QUIT', # <<<<<<<<<<<<<< * SDL_APP_TERMINATING : 'APP_TERMINATING', * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_QUIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_QUIT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":7 * SDL_FIRSTEVENT : u'NOEVENT', * SDL_QUIT : 'QUIT', * SDL_APP_TERMINATING : 'APP_TERMINATING', # <<<<<<<<<<<<<< * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_TERMINATING); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_TERMINATING) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":8 * SDL_QUIT : 'QUIT', * SDL_APP_TERMINATING : 'APP_TERMINATING', * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', # <<<<<<<<<<<<<< * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_LOWMEMORY); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_LOWMEMORY) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":9 * SDL_APP_TERMINATING : 'APP_TERMINATING', * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', # <<<<<<<<<<<<<< * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERBACKGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_WILLENTERBACKGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":10 * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', # <<<<<<<<<<<<<< * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERBACKGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_DIDENTERBACKGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":11 * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', # <<<<<<<<<<<<<< * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', * SDL_DISPLAYEVENT : 'DISPLAYEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERFOREGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_WILLENTERFOREGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":12 * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', # <<<<<<<<<<<<<< * SDL_DISPLAYEVENT : 'DISPLAYEVENT', * SDL_WINDOWEVENT : 'WINDOWEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERFOREGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_DIDENTERFOREGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":13 * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', * SDL_DISPLAYEVENT : 'DISPLAYEVENT', # <<<<<<<<<<<<<< * SDL_WINDOWEVENT : 'WINDOWEVENT', * SDL_SYSWMEVENT : 'SYSWMEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DISPLAYEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DISPLAYEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":14 * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', * SDL_DISPLAYEVENT : 'DISPLAYEVENT', * SDL_WINDOWEVENT : 'WINDOWEVENT', # <<<<<<<<<<<<<< * SDL_SYSWMEVENT : 'SYSWMEVENT', * SDL_KEYDOWN : 'KEYDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_WINDOWEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":15 * SDL_DISPLAYEVENT : 'DISPLAYEVENT', * SDL_WINDOWEVENT : 'WINDOWEVENT', * SDL_SYSWMEVENT : 'SYSWMEVENT', # <<<<<<<<<<<<<< * SDL_KEYDOWN : 'KEYDOWN', * SDL_KEYUP : 'KEYUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_SYSWMEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_SYSWMEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":16 * SDL_WINDOWEVENT : 'WINDOWEVENT', * SDL_SYSWMEVENT : 'SYSWMEVENT', * SDL_KEYDOWN : 'KEYDOWN', # <<<<<<<<<<<<<< * SDL_KEYUP : 'KEYUP', * SDL_TEXTEDITING : 'TEXTEDITING', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_KEYDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":17 * SDL_SYSWMEVENT : 'SYSWMEVENT', * SDL_KEYDOWN : 'KEYDOWN', * SDL_KEYUP : 'KEYUP', # <<<<<<<<<<<<<< * SDL_TEXTEDITING : 'TEXTEDITING', * SDL_TEXTINPUT : 'TEXTINPUT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_KEYUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":18 * SDL_KEYDOWN : 'KEYDOWN', * SDL_KEYUP : 'KEYUP', * SDL_TEXTEDITING : 'TEXTEDITING', # <<<<<<<<<<<<<< * SDL_TEXTINPUT : 'TEXTINPUT', * SDL_KEYMAPCHANGED : 'KEYMAPCHANGED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTEDITING); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_TEXTEDITING) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":19 * SDL_KEYUP : 'KEYUP', * SDL_TEXTEDITING : 'TEXTEDITING', * SDL_TEXTINPUT : 'TEXTINPUT', # <<<<<<<<<<<<<< * SDL_KEYMAPCHANGED : 'KEYMAPCHANGED', * SDL_MOUSEMOTION : 'MOUSEMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTINPUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_TEXTINPUT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":20 * SDL_TEXTEDITING : 'TEXTEDITING', * SDL_TEXTINPUT : 'TEXTINPUT', * SDL_KEYMAPCHANGED : 'KEYMAPCHANGED', # <<<<<<<<<<<<<< * SDL_MOUSEMOTION : 'MOUSEMOTION', * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYMAPCHANGED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_KEYMAPCHANGED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":21 * SDL_TEXTINPUT : 'TEXTINPUT', * SDL_KEYMAPCHANGED : 'KEYMAPCHANGED', * SDL_MOUSEMOTION : 'MOUSEMOTION', # <<<<<<<<<<<<<< * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MOUSEMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":22 * SDL_KEYMAPCHANGED : 'KEYMAPCHANGED', * SDL_MOUSEMOTION : 'MOUSEMOTION', * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', # <<<<<<<<<<<<<< * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', * SDL_MOUSEWHEEL : 'MOUSEWHEEL', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MOUSEBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":23 * SDL_MOUSEMOTION : 'MOUSEMOTION', * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', # <<<<<<<<<<<<<< * SDL_MOUSEWHEEL : 'MOUSEWHEEL', * SDL_JOYAXISMOTION : 'JOYAXISMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MOUSEBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":24 * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', * SDL_MOUSEWHEEL : 'MOUSEWHEEL', # <<<<<<<<<<<<<< * SDL_JOYAXISMOTION : 'JOYAXISMOTION', * SDL_JOYBALLMOTION : 'JOYBALLMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEWHEEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MOUSEWHEEL) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":25 * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', * SDL_MOUSEWHEEL : 'MOUSEWHEEL', * SDL_JOYAXISMOTION : 'JOYAXISMOTION', # <<<<<<<<<<<<<< * SDL_JOYBALLMOTION : 'JOYBALLMOTION', * SDL_JOYHATMOTION : 'JOYHATMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYAXISMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYAXISMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":26 * SDL_MOUSEWHEEL : 'MOUSEWHEEL', * SDL_JOYAXISMOTION : 'JOYAXISMOTION', * SDL_JOYBALLMOTION : 'JOYBALLMOTION', # <<<<<<<<<<<<<< * SDL_JOYHATMOTION : 'JOYHATMOTION', * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBALLMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYBALLMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":27 * SDL_JOYAXISMOTION : 'JOYAXISMOTION', * SDL_JOYBALLMOTION : 'JOYBALLMOTION', * SDL_JOYHATMOTION : 'JOYHATMOTION', # <<<<<<<<<<<<<< * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', * SDL_JOYBUTTONUP : 'JOYBUTTONUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYHATMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYHATMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":28 * SDL_JOYBALLMOTION : 'JOYBALLMOTION', * SDL_JOYHATMOTION : 'JOYHATMOTION', * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', # <<<<<<<<<<<<<< * SDL_JOYBUTTONUP : 'JOYBUTTONUP', * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":29 * SDL_JOYHATMOTION : 'JOYHATMOTION', * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', * SDL_JOYBUTTONUP : 'JOYBUTTONUP', # <<<<<<<<<<<<<< * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":30 * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', * SDL_JOYBUTTONUP : 'JOYBUTTONUP', * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', # <<<<<<<<<<<<<< * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYDEVICEADDED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":31 * SDL_JOYBUTTONUP : 'JOYBUTTONUP', * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', # <<<<<<<<<<<<<< * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYDEVICEREMOVED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":32 * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', # <<<<<<<<<<<<<< * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERAXISMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERAXISMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":33 * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', # <<<<<<<<<<<<<< * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":34 * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', # <<<<<<<<<<<<<< * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":35 * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', # <<<<<<<<<<<<<< * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERDEVICEADDED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":36 * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', # <<<<<<<<<<<<<< * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', * SDL_FINGERDOWN : 'FINGERDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERDEVICEREMOVED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":37 * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', # <<<<<<<<<<<<<< * SDL_FINGERDOWN : 'FINGERDOWN', * SDL_FINGERUP : 'FINGERUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMAPPED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERDEVICEREMAPPED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":38 * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', * SDL_FINGERDOWN : 'FINGERDOWN', # <<<<<<<<<<<<<< * SDL_FINGERUP : 'FINGERUP', * SDL_FINGERMOTION : 'FINGERMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_FINGERDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":39 * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', * SDL_FINGERDOWN : 'FINGERDOWN', * SDL_FINGERUP : 'FINGERUP', # <<<<<<<<<<<<<< * SDL_FINGERMOTION : 'FINGERMOTION', * SDL_DOLLARGESTURE : 'DOLLARGESTURE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_FINGERUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":40 * SDL_FINGERDOWN : 'FINGERDOWN', * SDL_FINGERUP : 'FINGERUP', * SDL_FINGERMOTION : 'FINGERMOTION', # <<<<<<<<<<<<<< * SDL_DOLLARGESTURE : 'DOLLARGESTURE', * SDL_DOLLARRECORD : 'DOLLARRECORD', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_FINGERMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":41 * SDL_FINGERUP : 'FINGERUP', * SDL_FINGERMOTION : 'FINGERMOTION', * SDL_DOLLARGESTURE : 'DOLLARGESTURE', # <<<<<<<<<<<<<< * SDL_DOLLARRECORD : 'DOLLARRECORD', * SDL_MULTIGESTURE : 'MULTIGESTURE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARGESTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DOLLARGESTURE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":42 * SDL_FINGERMOTION : 'FINGERMOTION', * SDL_DOLLARGESTURE : 'DOLLARGESTURE', * SDL_DOLLARRECORD : 'DOLLARRECORD', # <<<<<<<<<<<<<< * SDL_MULTIGESTURE : 'MULTIGESTURE', * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARRECORD); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DOLLARRECORD) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":43 * SDL_DOLLARGESTURE : 'DOLLARGESTURE', * SDL_DOLLARRECORD : 'DOLLARRECORD', * SDL_MULTIGESTURE : 'MULTIGESTURE', # <<<<<<<<<<<<<< * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', * SDL_DROPFILE : 'DROPFILE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MULTIGESTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MULTIGESTURE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":44 * SDL_DOLLARRECORD : 'DOLLARRECORD', * SDL_MULTIGESTURE : 'MULTIGESTURE', * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', # <<<<<<<<<<<<<< * SDL_DROPFILE : 'DROPFILE', * SDL_DROPTEXT : 'DROPTEXT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CLIPBOARDUPDATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CLIPBOARDUPDATE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":45 * SDL_MULTIGESTURE : 'MULTIGESTURE', * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', * SDL_DROPFILE : 'DROPFILE', # <<<<<<<<<<<<<< * SDL_DROPTEXT : 'DROPTEXT', * SDL_DROPBEGIN : 'DROPBEGIN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DROPFILE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":46 * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', * SDL_DROPFILE : 'DROPFILE', * SDL_DROPTEXT : 'DROPTEXT', # <<<<<<<<<<<<<< * SDL_DROPBEGIN : 'DROPBEGIN', * SDL_DROPCOMPLETE : 'DROPCOMPLETE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPTEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DROPTEXT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":47 * SDL_DROPFILE : 'DROPFILE', * SDL_DROPTEXT : 'DROPTEXT', * SDL_DROPBEGIN : 'DROPBEGIN', # <<<<<<<<<<<<<< * SDL_DROPCOMPLETE : 'DROPCOMPLETE', * SDL_AUDIODEVICEADDED : 'AUDIODEVICEADDED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPBEGIN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DROPBEGIN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":48 * SDL_DROPTEXT : 'DROPTEXT', * SDL_DROPBEGIN : 'DROPBEGIN', * SDL_DROPCOMPLETE : 'DROPCOMPLETE', # <<<<<<<<<<<<<< * SDL_AUDIODEVICEADDED : 'AUDIODEVICEADDED', * SDL_AUDIODEVICEREMOVED : 'AUDIODEVICEREMOVED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPCOMPLETE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DROPCOMPLETE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":49 * SDL_DROPBEGIN : 'DROPBEGIN', * SDL_DROPCOMPLETE : 'DROPCOMPLETE', * SDL_AUDIODEVICEADDED : 'AUDIODEVICEADDED', # <<<<<<<<<<<<<< * SDL_AUDIODEVICEREMOVED : 'AUDIODEVICEREMOVED', * SDL_SENSORUPDATE : 'SENSORUPDATE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_AUDIODEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_AUDIODEVICEADDED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":50 * SDL_DROPCOMPLETE : 'DROPCOMPLETE', * SDL_AUDIODEVICEADDED : 'AUDIODEVICEADDED', * SDL_AUDIODEVICEREMOVED : 'AUDIODEVICEREMOVED', # <<<<<<<<<<<<<< * SDL_SENSORUPDATE : 'SENSORUPDATE', * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_AUDIODEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_AUDIODEVICEREMOVED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":51 * SDL_AUDIODEVICEADDED : 'AUDIODEVICEADDED', * SDL_AUDIODEVICEREMOVED : 'AUDIODEVICEREMOVED', * SDL_SENSORUPDATE : 'SENSORUPDATE', # <<<<<<<<<<<<<< * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', * SDL_RENDER_DEVICE_RESET : 'RENDER_DEVICE_RESET', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_SENSORUPDATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_SENSORUPDATE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":52 * SDL_AUDIODEVICEREMOVED : 'AUDIODEVICEREMOVED', * SDL_SENSORUPDATE : 'SENSORUPDATE', * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', # <<<<<<<<<<<<<< * SDL_RENDER_DEVICE_RESET : 'RENDER_DEVICE_RESET', * SDL_USEREVENT : 'USEREVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_TARGETS_RESET); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_RENDER_TARGETS_RESET) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":53 * SDL_SENSORUPDATE : 'SENSORUPDATE', * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', * SDL_RENDER_DEVICE_RESET : 'RENDER_DEVICE_RESET', # <<<<<<<<<<<<<< * SDL_USEREVENT : 'USEREVENT', * SDL_LASTEVENT : 'LASTEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_DEVICE_RESET); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_RENDER_DEVICE_RESET) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":54 * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', * SDL_RENDER_DEVICE_RESET : 'RENDER_DEVICE_RESET', * SDL_USEREVENT : 'USEREVENT', # <<<<<<<<<<<<<< * SDL_LASTEVENT : 'LASTEVENT', * } */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_USEREVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":55 * SDL_RENDER_DEVICE_RESET : 'RENDER_DEVICE_RESET', * SDL_USEREVENT : 'USEREVENT', * SDL_LASTEVENT : 'LASTEVENT', # <<<<<<<<<<<<<< * } */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_LASTEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_LASTEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_event_names, __pyx_t_3) < 0) __PYX_ERR(4, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":34 * * # Add events to emulate SDL 1.2. These also need to be added in locals. * ACTIVEEVENT = SDL_LASTEVENT - 1 # <<<<<<<<<<<<<< * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACTIVEEVENT, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":35 * # Add events to emulate SDL 1.2. These also need to be added in locals. * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 # <<<<<<<<<<<<<< * VIDEOEXPOSE = SDL_LASTEVENT - 3 * WINDOWMOVED = SDL_LASTEVENT - 4 */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEORESIZE, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":36 * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 # <<<<<<<<<<<<<< * WINDOWMOVED = SDL_LASTEVENT - 4 * # (Do not add events here.) */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEOEXPOSE, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":37 * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 * WINDOWMOVED = SDL_LASTEVENT - 4 # <<<<<<<<<<<<<< * # (Do not add events here.) * */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWMOVED, __pyx_t_3) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":40 * # (Do not add events here.) * * event_names[ACTIVEEVENT] = "ACTIVEEVENT" # <<<<<<<<<<<<<< * event_names[VIDEORESIZE] = "VIDEORESIZE" * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_event_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_ACTIVEEVENT) < 0))) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":41 * * event_names[ACTIVEEVENT] = "ACTIVEEVENT" * event_names[VIDEORESIZE] = "VIDEORESIZE" # <<<<<<<<<<<<<< * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" * event_names[WINDOWMOVED] = "WINDOWMOVED" */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_event_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_VIDEORESIZE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_VIDEORESIZE) < 0))) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":42 * event_names[ACTIVEEVENT] = "ACTIVEEVENT" * event_names[VIDEORESIZE] = "VIDEORESIZE" * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" # <<<<<<<<<<<<<< * event_names[WINDOWMOVED] = "WINDOWMOVED" * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_event_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_VIDEOEXPOSE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_VIDEOEXPOSE) < 0))) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":43 * event_names[VIDEORESIZE] = "VIDEORESIZE" * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" * event_names[WINDOWMOVED] = "WINDOWMOVED" # <<<<<<<<<<<<<< * * # This is used for events posted to the event queue. This won't be returned */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_event_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_WINDOWMOVED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_WINDOWMOVED) < 0))) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":49 * # giving the type. * cdef unsigned int POSTEDEVENT * POSTEDEVENT = SDL_LASTEVENT - 5 # <<<<<<<<<<<<<< * * # The maximum number of a user-defined event. */ __pyx_v_11pygame_sdl2_5event_POSTEDEVENT = (SDL_LASTEVENT - 5); /* "pygame_sdl2/event.pyx":52 * * # The maximum number of a user-defined event. * USEREVENT_MAX = SDL_LASTEVENT - 6 # <<<<<<<<<<<<<< * * # If true, the mousewheel is mapped to buttons 4 and 5. Otherwise, a */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_USEREVENT_MAX, __pyx_t_3) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":56 * # If true, the mousewheel is mapped to buttons 4 and 5. Otherwise, a * # MOUSEWHEEL event is created. * cdef bint mousewheel_buttons = 1 # <<<<<<<<<<<<<< * * cdef unsigned int SDL_TOUCH_MOUSEID */ __pyx_v_11pygame_sdl2_5event_mousewheel_buttons = 1; /* "pygame_sdl2/event.pyx":59 * * cdef unsigned int SDL_TOUCH_MOUSEID * SDL_TOUCH_MOUSEID = -1 # <<<<<<<<<<<<<< * * class EventType(object): */ __pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID = ((unsigned int)-1L); /* "pygame_sdl2/event.pyx":61 * SDL_TOUCH_MOUSEID = -1 * * class EventType(object): # <<<<<<<<<<<<<< * * def __init__(self, type, dict=None, **kwargs): */ __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_tuple__7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_EventType, __pyx_n_s_EventType, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_event, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3 != __pyx_tuple__7) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__7) < 0))) __PYX_ERR(0, 61, __pyx_L1_error) } /* "pygame_sdl2/event.pyx":63 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_1__init__, 0, __pyx_n_s_EventType___init, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":71 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < WINDOWMOVED: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_3__repr__, 0, __pyx_n_s_EventType___repr, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_repr, __pyx_t_6) < 0) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":90 * return '' % (self.type, ename, ", ".join(rest)) * * @property # <<<<<<<<<<<<<< * def dict(self): * return self.__dict__ */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_5dict, 0, __pyx_n_s_EventType_dict, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_dict, __pyx_t_7) < 0) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":94 * return self.__dict__ * * @property # <<<<<<<<<<<<<< * def type(self): * return self._type */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_7type, 0, __pyx_n_s_EventType_type, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_type, __pyx_t_6) < 0) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":98 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_9__eq__, 0, __pyx_n_s_EventType___eq, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_eq, __pyx_t_6) < 0) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":101 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_11__ne__, 0, __pyx_n_s_EventType___ne, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ne, __pyx_t_6) < 0) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":104 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_13__nonzero__, 0, __pyx_n_s_EventType___nonzero, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_nonzero, __pyx_t_6) < 0) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":61 * SDL_TOUCH_MOUSEID = -1 * * class EventType(object): # <<<<<<<<<<<<<< * * def __init__(self, type, dict=None, **kwargs): */ __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_EventType, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EventType, __pyx_t_6) < 0) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":107 * return self.type != 0 * * Event = EventType # <<<<<<<<<<<<<< * * cdef get_textinput(): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_EventType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Event, __pyx_t_3) < 0) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":305 * * # The event queue - a list of pending events from oldest to newest. * cdef public event_queue = list() # <<<<<<<<<<<<<< * * # The lock that protects the event queue. */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(event_queue); __Pyx_DECREF_SET(event_queue, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":308 * * # The lock that protects the event queue. * lock = threading.RLock() # <<<<<<<<<<<<<< * * # This is the object that is returned when no event exists. */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RLock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_lock, __pyx_t_3) < 0) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":311 * * # This is the object that is returned when no event exists. * NOEVENT_EVENT = EventType(0) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_EventType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOEVENT_EVENT, __pyx_t_2) < 0) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":371 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_1pump, 0, __pyx_n_s_pump, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pump, __pyx_t_2) < 0) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":376 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_3get, 0, __pyx_n_s_get, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":396 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_5poll, 0, __pyx_n_s_poll, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_poll, __pyx_t_2) < 0) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":407 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_7wait, 0, __pyx_n_s_wait, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":427 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9peek, 0, __pyx_n_s_peek, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_peek, __pyx_t_2) < 0) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":440 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_11clear, 0, __pyx_n_s_clear, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_clear, __pyx_t_2) < 0) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":445 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_13get_standard_events, 0, __pyx_n_s_get_standard_events, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_standard_events, __pyx_t_2) < 0) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":452 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_15event_name, 0, __pyx_n_s_event_name, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_event_name, __pyx_t_2) < 0) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":458 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_17set_blocked, 0, __pyx_n_s_set_blocked, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_blocked, __pyx_t_2) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":468 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_19set_allowed, 0, __pyx_n_s_set_allowed, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_allowed, __pyx_t_2) < 0) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":478 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_21get_blocked, 0, __pyx_n_s_get_blocked, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_blocked, __pyx_t_2) < 0) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":481 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_23set_grab, 0, __pyx_n_s_set_grab, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_grab, __pyx_t_2) < 0) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":487 * SDL_SetRelativeMouseMode(on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_25get_grab, 0, __pyx_n_s_get_grab, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_grab, __pyx_t_2) < 0) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":490 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_27set_mousewheel_buttons, 0, __pyx_n_s_set_mousewheel_buttons, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mousewheel_buttons, __pyx_t_2) < 0) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":502 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_29get_mousewheel_buttons, 0, __pyx_n_s_get_mousewheel_buttons, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_mousewheel_buttons, __pyx_t_2) < 0) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":509 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_31post, 0, __pyx_n_s_post, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_post, __pyx_t_2) < 0) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":529 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_33register, 0, __pyx_n_s_register, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_register, __pyx_t_2) < 0) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":543 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_35copy_event_queue, 0, __pyx_n_s_copy_event_queue, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy_event_queue, __pyx_t_2) < 0) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":552 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_37init, 0, __pyx_n_s_init_2, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":560 * raise pygame_sdl2.error.error() * * _types = """ # <<<<<<<<<<<<<< * Event = EventType * """ */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_kp_s_Event_EventType) < 0) __PYX_ERR(0, 560, __pyx_L1_error) /* "pygame_sdl2/event.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Copyright 2014 Tom Rothamel * # */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.event", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.event"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* StringJoin */ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { (void) __Pyx_PyObject_CallMethod1; #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION < 3 return _PyString_Join(sep, values); #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 return _PyBytes_Join(sep, values); #else return __Pyx_PyObject_CallMethod1(sep, __pyx_n_s_join, values); #endif } /* PyIntCompare */ static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { Py_RETURN_FALSE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { if (__Pyx_PyLong_IsZero(op1) != 1) Py_RETURN_TRUE; else Py_RETURN_FALSE; } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) Py_RETURN_TRUE; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) Py_RETURN_TRUE; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } return ( PyObject_RichCompare(op1, op2, Py_NE)); } /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + (unsigned long)b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* RaiseUnboundLocalError */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* pop_index */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { PyObject *r; if (unlikely(!py_ix)) return NULL; r = __Pyx__PyObject_PopIndex(L, py_ix); Py_DECREF(py_ix); return r; } static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); } #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { Py_ssize_t size = PyList_GET_SIZE(L); if (likely(size > (((PyListObject*)L)->allocated >> 1))) { Py_ssize_t cix = ix; if (cix < 0) { cix += size; } if (likely(__Pyx_is_valid_index(cix, size))) { PyObject* v = PyList_GET_ITEM(L, cix); __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); size -= 1; memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); return v; } } if (py_ix == Py_None) { return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); } else { return __Pyx__PyObject_PopIndex(L, py_ix); } } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } *pvalue1 = value1; *pvalue2 = value2; return 0; #if CYTHON_COMPILING_IN_PYPY bad: Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; #endif } static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = __Pyx_PyObject_GetIterNextFunc(iter); value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { #if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; #elif PY_MAJOR_VERSION >= 3 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { const char *name = PyUnicode_AsUTF8(method_name); if (strcmp(name, "iteritems") == 0) pp = &py_items; else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; else if (strcmp(name, "itervalues") == 0) pp = &py_values; if (pp) { if (!*pp) { *pp = PyUnicode_FromString(name + 4); if (!*pp) return NULL; } method_name = *pp; } } #endif } *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* SetItemInt */ static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (unlikely(!j)) return -1; r = PyObject_SetItem(o, j, v); Py_DECREF(j); return r; } static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { PyObject* old = PyList_GET_ITEM(o, n); Py_INCREF(v); PyList_SET_ITEM(o, n, v); Py_DECREF(old); return 1; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_ass_subscript) { int r; PyObject *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return -1; r = mm->mp_ass_subscript(o, key, v); Py_DECREF(key); return r; } if (likely(sm && sm->sq_ass_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return -1; PyErr_Clear(); } } return sm->sq_ass_item(o, i, v); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_SetItem(o, i, v); } #endif return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_8 #define __PYX_HAVE_RT_ImportType_3_0_8 static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__5; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict_2); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_EventType neg_one = (SDL_EventType) -1, const_zero = (SDL_EventType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_EventType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_EventType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_EventType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_EventType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_EventType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_EventType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_EventType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Scancode(SDL_Scancode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_Scancode neg_one = (SDL_Scancode) -1, const_zero = (SDL_Scancode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_Scancode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Scancode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_Scancode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_Scancode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_Scancode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_Scancode), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_Scancode)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint16_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint16_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int16_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int16_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint32_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint32_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntFromPy */ static CYTHON_INLINE SDL_bool __Pyx_PyInt_As_SDL_bool(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SDL_bool) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_bool) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_bool, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SDL_bool) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) >= 2 * PyLong_SHIFT)) { return (SDL_bool) (((((SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0])); } } break; case 3: if ((8 * sizeof(SDL_bool) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) >= 3 * PyLong_SHIFT)) { return (SDL_bool) (((((((SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0])); } } break; case 4: if ((8 * sizeof(SDL_bool) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) >= 4 * PyLong_SHIFT)) { return (SDL_bool) (((((((((SDL_bool)digits[3]) << PyLong_SHIFT) | (SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_bool) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SDL_bool) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_bool, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SDL_bool) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) - 1 > 2 * PyLong_SHIFT)) { return (SDL_bool) (((SDL_bool)-1)*(((((SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case 2: if ((8 * sizeof(SDL_bool) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) - 1 > 2 * PyLong_SHIFT)) { return (SDL_bool) ((((((SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case -3: if ((8 * sizeof(SDL_bool) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) - 1 > 3 * PyLong_SHIFT)) { return (SDL_bool) (((SDL_bool)-1)*(((((((SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case 3: if ((8 * sizeof(SDL_bool) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) - 1 > 3 * PyLong_SHIFT)) { return (SDL_bool) ((((((((SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case -4: if ((8 * sizeof(SDL_bool) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) - 1 > 4 * PyLong_SHIFT)) { return (SDL_bool) (((SDL_bool)-1)*(((((((((SDL_bool)digits[3]) << PyLong_SHIFT) | (SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case 4: if ((8 * sizeof(SDL_bool) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) - 1 > 4 * PyLong_SHIFT)) { return (SDL_bool) ((((((((((SDL_bool)digits[3]) << PyLong_SHIFT) | (SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; } } #endif if ((sizeof(SDL_bool) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_bool) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (SDL_bool) -1; } else { SDL_bool val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_bool) -1; val = __Pyx_PyInt_As_SDL_bool(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_bool"); return (SDL_bool) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_bool"); return (SDL_bool) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_bool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_bool) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_bool), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_bool)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__49); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* VoidPtrImport */ #ifndef __PYX_HAVE_RT_ImportVoidPtr_3_0_8 #define __PYX_HAVE_RT_ImportVoidPtr_3_0_8 static int __Pyx_ImportVoidPtr_3_0_8(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709471.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.event.h0000664000175000017500000000407714760217137020154 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef __PYX_HAVE__pygame_sdl2__event #define __PYX_HAVE__pygame_sdl2__event #include "Python.h" #ifndef __PYX_HAVE_API__pygame_sdl2__event #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(_T) _T #endif __PYX_EXTERN_C PyObject *event_queue; #endif /* !__PYX_HAVE_API__pygame_sdl2__event */ /* WARNING: the interface of the module init function changed in CPython 3.5. */ /* It now returns a PyModuleDef instance instead of a PyModule instance. */ #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initevent(void); #else /* WARNING: Use PyImport_AppendInittab("event", PyInit_event) instead of calling PyInit_event directly from Python 3.5 */ PyMODINIT_FUNC PyInit_event(void); #if PY_VERSION_HEX >= 0x03050000 && (defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER) || (defined(__cplusplus) && __cplusplus >= 201402L)) #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("Use PyImport_AppendInittab(\"event\", PyInit_event) instead of calling PyInit_event directly.")]] inline #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("Use PyImport_AppendInittab(\"event\", PyInit_event) instead of calling PyInit_event directly."), __unused__)) __inline__ #elif defined(_MSC_VER) __declspec(deprecated("Use PyImport_AppendInittab(\"event\", PyInit_event) instead of calling PyInit_event directly.")) __inline #endif static PyObject* __PYX_WARN_IF_PyInit_event_INIT_CALLED(PyObject* res) { return res; } #define PyInit_event() __PYX_WARN_IF_PyInit_event_INIT_CALLED(PyInit_event()) #endif #endif #endif /* !__PYX_HAVE__pygame_sdl2__event */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709475.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.font.c0000664000175000017500000175137314760217143020002 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__font #define __PYX_HAVE_API__pygame_sdl2__font /* Early includes */ #include #include #include #include #include "SDL.h" #include "SDL_ttf.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "", "src/pygame_sdl2/font.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/color.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_5color_Color; struct __pyx_obj_11pygame_sdl2_4font_Font; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/font.pyx":50 * return match_font("sans") * * cdef class Font: # <<<<<<<<<<<<<< * cdef TTF_Font *font * cdef int style */ struct __pyx_obj_11pygame_sdl2_4font_Font { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *__pyx_vtab; TTF_Font *font; int style; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* "pygame_sdl2/font.pyx":50 * return match_font("sans") * * cdef class Font: # <<<<<<<<<<<<<< * cdef TTF_Font *font * cdef int style */ struct __pyx_vtabstruct_11pygame_sdl2_4font_Font { PyObject *(*set_style)(struct __pyx_obj_11pygame_sdl2_4font_Font *, PyObject *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *__pyx_vtabptr_11pygame_sdl2_4font_Font; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* UnicodeAsUCS4.proto */ static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*); /* object_ord.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyObject_Ord(c)\ (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c)) #else #define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c) #endif static long __Pyx__PyObject_Ord(PyObject* c); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 #define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_8 { __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ static PyObject *__pyx_f_11pygame_sdl2_4font_4Font_set_style(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_on); /* proto*/ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_ttf" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.color" */ static PyObject *(*__pyx_f_11pygame_sdl2_5color_to_sdl_color)(PyObject *, SDL_Color *); /*proto*/ /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.font" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.font" extern int __pyx_module_is_main_pygame_sdl2__font; int __pyx_module_is_main_pygame_sdl2__font = 0; /* Implementation of "pygame_sdl2.font" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "*"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_w[] = "w"; static const char __pyx_k__2[] = " "; static const char __pyx_k__5[] = "."; static const char __pyx_k_ch[] = "ch"; static const char __pyx_k_fg[] = "fg"; static const char __pyx_k_fi[] = "fi"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_on[] = "on"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__33[] = "?"; static const char __pyx_k_Font[] = "Font"; static const char __pyx_k_blit[] = "blit"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_file[] = "__file__"; static const char __pyx_k_fill[] = "fill"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_maxx[] = "maxx"; static const char __pyx_k_maxy[] = "maxy"; static const char __pyx_k_minx[] = "minx"; static const char __pyx_k_miny[] = "miny"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_sans[] = "sans"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_surf[] = "surf"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_text[] = "text"; static const char __pyx_k_chnum[] = "chnum"; static const char __pyx_k_color[] = "color"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_bgsurf[] = "bgsurf"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_exists[] = "exists"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_render[] = "render"; static const char __pyx_k_SysFont[] = "SysFont"; static const char __pyx_k_advance[] = "advance"; static const char __pyx_k_convert[] = "convert"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_dirname[] = "dirname"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_metrics[] = "metrics"; static const char __pyx_k_get_bold[] = "get_bold"; static const char __pyx_k_get_init[] = "get_init"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_set_bold[] = "set_bold"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_Font_size[] = "Font.size"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_antialias[] = "antialias"; static const char __pyx_k_get_fonts[] = "get_fonts"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_background[] = "background"; static const char __pyx_k_get_ascent[] = "get_ascent"; static const char __pyx_k_get_height[] = "get_height"; static const char __pyx_k_get_italic[] = "get_italic"; static const char __pyx_k_match_font[] = "match_font"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_set_italic[] = "set_italic"; static const char __pyx_k_Font_render[] = "Font.render"; static const char __pyx_k_get_descent[] = "get_descent"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_Font_metrics[] = "Font.metrics"; static const char __pyx_k_get_linesize[] = "get_linesize"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_Font_get_bold[] = "Font.get_bold"; static const char __pyx_k_Font_set_bold[] = "Font.set_bold"; static const char __pyx_k_get_underline[] = "get_underline"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_set_underline[] = "set_underline"; static const char __pyx_k_DejaVuSans_ttf[] = "DejaVuSans.ttf"; static const char __pyx_k_Font_get_ascent[] = "Font.get_ascent"; static const char __pyx_k_Font_get_height[] = "Font.get_height"; static const char __pyx_k_Font_get_italic[] = "Font.get_italic"; static const char __pyx_k_Font_set_italic[] = "Font.set_italic"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Font_get_descent[] = "Font.get_descent"; static const char __pyx_k_get_default_font[] = "get_default_font"; static const char __pyx_k_pygame_sdl2_font[] = "pygame_sdl2.font"; static const char __pyx_k_Font_get_linesize[] = "Font.get_linesize"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_Font_get_underline[] = "Font.get_underline"; static const char __pyx_k_Font_set_underline[] = "Font.set_underline"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_sysfont[] = "pygame_sdl2.sysfont"; static const char __pyx_k_Font___reduce_cython[] = "Font.__reduce_cython__"; static const char __pyx_k_Font___setstate_cython[] = "Font.__setstate_cython__"; static const char __pyx_k_src_pygame_sdl2_font_pyx[] = "src/pygame_sdl2/font.pyx"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_4font_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_6get_default_font(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4font_4Font___cinit__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_4font_4Font_2__dealloc__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4font_4Font_4__init__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_6render(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_antialias, PyObject *__pyx_v_color, PyObject *__pyx_v_background); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_8size(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_10set_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_12get_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_14set_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_16get_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_18set_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_20get_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_22get_linesize(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_24get_height(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_26get_ascent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_28get_descent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_30metrics(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_4font_Font(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_4font_Font; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_4font_Font; PyObject *__pyx_n_s_; PyObject *__pyx_kp_s_DejaVuSans_ttf; PyObject *__pyx_n_s_Font; PyObject *__pyx_n_s_Font___reduce_cython; PyObject *__pyx_n_s_Font___setstate_cython; PyObject *__pyx_n_s_Font_get_ascent; PyObject *__pyx_n_s_Font_get_bold; PyObject *__pyx_n_s_Font_get_descent; PyObject *__pyx_n_s_Font_get_height; PyObject *__pyx_n_s_Font_get_italic; PyObject *__pyx_n_s_Font_get_linesize; PyObject *__pyx_n_s_Font_get_underline; PyObject *__pyx_n_s_Font_metrics; PyObject *__pyx_n_s_Font_render; PyObject *__pyx_n_s_Font_set_bold; PyObject *__pyx_n_s_Font_set_italic; PyObject *__pyx_n_s_Font_set_underline; PyObject *__pyx_n_s_Font_size; PyObject *__pyx_n_s_SysFont; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_kp_s__2; PyObject *__pyx_n_s__33; PyObject *__pyx_kp_u__5; PyObject *__pyx_n_s_advance; PyObject *__pyx_n_s_antialias; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_background; PyObject *__pyx_n_s_bgsurf; PyObject *__pyx_n_s_blit; PyObject *__pyx_n_s_ch; PyObject *__pyx_n_s_chnum; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_color; PyObject *__pyx_n_s_convert; PyObject *__pyx_n_s_copy; PyObject *__pyx_n_s_default; PyObject *__pyx_n_s_dirname; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_exists; PyObject *__pyx_n_s_fg; PyObject *__pyx_n_s_fi; PyObject *__pyx_n_s_file; PyObject *__pyx_n_s_fill; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_ascent; PyObject *__pyx_n_s_get_bold; PyObject *__pyx_n_s_get_default_font; PyObject *__pyx_n_s_get_descent; PyObject *__pyx_n_s_get_fonts; PyObject *__pyx_n_s_get_height; PyObject *__pyx_n_s_get_init; PyObject *__pyx_n_s_get_italic; PyObject *__pyx_n_s_get_linesize; PyObject *__pyx_n_s_get_underline; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_join; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_match_font; PyObject *__pyx_n_s_maxx; PyObject *__pyx_n_s_maxy; PyObject *__pyx_n_s_metrics; PyObject *__pyx_n_s_minx; PyObject *__pyx_n_s_miny; PyObject *__pyx_n_s_name; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_on; PyObject *__pyx_n_s_os; PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_font; PyObject *__pyx_n_s_pygame_sdl2_sysfont; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_register_init; PyObject *__pyx_n_s_register_quit; PyObject *__pyx_n_s_render; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_sans; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_bold; PyObject *__pyx_n_s_set_italic; PyObject *__pyx_n_s_set_underline; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_font_pyx; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_surf; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_text; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_n_s_w; PyObject *__pyx_int_0; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__31; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__24; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__32; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_4font_Font); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_4font_Font); Py_CLEAR(clear_module_state->__pyx_n_s_); Py_CLEAR(clear_module_state->__pyx_kp_s_DejaVuSans_ttf); Py_CLEAR(clear_module_state->__pyx_n_s_Font); Py_CLEAR(clear_module_state->__pyx_n_s_Font___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Font___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_ascent); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_bold); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_descent); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_height); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_italic); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_linesize); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_underline); Py_CLEAR(clear_module_state->__pyx_n_s_Font_metrics); Py_CLEAR(clear_module_state->__pyx_n_s_Font_render); Py_CLEAR(clear_module_state->__pyx_n_s_Font_set_bold); Py_CLEAR(clear_module_state->__pyx_n_s_Font_set_italic); Py_CLEAR(clear_module_state->__pyx_n_s_Font_set_underline); Py_CLEAR(clear_module_state->__pyx_n_s_Font_size); Py_CLEAR(clear_module_state->__pyx_n_s_SysFont); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_kp_s__2); Py_CLEAR(clear_module_state->__pyx_n_s__33); Py_CLEAR(clear_module_state->__pyx_kp_u__5); Py_CLEAR(clear_module_state->__pyx_n_s_advance); Py_CLEAR(clear_module_state->__pyx_n_s_antialias); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_background); Py_CLEAR(clear_module_state->__pyx_n_s_bgsurf); Py_CLEAR(clear_module_state->__pyx_n_s_blit); Py_CLEAR(clear_module_state->__pyx_n_s_ch); Py_CLEAR(clear_module_state->__pyx_n_s_chnum); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_color); Py_CLEAR(clear_module_state->__pyx_n_s_convert); Py_CLEAR(clear_module_state->__pyx_n_s_copy); Py_CLEAR(clear_module_state->__pyx_n_s_default); Py_CLEAR(clear_module_state->__pyx_n_s_dirname); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_exists); Py_CLEAR(clear_module_state->__pyx_n_s_fg); Py_CLEAR(clear_module_state->__pyx_n_s_fi); Py_CLEAR(clear_module_state->__pyx_n_s_file); Py_CLEAR(clear_module_state->__pyx_n_s_fill); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_ascent); Py_CLEAR(clear_module_state->__pyx_n_s_get_bold); Py_CLEAR(clear_module_state->__pyx_n_s_get_default_font); Py_CLEAR(clear_module_state->__pyx_n_s_get_descent); Py_CLEAR(clear_module_state->__pyx_n_s_get_fonts); Py_CLEAR(clear_module_state->__pyx_n_s_get_height); Py_CLEAR(clear_module_state->__pyx_n_s_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_get_italic); Py_CLEAR(clear_module_state->__pyx_n_s_get_linesize); Py_CLEAR(clear_module_state->__pyx_n_s_get_underline); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_join); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_match_font); Py_CLEAR(clear_module_state->__pyx_n_s_maxx); Py_CLEAR(clear_module_state->__pyx_n_s_maxy); Py_CLEAR(clear_module_state->__pyx_n_s_metrics); Py_CLEAR(clear_module_state->__pyx_n_s_minx); Py_CLEAR(clear_module_state->__pyx_n_s_miny); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_on); Py_CLEAR(clear_module_state->__pyx_n_s_os); Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_font); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_sysfont); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_register_init); Py_CLEAR(clear_module_state->__pyx_n_s_register_quit); Py_CLEAR(clear_module_state->__pyx_n_s_render); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_sans); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_bold); Py_CLEAR(clear_module_state->__pyx_n_s_set_italic); Py_CLEAR(clear_module_state->__pyx_n_s_set_underline); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_font_pyx); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_surf); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_text); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__24); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__32); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_4font_Font); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_4font_Font); Py_VISIT(traverse_module_state->__pyx_n_s_); Py_VISIT(traverse_module_state->__pyx_kp_s_DejaVuSans_ttf); Py_VISIT(traverse_module_state->__pyx_n_s_Font); Py_VISIT(traverse_module_state->__pyx_n_s_Font___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Font___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_ascent); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_bold); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_descent); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_height); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_italic); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_linesize); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_underline); Py_VISIT(traverse_module_state->__pyx_n_s_Font_metrics); Py_VISIT(traverse_module_state->__pyx_n_s_Font_render); Py_VISIT(traverse_module_state->__pyx_n_s_Font_set_bold); Py_VISIT(traverse_module_state->__pyx_n_s_Font_set_italic); Py_VISIT(traverse_module_state->__pyx_n_s_Font_set_underline); Py_VISIT(traverse_module_state->__pyx_n_s_Font_size); Py_VISIT(traverse_module_state->__pyx_n_s_SysFont); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_kp_s__2); Py_VISIT(traverse_module_state->__pyx_n_s__33); Py_VISIT(traverse_module_state->__pyx_kp_u__5); Py_VISIT(traverse_module_state->__pyx_n_s_advance); Py_VISIT(traverse_module_state->__pyx_n_s_antialias); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_background); Py_VISIT(traverse_module_state->__pyx_n_s_bgsurf); Py_VISIT(traverse_module_state->__pyx_n_s_blit); Py_VISIT(traverse_module_state->__pyx_n_s_ch); Py_VISIT(traverse_module_state->__pyx_n_s_chnum); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_color); Py_VISIT(traverse_module_state->__pyx_n_s_convert); Py_VISIT(traverse_module_state->__pyx_n_s_copy); Py_VISIT(traverse_module_state->__pyx_n_s_default); Py_VISIT(traverse_module_state->__pyx_n_s_dirname); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_exists); Py_VISIT(traverse_module_state->__pyx_n_s_fg); Py_VISIT(traverse_module_state->__pyx_n_s_fi); Py_VISIT(traverse_module_state->__pyx_n_s_file); Py_VISIT(traverse_module_state->__pyx_n_s_fill); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_ascent); Py_VISIT(traverse_module_state->__pyx_n_s_get_bold); Py_VISIT(traverse_module_state->__pyx_n_s_get_default_font); Py_VISIT(traverse_module_state->__pyx_n_s_get_descent); Py_VISIT(traverse_module_state->__pyx_n_s_get_fonts); Py_VISIT(traverse_module_state->__pyx_n_s_get_height); Py_VISIT(traverse_module_state->__pyx_n_s_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_get_italic); Py_VISIT(traverse_module_state->__pyx_n_s_get_linesize); Py_VISIT(traverse_module_state->__pyx_n_s_get_underline); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_join); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_match_font); Py_VISIT(traverse_module_state->__pyx_n_s_maxx); Py_VISIT(traverse_module_state->__pyx_n_s_maxy); Py_VISIT(traverse_module_state->__pyx_n_s_metrics); Py_VISIT(traverse_module_state->__pyx_n_s_minx); Py_VISIT(traverse_module_state->__pyx_n_s_miny); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_on); Py_VISIT(traverse_module_state->__pyx_n_s_os); Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_font); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_sysfont); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_register_init); Py_VISIT(traverse_module_state->__pyx_n_s_register_quit); Py_VISIT(traverse_module_state->__pyx_n_s_render); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_sans); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_bold); Py_VISIT(traverse_module_state->__pyx_n_s_set_italic); Py_VISIT(traverse_module_state->__pyx_n_s_set_underline); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_font_pyx); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_surf); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_text); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__24); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__32); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_5color_Color __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5color_Color #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_4font_Font __pyx_mstate_global->__pyx_type_11pygame_sdl2_4font_Font #endif #define __pyx_ptype_11pygame_sdl2_4font_Font __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_4font_Font #define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ #define __pyx_kp_s_DejaVuSans_ttf __pyx_mstate_global->__pyx_kp_s_DejaVuSans_ttf #define __pyx_n_s_Font __pyx_mstate_global->__pyx_n_s_Font #define __pyx_n_s_Font___reduce_cython __pyx_mstate_global->__pyx_n_s_Font___reduce_cython #define __pyx_n_s_Font___setstate_cython __pyx_mstate_global->__pyx_n_s_Font___setstate_cython #define __pyx_n_s_Font_get_ascent __pyx_mstate_global->__pyx_n_s_Font_get_ascent #define __pyx_n_s_Font_get_bold __pyx_mstate_global->__pyx_n_s_Font_get_bold #define __pyx_n_s_Font_get_descent __pyx_mstate_global->__pyx_n_s_Font_get_descent #define __pyx_n_s_Font_get_height __pyx_mstate_global->__pyx_n_s_Font_get_height #define __pyx_n_s_Font_get_italic __pyx_mstate_global->__pyx_n_s_Font_get_italic #define __pyx_n_s_Font_get_linesize __pyx_mstate_global->__pyx_n_s_Font_get_linesize #define __pyx_n_s_Font_get_underline __pyx_mstate_global->__pyx_n_s_Font_get_underline #define __pyx_n_s_Font_metrics __pyx_mstate_global->__pyx_n_s_Font_metrics #define __pyx_n_s_Font_render __pyx_mstate_global->__pyx_n_s_Font_render #define __pyx_n_s_Font_set_bold __pyx_mstate_global->__pyx_n_s_Font_set_bold #define __pyx_n_s_Font_set_italic __pyx_mstate_global->__pyx_n_s_Font_set_italic #define __pyx_n_s_Font_set_underline __pyx_mstate_global->__pyx_n_s_Font_set_underline #define __pyx_n_s_Font_size __pyx_mstate_global->__pyx_n_s_Font_size #define __pyx_n_s_SysFont __pyx_mstate_global->__pyx_n_s_SysFont #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_kp_s__2 __pyx_mstate_global->__pyx_kp_s__2 #define __pyx_n_s__33 __pyx_mstate_global->__pyx_n_s__33 #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 #define __pyx_n_s_advance __pyx_mstate_global->__pyx_n_s_advance #define __pyx_n_s_antialias __pyx_mstate_global->__pyx_n_s_antialias #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_background __pyx_mstate_global->__pyx_n_s_background #define __pyx_n_s_bgsurf __pyx_mstate_global->__pyx_n_s_bgsurf #define __pyx_n_s_blit __pyx_mstate_global->__pyx_n_s_blit #define __pyx_n_s_ch __pyx_mstate_global->__pyx_n_s_ch #define __pyx_n_s_chnum __pyx_mstate_global->__pyx_n_s_chnum #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_color __pyx_mstate_global->__pyx_n_s_color #define __pyx_n_s_convert __pyx_mstate_global->__pyx_n_s_convert #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy #define __pyx_n_s_default __pyx_mstate_global->__pyx_n_s_default #define __pyx_n_s_dirname __pyx_mstate_global->__pyx_n_s_dirname #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_exists __pyx_mstate_global->__pyx_n_s_exists #define __pyx_n_s_fg __pyx_mstate_global->__pyx_n_s_fg #define __pyx_n_s_fi __pyx_mstate_global->__pyx_n_s_fi #define __pyx_n_s_file __pyx_mstate_global->__pyx_n_s_file #define __pyx_n_s_fill __pyx_mstate_global->__pyx_n_s_fill #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_ascent __pyx_mstate_global->__pyx_n_s_get_ascent #define __pyx_n_s_get_bold __pyx_mstate_global->__pyx_n_s_get_bold #define __pyx_n_s_get_default_font __pyx_mstate_global->__pyx_n_s_get_default_font #define __pyx_n_s_get_descent __pyx_mstate_global->__pyx_n_s_get_descent #define __pyx_n_s_get_fonts __pyx_mstate_global->__pyx_n_s_get_fonts #define __pyx_n_s_get_height __pyx_mstate_global->__pyx_n_s_get_height #define __pyx_n_s_get_init __pyx_mstate_global->__pyx_n_s_get_init #define __pyx_n_s_get_italic __pyx_mstate_global->__pyx_n_s_get_italic #define __pyx_n_s_get_linesize __pyx_mstate_global->__pyx_n_s_get_linesize #define __pyx_n_s_get_underline __pyx_mstate_global->__pyx_n_s_get_underline #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_match_font __pyx_mstate_global->__pyx_n_s_match_font #define __pyx_n_s_maxx __pyx_mstate_global->__pyx_n_s_maxx #define __pyx_n_s_maxy __pyx_mstate_global->__pyx_n_s_maxy #define __pyx_n_s_metrics __pyx_mstate_global->__pyx_n_s_metrics #define __pyx_n_s_minx __pyx_mstate_global->__pyx_n_s_minx #define __pyx_n_s_miny __pyx_mstate_global->__pyx_n_s_miny #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_on __pyx_mstate_global->__pyx_n_s_on #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_font __pyx_mstate_global->__pyx_n_s_pygame_sdl2_font #define __pyx_n_s_pygame_sdl2_sysfont __pyx_mstate_global->__pyx_n_s_pygame_sdl2_sysfont #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_register_init __pyx_mstate_global->__pyx_n_s_register_init #define __pyx_n_s_register_quit __pyx_mstate_global->__pyx_n_s_register_quit #define __pyx_n_s_render __pyx_mstate_global->__pyx_n_s_render #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_sans __pyx_mstate_global->__pyx_n_s_sans #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_bold __pyx_mstate_global->__pyx_n_s_set_bold #define __pyx_n_s_set_italic __pyx_mstate_global->__pyx_n_s_set_italic #define __pyx_n_s_set_underline __pyx_mstate_global->__pyx_n_s_set_underline #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_font_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_font_pyx #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_surf __pyx_mstate_global->__pyx_n_s_surf #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_text __pyx_mstate_global->__pyx_n_s_text #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 /* #### Code section: module_code ### */ /* "pygame_sdl2/font.pyx":29 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * TTF_Init() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_4font_init}; static PyObject *__pyx_pw_11pygame_sdl2_4font_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4font_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/font.pyx":31 * @pygame_sdl2.register_init * def init(): * TTF_Init() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ (void)(TTF_Init()); /* "pygame_sdl2/font.pyx":29 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * TTF_Init() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":33 * TTF_Init() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * TTF_Quit() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_2quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_3quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_4font_2quit}; static PyObject *__pyx_pw_11pygame_sdl2_4font_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4font_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/font.pyx":35 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * TTF_Quit() # <<<<<<<<<<<<<< * * def get_init(): */ TTF_Quit(); /* "pygame_sdl2/font.pyx":33 * TTF_Init() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * TTF_Quit() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4get_init, "get_init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_5get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_5get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_4font_4get_init}; static PyObject *__pyx_pw_11pygame_sdl2_4font_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/font.pyx":38 * * def get_init(): * return TTF_WasInit() != 0 # <<<<<<<<<<<<<< * * def get_default_font(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((TTF_WasInit() != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_7get_default_font(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_6get_default_font, "get_default_font()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_7get_default_font = {"get_default_font", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_7get_default_font, METH_NOARGS, __pyx_doc_11pygame_sdl2_4font_6get_default_font}; static PyObject *__pyx_pw_11pygame_sdl2_4font_7get_default_font(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_default_font (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4font_6get_default_font(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_6get_default_font(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_v_os = NULL; PyObject *__pyx_v_default = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_default_font", 1); /* "pygame_sdl2/font.pyx":41 * * def get_default_font(): * import os # <<<<<<<<<<<<<< * * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") */ __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_os = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":43 * import os * * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") # <<<<<<<<<<<<<< * * if os.path.exists(default): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dirname); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_2, __pyx_kp_s_DejaVuSans_ttf}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_default = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":45 * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") * * if os.path.exists(default): # <<<<<<<<<<<<<< * return default * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_default}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { /* "pygame_sdl2/font.pyx":46 * * if os.path.exists(default): * return default # <<<<<<<<<<<<<< * * return match_font("sans") */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; /* "pygame_sdl2/font.pyx":45 * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") * * if os.path.exists(default): # <<<<<<<<<<<<<< * return default * */ } /* "pygame_sdl2/font.pyx":48 * return default * * return match_font("sans") # <<<<<<<<<<<<<< * * cdef class Font: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_match_font); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_sans}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.font.get_default_font", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_os); __Pyx_XDECREF(__pyx_v_default); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":54 * cdef int style * * def __cinit__(self): # <<<<<<<<<<<<<< * self.font = NULL * self.style = TTF_STYLE_NORMAL */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4font_4Font_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_4font_4Font_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font___cinit__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4font_4Font___cinit__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/font.pyx":55 * * def __cinit__(self): * self.font = NULL # <<<<<<<<<<<<<< * self.style = TTF_STYLE_NORMAL * */ __pyx_v_self->font = NULL; /* "pygame_sdl2/font.pyx":56 * def __cinit__(self): * self.font = NULL * self.style = TTF_STYLE_NORMAL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->style = TTF_STYLE_NORMAL; /* "pygame_sdl2/font.pyx":54 * cdef int style * * def __cinit__(self): # <<<<<<<<<<<<<< * self.font = NULL * self.style = TTF_STYLE_NORMAL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/font.pyx":58 * self.style = TTF_STYLE_NORMAL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.font: * TTF_CloseFont(self.font) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_4font_4Font_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_4font_4Font_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_4font_4Font_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_4font_4Font_2__dealloc__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { int __pyx_t_1; /* "pygame_sdl2/font.pyx":59 * * def __dealloc__(self): * if self.font: # <<<<<<<<<<<<<< * TTF_CloseFont(self.font) * */ __pyx_t_1 = (__pyx_v_self->font != 0); if (__pyx_t_1) { /* "pygame_sdl2/font.pyx":60 * def __dealloc__(self): * if self.font: * TTF_CloseFont(self.font) # <<<<<<<<<<<<<< * * def __init__(self, fi, size): */ TTF_CloseFont(__pyx_v_self->font); /* "pygame_sdl2/font.pyx":59 * * def __dealloc__(self): * if self.font: # <<<<<<<<<<<<<< * TTF_CloseFont(self.font) * */ } /* "pygame_sdl2/font.pyx":58 * self.style = TTF_STYLE_NORMAL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.font: * TTF_CloseFont(self.font) */ /* function exit code */ } /* "pygame_sdl2/font.pyx":62 * TTF_CloseFont(self.font) * * def __init__(self, fi, size): # <<<<<<<<<<<<<< * if fi is None: * fi = get_default_font() */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4font_4Font_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_4font_4Font_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fi = 0; PyObject *__pyx_v_size = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 62, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 62, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(1, 62, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 62, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); } __pyx_v_fi = values[0]; __pyx_v_size = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 62, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_4__init__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_fi, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4font_4Font_4__init__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_size) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; SDL_RWops *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_fi); /* "pygame_sdl2/font.pyx":63 * * def __init__(self, fi, size): * if fi is None: # <<<<<<<<<<<<<< * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) */ __pyx_t_1 = (__pyx_v_fi == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/font.pyx":64 * def __init__(self, fi, size): * if fi is None: * fi = get_default_font() # <<<<<<<<<<<<<< * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_default_font); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_fi, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":63 * * def __init__(self, fi, size): * if fi is None: # <<<<<<<<<<<<<< * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) */ } /* "pygame_sdl2/font.pyx":65 * if fi is None: * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) # <<<<<<<<<<<<<< * if self.font == NULL: * raise error() */ __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_6 == ((SDL_RWops *)NULL))) __PYX_ERR(1, 65, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L1_error) __pyx_v_self->font = TTF_OpenFontRW(__pyx_t_6, 1, __pyx_t_5); /* "pygame_sdl2/font.pyx":66 * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_self->font == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/font.pyx":67 * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: * raise error() # <<<<<<<<<<<<<< * * def render(self, text, antialias, color, background=None): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 67, __pyx_L1_error) /* "pygame_sdl2/font.pyx":66 * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/font.pyx":62 * TTF_CloseFont(self.font) * * def __init__(self, fi, size): # <<<<<<<<<<<<<< * if fi is None: * fi = get_default_font() */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.font.Font.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fi); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":69 * raise error() * * def render(self, text, antialias, color, background=None): # <<<<<<<<<<<<<< * cdef SDL_Surface *surf * cdef SDL_Color fg */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_7render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_6render, "Font.render(self, text, antialias, color, background=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_7render = {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_7render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_6render}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_7render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_text = 0; PyObject *__pyx_v_antialias = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_background = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,&__pyx_n_s_antialias,&__pyx_n_s_color,&__pyx_n_s_background,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_text)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 69, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_antialias)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, 1); __PYX_ERR(1, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, 2); __PYX_ERR(1, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_background); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 69, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "render") < 0)) __PYX_ERR(1, 69, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_text = values[0]; __pyx_v_antialias = values[1]; __pyx_v_color = values[2]; __pyx_v_background = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, __pyx_nargs); __PYX_ERR(1, 69, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_6render(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_text, __pyx_v_antialias, __pyx_v_color, __pyx_v_background); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_6render(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_antialias, PyObject *__pyx_v_color, PyObject *__pyx_v_background) { SDL_Surface *__pyx_v_surf; SDL_Color __pyx_v_fg; CYTHON_UNUSED PyObject *__pyx_v_w = NULL; PyObject *__pyx_v_h = NULL; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_v_bgsurf = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); char const *__pyx_t_9; char const *__pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 1); /* "pygame_sdl2/font.pyx":73 * cdef SDL_Color fg * * if not text: # <<<<<<<<<<<<<< * w, h = self.size(" ") * return Surface((0, h)) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 73, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":74 * * if not text: * w, h = self.size(" ") # <<<<<<<<<<<<<< * return Surface((0, h)) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s__2}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(1, 74, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(1, 74, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(1, 74, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_w = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_h = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":75 * if not text: * w, h = self.size(" ") * return Surface((0, h)) # <<<<<<<<<<<<<< * * to_sdl_color(color, &fg) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0)) __PYX_ERR(1, 75, __pyx_L1_error); __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_h)) __PYX_ERR(1, 75, __pyx_L1_error); __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":73 * cdef SDL_Color fg * * if not text: # <<<<<<<<<<<<<< * w, h = self.size(" ") * return Surface((0, h)) */ } /* "pygame_sdl2/font.pyx":77 * return Surface((0, h)) * * to_sdl_color(color, &fg) # <<<<<<<<<<<<<< * * TTF_SetFontStyle(self.font, self.style) */ __pyx_t_5 = __pyx_f_11pygame_sdl2_5color_to_sdl_color(__pyx_v_color, (&__pyx_v_fg)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":79 * to_sdl_color(color, &fg) * * TTF_SetFontStyle(self.font, self.style) # <<<<<<<<<<<<<< * if antialias: * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) */ TTF_SetFontStyle(__pyx_v_self->font, __pyx_v_self->style); /* "pygame_sdl2/font.pyx":80 * * TTF_SetFontStyle(self.font, self.style) * if antialias: # <<<<<<<<<<<<<< * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_antialias); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 80, __pyx_L1_error) if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":81 * TTF_SetFontStyle(self.font, self.style) * if antialias: * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) # <<<<<<<<<<<<<< * else: * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_utf_8}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_t_5); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(1, 81, __pyx_L1_error) __pyx_v_surf = TTF_RenderUTF8_Blended(__pyx_v_self->font, __pyx_t_9, __pyx_v_fg); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":80 * * TTF_SetFontStyle(self.font, self.style) * if antialias: # <<<<<<<<<<<<<< * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: */ goto __pyx_L6; } /* "pygame_sdl2/font.pyx":83 * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) # <<<<<<<<<<<<<< * * if surf == NULL: */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_utf_8}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_t_5); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(1, 83, __pyx_L1_error) __pyx_v_surf = TTF_RenderUTF8_Solid(__pyx_v_self->font, __pyx_t_10, __pyx_v_fg); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L6:; /* "pygame_sdl2/font.pyx":85 * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) * * if surf == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_surf == NULL); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/font.pyx":86 * * if surf == NULL: * raise error() # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(1, 86, __pyx_L1_error) /* "pygame_sdl2/font.pyx":85 * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) * * if surf == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/font.pyx":88 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":89 * * cdef Surface rv = Surface(()) * rv.take_surface(surf) # <<<<<<<<<<<<<< * * if rv.surface.format.BitsPerPixel != 32: */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_surf); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error) /* "pygame_sdl2/font.pyx":91 * rv.take_surface(surf) * * if rv.surface.format.BitsPerPixel != 32: # <<<<<<<<<<<<<< * rv = rv.convert() * */ __pyx_t_2 = (__pyx_v_rv->surface->format->BitsPerPixel != 32); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":92 * * if rv.surface.format.BitsPerPixel != 32: * rv = rv.convert() # <<<<<<<<<<<<<< * * if background is not None: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_convert); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(1, 92, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_rv, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_5)); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":91 * rv.take_surface(surf) * * if rv.surface.format.BitsPerPixel != 32: # <<<<<<<<<<<<<< * rv = rv.convert() * */ } /* "pygame_sdl2/font.pyx":94 * rv = rv.convert() * * if background is not None: # <<<<<<<<<<<<<< * bgsurf = rv.copy() * bgsurf.fill(background) */ __pyx_t_2 = (__pyx_v_background != Py_None); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":95 * * if background is not None: * bgsurf = rv.copy() # <<<<<<<<<<<<<< * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_bgsurf = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":96 * if background is not None: * bgsurf = rv.copy() * bgsurf.fill(background) # <<<<<<<<<<<<<< * bgsurf.blit(rv, (0,0)) * return bgsurf */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_bgsurf, __pyx_n_s_fill); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_background}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":97 * bgsurf = rv.copy() * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) # <<<<<<<<<<<<<< * return bgsurf * return rv */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_bgsurf, __pyx_n_s_blit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_rv), __pyx_tuple__4}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":98 * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) * return bgsurf # <<<<<<<<<<<<<< * return rv * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_bgsurf); __pyx_r = __pyx_v_bgsurf; goto __pyx_L0; /* "pygame_sdl2/font.pyx":94 * rv = rv.convert() * * if background is not None: # <<<<<<<<<<<<<< * bgsurf = rv.copy() * bgsurf.fill(background) */ } /* "pygame_sdl2/font.pyx":99 * bgsurf.blit(rv, (0,0)) * return bgsurf * return rv # <<<<<<<<<<<<<< * * def size(self, text): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/font.pyx":69 * raise error() * * def render(self, text, antialias, color, background=None): # <<<<<<<<<<<<<< * cdef SDL_Surface *surf * cdef SDL_Color fg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.font.Font.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_w); __Pyx_XDECREF(__pyx_v_h); __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XDECREF(__pyx_v_bgsurf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":101 * return rv * * def size(self, text): # <<<<<<<<<<<<<< * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_9size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_8size, "Font.size(self, text)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_9size = {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_9size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_8size}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_9size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_text = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("size (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_text)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 101, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "size") < 0)) __PYX_ERR(1, 101, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_text = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("size", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 101, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.size", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_8size(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_text); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_8size(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; char const *__pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("size", 1); /* "pygame_sdl2/font.pyx":103 * def size(self, text): * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * return w, h */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_t_6 = (TTF_SizeUTF8(__pyx_v_self->font, __pyx_t_5, (&__pyx_v_w), (&__pyx_v_h)) != 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_6)) { /* "pygame_sdl2/font.pyx":104 * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: * raise error() # <<<<<<<<<<<<<< * return w, h * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 104, __pyx_L1_error) /* "pygame_sdl2/font.pyx":103 * def size(self, text): * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * return w, h */ } /* "pygame_sdl2/font.pyx":105 * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: * raise error() * return w, h # <<<<<<<<<<<<<< * * cdef set_style(self, flag, on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 105, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":101 * return rv * * def size(self, text): # <<<<<<<<<<<<<< * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.font.Font.size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":107 * return w, h * * cdef set_style(self, flag, on): # <<<<<<<<<<<<<< * if on: * self.style |= flag */ static PyObject *__pyx_f_11pygame_sdl2_4font_4Font_set_style(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_style", 1); /* "pygame_sdl2/font.pyx":108 * * cdef set_style(self, flag, on): * if on: # <<<<<<<<<<<<<< * self.style |= flag * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_on); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 108, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/font.pyx":109 * cdef set_style(self, flag, on): * if on: * self.style |= flag # <<<<<<<<<<<<<< * else: * self.style &= ~flag */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->style); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_InPlaceOr(__pyx_t_2, __pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->style = __pyx_t_4; /* "pygame_sdl2/font.pyx":108 * * cdef set_style(self, flag, on): * if on: # <<<<<<<<<<<<<< * self.style |= flag * else: */ goto __pyx_L3; } /* "pygame_sdl2/font.pyx":111 * self.style |= flag * else: * self.style &= ~flag # <<<<<<<<<<<<<< * * def set_underline(self, on): */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->style); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Invert(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->style = __pyx_t_4; } __pyx_L3:; /* "pygame_sdl2/font.pyx":107 * return w, h * * cdef set_style(self, flag, on): # <<<<<<<<<<<<<< * if on: * self.style |= flag */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_style", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":113 * self.style &= ~flag * * def set_underline(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_UNDERLINE, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_10set_underline, "Font.set_underline(self, on)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_11set_underline = {"set_underline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_10set_underline}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_on = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_underline (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_on,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_on)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 113, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_underline") < 0)) __PYX_ERR(1, 113, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_on = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_underline", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 113, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.set_underline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_10set_underline(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_on); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_10set_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_underline", 1); /* "pygame_sdl2/font.pyx":114 * * def set_underline(self, on): * self.set_style(TTF_STYLE_UNDERLINE, on) # <<<<<<<<<<<<<< * * def get_underline(self): */ __pyx_t_1 = __Pyx_PyInt_From___pyx_anon_enum(TTF_STYLE_UNDERLINE); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":113 * self.style &= ~flag * * def set_underline(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_UNDERLINE, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_underline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":116 * self.set_style(TTF_STYLE_UNDERLINE, on) * * def get_underline(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_UNDERLINE * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_12get_underline, "Font.get_underline(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_13get_underline = {"get_underline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_12get_underline}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_underline (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_underline", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_underline", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_12get_underline(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_12get_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_underline", 1); /* "pygame_sdl2/font.pyx":117 * * def get_underline(self): * return self.style & TTF_STYLE_UNDERLINE # <<<<<<<<<<<<<< * * def set_bold(self, on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_UNDERLINE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":116 * self.set_style(TTF_STYLE_UNDERLINE, on) * * def get_underline(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_UNDERLINE * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_underline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":119 * return self.style & TTF_STYLE_UNDERLINE * * def set_bold(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_BOLD, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_14set_bold, "Font.set_bold(self, on)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_15set_bold = {"set_bold", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_14set_bold}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_on = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_bold (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_on,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_on)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 119, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_bold") < 0)) __PYX_ERR(1, 119, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_on = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_bold", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 119, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.set_bold", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_14set_bold(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_on); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_14set_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_bold", 1); /* "pygame_sdl2/font.pyx":120 * * def set_bold(self, on): * self.set_style(TTF_STYLE_BOLD, on) # <<<<<<<<<<<<<< * * def get_bold(self): */ __pyx_t_1 = __Pyx_PyInt_From___pyx_anon_enum(TTF_STYLE_BOLD); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":119 * return self.style & TTF_STYLE_UNDERLINE * * def set_bold(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_BOLD, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_bold", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":122 * self.set_style(TTF_STYLE_BOLD, on) * * def get_bold(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_BOLD * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_16get_bold, "Font.get_bold(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_17get_bold = {"get_bold", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_16get_bold}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bold (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_bold", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_bold", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_16get_bold(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_16get_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_bold", 1); /* "pygame_sdl2/font.pyx":123 * * def get_bold(self): * return self.style & TTF_STYLE_BOLD # <<<<<<<<<<<<<< * * def set_italic(self, on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_BOLD)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":122 * self.set_style(TTF_STYLE_BOLD, on) * * def get_bold(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_BOLD * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_bold", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":125 * return self.style & TTF_STYLE_BOLD * * def set_italic(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_ITALIC, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_18set_italic, "Font.set_italic(self, on)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_19set_italic = {"set_italic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_18set_italic}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_on = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_italic (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_on,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_on)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 125, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_italic") < 0)) __PYX_ERR(1, 125, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_on = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_italic", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 125, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.set_italic", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_18set_italic(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_on); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_18set_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_italic", 1); /* "pygame_sdl2/font.pyx":126 * * def set_italic(self, on): * self.set_style(TTF_STYLE_ITALIC, on) # <<<<<<<<<<<<<< * * def get_italic(self): */ __pyx_t_1 = __Pyx_PyInt_From___pyx_anon_enum(TTF_STYLE_ITALIC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":125 * return self.style & TTF_STYLE_BOLD * * def set_italic(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_ITALIC, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_italic", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":128 * self.set_style(TTF_STYLE_ITALIC, on) * * def get_italic(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_ITALIC * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_20get_italic, "Font.get_italic(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_21get_italic = {"get_italic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_20get_italic}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_italic (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_italic", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_italic", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_20get_italic(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_20get_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_italic", 1); /* "pygame_sdl2/font.pyx":129 * * def get_italic(self): * return self.style & TTF_STYLE_ITALIC # <<<<<<<<<<<<<< * * def get_linesize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_ITALIC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":128 * self.set_style(TTF_STYLE_ITALIC, on) * * def get_italic(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_ITALIC * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_italic", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":131 * return self.style & TTF_STYLE_ITALIC * * def get_linesize(self): # <<<<<<<<<<<<<< * return TTF_FontLineSkip(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_22get_linesize, "Font.get_linesize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_23get_linesize = {"get_linesize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_22get_linesize}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_linesize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_linesize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_linesize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_22get_linesize(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_22get_linesize(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_linesize", 1); /* "pygame_sdl2/font.pyx":132 * * def get_linesize(self): * return TTF_FontLineSkip(self.font) # <<<<<<<<<<<<<< * * def get_height(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontLineSkip(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":131 * return self.style & TTF_STYLE_ITALIC * * def get_linesize(self): # <<<<<<<<<<<<<< * return TTF_FontLineSkip(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_linesize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":134 * return TTF_FontLineSkip(self.font) * * def get_height(self): # <<<<<<<<<<<<<< * return TTF_FontHeight(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_25get_height(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_24get_height, "Font.get_height(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_25get_height = {"get_height", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_25get_height, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_24get_height}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_25get_height(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_height (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_height", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_height", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_24get_height(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_24get_height(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_height", 1); /* "pygame_sdl2/font.pyx":135 * * def get_height(self): * return TTF_FontHeight(self.font) # <<<<<<<<<<<<<< * * def get_ascent(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontHeight(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":134 * return TTF_FontLineSkip(self.font) * * def get_height(self): # <<<<<<<<<<<<<< * return TTF_FontHeight(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_height", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":137 * return TTF_FontHeight(self.font) * * def get_ascent(self): # <<<<<<<<<<<<<< * return TTF_FontAscent(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_26get_ascent, "Font.get_ascent(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_27get_ascent = {"get_ascent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_26get_ascent}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_ascent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_ascent", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_ascent", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_26get_ascent(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_26get_ascent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_ascent", 1); /* "pygame_sdl2/font.pyx":138 * * def get_ascent(self): * return TTF_FontAscent(self.font) # <<<<<<<<<<<<<< * * def get_descent(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontAscent(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":137 * return TTF_FontHeight(self.font) * * def get_ascent(self): # <<<<<<<<<<<<<< * return TTF_FontAscent(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_ascent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":140 * return TTF_FontAscent(self.font) * * def get_descent(self): # <<<<<<<<<<<<<< * return TTF_FontDescent(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_28get_descent, "Font.get_descent(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_29get_descent = {"get_descent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_28get_descent}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_descent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_descent", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_descent", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_28get_descent(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_28get_descent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_descent", 1); /* "pygame_sdl2/font.pyx":141 * * def get_descent(self): * return TTF_FontDescent(self.font) # <<<<<<<<<<<<<< * * def metrics(self, text not None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontDescent(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":140 * return TTF_FontAscent(self.font) * * def get_descent(self): # <<<<<<<<<<<<<< * return TTF_FontDescent(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_descent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":143 * return TTF_FontDescent(self.font) * * def metrics(self, text not None): # <<<<<<<<<<<<<< * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_31metrics(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_30metrics, "Font.metrics(self, text)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_31metrics = {"metrics", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_31metrics, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_30metrics}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_31metrics(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_text = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metrics (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_text)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 143, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metrics") < 0)) __PYX_ERR(1, 143, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_text = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metrics", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 143, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.metrics", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_text) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "text"); __PYX_ERR(1, 143, __pyx_L1_error) } __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_30metrics(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_text); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_30metrics(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text) { int __pyx_v_minx; int __pyx_v_maxx; int __pyx_v_miny; int __pyx_v_maxy; int __pyx_v_advance; uint16_t __pyx_v_chnum; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_ch = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; long __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metrics", 1); /* "pygame_sdl2/font.pyx":146 * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum * rv = [] # <<<<<<<<<<<<<< * * for ch in text: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":148 * rv = [] * * for ch in text: # <<<<<<<<<<<<<< * chnum = ord(ch) * */ if (likely(PyList_CheckExact(__pyx_v_text)) || PyTuple_CheckExact(__pyx_v_text)) { __pyx_t_1 = __pyx_v_text; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 148, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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(1, 148, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 148, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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(1, 148, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(1, 148, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_ch, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":149 * * for ch in text: * chnum = ord(ch) # <<<<<<<<<<<<<< * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: */ __pyx_t_5 = __Pyx_PyObject_Ord(__pyx_v_ch); if (unlikely(__pyx_t_5 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(1, 149, __pyx_L1_error) __pyx_v_chnum = __pyx_t_5; /* "pygame_sdl2/font.pyx":151 * chnum = ord(ch) * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: # <<<<<<<<<<<<<< * rv.append((minx, maxx, miny, maxy, advance)) * else: */ __pyx_t_6 = (TTF_GlyphMetrics(__pyx_v_self->font, __pyx_v_chnum, (&__pyx_v_minx), (&__pyx_v_maxx), (&__pyx_v_miny), (&__pyx_v_maxy), (&__pyx_v_advance)) == 0); if (__pyx_t_6) { /* "pygame_sdl2/font.pyx":152 * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: * rv.append((minx, maxx, miny, maxy, advance)) # <<<<<<<<<<<<<< * else: * rv.append(None) */ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minx); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_maxx); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_miny); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_maxy); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_advance); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(5); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4)) __PYX_ERR(1, 152, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7)) __PYX_ERR(1, 152, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_8)) __PYX_ERR(1, 152, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_11); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/font.pyx":151 * chnum = ord(ch) * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: # <<<<<<<<<<<<<< * rv.append((minx, maxx, miny, maxy, advance)) * else: */ goto __pyx_L5; } /* "pygame_sdl2/font.pyx":154 * rv.append((minx, maxx, miny, maxy, advance)) * else: * rv.append(None) # <<<<<<<<<<<<<< * * return rv */ /*else*/ { __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_rv, Py_None); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(1, 154, __pyx_L1_error) } __pyx_L5:; /* "pygame_sdl2/font.pyx":148 * rv = [] * * for ch in text: # <<<<<<<<<<<<<< * chnum = ord(ch) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":156 * rv.append(None) * * return rv # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/font.pyx":143 * return TTF_FontDescent(self.font) * * def metrics(self, text not None): # <<<<<<<<<<<<<< * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.font.Font.metrics", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_ch); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_33__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_32__reduce_cython__, "Font.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_33__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_32__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_33__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_32__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.font.Font.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_35__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_34__setstate_cython__, "Font.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_35__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_34__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_35__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_34__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.font.Font.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_4font_Font __pyx_vtable_11pygame_sdl2_4font_Font; static PyObject *__pyx_tp_new_11pygame_sdl2_4font_Font(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_4font_Font *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_4font_Font *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_4font_Font; if (unlikely(__pyx_pw_11pygame_sdl2_4font_4Font_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_4font_Font(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_4font_Font) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_4font_4Font_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_11pygame_sdl2_4font_Font[] = { {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_7render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_6render}, {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_9size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_8size}, {"set_underline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_10set_underline}, {"get_underline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_12get_underline}, {"set_bold", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_14set_bold}, {"get_bold", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_16get_bold}, {"set_italic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_18set_italic}, {"get_italic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_20get_italic}, {"get_linesize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_22get_linesize}, {"get_height", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_25get_height, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_24get_height}, {"get_ascent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_26get_ascent}, {"get_descent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_28get_descent}, {"metrics", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_31metrics, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_30metrics}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_32__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_34__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_4font_Font_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_4font_Font}, {Py_tp_doc, (void *)PyDoc_STR("Font(fi, size)")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_4font_Font}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_4font_4Font_5__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_4font_Font}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_4font_Font_spec = { "pygame_sdl2.font.Font", sizeof(struct __pyx_obj_11pygame_sdl2_4font_Font), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_4font_Font_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_4font_Font = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.font.""Font", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_4font_Font), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_4font_Font, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Font(fi, size)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_4font_Font, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_4font_4Font_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_4font_Font, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, {&__pyx_kp_s_DejaVuSans_ttf, __pyx_k_DejaVuSans_ttf, sizeof(__pyx_k_DejaVuSans_ttf), 0, 0, 1, 0}, {&__pyx_n_s_Font, __pyx_k_Font, sizeof(__pyx_k_Font), 0, 0, 1, 1}, {&__pyx_n_s_Font___reduce_cython, __pyx_k_Font___reduce_cython, sizeof(__pyx_k_Font___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Font___setstate_cython, __pyx_k_Font___setstate_cython, sizeof(__pyx_k_Font___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_ascent, __pyx_k_Font_get_ascent, sizeof(__pyx_k_Font_get_ascent), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_bold, __pyx_k_Font_get_bold, sizeof(__pyx_k_Font_get_bold), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_descent, __pyx_k_Font_get_descent, sizeof(__pyx_k_Font_get_descent), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_height, __pyx_k_Font_get_height, sizeof(__pyx_k_Font_get_height), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_italic, __pyx_k_Font_get_italic, sizeof(__pyx_k_Font_get_italic), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_linesize, __pyx_k_Font_get_linesize, sizeof(__pyx_k_Font_get_linesize), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_underline, __pyx_k_Font_get_underline, sizeof(__pyx_k_Font_get_underline), 0, 0, 1, 1}, {&__pyx_n_s_Font_metrics, __pyx_k_Font_metrics, sizeof(__pyx_k_Font_metrics), 0, 0, 1, 1}, {&__pyx_n_s_Font_render, __pyx_k_Font_render, sizeof(__pyx_k_Font_render), 0, 0, 1, 1}, {&__pyx_n_s_Font_set_bold, __pyx_k_Font_set_bold, sizeof(__pyx_k_Font_set_bold), 0, 0, 1, 1}, {&__pyx_n_s_Font_set_italic, __pyx_k_Font_set_italic, sizeof(__pyx_k_Font_set_italic), 0, 0, 1, 1}, {&__pyx_n_s_Font_set_underline, __pyx_k_Font_set_underline, sizeof(__pyx_k_Font_set_underline), 0, 0, 1, 1}, {&__pyx_n_s_Font_size, __pyx_k_Font_size, sizeof(__pyx_k_Font_size), 0, 0, 1, 1}, {&__pyx_n_s_SysFont, __pyx_k_SysFont, sizeof(__pyx_k_SysFont), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_n_s__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 1, 1}, {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, {&__pyx_n_s_advance, __pyx_k_advance, sizeof(__pyx_k_advance), 0, 0, 1, 1}, {&__pyx_n_s_antialias, __pyx_k_antialias, sizeof(__pyx_k_antialias), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_background, __pyx_k_background, sizeof(__pyx_k_background), 0, 0, 1, 1}, {&__pyx_n_s_bgsurf, __pyx_k_bgsurf, sizeof(__pyx_k_bgsurf), 0, 0, 1, 1}, {&__pyx_n_s_blit, __pyx_k_blit, sizeof(__pyx_k_blit), 0, 0, 1, 1}, {&__pyx_n_s_ch, __pyx_k_ch, sizeof(__pyx_k_ch), 0, 0, 1, 1}, {&__pyx_n_s_chnum, __pyx_k_chnum, sizeof(__pyx_k_chnum), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, {&__pyx_n_s_fg, __pyx_k_fg, sizeof(__pyx_k_fg), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_ascent, __pyx_k_get_ascent, sizeof(__pyx_k_get_ascent), 0, 0, 1, 1}, {&__pyx_n_s_get_bold, __pyx_k_get_bold, sizeof(__pyx_k_get_bold), 0, 0, 1, 1}, {&__pyx_n_s_get_default_font, __pyx_k_get_default_font, sizeof(__pyx_k_get_default_font), 0, 0, 1, 1}, {&__pyx_n_s_get_descent, __pyx_k_get_descent, sizeof(__pyx_k_get_descent), 0, 0, 1, 1}, {&__pyx_n_s_get_fonts, __pyx_k_get_fonts, sizeof(__pyx_k_get_fonts), 0, 0, 1, 1}, {&__pyx_n_s_get_height, __pyx_k_get_height, sizeof(__pyx_k_get_height), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_italic, __pyx_k_get_italic, sizeof(__pyx_k_get_italic), 0, 0, 1, 1}, {&__pyx_n_s_get_linesize, __pyx_k_get_linesize, sizeof(__pyx_k_get_linesize), 0, 0, 1, 1}, {&__pyx_n_s_get_underline, __pyx_k_get_underline, sizeof(__pyx_k_get_underline), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_match_font, __pyx_k_match_font, sizeof(__pyx_k_match_font), 0, 0, 1, 1}, {&__pyx_n_s_maxx, __pyx_k_maxx, sizeof(__pyx_k_maxx), 0, 0, 1, 1}, {&__pyx_n_s_maxy, __pyx_k_maxy, sizeof(__pyx_k_maxy), 0, 0, 1, 1}, {&__pyx_n_s_metrics, __pyx_k_metrics, sizeof(__pyx_k_metrics), 0, 0, 1, 1}, {&__pyx_n_s_minx, __pyx_k_minx, sizeof(__pyx_k_minx), 0, 0, 1, 1}, {&__pyx_n_s_miny, __pyx_k_miny, sizeof(__pyx_k_miny), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_on, __pyx_k_on, sizeof(__pyx_k_on), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_font, __pyx_k_pygame_sdl2_font, sizeof(__pyx_k_pygame_sdl2_font), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_sysfont, __pyx_k_pygame_sdl2_sysfont, sizeof(__pyx_k_pygame_sdl2_sysfont), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_render, __pyx_k_render, sizeof(__pyx_k_render), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_sans, __pyx_k_sans, sizeof(__pyx_k_sans), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_bold, __pyx_k_set_bold, sizeof(__pyx_k_set_bold), 0, 0, 1, 1}, {&__pyx_n_s_set_italic, __pyx_k_set_italic, sizeof(__pyx_k_set_italic), 0, 0, 1, 1}, {&__pyx_n_s_set_underline, __pyx_k_set_underline, sizeof(__pyx_k_set_underline), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_k_src_pygame_sdl2_font_pyx, sizeof(__pyx_k_src_pygame_sdl2_font_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_surf, __pyx_k_surf, sizeof(__pyx_k_surf), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/font.pyx":88 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/font.pyx":97 * bgsurf = rv.copy() * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) # <<<<<<<<<<<<<< * return bgsurf * return rv */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/font.pyx":29 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * TTF_Init() */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_init, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 29, __pyx_L1_error) /* "pygame_sdl2/font.pyx":33 * TTF_Init() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * TTF_Quit() */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_quit, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(1, 33, __pyx_L1_error) /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_init, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 37, __pyx_L1_error) /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_os, __pyx_n_s_default); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_default_font, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 40, __pyx_L1_error) /* "pygame_sdl2/font.pyx":69 * raise error() * * def render(self, text, antialias, color, background=None): # <<<<<<<<<<<<<< * cdef SDL_Surface *surf * cdef SDL_Color fg */ __pyx_tuple__11 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_antialias, __pyx_n_s_color, __pyx_n_s_background, __pyx_n_s_surf, __pyx_n_s_fg, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_rv, __pyx_n_s_bgsurf); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_render, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 69, __pyx_L1_error) __pyx_tuple__13 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "pygame_sdl2/font.pyx":101 * return rv * * def size(self, text): # <<<<<<<<<<<<<< * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: */ __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_w, __pyx_n_s_h); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_size, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 101, __pyx_L1_error) /* "pygame_sdl2/font.pyx":113 * self.style &= ~flag * * def set_underline(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_UNDERLINE, on) * */ __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_on); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_set_underline, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 113, __pyx_L1_error) /* "pygame_sdl2/font.pyx":116 * self.set_style(TTF_STYLE_UNDERLINE, on) * * def get_underline(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_UNDERLINE * */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_underline, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(1, 116, __pyx_L1_error) /* "pygame_sdl2/font.pyx":119 * return self.style & TTF_STYLE_UNDERLINE * * def set_bold(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_BOLD, on) * */ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_set_bold, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 119, __pyx_L1_error) /* "pygame_sdl2/font.pyx":122 * self.set_style(TTF_STYLE_BOLD, on) * * def get_bold(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_BOLD * */ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_bold, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 122, __pyx_L1_error) /* "pygame_sdl2/font.pyx":125 * return self.style & TTF_STYLE_BOLD * * def set_italic(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_ITALIC, on) * */ __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_set_italic, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 125, __pyx_L1_error) /* "pygame_sdl2/font.pyx":128 * self.set_style(TTF_STYLE_ITALIC, on) * * def get_italic(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_ITALIC * */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_italic, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 128, __pyx_L1_error) /* "pygame_sdl2/font.pyx":131 * return self.style & TTF_STYLE_ITALIC * * def get_linesize(self): # <<<<<<<<<<<<<< * return TTF_FontLineSkip(self.font) * */ __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_linesize, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 131, __pyx_L1_error) /* "pygame_sdl2/font.pyx":134 * return TTF_FontLineSkip(self.font) * * def get_height(self): # <<<<<<<<<<<<<< * return TTF_FontHeight(self.font) * */ __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_height, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 134, __pyx_L1_error) /* "pygame_sdl2/font.pyx":137 * return TTF_FontHeight(self.font) * * def get_ascent(self): # <<<<<<<<<<<<<< * return TTF_FontAscent(self.font) * */ __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_ascent, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(1, 137, __pyx_L1_error) /* "pygame_sdl2/font.pyx":140 * return TTF_FontAscent(self.font) * * def get_descent(self): # <<<<<<<<<<<<<< * return TTF_FontDescent(self.font) * */ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_descent, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(1, 140, __pyx_L1_error) /* "pygame_sdl2/font.pyx":143 * return TTF_FontDescent(self.font) * * def metrics(self, text not None): # <<<<<<<<<<<<<< * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum */ __pyx_tuple__28 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_minx, __pyx_n_s_maxx, __pyx_n_s_miny, __pyx_n_s_maxy, __pyx_n_s_advance, __pyx_n_s_chnum, __pyx_n_s_rv, __pyx_n_s_ch); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_metrics, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(1, 143, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_4font_Font = &__pyx_vtable_11pygame_sdl2_4font_Font; __pyx_vtable_11pygame_sdl2_4font_Font.set_style = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_4font_Font *, PyObject *, PyObject *))__pyx_f_11pygame_sdl2_4font_4Font_set_style; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_4font_Font = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_4font_Font_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_4font_Font)) __PYX_ERR(1, 50, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_4font_Font_spec, __pyx_ptype_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_4font_Font = &__pyx_type_11pygame_sdl2_4font_Font; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_4font_Font->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_4font_Font->tp_dictoffset && __pyx_ptype_11pygame_sdl2_4font_Font->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_4font_Font->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_vtabptr_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Font, (PyObject *) __pyx_ptype_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.color"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_5color_Color),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_5color_Color) __PYX_ERR(3, 26, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.color"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_8(__pyx_t_1, "to_sdl_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_to_sdl_color, "PyObject *(PyObject *, SDL_Color *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_8(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_font(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_font}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "font", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initfont(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initfont(void) #else __Pyx_PyMODINIT_FUNC PyInit_font(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_font(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_font(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'font' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("font", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "font" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_font(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__font) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.font")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.font", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "pygame_sdl2/font.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * from pygame_sdl2.sysfont import SysFont, match_font, get_fonts # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * import pygame_sdl2 */ __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_SysFont); __Pyx_GIVEREF(__pyx_n_s_SysFont); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SysFont)) __PYX_ERR(1, 25, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_match_font); __Pyx_GIVEREF(__pyx_n_s_match_font); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_match_font)) __PYX_ERR(1, 25, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_get_fonts); __Pyx_GIVEREF(__pyx_n_s_get_fonts); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_get_fonts)) __PYX_ERR(1, 25, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_sysfont, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_SysFont); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SysFont, __pyx_t_2) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_match_font); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_match_font, __pyx_t_2) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_get_fonts); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_fonts, __pyx_t_2) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":26 * * from pygame_sdl2.sysfont import SysFont, match_font, get_fonts * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error)) __PYX_ERR(1, 26, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":27 * from pygame_sdl2.sysfont import SysFont, match_font, get_fonts * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":29 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * TTF_Init() */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":33 * TTF_Init() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * TTF_Quit() */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_3quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_3) < 0) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_5get_init, 0, __pyx_n_s_get_init, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_3) < 0) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_7get_default_font, 0, __pyx_n_s_get_default_font, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_default_font, __pyx_t_3) < 0) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":69 * raise error() * * def render(self, text, antialias, color, background=None): # <<<<<<<<<<<<<< * cdef SDL_Surface *surf * cdef SDL_Color fg */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_7render, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_render, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_render, __pyx_t_3) < 0) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":101 * return rv * * def size(self, text): # <<<<<<<<<<<<<< * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_9size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_size, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_size, __pyx_t_3) < 0) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":113 * self.style &= ~flag * * def set_underline(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_UNDERLINE, on) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_11set_underline, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_set_underline, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_set_underline, __pyx_t_3) < 0) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":116 * self.set_style(TTF_STYLE_UNDERLINE, on) * * def get_underline(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_UNDERLINE * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_13get_underline, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_underline, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_underline, __pyx_t_3) < 0) __PYX_ERR(1, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":119 * return self.style & TTF_STYLE_UNDERLINE * * def set_bold(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_BOLD, on) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_15set_bold, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_set_bold, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_set_bold, __pyx_t_3) < 0) __PYX_ERR(1, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":122 * self.set_style(TTF_STYLE_BOLD, on) * * def get_bold(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_BOLD * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_17get_bold, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_bold, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_bold, __pyx_t_3) < 0) __PYX_ERR(1, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":125 * return self.style & TTF_STYLE_BOLD * * def set_italic(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_ITALIC, on) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_19set_italic, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_set_italic, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_set_italic, __pyx_t_3) < 0) __PYX_ERR(1, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":128 * self.set_style(TTF_STYLE_ITALIC, on) * * def get_italic(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_ITALIC * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_21get_italic, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_italic, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_italic, __pyx_t_3) < 0) __PYX_ERR(1, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":131 * return self.style & TTF_STYLE_ITALIC * * def get_linesize(self): # <<<<<<<<<<<<<< * return TTF_FontLineSkip(self.font) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_23get_linesize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_linesize, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_linesize, __pyx_t_3) < 0) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":134 * return TTF_FontLineSkip(self.font) * * def get_height(self): # <<<<<<<<<<<<<< * return TTF_FontHeight(self.font) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_25get_height, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_height, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_height, __pyx_t_3) < 0) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":137 * return TTF_FontHeight(self.font) * * def get_ascent(self): # <<<<<<<<<<<<<< * return TTF_FontAscent(self.font) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_27get_ascent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_ascent, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_ascent, __pyx_t_3) < 0) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":140 * return TTF_FontAscent(self.font) * * def get_descent(self): # <<<<<<<<<<<<<< * return TTF_FontDescent(self.font) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_29get_descent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_descent, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_descent, __pyx_t_3) < 0) __PYX_ERR(1, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":143 * return TTF_FontDescent(self.font) * * def metrics(self, text not None): # <<<<<<<<<<<<<< * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_31metrics, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_metrics, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_metrics, __pyx_t_3) < 0) __PYX_ERR(1, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_33__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_35__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.font", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.font"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s_; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* UnicodeAsUCS4 */ static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { Py_ssize_t length; #if CYTHON_PEP393_ENABLED length = PyUnicode_GET_LENGTH(x); if (likely(length == 1)) { return PyUnicode_READ_CHAR(x, 0); } #else length = PyUnicode_GET_SIZE(x); if (likely(length == 1)) { return PyUnicode_AS_UNICODE(x)[0]; } #if Py_UNICODE_SIZE == 2 else if (PyUnicode_GET_SIZE(x) == 2) { Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0]; if (high_val >= 0xD800 && high_val <= 0xDBFF) { Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; if (low_val >= 0xDC00 && low_val <= 0xDFFF) { return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); } } } #endif #endif PyErr_Format(PyExc_ValueError, "only single character unicode strings can be converted to Py_UCS4, " "got length %" CYTHON_FORMAT_SSIZE_T "d", length); return (Py_UCS4)-1; } /* object_ord */ static long __Pyx__PyObject_Ord(PyObject* c) { Py_ssize_t size; if (PyBytes_Check(c)) { size = PyBytes_GET_SIZE(c); if (likely(size == 1)) { return (unsigned char) PyBytes_AS_STRING(c)[0]; } #if PY_MAJOR_VERSION < 3 } else if (PyUnicode_Check(c)) { return (long)__Pyx_PyUnicode_AsPy_UCS4(c); #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) } else if (PyByteArray_Check(c)) { size = PyByteArray_GET_SIZE(c); if (likely(size == 1)) { return (unsigned char) PyByteArray_AS_STRING(c)[0]; } #endif } else { __Pyx_TypeName c_type_name = __Pyx_PyType_GetName(Py_TYPE(c)); PyErr_Format(PyExc_TypeError, "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found", c_type_name); __Pyx_DECREF_TypeName(c_type_name); return (long)(Py_UCS4)-1; } PyErr_Format(PyExc_TypeError, "ord() expected a character, but string of length %zd found", size); return (long)(Py_UCS4)-1; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetVTable */ static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { PyObject *ob = PyCapsule_New(vtable, 0, 0); if (unlikely(!ob)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* MergeVTables */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type) { int i; void** base_vtables; __Pyx_TypeName tp_base_name; __Pyx_TypeName base_name; void* unknown = (void*)-1; PyObject* bases = type->tp_bases; int base_depth = 0; { PyTypeObject* base = type->tp_base; while (base) { base_depth += 1; base = base->tp_base; } } base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); if (base_vtable != NULL) { int j; PyTypeObject* base = type->tp_base; for (j = 0; j < base_depth; j++) { if (base_vtables[j] == unknown) { base_vtables[j] = __Pyx_GetVtable(base); base_vtables[j + 1] = unknown; } if (base_vtables[j] == base_vtable) { break; } else if (base_vtables[j] == NULL) { goto bad; } base = base->tp_base; } } } PyErr_Clear(); free(base_vtables); return 0; bad: tp_base_name = __Pyx_PyType_GetName(type->tp_base); base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); free(base_vtables); return -1; } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_8 #define __PYX_HAVE_RT_ImportType_3_0_8 static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__5); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__33); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_8 #define __PYX_HAVE_RT_ImportFunction_3_0_8 static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709474.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.gfxdraw.c0000664000175000017500000257733414760217142020501 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__gfxdraw #define __PYX_HAVE_API__pygame_sdl2__gfxdraw /* Early includes */ #include #include #include #include #include "SDL.h" #include "SDL2_rotozoom.h" #include "SDL_gfxPrimitives.h" #include #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/gfxdraw.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/color.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_5color_Color; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 #define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_8 { __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_gfx" */ /* Module declarations from "libc.stdlib" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.color" */ /* Module declarations from "pygame_sdl2.gfxdraw" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.gfxdraw" extern int __pyx_module_is_main_pygame_sdl2__gfxdraw; int __pyx_module_is_main_pygame_sdl2__gfxdraw = 0; /* Implementation of "pygame_sdl2.gfxdraw" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_range; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; static const char __pyx_k_c[] = "c"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k_pt[] = "pt"; static const char __pyx_k_rx[] = "rx"; static const char __pyx_k_ry[] = "ry"; static const char __pyx_k_tx[] = "tx"; static const char __pyx_k_ty[] = "ty"; static const char __pyx_k_vx[] = "vx"; static const char __pyx_k_vy[] = "vy"; static const char __pyx_k_x1[] = "x1"; static const char __pyx_k_x2[] = "x2"; static const char __pyx_k_x3[] = "x3"; static const char __pyx_k_y1[] = "y1"; static const char __pyx_k_y2[] = "y2"; static const char __pyx_k_y3[] = "y3"; static const char __pyx_k__43[] = "?"; static const char __pyx_k_arc[] = "arc"; static const char __pyx_k_box[] = "box"; static const char __pyx_k_end[] = "end"; static const char __pyx_k_pie[] = "pie"; static const char __pyx_k_rad[] = "rad"; static const char __pyx_k_zip[] = "zip"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_line[] = "line"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_color[] = "color"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_hline[] = "hline"; static const char __pyx_k_pixel[] = "pixel"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_steps[] = "steps"; static const char __pyx_k_vline[] = "vline"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_x1int[] = "x1int"; static const char __pyx_k_x2int[] = "x2int"; static const char __pyx_k_y1int[] = "y1int"; static const char __pyx_k_y2int[] = "y2int"; static const char __pyx_k_aaline[] = "aaline"; static const char __pyx_k_bezier[] = "bezier"; static const char __pyx_k_circle[] = "circle"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_points[] = "points"; static const char __pyx_k_trigon[] = "trigon"; static const char __pyx_k_ellipse[] = "ellipse"; static const char __pyx_k_polygon[] = "polygon"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_texture[] = "texture"; static const char __pyx_k_aacircle[] = "aacircle"; static const char __pyx_k_aatrigon[] = "aatrigon"; static const char __pyx_k_aaellipse[] = "aaellipse"; static const char __pyx_k_aapolygon[] = "aapolygon"; static const char __pyx_k_rectangle[] = "rectangle"; static const char __pyx_k_filled_pie[] = "filled_pie"; static const char __pyx_k_num_points[] = "num_points"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_thick_line[] = "thick_line"; static const char __pyx_k_rounded_box[] = "rounded_box"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_filled_circle[] = "filled_circle"; static const char __pyx_k_filled_trigon[] = "filled_trigon"; static const char __pyx_k_filled_ellipse[] = "filled_ellipse"; static const char __pyx_k_filled_polygon[] = "filled_polygon"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_textured_polygon[] = "textured_polygon"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_rounded_rectangle[] = "rounded_rectangle"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_gfxdraw[] = "pygame_sdl2.gfxdraw"; static const char __pyx_k_src_pygame_sdl2_gfxdraw_pyx[] = "src/pygame_sdl2/gfxdraw.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_pixel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_2hline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_4vline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y1, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_10box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_14line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_width, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_20circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_22arc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_34pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture, PyObject *__pyx_v_tx, PyObject *__pyx_v_ty); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_steps, PyObject *__pyx_v_color); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color; #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_u_; PyObject *__pyx_n_s_Rect; PyObject *__pyx_n_s__43; PyObject *__pyx_n_s_aacircle; PyObject *__pyx_n_s_aaellipse; PyObject *__pyx_n_s_aaline; PyObject *__pyx_n_s_aapolygon; PyObject *__pyx_n_s_aatrigon; PyObject *__pyx_n_s_arc; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_bezier; PyObject *__pyx_n_s_box; PyObject *__pyx_n_s_c; PyObject *__pyx_n_s_circle; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_color; PyObject *__pyx_n_s_ellipse; PyObject *__pyx_n_s_end; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_filled_circle; PyObject *__pyx_n_s_filled_ellipse; PyObject *__pyx_n_s_filled_pie; PyObject *__pyx_n_s_filled_polygon; PyObject *__pyx_n_s_filled_trigon; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_hline; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_line; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_num_points; PyObject *__pyx_n_s_pie; PyObject *__pyx_n_s_pixel; PyObject *__pyx_n_s_points; PyObject *__pyx_n_s_polygon; PyObject *__pyx_n_s_pt; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_gfxdraw; PyObject *__pyx_n_s_pygame_sdl2_rect; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_rad; PyObject *__pyx_n_s_range; PyObject *__pyx_n_s_rect; PyObject *__pyx_n_s_rectangle; PyObject *__pyx_n_s_rounded_box; PyObject *__pyx_n_s_rounded_rectangle; PyObject *__pyx_n_s_rx; PyObject *__pyx_n_s_ry; PyObject *__pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_steps; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_texture; PyObject *__pyx_n_s_textured_polygon; PyObject *__pyx_n_s_thick_line; PyObject *__pyx_n_s_trigon; PyObject *__pyx_n_s_tx; PyObject *__pyx_n_s_ty; PyObject *__pyx_n_s_vline; PyObject *__pyx_n_s_vx; PyObject *__pyx_n_s_vy; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_width; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_x1; PyObject *__pyx_n_s_x1int; PyObject *__pyx_n_s_x2; PyObject *__pyx_n_s_x2int; PyObject *__pyx_n_s_x3; PyObject *__pyx_n_s_y; PyObject *__pyx_n_s_y1; PyObject *__pyx_n_s_y1int; PyObject *__pyx_n_s_y2; PyObject *__pyx_n_s_y2int; PyObject *__pyx_n_s_y3; PyObject *__pyx_n_s_zip; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__35; PyObject *__pyx_tuple__39; PyObject *__pyx_tuple__41; PyObject *__pyx_codeobj__3; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__24; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__37; PyObject *__pyx_codeobj__38; PyObject *__pyx_codeobj__40; PyObject *__pyx_codeobj__42; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_n_s_Rect); Py_CLEAR(clear_module_state->__pyx_n_s__43); Py_CLEAR(clear_module_state->__pyx_n_s_aacircle); Py_CLEAR(clear_module_state->__pyx_n_s_aaellipse); Py_CLEAR(clear_module_state->__pyx_n_s_aaline); Py_CLEAR(clear_module_state->__pyx_n_s_aapolygon); Py_CLEAR(clear_module_state->__pyx_n_s_aatrigon); Py_CLEAR(clear_module_state->__pyx_n_s_arc); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_bezier); Py_CLEAR(clear_module_state->__pyx_n_s_box); Py_CLEAR(clear_module_state->__pyx_n_s_c); Py_CLEAR(clear_module_state->__pyx_n_s_circle); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_color); Py_CLEAR(clear_module_state->__pyx_n_s_ellipse); Py_CLEAR(clear_module_state->__pyx_n_s_end); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_filled_circle); Py_CLEAR(clear_module_state->__pyx_n_s_filled_ellipse); Py_CLEAR(clear_module_state->__pyx_n_s_filled_pie); Py_CLEAR(clear_module_state->__pyx_n_s_filled_polygon); Py_CLEAR(clear_module_state->__pyx_n_s_filled_trigon); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_hline); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_line); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_num_points); Py_CLEAR(clear_module_state->__pyx_n_s_pie); Py_CLEAR(clear_module_state->__pyx_n_s_pixel); Py_CLEAR(clear_module_state->__pyx_n_s_points); Py_CLEAR(clear_module_state->__pyx_n_s_polygon); Py_CLEAR(clear_module_state->__pyx_n_s_pt); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_gfxdraw); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rect); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_rad); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_s_rect); Py_CLEAR(clear_module_state->__pyx_n_s_rectangle); Py_CLEAR(clear_module_state->__pyx_n_s_rounded_box); Py_CLEAR(clear_module_state->__pyx_n_s_rounded_rectangle); Py_CLEAR(clear_module_state->__pyx_n_s_rx); Py_CLEAR(clear_module_state->__pyx_n_s_ry); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_steps); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_texture); Py_CLEAR(clear_module_state->__pyx_n_s_textured_polygon); Py_CLEAR(clear_module_state->__pyx_n_s_thick_line); Py_CLEAR(clear_module_state->__pyx_n_s_trigon); Py_CLEAR(clear_module_state->__pyx_n_s_tx); Py_CLEAR(clear_module_state->__pyx_n_s_ty); Py_CLEAR(clear_module_state->__pyx_n_s_vline); Py_CLEAR(clear_module_state->__pyx_n_s_vx); Py_CLEAR(clear_module_state->__pyx_n_s_vy); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_x1); Py_CLEAR(clear_module_state->__pyx_n_s_x1int); Py_CLEAR(clear_module_state->__pyx_n_s_x2); Py_CLEAR(clear_module_state->__pyx_n_s_x2int); Py_CLEAR(clear_module_state->__pyx_n_s_x3); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_n_s_y1); Py_CLEAR(clear_module_state->__pyx_n_s_y1int); Py_CLEAR(clear_module_state->__pyx_n_s_y2); Py_CLEAR(clear_module_state->__pyx_n_s_y2int); Py_CLEAR(clear_module_state->__pyx_n_s_y3); Py_CLEAR(clear_module_state->__pyx_n_s_zip); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__35); Py_CLEAR(clear_module_state->__pyx_tuple__39); Py_CLEAR(clear_module_state->__pyx_tuple__41); Py_CLEAR(clear_module_state->__pyx_codeobj__3); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__24); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__37); Py_CLEAR(clear_module_state->__pyx_codeobj__38); Py_CLEAR(clear_module_state->__pyx_codeobj__40); Py_CLEAR(clear_module_state->__pyx_codeobj__42); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_n_s_Rect); Py_VISIT(traverse_module_state->__pyx_n_s__43); Py_VISIT(traverse_module_state->__pyx_n_s_aacircle); Py_VISIT(traverse_module_state->__pyx_n_s_aaellipse); Py_VISIT(traverse_module_state->__pyx_n_s_aaline); Py_VISIT(traverse_module_state->__pyx_n_s_aapolygon); Py_VISIT(traverse_module_state->__pyx_n_s_aatrigon); Py_VISIT(traverse_module_state->__pyx_n_s_arc); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_bezier); Py_VISIT(traverse_module_state->__pyx_n_s_box); Py_VISIT(traverse_module_state->__pyx_n_s_c); Py_VISIT(traverse_module_state->__pyx_n_s_circle); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_color); Py_VISIT(traverse_module_state->__pyx_n_s_ellipse); Py_VISIT(traverse_module_state->__pyx_n_s_end); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_filled_circle); Py_VISIT(traverse_module_state->__pyx_n_s_filled_ellipse); Py_VISIT(traverse_module_state->__pyx_n_s_filled_pie); Py_VISIT(traverse_module_state->__pyx_n_s_filled_polygon); Py_VISIT(traverse_module_state->__pyx_n_s_filled_trigon); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_hline); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_line); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_num_points); Py_VISIT(traverse_module_state->__pyx_n_s_pie); Py_VISIT(traverse_module_state->__pyx_n_s_pixel); Py_VISIT(traverse_module_state->__pyx_n_s_points); Py_VISIT(traverse_module_state->__pyx_n_s_polygon); Py_VISIT(traverse_module_state->__pyx_n_s_pt); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_gfxdraw); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rect); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_rad); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_s_rect); Py_VISIT(traverse_module_state->__pyx_n_s_rectangle); Py_VISIT(traverse_module_state->__pyx_n_s_rounded_box); Py_VISIT(traverse_module_state->__pyx_n_s_rounded_rectangle); Py_VISIT(traverse_module_state->__pyx_n_s_rx); Py_VISIT(traverse_module_state->__pyx_n_s_ry); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_steps); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_texture); Py_VISIT(traverse_module_state->__pyx_n_s_textured_polygon); Py_VISIT(traverse_module_state->__pyx_n_s_thick_line); Py_VISIT(traverse_module_state->__pyx_n_s_trigon); Py_VISIT(traverse_module_state->__pyx_n_s_tx); Py_VISIT(traverse_module_state->__pyx_n_s_ty); Py_VISIT(traverse_module_state->__pyx_n_s_vline); Py_VISIT(traverse_module_state->__pyx_n_s_vx); Py_VISIT(traverse_module_state->__pyx_n_s_vy); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_x1); Py_VISIT(traverse_module_state->__pyx_n_s_x1int); Py_VISIT(traverse_module_state->__pyx_n_s_x2); Py_VISIT(traverse_module_state->__pyx_n_s_x2int); Py_VISIT(traverse_module_state->__pyx_n_s_x3); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_n_s_y1); Py_VISIT(traverse_module_state->__pyx_n_s_y1int); Py_VISIT(traverse_module_state->__pyx_n_s_y2); Py_VISIT(traverse_module_state->__pyx_n_s_y2int); Py_VISIT(traverse_module_state->__pyx_n_s_y3); Py_VISIT(traverse_module_state->__pyx_n_s_zip); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__35); Py_VISIT(traverse_module_state->__pyx_tuple__39); Py_VISIT(traverse_module_state->__pyx_tuple__41); Py_VISIT(traverse_module_state->__pyx_codeobj__3); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__24); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__37); Py_VISIT(traverse_module_state->__pyx_codeobj__38); Py_VISIT(traverse_module_state->__pyx_codeobj__40); Py_VISIT(traverse_module_state->__pyx_codeobj__42); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_5color_Color __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5color_Color #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_n_s_Rect __pyx_mstate_global->__pyx_n_s_Rect #define __pyx_n_s__43 __pyx_mstate_global->__pyx_n_s__43 #define __pyx_n_s_aacircle __pyx_mstate_global->__pyx_n_s_aacircle #define __pyx_n_s_aaellipse __pyx_mstate_global->__pyx_n_s_aaellipse #define __pyx_n_s_aaline __pyx_mstate_global->__pyx_n_s_aaline #define __pyx_n_s_aapolygon __pyx_mstate_global->__pyx_n_s_aapolygon #define __pyx_n_s_aatrigon __pyx_mstate_global->__pyx_n_s_aatrigon #define __pyx_n_s_arc __pyx_mstate_global->__pyx_n_s_arc #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_bezier __pyx_mstate_global->__pyx_n_s_bezier #define __pyx_n_s_box __pyx_mstate_global->__pyx_n_s_box #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c #define __pyx_n_s_circle __pyx_mstate_global->__pyx_n_s_circle #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_color __pyx_mstate_global->__pyx_n_s_color #define __pyx_n_s_ellipse __pyx_mstate_global->__pyx_n_s_ellipse #define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_filled_circle __pyx_mstate_global->__pyx_n_s_filled_circle #define __pyx_n_s_filled_ellipse __pyx_mstate_global->__pyx_n_s_filled_ellipse #define __pyx_n_s_filled_pie __pyx_mstate_global->__pyx_n_s_filled_pie #define __pyx_n_s_filled_polygon __pyx_mstate_global->__pyx_n_s_filled_polygon #define __pyx_n_s_filled_trigon __pyx_mstate_global->__pyx_n_s_filled_trigon #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_hline __pyx_mstate_global->__pyx_n_s_hline #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_line __pyx_mstate_global->__pyx_n_s_line #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_num_points __pyx_mstate_global->__pyx_n_s_num_points #define __pyx_n_s_pie __pyx_mstate_global->__pyx_n_s_pie #define __pyx_n_s_pixel __pyx_mstate_global->__pyx_n_s_pixel #define __pyx_n_s_points __pyx_mstate_global->__pyx_n_s_points #define __pyx_n_s_polygon __pyx_mstate_global->__pyx_n_s_polygon #define __pyx_n_s_pt __pyx_mstate_global->__pyx_n_s_pt #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_gfxdraw __pyx_mstate_global->__pyx_n_s_pygame_sdl2_gfxdraw #define __pyx_n_s_pygame_sdl2_rect __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rect #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_rad __pyx_mstate_global->__pyx_n_s_rad #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_n_s_rect __pyx_mstate_global->__pyx_n_s_rect #define __pyx_n_s_rectangle __pyx_mstate_global->__pyx_n_s_rectangle #define __pyx_n_s_rounded_box __pyx_mstate_global->__pyx_n_s_rounded_box #define __pyx_n_s_rounded_rectangle __pyx_mstate_global->__pyx_n_s_rounded_rectangle #define __pyx_n_s_rx __pyx_mstate_global->__pyx_n_s_rx #define __pyx_n_s_ry __pyx_mstate_global->__pyx_n_s_ry #define __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_steps __pyx_mstate_global->__pyx_n_s_steps #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_texture __pyx_mstate_global->__pyx_n_s_texture #define __pyx_n_s_textured_polygon __pyx_mstate_global->__pyx_n_s_textured_polygon #define __pyx_n_s_thick_line __pyx_mstate_global->__pyx_n_s_thick_line #define __pyx_n_s_trigon __pyx_mstate_global->__pyx_n_s_trigon #define __pyx_n_s_tx __pyx_mstate_global->__pyx_n_s_tx #define __pyx_n_s_ty __pyx_mstate_global->__pyx_n_s_ty #define __pyx_n_s_vline __pyx_mstate_global->__pyx_n_s_vline #define __pyx_n_s_vx __pyx_mstate_global->__pyx_n_s_vx #define __pyx_n_s_vy __pyx_mstate_global->__pyx_n_s_vy #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_x1 __pyx_mstate_global->__pyx_n_s_x1 #define __pyx_n_s_x1int __pyx_mstate_global->__pyx_n_s_x1int #define __pyx_n_s_x2 __pyx_mstate_global->__pyx_n_s_x2 #define __pyx_n_s_x2int __pyx_mstate_global->__pyx_n_s_x2int #define __pyx_n_s_x3 __pyx_mstate_global->__pyx_n_s_x3 #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_n_s_y1 __pyx_mstate_global->__pyx_n_s_y1 #define __pyx_n_s_y1int __pyx_mstate_global->__pyx_n_s_y1int #define __pyx_n_s_y2 __pyx_mstate_global->__pyx_n_s_y2 #define __pyx_n_s_y2int __pyx_mstate_global->__pyx_n_s_y2int #define __pyx_n_s_y3 __pyx_mstate_global->__pyx_n_s_y3 #define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 #define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 #define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 #define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 #define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 /* #### Code section: module_code ### */ /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_pixel, "pixel(Surface surface, x, y, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_1pixel = {"pixel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_pixel}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pixel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 1); __PYX_ERR(0, 29, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 2); __PYX_ERR(0, 29, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 3); __PYX_ERR(0, 29, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pixel") < 0)) __PYX_ERR(0, 29, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_color = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 29, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pixel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 29, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_pixel(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_pixel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pixel", 1); /* "pygame_sdl2/gfxdraw.pyx":30 * * def pixel(Surface surface, x, y, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":31 * def pixel(Surface surface, x, y, color): * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def hline(Surface surface, x1, x2, y, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error) (void)(pixelRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pixel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_3hline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_2hline, "hline(Surface surface, x1, x2, y, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_3hline = {"hline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_3hline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_2hline}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_3hline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hline (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_x2,&__pyx_n_s_y,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 1); __PYX_ERR(0, 33, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 2); __PYX_ERR(0, 33, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 3); __PYX_ERR(0, 33, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 4); __PYX_ERR(0, 33, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hline") < 0)) __PYX_ERR(0, 33, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_x2 = values[2]; __pyx_v_y = values[3]; __pyx_v_color = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 33, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.hline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 33, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_2hline(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_x2, __pyx_v_y, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_2hline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hline", 1); /* "pygame_sdl2/gfxdraw.pyx":34 * * def hline(Surface surface, x1, x2, y, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":35 * def hline(Surface surface, x1, x2, y, color): * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def vline(Surface surface, x, y1, y2, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error) (void)(hlineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.hline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_5vline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_4vline, "vline(Surface surface, x, y1, y2, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_5vline = {"vline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_5vline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_4vline}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_5vline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("vline (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y1,&__pyx_n_s_y2,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 1); __PYX_ERR(0, 37, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 2); __PYX_ERR(0, 37, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 3); __PYX_ERR(0, 37, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 4); __PYX_ERR(0, 37, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "vline") < 0)) __PYX_ERR(0, 37, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y1 = values[2]; __pyx_v_y2 = values[3]; __pyx_v_color = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 37, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.vline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 37, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_4vline(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y1, __pyx_v_y2, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_4vline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y1, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vline", 1); /* "pygame_sdl2/gfxdraw.pyx":38 * * def vline(Surface surface, x, y1, y2, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":39 * def vline(Surface surface, x, y1, y2, color): * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def rectangle(Surface surface, rect, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error) (void)(vlineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.vline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_6rectangle, "rectangle(Surface surface, rect, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_7rectangle = {"rectangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_6rectangle}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rectangle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, 1); __PYX_ERR(0, 41, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, 2); __PYX_ERR(0, 41, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rectangle") < 0)) __PYX_ERR(0, 41, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_color = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 41, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 41, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rectangle", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":42 * * def rectangle(Surface surface, rect, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":43 * def rectangle(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/gfxdraw.pyx":44 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_rect}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":43 * def rectangle(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":45 * if not isinstance(rect, Rect): * rect = Rect(rect) * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def rounded_rectangle(Surface surface, rect, rad, color): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (void)(rectangleRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_8rounded_rectangle, "rounded_rectangle(Surface surface, rect, rad, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_9rounded_rectangle = {"rounded_rectangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_8rounded_rectangle}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_rad = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rounded_rectangle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_rad,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 1); __PYX_ERR(0, 47, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rad)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 2); __PYX_ERR(0, 47, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 3); __PYX_ERR(0, 47, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rounded_rectangle") < 0)) __PYX_ERR(0, 47, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_rad = values[2]; __pyx_v_color = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 47, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_rad, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; Sint16 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rounded_rectangle", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":48 * * def rounded_rectangle(Surface surface, rect, rad, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":49 * def rounded_rectangle(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/gfxdraw.pyx":50 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_rect}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":49 * def rounded_rectangle(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":51 * if not isinstance(rect, Rect): * rect = Rect(rect) * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def box(Surface surface, rect, color): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyInt_As_int16_t(__pyx_v_rad); if (unlikely((__pyx_t_11 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) (void)(roundedRectangleRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_11box(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_10box, "box(Surface surface, rect, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_11box = {"box", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_11box, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_10box}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_11box(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("box (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, 1); __PYX_ERR(0, 53, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, 2); __PYX_ERR(0, 53, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "box") < 0)) __PYX_ERR(0, 53, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_color = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 53, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.box", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 53, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_10box(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_10box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("box", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":54 * * def box(Surface surface, rect, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":55 * def box(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/gfxdraw.pyx":56 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_rect}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":55 * def box(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":57 * if not isinstance(rect, Rect): * rect = Rect(rect) * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def rounded_box(Surface surface, rect, rad, color): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (void)(boxRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.box", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_12rounded_box, "rounded_box(Surface surface, rect, rad, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_13rounded_box = {"rounded_box", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_12rounded_box}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_rad = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rounded_box (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_rad,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 1); __PYX_ERR(0, 59, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rad)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 2); __PYX_ERR(0, 59, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 3); __PYX_ERR(0, 59, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rounded_box") < 0)) __PYX_ERR(0, 59, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_rad = values[2]; __pyx_v_color = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 59, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_box", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 59, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_rad, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; Sint16 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rounded_box", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":60 * * def rounded_box(Surface surface, rect, rad, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":61 * def rounded_box(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/gfxdraw.pyx":62 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_rect}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":61 * def rounded_box(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":63 * if not isinstance(rect, Rect): * rect = Rect(rect) * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def line(Surface surface, x1, y1, x2, y2, color): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyInt_As_int16_t(__pyx_v_rad); if (unlikely((__pyx_t_11 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) (void)(roundedBoxRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_box", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_15line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_14line, "line(Surface surface, x1, y1, x2, y2, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_15line = {"line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_15line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_14line}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_15line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("line (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 1); __PYX_ERR(0, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 2); __PYX_ERR(0, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 3); __PYX_ERR(0, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 4); __PYX_ERR(0, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 5); __PYX_ERR(0, 65, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "line") < 0)) __PYX_ERR(0, 65, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_color = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 65, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_14line(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_14line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("line", 1); /* "pygame_sdl2/gfxdraw.pyx":66 * * def line(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":67 * def line(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aaline(Surface surface, x1, y1, x2, y2, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) (void)(lineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_16aaline, "aaline(Surface surface, x1, y1, x2, y2, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_17aaline = {"aaline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_16aaline}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aaline (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 1); __PYX_ERR(0, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 2); __PYX_ERR(0, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 3); __PYX_ERR(0, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 4); __PYX_ERR(0, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 5); __PYX_ERR(0, 69, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aaline") < 0)) __PYX_ERR(0, 69, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_color = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 69, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 69, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aaline", 1); /* "pygame_sdl2/gfxdraw.pyx":70 * * def aaline(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":71 * def aaline(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) (void)(aalineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_18thick_line, "thick_line(Surface surface, x1, y1, x2, y2, width, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_19thick_line = {"thick_line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_18thick_line}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_width = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[7] = {0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("thick_line (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_width,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 1); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 2); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 3); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 4); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 5); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 6); __PYX_ERR(0, 73, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "thick_line") < 0)) __PYX_ERR(0, 73, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 7)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_width = values[5]; __pyx_v_color = values[6]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 73, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.thick_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_width, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_width, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; int __pyx_v_x1int; int __pyx_v_y1int; int __pyx_v_x2int; int __pyx_v_y2int; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; Uint8 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("thick_line", 1); /* "pygame_sdl2/gfxdraw.pyx":74 * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * * # This locks up in c code when trying to draw a zero-length line. So make */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":79 * # sure that doesn't happen. * cdef int x1int, y1int, x2int, y2int * x1int = x1 # <<<<<<<<<<<<<< * y1int = y1 * x2int = x2 */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error) __pyx_v_x1int = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":80 * cdef int x1int, y1int, x2int, y2int * x1int = x1 * y1int = y1 # <<<<<<<<<<<<<< * x2int = x2 * y2int = y2 */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_y1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error) __pyx_v_y1int = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":81 * x1int = x1 * y1int = y1 * x2int = x2 # <<<<<<<<<<<<<< * y2int = y2 * */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x2); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error) __pyx_v_x2int = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":82 * y1int = y1 * x2int = x2 * y2int = y2 # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_y2); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_v_y2int = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":85 * * * if x1int == x2int and y1int == y2int: # <<<<<<<<<<<<<< * return * */ __pyx_t_4 = (__pyx_v_x1int == __pyx_v_x2int); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__pyx_v_y1int == __pyx_v_y2int); __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/gfxdraw.pyx":86 * * if x1int == x2int and y1int == y2int: * return # <<<<<<<<<<<<<< * * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/gfxdraw.pyx":85 * * * if x1int == x2int and y1int == y2int: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/gfxdraw.pyx":88 * return * * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def circle(Surface surface, x, y, r, color): */ __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_width); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) (void)(thickLineRGBA(__pyx_v_surface->surface, __pyx_v_x1int, __pyx_v_y1int, __pyx_v_x2int, __pyx_v_y2int, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.thick_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_21circle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_20circle, "circle(Surface surface, x, y, r, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_21circle = {"circle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_21circle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_20circle}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_21circle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("circle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 1); __PYX_ERR(0, 90, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 2); __PYX_ERR(0, 90, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 3); __PYX_ERR(0, 90, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 4); __PYX_ERR(0, 90, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "circle") < 0)) __PYX_ERR(0, 90, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_color = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 90, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 90, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_20circle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_20circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("circle", 1); /* "pygame_sdl2/gfxdraw.pyx":91 * * def circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":92 * def circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def arc(Surface surface, x, y, r, start, end, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) (void)(circleRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_23arc(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_22arc, "arc(Surface surface, x, y, r, start, end, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_23arc = {"arc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_23arc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_22arc}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_23arc(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[7] = {0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("arc (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 1); __PYX_ERR(0, 94, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 2); __PYX_ERR(0, 94, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 3); __PYX_ERR(0, 94, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 4); __PYX_ERR(0, 94, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 5); __PYX_ERR(0, 94, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 6); __PYX_ERR(0, 94, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "arc") < 0)) __PYX_ERR(0, 94, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 7)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_start = values[4]; __pyx_v_end = values[5]; __pyx_v_color = values[6]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 94, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 94, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_22arc(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_22arc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arc", 1); /* "pygame_sdl2/gfxdraw.pyx":95 * * def arc(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":96 * def arc(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aacircle(Surface surface, x, y, r, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) (void)(arcRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_24aacircle, "aacircle(Surface surface, x, y, r, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_25aacircle = {"aacircle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_24aacircle}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aacircle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 1); __PYX_ERR(0, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 2); __PYX_ERR(0, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 3); __PYX_ERR(0, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 4); __PYX_ERR(0, 98, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aacircle") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_color = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aacircle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aacircle", 1); /* "pygame_sdl2/gfxdraw.pyx":99 * * def aacircle(Surface surface, x, y, r, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":100 * def aacircle(Surface surface, x, y, r, color): * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_circle(Surface surface, x, y, r, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) (void)(aacircleRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aacircle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_26filled_circle, "filled_circle(Surface surface, x, y, r, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_27filled_circle = {"filled_circle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_26filled_circle}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_circle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 1); __PYX_ERR(0, 102, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 2); __PYX_ERR(0, 102, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 3); __PYX_ERR(0, 102, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 4); __PYX_ERR(0, 102, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filled_circle") < 0)) __PYX_ERR(0, 102, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_color = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 102, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_circle", 1); /* "pygame_sdl2/gfxdraw.pyx":103 * * def filled_circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":104 * def filled_circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def ellipse(Surface surface, x, y, rx, ry, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) (void)(filledCircleRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_28ellipse, "ellipse(Surface surface, x, y, rx, ry, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_29ellipse = {"ellipse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_28ellipse}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_rx = 0; PyObject *__pyx_v_ry = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ellipse (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 1); __PYX_ERR(0, 106, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 2); __PYX_ERR(0, 106, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 3); __PYX_ERR(0, 106, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ry)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 4); __PYX_ERR(0, 106, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 5); __PYX_ERR(0, 106, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ellipse") < 0)) __PYX_ERR(0, 106, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_rx = values[3]; __pyx_v_ry = values[4]; __pyx_v_color = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 106, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 106, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ellipse", 1); /* "pygame_sdl2/gfxdraw.pyx":107 * * def ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":108 * def ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aaellipse(Surface surface, x, y, rx, ry, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error) (void)(ellipseRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_30aaellipse, "aaellipse(Surface surface, x, y, rx, ry, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_31aaellipse = {"aaellipse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_30aaellipse}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_rx = 0; PyObject *__pyx_v_ry = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aaellipse (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 1); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 2); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 3); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ry)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 4); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 5); __PYX_ERR(0, 110, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aaellipse") < 0)) __PYX_ERR(0, 110, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_rx = values[3]; __pyx_v_ry = values[4]; __pyx_v_color = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 110, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 110, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aaellipse", 1); /* "pygame_sdl2/gfxdraw.pyx":111 * * def aaellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":112 * def aaellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_ellipse(Surface surface, x, y, rx, ry, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) (void)(aaellipseRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_32filled_ellipse, "filled_ellipse(Surface surface, x, y, rx, ry, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_33filled_ellipse = {"filled_ellipse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_32filled_ellipse}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_rx = 0; PyObject *__pyx_v_ry = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_ellipse (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 1); __PYX_ERR(0, 114, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 2); __PYX_ERR(0, 114, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 3); __PYX_ERR(0, 114, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ry)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 4); __PYX_ERR(0, 114, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 5); __PYX_ERR(0, 114, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filled_ellipse") < 0)) __PYX_ERR(0, 114, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_rx = values[3]; __pyx_v_ry = values[4]; __pyx_v_color = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 114, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 114, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_ellipse", 1); /* "pygame_sdl2/gfxdraw.pyx":115 * * def filled_ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":116 * def filled_ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def pie(Surface surface, x, y, r, start, end, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) (void)(filledEllipseRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_35pie(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_34pie, "pie(Surface surface, x, y, r, start, end, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_35pie = {"pie", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_35pie, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_34pie}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_35pie(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[7] = {0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pie (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 1); __PYX_ERR(0, 118, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 2); __PYX_ERR(0, 118, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 3); __PYX_ERR(0, 118, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 4); __PYX_ERR(0, 118, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 5); __PYX_ERR(0, 118, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 6); __PYX_ERR(0, 118, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pie") < 0)) __PYX_ERR(0, 118, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 7)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_start = values[4]; __pyx_v_end = values[5]; __pyx_v_color = values[6]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 118, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 118, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_34pie(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_34pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pie", 1); /* "pygame_sdl2/gfxdraw.pyx":119 * * def pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":120 * def pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_pie(Surface surface, x, y, r, start, end, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) (void)(pieRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_36filled_pie, "filled_pie(Surface surface, x, y, r, start, end, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_37filled_pie = {"filled_pie", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_36filled_pie}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[7] = {0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_pie (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 1); __PYX_ERR(0, 122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 2); __PYX_ERR(0, 122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 3); __PYX_ERR(0, 122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 4); __PYX_ERR(0, 122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 5); __PYX_ERR(0, 122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 6); __PYX_ERR(0, 122, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filled_pie") < 0)) __PYX_ERR(0, 122, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 7)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_start = values[4]; __pyx_v_end = values[5]; __pyx_v_color = values[6]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 122, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 122, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_pie", 1); /* "pygame_sdl2/gfxdraw.pyx":123 * * def filled_pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":124 * def filled_pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error) (void)(filledPieRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_38trigon, "trigon(Surface surface, x1, y1, x2, y2, x3, y3, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_39trigon = {"trigon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_38trigon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_x3 = 0; PyObject *__pyx_v_y3 = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[8] = {0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trigon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 1); __PYX_ERR(0, 126, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 2); __PYX_ERR(0, 126, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 3); __PYX_ERR(0, 126, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 4); __PYX_ERR(0, 126, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 5); __PYX_ERR(0, 126, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 6); __PYX_ERR(0, 126, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 7); __PYX_ERR(0, 126, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "trigon") < 0)) __PYX_ERR(0, 126, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 8)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_x3 = values[5]; __pyx_v_y3 = values[6]; __pyx_v_color = values[7]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 126, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 126, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("trigon", 1); /* "pygame_sdl2/gfxdraw.pyx":127 * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":128 * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) (void)(trigonRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_40aatrigon, "aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_41aatrigon = {"aatrigon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_40aatrigon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_x3 = 0; PyObject *__pyx_v_y3 = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[8] = {0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aatrigon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 1); __PYX_ERR(0, 130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 2); __PYX_ERR(0, 130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 3); __PYX_ERR(0, 130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 4); __PYX_ERR(0, 130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 5); __PYX_ERR(0, 130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 6); __PYX_ERR(0, 130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 7); __PYX_ERR(0, 130, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aatrigon") < 0)) __PYX_ERR(0, 130, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 8)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_x3 = values[5]; __pyx_v_y3 = values[6]; __pyx_v_color = values[7]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 130, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aatrigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 130, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aatrigon", 1); /* "pygame_sdl2/gfxdraw.pyx":131 * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":132 * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) (void)(aatrigonRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aatrigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_42filled_trigon, "filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_43filled_trigon = {"filled_trigon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_42filled_trigon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_x3 = 0; PyObject *__pyx_v_y3 = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[8] = {0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_trigon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 1); __PYX_ERR(0, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 2); __PYX_ERR(0, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 3); __PYX_ERR(0, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 4); __PYX_ERR(0, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 5); __PYX_ERR(0, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 6); __PYX_ERR(0, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 7); __PYX_ERR(0, 134, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filled_trigon") < 0)) __PYX_ERR(0, 134, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 8)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_x3 = values[5]; __pyx_v_y3 = values[6]; __pyx_v_color = values[7]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 134, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 134, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_trigon", 1); /* "pygame_sdl2/gfxdraw.pyx":135 * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":136 * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def polygon(Surface surface, points, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) (void)(filledTrigonRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_44polygon, "polygon(Surface surface, points, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_45polygon = {"polygon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_44polygon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("polygon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, 1); __PYX_ERR(0, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, 2); __PYX_ERR(0, 138, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "polygon") < 0)) __PYX_ERR(0, 138, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_color = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 138, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 138, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("polygon", 1); /* "pygame_sdl2/gfxdraw.pyx":139 * * def polygon(Surface surface, points, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":142 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 142, __pyx_L1_error) __pyx_v_num_points = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":143 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":144 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":145 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points)) __PYX_ERR(0, 145, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_4 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 145, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 145, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 145, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 145, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 145, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 145, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 145, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 145, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":146 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 146, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 146, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 146, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":145 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":147 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ (void)(polygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":148 * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":149 * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def aapolygon(Surface surface, points, color): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_46aapolygon, "aapolygon(Surface surface, points, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_47aapolygon = {"aapolygon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_46aapolygon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aapolygon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, 1); __PYX_ERR(0, 151, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, 2); __PYX_ERR(0, 151, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aapolygon") < 0)) __PYX_ERR(0, 151, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_color = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 151, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aapolygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 151, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aapolygon", 1); /* "pygame_sdl2/gfxdraw.pyx":152 * * def aapolygon(Surface surface, points, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":155 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 155, __pyx_L1_error) __pyx_v_num_points = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":156 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":157 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":158 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points)) __PYX_ERR(0, 158, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_4 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 158, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 158, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 158, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 158, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 158, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 158, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 158, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 158, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":159 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 159, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 159, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":158 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":160 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ (void)(aapolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":161 * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":162 * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def filled_polygon(Surface surface, points, color): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aapolygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_48filled_polygon, "filled_polygon(Surface surface, points, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_49filled_polygon = {"filled_polygon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_48filled_polygon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_polygon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, 1); __PYX_ERR(0, 164, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, 2); __PYX_ERR(0, 164, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filled_polygon") < 0)) __PYX_ERR(0, 164, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_color = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 164, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 164, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_polygon", 1); /* "pygame_sdl2/gfxdraw.pyx":165 * * def filled_polygon(Surface surface, points, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":168 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 168, __pyx_L1_error) __pyx_v_num_points = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":169 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":170 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":171 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points)) __PYX_ERR(0, 171, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_4 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 171, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 171, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 171, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 171, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 171, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 171, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 171, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 171, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":172 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 172, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 172, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 172, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":171 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":173 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ (void)(filledPolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":174 * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":175 * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_50textured_polygon, "textured_polygon(Surface surface, points, Surface texture, tx, ty)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_51textured_polygon = {"textured_polygon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_50textured_polygon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture = 0; PyObject *__pyx_v_tx = 0; PyObject *__pyx_v_ty = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("textured_polygon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_texture,&__pyx_n_s_tx,&__pyx_n_s_ty,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 1); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_texture)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 2); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 3); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ty)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 4); __PYX_ERR(0, 177, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "textured_polygon") < 0)) __PYX_ERR(0, 177, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_texture = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[2]); __pyx_v_tx = values[3]; __pyx_v_ty = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 177, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.textured_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 177, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_texture), __pyx_ptype_11pygame_sdl2_7surface_Surface, 0, "texture", 0))) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_texture, __pyx_v_tx, __pyx_v_ty); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture, PyObject *__pyx_v_tx, PyObject *__pyx_v_ty) { Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("textured_polygon", 1); /* "pygame_sdl2/gfxdraw.pyx":180 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_1 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 180, __pyx_L1_error) __pyx_v_num_points = __pyx_t_1; /* "pygame_sdl2/gfxdraw.pyx":181 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":182 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":183 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) */ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_points)) __PYX_ERR(0, 183, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_4 = NULL; } else { __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 183, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 183, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 183, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 183, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 183, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 183, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 183, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 183, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":184 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) * free(vx) */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 184, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 184, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 184, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":183 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":185 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_tx); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error) __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_ty); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error) (void)(texturedPolygon(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_texture->surface, __pyx_t_12, __pyx_t_13)); /* "pygame_sdl2/gfxdraw.pyx":186 * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":187 * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def bezier(Surface surface, points, steps, color): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.textured_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_52bezier, "bezier(Surface surface, points, steps, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_53bezier = {"bezier", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_52bezier}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_steps = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bezier (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_steps,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 1); __PYX_ERR(0, 189, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_steps)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 2); __PYX_ERR(0, 189, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 3); __PYX_ERR(0, 189, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "bezier") < 0)) __PYX_ERR(0, 189, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_steps = values[2]; __pyx_v_color = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 189, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.bezier", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 189, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_steps, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_steps, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bezier", 1); /* "pygame_sdl2/gfxdraw.pyx":190 * * def bezier(Surface surface, points, steps, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":193 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 193, __pyx_L1_error) __pyx_v_num_points = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":194 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":195 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":196 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) */ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points)) __PYX_ERR(0, 196, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_4 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 196, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 196, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 196, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 196, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 196, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 196, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 196, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 196, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":197 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 197, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 197, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error) (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error) (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":196 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":198 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_steps); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L1_error) (void)(bezierRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_t_12, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":199 * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":200 * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.bezier", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 0, 1, 1}, {&__pyx_n_s_aacircle, __pyx_k_aacircle, sizeof(__pyx_k_aacircle), 0, 0, 1, 1}, {&__pyx_n_s_aaellipse, __pyx_k_aaellipse, sizeof(__pyx_k_aaellipse), 0, 0, 1, 1}, {&__pyx_n_s_aaline, __pyx_k_aaline, sizeof(__pyx_k_aaline), 0, 0, 1, 1}, {&__pyx_n_s_aapolygon, __pyx_k_aapolygon, sizeof(__pyx_k_aapolygon), 0, 0, 1, 1}, {&__pyx_n_s_aatrigon, __pyx_k_aatrigon, sizeof(__pyx_k_aatrigon), 0, 0, 1, 1}, {&__pyx_n_s_arc, __pyx_k_arc, sizeof(__pyx_k_arc), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_bezier, __pyx_k_bezier, sizeof(__pyx_k_bezier), 0, 0, 1, 1}, {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_ellipse, __pyx_k_ellipse, sizeof(__pyx_k_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_filled_circle, __pyx_k_filled_circle, sizeof(__pyx_k_filled_circle), 0, 0, 1, 1}, {&__pyx_n_s_filled_ellipse, __pyx_k_filled_ellipse, sizeof(__pyx_k_filled_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_filled_pie, __pyx_k_filled_pie, sizeof(__pyx_k_filled_pie), 0, 0, 1, 1}, {&__pyx_n_s_filled_polygon, __pyx_k_filled_polygon, sizeof(__pyx_k_filled_polygon), 0, 0, 1, 1}, {&__pyx_n_s_filled_trigon, __pyx_k_filled_trigon, sizeof(__pyx_k_filled_trigon), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_hline, __pyx_k_hline, sizeof(__pyx_k_hline), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_num_points, __pyx_k_num_points, sizeof(__pyx_k_num_points), 0, 0, 1, 1}, {&__pyx_n_s_pie, __pyx_k_pie, sizeof(__pyx_k_pie), 0, 0, 1, 1}, {&__pyx_n_s_pixel, __pyx_k_pixel, sizeof(__pyx_k_pixel), 0, 0, 1, 1}, {&__pyx_n_s_points, __pyx_k_points, sizeof(__pyx_k_points), 0, 0, 1, 1}, {&__pyx_n_s_polygon, __pyx_k_polygon, sizeof(__pyx_k_polygon), 0, 0, 1, 1}, {&__pyx_n_s_pt, __pyx_k_pt, sizeof(__pyx_k_pt), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_gfxdraw, __pyx_k_pygame_sdl2_gfxdraw, sizeof(__pyx_k_pygame_sdl2_gfxdraw), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_rad, __pyx_k_rad, sizeof(__pyx_k_rad), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_rectangle, __pyx_k_rectangle, sizeof(__pyx_k_rectangle), 0, 0, 1, 1}, {&__pyx_n_s_rounded_box, __pyx_k_rounded_box, sizeof(__pyx_k_rounded_box), 0, 0, 1, 1}, {&__pyx_n_s_rounded_rectangle, __pyx_k_rounded_rectangle, sizeof(__pyx_k_rounded_rectangle), 0, 0, 1, 1}, {&__pyx_n_s_rx, __pyx_k_rx, sizeof(__pyx_k_rx), 0, 0, 1, 1}, {&__pyx_n_s_ry, __pyx_k_ry, sizeof(__pyx_k_ry), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_k_src_pygame_sdl2_gfxdraw_pyx, sizeof(__pyx_k_src_pygame_sdl2_gfxdraw_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_steps, __pyx_k_steps, sizeof(__pyx_k_steps), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_texture, __pyx_k_texture, sizeof(__pyx_k_texture), 0, 0, 1, 1}, {&__pyx_n_s_textured_polygon, __pyx_k_textured_polygon, sizeof(__pyx_k_textured_polygon), 0, 0, 1, 1}, {&__pyx_n_s_thick_line, __pyx_k_thick_line, sizeof(__pyx_k_thick_line), 0, 0, 1, 1}, {&__pyx_n_s_trigon, __pyx_k_trigon, sizeof(__pyx_k_trigon), 0, 0, 1, 1}, {&__pyx_n_s_tx, __pyx_k_tx, sizeof(__pyx_k_tx), 0, 0, 1, 1}, {&__pyx_n_s_ty, __pyx_k_ty, sizeof(__pyx_k_ty), 0, 0, 1, 1}, {&__pyx_n_s_vline, __pyx_k_vline, sizeof(__pyx_k_vline), 0, 0, 1, 1}, {&__pyx_n_s_vx, __pyx_k_vx, sizeof(__pyx_k_vx), 0, 0, 1, 1}, {&__pyx_n_s_vy, __pyx_k_vy, sizeof(__pyx_k_vy), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, {&__pyx_n_s_x1int, __pyx_k_x1int, sizeof(__pyx_k_x1int), 0, 0, 1, 1}, {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, {&__pyx_n_s_x2int, __pyx_k_x2int, sizeof(__pyx_k_x2int), 0, 0, 1, 1}, {&__pyx_n_s_x3, __pyx_k_x3, sizeof(__pyx_k_x3), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, {&__pyx_n_s_y1int, __pyx_k_y1int, sizeof(__pyx_k_y1int), 0, 0, 1, 1}, {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, {&__pyx_n_s_y2int, __pyx_k_y2int, sizeof(__pyx_k_y2int), 0, 0, 1, 1}, {&__pyx_n_s_y3, __pyx_k_y3, sizeof(__pyx_k_y3), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 145, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 145, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ __pyx_tuple__2 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_pixel, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 29, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ __pyx_tuple__4 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_x2, __pyx_n_s_y, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_hline, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 33, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ __pyx_tuple__6 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y1, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_vline, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 37, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_tuple__8 = PyTuple_Pack(4, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rectangle, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 41, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_tuple__10 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_rad, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rounded_rectangle, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 47, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_box, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 53, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rounded_box, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 59, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_tuple__14 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_line, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 65, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aaline, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 69, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ __pyx_tuple__17 = PyTuple_Pack(12, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_width, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_x1int, __pyx_n_s_y1int, __pyx_n_s_x2int, __pyx_n_s_y2int); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_thick_line, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 73, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_tuple__19 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_circle, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 90, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_tuple__21 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_arc, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 94, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aacircle, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 98, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_circle, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 102, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_tuple__25 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_ellipse, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 106, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aaellipse, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 110, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_ellipse, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 114, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_pie, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 118, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_pie, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 122, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_tuple__31 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_trigon, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 126, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aatrigon, 130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 130, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_trigon, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 134, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_tuple__35 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_polygon, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 138, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aapolygon, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 151, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_polygon, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 164, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_tuple__39 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_texture, __pyx_n_s_tx, __pyx_n_s_ty, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_textured_polygon, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 177, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_tuple__41 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_steps, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_bezier, 189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(1, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.color"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_5color_Color),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_5color_Color) __PYX_ERR(2, 26, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_gfxdraw(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_gfxdraw}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "gfxdraw", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initgfxdraw(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initgfxdraw(void) #else __Pyx_PyMODINIT_FUNC PyInit_gfxdraw(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_gfxdraw(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_gfxdraw(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'gfxdraw' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("gfxdraw", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "gfxdraw" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_gfxdraw(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__gfxdraw) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.gfxdraw")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.gfxdraw", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/gfxdraw.pyx":25 * from pygame_sdl2.color cimport Color * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.rect import Rect * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 25, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/gfxdraw.pyx":26 * * from pygame_sdl2.error import error * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Rect)) __PYX_ERR(0, 26, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_1pixel, 0, __pyx_n_s_pixel, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixel, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_3hline, 0, __pyx_n_s_hline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hline, __pyx_t_2) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_5vline, 0, __pyx_n_s_vline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_vline, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_7rectangle, 0, __pyx_n_s_rectangle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rectangle, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_9rounded_rectangle, 0, __pyx_n_s_rounded_rectangle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rounded_rectangle, __pyx_t_2) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_11box, 0, __pyx_n_s_box, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_box, __pyx_t_2) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_13rounded_box, 0, __pyx_n_s_rounded_box, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rounded_box, __pyx_t_2) < 0) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_15line, 0, __pyx_n_s_line, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_line, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_17aaline, 0, __pyx_n_s_aaline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaline, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_19thick_line, 0, __pyx_n_s_thick_line, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_thick_line, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_21circle, 0, __pyx_n_s_circle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_circle, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_23arc, 0, __pyx_n_s_arc, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_arc, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_25aacircle, 0, __pyx_n_s_aacircle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aacircle, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_27filled_circle, 0, __pyx_n_s_filled_circle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_circle, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_29ellipse, 0, __pyx_n_s_ellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ellipse, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_31aaellipse, 0, __pyx_n_s_aaellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaellipse, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_33filled_ellipse, 0, __pyx_n_s_filled_ellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_ellipse, __pyx_t_2) < 0) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_35pie, 0, __pyx_n_s_pie, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pie, __pyx_t_2) < 0) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_37filled_pie, 0, __pyx_n_s_filled_pie, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_pie, __pyx_t_2) < 0) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_39trigon, 0, __pyx_n_s_trigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_trigon, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_41aatrigon, 0, __pyx_n_s_aatrigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aatrigon, __pyx_t_2) < 0) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_43filled_trigon, 0, __pyx_n_s_filled_trigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_trigon, __pyx_t_2) < 0) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_45polygon, 0, __pyx_n_s_polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_polygon, __pyx_t_2) < 0) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_47aapolygon, 0, __pyx_n_s_aapolygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aapolygon, __pyx_t_2) < 0) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_49filled_polygon, 0, __pyx_n_s_filled_polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_polygon, __pyx_t_2) < 0) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_51textured_polygon, 0, __pyx_n_s_textured_polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_textured_polygon, __pyx_t_2) < 0) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_53bezier, 0, __pyx_n_s_bezier, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bezier, __pyx_t_2) < 0) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.gfxdraw", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.gfxdraw"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_8 #define __PYX_HAVE_RT_ImportType_3_0_8 static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int16_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int16_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int16_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) >= 2 * PyLong_SHIFT)) { return (int16_t) (((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; case 3: if ((8 * sizeof(int16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) >= 3 * PyLong_SHIFT)) { return (int16_t) (((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; case 4: if ((8 * sizeof(int16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) >= 4 * PyLong_SHIFT)) { return (int16_t) (((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int16_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int16_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int16_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int16_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT)) { return (int16_t) (((int16_t)-1)*(((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 2: if ((8 * sizeof(int16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT)) { return (int16_t) ((((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case -3: if ((8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT)) { return (int16_t) (((int16_t)-1)*(((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 3: if ((8 * sizeof(int16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT)) { return (int16_t) ((((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case -4: if ((8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT)) { return (int16_t) (((int16_t)-1)*(((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 4: if ((8 * sizeof(int16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT)) { return (int16_t) ((((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; } } #endif if ((sizeof(int16_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int16_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int16_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int16_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int16_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int16_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int16_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (int16_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int16_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int16_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int16_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int16_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int16_t) 1) << (sizeof(int16_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int16_t) -1; } } else { int16_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int16_t) -1; val = __Pyx_PyInt_As_int16_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int16_t"); return (int16_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int16_t"); return (int16_t) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint8_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT)) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT)) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT)) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint8_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } } #endif if ((sizeof(uint8_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint8_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint8_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint8_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint8_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint8_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint8_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint8_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint8_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint8_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint8_t) 1) << (sizeof(uint8_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint8_t) -1; } } else { uint8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__43); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709474.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.image.c0000664000175000017500000144352714760217142020114 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__image #define __PYX_HAVE_API__pygame_sdl2__image /* Early includes */ #include #include #include #include #include "SDL.h" #include "sdl_image_compat.h" #include "write_jpeg.h" #include "write_png.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/image.pyx", "src/pygame_sdl2/surface.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 #define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_8 { __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_IMG_InitFlags(IMG_InitFlags value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_image" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.image" */ static int __pyx_v_11pygame_sdl2_5image_image_formats; static PyObject *__pyx_f_11pygame_sdl2_5image_process_namehint(PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.image" extern int __pyx_module_is_main_pygame_sdl2__image; int __pyx_module_is_main_pygame_sdl2__image = 0; /* Implementation of "pygame_sdl2.image" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_ValueError; /* #### Code section: string_decls ### */ static const char __pyx_k_n[] = "n"; static const char __pyx_k__2[] = ""; static const char __pyx_k__3[] = "."; static const char __pyx_k__6[] = "*"; static const char __pyx_k_fi[] = "fi"; static const char __pyx_k_fn[] = "fn"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_wb[] = "wb"; static const char __pyx_k_BMP[] = ".BMP"; static const char __pyx_k_JPG[] = ".JPG"; static const char __pyx_k_PNG[] = ".PNG"; static const char __pyx_k_SVG[] = ".SVG"; static const char __pyx_k_TGA[] = "TGA"; static const char __pyx_k__18[] = "?"; static const char __pyx_k_err[] = "err"; static const char __pyx_k_ext[] = "ext"; static const char __pyx_k_img[] = "img"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_tga[] = ".tga"; static const char __pyx_k_JPEG[] = ".JPEG"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_load[] = "load"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_save[] = "save"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_surf[] = "surf"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_ascii[] = "ascii"; static const char __pyx_k_bytes[] = "bytes_"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_ftype[] = "ftype"; static const char __pyx_k_lower[] = "lower"; static const char __pyx_k_rwops[] = "rwops"; static const char __pyx_k_upper[] = "upper"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_height[] = "height"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_convert[] = "convert"; static const char __pyx_k_replace[] = "replace"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_unicode[] = "unicode_"; static const char __pyx_k_INIT_JPG[] = "INIT_JPG"; static const char __pyx_k_INIT_JXL[] = "INIT_JXL"; static const char __pyx_k_INIT_PNG[] = "INIT_PNG"; static const char __pyx_k_INIT_TIF[] = "INIT_TIF"; static const char __pyx_k_endswith[] = "endswith"; static const char __pyx_k_filename[] = "filename"; static const char __pyx_k_has_init[] = "has_init"; static const char __pyx_k_namehint[] = "namehint"; static const char __pyx_k_splitext[] = "splitext"; static const char __pyx_k_INIT_AVIF[] = "INIT_AVIF"; static const char __pyx_k_INIT_WEBP[] = "INIT_WEBP"; static const char __pyx_k_has_alpha[] = "has_alpha"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_compression[] = "compression"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_get_extended[] = "get_extended"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_convert_alpha[] = "convert_alpha"; static const char __pyx_k_utf8_filename[] = "utf8_filename"; static const char __pyx_k_compression_level[] = "compression_level"; static const char __pyx_k_filesystem_encode[] = "filesystem_encode"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_pygame_sdl2_image[] = "pygame_sdl2.image"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat"; static const char __pyx_k_Unsupported_format_s[] = "Unsupported format: %s"; static const char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; static const char __pyx_k_src_pygame_sdl2_image_pyx[] = "src/pygame_sdl2/image.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5image_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_2has_init(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_4quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_6load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_namehint, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_8save(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_filename, PyObject *__pyx_v_compression); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_10get_extended(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_b_BMP; PyObject *__pyx_n_s_INIT_AVIF; PyObject *__pyx_n_s_INIT_JPG; PyObject *__pyx_n_s_INIT_JXL; PyObject *__pyx_n_s_INIT_PNG; PyObject *__pyx_n_s_INIT_TIF; PyObject *__pyx_n_s_INIT_WEBP; PyObject *__pyx_kp_b_JPEG; PyObject *__pyx_kp_b_JPG; PyObject *__pyx_kp_b_PNG; PyObject *__pyx_kp_b_SVG; PyObject *__pyx_n_s_TGA; PyObject *__pyx_kp_s_Unsupported_format_s; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s__18; PyObject *__pyx_kp_b__2; PyObject *__pyx_kp_s__2; PyObject *__pyx_kp_b__3; PyObject *__pyx_kp_u__3; PyObject *__pyx_n_s__6; PyObject *__pyx_n_s_ascii; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_bytes; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_compression; PyObject *__pyx_n_s_compression_level; PyObject *__pyx_n_s_convert; PyObject *__pyx_n_s_convert_alpha; PyObject *__pyx_n_s_decode; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_endswith; PyObject *__pyx_n_s_err; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_ext; PyObject *__pyx_n_s_fi; PyObject *__pyx_n_s_filename; PyObject *__pyx_n_s_filesystem_encode; PyObject *__pyx_n_s_flags; PyObject *__pyx_n_s_fn; PyObject *__pyx_n_s_ftype; PyObject *__pyx_n_s_get_extended; PyObject *__pyx_n_s_getfilesystemencoding; PyObject *__pyx_n_s_has_alpha; PyObject *__pyx_n_s_has_init; PyObject *__pyx_n_s_height; PyObject *__pyx_n_s_img; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_load; PyObject *__pyx_n_s_lower; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_namehint; PyObject *__pyx_n_s_os; PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_compat; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_image; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_replace; PyObject *__pyx_n_s_rwops; PyObject *__pyx_n_s_save; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_splitext; PyObject *__pyx_kp_s_src_pygame_sdl2_image_pyx; PyObject *__pyx_n_s_surf; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_sys; PyObject *__pyx_n_s_test; PyObject *__pyx_kp_s_tga; PyObject *__pyx_n_s_unicode; PyObject *__pyx_n_s_upper; PyObject *__pyx_n_s_utf8_filename; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_n_s_wb; PyObject *__pyx_n_s_width; PyObject *__pyx_int_1; PyObject *__pyx_int_neg_1; PyObject *__pyx_tuple_; PyObject *__pyx_slice__4; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_kp_b_BMP); Py_CLEAR(clear_module_state->__pyx_n_s_INIT_AVIF); Py_CLEAR(clear_module_state->__pyx_n_s_INIT_JPG); Py_CLEAR(clear_module_state->__pyx_n_s_INIT_JXL); Py_CLEAR(clear_module_state->__pyx_n_s_INIT_PNG); Py_CLEAR(clear_module_state->__pyx_n_s_INIT_TIF); Py_CLEAR(clear_module_state->__pyx_n_s_INIT_WEBP); Py_CLEAR(clear_module_state->__pyx_kp_b_JPEG); Py_CLEAR(clear_module_state->__pyx_kp_b_JPG); Py_CLEAR(clear_module_state->__pyx_kp_b_PNG); Py_CLEAR(clear_module_state->__pyx_kp_b_SVG); Py_CLEAR(clear_module_state->__pyx_n_s_TGA); Py_CLEAR(clear_module_state->__pyx_kp_s_Unsupported_format_s); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_n_s__18); Py_CLEAR(clear_module_state->__pyx_kp_b__2); Py_CLEAR(clear_module_state->__pyx_kp_s__2); Py_CLEAR(clear_module_state->__pyx_kp_b__3); Py_CLEAR(clear_module_state->__pyx_kp_u__3); Py_CLEAR(clear_module_state->__pyx_n_s__6); Py_CLEAR(clear_module_state->__pyx_n_s_ascii); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_bytes); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_compression); Py_CLEAR(clear_module_state->__pyx_n_s_compression_level); Py_CLEAR(clear_module_state->__pyx_n_s_convert); Py_CLEAR(clear_module_state->__pyx_n_s_convert_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_decode); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_endswith); Py_CLEAR(clear_module_state->__pyx_n_s_err); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_ext); Py_CLEAR(clear_module_state->__pyx_n_s_fi); Py_CLEAR(clear_module_state->__pyx_n_s_filename); Py_CLEAR(clear_module_state->__pyx_n_s_filesystem_encode); Py_CLEAR(clear_module_state->__pyx_n_s_flags); Py_CLEAR(clear_module_state->__pyx_n_s_fn); Py_CLEAR(clear_module_state->__pyx_n_s_ftype); Py_CLEAR(clear_module_state->__pyx_n_s_get_extended); Py_CLEAR(clear_module_state->__pyx_n_s_getfilesystemencoding); Py_CLEAR(clear_module_state->__pyx_n_s_has_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_has_init); Py_CLEAR(clear_module_state->__pyx_n_s_height); Py_CLEAR(clear_module_state->__pyx_n_s_img); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_load); Py_CLEAR(clear_module_state->__pyx_n_s_lower); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_namehint); Py_CLEAR(clear_module_state->__pyx_n_s_os); Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_compat); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_image); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_replace); Py_CLEAR(clear_module_state->__pyx_n_s_rwops); Py_CLEAR(clear_module_state->__pyx_n_s_save); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_splitext); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_image_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_surf); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_sys); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_kp_s_tga); Py_CLEAR(clear_module_state->__pyx_n_s_unicode); Py_CLEAR(clear_module_state->__pyx_n_s_upper); Py_CLEAR(clear_module_state->__pyx_n_s_utf8_filename); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_n_s_wb); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_slice__4); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_kp_b_BMP); Py_VISIT(traverse_module_state->__pyx_n_s_INIT_AVIF); Py_VISIT(traverse_module_state->__pyx_n_s_INIT_JPG); Py_VISIT(traverse_module_state->__pyx_n_s_INIT_JXL); Py_VISIT(traverse_module_state->__pyx_n_s_INIT_PNG); Py_VISIT(traverse_module_state->__pyx_n_s_INIT_TIF); Py_VISIT(traverse_module_state->__pyx_n_s_INIT_WEBP); Py_VISIT(traverse_module_state->__pyx_kp_b_JPEG); Py_VISIT(traverse_module_state->__pyx_kp_b_JPG); Py_VISIT(traverse_module_state->__pyx_kp_b_PNG); Py_VISIT(traverse_module_state->__pyx_kp_b_SVG); Py_VISIT(traverse_module_state->__pyx_n_s_TGA); Py_VISIT(traverse_module_state->__pyx_kp_s_Unsupported_format_s); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_n_s__18); Py_VISIT(traverse_module_state->__pyx_kp_b__2); Py_VISIT(traverse_module_state->__pyx_kp_s__2); Py_VISIT(traverse_module_state->__pyx_kp_b__3); Py_VISIT(traverse_module_state->__pyx_kp_u__3); Py_VISIT(traverse_module_state->__pyx_n_s__6); Py_VISIT(traverse_module_state->__pyx_n_s_ascii); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_bytes); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_compression); Py_VISIT(traverse_module_state->__pyx_n_s_compression_level); Py_VISIT(traverse_module_state->__pyx_n_s_convert); Py_VISIT(traverse_module_state->__pyx_n_s_convert_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_decode); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_endswith); Py_VISIT(traverse_module_state->__pyx_n_s_err); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_ext); Py_VISIT(traverse_module_state->__pyx_n_s_fi); Py_VISIT(traverse_module_state->__pyx_n_s_filename); Py_VISIT(traverse_module_state->__pyx_n_s_filesystem_encode); Py_VISIT(traverse_module_state->__pyx_n_s_flags); Py_VISIT(traverse_module_state->__pyx_n_s_fn); Py_VISIT(traverse_module_state->__pyx_n_s_ftype); Py_VISIT(traverse_module_state->__pyx_n_s_get_extended); Py_VISIT(traverse_module_state->__pyx_n_s_getfilesystemencoding); Py_VISIT(traverse_module_state->__pyx_n_s_has_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_has_init); Py_VISIT(traverse_module_state->__pyx_n_s_height); Py_VISIT(traverse_module_state->__pyx_n_s_img); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_load); Py_VISIT(traverse_module_state->__pyx_n_s_lower); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_namehint); Py_VISIT(traverse_module_state->__pyx_n_s_os); Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_compat); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_image); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_replace); Py_VISIT(traverse_module_state->__pyx_n_s_rwops); Py_VISIT(traverse_module_state->__pyx_n_s_save); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_splitext); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_image_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_surf); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_sys); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_kp_s_tga); Py_VISIT(traverse_module_state->__pyx_n_s_unicode); Py_VISIT(traverse_module_state->__pyx_n_s_upper); Py_VISIT(traverse_module_state->__pyx_n_s_utf8_filename); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_n_s_wb); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_slice__4); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_b_BMP __pyx_mstate_global->__pyx_kp_b_BMP #define __pyx_n_s_INIT_AVIF __pyx_mstate_global->__pyx_n_s_INIT_AVIF #define __pyx_n_s_INIT_JPG __pyx_mstate_global->__pyx_n_s_INIT_JPG #define __pyx_n_s_INIT_JXL __pyx_mstate_global->__pyx_n_s_INIT_JXL #define __pyx_n_s_INIT_PNG __pyx_mstate_global->__pyx_n_s_INIT_PNG #define __pyx_n_s_INIT_TIF __pyx_mstate_global->__pyx_n_s_INIT_TIF #define __pyx_n_s_INIT_WEBP __pyx_mstate_global->__pyx_n_s_INIT_WEBP #define __pyx_kp_b_JPEG __pyx_mstate_global->__pyx_kp_b_JPEG #define __pyx_kp_b_JPG __pyx_mstate_global->__pyx_kp_b_JPG #define __pyx_kp_b_PNG __pyx_mstate_global->__pyx_kp_b_PNG #define __pyx_kp_b_SVG __pyx_mstate_global->__pyx_kp_b_SVG #define __pyx_n_s_TGA __pyx_mstate_global->__pyx_n_s_TGA #define __pyx_kp_s_Unsupported_format_s __pyx_mstate_global->__pyx_kp_s_Unsupported_format_s #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_n_s__18 __pyx_mstate_global->__pyx_n_s__18 #define __pyx_kp_b__2 __pyx_mstate_global->__pyx_kp_b__2 #define __pyx_kp_s__2 __pyx_mstate_global->__pyx_kp_s__2 #define __pyx_kp_b__3 __pyx_mstate_global->__pyx_kp_b__3 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 #define __pyx_n_s__6 __pyx_mstate_global->__pyx_n_s__6 #define __pyx_n_s_ascii __pyx_mstate_global->__pyx_n_s_ascii #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_compression __pyx_mstate_global->__pyx_n_s_compression #define __pyx_n_s_compression_level __pyx_mstate_global->__pyx_n_s_compression_level #define __pyx_n_s_convert __pyx_mstate_global->__pyx_n_s_convert #define __pyx_n_s_convert_alpha __pyx_mstate_global->__pyx_n_s_convert_alpha #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_endswith __pyx_mstate_global->__pyx_n_s_endswith #define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_ext __pyx_mstate_global->__pyx_n_s_ext #define __pyx_n_s_fi __pyx_mstate_global->__pyx_n_s_fi #define __pyx_n_s_filename __pyx_mstate_global->__pyx_n_s_filename #define __pyx_n_s_filesystem_encode __pyx_mstate_global->__pyx_n_s_filesystem_encode #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags #define __pyx_n_s_fn __pyx_mstate_global->__pyx_n_s_fn #define __pyx_n_s_ftype __pyx_mstate_global->__pyx_n_s_ftype #define __pyx_n_s_get_extended __pyx_mstate_global->__pyx_n_s_get_extended #define __pyx_n_s_getfilesystemencoding __pyx_mstate_global->__pyx_n_s_getfilesystemencoding #define __pyx_n_s_has_alpha __pyx_mstate_global->__pyx_n_s_has_alpha #define __pyx_n_s_has_init __pyx_mstate_global->__pyx_n_s_has_init #define __pyx_n_s_height __pyx_mstate_global->__pyx_n_s_height #define __pyx_n_s_img __pyx_mstate_global->__pyx_n_s_img #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_load __pyx_mstate_global->__pyx_n_s_load #define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_namehint __pyx_mstate_global->__pyx_n_s_namehint #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_compat __pyx_mstate_global->__pyx_n_s_pygame_sdl2_compat #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_image __pyx_mstate_global->__pyx_n_s_pygame_sdl2_image #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace #define __pyx_n_s_rwops __pyx_mstate_global->__pyx_n_s_rwops #define __pyx_n_s_save __pyx_mstate_global->__pyx_n_s_save #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_splitext __pyx_mstate_global->__pyx_n_s_splitext #define __pyx_kp_s_src_pygame_sdl2_image_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_image_pyx #define __pyx_n_s_surf __pyx_mstate_global->__pyx_n_s_surf #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_kp_s_tga __pyx_mstate_global->__pyx_kp_s_tga #define __pyx_n_s_unicode __pyx_mstate_global->__pyx_n_s_unicode #define __pyx_n_s_upper __pyx_mstate_global->__pyx_n_s_upper #define __pyx_n_s_utf8_filename __pyx_mstate_global->__pyx_n_s_utf8_filename #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_n_s_wb __pyx_mstate_global->__pyx_n_s_wb #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_slice__4 __pyx_mstate_global->__pyx_slice__4 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 /* #### Code section: module_code ### */ /* "pygame_sdl2/image.pyx":34 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * # Attempt to initialize everything. Only fail loudly if all formats fail * global image_formats */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5image_init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_5image_init}; static PyObject *__pyx_pw_11pygame_sdl2_5image_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5image_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/image.pyx":37 * # Attempt to initialize everything. Only fail loudly if all formats fail * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP | IMG_INIT_JXL | IMG_INIT_AVIF) # <<<<<<<<<<<<<< * if image_formats == 0: * raise error() */ __pyx_v_11pygame_sdl2_5image_image_formats = IMG_Init((((((IMG_INIT_JPG | IMG_INIT_PNG) | IMG_INIT_TIF) | IMG_INIT_WEBP) | IMG_INIT_JXL) | IMG_INIT_AVIF)); /* "pygame_sdl2/image.pyx":38 * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP | IMG_INIT_JXL | IMG_INIT_AVIF) * if image_formats == 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_11pygame_sdl2_5image_image_formats == 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/image.pyx":39 * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP | IMG_INIT_JXL | IMG_INIT_AVIF) * if image_formats == 0: * raise error() # <<<<<<<<<<<<<< * * init() */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 39, __pyx_L1_error) /* "pygame_sdl2/image.pyx":38 * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP | IMG_INIT_JXL | IMG_INIT_AVIF) * if image_formats == 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/image.pyx":34 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * # Attempt to initialize everything. Only fail loudly if all formats fail * global image_formats */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.image.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":51 * INIT_AVIF = IMG_INIT_AVIF * * def has_init(int flags): # <<<<<<<<<<<<<< * return (flags & image_formats) == flags * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_3has_init(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5image_2has_init, "has_init(int flags)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_3has_init = {"has_init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5image_3has_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5image_2has_init}; static PyObject *__pyx_pw_11pygame_sdl2_5image_3has_init(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { int __pyx_v_flags; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("has_init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "has_init") < 0)) __PYX_ERR(0, 51, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flags = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("has_init", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 51, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.image.has_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5image_2has_init(__pyx_self, __pyx_v_flags); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_2has_init(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_init", 1); /* "pygame_sdl2/image.pyx":52 * * def has_init(int flags): * return (flags & image_formats) == flags # <<<<<<<<<<<<<< * * def quit(): # @ReservedAssignment */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(((__pyx_v_flags & __pyx_v_11pygame_sdl2_5image_image_formats) == __pyx_v_flags)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/image.pyx":51 * INIT_AVIF = IMG_INIT_AVIF * * def has_init(int flags): # <<<<<<<<<<<<<< * return (flags & image_formats) == flags * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.image.has_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":54 * return (flags & image_formats) == flags * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_5quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5image_4quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_5quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_5quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_5image_4quit}; static PyObject *__pyx_pw_11pygame_sdl2_5image_5quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5image_4quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_4quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/image.pyx":55 * * def quit(): # @ReservedAssignment * IMG_Quit() # <<<<<<<<<<<<<< * * cdef process_namehint(namehint): */ IMG_Quit(); /* "pygame_sdl2/image.pyx":54 * return (flags & image_formats) == flags * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":57 * IMG_Quit() * * cdef process_namehint(namehint): # <<<<<<<<<<<<<< * # Accepts "foo.png", ".png", or "png" * */ static PyObject *__pyx_f_11pygame_sdl2_5image_process_namehint(PyObject *__pyx_v_namehint) { PyObject *__pyx_v_ext = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("process_namehint", 0); __Pyx_INCREF(__pyx_v_namehint); /* "pygame_sdl2/image.pyx":60 * # Accepts "foo.png", ".png", or "png" * * if not isinstance(namehint, bytes_): # <<<<<<<<<<<<<< * namehint = namehint.encode("ascii", "replace") * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_namehint, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":61 * * if not isinstance(namehint, bytes_): * namehint = namehint.encode("ascii", "replace") # <<<<<<<<<<<<<< * * if not namehint: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_namehint, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_namehint, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":60 * # Accepts "foo.png", ".png", or "png" * * if not isinstance(namehint, bytes_): # <<<<<<<<<<<<<< * namehint = namehint.encode("ascii", "replace") * */ } /* "pygame_sdl2/image.pyx":63 * namehint = namehint.encode("ascii", "replace") * * if not namehint: # <<<<<<<<<<<<<< * return b'' * */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_namehint); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_3); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":64 * * if not namehint: * return b'' # <<<<<<<<<<<<<< * * ext = os.path.splitext(namehint)[1] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_b__2); __pyx_r = __pyx_kp_b__2; goto __pyx_L0; /* "pygame_sdl2/image.pyx":63 * namehint = namehint.encode("ascii", "replace") * * if not namehint: # <<<<<<<<<<<<<< * return b'' * */ } /* "pygame_sdl2/image.pyx":66 * return b'' * * ext = os.path.splitext(namehint)[1] # <<<<<<<<<<<<<< * if not ext: * ext = namehint */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_splitext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_namehint}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_ext = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/image.pyx":67 * * ext = os.path.splitext(namehint)[1] * if not ext: # <<<<<<<<<<<<<< * ext = namehint * if ext[0] == b'.': */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ext); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":68 * ext = os.path.splitext(namehint)[1] * if not ext: * ext = namehint # <<<<<<<<<<<<<< * if ext[0] == b'.': * ext = ext[1:] */ __Pyx_INCREF(__pyx_v_namehint); __Pyx_DECREF_SET(__pyx_v_ext, __pyx_v_namehint); /* "pygame_sdl2/image.pyx":67 * * ext = os.path.splitext(namehint)[1] * if not ext: # <<<<<<<<<<<<<< * ext = namehint * if ext[0] == b'.': */ } /* "pygame_sdl2/image.pyx":69 * if not ext: * ext = namehint * if ext[0] == b'.': # <<<<<<<<<<<<<< * ext = ext[1:] * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ext, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b__3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":70 * ext = namehint * if ext[0] == b'.': * ext = ext[1:] # <<<<<<<<<<<<<< * * return ext.upper() */ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_ext, 1, 0, NULL, NULL, &__pyx_slice__4, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ext, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/image.pyx":69 * if not ext: * ext = namehint * if ext[0] == b'.': # <<<<<<<<<<<<<< * ext = ext[1:] * */ } /* "pygame_sdl2/image.pyx":72 * ext = ext[1:] * * return ext.upper() # <<<<<<<<<<<<<< * * def load(fi, namehint="", size=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ext, __pyx_n_s_upper); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/image.pyx":57 * IMG_Quit() * * cdef process_namehint(namehint): # <<<<<<<<<<<<<< * # Accepts "foo.png", ".png", or "png" * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.image.process_namehint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ext); __Pyx_XDECREF(__pyx_v_namehint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":74 * return ext.upper() * * def load(fi, namehint="", size=None): # <<<<<<<<<<<<<< * """ * `size` */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_7load(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5image_6load, "load(fi, namehint='', size=None)\n\n `size`\n A width, height tuple that specifies the size the image is loaded\n at. This is only supported for SVG images.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_7load = {"load", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5image_7load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5image_6load}; static PyObject *__pyx_pw_11pygame_sdl2_5image_7load(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fi = 0; PyObject *__pyx_v_namehint = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,&__pyx_n_s_namehint,&__pyx_n_s_size,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_kp_s__2))); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_namehint); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load") < 0)) __PYX_ERR(0, 74, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fi = values[0]; __pyx_v_namehint = values[1]; __pyx_v_size = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 74, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5image_6load(__pyx_self, __pyx_v_fi, __pyx_v_namehint, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_6load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_namehint, PyObject *__pyx_v_size) { SDL_Surface *__pyx_v_img; SDL_RWops *__pyx_v_rwops; char *__pyx_v_ftype; int __pyx_v_width; int __pyx_v_height; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf = 0; int __pyx_v_n; int __pyx_v_has_alpha; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; SDL_RWops *__pyx_t_7; char *__pyx_t_8; int __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 0); __Pyx_INCREF(__pyx_v_namehint); /* "pygame_sdl2/image.pyx":90 * * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): # <<<<<<<<<<<<<< * if fi.lower().endswith('.tga'): * namehint = "TGA" */ __pyx_t_1 = PyString_Check(__pyx_v_fi); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":91 * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): * if fi.lower().endswith('.tga'): # <<<<<<<<<<<<<< * namehint = "TGA" * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fi, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_endswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_tga}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":92 * if isinstance(fi, str): * if fi.lower().endswith('.tga'): * namehint = "TGA" # <<<<<<<<<<<<<< * * rwops = to_rwops(fi) */ __Pyx_INCREF(__pyx_n_s_TGA); __Pyx_DECREF_SET(__pyx_v_namehint, __pyx_n_s_TGA); /* "pygame_sdl2/image.pyx":91 * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): * if fi.lower().endswith('.tga'): # <<<<<<<<<<<<<< * namehint = "TGA" * */ } /* "pygame_sdl2/image.pyx":90 * * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): # <<<<<<<<<<<<<< * if fi.lower().endswith('.tga'): * namehint = "TGA" */ } /* "pygame_sdl2/image.pyx":94 * namehint = "TGA" * * rwops = to_rwops(fi) # <<<<<<<<<<<<<< * * if namehint == "": */ __pyx_t_7 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_7 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 94, __pyx_L1_error) __pyx_v_rwops = __pyx_t_7; /* "pygame_sdl2/image.pyx":96 * rwops = to_rwops(fi) * * if namehint == "": # <<<<<<<<<<<<<< * with nogil: * img = IMG_Load_RW(rwops, 1) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_namehint, __pyx_kp_s__2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 96, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":97 * * if namehint == "": * with nogil: # <<<<<<<<<<<<<< * img = IMG_Load_RW(rwops, 1) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/image.pyx":98 * if namehint == "": * with nogil: * img = IMG_Load_RW(rwops, 1) # <<<<<<<<<<<<<< * * else: */ __pyx_v_img = IMG_Load_RW(__pyx_v_rwops, 1); } /* "pygame_sdl2/image.pyx":97 * * if namehint == "": * with nogil: # <<<<<<<<<<<<<< * img = IMG_Load_RW(rwops, 1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "pygame_sdl2/image.pyx":96 * rwops = to_rwops(fi) * * if namehint == "": # <<<<<<<<<<<<<< * with nogil: * img = IMG_Load_RW(rwops, 1) */ goto __pyx_L5; } /* "pygame_sdl2/image.pyx":101 * * else: * namehint = process_namehint(namehint) # <<<<<<<<<<<<<< * ftype = namehint * */ /*else*/ { __pyx_t_2 = __pyx_f_11pygame_sdl2_5image_process_namehint(__pyx_v_namehint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_namehint, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":102 * else: * namehint = process_namehint(namehint) * ftype = namehint # <<<<<<<<<<<<<< * * if namehint == b".SVG" and size is not None: */ __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_namehint); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_v_ftype = __pyx_t_8; /* "pygame_sdl2/image.pyx":104 * ftype = namehint * * if namehint == b".SVG" and size is not None: # <<<<<<<<<<<<<< * width, height = size * */ __pyx_t_9 = (__Pyx_PyBytes_Equals(__pyx_v_namehint, __pyx_kp_b_SVG, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 104, __pyx_L1_error) if (__pyx_t_9) { } else { __pyx_t_1 = __pyx_t_9; goto __pyx_L10_bool_binop_done; } __pyx_t_9 = (__pyx_v_size != Py_None); __pyx_t_1 = __pyx_t_9; __pyx_L10_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":105 * * if namehint == b".SVG" and size is not None: * width, height = size # <<<<<<<<<<<<<< * * with nogil: */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 105, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_4 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_3), 2) < 0) __PYX_ERR(0, 105, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 105, __pyx_L1_error) __pyx_L13_unpacking_done:; } __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_width = __pyx_t_6; __pyx_v_height = __pyx_t_11; /* "pygame_sdl2/image.pyx":107 * width, height = size * * with nogil: # <<<<<<<<<<<<<< * img = IMG_LoadSizedSVG_RW(rwops, width, height) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/image.pyx":108 * * with nogil: * img = IMG_LoadSizedSVG_RW(rwops, width, height) # <<<<<<<<<<<<<< * * SDL_RWclose(rwops) */ __pyx_v_img = IMG_LoadSizedSVG_RW(__pyx_v_rwops, __pyx_v_width, __pyx_v_height); } /* "pygame_sdl2/image.pyx":107 * width, height = size * * with nogil: # <<<<<<<<<<<<<< * img = IMG_LoadSizedSVG_RW(rwops, width, height) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L16; } __pyx_L16:; } } /* "pygame_sdl2/image.pyx":110 * img = IMG_LoadSizedSVG_RW(rwops, width, height) * * SDL_RWclose(rwops) # <<<<<<<<<<<<<< * * else: */ (void)(SDL_RWclose(__pyx_v_rwops)); /* "pygame_sdl2/image.pyx":104 * ftype = namehint * * if namehint == b".SVG" and size is not None: # <<<<<<<<<<<<<< * width, height = size * */ goto __pyx_L9; } /* "pygame_sdl2/image.pyx":114 * else: * * with nogil: # <<<<<<<<<<<<<< * img = IMG_LoadTyped_RW(rwops, 1, ftype) * */ /*else*/ { { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/image.pyx":115 * * with nogil: * img = IMG_LoadTyped_RW(rwops, 1, ftype) # <<<<<<<<<<<<<< * * if img == NULL: */ __pyx_v_img = IMG_LoadTyped_RW(__pyx_v_rwops, 1, __pyx_v_ftype); } /* "pygame_sdl2/image.pyx":114 * else: * * with nogil: # <<<<<<<<<<<<<< * img = IMG_LoadTyped_RW(rwops, 1, ftype) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L19; } __pyx_L19:; } } } __pyx_L9:; } __pyx_L5:; /* "pygame_sdl2/image.pyx":117 * img = IMG_LoadTyped_RW(rwops, 1, ftype) * * if img == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_img == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/image.pyx":118 * * if img == NULL: * raise error() # <<<<<<<<<<<<<< * * cdef Surface surf = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 118, __pyx_L1_error) /* "pygame_sdl2/image.pyx":117 * img = IMG_LoadTyped_RW(rwops, 1, ftype) * * if img == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/image.pyx":120 * raise error() * * cdef Surface surf = Surface(()) # <<<<<<<<<<<<<< * surf.take_surface(img) * */ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_surf = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":121 * * cdef Surface surf = Surface(()) * surf.take_surface(img) # <<<<<<<<<<<<<< * * if img.format.BitsPerPixel == 32: */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_surf->__pyx_vtab)->take_surface(__pyx_v_surf, __pyx_v_img); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error) /* "pygame_sdl2/image.pyx":123 * surf.take_surface(img) * * if img.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * return surf * */ __pyx_t_1 = (__pyx_v_img->format->BitsPerPixel == 32); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":124 * * if img.format.BitsPerPixel == 32: * return surf # <<<<<<<<<<<<<< * * cdef int n = 0 */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_surf); __pyx_r = ((PyObject *)__pyx_v_surf); goto __pyx_L0; /* "pygame_sdl2/image.pyx":123 * surf.take_surface(img) * * if img.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * return surf * */ } /* "pygame_sdl2/image.pyx":126 * return surf * * cdef int n = 0 # <<<<<<<<<<<<<< * has_alpha = False * */ __pyx_v_n = 0; /* "pygame_sdl2/image.pyx":127 * * cdef int n = 0 * has_alpha = False # <<<<<<<<<<<<<< * * if img.format.Amask: */ __pyx_v_has_alpha = 0; /* "pygame_sdl2/image.pyx":129 * has_alpha = False * * if img.format.Amask: # <<<<<<<<<<<<<< * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: */ __pyx_t_1 = (__pyx_v_img->format->Amask != 0); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":130 * * if img.format.Amask: * has_alpha = True # <<<<<<<<<<<<<< * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True */ __pyx_v_has_alpha = 1; /* "pygame_sdl2/image.pyx":129 * has_alpha = False * * if img.format.Amask: # <<<<<<<<<<<<<< * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: */ goto __pyx_L22; } /* "pygame_sdl2/image.pyx":131 * if img.format.Amask: * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: # <<<<<<<<<<<<<< * has_alpha = True * elif img.format.palette != NULL: */ __pyx_t_1 = (((__pyx_v_img->format->format >> 24) & SDL_PIXELTYPE_INDEX1) != 0); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":132 * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True # <<<<<<<<<<<<<< * elif img.format.palette != NULL: * # Check for non-opaque palette colors. */ __pyx_v_has_alpha = 1; /* "pygame_sdl2/image.pyx":131 * if img.format.Amask: * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: # <<<<<<<<<<<<<< * has_alpha = True * elif img.format.palette != NULL: */ goto __pyx_L22; } /* "pygame_sdl2/image.pyx":133 * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True * elif img.format.palette != NULL: # <<<<<<<<<<<<<< * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: */ __pyx_t_1 = (__pyx_v_img->format->palette != NULL); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":135 * elif img.format.palette != NULL: * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: # <<<<<<<<<<<<<< * if img.format.palette.colors[n].a != 255: * has_alpha = True */ while (1) { __pyx_t_1 = (__pyx_v_n < __pyx_v_img->format->palette->ncolors); if (!__pyx_t_1) break; /* "pygame_sdl2/image.pyx":136 * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: * if img.format.palette.colors[n].a != 255: # <<<<<<<<<<<<<< * has_alpha = True * break */ __pyx_t_1 = ((__pyx_v_img->format->palette->colors[__pyx_v_n]).a != 0xFF); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":137 * while n < img.format.palette.ncolors: * if img.format.palette.colors[n].a != 255: * has_alpha = True # <<<<<<<<<<<<<< * break * n += 1 */ __pyx_v_has_alpha = 1; /* "pygame_sdl2/image.pyx":138 * if img.format.palette.colors[n].a != 255: * has_alpha = True * break # <<<<<<<<<<<<<< * n += 1 * */ goto __pyx_L24_break; /* "pygame_sdl2/image.pyx":136 * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: * if img.format.palette.colors[n].a != 255: # <<<<<<<<<<<<<< * has_alpha = True * break */ } /* "pygame_sdl2/image.pyx":139 * has_alpha = True * break * n += 1 # <<<<<<<<<<<<<< * * try: */ __pyx_v_n = (__pyx_v_n + 1); } __pyx_L24_break:; /* "pygame_sdl2/image.pyx":133 * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True * elif img.format.palette != NULL: # <<<<<<<<<<<<<< * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: */ } __pyx_L22:; /* "pygame_sdl2/image.pyx":141 * n += 1 * * try: # <<<<<<<<<<<<<< * if has_alpha: * return surf.convert_alpha() */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); /*try:*/ { /* "pygame_sdl2/image.pyx":142 * * try: * if has_alpha: # <<<<<<<<<<<<<< * return surf.convert_alpha() * else: */ if (__pyx_v_has_alpha) { /* "pygame_sdl2/image.pyx":143 * try: * if has_alpha: * return surf.convert_alpha() # <<<<<<<<<<<<<< * else: * return surf.convert() */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf), __pyx_n_s_convert_alpha); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L30_try_return; /* "pygame_sdl2/image.pyx":142 * * try: * if has_alpha: # <<<<<<<<<<<<<< * return surf.convert_alpha() * else: */ } /* "pygame_sdl2/image.pyx":145 * return surf.convert_alpha() * else: * return surf.convert() # <<<<<<<<<<<<<< * except error: * return surf */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf), __pyx_n_s_convert); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L30_try_return; } /* "pygame_sdl2/image.pyx":141 * n += 1 * * try: # <<<<<<<<<<<<<< * if has_alpha: * return surf.convert_alpha() */ } __pyx_L26_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/image.pyx":146 * else: * return surf.convert() * except error: # <<<<<<<<<<<<<< * return surf * */ __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_2, &__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_ErrRestore(__pyx_t_4, __pyx_t_2, __pyx_t_3); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; if (__pyx_t_11) { __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_4) < 0) __PYX_ERR(0, 146, __pyx_L28_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_4); /* "pygame_sdl2/image.pyx":147 * return surf.convert() * except error: * return surf # <<<<<<<<<<<<<< * * cdef extern from "write_jpeg.h": */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_surf); __pyx_r = ((PyObject *)__pyx_v_surf); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L29_except_return; } goto __pyx_L28_except_error; /* "pygame_sdl2/image.pyx":141 * n += 1 * * try: # <<<<<<<<<<<<<< * if has_alpha: * return surf.convert_alpha() */ __pyx_L28_except_error:; __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); goto __pyx_L1_error; __pyx_L30_try_return:; __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); goto __pyx_L0; __pyx_L29_except_return:; __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); goto __pyx_L0; } /* "pygame_sdl2/image.pyx":74 * return ext.upper() * * def load(fi, namehint="", size=None): # <<<<<<<<<<<<<< * """ * `size` */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf); __Pyx_XDECREF(__pyx_v_namehint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":155 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if not isinstance(filename, unicode_): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_9save(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5image_8save, "save(Surface surface, filename, compression=-1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_9save = {"save", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5image_9save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5image_8save}; static PyObject *__pyx_pw_11pygame_sdl2_5image_9save(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_compression = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("save (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_filename,&__pyx_n_s_compression,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_neg_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("save", 0, 2, 3, 1); __PYX_ERR(0, 155, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compression); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "save") < 0)) __PYX_ERR(0, 155, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_filename = values[1]; __pyx_v_compression = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("save", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 155, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.image.save", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 0, "surface", 0))) __PYX_ERR(0, 155, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5image_8save(__pyx_self, __pyx_v_surface, __pyx_v_filename, __pyx_v_compression); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_8save(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_filename, PyObject *__pyx_v_compression) { PyObject *__pyx_v_ext = NULL; long __pyx_v_err; PyObject *__pyx_v_utf8_filename = NULL; char *__pyx_v_fn; SDL_RWops *__pyx_v_rwops; int __pyx_v_compression_level; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; char *__pyx_t_9; SDL_RWops *__pyx_t_10; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("save", 0); __Pyx_INCREF(__pyx_v_filename); /* "pygame_sdl2/image.pyx":157 * def save(Surface surface not None, filename, compression=-1): * * if not isinstance(filename, unicode_): # <<<<<<<<<<<<<< * filename = filename.decode(sys.getfilesystemencoding()) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_filename, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":158 * * if not isinstance(filename, unicode_): * filename = filename.decode(sys.getfilesystemencoding()) # <<<<<<<<<<<<<< * * ext = os.path.splitext(filename)[1] */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/image.pyx":157 * def save(Surface surface not None, filename, compression=-1): * * if not isinstance(filename, unicode_): # <<<<<<<<<<<<<< * filename = filename.decode(sys.getfilesystemencoding()) * */ } /* "pygame_sdl2/image.pyx":160 * filename = filename.decode(sys.getfilesystemencoding()) * * ext = os.path.splitext(filename)[1] # <<<<<<<<<<<<<< * ext = ext.upper() * ext = ext.encode("utf-8") */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_splitext); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_filename}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ext = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":161 * * ext = os.path.splitext(filename)[1] * ext = ext.upper() # <<<<<<<<<<<<<< * ext = ext.encode("utf-8") * err = 0 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ext, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF_SET(__pyx_v_ext, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":162 * ext = os.path.splitext(filename)[1] * ext = ext.upper() * ext = ext.encode("utf-8") # <<<<<<<<<<<<<< * err = 0 * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ext, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_utf_8}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF_SET(__pyx_v_ext, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":163 * ext = ext.upper() * ext = ext.encode("utf-8") * err = 0 # <<<<<<<<<<<<<< * * utf8_filename = filename.encode("utf-8") */ __pyx_v_err = 0; /* "pygame_sdl2/image.pyx":165 * err = 0 * * utf8_filename = filename.encode("utf-8") # <<<<<<<<<<<<<< * * cdef char *fn = utf8_filename */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_utf_8}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_utf8_filename = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":167 * utf8_filename = filename.encode("utf-8") * * cdef char *fn = utf8_filename # <<<<<<<<<<<<<< * cdef SDL_RWops *rwops * cdef int compression_level = compression */ __pyx_t_9 = __Pyx_PyObject_AsWritableString(__pyx_v_utf8_filename); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __pyx_v_fn = __pyx_t_9; /* "pygame_sdl2/image.pyx":169 * cdef char *fn = utf8_filename * cdef SDL_RWops *rwops * cdef int compression_level = compression # <<<<<<<<<<<<<< * * if ext == b'.PNG': */ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 169, __pyx_L1_error) __pyx_v_compression_level = __pyx_t_8; /* "pygame_sdl2/image.pyx":171 * cdef int compression_level = compression * * if ext == b'.PNG': # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) */ __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_PNG, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 171, __pyx_L1_error) if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":172 * * if ext == b'.PNG': * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/image.pyx":173 * if ext == b'.PNG': * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) # <<<<<<<<<<<<<< * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") */ __pyx_v_err = Pygame_SDL2_SavePNG(__pyx_v_fn, __pyx_v_surface->surface, __pyx_v_compression_level); } /* "pygame_sdl2/image.pyx":172 * * if ext == b'.PNG': * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L7; } __pyx_L7:; } } /* "pygame_sdl2/image.pyx":171 * cdef int compression_level = compression * * if ext == b'.PNG': # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) */ goto __pyx_L4; } /* "pygame_sdl2/image.pyx":174 * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': # <<<<<<<<<<<<<< * rwops = to_rwops(filename, "wb") * with nogil: */ __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_BMP, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":175 * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") # <<<<<<<<<<<<<< * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) */ __pyx_t_11.__pyx_n = 1; __pyx_t_11.mode = __pyx_n_s_wb; __pyx_t_10 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filename, &__pyx_t_11); if (unlikely(__pyx_t_10 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 175, __pyx_L1_error) __pyx_v_rwops = __pyx_t_10; /* "pygame_sdl2/image.pyx":176 * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") * with nogil: # <<<<<<<<<<<<<< * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/image.pyx":177 * rwops = to_rwops(filename, "wb") * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) # <<<<<<<<<<<<<< * elif ext == b".JPG" or ext == b".JPEG": * with nogil: */ __pyx_v_err = SDL_SaveBMP_RW(__pyx_v_surface->surface, __pyx_v_rwops, 1); } /* "pygame_sdl2/image.pyx":176 * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") * with nogil: # <<<<<<<<<<<<<< * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/image.pyx":174 * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': # <<<<<<<<<<<<<< * rwops = to_rwops(filename, "wb") * with nogil: */ goto __pyx_L4; } /* "pygame_sdl2/image.pyx":178 * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) */ __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_JPG, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L11_bool_binop_done; } __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_JPEG, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) __pyx_t_3 = __pyx_t_2; __pyx_L11_bool_binop_done:; if (likely(__pyx_t_3)) { /* "pygame_sdl2/image.pyx":179 * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) * else: */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/image.pyx":180 * elif ext == b".JPG" or ext == b".JPEG": * with nogil: * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) # <<<<<<<<<<<<<< * else: * raise ValueError("Unsupported format: %s" % ext) */ __pyx_v_err = Pygame_SDL2_SaveJPEG(__pyx_v_surface->surface, __pyx_v_fn, __pyx_v_compression_level); } /* "pygame_sdl2/image.pyx":179 * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) * else: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L15; } __pyx_L15:; } } /* "pygame_sdl2/image.pyx":178 * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) */ goto __pyx_L4; } /* "pygame_sdl2/image.pyx":182 * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) * else: * raise ValueError("Unsupported format: %s" % ext) # <<<<<<<<<<<<<< * * if err != 0: */ /*else*/ { __pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Unsupported_format_s, __pyx_v_ext); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 182, __pyx_L1_error) } __pyx_L4:; /* "pygame_sdl2/image.pyx":184 * raise ValueError("Unsupported format: %s" % ext) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = (__pyx_v_err != 0); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/image.pyx":185 * * if err != 0: * raise error() # <<<<<<<<<<<<<< * * def get_extended(): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 185, __pyx_L1_error) /* "pygame_sdl2/image.pyx":184 * raise ValueError("Unsupported format: %s" % ext) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/image.pyx":155 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if not isinstance(filename, unicode_): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.image.save", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ext); __Pyx_XDECREF(__pyx_v_utf8_filename); __Pyx_XDECREF(__pyx_v_filename); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":187 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_11get_extended(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5image_10get_extended, "get_extended()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_11get_extended = {"get_extended", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_11get_extended, METH_NOARGS, __pyx_doc_11pygame_sdl2_5image_10get_extended}; static PyObject *__pyx_pw_11pygame_sdl2_5image_11get_extended(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_extended (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5image_10get_extended(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_10get_extended(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_extended", 1); /* "pygame_sdl2/image.pyx":189 * def get_extended(): * # This may be called before init. * return True # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/image.pyx":187 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_b_BMP, __pyx_k_BMP, sizeof(__pyx_k_BMP), 0, 0, 0, 0}, {&__pyx_n_s_INIT_AVIF, __pyx_k_INIT_AVIF, sizeof(__pyx_k_INIT_AVIF), 0, 0, 1, 1}, {&__pyx_n_s_INIT_JPG, __pyx_k_INIT_JPG, sizeof(__pyx_k_INIT_JPG), 0, 0, 1, 1}, {&__pyx_n_s_INIT_JXL, __pyx_k_INIT_JXL, sizeof(__pyx_k_INIT_JXL), 0, 0, 1, 1}, {&__pyx_n_s_INIT_PNG, __pyx_k_INIT_PNG, sizeof(__pyx_k_INIT_PNG), 0, 0, 1, 1}, {&__pyx_n_s_INIT_TIF, __pyx_k_INIT_TIF, sizeof(__pyx_k_INIT_TIF), 0, 0, 1, 1}, {&__pyx_n_s_INIT_WEBP, __pyx_k_INIT_WEBP, sizeof(__pyx_k_INIT_WEBP), 0, 0, 1, 1}, {&__pyx_kp_b_JPEG, __pyx_k_JPEG, sizeof(__pyx_k_JPEG), 0, 0, 0, 0}, {&__pyx_kp_b_JPG, __pyx_k_JPG, sizeof(__pyx_k_JPG), 0, 0, 0, 0}, {&__pyx_kp_b_PNG, __pyx_k_PNG, sizeof(__pyx_k_PNG), 0, 0, 0, 0}, {&__pyx_kp_b_SVG, __pyx_k_SVG, sizeof(__pyx_k_SVG), 0, 0, 0, 0}, {&__pyx_n_s_TGA, __pyx_k_TGA, sizeof(__pyx_k_TGA), 0, 0, 1, 1}, {&__pyx_kp_s_Unsupported_format_s, __pyx_k_Unsupported_format_s, sizeof(__pyx_k_Unsupported_format_s), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 1}, {&__pyx_kp_b__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 0, 0}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_b__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 0, 0}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 0, 1, 1}, {&__pyx_n_s_compression_level, __pyx_k_compression_level, sizeof(__pyx_k_compression_level), 0, 0, 1, 1}, {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, {&__pyx_n_s_convert_alpha, __pyx_k_convert_alpha, sizeof(__pyx_k_convert_alpha), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_ext, __pyx_k_ext, sizeof(__pyx_k_ext), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, {&__pyx_n_s_filesystem_encode, __pyx_k_filesystem_encode, sizeof(__pyx_k_filesystem_encode), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_fn, __pyx_k_fn, sizeof(__pyx_k_fn), 0, 0, 1, 1}, {&__pyx_n_s_ftype, __pyx_k_ftype, sizeof(__pyx_k_ftype), 0, 0, 1, 1}, {&__pyx_n_s_get_extended, __pyx_k_get_extended, sizeof(__pyx_k_get_extended), 0, 0, 1, 1}, {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, {&__pyx_n_s_has_alpha, __pyx_k_has_alpha, sizeof(__pyx_k_has_alpha), 0, 0, 1, 1}, {&__pyx_n_s_has_init, __pyx_k_has_init, sizeof(__pyx_k_has_init), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_n_s_img, __pyx_k_img, sizeof(__pyx_k_img), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_namehint, __pyx_k_namehint, sizeof(__pyx_k_namehint), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_compat, __pyx_k_pygame_sdl2_compat, sizeof(__pyx_k_pygame_sdl2_compat), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_image, __pyx_k_pygame_sdl2_image, sizeof(__pyx_k_pygame_sdl2_image), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, {&__pyx_n_s_rwops, __pyx_k_rwops, sizeof(__pyx_k_rwops), 0, 0, 1, 1}, {&__pyx_n_s_save, __pyx_k_save, sizeof(__pyx_k_save), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_splitext, __pyx_k_splitext, sizeof(__pyx_k_splitext), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_k_src_pygame_sdl2_image_pyx, sizeof(__pyx_k_src_pygame_sdl2_image_pyx), 0, 0, 1, 0}, {&__pyx_n_s_surf, __pyx_k_surf, sizeof(__pyx_k_surf), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_s_tga, __pyx_k_tga, sizeof(__pyx_k_tga), 0, 0, 1, 0}, {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1}, {&__pyx_n_s_utf8_filename, __pyx_k_utf8_filename, sizeof(__pyx_k_utf8_filename), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {&__pyx_n_s_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 182, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/image.pyx":61 * * if not isinstance(namehint, bytes_): * namehint = namehint.encode("ascii", "replace") # <<<<<<<<<<<<<< * * if not namehint: */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_ascii, __pyx_n_s_replace); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/image.pyx":70 * ext = namehint * if ext[0] == b'.': * ext = ext[1:] # <<<<<<<<<<<<<< * * return ext.upper() */ __pyx_slice__4 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__4); __Pyx_GIVEREF(__pyx_slice__4); /* "pygame_sdl2/image.pyx":120 * raise error() * * cdef Surface surf = Surface(()) # <<<<<<<<<<<<<< * surf.take_surface(img) * */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/image.pyx":34 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * # Attempt to initialize everything. Only fail loudly if all formats fail * global image_formats */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_init, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 34, __pyx_L1_error) /* "pygame_sdl2/image.pyx":51 * INIT_AVIF = IMG_INIT_AVIF * * def has_init(int flags): # <<<<<<<<<<<<<< * return (flags & image_formats) == flags * */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_flags); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_has_init, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 51, __pyx_L1_error) /* "pygame_sdl2/image.pyx":54 * return (flags & image_formats) == flags * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_quit, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 54, __pyx_L1_error) /* "pygame_sdl2/image.pyx":74 * return ext.upper() * * def load(fi, namehint="", size=None): # <<<<<<<<<<<<<< * """ * `size` */ __pyx_tuple__11 = PyTuple_Pack(11, __pyx_n_s_fi, __pyx_n_s_namehint, __pyx_n_s_size, __pyx_n_s_img, __pyx_n_s_rwops, __pyx_n_s_ftype, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_surf, __pyx_n_s_n, __pyx_n_s_has_alpha); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_load, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 74, __pyx_L1_error) __pyx_tuple__13 = PyTuple_Pack(2, ((PyObject*)__pyx_kp_s__2), Py_None); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "pygame_sdl2/image.pyx":155 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if not isinstance(filename, unicode_): */ __pyx_tuple__14 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_filename, __pyx_n_s_compression, __pyx_n_s_ext, __pyx_n_s_err, __pyx_n_s_utf8_filename, __pyx_n_s_fn, __pyx_n_s_rwops, __pyx_n_s_compression_level); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_save, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 155, __pyx_L1_error) __pyx_tuple__16 = PyTuple_Pack(1, ((PyObject *)__pyx_int_neg_1)); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "pygame_sdl2/image.pyx":187 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_get_extended, 187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(1, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_8(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_image(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_image}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "image", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initimage(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initimage(void) #else __Pyx_PyMODINIT_FUNC PyInit_image(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_image(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_image(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'image' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("image", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "image" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_image(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__image) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.image")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.image", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/image.pyx":24 * from pygame_sdl2.rwobject cimport to_rwops * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 24, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":25 * * from pygame_sdl2.error import error * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode # <<<<<<<<<<<<<< * * import sys */ __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_bytes); __Pyx_GIVEREF(__pyx_n_s_bytes); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_bytes)) __PYX_ERR(0, 25, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_unicode); __Pyx_GIVEREF(__pyx_n_s_unicode); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_unicode)) __PYX_ERR(0, 25, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_filesystem_encode); __Pyx_GIVEREF(__pyx_n_s_filesystem_encode); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_filesystem_encode)) __PYX_ERR(0, 25, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_filesystem_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filesystem_encode, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":27 * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode * * import sys # <<<<<<<<<<<<<< * import os * import pygame_sdl2 */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":28 * * import sys * import os # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":29 * import sys * import os * import pygame_sdl2 # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":32 * * * cdef int image_formats = 0 # <<<<<<<<<<<<<< * * def init(): */ __pyx_v_11pygame_sdl2_5image_image_formats = 0; /* "pygame_sdl2/image.pyx":34 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * # Attempt to initialize everything. Only fail loudly if all formats fail * global image_formats */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5image_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_image, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":41 * raise error() * * init() # <<<<<<<<<<<<<< * * # Make it possible for python to check individual formats */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":44 * * # Make it possible for python to check individual formats * INIT_JPG = IMG_INIT_JPG # <<<<<<<<<<<<<< * INIT_PNG = IMG_INIT_PNG * INIT_TIF = IMG_INIT_TIF */ __pyx_t_3 = __Pyx_PyInt_From_IMG_InitFlags(IMG_INIT_JPG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INIT_JPG, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":45 * # Make it possible for python to check individual formats * INIT_JPG = IMG_INIT_JPG * INIT_PNG = IMG_INIT_PNG # <<<<<<<<<<<<<< * INIT_TIF = IMG_INIT_TIF * INIT_WEBP = IMG_INIT_WEBP */ __pyx_t_3 = __Pyx_PyInt_From_IMG_InitFlags(IMG_INIT_PNG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INIT_PNG, __pyx_t_3) < 0) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":46 * INIT_JPG = IMG_INIT_JPG * INIT_PNG = IMG_INIT_PNG * INIT_TIF = IMG_INIT_TIF # <<<<<<<<<<<<<< * INIT_WEBP = IMG_INIT_WEBP * INIT_JXL = IMG_INIT_JXL */ __pyx_t_3 = __Pyx_PyInt_From_IMG_InitFlags(IMG_INIT_TIF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INIT_TIF, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":47 * INIT_PNG = IMG_INIT_PNG * INIT_TIF = IMG_INIT_TIF * INIT_WEBP = IMG_INIT_WEBP # <<<<<<<<<<<<<< * INIT_JXL = IMG_INIT_JXL * INIT_AVIF = IMG_INIT_AVIF */ __pyx_t_3 = __Pyx_PyInt_From_IMG_InitFlags(IMG_INIT_WEBP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INIT_WEBP, __pyx_t_3) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":48 * INIT_TIF = IMG_INIT_TIF * INIT_WEBP = IMG_INIT_WEBP * INIT_JXL = IMG_INIT_JXL # <<<<<<<<<<<<<< * INIT_AVIF = IMG_INIT_AVIF * */ __pyx_t_3 = __Pyx_PyInt_From_IMG_InitFlags(IMG_INIT_JXL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INIT_JXL, __pyx_t_3) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":49 * INIT_WEBP = IMG_INIT_WEBP * INIT_JXL = IMG_INIT_JXL * INIT_AVIF = IMG_INIT_AVIF # <<<<<<<<<<<<<< * * def has_init(int flags): */ __pyx_t_3 = __Pyx_PyInt_From_IMG_InitFlags(IMG_INIT_AVIF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INIT_AVIF, __pyx_t_3) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":51 * INIT_AVIF = IMG_INIT_AVIF * * def has_init(int flags): # <<<<<<<<<<<<<< * return (flags & image_formats) == flags * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5image_3has_init, 0, __pyx_n_s_has_init, NULL, __pyx_n_s_pygame_sdl2_image, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_init, __pyx_t_3) < 0) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":54 * return (flags & image_formats) == flags * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5image_5quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_image, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":74 * return ext.upper() * * def load(fi, namehint="", size=None): # <<<<<<<<<<<<<< * """ * `size` */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5image_7load, 0, __pyx_n_s_load, NULL, __pyx_n_s_pygame_sdl2_image, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_load, __pyx_t_3) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":155 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if not isinstance(filename, unicode_): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5image_9save, 0, __pyx_n_s_save, NULL, __pyx_n_s_pygame_sdl2_image, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_save, __pyx_t_3) < 0) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":187 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5image_11get_extended, 0, __pyx_n_s_get_extended, NULL, __pyx_n_s_pygame_sdl2_image, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_extended, __pyx_t_3) < 0) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.image", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.image"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_8 #define __PYX_HAVE_RT_ImportType_3_0_8 static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__3); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__6; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_IMG_InitFlags(IMG_InitFlags value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const IMG_InitFlags neg_one = (IMG_InitFlags) -1, const_zero = (IMG_InitFlags) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(IMG_InitFlags) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(IMG_InitFlags) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(IMG_InitFlags) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(IMG_InitFlags) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(IMG_InitFlags) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(IMG_InitFlags), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(IMG_InitFlags)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__18); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CheckBinaryVersion */ static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_8 #define __PYX_HAVE_RT_ImportFunction_3_0_8 static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709473.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.joystick.c0000664000175000017500000161611414760217141020662 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__joystick #define __PYX_HAVE_API__pygame_sdl2__joystick /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "", "src/pygame_sdl2/joystick.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_8joystick_Joystick; /* "pygame_sdl2/joystick.pyx":41 * * * cdef class Joystick: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_8joystick_Joystick { PyObject_HEAD PyObject *__weakref__; SDL_Joystick *joystick; int joyid; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.joystick" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.joystick" extern int __pyx_module_is_main_pygame_sdl2__joystick; int __pyx_module_is_main_pygame_sdl2__joystick = 0; /* Implementation of "pygame_sdl2.joystick" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; static const char __pyx_k__2[] = "*"; static const char __pyx_k_dx[] = "dx"; static const char __pyx_k_dy[] = "dy"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_hx[] = "hx"; static const char __pyx_k_hy[] = "hy"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__29[] = "?"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_button[] = "button"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_get_id[] = "get_id"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_get_hat[] = "get_hat"; static const char __pyx_k_Joystick[] = "Joystick"; static const char __pyx_k_get_axis[] = "get_axis"; static const char __pyx_k_get_ball[] = "get_ball"; static const char __pyx_k_get_init[] = "get_init"; static const char __pyx_k_get_name[] = "get_name"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_get_count[] = "get_count"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_get_button[] = "get_button"; static const char __pyx_k_hat_number[] = "hat_number"; static const char __pyx_k_axis_number[] = "axis_number"; static const char __pyx_k_ball_number[] = "ball_number"; static const char __pyx_k_get_numaxes[] = "get_numaxes"; static const char __pyx_k_get_numhats[] = "get_numhats"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_get_numballs[] = "get_numballs"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_Joystick_init[] = "Joystick.init"; static const char __pyx_k_Joystick_quit[] = "Joystick.quit"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_sdl_main_init[] = "sdl_main_init"; static const char __pyx_k_get_numbuttons[] = "get_numbuttons"; static const char __pyx_k_Joystick_get_id[] = "Joystick.get_id"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Joystick_get_hat[] = "Joystick.get_hat"; static const char __pyx_k_Joystick_get_axis[] = "Joystick.get_axis"; static const char __pyx_k_Joystick_get_ball[] = "Joystick.get_ball"; static const char __pyx_k_Joystick_get_init[] = "Joystick.get_init"; static const char __pyx_k_Joystick_get_name[] = "Joystick.get_name"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Joystick_get_button[] = "Joystick.get_button"; static const char __pyx_k_Joystick_get_numaxes[] = "Joystick.get_numaxes"; static const char __pyx_k_Joystick_get_numhats[] = "Joystick.get_numhats"; static const char __pyx_k_pygame_sdl2_joystick[] = "pygame_sdl2.joystick"; static const char __pyx_k_Joystick_get_numballs[] = "Joystick.get_numballs"; static const char __pyx_k_Joystick_get_numbuttons[] = "Joystick.get_numbuttons"; static const char __pyx_k_Joystick___reduce_cython[] = "Joystick.__reduce_cython__"; static const char __pyx_k_joystick_not_initialized[] = "joystick not initialized"; static const char __pyx_k_Joystick___setstate_cython[] = "Joystick.__setstate_cython__"; static const char __pyx_k_src_pygame_sdl2_joystick_pyx[] = "src/pygame_sdl2/joystick.pyx"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_4get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_6get_count(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick___cinit__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick_2__init__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_id); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_4init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_6quit(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_8get_init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_10get_id(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_12get_name(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_14get_numaxes(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_16get_numballs(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_20get_numhats(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_22get_axis(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_axis_number); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_24get_ball(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_ball_number); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_26get_button(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_button); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_28get_hat(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_hat_number); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_8joystick_Joystick(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_8joystick_Joystick; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_8joystick_Joystick; PyObject *__pyx_kp_u_; PyObject *__pyx_n_s_Joystick; PyObject *__pyx_n_s_Joystick___reduce_cython; PyObject *__pyx_n_s_Joystick___setstate_cython; PyObject *__pyx_n_s_Joystick_get_axis; PyObject *__pyx_n_s_Joystick_get_ball; PyObject *__pyx_n_s_Joystick_get_button; PyObject *__pyx_n_s_Joystick_get_hat; PyObject *__pyx_n_s_Joystick_get_id; PyObject *__pyx_n_s_Joystick_get_init; PyObject *__pyx_n_s_Joystick_get_name; PyObject *__pyx_n_s_Joystick_get_numaxes; PyObject *__pyx_n_s_Joystick_get_numballs; PyObject *__pyx_n_s_Joystick_get_numbuttons; PyObject *__pyx_n_s_Joystick_get_numhats; PyObject *__pyx_n_s_Joystick_init; PyObject *__pyx_n_s_Joystick_quit; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s__2; PyObject *__pyx_n_s__29; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_axis_number; PyObject *__pyx_n_s_ball_number; PyObject *__pyx_n_s_button; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_display; PyObject *__pyx_n_s_dx; PyObject *__pyx_n_s_dy; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_error; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_axis; PyObject *__pyx_n_s_get_ball; PyObject *__pyx_n_s_get_button; PyObject *__pyx_n_s_get_count; PyObject *__pyx_n_s_get_hat; PyObject *__pyx_n_s_get_id; PyObject *__pyx_n_s_get_init; PyObject *__pyx_n_s_get_name; PyObject *__pyx_n_s_get_numaxes; PyObject *__pyx_n_s_get_numballs; PyObject *__pyx_n_s_get_numbuttons; PyObject *__pyx_n_s_get_numhats; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_hat_number; PyObject *__pyx_n_s_hx; PyObject *__pyx_n_s_hy; PyObject *__pyx_n_s_id; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_kp_s_joystick_not_initialized; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_joystick; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_register_init; PyObject *__pyx_n_s_register_quit; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_sdl_main_init; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_joystick_pyx; PyObject *__pyx_n_s_state; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_test; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__27; PyObject *__pyx_codeobj__3; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__28; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_8joystick_Joystick); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_8joystick_Joystick); Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_axis); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_ball); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_button); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_hat); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_id); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_name); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_numaxes); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_numballs); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_numbuttons); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_numhats); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_init); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_quit); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s__2); Py_CLEAR(clear_module_state->__pyx_n_s__29); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_axis_number); Py_CLEAR(clear_module_state->__pyx_n_s_ball_number); Py_CLEAR(clear_module_state->__pyx_n_s_button); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_display); Py_CLEAR(clear_module_state->__pyx_n_s_dx); Py_CLEAR(clear_module_state->__pyx_n_s_dy); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_axis); Py_CLEAR(clear_module_state->__pyx_n_s_get_ball); Py_CLEAR(clear_module_state->__pyx_n_s_get_button); Py_CLEAR(clear_module_state->__pyx_n_s_get_count); Py_CLEAR(clear_module_state->__pyx_n_s_get_hat); Py_CLEAR(clear_module_state->__pyx_n_s_get_id); Py_CLEAR(clear_module_state->__pyx_n_s_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_get_name); Py_CLEAR(clear_module_state->__pyx_n_s_get_numaxes); Py_CLEAR(clear_module_state->__pyx_n_s_get_numballs); Py_CLEAR(clear_module_state->__pyx_n_s_get_numbuttons); Py_CLEAR(clear_module_state->__pyx_n_s_get_numhats); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_hat_number); Py_CLEAR(clear_module_state->__pyx_n_s_hx); Py_CLEAR(clear_module_state->__pyx_n_s_hy); Py_CLEAR(clear_module_state->__pyx_n_s_id); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_kp_s_joystick_not_initialized); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_joystick); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_register_init); Py_CLEAR(clear_module_state->__pyx_n_s_register_quit); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_main_init); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_joystick_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_codeobj__3); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__28); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_8joystick_Joystick); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_8joystick_Joystick); Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_axis); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_ball); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_button); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_hat); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_id); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_name); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_numaxes); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_numballs); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_numbuttons); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_numhats); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_init); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_quit); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s__2); Py_VISIT(traverse_module_state->__pyx_n_s__29); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_axis_number); Py_VISIT(traverse_module_state->__pyx_n_s_ball_number); Py_VISIT(traverse_module_state->__pyx_n_s_button); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_display); Py_VISIT(traverse_module_state->__pyx_n_s_dx); Py_VISIT(traverse_module_state->__pyx_n_s_dy); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_axis); Py_VISIT(traverse_module_state->__pyx_n_s_get_ball); Py_VISIT(traverse_module_state->__pyx_n_s_get_button); Py_VISIT(traverse_module_state->__pyx_n_s_get_count); Py_VISIT(traverse_module_state->__pyx_n_s_get_hat); Py_VISIT(traverse_module_state->__pyx_n_s_get_id); Py_VISIT(traverse_module_state->__pyx_n_s_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_get_name); Py_VISIT(traverse_module_state->__pyx_n_s_get_numaxes); Py_VISIT(traverse_module_state->__pyx_n_s_get_numballs); Py_VISIT(traverse_module_state->__pyx_n_s_get_numbuttons); Py_VISIT(traverse_module_state->__pyx_n_s_get_numhats); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_hat_number); Py_VISIT(traverse_module_state->__pyx_n_s_hx); Py_VISIT(traverse_module_state->__pyx_n_s_hy); Py_VISIT(traverse_module_state->__pyx_n_s_id); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_kp_s_joystick_not_initialized); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_joystick); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_register_init); Py_VISIT(traverse_module_state->__pyx_n_s_register_quit); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_main_init); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_joystick_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_codeobj__3); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__28); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_8joystick_Joystick __pyx_mstate_global->__pyx_type_11pygame_sdl2_8joystick_Joystick #endif #define __pyx_ptype_11pygame_sdl2_8joystick_Joystick __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_8joystick_Joystick #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_n_s_Joystick __pyx_mstate_global->__pyx_n_s_Joystick #define __pyx_n_s_Joystick___reduce_cython __pyx_mstate_global->__pyx_n_s_Joystick___reduce_cython #define __pyx_n_s_Joystick___setstate_cython __pyx_mstate_global->__pyx_n_s_Joystick___setstate_cython #define __pyx_n_s_Joystick_get_axis __pyx_mstate_global->__pyx_n_s_Joystick_get_axis #define __pyx_n_s_Joystick_get_ball __pyx_mstate_global->__pyx_n_s_Joystick_get_ball #define __pyx_n_s_Joystick_get_button __pyx_mstate_global->__pyx_n_s_Joystick_get_button #define __pyx_n_s_Joystick_get_hat __pyx_mstate_global->__pyx_n_s_Joystick_get_hat #define __pyx_n_s_Joystick_get_id __pyx_mstate_global->__pyx_n_s_Joystick_get_id #define __pyx_n_s_Joystick_get_init __pyx_mstate_global->__pyx_n_s_Joystick_get_init #define __pyx_n_s_Joystick_get_name __pyx_mstate_global->__pyx_n_s_Joystick_get_name #define __pyx_n_s_Joystick_get_numaxes __pyx_mstate_global->__pyx_n_s_Joystick_get_numaxes #define __pyx_n_s_Joystick_get_numballs __pyx_mstate_global->__pyx_n_s_Joystick_get_numballs #define __pyx_n_s_Joystick_get_numbuttons __pyx_mstate_global->__pyx_n_s_Joystick_get_numbuttons #define __pyx_n_s_Joystick_get_numhats __pyx_mstate_global->__pyx_n_s_Joystick_get_numhats #define __pyx_n_s_Joystick_init __pyx_mstate_global->__pyx_n_s_Joystick_init #define __pyx_n_s_Joystick_quit __pyx_mstate_global->__pyx_n_s_Joystick_quit #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s__2 __pyx_mstate_global->__pyx_n_s__2 #define __pyx_n_s__29 __pyx_mstate_global->__pyx_n_s__29 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_axis_number __pyx_mstate_global->__pyx_n_s_axis_number #define __pyx_n_s_ball_number __pyx_mstate_global->__pyx_n_s_ball_number #define __pyx_n_s_button __pyx_mstate_global->__pyx_n_s_button #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display #define __pyx_n_s_dx __pyx_mstate_global->__pyx_n_s_dx #define __pyx_n_s_dy __pyx_mstate_global->__pyx_n_s_dy #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_axis __pyx_mstate_global->__pyx_n_s_get_axis #define __pyx_n_s_get_ball __pyx_mstate_global->__pyx_n_s_get_ball #define __pyx_n_s_get_button __pyx_mstate_global->__pyx_n_s_get_button #define __pyx_n_s_get_count __pyx_mstate_global->__pyx_n_s_get_count #define __pyx_n_s_get_hat __pyx_mstate_global->__pyx_n_s_get_hat #define __pyx_n_s_get_id __pyx_mstate_global->__pyx_n_s_get_id #define __pyx_n_s_get_init __pyx_mstate_global->__pyx_n_s_get_init #define __pyx_n_s_get_name __pyx_mstate_global->__pyx_n_s_get_name #define __pyx_n_s_get_numaxes __pyx_mstate_global->__pyx_n_s_get_numaxes #define __pyx_n_s_get_numballs __pyx_mstate_global->__pyx_n_s_get_numballs #define __pyx_n_s_get_numbuttons __pyx_mstate_global->__pyx_n_s_get_numbuttons #define __pyx_n_s_get_numhats __pyx_mstate_global->__pyx_n_s_get_numhats #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_hat_number __pyx_mstate_global->__pyx_n_s_hat_number #define __pyx_n_s_hx __pyx_mstate_global->__pyx_n_s_hx #define __pyx_n_s_hy __pyx_mstate_global->__pyx_n_s_hy #define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_kp_s_joystick_not_initialized __pyx_mstate_global->__pyx_kp_s_joystick_not_initialized #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_joystick __pyx_mstate_global->__pyx_n_s_pygame_sdl2_joystick #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_register_init __pyx_mstate_global->__pyx_n_s_register_init #define __pyx_n_s_register_quit __pyx_mstate_global->__pyx_n_s_register_quit #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_sdl_main_init __pyx_mstate_global->__pyx_n_s_sdl_main_init #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_joystick_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_joystick_pyx #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 /* #### Code section: module_code ### */ /* "pygame_sdl2/joystick.pyx":23 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_8joystick_init}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/joystick.pyx":25 * @pygame_sdl2.register_init * def init(): * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/joystick.pyx":27 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = (SDL_InitSubSystem(SDL_INIT_JOYSTICK) != 0); if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/joystick.pyx":28 * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): * raise error() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 28, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":27 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/joystick.pyx":23 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":30 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_2quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_3quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_8joystick_2quit}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/joystick.pyx":32 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) # <<<<<<<<<<<<<< * * def get_init(): */ SDL_QuitSubSystem(SDL_INIT_JOYSTICK); /* "pygame_sdl2/joystick.pyx":30 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_4get_init, "get_init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_5get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_5get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_8joystick_4get_init}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_4get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_4get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/joystick.pyx":35 * * def get_init(): * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 # <<<<<<<<<<<<<< * * def get_count(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_WasInit(SDL_INIT_JOYSTICK) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.joystick.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_6get_count, "get_count()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_7get_count = {"get_count", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_7get_count, METH_NOARGS, __pyx_doc_11pygame_sdl2_8joystick_6get_count}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_count (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_6get_count(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_6get_count(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_count", 1); /* "pygame_sdl2/joystick.pyx":38 * * def get_count(): * return SDL_NumJoysticks() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(SDL_NumJoysticks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.joystick.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":48 * cdef int joyid * * def __cinit__(self): # <<<<<<<<<<<<<< * self.joystick = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick___cinit__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick___cinit__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/joystick.pyx":49 * * def __cinit__(self): * self.joystick = NULL # <<<<<<<<<<<<<< * * def __init__(self, id): */ __pyx_v_self->joystick = NULL; /* "pygame_sdl2/joystick.pyx":48 * cdef int joyid * * def __cinit__(self): # <<<<<<<<<<<<<< * self.joystick = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/joystick.pyx":51 * self.joystick = NULL * * def __init__(self, id): # <<<<<<<<<<<<<< * self.joyid = id * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_id = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_id,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_id)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 51, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_id = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 51, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_2__init__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v_id); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick_2__init__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_id) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/joystick.pyx":52 * * def __init__(self, id): * self.joyid = id # <<<<<<<<<<<<<< * * def init(self): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_id); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 52, __pyx_L1_error) __pyx_v_self->joyid = __pyx_t_1; /* "pygame_sdl2/joystick.pyx":51 * self.joystick = NULL * * def __init__(self, id): # <<<<<<<<<<<<<< * self.joyid = id * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/joystick.pyx":54 * self.joyid = id * * def init(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_4init, "Joystick.init(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_5init = {"init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_4init}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("init", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "init", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_4init(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_4init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/joystick.pyx":55 * * def init(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":56 * def init(self): * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error() */ __pyx_v_self->joystick = SDL_JoystickOpen(__pyx_v_self->joyid); /* "pygame_sdl2/joystick.pyx":57 * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":58 * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: * raise error() # <<<<<<<<<<<<<< * * def quit(self): # @ReservedAssignment */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 58, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":57 * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/joystick.pyx":55 * * def init(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: */ } /* "pygame_sdl2/joystick.pyx":54 * self.joyid = id * * def init(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":60 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_6quit, "Joystick.quit(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_7quit = {"quit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_6quit}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("quit", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "quit", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_6quit(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_6quit(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/joystick.pyx":61 * * def quit(self): # @ReservedAssignment * if self.joystick != NULL: # <<<<<<<<<<<<<< * SDL_JoystickClose(self.joystick) * self.joystick = NULL */ __pyx_t_1 = (__pyx_v_self->joystick != NULL); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":62 * def quit(self): # @ReservedAssignment * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) # <<<<<<<<<<<<<< * self.joystick = NULL * */ SDL_JoystickClose(__pyx_v_self->joystick); /* "pygame_sdl2/joystick.pyx":63 * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) * self.joystick = NULL # <<<<<<<<<<<<<< * * def get_init(self): */ __pyx_v_self->joystick = NULL; /* "pygame_sdl2/joystick.pyx":61 * * def quit(self): # @ReservedAssignment * if self.joystick != NULL: # <<<<<<<<<<<<<< * SDL_JoystickClose(self.joystick) * self.joystick = NULL */ } /* "pygame_sdl2/joystick.pyx":60 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":65 * self.joystick = NULL * * def get_init(self): # <<<<<<<<<<<<<< * if self.joystick: * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_8get_init, "Joystick.get_init(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_9get_init = {"get_init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_8get_init}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_init", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_init", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_8get_init(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_8get_init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/joystick.pyx":66 * * def get_init(self): * if self.joystick: # <<<<<<<<<<<<<< * return True * else: */ __pyx_t_1 = (__pyx_v_self->joystick != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":67 * def get_init(self): * if self.joystick: * return True # <<<<<<<<<<<<<< * else: * return False */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":66 * * def get_init(self): * if self.joystick: # <<<<<<<<<<<<<< * return True * else: */ } /* "pygame_sdl2/joystick.pyx":69 * return True * else: * return False # <<<<<<<<<<<<<< * * def get_id(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "pygame_sdl2/joystick.pyx":65 * self.joystick = NULL * * def get_init(self): # <<<<<<<<<<<<<< * if self.joystick: * return True */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":71 * return False * * def get_id(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_10get_id, "Joystick.get_id(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_11get_id = {"get_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_10get_id}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_id (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_id", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_id", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_10get_id(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_10get_id(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_id", 1); /* "pygame_sdl2/joystick.pyx":72 * * def get_id(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":73 * def get_id(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickInstanceID(self.joystick) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 73, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":72 * * def get_id(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":75 * raise error("joystick not initialized") * * return SDL_JoystickInstanceID(self.joystick) # <<<<<<<<<<<<<< * * def get_name(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int32_t(SDL_JoystickInstanceID(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":71 * return False * * def get_id(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_id", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":77 * return SDL_JoystickInstanceID(self.joystick) * * def get_name(self): # <<<<<<<<<<<<<< * cdef char *rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_12get_name, "Joystick.get_name(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_13get_name = {"get_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_12get_name}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_name (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_name", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_name", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_12get_name(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_12get_name(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { char *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_name", 1); /* "pygame_sdl2/joystick.pyx":80 * cdef char *rv * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":81 * * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * rv = SDL_JoystickName(self.joystick) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 81, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":80 * cdef char *rv * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":83 * raise error("joystick not initialized") * * rv = SDL_JoystickName(self.joystick) # <<<<<<<<<<<<<< * * if rv: */ __pyx_v_rv = SDL_JoystickName(__pyx_v_self->joystick); /* "pygame_sdl2/joystick.pyx":85 * rv = SDL_JoystickName(self.joystick) * * if rv: # <<<<<<<<<<<<<< * return rv.decode("utf-8") * else: */ __pyx_t_1 = (__pyx_v_rv != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":86 * * if rv: * return rv.decode("utf-8") # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_ssize_strlen(__pyx_v_rv); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(1, 86, __pyx_L1_error) __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_rv, 0, __pyx_t_6, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":85 * rv = SDL_JoystickName(self.joystick) * * if rv: # <<<<<<<<<<<<<< * return rv.decode("utf-8") * else: */ } /* "pygame_sdl2/joystick.pyx":88 * return rv.decode("utf-8") * else: * return None # <<<<<<<<<<<<<< * * def get_numaxes(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "pygame_sdl2/joystick.pyx":77 * return SDL_JoystickInstanceID(self.joystick) * * def get_name(self): # <<<<<<<<<<<<<< * cdef char *rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":90 * return None * * def get_numaxes(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_14get_numaxes, "Joystick.get_numaxes(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_15get_numaxes = {"get_numaxes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_14get_numaxes}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numaxes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_numaxes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_numaxes", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_14get_numaxes(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_14get_numaxes(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numaxes", 1); /* "pygame_sdl2/joystick.pyx":91 * * def get_numaxes(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":92 * def get_numaxes(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumAxes(self.joystick) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 92, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":91 * * def get_numaxes(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":94 * raise error("joystick not initialized") * * return SDL_JoystickNumAxes(self.joystick) # <<<<<<<<<<<<<< * * def get_numballs(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_JoystickNumAxes(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":90 * return None * * def get_numaxes(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numaxes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":96 * return SDL_JoystickNumAxes(self.joystick) * * def get_numballs(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_16get_numballs, "Joystick.get_numballs(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_17get_numballs = {"get_numballs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_16get_numballs}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numballs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_numballs", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_numballs", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_16get_numballs(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_16get_numballs(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numballs", 1); /* "pygame_sdl2/joystick.pyx":97 * * def get_numballs(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":98 * def get_numballs(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumBalls(self.joystick) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 98, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":97 * * def get_numballs(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":100 * raise error("joystick not initialized") * * return SDL_JoystickNumBalls(self.joystick) # <<<<<<<<<<<<<< * * def get_numbuttons(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_JoystickNumBalls(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":96 * return SDL_JoystickNumAxes(self.joystick) * * def get_numballs(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numballs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":102 * return SDL_JoystickNumBalls(self.joystick) * * def get_numbuttons(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons, "Joystick.get_numbuttons(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons = {"get_numbuttons", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numbuttons (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_numbuttons", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_numbuttons", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numbuttons", 1); /* "pygame_sdl2/joystick.pyx":103 * * def get_numbuttons(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":104 * def get_numbuttons(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumButtons(self.joystick) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 104, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":103 * * def get_numbuttons(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":106 * raise error("joystick not initialized") * * return SDL_JoystickNumButtons(self.joystick) # <<<<<<<<<<<<<< * * def get_numhats(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_JoystickNumButtons(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":102 * return SDL_JoystickNumBalls(self.joystick) * * def get_numbuttons(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numbuttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":108 * return SDL_JoystickNumButtons(self.joystick) * * def get_numhats(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_20get_numhats, "Joystick.get_numhats(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_21get_numhats = {"get_numhats", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_20get_numhats}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numhats (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_numhats", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_numhats", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_20get_numhats(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_20get_numhats(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numhats", 1); /* "pygame_sdl2/joystick.pyx":109 * * def get_numhats(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":110 * def get_numhats(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumHats(self.joystick) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 110, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":109 * * def get_numhats(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":112 * raise error("joystick not initialized") * * return SDL_JoystickNumHats(self.joystick) # <<<<<<<<<<<<<< * * def get_axis(self, axis_number): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_JoystickNumHats(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":108 * return SDL_JoystickNumButtons(self.joystick) * * def get_numhats(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numhats", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":114 * return SDL_JoystickNumHats(self.joystick) * * def get_axis(self, axis_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_22get_axis, "Joystick.get_axis(self, axis_number)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_23get_axis = {"get_axis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_22get_axis}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_axis_number = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_axis (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_axis_number,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_axis_number)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 114, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_axis") < 0)) __PYX_ERR(1, 114, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_axis_number = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_axis", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 114, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_22get_axis(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v_axis_number); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_22get_axis(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_axis_number) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_axis", 1); /* "pygame_sdl2/joystick.pyx":115 * * def get_axis(self, axis_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":116 * def get_axis(self, axis_number): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 116, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":115 * * def get_axis(self, axis_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":118 * raise error("joystick not initialized") * * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 # <<<<<<<<<<<<<< * * def get_ball(self, ball_number): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_axis_number); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 118, __pyx_L1_error) __pyx_t_2 = PyFloat_FromDouble((((double)SDL_JoystickGetAxis(__pyx_v_self->joystick, __pyx_t_5)) / 32768.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":114 * return SDL_JoystickNumHats(self.joystick) * * def get_axis(self, axis_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":120 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 * * def get_ball(self, ball_number): # <<<<<<<<<<<<<< * cdef int dx, dy * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_24get_ball, "Joystick.get_ball(self, ball_number)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_25get_ball = {"get_ball", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_24get_ball}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ball_number = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_ball (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ball_number,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ball_number)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 120, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_ball") < 0)) __PYX_ERR(1, 120, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ball_number = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_ball", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 120, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_ball", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_24get_ball(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v_ball_number); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_24get_ball(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_ball_number) { int __pyx_v_dx; int __pyx_v_dy; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_ball", 1); /* "pygame_sdl2/joystick.pyx":123 * cdef int dx, dy * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":124 * * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 124, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":123 * cdef int dx, dy * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":126 * raise error("joystick not initialized") * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: # <<<<<<<<<<<<<< * return (dx, dy) * else: */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_ball_number); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 126, __pyx_L1_error) __pyx_t_1 = (SDL_JoystickGetBall(__pyx_v_self->joystick, __pyx_t_5, (&__pyx_v_dx), (&__pyx_v_dy)) == 0); if (likely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":127 * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: * return (dx, dy) # <<<<<<<<<<<<<< * else: * raise error() */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dy); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(1, 127, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(1, 127, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":126 * raise error("joystick not initialized") * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: # <<<<<<<<<<<<<< * return (dx, dy) * else: */ } /* "pygame_sdl2/joystick.pyx":129 * return (dx, dy) * else: * raise error() # <<<<<<<<<<<<<< * * def get_button(self, button): */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 129, __pyx_L1_error) } /* "pygame_sdl2/joystick.pyx":120 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 * * def get_ball(self, ball_number): # <<<<<<<<<<<<<< * cdef int dx, dy * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_ball", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":131 * raise error() * * def get_button(self, button): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_26get_button, "Joystick.get_button(self, button)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_27get_button = {"get_button", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_26get_button}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_button = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_button (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_button,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_button)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_button") < 0)) __PYX_ERR(1, 131, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_button = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_button", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 131, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_26get_button(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v_button); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_26get_button(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_button", 1); /* "pygame_sdl2/joystick.pyx":132 * * def get_button(self, button): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":133 * def get_button(self, button): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickGetButton(self.joystick, button) == 1 */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 133, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":132 * * def get_button(self, button): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":135 * raise error("joystick not initialized") * * return SDL_JoystickGetButton(self.joystick, button) == 1 # <<<<<<<<<<<<<< * * def get_hat(self, hat_number): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_button); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 135, __pyx_L1_error) __pyx_t_2 = __Pyx_PyBool_FromLong((SDL_JoystickGetButton(__pyx_v_self->joystick, __pyx_t_5) == 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":131 * raise error() * * def get_button(self, button): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":137 * return SDL_JoystickGetButton(self.joystick, button) == 1 * * def get_hat(self, hat_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_28get_hat, "Joystick.get_hat(self, hat_number)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_29get_hat = {"get_hat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_28get_hat}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_hat_number = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_hat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hat_number,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hat_number)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 137, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_hat") < 0)) __PYX_ERR(1, 137, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_hat_number = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_hat", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 137, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_hat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_28get_hat(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v_hat_number); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_28get_hat(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_hat_number) { Uint8 __pyx_v_state; long __pyx_v_hx; long __pyx_v_hy; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_hat", 1); /* "pygame_sdl2/joystick.pyx":138 * * def get_hat(self, hat_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":139 * def get_hat(self, hat_number): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * state = SDL_JoystickGetHat(self.joystick, hat_number) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 139, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":138 * * def get_hat(self, hat_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":141 * raise error("joystick not initialized") * * state = SDL_JoystickGetHat(self.joystick, hat_number) # <<<<<<<<<<<<<< * hx = hy = 0 * if state & SDL_HAT_LEFT: */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_hat_number); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error) __pyx_v_state = SDL_JoystickGetHat(__pyx_v_self->joystick, __pyx_t_5); /* "pygame_sdl2/joystick.pyx":142 * * state = SDL_JoystickGetHat(self.joystick, hat_number) * hx = hy = 0 # <<<<<<<<<<<<<< * if state & SDL_HAT_LEFT: * hx = -1 */ __pyx_v_hx = 0; __pyx_v_hy = 0; /* "pygame_sdl2/joystick.pyx":143 * state = SDL_JoystickGetHat(self.joystick, hat_number) * hx = hy = 0 * if state & SDL_HAT_LEFT: # <<<<<<<<<<<<<< * hx = -1 * elif state & SDL_HAT_RIGHT: */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_LEFT) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":144 * hx = hy = 0 * if state & SDL_HAT_LEFT: * hx = -1 # <<<<<<<<<<<<<< * elif state & SDL_HAT_RIGHT: * hx = 1 */ __pyx_v_hx = -1L; /* "pygame_sdl2/joystick.pyx":143 * state = SDL_JoystickGetHat(self.joystick, hat_number) * hx = hy = 0 * if state & SDL_HAT_LEFT: # <<<<<<<<<<<<<< * hx = -1 * elif state & SDL_HAT_RIGHT: */ goto __pyx_L4; } /* "pygame_sdl2/joystick.pyx":145 * if state & SDL_HAT_LEFT: * hx = -1 * elif state & SDL_HAT_RIGHT: # <<<<<<<<<<<<<< * hx = 1 * */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_RIGHT) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":146 * hx = -1 * elif state & SDL_HAT_RIGHT: * hx = 1 # <<<<<<<<<<<<<< * * if state & SDL_HAT_UP: */ __pyx_v_hx = 1; /* "pygame_sdl2/joystick.pyx":145 * if state & SDL_HAT_LEFT: * hx = -1 * elif state & SDL_HAT_RIGHT: # <<<<<<<<<<<<<< * hx = 1 * */ } __pyx_L4:; /* "pygame_sdl2/joystick.pyx":148 * hx = 1 * * if state & SDL_HAT_UP: # <<<<<<<<<<<<<< * hy = 1 * elif state & SDL_HAT_DOWN: */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_UP) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":149 * * if state & SDL_HAT_UP: * hy = 1 # <<<<<<<<<<<<<< * elif state & SDL_HAT_DOWN: * hy = -1 */ __pyx_v_hy = 1; /* "pygame_sdl2/joystick.pyx":148 * hx = 1 * * if state & SDL_HAT_UP: # <<<<<<<<<<<<<< * hy = 1 * elif state & SDL_HAT_DOWN: */ goto __pyx_L5; } /* "pygame_sdl2/joystick.pyx":150 * if state & SDL_HAT_UP: * hy = 1 * elif state & SDL_HAT_DOWN: # <<<<<<<<<<<<<< * hy = -1 * */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_DOWN) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":151 * hy = 1 * elif state & SDL_HAT_DOWN: * hy = -1 # <<<<<<<<<<<<<< * * return (hx, hy) */ __pyx_v_hy = -1L; /* "pygame_sdl2/joystick.pyx":150 * if state & SDL_HAT_UP: * hy = 1 * elif state & SDL_HAT_DOWN: # <<<<<<<<<<<<<< * hy = -1 * */ } __pyx_L5:; /* "pygame_sdl2/joystick.pyx":153 * hy = -1 * * return (hx, hy) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_hx); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_hy); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(1, 153, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":137 * return SDL_JoystickGetButton(self.joystick, button) == 1 * * def get_hat(self, hat_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_hat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__, "Joystick.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__, "Joystick.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_8joystick_Joystick(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_11pygame_sdl2_8joystick_8Joystick_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_8joystick_Joystick(PyObject *o) { struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *p = (struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_8joystick_Joystick) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_11pygame_sdl2_8joystick_Joystick[] = { {"init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_4init}, {"quit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_6quit}, {"get_init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_8get_init}, {"get_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_10get_id}, {"get_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_12get_name}, {"get_numaxes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_14get_numaxes}, {"get_numballs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_16get_numballs}, {"get_numbuttons", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons}, {"get_numhats", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_20get_numhats}, {"get_axis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_22get_axis}, {"get_ball", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_24get_ball}, {"get_button", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_26get_button}, {"get_hat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_28get_hat}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_8joystick_Joystick_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_8joystick_Joystick}, {Py_tp_doc, (void *)PyDoc_STR("Joystick(id)")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_8joystick_Joystick}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_8joystick_Joystick}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_8joystick_Joystick_spec = { "pygame_sdl2.joystick.Joystick", sizeof(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_8joystick_Joystick_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_8joystick_Joystick = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.joystick.""Joystick", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_8joystick_Joystick, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Joystick(id)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_8joystick_Joystick, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_8joystick_Joystick, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_Joystick, __pyx_k_Joystick, sizeof(__pyx_k_Joystick), 0, 0, 1, 1}, {&__pyx_n_s_Joystick___reduce_cython, __pyx_k_Joystick___reduce_cython, sizeof(__pyx_k_Joystick___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Joystick___setstate_cython, __pyx_k_Joystick___setstate_cython, sizeof(__pyx_k_Joystick___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_axis, __pyx_k_Joystick_get_axis, sizeof(__pyx_k_Joystick_get_axis), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_ball, __pyx_k_Joystick_get_ball, sizeof(__pyx_k_Joystick_get_ball), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_button, __pyx_k_Joystick_get_button, sizeof(__pyx_k_Joystick_get_button), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_hat, __pyx_k_Joystick_get_hat, sizeof(__pyx_k_Joystick_get_hat), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_id, __pyx_k_Joystick_get_id, sizeof(__pyx_k_Joystick_get_id), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_init, __pyx_k_Joystick_get_init, sizeof(__pyx_k_Joystick_get_init), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_name, __pyx_k_Joystick_get_name, sizeof(__pyx_k_Joystick_get_name), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_numaxes, __pyx_k_Joystick_get_numaxes, sizeof(__pyx_k_Joystick_get_numaxes), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_numballs, __pyx_k_Joystick_get_numballs, sizeof(__pyx_k_Joystick_get_numballs), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_numbuttons, __pyx_k_Joystick_get_numbuttons, sizeof(__pyx_k_Joystick_get_numbuttons), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_numhats, __pyx_k_Joystick_get_numhats, sizeof(__pyx_k_Joystick_get_numhats), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_init, __pyx_k_Joystick_init, sizeof(__pyx_k_Joystick_init), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_quit, __pyx_k_Joystick_quit, sizeof(__pyx_k_Joystick_quit), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, {&__pyx_n_s__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_axis_number, __pyx_k_axis_number, sizeof(__pyx_k_axis_number), 0, 0, 1, 1}, {&__pyx_n_s_ball_number, __pyx_k_ball_number, sizeof(__pyx_k_ball_number), 0, 0, 1, 1}, {&__pyx_n_s_button, __pyx_k_button, sizeof(__pyx_k_button), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1}, {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_axis, __pyx_k_get_axis, sizeof(__pyx_k_get_axis), 0, 0, 1, 1}, {&__pyx_n_s_get_ball, __pyx_k_get_ball, sizeof(__pyx_k_get_ball), 0, 0, 1, 1}, {&__pyx_n_s_get_button, __pyx_k_get_button, sizeof(__pyx_k_get_button), 0, 0, 1, 1}, {&__pyx_n_s_get_count, __pyx_k_get_count, sizeof(__pyx_k_get_count), 0, 0, 1, 1}, {&__pyx_n_s_get_hat, __pyx_k_get_hat, sizeof(__pyx_k_get_hat), 0, 0, 1, 1}, {&__pyx_n_s_get_id, __pyx_k_get_id, sizeof(__pyx_k_get_id), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_name, __pyx_k_get_name, sizeof(__pyx_k_get_name), 0, 0, 1, 1}, {&__pyx_n_s_get_numaxes, __pyx_k_get_numaxes, sizeof(__pyx_k_get_numaxes), 0, 0, 1, 1}, {&__pyx_n_s_get_numballs, __pyx_k_get_numballs, sizeof(__pyx_k_get_numballs), 0, 0, 1, 1}, {&__pyx_n_s_get_numbuttons, __pyx_k_get_numbuttons, sizeof(__pyx_k_get_numbuttons), 0, 0, 1, 1}, {&__pyx_n_s_get_numhats, __pyx_k_get_numhats, sizeof(__pyx_k_get_numhats), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_hat_number, __pyx_k_hat_number, sizeof(__pyx_k_hat_number), 0, 0, 1, 1}, {&__pyx_n_s_hx, __pyx_k_hx, sizeof(__pyx_k_hx), 0, 0, 1, 1}, {&__pyx_n_s_hy, __pyx_k_hy, sizeof(__pyx_k_hy), 0, 0, 1, 1}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_kp_s_joystick_not_initialized, __pyx_k_joystick_not_initialized, sizeof(__pyx_k_joystick_not_initialized), 0, 0, 1, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_joystick, __pyx_k_pygame_sdl2_joystick, sizeof(__pyx_k_pygame_sdl2_joystick), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_k_src_pygame_sdl2_joystick_pyx, sizeof(__pyx_k_src_pygame_sdl2_joystick_pyx), 0, 0, 1, 0}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/joystick.pyx":23 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_init, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 23, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":30 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) */ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_quit, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(1, 30, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_init, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 34, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_count, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 37, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":54 * self.joyid = id * * def init(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_init, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 54, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":60 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) */ __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_quit, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(1, 60, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":65 * self.joystick = NULL * * def get_init(self): # <<<<<<<<<<<<<< * if self.joystick: * return True */ __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_init, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 65, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":71 * return False * * def get_id(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_id, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(1, 71, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":77 * return SDL_JoystickInstanceID(self.joystick) * * def get_name(self): # <<<<<<<<<<<<<< * cdef char *rv * */ __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_name, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(1, 77, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":90 * return None * * def get_numaxes(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_numaxes, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 90, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":96 * return SDL_JoystickNumAxes(self.joystick) * * def get_numballs(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_numballs, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 96, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":102 * return SDL_JoystickNumBalls(self.joystick) * * def get_numbuttons(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_numbuttons, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 102, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":108 * return SDL_JoystickNumButtons(self.joystick) * * def get_numhats(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_numhats, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 108, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":114 * return SDL_JoystickNumHats(self.joystick) * * def get_axis(self, axis_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_axis_number); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_axis, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(1, 114, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":120 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 * * def get_ball(self, ball_number): # <<<<<<<<<<<<<< * cdef int dx, dy * */ __pyx_tuple__20 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ball_number, __pyx_n_s_dx, __pyx_n_s_dy); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_ball, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 120, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":131 * raise error() * * def get_button(self, button): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_button); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_button, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 131, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":137 * return SDL_JoystickGetButton(self.joystick, button) == 1 * * def get_hat(self, hat_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_tuple__24 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_hat_number, __pyx_n_s_state, __pyx_n_s_hx, __pyx_n_s_hy); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_hat, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 137, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_8joystick_Joystick = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_8joystick_Joystick_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_8joystick_Joystick)) __PYX_ERR(1, 41, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_8joystick_Joystick_spec, __pyx_ptype_11pygame_sdl2_8joystick_Joystick) < 0) __PYX_ERR(1, 41, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_8joystick_Joystick = &__pyx_type_11pygame_sdl2_8joystick_Joystick; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_8joystick_Joystick) < 0) __PYX_ERR(1, 41, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_8joystick_Joystick->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_8joystick_Joystick->tp_dictoffset && __pyx_ptype_11pygame_sdl2_8joystick_Joystick->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_8joystick_Joystick->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Joystick, (PyObject *) __pyx_ptype_11pygame_sdl2_8joystick_Joystick) < 0) __PYX_ERR(1, 41, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_8joystick_Joystick->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_8joystick_Joystick->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick, __weakref__); #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_8joystick_Joystick) < 0) __PYX_ERR(1, 41, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_joystick(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_joystick}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "joystick", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initjoystick(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initjoystick(void) #else __Pyx_PyMODINIT_FUNC PyInit_joystick(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_joystick(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_joystick(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'joystick' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("joystick", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "joystick" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_joystick(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__joystick) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.joystick")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.joystick", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "pygame_sdl2/joystick.pyx":20 * * from sdl2 cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(1, 20, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/joystick.pyx":21 * from sdl2 cimport * * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/joystick.pyx":23 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/joystick.pyx":30 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_3quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_5get_init, 0, __pyx_n_s_get_init, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_7get_count, 0, __pyx_n_s_get_count, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_count, __pyx_t_2) < 0) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":54 * self.joyid = id * * def init(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_5init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_init, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(1, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":60 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_7quit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_quit, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":65 * self.joystick = NULL * * def get_init(self): # <<<<<<<<<<<<<< * if self.joystick: * return True */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_9get_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_init, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":71 * return False * * def get_id(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_11get_id, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_id, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_id, __pyx_t_2) < 0) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":77 * return SDL_JoystickInstanceID(self.joystick) * * def get_name(self): # <<<<<<<<<<<<<< * cdef char *rv * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_13get_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_name, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_name, __pyx_t_2) < 0) __PYX_ERR(1, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":90 * return None * * def get_numaxes(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_15get_numaxes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_numaxes, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_numaxes, __pyx_t_2) < 0) __PYX_ERR(1, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":96 * return SDL_JoystickNumAxes(self.joystick) * * def get_numballs(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_17get_numballs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_numballs, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_numballs, __pyx_t_2) < 0) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":102 * return SDL_JoystickNumBalls(self.joystick) * * def get_numbuttons(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_numbuttons, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_numbuttons, __pyx_t_2) < 0) __PYX_ERR(1, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":108 * return SDL_JoystickNumButtons(self.joystick) * * def get_numhats(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_21get_numhats, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_numhats, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_numhats, __pyx_t_2) < 0) __PYX_ERR(1, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":114 * return SDL_JoystickNumHats(self.joystick) * * def get_axis(self, axis_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_23get_axis, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_axis, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_axis, __pyx_t_2) < 0) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":120 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 * * def get_ball(self, ball_number): # <<<<<<<<<<<<<< * cdef int dx, dy * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_25get_ball, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_ball, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_ball, __pyx_t_2) < 0) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":131 * raise error() * * def get_button(self, button): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_27get_button, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_button, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_button, __pyx_t_2) < 0) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":137 * return SDL_JoystickGetButton(self.joystick, button) == 1 * * def get_hat(self, hat_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_29get_hat, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_hat, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_hat, __pyx_t_2) < 0) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.joystick", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.joystick"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__2; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__29); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709472.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.key.c0000664000175000017500000153130214760217140017605 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__key #define __PYX_HAVE_API__pygame_sdl2__key /* Early includes */ #include #include #include #include #include "SDL.h" #include #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/key.pyx", "", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", "src/pygame_sdl2/rect.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_3key_KeyboardState; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/key.pyx":28 * * * cdef class KeyboardState: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_3key_KeyboardState { PyObject_HEAD PyObject *__weakref__; uint8_t *data; int numkeys; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 #define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_8 { __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_Keymod __Pyx_PyInt_As_SDL_Keymod(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* VoidPtrImport.proto */ static int __Pyx_ImportVoidPtr_3_0_8(PyObject *module, const char *name, void **p, const char *sig); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "libc.stdlib" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.display" */ static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from "pygame_sdl2.rect" */ static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.key" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.key" extern int __pyx_module_is_main_pygame_sdl2__key; int __pyx_module_is_main_pygame_sdl2__key = 0; /* Implementation of "pygame_sdl2.key" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k__3[] = "."; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k__26[] = "?"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_delay[] = "delay"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_name_2[] = "name"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_window[] = "window"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_get_mods[] = "get_mods"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_interval[] = "interval"; static const char __pyx_k_sdl_rect[] = "sdl_rect"; static const char __pyx_k_set_mods[] = "set_mods"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_get_repeat[] = "get_repeat"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_set_repeat[] = "set_repeat"; static const char __pyx_k_text_input[] = "text_input"; static const char __pyx_k_get_focused[] = "get_focused"; static const char __pyx_k_get_pressed[] = "get_pressed"; static const char __pyx_k_Out_of_range[] = "Out of range."; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_KeyboardState[] = "KeyboardState"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_pygame_sdl2_key[] = "pygame_sdl2.key"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_stop_text_input[] = "stop_text_input"; static const char __pyx_k_start_text_input[] = "start_text_input"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_set_text_input_rect[] = "set_text_input_rect"; static const char __pyx_k_src_pygame_sdl2_key_pyx[] = "src/pygame_sdl2/key.pyx"; static const char __pyx_k_is_screen_keyboard_shown[] = "is_screen_keyboard_shown"; static const char __pyx_k_has_screen_keyboard_support[] = "has_screen_keyboard_support"; static const char __pyx_k_KeyboardState___reduce_cython[] = "KeyboardState.__reduce_cython__"; static const char __pyx_k_KeyboardState___setstate_cython[] = "KeyboardState.__setstate_cython__"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; /* #### Code section: decls ### */ static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState___cinit__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_3key_13KeyboardState_2__dealloc__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState_4__init__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_6__getitem__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, int __pyx_v_key); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_get_focused(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_2get_pressed(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_4get_mods(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_6set_mods(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_8set_repeat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_delay, CYTHON_UNUSED PyObject *__pyx_v_interval); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_10get_repeat(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_12name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_14start_text_input(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_16stop_text_input(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_18set_text_input_rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_20has_screen_keyboard_support(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_22is_screen_keyboard_shown(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_3key_KeyboardState(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect; #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_3key_KeyboardState; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_3key_KeyboardState; PyObject *__pyx_n_s_IndexError; PyObject *__pyx_n_s_KeyboardState; PyObject *__pyx_n_s_KeyboardState___reduce_cython; PyObject *__pyx_n_s_KeyboardState___setstate_cython; PyObject *__pyx_kp_s_Out_of_range; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s__26; PyObject *__pyx_kp_u__3; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_delay; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_error; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_focused; PyObject *__pyx_n_s_get_mods; PyObject *__pyx_n_s_get_pressed; PyObject *__pyx_n_s_get_repeat; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_has_screen_keyboard_support; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_interval; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_is_screen_keyboard_shown; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_key; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_key; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_rect; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_sdl_rect; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_mods; PyObject *__pyx_n_s_set_repeat; PyObject *__pyx_n_s_set_text_input_rect; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_kp_s_src_pygame_sdl2_key_pyx; PyObject *__pyx_n_s_start_text_input; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_stop_text_input; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_text_input; PyObject *__pyx_n_s_window; PyObject *__pyx_int_0; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__25; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__24; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_3key_KeyboardState); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_3key_KeyboardState); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); Py_CLEAR(clear_module_state->__pyx_n_s_KeyboardState); Py_CLEAR(clear_module_state->__pyx_n_s_KeyboardState___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_KeyboardState___setstate_cython); Py_CLEAR(clear_module_state->__pyx_kp_s_Out_of_range); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s__26); Py_CLEAR(clear_module_state->__pyx_kp_u__3); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_delay); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_focused); Py_CLEAR(clear_module_state->__pyx_n_s_get_mods); Py_CLEAR(clear_module_state->__pyx_n_s_get_pressed); Py_CLEAR(clear_module_state->__pyx_n_s_get_repeat); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_has_screen_keyboard_support); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_interval); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_is_screen_keyboard_shown); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_key); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_key); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_rect); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_rect); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_mods); Py_CLEAR(clear_module_state->__pyx_n_s_set_repeat); Py_CLEAR(clear_module_state->__pyx_n_s_set_text_input_rect); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_key_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start_text_input); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_stop_text_input); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_text_input); Py_CLEAR(clear_module_state->__pyx_n_s_window); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__24); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_3key_KeyboardState); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_3key_KeyboardState); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); Py_VISIT(traverse_module_state->__pyx_n_s_KeyboardState); Py_VISIT(traverse_module_state->__pyx_n_s_KeyboardState___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_KeyboardState___setstate_cython); Py_VISIT(traverse_module_state->__pyx_kp_s_Out_of_range); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s__26); Py_VISIT(traverse_module_state->__pyx_kp_u__3); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_delay); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_focused); Py_VISIT(traverse_module_state->__pyx_n_s_get_mods); Py_VISIT(traverse_module_state->__pyx_n_s_get_pressed); Py_VISIT(traverse_module_state->__pyx_n_s_get_repeat); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_has_screen_keyboard_support); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_interval); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_is_screen_keyboard_shown); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_key); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_key); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_rect); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_rect); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_mods); Py_VISIT(traverse_module_state->__pyx_n_s_set_repeat); Py_VISIT(traverse_module_state->__pyx_n_s_set_text_input_rect); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_key_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start_text_input); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_stop_text_input); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_text_input); Py_VISIT(traverse_module_state->__pyx_n_s_window); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__24); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7display_Window __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7display_Window #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_4rect_Rect __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_4rect_Rect #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_3key_KeyboardState __pyx_mstate_global->__pyx_type_11pygame_sdl2_3key_KeyboardState #endif #define __pyx_ptype_11pygame_sdl2_3key_KeyboardState __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_3key_KeyboardState #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError #define __pyx_n_s_KeyboardState __pyx_mstate_global->__pyx_n_s_KeyboardState #define __pyx_n_s_KeyboardState___reduce_cython __pyx_mstate_global->__pyx_n_s_KeyboardState___reduce_cython #define __pyx_n_s_KeyboardState___setstate_cython __pyx_mstate_global->__pyx_n_s_KeyboardState___setstate_cython #define __pyx_kp_s_Out_of_range __pyx_mstate_global->__pyx_kp_s_Out_of_range #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s__26 __pyx_mstate_global->__pyx_n_s__26 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_delay __pyx_mstate_global->__pyx_n_s_delay #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_focused __pyx_mstate_global->__pyx_n_s_get_focused #define __pyx_n_s_get_mods __pyx_mstate_global->__pyx_n_s_get_mods #define __pyx_n_s_get_pressed __pyx_mstate_global->__pyx_n_s_get_pressed #define __pyx_n_s_get_repeat __pyx_mstate_global->__pyx_n_s_get_repeat #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_has_screen_keyboard_support __pyx_mstate_global->__pyx_n_s_has_screen_keyboard_support #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_interval __pyx_mstate_global->__pyx_n_s_interval #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_is_screen_keyboard_shown __pyx_mstate_global->__pyx_n_s_is_screen_keyboard_shown #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_key __pyx_mstate_global->__pyx_n_s_pygame_sdl2_key #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_rect __pyx_mstate_global->__pyx_n_s_rect #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_sdl_rect __pyx_mstate_global->__pyx_n_s_sdl_rect #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_mods __pyx_mstate_global->__pyx_n_s_set_mods #define __pyx_n_s_set_repeat __pyx_mstate_global->__pyx_n_s_set_repeat #define __pyx_n_s_set_text_input_rect __pyx_mstate_global->__pyx_n_s_set_text_input_rect #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_kp_s_src_pygame_sdl2_key_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_key_pyx #define __pyx_n_s_start_text_input __pyx_mstate_global->__pyx_n_s_start_text_input #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_stop_text_input __pyx_mstate_global->__pyx_n_s_stop_text_input #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_text_input __pyx_mstate_global->__pyx_n_s_text_input #define __pyx_n_s_window __pyx_mstate_global->__pyx_n_s_window #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 /* #### Code section: module_code ### */ /* "pygame_sdl2/key.pyx":35 * cdef int numkeys * * def __cinit__(self): # <<<<<<<<<<<<<< * self.data = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState___cinit__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState___cinit__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/key.pyx":36 * * def __cinit__(self): * self.data = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->data = NULL; /* "pygame_sdl2/key.pyx":35 * cdef int numkeys * * def __cinit__(self): # <<<<<<<<<<<<<< * self.data = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/key.pyx":38 * self.data = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.data != NULL: * free(self.data) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_3key_13KeyboardState_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_3key_13KeyboardState_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_3key_13KeyboardState_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_3key_13KeyboardState_2__dealloc__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { int __pyx_t_1; /* "pygame_sdl2/key.pyx":39 * * def __dealloc__(self): * if self.data != NULL: # <<<<<<<<<<<<<< * free(self.data) * */ __pyx_t_1 = (__pyx_v_self->data != NULL); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":40 * def __dealloc__(self): * if self.data != NULL: * free(self.data) # <<<<<<<<<<<<<< * * def __init__(self): */ free(__pyx_v_self->data); /* "pygame_sdl2/key.pyx":39 * * def __dealloc__(self): * if self.data != NULL: # <<<<<<<<<<<<<< * free(self.data) * */ } /* "pygame_sdl2/key.pyx":38 * self.data = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.data != NULL: * free(self.data) */ /* function exit code */ } /* "pygame_sdl2/key.pyx":42 * free(self.data) * * def __init__(self): # <<<<<<<<<<<<<< * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_4__init__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState_4__init__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { uint8_t *__pyx_v_state; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/key.pyx":43 * * def __init__(self): * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) # <<<<<<<<<<<<<< * if state == NULL: * raise error() */ __pyx_v_state = SDL_GetKeyboardState((&__pyx_v_self->numkeys)); /* "pygame_sdl2/key.pyx":44 * def __init__(self): * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_state == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/key.pyx":45 * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: * raise error() # <<<<<<<<<<<<<< * * # Take a snapshot of the current state, rather than saving the pointer. */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 45, __pyx_L1_error) /* "pygame_sdl2/key.pyx":44 * def __init__(self): * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/key.pyx":48 * * # Take a snapshot of the current state, rather than saving the pointer. * self.data = malloc(self.numkeys) # <<<<<<<<<<<<<< * memcpy(self.data, state, self.numkeys) * */ __pyx_v_self->data = ((uint8_t *)malloc(__pyx_v_self->numkeys)); /* "pygame_sdl2/key.pyx":49 * # Take a snapshot of the current state, rather than saving the pointer. * self.data = malloc(self.numkeys) * memcpy(self.data, state, self.numkeys) # <<<<<<<<<<<<<< * * def __getitem__(self, int key): */ (void)(memcpy(__pyx_v_self->data, __pyx_v_state, __pyx_v_self->numkeys)); /* "pygame_sdl2/key.pyx":42 * free(self.data) * * def __init__(self): # <<<<<<<<<<<<<< * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":51 * memcpy(self.data, state, self.numkeys) * * def __getitem__(self, int key): # <<<<<<<<<<<<<< * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_key) { int __pyx_v_key; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); assert(__pyx_arg_key); { __pyx_v_key = __Pyx_PyInt_As_int(__pyx_arg_key); if (unlikely((__pyx_v_key == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_6__getitem__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self), ((int)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_6__getitem__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, int __pyx_v_key) { int __pyx_v_sc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "pygame_sdl2/key.pyx":52 * * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ __pyx_t_1 = (SDLK_DELETE < __pyx_v_key); if (__pyx_t_1) { __pyx_t_1 = (__pyx_v_key < SDLK_CAPSLOCK); } if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/key.pyx":53 * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * cdef int sc = SDL_GetScancodeFromKey(key) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 53, __pyx_L1_error) /* "pygame_sdl2/key.pyx":52 * * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ } /* "pygame_sdl2/key.pyx":55 * raise IndexError("Out of range.") * * cdef int sc = SDL_GetScancodeFromKey(key) # <<<<<<<<<<<<<< * if sc > self.numkeys: * raise IndexError("Out of range.") */ __pyx_v_sc = ((int)SDL_GetScancodeFromKey(__pyx_v_key)); /* "pygame_sdl2/key.pyx":56 * * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ __pyx_t_1 = (__pyx_v_sc > __pyx_v_self->numkeys); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/key.pyx":57 * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * return self.data[sc] */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 57, __pyx_L1_error) /* "pygame_sdl2/key.pyx":56 * * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ } /* "pygame_sdl2/key.pyx":59 * raise IndexError("Out of range.") * * return self.data[sc] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t((__pyx_v_self->data[__pyx_v_sc])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":51 * memcpy(self.data, state, self.numkeys) * * def __getitem__(self, int key): # <<<<<<<<<<<<<< * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__, "KeyboardState.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__, "KeyboardState.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_1get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_get_focused, "get_focused()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_1get_focused = {"get_focused", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_1get_focused, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_get_focused}; static PyObject *__pyx_pw_11pygame_sdl2_3key_1get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_focused (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_get_focused(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_get_focused(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_focused", 1); /* "pygame_sdl2/key.pyx":63 * * def get_focused(): * return SDL_GetKeyboardFocus() != NULL # <<<<<<<<<<<<<< * * def get_pressed(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_GetKeyboardFocus() != NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.get_focused", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_3get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_2get_pressed, "get_pressed()\n No longer returns a tuple. Use the returned object to check for\n individual keys, but don't loop through it. "); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_3get_pressed = {"get_pressed", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_3get_pressed, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_2get_pressed}; static PyObject *__pyx_pw_11pygame_sdl2_3key_3get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pressed (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_2get_pressed(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_2get_pressed(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pressed", 1); /* "pygame_sdl2/key.pyx":69 * individual keys, but don't loop through it. """ * * return KeyboardState() # <<<<<<<<<<<<<< * * def get_mods(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_11pygame_sdl2_3key_KeyboardState)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.get_pressed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_5get_mods(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_4get_mods, "get_mods()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_5get_mods = {"get_mods", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_5get_mods, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_4get_mods}; static PyObject *__pyx_pw_11pygame_sdl2_3key_5get_mods(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_mods (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_4get_mods(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_4get_mods(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_mods", 1); /* "pygame_sdl2/key.pyx":72 * * def get_mods(): * return SDL_GetModState() # <<<<<<<<<<<<<< * * def set_mods(state): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(SDL_GetModState()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.get_mods", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_7set_mods(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_6set_mods, "set_mods(state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_7set_mods = {"set_mods", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_7set_mods, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_6set_mods}; static PyObject *__pyx_pw_11pygame_sdl2_3key_7set_mods(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mods (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_mods") < 0)) __PYX_ERR(0, 74, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_mods", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 74, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.key.set_mods", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_6set_mods(__pyx_self, __pyx_v_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_6set_mods(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_Keymod __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_mods", 1); /* "pygame_sdl2/key.pyx":75 * * def set_mods(state): * SDL_SetModState(state) # <<<<<<<<<<<<<< * * def set_repeat(delay=0, interval=0): */ __pyx_t_1 = ((SDL_Keymod)__Pyx_PyInt_As_SDL_Keymod(__pyx_v_state)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error) SDL_SetModState(__pyx_t_1); /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.set_mods", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":77 * SDL_SetModState(state) * * def set_repeat(delay=0, interval=0): # <<<<<<<<<<<<<< * # Not possible with SDL2. * pass */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_9set_repeat(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_8set_repeat, "set_repeat(delay=0, interval=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_9set_repeat = {"set_repeat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_9set_repeat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_8set_repeat}; static PyObject *__pyx_pw_11pygame_sdl2_3key_9set_repeat(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_delay = 0; CYTHON_UNUSED PyObject *__pyx_v_interval = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_repeat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_delay,&__pyx_n_s_interval,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_delay); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interval); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_repeat") < 0)) __PYX_ERR(0, 77, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_delay = values[0]; __pyx_v_interval = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_repeat", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 77, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.key.set_repeat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_8set_repeat(__pyx_self, __pyx_v_delay, __pyx_v_interval); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_8set_repeat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_delay, CYTHON_UNUSED PyObject *__pyx_v_interval) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_repeat", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_11get_repeat(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_10get_repeat, "get_repeat()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_11get_repeat = {"get_repeat", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_11get_repeat, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_10get_repeat}; static PyObject *__pyx_pw_11pygame_sdl2_3key_11get_repeat(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_repeat (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_10get_repeat(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_10get_repeat(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_repeat", 1); /* "pygame_sdl2/key.pyx":83 * def get_repeat(): * # Not possible with SDL2. * return (0,0) # <<<<<<<<<<<<<< * * def name(key): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_tuple__2); __pyx_r = __pyx_tuple__2; goto __pyx_L0; /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_13name(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_12name, "name(key)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_13name = {"name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_13name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_12name}; static PyObject *__pyx_pw_11pygame_sdl2_3key_13name(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_key = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("name (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "name") < 0)) __PYX_ERR(0, 85, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_key = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 85, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.key.name", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_12name(__pyx_self, __pyx_v_key); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_12name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_Keycode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("name", 1); /* "pygame_sdl2/key.pyx":86 * * def name(key): * return SDL_GetKeyName(key) # <<<<<<<<<<<<<< * * text_input = False */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_As_int32_t(__pyx_v_key); if (unlikely((__pyx_t_1 == ((SDL_Keycode)-1)) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_2 = __Pyx_PyBytes_FromString(SDL_GetKeyName(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.key.name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_15start_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_14start_text_input, "start_text_input()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_15start_text_input = {"start_text_input", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_15start_text_input, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_14start_text_input}; static PyObject *__pyx_pw_11pygame_sdl2_3key_15start_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("start_text_input (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_14start_text_input(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_14start_text_input(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_bool __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("start_text_input", 1); /* "pygame_sdl2/key.pyx":92 * def start_text_input(): * global text_input * text_input = True # <<<<<<<<<<<<<< * * if SDL_HasScreenKeyboardSupport(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_input, Py_True) < 0) __PYX_ERR(0, 92, __pyx_L1_error) /* "pygame_sdl2/key.pyx":94 * text_input = True * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StartTextInput() * */ __pyx_t_1 = SDL_HasScreenKeyboardSupport(); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":95 * * if SDL_HasScreenKeyboardSupport(): * SDL_StartTextInput() # <<<<<<<<<<<<<< * * def stop_text_input(): */ SDL_StartTextInput(); /* "pygame_sdl2/key.pyx":94 * text_input = True * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StartTextInput() * */ } /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.start_text_input", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_17stop_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_16stop_text_input, "stop_text_input()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_17stop_text_input = {"stop_text_input", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_17stop_text_input, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_16stop_text_input}; static PyObject *__pyx_pw_11pygame_sdl2_3key_17stop_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop_text_input (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_16stop_text_input(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_16stop_text_input(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_bool __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stop_text_input", 1); /* "pygame_sdl2/key.pyx":99 * def stop_text_input(): * global text_input * text_input = False # <<<<<<<<<<<<<< * * if SDL_HasScreenKeyboardSupport(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_input, Py_False) < 0) __PYX_ERR(0, 99, __pyx_L1_error) /* "pygame_sdl2/key.pyx":101 * text_input = False * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StopTextInput() * */ __pyx_t_1 = SDL_HasScreenKeyboardSupport(); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":102 * * if SDL_HasScreenKeyboardSupport(): * SDL_StopTextInput() # <<<<<<<<<<<<<< * * def set_text_input_rect(rect): */ SDL_StopTextInput(); /* "pygame_sdl2/key.pyx":101 * text_input = False * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StopTextInput() * */ } /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.stop_text_input", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_19set_text_input_rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_18set_text_input_rect, "set_text_input_rect(rect)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_19set_text_input_rect = {"set_text_input_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_19set_text_input_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_18set_text_input_rect}; static PyObject *__pyx_pw_11pygame_sdl2_3key_19set_text_input_rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rect = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_text_input_rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rect,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_text_input_rect") < 0)) __PYX_ERR(0, 104, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_rect = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_text_input_rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 104, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.key.set_text_input_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_18set_text_input_rect(__pyx_self, __pyx_v_rect); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_18set_text_input_rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_sdl_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_text_input_rect", 1); /* "pygame_sdl2/key.pyx":107 * cdef SDL_Rect sdl_rect; * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * SDL_SetTextInputRect(&sdl_rect) */ __pyx_t_1 = (__pyx_v_rect != Py_None); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":108 * * if rect is not None: * to_sdl_rect(rect, &sdl_rect) # <<<<<<<<<<<<<< * SDL_SetTextInputRect(&sdl_rect) * else: */ __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 108, __pyx_L1_error) /* "pygame_sdl2/key.pyx":109 * if rect is not None: * to_sdl_rect(rect, &sdl_rect) * SDL_SetTextInputRect(&sdl_rect) # <<<<<<<<<<<<<< * else: * SDL_SetTextInputRect(NULL) */ SDL_SetTextInputRect((&__pyx_v_sdl_rect)); /* "pygame_sdl2/key.pyx":107 * cdef SDL_Rect sdl_rect; * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * SDL_SetTextInputRect(&sdl_rect) */ goto __pyx_L3; } /* "pygame_sdl2/key.pyx":111 * SDL_SetTextInputRect(&sdl_rect) * else: * SDL_SetTextInputRect(NULL) # <<<<<<<<<<<<<< * * def has_screen_keyboard_support(): */ /*else*/ { SDL_SetTextInputRect(NULL); } __pyx_L3:; /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.set_text_input_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_21has_screen_keyboard_support(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_20has_screen_keyboard_support, "has_screen_keyboard_support()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_21has_screen_keyboard_support = {"has_screen_keyboard_support", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_21has_screen_keyboard_support, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_20has_screen_keyboard_support}; static PyObject *__pyx_pw_11pygame_sdl2_3key_21has_screen_keyboard_support(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("has_screen_keyboard_support (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_20has_screen_keyboard_support(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_20has_screen_keyboard_support(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_screen_keyboard_support", 1); /* "pygame_sdl2/key.pyx":114 * * def has_screen_keyboard_support(): * return SDL_HasScreenKeyboardSupport() # <<<<<<<<<<<<<< * * def is_screen_keyboard_shown(Window window=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_HasScreenKeyboardSupport()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.has_screen_keyboard_support", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_23is_screen_keyboard_shown(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_22is_screen_keyboard_shown, "is_screen_keyboard_shown(Window window=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_23is_screen_keyboard_shown = {"is_screen_keyboard_shown", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_23is_screen_keyboard_shown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_22is_screen_keyboard_shown}; static PyObject *__pyx_pw_11pygame_sdl2_3key_23is_screen_keyboard_shown(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_screen_keyboard_shown (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_window,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_window); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_screen_keyboard_shown") < 0)) __PYX_ERR(0, 116, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("is_screen_keyboard_shown", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 116, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.key.is_screen_keyboard_shown", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_window), __pyx_ptype_11pygame_sdl2_7display_Window, 1, "window", 0))) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_3key_22is_screen_keyboard_shown(__pyx_self, __pyx_v_window); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_22is_screen_keyboard_shown(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_screen_keyboard_shown", 0); __Pyx_INCREF((PyObject *)__pyx_v_window); /* "pygame_sdl2/key.pyx":117 * * def is_screen_keyboard_shown(Window window=None): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ __pyx_t_1 = (((PyObject *)__pyx_v_window) == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":118 * def is_screen_keyboard_shown(Window window=None): * if window is None: * window = main_window # <<<<<<<<<<<<<< * * return SDL_IsScreenKeyboardShown(window.window) */ __Pyx_INCREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_window, __pyx_v_11pygame_sdl2_7display_main_window); /* "pygame_sdl2/key.pyx":117 * * def is_screen_keyboard_shown(Window window=None): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ } /* "pygame_sdl2/key.pyx":120 * window = main_window * * return SDL_IsScreenKeyboardShown(window.window) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_SDL_bool(SDL_IsScreenKeyboardShown(__pyx_v_window->window)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.key.is_screen_keyboard_shown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_window); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_3key_KeyboardState(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_11pygame_sdl2_3key_13KeyboardState_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_3key_KeyboardState(PyObject *o) { struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *p = (struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_3key_KeyboardState) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_3key_13KeyboardState_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_sq_item_11pygame_sdl2_3key_KeyboardState(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static PyMethodDef __pyx_methods_11pygame_sdl2_3key_KeyboardState[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_3key_KeyboardState_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_3key_KeyboardState}, {Py_sq_item, (void *)__pyx_sq_item_11pygame_sdl2_3key_KeyboardState}, {Py_mp_subscript, (void *)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__}, {Py_tp_doc, (void *)PyDoc_STR("KeyboardState()")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_3key_KeyboardState}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_3key_KeyboardState}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_3key_KeyboardState_spec = { "pygame_sdl2.key.KeyboardState", sizeof(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_3key_KeyboardState_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence_KeyboardState = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_3key_KeyboardState, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_KeyboardState = { 0, /*mp_length*/ __pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_3key_KeyboardState = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.key.""KeyboardState", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_3key_KeyboardState, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_KeyboardState, /*tp_as_sequence*/ &__pyx_tp_as_mapping_KeyboardState, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("KeyboardState()"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_3key_KeyboardState, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_3key_KeyboardState, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_KeyboardState, __pyx_k_KeyboardState, sizeof(__pyx_k_KeyboardState), 0, 0, 1, 1}, {&__pyx_n_s_KeyboardState___reduce_cython, __pyx_k_KeyboardState___reduce_cython, sizeof(__pyx_k_KeyboardState___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_KeyboardState___setstate_cython, __pyx_k_KeyboardState___setstate_cython, sizeof(__pyx_k_KeyboardState___setstate_cython), 0, 0, 1, 1}, {&__pyx_kp_s_Out_of_range, __pyx_k_Out_of_range, sizeof(__pyx_k_Out_of_range), 0, 0, 1, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 1}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_delay, __pyx_k_delay, sizeof(__pyx_k_delay), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_focused, __pyx_k_get_focused, sizeof(__pyx_k_get_focused), 0, 0, 1, 1}, {&__pyx_n_s_get_mods, __pyx_k_get_mods, sizeof(__pyx_k_get_mods), 0, 0, 1, 1}, {&__pyx_n_s_get_pressed, __pyx_k_get_pressed, sizeof(__pyx_k_get_pressed), 0, 0, 1, 1}, {&__pyx_n_s_get_repeat, __pyx_k_get_repeat, sizeof(__pyx_k_get_repeat), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_has_screen_keyboard_support, __pyx_k_has_screen_keyboard_support, sizeof(__pyx_k_has_screen_keyboard_support), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_is_screen_keyboard_shown, __pyx_k_is_screen_keyboard_shown, sizeof(__pyx_k_is_screen_keyboard_shown), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_key, __pyx_k_pygame_sdl2_key, sizeof(__pyx_k_pygame_sdl2_key), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_sdl_rect, __pyx_k_sdl_rect, sizeof(__pyx_k_sdl_rect), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_mods, __pyx_k_set_mods, sizeof(__pyx_k_set_mods), 0, 0, 1, 1}, {&__pyx_n_s_set_repeat, __pyx_k_set_repeat, sizeof(__pyx_k_set_repeat), 0, 0, 1, 1}, {&__pyx_n_s_set_text_input_rect, __pyx_k_set_text_input_rect, sizeof(__pyx_k_set_text_input_rect), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_k_src_pygame_sdl2_key_pyx, sizeof(__pyx_k_src_pygame_sdl2_key_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start_text_input, __pyx_k_start_text_input, sizeof(__pyx_k_start_text_input), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_stop_text_input, __pyx_k_stop_text_input, sizeof(__pyx_k_stop_text_input), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text_input, __pyx_k_text_input, sizeof(__pyx_k_text_input), 0, 0, 1, 1}, {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 53, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/key.pyx":53 * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * cdef int sc = SDL_GetScancodeFromKey(key) */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Out_of_range); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/key.pyx":83 * def get_repeat(): * # Not possible with SDL2. * return (0,0) # <<<<<<<<<<<<<< * * def name(key): */ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(1, 3, __pyx_L1_error) /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_focused, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 62, __pyx_L1_error) /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_pressed, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 65, __pyx_L1_error) /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_mods, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 71, __pyx_L1_error) /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_set_mods, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 74, __pyx_L1_error) /* "pygame_sdl2/key.pyx":77 * SDL_SetModState(state) * * def set_repeat(delay=0, interval=0): # <<<<<<<<<<<<<< * # Not possible with SDL2. * pass */ __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_delay, __pyx_n_s_interval); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_set_repeat, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 77, __pyx_L1_error) /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_repeat, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 81, __pyx_L1_error) /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_key); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_name_2, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 85, __pyx_L1_error) /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_start_text_input, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 90, __pyx_L1_error) /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_stop_text_input, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 97, __pyx_L1_error) /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ __pyx_tuple__20 = PyTuple_Pack(2, __pyx_n_s_rect, __pyx_n_s_sdl_rect); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_set_text_input_rect, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 104, __pyx_L1_error) /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_has_screen_keyboard_support, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 113, __pyx_L1_error) /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_window); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_is_screen_keyboard_shown, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_tuple__25 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_3key_KeyboardState = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_3key_KeyboardState_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_3key_KeyboardState)) __PYX_ERR(0, 28, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_3key_KeyboardState_spec, __pyx_ptype_11pygame_sdl2_3key_KeyboardState) < 0) __PYX_ERR(0, 28, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_3key_KeyboardState = &__pyx_type_11pygame_sdl2_3key_KeyboardState; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_3key_KeyboardState) < 0) __PYX_ERR(0, 28, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_3key_KeyboardState->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_3key_KeyboardState->tp_dictoffset && __pyx_ptype_11pygame_sdl2_3key_KeyboardState->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_3key_KeyboardState->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KeyboardState, (PyObject *) __pyx_ptype_11pygame_sdl2_3key_KeyboardState) < 0) __PYX_ERR(0, 28, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_3key_KeyboardState->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_3key_KeyboardState->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState, __weakref__); #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_3key_KeyboardState) < 0) __PYX_ERR(0, 28, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7display_Window),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7display_Window) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_4rect_Rect),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_4rect_Rect) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportVoidPtr_3_0_8(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_8(__pyx_t_1, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_key(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_key}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "key", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initkey(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initkey(void) #else __Pyx_PyMODINIT_FUNC PyInit_key(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_key(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_key(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'key' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("key", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "key" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_key(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__key) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.key")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.key", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_variable_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/key.pyx":25 * from pygame_sdl2.rect cimport to_sdl_rect * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 25, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_KeyboardState___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_KeyboardState___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_1get_focused, 0, __pyx_n_s_get_focused, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_focused, __pyx_t_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_3get_pressed, 0, __pyx_n_s_get_pressed, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pressed, __pyx_t_3) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_5get_mods, 0, __pyx_n_s_get_mods, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_mods, __pyx_t_3) < 0) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_7set_mods, 0, __pyx_n_s_set_mods, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mods, __pyx_t_3) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":77 * SDL_SetModState(state) * * def set_repeat(delay=0, interval=0): # <<<<<<<<<<<<<< * # Not possible with SDL2. * pass */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_9set_repeat, 0, __pyx_n_s_set_repeat, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_repeat, __pyx_t_3) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_11get_repeat, 0, __pyx_n_s_get_repeat, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_repeat, __pyx_t_3) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_13name, 0, __pyx_n_s_name_2, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_name_2, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":88 * return SDL_GetKeyName(key) * * text_input = False # <<<<<<<<<<<<<< * * def start_text_input(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_input, Py_False) < 0) __PYX_ERR(0, 88, __pyx_L1_error) /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_15start_text_input, 0, __pyx_n_s_start_text_input, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_start_text_input, __pyx_t_3) < 0) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_17stop_text_input, 0, __pyx_n_s_stop_text_input, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop_text_input, __pyx_t_3) < 0) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_19set_text_input_rect, 0, __pyx_n_s_set_text_input_rect, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_text_input_rect, __pyx_t_3) < 0) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_21has_screen_keyboard_support, 0, __pyx_n_s_has_screen_keyboard_support, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_screen_keyboard_support, __pyx_t_3) < 0) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_23is_screen_keyboard_shown, 0, __pyx_n_s_is_screen_keyboard_shown, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__25); if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_screen_keyboard_shown, __pyx_t_3) < 0) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.key", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.key"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_8 #define __PYX_HAVE_RT_ImportType_3_0_8 static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__3); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_Keymod) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Keymod) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_Keymod) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_Keymod) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_Keymod) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_Keymod), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_Keymod)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE SDL_Keymod __Pyx_PyInt_As_SDL_Keymod(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SDL_Keymod) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_Keymod) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SDL_Keymod) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) >= 2 * PyLong_SHIFT)) { return (SDL_Keymod) (((((SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0])); } } break; case 3: if ((8 * sizeof(SDL_Keymod) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) >= 3 * PyLong_SHIFT)) { return (SDL_Keymod) (((((((SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0])); } } break; case 4: if ((8 * sizeof(SDL_Keymod) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) >= 4 * PyLong_SHIFT)) { return (SDL_Keymod) (((((((((SDL_Keymod)digits[3]) << PyLong_SHIFT) | (SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_Keymod) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SDL_Keymod) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_Keymod) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SDL_Keymod) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) - 1 > 2 * PyLong_SHIFT)) { return (SDL_Keymod) (((SDL_Keymod)-1)*(((((SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case 2: if ((8 * sizeof(SDL_Keymod) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) - 1 > 2 * PyLong_SHIFT)) { return (SDL_Keymod) ((((((SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case -3: if ((8 * sizeof(SDL_Keymod) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) - 1 > 3 * PyLong_SHIFT)) { return (SDL_Keymod) (((SDL_Keymod)-1)*(((((((SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case 3: if ((8 * sizeof(SDL_Keymod) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) - 1 > 3 * PyLong_SHIFT)) { return (SDL_Keymod) ((((((((SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case -4: if ((8 * sizeof(SDL_Keymod) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) - 1 > 4 * PyLong_SHIFT)) { return (SDL_Keymod) (((SDL_Keymod)-1)*(((((((((SDL_Keymod)digits[3]) << PyLong_SHIFT) | (SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case 4: if ((8 * sizeof(SDL_Keymod) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) - 1 > 4 * PyLong_SHIFT)) { return (SDL_Keymod) ((((((((((SDL_Keymod)digits[3]) << PyLong_SHIFT) | (SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; } } #endif if ((sizeof(SDL_Keymod) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_Keymod) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available, cannot convert large enums"); return (SDL_Keymod) -1; } else { SDL_Keymod val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_Keymod) -1; val = __Pyx_PyInt_As_SDL_Keymod(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_Keymod"); return (SDL_Keymod) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_Keymod"); return (SDL_Keymod) -1; } /* CIntFromPy */ static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) >= 2 * PyLong_SHIFT)) { return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; case 3: if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) >= 3 * PyLong_SHIFT)) { return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; case 4: if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) >= 4 * PyLong_SHIFT)) { return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; } } #endif if ((sizeof(int32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int32_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int32_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int32_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int32_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (int32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int32_t) 1) << (sizeof(int32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int32_t) -1; } } else { int32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int32_t) -1; val = __Pyx_PyInt_As_int32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int32_t"); return (int32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int32_t"); return (int32_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_bool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_bool) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_bool), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_bool)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__26); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* VoidPtrImport */ #ifndef __PYX_HAVE_RT_ImportVoidPtr_3_0_8 #define __PYX_HAVE_RT_ImportVoidPtr_3_0_8 static int __Pyx_ImportVoidPtr_3_0_8(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_8 #define __PYX_HAVE_RT_ImportFunction_3_0_8 static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709472.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.locals.c0000664000175000017500000221374514760217140020303 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__locals #define __PYX_HAVE_API__pygame_sdl2__locals /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/locals.pyx", "include/event_list.pxi", "include/keycode_list.pxi", "include/glattr.pxi", "include/controller.pxi", }; /* #### Code section: utility_code_proto_before_types ### */ /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* IncludeStringH.proto */ #include /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* Globals.proto */ static PyObject* __Pyx_Globals(void); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLattr(SDL_GLattr value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLprofile(SDL_GLprofile value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.locals" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.locals" extern int __pyx_module_is_main_pygame_sdl2__locals; int __pyx_module_is_main_pygame_sdl2__locals = 0; /* Implementation of "pygame_sdl2.locals" */ /* #### Code section: global_var ### */ /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; static const char __pyx_k__2[] = "?"; static const char __pyx_k_K_0[] = "K_0"; static const char __pyx_k_K_1[] = "K_1"; static const char __pyx_k_K_2[] = "K_2"; static const char __pyx_k_K_3[] = "K_3"; static const char __pyx_k_K_4[] = "K_4"; static const char __pyx_k_K_5[] = "K_5"; static const char __pyx_k_K_6[] = "K_6"; static const char __pyx_k_K_7[] = "K_7"; static const char __pyx_k_K_8[] = "K_8"; static const char __pyx_k_K_9[] = "K_9"; static const char __pyx_k_K_a[] = "K_a"; static const char __pyx_k_K_b[] = "K_b"; static const char __pyx_k_K_c[] = "K_c"; static const char __pyx_k_K_d[] = "K_d"; static const char __pyx_k_K_e[] = "K_e"; static const char __pyx_k_K_f[] = "K_f"; static const char __pyx_k_K_g[] = "K_g"; static const char __pyx_k_K_h[] = "K_h"; static const char __pyx_k_K_i[] = "K_i"; static const char __pyx_k_K_j[] = "K_j"; static const char __pyx_k_K_k[] = "K_k"; static const char __pyx_k_K_l[] = "K_l"; static const char __pyx_k_K_m[] = "K_m"; static const char __pyx_k_K_n[] = "K_n"; static const char __pyx_k_K_o[] = "K_o"; static const char __pyx_k_K_p[] = "K_p"; static const char __pyx_k_K_q[] = "K_q"; static const char __pyx_k_K_r[] = "K_r"; static const char __pyx_k_K_s[] = "K_s"; static const char __pyx_k_K_t[] = "K_t"; static const char __pyx_k_K_u[] = "K_u"; static const char __pyx_k_K_v[] = "K_v"; static const char __pyx_k_K_w[] = "K_w"; static const char __pyx_k_K_x[] = "K_x"; static const char __pyx_k_K_y[] = "K_y"; static const char __pyx_k_K_z[] = "K_z"; static const char __pyx_k_K_AT[] = "K_AT"; static const char __pyx_k_K_F1[] = "K_F1"; static const char __pyx_k_K_F2[] = "K_F2"; static const char __pyx_k_K_F3[] = "K_F3"; static const char __pyx_k_K_F4[] = "K_F4"; static const char __pyx_k_K_F5[] = "K_F5"; static const char __pyx_k_K_F6[] = "K_F6"; static const char __pyx_k_K_F7[] = "K_F7"; static const char __pyx_k_K_F8[] = "K_F8"; static const char __pyx_k_K_F9[] = "K_F9"; static const char __pyx_k_K_UP[] = "K_UP"; static const char __pyx_k_QUIT[] = "QUIT"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_Color[] = "Color"; static const char __pyx_k_KEYUP[] = "KEYUP"; static const char __pyx_k_K_CUT[] = "K_CUT"; static const char __pyx_k_K_END[] = "K_END"; static const char __pyx_k_K_F10[] = "K_F10"; static const char __pyx_k_K_F11[] = "K_F11"; static const char __pyx_k_K_F12[] = "K_F12"; static const char __pyx_k_K_F13[] = "K_F13"; static const char __pyx_k_K_F14[] = "K_F14"; static const char __pyx_k_K_F15[] = "K_F15"; static const char __pyx_k_K_F16[] = "K_F16"; static const char __pyx_k_K_F17[] = "K_F17"; static const char __pyx_k_K_F18[] = "K_F18"; static const char __pyx_k_K_F19[] = "K_F19"; static const char __pyx_k_K_F20[] = "K_F20"; static const char __pyx_k_K_F21[] = "K_F21"; static const char __pyx_k_K_F22[] = "K_F22"; static const char __pyx_k_K_F23[] = "K_F23"; static const char __pyx_k_K_F24[] = "K_F24"; static const char __pyx_k_K_KP0[] = "K_KP0"; static const char __pyx_k_K_KP1[] = "K_KP1"; static const char __pyx_k_K_KP2[] = "K_KP2"; static const char __pyx_k_K_KP3[] = "K_KP3"; static const char __pyx_k_K_KP4[] = "K_KP4"; static const char __pyx_k_K_KP5[] = "K_KP5"; static const char __pyx_k_K_KP6[] = "K_KP6"; static const char __pyx_k_K_KP7[] = "K_KP7"; static const char __pyx_k_K_KP8[] = "K_KP8"; static const char __pyx_k_K_KP9[] = "K_KP9"; static const char __pyx_k_K_OUT[] = "K_OUT"; static const char __pyx_k_K_TAB[] = "K_TAB"; static const char __pyx_k_K_WWW[] = "K_WWW"; static const char __pyx_k_K_APP1[] = "K_APP1"; static const char __pyx_k_K_APP2[] = "K_APP2"; static const char __pyx_k_K_COPY[] = "K_COPY"; static const char __pyx_k_K_DOWN[] = "K_DOWN"; static const char __pyx_k_K_EURO[] = "K_EURO"; static const char __pyx_k_K_FIND[] = "K_FIND"; static const char __pyx_k_K_HASH[] = "K_HASH"; static const char __pyx_k_K_HELP[] = "K_HELP"; static const char __pyx_k_K_HOME[] = "K_HOME"; static const char __pyx_k_K_KP_0[] = "K_KP_0"; static const char __pyx_k_K_KP_1[] = "K_KP_1"; static const char __pyx_k_K_KP_2[] = "K_KP_2"; static const char __pyx_k_K_KP_3[] = "K_KP_3"; static const char __pyx_k_K_KP_4[] = "K_KP_4"; static const char __pyx_k_K_KP_5[] = "K_KP_5"; static const char __pyx_k_K_KP_6[] = "K_KP_6"; static const char __pyx_k_K_KP_7[] = "K_KP_7"; static const char __pyx_k_K_KP_8[] = "K_KP_8"; static const char __pyx_k_K_KP_9[] = "K_KP_9"; static const char __pyx_k_K_KP_A[] = "K_KP_A"; static const char __pyx_k_K_KP_B[] = "K_KP_B"; static const char __pyx_k_K_KP_C[] = "K_KP_C"; static const char __pyx_k_K_KP_D[] = "K_KP_D"; static const char __pyx_k_K_KP_E[] = "K_KP_E"; static const char __pyx_k_K_KP_F[] = "K_KP_F"; static const char __pyx_k_K_LALT[] = "K_LALT"; static const char __pyx_k_K_LAST[] = "K_LAST"; static const char __pyx_k_K_LEFT[] = "K_LEFT"; static const char __pyx_k_K_LESS[] = "K_LESS"; static const char __pyx_k_K_LGUI[] = "K_LGUI"; static const char __pyx_k_K_MAIL[] = "K_MAIL"; static const char __pyx_k_K_MENU[] = "K_MENU"; static const char __pyx_k_K_MODE[] = "K_MODE"; static const char __pyx_k_K_MUTE[] = "K_MUTE"; static const char __pyx_k_K_OPER[] = "K_OPER"; static const char __pyx_k_K_PLUS[] = "K_PLUS"; static const char __pyx_k_K_RALT[] = "K_RALT"; static const char __pyx_k_K_RGUI[] = "K_RGUI"; static const char __pyx_k_K_STOP[] = "K_STOP"; static const char __pyx_k_K_UNDO[] = "K_UNDO"; static const char __pyx_k_OPENGL[] = "OPENGL"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_KEYDOWN[] = "KEYDOWN"; static const char __pyx_k_K_AGAIN[] = "K_AGAIN"; static const char __pyx_k_K_BREAK[] = "K_BREAK"; static const char __pyx_k_K_CARET[] = "K_CARET"; static const char __pyx_k_K_CLEAR[] = "K_CLEAR"; static const char __pyx_k_K_COLON[] = "K_COLON"; static const char __pyx_k_K_COMMA[] = "K_COMMA"; static const char __pyx_k_K_CRSEL[] = "K_CRSEL"; static const char __pyx_k_K_EJECT[] = "K_EJECT"; static const char __pyx_k_K_EXSEL[] = "K_EXSEL"; static const char __pyx_k_K_FIRST[] = "K_FIRST"; static const char __pyx_k_K_KP_00[] = "K_KP_00"; static const char __pyx_k_K_KP_AT[] = "K_KP_AT"; static const char __pyx_k_K_LCTRL[] = "K_LCTRL"; static const char __pyx_k_K_LMETA[] = "K_LMETA"; static const char __pyx_k_K_MINUS[] = "K_MINUS"; static const char __pyx_k_K_PASTE[] = "K_PASTE"; static const char __pyx_k_K_PAUSE[] = "K_PAUSE"; static const char __pyx_k_K_POWER[] = "K_POWER"; static const char __pyx_k_K_PRINT[] = "K_PRINT"; static const char __pyx_k_K_PRIOR[] = "K_PRIOR"; static const char __pyx_k_K_QUOTE[] = "K_QUOTE"; static const char __pyx_k_K_RCTRL[] = "K_RCTRL"; static const char __pyx_k_K_RIGHT[] = "K_RIGHT"; static const char __pyx_k_K_RMETA[] = "K_RMETA"; static const char __pyx_k_K_SLASH[] = "K_SLASH"; static const char __pyx_k_K_SLEEP[] = "K_SLEEP"; static const char __pyx_k_K_SPACE[] = "K_SPACE"; static const char __pyx_k_NOEVENT[] = "NOEVENT"; static const char __pyx_k_NOFRAME[] = "NOFRAME"; static const char __pyx_k_DROPFILE[] = "DROPFILE"; static const char __pyx_k_DROPTEXT[] = "DROPTEXT"; static const char __pyx_k_FINGERUP[] = "FINGERUP"; static const char __pyx_k_KMOD_ALT[] = "KMOD_ALT"; static const char __pyx_k_KMOD_GUI[] = "KMOD_GUI"; static const char __pyx_k_KMOD_NUM[] = "KMOD_NUM"; static const char __pyx_k_K_CANCEL[] = "K_CANCEL"; static const char __pyx_k_K_DELETE[] = "K_DELETE"; static const char __pyx_k_K_DOLLAR[] = "K_DOLLAR"; static const char __pyx_k_K_EQUALS[] = "K_EQUALS"; static const char __pyx_k_K_ESCAPE[] = "K_ESCAPE"; static const char __pyx_k_K_INSERT[] = "K_INSERT"; static const char __pyx_k_K_KP_000[] = "K_KP_000"; static const char __pyx_k_K_KP_TAB[] = "K_KP_TAB"; static const char __pyx_k_K_KP_XOR[] = "K_KP_XOR"; static const char __pyx_k_K_LSHIFT[] = "K_LSHIFT"; static const char __pyx_k_K_LSUPER[] = "K_LSUPER"; static const char __pyx_k_K_PAGEUP[] = "K_PAGEUP"; static const char __pyx_k_K_PERIOD[] = "K_PERIOD"; static const char __pyx_k_K_RETURN[] = "K_RETURN"; static const char __pyx_k_K_RSHIFT[] = "K_RSHIFT"; static const char __pyx_k_K_RSUPER[] = "K_RSUPER"; static const char __pyx_k_K_SELECT[] = "K_SELECT"; static const char __pyx_k_K_SYSREQ[] = "K_SYSREQ"; static const char __pyx_k_RLEACCEL[] = "RLEACCEL"; static const char __pyx_k_SRCALPHA[] = "SRCALPHA"; static const char __pyx_k_BLEND_ADD[] = "BLEND_ADD"; static const char __pyx_k_BLEND_MAX[] = "BLEND_MAX"; static const char __pyx_k_BLEND_MIN[] = "BLEND_MIN"; static const char __pyx_k_BLEND_SUB[] = "BLEND_SUB"; static const char __pyx_k_BYTEORDER[] = "BYTEORDER"; static const char __pyx_k_DOUBLEBUF[] = "DOUBLEBUF"; static const char __pyx_k_DROPBEGIN[] = "DROPBEGIN"; static const char __pyx_k_GL_STEREO[] = "GL_STEREO"; static const char __pyx_k_HWSURFACE[] = "HWSURFACE"; static const char __pyx_k_KMOD_CAPS[] = "KMOD_CAPS"; static const char __pyx_k_KMOD_CTRL[] = "KMOD_CTRL"; static const char __pyx_k_KMOD_LALT[] = "KMOD_LALT"; static const char __pyx_k_KMOD_LGUI[] = "KMOD_LGUI"; static const char __pyx_k_KMOD_META[] = "KMOD_META"; static const char __pyx_k_KMOD_MODE[] = "KMOD_MODE"; static const char __pyx_k_KMOD_NONE[] = "KMOD_NONE"; static const char __pyx_k_KMOD_RALT[] = "KMOD_RALT"; static const char __pyx_k_KMOD_RGUI[] = "KMOD_RGUI"; static const char __pyx_k_K_AC_BACK[] = "K_AC_BACK"; static const char __pyx_k_K_AC_HOME[] = "K_AC_HOME"; static const char __pyx_k_K_AC_STOP[] = "K_AC_STOP"; static const char __pyx_k_K_EXCLAIM[] = "K_EXCLAIM"; static const char __pyx_k_K_EXECUTE[] = "K_EXECUTE"; static const char __pyx_k_K_GREATER[] = "K_GREATER"; static const char __pyx_k_K_KP_HASH[] = "K_KP_HASH"; static const char __pyx_k_K_KP_LESS[] = "K_KP_LESS"; static const char __pyx_k_K_KP_PLUS[] = "K_KP_PLUS"; static const char __pyx_k_K_NUMLOCK[] = "K_NUMLOCK"; static const char __pyx_k_K_PERCENT[] = "K_PERCENT"; static const char __pyx_k_K_RETURN2[] = "K_RETURN2"; static const char __pyx_k_K_UNKNOWN[] = "K_UNKNOWN"; static const char __pyx_k_LASTEVENT[] = "LASTEVENT"; static const char __pyx_k_RESIZABLE[] = "RESIZABLE"; static const char __pyx_k_SWSURFACE[] = "SWSURFACE"; static const char __pyx_k_TEXTINPUT[] = "TEXTINPUT"; static const char __pyx_k_USEREVENT[] = "USEREVENT"; static const char __pyx_k_BIG_ENDIAN[] = "BIG_ENDIAN"; static const char __pyx_k_BLEND_MULT[] = "BLEND_MULT"; static const char __pyx_k_FINGERDOWN[] = "FINGERDOWN"; static const char __pyx_k_FULLSCREEN[] = "FULLSCREEN"; static const char __pyx_k_KMOD_LCTRL[] = "KMOD_LCTRL"; static const char __pyx_k_KMOD_LMETA[] = "KMOD_LMETA"; static const char __pyx_k_KMOD_RCTRL[] = "KMOD_RCTRL"; static const char __pyx_k_KMOD_RMETA[] = "KMOD_RMETA"; static const char __pyx_k_KMOD_SHIFT[] = "KMOD_SHIFT"; static const char __pyx_k_K_ALTERASE[] = "K_ALTERASE"; static const char __pyx_k_K_ASTERISK[] = "K_ASTERISK"; static const char __pyx_k_K_CAPSLOCK[] = "K_CAPSLOCK"; static const char __pyx_k_K_COMPUTER[] = "K_COMPUTER"; static const char __pyx_k_K_KP_CLEAR[] = "K_KP_CLEAR"; static const char __pyx_k_K_KP_COLON[] = "K_KP_COLON"; static const char __pyx_k_K_KP_COMMA[] = "K_KP_COMMA"; static const char __pyx_k_K_KP_ENTER[] = "K_KP_ENTER"; static const char __pyx_k_K_KP_MINUS[] = "K_KP_MINUS"; static const char __pyx_k_K_KP_OCTAL[] = "K_KP_OCTAL"; static const char __pyx_k_K_KP_POWER[] = "K_KP_POWER"; static const char __pyx_k_K_KP_SPACE[] = "K_KP_SPACE"; static const char __pyx_k_K_PAGEDOWN[] = "K_PAGEDOWN"; static const char __pyx_k_K_QUESTION[] = "K_QUESTION"; static const char __pyx_k_K_QUOTEDBL[] = "K_QUOTEDBL"; static const char __pyx_k_K_VOLUMEUP[] = "K_VOLUMEUP"; static const char __pyx_k_LIL_ENDIAN[] = "LIL_ENDIAN"; static const char __pyx_k_MOUSEWHEEL[] = "MOUSEWHEEL"; static const char __pyx_k_SCRAP_TEXT[] = "SCRAP_TEXT"; static const char __pyx_k_SYSWMEVENT[] = "SYSWMEVENT"; static const char __pyx_k_text_plain[] = "text/plain"; static const char __pyx_k_ACTIVEEVENT[] = "ACTIVEEVENT"; static const char __pyx_k_GL_RED_SIZE[] = "GL_RED_SIZE"; static const char __pyx_k_JOYBUTTONUP[] = "JOYBUTTONUP"; static const char __pyx_k_KMOD_LSHIFT[] = "KMOD_LSHIFT"; static const char __pyx_k_KMOD_RSHIFT[] = "KMOD_RSHIFT"; static const char __pyx_k_K_AC_SEARCH[] = "K_AC_SEARCH"; static const char __pyx_k_K_AMPERSAND[] = "K_AMPERSAND"; static const char __pyx_k_K_AUDIOMUTE[] = "K_AUDIOMUTE"; static const char __pyx_k_K_AUDIONEXT[] = "K_AUDIONEXT"; static const char __pyx_k_K_AUDIOPLAY[] = "K_AUDIOPLAY"; static const char __pyx_k_K_AUDIOPREV[] = "K_AUDIOPREV"; static const char __pyx_k_K_AUDIOSTOP[] = "K_AUDIOSTOP"; static const char __pyx_k_K_BACKQUOTE[] = "K_BACKQUOTE"; static const char __pyx_k_K_BACKSLASH[] = "K_BACKSLASH"; static const char __pyx_k_K_BACKSPACE[] = "K_BACKSPACE"; static const char __pyx_k_K_KP_BINARY[] = "K_KP_BINARY"; static const char __pyx_k_K_KP_DIVIDE[] = "K_KP_DIVIDE"; static const char __pyx_k_K_KP_EQUALS[] = "K_KP_EQUALS"; static const char __pyx_k_K_KP_EXCLAM[] = "K_KP_EXCLAM"; static const char __pyx_k_K_KP_MEMADD[] = "K_KP_MEMADD"; static const char __pyx_k_K_KP_PERIOD[] = "K_KP_PERIOD"; static const char __pyx_k_K_LEFTPAREN[] = "K_LEFTPAREN"; static const char __pyx_k_K_SCROLLOCK[] = "K_SCROLLOCK"; static const char __pyx_k_K_SEMICOLON[] = "K_SEMICOLON"; static const char __pyx_k_K_SEPARATOR[] = "K_SEPARATOR"; static const char __pyx_k_MOUSEMOTION[] = "MOUSEMOTION"; static const char __pyx_k_SRCCOLORKEY[] = "SRCCOLORKEY"; static const char __pyx_k_TEXTEDITING[] = "TEXTEDITING"; static const char __pyx_k_VIDEOEXPOSE[] = "VIDEOEXPOSE"; static const char __pyx_k_VIDEORESIZE[] = "VIDEORESIZE"; static const char __pyx_k_WINDOWEVENT[] = "WINDOWEVENT"; static const char __pyx_k_WINDOWMOVED[] = "WINDOWMOVED"; static const char __pyx_k_DISPLAYEVENT[] = "DISPLAYEVENT"; static const char __pyx_k_DOLLARRECORD[] = "DOLLARRECORD"; static const char __pyx_k_DROPCOMPLETE[] = "DROPCOMPLETE"; static const char __pyx_k_FINGERMOTION[] = "FINGERMOTION"; static const char __pyx_k_GL_BLUE_SIZE[] = "GL_BLUE_SIZE"; static const char __pyx_k_JOYHATMOTION[] = "JOYHATMOTION"; static const char __pyx_k_K_AC_FORWARD[] = "K_AC_FORWARD"; static const char __pyx_k_K_AC_REFRESH[] = "K_AC_REFRESH"; static const char __pyx_k_K_CALCULATOR[] = "K_CALCULATOR"; static const char __pyx_k_K_CLEARAGAIN[] = "K_CLEARAGAIN"; static const char __pyx_k_K_KBDILLUMUP[] = "K_KBDILLUMUP"; static const char __pyx_k_K_KP_DECIMAL[] = "K_KP_DECIMAL"; static const char __pyx_k_K_KP_GREATER[] = "K_KP_GREATER"; static const char __pyx_k_K_KP_PERCENT[] = "K_KP_PERCENT"; static const char __pyx_k_K_RIGHTPAREN[] = "K_RIGHTPAREN"; static const char __pyx_k_K_SCROLLLOCK[] = "K_SCROLLLOCK"; static const char __pyx_k_K_UNDERSCORE[] = "K_UNDERSCORE"; static const char __pyx_k_K_VOLUMEDOWN[] = "K_VOLUMEDOWN"; static const char __pyx_k_MULTIGESTURE[] = "MULTIGESTURE"; static const char __pyx_k_SENSORUPDATE[] = "SENSORUPDATE"; static const char __pyx_k_WINDOW_SHOWN[] = "WINDOW_SHOWN"; static const char __pyx_k_APP_LOWMEMORY[] = "APP_LOWMEMORY"; static const char __pyx_k_BLEND_RGB_ADD[] = "BLEND_RGB_ADD"; static const char __pyx_k_BLEND_RGB_MAX[] = "BLEND_RGB_MAX"; static const char __pyx_k_BLEND_RGB_MIN[] = "BLEND_RGB_MIN"; static const char __pyx_k_BLEND_RGB_SUB[] = "BLEND_RGB_SUB"; static const char __pyx_k_DOLLARGESTURE[] = "DOLLARGESTURE"; static const char __pyx_k_GL_ALPHA_SIZE[] = "GL_ALPHA_SIZE"; static const char __pyx_k_GL_DEPTH_SIZE[] = "GL_DEPTH_SIZE"; static const char __pyx_k_GL_GREEN_SIZE[] = "GL_GREEN_SIZE"; static const char __pyx_k_JOYAXISMOTION[] = "JOYAXISMOTION"; static const char __pyx_k_JOYBALLMOTION[] = "JOYBALLMOTION"; static const char __pyx_k_JOYBUTTONDOWN[] = "JOYBUTTONDOWN"; static const char __pyx_k_KEYMAPCHANGED[] = "KEYMAPCHANGED"; static const char __pyx_k_K_APPLICATION[] = "K_APPLICATION"; static const char __pyx_k_K_AUDIOREWIND[] = "K_AUDIOREWIND"; static const char __pyx_k_K_KP_MEMCLEAR[] = "K_KP_MEMCLEAR"; static const char __pyx_k_K_KP_MEMSTORE[] = "K_KP_MEMSTORE"; static const char __pyx_k_K_KP_MULTIPLY[] = "K_KP_MULTIPLY"; static const char __pyx_k_K_LEFTBRACKET[] = "K_LEFTBRACKET"; static const char __pyx_k_K_MEDIASELECT[] = "K_MEDIASELECT"; static const char __pyx_k_K_PRINTSCREEN[] = "K_PRINTSCREEN"; static const char __pyx_k_MOUSEBUTTONUP[] = "MOUSEBUTTONUP"; static const char __pyx_k_TOUCH_MOUSEID[] = "TOUCH_MOUSEID"; static const char __pyx_k_WINDOW_HIDDEN[] = "WINDOW_HIDDEN"; static const char __pyx_k_WINDOW_OPENGL[] = "WINDOW_OPENGL"; static const char __pyx_k_BLEND_RGBA_ADD[] = "BLEND_RGBA_ADD"; static const char __pyx_k_BLEND_RGBA_MAX[] = "BLEND_RGBA_MAX"; static const char __pyx_k_BLEND_RGBA_MIN[] = "BLEND_RGBA_MIN"; static const char __pyx_k_BLEND_RGBA_SUB[] = "BLEND_RGBA_SUB"; static const char __pyx_k_BLEND_RGB_MULT[] = "BLEND_RGB_MULT"; static const char __pyx_k_GL_BUFFER_SIZE[] = "GL_BUFFER_SIZE"; static const char __pyx_k_GL_CONTEXT_EGL[] = "GL_CONTEXT_EGL"; static const char __pyx_k_JOYDEVICEADDED[] = "JOYDEVICEADDED"; static const char __pyx_k_K_AC_BOOKMARKS[] = "K_AC_BOOKMARKS"; static const char __pyx_k_K_BRIGHTNESSUP[] = "K_BRIGHTNESSUP"; static const char __pyx_k_K_CURRENCYUNIT[] = "K_CURRENCYUNIT"; static const char __pyx_k_K_KBDILLUMDOWN[] = "K_KBDILLUMDOWN"; static const char __pyx_k_K_KP_AMPERSAND[] = "K_KP_AMPERSAND"; static const char __pyx_k_K_KP_BACKSPACE[] = "K_KP_BACKSPACE"; static const char __pyx_k_K_KP_LEFTBRACE[] = "K_KP_LEFTBRACE"; static const char __pyx_k_K_KP_LEFTPAREN[] = "K_KP_LEFTPAREN"; static const char __pyx_k_K_KP_MEMDIVIDE[] = "K_KP_MEMDIVIDE"; static const char __pyx_k_K_KP_MEMRECALL[] = "K_KP_MEMRECALL"; static const char __pyx_k_K_KP_PLUSMINUS[] = "K_KP_PLUSMINUS"; static const char __pyx_k_K_NUMLOCKCLEAR[] = "K_NUMLOCKCLEAR"; static const char __pyx_k_K_RIGHTBRACKET[] = "K_RIGHTBRACKET"; static const char __pyx_k_WINDOW_FOREIGN[] = "WINDOW_FOREIGN"; static const char __pyx_k_WINDOW_NOFRAME[] = "WINDOW_NOFRAME"; static const char __pyx_k_APP_TERMINATING[] = "APP_TERMINATING"; static const char __pyx_k_BLEND_RGBA_MULT[] = "BLEND_RGBA_MULT"; static const char __pyx_k_CLIPBOARDUPDATE[] = "CLIPBOARDUPDATE"; static const char __pyx_k_GL_DOUBLEBUFFER[] = "GL_DOUBLEBUFFER"; static const char __pyx_k_GL_STENCIL_SIZE[] = "GL_STENCIL_SIZE"; static const char __pyx_k_GL_SWAP_CONTROL[] = "GL_SWAP_CONTROL"; static const char __pyx_k_K_DISPLAYSWITCH[] = "K_DISPLAYSWITCH"; static const char __pyx_k_K_KP_CLEARENTRY[] = "K_KP_CLEARENTRY"; static const char __pyx_k_K_KP_RIGHTBRACE[] = "K_KP_RIGHTBRACE"; static const char __pyx_k_K_KP_RIGHTPAREN[] = "K_KP_RIGHTPAREN"; static const char __pyx_k_MOUSEBUTTONDOWN[] = "MOUSEBUTTONDOWN"; static const char __pyx_k_AUDIODEVICEADDED[] = "AUDIODEVICEADDED"; static const char __pyx_k_GL_CONTEXT_FLAGS[] = "GL_CONTEXT_FLAGS"; static const char __pyx_k_JOYDEVICEREMOVED[] = "JOYDEVICEREMOVED"; static const char __pyx_k_K_BRIGHTNESSDOWN[] = "K_BRIGHTNESSDOWN"; static const char __pyx_k_K_KBDILLUMTOGGLE[] = "K_KBDILLUMTOGGLE"; static const char __pyx_k_K_KP_EQUALSAS400[] = "K_KP_EQUALSAS400"; static const char __pyx_k_K_KP_HEXADECIMAL[] = "K_KP_HEXADECIMAL"; static const char __pyx_k_K_KP_MEMMULTIPLY[] = "K_KP_MEMMULTIPLY"; static const char __pyx_k_K_KP_MEMSUBTRACT[] = "K_KP_MEMSUBTRACT"; static const char __pyx_k_K_KP_VERTICALBAR[] = "K_KP_VERTICALBAR"; static const char __pyx_k_WINDOW_MAXIMIZED[] = "WINDOW_MAXIMIZED"; static const char __pyx_k_WINDOW_MINIMIZED[] = "WINDOW_MINIMIZED"; static const char __pyx_k_WINDOW_RESIZABLE[] = "WINDOW_RESIZABLE"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_GL_ACCUM_RED_SIZE[] = "GL_ACCUM_RED_SIZE"; static const char __pyx_k_K_CURRENCYSUBUNIT[] = "K_CURRENCYSUBUNIT"; static const char __pyx_k_K_KP_DBLAMPERSAND[] = "K_KP_DBLAMPERSAND"; static const char __pyx_k_SDL_VERSION_TUPLE[] = "SDL_VERSION_TUPLE"; static const char __pyx_k_WINDOW_BORDERLESS[] = "WINDOW_BORDERLESS"; static const char __pyx_k_WINDOW_FULLSCREEN[] = "WINDOW_FULLSCREEN"; static const char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color"; static const char __pyx_k_AUDIODEVICEREMOVED[] = "AUDIODEVICEREMOVED"; static const char __pyx_k_CONTROLLERBUTTONUP[] = "CONTROLLERBUTTONUP"; static const char __pyx_k_GL_ACCUM_BLUE_SIZE[] = "GL_ACCUM_BLUE_SIZE"; static const char __pyx_k_K_AUDIOFASTFORWARD[] = "K_AUDIOFASTFORWARD"; static const char __pyx_k_K_DECIMALSEPARATOR[] = "K_DECIMALSEPARATOR"; static const char __pyx_k_POWERSTATE_CHARGED[] = "POWERSTATE_CHARGED"; static const char __pyx_k_POWERSTATE_UNKNOWN[] = "POWERSTATE_UNKNOWN"; static const char __pyx_k_WINDOWPOS_CENTERED[] = "WINDOWPOS_CENTERED"; static const char __pyx_k_WINDOW_INPUT_FOCUS[] = "WINDOW_INPUT_FOCUS"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_BLEND_PREMULTIPLIED[] = "BLEND_PREMULTIPLIED"; static const char __pyx_k_CONTROLLER_AXIS_MAX[] = "CONTROLLER_AXIS_MAX"; static const char __pyx_k_CONTROLLER_BUTTON_A[] = "CONTROLLER_BUTTON_A"; static const char __pyx_k_CONTROLLER_BUTTON_B[] = "CONTROLLER_BUTTON_B"; static const char __pyx_k_CONTROLLER_BUTTON_X[] = "CONTROLLER_BUTTON_X"; static const char __pyx_k_CONTROLLER_BUTTON_Y[] = "CONTROLLER_BUTTON_Y"; static const char __pyx_k_GL_ACCUM_ALPHA_SIZE[] = "GL_ACCUM_ALPHA_SIZE"; static const char __pyx_k_GL_ACCUM_GREEN_SIZE[] = "GL_ACCUM_GREEN_SIZE"; static const char __pyx_k_GL_CONTEXT_NO_ERROR[] = "GL_CONTEXT_NO_ERROR"; static const char __pyx_k_GL_RETAINED_BACKING[] = "GL_RETAINED_BACKING"; static const char __pyx_k_K_KP_DBLVERTICALBAR[] = "K_KP_DBLVERTICALBAR"; static const char __pyx_k_POWERSTATE_CHARGING[] = "POWERSTATE_CHARGING"; static const char __pyx_k_RENDER_DEVICE_RESET[] = "RENDER_DEVICE_RESET"; static const char __pyx_k_WINDOWPOS_UNDEFINED[] = "WINDOWPOS_UNDEFINED"; static const char __pyx_k_CONTROLLERAXISMOTION[] = "CONTROLLERAXISMOTION"; static const char __pyx_k_CONTROLLERBUTTONDOWN[] = "CONTROLLERBUTTONDOWN"; static const char __pyx_k_K_THOUSANDSSEPARATOR[] = "K_THOUSANDSSEPARATOR"; static const char __pyx_k_RENDER_TARGETS_RESET[] = "RENDER_TARGETS_RESET"; static const char __pyx_k_WINDOW_ALLOW_HIGHDPI[] = "WINDOW_ALLOW_HIGHDPI"; static const char __pyx_k_WINDOW_INPUT_GRABBED[] = "WINDOW_INPUT_GRABBED"; static const char __pyx_k_CONTROLLERDEVICEADDED[] = "CONTROLLERDEVICEADDED"; static const char __pyx_k_CONTROLLER_AXIS_LEFTX[] = "CONTROLLER_AXIS_LEFTX"; static const char __pyx_k_CONTROLLER_AXIS_LEFTY[] = "CONTROLLER_AXIS_LEFTY"; static const char __pyx_k_CONTROLLER_BUTTON_MAX[] = "CONTROLLER_BUTTON_MAX"; static const char __pyx_k_GL_ACCELERATED_VISUAL[] = "GL_ACCELERATED_VISUAL"; static const char __pyx_k_GL_CONTEXT_PROFILE_ES[] = "GL_CONTEXT_PROFILE_ES"; static const char __pyx_k_GL_MULTISAMPLEBUFFERS[] = "GL_MULTISAMPLEBUFFERS"; static const char __pyx_k_GL_MULTISAMPLESAMPLES[] = "GL_MULTISAMPLESAMPLES"; static const char __pyx_k_POWERSTATE_NO_BATTERY[] = "POWERSTATE_NO_BATTERY"; static const char __pyx_k_POWERSTATE_ON_BATTERY[] = "POWERSTATE_ON_BATTERY"; static const char __pyx_k_APP_DIDENTERBACKGROUND[] = "APP_DIDENTERBACKGROUND"; static const char __pyx_k_APP_DIDENTERFOREGROUND[] = "APP_DIDENTERFOREGROUND"; static const char __pyx_k_CONTROLLER_AXIS_RIGHTX[] = "CONTROLLER_AXIS_RIGHTX"; static const char __pyx_k_CONTROLLER_AXIS_RIGHTY[] = "CONTROLLER_AXIS_RIGHTY"; static const char __pyx_k_CONTROLLER_BUTTON_BACK[] = "CONTROLLER_BUTTON_BACK"; static const char __pyx_k_APP_WILLENTERBACKGROUND[] = "APP_WILLENTERBACKGROUND"; static const char __pyx_k_APP_WILLENTERFOREGROUND[] = "APP_WILLENTERFOREGROUND"; static const char __pyx_k_CONTROLLERDEVICEREMOVED[] = "CONTROLLERDEVICEREMOVED"; static const char __pyx_k_CONTROLLER_AXIS_INVALID[] = "CONTROLLER_AXIS_INVALID"; static const char __pyx_k_CONTROLLER_BUTTON_GUIDE[] = "CONTROLLER_BUTTON_GUIDE"; static const char __pyx_k_CONTROLLER_BUTTON_START[] = "CONTROLLER_BUTTON_START"; static const char __pyx_k_GL_CONTEXT_PROFILE_CORE[] = "GL_CONTEXT_PROFILE_CORE"; static const char __pyx_k_GL_CONTEXT_PROFILE_MASK[] = "GL_CONTEXT_PROFILE_MASK"; static const char __pyx_k_CONTROLLERDEVICEREMAPPED[] = "CONTROLLERDEVICEREMAPPED"; static const char __pyx_k_GL_CONTEXT_MAJOR_VERSION[] = "GL_CONTEXT_MAJOR_VERSION"; static const char __pyx_k_GL_CONTEXT_MINOR_VERSION[] = "GL_CONTEXT_MINOR_VERSION"; static const char __pyx_k_CONTROLLER_BUTTON_DPAD_UP[] = "CONTROLLER_BUTTON_DPAD_UP"; static const char __pyx_k_CONTROLLER_BUTTON_INVALID[] = "CONTROLLER_BUTTON_INVALID"; static const char __pyx_k_WINDOW_FULLSCREEN_DESKTOP[] = "WINDOW_FULLSCREEN_DESKTOP"; static const char __pyx_k_CONTROLLER_AXIS_TRIGGERLEFT[] = "CONTROLLER_AXIS_TRIGGERLEFT"; static const char __pyx_k_CONTROLLER_BUTTON_DPAD_DOWN[] = "CONTROLLER_BUTTON_DPAD_DOWN"; static const char __pyx_k_CONTROLLER_BUTTON_DPAD_LEFT[] = "CONTROLLER_BUTTON_DPAD_LEFT"; static const char __pyx_k_CONTROLLER_BUTTON_LEFTSTICK[] = "CONTROLLER_BUTTON_LEFTSTICK"; static const char __pyx_k_GL_CONTEXT_RELEASE_BEHAVIOR[] = "GL_CONTEXT_RELEASE_BEHAVIOR"; static const char __pyx_k_GL_FRAMEBUFFER_SRGB_CAPABLE[] = "GL_FRAMEBUFFER_SRGB_CAPABLE"; static const char __pyx_k_CONTROLLER_AXIS_TRIGGERRIGHT[] = "CONTROLLER_AXIS_TRIGGERRIGHT"; static const char __pyx_k_CONTROLLER_BUTTON_DPAD_RIGHT[] = "CONTROLLER_BUTTON_DPAD_RIGHT"; static const char __pyx_k_CONTROLLER_BUTTON_RIGHTSTICK[] = "CONTROLLER_BUTTON_RIGHTSTICK"; static const char __pyx_k_GL_CONTEXT_RESET_NOTIFICATION[] = "GL_CONTEXT_RESET_NOTIFICATION"; static const char __pyx_k_GL_SHARE_WITH_CURRENT_CONTEXT[] = "GL_SHARE_WITH_CURRENT_CONTEXT"; static const char __pyx_k_CONTROLLER_BUTTON_LEFTSHOULDER[] = "CONTROLLER_BUTTON_LEFTSHOULDER"; static const char __pyx_k_CONTROLLER_BUTTON_RIGHTSHOULDER[] = "CONTROLLER_BUTTON_RIGHTSHOULDER"; static const char __pyx_k_GL_CONTEXT_PROFILE_COMPATIBILITY[] = "GL_CONTEXT_PROFILE_COMPATIBILITY"; /* #### Code section: decls ### */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_u_; PyObject *__pyx_n_s_ACTIVEEVENT; PyObject *__pyx_n_s_APP_DIDENTERBACKGROUND; PyObject *__pyx_n_s_APP_DIDENTERFOREGROUND; PyObject *__pyx_n_s_APP_LOWMEMORY; PyObject *__pyx_n_s_APP_TERMINATING; PyObject *__pyx_n_s_APP_WILLENTERBACKGROUND; PyObject *__pyx_n_s_APP_WILLENTERFOREGROUND; PyObject *__pyx_n_s_AUDIODEVICEADDED; PyObject *__pyx_n_s_AUDIODEVICEREMOVED; PyObject *__pyx_n_s_BIG_ENDIAN; PyObject *__pyx_n_s_BLEND_ADD; PyObject *__pyx_n_s_BLEND_MAX; PyObject *__pyx_n_s_BLEND_MIN; PyObject *__pyx_n_s_BLEND_MULT; PyObject *__pyx_n_s_BLEND_PREMULTIPLIED; PyObject *__pyx_n_s_BLEND_RGBA_ADD; PyObject *__pyx_n_s_BLEND_RGBA_MAX; PyObject *__pyx_n_s_BLEND_RGBA_MIN; PyObject *__pyx_n_s_BLEND_RGBA_MULT; PyObject *__pyx_n_s_BLEND_RGBA_SUB; PyObject *__pyx_n_s_BLEND_RGB_ADD; PyObject *__pyx_n_s_BLEND_RGB_MAX; PyObject *__pyx_n_s_BLEND_RGB_MIN; PyObject *__pyx_n_s_BLEND_RGB_MULT; PyObject *__pyx_n_s_BLEND_RGB_SUB; PyObject *__pyx_n_s_BLEND_SUB; PyObject *__pyx_n_s_BYTEORDER; PyObject *__pyx_n_s_CLIPBOARDUPDATE; PyObject *__pyx_n_s_CONTROLLERAXISMOTION; PyObject *__pyx_n_s_CONTROLLERBUTTONDOWN; PyObject *__pyx_n_s_CONTROLLERBUTTONUP; PyObject *__pyx_n_s_CONTROLLERDEVICEADDED; PyObject *__pyx_n_s_CONTROLLERDEVICEREMAPPED; PyObject *__pyx_n_s_CONTROLLERDEVICEREMOVED; PyObject *__pyx_n_s_CONTROLLER_AXIS_INVALID; PyObject *__pyx_n_s_CONTROLLER_AXIS_LEFTX; PyObject *__pyx_n_s_CONTROLLER_AXIS_LEFTY; PyObject *__pyx_n_s_CONTROLLER_AXIS_MAX; PyObject *__pyx_n_s_CONTROLLER_AXIS_RIGHTX; PyObject *__pyx_n_s_CONTROLLER_AXIS_RIGHTY; PyObject *__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT; PyObject *__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT; PyObject *__pyx_n_s_CONTROLLER_BUTTON_A; PyObject *__pyx_n_s_CONTROLLER_BUTTON_B; PyObject *__pyx_n_s_CONTROLLER_BUTTON_BACK; PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN; PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT; PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT; PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP; PyObject *__pyx_n_s_CONTROLLER_BUTTON_GUIDE; PyObject *__pyx_n_s_CONTROLLER_BUTTON_INVALID; PyObject *__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER; PyObject *__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK; PyObject *__pyx_n_s_CONTROLLER_BUTTON_MAX; PyObject *__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER; PyObject *__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK; PyObject *__pyx_n_s_CONTROLLER_BUTTON_START; PyObject *__pyx_n_s_CONTROLLER_BUTTON_X; PyObject *__pyx_n_s_CONTROLLER_BUTTON_Y; PyObject *__pyx_n_s_Color; PyObject *__pyx_n_s_DISPLAYEVENT; PyObject *__pyx_n_s_DOLLARGESTURE; PyObject *__pyx_n_s_DOLLARRECORD; PyObject *__pyx_n_s_DOUBLEBUF; PyObject *__pyx_n_s_DROPBEGIN; PyObject *__pyx_n_s_DROPCOMPLETE; PyObject *__pyx_n_s_DROPFILE; PyObject *__pyx_n_s_DROPTEXT; PyObject *__pyx_n_s_FINGERDOWN; PyObject *__pyx_n_s_FINGERMOTION; PyObject *__pyx_n_s_FINGERUP; PyObject *__pyx_n_s_FULLSCREEN; PyObject *__pyx_n_s_GL_ACCELERATED_VISUAL; PyObject *__pyx_n_s_GL_ACCUM_ALPHA_SIZE; PyObject *__pyx_n_s_GL_ACCUM_BLUE_SIZE; PyObject *__pyx_n_s_GL_ACCUM_GREEN_SIZE; PyObject *__pyx_n_s_GL_ACCUM_RED_SIZE; PyObject *__pyx_n_s_GL_ALPHA_SIZE; PyObject *__pyx_n_s_GL_BLUE_SIZE; PyObject *__pyx_n_s_GL_BUFFER_SIZE; PyObject *__pyx_n_s_GL_CONTEXT_EGL; PyObject *__pyx_n_s_GL_CONTEXT_FLAGS; PyObject *__pyx_n_s_GL_CONTEXT_MAJOR_VERSION; PyObject *__pyx_n_s_GL_CONTEXT_MINOR_VERSION; PyObject *__pyx_n_s_GL_CONTEXT_NO_ERROR; PyObject *__pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY; PyObject *__pyx_n_s_GL_CONTEXT_PROFILE_CORE; PyObject *__pyx_n_s_GL_CONTEXT_PROFILE_ES; PyObject *__pyx_n_s_GL_CONTEXT_PROFILE_MASK; PyObject *__pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR; PyObject *__pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION; PyObject *__pyx_n_s_GL_DEPTH_SIZE; PyObject *__pyx_n_s_GL_DOUBLEBUFFER; PyObject *__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE; PyObject *__pyx_n_s_GL_GREEN_SIZE; PyObject *__pyx_n_s_GL_MULTISAMPLEBUFFERS; PyObject *__pyx_n_s_GL_MULTISAMPLESAMPLES; PyObject *__pyx_n_s_GL_RED_SIZE; PyObject *__pyx_n_s_GL_RETAINED_BACKING; PyObject *__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT; PyObject *__pyx_n_s_GL_STENCIL_SIZE; PyObject *__pyx_n_s_GL_STEREO; PyObject *__pyx_n_s_GL_SWAP_CONTROL; PyObject *__pyx_n_s_HWSURFACE; PyObject *__pyx_n_s_JOYAXISMOTION; PyObject *__pyx_n_s_JOYBALLMOTION; PyObject *__pyx_n_s_JOYBUTTONDOWN; PyObject *__pyx_n_s_JOYBUTTONUP; PyObject *__pyx_n_s_JOYDEVICEADDED; PyObject *__pyx_n_s_JOYDEVICEREMOVED; PyObject *__pyx_n_s_JOYHATMOTION; PyObject *__pyx_n_s_KEYDOWN; PyObject *__pyx_n_s_KEYMAPCHANGED; PyObject *__pyx_n_s_KEYUP; PyObject *__pyx_n_s_KMOD_ALT; PyObject *__pyx_n_s_KMOD_CAPS; PyObject *__pyx_n_s_KMOD_CTRL; PyObject *__pyx_n_s_KMOD_GUI; PyObject *__pyx_n_s_KMOD_LALT; PyObject *__pyx_n_s_KMOD_LCTRL; PyObject *__pyx_n_s_KMOD_LGUI; PyObject *__pyx_n_s_KMOD_LMETA; PyObject *__pyx_n_s_KMOD_LSHIFT; PyObject *__pyx_n_s_KMOD_META; PyObject *__pyx_n_s_KMOD_MODE; PyObject *__pyx_n_s_KMOD_NONE; PyObject *__pyx_n_s_KMOD_NUM; PyObject *__pyx_n_s_KMOD_RALT; PyObject *__pyx_n_s_KMOD_RCTRL; PyObject *__pyx_n_s_KMOD_RGUI; PyObject *__pyx_n_s_KMOD_RMETA; PyObject *__pyx_n_s_KMOD_RSHIFT; PyObject *__pyx_n_s_KMOD_SHIFT; PyObject *__pyx_n_s_K_0; PyObject *__pyx_n_s_K_1; PyObject *__pyx_n_s_K_2; PyObject *__pyx_n_s_K_3; PyObject *__pyx_n_s_K_4; PyObject *__pyx_n_s_K_5; PyObject *__pyx_n_s_K_6; PyObject *__pyx_n_s_K_7; PyObject *__pyx_n_s_K_8; PyObject *__pyx_n_s_K_9; PyObject *__pyx_n_s_K_AC_BACK; PyObject *__pyx_n_s_K_AC_BOOKMARKS; PyObject *__pyx_n_s_K_AC_FORWARD; PyObject *__pyx_n_s_K_AC_HOME; PyObject *__pyx_n_s_K_AC_REFRESH; PyObject *__pyx_n_s_K_AC_SEARCH; PyObject *__pyx_n_s_K_AC_STOP; PyObject *__pyx_n_s_K_AGAIN; PyObject *__pyx_n_s_K_ALTERASE; PyObject *__pyx_n_s_K_AMPERSAND; PyObject *__pyx_n_s_K_APP1; PyObject *__pyx_n_s_K_APP2; PyObject *__pyx_n_s_K_APPLICATION; PyObject *__pyx_n_s_K_ASTERISK; PyObject *__pyx_n_s_K_AT; PyObject *__pyx_n_s_K_AUDIOFASTFORWARD; PyObject *__pyx_n_s_K_AUDIOMUTE; PyObject *__pyx_n_s_K_AUDIONEXT; PyObject *__pyx_n_s_K_AUDIOPLAY; PyObject *__pyx_n_s_K_AUDIOPREV; PyObject *__pyx_n_s_K_AUDIOREWIND; PyObject *__pyx_n_s_K_AUDIOSTOP; PyObject *__pyx_n_s_K_BACKQUOTE; PyObject *__pyx_n_s_K_BACKSLASH; PyObject *__pyx_n_s_K_BACKSPACE; PyObject *__pyx_n_s_K_BREAK; PyObject *__pyx_n_s_K_BRIGHTNESSDOWN; PyObject *__pyx_n_s_K_BRIGHTNESSUP; PyObject *__pyx_n_s_K_CALCULATOR; PyObject *__pyx_n_s_K_CANCEL; PyObject *__pyx_n_s_K_CAPSLOCK; PyObject *__pyx_n_s_K_CARET; PyObject *__pyx_n_s_K_CLEAR; PyObject *__pyx_n_s_K_CLEARAGAIN; PyObject *__pyx_n_s_K_COLON; PyObject *__pyx_n_s_K_COMMA; PyObject *__pyx_n_s_K_COMPUTER; PyObject *__pyx_n_s_K_COPY; PyObject *__pyx_n_s_K_CRSEL; PyObject *__pyx_n_s_K_CURRENCYSUBUNIT; PyObject *__pyx_n_s_K_CURRENCYUNIT; PyObject *__pyx_n_s_K_CUT; PyObject *__pyx_n_s_K_DECIMALSEPARATOR; PyObject *__pyx_n_s_K_DELETE; PyObject *__pyx_n_s_K_DISPLAYSWITCH; PyObject *__pyx_n_s_K_DOLLAR; PyObject *__pyx_n_s_K_DOWN; PyObject *__pyx_n_s_K_EJECT; PyObject *__pyx_n_s_K_END; PyObject *__pyx_n_s_K_EQUALS; PyObject *__pyx_n_s_K_ESCAPE; PyObject *__pyx_n_s_K_EURO; PyObject *__pyx_n_s_K_EXCLAIM; PyObject *__pyx_n_s_K_EXECUTE; PyObject *__pyx_n_s_K_EXSEL; PyObject *__pyx_n_s_K_F1; PyObject *__pyx_n_s_K_F10; PyObject *__pyx_n_s_K_F11; PyObject *__pyx_n_s_K_F12; PyObject *__pyx_n_s_K_F13; PyObject *__pyx_n_s_K_F14; PyObject *__pyx_n_s_K_F15; PyObject *__pyx_n_s_K_F16; PyObject *__pyx_n_s_K_F17; PyObject *__pyx_n_s_K_F18; PyObject *__pyx_n_s_K_F19; PyObject *__pyx_n_s_K_F2; PyObject *__pyx_n_s_K_F20; PyObject *__pyx_n_s_K_F21; PyObject *__pyx_n_s_K_F22; PyObject *__pyx_n_s_K_F23; PyObject *__pyx_n_s_K_F24; PyObject *__pyx_n_s_K_F3; PyObject *__pyx_n_s_K_F4; PyObject *__pyx_n_s_K_F5; PyObject *__pyx_n_s_K_F6; PyObject *__pyx_n_s_K_F7; PyObject *__pyx_n_s_K_F8; PyObject *__pyx_n_s_K_F9; PyObject *__pyx_n_s_K_FIND; PyObject *__pyx_n_s_K_FIRST; PyObject *__pyx_n_s_K_GREATER; PyObject *__pyx_n_s_K_HASH; PyObject *__pyx_n_s_K_HELP; PyObject *__pyx_n_s_K_HOME; PyObject *__pyx_n_s_K_INSERT; PyObject *__pyx_n_s_K_KBDILLUMDOWN; PyObject *__pyx_n_s_K_KBDILLUMTOGGLE; PyObject *__pyx_n_s_K_KBDILLUMUP; PyObject *__pyx_n_s_K_KP0; PyObject *__pyx_n_s_K_KP1; PyObject *__pyx_n_s_K_KP2; PyObject *__pyx_n_s_K_KP3; PyObject *__pyx_n_s_K_KP4; PyObject *__pyx_n_s_K_KP5; PyObject *__pyx_n_s_K_KP6; PyObject *__pyx_n_s_K_KP7; PyObject *__pyx_n_s_K_KP8; PyObject *__pyx_n_s_K_KP9; PyObject *__pyx_n_s_K_KP_0; PyObject *__pyx_n_s_K_KP_00; PyObject *__pyx_n_s_K_KP_000; PyObject *__pyx_n_s_K_KP_1; PyObject *__pyx_n_s_K_KP_2; PyObject *__pyx_n_s_K_KP_3; PyObject *__pyx_n_s_K_KP_4; PyObject *__pyx_n_s_K_KP_5; PyObject *__pyx_n_s_K_KP_6; PyObject *__pyx_n_s_K_KP_7; PyObject *__pyx_n_s_K_KP_8; PyObject *__pyx_n_s_K_KP_9; PyObject *__pyx_n_s_K_KP_A; PyObject *__pyx_n_s_K_KP_AMPERSAND; PyObject *__pyx_n_s_K_KP_AT; PyObject *__pyx_n_s_K_KP_B; PyObject *__pyx_n_s_K_KP_BACKSPACE; PyObject *__pyx_n_s_K_KP_BINARY; PyObject *__pyx_n_s_K_KP_C; PyObject *__pyx_n_s_K_KP_CLEAR; PyObject *__pyx_n_s_K_KP_CLEARENTRY; PyObject *__pyx_n_s_K_KP_COLON; PyObject *__pyx_n_s_K_KP_COMMA; PyObject *__pyx_n_s_K_KP_D; PyObject *__pyx_n_s_K_KP_DBLAMPERSAND; PyObject *__pyx_n_s_K_KP_DBLVERTICALBAR; PyObject *__pyx_n_s_K_KP_DECIMAL; PyObject *__pyx_n_s_K_KP_DIVIDE; PyObject *__pyx_n_s_K_KP_E; PyObject *__pyx_n_s_K_KP_ENTER; PyObject *__pyx_n_s_K_KP_EQUALS; PyObject *__pyx_n_s_K_KP_EQUALSAS400; PyObject *__pyx_n_s_K_KP_EXCLAM; PyObject *__pyx_n_s_K_KP_F; PyObject *__pyx_n_s_K_KP_GREATER; PyObject *__pyx_n_s_K_KP_HASH; PyObject *__pyx_n_s_K_KP_HEXADECIMAL; PyObject *__pyx_n_s_K_KP_LEFTBRACE; PyObject *__pyx_n_s_K_KP_LEFTPAREN; PyObject *__pyx_n_s_K_KP_LESS; PyObject *__pyx_n_s_K_KP_MEMADD; PyObject *__pyx_n_s_K_KP_MEMCLEAR; PyObject *__pyx_n_s_K_KP_MEMDIVIDE; PyObject *__pyx_n_s_K_KP_MEMMULTIPLY; PyObject *__pyx_n_s_K_KP_MEMRECALL; PyObject *__pyx_n_s_K_KP_MEMSTORE; PyObject *__pyx_n_s_K_KP_MEMSUBTRACT; PyObject *__pyx_n_s_K_KP_MINUS; PyObject *__pyx_n_s_K_KP_MULTIPLY; PyObject *__pyx_n_s_K_KP_OCTAL; PyObject *__pyx_n_s_K_KP_PERCENT; PyObject *__pyx_n_s_K_KP_PERIOD; PyObject *__pyx_n_s_K_KP_PLUS; PyObject *__pyx_n_s_K_KP_PLUSMINUS; PyObject *__pyx_n_s_K_KP_POWER; PyObject *__pyx_n_s_K_KP_RIGHTBRACE; PyObject *__pyx_n_s_K_KP_RIGHTPAREN; PyObject *__pyx_n_s_K_KP_SPACE; PyObject *__pyx_n_s_K_KP_TAB; PyObject *__pyx_n_s_K_KP_VERTICALBAR; PyObject *__pyx_n_s_K_KP_XOR; PyObject *__pyx_n_s_K_LALT; PyObject *__pyx_n_s_K_LAST; PyObject *__pyx_n_s_K_LCTRL; PyObject *__pyx_n_s_K_LEFT; PyObject *__pyx_n_s_K_LEFTBRACKET; PyObject *__pyx_n_s_K_LEFTPAREN; PyObject *__pyx_n_s_K_LESS; PyObject *__pyx_n_s_K_LGUI; PyObject *__pyx_n_s_K_LMETA; PyObject *__pyx_n_s_K_LSHIFT; PyObject *__pyx_n_s_K_LSUPER; PyObject *__pyx_n_s_K_MAIL; PyObject *__pyx_n_s_K_MEDIASELECT; PyObject *__pyx_n_s_K_MENU; PyObject *__pyx_n_s_K_MINUS; PyObject *__pyx_n_s_K_MODE; PyObject *__pyx_n_s_K_MUTE; PyObject *__pyx_n_s_K_NUMLOCK; PyObject *__pyx_n_s_K_NUMLOCKCLEAR; PyObject *__pyx_n_s_K_OPER; PyObject *__pyx_n_s_K_OUT; PyObject *__pyx_n_s_K_PAGEDOWN; PyObject *__pyx_n_s_K_PAGEUP; PyObject *__pyx_n_s_K_PASTE; PyObject *__pyx_n_s_K_PAUSE; PyObject *__pyx_n_s_K_PERCENT; PyObject *__pyx_n_s_K_PERIOD; PyObject *__pyx_n_s_K_PLUS; PyObject *__pyx_n_s_K_POWER; PyObject *__pyx_n_s_K_PRINT; PyObject *__pyx_n_s_K_PRINTSCREEN; PyObject *__pyx_n_s_K_PRIOR; PyObject *__pyx_n_s_K_QUESTION; PyObject *__pyx_n_s_K_QUOTE; PyObject *__pyx_n_s_K_QUOTEDBL; PyObject *__pyx_n_s_K_RALT; PyObject *__pyx_n_s_K_RCTRL; PyObject *__pyx_n_s_K_RETURN; PyObject *__pyx_n_s_K_RETURN2; PyObject *__pyx_n_s_K_RGUI; PyObject *__pyx_n_s_K_RIGHT; PyObject *__pyx_n_s_K_RIGHTBRACKET; PyObject *__pyx_n_s_K_RIGHTPAREN; PyObject *__pyx_n_s_K_RMETA; PyObject *__pyx_n_s_K_RSHIFT; PyObject *__pyx_n_s_K_RSUPER; PyObject *__pyx_n_s_K_SCROLLLOCK; PyObject *__pyx_n_s_K_SCROLLOCK; PyObject *__pyx_n_s_K_SELECT; PyObject *__pyx_n_s_K_SEMICOLON; PyObject *__pyx_n_s_K_SEPARATOR; PyObject *__pyx_n_s_K_SLASH; PyObject *__pyx_n_s_K_SLEEP; PyObject *__pyx_n_s_K_SPACE; PyObject *__pyx_n_s_K_STOP; PyObject *__pyx_n_s_K_SYSREQ; PyObject *__pyx_n_s_K_TAB; PyObject *__pyx_n_s_K_THOUSANDSSEPARATOR; PyObject *__pyx_n_s_K_UNDERSCORE; PyObject *__pyx_n_s_K_UNDO; PyObject *__pyx_n_s_K_UNKNOWN; PyObject *__pyx_n_s_K_UP; PyObject *__pyx_n_s_K_VOLUMEDOWN; PyObject *__pyx_n_s_K_VOLUMEUP; PyObject *__pyx_n_s_K_WWW; PyObject *__pyx_n_s_K_a; PyObject *__pyx_n_s_K_b; PyObject *__pyx_n_s_K_c; PyObject *__pyx_n_s_K_d; PyObject *__pyx_n_s_K_e; PyObject *__pyx_n_s_K_f; PyObject *__pyx_n_s_K_g; PyObject *__pyx_n_s_K_h; PyObject *__pyx_n_s_K_i; PyObject *__pyx_n_s_K_j; PyObject *__pyx_n_s_K_k; PyObject *__pyx_n_s_K_l; PyObject *__pyx_n_s_K_m; PyObject *__pyx_n_s_K_n; PyObject *__pyx_n_s_K_o; PyObject *__pyx_n_s_K_p; PyObject *__pyx_n_s_K_q; PyObject *__pyx_n_s_K_r; PyObject *__pyx_n_s_K_s; PyObject *__pyx_n_s_K_t; PyObject *__pyx_n_s_K_u; PyObject *__pyx_n_s_K_v; PyObject *__pyx_n_s_K_w; PyObject *__pyx_n_s_K_x; PyObject *__pyx_n_s_K_y; PyObject *__pyx_n_s_K_z; PyObject *__pyx_n_s_LASTEVENT; PyObject *__pyx_n_s_LIL_ENDIAN; PyObject *__pyx_n_s_MOUSEBUTTONDOWN; PyObject *__pyx_n_s_MOUSEBUTTONUP; PyObject *__pyx_n_s_MOUSEMOTION; PyObject *__pyx_n_s_MOUSEWHEEL; PyObject *__pyx_n_s_MULTIGESTURE; PyObject *__pyx_n_s_NOEVENT; PyObject *__pyx_n_s_NOFRAME; PyObject *__pyx_n_s_OPENGL; PyObject *__pyx_n_s_POWERSTATE_CHARGED; PyObject *__pyx_n_s_POWERSTATE_CHARGING; PyObject *__pyx_n_s_POWERSTATE_NO_BATTERY; PyObject *__pyx_n_s_POWERSTATE_ON_BATTERY; PyObject *__pyx_n_s_POWERSTATE_UNKNOWN; PyObject *__pyx_n_s_QUIT; PyObject *__pyx_n_s_RENDER_DEVICE_RESET; PyObject *__pyx_n_s_RENDER_TARGETS_RESET; PyObject *__pyx_n_s_RESIZABLE; PyObject *__pyx_n_s_RLEACCEL; PyObject *__pyx_n_s_Rect; PyObject *__pyx_n_s_SCRAP_TEXT; PyObject *__pyx_n_s_SDL_VERSION_TUPLE; PyObject *__pyx_n_s_SENSORUPDATE; PyObject *__pyx_n_s_SRCALPHA; PyObject *__pyx_n_s_SRCCOLORKEY; PyObject *__pyx_n_s_SWSURFACE; PyObject *__pyx_n_s_SYSWMEVENT; PyObject *__pyx_n_s_TEXTEDITING; PyObject *__pyx_n_s_TEXTINPUT; PyObject *__pyx_n_s_TOUCH_MOUSEID; PyObject *__pyx_n_s_USEREVENT; PyObject *__pyx_n_s_VIDEOEXPOSE; PyObject *__pyx_n_s_VIDEORESIZE; PyObject *__pyx_n_s_WINDOWEVENT; PyObject *__pyx_n_s_WINDOWMOVED; PyObject *__pyx_n_s_WINDOWPOS_CENTERED; PyObject *__pyx_n_s_WINDOWPOS_UNDEFINED; PyObject *__pyx_n_s_WINDOW_ALLOW_HIGHDPI; PyObject *__pyx_n_s_WINDOW_BORDERLESS; PyObject *__pyx_n_s_WINDOW_FOREIGN; PyObject *__pyx_n_s_WINDOW_FULLSCREEN; PyObject *__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP; PyObject *__pyx_n_s_WINDOW_HIDDEN; PyObject *__pyx_n_s_WINDOW_INPUT_FOCUS; PyObject *__pyx_n_s_WINDOW_INPUT_GRABBED; PyObject *__pyx_n_s_WINDOW_MAXIMIZED; PyObject *__pyx_n_s_WINDOW_MINIMIZED; PyObject *__pyx_n_s_WINDOW_NOFRAME; PyObject *__pyx_n_s_WINDOW_OPENGL; PyObject *__pyx_n_s_WINDOW_RESIZABLE; PyObject *__pyx_n_s_WINDOW_SHOWN; PyObject *__pyx_n_s__2; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_pygame_sdl2_color; PyObject *__pyx_n_s_pygame_sdl2_rect; PyObject *__pyx_n_s_test; PyObject *__pyx_kp_s_text_plain; PyObject *__pyx_n_s_update; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_2; PyObject *__pyx_int_3; PyObject *__pyx_int_4; PyObject *__pyx_int_5; PyObject *__pyx_int_6; PyObject *__pyx_int_7; PyObject *__pyx_int_8; PyObject *__pyx_int_9; PyObject *__pyx_int_16; PyObject *__pyx_int_17; PyObject *__pyx_int_1073741824; PyObject *__pyx_int_2147483648; PyObject *__pyx_int_neg_1; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_n_s_ACTIVEEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_APP_DIDENTERBACKGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_APP_DIDENTERFOREGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_APP_LOWMEMORY); Py_CLEAR(clear_module_state->__pyx_n_s_APP_TERMINATING); Py_CLEAR(clear_module_state->__pyx_n_s_APP_WILLENTERBACKGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_APP_WILLENTERFOREGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_AUDIODEVICEADDED); Py_CLEAR(clear_module_state->__pyx_n_s_AUDIODEVICEREMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_BIG_ENDIAN); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_ADD); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_MIN); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_MULT); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_PREMULTIPLIED); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGBA_ADD); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGBA_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGBA_MIN); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGBA_MULT); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGBA_SUB); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGB_ADD); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGB_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGB_MIN); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGB_MULT); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGB_SUB); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_SUB); Py_CLEAR(clear_module_state->__pyx_n_s_BYTEORDER); Py_CLEAR(clear_module_state->__pyx_n_s_CLIPBOARDUPDATE); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERAXISMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERBUTTONDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERBUTTONUP); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERDEVICEADDED); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERDEVICEREMAPPED); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERDEVICEREMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_INVALID); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_LEFTX); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_LEFTY); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_RIGHTX); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_RIGHTY); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_A); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_B); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_BACK); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_GUIDE); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_INVALID); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_START); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_X); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_Y); Py_CLEAR(clear_module_state->__pyx_n_s_Color); Py_CLEAR(clear_module_state->__pyx_n_s_DISPLAYEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_DOLLARGESTURE); Py_CLEAR(clear_module_state->__pyx_n_s_DOLLARRECORD); Py_CLEAR(clear_module_state->__pyx_n_s_DOUBLEBUF); Py_CLEAR(clear_module_state->__pyx_n_s_DROPBEGIN); Py_CLEAR(clear_module_state->__pyx_n_s_DROPCOMPLETE); Py_CLEAR(clear_module_state->__pyx_n_s_DROPFILE); Py_CLEAR(clear_module_state->__pyx_n_s_DROPTEXT); Py_CLEAR(clear_module_state->__pyx_n_s_FINGERDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_FINGERMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_FINGERUP); Py_CLEAR(clear_module_state->__pyx_n_s_FULLSCREEN); Py_CLEAR(clear_module_state->__pyx_n_s_GL_ACCELERATED_VISUAL); Py_CLEAR(clear_module_state->__pyx_n_s_GL_ACCUM_ALPHA_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_ACCUM_BLUE_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_ACCUM_GREEN_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_ACCUM_RED_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_ALPHA_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_BLUE_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_BUFFER_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_EGL); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_FLAGS); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_MAJOR_VERSION); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_MINOR_VERSION); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_NO_ERROR); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_CORE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_ES); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_MASK); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION); Py_CLEAR(clear_module_state->__pyx_n_s_GL_DEPTH_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_DOUBLEBUFFER); Py_CLEAR(clear_module_state->__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_GREEN_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_MULTISAMPLEBUFFERS); Py_CLEAR(clear_module_state->__pyx_n_s_GL_MULTISAMPLESAMPLES); Py_CLEAR(clear_module_state->__pyx_n_s_GL_RED_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_RETAINED_BACKING); Py_CLEAR(clear_module_state->__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT); Py_CLEAR(clear_module_state->__pyx_n_s_GL_STENCIL_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_STEREO); Py_CLEAR(clear_module_state->__pyx_n_s_GL_SWAP_CONTROL); Py_CLEAR(clear_module_state->__pyx_n_s_HWSURFACE); Py_CLEAR(clear_module_state->__pyx_n_s_JOYAXISMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_JOYBALLMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_JOYBUTTONDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_JOYBUTTONUP); Py_CLEAR(clear_module_state->__pyx_n_s_JOYDEVICEADDED); Py_CLEAR(clear_module_state->__pyx_n_s_JOYDEVICEREMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_JOYHATMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_KEYDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_KEYMAPCHANGED); Py_CLEAR(clear_module_state->__pyx_n_s_KEYUP); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_ALT); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_CAPS); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_CTRL); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_GUI); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_LALT); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_LCTRL); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_LGUI); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_LMETA); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_LSHIFT); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_META); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_MODE); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_NONE); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_NUM); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_RALT); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_RCTRL); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_RGUI); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_RMETA); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_RSHIFT); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_SHIFT); Py_CLEAR(clear_module_state->__pyx_n_s_K_0); Py_CLEAR(clear_module_state->__pyx_n_s_K_1); Py_CLEAR(clear_module_state->__pyx_n_s_K_2); Py_CLEAR(clear_module_state->__pyx_n_s_K_3); Py_CLEAR(clear_module_state->__pyx_n_s_K_4); Py_CLEAR(clear_module_state->__pyx_n_s_K_5); Py_CLEAR(clear_module_state->__pyx_n_s_K_6); Py_CLEAR(clear_module_state->__pyx_n_s_K_7); Py_CLEAR(clear_module_state->__pyx_n_s_K_8); Py_CLEAR(clear_module_state->__pyx_n_s_K_9); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_BACK); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_BOOKMARKS); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_FORWARD); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_HOME); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_REFRESH); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_SEARCH); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_STOP); Py_CLEAR(clear_module_state->__pyx_n_s_K_AGAIN); Py_CLEAR(clear_module_state->__pyx_n_s_K_ALTERASE); Py_CLEAR(clear_module_state->__pyx_n_s_K_AMPERSAND); Py_CLEAR(clear_module_state->__pyx_n_s_K_APP1); Py_CLEAR(clear_module_state->__pyx_n_s_K_APP2); Py_CLEAR(clear_module_state->__pyx_n_s_K_APPLICATION); Py_CLEAR(clear_module_state->__pyx_n_s_K_ASTERISK); Py_CLEAR(clear_module_state->__pyx_n_s_K_AT); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIOFASTFORWARD); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIOMUTE); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIONEXT); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIOPLAY); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIOPREV); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIOREWIND); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIOSTOP); Py_CLEAR(clear_module_state->__pyx_n_s_K_BACKQUOTE); Py_CLEAR(clear_module_state->__pyx_n_s_K_BACKSLASH); Py_CLEAR(clear_module_state->__pyx_n_s_K_BACKSPACE); Py_CLEAR(clear_module_state->__pyx_n_s_K_BREAK); Py_CLEAR(clear_module_state->__pyx_n_s_K_BRIGHTNESSDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_K_BRIGHTNESSUP); Py_CLEAR(clear_module_state->__pyx_n_s_K_CALCULATOR); Py_CLEAR(clear_module_state->__pyx_n_s_K_CANCEL); Py_CLEAR(clear_module_state->__pyx_n_s_K_CAPSLOCK); Py_CLEAR(clear_module_state->__pyx_n_s_K_CARET); Py_CLEAR(clear_module_state->__pyx_n_s_K_CLEAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_CLEARAGAIN); Py_CLEAR(clear_module_state->__pyx_n_s_K_COLON); Py_CLEAR(clear_module_state->__pyx_n_s_K_COMMA); Py_CLEAR(clear_module_state->__pyx_n_s_K_COMPUTER); Py_CLEAR(clear_module_state->__pyx_n_s_K_COPY); Py_CLEAR(clear_module_state->__pyx_n_s_K_CRSEL); Py_CLEAR(clear_module_state->__pyx_n_s_K_CURRENCYSUBUNIT); Py_CLEAR(clear_module_state->__pyx_n_s_K_CURRENCYUNIT); Py_CLEAR(clear_module_state->__pyx_n_s_K_CUT); Py_CLEAR(clear_module_state->__pyx_n_s_K_DECIMALSEPARATOR); Py_CLEAR(clear_module_state->__pyx_n_s_K_DELETE); Py_CLEAR(clear_module_state->__pyx_n_s_K_DISPLAYSWITCH); Py_CLEAR(clear_module_state->__pyx_n_s_K_DOLLAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_DOWN); Py_CLEAR(clear_module_state->__pyx_n_s_K_EJECT); Py_CLEAR(clear_module_state->__pyx_n_s_K_END); Py_CLEAR(clear_module_state->__pyx_n_s_K_EQUALS); Py_CLEAR(clear_module_state->__pyx_n_s_K_ESCAPE); Py_CLEAR(clear_module_state->__pyx_n_s_K_EURO); Py_CLEAR(clear_module_state->__pyx_n_s_K_EXCLAIM); Py_CLEAR(clear_module_state->__pyx_n_s_K_EXECUTE); Py_CLEAR(clear_module_state->__pyx_n_s_K_EXSEL); Py_CLEAR(clear_module_state->__pyx_n_s_K_F1); Py_CLEAR(clear_module_state->__pyx_n_s_K_F10); Py_CLEAR(clear_module_state->__pyx_n_s_K_F11); Py_CLEAR(clear_module_state->__pyx_n_s_K_F12); Py_CLEAR(clear_module_state->__pyx_n_s_K_F13); Py_CLEAR(clear_module_state->__pyx_n_s_K_F14); Py_CLEAR(clear_module_state->__pyx_n_s_K_F15); Py_CLEAR(clear_module_state->__pyx_n_s_K_F16); Py_CLEAR(clear_module_state->__pyx_n_s_K_F17); Py_CLEAR(clear_module_state->__pyx_n_s_K_F18); Py_CLEAR(clear_module_state->__pyx_n_s_K_F19); Py_CLEAR(clear_module_state->__pyx_n_s_K_F2); Py_CLEAR(clear_module_state->__pyx_n_s_K_F20); Py_CLEAR(clear_module_state->__pyx_n_s_K_F21); Py_CLEAR(clear_module_state->__pyx_n_s_K_F22); Py_CLEAR(clear_module_state->__pyx_n_s_K_F23); Py_CLEAR(clear_module_state->__pyx_n_s_K_F24); Py_CLEAR(clear_module_state->__pyx_n_s_K_F3); Py_CLEAR(clear_module_state->__pyx_n_s_K_F4); Py_CLEAR(clear_module_state->__pyx_n_s_K_F5); Py_CLEAR(clear_module_state->__pyx_n_s_K_F6); Py_CLEAR(clear_module_state->__pyx_n_s_K_F7); Py_CLEAR(clear_module_state->__pyx_n_s_K_F8); Py_CLEAR(clear_module_state->__pyx_n_s_K_F9); Py_CLEAR(clear_module_state->__pyx_n_s_K_FIND); Py_CLEAR(clear_module_state->__pyx_n_s_K_FIRST); Py_CLEAR(clear_module_state->__pyx_n_s_K_GREATER); Py_CLEAR(clear_module_state->__pyx_n_s_K_HASH); Py_CLEAR(clear_module_state->__pyx_n_s_K_HELP); Py_CLEAR(clear_module_state->__pyx_n_s_K_HOME); Py_CLEAR(clear_module_state->__pyx_n_s_K_INSERT); Py_CLEAR(clear_module_state->__pyx_n_s_K_KBDILLUMDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_K_KBDILLUMTOGGLE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KBDILLUMUP); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP0); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP1); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP2); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP3); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP4); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP5); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP6); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP7); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP8); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP9); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_0); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_00); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_000); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_1); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_2); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_3); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_4); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_5); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_6); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_7); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_8); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_9); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_A); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_AMPERSAND); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_AT); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_B); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_BACKSPACE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_BINARY); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_C); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_CLEAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_CLEARENTRY); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_COLON); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_COMMA); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_D); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_DBLAMPERSAND); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_DBLVERTICALBAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_DECIMAL); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_DIVIDE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_E); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_ENTER); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_EQUALS); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_EQUALSAS400); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_EXCLAM); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_F); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_GREATER); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_HASH); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_HEXADECIMAL); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_LEFTBRACE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_LEFTPAREN); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_LESS); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMADD); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMCLEAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMDIVIDE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMMULTIPLY); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMRECALL); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMSTORE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMSUBTRACT); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MINUS); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MULTIPLY); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_OCTAL); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_PERCENT); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_PERIOD); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_PLUS); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_PLUSMINUS); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_POWER); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_RIGHTBRACE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_RIGHTPAREN); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_SPACE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_TAB); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_VERTICALBAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_XOR); Py_CLEAR(clear_module_state->__pyx_n_s_K_LALT); Py_CLEAR(clear_module_state->__pyx_n_s_K_LAST); Py_CLEAR(clear_module_state->__pyx_n_s_K_LCTRL); Py_CLEAR(clear_module_state->__pyx_n_s_K_LEFT); Py_CLEAR(clear_module_state->__pyx_n_s_K_LEFTBRACKET); Py_CLEAR(clear_module_state->__pyx_n_s_K_LEFTPAREN); Py_CLEAR(clear_module_state->__pyx_n_s_K_LESS); Py_CLEAR(clear_module_state->__pyx_n_s_K_LGUI); Py_CLEAR(clear_module_state->__pyx_n_s_K_LMETA); Py_CLEAR(clear_module_state->__pyx_n_s_K_LSHIFT); Py_CLEAR(clear_module_state->__pyx_n_s_K_LSUPER); Py_CLEAR(clear_module_state->__pyx_n_s_K_MAIL); Py_CLEAR(clear_module_state->__pyx_n_s_K_MEDIASELECT); Py_CLEAR(clear_module_state->__pyx_n_s_K_MENU); Py_CLEAR(clear_module_state->__pyx_n_s_K_MINUS); Py_CLEAR(clear_module_state->__pyx_n_s_K_MODE); Py_CLEAR(clear_module_state->__pyx_n_s_K_MUTE); Py_CLEAR(clear_module_state->__pyx_n_s_K_NUMLOCK); Py_CLEAR(clear_module_state->__pyx_n_s_K_NUMLOCKCLEAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_OPER); Py_CLEAR(clear_module_state->__pyx_n_s_K_OUT); Py_CLEAR(clear_module_state->__pyx_n_s_K_PAGEDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_K_PAGEUP); Py_CLEAR(clear_module_state->__pyx_n_s_K_PASTE); Py_CLEAR(clear_module_state->__pyx_n_s_K_PAUSE); Py_CLEAR(clear_module_state->__pyx_n_s_K_PERCENT); Py_CLEAR(clear_module_state->__pyx_n_s_K_PERIOD); Py_CLEAR(clear_module_state->__pyx_n_s_K_PLUS); Py_CLEAR(clear_module_state->__pyx_n_s_K_POWER); Py_CLEAR(clear_module_state->__pyx_n_s_K_PRINT); Py_CLEAR(clear_module_state->__pyx_n_s_K_PRINTSCREEN); Py_CLEAR(clear_module_state->__pyx_n_s_K_PRIOR); Py_CLEAR(clear_module_state->__pyx_n_s_K_QUESTION); Py_CLEAR(clear_module_state->__pyx_n_s_K_QUOTE); Py_CLEAR(clear_module_state->__pyx_n_s_K_QUOTEDBL); Py_CLEAR(clear_module_state->__pyx_n_s_K_RALT); Py_CLEAR(clear_module_state->__pyx_n_s_K_RCTRL); Py_CLEAR(clear_module_state->__pyx_n_s_K_RETURN); Py_CLEAR(clear_module_state->__pyx_n_s_K_RETURN2); Py_CLEAR(clear_module_state->__pyx_n_s_K_RGUI); Py_CLEAR(clear_module_state->__pyx_n_s_K_RIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_K_RIGHTBRACKET); Py_CLEAR(clear_module_state->__pyx_n_s_K_RIGHTPAREN); Py_CLEAR(clear_module_state->__pyx_n_s_K_RMETA); Py_CLEAR(clear_module_state->__pyx_n_s_K_RSHIFT); Py_CLEAR(clear_module_state->__pyx_n_s_K_RSUPER); Py_CLEAR(clear_module_state->__pyx_n_s_K_SCROLLLOCK); Py_CLEAR(clear_module_state->__pyx_n_s_K_SCROLLOCK); Py_CLEAR(clear_module_state->__pyx_n_s_K_SELECT); Py_CLEAR(clear_module_state->__pyx_n_s_K_SEMICOLON); Py_CLEAR(clear_module_state->__pyx_n_s_K_SEPARATOR); Py_CLEAR(clear_module_state->__pyx_n_s_K_SLASH); Py_CLEAR(clear_module_state->__pyx_n_s_K_SLEEP); Py_CLEAR(clear_module_state->__pyx_n_s_K_SPACE); Py_CLEAR(clear_module_state->__pyx_n_s_K_STOP); Py_CLEAR(clear_module_state->__pyx_n_s_K_SYSREQ); Py_CLEAR(clear_module_state->__pyx_n_s_K_TAB); Py_CLEAR(clear_module_state->__pyx_n_s_K_THOUSANDSSEPARATOR); Py_CLEAR(clear_module_state->__pyx_n_s_K_UNDERSCORE); Py_CLEAR(clear_module_state->__pyx_n_s_K_UNDO); Py_CLEAR(clear_module_state->__pyx_n_s_K_UNKNOWN); Py_CLEAR(clear_module_state->__pyx_n_s_K_UP); Py_CLEAR(clear_module_state->__pyx_n_s_K_VOLUMEDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_K_VOLUMEUP); Py_CLEAR(clear_module_state->__pyx_n_s_K_WWW); Py_CLEAR(clear_module_state->__pyx_n_s_K_a); Py_CLEAR(clear_module_state->__pyx_n_s_K_b); Py_CLEAR(clear_module_state->__pyx_n_s_K_c); Py_CLEAR(clear_module_state->__pyx_n_s_K_d); Py_CLEAR(clear_module_state->__pyx_n_s_K_e); Py_CLEAR(clear_module_state->__pyx_n_s_K_f); Py_CLEAR(clear_module_state->__pyx_n_s_K_g); Py_CLEAR(clear_module_state->__pyx_n_s_K_h); Py_CLEAR(clear_module_state->__pyx_n_s_K_i); Py_CLEAR(clear_module_state->__pyx_n_s_K_j); Py_CLEAR(clear_module_state->__pyx_n_s_K_k); Py_CLEAR(clear_module_state->__pyx_n_s_K_l); Py_CLEAR(clear_module_state->__pyx_n_s_K_m); Py_CLEAR(clear_module_state->__pyx_n_s_K_n); Py_CLEAR(clear_module_state->__pyx_n_s_K_o); Py_CLEAR(clear_module_state->__pyx_n_s_K_p); Py_CLEAR(clear_module_state->__pyx_n_s_K_q); Py_CLEAR(clear_module_state->__pyx_n_s_K_r); Py_CLEAR(clear_module_state->__pyx_n_s_K_s); Py_CLEAR(clear_module_state->__pyx_n_s_K_t); Py_CLEAR(clear_module_state->__pyx_n_s_K_u); Py_CLEAR(clear_module_state->__pyx_n_s_K_v); Py_CLEAR(clear_module_state->__pyx_n_s_K_w); Py_CLEAR(clear_module_state->__pyx_n_s_K_x); Py_CLEAR(clear_module_state->__pyx_n_s_K_y); Py_CLEAR(clear_module_state->__pyx_n_s_K_z); Py_CLEAR(clear_module_state->__pyx_n_s_LASTEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_LIL_ENDIAN); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEBUTTONDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEBUTTONUP); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEWHEEL); Py_CLEAR(clear_module_state->__pyx_n_s_MULTIGESTURE); Py_CLEAR(clear_module_state->__pyx_n_s_NOEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_NOFRAME); Py_CLEAR(clear_module_state->__pyx_n_s_OPENGL); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_CHARGED); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_CHARGING); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_NO_BATTERY); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_ON_BATTERY); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_UNKNOWN); Py_CLEAR(clear_module_state->__pyx_n_s_QUIT); Py_CLEAR(clear_module_state->__pyx_n_s_RENDER_DEVICE_RESET); Py_CLEAR(clear_module_state->__pyx_n_s_RENDER_TARGETS_RESET); Py_CLEAR(clear_module_state->__pyx_n_s_RESIZABLE); Py_CLEAR(clear_module_state->__pyx_n_s_RLEACCEL); Py_CLEAR(clear_module_state->__pyx_n_s_Rect); Py_CLEAR(clear_module_state->__pyx_n_s_SCRAP_TEXT); Py_CLEAR(clear_module_state->__pyx_n_s_SDL_VERSION_TUPLE); Py_CLEAR(clear_module_state->__pyx_n_s_SENSORUPDATE); Py_CLEAR(clear_module_state->__pyx_n_s_SRCALPHA); Py_CLEAR(clear_module_state->__pyx_n_s_SRCCOLORKEY); Py_CLEAR(clear_module_state->__pyx_n_s_SWSURFACE); Py_CLEAR(clear_module_state->__pyx_n_s_SYSWMEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_TEXTEDITING); Py_CLEAR(clear_module_state->__pyx_n_s_TEXTINPUT); Py_CLEAR(clear_module_state->__pyx_n_s_TOUCH_MOUSEID); Py_CLEAR(clear_module_state->__pyx_n_s_USEREVENT); Py_CLEAR(clear_module_state->__pyx_n_s_VIDEOEXPOSE); Py_CLEAR(clear_module_state->__pyx_n_s_VIDEORESIZE); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOWEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOWMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOWPOS_CENTERED); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOWPOS_UNDEFINED); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_ALLOW_HIGHDPI); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_BORDERLESS); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_FOREIGN); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_FULLSCREEN); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_HIDDEN); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_INPUT_FOCUS); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_INPUT_GRABBED); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_MAXIMIZED); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_MINIMIZED); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_NOFRAME); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_OPENGL); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_RESIZABLE); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_SHOWN); Py_CLEAR(clear_module_state->__pyx_n_s__2); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_color); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rect); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_kp_s_text_plain); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_3); Py_CLEAR(clear_module_state->__pyx_int_4); Py_CLEAR(clear_module_state->__pyx_int_5); Py_CLEAR(clear_module_state->__pyx_int_6); Py_CLEAR(clear_module_state->__pyx_int_7); Py_CLEAR(clear_module_state->__pyx_int_8); Py_CLEAR(clear_module_state->__pyx_int_9); Py_CLEAR(clear_module_state->__pyx_int_16); Py_CLEAR(clear_module_state->__pyx_int_17); Py_CLEAR(clear_module_state->__pyx_int_1073741824); Py_CLEAR(clear_module_state->__pyx_int_2147483648); Py_CLEAR(clear_module_state->__pyx_int_neg_1); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_n_s_ACTIVEEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_APP_DIDENTERBACKGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_APP_DIDENTERFOREGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_APP_LOWMEMORY); Py_VISIT(traverse_module_state->__pyx_n_s_APP_TERMINATING); Py_VISIT(traverse_module_state->__pyx_n_s_APP_WILLENTERBACKGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_APP_WILLENTERFOREGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_AUDIODEVICEADDED); Py_VISIT(traverse_module_state->__pyx_n_s_AUDIODEVICEREMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_BIG_ENDIAN); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_ADD); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_MIN); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_MULT); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_PREMULTIPLIED); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGBA_ADD); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGBA_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGBA_MIN); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGBA_MULT); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGBA_SUB); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGB_ADD); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGB_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGB_MIN); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGB_MULT); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGB_SUB); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_SUB); Py_VISIT(traverse_module_state->__pyx_n_s_BYTEORDER); Py_VISIT(traverse_module_state->__pyx_n_s_CLIPBOARDUPDATE); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERAXISMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERBUTTONDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERBUTTONUP); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERDEVICEADDED); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERDEVICEREMAPPED); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERDEVICEREMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_INVALID); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_LEFTX); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_LEFTY); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_RIGHTX); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_RIGHTY); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_A); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_B); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_BACK); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_GUIDE); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_INVALID); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_START); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_X); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_Y); Py_VISIT(traverse_module_state->__pyx_n_s_Color); Py_VISIT(traverse_module_state->__pyx_n_s_DISPLAYEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_DOLLARGESTURE); Py_VISIT(traverse_module_state->__pyx_n_s_DOLLARRECORD); Py_VISIT(traverse_module_state->__pyx_n_s_DOUBLEBUF); Py_VISIT(traverse_module_state->__pyx_n_s_DROPBEGIN); Py_VISIT(traverse_module_state->__pyx_n_s_DROPCOMPLETE); Py_VISIT(traverse_module_state->__pyx_n_s_DROPFILE); Py_VISIT(traverse_module_state->__pyx_n_s_DROPTEXT); Py_VISIT(traverse_module_state->__pyx_n_s_FINGERDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_FINGERMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_FINGERUP); Py_VISIT(traverse_module_state->__pyx_n_s_FULLSCREEN); Py_VISIT(traverse_module_state->__pyx_n_s_GL_ACCELERATED_VISUAL); Py_VISIT(traverse_module_state->__pyx_n_s_GL_ACCUM_ALPHA_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_ACCUM_BLUE_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_ACCUM_GREEN_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_ACCUM_RED_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_ALPHA_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_BLUE_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_BUFFER_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_EGL); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_FLAGS); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_MAJOR_VERSION); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_MINOR_VERSION); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_NO_ERROR); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_CORE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_ES); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_MASK); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION); Py_VISIT(traverse_module_state->__pyx_n_s_GL_DEPTH_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_DOUBLEBUFFER); Py_VISIT(traverse_module_state->__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_GREEN_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_MULTISAMPLEBUFFERS); Py_VISIT(traverse_module_state->__pyx_n_s_GL_MULTISAMPLESAMPLES); Py_VISIT(traverse_module_state->__pyx_n_s_GL_RED_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_RETAINED_BACKING); Py_VISIT(traverse_module_state->__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT); Py_VISIT(traverse_module_state->__pyx_n_s_GL_STENCIL_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_STEREO); Py_VISIT(traverse_module_state->__pyx_n_s_GL_SWAP_CONTROL); Py_VISIT(traverse_module_state->__pyx_n_s_HWSURFACE); Py_VISIT(traverse_module_state->__pyx_n_s_JOYAXISMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_JOYBALLMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_JOYBUTTONDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_JOYBUTTONUP); Py_VISIT(traverse_module_state->__pyx_n_s_JOYDEVICEADDED); Py_VISIT(traverse_module_state->__pyx_n_s_JOYDEVICEREMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_JOYHATMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_KEYDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_KEYMAPCHANGED); Py_VISIT(traverse_module_state->__pyx_n_s_KEYUP); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_ALT); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_CAPS); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_CTRL); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_GUI); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_LALT); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_LCTRL); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_LGUI); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_LMETA); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_LSHIFT); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_META); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_MODE); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_NONE); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_NUM); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_RALT); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_RCTRL); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_RGUI); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_RMETA); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_RSHIFT); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_SHIFT); Py_VISIT(traverse_module_state->__pyx_n_s_K_0); Py_VISIT(traverse_module_state->__pyx_n_s_K_1); Py_VISIT(traverse_module_state->__pyx_n_s_K_2); Py_VISIT(traverse_module_state->__pyx_n_s_K_3); Py_VISIT(traverse_module_state->__pyx_n_s_K_4); Py_VISIT(traverse_module_state->__pyx_n_s_K_5); Py_VISIT(traverse_module_state->__pyx_n_s_K_6); Py_VISIT(traverse_module_state->__pyx_n_s_K_7); Py_VISIT(traverse_module_state->__pyx_n_s_K_8); Py_VISIT(traverse_module_state->__pyx_n_s_K_9); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_BACK); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_BOOKMARKS); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_FORWARD); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_HOME); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_REFRESH); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_SEARCH); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_STOP); Py_VISIT(traverse_module_state->__pyx_n_s_K_AGAIN); Py_VISIT(traverse_module_state->__pyx_n_s_K_ALTERASE); Py_VISIT(traverse_module_state->__pyx_n_s_K_AMPERSAND); Py_VISIT(traverse_module_state->__pyx_n_s_K_APP1); Py_VISIT(traverse_module_state->__pyx_n_s_K_APP2); Py_VISIT(traverse_module_state->__pyx_n_s_K_APPLICATION); Py_VISIT(traverse_module_state->__pyx_n_s_K_ASTERISK); Py_VISIT(traverse_module_state->__pyx_n_s_K_AT); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIOFASTFORWARD); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIOMUTE); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIONEXT); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIOPLAY); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIOPREV); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIOREWIND); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIOSTOP); Py_VISIT(traverse_module_state->__pyx_n_s_K_BACKQUOTE); Py_VISIT(traverse_module_state->__pyx_n_s_K_BACKSLASH); Py_VISIT(traverse_module_state->__pyx_n_s_K_BACKSPACE); Py_VISIT(traverse_module_state->__pyx_n_s_K_BREAK); Py_VISIT(traverse_module_state->__pyx_n_s_K_BRIGHTNESSDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_K_BRIGHTNESSUP); Py_VISIT(traverse_module_state->__pyx_n_s_K_CALCULATOR); Py_VISIT(traverse_module_state->__pyx_n_s_K_CANCEL); Py_VISIT(traverse_module_state->__pyx_n_s_K_CAPSLOCK); Py_VISIT(traverse_module_state->__pyx_n_s_K_CARET); Py_VISIT(traverse_module_state->__pyx_n_s_K_CLEAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_CLEARAGAIN); Py_VISIT(traverse_module_state->__pyx_n_s_K_COLON); Py_VISIT(traverse_module_state->__pyx_n_s_K_COMMA); Py_VISIT(traverse_module_state->__pyx_n_s_K_COMPUTER); Py_VISIT(traverse_module_state->__pyx_n_s_K_COPY); Py_VISIT(traverse_module_state->__pyx_n_s_K_CRSEL); Py_VISIT(traverse_module_state->__pyx_n_s_K_CURRENCYSUBUNIT); Py_VISIT(traverse_module_state->__pyx_n_s_K_CURRENCYUNIT); Py_VISIT(traverse_module_state->__pyx_n_s_K_CUT); Py_VISIT(traverse_module_state->__pyx_n_s_K_DECIMALSEPARATOR); Py_VISIT(traverse_module_state->__pyx_n_s_K_DELETE); Py_VISIT(traverse_module_state->__pyx_n_s_K_DISPLAYSWITCH); Py_VISIT(traverse_module_state->__pyx_n_s_K_DOLLAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_DOWN); Py_VISIT(traverse_module_state->__pyx_n_s_K_EJECT); Py_VISIT(traverse_module_state->__pyx_n_s_K_END); Py_VISIT(traverse_module_state->__pyx_n_s_K_EQUALS); Py_VISIT(traverse_module_state->__pyx_n_s_K_ESCAPE); Py_VISIT(traverse_module_state->__pyx_n_s_K_EURO); Py_VISIT(traverse_module_state->__pyx_n_s_K_EXCLAIM); Py_VISIT(traverse_module_state->__pyx_n_s_K_EXECUTE); Py_VISIT(traverse_module_state->__pyx_n_s_K_EXSEL); Py_VISIT(traverse_module_state->__pyx_n_s_K_F1); Py_VISIT(traverse_module_state->__pyx_n_s_K_F10); Py_VISIT(traverse_module_state->__pyx_n_s_K_F11); Py_VISIT(traverse_module_state->__pyx_n_s_K_F12); Py_VISIT(traverse_module_state->__pyx_n_s_K_F13); Py_VISIT(traverse_module_state->__pyx_n_s_K_F14); Py_VISIT(traverse_module_state->__pyx_n_s_K_F15); Py_VISIT(traverse_module_state->__pyx_n_s_K_F16); Py_VISIT(traverse_module_state->__pyx_n_s_K_F17); Py_VISIT(traverse_module_state->__pyx_n_s_K_F18); Py_VISIT(traverse_module_state->__pyx_n_s_K_F19); Py_VISIT(traverse_module_state->__pyx_n_s_K_F2); Py_VISIT(traverse_module_state->__pyx_n_s_K_F20); Py_VISIT(traverse_module_state->__pyx_n_s_K_F21); Py_VISIT(traverse_module_state->__pyx_n_s_K_F22); Py_VISIT(traverse_module_state->__pyx_n_s_K_F23); Py_VISIT(traverse_module_state->__pyx_n_s_K_F24); Py_VISIT(traverse_module_state->__pyx_n_s_K_F3); Py_VISIT(traverse_module_state->__pyx_n_s_K_F4); Py_VISIT(traverse_module_state->__pyx_n_s_K_F5); Py_VISIT(traverse_module_state->__pyx_n_s_K_F6); Py_VISIT(traverse_module_state->__pyx_n_s_K_F7); Py_VISIT(traverse_module_state->__pyx_n_s_K_F8); Py_VISIT(traverse_module_state->__pyx_n_s_K_F9); Py_VISIT(traverse_module_state->__pyx_n_s_K_FIND); Py_VISIT(traverse_module_state->__pyx_n_s_K_FIRST); Py_VISIT(traverse_module_state->__pyx_n_s_K_GREATER); Py_VISIT(traverse_module_state->__pyx_n_s_K_HASH); Py_VISIT(traverse_module_state->__pyx_n_s_K_HELP); Py_VISIT(traverse_module_state->__pyx_n_s_K_HOME); Py_VISIT(traverse_module_state->__pyx_n_s_K_INSERT); Py_VISIT(traverse_module_state->__pyx_n_s_K_KBDILLUMDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_K_KBDILLUMTOGGLE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KBDILLUMUP); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP0); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP1); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP2); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP3); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP4); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP5); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP6); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP7); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP8); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP9); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_0); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_00); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_000); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_1); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_2); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_3); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_4); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_5); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_6); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_7); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_8); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_9); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_A); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_AMPERSAND); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_AT); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_B); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_BACKSPACE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_BINARY); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_C); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_CLEAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_CLEARENTRY); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_COLON); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_COMMA); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_D); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_DBLAMPERSAND); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_DBLVERTICALBAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_DECIMAL); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_DIVIDE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_E); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_ENTER); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_EQUALS); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_EQUALSAS400); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_EXCLAM); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_F); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_GREATER); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_HASH); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_HEXADECIMAL); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_LEFTBRACE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_LEFTPAREN); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_LESS); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMADD); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMCLEAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMDIVIDE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMMULTIPLY); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMRECALL); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMSTORE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMSUBTRACT); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MINUS); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MULTIPLY); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_OCTAL); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_PERCENT); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_PERIOD); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_PLUS); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_PLUSMINUS); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_POWER); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_RIGHTBRACE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_RIGHTPAREN); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_SPACE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_TAB); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_VERTICALBAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_XOR); Py_VISIT(traverse_module_state->__pyx_n_s_K_LALT); Py_VISIT(traverse_module_state->__pyx_n_s_K_LAST); Py_VISIT(traverse_module_state->__pyx_n_s_K_LCTRL); Py_VISIT(traverse_module_state->__pyx_n_s_K_LEFT); Py_VISIT(traverse_module_state->__pyx_n_s_K_LEFTBRACKET); Py_VISIT(traverse_module_state->__pyx_n_s_K_LEFTPAREN); Py_VISIT(traverse_module_state->__pyx_n_s_K_LESS); Py_VISIT(traverse_module_state->__pyx_n_s_K_LGUI); Py_VISIT(traverse_module_state->__pyx_n_s_K_LMETA); Py_VISIT(traverse_module_state->__pyx_n_s_K_LSHIFT); Py_VISIT(traverse_module_state->__pyx_n_s_K_LSUPER); Py_VISIT(traverse_module_state->__pyx_n_s_K_MAIL); Py_VISIT(traverse_module_state->__pyx_n_s_K_MEDIASELECT); Py_VISIT(traverse_module_state->__pyx_n_s_K_MENU); Py_VISIT(traverse_module_state->__pyx_n_s_K_MINUS); Py_VISIT(traverse_module_state->__pyx_n_s_K_MODE); Py_VISIT(traverse_module_state->__pyx_n_s_K_MUTE); Py_VISIT(traverse_module_state->__pyx_n_s_K_NUMLOCK); Py_VISIT(traverse_module_state->__pyx_n_s_K_NUMLOCKCLEAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_OPER); Py_VISIT(traverse_module_state->__pyx_n_s_K_OUT); Py_VISIT(traverse_module_state->__pyx_n_s_K_PAGEDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_K_PAGEUP); Py_VISIT(traverse_module_state->__pyx_n_s_K_PASTE); Py_VISIT(traverse_module_state->__pyx_n_s_K_PAUSE); Py_VISIT(traverse_module_state->__pyx_n_s_K_PERCENT); Py_VISIT(traverse_module_state->__pyx_n_s_K_PERIOD); Py_VISIT(traverse_module_state->__pyx_n_s_K_PLUS); Py_VISIT(traverse_module_state->__pyx_n_s_K_POWER); Py_VISIT(traverse_module_state->__pyx_n_s_K_PRINT); Py_VISIT(traverse_module_state->__pyx_n_s_K_PRINTSCREEN); Py_VISIT(traverse_module_state->__pyx_n_s_K_PRIOR); Py_VISIT(traverse_module_state->__pyx_n_s_K_QUESTION); Py_VISIT(traverse_module_state->__pyx_n_s_K_QUOTE); Py_VISIT(traverse_module_state->__pyx_n_s_K_QUOTEDBL); Py_VISIT(traverse_module_state->__pyx_n_s_K_RALT); Py_VISIT(traverse_module_state->__pyx_n_s_K_RCTRL); Py_VISIT(traverse_module_state->__pyx_n_s_K_RETURN); Py_VISIT(traverse_module_state->__pyx_n_s_K_RETURN2); Py_VISIT(traverse_module_state->__pyx_n_s_K_RGUI); Py_VISIT(traverse_module_state->__pyx_n_s_K_RIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_K_RIGHTBRACKET); Py_VISIT(traverse_module_state->__pyx_n_s_K_RIGHTPAREN); Py_VISIT(traverse_module_state->__pyx_n_s_K_RMETA); Py_VISIT(traverse_module_state->__pyx_n_s_K_RSHIFT); Py_VISIT(traverse_module_state->__pyx_n_s_K_RSUPER); Py_VISIT(traverse_module_state->__pyx_n_s_K_SCROLLLOCK); Py_VISIT(traverse_module_state->__pyx_n_s_K_SCROLLOCK); Py_VISIT(traverse_module_state->__pyx_n_s_K_SELECT); Py_VISIT(traverse_module_state->__pyx_n_s_K_SEMICOLON); Py_VISIT(traverse_module_state->__pyx_n_s_K_SEPARATOR); Py_VISIT(traverse_module_state->__pyx_n_s_K_SLASH); Py_VISIT(traverse_module_state->__pyx_n_s_K_SLEEP); Py_VISIT(traverse_module_state->__pyx_n_s_K_SPACE); Py_VISIT(traverse_module_state->__pyx_n_s_K_STOP); Py_VISIT(traverse_module_state->__pyx_n_s_K_SYSREQ); Py_VISIT(traverse_module_state->__pyx_n_s_K_TAB); Py_VISIT(traverse_module_state->__pyx_n_s_K_THOUSANDSSEPARATOR); Py_VISIT(traverse_module_state->__pyx_n_s_K_UNDERSCORE); Py_VISIT(traverse_module_state->__pyx_n_s_K_UNDO); Py_VISIT(traverse_module_state->__pyx_n_s_K_UNKNOWN); Py_VISIT(traverse_module_state->__pyx_n_s_K_UP); Py_VISIT(traverse_module_state->__pyx_n_s_K_VOLUMEDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_K_VOLUMEUP); Py_VISIT(traverse_module_state->__pyx_n_s_K_WWW); Py_VISIT(traverse_module_state->__pyx_n_s_K_a); Py_VISIT(traverse_module_state->__pyx_n_s_K_b); Py_VISIT(traverse_module_state->__pyx_n_s_K_c); Py_VISIT(traverse_module_state->__pyx_n_s_K_d); Py_VISIT(traverse_module_state->__pyx_n_s_K_e); Py_VISIT(traverse_module_state->__pyx_n_s_K_f); Py_VISIT(traverse_module_state->__pyx_n_s_K_g); Py_VISIT(traverse_module_state->__pyx_n_s_K_h); Py_VISIT(traverse_module_state->__pyx_n_s_K_i); Py_VISIT(traverse_module_state->__pyx_n_s_K_j); Py_VISIT(traverse_module_state->__pyx_n_s_K_k); Py_VISIT(traverse_module_state->__pyx_n_s_K_l); Py_VISIT(traverse_module_state->__pyx_n_s_K_m); Py_VISIT(traverse_module_state->__pyx_n_s_K_n); Py_VISIT(traverse_module_state->__pyx_n_s_K_o); Py_VISIT(traverse_module_state->__pyx_n_s_K_p); Py_VISIT(traverse_module_state->__pyx_n_s_K_q); Py_VISIT(traverse_module_state->__pyx_n_s_K_r); Py_VISIT(traverse_module_state->__pyx_n_s_K_s); Py_VISIT(traverse_module_state->__pyx_n_s_K_t); Py_VISIT(traverse_module_state->__pyx_n_s_K_u); Py_VISIT(traverse_module_state->__pyx_n_s_K_v); Py_VISIT(traverse_module_state->__pyx_n_s_K_w); Py_VISIT(traverse_module_state->__pyx_n_s_K_x); Py_VISIT(traverse_module_state->__pyx_n_s_K_y); Py_VISIT(traverse_module_state->__pyx_n_s_K_z); Py_VISIT(traverse_module_state->__pyx_n_s_LASTEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_LIL_ENDIAN); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEBUTTONDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEBUTTONUP); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEWHEEL); Py_VISIT(traverse_module_state->__pyx_n_s_MULTIGESTURE); Py_VISIT(traverse_module_state->__pyx_n_s_NOEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_NOFRAME); Py_VISIT(traverse_module_state->__pyx_n_s_OPENGL); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_CHARGED); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_CHARGING); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_NO_BATTERY); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_ON_BATTERY); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_UNKNOWN); Py_VISIT(traverse_module_state->__pyx_n_s_QUIT); Py_VISIT(traverse_module_state->__pyx_n_s_RENDER_DEVICE_RESET); Py_VISIT(traverse_module_state->__pyx_n_s_RENDER_TARGETS_RESET); Py_VISIT(traverse_module_state->__pyx_n_s_RESIZABLE); Py_VISIT(traverse_module_state->__pyx_n_s_RLEACCEL); Py_VISIT(traverse_module_state->__pyx_n_s_Rect); Py_VISIT(traverse_module_state->__pyx_n_s_SCRAP_TEXT); Py_VISIT(traverse_module_state->__pyx_n_s_SDL_VERSION_TUPLE); Py_VISIT(traverse_module_state->__pyx_n_s_SENSORUPDATE); Py_VISIT(traverse_module_state->__pyx_n_s_SRCALPHA); Py_VISIT(traverse_module_state->__pyx_n_s_SRCCOLORKEY); Py_VISIT(traverse_module_state->__pyx_n_s_SWSURFACE); Py_VISIT(traverse_module_state->__pyx_n_s_SYSWMEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_TEXTEDITING); Py_VISIT(traverse_module_state->__pyx_n_s_TEXTINPUT); Py_VISIT(traverse_module_state->__pyx_n_s_TOUCH_MOUSEID); Py_VISIT(traverse_module_state->__pyx_n_s_USEREVENT); Py_VISIT(traverse_module_state->__pyx_n_s_VIDEOEXPOSE); Py_VISIT(traverse_module_state->__pyx_n_s_VIDEORESIZE); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOWEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOWMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOWPOS_CENTERED); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOWPOS_UNDEFINED); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_ALLOW_HIGHDPI); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_BORDERLESS); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_FOREIGN); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_FULLSCREEN); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_HIDDEN); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_INPUT_FOCUS); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_INPUT_GRABBED); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_MAXIMIZED); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_MINIMIZED); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_NOFRAME); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_OPENGL); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_RESIZABLE); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_SHOWN); Py_VISIT(traverse_module_state->__pyx_n_s__2); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_color); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rect); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_kp_s_text_plain); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_3); Py_VISIT(traverse_module_state->__pyx_int_4); Py_VISIT(traverse_module_state->__pyx_int_5); Py_VISIT(traverse_module_state->__pyx_int_6); Py_VISIT(traverse_module_state->__pyx_int_7); Py_VISIT(traverse_module_state->__pyx_int_8); Py_VISIT(traverse_module_state->__pyx_int_9); Py_VISIT(traverse_module_state->__pyx_int_16); Py_VISIT(traverse_module_state->__pyx_int_17); Py_VISIT(traverse_module_state->__pyx_int_1073741824); Py_VISIT(traverse_module_state->__pyx_int_2147483648); Py_VISIT(traverse_module_state->__pyx_int_neg_1); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_n_s_ACTIVEEVENT __pyx_mstate_global->__pyx_n_s_ACTIVEEVENT #define __pyx_n_s_APP_DIDENTERBACKGROUND __pyx_mstate_global->__pyx_n_s_APP_DIDENTERBACKGROUND #define __pyx_n_s_APP_DIDENTERFOREGROUND __pyx_mstate_global->__pyx_n_s_APP_DIDENTERFOREGROUND #define __pyx_n_s_APP_LOWMEMORY __pyx_mstate_global->__pyx_n_s_APP_LOWMEMORY #define __pyx_n_s_APP_TERMINATING __pyx_mstate_global->__pyx_n_s_APP_TERMINATING #define __pyx_n_s_APP_WILLENTERBACKGROUND __pyx_mstate_global->__pyx_n_s_APP_WILLENTERBACKGROUND #define __pyx_n_s_APP_WILLENTERFOREGROUND __pyx_mstate_global->__pyx_n_s_APP_WILLENTERFOREGROUND #define __pyx_n_s_AUDIODEVICEADDED __pyx_mstate_global->__pyx_n_s_AUDIODEVICEADDED #define __pyx_n_s_AUDIODEVICEREMOVED __pyx_mstate_global->__pyx_n_s_AUDIODEVICEREMOVED #define __pyx_n_s_BIG_ENDIAN __pyx_mstate_global->__pyx_n_s_BIG_ENDIAN #define __pyx_n_s_BLEND_ADD __pyx_mstate_global->__pyx_n_s_BLEND_ADD #define __pyx_n_s_BLEND_MAX __pyx_mstate_global->__pyx_n_s_BLEND_MAX #define __pyx_n_s_BLEND_MIN __pyx_mstate_global->__pyx_n_s_BLEND_MIN #define __pyx_n_s_BLEND_MULT __pyx_mstate_global->__pyx_n_s_BLEND_MULT #define __pyx_n_s_BLEND_PREMULTIPLIED __pyx_mstate_global->__pyx_n_s_BLEND_PREMULTIPLIED #define __pyx_n_s_BLEND_RGBA_ADD __pyx_mstate_global->__pyx_n_s_BLEND_RGBA_ADD #define __pyx_n_s_BLEND_RGBA_MAX __pyx_mstate_global->__pyx_n_s_BLEND_RGBA_MAX #define __pyx_n_s_BLEND_RGBA_MIN __pyx_mstate_global->__pyx_n_s_BLEND_RGBA_MIN #define __pyx_n_s_BLEND_RGBA_MULT __pyx_mstate_global->__pyx_n_s_BLEND_RGBA_MULT #define __pyx_n_s_BLEND_RGBA_SUB __pyx_mstate_global->__pyx_n_s_BLEND_RGBA_SUB #define __pyx_n_s_BLEND_RGB_ADD __pyx_mstate_global->__pyx_n_s_BLEND_RGB_ADD #define __pyx_n_s_BLEND_RGB_MAX __pyx_mstate_global->__pyx_n_s_BLEND_RGB_MAX #define __pyx_n_s_BLEND_RGB_MIN __pyx_mstate_global->__pyx_n_s_BLEND_RGB_MIN #define __pyx_n_s_BLEND_RGB_MULT __pyx_mstate_global->__pyx_n_s_BLEND_RGB_MULT #define __pyx_n_s_BLEND_RGB_SUB __pyx_mstate_global->__pyx_n_s_BLEND_RGB_SUB #define __pyx_n_s_BLEND_SUB __pyx_mstate_global->__pyx_n_s_BLEND_SUB #define __pyx_n_s_BYTEORDER __pyx_mstate_global->__pyx_n_s_BYTEORDER #define __pyx_n_s_CLIPBOARDUPDATE __pyx_mstate_global->__pyx_n_s_CLIPBOARDUPDATE #define __pyx_n_s_CONTROLLERAXISMOTION __pyx_mstate_global->__pyx_n_s_CONTROLLERAXISMOTION #define __pyx_n_s_CONTROLLERBUTTONDOWN __pyx_mstate_global->__pyx_n_s_CONTROLLERBUTTONDOWN #define __pyx_n_s_CONTROLLERBUTTONUP __pyx_mstate_global->__pyx_n_s_CONTROLLERBUTTONUP #define __pyx_n_s_CONTROLLERDEVICEADDED __pyx_mstate_global->__pyx_n_s_CONTROLLERDEVICEADDED #define __pyx_n_s_CONTROLLERDEVICEREMAPPED __pyx_mstate_global->__pyx_n_s_CONTROLLERDEVICEREMAPPED #define __pyx_n_s_CONTROLLERDEVICEREMOVED __pyx_mstate_global->__pyx_n_s_CONTROLLERDEVICEREMOVED #define __pyx_n_s_CONTROLLER_AXIS_INVALID __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_INVALID #define __pyx_n_s_CONTROLLER_AXIS_LEFTX __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_LEFTX #define __pyx_n_s_CONTROLLER_AXIS_LEFTY __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_LEFTY #define __pyx_n_s_CONTROLLER_AXIS_MAX __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_MAX #define __pyx_n_s_CONTROLLER_AXIS_RIGHTX __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_RIGHTX #define __pyx_n_s_CONTROLLER_AXIS_RIGHTY __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_RIGHTY #define __pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT #define __pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT #define __pyx_n_s_CONTROLLER_BUTTON_A __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_A #define __pyx_n_s_CONTROLLER_BUTTON_B __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_B #define __pyx_n_s_CONTROLLER_BUTTON_BACK __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_BACK #define __pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN #define __pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT #define __pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT #define __pyx_n_s_CONTROLLER_BUTTON_DPAD_UP __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP #define __pyx_n_s_CONTROLLER_BUTTON_GUIDE __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_GUIDE #define __pyx_n_s_CONTROLLER_BUTTON_INVALID __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_INVALID #define __pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER #define __pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK #define __pyx_n_s_CONTROLLER_BUTTON_MAX __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_MAX #define __pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER #define __pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK #define __pyx_n_s_CONTROLLER_BUTTON_START __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_START #define __pyx_n_s_CONTROLLER_BUTTON_X __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_X #define __pyx_n_s_CONTROLLER_BUTTON_Y __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_Y #define __pyx_n_s_Color __pyx_mstate_global->__pyx_n_s_Color #define __pyx_n_s_DISPLAYEVENT __pyx_mstate_global->__pyx_n_s_DISPLAYEVENT #define __pyx_n_s_DOLLARGESTURE __pyx_mstate_global->__pyx_n_s_DOLLARGESTURE #define __pyx_n_s_DOLLARRECORD __pyx_mstate_global->__pyx_n_s_DOLLARRECORD #define __pyx_n_s_DOUBLEBUF __pyx_mstate_global->__pyx_n_s_DOUBLEBUF #define __pyx_n_s_DROPBEGIN __pyx_mstate_global->__pyx_n_s_DROPBEGIN #define __pyx_n_s_DROPCOMPLETE __pyx_mstate_global->__pyx_n_s_DROPCOMPLETE #define __pyx_n_s_DROPFILE __pyx_mstate_global->__pyx_n_s_DROPFILE #define __pyx_n_s_DROPTEXT __pyx_mstate_global->__pyx_n_s_DROPTEXT #define __pyx_n_s_FINGERDOWN __pyx_mstate_global->__pyx_n_s_FINGERDOWN #define __pyx_n_s_FINGERMOTION __pyx_mstate_global->__pyx_n_s_FINGERMOTION #define __pyx_n_s_FINGERUP __pyx_mstate_global->__pyx_n_s_FINGERUP #define __pyx_n_s_FULLSCREEN __pyx_mstate_global->__pyx_n_s_FULLSCREEN #define __pyx_n_s_GL_ACCELERATED_VISUAL __pyx_mstate_global->__pyx_n_s_GL_ACCELERATED_VISUAL #define __pyx_n_s_GL_ACCUM_ALPHA_SIZE __pyx_mstate_global->__pyx_n_s_GL_ACCUM_ALPHA_SIZE #define __pyx_n_s_GL_ACCUM_BLUE_SIZE __pyx_mstate_global->__pyx_n_s_GL_ACCUM_BLUE_SIZE #define __pyx_n_s_GL_ACCUM_GREEN_SIZE __pyx_mstate_global->__pyx_n_s_GL_ACCUM_GREEN_SIZE #define __pyx_n_s_GL_ACCUM_RED_SIZE __pyx_mstate_global->__pyx_n_s_GL_ACCUM_RED_SIZE #define __pyx_n_s_GL_ALPHA_SIZE __pyx_mstate_global->__pyx_n_s_GL_ALPHA_SIZE #define __pyx_n_s_GL_BLUE_SIZE __pyx_mstate_global->__pyx_n_s_GL_BLUE_SIZE #define __pyx_n_s_GL_BUFFER_SIZE __pyx_mstate_global->__pyx_n_s_GL_BUFFER_SIZE #define __pyx_n_s_GL_CONTEXT_EGL __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_EGL #define __pyx_n_s_GL_CONTEXT_FLAGS __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_FLAGS #define __pyx_n_s_GL_CONTEXT_MAJOR_VERSION __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_MAJOR_VERSION #define __pyx_n_s_GL_CONTEXT_MINOR_VERSION __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_MINOR_VERSION #define __pyx_n_s_GL_CONTEXT_NO_ERROR __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_NO_ERROR #define __pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY #define __pyx_n_s_GL_CONTEXT_PROFILE_CORE __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_PROFILE_CORE #define __pyx_n_s_GL_CONTEXT_PROFILE_ES __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_PROFILE_ES #define __pyx_n_s_GL_CONTEXT_PROFILE_MASK __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_PROFILE_MASK #define __pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR #define __pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION #define __pyx_n_s_GL_DEPTH_SIZE __pyx_mstate_global->__pyx_n_s_GL_DEPTH_SIZE #define __pyx_n_s_GL_DOUBLEBUFFER __pyx_mstate_global->__pyx_n_s_GL_DOUBLEBUFFER #define __pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE __pyx_mstate_global->__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE #define __pyx_n_s_GL_GREEN_SIZE __pyx_mstate_global->__pyx_n_s_GL_GREEN_SIZE #define __pyx_n_s_GL_MULTISAMPLEBUFFERS __pyx_mstate_global->__pyx_n_s_GL_MULTISAMPLEBUFFERS #define __pyx_n_s_GL_MULTISAMPLESAMPLES __pyx_mstate_global->__pyx_n_s_GL_MULTISAMPLESAMPLES #define __pyx_n_s_GL_RED_SIZE __pyx_mstate_global->__pyx_n_s_GL_RED_SIZE #define __pyx_n_s_GL_RETAINED_BACKING __pyx_mstate_global->__pyx_n_s_GL_RETAINED_BACKING #define __pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT __pyx_mstate_global->__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT #define __pyx_n_s_GL_STENCIL_SIZE __pyx_mstate_global->__pyx_n_s_GL_STENCIL_SIZE #define __pyx_n_s_GL_STEREO __pyx_mstate_global->__pyx_n_s_GL_STEREO #define __pyx_n_s_GL_SWAP_CONTROL __pyx_mstate_global->__pyx_n_s_GL_SWAP_CONTROL #define __pyx_n_s_HWSURFACE __pyx_mstate_global->__pyx_n_s_HWSURFACE #define __pyx_n_s_JOYAXISMOTION __pyx_mstate_global->__pyx_n_s_JOYAXISMOTION #define __pyx_n_s_JOYBALLMOTION __pyx_mstate_global->__pyx_n_s_JOYBALLMOTION #define __pyx_n_s_JOYBUTTONDOWN __pyx_mstate_global->__pyx_n_s_JOYBUTTONDOWN #define __pyx_n_s_JOYBUTTONUP __pyx_mstate_global->__pyx_n_s_JOYBUTTONUP #define __pyx_n_s_JOYDEVICEADDED __pyx_mstate_global->__pyx_n_s_JOYDEVICEADDED #define __pyx_n_s_JOYDEVICEREMOVED __pyx_mstate_global->__pyx_n_s_JOYDEVICEREMOVED #define __pyx_n_s_JOYHATMOTION __pyx_mstate_global->__pyx_n_s_JOYHATMOTION #define __pyx_n_s_KEYDOWN __pyx_mstate_global->__pyx_n_s_KEYDOWN #define __pyx_n_s_KEYMAPCHANGED __pyx_mstate_global->__pyx_n_s_KEYMAPCHANGED #define __pyx_n_s_KEYUP __pyx_mstate_global->__pyx_n_s_KEYUP #define __pyx_n_s_KMOD_ALT __pyx_mstate_global->__pyx_n_s_KMOD_ALT #define __pyx_n_s_KMOD_CAPS __pyx_mstate_global->__pyx_n_s_KMOD_CAPS #define __pyx_n_s_KMOD_CTRL __pyx_mstate_global->__pyx_n_s_KMOD_CTRL #define __pyx_n_s_KMOD_GUI __pyx_mstate_global->__pyx_n_s_KMOD_GUI #define __pyx_n_s_KMOD_LALT __pyx_mstate_global->__pyx_n_s_KMOD_LALT #define __pyx_n_s_KMOD_LCTRL __pyx_mstate_global->__pyx_n_s_KMOD_LCTRL #define __pyx_n_s_KMOD_LGUI __pyx_mstate_global->__pyx_n_s_KMOD_LGUI #define __pyx_n_s_KMOD_LMETA __pyx_mstate_global->__pyx_n_s_KMOD_LMETA #define __pyx_n_s_KMOD_LSHIFT __pyx_mstate_global->__pyx_n_s_KMOD_LSHIFT #define __pyx_n_s_KMOD_META __pyx_mstate_global->__pyx_n_s_KMOD_META #define __pyx_n_s_KMOD_MODE __pyx_mstate_global->__pyx_n_s_KMOD_MODE #define __pyx_n_s_KMOD_NONE __pyx_mstate_global->__pyx_n_s_KMOD_NONE #define __pyx_n_s_KMOD_NUM __pyx_mstate_global->__pyx_n_s_KMOD_NUM #define __pyx_n_s_KMOD_RALT __pyx_mstate_global->__pyx_n_s_KMOD_RALT #define __pyx_n_s_KMOD_RCTRL __pyx_mstate_global->__pyx_n_s_KMOD_RCTRL #define __pyx_n_s_KMOD_RGUI __pyx_mstate_global->__pyx_n_s_KMOD_RGUI #define __pyx_n_s_KMOD_RMETA __pyx_mstate_global->__pyx_n_s_KMOD_RMETA #define __pyx_n_s_KMOD_RSHIFT __pyx_mstate_global->__pyx_n_s_KMOD_RSHIFT #define __pyx_n_s_KMOD_SHIFT __pyx_mstate_global->__pyx_n_s_KMOD_SHIFT #define __pyx_n_s_K_0 __pyx_mstate_global->__pyx_n_s_K_0 #define __pyx_n_s_K_1 __pyx_mstate_global->__pyx_n_s_K_1 #define __pyx_n_s_K_2 __pyx_mstate_global->__pyx_n_s_K_2 #define __pyx_n_s_K_3 __pyx_mstate_global->__pyx_n_s_K_3 #define __pyx_n_s_K_4 __pyx_mstate_global->__pyx_n_s_K_4 #define __pyx_n_s_K_5 __pyx_mstate_global->__pyx_n_s_K_5 #define __pyx_n_s_K_6 __pyx_mstate_global->__pyx_n_s_K_6 #define __pyx_n_s_K_7 __pyx_mstate_global->__pyx_n_s_K_7 #define __pyx_n_s_K_8 __pyx_mstate_global->__pyx_n_s_K_8 #define __pyx_n_s_K_9 __pyx_mstate_global->__pyx_n_s_K_9 #define __pyx_n_s_K_AC_BACK __pyx_mstate_global->__pyx_n_s_K_AC_BACK #define __pyx_n_s_K_AC_BOOKMARKS __pyx_mstate_global->__pyx_n_s_K_AC_BOOKMARKS #define __pyx_n_s_K_AC_FORWARD __pyx_mstate_global->__pyx_n_s_K_AC_FORWARD #define __pyx_n_s_K_AC_HOME __pyx_mstate_global->__pyx_n_s_K_AC_HOME #define __pyx_n_s_K_AC_REFRESH __pyx_mstate_global->__pyx_n_s_K_AC_REFRESH #define __pyx_n_s_K_AC_SEARCH __pyx_mstate_global->__pyx_n_s_K_AC_SEARCH #define __pyx_n_s_K_AC_STOP __pyx_mstate_global->__pyx_n_s_K_AC_STOP #define __pyx_n_s_K_AGAIN __pyx_mstate_global->__pyx_n_s_K_AGAIN #define __pyx_n_s_K_ALTERASE __pyx_mstate_global->__pyx_n_s_K_ALTERASE #define __pyx_n_s_K_AMPERSAND __pyx_mstate_global->__pyx_n_s_K_AMPERSAND #define __pyx_n_s_K_APP1 __pyx_mstate_global->__pyx_n_s_K_APP1 #define __pyx_n_s_K_APP2 __pyx_mstate_global->__pyx_n_s_K_APP2 #define __pyx_n_s_K_APPLICATION __pyx_mstate_global->__pyx_n_s_K_APPLICATION #define __pyx_n_s_K_ASTERISK __pyx_mstate_global->__pyx_n_s_K_ASTERISK #define __pyx_n_s_K_AT __pyx_mstate_global->__pyx_n_s_K_AT #define __pyx_n_s_K_AUDIOFASTFORWARD __pyx_mstate_global->__pyx_n_s_K_AUDIOFASTFORWARD #define __pyx_n_s_K_AUDIOMUTE __pyx_mstate_global->__pyx_n_s_K_AUDIOMUTE #define __pyx_n_s_K_AUDIONEXT __pyx_mstate_global->__pyx_n_s_K_AUDIONEXT #define __pyx_n_s_K_AUDIOPLAY __pyx_mstate_global->__pyx_n_s_K_AUDIOPLAY #define __pyx_n_s_K_AUDIOPREV __pyx_mstate_global->__pyx_n_s_K_AUDIOPREV #define __pyx_n_s_K_AUDIOREWIND __pyx_mstate_global->__pyx_n_s_K_AUDIOREWIND #define __pyx_n_s_K_AUDIOSTOP __pyx_mstate_global->__pyx_n_s_K_AUDIOSTOP #define __pyx_n_s_K_BACKQUOTE __pyx_mstate_global->__pyx_n_s_K_BACKQUOTE #define __pyx_n_s_K_BACKSLASH __pyx_mstate_global->__pyx_n_s_K_BACKSLASH #define __pyx_n_s_K_BACKSPACE __pyx_mstate_global->__pyx_n_s_K_BACKSPACE #define __pyx_n_s_K_BREAK __pyx_mstate_global->__pyx_n_s_K_BREAK #define __pyx_n_s_K_BRIGHTNESSDOWN __pyx_mstate_global->__pyx_n_s_K_BRIGHTNESSDOWN #define __pyx_n_s_K_BRIGHTNESSUP __pyx_mstate_global->__pyx_n_s_K_BRIGHTNESSUP #define __pyx_n_s_K_CALCULATOR __pyx_mstate_global->__pyx_n_s_K_CALCULATOR #define __pyx_n_s_K_CANCEL __pyx_mstate_global->__pyx_n_s_K_CANCEL #define __pyx_n_s_K_CAPSLOCK __pyx_mstate_global->__pyx_n_s_K_CAPSLOCK #define __pyx_n_s_K_CARET __pyx_mstate_global->__pyx_n_s_K_CARET #define __pyx_n_s_K_CLEAR __pyx_mstate_global->__pyx_n_s_K_CLEAR #define __pyx_n_s_K_CLEARAGAIN __pyx_mstate_global->__pyx_n_s_K_CLEARAGAIN #define __pyx_n_s_K_COLON __pyx_mstate_global->__pyx_n_s_K_COLON #define __pyx_n_s_K_COMMA __pyx_mstate_global->__pyx_n_s_K_COMMA #define __pyx_n_s_K_COMPUTER __pyx_mstate_global->__pyx_n_s_K_COMPUTER #define __pyx_n_s_K_COPY __pyx_mstate_global->__pyx_n_s_K_COPY #define __pyx_n_s_K_CRSEL __pyx_mstate_global->__pyx_n_s_K_CRSEL #define __pyx_n_s_K_CURRENCYSUBUNIT __pyx_mstate_global->__pyx_n_s_K_CURRENCYSUBUNIT #define __pyx_n_s_K_CURRENCYUNIT __pyx_mstate_global->__pyx_n_s_K_CURRENCYUNIT #define __pyx_n_s_K_CUT __pyx_mstate_global->__pyx_n_s_K_CUT #define __pyx_n_s_K_DECIMALSEPARATOR __pyx_mstate_global->__pyx_n_s_K_DECIMALSEPARATOR #define __pyx_n_s_K_DELETE __pyx_mstate_global->__pyx_n_s_K_DELETE #define __pyx_n_s_K_DISPLAYSWITCH __pyx_mstate_global->__pyx_n_s_K_DISPLAYSWITCH #define __pyx_n_s_K_DOLLAR __pyx_mstate_global->__pyx_n_s_K_DOLLAR #define __pyx_n_s_K_DOWN __pyx_mstate_global->__pyx_n_s_K_DOWN #define __pyx_n_s_K_EJECT __pyx_mstate_global->__pyx_n_s_K_EJECT #define __pyx_n_s_K_END __pyx_mstate_global->__pyx_n_s_K_END #define __pyx_n_s_K_EQUALS __pyx_mstate_global->__pyx_n_s_K_EQUALS #define __pyx_n_s_K_ESCAPE __pyx_mstate_global->__pyx_n_s_K_ESCAPE #define __pyx_n_s_K_EURO __pyx_mstate_global->__pyx_n_s_K_EURO #define __pyx_n_s_K_EXCLAIM __pyx_mstate_global->__pyx_n_s_K_EXCLAIM #define __pyx_n_s_K_EXECUTE __pyx_mstate_global->__pyx_n_s_K_EXECUTE #define __pyx_n_s_K_EXSEL __pyx_mstate_global->__pyx_n_s_K_EXSEL #define __pyx_n_s_K_F1 __pyx_mstate_global->__pyx_n_s_K_F1 #define __pyx_n_s_K_F10 __pyx_mstate_global->__pyx_n_s_K_F10 #define __pyx_n_s_K_F11 __pyx_mstate_global->__pyx_n_s_K_F11 #define __pyx_n_s_K_F12 __pyx_mstate_global->__pyx_n_s_K_F12 #define __pyx_n_s_K_F13 __pyx_mstate_global->__pyx_n_s_K_F13 #define __pyx_n_s_K_F14 __pyx_mstate_global->__pyx_n_s_K_F14 #define __pyx_n_s_K_F15 __pyx_mstate_global->__pyx_n_s_K_F15 #define __pyx_n_s_K_F16 __pyx_mstate_global->__pyx_n_s_K_F16 #define __pyx_n_s_K_F17 __pyx_mstate_global->__pyx_n_s_K_F17 #define __pyx_n_s_K_F18 __pyx_mstate_global->__pyx_n_s_K_F18 #define __pyx_n_s_K_F19 __pyx_mstate_global->__pyx_n_s_K_F19 #define __pyx_n_s_K_F2 __pyx_mstate_global->__pyx_n_s_K_F2 #define __pyx_n_s_K_F20 __pyx_mstate_global->__pyx_n_s_K_F20 #define __pyx_n_s_K_F21 __pyx_mstate_global->__pyx_n_s_K_F21 #define __pyx_n_s_K_F22 __pyx_mstate_global->__pyx_n_s_K_F22 #define __pyx_n_s_K_F23 __pyx_mstate_global->__pyx_n_s_K_F23 #define __pyx_n_s_K_F24 __pyx_mstate_global->__pyx_n_s_K_F24 #define __pyx_n_s_K_F3 __pyx_mstate_global->__pyx_n_s_K_F3 #define __pyx_n_s_K_F4 __pyx_mstate_global->__pyx_n_s_K_F4 #define __pyx_n_s_K_F5 __pyx_mstate_global->__pyx_n_s_K_F5 #define __pyx_n_s_K_F6 __pyx_mstate_global->__pyx_n_s_K_F6 #define __pyx_n_s_K_F7 __pyx_mstate_global->__pyx_n_s_K_F7 #define __pyx_n_s_K_F8 __pyx_mstate_global->__pyx_n_s_K_F8 #define __pyx_n_s_K_F9 __pyx_mstate_global->__pyx_n_s_K_F9 #define __pyx_n_s_K_FIND __pyx_mstate_global->__pyx_n_s_K_FIND #define __pyx_n_s_K_FIRST __pyx_mstate_global->__pyx_n_s_K_FIRST #define __pyx_n_s_K_GREATER __pyx_mstate_global->__pyx_n_s_K_GREATER #define __pyx_n_s_K_HASH __pyx_mstate_global->__pyx_n_s_K_HASH #define __pyx_n_s_K_HELP __pyx_mstate_global->__pyx_n_s_K_HELP #define __pyx_n_s_K_HOME __pyx_mstate_global->__pyx_n_s_K_HOME #define __pyx_n_s_K_INSERT __pyx_mstate_global->__pyx_n_s_K_INSERT #define __pyx_n_s_K_KBDILLUMDOWN __pyx_mstate_global->__pyx_n_s_K_KBDILLUMDOWN #define __pyx_n_s_K_KBDILLUMTOGGLE __pyx_mstate_global->__pyx_n_s_K_KBDILLUMTOGGLE #define __pyx_n_s_K_KBDILLUMUP __pyx_mstate_global->__pyx_n_s_K_KBDILLUMUP #define __pyx_n_s_K_KP0 __pyx_mstate_global->__pyx_n_s_K_KP0 #define __pyx_n_s_K_KP1 __pyx_mstate_global->__pyx_n_s_K_KP1 #define __pyx_n_s_K_KP2 __pyx_mstate_global->__pyx_n_s_K_KP2 #define __pyx_n_s_K_KP3 __pyx_mstate_global->__pyx_n_s_K_KP3 #define __pyx_n_s_K_KP4 __pyx_mstate_global->__pyx_n_s_K_KP4 #define __pyx_n_s_K_KP5 __pyx_mstate_global->__pyx_n_s_K_KP5 #define __pyx_n_s_K_KP6 __pyx_mstate_global->__pyx_n_s_K_KP6 #define __pyx_n_s_K_KP7 __pyx_mstate_global->__pyx_n_s_K_KP7 #define __pyx_n_s_K_KP8 __pyx_mstate_global->__pyx_n_s_K_KP8 #define __pyx_n_s_K_KP9 __pyx_mstate_global->__pyx_n_s_K_KP9 #define __pyx_n_s_K_KP_0 __pyx_mstate_global->__pyx_n_s_K_KP_0 #define __pyx_n_s_K_KP_00 __pyx_mstate_global->__pyx_n_s_K_KP_00 #define __pyx_n_s_K_KP_000 __pyx_mstate_global->__pyx_n_s_K_KP_000 #define __pyx_n_s_K_KP_1 __pyx_mstate_global->__pyx_n_s_K_KP_1 #define __pyx_n_s_K_KP_2 __pyx_mstate_global->__pyx_n_s_K_KP_2 #define __pyx_n_s_K_KP_3 __pyx_mstate_global->__pyx_n_s_K_KP_3 #define __pyx_n_s_K_KP_4 __pyx_mstate_global->__pyx_n_s_K_KP_4 #define __pyx_n_s_K_KP_5 __pyx_mstate_global->__pyx_n_s_K_KP_5 #define __pyx_n_s_K_KP_6 __pyx_mstate_global->__pyx_n_s_K_KP_6 #define __pyx_n_s_K_KP_7 __pyx_mstate_global->__pyx_n_s_K_KP_7 #define __pyx_n_s_K_KP_8 __pyx_mstate_global->__pyx_n_s_K_KP_8 #define __pyx_n_s_K_KP_9 __pyx_mstate_global->__pyx_n_s_K_KP_9 #define __pyx_n_s_K_KP_A __pyx_mstate_global->__pyx_n_s_K_KP_A #define __pyx_n_s_K_KP_AMPERSAND __pyx_mstate_global->__pyx_n_s_K_KP_AMPERSAND #define __pyx_n_s_K_KP_AT __pyx_mstate_global->__pyx_n_s_K_KP_AT #define __pyx_n_s_K_KP_B __pyx_mstate_global->__pyx_n_s_K_KP_B #define __pyx_n_s_K_KP_BACKSPACE __pyx_mstate_global->__pyx_n_s_K_KP_BACKSPACE #define __pyx_n_s_K_KP_BINARY __pyx_mstate_global->__pyx_n_s_K_KP_BINARY #define __pyx_n_s_K_KP_C __pyx_mstate_global->__pyx_n_s_K_KP_C #define __pyx_n_s_K_KP_CLEAR __pyx_mstate_global->__pyx_n_s_K_KP_CLEAR #define __pyx_n_s_K_KP_CLEARENTRY __pyx_mstate_global->__pyx_n_s_K_KP_CLEARENTRY #define __pyx_n_s_K_KP_COLON __pyx_mstate_global->__pyx_n_s_K_KP_COLON #define __pyx_n_s_K_KP_COMMA __pyx_mstate_global->__pyx_n_s_K_KP_COMMA #define __pyx_n_s_K_KP_D __pyx_mstate_global->__pyx_n_s_K_KP_D #define __pyx_n_s_K_KP_DBLAMPERSAND __pyx_mstate_global->__pyx_n_s_K_KP_DBLAMPERSAND #define __pyx_n_s_K_KP_DBLVERTICALBAR __pyx_mstate_global->__pyx_n_s_K_KP_DBLVERTICALBAR #define __pyx_n_s_K_KP_DECIMAL __pyx_mstate_global->__pyx_n_s_K_KP_DECIMAL #define __pyx_n_s_K_KP_DIVIDE __pyx_mstate_global->__pyx_n_s_K_KP_DIVIDE #define __pyx_n_s_K_KP_E __pyx_mstate_global->__pyx_n_s_K_KP_E #define __pyx_n_s_K_KP_ENTER __pyx_mstate_global->__pyx_n_s_K_KP_ENTER #define __pyx_n_s_K_KP_EQUALS __pyx_mstate_global->__pyx_n_s_K_KP_EQUALS #define __pyx_n_s_K_KP_EQUALSAS400 __pyx_mstate_global->__pyx_n_s_K_KP_EQUALSAS400 #define __pyx_n_s_K_KP_EXCLAM __pyx_mstate_global->__pyx_n_s_K_KP_EXCLAM #define __pyx_n_s_K_KP_F __pyx_mstate_global->__pyx_n_s_K_KP_F #define __pyx_n_s_K_KP_GREATER __pyx_mstate_global->__pyx_n_s_K_KP_GREATER #define __pyx_n_s_K_KP_HASH __pyx_mstate_global->__pyx_n_s_K_KP_HASH #define __pyx_n_s_K_KP_HEXADECIMAL __pyx_mstate_global->__pyx_n_s_K_KP_HEXADECIMAL #define __pyx_n_s_K_KP_LEFTBRACE __pyx_mstate_global->__pyx_n_s_K_KP_LEFTBRACE #define __pyx_n_s_K_KP_LEFTPAREN __pyx_mstate_global->__pyx_n_s_K_KP_LEFTPAREN #define __pyx_n_s_K_KP_LESS __pyx_mstate_global->__pyx_n_s_K_KP_LESS #define __pyx_n_s_K_KP_MEMADD __pyx_mstate_global->__pyx_n_s_K_KP_MEMADD #define __pyx_n_s_K_KP_MEMCLEAR __pyx_mstate_global->__pyx_n_s_K_KP_MEMCLEAR #define __pyx_n_s_K_KP_MEMDIVIDE __pyx_mstate_global->__pyx_n_s_K_KP_MEMDIVIDE #define __pyx_n_s_K_KP_MEMMULTIPLY __pyx_mstate_global->__pyx_n_s_K_KP_MEMMULTIPLY #define __pyx_n_s_K_KP_MEMRECALL __pyx_mstate_global->__pyx_n_s_K_KP_MEMRECALL #define __pyx_n_s_K_KP_MEMSTORE __pyx_mstate_global->__pyx_n_s_K_KP_MEMSTORE #define __pyx_n_s_K_KP_MEMSUBTRACT __pyx_mstate_global->__pyx_n_s_K_KP_MEMSUBTRACT #define __pyx_n_s_K_KP_MINUS __pyx_mstate_global->__pyx_n_s_K_KP_MINUS #define __pyx_n_s_K_KP_MULTIPLY __pyx_mstate_global->__pyx_n_s_K_KP_MULTIPLY #define __pyx_n_s_K_KP_OCTAL __pyx_mstate_global->__pyx_n_s_K_KP_OCTAL #define __pyx_n_s_K_KP_PERCENT __pyx_mstate_global->__pyx_n_s_K_KP_PERCENT #define __pyx_n_s_K_KP_PERIOD __pyx_mstate_global->__pyx_n_s_K_KP_PERIOD #define __pyx_n_s_K_KP_PLUS __pyx_mstate_global->__pyx_n_s_K_KP_PLUS #define __pyx_n_s_K_KP_PLUSMINUS __pyx_mstate_global->__pyx_n_s_K_KP_PLUSMINUS #define __pyx_n_s_K_KP_POWER __pyx_mstate_global->__pyx_n_s_K_KP_POWER #define __pyx_n_s_K_KP_RIGHTBRACE __pyx_mstate_global->__pyx_n_s_K_KP_RIGHTBRACE #define __pyx_n_s_K_KP_RIGHTPAREN __pyx_mstate_global->__pyx_n_s_K_KP_RIGHTPAREN #define __pyx_n_s_K_KP_SPACE __pyx_mstate_global->__pyx_n_s_K_KP_SPACE #define __pyx_n_s_K_KP_TAB __pyx_mstate_global->__pyx_n_s_K_KP_TAB #define __pyx_n_s_K_KP_VERTICALBAR __pyx_mstate_global->__pyx_n_s_K_KP_VERTICALBAR #define __pyx_n_s_K_KP_XOR __pyx_mstate_global->__pyx_n_s_K_KP_XOR #define __pyx_n_s_K_LALT __pyx_mstate_global->__pyx_n_s_K_LALT #define __pyx_n_s_K_LAST __pyx_mstate_global->__pyx_n_s_K_LAST #define __pyx_n_s_K_LCTRL __pyx_mstate_global->__pyx_n_s_K_LCTRL #define __pyx_n_s_K_LEFT __pyx_mstate_global->__pyx_n_s_K_LEFT #define __pyx_n_s_K_LEFTBRACKET __pyx_mstate_global->__pyx_n_s_K_LEFTBRACKET #define __pyx_n_s_K_LEFTPAREN __pyx_mstate_global->__pyx_n_s_K_LEFTPAREN #define __pyx_n_s_K_LESS __pyx_mstate_global->__pyx_n_s_K_LESS #define __pyx_n_s_K_LGUI __pyx_mstate_global->__pyx_n_s_K_LGUI #define __pyx_n_s_K_LMETA __pyx_mstate_global->__pyx_n_s_K_LMETA #define __pyx_n_s_K_LSHIFT __pyx_mstate_global->__pyx_n_s_K_LSHIFT #define __pyx_n_s_K_LSUPER __pyx_mstate_global->__pyx_n_s_K_LSUPER #define __pyx_n_s_K_MAIL __pyx_mstate_global->__pyx_n_s_K_MAIL #define __pyx_n_s_K_MEDIASELECT __pyx_mstate_global->__pyx_n_s_K_MEDIASELECT #define __pyx_n_s_K_MENU __pyx_mstate_global->__pyx_n_s_K_MENU #define __pyx_n_s_K_MINUS __pyx_mstate_global->__pyx_n_s_K_MINUS #define __pyx_n_s_K_MODE __pyx_mstate_global->__pyx_n_s_K_MODE #define __pyx_n_s_K_MUTE __pyx_mstate_global->__pyx_n_s_K_MUTE #define __pyx_n_s_K_NUMLOCK __pyx_mstate_global->__pyx_n_s_K_NUMLOCK #define __pyx_n_s_K_NUMLOCKCLEAR __pyx_mstate_global->__pyx_n_s_K_NUMLOCKCLEAR #define __pyx_n_s_K_OPER __pyx_mstate_global->__pyx_n_s_K_OPER #define __pyx_n_s_K_OUT __pyx_mstate_global->__pyx_n_s_K_OUT #define __pyx_n_s_K_PAGEDOWN __pyx_mstate_global->__pyx_n_s_K_PAGEDOWN #define __pyx_n_s_K_PAGEUP __pyx_mstate_global->__pyx_n_s_K_PAGEUP #define __pyx_n_s_K_PASTE __pyx_mstate_global->__pyx_n_s_K_PASTE #define __pyx_n_s_K_PAUSE __pyx_mstate_global->__pyx_n_s_K_PAUSE #define __pyx_n_s_K_PERCENT __pyx_mstate_global->__pyx_n_s_K_PERCENT #define __pyx_n_s_K_PERIOD __pyx_mstate_global->__pyx_n_s_K_PERIOD #define __pyx_n_s_K_PLUS __pyx_mstate_global->__pyx_n_s_K_PLUS #define __pyx_n_s_K_POWER __pyx_mstate_global->__pyx_n_s_K_POWER #define __pyx_n_s_K_PRINT __pyx_mstate_global->__pyx_n_s_K_PRINT #define __pyx_n_s_K_PRINTSCREEN __pyx_mstate_global->__pyx_n_s_K_PRINTSCREEN #define __pyx_n_s_K_PRIOR __pyx_mstate_global->__pyx_n_s_K_PRIOR #define __pyx_n_s_K_QUESTION __pyx_mstate_global->__pyx_n_s_K_QUESTION #define __pyx_n_s_K_QUOTE __pyx_mstate_global->__pyx_n_s_K_QUOTE #define __pyx_n_s_K_QUOTEDBL __pyx_mstate_global->__pyx_n_s_K_QUOTEDBL #define __pyx_n_s_K_RALT __pyx_mstate_global->__pyx_n_s_K_RALT #define __pyx_n_s_K_RCTRL __pyx_mstate_global->__pyx_n_s_K_RCTRL #define __pyx_n_s_K_RETURN __pyx_mstate_global->__pyx_n_s_K_RETURN #define __pyx_n_s_K_RETURN2 __pyx_mstate_global->__pyx_n_s_K_RETURN2 #define __pyx_n_s_K_RGUI __pyx_mstate_global->__pyx_n_s_K_RGUI #define __pyx_n_s_K_RIGHT __pyx_mstate_global->__pyx_n_s_K_RIGHT #define __pyx_n_s_K_RIGHTBRACKET __pyx_mstate_global->__pyx_n_s_K_RIGHTBRACKET #define __pyx_n_s_K_RIGHTPAREN __pyx_mstate_global->__pyx_n_s_K_RIGHTPAREN #define __pyx_n_s_K_RMETA __pyx_mstate_global->__pyx_n_s_K_RMETA #define __pyx_n_s_K_RSHIFT __pyx_mstate_global->__pyx_n_s_K_RSHIFT #define __pyx_n_s_K_RSUPER __pyx_mstate_global->__pyx_n_s_K_RSUPER #define __pyx_n_s_K_SCROLLLOCK __pyx_mstate_global->__pyx_n_s_K_SCROLLLOCK #define __pyx_n_s_K_SCROLLOCK __pyx_mstate_global->__pyx_n_s_K_SCROLLOCK #define __pyx_n_s_K_SELECT __pyx_mstate_global->__pyx_n_s_K_SELECT #define __pyx_n_s_K_SEMICOLON __pyx_mstate_global->__pyx_n_s_K_SEMICOLON #define __pyx_n_s_K_SEPARATOR __pyx_mstate_global->__pyx_n_s_K_SEPARATOR #define __pyx_n_s_K_SLASH __pyx_mstate_global->__pyx_n_s_K_SLASH #define __pyx_n_s_K_SLEEP __pyx_mstate_global->__pyx_n_s_K_SLEEP #define __pyx_n_s_K_SPACE __pyx_mstate_global->__pyx_n_s_K_SPACE #define __pyx_n_s_K_STOP __pyx_mstate_global->__pyx_n_s_K_STOP #define __pyx_n_s_K_SYSREQ __pyx_mstate_global->__pyx_n_s_K_SYSREQ #define __pyx_n_s_K_TAB __pyx_mstate_global->__pyx_n_s_K_TAB #define __pyx_n_s_K_THOUSANDSSEPARATOR __pyx_mstate_global->__pyx_n_s_K_THOUSANDSSEPARATOR #define __pyx_n_s_K_UNDERSCORE __pyx_mstate_global->__pyx_n_s_K_UNDERSCORE #define __pyx_n_s_K_UNDO __pyx_mstate_global->__pyx_n_s_K_UNDO #define __pyx_n_s_K_UNKNOWN __pyx_mstate_global->__pyx_n_s_K_UNKNOWN #define __pyx_n_s_K_UP __pyx_mstate_global->__pyx_n_s_K_UP #define __pyx_n_s_K_VOLUMEDOWN __pyx_mstate_global->__pyx_n_s_K_VOLUMEDOWN #define __pyx_n_s_K_VOLUMEUP __pyx_mstate_global->__pyx_n_s_K_VOLUMEUP #define __pyx_n_s_K_WWW __pyx_mstate_global->__pyx_n_s_K_WWW #define __pyx_n_s_K_a __pyx_mstate_global->__pyx_n_s_K_a #define __pyx_n_s_K_b __pyx_mstate_global->__pyx_n_s_K_b #define __pyx_n_s_K_c __pyx_mstate_global->__pyx_n_s_K_c #define __pyx_n_s_K_d __pyx_mstate_global->__pyx_n_s_K_d #define __pyx_n_s_K_e __pyx_mstate_global->__pyx_n_s_K_e #define __pyx_n_s_K_f __pyx_mstate_global->__pyx_n_s_K_f #define __pyx_n_s_K_g __pyx_mstate_global->__pyx_n_s_K_g #define __pyx_n_s_K_h __pyx_mstate_global->__pyx_n_s_K_h #define __pyx_n_s_K_i __pyx_mstate_global->__pyx_n_s_K_i #define __pyx_n_s_K_j __pyx_mstate_global->__pyx_n_s_K_j #define __pyx_n_s_K_k __pyx_mstate_global->__pyx_n_s_K_k #define __pyx_n_s_K_l __pyx_mstate_global->__pyx_n_s_K_l #define __pyx_n_s_K_m __pyx_mstate_global->__pyx_n_s_K_m #define __pyx_n_s_K_n __pyx_mstate_global->__pyx_n_s_K_n #define __pyx_n_s_K_o __pyx_mstate_global->__pyx_n_s_K_o #define __pyx_n_s_K_p __pyx_mstate_global->__pyx_n_s_K_p #define __pyx_n_s_K_q __pyx_mstate_global->__pyx_n_s_K_q #define __pyx_n_s_K_r __pyx_mstate_global->__pyx_n_s_K_r #define __pyx_n_s_K_s __pyx_mstate_global->__pyx_n_s_K_s #define __pyx_n_s_K_t __pyx_mstate_global->__pyx_n_s_K_t #define __pyx_n_s_K_u __pyx_mstate_global->__pyx_n_s_K_u #define __pyx_n_s_K_v __pyx_mstate_global->__pyx_n_s_K_v #define __pyx_n_s_K_w __pyx_mstate_global->__pyx_n_s_K_w #define __pyx_n_s_K_x __pyx_mstate_global->__pyx_n_s_K_x #define __pyx_n_s_K_y __pyx_mstate_global->__pyx_n_s_K_y #define __pyx_n_s_K_z __pyx_mstate_global->__pyx_n_s_K_z #define __pyx_n_s_LASTEVENT __pyx_mstate_global->__pyx_n_s_LASTEVENT #define __pyx_n_s_LIL_ENDIAN __pyx_mstate_global->__pyx_n_s_LIL_ENDIAN #define __pyx_n_s_MOUSEBUTTONDOWN __pyx_mstate_global->__pyx_n_s_MOUSEBUTTONDOWN #define __pyx_n_s_MOUSEBUTTONUP __pyx_mstate_global->__pyx_n_s_MOUSEBUTTONUP #define __pyx_n_s_MOUSEMOTION __pyx_mstate_global->__pyx_n_s_MOUSEMOTION #define __pyx_n_s_MOUSEWHEEL __pyx_mstate_global->__pyx_n_s_MOUSEWHEEL #define __pyx_n_s_MULTIGESTURE __pyx_mstate_global->__pyx_n_s_MULTIGESTURE #define __pyx_n_s_NOEVENT __pyx_mstate_global->__pyx_n_s_NOEVENT #define __pyx_n_s_NOFRAME __pyx_mstate_global->__pyx_n_s_NOFRAME #define __pyx_n_s_OPENGL __pyx_mstate_global->__pyx_n_s_OPENGL #define __pyx_n_s_POWERSTATE_CHARGED __pyx_mstate_global->__pyx_n_s_POWERSTATE_CHARGED #define __pyx_n_s_POWERSTATE_CHARGING __pyx_mstate_global->__pyx_n_s_POWERSTATE_CHARGING #define __pyx_n_s_POWERSTATE_NO_BATTERY __pyx_mstate_global->__pyx_n_s_POWERSTATE_NO_BATTERY #define __pyx_n_s_POWERSTATE_ON_BATTERY __pyx_mstate_global->__pyx_n_s_POWERSTATE_ON_BATTERY #define __pyx_n_s_POWERSTATE_UNKNOWN __pyx_mstate_global->__pyx_n_s_POWERSTATE_UNKNOWN #define __pyx_n_s_QUIT __pyx_mstate_global->__pyx_n_s_QUIT #define __pyx_n_s_RENDER_DEVICE_RESET __pyx_mstate_global->__pyx_n_s_RENDER_DEVICE_RESET #define __pyx_n_s_RENDER_TARGETS_RESET __pyx_mstate_global->__pyx_n_s_RENDER_TARGETS_RESET #define __pyx_n_s_RESIZABLE __pyx_mstate_global->__pyx_n_s_RESIZABLE #define __pyx_n_s_RLEACCEL __pyx_mstate_global->__pyx_n_s_RLEACCEL #define __pyx_n_s_Rect __pyx_mstate_global->__pyx_n_s_Rect #define __pyx_n_s_SCRAP_TEXT __pyx_mstate_global->__pyx_n_s_SCRAP_TEXT #define __pyx_n_s_SDL_VERSION_TUPLE __pyx_mstate_global->__pyx_n_s_SDL_VERSION_TUPLE #define __pyx_n_s_SENSORUPDATE __pyx_mstate_global->__pyx_n_s_SENSORUPDATE #define __pyx_n_s_SRCALPHA __pyx_mstate_global->__pyx_n_s_SRCALPHA #define __pyx_n_s_SRCCOLORKEY __pyx_mstate_global->__pyx_n_s_SRCCOLORKEY #define __pyx_n_s_SWSURFACE __pyx_mstate_global->__pyx_n_s_SWSURFACE #define __pyx_n_s_SYSWMEVENT __pyx_mstate_global->__pyx_n_s_SYSWMEVENT #define __pyx_n_s_TEXTEDITING __pyx_mstate_global->__pyx_n_s_TEXTEDITING #define __pyx_n_s_TEXTINPUT __pyx_mstate_global->__pyx_n_s_TEXTINPUT #define __pyx_n_s_TOUCH_MOUSEID __pyx_mstate_global->__pyx_n_s_TOUCH_MOUSEID #define __pyx_n_s_USEREVENT __pyx_mstate_global->__pyx_n_s_USEREVENT #define __pyx_n_s_VIDEOEXPOSE __pyx_mstate_global->__pyx_n_s_VIDEOEXPOSE #define __pyx_n_s_VIDEORESIZE __pyx_mstate_global->__pyx_n_s_VIDEORESIZE #define __pyx_n_s_WINDOWEVENT __pyx_mstate_global->__pyx_n_s_WINDOWEVENT #define __pyx_n_s_WINDOWMOVED __pyx_mstate_global->__pyx_n_s_WINDOWMOVED #define __pyx_n_s_WINDOWPOS_CENTERED __pyx_mstate_global->__pyx_n_s_WINDOWPOS_CENTERED #define __pyx_n_s_WINDOWPOS_UNDEFINED __pyx_mstate_global->__pyx_n_s_WINDOWPOS_UNDEFINED #define __pyx_n_s_WINDOW_ALLOW_HIGHDPI __pyx_mstate_global->__pyx_n_s_WINDOW_ALLOW_HIGHDPI #define __pyx_n_s_WINDOW_BORDERLESS __pyx_mstate_global->__pyx_n_s_WINDOW_BORDERLESS #define __pyx_n_s_WINDOW_FOREIGN __pyx_mstate_global->__pyx_n_s_WINDOW_FOREIGN #define __pyx_n_s_WINDOW_FULLSCREEN __pyx_mstate_global->__pyx_n_s_WINDOW_FULLSCREEN #define __pyx_n_s_WINDOW_FULLSCREEN_DESKTOP __pyx_mstate_global->__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP #define __pyx_n_s_WINDOW_HIDDEN __pyx_mstate_global->__pyx_n_s_WINDOW_HIDDEN #define __pyx_n_s_WINDOW_INPUT_FOCUS __pyx_mstate_global->__pyx_n_s_WINDOW_INPUT_FOCUS #define __pyx_n_s_WINDOW_INPUT_GRABBED __pyx_mstate_global->__pyx_n_s_WINDOW_INPUT_GRABBED #define __pyx_n_s_WINDOW_MAXIMIZED __pyx_mstate_global->__pyx_n_s_WINDOW_MAXIMIZED #define __pyx_n_s_WINDOW_MINIMIZED __pyx_mstate_global->__pyx_n_s_WINDOW_MINIMIZED #define __pyx_n_s_WINDOW_NOFRAME __pyx_mstate_global->__pyx_n_s_WINDOW_NOFRAME #define __pyx_n_s_WINDOW_OPENGL __pyx_mstate_global->__pyx_n_s_WINDOW_OPENGL #define __pyx_n_s_WINDOW_RESIZABLE __pyx_mstate_global->__pyx_n_s_WINDOW_RESIZABLE #define __pyx_n_s_WINDOW_SHOWN __pyx_mstate_global->__pyx_n_s_WINDOW_SHOWN #define __pyx_n_s__2 __pyx_mstate_global->__pyx_n_s__2 #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_pygame_sdl2_color __pyx_mstate_global->__pyx_n_s_pygame_sdl2_color #define __pyx_n_s_pygame_sdl2_rect __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rect #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_kp_s_text_plain __pyx_mstate_global->__pyx_kp_s_text_plain #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 #define __pyx_int_5 __pyx_mstate_global->__pyx_int_5 #define __pyx_int_6 __pyx_mstate_global->__pyx_int_6 #define __pyx_int_7 __pyx_mstate_global->__pyx_int_7 #define __pyx_int_8 __pyx_mstate_global->__pyx_int_8 #define __pyx_int_9 __pyx_mstate_global->__pyx_int_9 #define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 #define __pyx_int_17 __pyx_mstate_global->__pyx_int_17 #define __pyx_int_1073741824 __pyx_mstate_global->__pyx_int_1073741824 #define __pyx_int_2147483648 __pyx_mstate_global->__pyx_int_2147483648 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 /* #### Code section: module_code ### */ static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_ACTIVEEVENT, __pyx_k_ACTIVEEVENT, sizeof(__pyx_k_ACTIVEEVENT), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERBACKGROUND, __pyx_k_APP_DIDENTERBACKGROUND, sizeof(__pyx_k_APP_DIDENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERFOREGROUND, __pyx_k_APP_DIDENTERFOREGROUND, sizeof(__pyx_k_APP_DIDENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_LOWMEMORY, __pyx_k_APP_LOWMEMORY, sizeof(__pyx_k_APP_LOWMEMORY), 0, 0, 1, 1}, {&__pyx_n_s_APP_TERMINATING, __pyx_k_APP_TERMINATING, sizeof(__pyx_k_APP_TERMINATING), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERBACKGROUND, __pyx_k_APP_WILLENTERBACKGROUND, sizeof(__pyx_k_APP_WILLENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERFOREGROUND, __pyx_k_APP_WILLENTERFOREGROUND, sizeof(__pyx_k_APP_WILLENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_AUDIODEVICEADDED, __pyx_k_AUDIODEVICEADDED, sizeof(__pyx_k_AUDIODEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_AUDIODEVICEREMOVED, __pyx_k_AUDIODEVICEREMOVED, sizeof(__pyx_k_AUDIODEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_BIG_ENDIAN, __pyx_k_BIG_ENDIAN, sizeof(__pyx_k_BIG_ENDIAN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_ADD, __pyx_k_BLEND_ADD, sizeof(__pyx_k_BLEND_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_MAX, __pyx_k_BLEND_MAX, sizeof(__pyx_k_BLEND_MAX), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_MIN, __pyx_k_BLEND_MIN, sizeof(__pyx_k_BLEND_MIN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_MULT, __pyx_k_BLEND_MULT, sizeof(__pyx_k_BLEND_MULT), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_PREMULTIPLIED, __pyx_k_BLEND_PREMULTIPLIED, sizeof(__pyx_k_BLEND_PREMULTIPLIED), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_ADD, __pyx_k_BLEND_RGBA_ADD, sizeof(__pyx_k_BLEND_RGBA_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_MAX, __pyx_k_BLEND_RGBA_MAX, sizeof(__pyx_k_BLEND_RGBA_MAX), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_MIN, __pyx_k_BLEND_RGBA_MIN, sizeof(__pyx_k_BLEND_RGBA_MIN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_MULT, __pyx_k_BLEND_RGBA_MULT, sizeof(__pyx_k_BLEND_RGBA_MULT), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_SUB, __pyx_k_BLEND_RGBA_SUB, sizeof(__pyx_k_BLEND_RGBA_SUB), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_ADD, __pyx_k_BLEND_RGB_ADD, sizeof(__pyx_k_BLEND_RGB_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_MAX, __pyx_k_BLEND_RGB_MAX, sizeof(__pyx_k_BLEND_RGB_MAX), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_MIN, __pyx_k_BLEND_RGB_MIN, sizeof(__pyx_k_BLEND_RGB_MIN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_MULT, __pyx_k_BLEND_RGB_MULT, sizeof(__pyx_k_BLEND_RGB_MULT), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_SUB, __pyx_k_BLEND_RGB_SUB, sizeof(__pyx_k_BLEND_RGB_SUB), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_SUB, __pyx_k_BLEND_SUB, sizeof(__pyx_k_BLEND_SUB), 0, 0, 1, 1}, {&__pyx_n_s_BYTEORDER, __pyx_k_BYTEORDER, sizeof(__pyx_k_BYTEORDER), 0, 0, 1, 1}, {&__pyx_n_s_CLIPBOARDUPDATE, __pyx_k_CLIPBOARDUPDATE, sizeof(__pyx_k_CLIPBOARDUPDATE), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERAXISMOTION, __pyx_k_CONTROLLERAXISMOTION, sizeof(__pyx_k_CONTROLLERAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONDOWN, __pyx_k_CONTROLLERBUTTONDOWN, sizeof(__pyx_k_CONTROLLERBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONUP, __pyx_k_CONTROLLERBUTTONUP, sizeof(__pyx_k_CONTROLLERBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEADDED, __pyx_k_CONTROLLERDEVICEADDED, sizeof(__pyx_k_CONTROLLERDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMAPPED, __pyx_k_CONTROLLERDEVICEREMAPPED, sizeof(__pyx_k_CONTROLLERDEVICEREMAPPED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMOVED, __pyx_k_CONTROLLERDEVICEREMOVED, sizeof(__pyx_k_CONTROLLERDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_INVALID, __pyx_k_CONTROLLER_AXIS_INVALID, sizeof(__pyx_k_CONTROLLER_AXIS_INVALID), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_LEFTX, __pyx_k_CONTROLLER_AXIS_LEFTX, sizeof(__pyx_k_CONTROLLER_AXIS_LEFTX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_LEFTY, __pyx_k_CONTROLLER_AXIS_LEFTY, sizeof(__pyx_k_CONTROLLER_AXIS_LEFTY), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_MAX, __pyx_k_CONTROLLER_AXIS_MAX, sizeof(__pyx_k_CONTROLLER_AXIS_MAX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_RIGHTX, __pyx_k_CONTROLLER_AXIS_RIGHTX, sizeof(__pyx_k_CONTROLLER_AXIS_RIGHTX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_RIGHTY, __pyx_k_CONTROLLER_AXIS_RIGHTY, sizeof(__pyx_k_CONTROLLER_AXIS_RIGHTY), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT, __pyx_k_CONTROLLER_AXIS_TRIGGERLEFT, sizeof(__pyx_k_CONTROLLER_AXIS_TRIGGERLEFT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT, __pyx_k_CONTROLLER_AXIS_TRIGGERRIGHT, sizeof(__pyx_k_CONTROLLER_AXIS_TRIGGERRIGHT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_A, __pyx_k_CONTROLLER_BUTTON_A, sizeof(__pyx_k_CONTROLLER_BUTTON_A), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_B, __pyx_k_CONTROLLER_BUTTON_B, sizeof(__pyx_k_CONTROLLER_BUTTON_B), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_BACK, __pyx_k_CONTROLLER_BUTTON_BACK, sizeof(__pyx_k_CONTROLLER_BUTTON_BACK), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN, __pyx_k_CONTROLLER_BUTTON_DPAD_DOWN, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT, __pyx_k_CONTROLLER_BUTTON_DPAD_LEFT, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT, __pyx_k_CONTROLLER_BUTTON_DPAD_RIGHT, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP, __pyx_k_CONTROLLER_BUTTON_DPAD_UP, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_UP), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_GUIDE, __pyx_k_CONTROLLER_BUTTON_GUIDE, sizeof(__pyx_k_CONTROLLER_BUTTON_GUIDE), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_INVALID, __pyx_k_CONTROLLER_BUTTON_INVALID, sizeof(__pyx_k_CONTROLLER_BUTTON_INVALID), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER, __pyx_k_CONTROLLER_BUTTON_LEFTSHOULDER, sizeof(__pyx_k_CONTROLLER_BUTTON_LEFTSHOULDER), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK, __pyx_k_CONTROLLER_BUTTON_LEFTSTICK, sizeof(__pyx_k_CONTROLLER_BUTTON_LEFTSTICK), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_MAX, __pyx_k_CONTROLLER_BUTTON_MAX, sizeof(__pyx_k_CONTROLLER_BUTTON_MAX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER, __pyx_k_CONTROLLER_BUTTON_RIGHTSHOULDER, sizeof(__pyx_k_CONTROLLER_BUTTON_RIGHTSHOULDER), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK, __pyx_k_CONTROLLER_BUTTON_RIGHTSTICK, sizeof(__pyx_k_CONTROLLER_BUTTON_RIGHTSTICK), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_START, __pyx_k_CONTROLLER_BUTTON_START, sizeof(__pyx_k_CONTROLLER_BUTTON_START), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_X, __pyx_k_CONTROLLER_BUTTON_X, sizeof(__pyx_k_CONTROLLER_BUTTON_X), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_Y, __pyx_k_CONTROLLER_BUTTON_Y, sizeof(__pyx_k_CONTROLLER_BUTTON_Y), 0, 0, 1, 1}, {&__pyx_n_s_Color, __pyx_k_Color, sizeof(__pyx_k_Color), 0, 0, 1, 1}, {&__pyx_n_s_DISPLAYEVENT, __pyx_k_DISPLAYEVENT, sizeof(__pyx_k_DISPLAYEVENT), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARGESTURE, __pyx_k_DOLLARGESTURE, sizeof(__pyx_k_DOLLARGESTURE), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARRECORD, __pyx_k_DOLLARRECORD, sizeof(__pyx_k_DOLLARRECORD), 0, 0, 1, 1}, {&__pyx_n_s_DOUBLEBUF, __pyx_k_DOUBLEBUF, sizeof(__pyx_k_DOUBLEBUF), 0, 0, 1, 1}, {&__pyx_n_s_DROPBEGIN, __pyx_k_DROPBEGIN, sizeof(__pyx_k_DROPBEGIN), 0, 0, 1, 1}, {&__pyx_n_s_DROPCOMPLETE, __pyx_k_DROPCOMPLETE, sizeof(__pyx_k_DROPCOMPLETE), 0, 0, 1, 1}, {&__pyx_n_s_DROPFILE, __pyx_k_DROPFILE, sizeof(__pyx_k_DROPFILE), 0, 0, 1, 1}, {&__pyx_n_s_DROPTEXT, __pyx_k_DROPTEXT, sizeof(__pyx_k_DROPTEXT), 0, 0, 1, 1}, {&__pyx_n_s_FINGERDOWN, __pyx_k_FINGERDOWN, sizeof(__pyx_k_FINGERDOWN), 0, 0, 1, 1}, {&__pyx_n_s_FINGERMOTION, __pyx_k_FINGERMOTION, sizeof(__pyx_k_FINGERMOTION), 0, 0, 1, 1}, {&__pyx_n_s_FINGERUP, __pyx_k_FINGERUP, sizeof(__pyx_k_FINGERUP), 0, 0, 1, 1}, {&__pyx_n_s_FULLSCREEN, __pyx_k_FULLSCREEN, sizeof(__pyx_k_FULLSCREEN), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCELERATED_VISUAL, __pyx_k_GL_ACCELERATED_VISUAL, sizeof(__pyx_k_GL_ACCELERATED_VISUAL), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_ALPHA_SIZE, __pyx_k_GL_ACCUM_ALPHA_SIZE, sizeof(__pyx_k_GL_ACCUM_ALPHA_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_BLUE_SIZE, __pyx_k_GL_ACCUM_BLUE_SIZE, sizeof(__pyx_k_GL_ACCUM_BLUE_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_GREEN_SIZE, __pyx_k_GL_ACCUM_GREEN_SIZE, sizeof(__pyx_k_GL_ACCUM_GREEN_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_RED_SIZE, __pyx_k_GL_ACCUM_RED_SIZE, sizeof(__pyx_k_GL_ACCUM_RED_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ALPHA_SIZE, __pyx_k_GL_ALPHA_SIZE, sizeof(__pyx_k_GL_ALPHA_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_BLUE_SIZE, __pyx_k_GL_BLUE_SIZE, sizeof(__pyx_k_GL_BLUE_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_BUFFER_SIZE, __pyx_k_GL_BUFFER_SIZE, sizeof(__pyx_k_GL_BUFFER_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_EGL, __pyx_k_GL_CONTEXT_EGL, sizeof(__pyx_k_GL_CONTEXT_EGL), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_FLAGS, __pyx_k_GL_CONTEXT_FLAGS, sizeof(__pyx_k_GL_CONTEXT_FLAGS), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_MAJOR_VERSION, __pyx_k_GL_CONTEXT_MAJOR_VERSION, sizeof(__pyx_k_GL_CONTEXT_MAJOR_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_MINOR_VERSION, __pyx_k_GL_CONTEXT_MINOR_VERSION, sizeof(__pyx_k_GL_CONTEXT_MINOR_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_NO_ERROR, __pyx_k_GL_CONTEXT_NO_ERROR, sizeof(__pyx_k_GL_CONTEXT_NO_ERROR), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY, __pyx_k_GL_CONTEXT_PROFILE_COMPATIBILITY, sizeof(__pyx_k_GL_CONTEXT_PROFILE_COMPATIBILITY), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_PROFILE_CORE, __pyx_k_GL_CONTEXT_PROFILE_CORE, sizeof(__pyx_k_GL_CONTEXT_PROFILE_CORE), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_PROFILE_ES, __pyx_k_GL_CONTEXT_PROFILE_ES, sizeof(__pyx_k_GL_CONTEXT_PROFILE_ES), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_PROFILE_MASK, __pyx_k_GL_CONTEXT_PROFILE_MASK, sizeof(__pyx_k_GL_CONTEXT_PROFILE_MASK), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR, __pyx_k_GL_CONTEXT_RELEASE_BEHAVIOR, sizeof(__pyx_k_GL_CONTEXT_RELEASE_BEHAVIOR), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION, __pyx_k_GL_CONTEXT_RESET_NOTIFICATION, sizeof(__pyx_k_GL_CONTEXT_RESET_NOTIFICATION), 0, 0, 1, 1}, {&__pyx_n_s_GL_DEPTH_SIZE, __pyx_k_GL_DEPTH_SIZE, sizeof(__pyx_k_GL_DEPTH_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_DOUBLEBUFFER, __pyx_k_GL_DOUBLEBUFFER, sizeof(__pyx_k_GL_DOUBLEBUFFER), 0, 0, 1, 1}, {&__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE, __pyx_k_GL_FRAMEBUFFER_SRGB_CAPABLE, sizeof(__pyx_k_GL_FRAMEBUFFER_SRGB_CAPABLE), 0, 0, 1, 1}, {&__pyx_n_s_GL_GREEN_SIZE, __pyx_k_GL_GREEN_SIZE, sizeof(__pyx_k_GL_GREEN_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_MULTISAMPLEBUFFERS, __pyx_k_GL_MULTISAMPLEBUFFERS, sizeof(__pyx_k_GL_MULTISAMPLEBUFFERS), 0, 0, 1, 1}, {&__pyx_n_s_GL_MULTISAMPLESAMPLES, __pyx_k_GL_MULTISAMPLESAMPLES, sizeof(__pyx_k_GL_MULTISAMPLESAMPLES), 0, 0, 1, 1}, {&__pyx_n_s_GL_RED_SIZE, __pyx_k_GL_RED_SIZE, sizeof(__pyx_k_GL_RED_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_RETAINED_BACKING, __pyx_k_GL_RETAINED_BACKING, sizeof(__pyx_k_GL_RETAINED_BACKING), 0, 0, 1, 1}, {&__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT, __pyx_k_GL_SHARE_WITH_CURRENT_CONTEXT, sizeof(__pyx_k_GL_SHARE_WITH_CURRENT_CONTEXT), 0, 0, 1, 1}, {&__pyx_n_s_GL_STENCIL_SIZE, __pyx_k_GL_STENCIL_SIZE, sizeof(__pyx_k_GL_STENCIL_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_STEREO, __pyx_k_GL_STEREO, sizeof(__pyx_k_GL_STEREO), 0, 0, 1, 1}, {&__pyx_n_s_GL_SWAP_CONTROL, __pyx_k_GL_SWAP_CONTROL, sizeof(__pyx_k_GL_SWAP_CONTROL), 0, 0, 1, 1}, {&__pyx_n_s_HWSURFACE, __pyx_k_HWSURFACE, sizeof(__pyx_k_HWSURFACE), 0, 0, 1, 1}, {&__pyx_n_s_JOYAXISMOTION, __pyx_k_JOYAXISMOTION, sizeof(__pyx_k_JOYAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBALLMOTION, __pyx_k_JOYBALLMOTION, sizeof(__pyx_k_JOYBALLMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONDOWN, __pyx_k_JOYBUTTONDOWN, sizeof(__pyx_k_JOYBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONUP, __pyx_k_JOYBUTTONUP, sizeof(__pyx_k_JOYBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEADDED, __pyx_k_JOYDEVICEADDED, sizeof(__pyx_k_JOYDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEREMOVED, __pyx_k_JOYDEVICEREMOVED, sizeof(__pyx_k_JOYDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_JOYHATMOTION, __pyx_k_JOYHATMOTION, sizeof(__pyx_k_JOYHATMOTION), 0, 0, 1, 1}, {&__pyx_n_s_KEYDOWN, __pyx_k_KEYDOWN, sizeof(__pyx_k_KEYDOWN), 0, 0, 1, 1}, {&__pyx_n_s_KEYMAPCHANGED, __pyx_k_KEYMAPCHANGED, sizeof(__pyx_k_KEYMAPCHANGED), 0, 0, 1, 1}, {&__pyx_n_s_KEYUP, __pyx_k_KEYUP, sizeof(__pyx_k_KEYUP), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_ALT, __pyx_k_KMOD_ALT, sizeof(__pyx_k_KMOD_ALT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_CAPS, __pyx_k_KMOD_CAPS, sizeof(__pyx_k_KMOD_CAPS), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_CTRL, __pyx_k_KMOD_CTRL, sizeof(__pyx_k_KMOD_CTRL), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_GUI, __pyx_k_KMOD_GUI, sizeof(__pyx_k_KMOD_GUI), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LALT, __pyx_k_KMOD_LALT, sizeof(__pyx_k_KMOD_LALT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LCTRL, __pyx_k_KMOD_LCTRL, sizeof(__pyx_k_KMOD_LCTRL), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LGUI, __pyx_k_KMOD_LGUI, sizeof(__pyx_k_KMOD_LGUI), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LMETA, __pyx_k_KMOD_LMETA, sizeof(__pyx_k_KMOD_LMETA), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LSHIFT, __pyx_k_KMOD_LSHIFT, sizeof(__pyx_k_KMOD_LSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_META, __pyx_k_KMOD_META, sizeof(__pyx_k_KMOD_META), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_MODE, __pyx_k_KMOD_MODE, sizeof(__pyx_k_KMOD_MODE), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_NONE, __pyx_k_KMOD_NONE, sizeof(__pyx_k_KMOD_NONE), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_NUM, __pyx_k_KMOD_NUM, sizeof(__pyx_k_KMOD_NUM), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RALT, __pyx_k_KMOD_RALT, sizeof(__pyx_k_KMOD_RALT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RCTRL, __pyx_k_KMOD_RCTRL, sizeof(__pyx_k_KMOD_RCTRL), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RGUI, __pyx_k_KMOD_RGUI, sizeof(__pyx_k_KMOD_RGUI), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RMETA, __pyx_k_KMOD_RMETA, sizeof(__pyx_k_KMOD_RMETA), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RSHIFT, __pyx_k_KMOD_RSHIFT, sizeof(__pyx_k_KMOD_RSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_SHIFT, __pyx_k_KMOD_SHIFT, sizeof(__pyx_k_KMOD_SHIFT), 0, 0, 1, 1}, {&__pyx_n_s_K_0, __pyx_k_K_0, sizeof(__pyx_k_K_0), 0, 0, 1, 1}, {&__pyx_n_s_K_1, __pyx_k_K_1, sizeof(__pyx_k_K_1), 0, 0, 1, 1}, {&__pyx_n_s_K_2, __pyx_k_K_2, sizeof(__pyx_k_K_2), 0, 0, 1, 1}, {&__pyx_n_s_K_3, __pyx_k_K_3, sizeof(__pyx_k_K_3), 0, 0, 1, 1}, {&__pyx_n_s_K_4, __pyx_k_K_4, sizeof(__pyx_k_K_4), 0, 0, 1, 1}, {&__pyx_n_s_K_5, __pyx_k_K_5, sizeof(__pyx_k_K_5), 0, 0, 1, 1}, {&__pyx_n_s_K_6, __pyx_k_K_6, sizeof(__pyx_k_K_6), 0, 0, 1, 1}, {&__pyx_n_s_K_7, __pyx_k_K_7, sizeof(__pyx_k_K_7), 0, 0, 1, 1}, {&__pyx_n_s_K_8, __pyx_k_K_8, sizeof(__pyx_k_K_8), 0, 0, 1, 1}, {&__pyx_n_s_K_9, __pyx_k_K_9, sizeof(__pyx_k_K_9), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_BACK, __pyx_k_K_AC_BACK, sizeof(__pyx_k_K_AC_BACK), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_BOOKMARKS, __pyx_k_K_AC_BOOKMARKS, sizeof(__pyx_k_K_AC_BOOKMARKS), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_FORWARD, __pyx_k_K_AC_FORWARD, sizeof(__pyx_k_K_AC_FORWARD), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_HOME, __pyx_k_K_AC_HOME, sizeof(__pyx_k_K_AC_HOME), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_REFRESH, __pyx_k_K_AC_REFRESH, sizeof(__pyx_k_K_AC_REFRESH), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_SEARCH, __pyx_k_K_AC_SEARCH, sizeof(__pyx_k_K_AC_SEARCH), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_STOP, __pyx_k_K_AC_STOP, sizeof(__pyx_k_K_AC_STOP), 0, 0, 1, 1}, {&__pyx_n_s_K_AGAIN, __pyx_k_K_AGAIN, sizeof(__pyx_k_K_AGAIN), 0, 0, 1, 1}, {&__pyx_n_s_K_ALTERASE, __pyx_k_K_ALTERASE, sizeof(__pyx_k_K_ALTERASE), 0, 0, 1, 1}, {&__pyx_n_s_K_AMPERSAND, __pyx_k_K_AMPERSAND, sizeof(__pyx_k_K_AMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_K_APP1, __pyx_k_K_APP1, sizeof(__pyx_k_K_APP1), 0, 0, 1, 1}, {&__pyx_n_s_K_APP2, __pyx_k_K_APP2, sizeof(__pyx_k_K_APP2), 0, 0, 1, 1}, {&__pyx_n_s_K_APPLICATION, __pyx_k_K_APPLICATION, sizeof(__pyx_k_K_APPLICATION), 0, 0, 1, 1}, {&__pyx_n_s_K_ASTERISK, __pyx_k_K_ASTERISK, sizeof(__pyx_k_K_ASTERISK), 0, 0, 1, 1}, {&__pyx_n_s_K_AT, __pyx_k_K_AT, sizeof(__pyx_k_K_AT), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOFASTFORWARD, __pyx_k_K_AUDIOFASTFORWARD, sizeof(__pyx_k_K_AUDIOFASTFORWARD), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOMUTE, __pyx_k_K_AUDIOMUTE, sizeof(__pyx_k_K_AUDIOMUTE), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIONEXT, __pyx_k_K_AUDIONEXT, sizeof(__pyx_k_K_AUDIONEXT), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOPLAY, __pyx_k_K_AUDIOPLAY, sizeof(__pyx_k_K_AUDIOPLAY), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOPREV, __pyx_k_K_AUDIOPREV, sizeof(__pyx_k_K_AUDIOPREV), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOREWIND, __pyx_k_K_AUDIOREWIND, sizeof(__pyx_k_K_AUDIOREWIND), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOSTOP, __pyx_k_K_AUDIOSTOP, sizeof(__pyx_k_K_AUDIOSTOP), 0, 0, 1, 1}, {&__pyx_n_s_K_BACKQUOTE, __pyx_k_K_BACKQUOTE, sizeof(__pyx_k_K_BACKQUOTE), 0, 0, 1, 1}, {&__pyx_n_s_K_BACKSLASH, __pyx_k_K_BACKSLASH, sizeof(__pyx_k_K_BACKSLASH), 0, 0, 1, 1}, {&__pyx_n_s_K_BACKSPACE, __pyx_k_K_BACKSPACE, sizeof(__pyx_k_K_BACKSPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_BREAK, __pyx_k_K_BREAK, sizeof(__pyx_k_K_BREAK), 0, 0, 1, 1}, {&__pyx_n_s_K_BRIGHTNESSDOWN, __pyx_k_K_BRIGHTNESSDOWN, sizeof(__pyx_k_K_BRIGHTNESSDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_BRIGHTNESSUP, __pyx_k_K_BRIGHTNESSUP, sizeof(__pyx_k_K_BRIGHTNESSUP), 0, 0, 1, 1}, {&__pyx_n_s_K_CALCULATOR, __pyx_k_K_CALCULATOR, sizeof(__pyx_k_K_CALCULATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_CANCEL, __pyx_k_K_CANCEL, sizeof(__pyx_k_K_CANCEL), 0, 0, 1, 1}, {&__pyx_n_s_K_CAPSLOCK, __pyx_k_K_CAPSLOCK, sizeof(__pyx_k_K_CAPSLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_CARET, __pyx_k_K_CARET, sizeof(__pyx_k_K_CARET), 0, 0, 1, 1}, {&__pyx_n_s_K_CLEAR, __pyx_k_K_CLEAR, sizeof(__pyx_k_K_CLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_CLEARAGAIN, __pyx_k_K_CLEARAGAIN, sizeof(__pyx_k_K_CLEARAGAIN), 0, 0, 1, 1}, {&__pyx_n_s_K_COLON, __pyx_k_K_COLON, sizeof(__pyx_k_K_COLON), 0, 0, 1, 1}, {&__pyx_n_s_K_COMMA, __pyx_k_K_COMMA, sizeof(__pyx_k_K_COMMA), 0, 0, 1, 1}, {&__pyx_n_s_K_COMPUTER, __pyx_k_K_COMPUTER, sizeof(__pyx_k_K_COMPUTER), 0, 0, 1, 1}, {&__pyx_n_s_K_COPY, __pyx_k_K_COPY, sizeof(__pyx_k_K_COPY), 0, 0, 1, 1}, {&__pyx_n_s_K_CRSEL, __pyx_k_K_CRSEL, sizeof(__pyx_k_K_CRSEL), 0, 0, 1, 1}, {&__pyx_n_s_K_CURRENCYSUBUNIT, __pyx_k_K_CURRENCYSUBUNIT, sizeof(__pyx_k_K_CURRENCYSUBUNIT), 0, 0, 1, 1}, {&__pyx_n_s_K_CURRENCYUNIT, __pyx_k_K_CURRENCYUNIT, sizeof(__pyx_k_K_CURRENCYUNIT), 0, 0, 1, 1}, {&__pyx_n_s_K_CUT, __pyx_k_K_CUT, sizeof(__pyx_k_K_CUT), 0, 0, 1, 1}, {&__pyx_n_s_K_DECIMALSEPARATOR, __pyx_k_K_DECIMALSEPARATOR, sizeof(__pyx_k_K_DECIMALSEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_DELETE, __pyx_k_K_DELETE, sizeof(__pyx_k_K_DELETE), 0, 0, 1, 1}, {&__pyx_n_s_K_DISPLAYSWITCH, __pyx_k_K_DISPLAYSWITCH, sizeof(__pyx_k_K_DISPLAYSWITCH), 0, 0, 1, 1}, {&__pyx_n_s_K_DOLLAR, __pyx_k_K_DOLLAR, sizeof(__pyx_k_K_DOLLAR), 0, 0, 1, 1}, {&__pyx_n_s_K_DOWN, __pyx_k_K_DOWN, sizeof(__pyx_k_K_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_EJECT, __pyx_k_K_EJECT, sizeof(__pyx_k_K_EJECT), 0, 0, 1, 1}, {&__pyx_n_s_K_END, __pyx_k_K_END, sizeof(__pyx_k_K_END), 0, 0, 1, 1}, {&__pyx_n_s_K_EQUALS, __pyx_k_K_EQUALS, sizeof(__pyx_k_K_EQUALS), 0, 0, 1, 1}, {&__pyx_n_s_K_ESCAPE, __pyx_k_K_ESCAPE, sizeof(__pyx_k_K_ESCAPE), 0, 0, 1, 1}, {&__pyx_n_s_K_EURO, __pyx_k_K_EURO, sizeof(__pyx_k_K_EURO), 0, 0, 1, 1}, {&__pyx_n_s_K_EXCLAIM, __pyx_k_K_EXCLAIM, sizeof(__pyx_k_K_EXCLAIM), 0, 0, 1, 1}, {&__pyx_n_s_K_EXECUTE, __pyx_k_K_EXECUTE, sizeof(__pyx_k_K_EXECUTE), 0, 0, 1, 1}, {&__pyx_n_s_K_EXSEL, __pyx_k_K_EXSEL, sizeof(__pyx_k_K_EXSEL), 0, 0, 1, 1}, {&__pyx_n_s_K_F1, __pyx_k_K_F1, sizeof(__pyx_k_K_F1), 0, 0, 1, 1}, {&__pyx_n_s_K_F10, __pyx_k_K_F10, sizeof(__pyx_k_K_F10), 0, 0, 1, 1}, {&__pyx_n_s_K_F11, __pyx_k_K_F11, sizeof(__pyx_k_K_F11), 0, 0, 1, 1}, {&__pyx_n_s_K_F12, __pyx_k_K_F12, sizeof(__pyx_k_K_F12), 0, 0, 1, 1}, {&__pyx_n_s_K_F13, __pyx_k_K_F13, sizeof(__pyx_k_K_F13), 0, 0, 1, 1}, {&__pyx_n_s_K_F14, __pyx_k_K_F14, sizeof(__pyx_k_K_F14), 0, 0, 1, 1}, {&__pyx_n_s_K_F15, __pyx_k_K_F15, sizeof(__pyx_k_K_F15), 0, 0, 1, 1}, {&__pyx_n_s_K_F16, __pyx_k_K_F16, sizeof(__pyx_k_K_F16), 0, 0, 1, 1}, {&__pyx_n_s_K_F17, __pyx_k_K_F17, sizeof(__pyx_k_K_F17), 0, 0, 1, 1}, {&__pyx_n_s_K_F18, __pyx_k_K_F18, sizeof(__pyx_k_K_F18), 0, 0, 1, 1}, {&__pyx_n_s_K_F19, __pyx_k_K_F19, sizeof(__pyx_k_K_F19), 0, 0, 1, 1}, {&__pyx_n_s_K_F2, __pyx_k_K_F2, sizeof(__pyx_k_K_F2), 0, 0, 1, 1}, {&__pyx_n_s_K_F20, __pyx_k_K_F20, sizeof(__pyx_k_K_F20), 0, 0, 1, 1}, {&__pyx_n_s_K_F21, __pyx_k_K_F21, sizeof(__pyx_k_K_F21), 0, 0, 1, 1}, {&__pyx_n_s_K_F22, __pyx_k_K_F22, sizeof(__pyx_k_K_F22), 0, 0, 1, 1}, {&__pyx_n_s_K_F23, __pyx_k_K_F23, sizeof(__pyx_k_K_F23), 0, 0, 1, 1}, {&__pyx_n_s_K_F24, __pyx_k_K_F24, sizeof(__pyx_k_K_F24), 0, 0, 1, 1}, {&__pyx_n_s_K_F3, __pyx_k_K_F3, sizeof(__pyx_k_K_F3), 0, 0, 1, 1}, {&__pyx_n_s_K_F4, __pyx_k_K_F4, sizeof(__pyx_k_K_F4), 0, 0, 1, 1}, {&__pyx_n_s_K_F5, __pyx_k_K_F5, sizeof(__pyx_k_K_F5), 0, 0, 1, 1}, {&__pyx_n_s_K_F6, __pyx_k_K_F6, sizeof(__pyx_k_K_F6), 0, 0, 1, 1}, {&__pyx_n_s_K_F7, __pyx_k_K_F7, sizeof(__pyx_k_K_F7), 0, 0, 1, 1}, {&__pyx_n_s_K_F8, __pyx_k_K_F8, sizeof(__pyx_k_K_F8), 0, 0, 1, 1}, {&__pyx_n_s_K_F9, __pyx_k_K_F9, sizeof(__pyx_k_K_F9), 0, 0, 1, 1}, {&__pyx_n_s_K_FIND, __pyx_k_K_FIND, sizeof(__pyx_k_K_FIND), 0, 0, 1, 1}, {&__pyx_n_s_K_FIRST, __pyx_k_K_FIRST, sizeof(__pyx_k_K_FIRST), 0, 0, 1, 1}, {&__pyx_n_s_K_GREATER, __pyx_k_K_GREATER, sizeof(__pyx_k_K_GREATER), 0, 0, 1, 1}, {&__pyx_n_s_K_HASH, __pyx_k_K_HASH, sizeof(__pyx_k_K_HASH), 0, 0, 1, 1}, {&__pyx_n_s_K_HELP, __pyx_k_K_HELP, sizeof(__pyx_k_K_HELP), 0, 0, 1, 1}, {&__pyx_n_s_K_HOME, __pyx_k_K_HOME, sizeof(__pyx_k_K_HOME), 0, 0, 1, 1}, {&__pyx_n_s_K_INSERT, __pyx_k_K_INSERT, sizeof(__pyx_k_K_INSERT), 0, 0, 1, 1}, {&__pyx_n_s_K_KBDILLUMDOWN, __pyx_k_K_KBDILLUMDOWN, sizeof(__pyx_k_K_KBDILLUMDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_KBDILLUMTOGGLE, __pyx_k_K_KBDILLUMTOGGLE, sizeof(__pyx_k_K_KBDILLUMTOGGLE), 0, 0, 1, 1}, {&__pyx_n_s_K_KBDILLUMUP, __pyx_k_K_KBDILLUMUP, sizeof(__pyx_k_K_KBDILLUMUP), 0, 0, 1, 1}, {&__pyx_n_s_K_KP0, __pyx_k_K_KP0, sizeof(__pyx_k_K_KP0), 0, 0, 1, 1}, {&__pyx_n_s_K_KP1, __pyx_k_K_KP1, sizeof(__pyx_k_K_KP1), 0, 0, 1, 1}, {&__pyx_n_s_K_KP2, __pyx_k_K_KP2, sizeof(__pyx_k_K_KP2), 0, 0, 1, 1}, {&__pyx_n_s_K_KP3, __pyx_k_K_KP3, sizeof(__pyx_k_K_KP3), 0, 0, 1, 1}, {&__pyx_n_s_K_KP4, __pyx_k_K_KP4, sizeof(__pyx_k_K_KP4), 0, 0, 1, 1}, {&__pyx_n_s_K_KP5, __pyx_k_K_KP5, sizeof(__pyx_k_K_KP5), 0, 0, 1, 1}, {&__pyx_n_s_K_KP6, __pyx_k_K_KP6, sizeof(__pyx_k_K_KP6), 0, 0, 1, 1}, {&__pyx_n_s_K_KP7, __pyx_k_K_KP7, sizeof(__pyx_k_K_KP7), 0, 0, 1, 1}, {&__pyx_n_s_K_KP8, __pyx_k_K_KP8, sizeof(__pyx_k_K_KP8), 0, 0, 1, 1}, {&__pyx_n_s_K_KP9, __pyx_k_K_KP9, sizeof(__pyx_k_K_KP9), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_0, __pyx_k_K_KP_0, sizeof(__pyx_k_K_KP_0), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_00, __pyx_k_K_KP_00, sizeof(__pyx_k_K_KP_00), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_000, __pyx_k_K_KP_000, sizeof(__pyx_k_K_KP_000), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_1, __pyx_k_K_KP_1, sizeof(__pyx_k_K_KP_1), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_2, __pyx_k_K_KP_2, sizeof(__pyx_k_K_KP_2), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_3, __pyx_k_K_KP_3, sizeof(__pyx_k_K_KP_3), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_4, __pyx_k_K_KP_4, sizeof(__pyx_k_K_KP_4), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_5, __pyx_k_K_KP_5, sizeof(__pyx_k_K_KP_5), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_6, __pyx_k_K_KP_6, sizeof(__pyx_k_K_KP_6), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_7, __pyx_k_K_KP_7, sizeof(__pyx_k_K_KP_7), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_8, __pyx_k_K_KP_8, sizeof(__pyx_k_K_KP_8), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_9, __pyx_k_K_KP_9, sizeof(__pyx_k_K_KP_9), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_A, __pyx_k_K_KP_A, sizeof(__pyx_k_K_KP_A), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_AMPERSAND, __pyx_k_K_KP_AMPERSAND, sizeof(__pyx_k_K_KP_AMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_AT, __pyx_k_K_KP_AT, sizeof(__pyx_k_K_KP_AT), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_B, __pyx_k_K_KP_B, sizeof(__pyx_k_K_KP_B), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_BACKSPACE, __pyx_k_K_KP_BACKSPACE, sizeof(__pyx_k_K_KP_BACKSPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_BINARY, __pyx_k_K_KP_BINARY, sizeof(__pyx_k_K_KP_BINARY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_C, __pyx_k_K_KP_C, sizeof(__pyx_k_K_KP_C), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_CLEAR, __pyx_k_K_KP_CLEAR, sizeof(__pyx_k_K_KP_CLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_CLEARENTRY, __pyx_k_K_KP_CLEARENTRY, sizeof(__pyx_k_K_KP_CLEARENTRY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_COLON, __pyx_k_K_KP_COLON, sizeof(__pyx_k_K_KP_COLON), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_COMMA, __pyx_k_K_KP_COMMA, sizeof(__pyx_k_K_KP_COMMA), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_D, __pyx_k_K_KP_D, sizeof(__pyx_k_K_KP_D), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DBLAMPERSAND, __pyx_k_K_KP_DBLAMPERSAND, sizeof(__pyx_k_K_KP_DBLAMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DBLVERTICALBAR, __pyx_k_K_KP_DBLVERTICALBAR, sizeof(__pyx_k_K_KP_DBLVERTICALBAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DECIMAL, __pyx_k_K_KP_DECIMAL, sizeof(__pyx_k_K_KP_DECIMAL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DIVIDE, __pyx_k_K_KP_DIVIDE, sizeof(__pyx_k_K_KP_DIVIDE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_E, __pyx_k_K_KP_E, sizeof(__pyx_k_K_KP_E), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_ENTER, __pyx_k_K_KP_ENTER, sizeof(__pyx_k_K_KP_ENTER), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_EQUALS, __pyx_k_K_KP_EQUALS, sizeof(__pyx_k_K_KP_EQUALS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_EQUALSAS400, __pyx_k_K_KP_EQUALSAS400, sizeof(__pyx_k_K_KP_EQUALSAS400), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_EXCLAM, __pyx_k_K_KP_EXCLAM, sizeof(__pyx_k_K_KP_EXCLAM), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_F, __pyx_k_K_KP_F, sizeof(__pyx_k_K_KP_F), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_GREATER, __pyx_k_K_KP_GREATER, sizeof(__pyx_k_K_KP_GREATER), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_HASH, __pyx_k_K_KP_HASH, sizeof(__pyx_k_K_KP_HASH), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_HEXADECIMAL, __pyx_k_K_KP_HEXADECIMAL, sizeof(__pyx_k_K_KP_HEXADECIMAL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_LEFTBRACE, __pyx_k_K_KP_LEFTBRACE, sizeof(__pyx_k_K_KP_LEFTBRACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_LEFTPAREN, __pyx_k_K_KP_LEFTPAREN, sizeof(__pyx_k_K_KP_LEFTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_LESS, __pyx_k_K_KP_LESS, sizeof(__pyx_k_K_KP_LESS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMADD, __pyx_k_K_KP_MEMADD, sizeof(__pyx_k_K_KP_MEMADD), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMCLEAR, __pyx_k_K_KP_MEMCLEAR, sizeof(__pyx_k_K_KP_MEMCLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMDIVIDE, __pyx_k_K_KP_MEMDIVIDE, sizeof(__pyx_k_K_KP_MEMDIVIDE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMMULTIPLY, __pyx_k_K_KP_MEMMULTIPLY, sizeof(__pyx_k_K_KP_MEMMULTIPLY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMRECALL, __pyx_k_K_KP_MEMRECALL, sizeof(__pyx_k_K_KP_MEMRECALL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMSTORE, __pyx_k_K_KP_MEMSTORE, sizeof(__pyx_k_K_KP_MEMSTORE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMSUBTRACT, __pyx_k_K_KP_MEMSUBTRACT, sizeof(__pyx_k_K_KP_MEMSUBTRACT), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MINUS, __pyx_k_K_KP_MINUS, sizeof(__pyx_k_K_KP_MINUS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MULTIPLY, __pyx_k_K_KP_MULTIPLY, sizeof(__pyx_k_K_KP_MULTIPLY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_OCTAL, __pyx_k_K_KP_OCTAL, sizeof(__pyx_k_K_KP_OCTAL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PERCENT, __pyx_k_K_KP_PERCENT, sizeof(__pyx_k_K_KP_PERCENT), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PERIOD, __pyx_k_K_KP_PERIOD, sizeof(__pyx_k_K_KP_PERIOD), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PLUS, __pyx_k_K_KP_PLUS, sizeof(__pyx_k_K_KP_PLUS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PLUSMINUS, __pyx_k_K_KP_PLUSMINUS, sizeof(__pyx_k_K_KP_PLUSMINUS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_POWER, __pyx_k_K_KP_POWER, sizeof(__pyx_k_K_KP_POWER), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_RIGHTBRACE, __pyx_k_K_KP_RIGHTBRACE, sizeof(__pyx_k_K_KP_RIGHTBRACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_RIGHTPAREN, __pyx_k_K_KP_RIGHTPAREN, sizeof(__pyx_k_K_KP_RIGHTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_SPACE, __pyx_k_K_KP_SPACE, sizeof(__pyx_k_K_KP_SPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_TAB, __pyx_k_K_KP_TAB, sizeof(__pyx_k_K_KP_TAB), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_VERTICALBAR, __pyx_k_K_KP_VERTICALBAR, sizeof(__pyx_k_K_KP_VERTICALBAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_XOR, __pyx_k_K_KP_XOR, sizeof(__pyx_k_K_KP_XOR), 0, 0, 1, 1}, {&__pyx_n_s_K_LALT, __pyx_k_K_LALT, sizeof(__pyx_k_K_LALT), 0, 0, 1, 1}, {&__pyx_n_s_K_LAST, __pyx_k_K_LAST, sizeof(__pyx_k_K_LAST), 0, 0, 1, 1}, {&__pyx_n_s_K_LCTRL, __pyx_k_K_LCTRL, sizeof(__pyx_k_K_LCTRL), 0, 0, 1, 1}, {&__pyx_n_s_K_LEFT, __pyx_k_K_LEFT, sizeof(__pyx_k_K_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_K_LEFTBRACKET, __pyx_k_K_LEFTBRACKET, sizeof(__pyx_k_K_LEFTBRACKET), 0, 0, 1, 1}, {&__pyx_n_s_K_LEFTPAREN, __pyx_k_K_LEFTPAREN, sizeof(__pyx_k_K_LEFTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_LESS, __pyx_k_K_LESS, sizeof(__pyx_k_K_LESS), 0, 0, 1, 1}, {&__pyx_n_s_K_LGUI, __pyx_k_K_LGUI, sizeof(__pyx_k_K_LGUI), 0, 0, 1, 1}, {&__pyx_n_s_K_LMETA, __pyx_k_K_LMETA, sizeof(__pyx_k_K_LMETA), 0, 0, 1, 1}, {&__pyx_n_s_K_LSHIFT, __pyx_k_K_LSHIFT, sizeof(__pyx_k_K_LSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_K_LSUPER, __pyx_k_K_LSUPER, sizeof(__pyx_k_K_LSUPER), 0, 0, 1, 1}, {&__pyx_n_s_K_MAIL, __pyx_k_K_MAIL, sizeof(__pyx_k_K_MAIL), 0, 0, 1, 1}, {&__pyx_n_s_K_MEDIASELECT, __pyx_k_K_MEDIASELECT, sizeof(__pyx_k_K_MEDIASELECT), 0, 0, 1, 1}, {&__pyx_n_s_K_MENU, __pyx_k_K_MENU, sizeof(__pyx_k_K_MENU), 0, 0, 1, 1}, {&__pyx_n_s_K_MINUS, __pyx_k_K_MINUS, sizeof(__pyx_k_K_MINUS), 0, 0, 1, 1}, {&__pyx_n_s_K_MODE, __pyx_k_K_MODE, sizeof(__pyx_k_K_MODE), 0, 0, 1, 1}, {&__pyx_n_s_K_MUTE, __pyx_k_K_MUTE, sizeof(__pyx_k_K_MUTE), 0, 0, 1, 1}, {&__pyx_n_s_K_NUMLOCK, __pyx_k_K_NUMLOCK, sizeof(__pyx_k_K_NUMLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_NUMLOCKCLEAR, __pyx_k_K_NUMLOCKCLEAR, sizeof(__pyx_k_K_NUMLOCKCLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_OPER, __pyx_k_K_OPER, sizeof(__pyx_k_K_OPER), 0, 0, 1, 1}, {&__pyx_n_s_K_OUT, __pyx_k_K_OUT, sizeof(__pyx_k_K_OUT), 0, 0, 1, 1}, {&__pyx_n_s_K_PAGEDOWN, __pyx_k_K_PAGEDOWN, sizeof(__pyx_k_K_PAGEDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_PAGEUP, __pyx_k_K_PAGEUP, sizeof(__pyx_k_K_PAGEUP), 0, 0, 1, 1}, {&__pyx_n_s_K_PASTE, __pyx_k_K_PASTE, sizeof(__pyx_k_K_PASTE), 0, 0, 1, 1}, {&__pyx_n_s_K_PAUSE, __pyx_k_K_PAUSE, sizeof(__pyx_k_K_PAUSE), 0, 0, 1, 1}, {&__pyx_n_s_K_PERCENT, __pyx_k_K_PERCENT, sizeof(__pyx_k_K_PERCENT), 0, 0, 1, 1}, {&__pyx_n_s_K_PERIOD, __pyx_k_K_PERIOD, sizeof(__pyx_k_K_PERIOD), 0, 0, 1, 1}, {&__pyx_n_s_K_PLUS, __pyx_k_K_PLUS, sizeof(__pyx_k_K_PLUS), 0, 0, 1, 1}, {&__pyx_n_s_K_POWER, __pyx_k_K_POWER, sizeof(__pyx_k_K_POWER), 0, 0, 1, 1}, {&__pyx_n_s_K_PRINT, __pyx_k_K_PRINT, sizeof(__pyx_k_K_PRINT), 0, 0, 1, 1}, {&__pyx_n_s_K_PRINTSCREEN, __pyx_k_K_PRINTSCREEN, sizeof(__pyx_k_K_PRINTSCREEN), 0, 0, 1, 1}, {&__pyx_n_s_K_PRIOR, __pyx_k_K_PRIOR, sizeof(__pyx_k_K_PRIOR), 0, 0, 1, 1}, {&__pyx_n_s_K_QUESTION, __pyx_k_K_QUESTION, sizeof(__pyx_k_K_QUESTION), 0, 0, 1, 1}, {&__pyx_n_s_K_QUOTE, __pyx_k_K_QUOTE, sizeof(__pyx_k_K_QUOTE), 0, 0, 1, 1}, {&__pyx_n_s_K_QUOTEDBL, __pyx_k_K_QUOTEDBL, sizeof(__pyx_k_K_QUOTEDBL), 0, 0, 1, 1}, {&__pyx_n_s_K_RALT, __pyx_k_K_RALT, sizeof(__pyx_k_K_RALT), 0, 0, 1, 1}, {&__pyx_n_s_K_RCTRL, __pyx_k_K_RCTRL, sizeof(__pyx_k_K_RCTRL), 0, 0, 1, 1}, {&__pyx_n_s_K_RETURN, __pyx_k_K_RETURN, sizeof(__pyx_k_K_RETURN), 0, 0, 1, 1}, {&__pyx_n_s_K_RETURN2, __pyx_k_K_RETURN2, sizeof(__pyx_k_K_RETURN2), 0, 0, 1, 1}, {&__pyx_n_s_K_RGUI, __pyx_k_K_RGUI, sizeof(__pyx_k_K_RGUI), 0, 0, 1, 1}, {&__pyx_n_s_K_RIGHT, __pyx_k_K_RIGHT, sizeof(__pyx_k_K_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_K_RIGHTBRACKET, __pyx_k_K_RIGHTBRACKET, sizeof(__pyx_k_K_RIGHTBRACKET), 0, 0, 1, 1}, {&__pyx_n_s_K_RIGHTPAREN, __pyx_k_K_RIGHTPAREN, sizeof(__pyx_k_K_RIGHTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_RMETA, __pyx_k_K_RMETA, sizeof(__pyx_k_K_RMETA), 0, 0, 1, 1}, {&__pyx_n_s_K_RSHIFT, __pyx_k_K_RSHIFT, sizeof(__pyx_k_K_RSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_K_RSUPER, __pyx_k_K_RSUPER, sizeof(__pyx_k_K_RSUPER), 0, 0, 1, 1}, {&__pyx_n_s_K_SCROLLLOCK, __pyx_k_K_SCROLLLOCK, sizeof(__pyx_k_K_SCROLLLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_SCROLLOCK, __pyx_k_K_SCROLLOCK, sizeof(__pyx_k_K_SCROLLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_SELECT, __pyx_k_K_SELECT, sizeof(__pyx_k_K_SELECT), 0, 0, 1, 1}, {&__pyx_n_s_K_SEMICOLON, __pyx_k_K_SEMICOLON, sizeof(__pyx_k_K_SEMICOLON), 0, 0, 1, 1}, {&__pyx_n_s_K_SEPARATOR, __pyx_k_K_SEPARATOR, sizeof(__pyx_k_K_SEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_SLASH, __pyx_k_K_SLASH, sizeof(__pyx_k_K_SLASH), 0, 0, 1, 1}, {&__pyx_n_s_K_SLEEP, __pyx_k_K_SLEEP, sizeof(__pyx_k_K_SLEEP), 0, 0, 1, 1}, {&__pyx_n_s_K_SPACE, __pyx_k_K_SPACE, sizeof(__pyx_k_K_SPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_STOP, __pyx_k_K_STOP, sizeof(__pyx_k_K_STOP), 0, 0, 1, 1}, {&__pyx_n_s_K_SYSREQ, __pyx_k_K_SYSREQ, sizeof(__pyx_k_K_SYSREQ), 0, 0, 1, 1}, {&__pyx_n_s_K_TAB, __pyx_k_K_TAB, sizeof(__pyx_k_K_TAB), 0, 0, 1, 1}, {&__pyx_n_s_K_THOUSANDSSEPARATOR, __pyx_k_K_THOUSANDSSEPARATOR, sizeof(__pyx_k_K_THOUSANDSSEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_UNDERSCORE, __pyx_k_K_UNDERSCORE, sizeof(__pyx_k_K_UNDERSCORE), 0, 0, 1, 1}, {&__pyx_n_s_K_UNDO, __pyx_k_K_UNDO, sizeof(__pyx_k_K_UNDO), 0, 0, 1, 1}, {&__pyx_n_s_K_UNKNOWN, __pyx_k_K_UNKNOWN, sizeof(__pyx_k_K_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_UP, __pyx_k_K_UP, sizeof(__pyx_k_K_UP), 0, 0, 1, 1}, {&__pyx_n_s_K_VOLUMEDOWN, __pyx_k_K_VOLUMEDOWN, sizeof(__pyx_k_K_VOLUMEDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_VOLUMEUP, __pyx_k_K_VOLUMEUP, sizeof(__pyx_k_K_VOLUMEUP), 0, 0, 1, 1}, {&__pyx_n_s_K_WWW, __pyx_k_K_WWW, sizeof(__pyx_k_K_WWW), 0, 0, 1, 1}, {&__pyx_n_s_K_a, __pyx_k_K_a, sizeof(__pyx_k_K_a), 0, 0, 1, 1}, {&__pyx_n_s_K_b, __pyx_k_K_b, sizeof(__pyx_k_K_b), 0, 0, 1, 1}, {&__pyx_n_s_K_c, __pyx_k_K_c, sizeof(__pyx_k_K_c), 0, 0, 1, 1}, {&__pyx_n_s_K_d, __pyx_k_K_d, sizeof(__pyx_k_K_d), 0, 0, 1, 1}, {&__pyx_n_s_K_e, __pyx_k_K_e, sizeof(__pyx_k_K_e), 0, 0, 1, 1}, {&__pyx_n_s_K_f, __pyx_k_K_f, sizeof(__pyx_k_K_f), 0, 0, 1, 1}, {&__pyx_n_s_K_g, __pyx_k_K_g, sizeof(__pyx_k_K_g), 0, 0, 1, 1}, {&__pyx_n_s_K_h, __pyx_k_K_h, sizeof(__pyx_k_K_h), 0, 0, 1, 1}, {&__pyx_n_s_K_i, __pyx_k_K_i, sizeof(__pyx_k_K_i), 0, 0, 1, 1}, {&__pyx_n_s_K_j, __pyx_k_K_j, sizeof(__pyx_k_K_j), 0, 0, 1, 1}, {&__pyx_n_s_K_k, __pyx_k_K_k, sizeof(__pyx_k_K_k), 0, 0, 1, 1}, {&__pyx_n_s_K_l, __pyx_k_K_l, sizeof(__pyx_k_K_l), 0, 0, 1, 1}, {&__pyx_n_s_K_m, __pyx_k_K_m, sizeof(__pyx_k_K_m), 0, 0, 1, 1}, {&__pyx_n_s_K_n, __pyx_k_K_n, sizeof(__pyx_k_K_n), 0, 0, 1, 1}, {&__pyx_n_s_K_o, __pyx_k_K_o, sizeof(__pyx_k_K_o), 0, 0, 1, 1}, {&__pyx_n_s_K_p, __pyx_k_K_p, sizeof(__pyx_k_K_p), 0, 0, 1, 1}, {&__pyx_n_s_K_q, __pyx_k_K_q, sizeof(__pyx_k_K_q), 0, 0, 1, 1}, {&__pyx_n_s_K_r, __pyx_k_K_r, sizeof(__pyx_k_K_r), 0, 0, 1, 1}, {&__pyx_n_s_K_s, __pyx_k_K_s, sizeof(__pyx_k_K_s), 0, 0, 1, 1}, {&__pyx_n_s_K_t, __pyx_k_K_t, sizeof(__pyx_k_K_t), 0, 0, 1, 1}, {&__pyx_n_s_K_u, __pyx_k_K_u, sizeof(__pyx_k_K_u), 0, 0, 1, 1}, {&__pyx_n_s_K_v, __pyx_k_K_v, sizeof(__pyx_k_K_v), 0, 0, 1, 1}, {&__pyx_n_s_K_w, __pyx_k_K_w, sizeof(__pyx_k_K_w), 0, 0, 1, 1}, {&__pyx_n_s_K_x, __pyx_k_K_x, sizeof(__pyx_k_K_x), 0, 0, 1, 1}, {&__pyx_n_s_K_y, __pyx_k_K_y, sizeof(__pyx_k_K_y), 0, 0, 1, 1}, {&__pyx_n_s_K_z, __pyx_k_K_z, sizeof(__pyx_k_K_z), 0, 0, 1, 1}, {&__pyx_n_s_LASTEVENT, __pyx_k_LASTEVENT, sizeof(__pyx_k_LASTEVENT), 0, 0, 1, 1}, {&__pyx_n_s_LIL_ENDIAN, __pyx_k_LIL_ENDIAN, sizeof(__pyx_k_LIL_ENDIAN), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONDOWN, __pyx_k_MOUSEBUTTONDOWN, sizeof(__pyx_k_MOUSEBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONUP, __pyx_k_MOUSEBUTTONUP, sizeof(__pyx_k_MOUSEBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEMOTION, __pyx_k_MOUSEMOTION, sizeof(__pyx_k_MOUSEMOTION), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEWHEEL, __pyx_k_MOUSEWHEEL, sizeof(__pyx_k_MOUSEWHEEL), 0, 0, 1, 1}, {&__pyx_n_s_MULTIGESTURE, __pyx_k_MULTIGESTURE, sizeof(__pyx_k_MULTIGESTURE), 0, 0, 1, 1}, {&__pyx_n_s_NOEVENT, __pyx_k_NOEVENT, sizeof(__pyx_k_NOEVENT), 0, 0, 1, 1}, {&__pyx_n_s_NOFRAME, __pyx_k_NOFRAME, sizeof(__pyx_k_NOFRAME), 0, 0, 1, 1}, {&__pyx_n_s_OPENGL, __pyx_k_OPENGL, sizeof(__pyx_k_OPENGL), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGED, __pyx_k_POWERSTATE_CHARGED, sizeof(__pyx_k_POWERSTATE_CHARGED), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGING, __pyx_k_POWERSTATE_CHARGING, sizeof(__pyx_k_POWERSTATE_CHARGING), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_k_POWERSTATE_NO_BATTERY, sizeof(__pyx_k_POWERSTATE_NO_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_k_POWERSTATE_ON_BATTERY, sizeof(__pyx_k_POWERSTATE_ON_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_UNKNOWN, __pyx_k_POWERSTATE_UNKNOWN, sizeof(__pyx_k_POWERSTATE_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_QUIT, __pyx_k_QUIT, sizeof(__pyx_k_QUIT), 0, 0, 1, 1}, {&__pyx_n_s_RENDER_DEVICE_RESET, __pyx_k_RENDER_DEVICE_RESET, sizeof(__pyx_k_RENDER_DEVICE_RESET), 0, 0, 1, 1}, {&__pyx_n_s_RENDER_TARGETS_RESET, __pyx_k_RENDER_TARGETS_RESET, sizeof(__pyx_k_RENDER_TARGETS_RESET), 0, 0, 1, 1}, {&__pyx_n_s_RESIZABLE, __pyx_k_RESIZABLE, sizeof(__pyx_k_RESIZABLE), 0, 0, 1, 1}, {&__pyx_n_s_RLEACCEL, __pyx_k_RLEACCEL, sizeof(__pyx_k_RLEACCEL), 0, 0, 1, 1}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_SCRAP_TEXT, __pyx_k_SCRAP_TEXT, sizeof(__pyx_k_SCRAP_TEXT), 0, 0, 1, 1}, {&__pyx_n_s_SDL_VERSION_TUPLE, __pyx_k_SDL_VERSION_TUPLE, sizeof(__pyx_k_SDL_VERSION_TUPLE), 0, 0, 1, 1}, {&__pyx_n_s_SENSORUPDATE, __pyx_k_SENSORUPDATE, sizeof(__pyx_k_SENSORUPDATE), 0, 0, 1, 1}, {&__pyx_n_s_SRCALPHA, __pyx_k_SRCALPHA, sizeof(__pyx_k_SRCALPHA), 0, 0, 1, 1}, {&__pyx_n_s_SRCCOLORKEY, __pyx_k_SRCCOLORKEY, sizeof(__pyx_k_SRCCOLORKEY), 0, 0, 1, 1}, {&__pyx_n_s_SWSURFACE, __pyx_k_SWSURFACE, sizeof(__pyx_k_SWSURFACE), 0, 0, 1, 1}, {&__pyx_n_s_SYSWMEVENT, __pyx_k_SYSWMEVENT, sizeof(__pyx_k_SYSWMEVENT), 0, 0, 1, 1}, {&__pyx_n_s_TEXTEDITING, __pyx_k_TEXTEDITING, sizeof(__pyx_k_TEXTEDITING), 0, 0, 1, 1}, {&__pyx_n_s_TEXTINPUT, __pyx_k_TEXTINPUT, sizeof(__pyx_k_TEXTINPUT), 0, 0, 1, 1}, {&__pyx_n_s_TOUCH_MOUSEID, __pyx_k_TOUCH_MOUSEID, sizeof(__pyx_k_TOUCH_MOUSEID), 0, 0, 1, 1}, {&__pyx_n_s_USEREVENT, __pyx_k_USEREVENT, sizeof(__pyx_k_USEREVENT), 0, 0, 1, 1}, {&__pyx_n_s_VIDEOEXPOSE, __pyx_k_VIDEOEXPOSE, sizeof(__pyx_k_VIDEOEXPOSE), 0, 0, 1, 1}, {&__pyx_n_s_VIDEORESIZE, __pyx_k_VIDEORESIZE, sizeof(__pyx_k_VIDEORESIZE), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWEVENT, __pyx_k_WINDOWEVENT, sizeof(__pyx_k_WINDOWEVENT), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWMOVED, __pyx_k_WINDOWMOVED, sizeof(__pyx_k_WINDOWMOVED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWPOS_CENTERED, __pyx_k_WINDOWPOS_CENTERED, sizeof(__pyx_k_WINDOWPOS_CENTERED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWPOS_UNDEFINED, __pyx_k_WINDOWPOS_UNDEFINED, sizeof(__pyx_k_WINDOWPOS_UNDEFINED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_ALLOW_HIGHDPI, __pyx_k_WINDOW_ALLOW_HIGHDPI, sizeof(__pyx_k_WINDOW_ALLOW_HIGHDPI), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_BORDERLESS, __pyx_k_WINDOW_BORDERLESS, sizeof(__pyx_k_WINDOW_BORDERLESS), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_FOREIGN, __pyx_k_WINDOW_FOREIGN, sizeof(__pyx_k_WINDOW_FOREIGN), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_FULLSCREEN, __pyx_k_WINDOW_FULLSCREEN, sizeof(__pyx_k_WINDOW_FULLSCREEN), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP, __pyx_k_WINDOW_FULLSCREEN_DESKTOP, sizeof(__pyx_k_WINDOW_FULLSCREEN_DESKTOP), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_HIDDEN, __pyx_k_WINDOW_HIDDEN, sizeof(__pyx_k_WINDOW_HIDDEN), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_INPUT_FOCUS, __pyx_k_WINDOW_INPUT_FOCUS, sizeof(__pyx_k_WINDOW_INPUT_FOCUS), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_INPUT_GRABBED, __pyx_k_WINDOW_INPUT_GRABBED, sizeof(__pyx_k_WINDOW_INPUT_GRABBED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_MAXIMIZED, __pyx_k_WINDOW_MAXIMIZED, sizeof(__pyx_k_WINDOW_MAXIMIZED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_MINIMIZED, __pyx_k_WINDOW_MINIMIZED, sizeof(__pyx_k_WINDOW_MINIMIZED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_NOFRAME, __pyx_k_WINDOW_NOFRAME, sizeof(__pyx_k_WINDOW_NOFRAME), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_OPENGL, __pyx_k_WINDOW_OPENGL, sizeof(__pyx_k_WINDOW_OPENGL), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_RESIZABLE, __pyx_k_WINDOW_RESIZABLE, sizeof(__pyx_k_WINDOW_RESIZABLE), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_SHOWN, __pyx_k_WINDOW_SHOWN, sizeof(__pyx_k_WINDOW_SHOWN), 0, 0, 1, 1}, {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_s_text_plain, __pyx_k_text_plain, sizeof(__pyx_k_text_plain), 0, 0, 1, 0}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { return 0; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); __Pyx_RefNannyFinishContext(); return 0; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1073741824 = PyInt_FromLong(1073741824L); if (unlikely(!__pyx_int_1073741824)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2147483648 = PyInt_FromString((char *)"2147483648", 0, 0); if (unlikely(!__pyx_int_2147483648)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_locals(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_locals}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "locals", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initlocals(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initlocals(void) #else __Pyx_PyMODINIT_FUNC PyInit_locals(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_locals(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_locals(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'locals' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("locals", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "locals" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_locals(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__locals) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.locals")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.locals", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/locals.pyx":4 * cimport sdl2 * * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * from pygame_sdl2.color import Color * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Rect)) __PYX_ERR(0, 4, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":5 * * from pygame_sdl2.rect import Rect * from pygame_sdl2.color import Color # <<<<<<<<<<<<<< * * include "event_list.pxi" */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_Color); __Pyx_GIVEREF(__pyx_n_s_Color); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Color)) __PYX_ERR(0, 5, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_color, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Color, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":4 * # Do not edit! * * NOEVENT = SDL_FIRSTEVENT # <<<<<<<<<<<<<< * QUIT = SDL_QUIT * APP_TERMINATING = SDL_APP_TERMINATING */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FIRSTEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOEVENT, __pyx_t_2) < 0) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":5 * * NOEVENT = SDL_FIRSTEVENT * QUIT = SDL_QUIT # <<<<<<<<<<<<<< * APP_TERMINATING = SDL_APP_TERMINATING * APP_LOWMEMORY = SDL_APP_LOWMEMORY */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_QUIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUIT, __pyx_t_2) < 0) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":6 * NOEVENT = SDL_FIRSTEVENT * QUIT = SDL_QUIT * APP_TERMINATING = SDL_APP_TERMINATING # <<<<<<<<<<<<<< * APP_LOWMEMORY = SDL_APP_LOWMEMORY * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_TERMINATING); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_TERMINATING, __pyx_t_2) < 0) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":7 * QUIT = SDL_QUIT * APP_TERMINATING = SDL_APP_TERMINATING * APP_LOWMEMORY = SDL_APP_LOWMEMORY # <<<<<<<<<<<<<< * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_LOWMEMORY); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_LOWMEMORY, __pyx_t_2) < 0) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":8 * APP_TERMINATING = SDL_APP_TERMINATING * APP_LOWMEMORY = SDL_APP_LOWMEMORY * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND # <<<<<<<<<<<<<< * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERBACKGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_WILLENTERBACKGROUND, __pyx_t_2) < 0) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":9 * APP_LOWMEMORY = SDL_APP_LOWMEMORY * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND # <<<<<<<<<<<<<< * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERBACKGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_DIDENTERBACKGROUND, __pyx_t_2) < 0) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":10 * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND # <<<<<<<<<<<<<< * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND * DISPLAYEVENT = SDL_DISPLAYEVENT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERFOREGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_WILLENTERFOREGROUND, __pyx_t_2) < 0) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":11 * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND # <<<<<<<<<<<<<< * DISPLAYEVENT = SDL_DISPLAYEVENT * WINDOWEVENT = SDL_WINDOWEVENT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERFOREGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_DIDENTERFOREGROUND, __pyx_t_2) < 0) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":12 * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND * DISPLAYEVENT = SDL_DISPLAYEVENT # <<<<<<<<<<<<<< * WINDOWEVENT = SDL_WINDOWEVENT * SYSWMEVENT = SDL_SYSWMEVENT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DISPLAYEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DISPLAYEVENT, __pyx_t_2) < 0) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":13 * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND * DISPLAYEVENT = SDL_DISPLAYEVENT * WINDOWEVENT = SDL_WINDOWEVENT # <<<<<<<<<<<<<< * SYSWMEVENT = SDL_SYSWMEVENT * KEYDOWN = SDL_KEYDOWN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWEVENT, __pyx_t_2) < 0) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":14 * DISPLAYEVENT = SDL_DISPLAYEVENT * WINDOWEVENT = SDL_WINDOWEVENT * SYSWMEVENT = SDL_SYSWMEVENT # <<<<<<<<<<<<<< * KEYDOWN = SDL_KEYDOWN * KEYUP = SDL_KEYUP */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_SYSWMEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSWMEVENT, __pyx_t_2) < 0) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":15 * WINDOWEVENT = SDL_WINDOWEVENT * SYSWMEVENT = SDL_SYSWMEVENT * KEYDOWN = SDL_KEYDOWN # <<<<<<<<<<<<<< * KEYUP = SDL_KEYUP * TEXTEDITING = SDL_TEXTEDITING */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEYDOWN, __pyx_t_2) < 0) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":16 * SYSWMEVENT = SDL_SYSWMEVENT * KEYDOWN = SDL_KEYDOWN * KEYUP = SDL_KEYUP # <<<<<<<<<<<<<< * TEXTEDITING = SDL_TEXTEDITING * TEXTINPUT = SDL_TEXTINPUT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEYUP, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":17 * KEYDOWN = SDL_KEYDOWN * KEYUP = SDL_KEYUP * TEXTEDITING = SDL_TEXTEDITING # <<<<<<<<<<<<<< * TEXTINPUT = SDL_TEXTINPUT * KEYMAPCHANGED = SDL_KEYMAPCHANGED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTEDITING); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TEXTEDITING, __pyx_t_2) < 0) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":18 * KEYUP = SDL_KEYUP * TEXTEDITING = SDL_TEXTEDITING * TEXTINPUT = SDL_TEXTINPUT # <<<<<<<<<<<<<< * KEYMAPCHANGED = SDL_KEYMAPCHANGED * MOUSEMOTION = SDL_MOUSEMOTION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTINPUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TEXTINPUT, __pyx_t_2) < 0) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":19 * TEXTEDITING = SDL_TEXTEDITING * TEXTINPUT = SDL_TEXTINPUT * KEYMAPCHANGED = SDL_KEYMAPCHANGED # <<<<<<<<<<<<<< * MOUSEMOTION = SDL_MOUSEMOTION * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYMAPCHANGED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEYMAPCHANGED, __pyx_t_2) < 0) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":20 * TEXTINPUT = SDL_TEXTINPUT * KEYMAPCHANGED = SDL_KEYMAPCHANGED * MOUSEMOTION = SDL_MOUSEMOTION # <<<<<<<<<<<<<< * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEMOTION, __pyx_t_2) < 0) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":21 * KEYMAPCHANGED = SDL_KEYMAPCHANGED * MOUSEMOTION = SDL_MOUSEMOTION * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN # <<<<<<<<<<<<<< * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP * MOUSEWHEEL = SDL_MOUSEWHEEL */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEBUTTONDOWN, __pyx_t_2) < 0) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":22 * MOUSEMOTION = SDL_MOUSEMOTION * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP # <<<<<<<<<<<<<< * MOUSEWHEEL = SDL_MOUSEWHEEL * JOYAXISMOTION = SDL_JOYAXISMOTION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEBUTTONUP, __pyx_t_2) < 0) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":23 * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP * MOUSEWHEEL = SDL_MOUSEWHEEL # <<<<<<<<<<<<<< * JOYAXISMOTION = SDL_JOYAXISMOTION * JOYBALLMOTION = SDL_JOYBALLMOTION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEWHEEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEWHEEL, __pyx_t_2) < 0) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":24 * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP * MOUSEWHEEL = SDL_MOUSEWHEEL * JOYAXISMOTION = SDL_JOYAXISMOTION # <<<<<<<<<<<<<< * JOYBALLMOTION = SDL_JOYBALLMOTION * JOYHATMOTION = SDL_JOYHATMOTION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYAXISMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYAXISMOTION, __pyx_t_2) < 0) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":25 * MOUSEWHEEL = SDL_MOUSEWHEEL * JOYAXISMOTION = SDL_JOYAXISMOTION * JOYBALLMOTION = SDL_JOYBALLMOTION # <<<<<<<<<<<<<< * JOYHATMOTION = SDL_JOYHATMOTION * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBALLMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYBALLMOTION, __pyx_t_2) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":26 * JOYAXISMOTION = SDL_JOYAXISMOTION * JOYBALLMOTION = SDL_JOYBALLMOTION * JOYHATMOTION = SDL_JOYHATMOTION # <<<<<<<<<<<<<< * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN * JOYBUTTONUP = SDL_JOYBUTTONUP */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYHATMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYHATMOTION, __pyx_t_2) < 0) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":27 * JOYBALLMOTION = SDL_JOYBALLMOTION * JOYHATMOTION = SDL_JOYHATMOTION * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN # <<<<<<<<<<<<<< * JOYBUTTONUP = SDL_JOYBUTTONUP * JOYDEVICEADDED = SDL_JOYDEVICEADDED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYBUTTONDOWN, __pyx_t_2) < 0) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":28 * JOYHATMOTION = SDL_JOYHATMOTION * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN * JOYBUTTONUP = SDL_JOYBUTTONUP # <<<<<<<<<<<<<< * JOYDEVICEADDED = SDL_JOYDEVICEADDED * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYBUTTONUP, __pyx_t_2) < 0) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":29 * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN * JOYBUTTONUP = SDL_JOYBUTTONUP * JOYDEVICEADDED = SDL_JOYDEVICEADDED # <<<<<<<<<<<<<< * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYDEVICEADDED, __pyx_t_2) < 0) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":30 * JOYBUTTONUP = SDL_JOYBUTTONUP * JOYDEVICEADDED = SDL_JOYDEVICEADDED * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED # <<<<<<<<<<<<<< * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYDEVICEREMOVED, __pyx_t_2) < 0) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":31 * JOYDEVICEADDED = SDL_JOYDEVICEADDED * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION # <<<<<<<<<<<<<< * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERAXISMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERAXISMOTION, __pyx_t_2) < 0) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":32 * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN # <<<<<<<<<<<<<< * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERBUTTONDOWN, __pyx_t_2) < 0) __PYX_ERR(1, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":33 * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP # <<<<<<<<<<<<<< * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERBUTTONUP, __pyx_t_2) < 0) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":34 * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED # <<<<<<<<<<<<<< * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERDEVICEADDED, __pyx_t_2) < 0) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":35 * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED # <<<<<<<<<<<<<< * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED * FINGERDOWN = SDL_FINGERDOWN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERDEVICEREMOVED, __pyx_t_2) < 0) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":36 * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED # <<<<<<<<<<<<<< * FINGERDOWN = SDL_FINGERDOWN * FINGERUP = SDL_FINGERUP */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMAPPED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERDEVICEREMAPPED, __pyx_t_2) < 0) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":37 * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED * FINGERDOWN = SDL_FINGERDOWN # <<<<<<<<<<<<<< * FINGERUP = SDL_FINGERUP * FINGERMOTION = SDL_FINGERMOTION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FINGERDOWN, __pyx_t_2) < 0) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":38 * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED * FINGERDOWN = SDL_FINGERDOWN * FINGERUP = SDL_FINGERUP # <<<<<<<<<<<<<< * FINGERMOTION = SDL_FINGERMOTION * DOLLARGESTURE = SDL_DOLLARGESTURE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FINGERUP, __pyx_t_2) < 0) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":39 * FINGERDOWN = SDL_FINGERDOWN * FINGERUP = SDL_FINGERUP * FINGERMOTION = SDL_FINGERMOTION # <<<<<<<<<<<<<< * DOLLARGESTURE = SDL_DOLLARGESTURE * DOLLARRECORD = SDL_DOLLARRECORD */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FINGERMOTION, __pyx_t_2) < 0) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":40 * FINGERUP = SDL_FINGERUP * FINGERMOTION = SDL_FINGERMOTION * DOLLARGESTURE = SDL_DOLLARGESTURE # <<<<<<<<<<<<<< * DOLLARRECORD = SDL_DOLLARRECORD * MULTIGESTURE = SDL_MULTIGESTURE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARGESTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOLLARGESTURE, __pyx_t_2) < 0) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":41 * FINGERMOTION = SDL_FINGERMOTION * DOLLARGESTURE = SDL_DOLLARGESTURE * DOLLARRECORD = SDL_DOLLARRECORD # <<<<<<<<<<<<<< * MULTIGESTURE = SDL_MULTIGESTURE * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARRECORD); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOLLARRECORD, __pyx_t_2) < 0) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":42 * DOLLARGESTURE = SDL_DOLLARGESTURE * DOLLARRECORD = SDL_DOLLARRECORD * MULTIGESTURE = SDL_MULTIGESTURE # <<<<<<<<<<<<<< * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE * DROPFILE = SDL_DROPFILE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MULTIGESTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MULTIGESTURE, __pyx_t_2) < 0) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":43 * DOLLARRECORD = SDL_DOLLARRECORD * MULTIGESTURE = SDL_MULTIGESTURE * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE # <<<<<<<<<<<<<< * DROPFILE = SDL_DROPFILE * DROPTEXT = SDL_DROPTEXT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CLIPBOARDUPDATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLIPBOARDUPDATE, __pyx_t_2) < 0) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":44 * MULTIGESTURE = SDL_MULTIGESTURE * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE * DROPFILE = SDL_DROPFILE # <<<<<<<<<<<<<< * DROPTEXT = SDL_DROPTEXT * DROPBEGIN = SDL_DROPBEGIN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DROPFILE, __pyx_t_2) < 0) __PYX_ERR(1, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":45 * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE * DROPFILE = SDL_DROPFILE * DROPTEXT = SDL_DROPTEXT # <<<<<<<<<<<<<< * DROPBEGIN = SDL_DROPBEGIN * DROPCOMPLETE = SDL_DROPCOMPLETE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPTEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DROPTEXT, __pyx_t_2) < 0) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":46 * DROPFILE = SDL_DROPFILE * DROPTEXT = SDL_DROPTEXT * DROPBEGIN = SDL_DROPBEGIN # <<<<<<<<<<<<<< * DROPCOMPLETE = SDL_DROPCOMPLETE * AUDIODEVICEADDED = SDL_AUDIODEVICEADDED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPBEGIN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DROPBEGIN, __pyx_t_2) < 0) __PYX_ERR(1, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":47 * DROPTEXT = SDL_DROPTEXT * DROPBEGIN = SDL_DROPBEGIN * DROPCOMPLETE = SDL_DROPCOMPLETE # <<<<<<<<<<<<<< * AUDIODEVICEADDED = SDL_AUDIODEVICEADDED * AUDIODEVICEREMOVED = SDL_AUDIODEVICEREMOVED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPCOMPLETE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DROPCOMPLETE, __pyx_t_2) < 0) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":48 * DROPBEGIN = SDL_DROPBEGIN * DROPCOMPLETE = SDL_DROPCOMPLETE * AUDIODEVICEADDED = SDL_AUDIODEVICEADDED # <<<<<<<<<<<<<< * AUDIODEVICEREMOVED = SDL_AUDIODEVICEREMOVED * SENSORUPDATE = SDL_SENSORUPDATE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_AUDIODEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_AUDIODEVICEADDED, __pyx_t_2) < 0) __PYX_ERR(1, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":49 * DROPCOMPLETE = SDL_DROPCOMPLETE * AUDIODEVICEADDED = SDL_AUDIODEVICEADDED * AUDIODEVICEREMOVED = SDL_AUDIODEVICEREMOVED # <<<<<<<<<<<<<< * SENSORUPDATE = SDL_SENSORUPDATE * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_AUDIODEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_AUDIODEVICEREMOVED, __pyx_t_2) < 0) __PYX_ERR(1, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":50 * AUDIODEVICEADDED = SDL_AUDIODEVICEADDED * AUDIODEVICEREMOVED = SDL_AUDIODEVICEREMOVED * SENSORUPDATE = SDL_SENSORUPDATE # <<<<<<<<<<<<<< * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET * RENDER_DEVICE_RESET = SDL_RENDER_DEVICE_RESET */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_SENSORUPDATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SENSORUPDATE, __pyx_t_2) < 0) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":51 * AUDIODEVICEREMOVED = SDL_AUDIODEVICEREMOVED * SENSORUPDATE = SDL_SENSORUPDATE * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET # <<<<<<<<<<<<<< * RENDER_DEVICE_RESET = SDL_RENDER_DEVICE_RESET * USEREVENT = SDL_USEREVENT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_TARGETS_RESET); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RENDER_TARGETS_RESET, __pyx_t_2) < 0) __PYX_ERR(1, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":52 * SENSORUPDATE = SDL_SENSORUPDATE * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET * RENDER_DEVICE_RESET = SDL_RENDER_DEVICE_RESET # <<<<<<<<<<<<<< * USEREVENT = SDL_USEREVENT * LASTEVENT = SDL_LASTEVENT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_DEVICE_RESET); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RENDER_DEVICE_RESET, __pyx_t_2) < 0) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":53 * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET * RENDER_DEVICE_RESET = SDL_RENDER_DEVICE_RESET * USEREVENT = SDL_USEREVENT # <<<<<<<<<<<<<< * LASTEVENT = SDL_LASTEVENT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_USEREVENT, __pyx_t_2) < 0) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":54 * RENDER_DEVICE_RESET = SDL_RENDER_DEVICE_RESET * USEREVENT = SDL_USEREVENT * LASTEVENT = SDL_LASTEVENT # <<<<<<<<<<<<<< */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_LASTEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LASTEVENT, __pyx_t_2) < 0) __PYX_ERR(1, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":8 * * include "event_list.pxi" * ACTIVEEVENT = SDL_LASTEVENT - 1 # <<<<<<<<<<<<<< * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 */ __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACTIVEEVENT, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":9 * include "event_list.pxi" * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 # <<<<<<<<<<<<<< * VIDEOEXPOSE = SDL_LASTEVENT - 3 * WINDOWMOVED = SDL_LASTEVENT - 4 */ __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEORESIZE, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":10 * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 # <<<<<<<<<<<<<< * WINDOWMOVED = SDL_LASTEVENT - 4 * */ __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEOEXPOSE, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":11 * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 * WINDOWMOVED = SDL_LASTEVENT - 4 # <<<<<<<<<<<<<< * * include "keycode_list.pxi" */ __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWMOVED, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":4 * # Do not edit! * * K_UNKNOWN = SDLK_UNKNOWN # <<<<<<<<<<<<<< * K_RETURN = SDLK_RETURN * K_ESCAPE = SDLK_ESCAPE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_UNKNOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UNKNOWN, __pyx_t_2) < 0) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":5 * * K_UNKNOWN = SDLK_UNKNOWN * K_RETURN = SDLK_RETURN # <<<<<<<<<<<<<< * K_ESCAPE = SDLK_ESCAPE * K_BACKSPACE = SDLK_BACKSPACE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RETURN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RETURN, __pyx_t_2) < 0) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":6 * K_UNKNOWN = SDLK_UNKNOWN * K_RETURN = SDLK_RETURN * K_ESCAPE = SDLK_ESCAPE # <<<<<<<<<<<<<< * K_BACKSPACE = SDLK_BACKSPACE * K_TAB = SDLK_TAB */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_ESCAPE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_ESCAPE, __pyx_t_2) < 0) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":7 * K_RETURN = SDLK_RETURN * K_ESCAPE = SDLK_ESCAPE * K_BACKSPACE = SDLK_BACKSPACE # <<<<<<<<<<<<<< * K_TAB = SDLK_TAB * K_SPACE = SDLK_SPACE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_BACKSPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BACKSPACE, __pyx_t_2) < 0) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":8 * K_ESCAPE = SDLK_ESCAPE * K_BACKSPACE = SDLK_BACKSPACE * K_TAB = SDLK_TAB # <<<<<<<<<<<<<< * K_SPACE = SDLK_SPACE * K_EXCLAIM = SDLK_EXCLAIM */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_TAB); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_TAB, __pyx_t_2) < 0) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":9 * K_BACKSPACE = SDLK_BACKSPACE * K_TAB = SDLK_TAB * K_SPACE = SDLK_SPACE # <<<<<<<<<<<<<< * K_EXCLAIM = SDLK_EXCLAIM * K_QUOTEDBL = SDLK_QUOTEDBL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SPACE, __pyx_t_2) < 0) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":10 * K_TAB = SDLK_TAB * K_SPACE = SDLK_SPACE * K_EXCLAIM = SDLK_EXCLAIM # <<<<<<<<<<<<<< * K_QUOTEDBL = SDLK_QUOTEDBL * K_HASH = SDLK_HASH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_EXCLAIM); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EXCLAIM, __pyx_t_2) < 0) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":11 * K_SPACE = SDLK_SPACE * K_EXCLAIM = SDLK_EXCLAIM * K_QUOTEDBL = SDLK_QUOTEDBL # <<<<<<<<<<<<<< * K_HASH = SDLK_HASH * K_PERCENT = SDLK_PERCENT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_QUOTEDBL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_QUOTEDBL, __pyx_t_2) < 0) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":12 * K_EXCLAIM = SDLK_EXCLAIM * K_QUOTEDBL = SDLK_QUOTEDBL * K_HASH = SDLK_HASH # <<<<<<<<<<<<<< * K_PERCENT = SDLK_PERCENT * K_DOLLAR = SDLK_DOLLAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_HASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_HASH, __pyx_t_2) < 0) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":13 * K_QUOTEDBL = SDLK_QUOTEDBL * K_HASH = SDLK_HASH * K_PERCENT = SDLK_PERCENT # <<<<<<<<<<<<<< * K_DOLLAR = SDLK_DOLLAR * K_AMPERSAND = SDLK_AMPERSAND */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PERCENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PERCENT, __pyx_t_2) < 0) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":14 * K_HASH = SDLK_HASH * K_PERCENT = SDLK_PERCENT * K_DOLLAR = SDLK_DOLLAR # <<<<<<<<<<<<<< * K_AMPERSAND = SDLK_AMPERSAND * K_QUOTE = SDLK_QUOTE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_DOLLAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DOLLAR, __pyx_t_2) < 0) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":15 * K_PERCENT = SDLK_PERCENT * K_DOLLAR = SDLK_DOLLAR * K_AMPERSAND = SDLK_AMPERSAND # <<<<<<<<<<<<<< * K_QUOTE = SDLK_QUOTE * K_LEFTPAREN = SDLK_LEFTPAREN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AMPERSAND); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AMPERSAND, __pyx_t_2) < 0) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":16 * K_DOLLAR = SDLK_DOLLAR * K_AMPERSAND = SDLK_AMPERSAND * K_QUOTE = SDLK_QUOTE # <<<<<<<<<<<<<< * K_LEFTPAREN = SDLK_LEFTPAREN * K_RIGHTPAREN = SDLK_RIGHTPAREN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_QUOTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_QUOTE, __pyx_t_2) < 0) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":17 * K_AMPERSAND = SDLK_AMPERSAND * K_QUOTE = SDLK_QUOTE * K_LEFTPAREN = SDLK_LEFTPAREN # <<<<<<<<<<<<<< * K_RIGHTPAREN = SDLK_RIGHTPAREN * K_ASTERISK = SDLK_ASTERISK */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LEFTPAREN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LEFTPAREN, __pyx_t_2) < 0) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":18 * K_QUOTE = SDLK_QUOTE * K_LEFTPAREN = SDLK_LEFTPAREN * K_RIGHTPAREN = SDLK_RIGHTPAREN # <<<<<<<<<<<<<< * K_ASTERISK = SDLK_ASTERISK * K_PLUS = SDLK_PLUS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RIGHTPAREN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RIGHTPAREN, __pyx_t_2) < 0) __PYX_ERR(2, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":19 * K_LEFTPAREN = SDLK_LEFTPAREN * K_RIGHTPAREN = SDLK_RIGHTPAREN * K_ASTERISK = SDLK_ASTERISK # <<<<<<<<<<<<<< * K_PLUS = SDLK_PLUS * K_COMMA = SDLK_COMMA */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_ASTERISK); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_ASTERISK, __pyx_t_2) < 0) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":20 * K_RIGHTPAREN = SDLK_RIGHTPAREN * K_ASTERISK = SDLK_ASTERISK * K_PLUS = SDLK_PLUS # <<<<<<<<<<<<<< * K_COMMA = SDLK_COMMA * K_MINUS = SDLK_MINUS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PLUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PLUS, __pyx_t_2) < 0) __PYX_ERR(2, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":21 * K_ASTERISK = SDLK_ASTERISK * K_PLUS = SDLK_PLUS * K_COMMA = SDLK_COMMA # <<<<<<<<<<<<<< * K_MINUS = SDLK_MINUS * K_PERIOD = SDLK_PERIOD */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_COMMA); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COMMA, __pyx_t_2) < 0) __PYX_ERR(2, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":22 * K_PLUS = SDLK_PLUS * K_COMMA = SDLK_COMMA * K_MINUS = SDLK_MINUS # <<<<<<<<<<<<<< * K_PERIOD = SDLK_PERIOD * K_SLASH = SDLK_SLASH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_MINUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MINUS, __pyx_t_2) < 0) __PYX_ERR(2, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":23 * K_COMMA = SDLK_COMMA * K_MINUS = SDLK_MINUS * K_PERIOD = SDLK_PERIOD # <<<<<<<<<<<<<< * K_SLASH = SDLK_SLASH * K_0 = SDLK_0 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PERIOD); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PERIOD, __pyx_t_2) < 0) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":24 * K_MINUS = SDLK_MINUS * K_PERIOD = SDLK_PERIOD * K_SLASH = SDLK_SLASH # <<<<<<<<<<<<<< * K_0 = SDLK_0 * K_1 = SDLK_1 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SLASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SLASH, __pyx_t_2) < 0) __PYX_ERR(2, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":25 * K_PERIOD = SDLK_PERIOD * K_SLASH = SDLK_SLASH * K_0 = SDLK_0 # <<<<<<<<<<<<<< * K_1 = SDLK_1 * K_2 = SDLK_2 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_0, __pyx_t_2) < 0) __PYX_ERR(2, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":26 * K_SLASH = SDLK_SLASH * K_0 = SDLK_0 * K_1 = SDLK_1 # <<<<<<<<<<<<<< * K_2 = SDLK_2 * K_3 = SDLK_3 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_1, __pyx_t_2) < 0) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":27 * K_0 = SDLK_0 * K_1 = SDLK_1 * K_2 = SDLK_2 # <<<<<<<<<<<<<< * K_3 = SDLK_3 * K_4 = SDLK_4 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_2, __pyx_t_2) < 0) __PYX_ERR(2, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":28 * K_1 = SDLK_1 * K_2 = SDLK_2 * K_3 = SDLK_3 # <<<<<<<<<<<<<< * K_4 = SDLK_4 * K_5 = SDLK_5 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_3, __pyx_t_2) < 0) __PYX_ERR(2, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":29 * K_2 = SDLK_2 * K_3 = SDLK_3 * K_4 = SDLK_4 # <<<<<<<<<<<<<< * K_5 = SDLK_5 * K_6 = SDLK_6 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_4, __pyx_t_2) < 0) __PYX_ERR(2, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":30 * K_3 = SDLK_3 * K_4 = SDLK_4 * K_5 = SDLK_5 # <<<<<<<<<<<<<< * K_6 = SDLK_6 * K_7 = SDLK_7 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_5, __pyx_t_2) < 0) __PYX_ERR(2, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":31 * K_4 = SDLK_4 * K_5 = SDLK_5 * K_6 = SDLK_6 # <<<<<<<<<<<<<< * K_7 = SDLK_7 * K_8 = SDLK_8 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_6, __pyx_t_2) < 0) __PYX_ERR(2, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":32 * K_5 = SDLK_5 * K_6 = SDLK_6 * K_7 = SDLK_7 # <<<<<<<<<<<<<< * K_8 = SDLK_8 * K_9 = SDLK_9 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_7, __pyx_t_2) < 0) __PYX_ERR(2, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":33 * K_6 = SDLK_6 * K_7 = SDLK_7 * K_8 = SDLK_8 # <<<<<<<<<<<<<< * K_9 = SDLK_9 * K_COLON = SDLK_COLON */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_8, __pyx_t_2) < 0) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":34 * K_7 = SDLK_7 * K_8 = SDLK_8 * K_9 = SDLK_9 # <<<<<<<<<<<<<< * K_COLON = SDLK_COLON * K_SEMICOLON = SDLK_SEMICOLON */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_9, __pyx_t_2) < 0) __PYX_ERR(2, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":35 * K_8 = SDLK_8 * K_9 = SDLK_9 * K_COLON = SDLK_COLON # <<<<<<<<<<<<<< * K_SEMICOLON = SDLK_SEMICOLON * K_LESS = SDLK_LESS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_COLON); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COLON, __pyx_t_2) < 0) __PYX_ERR(2, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":36 * K_9 = SDLK_9 * K_COLON = SDLK_COLON * K_SEMICOLON = SDLK_SEMICOLON # <<<<<<<<<<<<<< * K_LESS = SDLK_LESS * K_EQUALS = SDLK_EQUALS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SEMICOLON); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SEMICOLON, __pyx_t_2) < 0) __PYX_ERR(2, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":37 * K_COLON = SDLK_COLON * K_SEMICOLON = SDLK_SEMICOLON * K_LESS = SDLK_LESS # <<<<<<<<<<<<<< * K_EQUALS = SDLK_EQUALS * K_GREATER = SDLK_GREATER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LESS, __pyx_t_2) < 0) __PYX_ERR(2, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":38 * K_SEMICOLON = SDLK_SEMICOLON * K_LESS = SDLK_LESS * K_EQUALS = SDLK_EQUALS # <<<<<<<<<<<<<< * K_GREATER = SDLK_GREATER * K_QUESTION = SDLK_QUESTION */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_EQUALS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EQUALS, __pyx_t_2) < 0) __PYX_ERR(2, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":39 * K_LESS = SDLK_LESS * K_EQUALS = SDLK_EQUALS * K_GREATER = SDLK_GREATER # <<<<<<<<<<<<<< * K_QUESTION = SDLK_QUESTION * K_AT = SDLK_AT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_GREATER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_GREATER, __pyx_t_2) < 0) __PYX_ERR(2, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":40 * K_EQUALS = SDLK_EQUALS * K_GREATER = SDLK_GREATER * K_QUESTION = SDLK_QUESTION # <<<<<<<<<<<<<< * K_AT = SDLK_AT * K_LEFTBRACKET = SDLK_LEFTBRACKET */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_QUESTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_QUESTION, __pyx_t_2) < 0) __PYX_ERR(2, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":41 * K_GREATER = SDLK_GREATER * K_QUESTION = SDLK_QUESTION * K_AT = SDLK_AT # <<<<<<<<<<<<<< * K_LEFTBRACKET = SDLK_LEFTBRACKET * K_BACKSLASH = SDLK_BACKSLASH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AT, __pyx_t_2) < 0) __PYX_ERR(2, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":42 * K_QUESTION = SDLK_QUESTION * K_AT = SDLK_AT * K_LEFTBRACKET = SDLK_LEFTBRACKET # <<<<<<<<<<<<<< * K_BACKSLASH = SDLK_BACKSLASH * K_RIGHTBRACKET = SDLK_RIGHTBRACKET */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LEFTBRACKET); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LEFTBRACKET, __pyx_t_2) < 0) __PYX_ERR(2, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":43 * K_AT = SDLK_AT * K_LEFTBRACKET = SDLK_LEFTBRACKET * K_BACKSLASH = SDLK_BACKSLASH # <<<<<<<<<<<<<< * K_RIGHTBRACKET = SDLK_RIGHTBRACKET * K_CARET = SDLK_CARET */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_BACKSLASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BACKSLASH, __pyx_t_2) < 0) __PYX_ERR(2, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":44 * K_LEFTBRACKET = SDLK_LEFTBRACKET * K_BACKSLASH = SDLK_BACKSLASH * K_RIGHTBRACKET = SDLK_RIGHTBRACKET # <<<<<<<<<<<<<< * K_CARET = SDLK_CARET * K_UNDERSCORE = SDLK_UNDERSCORE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RIGHTBRACKET); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RIGHTBRACKET, __pyx_t_2) < 0) __PYX_ERR(2, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":45 * K_BACKSLASH = SDLK_BACKSLASH * K_RIGHTBRACKET = SDLK_RIGHTBRACKET * K_CARET = SDLK_CARET # <<<<<<<<<<<<<< * K_UNDERSCORE = SDLK_UNDERSCORE * K_BACKQUOTE = SDLK_BACKQUOTE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CARET); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CARET, __pyx_t_2) < 0) __PYX_ERR(2, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":46 * K_RIGHTBRACKET = SDLK_RIGHTBRACKET * K_CARET = SDLK_CARET * K_UNDERSCORE = SDLK_UNDERSCORE # <<<<<<<<<<<<<< * K_BACKQUOTE = SDLK_BACKQUOTE * K_a = SDLK_a */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_UNDERSCORE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UNDERSCORE, __pyx_t_2) < 0) __PYX_ERR(2, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":47 * K_CARET = SDLK_CARET * K_UNDERSCORE = SDLK_UNDERSCORE * K_BACKQUOTE = SDLK_BACKQUOTE # <<<<<<<<<<<<<< * K_a = SDLK_a * K_b = SDLK_b */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_BACKQUOTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BACKQUOTE, __pyx_t_2) < 0) __PYX_ERR(2, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":48 * K_UNDERSCORE = SDLK_UNDERSCORE * K_BACKQUOTE = SDLK_BACKQUOTE * K_a = SDLK_a # <<<<<<<<<<<<<< * K_b = SDLK_b * K_c = SDLK_c */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_a); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_a, __pyx_t_2) < 0) __PYX_ERR(2, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":49 * K_BACKQUOTE = SDLK_BACKQUOTE * K_a = SDLK_a * K_b = SDLK_b # <<<<<<<<<<<<<< * K_c = SDLK_c * K_d = SDLK_d */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_b, __pyx_t_2) < 0) __PYX_ERR(2, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":50 * K_a = SDLK_a * K_b = SDLK_b * K_c = SDLK_c # <<<<<<<<<<<<<< * K_d = SDLK_d * K_e = SDLK_e */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_c, __pyx_t_2) < 0) __PYX_ERR(2, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":51 * K_b = SDLK_b * K_c = SDLK_c * K_d = SDLK_d # <<<<<<<<<<<<<< * K_e = SDLK_e * K_f = SDLK_f */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_d, __pyx_t_2) < 0) __PYX_ERR(2, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":52 * K_c = SDLK_c * K_d = SDLK_d * K_e = SDLK_e # <<<<<<<<<<<<<< * K_f = SDLK_f * K_g = SDLK_g */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_e, __pyx_t_2) < 0) __PYX_ERR(2, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":53 * K_d = SDLK_d * K_e = SDLK_e * K_f = SDLK_f # <<<<<<<<<<<<<< * K_g = SDLK_g * K_h = SDLK_h */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_f, __pyx_t_2) < 0) __PYX_ERR(2, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":54 * K_e = SDLK_e * K_f = SDLK_f * K_g = SDLK_g # <<<<<<<<<<<<<< * K_h = SDLK_h * K_i = SDLK_i */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_g, __pyx_t_2) < 0) __PYX_ERR(2, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":55 * K_f = SDLK_f * K_g = SDLK_g * K_h = SDLK_h # <<<<<<<<<<<<<< * K_i = SDLK_i * K_j = SDLK_j */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_h, __pyx_t_2) < 0) __PYX_ERR(2, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":56 * K_g = SDLK_g * K_h = SDLK_h * K_i = SDLK_i # <<<<<<<<<<<<<< * K_j = SDLK_j * K_k = SDLK_k */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_i, __pyx_t_2) < 0) __PYX_ERR(2, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":57 * K_h = SDLK_h * K_i = SDLK_i * K_j = SDLK_j # <<<<<<<<<<<<<< * K_k = SDLK_k * K_l = SDLK_l */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_j, __pyx_t_2) < 0) __PYX_ERR(2, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":58 * K_i = SDLK_i * K_j = SDLK_j * K_k = SDLK_k # <<<<<<<<<<<<<< * K_l = SDLK_l * K_m = SDLK_m */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_k, __pyx_t_2) < 0) __PYX_ERR(2, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":59 * K_j = SDLK_j * K_k = SDLK_k * K_l = SDLK_l # <<<<<<<<<<<<<< * K_m = SDLK_m * K_n = SDLK_n */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_l, __pyx_t_2) < 0) __PYX_ERR(2, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":60 * K_k = SDLK_k * K_l = SDLK_l * K_m = SDLK_m # <<<<<<<<<<<<<< * K_n = SDLK_n * K_o = SDLK_o */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_m, __pyx_t_2) < 0) __PYX_ERR(2, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":61 * K_l = SDLK_l * K_m = SDLK_m * K_n = SDLK_n # <<<<<<<<<<<<<< * K_o = SDLK_o * K_p = SDLK_p */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_n, __pyx_t_2) < 0) __PYX_ERR(2, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":62 * K_m = SDLK_m * K_n = SDLK_n * K_o = SDLK_o # <<<<<<<<<<<<<< * K_p = SDLK_p * K_q = SDLK_q */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_o); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_o, __pyx_t_2) < 0) __PYX_ERR(2, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":63 * K_n = SDLK_n * K_o = SDLK_o * K_p = SDLK_p # <<<<<<<<<<<<<< * K_q = SDLK_q * K_r = SDLK_r */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_p, __pyx_t_2) < 0) __PYX_ERR(2, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":64 * K_o = SDLK_o * K_p = SDLK_p * K_q = SDLK_q # <<<<<<<<<<<<<< * K_r = SDLK_r * K_s = SDLK_s */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_q); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_q, __pyx_t_2) < 0) __PYX_ERR(2, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":65 * K_p = SDLK_p * K_q = SDLK_q * K_r = SDLK_r # <<<<<<<<<<<<<< * K_s = SDLK_s * K_t = SDLK_t */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_r, __pyx_t_2) < 0) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":66 * K_q = SDLK_q * K_r = SDLK_r * K_s = SDLK_s # <<<<<<<<<<<<<< * K_t = SDLK_t * K_u = SDLK_u */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_s, __pyx_t_2) < 0) __PYX_ERR(2, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":67 * K_r = SDLK_r * K_s = SDLK_s * K_t = SDLK_t # <<<<<<<<<<<<<< * K_u = SDLK_u * K_v = SDLK_v */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_t, __pyx_t_2) < 0) __PYX_ERR(2, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":68 * K_s = SDLK_s * K_t = SDLK_t * K_u = SDLK_u # <<<<<<<<<<<<<< * K_v = SDLK_v * K_w = SDLK_w */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_u); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_u, __pyx_t_2) < 0) __PYX_ERR(2, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":69 * K_t = SDLK_t * K_u = SDLK_u * K_v = SDLK_v # <<<<<<<<<<<<<< * K_w = SDLK_w * K_x = SDLK_x */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_v); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_v, __pyx_t_2) < 0) __PYX_ERR(2, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":70 * K_u = SDLK_u * K_v = SDLK_v * K_w = SDLK_w # <<<<<<<<<<<<<< * K_x = SDLK_x * K_y = SDLK_y */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_w, __pyx_t_2) < 0) __PYX_ERR(2, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":71 * K_v = SDLK_v * K_w = SDLK_w * K_x = SDLK_x # <<<<<<<<<<<<<< * K_y = SDLK_y * K_z = SDLK_z */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_x, __pyx_t_2) < 0) __PYX_ERR(2, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":72 * K_w = SDLK_w * K_x = SDLK_x * K_y = SDLK_y # <<<<<<<<<<<<<< * K_z = SDLK_z * K_CAPSLOCK = SDLK_CAPSLOCK */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_y, __pyx_t_2) < 0) __PYX_ERR(2, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":73 * K_x = SDLK_x * K_y = SDLK_y * K_z = SDLK_z # <<<<<<<<<<<<<< * K_CAPSLOCK = SDLK_CAPSLOCK * K_F1 = SDLK_F1 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_z, __pyx_t_2) < 0) __PYX_ERR(2, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":74 * K_y = SDLK_y * K_z = SDLK_z * K_CAPSLOCK = SDLK_CAPSLOCK # <<<<<<<<<<<<<< * K_F1 = SDLK_F1 * K_F2 = SDLK_F2 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CAPSLOCK); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CAPSLOCK, __pyx_t_2) < 0) __PYX_ERR(2, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":75 * K_z = SDLK_z * K_CAPSLOCK = SDLK_CAPSLOCK * K_F1 = SDLK_F1 # <<<<<<<<<<<<<< * K_F2 = SDLK_F2 * K_F3 = SDLK_F3 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F1, __pyx_t_2) < 0) __PYX_ERR(2, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":76 * K_CAPSLOCK = SDLK_CAPSLOCK * K_F1 = SDLK_F1 * K_F2 = SDLK_F2 # <<<<<<<<<<<<<< * K_F3 = SDLK_F3 * K_F4 = SDLK_F4 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F2, __pyx_t_2) < 0) __PYX_ERR(2, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":77 * K_F1 = SDLK_F1 * K_F2 = SDLK_F2 * K_F3 = SDLK_F3 # <<<<<<<<<<<<<< * K_F4 = SDLK_F4 * K_F5 = SDLK_F5 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F3, __pyx_t_2) < 0) __PYX_ERR(2, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":78 * K_F2 = SDLK_F2 * K_F3 = SDLK_F3 * K_F4 = SDLK_F4 # <<<<<<<<<<<<<< * K_F5 = SDLK_F5 * K_F6 = SDLK_F6 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F4, __pyx_t_2) < 0) __PYX_ERR(2, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":79 * K_F3 = SDLK_F3 * K_F4 = SDLK_F4 * K_F5 = SDLK_F5 # <<<<<<<<<<<<<< * K_F6 = SDLK_F6 * K_F7 = SDLK_F7 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F5); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F5, __pyx_t_2) < 0) __PYX_ERR(2, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":80 * K_F4 = SDLK_F4 * K_F5 = SDLK_F5 * K_F6 = SDLK_F6 # <<<<<<<<<<<<<< * K_F7 = SDLK_F7 * K_F8 = SDLK_F8 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F6); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F6, __pyx_t_2) < 0) __PYX_ERR(2, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":81 * K_F5 = SDLK_F5 * K_F6 = SDLK_F6 * K_F7 = SDLK_F7 # <<<<<<<<<<<<<< * K_F8 = SDLK_F8 * K_F9 = SDLK_F9 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F7, __pyx_t_2) < 0) __PYX_ERR(2, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":82 * K_F6 = SDLK_F6 * K_F7 = SDLK_F7 * K_F8 = SDLK_F8 # <<<<<<<<<<<<<< * K_F9 = SDLK_F9 * K_F10 = SDLK_F10 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F8); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F8, __pyx_t_2) < 0) __PYX_ERR(2, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":83 * K_F7 = SDLK_F7 * K_F8 = SDLK_F8 * K_F9 = SDLK_F9 # <<<<<<<<<<<<<< * K_F10 = SDLK_F10 * K_F11 = SDLK_F11 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F9); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F9, __pyx_t_2) < 0) __PYX_ERR(2, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":84 * K_F8 = SDLK_F8 * K_F9 = SDLK_F9 * K_F10 = SDLK_F10 # <<<<<<<<<<<<<< * K_F11 = SDLK_F11 * K_F12 = SDLK_F12 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F10); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F10, __pyx_t_2) < 0) __PYX_ERR(2, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":85 * K_F9 = SDLK_F9 * K_F10 = SDLK_F10 * K_F11 = SDLK_F11 # <<<<<<<<<<<<<< * K_F12 = SDLK_F12 * K_PRINTSCREEN = SDLK_PRINTSCREEN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F11); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F11, __pyx_t_2) < 0) __PYX_ERR(2, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":86 * K_F10 = SDLK_F10 * K_F11 = SDLK_F11 * K_F12 = SDLK_F12 # <<<<<<<<<<<<<< * K_PRINTSCREEN = SDLK_PRINTSCREEN * K_SCROLLLOCK = SDLK_SCROLLLOCK */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F12); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F12, __pyx_t_2) < 0) __PYX_ERR(2, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":87 * K_F11 = SDLK_F11 * K_F12 = SDLK_F12 * K_PRINTSCREEN = SDLK_PRINTSCREEN # <<<<<<<<<<<<<< * K_SCROLLLOCK = SDLK_SCROLLLOCK * K_PAUSE = SDLK_PAUSE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PRINTSCREEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PRINTSCREEN, __pyx_t_2) < 0) __PYX_ERR(2, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":88 * K_F12 = SDLK_F12 * K_PRINTSCREEN = SDLK_PRINTSCREEN * K_SCROLLLOCK = SDLK_SCROLLLOCK # <<<<<<<<<<<<<< * K_PAUSE = SDLK_PAUSE * K_INSERT = SDLK_INSERT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SCROLLLOCK); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SCROLLLOCK, __pyx_t_2) < 0) __PYX_ERR(2, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":89 * K_PRINTSCREEN = SDLK_PRINTSCREEN * K_SCROLLLOCK = SDLK_SCROLLLOCK * K_PAUSE = SDLK_PAUSE # <<<<<<<<<<<<<< * K_INSERT = SDLK_INSERT * K_HOME = SDLK_HOME */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PAUSE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PAUSE, __pyx_t_2) < 0) __PYX_ERR(2, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":90 * K_SCROLLLOCK = SDLK_SCROLLLOCK * K_PAUSE = SDLK_PAUSE * K_INSERT = SDLK_INSERT # <<<<<<<<<<<<<< * K_HOME = SDLK_HOME * K_PAGEUP = SDLK_PAGEUP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_INSERT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_INSERT, __pyx_t_2) < 0) __PYX_ERR(2, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":91 * K_PAUSE = SDLK_PAUSE * K_INSERT = SDLK_INSERT * K_HOME = SDLK_HOME # <<<<<<<<<<<<<< * K_PAGEUP = SDLK_PAGEUP * K_DELETE = SDLK_DELETE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_HOME); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_HOME, __pyx_t_2) < 0) __PYX_ERR(2, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":92 * K_INSERT = SDLK_INSERT * K_HOME = SDLK_HOME * K_PAGEUP = SDLK_PAGEUP # <<<<<<<<<<<<<< * K_DELETE = SDLK_DELETE * K_END = SDLK_END */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PAGEUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PAGEUP, __pyx_t_2) < 0) __PYX_ERR(2, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":93 * K_HOME = SDLK_HOME * K_PAGEUP = SDLK_PAGEUP * K_DELETE = SDLK_DELETE # <<<<<<<<<<<<<< * K_END = SDLK_END * K_PAGEDOWN = SDLK_PAGEDOWN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_DELETE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DELETE, __pyx_t_2) < 0) __PYX_ERR(2, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":94 * K_PAGEUP = SDLK_PAGEUP * K_DELETE = SDLK_DELETE * K_END = SDLK_END # <<<<<<<<<<<<<< * K_PAGEDOWN = SDLK_PAGEDOWN * K_RIGHT = SDLK_RIGHT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_END); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_END, __pyx_t_2) < 0) __PYX_ERR(2, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":95 * K_DELETE = SDLK_DELETE * K_END = SDLK_END * K_PAGEDOWN = SDLK_PAGEDOWN # <<<<<<<<<<<<<< * K_RIGHT = SDLK_RIGHT * K_LEFT = SDLK_LEFT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PAGEDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PAGEDOWN, __pyx_t_2) < 0) __PYX_ERR(2, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":96 * K_END = SDLK_END * K_PAGEDOWN = SDLK_PAGEDOWN * K_RIGHT = SDLK_RIGHT # <<<<<<<<<<<<<< * K_LEFT = SDLK_LEFT * K_DOWN = SDLK_DOWN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RIGHT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RIGHT, __pyx_t_2) < 0) __PYX_ERR(2, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":97 * K_PAGEDOWN = SDLK_PAGEDOWN * K_RIGHT = SDLK_RIGHT * K_LEFT = SDLK_LEFT # <<<<<<<<<<<<<< * K_DOWN = SDLK_DOWN * K_UP = SDLK_UP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LEFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LEFT, __pyx_t_2) < 0) __PYX_ERR(2, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":98 * K_RIGHT = SDLK_RIGHT * K_LEFT = SDLK_LEFT * K_DOWN = SDLK_DOWN # <<<<<<<<<<<<<< * K_UP = SDLK_UP * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_DOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DOWN, __pyx_t_2) < 0) __PYX_ERR(2, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":99 * K_LEFT = SDLK_LEFT * K_DOWN = SDLK_DOWN * K_UP = SDLK_UP # <<<<<<<<<<<<<< * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * K_KP_DIVIDE = SDLK_KP_DIVIDE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_UP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UP, __pyx_t_2) < 0) __PYX_ERR(2, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":100 * K_DOWN = SDLK_DOWN * K_UP = SDLK_UP * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR # <<<<<<<<<<<<<< * K_KP_DIVIDE = SDLK_KP_DIVIDE * K_KP_MULTIPLY = SDLK_KP_MULTIPLY */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_NUMLOCKCLEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_NUMLOCKCLEAR, __pyx_t_2) < 0) __PYX_ERR(2, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":101 * K_UP = SDLK_UP * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * K_KP_DIVIDE = SDLK_KP_DIVIDE # <<<<<<<<<<<<<< * K_KP_MULTIPLY = SDLK_KP_MULTIPLY * K_KP_MINUS = SDLK_KP_MINUS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_DIVIDE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DIVIDE, __pyx_t_2) < 0) __PYX_ERR(2, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":102 * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * K_KP_DIVIDE = SDLK_KP_DIVIDE * K_KP_MULTIPLY = SDLK_KP_MULTIPLY # <<<<<<<<<<<<<< * K_KP_MINUS = SDLK_KP_MINUS * K_KP_PLUS = SDLK_KP_PLUS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MULTIPLY); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MULTIPLY, __pyx_t_2) < 0) __PYX_ERR(2, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":103 * K_KP_DIVIDE = SDLK_KP_DIVIDE * K_KP_MULTIPLY = SDLK_KP_MULTIPLY * K_KP_MINUS = SDLK_KP_MINUS # <<<<<<<<<<<<<< * K_KP_PLUS = SDLK_KP_PLUS * K_KP_ENTER = SDLK_KP_ENTER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MINUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MINUS, __pyx_t_2) < 0) __PYX_ERR(2, 103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":104 * K_KP_MULTIPLY = SDLK_KP_MULTIPLY * K_KP_MINUS = SDLK_KP_MINUS * K_KP_PLUS = SDLK_KP_PLUS # <<<<<<<<<<<<<< * K_KP_ENTER = SDLK_KP_ENTER * K_KP_1 = SDLK_KP_1 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_PLUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PLUS, __pyx_t_2) < 0) __PYX_ERR(2, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":105 * K_KP_MINUS = SDLK_KP_MINUS * K_KP_PLUS = SDLK_KP_PLUS * K_KP_ENTER = SDLK_KP_ENTER # <<<<<<<<<<<<<< * K_KP_1 = SDLK_KP_1 * K_KP_2 = SDLK_KP_2 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_ENTER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_ENTER, __pyx_t_2) < 0) __PYX_ERR(2, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":106 * K_KP_PLUS = SDLK_KP_PLUS * K_KP_ENTER = SDLK_KP_ENTER * K_KP_1 = SDLK_KP_1 # <<<<<<<<<<<<<< * K_KP_2 = SDLK_KP_2 * K_KP_3 = SDLK_KP_3 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_1, __pyx_t_2) < 0) __PYX_ERR(2, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":107 * K_KP_ENTER = SDLK_KP_ENTER * K_KP_1 = SDLK_KP_1 * K_KP_2 = SDLK_KP_2 # <<<<<<<<<<<<<< * K_KP_3 = SDLK_KP_3 * K_KP_4 = SDLK_KP_4 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_2, __pyx_t_2) < 0) __PYX_ERR(2, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":108 * K_KP_1 = SDLK_KP_1 * K_KP_2 = SDLK_KP_2 * K_KP_3 = SDLK_KP_3 # <<<<<<<<<<<<<< * K_KP_4 = SDLK_KP_4 * K_KP_5 = SDLK_KP_5 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_3, __pyx_t_2) < 0) __PYX_ERR(2, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":109 * K_KP_2 = SDLK_KP_2 * K_KP_3 = SDLK_KP_3 * K_KP_4 = SDLK_KP_4 # <<<<<<<<<<<<<< * K_KP_5 = SDLK_KP_5 * K_KP_6 = SDLK_KP_6 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_4, __pyx_t_2) < 0) __PYX_ERR(2, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":110 * K_KP_3 = SDLK_KP_3 * K_KP_4 = SDLK_KP_4 * K_KP_5 = SDLK_KP_5 # <<<<<<<<<<<<<< * K_KP_6 = SDLK_KP_6 * K_KP_7 = SDLK_KP_7 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_5, __pyx_t_2) < 0) __PYX_ERR(2, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":111 * K_KP_4 = SDLK_KP_4 * K_KP_5 = SDLK_KP_5 * K_KP_6 = SDLK_KP_6 # <<<<<<<<<<<<<< * K_KP_7 = SDLK_KP_7 * K_KP_8 = SDLK_KP_8 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_6, __pyx_t_2) < 0) __PYX_ERR(2, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":112 * K_KP_5 = SDLK_KP_5 * K_KP_6 = SDLK_KP_6 * K_KP_7 = SDLK_KP_7 # <<<<<<<<<<<<<< * K_KP_8 = SDLK_KP_8 * K_KP_9 = SDLK_KP_9 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_7, __pyx_t_2) < 0) __PYX_ERR(2, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":113 * K_KP_6 = SDLK_KP_6 * K_KP_7 = SDLK_KP_7 * K_KP_8 = SDLK_KP_8 # <<<<<<<<<<<<<< * K_KP_9 = SDLK_KP_9 * K_KP_0 = SDLK_KP_0 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_8, __pyx_t_2) < 0) __PYX_ERR(2, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":114 * K_KP_7 = SDLK_KP_7 * K_KP_8 = SDLK_KP_8 * K_KP_9 = SDLK_KP_9 # <<<<<<<<<<<<<< * K_KP_0 = SDLK_KP_0 * K_KP_PERIOD = SDLK_KP_PERIOD */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_9, __pyx_t_2) < 0) __PYX_ERR(2, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":115 * K_KP_8 = SDLK_KP_8 * K_KP_9 = SDLK_KP_9 * K_KP_0 = SDLK_KP_0 # <<<<<<<<<<<<<< * K_KP_PERIOD = SDLK_KP_PERIOD * K_APPLICATION = SDLK_APPLICATION */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_0, __pyx_t_2) < 0) __PYX_ERR(2, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":116 * K_KP_9 = SDLK_KP_9 * K_KP_0 = SDLK_KP_0 * K_KP_PERIOD = SDLK_KP_PERIOD # <<<<<<<<<<<<<< * K_APPLICATION = SDLK_APPLICATION * K_POWER = SDLK_POWER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_PERIOD); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PERIOD, __pyx_t_2) < 0) __PYX_ERR(2, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":117 * K_KP_0 = SDLK_KP_0 * K_KP_PERIOD = SDLK_KP_PERIOD * K_APPLICATION = SDLK_APPLICATION # <<<<<<<<<<<<<< * K_POWER = SDLK_POWER * K_KP_EQUALS = SDLK_KP_EQUALS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_APPLICATION); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_APPLICATION, __pyx_t_2) < 0) __PYX_ERR(2, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":118 * K_KP_PERIOD = SDLK_KP_PERIOD * K_APPLICATION = SDLK_APPLICATION * K_POWER = SDLK_POWER # <<<<<<<<<<<<<< * K_KP_EQUALS = SDLK_KP_EQUALS * K_F13 = SDLK_F13 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_POWER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_POWER, __pyx_t_2) < 0) __PYX_ERR(2, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":119 * K_APPLICATION = SDLK_APPLICATION * K_POWER = SDLK_POWER * K_KP_EQUALS = SDLK_KP_EQUALS # <<<<<<<<<<<<<< * K_F13 = SDLK_F13 * K_F14 = SDLK_F14 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_EQUALS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_EQUALS, __pyx_t_2) < 0) __PYX_ERR(2, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":120 * K_POWER = SDLK_POWER * K_KP_EQUALS = SDLK_KP_EQUALS * K_F13 = SDLK_F13 # <<<<<<<<<<<<<< * K_F14 = SDLK_F14 * K_F15 = SDLK_F15 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F13); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F13, __pyx_t_2) < 0) __PYX_ERR(2, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":121 * K_KP_EQUALS = SDLK_KP_EQUALS * K_F13 = SDLK_F13 * K_F14 = SDLK_F14 # <<<<<<<<<<<<<< * K_F15 = SDLK_F15 * K_F16 = SDLK_F16 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F14); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F14, __pyx_t_2) < 0) __PYX_ERR(2, 121, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":122 * K_F13 = SDLK_F13 * K_F14 = SDLK_F14 * K_F15 = SDLK_F15 # <<<<<<<<<<<<<< * K_F16 = SDLK_F16 * K_F17 = SDLK_F17 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F15); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F15, __pyx_t_2) < 0) __PYX_ERR(2, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":123 * K_F14 = SDLK_F14 * K_F15 = SDLK_F15 * K_F16 = SDLK_F16 # <<<<<<<<<<<<<< * K_F17 = SDLK_F17 * K_F18 = SDLK_F18 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F16); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F16, __pyx_t_2) < 0) __PYX_ERR(2, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":124 * K_F15 = SDLK_F15 * K_F16 = SDLK_F16 * K_F17 = SDLK_F17 # <<<<<<<<<<<<<< * K_F18 = SDLK_F18 * K_F19 = SDLK_F19 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F17); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F17, __pyx_t_2) < 0) __PYX_ERR(2, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":125 * K_F16 = SDLK_F16 * K_F17 = SDLK_F17 * K_F18 = SDLK_F18 # <<<<<<<<<<<<<< * K_F19 = SDLK_F19 * K_F20 = SDLK_F20 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F18); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F18, __pyx_t_2) < 0) __PYX_ERR(2, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":126 * K_F17 = SDLK_F17 * K_F18 = SDLK_F18 * K_F19 = SDLK_F19 # <<<<<<<<<<<<<< * K_F20 = SDLK_F20 * K_F21 = SDLK_F21 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F19); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F19, __pyx_t_2) < 0) __PYX_ERR(2, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":127 * K_F18 = SDLK_F18 * K_F19 = SDLK_F19 * K_F20 = SDLK_F20 # <<<<<<<<<<<<<< * K_F21 = SDLK_F21 * K_F22 = SDLK_F22 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F20); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F20, __pyx_t_2) < 0) __PYX_ERR(2, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":128 * K_F19 = SDLK_F19 * K_F20 = SDLK_F20 * K_F21 = SDLK_F21 # <<<<<<<<<<<<<< * K_F22 = SDLK_F22 * K_F23 = SDLK_F23 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F21); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F21, __pyx_t_2) < 0) __PYX_ERR(2, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":129 * K_F20 = SDLK_F20 * K_F21 = SDLK_F21 * K_F22 = SDLK_F22 # <<<<<<<<<<<<<< * K_F23 = SDLK_F23 * K_F24 = SDLK_F24 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F22); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F22, __pyx_t_2) < 0) __PYX_ERR(2, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":130 * K_F21 = SDLK_F21 * K_F22 = SDLK_F22 * K_F23 = SDLK_F23 # <<<<<<<<<<<<<< * K_F24 = SDLK_F24 * K_EXECUTE = SDLK_EXECUTE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F23); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F23, __pyx_t_2) < 0) __PYX_ERR(2, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":131 * K_F22 = SDLK_F22 * K_F23 = SDLK_F23 * K_F24 = SDLK_F24 # <<<<<<<<<<<<<< * K_EXECUTE = SDLK_EXECUTE * K_HELP = SDLK_HELP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F24); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F24, __pyx_t_2) < 0) __PYX_ERR(2, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":132 * K_F23 = SDLK_F23 * K_F24 = SDLK_F24 * K_EXECUTE = SDLK_EXECUTE # <<<<<<<<<<<<<< * K_HELP = SDLK_HELP * K_MENU = SDLK_MENU */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_EXECUTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EXECUTE, __pyx_t_2) < 0) __PYX_ERR(2, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":133 * K_F24 = SDLK_F24 * K_EXECUTE = SDLK_EXECUTE * K_HELP = SDLK_HELP # <<<<<<<<<<<<<< * K_MENU = SDLK_MENU * K_SELECT = SDLK_SELECT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_HELP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_HELP, __pyx_t_2) < 0) __PYX_ERR(2, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":134 * K_EXECUTE = SDLK_EXECUTE * K_HELP = SDLK_HELP * K_MENU = SDLK_MENU # <<<<<<<<<<<<<< * K_SELECT = SDLK_SELECT * K_STOP = SDLK_STOP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_MENU); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MENU, __pyx_t_2) < 0) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":135 * K_HELP = SDLK_HELP * K_MENU = SDLK_MENU * K_SELECT = SDLK_SELECT # <<<<<<<<<<<<<< * K_STOP = SDLK_STOP * K_AGAIN = SDLK_AGAIN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SELECT, __pyx_t_2) < 0) __PYX_ERR(2, 135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":136 * K_MENU = SDLK_MENU * K_SELECT = SDLK_SELECT * K_STOP = SDLK_STOP # <<<<<<<<<<<<<< * K_AGAIN = SDLK_AGAIN * K_UNDO = SDLK_UNDO */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_STOP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_STOP, __pyx_t_2) < 0) __PYX_ERR(2, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":137 * K_SELECT = SDLK_SELECT * K_STOP = SDLK_STOP * K_AGAIN = SDLK_AGAIN # <<<<<<<<<<<<<< * K_UNDO = SDLK_UNDO * K_CUT = SDLK_CUT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AGAIN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AGAIN, __pyx_t_2) < 0) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":138 * K_STOP = SDLK_STOP * K_AGAIN = SDLK_AGAIN * K_UNDO = SDLK_UNDO # <<<<<<<<<<<<<< * K_CUT = SDLK_CUT * K_COPY = SDLK_COPY */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_UNDO); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UNDO, __pyx_t_2) < 0) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":139 * K_AGAIN = SDLK_AGAIN * K_UNDO = SDLK_UNDO * K_CUT = SDLK_CUT # <<<<<<<<<<<<<< * K_COPY = SDLK_COPY * K_PASTE = SDLK_PASTE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CUT, __pyx_t_2) < 0) __PYX_ERR(2, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":140 * K_UNDO = SDLK_UNDO * K_CUT = SDLK_CUT * K_COPY = SDLK_COPY # <<<<<<<<<<<<<< * K_PASTE = SDLK_PASTE * K_FIND = SDLK_FIND */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_COPY); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COPY, __pyx_t_2) < 0) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":141 * K_CUT = SDLK_CUT * K_COPY = SDLK_COPY * K_PASTE = SDLK_PASTE # <<<<<<<<<<<<<< * K_FIND = SDLK_FIND * K_MUTE = SDLK_MUTE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PASTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PASTE, __pyx_t_2) < 0) __PYX_ERR(2, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":142 * K_COPY = SDLK_COPY * K_PASTE = SDLK_PASTE * K_FIND = SDLK_FIND # <<<<<<<<<<<<<< * K_MUTE = SDLK_MUTE * K_VOLUMEUP = SDLK_VOLUMEUP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_FIND); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_FIND, __pyx_t_2) < 0) __PYX_ERR(2, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":143 * K_PASTE = SDLK_PASTE * K_FIND = SDLK_FIND * K_MUTE = SDLK_MUTE # <<<<<<<<<<<<<< * K_VOLUMEUP = SDLK_VOLUMEUP * K_VOLUMEDOWN = SDLK_VOLUMEDOWN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_MUTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MUTE, __pyx_t_2) < 0) __PYX_ERR(2, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":144 * K_FIND = SDLK_FIND * K_MUTE = SDLK_MUTE * K_VOLUMEUP = SDLK_VOLUMEUP # <<<<<<<<<<<<<< * K_VOLUMEDOWN = SDLK_VOLUMEDOWN * K_KP_COMMA = SDLK_KP_COMMA */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_VOLUMEUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_VOLUMEUP, __pyx_t_2) < 0) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":145 * K_MUTE = SDLK_MUTE * K_VOLUMEUP = SDLK_VOLUMEUP * K_VOLUMEDOWN = SDLK_VOLUMEDOWN # <<<<<<<<<<<<<< * K_KP_COMMA = SDLK_KP_COMMA * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_VOLUMEDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_VOLUMEDOWN, __pyx_t_2) < 0) __PYX_ERR(2, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":146 * K_VOLUMEUP = SDLK_VOLUMEUP * K_VOLUMEDOWN = SDLK_VOLUMEDOWN * K_KP_COMMA = SDLK_KP_COMMA # <<<<<<<<<<<<<< * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * K_ALTERASE = SDLK_ALTERASE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_COMMA); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_COMMA, __pyx_t_2) < 0) __PYX_ERR(2, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":147 * K_VOLUMEDOWN = SDLK_VOLUMEDOWN * K_KP_COMMA = SDLK_KP_COMMA * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 # <<<<<<<<<<<<<< * K_ALTERASE = SDLK_ALTERASE * K_SYSREQ = SDLK_SYSREQ */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_EQUALSAS400); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_EQUALSAS400, __pyx_t_2) < 0) __PYX_ERR(2, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":148 * K_KP_COMMA = SDLK_KP_COMMA * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * K_ALTERASE = SDLK_ALTERASE # <<<<<<<<<<<<<< * K_SYSREQ = SDLK_SYSREQ * K_CANCEL = SDLK_CANCEL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_ALTERASE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_ALTERASE, __pyx_t_2) < 0) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":149 * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * K_ALTERASE = SDLK_ALTERASE * K_SYSREQ = SDLK_SYSREQ # <<<<<<<<<<<<<< * K_CANCEL = SDLK_CANCEL * K_CLEAR = SDLK_CLEAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SYSREQ); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SYSREQ, __pyx_t_2) < 0) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":150 * K_ALTERASE = SDLK_ALTERASE * K_SYSREQ = SDLK_SYSREQ * K_CANCEL = SDLK_CANCEL # <<<<<<<<<<<<<< * K_CLEAR = SDLK_CLEAR * K_PRIOR = SDLK_PRIOR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CANCEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CANCEL, __pyx_t_2) < 0) __PYX_ERR(2, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":151 * K_SYSREQ = SDLK_SYSREQ * K_CANCEL = SDLK_CANCEL * K_CLEAR = SDLK_CLEAR # <<<<<<<<<<<<<< * K_PRIOR = SDLK_PRIOR * K_RETURN2 = SDLK_RETURN2 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CLEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CLEAR, __pyx_t_2) < 0) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":152 * K_CANCEL = SDLK_CANCEL * K_CLEAR = SDLK_CLEAR * K_PRIOR = SDLK_PRIOR # <<<<<<<<<<<<<< * K_RETURN2 = SDLK_RETURN2 * K_SEPARATOR = SDLK_SEPARATOR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PRIOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PRIOR, __pyx_t_2) < 0) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":153 * K_CLEAR = SDLK_CLEAR * K_PRIOR = SDLK_PRIOR * K_RETURN2 = SDLK_RETURN2 # <<<<<<<<<<<<<< * K_SEPARATOR = SDLK_SEPARATOR * K_OUT = SDLK_OUT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RETURN2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RETURN2, __pyx_t_2) < 0) __PYX_ERR(2, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":154 * K_PRIOR = SDLK_PRIOR * K_RETURN2 = SDLK_RETURN2 * K_SEPARATOR = SDLK_SEPARATOR # <<<<<<<<<<<<<< * K_OUT = SDLK_OUT * K_OPER = SDLK_OPER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SEPARATOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SEPARATOR, __pyx_t_2) < 0) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":155 * K_RETURN2 = SDLK_RETURN2 * K_SEPARATOR = SDLK_SEPARATOR * K_OUT = SDLK_OUT # <<<<<<<<<<<<<< * K_OPER = SDLK_OPER * K_CLEARAGAIN = SDLK_CLEARAGAIN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_OUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_OUT, __pyx_t_2) < 0) __PYX_ERR(2, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":156 * K_SEPARATOR = SDLK_SEPARATOR * K_OUT = SDLK_OUT * K_OPER = SDLK_OPER # <<<<<<<<<<<<<< * K_CLEARAGAIN = SDLK_CLEARAGAIN * K_CRSEL = SDLK_CRSEL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_OPER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_OPER, __pyx_t_2) < 0) __PYX_ERR(2, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":157 * K_OUT = SDLK_OUT * K_OPER = SDLK_OPER * K_CLEARAGAIN = SDLK_CLEARAGAIN # <<<<<<<<<<<<<< * K_CRSEL = SDLK_CRSEL * K_EXSEL = SDLK_EXSEL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CLEARAGAIN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CLEARAGAIN, __pyx_t_2) < 0) __PYX_ERR(2, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":158 * K_OPER = SDLK_OPER * K_CLEARAGAIN = SDLK_CLEARAGAIN * K_CRSEL = SDLK_CRSEL # <<<<<<<<<<<<<< * K_EXSEL = SDLK_EXSEL * K_KP_00 = SDLK_KP_00 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CRSEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CRSEL, __pyx_t_2) < 0) __PYX_ERR(2, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":159 * K_CLEARAGAIN = SDLK_CLEARAGAIN * K_CRSEL = SDLK_CRSEL * K_EXSEL = SDLK_EXSEL # <<<<<<<<<<<<<< * K_KP_00 = SDLK_KP_00 * K_KP_000 = SDLK_KP_000 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_EXSEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EXSEL, __pyx_t_2) < 0) __PYX_ERR(2, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":160 * K_CRSEL = SDLK_CRSEL * K_EXSEL = SDLK_EXSEL * K_KP_00 = SDLK_KP_00 # <<<<<<<<<<<<<< * K_KP_000 = SDLK_KP_000 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_00); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_00, __pyx_t_2) < 0) __PYX_ERR(2, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":161 * K_EXSEL = SDLK_EXSEL * K_KP_00 = SDLK_KP_00 * K_KP_000 = SDLK_KP_000 # <<<<<<<<<<<<<< * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_000); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_000, __pyx_t_2) < 0) __PYX_ERR(2, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":162 * K_KP_00 = SDLK_KP_00 * K_KP_000 = SDLK_KP_000 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR # <<<<<<<<<<<<<< * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * K_CURRENCYUNIT = SDLK_CURRENCYUNIT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_THOUSANDSSEPARATOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_THOUSANDSSEPARATOR, __pyx_t_2) < 0) __PYX_ERR(2, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":163 * K_KP_000 = SDLK_KP_000 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR # <<<<<<<<<<<<<< * K_CURRENCYUNIT = SDLK_CURRENCYUNIT * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_DECIMALSEPARATOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DECIMALSEPARATOR, __pyx_t_2) < 0) __PYX_ERR(2, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":164 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * K_CURRENCYUNIT = SDLK_CURRENCYUNIT # <<<<<<<<<<<<<< * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CURRENCYUNIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CURRENCYUNIT, __pyx_t_2) < 0) __PYX_ERR(2, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":165 * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * K_CURRENCYUNIT = SDLK_CURRENCYUNIT * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT # <<<<<<<<<<<<<< * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CURRENCYSUBUNIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CURRENCYSUBUNIT, __pyx_t_2) < 0) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":166 * K_CURRENCYUNIT = SDLK_CURRENCYUNIT * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN # <<<<<<<<<<<<<< * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_LEFTPAREN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_LEFTPAREN, __pyx_t_2) < 0) __PYX_ERR(2, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":167 * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN # <<<<<<<<<<<<<< * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_RIGHTPAREN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_RIGHTPAREN, __pyx_t_2) < 0) __PYX_ERR(2, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":168 * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE # <<<<<<<<<<<<<< * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * K_KP_TAB = SDLK_KP_TAB */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_LEFTBRACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_LEFTBRACE, __pyx_t_2) < 0) __PYX_ERR(2, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":169 * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE # <<<<<<<<<<<<<< * K_KP_TAB = SDLK_KP_TAB * K_KP_BACKSPACE = SDLK_KP_BACKSPACE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_RIGHTBRACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_RIGHTBRACE, __pyx_t_2) < 0) __PYX_ERR(2, 169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":170 * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * K_KP_TAB = SDLK_KP_TAB # <<<<<<<<<<<<<< * K_KP_BACKSPACE = SDLK_KP_BACKSPACE * K_KP_A = SDLK_KP_A */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_TAB); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_TAB, __pyx_t_2) < 0) __PYX_ERR(2, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":171 * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * K_KP_TAB = SDLK_KP_TAB * K_KP_BACKSPACE = SDLK_KP_BACKSPACE # <<<<<<<<<<<<<< * K_KP_A = SDLK_KP_A * K_KP_B = SDLK_KP_B */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_BACKSPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_BACKSPACE, __pyx_t_2) < 0) __PYX_ERR(2, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":172 * K_KP_TAB = SDLK_KP_TAB * K_KP_BACKSPACE = SDLK_KP_BACKSPACE * K_KP_A = SDLK_KP_A # <<<<<<<<<<<<<< * K_KP_B = SDLK_KP_B * K_KP_C = SDLK_KP_C */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_A); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_A, __pyx_t_2) < 0) __PYX_ERR(2, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":173 * K_KP_BACKSPACE = SDLK_KP_BACKSPACE * K_KP_A = SDLK_KP_A * K_KP_B = SDLK_KP_B # <<<<<<<<<<<<<< * K_KP_C = SDLK_KP_C * K_KP_D = SDLK_KP_D */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_B); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_B, __pyx_t_2) < 0) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":174 * K_KP_A = SDLK_KP_A * K_KP_B = SDLK_KP_B * K_KP_C = SDLK_KP_C # <<<<<<<<<<<<<< * K_KP_D = SDLK_KP_D * K_KP_E = SDLK_KP_E */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_C); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_C, __pyx_t_2) < 0) __PYX_ERR(2, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":175 * K_KP_B = SDLK_KP_B * K_KP_C = SDLK_KP_C * K_KP_D = SDLK_KP_D # <<<<<<<<<<<<<< * K_KP_E = SDLK_KP_E * K_KP_F = SDLK_KP_F */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_D); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_D, __pyx_t_2) < 0) __PYX_ERR(2, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":176 * K_KP_C = SDLK_KP_C * K_KP_D = SDLK_KP_D * K_KP_E = SDLK_KP_E # <<<<<<<<<<<<<< * K_KP_F = SDLK_KP_F * K_KP_XOR = SDLK_KP_XOR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_E); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_E, __pyx_t_2) < 0) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":177 * K_KP_D = SDLK_KP_D * K_KP_E = SDLK_KP_E * K_KP_F = SDLK_KP_F # <<<<<<<<<<<<<< * K_KP_XOR = SDLK_KP_XOR * K_KP_POWER = SDLK_KP_POWER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_F); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_F, __pyx_t_2) < 0) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":178 * K_KP_E = SDLK_KP_E * K_KP_F = SDLK_KP_F * K_KP_XOR = SDLK_KP_XOR # <<<<<<<<<<<<<< * K_KP_POWER = SDLK_KP_POWER * K_KP_PERCENT = SDLK_KP_PERCENT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_XOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_XOR, __pyx_t_2) < 0) __PYX_ERR(2, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":179 * K_KP_F = SDLK_KP_F * K_KP_XOR = SDLK_KP_XOR * K_KP_POWER = SDLK_KP_POWER # <<<<<<<<<<<<<< * K_KP_PERCENT = SDLK_KP_PERCENT * K_KP_LESS = SDLK_KP_LESS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_POWER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_POWER, __pyx_t_2) < 0) __PYX_ERR(2, 179, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":180 * K_KP_XOR = SDLK_KP_XOR * K_KP_POWER = SDLK_KP_POWER * K_KP_PERCENT = SDLK_KP_PERCENT # <<<<<<<<<<<<<< * K_KP_LESS = SDLK_KP_LESS * K_KP_GREATER = SDLK_KP_GREATER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_PERCENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PERCENT, __pyx_t_2) < 0) __PYX_ERR(2, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":181 * K_KP_POWER = SDLK_KP_POWER * K_KP_PERCENT = SDLK_KP_PERCENT * K_KP_LESS = SDLK_KP_LESS # <<<<<<<<<<<<<< * K_KP_GREATER = SDLK_KP_GREATER * K_KP_AMPERSAND = SDLK_KP_AMPERSAND */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_LESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_LESS, __pyx_t_2) < 0) __PYX_ERR(2, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":182 * K_KP_PERCENT = SDLK_KP_PERCENT * K_KP_LESS = SDLK_KP_LESS * K_KP_GREATER = SDLK_KP_GREATER # <<<<<<<<<<<<<< * K_KP_AMPERSAND = SDLK_KP_AMPERSAND * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_GREATER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_GREATER, __pyx_t_2) < 0) __PYX_ERR(2, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":183 * K_KP_LESS = SDLK_KP_LESS * K_KP_GREATER = SDLK_KP_GREATER * K_KP_AMPERSAND = SDLK_KP_AMPERSAND # <<<<<<<<<<<<<< * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_AMPERSAND); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_AMPERSAND, __pyx_t_2) < 0) __PYX_ERR(2, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":184 * K_KP_GREATER = SDLK_KP_GREATER * K_KP_AMPERSAND = SDLK_KP_AMPERSAND * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND # <<<<<<<<<<<<<< * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_DBLAMPERSAND); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DBLAMPERSAND, __pyx_t_2) < 0) __PYX_ERR(2, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":185 * K_KP_AMPERSAND = SDLK_KP_AMPERSAND * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR # <<<<<<<<<<<<<< * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * K_KP_COLON = SDLK_KP_COLON */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_VERTICALBAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_VERTICALBAR, __pyx_t_2) < 0) __PYX_ERR(2, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":186 * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR # <<<<<<<<<<<<<< * K_KP_COLON = SDLK_KP_COLON * K_KP_HASH = SDLK_KP_HASH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_DBLVERTICALBAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DBLVERTICALBAR, __pyx_t_2) < 0) __PYX_ERR(2, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":187 * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * K_KP_COLON = SDLK_KP_COLON # <<<<<<<<<<<<<< * K_KP_HASH = SDLK_KP_HASH * K_KP_SPACE = SDLK_KP_SPACE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_COLON); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_COLON, __pyx_t_2) < 0) __PYX_ERR(2, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":188 * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * K_KP_COLON = SDLK_KP_COLON * K_KP_HASH = SDLK_KP_HASH # <<<<<<<<<<<<<< * K_KP_SPACE = SDLK_KP_SPACE * K_KP_AT = SDLK_KP_AT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_HASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_HASH, __pyx_t_2) < 0) __PYX_ERR(2, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":189 * K_KP_COLON = SDLK_KP_COLON * K_KP_HASH = SDLK_KP_HASH * K_KP_SPACE = SDLK_KP_SPACE # <<<<<<<<<<<<<< * K_KP_AT = SDLK_KP_AT * K_KP_EXCLAM = SDLK_KP_EXCLAM */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_SPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_SPACE, __pyx_t_2) < 0) __PYX_ERR(2, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":190 * K_KP_HASH = SDLK_KP_HASH * K_KP_SPACE = SDLK_KP_SPACE * K_KP_AT = SDLK_KP_AT # <<<<<<<<<<<<<< * K_KP_EXCLAM = SDLK_KP_EXCLAM * K_KP_MEMSTORE = SDLK_KP_MEMSTORE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_AT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_AT, __pyx_t_2) < 0) __PYX_ERR(2, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":191 * K_KP_SPACE = SDLK_KP_SPACE * K_KP_AT = SDLK_KP_AT * K_KP_EXCLAM = SDLK_KP_EXCLAM # <<<<<<<<<<<<<< * K_KP_MEMSTORE = SDLK_KP_MEMSTORE * K_KP_MEMRECALL = SDLK_KP_MEMRECALL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_EXCLAM); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_EXCLAM, __pyx_t_2) < 0) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":192 * K_KP_AT = SDLK_KP_AT * K_KP_EXCLAM = SDLK_KP_EXCLAM * K_KP_MEMSTORE = SDLK_KP_MEMSTORE # <<<<<<<<<<<<<< * K_KP_MEMRECALL = SDLK_KP_MEMRECALL * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMSTORE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMSTORE, __pyx_t_2) < 0) __PYX_ERR(2, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":193 * K_KP_EXCLAM = SDLK_KP_EXCLAM * K_KP_MEMSTORE = SDLK_KP_MEMSTORE * K_KP_MEMRECALL = SDLK_KP_MEMRECALL # <<<<<<<<<<<<<< * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR * K_KP_MEMADD = SDLK_KP_MEMADD */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMRECALL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMRECALL, __pyx_t_2) < 0) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":194 * K_KP_MEMSTORE = SDLK_KP_MEMSTORE * K_KP_MEMRECALL = SDLK_KP_MEMRECALL * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR # <<<<<<<<<<<<<< * K_KP_MEMADD = SDLK_KP_MEMADD * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMCLEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMCLEAR, __pyx_t_2) < 0) __PYX_ERR(2, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":195 * K_KP_MEMRECALL = SDLK_KP_MEMRECALL * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR * K_KP_MEMADD = SDLK_KP_MEMADD # <<<<<<<<<<<<<< * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMADD); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMADD, __pyx_t_2) < 0) __PYX_ERR(2, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":196 * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR * K_KP_MEMADD = SDLK_KP_MEMADD * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT # <<<<<<<<<<<<<< * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMSUBTRACT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMSUBTRACT, __pyx_t_2) < 0) __PYX_ERR(2, 196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":197 * K_KP_MEMADD = SDLK_KP_MEMADD * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY # <<<<<<<<<<<<<< * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMMULTIPLY); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMMULTIPLY, __pyx_t_2) < 0) __PYX_ERR(2, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":198 * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE # <<<<<<<<<<<<<< * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS * K_KP_CLEAR = SDLK_KP_CLEAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMDIVIDE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMDIVIDE, __pyx_t_2) < 0) __PYX_ERR(2, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":199 * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS # <<<<<<<<<<<<<< * K_KP_CLEAR = SDLK_KP_CLEAR * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_PLUSMINUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PLUSMINUS, __pyx_t_2) < 0) __PYX_ERR(2, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":200 * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS * K_KP_CLEAR = SDLK_KP_CLEAR # <<<<<<<<<<<<<< * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY * K_KP_BINARY = SDLK_KP_BINARY */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_CLEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_CLEAR, __pyx_t_2) < 0) __PYX_ERR(2, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":201 * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS * K_KP_CLEAR = SDLK_KP_CLEAR * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY # <<<<<<<<<<<<<< * K_KP_BINARY = SDLK_KP_BINARY * K_KP_OCTAL = SDLK_KP_OCTAL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_CLEARENTRY); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_CLEARENTRY, __pyx_t_2) < 0) __PYX_ERR(2, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":202 * K_KP_CLEAR = SDLK_KP_CLEAR * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY * K_KP_BINARY = SDLK_KP_BINARY # <<<<<<<<<<<<<< * K_KP_OCTAL = SDLK_KP_OCTAL * K_KP_DECIMAL = SDLK_KP_DECIMAL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_BINARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_BINARY, __pyx_t_2) < 0) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":203 * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY * K_KP_BINARY = SDLK_KP_BINARY * K_KP_OCTAL = SDLK_KP_OCTAL # <<<<<<<<<<<<<< * K_KP_DECIMAL = SDLK_KP_DECIMAL * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_OCTAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_OCTAL, __pyx_t_2) < 0) __PYX_ERR(2, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":204 * K_KP_BINARY = SDLK_KP_BINARY * K_KP_OCTAL = SDLK_KP_OCTAL * K_KP_DECIMAL = SDLK_KP_DECIMAL # <<<<<<<<<<<<<< * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * K_LCTRL = SDLK_LCTRL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_DECIMAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DECIMAL, __pyx_t_2) < 0) __PYX_ERR(2, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":205 * K_KP_OCTAL = SDLK_KP_OCTAL * K_KP_DECIMAL = SDLK_KP_DECIMAL * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL # <<<<<<<<<<<<<< * K_LCTRL = SDLK_LCTRL * K_LSHIFT = SDLK_LSHIFT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_HEXADECIMAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_HEXADECIMAL, __pyx_t_2) < 0) __PYX_ERR(2, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":206 * K_KP_DECIMAL = SDLK_KP_DECIMAL * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * K_LCTRL = SDLK_LCTRL # <<<<<<<<<<<<<< * K_LSHIFT = SDLK_LSHIFT * K_LALT = SDLK_LALT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LCTRL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LCTRL, __pyx_t_2) < 0) __PYX_ERR(2, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":207 * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * K_LCTRL = SDLK_LCTRL * K_LSHIFT = SDLK_LSHIFT # <<<<<<<<<<<<<< * K_LALT = SDLK_LALT * K_LGUI = SDLK_LGUI */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LSHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LSHIFT, __pyx_t_2) < 0) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":208 * K_LCTRL = SDLK_LCTRL * K_LSHIFT = SDLK_LSHIFT * K_LALT = SDLK_LALT # <<<<<<<<<<<<<< * K_LGUI = SDLK_LGUI * K_RCTRL = SDLK_RCTRL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LALT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LALT, __pyx_t_2) < 0) __PYX_ERR(2, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":209 * K_LSHIFT = SDLK_LSHIFT * K_LALT = SDLK_LALT * K_LGUI = SDLK_LGUI # <<<<<<<<<<<<<< * K_RCTRL = SDLK_RCTRL * K_RSHIFT = SDLK_RSHIFT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LGUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LGUI, __pyx_t_2) < 0) __PYX_ERR(2, 209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":210 * K_LALT = SDLK_LALT * K_LGUI = SDLK_LGUI * K_RCTRL = SDLK_RCTRL # <<<<<<<<<<<<<< * K_RSHIFT = SDLK_RSHIFT * K_RALT = SDLK_RALT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RCTRL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RCTRL, __pyx_t_2) < 0) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":211 * K_LGUI = SDLK_LGUI * K_RCTRL = SDLK_RCTRL * K_RSHIFT = SDLK_RSHIFT # <<<<<<<<<<<<<< * K_RALT = SDLK_RALT * K_RGUI = SDLK_RGUI */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RSHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RSHIFT, __pyx_t_2) < 0) __PYX_ERR(2, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":212 * K_RCTRL = SDLK_RCTRL * K_RSHIFT = SDLK_RSHIFT * K_RALT = SDLK_RALT # <<<<<<<<<<<<<< * K_RGUI = SDLK_RGUI * K_MODE = SDLK_MODE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RALT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RALT, __pyx_t_2) < 0) __PYX_ERR(2, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":213 * K_RSHIFT = SDLK_RSHIFT * K_RALT = SDLK_RALT * K_RGUI = SDLK_RGUI # <<<<<<<<<<<<<< * K_MODE = SDLK_MODE * K_AUDIONEXT = SDLK_AUDIONEXT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RGUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RGUI, __pyx_t_2) < 0) __PYX_ERR(2, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":214 * K_RALT = SDLK_RALT * K_RGUI = SDLK_RGUI * K_MODE = SDLK_MODE # <<<<<<<<<<<<<< * K_AUDIONEXT = SDLK_AUDIONEXT * K_AUDIOPREV = SDLK_AUDIOPREV */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_MODE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MODE, __pyx_t_2) < 0) __PYX_ERR(2, 214, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":215 * K_RGUI = SDLK_RGUI * K_MODE = SDLK_MODE * K_AUDIONEXT = SDLK_AUDIONEXT # <<<<<<<<<<<<<< * K_AUDIOPREV = SDLK_AUDIOPREV * K_AUDIOSTOP = SDLK_AUDIOSTOP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIONEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIONEXT, __pyx_t_2) < 0) __PYX_ERR(2, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":216 * K_MODE = SDLK_MODE * K_AUDIONEXT = SDLK_AUDIONEXT * K_AUDIOPREV = SDLK_AUDIOPREV # <<<<<<<<<<<<<< * K_AUDIOSTOP = SDLK_AUDIOSTOP * K_AUDIOPLAY = SDLK_AUDIOPLAY */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIOPREV); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOPREV, __pyx_t_2) < 0) __PYX_ERR(2, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":217 * K_AUDIONEXT = SDLK_AUDIONEXT * K_AUDIOPREV = SDLK_AUDIOPREV * K_AUDIOSTOP = SDLK_AUDIOSTOP # <<<<<<<<<<<<<< * K_AUDIOPLAY = SDLK_AUDIOPLAY * K_AUDIOMUTE = SDLK_AUDIOMUTE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIOSTOP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOSTOP, __pyx_t_2) < 0) __PYX_ERR(2, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":218 * K_AUDIOPREV = SDLK_AUDIOPREV * K_AUDIOSTOP = SDLK_AUDIOSTOP * K_AUDIOPLAY = SDLK_AUDIOPLAY # <<<<<<<<<<<<<< * K_AUDIOMUTE = SDLK_AUDIOMUTE * K_MEDIASELECT = SDLK_MEDIASELECT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIOPLAY); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOPLAY, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":219 * K_AUDIOSTOP = SDLK_AUDIOSTOP * K_AUDIOPLAY = SDLK_AUDIOPLAY * K_AUDIOMUTE = SDLK_AUDIOMUTE # <<<<<<<<<<<<<< * K_MEDIASELECT = SDLK_MEDIASELECT * K_WWW = SDLK_WWW */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIOMUTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOMUTE, __pyx_t_2) < 0) __PYX_ERR(2, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":220 * K_AUDIOPLAY = SDLK_AUDIOPLAY * K_AUDIOMUTE = SDLK_AUDIOMUTE * K_MEDIASELECT = SDLK_MEDIASELECT # <<<<<<<<<<<<<< * K_WWW = SDLK_WWW * K_MAIL = SDLK_MAIL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_MEDIASELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MEDIASELECT, __pyx_t_2) < 0) __PYX_ERR(2, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":221 * K_AUDIOMUTE = SDLK_AUDIOMUTE * K_MEDIASELECT = SDLK_MEDIASELECT * K_WWW = SDLK_WWW # <<<<<<<<<<<<<< * K_MAIL = SDLK_MAIL * K_CALCULATOR = SDLK_CALCULATOR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_WWW); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_WWW, __pyx_t_2) < 0) __PYX_ERR(2, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":222 * K_MEDIASELECT = SDLK_MEDIASELECT * K_WWW = SDLK_WWW * K_MAIL = SDLK_MAIL # <<<<<<<<<<<<<< * K_CALCULATOR = SDLK_CALCULATOR * K_COMPUTER = SDLK_COMPUTER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_MAIL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MAIL, __pyx_t_2) < 0) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":223 * K_WWW = SDLK_WWW * K_MAIL = SDLK_MAIL * K_CALCULATOR = SDLK_CALCULATOR # <<<<<<<<<<<<<< * K_COMPUTER = SDLK_COMPUTER * K_AC_SEARCH = SDLK_AC_SEARCH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CALCULATOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CALCULATOR, __pyx_t_2) < 0) __PYX_ERR(2, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":224 * K_MAIL = SDLK_MAIL * K_CALCULATOR = SDLK_CALCULATOR * K_COMPUTER = SDLK_COMPUTER # <<<<<<<<<<<<<< * K_AC_SEARCH = SDLK_AC_SEARCH * K_AC_HOME = SDLK_AC_HOME */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_COMPUTER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COMPUTER, __pyx_t_2) < 0) __PYX_ERR(2, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":225 * K_CALCULATOR = SDLK_CALCULATOR * K_COMPUTER = SDLK_COMPUTER * K_AC_SEARCH = SDLK_AC_SEARCH # <<<<<<<<<<<<<< * K_AC_HOME = SDLK_AC_HOME * K_AC_BACK = SDLK_AC_BACK */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_SEARCH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_SEARCH, __pyx_t_2) < 0) __PYX_ERR(2, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":226 * K_COMPUTER = SDLK_COMPUTER * K_AC_SEARCH = SDLK_AC_SEARCH * K_AC_HOME = SDLK_AC_HOME # <<<<<<<<<<<<<< * K_AC_BACK = SDLK_AC_BACK * K_AC_FORWARD = SDLK_AC_FORWARD */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_HOME); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_HOME, __pyx_t_2) < 0) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":227 * K_AC_SEARCH = SDLK_AC_SEARCH * K_AC_HOME = SDLK_AC_HOME * K_AC_BACK = SDLK_AC_BACK # <<<<<<<<<<<<<< * K_AC_FORWARD = SDLK_AC_FORWARD * K_AC_STOP = SDLK_AC_STOP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_BACK); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_BACK, __pyx_t_2) < 0) __PYX_ERR(2, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":228 * K_AC_HOME = SDLK_AC_HOME * K_AC_BACK = SDLK_AC_BACK * K_AC_FORWARD = SDLK_AC_FORWARD # <<<<<<<<<<<<<< * K_AC_STOP = SDLK_AC_STOP * K_AC_REFRESH = SDLK_AC_REFRESH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_FORWARD); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_FORWARD, __pyx_t_2) < 0) __PYX_ERR(2, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":229 * K_AC_BACK = SDLK_AC_BACK * K_AC_FORWARD = SDLK_AC_FORWARD * K_AC_STOP = SDLK_AC_STOP # <<<<<<<<<<<<<< * K_AC_REFRESH = SDLK_AC_REFRESH * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_STOP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_STOP, __pyx_t_2) < 0) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":230 * K_AC_FORWARD = SDLK_AC_FORWARD * K_AC_STOP = SDLK_AC_STOP * K_AC_REFRESH = SDLK_AC_REFRESH # <<<<<<<<<<<<<< * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_REFRESH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_REFRESH, __pyx_t_2) < 0) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":231 * K_AC_STOP = SDLK_AC_STOP * K_AC_REFRESH = SDLK_AC_REFRESH * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS # <<<<<<<<<<<<<< * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_BOOKMARKS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_BOOKMARKS, __pyx_t_2) < 0) __PYX_ERR(2, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":232 * K_AC_REFRESH = SDLK_AC_REFRESH * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN # <<<<<<<<<<<<<< * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_BRIGHTNESSDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BRIGHTNESSDOWN, __pyx_t_2) < 0) __PYX_ERR(2, 232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":233 * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP # <<<<<<<<<<<<<< * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_BRIGHTNESSUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BRIGHTNESSUP, __pyx_t_2) < 0) __PYX_ERR(2, 233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":234 * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH # <<<<<<<<<<<<<< * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_DISPLAYSWITCH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DISPLAYSWITCH, __pyx_t_2) < 0) __PYX_ERR(2, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":235 * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE # <<<<<<<<<<<<<< * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN * K_KBDILLUMUP = SDLK_KBDILLUMUP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KBDILLUMTOGGLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KBDILLUMTOGGLE, __pyx_t_2) < 0) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":236 * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN # <<<<<<<<<<<<<< * K_KBDILLUMUP = SDLK_KBDILLUMUP * K_EJECT = SDLK_EJECT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KBDILLUMDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KBDILLUMDOWN, __pyx_t_2) < 0) __PYX_ERR(2, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":237 * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN * K_KBDILLUMUP = SDLK_KBDILLUMUP # <<<<<<<<<<<<<< * K_EJECT = SDLK_EJECT * K_SLEEP = SDLK_SLEEP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KBDILLUMUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KBDILLUMUP, __pyx_t_2) < 0) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":238 * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN * K_KBDILLUMUP = SDLK_KBDILLUMUP * K_EJECT = SDLK_EJECT # <<<<<<<<<<<<<< * K_SLEEP = SDLK_SLEEP * K_APP1 = SDLK_APP1 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_EJECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EJECT, __pyx_t_2) < 0) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":239 * K_KBDILLUMUP = SDLK_KBDILLUMUP * K_EJECT = SDLK_EJECT * K_SLEEP = SDLK_SLEEP # <<<<<<<<<<<<<< * K_APP1 = SDLK_APP1 * K_APP2 = SDLK_APP2 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SLEEP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SLEEP, __pyx_t_2) < 0) __PYX_ERR(2, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":240 * K_EJECT = SDLK_EJECT * K_SLEEP = SDLK_SLEEP * K_APP1 = SDLK_APP1 # <<<<<<<<<<<<<< * K_APP2 = SDLK_APP2 * K_AUDIOREWIND = SDLK_AUDIOREWIND */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_APP1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_APP1, __pyx_t_2) < 0) __PYX_ERR(2, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":241 * K_SLEEP = SDLK_SLEEP * K_APP1 = SDLK_APP1 * K_APP2 = SDLK_APP2 # <<<<<<<<<<<<<< * K_AUDIOREWIND = SDLK_AUDIOREWIND * K_AUDIOFASTFORWARD = SDLK_AUDIOFASTFORWARD */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_APP2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_APP2, __pyx_t_2) < 0) __PYX_ERR(2, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":242 * K_APP1 = SDLK_APP1 * K_APP2 = SDLK_APP2 * K_AUDIOREWIND = SDLK_AUDIOREWIND # <<<<<<<<<<<<<< * K_AUDIOFASTFORWARD = SDLK_AUDIOFASTFORWARD */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIOREWIND); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOREWIND, __pyx_t_2) < 0) __PYX_ERR(2, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":243 * K_APP2 = SDLK_APP2 * K_AUDIOREWIND = SDLK_AUDIOREWIND * K_AUDIOFASTFORWARD = SDLK_AUDIOFASTFORWARD # <<<<<<<<<<<<<< */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIOFASTFORWARD); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOFASTFORWARD, __pyx_t_2) < 0) __PYX_ERR(2, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":1 * GL_RED_SIZE = SDL_GL_RED_SIZE # <<<<<<<<<<<<<< * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_RED_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_RED_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":2 * GL_RED_SIZE = SDL_GL_RED_SIZE * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE # <<<<<<<<<<<<<< * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_GREEN_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_GREEN_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":3 * GL_RED_SIZE = SDL_GL_RED_SIZE * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE # <<<<<<<<<<<<<< * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_BLUE_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_BLUE_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":4 * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE # <<<<<<<<<<<<<< * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ALPHA_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ALPHA_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":5 * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE # <<<<<<<<<<<<<< * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_BUFFER_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_BUFFER_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":6 * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER # <<<<<<<<<<<<<< * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_DOUBLEBUFFER); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_DOUBLEBUFFER, __pyx_t_2) < 0) __PYX_ERR(3, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":7 * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE # <<<<<<<<<<<<<< * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_DEPTH_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_DEPTH_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":8 * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_STENCIL_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_STENCIL_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":9 * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_RED_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_RED_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":10 * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_GREEN_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_GREEN_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":11 * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE * GL_STEREO = SDL_GL_STEREO */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_BLUE_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_BLUE_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":12 * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE # <<<<<<<<<<<<<< * GL_STEREO = SDL_GL_STEREO * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_ALPHA_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_ALPHA_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":13 * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE * GL_STEREO = SDL_GL_STEREO # <<<<<<<<<<<<<< * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_STEREO); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_STEREO, __pyx_t_2) < 0) __PYX_ERR(3, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":14 * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE * GL_STEREO = SDL_GL_STEREO * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS # <<<<<<<<<<<<<< * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_MULTISAMPLEBUFFERS); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_MULTISAMPLEBUFFERS, __pyx_t_2) < 0) __PYX_ERR(3, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":15 * GL_STEREO = SDL_GL_STEREO * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES # <<<<<<<<<<<<<< * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_MULTISAMPLESAMPLES); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_MULTISAMPLESAMPLES, __pyx_t_2) < 0) __PYX_ERR(3, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":16 * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL # <<<<<<<<<<<<<< * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCELERATED_VISUAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCELERATED_VISUAL, __pyx_t_2) < 0) __PYX_ERR(3, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":17 * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING # <<<<<<<<<<<<<< * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_RETAINED_BACKING); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_RETAINED_BACKING, __pyx_t_2) < 0) __PYX_ERR(3, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":18 * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION # <<<<<<<<<<<<<< * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_MAJOR_VERSION); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_MAJOR_VERSION, __pyx_t_2) < 0) __PYX_ERR(3, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":19 * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION # <<<<<<<<<<<<<< * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_MINOR_VERSION); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_MINOR_VERSION, __pyx_t_2) < 0) __PYX_ERR(3, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":20 * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL # <<<<<<<<<<<<<< * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_EGL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_EGL, __pyx_t_2) < 0) __PYX_ERR(3, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":21 * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS # <<<<<<<<<<<<<< * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_FLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_FLAGS, __pyx_t_2) < 0) __PYX_ERR(3, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":22 * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK # <<<<<<<<<<<<<< * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_PROFILE_MASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_PROFILE_MASK, __pyx_t_2) < 0) __PYX_ERR(3, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":23 * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT # <<<<<<<<<<<<<< * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE * GL_CONTEXT_RELEASE_BEHAVIOR = SDL_GL_CONTEXT_RELEASE_BEHAVIOR */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_SHARE_WITH_CURRENT_CONTEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT, __pyx_t_2) < 0) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":24 * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE # <<<<<<<<<<<<<< * GL_CONTEXT_RELEASE_BEHAVIOR = SDL_GL_CONTEXT_RELEASE_BEHAVIOR * GL_CONTEXT_RESET_NOTIFICATION = SDL_GL_CONTEXT_RESET_NOTIFICATION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE, __pyx_t_2) < 0) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":25 * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE * GL_CONTEXT_RELEASE_BEHAVIOR = SDL_GL_CONTEXT_RELEASE_BEHAVIOR # <<<<<<<<<<<<<< * GL_CONTEXT_RESET_NOTIFICATION = SDL_GL_CONTEXT_RESET_NOTIFICATION * GL_CONTEXT_NO_ERROR = SDL_GL_CONTEXT_NO_ERROR */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_RELEASE_BEHAVIOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR, __pyx_t_2) < 0) __PYX_ERR(3, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":26 * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE * GL_CONTEXT_RELEASE_BEHAVIOR = SDL_GL_CONTEXT_RELEASE_BEHAVIOR * GL_CONTEXT_RESET_NOTIFICATION = SDL_GL_CONTEXT_RESET_NOTIFICATION # <<<<<<<<<<<<<< * GL_CONTEXT_NO_ERROR = SDL_GL_CONTEXT_NO_ERROR */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_RESET_NOTIFICATION); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION, __pyx_t_2) < 0) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":27 * GL_CONTEXT_RELEASE_BEHAVIOR = SDL_GL_CONTEXT_RELEASE_BEHAVIOR * GL_CONTEXT_RESET_NOTIFICATION = SDL_GL_CONTEXT_RESET_NOTIFICATION * GL_CONTEXT_NO_ERROR = SDL_GL_CONTEXT_NO_ERROR # <<<<<<<<<<<<<< */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_NO_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_NO_ERROR, __pyx_t_2) < 0) __PYX_ERR(3, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":16 * * include "glattr.pxi" * GL_SWAP_CONTROL = -1 # <<<<<<<<<<<<<< * * GL_CONTEXT_PROFILE_CORE = SDL_GL_CONTEXT_PROFILE_CORE */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SWAP_CONTROL, __pyx_int_neg_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":18 * GL_SWAP_CONTROL = -1 * * GL_CONTEXT_PROFILE_CORE = SDL_GL_CONTEXT_PROFILE_CORE # <<<<<<<<<<<<<< * GL_CONTEXT_PROFILE_COMPATIBILITY = SDL_GL_CONTEXT_PROFILE_COMPATIBILITY * GL_CONTEXT_PROFILE_ES = SDL_GL_CONTEXT_PROFILE_ES */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLprofile(SDL_GL_CONTEXT_PROFILE_CORE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_PROFILE_CORE, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":19 * * GL_CONTEXT_PROFILE_CORE = SDL_GL_CONTEXT_PROFILE_CORE * GL_CONTEXT_PROFILE_COMPATIBILITY = SDL_GL_CONTEXT_PROFILE_COMPATIBILITY # <<<<<<<<<<<<<< * GL_CONTEXT_PROFILE_ES = SDL_GL_CONTEXT_PROFILE_ES * */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLprofile(SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":20 * GL_CONTEXT_PROFILE_CORE = SDL_GL_CONTEXT_PROFILE_CORE * GL_CONTEXT_PROFILE_COMPATIBILITY = SDL_GL_CONTEXT_PROFILE_COMPATIBILITY * GL_CONTEXT_PROFILE_ES = SDL_GL_CONTEXT_PROFILE_ES # <<<<<<<<<<<<<< * * RLEACCEL = SDL_RLEACCEL */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLprofile(SDL_GL_CONTEXT_PROFILE_ES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_PROFILE_ES, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":22 * GL_CONTEXT_PROFILE_ES = SDL_GL_CONTEXT_PROFILE_ES * * RLEACCEL = SDL_RLEACCEL # <<<<<<<<<<<<<< * SRCCOLORKEY = 0 * */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_RLEACCEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RLEACCEL, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":23 * * RLEACCEL = SDL_RLEACCEL * SRCCOLORKEY = 0 # <<<<<<<<<<<<<< * * # Surface flags. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCCOLORKEY, __pyx_int_0) < 0) __PYX_ERR(0, 23, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":26 * * # Surface flags. * SRCALPHA = 0x80000000 # <<<<<<<<<<<<<< * HWSURFACE = 0x40000000 * SWSURFACE = 0 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_int_2147483648) < 0) __PYX_ERR(0, 26, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":27 * # Surface flags. * SRCALPHA = 0x80000000 * HWSURFACE = 0x40000000 # <<<<<<<<<<<<<< * SWSURFACE = 0 * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_HWSURFACE, __pyx_int_1073741824) < 0) __PYX_ERR(0, 27, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":28 * SRCALPHA = 0x80000000 * HWSURFACE = 0x40000000 * SWSURFACE = 0 # <<<<<<<<<<<<<< * * # Window flags. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SWSURFACE, __pyx_int_0) < 0) __PYX_ERR(0, 28, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":31 * * # Window flags. * FULLSCREEN = SDL_WINDOW_FULLSCREEN # <<<<<<<<<<<<<< * OPENGL = SDL_WINDOW_OPENGL * NOFRAME = SDL_WINDOW_BORDERLESS */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FULLSCREEN, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":32 * # Window flags. * FULLSCREEN = SDL_WINDOW_FULLSCREEN * OPENGL = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * NOFRAME = SDL_WINDOW_BORDERLESS * RESIZABLE = SDL_WINDOW_RESIZABLE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_OPENGL, __pyx_t_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":33 * FULLSCREEN = SDL_WINDOW_FULLSCREEN * OPENGL = SDL_WINDOW_OPENGL * NOFRAME = SDL_WINDOW_BORDERLESS # <<<<<<<<<<<<<< * RESIZABLE = SDL_WINDOW_RESIZABLE * DOUBLEBUF = 0 */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_BORDERLESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOFRAME, __pyx_t_2) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":34 * OPENGL = SDL_WINDOW_OPENGL * NOFRAME = SDL_WINDOW_BORDERLESS * RESIZABLE = SDL_WINDOW_RESIZABLE # <<<<<<<<<<<<<< * DOUBLEBUF = 0 * */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_RESIZABLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RESIZABLE, __pyx_t_2) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":35 * NOFRAME = SDL_WINDOW_BORDERLESS * RESIZABLE = SDL_WINDOW_RESIZABLE * DOUBLEBUF = 0 # <<<<<<<<<<<<<< * * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOUBLEBUF, __pyx_int_0) < 0) __PYX_ERR(0, 35, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":37 * DOUBLEBUF = 0 * * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN # <<<<<<<<<<<<<< * WINDOW_SHOWN = SDL_WINDOW_SHOWN * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_FULLSCREEN, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":38 * * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN * WINDOW_SHOWN = SDL_WINDOW_SHOWN # <<<<<<<<<<<<<< * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN * WINDOW_OPENGL = SDL_WINDOW_OPENGL */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_SHOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_SHOWN, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":39 * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN * WINDOW_SHOWN = SDL_WINDOW_SHOWN * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN # <<<<<<<<<<<<<< * WINDOW_OPENGL = SDL_WINDOW_OPENGL * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_HIDDEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_HIDDEN, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":40 * WINDOW_SHOWN = SDL_WINDOW_SHOWN * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN * WINDOW_OPENGL = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_OPENGL, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":41 * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN * WINDOW_OPENGL = SDL_WINDOW_OPENGL * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS # <<<<<<<<<<<<<< * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_BORDERLESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_NOFRAME, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":42 * WINDOW_OPENGL = SDL_WINDOW_OPENGL * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS # <<<<<<<<<<<<<< * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_BORDERLESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_BORDERLESS, __pyx_t_2) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":43 * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE # <<<<<<<<<<<<<< * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_RESIZABLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_RESIZABLE, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":44 * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED # <<<<<<<<<<<<<< * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_MINIMIZED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_MINIMIZED, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":45 * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED # <<<<<<<<<<<<<< * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_MAXIMIZED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_MAXIMIZED, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":46 * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED # <<<<<<<<<<<<<< * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_INPUT_GRABBED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_INPUT_GRABBED, __pyx_t_2) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":47 * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS # <<<<<<<<<<<<<< * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_MOUSE_FOCUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_INPUT_FOCUS, __pyx_t_2) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":48 * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<< * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN_DESKTOP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_FULLSCREEN_DESKTOP, __pyx_t_2) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":49 * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN # <<<<<<<<<<<<<< * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI * */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FOREIGN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_FOREIGN, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":50 * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI # <<<<<<<<<<<<<< * * WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_ALLOW_HIGHDPI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_ALLOW_HIGHDPI, __pyx_t_2) < 0) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":52 * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI * * WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED # <<<<<<<<<<<<<< * WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED * */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_CENTERED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWPOS_CENTERED, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":53 * * WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED * WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED # <<<<<<<<<<<<<< * * # Blend modes */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWPOS_UNDEFINED, __pyx_t_2) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":56 * * # Blend modes * BLEND_RGB_ADD = BLEND_ADD = 0x1 # <<<<<<<<<<<<<< * BLEND_RGB_SUB = BLEND_SUB = 0x2 * BLEND_RGB_MULT = BLEND_MULT = 0x3 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_ADD, __pyx_int_1) < 0) __PYX_ERR(0, 56, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_ADD, __pyx_int_1) < 0) __PYX_ERR(0, 56, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":57 * # Blend modes * BLEND_RGB_ADD = BLEND_ADD = 0x1 * BLEND_RGB_SUB = BLEND_SUB = 0x2 # <<<<<<<<<<<<<< * BLEND_RGB_MULT = BLEND_MULT = 0x3 * BLEND_RGB_MIN = BLEND_MIN = 0x4 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_SUB, __pyx_int_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_SUB, __pyx_int_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":58 * BLEND_RGB_ADD = BLEND_ADD = 0x1 * BLEND_RGB_SUB = BLEND_SUB = 0x2 * BLEND_RGB_MULT = BLEND_MULT = 0x3 # <<<<<<<<<<<<<< * BLEND_RGB_MIN = BLEND_MIN = 0x4 * BLEND_RGB_MAX = BLEND_MAX = 0x5 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_MULT, __pyx_int_3) < 0) __PYX_ERR(0, 58, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_MULT, __pyx_int_3) < 0) __PYX_ERR(0, 58, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":59 * BLEND_RGB_SUB = BLEND_SUB = 0x2 * BLEND_RGB_MULT = BLEND_MULT = 0x3 * BLEND_RGB_MIN = BLEND_MIN = 0x4 # <<<<<<<<<<<<<< * BLEND_RGB_MAX = BLEND_MAX = 0x5 * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_MIN, __pyx_int_4) < 0) __PYX_ERR(0, 59, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_MIN, __pyx_int_4) < 0) __PYX_ERR(0, 59, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":60 * BLEND_RGB_MULT = BLEND_MULT = 0x3 * BLEND_RGB_MIN = BLEND_MIN = 0x4 * BLEND_RGB_MAX = BLEND_MAX = 0x5 # <<<<<<<<<<<<<< * * BLEND_RGBA_ADD = 0x6 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_MAX, __pyx_int_5) < 0) __PYX_ERR(0, 60, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_MAX, __pyx_int_5) < 0) __PYX_ERR(0, 60, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":62 * BLEND_RGB_MAX = BLEND_MAX = 0x5 * * BLEND_RGBA_ADD = 0x6 # <<<<<<<<<<<<<< * BLEND_RGBA_SUB = 0x7 * BLEND_RGBA_MULT = 0x8 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_ADD, __pyx_int_6) < 0) __PYX_ERR(0, 62, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":63 * * BLEND_RGBA_ADD = 0x6 * BLEND_RGBA_SUB = 0x7 # <<<<<<<<<<<<<< * BLEND_RGBA_MULT = 0x8 * BLEND_RGBA_MIN = 0x9 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_SUB, __pyx_int_7) < 0) __PYX_ERR(0, 63, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":64 * BLEND_RGBA_ADD = 0x6 * BLEND_RGBA_SUB = 0x7 * BLEND_RGBA_MULT = 0x8 # <<<<<<<<<<<<<< * BLEND_RGBA_MIN = 0x9 * BLEND_RGBA_MAX = 0x10 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_MULT, __pyx_int_8) < 0) __PYX_ERR(0, 64, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":65 * BLEND_RGBA_SUB = 0x7 * BLEND_RGBA_MULT = 0x8 * BLEND_RGBA_MIN = 0x9 # <<<<<<<<<<<<<< * BLEND_RGBA_MAX = 0x10 * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_MIN, __pyx_int_9) < 0) __PYX_ERR(0, 65, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":66 * BLEND_RGBA_MULT = 0x8 * BLEND_RGBA_MIN = 0x9 * BLEND_RGBA_MAX = 0x10 # <<<<<<<<<<<<<< * * BLEND_PREMULTIPLIED = 0x11 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_MAX, __pyx_int_16) < 0) __PYX_ERR(0, 66, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":68 * BLEND_RGBA_MAX = 0x10 * * BLEND_PREMULTIPLIED = 0x11 # <<<<<<<<<<<<<< * * # Scrap types. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_PREMULTIPLIED, __pyx_int_17) < 0) __PYX_ERR(0, 68, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":71 * * # Scrap types. * SCRAP_TEXT = "text/plain" # <<<<<<<<<<<<<< * * BYTEORDER = SDL_BYTEORDER */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCRAP_TEXT, __pyx_kp_s_text_plain) < 0) __PYX_ERR(0, 71, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":73 * SCRAP_TEXT = "text/plain" * * BYTEORDER = SDL_BYTEORDER # <<<<<<<<<<<<<< * LIL_ENDIAN = SDL_LIL_ENDIAN * BIG_ENDIAN = SDL_BIG_ENDIAN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_BYTEORDER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BYTEORDER, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":74 * * BYTEORDER = SDL_BYTEORDER * LIL_ENDIAN = SDL_LIL_ENDIAN # <<<<<<<<<<<<<< * BIG_ENDIAN = SDL_BIG_ENDIAN * */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_LIL_ENDIAN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIL_ENDIAN, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":75 * BYTEORDER = SDL_BYTEORDER * LIL_ENDIAN = SDL_LIL_ENDIAN * BIG_ENDIAN = SDL_BIG_ENDIAN # <<<<<<<<<<<<<< * * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_BIG_ENDIAN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BIG_ENDIAN, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":77 * BIG_ENDIAN = SDL_BIG_ENDIAN * * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) # <<<<<<<<<<<<<< * * globals().update(dict( */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_MAJOR_VERSION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDL_MINOR_VERSION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From___pyx_anon_enum(SDL_PATCHLEVEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_SDL_VERSION_TUPLE, __pyx_t_5) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/locals.pyx":79 * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) * * globals().update(dict( # <<<<<<<<<<<<<< * KMOD_NONE = sdl2.KMOD_NONE, * */ __pyx_t_5 = __Pyx_Globals(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/locals.pyx":80 * * globals().update(dict( * KMOD_NONE = sdl2.KMOD_NONE, # <<<<<<<<<<<<<< * * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, */ __pyx_t_5 = __Pyx_PyDict_NewPresized(40); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_NONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_NONE, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":82 * KMOD_NONE = sdl2.KMOD_NONE, * * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, # <<<<<<<<<<<<<< * KMOD_RSHIFT = sdl2.KMOD_RSHIFT, * KMOD_SHIFT = sdl2.KMOD_SHIFT, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LSHIFT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_LSHIFT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":83 * * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, * KMOD_RSHIFT = sdl2.KMOD_RSHIFT, # <<<<<<<<<<<<<< * KMOD_SHIFT = sdl2.KMOD_SHIFT, * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RSHIFT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_RSHIFT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":84 * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, * KMOD_RSHIFT = sdl2.KMOD_RSHIFT, * KMOD_SHIFT = sdl2.KMOD_SHIFT, # <<<<<<<<<<<<<< * * KMOD_LCTRL = sdl2.KMOD_LCTRL, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(KMOD_SHIFT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_SHIFT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":86 * KMOD_SHIFT = sdl2.KMOD_SHIFT, * * KMOD_LCTRL = sdl2.KMOD_LCTRL, # <<<<<<<<<<<<<< * KMOD_RCTRL = sdl2.KMOD_RCTRL, * KMOD_CTRL = sdl2.KMOD_CTRL, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LCTRL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_LCTRL, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":87 * * KMOD_LCTRL = sdl2.KMOD_LCTRL, * KMOD_RCTRL = sdl2.KMOD_RCTRL, # <<<<<<<<<<<<<< * KMOD_CTRL = sdl2.KMOD_CTRL, * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RCTRL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_RCTRL, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":88 * KMOD_LCTRL = sdl2.KMOD_LCTRL, * KMOD_RCTRL = sdl2.KMOD_RCTRL, * KMOD_CTRL = sdl2.KMOD_CTRL, # <<<<<<<<<<<<<< * * KMOD_LALT = sdl2.KMOD_LALT, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(KMOD_CTRL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_CTRL, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":90 * KMOD_CTRL = sdl2.KMOD_CTRL, * * KMOD_LALT = sdl2.KMOD_LALT, # <<<<<<<<<<<<<< * KMOD_RALT = sdl2.KMOD_RALT, * KMOD_ALT = sdl2.KMOD_ALT, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LALT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_LALT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":91 * * KMOD_LALT = sdl2.KMOD_LALT, * KMOD_RALT = sdl2.KMOD_RALT, # <<<<<<<<<<<<<< * KMOD_ALT = sdl2.KMOD_ALT, * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RALT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_RALT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":92 * KMOD_LALT = sdl2.KMOD_LALT, * KMOD_RALT = sdl2.KMOD_RALT, * KMOD_ALT = sdl2.KMOD_ALT, # <<<<<<<<<<<<<< * * KMOD_LGUI = sdl2.KMOD_LGUI, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(KMOD_ALT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_ALT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":94 * KMOD_ALT = sdl2.KMOD_ALT, * * KMOD_LGUI = sdl2.KMOD_LGUI, # <<<<<<<<<<<<<< * KMOD_RGUI = sdl2.KMOD_RGUI, * KMOD_GUI = sdl2.KMOD_GUI, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_LGUI, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":95 * * KMOD_LGUI = sdl2.KMOD_LGUI, * KMOD_RGUI = sdl2.KMOD_RGUI, # <<<<<<<<<<<<<< * KMOD_GUI = sdl2.KMOD_GUI, * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_RGUI, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":96 * KMOD_LGUI = sdl2.KMOD_LGUI, * KMOD_RGUI = sdl2.KMOD_RGUI, * KMOD_GUI = sdl2.KMOD_GUI, # <<<<<<<<<<<<<< * * KMOD_LMETA = sdl2.KMOD_LGUI, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(KMOD_GUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_GUI, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":98 * KMOD_GUI = sdl2.KMOD_GUI, * * KMOD_LMETA = sdl2.KMOD_LGUI, # <<<<<<<<<<<<<< * KMOD_RMETA = sdl2.KMOD_RGUI, * KMOD_META = sdl2.KMOD_GUI, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_LMETA, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":99 * * KMOD_LMETA = sdl2.KMOD_LGUI, * KMOD_RMETA = sdl2.KMOD_RGUI, # <<<<<<<<<<<<<< * KMOD_META = sdl2.KMOD_GUI, * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_RMETA, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":100 * KMOD_LMETA = sdl2.KMOD_LGUI, * KMOD_RMETA = sdl2.KMOD_RGUI, * KMOD_META = sdl2.KMOD_GUI, # <<<<<<<<<<<<<< * * KMOD_NUM = sdl2.KMOD_NUM, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(KMOD_GUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_META, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":102 * KMOD_META = sdl2.KMOD_GUI, * * KMOD_NUM = sdl2.KMOD_NUM, # <<<<<<<<<<<<<< * KMOD_CAPS = sdl2.KMOD_CAPS, * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_NUM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_NUM, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":103 * * KMOD_NUM = sdl2.KMOD_NUM, * KMOD_CAPS = sdl2.KMOD_CAPS, # <<<<<<<<<<<<<< * * KMOD_MODE = sdl2.KMOD_MODE, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_CAPS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_CAPS, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":105 * KMOD_CAPS = sdl2.KMOD_CAPS, * * KMOD_MODE = sdl2.KMOD_MODE, # <<<<<<<<<<<<<< * * K_FIRST = 0, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_MODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_MODE, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_FIRST, __pyx_int_0) < 0) __PYX_ERR(0, 80, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":108 * * K_FIRST = 0, * K_LAST = sdl2.SDLK_SLEEP, # <<<<<<<<<<<<<< * * K_BREAK = sdl2.SDLK_PAUSE, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SLEEP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_LAST, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":110 * K_LAST = sdl2.SDLK_SLEEP, * * K_BREAK = sdl2.SDLK_PAUSE, # <<<<<<<<<<<<<< * K_EURO = sdl2.SDLK_CURRENCYUNIT, * */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PAUSE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_BREAK, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":111 * * K_BREAK = sdl2.SDLK_PAUSE, * K_EURO = sdl2.SDLK_CURRENCYUNIT, # <<<<<<<<<<<<<< * * K_KP0 = sdl2.SDLK_KP_0, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CURRENCYUNIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_EURO, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":113 * K_EURO = sdl2.SDLK_CURRENCYUNIT, * * K_KP0 = sdl2.SDLK_KP_0, # <<<<<<<<<<<<<< * K_KP1 = sdl2.SDLK_KP_1, * K_KP2 = sdl2.SDLK_KP_2, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP0, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":114 * * K_KP0 = sdl2.SDLK_KP_0, * K_KP1 = sdl2.SDLK_KP_1, # <<<<<<<<<<<<<< * K_KP2 = sdl2.SDLK_KP_2, * K_KP3 = sdl2.SDLK_KP_3, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP1, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":115 * K_KP0 = sdl2.SDLK_KP_0, * K_KP1 = sdl2.SDLK_KP_1, * K_KP2 = sdl2.SDLK_KP_2, # <<<<<<<<<<<<<< * K_KP3 = sdl2.SDLK_KP_3, * K_KP4 = sdl2.SDLK_KP_4, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP2, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":116 * K_KP1 = sdl2.SDLK_KP_1, * K_KP2 = sdl2.SDLK_KP_2, * K_KP3 = sdl2.SDLK_KP_3, # <<<<<<<<<<<<<< * K_KP4 = sdl2.SDLK_KP_4, * K_KP5 = sdl2.SDLK_KP_5, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP3, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":117 * K_KP2 = sdl2.SDLK_KP_2, * K_KP3 = sdl2.SDLK_KP_3, * K_KP4 = sdl2.SDLK_KP_4, # <<<<<<<<<<<<<< * K_KP5 = sdl2.SDLK_KP_5, * K_KP6 = sdl2.SDLK_KP_6, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP4, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":118 * K_KP3 = sdl2.SDLK_KP_3, * K_KP4 = sdl2.SDLK_KP_4, * K_KP5 = sdl2.SDLK_KP_5, # <<<<<<<<<<<<<< * K_KP6 = sdl2.SDLK_KP_6, * K_KP7 = sdl2.SDLK_KP_7, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP5, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":119 * K_KP4 = sdl2.SDLK_KP_4, * K_KP5 = sdl2.SDLK_KP_5, * K_KP6 = sdl2.SDLK_KP_6, # <<<<<<<<<<<<<< * K_KP7 = sdl2.SDLK_KP_7, * K_KP8 = sdl2.SDLK_KP_8, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP6, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":120 * K_KP5 = sdl2.SDLK_KP_5, * K_KP6 = sdl2.SDLK_KP_6, * K_KP7 = sdl2.SDLK_KP_7, # <<<<<<<<<<<<<< * K_KP8 = sdl2.SDLK_KP_8, * K_KP9 = sdl2.SDLK_KP_9, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP7, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":121 * K_KP6 = sdl2.SDLK_KP_6, * K_KP7 = sdl2.SDLK_KP_7, * K_KP8 = sdl2.SDLK_KP_8, # <<<<<<<<<<<<<< * K_KP9 = sdl2.SDLK_KP_9, * */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP8, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":122 * K_KP7 = sdl2.SDLK_KP_7, * K_KP8 = sdl2.SDLK_KP_8, * K_KP9 = sdl2.SDLK_KP_9, # <<<<<<<<<<<<<< * * K_LMETA = sdl2.SDLK_LGUI, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP9, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":124 * K_KP9 = sdl2.SDLK_KP_9, * * K_LMETA = sdl2.SDLK_LGUI, # <<<<<<<<<<<<<< * K_LSUPER = sdl2.SDLK_LGUI, * K_RMETA = sdl2.SDLK_RGUI, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_LMETA, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":125 * * K_LMETA = sdl2.SDLK_LGUI, * K_LSUPER = sdl2.SDLK_LGUI, # <<<<<<<<<<<<<< * K_RMETA = sdl2.SDLK_RGUI, * K_RSUPER = sdl2.SDLK_RGUI, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_LSUPER, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":126 * K_LMETA = sdl2.SDLK_LGUI, * K_LSUPER = sdl2.SDLK_LGUI, * K_RMETA = sdl2.SDLK_RGUI, # <<<<<<<<<<<<<< * K_RSUPER = sdl2.SDLK_RGUI, * */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_RMETA, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":127 * K_LSUPER = sdl2.SDLK_LGUI, * K_RMETA = sdl2.SDLK_RGUI, * K_RSUPER = sdl2.SDLK_RGUI, # <<<<<<<<<<<<<< * * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_RSUPER, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":129 * K_RSUPER = sdl2.SDLK_RGUI, * * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, # <<<<<<<<<<<<<< * K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, * K_PRINT = sdl2.SDLK_PRINTSCREEN, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_NUMLOCKCLEAR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_NUMLOCK, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":130 * * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, * K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, # <<<<<<<<<<<<<< * K_PRINT = sdl2.SDLK_PRINTSCREEN, * )) */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SCROLLLOCK); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_SCROLLOCK, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":131 * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, * K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, * K_PRINT = sdl2.SDLK_PRINTSCREEN, # <<<<<<<<<<<<<< * )) * */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PRINTSCREEN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_PRINT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":79 * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) * * globals().update(dict( # <<<<<<<<<<<<<< * KMOD_NONE = sdl2.KMOD_NONE, * */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":134 * )) * * TOUCH_MOUSEID = -1 # <<<<<<<<<<<<<< * * include "controller.pxi" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOUCH_MOUSEID, __pyx_int_neg_1) < 0) __PYX_ERR(0, 134, __pyx_L1_error) /* "include/controller.pxi":1 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_INVALID); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_INVALID, __pyx_t_3) < 0) __PYX_ERR(4, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":2 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_A); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_A, __pyx_t_3) < 0) __PYX_ERR(4, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":3 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_B); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_B, __pyx_t_3) < 0) __PYX_ERR(4, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":4 * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_X); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_X, __pyx_t_3) < 0) __PYX_ERR(4, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":5 * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_Y); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_Y, __pyx_t_3) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":6 * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_BACK); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_BACK, __pyx_t_3) < 0) __PYX_ERR(4, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":7 * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_GUIDE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_GUIDE, __pyx_t_3) < 0) __PYX_ERR(4, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":8 * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_START, __pyx_t_3) < 0) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":9 * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_LEFTSTICK); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK, __pyx_t_3) < 0) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":10 * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_RIGHTSTICK); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK, __pyx_t_3) < 0) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":11 * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_LEFTSHOULDER); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER, __pyx_t_3) < 0) __PYX_ERR(4, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":12 * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER, __pyx_t_3) < 0) __PYX_ERR(4, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":13 * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_UP); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_UP, __pyx_t_3) < 0) __PYX_ERR(4, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":14 * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_DOWN); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN, __pyx_t_3) < 0) __PYX_ERR(4, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":15 * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_LEFT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT, __pyx_t_3) < 0) __PYX_ERR(4, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":16 * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_RIGHT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT, __pyx_t_3) < 0) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":17 * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX # <<<<<<<<<<<<<< * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_MAX, __pyx_t_3) < 0) __PYX_ERR(4, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":18 * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID # <<<<<<<<<<<<<< * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_INVALID); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_INVALID, __pyx_t_3) < 0) __PYX_ERR(4, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":19 * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX # <<<<<<<<<<<<<< * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_LEFTX); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_LEFTX, __pyx_t_3) < 0) __PYX_ERR(4, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":20 * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY # <<<<<<<<<<<<<< * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_LEFTY); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_LEFTY, __pyx_t_3) < 0) __PYX_ERR(4, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":21 * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX # <<<<<<<<<<<<<< * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_RIGHTX); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_RIGHTX, __pyx_t_3) < 0) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":22 * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY # <<<<<<<<<<<<<< * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_RIGHTY); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_RIGHTY, __pyx_t_3) < 0) __PYX_ERR(4, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":23 * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT # <<<<<<<<<<<<<< * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_TRIGGERLEFT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT, __pyx_t_3) < 0) __PYX_ERR(4, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":24 * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT # <<<<<<<<<<<<<< * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_TRIGGERRIGHT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT, __pyx_t_3) < 0) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":25 * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX # <<<<<<<<<<<<<< */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_MAX, __pyx_t_3) < 0) __PYX_ERR(4, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":138 * include "controller.pxi" * * POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN # <<<<<<<<<<<<<< * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY */ __pyx_t_3 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_UNKNOWN, __pyx_t_3) < 0) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":139 * * POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY # <<<<<<<<<<<<<< * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING */ __pyx_t_3 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_t_3) < 0) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":140 * POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY # <<<<<<<<<<<<<< * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED */ __pyx_t_3 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_t_3) < 0) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":141 * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING # <<<<<<<<<<<<<< * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED */ __pyx_t_3 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGING, __pyx_t_3) < 0) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":142 * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED # <<<<<<<<<<<<<< */ __pyx_t_3 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGED, __pyx_t_3) < 0) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":1 * from sdl2 cimport * # <<<<<<<<<<<<<< * cimport sdl2 * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.locals", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.locals"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* Globals */ static PyObject* __Pyx_Globals(void) { return __Pyx_NewRef(__pyx_d); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_EventType neg_one = (SDL_EventType) -1, const_zero = (SDL_EventType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_EventType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_EventType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_EventType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_EventType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_EventType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_EventType), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_EventType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLattr(SDL_GLattr value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GLattr neg_one = (SDL_GLattr) -1, const_zero = (SDL_GLattr) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GLattr) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GLattr) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GLattr) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_GLattr) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GLattr) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_GLattr), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_GLattr)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLprofile(SDL_GLprofile value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GLprofile neg_one = (SDL_GLprofile) -1, const_zero = (SDL_GLprofile) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GLprofile) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GLprofile) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GLprofile) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_GLprofile) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GLprofile) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_GLprofile), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_GLprofile)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_WindowFlags neg_one = (SDL_WindowFlags) -1, const_zero = (SDL_WindowFlags) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_WindowFlags) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_WindowFlags) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_WindowFlags) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_WindowFlags), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_WindowFlags)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_Keymod) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Keymod) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_Keymod) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_Keymod) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_Keymod) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_Keymod), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_Keymod)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerButton) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_GameControllerButton) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerButton) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerButton), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_GameControllerButton)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerAxis) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_GameControllerAxis) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerAxis) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerAxis), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_GameControllerAxis)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_PowerState neg_one = (SDL_PowerState) -1, const_zero = (SDL_PowerState) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_PowerState) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_PowerState) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_PowerState) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_PowerState) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_PowerState) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_PowerState), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_PowerState)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__2); } return name; } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709475.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.mixer.c0000664000175000017500000311530614760217143020150 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__mixer #define __PYX_HAVE_API__pygame_sdl2__mixer /* Early includes */ #include #include #include #include #include "SDL.h" #include "SDL_mixer.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "", "src/pygame_sdl2/mixer.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_5mixer_Sound; struct __pyx_obj_11pygame_sdl2_5mixer_Channel; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; struct __pyx_defaults; typedef struct __pyx_defaults __pyx_defaults; struct __pyx_defaults1; typedef struct __pyx_defaults1 __pyx_defaults1; struct __pyx_defaults { PyObject *__pyx_arg_size; }; struct __pyx_defaults1 { PyObject *__pyx_arg_size; }; /* "pygame_sdl2/mixer.pyx":160 * * * cdef class Sound: # <<<<<<<<<<<<<< * cdef Mix_Chunk *chunk * */ struct __pyx_obj_11pygame_sdl2_5mixer_Sound { PyObject_HEAD Mix_Chunk *chunk; }; /* "pygame_sdl2/mixer.pyx":248 * * * cdef class Channel(object): # <<<<<<<<<<<<<< * cdef int cid * */ struct __pyx_obj_11pygame_sdl2_5mixer_Channel { PyObject_HEAD int cid; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* RaiseUnboundLocalError.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); /* dict_getitem_default.proto */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod1.proto */ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #else #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) #endif /* CallUnboundCMethod2.proto */ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); #else #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) #else static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MIX_InitFlags(MIX_InitFlags value); /* CIntFromPy.proto */ static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_mixer" */ /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.mixer" */ static PyObject *__pyx_v_11pygame_sdl2_5mixer_preinit_args = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_output_spec = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_channel_events = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_channel_queued = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_current_sounds = 0; static void __pyx_f_11pygame_sdl2_5mixer_channel_callback(int); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5mixer___pyx_unpickle_Channel__set_state(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *, PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.mixer" extern int __pyx_module_is_main_pygame_sdl2__mixer; int __pyx_module_is_main_pygame_sdl2__mixer = 0; /* Implementation of "pygame_sdl2.mixer" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_i[] = "i"; static const char __pyx_k_n[] = "n"; static const char __pyx_k__2[] = "{}\n"; static const char __pyx_k__4[] = "."; static const char __pyx_k__5[] = "*"; static const char __pyx_k_fi[] = "fi"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_ms[] = "ms"; static const char __pyx_k__74[] = "?"; static const char __pyx_k_cid[] = "cid"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_vol[] = "vol"; static const char __pyx_k_Lock[] = "Lock"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_chan[] = "chan"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_exit[] = "__exit__"; static const char __pyx_k_flag[] = "flag"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_lock[] = "_lock"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_play[] = "play"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_stop[] = "stop"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_time[] = "time"; static const char __pyx_k_type[] = "type"; static const char __pyx_k_Sound[] = "Sound"; static const char __pyx_k_count[] = "count"; static const char __pyx_k_enter[] = "__enter__"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_force[] = "force"; static const char __pyx_k_loops[] = "loops"; static const char __pyx_k_music[] = "music"; static const char __pyx_k_pause[] = "pause"; static const char __pyx_k_queue[] = "queue"; static const char __pyx_k_sound[] = "sound"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_Thread[] = "Thread"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_buffer[] = "buffer"; static const char __pyx_k_dict_2[] = "_dict"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_errors[] = "errors"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_target[] = "target"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_volume[] = "volume"; static const char __pyx_k_Channel[] = "Channel"; static const char __pyx_k_channel[] = "channel"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_fade_ms[] = "fade_ms"; static const char __pyx_k_fadeout[] = "fadeout"; static const char __pyx_k_get_raw[] = "get_raw"; static const char __pyx_k_loops_2[] = "_loops"; static const char __pyx_k_maxtime[] = "maxtime"; static const char __pyx_k_unpause[] = "unpause"; static const char __pyx_k_channels[] = "channels"; static const char __pyx_k_get_busy[] = "get_busy"; static const char __pyx_k_get_init[] = "get_init"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_pre_init[] = "pre_init"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_fade_ms_2[] = "_fade_ms"; static const char __pyx_k_frequency[] = "frequency"; static const char __pyx_k_get_queue[] = "get_queue"; static const char __pyx_k_get_sound[] = "get_sound"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_maxtime_2[] = "_maxtime"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_threading[] = "threading"; static const char __pyx_k_Sound_play[] = "Sound.play"; static const char __pyx_k_Sound_stop[] = "Sound.stop"; static const char __pyx_k_buffersize[] = "buffersize"; static const char __pyx_k_get_length[] = "get_length"; static const char __pyx_k_get_volume[] = "get_volume"; static const char __pyx_k_next_sound[] = "next_sound"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_set_volume[] = "set_volume"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_Sound_pause[] = "Sound.pause"; static const char __pyx_k_mixer_music[] = "mixer_music"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_Channel_play[] = "Channel.play"; static const char __pyx_k_Channel_stop[] = "Channel.stop"; static const char __pyx_k_find_channel[] = "find_channel"; static const char __pyx_k_get_endevent[] = "get_endevent"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_play_current[] = "_play_current"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_set_endevent[] = "set_endevent"; static const char __pyx_k_set_reserved[] = "set_reserved"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_use_setstate[] = "use_setstate"; static const char __pyx_k_Channel_pause[] = "Channel.pause"; static const char __pyx_k_Channel_queue[] = "Channel.queue"; static const char __pyx_k_Sound_fadeout[] = "Sound.fadeout"; static const char __pyx_k_Sound_get_raw[] = "Sound.get_raw"; static const char __pyx_k_Sound_unpause[] = "Sound.unpause"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_Channel_fadeout[] = "Channel.fadeout"; static const char __pyx_k_Channel_unpause[] = "Channel.unpause"; static const char __pyx_k_Not_implemented[] = "Not implemented."; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Channel_get_busy[] = "Channel.get_busy"; static const char __pyx_k_Sound_get_length[] = "Sound.get_length"; static const char __pyx_k_Sound_get_volume[] = "Sound.get_volume"; static const char __pyx_k_Sound_set_volume[] = "Sound.set_volume"; static const char __pyx_k_get_num_channels[] = "get_num_channels"; static const char __pyx_k_set_num_channels[] = "set_num_channels"; static const char __pyx_k_Channel_get_queue[] = "Channel.get_queue"; static const char __pyx_k_Channel_get_sound[] = "Channel.get_sound"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_pygame_sdl2_mixer[] = "pygame_sdl2.mixer"; static const char __pyx_k_Channel_get_volume[] = "Channel.get_volume"; static const char __pyx_k_Channel_set_volume[] = "Channel.set_volume"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Channel_get_endevent[] = "Channel.get_endevent"; static const char __pyx_k_Channel_set_endevent[] = "Channel.set_endevent"; static const char __pyx_k_pyx_unpickle_Channel[] = "__pyx_unpickle_Channel"; static const char __pyx_k_Sound___reduce_cython[] = "Sound.__reduce_cython__"; static const char __pyx_k_Sound_get_num_channels[] = "Sound.get_num_channels"; static const char __pyx_k_Channel___reduce_cython[] = "Channel.__reduce_cython__"; static const char __pyx_k_Sound___setstate_cython[] = "Sound.__setstate_cython__"; static const char __pyx_k_pygame_sdl2_mixer_music[] = "pygame_sdl2.mixer_music"; static const char __pyx_k_Channel___setstate_cython[] = "Channel.__setstate_cython__"; static const char __pyx_k_src_pygame_sdl2_mixer_pyx[] = "src/pygame_sdl2/mixer.pyx"; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer__play_current(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_channel); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_30__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_2init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffer); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_32__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_4pre_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffersize); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_6quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_8get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_10stop(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_12pause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_14unpause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_16fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_18set_num_channels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_20get_num_channels(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_22set_reserved(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_24find_channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_force); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_26get_busy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5mixer_5Sound___cinit__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_5mixer_5Sound_2__dealloc__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5mixer_5Sound_4__init__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_6play(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_8stop(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_10pause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_12unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_14fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_16set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_18get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_20get_num_channels(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_22get_length(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_24get_raw(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11pygame_sdl2_5mixer_7Channel___init__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_cid); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_4stop(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_6pause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_8unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_10fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_12set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_volume); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_14get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_16get_busy(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_18get_sound(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_20queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_22get_queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_24set_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_26get_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_28__pyx_unpickle_Channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Sound(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Channel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_5mixer_Sound; PyObject *__pyx_type_11pygame_sdl2_5mixer_Channel; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_5mixer_Sound; PyTypeObject *__pyx_ptype_11pygame_sdl2_5mixer_Channel; PyObject *__pyx_n_s_Channel; PyObject *__pyx_n_s_Channel___reduce_cython; PyObject *__pyx_n_s_Channel___setstate_cython; PyObject *__pyx_n_s_Channel_fadeout; PyObject *__pyx_n_s_Channel_get_busy; PyObject *__pyx_n_s_Channel_get_endevent; PyObject *__pyx_n_s_Channel_get_queue; PyObject *__pyx_n_s_Channel_get_sound; PyObject *__pyx_n_s_Channel_get_volume; PyObject *__pyx_n_s_Channel_pause; PyObject *__pyx_n_s_Channel_play; PyObject *__pyx_n_s_Channel_queue; PyObject *__pyx_n_s_Channel_set_endevent; PyObject *__pyx_n_s_Channel_set_volume; PyObject *__pyx_n_s_Channel_stop; PyObject *__pyx_n_s_Channel_unpause; PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; PyObject *__pyx_n_s_Lock; PyObject *__pyx_kp_s_Not_implemented; PyObject *__pyx_n_s_PickleError; PyObject *__pyx_n_s_Sound; PyObject *__pyx_n_s_Sound___reduce_cython; PyObject *__pyx_n_s_Sound___setstate_cython; PyObject *__pyx_n_s_Sound_fadeout; PyObject *__pyx_n_s_Sound_get_length; PyObject *__pyx_n_s_Sound_get_num_channels; PyObject *__pyx_n_s_Sound_get_raw; PyObject *__pyx_n_s_Sound_get_volume; PyObject *__pyx_n_s_Sound_pause; PyObject *__pyx_n_s_Sound_play; PyObject *__pyx_n_s_Sound_set_volume; PyObject *__pyx_n_s_Sound_stop; PyObject *__pyx_n_s_Sound_unpause; PyObject *__pyx_n_s_Thread; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_kp_s__2; PyObject *__pyx_kp_u__4; PyObject *__pyx_n_s__5; PyObject *__pyx_n_s__74; PyObject *__pyx_n_s_append; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_buffer; PyObject *__pyx_n_s_buffersize; PyObject *__pyx_n_s_chan; PyObject *__pyx_n_s_channel; PyObject *__pyx_n_s_channels; PyObject *__pyx_n_s_cid; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_count; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_dict_2; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_enter; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_errors; PyObject *__pyx_n_s_exit; PyObject *__pyx_n_s_fade_ms; PyObject *__pyx_n_s_fade_ms_2; PyObject *__pyx_n_s_fadeout; PyObject *__pyx_n_s_fi; PyObject *__pyx_n_s_find_channel; PyObject *__pyx_n_s_flag; PyObject *__pyx_n_s_force; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_frequency; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_busy; PyObject *__pyx_n_s_get_endevent; PyObject *__pyx_n_s_get_init; PyObject *__pyx_n_s_get_length; PyObject *__pyx_n_s_get_num_channels; PyObject *__pyx_n_s_get_queue; PyObject *__pyx_n_s_get_raw; PyObject *__pyx_n_s_get_sound; PyObject *__pyx_n_s_get_volume; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_lock; PyObject *__pyx_n_s_loops; PyObject *__pyx_n_s_loops_2; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_maxtime; PyObject *__pyx_n_s_maxtime_2; PyObject *__pyx_n_s_mixer_music; PyObject *__pyx_n_s_ms; PyObject *__pyx_n_s_music; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_new; PyObject *__pyx_n_s_next_sound; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_pause; PyObject *__pyx_n_s_pickle; PyObject *__pyx_n_s_play; PyObject *__pyx_n_s_play_current; PyObject *__pyx_n_s_pre_init; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_mixer; PyObject *__pyx_n_s_pygame_sdl2_mixer_music; PyObject *__pyx_n_s_pyx_PickleError; PyObject *__pyx_n_s_pyx_checksum; PyObject *__pyx_n_s_pyx_result; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_type; PyObject *__pyx_n_s_pyx_unpickle_Channel; PyObject *__pyx_n_s_queue; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_register_init; PyObject *__pyx_n_s_register_quit; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_endevent; PyObject *__pyx_n_s_set_num_channels; PyObject *__pyx_n_s_set_reserved; PyObject *__pyx_n_s_set_volume; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_sound; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_mixer_pyx; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_stop; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_sys; PyObject *__pyx_n_s_target; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_threading; PyObject *__pyx_n_s_time; PyObject *__pyx_n_s_type; PyObject *__pyx_n_s_unpause; PyObject *__pyx_n_s_update; PyObject *__pyx_n_s_use_setstate; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_vol; PyObject *__pyx_n_s_volume; PyObject *__pyx_int_0; PyObject *__pyx_int_2; PyObject *__pyx_int_4096; PyObject *__pyx_int_22050; PyObject *__pyx_int_63693568; PyObject *__pyx_int_79154262; PyObject *__pyx_int_88229414; PyObject *__pyx_int_neg_1; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__32; PyObject *__pyx_tuple__36; PyObject *__pyx_tuple__38; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__42; PyObject *__pyx_tuple__47; PyObject *__pyx_tuple__49; PyObject *__pyx_tuple__54; PyObject *__pyx_tuple__56; PyObject *__pyx_tuple__58; PyObject *__pyx_tuple__62; PyObject *__pyx_tuple__65; PyObject *__pyx_tuple__67; PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__72; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__24; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__37; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__43; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__45; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__48; PyObject *__pyx_codeobj__50; PyObject *__pyx_codeobj__51; PyObject *__pyx_codeobj__52; PyObject *__pyx_codeobj__53; PyObject *__pyx_codeobj__55; PyObject *__pyx_codeobj__57; PyObject *__pyx_codeobj__59; PyObject *__pyx_codeobj__60; PyObject *__pyx_codeobj__61; PyObject *__pyx_codeobj__63; PyObject *__pyx_codeobj__64; PyObject *__pyx_codeobj__66; PyObject *__pyx_codeobj__68; PyObject *__pyx_codeobj__70; PyObject *__pyx_codeobj__71; PyObject *__pyx_codeobj__73; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5mixer_Sound); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_5mixer_Sound); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5mixer_Channel); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_5mixer_Channel); Py_CLEAR(clear_module_state->__pyx_n_s_Channel); Py_CLEAR(clear_module_state->__pyx_n_s_Channel___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Channel___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_fadeout); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_get_busy); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_get_endevent); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_get_queue); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_get_sound); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_get_volume); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_pause); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_play); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_queue); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_set_endevent); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_set_volume); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_stop); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_unpause); Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_CLEAR(clear_module_state->__pyx_n_s_Lock); Py_CLEAR(clear_module_state->__pyx_kp_s_Not_implemented); Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_Sound); Py_CLEAR(clear_module_state->__pyx_n_s_Sound___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Sound___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_fadeout); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_get_length); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_get_num_channels); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_get_raw); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_get_volume); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_pause); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_play); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_set_volume); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_stop); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_unpause); Py_CLEAR(clear_module_state->__pyx_n_s_Thread); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_kp_s__2); Py_CLEAR(clear_module_state->__pyx_kp_u__4); Py_CLEAR(clear_module_state->__pyx_n_s__5); Py_CLEAR(clear_module_state->__pyx_n_s__74); Py_CLEAR(clear_module_state->__pyx_n_s_append); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_buffersize); Py_CLEAR(clear_module_state->__pyx_n_s_chan); Py_CLEAR(clear_module_state->__pyx_n_s_channel); Py_CLEAR(clear_module_state->__pyx_n_s_channels); Py_CLEAR(clear_module_state->__pyx_n_s_cid); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_count); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_enter); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_errors); Py_CLEAR(clear_module_state->__pyx_n_s_exit); Py_CLEAR(clear_module_state->__pyx_n_s_fade_ms); Py_CLEAR(clear_module_state->__pyx_n_s_fade_ms_2); Py_CLEAR(clear_module_state->__pyx_n_s_fadeout); Py_CLEAR(clear_module_state->__pyx_n_s_fi); Py_CLEAR(clear_module_state->__pyx_n_s_find_channel); Py_CLEAR(clear_module_state->__pyx_n_s_flag); Py_CLEAR(clear_module_state->__pyx_n_s_force); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_frequency); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_busy); Py_CLEAR(clear_module_state->__pyx_n_s_get_endevent); Py_CLEAR(clear_module_state->__pyx_n_s_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_get_length); Py_CLEAR(clear_module_state->__pyx_n_s_get_num_channels); Py_CLEAR(clear_module_state->__pyx_n_s_get_queue); Py_CLEAR(clear_module_state->__pyx_n_s_get_raw); Py_CLEAR(clear_module_state->__pyx_n_s_get_sound); Py_CLEAR(clear_module_state->__pyx_n_s_get_volume); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_lock); Py_CLEAR(clear_module_state->__pyx_n_s_loops); Py_CLEAR(clear_module_state->__pyx_n_s_loops_2); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_maxtime); Py_CLEAR(clear_module_state->__pyx_n_s_maxtime_2); Py_CLEAR(clear_module_state->__pyx_n_s_mixer_music); Py_CLEAR(clear_module_state->__pyx_n_s_ms); Py_CLEAR(clear_module_state->__pyx_n_s_music); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_new); Py_CLEAR(clear_module_state->__pyx_n_s_next_sound); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_pause); Py_CLEAR(clear_module_state->__pyx_n_s_pickle); Py_CLEAR(clear_module_state->__pyx_n_s_play); Py_CLEAR(clear_module_state->__pyx_n_s_play_current); Py_CLEAR(clear_module_state->__pyx_n_s_pre_init); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_mixer); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_mixer_music); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Channel); Py_CLEAR(clear_module_state->__pyx_n_s_queue); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_register_init); Py_CLEAR(clear_module_state->__pyx_n_s_register_quit); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_endevent); Py_CLEAR(clear_module_state->__pyx_n_s_set_num_channels); Py_CLEAR(clear_module_state->__pyx_n_s_set_reserved); Py_CLEAR(clear_module_state->__pyx_n_s_set_volume); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_sound); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_mixer_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_stop); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_sys); Py_CLEAR(clear_module_state->__pyx_n_s_target); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_threading); Py_CLEAR(clear_module_state->__pyx_n_s_time); Py_CLEAR(clear_module_state->__pyx_n_s_type); Py_CLEAR(clear_module_state->__pyx_n_s_unpause); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_vol); Py_CLEAR(clear_module_state->__pyx_n_s_volume); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_4096); Py_CLEAR(clear_module_state->__pyx_int_22050); Py_CLEAR(clear_module_state->__pyx_int_63693568); Py_CLEAR(clear_module_state->__pyx_int_79154262); Py_CLEAR(clear_module_state->__pyx_int_88229414); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__32); Py_CLEAR(clear_module_state->__pyx_tuple__36); Py_CLEAR(clear_module_state->__pyx_tuple__38); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__42); Py_CLEAR(clear_module_state->__pyx_tuple__47); Py_CLEAR(clear_module_state->__pyx_tuple__49); Py_CLEAR(clear_module_state->__pyx_tuple__54); Py_CLEAR(clear_module_state->__pyx_tuple__56); Py_CLEAR(clear_module_state->__pyx_tuple__58); Py_CLEAR(clear_module_state->__pyx_tuple__62); Py_CLEAR(clear_module_state->__pyx_tuple__65); Py_CLEAR(clear_module_state->__pyx_tuple__67); Py_CLEAR(clear_module_state->__pyx_tuple__69); Py_CLEAR(clear_module_state->__pyx_tuple__72); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__24); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__37); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__43); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__45); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__48); Py_CLEAR(clear_module_state->__pyx_codeobj__50); Py_CLEAR(clear_module_state->__pyx_codeobj__51); Py_CLEAR(clear_module_state->__pyx_codeobj__52); Py_CLEAR(clear_module_state->__pyx_codeobj__53); Py_CLEAR(clear_module_state->__pyx_codeobj__55); Py_CLEAR(clear_module_state->__pyx_codeobj__57); Py_CLEAR(clear_module_state->__pyx_codeobj__59); Py_CLEAR(clear_module_state->__pyx_codeobj__60); Py_CLEAR(clear_module_state->__pyx_codeobj__61); Py_CLEAR(clear_module_state->__pyx_codeobj__63); Py_CLEAR(clear_module_state->__pyx_codeobj__64); Py_CLEAR(clear_module_state->__pyx_codeobj__66); Py_CLEAR(clear_module_state->__pyx_codeobj__68); Py_CLEAR(clear_module_state->__pyx_codeobj__70); Py_CLEAR(clear_module_state->__pyx_codeobj__71); Py_CLEAR(clear_module_state->__pyx_codeobj__73); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5mixer_Sound); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_5mixer_Sound); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5mixer_Channel); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_5mixer_Channel); Py_VISIT(traverse_module_state->__pyx_n_s_Channel); Py_VISIT(traverse_module_state->__pyx_n_s_Channel___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Channel___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_fadeout); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_get_busy); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_get_endevent); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_get_queue); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_get_sound); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_get_volume); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_pause); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_play); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_queue); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_set_endevent); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_set_volume); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_stop); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_unpause); Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_VISIT(traverse_module_state->__pyx_n_s_Lock); Py_VISIT(traverse_module_state->__pyx_kp_s_Not_implemented); Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_Sound); Py_VISIT(traverse_module_state->__pyx_n_s_Sound___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Sound___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_fadeout); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_get_length); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_get_num_channels); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_get_raw); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_get_volume); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_pause); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_play); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_set_volume); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_stop); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_unpause); Py_VISIT(traverse_module_state->__pyx_n_s_Thread); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_kp_s__2); Py_VISIT(traverse_module_state->__pyx_kp_u__4); Py_VISIT(traverse_module_state->__pyx_n_s__5); Py_VISIT(traverse_module_state->__pyx_n_s__74); Py_VISIT(traverse_module_state->__pyx_n_s_append); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_buffersize); Py_VISIT(traverse_module_state->__pyx_n_s_chan); Py_VISIT(traverse_module_state->__pyx_n_s_channel); Py_VISIT(traverse_module_state->__pyx_n_s_channels); Py_VISIT(traverse_module_state->__pyx_n_s_cid); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_count); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_enter); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_errors); Py_VISIT(traverse_module_state->__pyx_n_s_exit); Py_VISIT(traverse_module_state->__pyx_n_s_fade_ms); Py_VISIT(traverse_module_state->__pyx_n_s_fade_ms_2); Py_VISIT(traverse_module_state->__pyx_n_s_fadeout); Py_VISIT(traverse_module_state->__pyx_n_s_fi); Py_VISIT(traverse_module_state->__pyx_n_s_find_channel); Py_VISIT(traverse_module_state->__pyx_n_s_flag); Py_VISIT(traverse_module_state->__pyx_n_s_force); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_frequency); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_busy); Py_VISIT(traverse_module_state->__pyx_n_s_get_endevent); Py_VISIT(traverse_module_state->__pyx_n_s_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_get_length); Py_VISIT(traverse_module_state->__pyx_n_s_get_num_channels); Py_VISIT(traverse_module_state->__pyx_n_s_get_queue); Py_VISIT(traverse_module_state->__pyx_n_s_get_raw); Py_VISIT(traverse_module_state->__pyx_n_s_get_sound); Py_VISIT(traverse_module_state->__pyx_n_s_get_volume); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_lock); Py_VISIT(traverse_module_state->__pyx_n_s_loops); Py_VISIT(traverse_module_state->__pyx_n_s_loops_2); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_maxtime); Py_VISIT(traverse_module_state->__pyx_n_s_maxtime_2); Py_VISIT(traverse_module_state->__pyx_n_s_mixer_music); Py_VISIT(traverse_module_state->__pyx_n_s_ms); Py_VISIT(traverse_module_state->__pyx_n_s_music); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_new); Py_VISIT(traverse_module_state->__pyx_n_s_next_sound); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_pause); Py_VISIT(traverse_module_state->__pyx_n_s_pickle); Py_VISIT(traverse_module_state->__pyx_n_s_play); Py_VISIT(traverse_module_state->__pyx_n_s_play_current); Py_VISIT(traverse_module_state->__pyx_n_s_pre_init); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_mixer); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_mixer_music); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Channel); Py_VISIT(traverse_module_state->__pyx_n_s_queue); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_register_init); Py_VISIT(traverse_module_state->__pyx_n_s_register_quit); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_endevent); Py_VISIT(traverse_module_state->__pyx_n_s_set_num_channels); Py_VISIT(traverse_module_state->__pyx_n_s_set_reserved); Py_VISIT(traverse_module_state->__pyx_n_s_set_volume); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_sound); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_mixer_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_stop); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_sys); Py_VISIT(traverse_module_state->__pyx_n_s_target); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_threading); Py_VISIT(traverse_module_state->__pyx_n_s_time); Py_VISIT(traverse_module_state->__pyx_n_s_type); Py_VISIT(traverse_module_state->__pyx_n_s_unpause); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_vol); Py_VISIT(traverse_module_state->__pyx_n_s_volume); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_4096); Py_VISIT(traverse_module_state->__pyx_int_22050); Py_VISIT(traverse_module_state->__pyx_int_63693568); Py_VISIT(traverse_module_state->__pyx_int_79154262); Py_VISIT(traverse_module_state->__pyx_int_88229414); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__32); Py_VISIT(traverse_module_state->__pyx_tuple__36); Py_VISIT(traverse_module_state->__pyx_tuple__38); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__42); Py_VISIT(traverse_module_state->__pyx_tuple__47); Py_VISIT(traverse_module_state->__pyx_tuple__49); Py_VISIT(traverse_module_state->__pyx_tuple__54); Py_VISIT(traverse_module_state->__pyx_tuple__56); Py_VISIT(traverse_module_state->__pyx_tuple__58); Py_VISIT(traverse_module_state->__pyx_tuple__62); Py_VISIT(traverse_module_state->__pyx_tuple__65); Py_VISIT(traverse_module_state->__pyx_tuple__67); Py_VISIT(traverse_module_state->__pyx_tuple__69); Py_VISIT(traverse_module_state->__pyx_tuple__72); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__24); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__37); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__43); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__45); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__48); Py_VISIT(traverse_module_state->__pyx_codeobj__50); Py_VISIT(traverse_module_state->__pyx_codeobj__51); Py_VISIT(traverse_module_state->__pyx_codeobj__52); Py_VISIT(traverse_module_state->__pyx_codeobj__53); Py_VISIT(traverse_module_state->__pyx_codeobj__55); Py_VISIT(traverse_module_state->__pyx_codeobj__57); Py_VISIT(traverse_module_state->__pyx_codeobj__59); Py_VISIT(traverse_module_state->__pyx_codeobj__60); Py_VISIT(traverse_module_state->__pyx_codeobj__61); Py_VISIT(traverse_module_state->__pyx_codeobj__63); Py_VISIT(traverse_module_state->__pyx_codeobj__64); Py_VISIT(traverse_module_state->__pyx_codeobj__66); Py_VISIT(traverse_module_state->__pyx_codeobj__68); Py_VISIT(traverse_module_state->__pyx_codeobj__70); Py_VISIT(traverse_module_state->__pyx_codeobj__71); Py_VISIT(traverse_module_state->__pyx_codeobj__73); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_5mixer_Sound __pyx_mstate_global->__pyx_type_11pygame_sdl2_5mixer_Sound #define __pyx_type_11pygame_sdl2_5mixer_Channel __pyx_mstate_global->__pyx_type_11pygame_sdl2_5mixer_Channel #endif #define __pyx_ptype_11pygame_sdl2_5mixer_Sound __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5mixer_Sound #define __pyx_ptype_11pygame_sdl2_5mixer_Channel __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5mixer_Channel #define __pyx_n_s_Channel __pyx_mstate_global->__pyx_n_s_Channel #define __pyx_n_s_Channel___reduce_cython __pyx_mstate_global->__pyx_n_s_Channel___reduce_cython #define __pyx_n_s_Channel___setstate_cython __pyx_mstate_global->__pyx_n_s_Channel___setstate_cython #define __pyx_n_s_Channel_fadeout __pyx_mstate_global->__pyx_n_s_Channel_fadeout #define __pyx_n_s_Channel_get_busy __pyx_mstate_global->__pyx_n_s_Channel_get_busy #define __pyx_n_s_Channel_get_endevent __pyx_mstate_global->__pyx_n_s_Channel_get_endevent #define __pyx_n_s_Channel_get_queue __pyx_mstate_global->__pyx_n_s_Channel_get_queue #define __pyx_n_s_Channel_get_sound __pyx_mstate_global->__pyx_n_s_Channel_get_sound #define __pyx_n_s_Channel_get_volume __pyx_mstate_global->__pyx_n_s_Channel_get_volume #define __pyx_n_s_Channel_pause __pyx_mstate_global->__pyx_n_s_Channel_pause #define __pyx_n_s_Channel_play __pyx_mstate_global->__pyx_n_s_Channel_play #define __pyx_n_s_Channel_queue __pyx_mstate_global->__pyx_n_s_Channel_queue #define __pyx_n_s_Channel_set_endevent __pyx_mstate_global->__pyx_n_s_Channel_set_endevent #define __pyx_n_s_Channel_set_volume __pyx_mstate_global->__pyx_n_s_Channel_set_volume #define __pyx_n_s_Channel_stop __pyx_mstate_global->__pyx_n_s_Channel_stop #define __pyx_n_s_Channel_unpause __pyx_mstate_global->__pyx_n_s_Channel_unpause #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 #define __pyx_n_s_Lock __pyx_mstate_global->__pyx_n_s_Lock #define __pyx_kp_s_Not_implemented __pyx_mstate_global->__pyx_kp_s_Not_implemented #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError #define __pyx_n_s_Sound __pyx_mstate_global->__pyx_n_s_Sound #define __pyx_n_s_Sound___reduce_cython __pyx_mstate_global->__pyx_n_s_Sound___reduce_cython #define __pyx_n_s_Sound___setstate_cython __pyx_mstate_global->__pyx_n_s_Sound___setstate_cython #define __pyx_n_s_Sound_fadeout __pyx_mstate_global->__pyx_n_s_Sound_fadeout #define __pyx_n_s_Sound_get_length __pyx_mstate_global->__pyx_n_s_Sound_get_length #define __pyx_n_s_Sound_get_num_channels __pyx_mstate_global->__pyx_n_s_Sound_get_num_channels #define __pyx_n_s_Sound_get_raw __pyx_mstate_global->__pyx_n_s_Sound_get_raw #define __pyx_n_s_Sound_get_volume __pyx_mstate_global->__pyx_n_s_Sound_get_volume #define __pyx_n_s_Sound_pause __pyx_mstate_global->__pyx_n_s_Sound_pause #define __pyx_n_s_Sound_play __pyx_mstate_global->__pyx_n_s_Sound_play #define __pyx_n_s_Sound_set_volume __pyx_mstate_global->__pyx_n_s_Sound_set_volume #define __pyx_n_s_Sound_stop __pyx_mstate_global->__pyx_n_s_Sound_stop #define __pyx_n_s_Sound_unpause __pyx_mstate_global->__pyx_n_s_Sound_unpause #define __pyx_n_s_Thread __pyx_mstate_global->__pyx_n_s_Thread #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_kp_s__2 __pyx_mstate_global->__pyx_kp_s__2 #define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 #define __pyx_n_s__5 __pyx_mstate_global->__pyx_n_s__5 #define __pyx_n_s__74 __pyx_mstate_global->__pyx_n_s__74 #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer #define __pyx_n_s_buffersize __pyx_mstate_global->__pyx_n_s_buffersize #define __pyx_n_s_chan __pyx_mstate_global->__pyx_n_s_chan #define __pyx_n_s_channel __pyx_mstate_global->__pyx_n_s_channel #define __pyx_n_s_channels __pyx_mstate_global->__pyx_n_s_channels #define __pyx_n_s_cid __pyx_mstate_global->__pyx_n_s_cid #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_errors __pyx_mstate_global->__pyx_n_s_errors #define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit #define __pyx_n_s_fade_ms __pyx_mstate_global->__pyx_n_s_fade_ms #define __pyx_n_s_fade_ms_2 __pyx_mstate_global->__pyx_n_s_fade_ms_2 #define __pyx_n_s_fadeout __pyx_mstate_global->__pyx_n_s_fadeout #define __pyx_n_s_fi __pyx_mstate_global->__pyx_n_s_fi #define __pyx_n_s_find_channel __pyx_mstate_global->__pyx_n_s_find_channel #define __pyx_n_s_flag __pyx_mstate_global->__pyx_n_s_flag #define __pyx_n_s_force __pyx_mstate_global->__pyx_n_s_force #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_frequency __pyx_mstate_global->__pyx_n_s_frequency #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_busy __pyx_mstate_global->__pyx_n_s_get_busy #define __pyx_n_s_get_endevent __pyx_mstate_global->__pyx_n_s_get_endevent #define __pyx_n_s_get_init __pyx_mstate_global->__pyx_n_s_get_init #define __pyx_n_s_get_length __pyx_mstate_global->__pyx_n_s_get_length #define __pyx_n_s_get_num_channels __pyx_mstate_global->__pyx_n_s_get_num_channels #define __pyx_n_s_get_queue __pyx_mstate_global->__pyx_n_s_get_queue #define __pyx_n_s_get_raw __pyx_mstate_global->__pyx_n_s_get_raw #define __pyx_n_s_get_sound __pyx_mstate_global->__pyx_n_s_get_sound #define __pyx_n_s_get_volume __pyx_mstate_global->__pyx_n_s_get_volume #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_lock __pyx_mstate_global->__pyx_n_s_lock #define __pyx_n_s_loops __pyx_mstate_global->__pyx_n_s_loops #define __pyx_n_s_loops_2 __pyx_mstate_global->__pyx_n_s_loops_2 #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_maxtime __pyx_mstate_global->__pyx_n_s_maxtime #define __pyx_n_s_maxtime_2 __pyx_mstate_global->__pyx_n_s_maxtime_2 #define __pyx_n_s_mixer_music __pyx_mstate_global->__pyx_n_s_mixer_music #define __pyx_n_s_ms __pyx_mstate_global->__pyx_n_s_ms #define __pyx_n_s_music __pyx_mstate_global->__pyx_n_s_music #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new #define __pyx_n_s_next_sound __pyx_mstate_global->__pyx_n_s_next_sound #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_pause __pyx_mstate_global->__pyx_n_s_pause #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle #define __pyx_n_s_play __pyx_mstate_global->__pyx_n_s_play #define __pyx_n_s_play_current __pyx_mstate_global->__pyx_n_s_play_current #define __pyx_n_s_pre_init __pyx_mstate_global->__pyx_n_s_pre_init #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_mixer __pyx_mstate_global->__pyx_n_s_pygame_sdl2_mixer #define __pyx_n_s_pygame_sdl2_mixer_music __pyx_mstate_global->__pyx_n_s_pygame_sdl2_mixer_music #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type #define __pyx_n_s_pyx_unpickle_Channel __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Channel #define __pyx_n_s_queue __pyx_mstate_global->__pyx_n_s_queue #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_register_init __pyx_mstate_global->__pyx_n_s_register_init #define __pyx_n_s_register_quit __pyx_mstate_global->__pyx_n_s_register_quit #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_endevent __pyx_mstate_global->__pyx_n_s_set_endevent #define __pyx_n_s_set_num_channels __pyx_mstate_global->__pyx_n_s_set_num_channels #define __pyx_n_s_set_reserved __pyx_mstate_global->__pyx_n_s_set_reserved #define __pyx_n_s_set_volume __pyx_mstate_global->__pyx_n_s_set_volume #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_sound __pyx_mstate_global->__pyx_n_s_sound #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_mixer_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_mixer_pyx #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys #define __pyx_n_s_target __pyx_mstate_global->__pyx_n_s_target #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_threading __pyx_mstate_global->__pyx_n_s_threading #define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time #define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type #define __pyx_n_s_unpause __pyx_mstate_global->__pyx_n_s_unpause #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_vol __pyx_mstate_global->__pyx_n_s_vol #define __pyx_n_s_volume __pyx_mstate_global->__pyx_n_s_volume #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_4096 __pyx_mstate_global->__pyx_int_4096 #define __pyx_int_22050 __pyx_mstate_global->__pyx_int_22050 #define __pyx_int_63693568 __pyx_mstate_global->__pyx_int_63693568 #define __pyx_int_79154262 __pyx_mstate_global->__pyx_int_79154262 #define __pyx_int_88229414 __pyx_mstate_global->__pyx_int_88229414 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 #define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 #define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 #define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58 #define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 #define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 #define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 #define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 #define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 #define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 #define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 #define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61 #define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63 #define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64 #define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 #define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68 #define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 #define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71 #define __pyx_codeobj__73 __pyx_mstate_global->__pyx_codeobj__73 /* #### Code section: module_code ### */ /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_1_play_current(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer__play_current, "_play_current(int channel)\n\n Caled by channel_callback to play the next sound. This has to be called\n from a different thread, as the channel callback isn't allowed to call\n MIX functions.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_1_play_current = {"_play_current", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_1_play_current, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer__play_current}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_1_play_current(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { int __pyx_v_channel; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_play_current (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_channel,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_channel)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_play_current") < 0)) __PYX_ERR(1, 41, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_channel = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_channel == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_play_current", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 41, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer._play_current", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer__play_current(__pyx_self, __pyx_v_channel); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer__play_current(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_channel) { struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_next_sound = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_play_current", 1); /* "pygame_sdl2/mixer.pyx":50 * cdef Sound next_sound * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 50, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 50, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/mixer.pyx":51 * * with _lock: * next_sound = channel_queued[channel] # <<<<<<<<<<<<<< * current_sounds[channel] = next_sound * channel_queued[channel] = None */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 51, __pyx_L7_error) } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 51, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 51, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11pygame_sdl2_5mixer_Sound))))) __PYX_ERR(1, 51, __pyx_L7_error) __pyx_v_next_sound = ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":52 * with _lock: * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound # <<<<<<<<<<<<<< * channel_queued[channel] = None * */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 52, __pyx_L7_error) } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 52, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_3, ((PyObject *)__pyx_v_next_sound)) < 0))) __PYX_ERR(1, 52, __pyx_L7_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":53 * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound * channel_queued[channel] = None # <<<<<<<<<<<<<< * * if next_sound: */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 53, __pyx_L7_error) } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 53, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_3, Py_None) < 0))) __PYX_ERR(1, 53, __pyx_L7_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":50 * cdef Sound next_sound * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer._play_current", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(1, 50, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 50, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 50, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_11 < 0) __PYX_ERR(1, 50, __pyx_L9_except_error) __pyx_t_12 = (!__pyx_t_11); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __PYX_ERR(1, 50, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L12_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L16; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L16:; } /* "pygame_sdl2/mixer.pyx":55 * channel_queued[channel] = None * * if next_sound: # <<<<<<<<<<<<<< * with nogil: * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) */ if (unlikely(!__pyx_v_next_sound)) { __Pyx_RaiseUnboundLocalError("next_sound"); __PYX_ERR(1, 55, __pyx_L1_error) } __pyx_t_12 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_next_sound)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(1, 55, __pyx_L1_error) if (__pyx_t_12) { /* "pygame_sdl2/mixer.pyx":56 * * if next_sound: * with nogil: # <<<<<<<<<<<<<< * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":57 * if next_sound: * with nogil: * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) # <<<<<<<<<<<<<< * * */ if (unlikely(!__pyx_v_next_sound)) { __Pyx_RaiseUnboundLocalError("next_sound"); __PYX_ERR(1, 57, __pyx_L19_error) } (void)(Mix_PlayChannelTimed(__pyx_v_channel, __pyx_v_next_sound->chunk, 0, -1)); } /* "pygame_sdl2/mixer.pyx":56 * * if next_sound: * with nogil: # <<<<<<<<<<<<<< * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L20; } __pyx_L19_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } __pyx_L20:; } } /* "pygame_sdl2/mixer.pyx":55 * channel_queued[channel] = None * * if next_sound: # <<<<<<<<<<<<<< * with nogil: * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) */ } /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer._play_current", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_next_sound); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":60 * * * cdef void channel_callback(int channel) noexcept with gil: # <<<<<<<<<<<<<< * * cdef int etype = 0 */ static void __pyx_f_11pygame_sdl2_5mixer_channel_callback(int __pyx_v_channel) { int __pyx_v_etype; SDL_Event __pyx_v_e; PyObject *__pyx_v_next_sound = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("channel_callback", 0); /* "pygame_sdl2/mixer.pyx":62 * cdef void channel_callback(int channel) noexcept with gil: * * cdef int etype = 0 # <<<<<<<<<<<<<< * cdef SDL_Event e * */ __pyx_v_etype = 0; /* "pygame_sdl2/mixer.pyx":65 * cdef SDL_Event e * * etype = channel_events.get(channel, 0) # <<<<<<<<<<<<<< * if etype != 0: * memset(&e, 0, sizeof(SDL_Event)) */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(1, 65, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_1, __pyx_int_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_etype = __pyx_t_3; /* "pygame_sdl2/mixer.pyx":66 * * etype = channel_events.get(channel, 0) * if etype != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype */ __pyx_t_4 = (__pyx_v_etype != 0); if (__pyx_t_4) { /* "pygame_sdl2/mixer.pyx":67 * etype = channel_events.get(channel, 0) * if etype != 0: * memset(&e, 0, sizeof(SDL_Event)) # <<<<<<<<<<<<<< * e.type = etype * SDL_PushEvent(&e) */ (void)(memset((&__pyx_v_e), 0, (sizeof(SDL_Event)))); /* "pygame_sdl2/mixer.pyx":68 * if etype != 0: * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype # <<<<<<<<<<<<<< * SDL_PushEvent(&e) * */ __pyx_v_e.type = __pyx_v_etype; /* "pygame_sdl2/mixer.pyx":69 * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype * SDL_PushEvent(&e) # <<<<<<<<<<<<<< * * with _lock: */ (void)(SDL_PushEvent((&__pyx_v_e))); /* "pygame_sdl2/mixer.pyx":66 * * etype = channel_events.get(channel, 0) * if etype != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype */ } /* "pygame_sdl2/mixer.pyx":71 * SDL_PushEvent(&e) * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued.get(channel) * if next_sound: */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 71, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_3 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_3, 0+__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "pygame_sdl2/mixer.pyx":72 * * with _lock: * next_sound = channel_queued.get(channel) # <<<<<<<<<<<<<< * if next_sound: * threading.Thread(target=_play_current, args=(channel,)).start() */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(1, 72, __pyx_L8_error) } __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 72, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_next_sound = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":73 * with _lock: * next_sound = channel_queued.get(channel) * if next_sound: # <<<<<<<<<<<<<< * threading.Thread(target=_play_current, args=(channel,)).start() * */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_next_sound); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 73, __pyx_L8_error) if (__pyx_t_4) { /* "pygame_sdl2/mixer.pyx":74 * next_sound = channel_queued.get(channel) * if next_sound: * threading.Thread(target=_play_current, args=(channel,)).start() # <<<<<<<<<<<<<< * * # A list of errors that occured during mixer initialization. */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Thread); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_play_current); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target, __pyx_t_7) < 0) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7)) __PYX_ERR(1, 74, __pyx_L8_error); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_args, __pyx_t_11) < 0) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_3 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_3, 0+__pyx_t_3); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":73 * with _lock: * next_sound = channel_queued.get(channel) * if next_sound: # <<<<<<<<<<<<<< * threading.Thread(target=_play_current, args=(channel,)).start() * */ } /* "pygame_sdl2/mixer.pyx":71 * SDL_PushEvent(&e) * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued.get(channel) * if next_sound: */ } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L13_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.channel_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_11) < 0) __PYX_ERR(1, 71, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 71, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 71, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_4 < 0) __PYX_ERR(1, 71, __pyx_L10_except_error) __pyx_t_13 = (!__pyx_t_4); if (unlikely(__pyx_t_13)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_11); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_11 = 0; __PYX_ERR(1, 71, __pyx_L10_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_L13_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_5) { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } goto __pyx_L7; } __pyx_L7:; } goto __pyx_L18; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L1_error; __pyx_L18:; } /* "pygame_sdl2/mixer.pyx":60 * * * cdef void channel_callback(int channel) noexcept with gil: # <<<<<<<<<<<<<< * * cdef int etype = 0 */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __Pyx_WriteUnraisable("pygame_sdl2.mixer.channel_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_XDECREF(__pyx_v_next_sound); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } /* "pygame_sdl2/mixer.pyx":79 * errors = [ ] * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_30__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_int_22050)); __Pyx_GIVEREF(((PyObject *)__pyx_int_22050)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_int_22050))) __PYX_ERR(1, 79, __pyx_L1_error); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_size); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_size); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_size)) __PYX_ERR(1, 79, __pyx_L1_error); __Pyx_INCREF(((PyObject *)__pyx_int_2)); __Pyx_GIVEREF(((PyObject *)__pyx_int_2)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_2))) __PYX_ERR(1, 79, __pyx_L1_error); __Pyx_INCREF(((PyObject *)__pyx_int_4096)); __Pyx_GIVEREF(((PyObject *)__pyx_int_4096)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_int_4096))) __PYX_ERR(1, 79, __pyx_L1_error); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 79, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(1, 79, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_3init(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_2init, "init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_3init = {"init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_3init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_2init}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_3init(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_frequency = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_channels = 0; PyObject *__pyx_v_buffer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_size,&__pyx_n_s_channels,&__pyx_n_s_buffer,0}; __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_22050))); values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_size); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_2))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_4096))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_channels); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffer); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "init") < 0)) __PYX_ERR(1, 79, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_frequency = values[0]; __pyx_v_size = values[1]; __pyx_v_channels = values[2]; __pyx_v_buffer = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("init", 0, 0, 4, __pyx_nargs); __PYX_ERR(1, 79, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_2init(__pyx_self, __pyx_v_frequency, __pyx_v_size, __pyx_v_channels, __pyx_v_buffer); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_2init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffer) { PyObject *__pyx_v_flag = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); Uint16 __pyx_t_12; int __pyx_t_13; int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); __Pyx_INCREF(__pyx_v_frequency); __Pyx_INCREF(__pyx_v_size); __Pyx_INCREF(__pyx_v_channels); __Pyx_INCREF(__pyx_v_buffer); /* "pygame_sdl2/mixer.pyx":81 * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: # <<<<<<<<<<<<<< * return * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = (__pyx_t_1 != Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":82 * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: * return # <<<<<<<<<<<<<< * * for flag in (MIX_INIT_FLAC, MIX_INIT_MP3, MIX_INIT_OGG): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":81 * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/mixer.pyx":84 * return * * for flag in (MIX_INIT_FLAC, MIX_INIT_MP3, MIX_INIT_OGG): # <<<<<<<<<<<<<< * * if Mix_Init(flag) != flag: */ __pyx_t_1 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_FLAC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_MP3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_OGG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(1, 84, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3)) __PYX_ERR(1, 84, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (;;) { if (__pyx_t_7 >= 3) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(1, 84, __pyx_L1_error) #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_v_flag, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/mixer.pyx":86 * for flag in (MIX_INIT_FLAC, MIX_INIT_MP3, MIX_INIT_OGG): * * if Mix_Init(flag) != flag: # <<<<<<<<<<<<<< * errors.append("{}\n".format(SDL_GetError())) * */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_flag); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 86, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_int(Mix_Init(__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_flag, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":87 * * if Mix_Init(flag) != flag: * errors.append("{}\n".format(SDL_GetError())) # <<<<<<<<<<<<<< * * if preinit_args: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s__2, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_6); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/mixer.pyx":86 * for flag in (MIX_INIT_FLAC, MIX_INIT_MP3, MIX_INIT_OGG): * * if Mix_Init(flag) != flag: # <<<<<<<<<<<<<< * errors.append("{}\n".format(SDL_GetError())) * */ } /* "pygame_sdl2/mixer.pyx":84 * return * * for flag in (MIX_INIT_FLAC, MIX_INIT_MP3, MIX_INIT_OGG): # <<<<<<<<<<<<<< * * if Mix_Init(flag) != flag: */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":89 * errors.append("{}\n".format(SDL_GetError())) * * if preinit_args: # <<<<<<<<<<<<<< * frequency, size, channels, buffer = preinit_args * */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_11pygame_sdl2_5mixer_preinit_args); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 89, __pyx_L1_error) if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":90 * * if preinit_args: * frequency, size, channels, buffer = preinit_args # <<<<<<<<<<<<<< * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: */ if ((likely(PyTuple_CheckExact(__pyx_v_11pygame_sdl2_5mixer_preinit_args))) || (PyList_CheckExact(__pyx_v_11pygame_sdl2_5mixer_preinit_args))) { PyObject* sequence = __pyx_v_11pygame_sdl2_5mixer_preinit_args; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(1, 90, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_2 = PyList_GET_ITEM(sequence, 2); __pyx_t_1 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_6,&__pyx_t_2,&__pyx_t_1}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(1, 90, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_6,&__pyx_t_2,&__pyx_t_1}; __pyx_t_8 = PyObject_GetIter(__pyx_v_11pygame_sdl2_5mixer_preinit_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_11(__pyx_t_8); if (unlikely(!item)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_8), 4) < 0) __PYX_ERR(1, 90, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(1, 90, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_frequency, __pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_channels, __pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":89 * errors.append("{}\n".format(SDL_GetError())) * * if preinit_args: # <<<<<<<<<<<<<< * frequency, size, channels, buffer = preinit_args * */ } /* "pygame_sdl2/mixer.pyx":92 * frequency, size, channels, buffer = preinit_args * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_frequency); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error) __pyx_t_12 = __Pyx_PyInt_As_uint16_t(__pyx_v_size); if (unlikely((__pyx_t_12 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error) __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_channels); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error) __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_buffer); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error) __pyx_t_5 = (Mix_OpenAudio(__pyx_t_4, __pyx_t_12, __pyx_t_13, __pyx_t_14) != 0); if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/mixer.pyx":93 * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: * raise error() # <<<<<<<<<<<<<< * * global output_spec */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_14 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_14 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_14, 0+__pyx_t_14); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 93, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":92 * frequency, size, channels, buffer = preinit_args * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/mixer.pyx":96 * * global output_spec * output_spec = get_init() # <<<<<<<<<<<<<< * * Mix_ChannelFinished(channel_callback) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_14 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_14 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_14, 0+__pyx_t_14); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_output_spec); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_output_spec, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":98 * output_spec = get_init() * * Mix_ChannelFinished(channel_callback) # <<<<<<<<<<<<<< * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): */ Mix_ChannelFinished(__pyx_f_11pygame_sdl2_5mixer_channel_callback); /* "pygame_sdl2/mixer.pyx":79 * errors = [ ] * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.mixer.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_flag); __Pyx_XDECREF(__pyx_v_frequency); __Pyx_XDECREF(__pyx_v_size); __Pyx_XDECREF(__pyx_v_channels); __Pyx_XDECREF(__pyx_v_buffer); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":100 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_32__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_int_22050)); __Pyx_GIVEREF(((PyObject *)__pyx_int_22050)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_int_22050))) __PYX_ERR(1, 100, __pyx_L1_error); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_size); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_size); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_size)) __PYX_ERR(1, 100, __pyx_L1_error); __Pyx_INCREF(((PyObject *)__pyx_int_2)); __Pyx_GIVEREF(((PyObject *)__pyx_int_2)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_2))) __PYX_ERR(1, 100, __pyx_L1_error); __Pyx_INCREF(((PyObject *)__pyx_int_4096)); __Pyx_GIVEREF(((PyObject *)__pyx_int_4096)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_int_4096))) __PYX_ERR(1, 100, __pyx_L1_error); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 100, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(1, 100, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5pre_init(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_4pre_init, "pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5pre_init = {"pre_init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5pre_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_4pre_init}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5pre_init(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_frequency = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_channels = 0; PyObject *__pyx_v_buffersize = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pre_init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_size,&__pyx_n_s_channels,&__pyx_n_s_buffersize,0}; __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self); values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_22050))); values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_size); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_2))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_4096))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 100, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 100, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_channels); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 100, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffersize); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 100, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pre_init") < 0)) __PYX_ERR(1, 100, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_frequency = values[0]; __pyx_v_size = values[1]; __pyx_v_channels = values[2]; __pyx_v_buffersize = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pre_init", 0, 0, 4, __pyx_nargs); __PYX_ERR(1, 100, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.pre_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_4pre_init(__pyx_self, __pyx_v_frequency, __pyx_v_size, __pyx_v_channels, __pyx_v_buffersize); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_4pre_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffersize) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pre_init", 1); /* "pygame_sdl2/mixer.pyx":102 * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): * global preinit_args * preinit_args = (frequency, size, channels, buffersize) # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_frequency); __Pyx_GIVEREF(__pyx_v_frequency); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_frequency)) __PYX_ERR(1, 102, __pyx_L1_error); __Pyx_INCREF(__pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_size)) __PYX_ERR(1, 102, __pyx_L1_error); __Pyx_INCREF(__pyx_v_channels); __Pyx_GIVEREF(__pyx_v_channels); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_channels)) __PYX_ERR(1, 102, __pyx_L1_error); __Pyx_INCREF(__pyx_v_buffersize); __Pyx_GIVEREF(__pyx_v_buffersize); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_buffersize)) __PYX_ERR(1, 102, __pyx_L1_error); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_preinit_args); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_preinit_args, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":100 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.pre_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":104 * preinit_args = (frequency, size, channels, buffersize) * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * Mix_CloseAudio() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_6quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_6quit}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_6quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_6quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/mixer.pyx":106 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * Mix_CloseAudio() # <<<<<<<<<<<<<< * Mix_Quit() * */ Mix_CloseAudio(); /* "pygame_sdl2/mixer.pyx":107 * def quit(): # @ReservedAssignment * Mix_CloseAudio() * Mix_Quit() # <<<<<<<<<<<<<< * * def get_init(): */ Mix_Quit(); /* "pygame_sdl2/mixer.pyx":104 * preinit_args = (frequency, size, channels, buffersize) * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * Mix_CloseAudio() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":109 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_9get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_8get_init, "get_init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_9get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_9get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_8get_init}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_9get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_8get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_8get_init(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_frequency; Uint16 __pyx_v_format; int __pyx_v_channels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/mixer.pyx":114 * cdef int channels * * if Mix_QuerySpec(&frequency, &format, &channels) == 0: # <<<<<<<<<<<<<< * return None * else: */ __pyx_t_1 = (Mix_QuerySpec((&__pyx_v_frequency), (&__pyx_v_format), (&__pyx_v_channels)) == 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":115 * * if Mix_QuerySpec(&frequency, &format, &channels) == 0: * return None # <<<<<<<<<<<<<< * else: * return frequency, format, channels */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":114 * cdef int channels * * if Mix_QuerySpec(&frequency, &format, &channels) == 0: # <<<<<<<<<<<<<< * return None * else: */ } /* "pygame_sdl2/mixer.pyx":117 * return None * else: * return frequency, format, channels # <<<<<<<<<<<<<< * * def stop(): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_frequency); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint16_t(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_channels); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(1, 117, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(1, 117, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(1, 117, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "pygame_sdl2/mixer.pyx":109 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":119 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_11stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_10stop, "stop()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_11stop = {"stop", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_11stop, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_10stop}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_11stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_10stop(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_10stop(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 1); /* "pygame_sdl2/mixer.pyx":120 * * def stop(): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(-1) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":121 * def stop(): * with nogil: * Mix_HaltChannel(-1) # <<<<<<<<<<<<<< * * def pause(): */ (void)(Mix_HaltChannel(-1)); } /* "pygame_sdl2/mixer.pyx":120 * * def stop(): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(-1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":119 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":123 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_13pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_12pause, "pause()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_13pause = {"pause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_13pause, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_12pause}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_13pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_12pause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_12pause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause", 1); /* "pygame_sdl2/mixer.pyx":124 * * def pause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(-1) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":125 * def pause(): * with nogil: * Mix_Pause(-1) # <<<<<<<<<<<<<< * * def unpause(): */ Mix_Pause(-1); } /* "pygame_sdl2/mixer.pyx":124 * * def pause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(-1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":123 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":127 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_15unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_14unpause, "unpause()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_15unpause = {"unpause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_15unpause, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_14unpause}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_15unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_14unpause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_14unpause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause", 1); /* "pygame_sdl2/mixer.pyx":128 * * def unpause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(-1) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":129 * def unpause(): * with nogil: * Mix_Resume(-1) # <<<<<<<<<<<<<< * * def fadeout(time): */ Mix_Resume(-1); } /* "pygame_sdl2/mixer.pyx":128 * * def unpause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(-1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":127 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":131 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_17fadeout(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_16fadeout, "fadeout(time)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_17fadeout = {"fadeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_17fadeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_16fadeout}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_17fadeout(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_time = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fadeout") < 0)) __PYX_ERR(1, 131, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_time = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fadeout", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 131, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_16fadeout(__pyx_self, __pyx_v_time); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_16fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time) { int __pyx_v_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 1); /* "pygame_sdl2/mixer.pyx":132 * * def fadeout(time): * cdef int ms = time # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(-1, ms) */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L1_error) __pyx_v_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":133 * def fadeout(time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(-1, ms) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":134 * cdef int ms = time * with nogil: * Mix_FadeOutChannel(-1, ms) # <<<<<<<<<<<<<< * * def set_num_channels(count): */ (void)(Mix_FadeOutChannel(-1, __pyx_v_ms)); } /* "pygame_sdl2/mixer.pyx":133 * def fadeout(time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(-1, ms) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":131 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":136 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_19set_num_channels(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_18set_num_channels, "set_num_channels(count)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_19set_num_channels = {"set_num_channels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_19set_num_channels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_18set_num_channels}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_19set_num_channels(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_count = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_num_channels (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_count,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_count)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 136, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_num_channels") < 0)) __PYX_ERR(1, 136, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_count = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_num_channels", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 136, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.set_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_18set_num_channels(__pyx_self, __pyx_v_count); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_18set_num_channels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_num_channels", 1); /* "pygame_sdl2/mixer.pyx":137 * * def set_num_channels(count): * Mix_AllocateChannels(count) # <<<<<<<<<<<<<< * * def get_num_channels(): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_count); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 137, __pyx_L1_error) (void)(Mix_AllocateChannels(__pyx_t_1)); /* "pygame_sdl2/mixer.pyx":136 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.set_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":139 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_21get_num_channels(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_20get_num_channels, "get_num_channels()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_21get_num_channels = {"get_num_channels", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_21get_num_channels, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_20get_num_channels}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_21get_num_channels(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_channels (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_20get_num_channels(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_20get_num_channels(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_num_channels", 1); /* "pygame_sdl2/mixer.pyx":140 * * def get_num_channels(): * return Mix_AllocateChannels(-1) # <<<<<<<<<<<<<< * * def set_reserved(count): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(Mix_AllocateChannels(-1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":139 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.get_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":142 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_23set_reserved(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_22set_reserved, "set_reserved(count)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_23set_reserved = {"set_reserved", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_23set_reserved, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_22set_reserved}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_23set_reserved(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_count = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_reserved (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_count,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_count)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_reserved") < 0)) __PYX_ERR(1, 142, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_count = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_reserved", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 142, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.set_reserved", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_22set_reserved(__pyx_self, __pyx_v_count); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_22set_reserved(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_reserved", 1); /* "pygame_sdl2/mixer.pyx":143 * * def set_reserved(count): * Mix_ReserveChannels(count) # <<<<<<<<<<<<<< * * def find_channel(force=False): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_count); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 143, __pyx_L1_error) (void)(Mix_ReserveChannels(__pyx_t_1)); /* "pygame_sdl2/mixer.pyx":142 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.set_reserved", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":145 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_25find_channel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_24find_channel, "find_channel(force=False)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_25find_channel = {"find_channel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_25find_channel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_24find_channel}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_25find_channel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_force = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("find_channel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_force,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_force); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 145, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "find_channel") < 0)) __PYX_ERR(1, 145, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_force = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("find_channel", 0, 0, 1, __pyx_nargs); __PYX_ERR(1, 145, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.find_channel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_24find_channel(__pyx_self, __pyx_v_force); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_24find_channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_force) { int __pyx_v_chan; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("find_channel", 1); /* "pygame_sdl2/mixer.pyx":147 * def find_channel(force=False): * cdef int chan * chan = Mix_GroupAvailable(-1) # <<<<<<<<<<<<<< * if chan == -1: * if not force: */ __pyx_v_chan = Mix_GroupAvailable(-1); /* "pygame_sdl2/mixer.pyx":148 * cdef int chan * chan = Mix_GroupAvailable(-1) * if chan == -1: # <<<<<<<<<<<<<< * if not force: * return None */ __pyx_t_1 = (__pyx_v_chan == -1L); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":149 * chan = Mix_GroupAvailable(-1) * if chan == -1: * if not force: # <<<<<<<<<<<<<< * return None * chan = Mix_GroupOldest(-1) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 149, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":150 * if chan == -1: * if not force: * return None # <<<<<<<<<<<<<< * chan = Mix_GroupOldest(-1) * if chan == -1: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":149 * chan = Mix_GroupAvailable(-1) * if chan == -1: * if not force: # <<<<<<<<<<<<<< * return None * chan = Mix_GroupOldest(-1) */ } /* "pygame_sdl2/mixer.pyx":151 * if not force: * return None * chan = Mix_GroupOldest(-1) # <<<<<<<<<<<<<< * if chan == -1: * raise error() */ __pyx_v_chan = Mix_GroupOldest(-1); /* "pygame_sdl2/mixer.pyx":152 * return None * chan = Mix_GroupOldest(-1) * if chan == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(chan) */ __pyx_t_2 = (__pyx_v_chan == -1L); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/mixer.pyx":153 * chan = Mix_GroupOldest(-1) * if chan == -1: * raise error() # <<<<<<<<<<<<<< * return Channel(chan) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 153, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":152 * return None * chan = Mix_GroupOldest(-1) * if chan == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(chan) */ } /* "pygame_sdl2/mixer.pyx":148 * cdef int chan * chan = Mix_GroupAvailable(-1) * if chan == -1: # <<<<<<<<<<<<<< * if not force: * return None */ } /* "pygame_sdl2/mixer.pyx":154 * if chan == -1: * raise error() * return Channel(chan) # <<<<<<<<<<<<<< * * def get_busy(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_chan); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":145 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.find_channel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":156 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_27get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_26get_busy, "get_busy()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_27get_busy = {"get_busy", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_27get_busy, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_26get_busy}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_27get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_busy (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_26get_busy(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_26get_busy(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_busy", 1); /* "pygame_sdl2/mixer.pyx":157 * * def get_busy(): * return Mix_GroupNewer(-1) != -1 # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((Mix_GroupNewer(-1) != -1L)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":156 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.get_busy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":163 * cdef Mix_Chunk *chunk * * def __cinit__(self): # <<<<<<<<<<<<<< * self.chunk = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound___cinit__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mixer_5Sound___cinit__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/mixer.pyx":164 * * def __cinit__(self): * self.chunk = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->chunk = NULL; /* "pygame_sdl2/mixer.pyx":163 * cdef Mix_Chunk *chunk * * def __cinit__(self): # <<<<<<<<<<<<<< * self.chunk = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/mixer.pyx":166 * self.chunk = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.chunk: * Mix_FreeChunk(self.chunk) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_5mixer_5Sound_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_5mixer_5Sound_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_5mixer_5Sound_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_5mixer_5Sound_2__dealloc__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_t_1; /* "pygame_sdl2/mixer.pyx":167 * * def __dealloc__(self): * if self.chunk: # <<<<<<<<<<<<<< * Mix_FreeChunk(self.chunk) * */ __pyx_t_1 = (__pyx_v_self->chunk != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":168 * def __dealloc__(self): * if self.chunk: * Mix_FreeChunk(self.chunk) # <<<<<<<<<<<<<< * * def __init__(self, fi): */ Mix_FreeChunk(__pyx_v_self->chunk); /* "pygame_sdl2/mixer.pyx":167 * * def __dealloc__(self): * if self.chunk: # <<<<<<<<<<<<<< * Mix_FreeChunk(self.chunk) * */ } /* "pygame_sdl2/mixer.pyx":166 * self.chunk = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.chunk: * Mix_FreeChunk(self.chunk) */ /* function exit code */ } /* "pygame_sdl2/mixer.pyx":170 * Mix_FreeChunk(self.chunk) * * def __init__(self, fi): # <<<<<<<<<<<<<< * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fi = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 170, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_fi = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 170, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_4__init__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v_fi); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mixer_5Sound_4__init__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_fi) { int __pyx_r; __Pyx_RefNannyDeclarations SDL_RWops *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/mixer.pyx":171 * * def __init__(self, fi): * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) # <<<<<<<<<<<<<< * if self.chunk == NULL: * raise error() */ __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_1 == ((SDL_RWops *)NULL))) __PYX_ERR(1, 171, __pyx_L1_error) __pyx_v_self->chunk = Mix_LoadWAV_RW(__pyx_t_1, 1); /* "pygame_sdl2/mixer.pyx":172 * def __init__(self, fi): * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_self->chunk == NULL); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/mixer.pyx":173 * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: * raise error() # <<<<<<<<<<<<<< * * def play(self, loops=0, maxtime=-1, fade_ms=0): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 173, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":172 * def __init__(self, fi): * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/mixer.pyx":170 * Mix_FreeChunk(self.chunk) * * def __init__(self, fi): # <<<<<<<<<<<<<< * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":175 * raise error() * * def play(self, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int cid * cdef int _loops = loops */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_6play, "Sound.play(self, loops=0, maxtime=-1, fade_ms=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_7play = {"play", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_6play}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_loops = 0; PyObject *__pyx_v_maxtime = 0; PyObject *__pyx_v_fade_ms = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loops,&__pyx_n_s_maxtime,&__pyx_n_s_fade_ms,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_neg_1)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loops); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxtime); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fade_ms); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "play") < 0)) __PYX_ERR(1, 175, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loops = values[0]; __pyx_v_maxtime = values[1]; __pyx_v_fade_ms = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play", 0, 0, 3, __pyx_nargs); __PYX_ERR(1, 175, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_6play(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v_loops, __pyx_v_maxtime, __pyx_v_fade_ms); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_6play(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms) { int __pyx_v_cid; int __pyx_v__loops; int __pyx_v__maxtime; int __pyx_v__fade_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("play", 1); /* "pygame_sdl2/mixer.pyx":177 * def play(self, loops=0, maxtime=-1, fade_ms=0): * cdef int cid * cdef int _loops = loops # <<<<<<<<<<<<<< * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 177, __pyx_L1_error) __pyx_v__loops = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":178 * cdef int cid * cdef int _loops = loops * cdef int _maxtime = maxtime # <<<<<<<<<<<<<< * cdef int _fade_ms = fade_ms * */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_maxtime); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 178, __pyx_L1_error) __pyx_v__maxtime = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":179 * cdef int _loops = loops * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_fade_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 179, __pyx_L1_error) __pyx_v__fade_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":181 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":182 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) * else: */ __pyx_t_2 = (__pyx_v__fade_ms != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":183 * with nogil: * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) # <<<<<<<<<<<<<< * else: * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) */ __pyx_v_cid = Mix_FadeInChannelTimed(-1, __pyx_v_self->chunk, __pyx_v__loops, __pyx_v__fade_ms, __pyx_v__maxtime); /* "pygame_sdl2/mixer.pyx":182 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) * else: */ goto __pyx_L6; } /* "pygame_sdl2/mixer.pyx":185 * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) * else: * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) # <<<<<<<<<<<<<< * * if cid == -1: */ /*else*/ { __pyx_v_cid = Mix_PlayChannelTimed(-1, __pyx_v_self->chunk, __pyx_v__loops, __pyx_v__maxtime); } __pyx_L6:; } /* "pygame_sdl2/mixer.pyx":181 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":187 * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(cid) */ __pyx_t_2 = (__pyx_v_cid == -1L); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/mixer.pyx":188 * * if cid == -1: * raise error() # <<<<<<<<<<<<<< * return Channel(cid) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_1 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_1 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_1, 0+__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 188, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":187 * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(cid) */ } /* "pygame_sdl2/mixer.pyx":189 * if cid == -1: * raise error() * return Channel(cid) # <<<<<<<<<<<<<< * * def stop(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":175 * raise error() * * def play(self, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int cid * cdef int _loops = loops */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":191 * return Channel(cid) * * def stop(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_8stop, "Sound.stop(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_9stop = {"stop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_8stop}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("stop", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "stop", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_8stop(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_8stop(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("stop", 1); /* "pygame_sdl2/mixer.pyx":192 * * def stop(self): * cdef int i = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":193 * def stop(self): * cdef int i = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_1 = (__pyx_v_i < Mix_AllocateChannels(-1)); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":194 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(i) */ __pyx_t_1 = (Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":195 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(i) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":196 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_HaltChannel(i) # <<<<<<<<<<<<<< * i += 1 * */ (void)(Mix_HaltChannel(__pyx_v_i)); } /* "pygame_sdl2/mixer.pyx":195 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(i) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/mixer.pyx":194 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(i) */ } /* "pygame_sdl2/mixer.pyx":197 * with nogil: * Mix_HaltChannel(i) * i += 1 # <<<<<<<<<<<<<< * * def pause(self): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":191 * return Channel(cid) * * def stop(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":199 * i += 1 * * def pause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_10pause, "Sound.pause(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_11pause = {"pause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_10pause}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("pause", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pause", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_10pause(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_10pause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("pause", 1); /* "pygame_sdl2/mixer.pyx":200 * * def pause(self): * cdef int i = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":201 * def pause(self): * cdef int i = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_1 = (__pyx_v_i < Mix_AllocateChannels(-1)); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":202 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(i) */ __pyx_t_1 = (Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":203 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(i) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":204 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_Pause(i) # <<<<<<<<<<<<<< * i += 1 * */ Mix_Pause(__pyx_v_i); } /* "pygame_sdl2/mixer.pyx":203 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(i) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/mixer.pyx":202 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(i) */ } /* "pygame_sdl2/mixer.pyx":205 * with nogil: * Mix_Pause(i) * i += 1 # <<<<<<<<<<<<<< * * def unpause(self): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":199 * i += 1 * * def pause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":207 * i += 1 * * def unpause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_12unpause, "Sound.unpause(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_13unpause = {"unpause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_12unpause}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("unpause", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "unpause", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_12unpause(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_12unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("unpause", 1); /* "pygame_sdl2/mixer.pyx":208 * * def unpause(self): * cdef int i = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":209 * def unpause(self): * cdef int i = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_1 = (__pyx_v_i < Mix_AllocateChannels(-1)); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":210 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(i) */ __pyx_t_1 = (Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":211 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(i) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":212 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_Resume(i) # <<<<<<<<<<<<<< * i += 1 * */ Mix_Resume(__pyx_v_i); } /* "pygame_sdl2/mixer.pyx":211 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(i) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/mixer.pyx":210 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(i) */ } /* "pygame_sdl2/mixer.pyx":213 * with nogil: * Mix_Resume(i) * i += 1 # <<<<<<<<<<<<<< * * def fadeout(self, time): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":207 * i += 1 * * def unpause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":215 * i += 1 * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int ms = time */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_14fadeout, "Sound.fadeout(self, time)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_15fadeout = {"fadeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_14fadeout}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_time = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 215, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fadeout") < 0)) __PYX_ERR(1, 215, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_time = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fadeout", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 215, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_14fadeout(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v_time); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_14fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_time) { int __pyx_v_i; int __pyx_v_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 1); /* "pygame_sdl2/mixer.pyx":216 * * def fadeout(self, time): * cdef int i = 0 # <<<<<<<<<<<<<< * cdef int ms = time * while i < Mix_AllocateChannels(-1): */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":217 * def fadeout(self, time): * cdef int i = 0 * cdef int ms = time # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 217, __pyx_L1_error) __pyx_v_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":218 * cdef int i = 0 * cdef int ms = time * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_2 = (__pyx_v_i < Mix_AllocateChannels(-1)); if (!__pyx_t_2) break; /* "pygame_sdl2/mixer.pyx":219 * cdef int ms = time * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(i, ms) */ __pyx_t_2 = (Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":220 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(i, ms) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":221 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_FadeOutChannel(i, ms) # <<<<<<<<<<<<<< * i += 1 * */ (void)(Mix_FadeOutChannel(__pyx_v_i, __pyx_v_ms)); } /* "pygame_sdl2/mixer.pyx":220 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(i, ms) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/mixer.pyx":219 * cdef int ms = time * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(i, ms) */ } /* "pygame_sdl2/mixer.pyx":222 * with nogil: * Mix_FadeOutChannel(i, ms) * i += 1 # <<<<<<<<<<<<<< * * def set_volume(self, value): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":215 * i += 1 * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int ms = time */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":224 * i += 1 * * def set_volume(self, value): # <<<<<<<<<<<<<< * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_16set_volume, "Sound.set_volume(self, value)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_17set_volume = {"set_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_16set_volume}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 224, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_volume") < 0)) __PYX_ERR(1, 224, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_value = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_volume", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 224, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_16set_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_16set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_volume", 1); /* "pygame_sdl2/mixer.pyx":225 * * def set_volume(self, value): * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) # <<<<<<<<<<<<<< * * def get_volume(self): */ __pyx_t_1 = __Pyx_PyInt_From___pyx_anon_enum(MIX_MAX_VOLUME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (void)(Mix_VolumeChunk(__pyx_v_self->chunk, __pyx_t_3)); /* "pygame_sdl2/mixer.pyx":224 * i += 1 * * def set_volume(self, value): # <<<<<<<<<<<<<< * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":227 * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * * def get_volume(self): # <<<<<<<<<<<<<< * return Mix_VolumeChunk(self.chunk, -1) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_18get_volume, "Sound.get_volume(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_19get_volume = {"get_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_18get_volume}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_volume (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_volume", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_volume", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_18get_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_18get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_volume", 1); /* "pygame_sdl2/mixer.pyx":228 * * def get_volume(self): * return Mix_VolumeChunk(self.chunk, -1) # <<<<<<<<<<<<<< * * def get_num_channels(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(Mix_VolumeChunk(__pyx_v_self->chunk, -1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":227 * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * * def get_volume(self): # <<<<<<<<<<<<<< * return Mix_VolumeChunk(self.chunk, -1) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":230 * return Mix_VolumeChunk(self.chunk, -1) * * def get_num_channels(self): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int n = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_20get_num_channels, "Sound.get_num_channels(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_21get_num_channels = {"get_num_channels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_20get_num_channels}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_channels (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_num_channels", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_num_channels", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_20get_num_channels(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_20get_num_channels(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; int __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_num_channels", 1); /* "pygame_sdl2/mixer.pyx":231 * * def get_num_channels(self): * cdef int i = 0 # <<<<<<<<<<<<<< * cdef int n = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":232 * def get_num_channels(self): * cdef int i = 0 * cdef int n = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_n = 0; /* "pygame_sdl2/mixer.pyx":233 * cdef int i = 0 * cdef int n = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * n += 1 */ while (1) { __pyx_t_1 = (__pyx_v_i < Mix_AllocateChannels(-1)); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":234 * cdef int n = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * n += 1 * i += 1 */ __pyx_t_1 = (Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":235 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * n += 1 # <<<<<<<<<<<<<< * i += 1 * return n */ __pyx_v_n = (__pyx_v_n + 1); /* "pygame_sdl2/mixer.pyx":234 * cdef int n = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * n += 1 * i += 1 */ } /* "pygame_sdl2/mixer.pyx":236 * if Mix_GetChunk(i) == self.chunk: * n += 1 * i += 1 # <<<<<<<<<<<<<< * return n * */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":237 * n += 1 * i += 1 * return n # <<<<<<<<<<<<<< * * def get_length(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":230 * return Mix_VolumeChunk(self.chunk, -1) * * def get_num_channels(self): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int n = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":239 * return n * * def get_length(self): # <<<<<<<<<<<<<< * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_22get_length, "Sound.get_length(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_23get_length = {"get_length", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_22get_length}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_length (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_length", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_length", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_22get_length(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_22get_length(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_length", 1); /* "pygame_sdl2/mixer.pyx":241 * def get_length(self): * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] # <<<<<<<<<<<<<< * * def get_raw(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_v_self->chunk->alen)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_11pygame_sdl2_5mixer_output_spec, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_3, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_11pygame_sdl2_5mixer_output_spec, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":239 * return n * * def get_length(self): # <<<<<<<<<<<<<< * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_length", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":243 * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] * * def get_raw(self): # <<<<<<<<<<<<<< * # return self.chunk.abuf * raise error("Not implemented.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_24get_raw, "Sound.get_raw(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_25get_raw = {"get_raw", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_24get_raw}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_raw (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_raw", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_raw", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_24get_raw(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_24get_raw(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_raw", 1); /* "pygame_sdl2/mixer.pyx":245 * def get_raw(self): * # return self.chunk.abuf * raise error("Not implemented.") # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Not_implemented}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 245, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":243 * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] * * def get_raw(self): # <<<<<<<<<<<<<< * # return self.chunk.abuf * raise error("Not implemented.") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_raw", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__, "Sound.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__, "Sound.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":251 * cdef int cid * * def __init__(self, cid): # <<<<<<<<<<<<<< * self.cid = cid * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_cid = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cid,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cid)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 251, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 251, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_cid = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 251, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel___init__(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_cid); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mixer_7Channel___init__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_cid) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/mixer.pyx":252 * * def __init__(self, cid): * self.cid = cid # <<<<<<<<<<<<<< * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_cid); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 252, __pyx_L1_error) __pyx_v_self->cid = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":251 * cdef int cid * * def __init__(self, cid): # <<<<<<<<<<<<<< * self.cid = cid * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/mixer.pyx":254 * self.cid = cid * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int _loops = loops * cdef int _maxtime = maxtime */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_2play, "Channel.play(self, Sound sound, loops=0, maxtime=-1, fade_ms=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_3play = {"play", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_2play}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound = 0; PyObject *__pyx_v_loops = 0; PyObject *__pyx_v_maxtime = 0; PyObject *__pyx_v_fade_ms = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sound,&__pyx_n_s_loops,&__pyx_n_s_maxtime,&__pyx_n_s_fade_ms,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_neg_1)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sound)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 254, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loops); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 254, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxtime); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 254, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fade_ms); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 254, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "play") < 0)) __PYX_ERR(1, 254, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_sound = ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)values[0]); __pyx_v_loops = values[1]; __pyx_v_maxtime = values[2]; __pyx_v_fade_ms = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play", 0, 1, 4, __pyx_nargs); __PYX_ERR(1, 254, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sound), __pyx_ptype_11pygame_sdl2_5mixer_Sound, 0, "sound", 0))) __PYX_ERR(1, 254, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_sound, __pyx_v_loops, __pyx_v_maxtime, __pyx_v_fade_ms); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms) { int __pyx_v__loops; int __pyx_v__maxtime; int __pyx_v__fade_ms; int __pyx_v_cid; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("play", 1); /* "pygame_sdl2/mixer.pyx":255 * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): * cdef int _loops = loops # <<<<<<<<<<<<<< * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 255, __pyx_L1_error) __pyx_v__loops = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":256 * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): * cdef int _loops = loops * cdef int _maxtime = maxtime # <<<<<<<<<<<<<< * cdef int _fade_ms = fade_ms * */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_maxtime); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 256, __pyx_L1_error) __pyx_v__maxtime = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":257 * cdef int _loops = loops * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_fade_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 257, __pyx_L1_error) __pyx_v__fade_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":259 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":260 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) * else: */ __pyx_t_2 = (__pyx_v__fade_ms != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":261 * with nogil: * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) # <<<<<<<<<<<<<< * else: * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) */ __pyx_v_cid = Mix_FadeInChannelTimed(__pyx_v_self->cid, __pyx_v_sound->chunk, __pyx_v__loops, __pyx_v__fade_ms, __pyx_v__maxtime); /* "pygame_sdl2/mixer.pyx":260 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) * else: */ goto __pyx_L6; } /* "pygame_sdl2/mixer.pyx":263 * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) * else: * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) # <<<<<<<<<<<<<< * * if cid == -1: */ /*else*/ { __pyx_v_cid = Mix_PlayChannelTimed(__pyx_v_self->cid, __pyx_v_sound->chunk, __pyx_v__loops, __pyx_v__maxtime); } __pyx_L6:; } /* "pygame_sdl2/mixer.pyx":259 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":265 * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_cid == -1L); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/mixer.pyx":266 * * if cid == -1: * raise error() # <<<<<<<<<<<<<< * * with _lock: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_1 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_1 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_1, 0+__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 266, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":265 * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/mixer.pyx":268 * raise error() * * with _lock: # <<<<<<<<<<<<<< * current_sounds[self.cid] = sound * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 268, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_1 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_1 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_1, 0+__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 268, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "pygame_sdl2/mixer.pyx":269 * * with _lock: * current_sounds[self.cid] = sound # <<<<<<<<<<<<<< * * def stop(self): */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 269, __pyx_L12_error) } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 269, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_3, ((PyObject *)__pyx_v_sound)) < 0))) __PYX_ERR(1, 269, __pyx_L12_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":268 * raise error() * * with _lock: # <<<<<<<<<<<<<< * current_sounds[self.cid] = sound * */ } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L17_try_end; __pyx_L12_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(1, 268, __pyx_L14_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __pyx_t_7 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 268, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 268, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_2 < 0) __PYX_ERR(1, 268, __pyx_L14_except_error) __pyx_t_12 = (!__pyx_t_2); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __PYX_ERR(1, 268, __pyx_L14_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L13_exception_handled; } __pyx_L14_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L13_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_L17_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_6) { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } goto __pyx_L11; } __pyx_L11:; } goto __pyx_L21; __pyx_L8_error:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L1_error; __pyx_L21:; } /* "pygame_sdl2/mixer.pyx":254 * self.cid = cid * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int _loops = loops * cdef int _maxtime = maxtime */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":271 * current_sounds[self.cid] = sound * * def stop(self): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_4stop, "Channel.stop(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_5stop = {"stop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_4stop}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("stop", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "stop", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_4stop(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_4stop(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 1); /* "pygame_sdl2/mixer.pyx":272 * * def stop(self): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(self.cid) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":273 * def stop(self): * with nogil: * Mix_HaltChannel(self.cid) # <<<<<<<<<<<<<< * * def pause(self): */ (void)(Mix_HaltChannel(__pyx_v_self->cid)); } /* "pygame_sdl2/mixer.pyx":272 * * def stop(self): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(self.cid) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":271 * current_sounds[self.cid] = sound * * def stop(self): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":275 * Mix_HaltChannel(self.cid) * * def pause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_6pause, "Channel.pause(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_7pause = {"pause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_6pause}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("pause", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pause", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_6pause(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_6pause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause", 1); /* "pygame_sdl2/mixer.pyx":276 * * def pause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(self.cid) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":277 * def pause(self): * with nogil: * Mix_Pause(self.cid) # <<<<<<<<<<<<<< * * def unpause(self): */ Mix_Pause(__pyx_v_self->cid); } /* "pygame_sdl2/mixer.pyx":276 * * def pause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(self.cid) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":275 * Mix_HaltChannel(self.cid) * * def pause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":279 * Mix_Pause(self.cid) * * def unpause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_8unpause, "Channel.unpause(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_9unpause = {"unpause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_8unpause}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("unpause", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "unpause", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_8unpause(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_8unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause", 1); /* "pygame_sdl2/mixer.pyx":280 * * def unpause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(self.cid) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":281 * def unpause(self): * with nogil: * Mix_Resume(self.cid) # <<<<<<<<<<<<<< * * def fadeout(self, time): */ Mix_Resume(__pyx_v_self->cid); } /* "pygame_sdl2/mixer.pyx":280 * * def unpause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(self.cid) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":279 * Mix_Pause(self.cid) * * def unpause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":283 * Mix_Resume(self.cid) * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_10fadeout, "Channel.fadeout(self, time)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_11fadeout = {"fadeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_10fadeout}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_time = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 283, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fadeout") < 0)) __PYX_ERR(1, 283, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_time = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fadeout", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 283, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_10fadeout(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_time); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_10fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_time) { int __pyx_v_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 1); /* "pygame_sdl2/mixer.pyx":284 * * def fadeout(self, time): * cdef int ms = time # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(self.cid, ms) */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 284, __pyx_L1_error) __pyx_v_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":285 * def fadeout(self, time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(self.cid, ms) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":286 * cdef int ms = time * with nogil: * Mix_FadeOutChannel(self.cid, ms) # <<<<<<<<<<<<<< * * def set_volume(self, volume): */ (void)(Mix_FadeOutChannel(__pyx_v_self->cid, __pyx_v_ms)); } /* "pygame_sdl2/mixer.pyx":285 * def fadeout(self, time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(self.cid, ms) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":283 * Mix_Resume(self.cid) * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":288 * Mix_FadeOutChannel(self.cid, ms) * * def set_volume(self, volume): # <<<<<<<<<<<<<< * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_12set_volume, "Channel.set_volume(self, volume)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_13set_volume = {"set_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_12set_volume}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_volume = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_volume,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_volume)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 288, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_volume") < 0)) __PYX_ERR(1, 288, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_volume = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_volume", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 288, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_12set_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_volume); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_12set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_volume) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_volume", 1); /* "pygame_sdl2/mixer.pyx":289 * * def set_volume(self, volume): * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) # <<<<<<<<<<<<<< * * def get_volume(self): */ __pyx_t_1 = __Pyx_PyInt_From___pyx_anon_enum(MIX_MAX_VOLUME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (void)(Mix_Volume(__pyx_v_self->cid, __pyx_t_3)); /* "pygame_sdl2/mixer.pyx":288 * Mix_FadeOutChannel(self.cid, ms) * * def set_volume(self, volume): # <<<<<<<<<<<<<< * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":291 * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * * def get_volume(self): # <<<<<<<<<<<<<< * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_14get_volume, "Channel.get_volume(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_15get_volume = {"get_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_14get_volume}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_volume (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_volume", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_volume", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_14get_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_14get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { int __pyx_v_vol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_volume", 1); /* "pygame_sdl2/mixer.pyx":292 * * def get_volume(self): * cdef int vol = Mix_Volume(self.cid, -1) # <<<<<<<<<<<<<< * return vol / MIX_MAX_VOLUME * */ __pyx_v_vol = Mix_Volume(__pyx_v_self->cid, -1); /* "pygame_sdl2/mixer.pyx":293 * def get_volume(self): * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME # <<<<<<<<<<<<<< * * def get_busy(self): */ __Pyx_XDECREF(__pyx_r); if (unlikely(((double)MIX_MAX_VOLUME) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(1, 293, __pyx_L1_error) } __pyx_t_1 = PyFloat_FromDouble((((double)__pyx_v_vol) / ((double)MIX_MAX_VOLUME))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":291 * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * * def get_volume(self): # <<<<<<<<<<<<<< * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":295 * return vol / MIX_MAX_VOLUME * * def get_busy(self): # <<<<<<<<<<<<<< * return Mix_Playing(self.cid) != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_16get_busy, "Channel.get_busy(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_17get_busy = {"get_busy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_16get_busy}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_busy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_busy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_busy", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_16get_busy(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_16get_busy(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_busy", 1); /* "pygame_sdl2/mixer.pyx":296 * * def get_busy(self): * return Mix_Playing(self.cid) != 0 # <<<<<<<<<<<<<< * * def get_sound(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((Mix_Playing(__pyx_v_self->cid) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":295 * return vol / MIX_MAX_VOLUME * * def get_busy(self): # <<<<<<<<<<<<<< * return Mix_Playing(self.cid) != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_busy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":298 * return Mix_Playing(self.cid) != 0 * * def get_sound(self): # <<<<<<<<<<<<<< * with _lock: * return current_sounds.get(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_18get_sound, "Channel.get_sound(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_19get_sound = {"get_sound", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_18get_sound}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_sound (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_sound", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_sound", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_18get_sound(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_18get_sound(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sound", 1); /* "pygame_sdl2/mixer.pyx":299 * * def get_sound(self): * with _lock: # <<<<<<<<<<<<<< * return current_sounds.get(self.cid) * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 299, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 299, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/mixer.pyx":300 * def get_sound(self): * with _lock: * return current_sounds.get(self.cid) # <<<<<<<<<<<<<< * * def queue(self, Sound sound): */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(1, 300, __pyx_L7_error) } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 300, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 300, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/mixer.pyx":299 * * def get_sound(self): * with _lock: # <<<<<<<<<<<<<< * return current_sounds.get(self.cid) * */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_sound", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(1, 299, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 299, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 299, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_11 < 0) __PYX_ERR(1, 299, __pyx_L9_except_error) __pyx_t_12 = (!__pyx_t_11); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __PYX_ERR(1, 299, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_9 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L16; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L16:; } /* "pygame_sdl2/mixer.pyx":298 * return Mix_Playing(self.cid) != 0 * * def get_sound(self): # <<<<<<<<<<<<<< * with _lock: * return current_sounds.get(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_sound", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":302 * return current_sounds.get(self.cid) * * def queue(self, Sound sound): # <<<<<<<<<<<<<< * if self.get_busy(): * with _lock: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_20queue, "Channel.queue(self, Sound sound)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_21queue = {"queue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_20queue}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("queue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sound,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sound)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 302, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "queue") < 0)) __PYX_ERR(1, 302, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sound = ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("queue", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 302, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sound), __pyx_ptype_11pygame_sdl2_5mixer_Sound, 1, "sound", 0))) __PYX_ERR(1, 302, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_20queue(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_sound); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_20queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("queue", 1); /* "pygame_sdl2/mixer.pyx":303 * * def queue(self, Sound sound): * if self.get_busy(): # <<<<<<<<<<<<<< * with _lock: * channel_queued[self.cid] = sound */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_busy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":304 * def queue(self, Sound sound): * if self.get_busy(): * with _lock: # <<<<<<<<<<<<<< * channel_queued[self.cid] = sound * else: */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 304, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 304, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "pygame_sdl2/mixer.pyx":305 * if self.get_busy(): * with _lock: * channel_queued[self.cid] = sound # <<<<<<<<<<<<<< * else: * self.play(sound) */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 305, __pyx_L8_error) } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 305, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1, ((PyObject *)__pyx_v_sound)) < 0))) __PYX_ERR(1, 305, __pyx_L8_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":304 * def queue(self, Sound sound): * if self.get_busy(): * with _lock: # <<<<<<<<<<<<<< * channel_queued[self.cid] = sound * else: */ } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L13_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(1, 304, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __pyx_t_7 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 304, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 304, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_5 < 0) __PYX_ERR(1, 304, __pyx_L10_except_error) __pyx_t_12 = (!__pyx_t_5); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __PYX_ERR(1, 304, __pyx_L10_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_L13_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_6) { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } goto __pyx_L7; } __pyx_L7:; } goto __pyx_L17; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L1_error; __pyx_L17:; } /* "pygame_sdl2/mixer.pyx":303 * * def queue(self, Sound sound): * if self.get_busy(): # <<<<<<<<<<<<<< * with _lock: * channel_queued[self.cid] = sound */ goto __pyx_L3; } /* "pygame_sdl2/mixer.pyx":307 * channel_queued[self.cid] = sound * else: * self.play(sound) # <<<<<<<<<<<<<< * * def get_queue(self): */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_play); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_sound)}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "pygame_sdl2/mixer.pyx":302 * return current_sounds.get(self.cid) * * def queue(self, Sound sound): # <<<<<<<<<<<<<< * if self.get_busy(): * with _lock: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":309 * self.play(sound) * * def get_queue(self): # <<<<<<<<<<<<<< * with _lock: * return channel_queued.get(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_22get_queue, "Channel.get_queue(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_23get_queue = {"get_queue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_22get_queue}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_queue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_queue", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_queue", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_22get_queue(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_22get_queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_queue", 1); /* "pygame_sdl2/mixer.pyx":310 * * def get_queue(self): * with _lock: # <<<<<<<<<<<<<< * return channel_queued.get(self.cid) * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 310, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 310, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/mixer.pyx":311 * def get_queue(self): * with _lock: * return channel_queued.get(self.cid) # <<<<<<<<<<<<<< * * def set_endevent(self, type=None): */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(1, 311, __pyx_L7_error) } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 311, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 311, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/mixer.pyx":310 * * def get_queue(self): * with _lock: # <<<<<<<<<<<<<< * return channel_queued.get(self.cid) * */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(1, 310, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 310, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 310, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_11 < 0) __PYX_ERR(1, 310, __pyx_L9_except_error) __pyx_t_12 = (!__pyx_t_11); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __PYX_ERR(1, 310, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_9 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L16; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L16:; } /* "pygame_sdl2/mixer.pyx":309 * self.play(sound) * * def get_queue(self): # <<<<<<<<<<<<<< * with _lock: * return channel_queued.get(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":313 * return channel_queued.get(self.cid) * * def set_endevent(self, type=None): # <<<<<<<<<<<<<< * channel_events[self.cid] = type or 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_24set_endevent, "Channel.set_endevent(self, type=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_25set_endevent = {"set_endevent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_24set_endevent}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_endevent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 313, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_endevent") < 0)) __PYX_ERR(1, 313, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_endevent", 0, 0, 1, __pyx_nargs); __PYX_ERR(1, 313, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_24set_endevent(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_24set_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_endevent", 1); /* "pygame_sdl2/mixer.pyx":314 * * def set_endevent(self, type=None): * channel_events[self.cid] = type or 0 # <<<<<<<<<<<<<< * * def get_endevent(self): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_type); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 314, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_type); __pyx_t_1 = __pyx_v_type; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; __pyx_L3_bool_binop_done:; if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 314, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(1, 314, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":313 * return channel_queued.get(self.cid) * * def set_endevent(self, type=None): # <<<<<<<<<<<<<< * channel_events[self.cid] = type or 0 * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":316 * channel_events[self.cid] = type or 0 * * def get_endevent(self): # <<<<<<<<<<<<<< * return channel_events.get(self.cid, 0) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_26get_endevent, "Channel.get_endevent(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_27get_endevent = {"get_endevent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_26get_endevent}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_endevent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_endevent", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_endevent", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_26get_endevent(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_26get_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_endevent", 1); /* "pygame_sdl2/mixer.pyx":317 * * def get_endevent(self): * return channel_events.get(self.cid, 0) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(1, 317, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_1, __pyx_int_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":316 * channel_events[self.cid] = type or 0 * * def get_endevent(self): # <<<<<<<<<<<<<< * return channel_events.get(self.cid, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__, "Channel.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self.cid,) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error); __pyx_t_1 = 0; __pyx_v_state = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self.cid,) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v__dict = __pyx_t_2; __pyx_t_2 = 0; /* "(tree fragment)":7 * state = (self.cid,) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_3 = (__pyx_v__dict != Py_None); if (__pyx_t_3) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict)) __PYX_ERR(0, 8, __pyx_L1_error); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = False */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self.cid,) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = False # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_Channel, (type(self), 0x5424626, None), state */ /*else*/ { __pyx_v_use_setstate = 0; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Channel, (type(self), 0x5424626, None), state * else: */ if (__pyx_v_use_setstate) { /* "(tree fragment)":13 * use_setstate = False * if use_setstate: * return __pyx_unpickle_Channel, (type(self), 0x5424626, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_Channel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(0, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_int_88229414); __Pyx_GIVEREF(__pyx_int_88229414); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_88229414)) __PYX_ERR(0, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None)) __PYX_ERR(0, 13, __pyx_L1_error); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(0, 13, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Channel, (type(self), 0x5424626, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_Channel, (type(self), 0x5424626, None), state * else: * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Channel__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Channel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_int_88229414); __Pyx_GIVEREF(__pyx_int_88229414); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_88229414)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state)) __PYX_ERR(0, 15, __pyx_L1_error); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Channel__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__, "Channel.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 16, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Channel__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(0, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_11pygame_sdl2_5mixer___pyx_unpickle_Channel__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Channel__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_28__pyx_unpickle_Channel, "__pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel = {"__pyx_unpickle_Channel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_28__pyx_unpickle_Channel}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_Channel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Channel", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Channel", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Channel") < 0)) __PYX_ERR(0, 1, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Channel", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.__pyx_unpickle_Channel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_28__pyx_unpickle_Channel(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_28__pyx_unpickle_Channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_Channel", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x5424626, 0x3cbe300, 0x4b7cc56): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__3, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum not in (0x5424626, 0x3cbe300, 0x4b7cc56): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum * __pyx_result = Channel.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(0, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v___pyx_PickleError = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum not in (0x5424626, 0x3cbe300, 0x4b7cc56): * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum # <<<<<<<<<<<<<< * __pyx_result = Channel.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x5424626, 0x3cbe300, 0x4b7cc56): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum * __pyx_result = Channel.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v___pyx_result = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum * __pyx_result = Channel.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_2 = (__pyx_v___pyx_state != Py_None); if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = Channel.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(0, 9, __pyx_L1_error) __pyx_t_1 = __pyx_f_11pygame_sdl2_5mixer___pyx_unpickle_Channel__set_state(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum * __pyx_result = Channel.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): * __pyx_result.cid = __pyx_state[0] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.mixer.__pyx_unpickle_Channel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.cid = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_11pygame_sdl2_5mixer___pyx_unpickle_Channel__set_state(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_Channel__set_state", 1); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): * __pyx_result.cid = __pyx_state[0] # <<<<<<<<<<<<<< * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->cid = __pyx_t_2; /* "(tree fragment)":13 * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): * __pyx_result.cid = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 13, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 13, __pyx_L1_error) __pyx_t_5 = (__pyx_t_4 > 1); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 13, __pyx_L1_error) __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { /* "(tree fragment)":14 * __pyx_result.cid = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 14, __pyx_L1_error) } __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): * __pyx_result.cid = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ } /* "(tree fragment)":11 * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.cid = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.mixer.__pyx_unpickle_Channel__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Sound(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_11pygame_sdl2_5mixer_5Sound_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_5mixer_Sound(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_5mixer_Sound) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_5mixer_5Sound_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_11pygame_sdl2_5mixer_Sound[] = { {"play", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_6play}, {"stop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_8stop}, {"pause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_10pause}, {"unpause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_12unpause}, {"fadeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_14fadeout}, {"set_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_16set_volume}, {"get_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_18get_volume}, {"get_num_channels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_20get_num_channels}, {"get_length", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_22get_length}, {"get_raw", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_24get_raw}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_5mixer_Sound_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_5mixer_Sound}, {Py_tp_doc, (void *)PyDoc_STR("Sound(fi)")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_5mixer_Sound}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_5mixer_Sound}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_5mixer_Sound_spec = { "pygame_sdl2.mixer.Sound", sizeof(struct __pyx_obj_11pygame_sdl2_5mixer_Sound), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_5mixer_Sound_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_5mixer_Sound = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.mixer.""Sound", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5mixer_Sound), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5mixer_Sound, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Sound(fi)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5mixer_Sound, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5mixer_Sound, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Channel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5mixer_Channel(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_5mixer_Channel) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_11pygame_sdl2_5mixer_Channel[] = { {"play", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_2play}, {"stop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_4stop}, {"pause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_6pause}, {"unpause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_8unpause}, {"fadeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_10fadeout}, {"set_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_12set_volume}, {"get_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_14get_volume}, {"get_busy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_16get_busy}, {"get_sound", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_18get_sound}, {"queue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_20queue}, {"get_queue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_22get_queue}, {"set_endevent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_24set_endevent}, {"get_endevent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_26get_endevent}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_5mixer_Channel_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_5mixer_Channel}, {Py_tp_doc, (void *)PyDoc_STR("Channel(cid)")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_5mixer_Channel}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_5mixer_Channel}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_5mixer_Channel_spec = { "pygame_sdl2.mixer.Channel", sizeof(struct __pyx_obj_11pygame_sdl2_5mixer_Channel), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_5mixer_Channel_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_5mixer_Channel = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.mixer.""Channel", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5mixer_Channel), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5mixer_Channel, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Channel(cid)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5mixer_Channel, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5mixer_Channel, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Channel, __pyx_k_Channel, sizeof(__pyx_k_Channel), 0, 0, 1, 1}, {&__pyx_n_s_Channel___reduce_cython, __pyx_k_Channel___reduce_cython, sizeof(__pyx_k_Channel___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Channel___setstate_cython, __pyx_k_Channel___setstate_cython, sizeof(__pyx_k_Channel___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Channel_fadeout, __pyx_k_Channel_fadeout, sizeof(__pyx_k_Channel_fadeout), 0, 0, 1, 1}, {&__pyx_n_s_Channel_get_busy, __pyx_k_Channel_get_busy, sizeof(__pyx_k_Channel_get_busy), 0, 0, 1, 1}, {&__pyx_n_s_Channel_get_endevent, __pyx_k_Channel_get_endevent, sizeof(__pyx_k_Channel_get_endevent), 0, 0, 1, 1}, {&__pyx_n_s_Channel_get_queue, __pyx_k_Channel_get_queue, sizeof(__pyx_k_Channel_get_queue), 0, 0, 1, 1}, {&__pyx_n_s_Channel_get_sound, __pyx_k_Channel_get_sound, sizeof(__pyx_k_Channel_get_sound), 0, 0, 1, 1}, {&__pyx_n_s_Channel_get_volume, __pyx_k_Channel_get_volume, sizeof(__pyx_k_Channel_get_volume), 0, 0, 1, 1}, {&__pyx_n_s_Channel_pause, __pyx_k_Channel_pause, sizeof(__pyx_k_Channel_pause), 0, 0, 1, 1}, {&__pyx_n_s_Channel_play, __pyx_k_Channel_play, sizeof(__pyx_k_Channel_play), 0, 0, 1, 1}, {&__pyx_n_s_Channel_queue, __pyx_k_Channel_queue, sizeof(__pyx_k_Channel_queue), 0, 0, 1, 1}, {&__pyx_n_s_Channel_set_endevent, __pyx_k_Channel_set_endevent, sizeof(__pyx_k_Channel_set_endevent), 0, 0, 1, 1}, {&__pyx_n_s_Channel_set_volume, __pyx_k_Channel_set_volume, sizeof(__pyx_k_Channel_set_volume), 0, 0, 1, 1}, {&__pyx_n_s_Channel_stop, __pyx_k_Channel_stop, sizeof(__pyx_k_Channel_stop), 0, 0, 1, 1}, {&__pyx_n_s_Channel_unpause, __pyx_k_Channel_unpause, sizeof(__pyx_k_Channel_unpause), 0, 0, 1, 1}, {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, {&__pyx_n_s_Lock, __pyx_k_Lock, sizeof(__pyx_k_Lock), 0, 0, 1, 1}, {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_Sound, __pyx_k_Sound, sizeof(__pyx_k_Sound), 0, 0, 1, 1}, {&__pyx_n_s_Sound___reduce_cython, __pyx_k_Sound___reduce_cython, sizeof(__pyx_k_Sound___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Sound___setstate_cython, __pyx_k_Sound___setstate_cython, sizeof(__pyx_k_Sound___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Sound_fadeout, __pyx_k_Sound_fadeout, sizeof(__pyx_k_Sound_fadeout), 0, 0, 1, 1}, {&__pyx_n_s_Sound_get_length, __pyx_k_Sound_get_length, sizeof(__pyx_k_Sound_get_length), 0, 0, 1, 1}, {&__pyx_n_s_Sound_get_num_channels, __pyx_k_Sound_get_num_channels, sizeof(__pyx_k_Sound_get_num_channels), 0, 0, 1, 1}, {&__pyx_n_s_Sound_get_raw, __pyx_k_Sound_get_raw, sizeof(__pyx_k_Sound_get_raw), 0, 0, 1, 1}, {&__pyx_n_s_Sound_get_volume, __pyx_k_Sound_get_volume, sizeof(__pyx_k_Sound_get_volume), 0, 0, 1, 1}, {&__pyx_n_s_Sound_pause, __pyx_k_Sound_pause, sizeof(__pyx_k_Sound_pause), 0, 0, 1, 1}, {&__pyx_n_s_Sound_play, __pyx_k_Sound_play, sizeof(__pyx_k_Sound_play), 0, 0, 1, 1}, {&__pyx_n_s_Sound_set_volume, __pyx_k_Sound_set_volume, sizeof(__pyx_k_Sound_set_volume), 0, 0, 1, 1}, {&__pyx_n_s_Sound_stop, __pyx_k_Sound_stop, sizeof(__pyx_k_Sound_stop), 0, 0, 1, 1}, {&__pyx_n_s_Sound_unpause, __pyx_k_Sound_unpause, sizeof(__pyx_k_Sound_unpause), 0, 0, 1, 1}, {&__pyx_n_s_Thread, __pyx_k_Thread, sizeof(__pyx_k_Thread), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, {&__pyx_n_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 1}, {&__pyx_n_s__74, __pyx_k__74, sizeof(__pyx_k__74), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, {&__pyx_n_s_buffersize, __pyx_k_buffersize, sizeof(__pyx_k_buffersize), 0, 0, 1, 1}, {&__pyx_n_s_chan, __pyx_k_chan, sizeof(__pyx_k_chan), 0, 0, 1, 1}, {&__pyx_n_s_channel, __pyx_k_channel, sizeof(__pyx_k_channel), 0, 0, 1, 1}, {&__pyx_n_s_channels, __pyx_k_channels, sizeof(__pyx_k_channels), 0, 0, 1, 1}, {&__pyx_n_s_cid, __pyx_k_cid, sizeof(__pyx_k_cid), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_n_s_fade_ms, __pyx_k_fade_ms, sizeof(__pyx_k_fade_ms), 0, 0, 1, 1}, {&__pyx_n_s_fade_ms_2, __pyx_k_fade_ms_2, sizeof(__pyx_k_fade_ms_2), 0, 0, 1, 1}, {&__pyx_n_s_fadeout, __pyx_k_fadeout, sizeof(__pyx_k_fadeout), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_find_channel, __pyx_k_find_channel, sizeof(__pyx_k_find_channel), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_frequency, __pyx_k_frequency, sizeof(__pyx_k_frequency), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_busy, __pyx_k_get_busy, sizeof(__pyx_k_get_busy), 0, 0, 1, 1}, {&__pyx_n_s_get_endevent, __pyx_k_get_endevent, sizeof(__pyx_k_get_endevent), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_length, __pyx_k_get_length, sizeof(__pyx_k_get_length), 0, 0, 1, 1}, {&__pyx_n_s_get_num_channels, __pyx_k_get_num_channels, sizeof(__pyx_k_get_num_channels), 0, 0, 1, 1}, {&__pyx_n_s_get_queue, __pyx_k_get_queue, sizeof(__pyx_k_get_queue), 0, 0, 1, 1}, {&__pyx_n_s_get_raw, __pyx_k_get_raw, sizeof(__pyx_k_get_raw), 0, 0, 1, 1}, {&__pyx_n_s_get_sound, __pyx_k_get_sound, sizeof(__pyx_k_get_sound), 0, 0, 1, 1}, {&__pyx_n_s_get_volume, __pyx_k_get_volume, sizeof(__pyx_k_get_volume), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_loops, __pyx_k_loops, sizeof(__pyx_k_loops), 0, 0, 1, 1}, {&__pyx_n_s_loops_2, __pyx_k_loops_2, sizeof(__pyx_k_loops_2), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_maxtime, __pyx_k_maxtime, sizeof(__pyx_k_maxtime), 0, 0, 1, 1}, {&__pyx_n_s_maxtime_2, __pyx_k_maxtime_2, sizeof(__pyx_k_maxtime_2), 0, 0, 1, 1}, {&__pyx_n_s_mixer_music, __pyx_k_mixer_music, sizeof(__pyx_k_mixer_music), 0, 0, 1, 1}, {&__pyx_n_s_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 0, 1, 1}, {&__pyx_n_s_music, __pyx_k_music, sizeof(__pyx_k_music), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_next_sound, __pyx_k_next_sound, sizeof(__pyx_k_next_sound), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_pause, __pyx_k_pause, sizeof(__pyx_k_pause), 0, 0, 1, 1}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_play, __pyx_k_play, sizeof(__pyx_k_play), 0, 0, 1, 1}, {&__pyx_n_s_play_current, __pyx_k_play_current, sizeof(__pyx_k_play_current), 0, 0, 1, 1}, {&__pyx_n_s_pre_init, __pyx_k_pre_init, sizeof(__pyx_k_pre_init), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mixer, __pyx_k_pygame_sdl2_mixer, sizeof(__pyx_k_pygame_sdl2_mixer), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mixer_music, __pyx_k_pygame_sdl2_mixer_music, sizeof(__pyx_k_pygame_sdl2_mixer_music), 0, 0, 1, 1}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_Channel, __pyx_k_pyx_unpickle_Channel, sizeof(__pyx_k_pyx_unpickle_Channel), 0, 0, 1, 1}, {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_endevent, __pyx_k_set_endevent, sizeof(__pyx_k_set_endevent), 0, 0, 1, 1}, {&__pyx_n_s_set_num_channels, __pyx_k_set_num_channels, sizeof(__pyx_k_set_num_channels), 0, 0, 1, 1}, {&__pyx_n_s_set_reserved, __pyx_k_set_reserved, sizeof(__pyx_k_set_reserved), 0, 0, 1, 1}, {&__pyx_n_s_set_volume, __pyx_k_set_volume, sizeof(__pyx_k_set_volume), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_sound, __pyx_k_sound, sizeof(__pyx_k_sound), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_k_src_pygame_sdl2_mixer_pyx, sizeof(__pyx_k_src_pygame_sdl2_mixer_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_unpause, __pyx_k_unpause, sizeof(__pyx_k_unpause), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_vol, __pyx_k_vol, sizeof(__pyx_k_vol), 0, 0, 1, 1}, {&__pyx_n_s_volume, __pyx_k_volume, sizeof(__pyx_k_volume), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/mixer.pyx":50 * cdef Sound next_sound * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound */ __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x5424626, 0x3cbe300, 0x4b7cc56): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum */ __pyx_tuple__3 = PyTuple_Pack(3, __pyx_int_88229414, __pyx_int_63693568, __pyx_int_79154262); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/mixer.pyx":28 * from pygame_sdl2.error import error * * import pygame_sdl2.mixer_music as music # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_pygame_sdl2, __pyx_n_s_mixer_music); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_channel, __pyx_n_s_next_sound); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_play_current, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 41, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":79 * errors = [ ] * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: */ __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_frequency, __pyx_n_s_size, __pyx_n_s_channels, __pyx_n_s_buffer, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_init, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 79, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":100 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_frequency, __pyx_n_s_size, __pyx_n_s_channels, __pyx_n_s_buffersize); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_pre_init, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 100, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":104 * preinit_args = (frequency, size, channels, buffersize) * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * Mix_CloseAudio() */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_quit, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(1, 104, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":109 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_frequency, __pyx_n_s_format, __pyx_n_s_channels); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_init, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 109, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":119 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_stop, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 119, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":123 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_pause, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 123, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":127 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_unpause, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 127, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":131 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_time, __pyx_n_s_ms); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_fadeout, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 131, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":136 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_count); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_num_channels, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 136, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":139 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_num_channels, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 139, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":142 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_reserved, 142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 142, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":145 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_force, __pyx_n_s_chan); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_find_channel, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(1, 145, __pyx_L1_error) __pyx_tuple__27 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "pygame_sdl2/mixer.pyx":156 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_busy, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(1, 156, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":175 * raise error() * * def play(self, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int cid * cdef int _loops = loops */ __pyx_tuple__29 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_loops, __pyx_n_s_maxtime, __pyx_n_s_fade_ms, __pyx_n_s_cid, __pyx_n_s_loops_2, __pyx_n_s_maxtime_2, __pyx_n_s_fade_ms_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_play, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(1, 175, __pyx_L1_error) __pyx_tuple__31 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_neg_1, __pyx_int_0); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "pygame_sdl2/mixer.pyx":191 * return Channel(cid) * * def stop(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_i); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_stop, 191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(1, 191, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":199 * i += 1 * * def pause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_pause, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 199, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":207 * i += 1 * * def unpause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_unpause, 207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(1, 207, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":215 * i += 1 * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int ms = time */ __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_time, __pyx_n_s_i, __pyx_n_s_ms); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_fadeout, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 215, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":224 * i += 1 * * def set_volume(self, value): # <<<<<<<<<<<<<< * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * */ __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_volume, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 224, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":227 * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * * def get_volume(self): # <<<<<<<<<<<<<< * return Mix_VolumeChunk(self.chunk, -1) * */ __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_volume, 227, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(1, 227, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":230 * return Mix_VolumeChunk(self.chunk, -1) * * def get_num_channels(self): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int n = 0 */ __pyx_tuple__42 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_n); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_num_channels, 230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(1, 230, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":239 * return n * * def get_length(self): # <<<<<<<<<<<<<< * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] */ __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_length, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(1, 239, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":243 * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] * * def get_raw(self): # <<<<<<<<<<<<<< * # return self.chunk.abuf * raise error("Not implemented.") */ __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_raw, 243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(1, 243, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 3, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":254 * self.cid = cid * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int _loops = loops * cdef int _maxtime = maxtime */ __pyx_tuple__49 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_sound, __pyx_n_s_loops, __pyx_n_s_maxtime, __pyx_n_s_fade_ms, __pyx_n_s_loops_2, __pyx_n_s_maxtime_2, __pyx_n_s_fade_ms_2, __pyx_n_s_cid); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_play, 254, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(1, 254, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":271 * current_sounds[self.cid] = sound * * def stop(self): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(self.cid) */ __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_stop, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(1, 271, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":275 * Mix_HaltChannel(self.cid) * * def pause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(self.cid) */ __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_pause, 275, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(1, 275, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":279 * Mix_Pause(self.cid) * * def unpause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(self.cid) */ __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_unpause, 279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(1, 279, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":283 * Mix_Resume(self.cid) * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_time, __pyx_n_s_ms); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_fadeout, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(1, 283, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":288 * Mix_FadeOutChannel(self.cid, ms) * * def set_volume(self, volume): # <<<<<<<<<<<<<< * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * */ __pyx_tuple__56 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_volume); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_volume, 288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(1, 288, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":291 * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * * def get_volume(self): # <<<<<<<<<<<<<< * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME */ __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_vol); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_volume, 291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(1, 291, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":295 * return vol / MIX_MAX_VOLUME * * def get_busy(self): # <<<<<<<<<<<<<< * return Mix_Playing(self.cid) != 0 * */ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_busy, 295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 295, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":298 * return Mix_Playing(self.cid) != 0 * * def get_sound(self): # <<<<<<<<<<<<<< * with _lock: * return current_sounds.get(self.cid) */ __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_sound, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(1, 298, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":302 * return current_sounds.get(self.cid) * * def queue(self, Sound sound): # <<<<<<<<<<<<<< * if self.get_busy(): * with _lock: */ __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_sound); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_queue, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(1, 302, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":309 * self.play(sound) * * def get_queue(self): # <<<<<<<<<<<<<< * with _lock: * return channel_queued.get(self.cid) */ __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_queue, 309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(1, 309, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":313 * return channel_queued.get(self.cid) * * def set_endevent(self, type=None): # <<<<<<<<<<<<<< * channel_events[self.cid] = type or 0 * */ __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_type); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(1, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_endevent, 313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(1, 313, __pyx_L1_error) __pyx_tuple__67 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(1, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); /* "pygame_sdl2/mixer.pyx":316 * channel_events[self.cid] = type or 0 * * def get_endevent(self): # <<<<<<<<<<<<<< * return channel_events.get(self.cid, 0) */ __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_endevent, 316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(1, 316, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_tuple__69 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Channel__set_state(self, __pyx_state) */ __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_tuple__72 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Channel, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get; if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_4096 = PyInt_FromLong(4096); if (unlikely(!__pyx_int_4096)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_22050 = PyInt_FromLong(22050L); if (unlikely(!__pyx_int_22050)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_63693568 = PyInt_FromLong(63693568L); if (unlikely(!__pyx_int_63693568)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_79154262 = PyInt_FromLong(79154262L); if (unlikely(!__pyx_int_79154262)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_88229414 = PyInt_FromLong(88229414L); if (unlikely(!__pyx_int_88229414)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_5mixer_preinit_args = Py_None; Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_output_spec = Py_None; Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_channel_events = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_channel_queued = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_current_sounds = ((PyObject*)Py_None); Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_5mixer_Sound = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_5mixer_Sound_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_5mixer_Sound)) __PYX_ERR(1, 160, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_5mixer_Sound_spec, __pyx_ptype_11pygame_sdl2_5mixer_Sound) < 0) __PYX_ERR(1, 160, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_5mixer_Sound = &__pyx_type_11pygame_sdl2_5mixer_Sound; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_5mixer_Sound) < 0) __PYX_ERR(1, 160, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_5mixer_Sound->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_5mixer_Sound->tp_dictoffset && __pyx_ptype_11pygame_sdl2_5mixer_Sound->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_5mixer_Sound->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Sound, (PyObject *) __pyx_ptype_11pygame_sdl2_5mixer_Sound) < 0) __PYX_ERR(1, 160, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_5mixer_Sound) < 0) __PYX_ERR(1, 160, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_5mixer_Channel = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_5mixer_Channel_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_5mixer_Channel)) __PYX_ERR(1, 248, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_5mixer_Channel_spec, __pyx_ptype_11pygame_sdl2_5mixer_Channel) < 0) __PYX_ERR(1, 248, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_5mixer_Channel = &__pyx_type_11pygame_sdl2_5mixer_Channel; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_5mixer_Channel) < 0) __PYX_ERR(1, 248, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_5mixer_Channel->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_5mixer_Channel->tp_dictoffset && __pyx_ptype_11pygame_sdl2_5mixer_Channel->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_5mixer_Channel->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Channel, (PyObject *) __pyx_ptype_11pygame_sdl2_5mixer_Channel) < 0) __PYX_ERR(1, 248, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_5mixer_Channel) < 0) __PYX_ERR(1, 248, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_8(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_mixer(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_mixer}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "mixer", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initmixer(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initmixer(void) #else __Pyx_PyMODINIT_FUNC PyInit_mixer(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_mixer(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_mixer(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'mixer' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("mixer", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "mixer" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_mixer(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__mixer) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.mixer")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.mixer", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "pygame_sdl2/mixer.pyx":24 * from libc.string cimport memset * * import sys # <<<<<<<<<<<<<< * import threading * from pygame_sdl2.error import error */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":25 * * import sys * import threading # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_threading, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_2) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":26 * import sys * import threading * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * import pygame_sdl2.mixer_music as music */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(1, 26, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":28 * from pygame_sdl2.error import error * * import pygame_sdl2.mixer_music as music # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2_mixer_music, __pyx_tuple__6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_music, __pyx_t_3) < 0) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":29 * * import pygame_sdl2.mixer_music as music * import pygame_sdl2 # <<<<<<<<<<<<<< * * cdef object preinit_args = None */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":31 * import pygame_sdl2 * * cdef object preinit_args = None # <<<<<<<<<<<<<< * cdef object output_spec = None * */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_preinit_args); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_preinit_args, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer.pyx":32 * * cdef object preinit_args = None * cdef object output_spec = None # <<<<<<<<<<<<<< * * cdef dict channel_events = {} */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_output_spec); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_output_spec, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer.pyx":34 * cdef object output_spec = None * * cdef dict channel_events = {} # <<<<<<<<<<<<<< * cdef dict channel_queued = {} * cdef dict current_sounds = {} */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_channel_events); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_channel_events, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":35 * * cdef dict channel_events = {} * cdef dict channel_queued = {} # <<<<<<<<<<<<<< * cdef dict current_sounds = {} * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_channel_queued); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_channel_queued, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":36 * cdef dict channel_events = {} * cdef dict channel_queued = {} * cdef dict current_sounds = {} # <<<<<<<<<<<<<< * * # The lock protects channel_queued and current_sounds. */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_current_sounds); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_current_sounds, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":39 * * # The lock protects channel_queued and current_sounds. * _lock = threading.Lock() # <<<<<<<<<<<<<< * * def _play_current(int channel): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_lock, __pyx_t_3) < 0) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_1_play_current, 0, __pyx_n_s_play_current, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_play_current, __pyx_t_3) < 0) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":77 * * # A list of errors that occured during mixer initialization. * errors = [ ] # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_errors, __pyx_t_3) < 0) __PYX_ERR(1, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":79 * errors = [ ] * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_3init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults), 1)) __PYX_ERR(1, 79, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":80 * * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): # <<<<<<<<<<<<<< * if get_init() is not None: * return */ __pyx_t_4 = __Pyx_PyInt_From___pyx_anon_enum(MIX_DEFAULT_FORMAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_3)->__pyx_arg_size = __pyx_t_4; __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_11pygame_sdl2_5mixer_30__defaults__); /* "pygame_sdl2/mixer.pyx":79 * errors = [ ] * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/mixer.pyx":100 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5pre_init, 0, __pyx_n_s_pre_init, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults1), 1)) __PYX_ERR(1, 100, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(MIX_DEFAULT_FORMAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_4)->__pyx_arg_size = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_11pygame_sdl2_5mixer_32__defaults__); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pre_init, __pyx_t_4) < 0) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/mixer.pyx":104 * preinit_args = (frequency, size, channels, buffersize) * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * Mix_CloseAudio() */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":109 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_9get_init, 0, __pyx_n_s_get_init, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":119 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_11stop, 0, __pyx_n_s_stop, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(1, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":123 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_13pause, 0, __pyx_n_s_pause, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pause, __pyx_t_2) < 0) __PYX_ERR(1, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":127 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_15unpause, 0, __pyx_n_s_unpause, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpause, __pyx_t_2) < 0) __PYX_ERR(1, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":131 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_17fadeout, 0, __pyx_n_s_fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_fadeout, __pyx_t_2) < 0) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":136 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_19set_num_channels, 0, __pyx_n_s_set_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_num_channels, __pyx_t_2) < 0) __PYX_ERR(1, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":139 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_21get_num_channels, 0, __pyx_n_s_get_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_channels, __pyx_t_2) < 0) __PYX_ERR(1, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":142 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_23set_reserved, 0, __pyx_n_s_set_reserved, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_reserved, __pyx_t_2) < 0) __PYX_ERR(1, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":145 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_25find_channel, 0, __pyx_n_s_find_channel, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__27); if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_channel, __pyx_t_2) < 0) __PYX_ERR(1, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":156 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_27get_busy, 0, __pyx_n_s_get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_busy, __pyx_t_2) < 0) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":175 * raise error() * * def play(self, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int cid * cdef int _loops = loops */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_7play, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_play, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__31); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_play, __pyx_t_2) < 0) __PYX_ERR(1, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":191 * return Channel(cid) * * def stop(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_9stop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_stop, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(1, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":199 * i += 1 * * def pause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_11pause, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_pause, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_pause, __pyx_t_2) < 0) __PYX_ERR(1, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":207 * i += 1 * * def unpause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_13unpause, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_unpause, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_unpause, __pyx_t_2) < 0) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":215 * i += 1 * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int ms = time */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_15fadeout, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_fadeout, __pyx_t_2) < 0) __PYX_ERR(1, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":224 * i += 1 * * def set_volume(self, value): # <<<<<<<<<<<<<< * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_17set_volume, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_set_volume, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_set_volume, __pyx_t_2) < 0) __PYX_ERR(1, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":227 * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * * def get_volume(self): # <<<<<<<<<<<<<< * return Mix_VolumeChunk(self.chunk, -1) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_19get_volume, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_get_volume, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_get_volume, __pyx_t_2) < 0) __PYX_ERR(1, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":230 * return Mix_VolumeChunk(self.chunk, -1) * * def get_num_channels(self): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int n = 0 */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_21get_num_channels, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_get_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_get_num_channels, __pyx_t_2) < 0) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":239 * return n * * def get_length(self): # <<<<<<<<<<<<<< * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_23get_length, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_get_length, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_get_length, __pyx_t_2) < 0) __PYX_ERR(1, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":243 * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] * * def get_raw(self): # <<<<<<<<<<<<<< * # return self.chunk.abuf * raise error("Not implemented.") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_25get_raw, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_get_raw, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_get_raw, __pyx_t_2) < 0) __PYX_ERR(1, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":254 * self.cid = cid * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int _loops = loops * cdef int _maxtime = maxtime */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_3play, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_play, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__31); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_play, __pyx_t_2) < 0) __PYX_ERR(1, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":271 * current_sounds[self.cid] = sound * * def stop(self): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(self.cid) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_5stop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_stop, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(1, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":275 * Mix_HaltChannel(self.cid) * * def pause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(self.cid) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_7pause, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_pause, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_pause, __pyx_t_2) < 0) __PYX_ERR(1, 275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":279 * Mix_Pause(self.cid) * * def unpause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(self.cid) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_9unpause, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_unpause, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_unpause, __pyx_t_2) < 0) __PYX_ERR(1, 279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":283 * Mix_Resume(self.cid) * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_11fadeout, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_fadeout, __pyx_t_2) < 0) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":288 * Mix_FadeOutChannel(self.cid, ms) * * def set_volume(self, volume): # <<<<<<<<<<<<<< * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_13set_volume, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_set_volume, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_set_volume, __pyx_t_2) < 0) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":291 * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * * def get_volume(self): # <<<<<<<<<<<<<< * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_15get_volume, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_volume, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_get_volume, __pyx_t_2) < 0) __PYX_ERR(1, 291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":295 * return vol / MIX_MAX_VOLUME * * def get_busy(self): # <<<<<<<<<<<<<< * return Mix_Playing(self.cid) != 0 * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_17get_busy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_get_busy, __pyx_t_2) < 0) __PYX_ERR(1, 295, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":298 * return Mix_Playing(self.cid) != 0 * * def get_sound(self): # <<<<<<<<<<<<<< * with _lock: * return current_sounds.get(self.cid) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_19get_sound, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_sound, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_get_sound, __pyx_t_2) < 0) __PYX_ERR(1, 298, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":302 * return current_sounds.get(self.cid) * * def queue(self, Sound sound): # <<<<<<<<<<<<<< * if self.get_busy(): * with _lock: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_21queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_queue, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_queue, __pyx_t_2) < 0) __PYX_ERR(1, 302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":309 * self.play(sound) * * def get_queue(self): # <<<<<<<<<<<<<< * with _lock: * return channel_queued.get(self.cid) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_23get_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_queue, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_get_queue, __pyx_t_2) < 0) __PYX_ERR(1, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":313 * return channel_queued.get(self.cid) * * def set_endevent(self, type=None): # <<<<<<<<<<<<<< * channel_events[self.cid] = type or 0 * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_25set_endevent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_set_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__67); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_set_endevent, __pyx_t_2) < 0) __PYX_ERR(1, 313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":316 * channel_events[self.cid] = type or 0 * * def get_endevent(self): # <<<<<<<<<<<<<< * return channel_events.get(self.cid, 0) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_27get_endevent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_get_endevent, __pyx_t_2) < 0) __PYX_ERR(1, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "(tree fragment)":16 * else: * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Channel__set_state(self, __pyx_state) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "(tree fragment)":1 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel, 0, __pyx_n_s_pyx_unpickle_Channel, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Channel, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.mixer", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.mixer"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* RaiseUnboundLocalError */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *result; PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); if (unlikely(!selfless_args)) return NULL; result = PyObject_Call(method, selfless_args, kwargs); Py_DECREF(selfless_args); return result; } static PyMethodDef __Pyx_UnboundCMethod_Def = { "CythonUnboundCMethod", __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), METH_VARARGS | METH_KEYWORDS, NULL }; static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #else if (likely(!__Pyx_CyOrPyCFunction_Check(method))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } else #endif #if CYTHON_COMPILING_IN_PYPY #else if (PyCFunction_Check(method)) #endif { PyObject *self; int self_found; #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY self = PyObject_GetAttrString(method, "__self__"); if (!self) { PyErr_Clear(); } #else self = PyCFunction_GET_SELF(method); #endif self_found = (self && self != Py_None); #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY Py_XDECREF(self); #endif if (self_found) { PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); if (unlikely(!unbound_method)) return -1; Py_DECREF(method); target->method = unbound_method; } } return 0; } /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { if (likely(cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); #endif } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } return __Pyx__CallUnboundCMethod1(cfunc, self, arg); } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(2, self, arg); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { if (likely(cfunc->func)) { PyObject *args[2] = {arg1, arg2}; if (cfunc->flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } #if PY_VERSION_HEX >= 0x030700A0 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); } #endif static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(3); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg1); PyTuple_SET_ITEM(args, 1, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 2, arg2); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(3, self, arg1, arg2); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* dict_getitem_default */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); if ((1)); #else if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; } Py_INCREF(value); } #endif else { if (default_value == Py_None) value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); else value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); else state = (PyGILState_STATE)0; #endif CYTHON_UNUSED_VAR(clineno); CYTHON_UNUSED_VAR(lineno); CYTHON_UNUSED_VAR(filename); CYTHON_MAYBE_UNUSED_VAR(nogil); __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) { return PyFloat_FromDouble((double)a / (double)b); } return PyInt_Type.tp_as_number->nb_true_divide(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; if (unlikely(__Pyx_PyLong_IsZero(op1))) { } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); } } if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) || __Pyx_PyLong_DigitCount(op1) <= 52 / PyLong_SHIFT) { return PyFloat_FromDouble((double)a / (double)b); } return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); return PyLong_FromLong(x); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("divide", return NULL) result = ((double)a) / (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); } #endif /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* GetAttr3 */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } #endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { r = __Pyx_NewRef(d); } return r; } #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); #endif } /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__4); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* HasAttr */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (!r) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } #endif /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__5; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MIX_InitFlags(MIX_InitFlags value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MIX_InitFlags neg_one = (MIX_InitFlags) -1, const_zero = (MIX_InitFlags) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MIX_InitFlags) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MIX_InitFlags) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MIX_InitFlags) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MIX_InitFlags) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MIX_InitFlags) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(MIX_InitFlags), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(MIX_InitFlags)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint16_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint16_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) >= 2 * PyLong_SHIFT)) { return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) >= 3 * PyLong_SHIFT)) { return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) >= 4 * PyLong_SHIFT)) { return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint16_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint16_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint16_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { return (uint16_t) (((uint16_t)-1)*(((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { return (uint16_t) ((((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { return (uint16_t) (((uint16_t)-1)*(((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { return (uint16_t) ((((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) { return (uint16_t) (((uint16_t)-1)*(((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) { return (uint16_t) ((((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; } } #endif if ((sizeof(uint16_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint16_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint16_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint16_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint16_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint16_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint16_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint16_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint16_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint16_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint16_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint16_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint16_t) 1) << (sizeof(uint16_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint16_t) -1; } } else { uint16_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint16_t) -1; val = __Pyx_PyInt_As_uint16_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint16_t"); return (uint16_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint16_t"); return (uint16_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint16_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint16_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__74); } return name; } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_8 #define __PYX_HAVE_RT_ImportFunction_3_0_8 static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709476.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.mixer_music.c0000664000175000017500000127430714760217144021356 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__mixer_music #define __PYX_HAVE_API__pygame_sdl2__mixer_music /* Early includes */ #include #include #include #include #include "SDL.h" #include "SDL_mixer.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/mixer_music.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_mixer" */ /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.mixer_music" */ static Mix_Music *__pyx_v_11pygame_sdl2_11mixer_music_current_music; static PyObject *__pyx_v_11pygame_sdl2_11mixer_music_queued_music = 0; static int __pyx_v_11pygame_sdl2_11mixer_music_endevent; static void __pyx_f_11pygame_sdl2_11mixer_music_music_finished(void); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.mixer_music" extern int __pyx_module_is_main_pygame_sdl2__mixer_music; int __pyx_module_is_main_pygame_sdl2__mixer_music = 0; /* Implementation of "pygame_sdl2.mixer_music" */ /* #### Code section: global_var ### */ /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; static const char __pyx_k_fi[] = "fi"; static const char __pyx_k__24[] = "?"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_load[] = "load"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_play[] = "play"; static const char __pyx_k_stop[] = "stop"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_time[] = "time"; static const char __pyx_k_type[] = "type"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_loops[] = "loops"; static const char __pyx_k_pause[] = "pause"; static const char __pyx_k_queue[] = "queue"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_rewind[] = "rewind"; static const char __pyx_k_fadeout[] = "fadeout"; static const char __pyx_k_get_pos[] = "get_pos"; static const char __pyx_k_set_pos[] = "set_pos"; static const char __pyx_k_unpause[] = "unpause"; static const char __pyx_k_get_busy[] = "get_busy"; static const char __pyx_k_get_volume[] = "get_volume"; static const char __pyx_k_set_volume[] = "set_volume"; static const char __pyx_k_get_endevent[] = "get_endevent"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_set_endevent[] = "set_endevent"; static const char __pyx_k_Not_implemented[] = "Not implemented."; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_mixer_music[] = "pygame_sdl2.mixer_music"; static const char __pyx_k_src_pygame_sdl2_mixer_music_pyx[] = "src/pygame_sdl2/mixer_music.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_2play(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loops, double __pyx_v_start); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_4rewind(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_6stop(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_8pause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_10unpause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_12fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_14set_volume(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_16get_volume(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_18get_busy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_20set_pos(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_22get_pos(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_24queue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_26set_endevent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_28get_endevent(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_u_; PyObject *__pyx_kp_s_Not_implemented; PyObject *__pyx_n_s__24; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_fadeout; PyObject *__pyx_n_s_fi; PyObject *__pyx_n_s_get_busy; PyObject *__pyx_n_s_get_endevent; PyObject *__pyx_n_s_get_pos; PyObject *__pyx_n_s_get_volume; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_load; PyObject *__pyx_n_s_loops; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_pause; PyObject *__pyx_n_s_play; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_mixer_music; PyObject *__pyx_n_s_queue; PyObject *__pyx_n_s_rewind; PyObject *__pyx_n_s_set_endevent; PyObject *__pyx_n_s_set_pos; PyObject *__pyx_n_s_set_volume; PyObject *__pyx_kp_s_src_pygame_sdl2_mixer_music_pyx; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_stop; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_time; PyObject *__pyx_n_s_type; PyObject *__pyx_n_s_unpause; PyObject *__pyx_n_s_value; PyObject *__pyx_int_0; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__22; PyObject *__pyx_codeobj__3; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_kp_s_Not_implemented); Py_CLEAR(clear_module_state->__pyx_n_s__24); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_fadeout); Py_CLEAR(clear_module_state->__pyx_n_s_fi); Py_CLEAR(clear_module_state->__pyx_n_s_get_busy); Py_CLEAR(clear_module_state->__pyx_n_s_get_endevent); Py_CLEAR(clear_module_state->__pyx_n_s_get_pos); Py_CLEAR(clear_module_state->__pyx_n_s_get_volume); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_load); Py_CLEAR(clear_module_state->__pyx_n_s_loops); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_pause); Py_CLEAR(clear_module_state->__pyx_n_s_play); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_mixer_music); Py_CLEAR(clear_module_state->__pyx_n_s_queue); Py_CLEAR(clear_module_state->__pyx_n_s_rewind); Py_CLEAR(clear_module_state->__pyx_n_s_set_endevent); Py_CLEAR(clear_module_state->__pyx_n_s_set_pos); Py_CLEAR(clear_module_state->__pyx_n_s_set_volume); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_mixer_music_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_stop); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_time); Py_CLEAR(clear_module_state->__pyx_n_s_type); Py_CLEAR(clear_module_state->__pyx_n_s_unpause); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_codeobj__3); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_kp_s_Not_implemented); Py_VISIT(traverse_module_state->__pyx_n_s__24); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_fadeout); Py_VISIT(traverse_module_state->__pyx_n_s_fi); Py_VISIT(traverse_module_state->__pyx_n_s_get_busy); Py_VISIT(traverse_module_state->__pyx_n_s_get_endevent); Py_VISIT(traverse_module_state->__pyx_n_s_get_pos); Py_VISIT(traverse_module_state->__pyx_n_s_get_volume); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_load); Py_VISIT(traverse_module_state->__pyx_n_s_loops); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_pause); Py_VISIT(traverse_module_state->__pyx_n_s_play); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_mixer_music); Py_VISIT(traverse_module_state->__pyx_n_s_queue); Py_VISIT(traverse_module_state->__pyx_n_s_rewind); Py_VISIT(traverse_module_state->__pyx_n_s_set_endevent); Py_VISIT(traverse_module_state->__pyx_n_s_set_pos); Py_VISIT(traverse_module_state->__pyx_n_s_set_volume); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_mixer_music_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_stop); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_time); Py_VISIT(traverse_module_state->__pyx_n_s_type); Py_VISIT(traverse_module_state->__pyx_n_s_unpause); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_codeobj__3); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_kp_s_Not_implemented __pyx_mstate_global->__pyx_kp_s_Not_implemented #define __pyx_n_s__24 __pyx_mstate_global->__pyx_n_s__24 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_fadeout __pyx_mstate_global->__pyx_n_s_fadeout #define __pyx_n_s_fi __pyx_mstate_global->__pyx_n_s_fi #define __pyx_n_s_get_busy __pyx_mstate_global->__pyx_n_s_get_busy #define __pyx_n_s_get_endevent __pyx_mstate_global->__pyx_n_s_get_endevent #define __pyx_n_s_get_pos __pyx_mstate_global->__pyx_n_s_get_pos #define __pyx_n_s_get_volume __pyx_mstate_global->__pyx_n_s_get_volume #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_load __pyx_mstate_global->__pyx_n_s_load #define __pyx_n_s_loops __pyx_mstate_global->__pyx_n_s_loops #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_pause __pyx_mstate_global->__pyx_n_s_pause #define __pyx_n_s_play __pyx_mstate_global->__pyx_n_s_play #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_mixer_music __pyx_mstate_global->__pyx_n_s_pygame_sdl2_mixer_music #define __pyx_n_s_queue __pyx_mstate_global->__pyx_n_s_queue #define __pyx_n_s_rewind __pyx_mstate_global->__pyx_n_s_rewind #define __pyx_n_s_set_endevent __pyx_mstate_global->__pyx_n_s_set_endevent #define __pyx_n_s_set_pos __pyx_mstate_global->__pyx_n_s_set_pos #define __pyx_n_s_set_volume __pyx_mstate_global->__pyx_n_s_set_volume #define __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_mixer_music_pyx #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time #define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type #define __pyx_n_s_unpause __pyx_mstate_global->__pyx_n_s_unpause #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 /* #### Code section: module_code ### */ /* "pygame_sdl2/mixer_music.pyx":30 * cdef int endevent = 0 * * cdef void music_finished() noexcept: # <<<<<<<<<<<<<< * global queued_music * if queued_music: */ static void __pyx_f_11pygame_sdl2_11mixer_music_music_finished(void) { SDL_Event __pyx_v_e; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("music_finished", 1); /* "pygame_sdl2/mixer_music.pyx":32 * cdef void music_finished() noexcept: * global queued_music * if queued_music: # <<<<<<<<<<<<<< * load(queued_music) * play() */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 32, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":33 * global queued_music * if queued_music: * load(queued_music) # <<<<<<<<<<<<<< * play() * queued_music = None */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_load); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_11pygame_sdl2_11mixer_music_queued_music}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer_music.pyx":34 * if queued_music: * load(queued_music) * play() # <<<<<<<<<<<<<< * queued_music = None * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_play); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer_music.pyx":35 * load(queued_music) * play() * queued_music = None # <<<<<<<<<<<<<< * * cdef SDL_Event e */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11mixer_music_queued_music, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer_music.pyx":32 * cdef void music_finished() noexcept: * global queued_music * if queued_music: # <<<<<<<<<<<<<< * load(queued_music) * play() */ } /* "pygame_sdl2/mixer_music.pyx":38 * * cdef SDL_Event e * if endevent != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent */ __pyx_t_1 = (__pyx_v_11pygame_sdl2_11mixer_music_endevent != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":39 * cdef SDL_Event e * if endevent != 0: * memset(&e, 0, sizeof(SDL_Event)) # <<<<<<<<<<<<<< * e.type = endevent * SDL_PushEvent(&e) */ (void)(memset((&__pyx_v_e), 0, (sizeof(SDL_Event)))); /* "pygame_sdl2/mixer_music.pyx":40 * if endevent != 0: * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent # <<<<<<<<<<<<<< * SDL_PushEvent(&e) * */ __pyx_v_e.type = __pyx_v_11pygame_sdl2_11mixer_music_endevent; /* "pygame_sdl2/mixer_music.pyx":41 * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent * SDL_PushEvent(&e) # <<<<<<<<<<<<<< * * */ (void)(SDL_PushEvent((&__pyx_v_e))); /* "pygame_sdl2/mixer_music.pyx":38 * * cdef SDL_Event e * if endevent != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent */ } /* "pygame_sdl2/mixer_music.pyx":30 * cdef int endevent = 0 * * cdef void music_finished() noexcept: # <<<<<<<<<<<<<< * global queued_music * if queued_music: */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_WriteUnraisable("pygame_sdl2.mixer_music.music_finished", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_1load(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_load, "load(fi)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_1load = {"load", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_1load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_load}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_1load(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fi = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load") < 0)) __PYX_ERR(0, 44, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fi = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 44, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_load(__pyx_self, __pyx_v_fi); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; SDL_RWops *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 1); /* "pygame_sdl2/mixer_music.pyx":48 * * # Free any previously loaded music. * if current_music != NULL: # <<<<<<<<<<<<<< * Mix_FreeMusic(current_music) * */ __pyx_t_1 = (__pyx_v_11pygame_sdl2_11mixer_music_current_music != NULL); if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":49 * # Free any previously loaded music. * if current_music != NULL: * Mix_FreeMusic(current_music) # <<<<<<<<<<<<<< * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) */ Mix_FreeMusic(__pyx_v_11pygame_sdl2_11mixer_music_current_music); /* "pygame_sdl2/mixer_music.pyx":48 * * # Free any previously loaded music. * if current_music != NULL: # <<<<<<<<<<<<<< * Mix_FreeMusic(current_music) * */ } /* "pygame_sdl2/mixer_music.pyx":51 * Mix_FreeMusic(current_music) * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) # <<<<<<<<<<<<<< * if current_music == NULL: * raise error() */ __pyx_t_2 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_2 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 51, __pyx_L1_error) __pyx_v_11pygame_sdl2_11mixer_music_current_music = Mix_LoadMUS_RW(__pyx_t_2, 1); /* "pygame_sdl2/mixer_music.pyx":52 * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) * if current_music == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_11pygame_sdl2_11mixer_music_current_music == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/mixer_music.pyx":53 * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) * if current_music == NULL: * raise error() # <<<<<<<<<<<<<< * * def play(loops=0, double start=0.0): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 53, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":52 * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) * if current_music == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer_music.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_3play(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_2play, "play(loops=0, double start=0.0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_3play = {"play", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_3play, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_2play}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_3play(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_loops = 0; double __pyx_v_start; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loops,&__pyx_n_s_start,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loops); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "play") < 0)) __PYX_ERR(0, 55, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loops = values[0]; if (values[1]) { __pyx_v_start = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_start == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) } else { __pyx_v_start = ((double)((double)0.0)); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 55, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_2play(__pyx_self, __pyx_v_loops, __pyx_v_start); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_2play(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loops, double __pyx_v_start) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("play", 1); /* "pygame_sdl2/mixer_music.pyx":56 * * def play(loops=0, double start=0.0): * Mix_FadeInMusicPos(current_music, loops, 0, start) # <<<<<<<<<<<<<< * * def rewind(): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error) (void)(Mix_FadeInMusicPos(__pyx_v_11pygame_sdl2_11mixer_music_current_music, __pyx_t_1, 0, __pyx_v_start)); /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":58 * Mix_FadeInMusicPos(current_music, loops, 0, start) * * def rewind(): # <<<<<<<<<<<<<< * Mix_RewindMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_5rewind(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_4rewind, "rewind()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_5rewind = {"rewind", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_5rewind, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_4rewind}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_5rewind(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rewind (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_4rewind(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_4rewind(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rewind", 1); /* "pygame_sdl2/mixer_music.pyx":59 * * def rewind(): * Mix_RewindMusic() # <<<<<<<<<<<<<< * * def stop(): */ Mix_RewindMusic(); /* "pygame_sdl2/mixer_music.pyx":58 * Mix_FadeInMusicPos(current_music, loops, 0, start) * * def rewind(): # <<<<<<<<<<<<<< * Mix_RewindMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_7stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_6stop, "stop()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_7stop = {"stop", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_7stop, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_6stop}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_7stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_6stop(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_6stop(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 1); /* "pygame_sdl2/mixer_music.pyx":62 * * def stop(): * Mix_HaltMusic() # <<<<<<<<<<<<<< * * def pause(): */ (void)(Mix_HaltMusic()); /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_9pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_8pause, "pause()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_9pause = {"pause", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_9pause, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_8pause}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_9pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_8pause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_8pause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause", 1); /* "pygame_sdl2/mixer_music.pyx":65 * * def pause(): * Mix_PauseMusic() # <<<<<<<<<<<<<< * * def unpause(): */ Mix_PauseMusic(); /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_11unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_10unpause, "unpause()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_11unpause = {"unpause", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_11unpause, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_10unpause}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_11unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_10unpause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_10unpause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause", 1); /* "pygame_sdl2/mixer_music.pyx":68 * * def unpause(): * Mix_ResumeMusic() # <<<<<<<<<<<<<< * * def fadeout(time): */ Mix_ResumeMusic(); /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_13fadeout(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_12fadeout, "fadeout(time)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_13fadeout = {"fadeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_13fadeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_12fadeout}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_13fadeout(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_time = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fadeout") < 0)) __PYX_ERR(0, 70, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_time = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fadeout", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 70, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_12fadeout(__pyx_self, __pyx_v_time); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_12fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 1); /* "pygame_sdl2/mixer_music.pyx":71 * * def fadeout(time): * Mix_FadeOutMusic(time) # <<<<<<<<<<<<<< * * def set_volume(double value): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) (void)(Mix_FadeOutMusic(__pyx_t_1)); /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_15set_volume(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_14set_volume, "set_volume(double value)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_15set_volume = {"set_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_15set_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_14set_volume}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_15set_volume(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { double __pyx_v_value; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_volume") < 0)) __PYX_ERR(0, 73, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_value = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_volume", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 73, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_14set_volume(__pyx_self, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_14set_volume(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume", 1); /* "pygame_sdl2/mixer_music.pyx":74 * * def set_volume(double value): * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) # <<<<<<<<<<<<<< * * def get_volume(): */ (void)(Mix_VolumeMusic(((int)(MIX_MAX_VOLUME * __pyx_v_value)))); /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_17get_volume(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_16get_volume, "get_volume()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_17get_volume = {"get_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_17get_volume, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_16get_volume}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_17get_volume(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_volume (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_16get_volume(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_16get_volume(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_volume", 1); /* "pygame_sdl2/mixer_music.pyx":77 * * def get_volume(): * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME # <<<<<<<<<<<<<< * * def get_busy(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = Mix_VolumeMusic(-1); if (unlikely(((double)MIX_MAX_VOLUME) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 77, __pyx_L1_error) } __pyx_t_2 = PyFloat_FromDouble((((double)__pyx_t_1) / ((double)MIX_MAX_VOLUME))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_19get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_18get_busy, "get_busy()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_19get_busy = {"get_busy", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_19get_busy, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_18get_busy}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_19get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_busy (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_18get_busy(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_18get_busy(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_busy", 1); /* "pygame_sdl2/mixer_music.pyx":80 * * def get_busy(): * return Mix_PlayingMusic() # <<<<<<<<<<<<<< * * def set_pos(double pos): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(Mix_PlayingMusic()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_busy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_21set_pos(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_20set_pos, "set_pos(double pos)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_21set_pos = {"set_pos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_21set_pos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_20set_pos}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_21set_pos(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { double __pyx_v_pos; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_pos (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_pos") < 0)) __PYX_ERR(0, 82, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pos = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_pos == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_pos", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 82, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_20set_pos(__pyx_self, __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_20set_pos(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_pos) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_pos", 1); /* "pygame_sdl2/mixer_music.pyx":83 * * def set_pos(double pos): * Mix_SetMusicPosition(pos) # <<<<<<<<<<<<<< * * def get_pos(): */ (void)(Mix_SetMusicPosition(__pyx_v_pos)); /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_23get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_22get_pos, "get_pos()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_23get_pos = {"get_pos", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_23get_pos, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_22get_pos}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_23get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pos (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_22get_pos(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_22get_pos(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pos", 1); /* "pygame_sdl2/mixer_music.pyx":87 * def get_pos(): * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def queue(fi): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Not_implemented}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 87, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_25queue(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_24queue, "queue(fi)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_25queue = {"queue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_25queue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_24queue}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_25queue(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fi = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("queue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "queue") < 0)) __PYX_ERR(0, 89, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fi = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("queue", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 89, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_24queue(__pyx_self, __pyx_v_fi); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_24queue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("queue", 1); /* "pygame_sdl2/mixer_music.pyx":90 * * def queue(fi): * Mix_HookMusicFinished(music_finished) # <<<<<<<<<<<<<< * if get_busy(): * global queued_music */ Mix_HookMusicFinished(__pyx_f_11pygame_sdl2_11mixer_music_music_finished); /* "pygame_sdl2/mixer_music.pyx":91 * def queue(fi): * Mix_HookMusicFinished(music_finished) * if get_busy(): # <<<<<<<<<<<<<< * global queued_music * queued_music = fi */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_busy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/mixer_music.pyx":93 * if get_busy(): * global queued_music * queued_music = fi # <<<<<<<<<<<<<< * else: * load(fi) */ __Pyx_INCREF(__pyx_v_fi); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11mixer_music_queued_music, __pyx_v_fi); __Pyx_GIVEREF(__pyx_v_fi); /* "pygame_sdl2/mixer_music.pyx":91 * def queue(fi): * Mix_HookMusicFinished(music_finished) * if get_busy(): # <<<<<<<<<<<<<< * global queued_music * queued_music = fi */ goto __pyx_L3; } /* "pygame_sdl2/mixer_music.pyx":95 * queued_music = fi * else: * load(fi) # <<<<<<<<<<<<<< * play() * */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_load); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_fi}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer_music.pyx":96 * else: * load(fi) * play() # <<<<<<<<<<<<<< * * def set_endevent(type=None): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_play); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer_music.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_27set_endevent(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_26set_endevent, "set_endevent(type=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_27set_endevent = {"set_endevent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_27set_endevent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_26set_endevent}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_27set_endevent(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_endevent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_endevent") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_endevent", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_26set_endevent(__pyx_self, __pyx_v_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_26set_endevent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_endevent", 1); /* "pygame_sdl2/mixer_music.pyx":99 * * def set_endevent(type=None): * Mix_HookMusicFinished(music_finished) # <<<<<<<<<<<<<< * global endevent * endevent = type or 0 */ Mix_HookMusicFinished(__pyx_f_11pygame_sdl2_11mixer_music_music_finished); /* "pygame_sdl2/mixer_music.pyx":101 * Mix_HookMusicFinished(music_finished) * global endevent * endevent = type or 0 # <<<<<<<<<<<<<< * * def get_endevent(): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_type); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 101, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_type); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } __pyx_t_1 = 0; __pyx_L3_bool_binop_done:; __pyx_v_11pygame_sdl2_11mixer_music_endevent = __pyx_t_1; /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_29get_endevent(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_28get_endevent, "get_endevent()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_29get_endevent = {"get_endevent", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_29get_endevent, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_28get_endevent}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_29get_endevent(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_endevent (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_28get_endevent(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_28get_endevent(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_endevent", 1); /* "pygame_sdl2/mixer_music.pyx":104 * * def get_endevent(): * return endevent # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_11pygame_sdl2_11mixer_music_endevent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {"rewind", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_5rewind, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_4rewind}, {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0}, {&__pyx_n_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_fadeout, __pyx_k_fadeout, sizeof(__pyx_k_fadeout), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_get_busy, __pyx_k_get_busy, sizeof(__pyx_k_get_busy), 0, 0, 1, 1}, {&__pyx_n_s_get_endevent, __pyx_k_get_endevent, sizeof(__pyx_k_get_endevent), 0, 0, 1, 1}, {&__pyx_n_s_get_pos, __pyx_k_get_pos, sizeof(__pyx_k_get_pos), 0, 0, 1, 1}, {&__pyx_n_s_get_volume, __pyx_k_get_volume, sizeof(__pyx_k_get_volume), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1}, {&__pyx_n_s_loops, __pyx_k_loops, sizeof(__pyx_k_loops), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pause, __pyx_k_pause, sizeof(__pyx_k_pause), 0, 0, 1, 1}, {&__pyx_n_s_play, __pyx_k_play, sizeof(__pyx_k_play), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mixer_music, __pyx_k_pygame_sdl2_mixer_music, sizeof(__pyx_k_pygame_sdl2_mixer_music), 0, 0, 1, 1}, {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, {&__pyx_n_s_rewind, __pyx_k_rewind, sizeof(__pyx_k_rewind), 0, 0, 1, 1}, {&__pyx_n_s_set_endevent, __pyx_k_set_endevent, sizeof(__pyx_k_set_endevent), 0, 0, 1, 1}, {&__pyx_n_s_set_pos, __pyx_k_set_pos, sizeof(__pyx_k_set_pos), 0, 0, 1, 1}, {&__pyx_n_s_set_volume, __pyx_k_set_volume, sizeof(__pyx_k_set_volume), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_k_src_pygame_sdl2_mixer_music_pyx, sizeof(__pyx_k_src_pygame_sdl2_mixer_music_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_unpause, __pyx_k_unpause, sizeof(__pyx_k_unpause), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { return 0; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_fi); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_load, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 44, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_loops, __pyx_n_s_start); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_play, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 55, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":58 * Mix_FadeInMusicPos(current_music, loops, 0, start) * * def rewind(): # <<<<<<<<<<<<<< * Mix_RewindMusic() * */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_rewind, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 58, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_stop, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 61, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_pause, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 64, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_unpause, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 67, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_time); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_fadeout, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 70, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_set_volume, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 73, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_volume, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 76, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_busy, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 79, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_set_pos, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 82, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_pos, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 85, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_queue, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 89, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_type); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_set_endevent, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_tuple__22 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_endevent, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_11mixer_music_queued_music = Py_None; Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_8(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_mixer_music(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_mixer_music}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "mixer_music", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initmixer_music(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initmixer_music(void) #else __Pyx_PyMODINIT_FUNC PyInit_mixer_music(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_mixer_music(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_mixer_music(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'mixer_music' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("mixer_music", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "mixer_music" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_mixer_music(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__mixer_music) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.mixer_music")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.mixer_music", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/mixer_music.pyx":24 * from libc.string cimport memset * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * cdef Mix_Music *current_music = NULL */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 24, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":26 * from pygame_sdl2.error import error * * cdef Mix_Music *current_music = NULL # <<<<<<<<<<<<<< * cdef object queued_music = None * cdef int endevent = 0 */ __pyx_v_11pygame_sdl2_11mixer_music_current_music = NULL; /* "pygame_sdl2/mixer_music.pyx":27 * * cdef Mix_Music *current_music = NULL * cdef object queued_music = None # <<<<<<<<<<<<<< * cdef int endevent = 0 * */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11mixer_music_queued_music, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer_music.pyx":28 * cdef Mix_Music *current_music = NULL * cdef object queued_music = None * cdef int endevent = 0 # <<<<<<<<<<<<<< * * cdef void music_finished() noexcept: */ __pyx_v_11pygame_sdl2_11mixer_music_endevent = 0; /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_1load, 0, __pyx_n_s_load, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_load, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ __pyx_t_3 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_int_0)); __Pyx_GIVEREF(((PyObject *)__pyx_int_0)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_int_0))) __PYX_ERR(0, 55, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_3play, 0, __pyx_n_s_play, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_play, __pyx_t_3) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":58 * Mix_FadeInMusicPos(current_music, loops, 0, start) * * def rewind(): # <<<<<<<<<<<<<< * Mix_RewindMusic() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_5rewind, 0, __pyx_n_s_rewind, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rewind, __pyx_t_3) < 0) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_7stop, 0, __pyx_n_s_stop, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop, __pyx_t_3) < 0) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_9pause, 0, __pyx_n_s_pause, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pause, __pyx_t_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_11unpause, 0, __pyx_n_s_unpause, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpause, __pyx_t_3) < 0) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_13fadeout, 0, __pyx_n_s_fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_fadeout, __pyx_t_3) < 0) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_15set_volume, 0, __pyx_n_s_set_volume, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_volume, __pyx_t_3) < 0) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_17get_volume, 0, __pyx_n_s_get_volume, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_volume, __pyx_t_3) < 0) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_19get_busy, 0, __pyx_n_s_get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_busy, __pyx_t_3) < 0) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_21set_pos, 0, __pyx_n_s_set_pos, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pos, __pyx_t_3) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_23get_pos, 0, __pyx_n_s_get_pos, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pos, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_25queue, 0, __pyx_n_s_queue, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue, __pyx_t_3) < 0) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_27set_endevent, 0, __pyx_n_s_set_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__22); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_endevent, __pyx_t_3) < 0) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_29get_endevent, 0, __pyx_n_s_get_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_endevent, __pyx_t_3) < 0) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.mixer_music", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.mixer_music"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); else state = (PyGILState_STATE)0; #endif CYTHON_UNUSED_VAR(clineno); CYTHON_UNUSED_VAR(lineno); CYTHON_UNUSED_VAR(filename); CYTHON_MAYBE_UNUSED_VAR(nogil); __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__24); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_8 #define __PYX_HAVE_RT_ImportFunction_3_0_8 static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709472.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.mouse.c0000664000175000017500000137754014760217140020161 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__mouse #define __PYX_HAVE_API__pygame_sdl2__mouse /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "", "src/pygame_sdl2/mouse.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/mouse.pyx":75 * active_cursor = False * * cdef class ColorCursor(object): # <<<<<<<<<<<<<< * * cdef SDL_Cursor *cursor */ struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor { PyObject_HEAD SDL_Cursor *cursor; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 #define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_8 { __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* VoidPtrImport.proto */ static int __Pyx_ImportVoidPtr_3_0_8(PyObject *module, const char *name, void **p, const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.display" */ static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from "pygame_sdl2.mouse" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.mouse" extern int __pyx_module_is_main_pygame_sdl2__mouse; int __pyx_module_is_main_pygame_sdl2__mouse = 0; /* Implementation of "pygame_sdl2.mouse" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k__22[] = "?"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_reset[] = "reset"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_get_pos[] = "get_pos"; static const char __pyx_k_get_rel[] = "get_rel"; static const char __pyx_k_hotspot[] = "hotspot"; static const char __pyx_k_set_pos[] = "set_pos"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_visible[] = "visible"; static const char __pyx_k_activate[] = "activate"; static const char __pyx_k_andmasks[] = "andmasks"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_xormasks[] = "xormasks"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_get_cursor[] = "get_cursor"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_set_cursor[] = "set_cursor"; static const char __pyx_k_ColorCursor[] = "ColorCursor"; static const char __pyx_k_get_focused[] = "get_focused"; static const char __pyx_k_get_pressed[] = "get_pressed"; static const char __pyx_k_set_visible[] = "set_visible"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_active_cursor[] = "active_cursor"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_pygame_sdl2_mouse[] = "pygame_sdl2.mouse"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_ColorCursor_activate[] = "ColorCursor.activate"; static const char __pyx_k_src_pygame_sdl2_mouse_pyx[] = "src/pygame_sdl2/mouse.pyx"; static const char __pyx_k_ColorCursor___reduce_cython[] = "ColorCursor.__reduce_cython__"; static const char __pyx_k_ColorCursor___setstate_cython[] = "ColorCursor.__setstate_cython__"; static const char __pyx_k_self_cursor_cannot_be_converted[] = "self.cursor cannot be converted to a Python object for pickling"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_4reset(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_6get_pressed(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_8get_pos(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_10get_rel(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_12set_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_14set_visible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_visible); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_16get_focused(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_18set_cursor(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_hotspot, CYTHON_UNUSED PyObject *__pyx_v_xormasks, CYTHON_UNUSED PyObject *__pyx_v_andmasks); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_20get_cursor(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor___init__(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static void __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_2__dealloc__(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_4activate(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_5mouse_ColorCursor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window; #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_5mouse_ColorCursor; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor; PyObject *__pyx_n_s_ColorCursor; PyObject *__pyx_n_s_ColorCursor___reduce_cython; PyObject *__pyx_n_s_ColorCursor___setstate_cython; PyObject *__pyx_n_s_ColorCursor_activate; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s__22; PyObject *__pyx_n_s_activate; PyObject *__pyx_n_s_active_cursor; PyObject *__pyx_n_s_andmasks; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_cursor; PyObject *__pyx_n_s_get_focused; PyObject *__pyx_n_s_get_pos; PyObject *__pyx_n_s_get_pressed; PyObject *__pyx_n_s_get_rel; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_hotspot; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_pygame_sdl2_mouse; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_reset; PyObject *__pyx_n_s_self; PyObject *__pyx_kp_s_self_cursor_cannot_be_converted; PyObject *__pyx_n_s_set_cursor; PyObject *__pyx_n_s_set_pos; PyObject *__pyx_n_s_set_visible; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_size; PyObject *__pyx_kp_s_src_pygame_sdl2_mouse_pyx; PyObject *__pyx_n_s_state; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_visible; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_xormasks; PyObject *__pyx_n_s_y; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_codeobj_; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__20; PyObject *__pyx_codeobj__2; PyObject *__pyx_codeobj__3; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_5mouse_ColorCursor); Py_CLEAR(clear_module_state->__pyx_n_s_ColorCursor); Py_CLEAR(clear_module_state->__pyx_n_s_ColorCursor___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_ColorCursor___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_ColorCursor_activate); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s__22); Py_CLEAR(clear_module_state->__pyx_n_s_activate); Py_CLEAR(clear_module_state->__pyx_n_s_active_cursor); Py_CLEAR(clear_module_state->__pyx_n_s_andmasks); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_cursor); Py_CLEAR(clear_module_state->__pyx_n_s_get_focused); Py_CLEAR(clear_module_state->__pyx_n_s_get_pos); Py_CLEAR(clear_module_state->__pyx_n_s_get_pressed); Py_CLEAR(clear_module_state->__pyx_n_s_get_rel); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_hotspot); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_mouse); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_reset); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_kp_s_self_cursor_cannot_be_converted); Py_CLEAR(clear_module_state->__pyx_n_s_set_cursor); Py_CLEAR(clear_module_state->__pyx_n_s_set_pos); Py_CLEAR(clear_module_state->__pyx_n_s_set_visible); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_mouse_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_visible); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_xormasks); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_codeobj_); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_codeobj__2); Py_CLEAR(clear_module_state->__pyx_codeobj__3); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_5mouse_ColorCursor); Py_VISIT(traverse_module_state->__pyx_n_s_ColorCursor); Py_VISIT(traverse_module_state->__pyx_n_s_ColorCursor___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_ColorCursor___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_ColorCursor_activate); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s__22); Py_VISIT(traverse_module_state->__pyx_n_s_activate); Py_VISIT(traverse_module_state->__pyx_n_s_active_cursor); Py_VISIT(traverse_module_state->__pyx_n_s_andmasks); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_cursor); Py_VISIT(traverse_module_state->__pyx_n_s_get_focused); Py_VISIT(traverse_module_state->__pyx_n_s_get_pos); Py_VISIT(traverse_module_state->__pyx_n_s_get_pressed); Py_VISIT(traverse_module_state->__pyx_n_s_get_rel); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_hotspot); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_mouse); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_reset); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_kp_s_self_cursor_cannot_be_converted); Py_VISIT(traverse_module_state->__pyx_n_s_set_cursor); Py_VISIT(traverse_module_state->__pyx_n_s_set_pos); Py_VISIT(traverse_module_state->__pyx_n_s_set_visible); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_mouse_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_visible); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_xormasks); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_codeobj_); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_codeobj__2); Py_VISIT(traverse_module_state->__pyx_codeobj__3); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7display_Window __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7display_Window #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_5mouse_ColorCursor __pyx_mstate_global->__pyx_type_11pygame_sdl2_5mouse_ColorCursor #endif #define __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor #define __pyx_n_s_ColorCursor __pyx_mstate_global->__pyx_n_s_ColorCursor #define __pyx_n_s_ColorCursor___reduce_cython __pyx_mstate_global->__pyx_n_s_ColorCursor___reduce_cython #define __pyx_n_s_ColorCursor___setstate_cython __pyx_mstate_global->__pyx_n_s_ColorCursor___setstate_cython #define __pyx_n_s_ColorCursor_activate __pyx_mstate_global->__pyx_n_s_ColorCursor_activate #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s__22 __pyx_mstate_global->__pyx_n_s__22 #define __pyx_n_s_activate __pyx_mstate_global->__pyx_n_s_activate #define __pyx_n_s_active_cursor __pyx_mstate_global->__pyx_n_s_active_cursor #define __pyx_n_s_andmasks __pyx_mstate_global->__pyx_n_s_andmasks #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_cursor __pyx_mstate_global->__pyx_n_s_get_cursor #define __pyx_n_s_get_focused __pyx_mstate_global->__pyx_n_s_get_focused #define __pyx_n_s_get_pos __pyx_mstate_global->__pyx_n_s_get_pos #define __pyx_n_s_get_pressed __pyx_mstate_global->__pyx_n_s_get_pressed #define __pyx_n_s_get_rel __pyx_mstate_global->__pyx_n_s_get_rel #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_hotspot __pyx_mstate_global->__pyx_n_s_hotspot #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_pygame_sdl2_mouse __pyx_mstate_global->__pyx_n_s_pygame_sdl2_mouse #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_reset __pyx_mstate_global->__pyx_n_s_reset #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_kp_s_self_cursor_cannot_be_converted __pyx_mstate_global->__pyx_kp_s_self_cursor_cannot_be_converted #define __pyx_n_s_set_cursor __pyx_mstate_global->__pyx_n_s_set_cursor #define __pyx_n_s_set_pos __pyx_mstate_global->__pyx_n_s_set_pos #define __pyx_n_s_set_visible __pyx_mstate_global->__pyx_n_s_set_visible #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_kp_s_src_pygame_sdl2_mouse_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_mouse_pyx #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_visible __pyx_mstate_global->__pyx_n_s_visible #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_xormasks __pyx_mstate_global->__pyx_n_s_xormasks #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_ #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 /* #### Code section: module_code ### */ /* "pygame_sdl2/mouse.pyx":23 * from pygame_sdl2.surface cimport Surface * * def init(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_init}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/mouse.pyx":25 * def init(): * global active_cursor * active_cursor = None # <<<<<<<<<<<<<< * * def quit(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_active_cursor, Py_None) < 0) __PYX_ERR(1, 25, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":23 * from pygame_sdl2.surface cimport Surface * * def init(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":27 * active_cursor = None * * def quit(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_2quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_3quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_2quit}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/mouse.pyx":29 * def quit(): * global active_cursor * active_cursor = None # <<<<<<<<<<<<<< * * def reset(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_active_cursor, Py_None) < 0) __PYX_ERR(1, 29, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":27 * active_cursor = None * * def quit(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.quit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":31 * active_cursor = None * * def reset(): # <<<<<<<<<<<<<< * SDL_SetCursor(SDL_GetDefaultCursor()) * global active_cursor */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_5reset(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_4reset, "reset()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_5reset = {"reset", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_5reset, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_4reset}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_5reset(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_4reset(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_4reset(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 1); /* "pygame_sdl2/mouse.pyx":32 * * def reset(): * SDL_SetCursor(SDL_GetDefaultCursor()) # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ SDL_SetCursor(SDL_GetDefaultCursor()); /* "pygame_sdl2/mouse.pyx":34 * SDL_SetCursor(SDL_GetDefaultCursor()) * global active_cursor * active_cursor = None # <<<<<<<<<<<<<< * * def get_pressed(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_active_cursor, Py_None) < 0) __PYX_ERR(1, 34, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":31 * active_cursor = None * * def reset(): # <<<<<<<<<<<<<< * SDL_SetCursor(SDL_GetDefaultCursor()) * global active_cursor */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":36 * active_cursor = None * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_7get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_6get_pressed, "get_pressed()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_7get_pressed = {"get_pressed", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_7get_pressed, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_6get_pressed}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_7get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pressed (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_6get_pressed(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_6get_pressed(CYTHON_UNUSED PyObject *__pyx_self) { Uint32 __pyx_v_state; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pressed", 1); /* "pygame_sdl2/mouse.pyx":37 * * def get_pressed(): * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) # <<<<<<<<<<<<<< * return (1 if state & SDL_BUTTON_LMASK else 0, * 1 if state & SDL_BUTTON_MMASK else 0, */ __pyx_v_state = SDL_GetMouseState(NULL, NULL); /* "pygame_sdl2/mouse.pyx":38 * def get_pressed(): * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if state & SDL_BUTTON_MMASK else 0, * 1 if state & SDL_BUTTON_RMASK else 0) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((__pyx_v_state & SDL_BUTTON_LMASK) != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_int_1); __pyx_t_1 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; } /* "pygame_sdl2/mouse.pyx":39 * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, * 1 if state & SDL_BUTTON_MMASK else 0, # <<<<<<<<<<<<<< * 1 if state & SDL_BUTTON_RMASK else 0) * */ __pyx_t_2 = ((__pyx_v_state & SDL_BUTTON_MMASK) != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_int_1); __pyx_t_3 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_3 = __pyx_int_0; } /* "pygame_sdl2/mouse.pyx":40 * return (1 if state & SDL_BUTTON_LMASK else 0, * 1 if state & SDL_BUTTON_MMASK else 0, * 1 if state & SDL_BUTTON_RMASK else 0) # <<<<<<<<<<<<<< * * def get_pos(): */ __pyx_t_2 = ((__pyx_v_state & SDL_BUTTON_RMASK) != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_int_1); __pyx_t_4 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_4 = __pyx_int_0; } /* "pygame_sdl2/mouse.pyx":38 * def get_pressed(): * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if state & SDL_BUTTON_MMASK else 0, * 1 if state & SDL_BUTTON_RMASK else 0) */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(1, 38, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(1, 38, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":36 * active_cursor = None * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mouse.get_pressed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":42 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_9get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_8get_pos, "get_pos()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_9get_pos = {"get_pos", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_9get_pos, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_8get_pos}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_9get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pos (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_8get_pos(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_8get_pos(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_x; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pos", 1); /* "pygame_sdl2/mouse.pyx":44 * def get_pos(): * cdef int x, y * SDL_GetMouseState(&x, &y) # <<<<<<<<<<<<<< * return (x, y) * */ (void)(SDL_GetMouseState((&__pyx_v_x), (&__pyx_v_y))); /* "pygame_sdl2/mouse.pyx":45 * cdef int x, y * SDL_GetMouseState(&x, &y) * return (x, y) # <<<<<<<<<<<<<< * * def get_rel(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":42 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mouse.get_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":47 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetRelativeMouseState(&x, &y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11get_rel(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_10get_rel, "get_rel()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_11get_rel = {"get_rel", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_11get_rel, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_10get_rel}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11get_rel(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_rel (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_10get_rel(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_10get_rel(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_x; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_rel", 1); /* "pygame_sdl2/mouse.pyx":49 * def get_rel(): * cdef int x, y * SDL_GetRelativeMouseState(&x, &y) # <<<<<<<<<<<<<< * return (x, y) * */ (void)(SDL_GetRelativeMouseState((&__pyx_v_x), (&__pyx_v_y))); /* "pygame_sdl2/mouse.pyx":50 * cdef int x, y * SDL_GetRelativeMouseState(&x, &y) * return (x, y) # <<<<<<<<<<<<<< * * def set_pos(pos): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 50, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":47 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetRelativeMouseState(&x, &y) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mouse.get_rel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":52 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_13set_pos(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_12set_pos, "set_pos(pos)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_13set_pos = {"set_pos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_13set_pos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_12set_pos}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_13set_pos(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pos = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_pos (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 52, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_pos") < 0)) __PYX_ERR(1, 52, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pos = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_pos", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 52, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mouse.set_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_12set_pos(__pyx_self, __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_12set_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_pos", 1); /* "pygame_sdl2/mouse.pyx":53 * * def set_pos(pos): * (x, y) = pos # <<<<<<<<<<<<<< * SDL_WarpMouseInWindow(NULL, x, y) * */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(1, 53, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(1, 53, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(1, 53, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":54 * def set_pos(pos): * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) # <<<<<<<<<<<<<< * * def set_visible(visible): */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 54, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 54, __pyx_L1_error) SDL_WarpMouseInWindow(NULL, __pyx_t_5, __pyx_t_6); /* "pygame_sdl2/mouse.pyx":52 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mouse.set_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":56 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_15set_visible(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_14set_visible, "set_visible(visible)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_15set_visible = {"set_visible", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_15set_visible, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_14set_visible}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_15set_visible(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_visible = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_visible (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_visible,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_visible)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_visible") < 0)) __PYX_ERR(1, 56, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_visible = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_visible", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 56, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mouse.set_visible", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_14set_visible(__pyx_self, __pyx_v_visible); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_14set_visible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_visible) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; SDL_bool __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_visible", 1); /* "pygame_sdl2/mouse.pyx":57 * * def set_visible(visible): * SDL_ShowCursor(1 if visible else 0) # <<<<<<<<<<<<<< * * if SDL_GetWindowGrab(main_window.window) == SDL_ENABLE: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_visible); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 57, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_1 = 1; } else { __pyx_t_1 = 0; } (void)(SDL_ShowCursor(__pyx_t_1)); /* "pygame_sdl2/mouse.pyx":59 * SDL_ShowCursor(1 if visible else 0) * * if SDL_GetWindowGrab(main_window.window) == SDL_ENABLE: # <<<<<<<<<<<<<< * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) * */ __pyx_t_2 = (SDL_GetWindowGrab(__pyx_v_11pygame_sdl2_7display_main_window->window) == SDL_ENABLE); if (__pyx_t_2) { /* "pygame_sdl2/mouse.pyx":60 * * if SDL_GetWindowGrab(main_window.window) == SDL_ENABLE: * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) # <<<<<<<<<<<<<< * * def get_focused(): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_visible); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 60, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_3 = SDL_FALSE; } else { __pyx_t_3 = SDL_TRUE; } (void)(SDL_SetRelativeMouseMode(__pyx_t_3)); /* "pygame_sdl2/mouse.pyx":59 * SDL_ShowCursor(1 if visible else 0) * * if SDL_GetWindowGrab(main_window.window) == SDL_ENABLE: # <<<<<<<<<<<<<< * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) * */ } /* "pygame_sdl2/mouse.pyx":56 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.set_visible", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":62 * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_17get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_16get_focused, "get_focused()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_17get_focused = {"get_focused", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_17get_focused, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_16get_focused}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_17get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_focused (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_16get_focused(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_16get_focused(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_focused", 1); /* "pygame_sdl2/mouse.pyx":63 * * def get_focused(): * return SDL_GetMouseFocus() != NULL # <<<<<<<<<<<<<< * * def set_cursor(size, hotspot, xormasks, andmasks): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_GetMouseFocus() != NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":62 * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mouse.get_focused", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":65 * return SDL_GetMouseFocus() != NULL * * def set_cursor(size, hotspot, xormasks, andmasks): # <<<<<<<<<<<<<< * # Does anyone use this? SDL2 has much improved custom cursor support. * pass */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_19set_cursor(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_18set_cursor, "set_cursor(size, hotspot, xormasks, andmasks)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_19set_cursor = {"set_cursor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_19set_cursor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_18set_cursor}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_19set_cursor(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_size = 0; CYTHON_UNUSED PyObject *__pyx_v_hotspot = 0; CYTHON_UNUSED PyObject *__pyx_v_xormasks = 0; CYTHON_UNUSED PyObject *__pyx_v_andmasks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_cursor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_hotspot,&__pyx_n_s_xormasks,&__pyx_n_s_andmasks,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hotspot)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 1); __PYX_ERR(1, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xormasks)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 2); __PYX_ERR(1, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_andmasks)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 3); __PYX_ERR(1, 65, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_cursor") < 0)) __PYX_ERR(1, 65, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_size = values[0]; __pyx_v_hotspot = values[1]; __pyx_v_xormasks = values[2]; __pyx_v_andmasks = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 65, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mouse.set_cursor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_18set_cursor(__pyx_self, __pyx_v_size, __pyx_v_hotspot, __pyx_v_xormasks, __pyx_v_andmasks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_18set_cursor(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_hotspot, CYTHON_UNUSED PyObject *__pyx_v_xormasks, CYTHON_UNUSED PyObject *__pyx_v_andmasks) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_cursor", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":69 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_21get_cursor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_20get_cursor, "get_cursor()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_21get_cursor = {"get_cursor", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_21get_cursor, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_20get_cursor}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_21get_cursor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_cursor (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_20get_cursor(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_20get_cursor(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_cursor", 1); /* "pygame_sdl2/mouse.pyx":70 * * def get_cursor(): * return None # <<<<<<<<<<<<<< * * # The ColorCursor that is currently in use. */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":69 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":79 * cdef SDL_Cursor *cursor * * def __init__(self, Surface surface, x, y): # <<<<<<<<<<<<<< * self.cursor = SDL_CreateColorCursor(surface.surface, x, y) * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(1, 79, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(1, 79, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 79, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 79, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mouse.ColorCursor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(1, 79, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor___init__(((struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *)__pyx_v_self), __pyx_v_surface, __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor___init__(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/mouse.pyx":80 * * def __init__(self, Surface surface, x, y): * self.cursor = SDL_CreateColorCursor(surface.surface, x, y) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 80, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 80, __pyx_L1_error) __pyx_v_self->cursor = SDL_CreateColorCursor(__pyx_v_surface->surface, __pyx_t_1, __pyx_t_2); /* "pygame_sdl2/mouse.pyx":79 * cdef SDL_Cursor *cursor * * def __init__(self, Surface surface, x, y): # <<<<<<<<<<<<<< * self.cursor = SDL_CreateColorCursor(surface.surface, x, y) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.ColorCursor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/mouse.pyx":82 * self.cursor = SDL_CreateColorCursor(surface.surface, x, y) * * def __dealloc__(self): # <<<<<<<<<<<<<< * SDL_FreeCursor(self.cursor) * */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_2__dealloc__(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self) { /* "pygame_sdl2/mouse.pyx":83 * * def __dealloc__(self): * SDL_FreeCursor(self.cursor) # <<<<<<<<<<<<<< * * def activate(self): */ SDL_FreeCursor(__pyx_v_self->cursor); /* "pygame_sdl2/mouse.pyx":82 * self.cursor = SDL_CreateColorCursor(surface.surface, x, y) * * def __dealloc__(self): # <<<<<<<<<<<<<< * SDL_FreeCursor(self.cursor) * */ /* function exit code */ } /* "pygame_sdl2/mouse.pyx":85 * SDL_FreeCursor(self.cursor) * * def activate(self): # <<<<<<<<<<<<<< * global active_cursor * if active_cursor is not self: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_5activate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_4activate, "ColorCursor.activate(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_11ColorCursor_5activate = {"activate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_5activate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_4activate}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_5activate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("activate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("activate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "activate", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_4activate(((struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_4activate(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("activate", 1); /* "pygame_sdl2/mouse.pyx":87 * def activate(self): * global active_cursor * if active_cursor is not self: # <<<<<<<<<<<<<< * active_cursor = self * SDL_SetCursor(self.cursor) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_active_cursor); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 != ((PyObject *)__pyx_v_self)); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/mouse.pyx":88 * global active_cursor * if active_cursor is not self: * active_cursor = self # <<<<<<<<<<<<<< * SDL_SetCursor(self.cursor) * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_active_cursor, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(1, 88, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":89 * if active_cursor is not self: * active_cursor = self * SDL_SetCursor(self.cursor) # <<<<<<<<<<<<<< * */ SDL_SetCursor(__pyx_v_self->cursor); /* "pygame_sdl2/mouse.pyx":87 * def activate(self): * global active_cursor * if active_cursor is not self: # <<<<<<<<<<<<<< * active_cursor = self * SDL_SetCursor(self.cursor) */ } /* "pygame_sdl2/mouse.pyx":85 * SDL_FreeCursor(self.cursor) * * def activate(self): # <<<<<<<<<<<<<< * global active_cursor * if active_cursor is not self: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mouse.ColorCursor.activate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_6__reduce_cython__, "ColorCursor.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_11ColorCursor_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_6__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_6__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_cursor_cannot_be_converted, 0, 0); __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.ColorCursor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_8__setstate_cython__, "ColorCursor.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_11ColorCursor_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_8__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mouse.ColorCursor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_8__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_cursor_cannot_be_converted, 0, 0); __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.ColorCursor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_5mouse_ColorCursor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5mouse_ColorCursor(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_5mouse_ColorCursor) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_11pygame_sdl2_5mouse_ColorCursor[] = { {"activate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_5activate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_4activate}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_8__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_5mouse_ColorCursor_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_5mouse_ColorCursor}, {Py_tp_doc, (void *)PyDoc_STR("ColorCursor(Surface surface, x, y)")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_5mouse_ColorCursor}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_5mouse_ColorCursor}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_5mouse_ColorCursor_spec = { "pygame_sdl2.mouse.ColorCursor", sizeof(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_5mouse_ColorCursor_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_5mouse_ColorCursor = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.mouse.""ColorCursor", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5mouse_ColorCursor, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("ColorCursor(Surface surface, x, y)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5mouse_ColorCursor, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5mouse_ColorCursor, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ColorCursor, __pyx_k_ColorCursor, sizeof(__pyx_k_ColorCursor), 0, 0, 1, 1}, {&__pyx_n_s_ColorCursor___reduce_cython, __pyx_k_ColorCursor___reduce_cython, sizeof(__pyx_k_ColorCursor___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_ColorCursor___setstate_cython, __pyx_k_ColorCursor___setstate_cython, sizeof(__pyx_k_ColorCursor___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_ColorCursor_activate, __pyx_k_ColorCursor_activate, sizeof(__pyx_k_ColorCursor_activate), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 1, 1}, {&__pyx_n_s_activate, __pyx_k_activate, sizeof(__pyx_k_activate), 0, 0, 1, 1}, {&__pyx_n_s_active_cursor, __pyx_k_active_cursor, sizeof(__pyx_k_active_cursor), 0, 0, 1, 1}, {&__pyx_n_s_andmasks, __pyx_k_andmasks, sizeof(__pyx_k_andmasks), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_cursor, __pyx_k_get_cursor, sizeof(__pyx_k_get_cursor), 0, 0, 1, 1}, {&__pyx_n_s_get_focused, __pyx_k_get_focused, sizeof(__pyx_k_get_focused), 0, 0, 1, 1}, {&__pyx_n_s_get_pos, __pyx_k_get_pos, sizeof(__pyx_k_get_pos), 0, 0, 1, 1}, {&__pyx_n_s_get_pressed, __pyx_k_get_pressed, sizeof(__pyx_k_get_pressed), 0, 0, 1, 1}, {&__pyx_n_s_get_rel, __pyx_k_get_rel, sizeof(__pyx_k_get_rel), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_hotspot, __pyx_k_hotspot, sizeof(__pyx_k_hotspot), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mouse, __pyx_k_pygame_sdl2_mouse, sizeof(__pyx_k_pygame_sdl2_mouse), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_kp_s_self_cursor_cannot_be_converted, __pyx_k_self_cursor_cannot_be_converted, sizeof(__pyx_k_self_cursor_cannot_be_converted), 0, 0, 1, 0}, {&__pyx_n_s_set_cursor, __pyx_k_set_cursor, sizeof(__pyx_k_set_cursor), 0, 0, 1, 1}, {&__pyx_n_s_set_pos, __pyx_k_set_pos, sizeof(__pyx_k_set_pos), 0, 0, 1, 1}, {&__pyx_n_s_set_visible, __pyx_k_set_visible, sizeof(__pyx_k_set_visible), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_k_src_pygame_sdl2_mouse_pyx, sizeof(__pyx_k_src_pygame_sdl2_mouse_pyx), 0, 0, 1, 0}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_visible, __pyx_k_visible, sizeof(__pyx_k_visible), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_xormasks, __pyx_k_xormasks, sizeof(__pyx_k_xormasks), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/mouse.pyx":23 * from pygame_sdl2.surface cimport Surface * * def init(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_init, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(1, 23, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":27 * active_cursor = None * * def quit(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_quit, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 27, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":31 * active_cursor = None * * def reset(): # <<<<<<<<<<<<<< * SDL_SetCursor(SDL_GetDefaultCursor()) * global active_cursor */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_reset, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 31, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":36 * active_cursor = None * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_pressed, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 36, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":42 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_pos, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(1, 42, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":47 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetRelativeMouseState(&x, &y) */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_rel, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 47, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":52 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_pos, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_set_pos, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 52, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":56 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_visible); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_set_visible, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 56, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":62 * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_focused, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(1, 62, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":65 * return SDL_GetMouseFocus() != NULL * * def set_cursor(size, hotspot, xormasks, andmasks): # <<<<<<<<<<<<<< * # Does anyone use this? SDL2 has much improved custom cursor support. * pass */ __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_size, __pyx_n_s_hotspot, __pyx_n_s_xormasks, __pyx_n_s_andmasks); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_set_cursor, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 65, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":69 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None * */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_cursor, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 69, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":85 * SDL_FreeCursor(self.cursor) * * def activate(self): # <<<<<<<<<<<<<< * global active_cursor * if active_cursor is not self: */ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_activate, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 85, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" */ __pyx_tuple__20 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_5mouse_ColorCursor_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor)) __PYX_ERR(1, 75, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_5mouse_ColorCursor_spec, __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor) < 0) __PYX_ERR(1, 75, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor = &__pyx_type_11pygame_sdl2_5mouse_ColorCursor; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor) < 0) __PYX_ERR(1, 75, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor->tp_dictoffset && __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ColorCursor, (PyObject *) __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor) < 0) __PYX_ERR(1, 75, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor) < 0) __PYX_ERR(1, 75, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7display_Window),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7display_Window) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportVoidPtr_3_0_8(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_mouse(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_mouse}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "mouse", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initmouse(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initmouse(void) #else __Pyx_PyMODINIT_FUNC PyInit_mouse(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_mouse(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_mouse(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'mouse' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("mouse", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "mouse" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_mouse(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__mouse) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.mouse")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.mouse", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_variable_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "pygame_sdl2/mouse.pyx":23 * from pygame_sdl2.surface cimport Surface * * def init(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":27 * active_cursor = None * * def quit(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_3quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":31 * active_cursor = None * * def reset(): # <<<<<<<<<<<<<< * SDL_SetCursor(SDL_GetDefaultCursor()) * global active_cursor */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_5reset, 0, __pyx_n_s_reset, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reset, __pyx_t_2) < 0) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":36 * active_cursor = None * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_7get_pressed, 0, __pyx_n_s_get_pressed, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pressed, __pyx_t_2) < 0) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":42 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_9get_pos, 0, __pyx_n_s_get_pos, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pos, __pyx_t_2) < 0) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":47 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetRelativeMouseState(&x, &y) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_11get_rel, 0, __pyx_n_s_get_rel, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_rel, __pyx_t_2) < 0) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":52 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_13set_pos, 0, __pyx_n_s_set_pos, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pos, __pyx_t_2) < 0) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":56 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_15set_visible, 0, __pyx_n_s_set_visible, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_visible, __pyx_t_2) < 0) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":62 * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_17get_focused, 0, __pyx_n_s_get_focused, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_focused, __pyx_t_2) < 0) __PYX_ERR(1, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":65 * return SDL_GetMouseFocus() != NULL * * def set_cursor(size, hotspot, xormasks, andmasks): # <<<<<<<<<<<<<< * # Does anyone use this? SDL2 has much improved custom cursor support. * pass */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_19set_cursor, 0, __pyx_n_s_set_cursor, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_cursor, __pyx_t_2) < 0) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":69 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_21get_cursor, 0, __pyx_n_s_get_cursor, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_cursor, __pyx_t_2) < 0) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":73 * * # The ColorCursor that is currently in use. * active_cursor = False # <<<<<<<<<<<<<< * * cdef class ColorCursor(object): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_active_cursor, Py_False) < 0) __PYX_ERR(1, 73, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":85 * SDL_FreeCursor(self.cursor) * * def activate(self): # <<<<<<<<<<<<<< * global active_cursor * if active_cursor is not self: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_11ColorCursor_5activate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ColorCursor_activate, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor, __pyx_n_s_activate, __pyx_t_2) < 0) __PYX_ERR(1, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_11ColorCursor_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ColorCursor___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_11ColorCursor_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ColorCursor___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.mouse", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.mouse"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_8 #define __PYX_HAVE_RT_ImportType_3_0_8 static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__22); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* VoidPtrImport */ #ifndef __PYX_HAVE_RT_ImportVoidPtr_3_0_8 #define __PYX_HAVE_RT_ImportVoidPtr_3_0_8 static int __Pyx_ImportVoidPtr_3_0_8(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709473.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.power.c0000664000175000017500000111556514760217141020163 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__power #define __PYX_HAVE_API__pygame_sdl2__power /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/power.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.power" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.power" extern int __pyx_module_is_main_pygame_sdl2__power; int __pyx_module_is_main_pygame_sdl2__power = 0; /* Implementation of "pygame_sdl2.power" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_object; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; static const char __pyx_k__8[] = "?"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_INVALID[] = "INVALID"; static const char __pyx_k_percent[] = "percent"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_seconds[] = "seconds"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_PowerInfo[] = "PowerInfo"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_get_power_info[] = "get_power_info"; static const char __pyx_k_PowerInfo___repr[] = "PowerInfo.__repr__"; static const char __pyx_k_pygame_sdl2_power[] = "pygame_sdl2.power"; static const char __pyx_k_POWERSTATE_CHARGED[] = "POWERSTATE_CHARGED"; static const char __pyx_k_POWERSTATE_UNKNOWN[] = "POWERSTATE_UNKNOWN"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_powerstate_to_name[] = "powerstate_to_name"; static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static const char __pyx_k_POWERSTATE_CHARGING[] = "POWERSTATE_CHARGING"; static const char __pyx_k_POWERSTATE_NO_BATTERY[] = "POWERSTATE_NO_BATTERY"; static const char __pyx_k_POWERSTATE_ON_BATTERY[] = "POWERSTATE_ON_BATTERY"; static const char __pyx_k_src_pygame_sdl2_power_pyx[] = "src/pygame_sdl2/power.pyx"; static const char __pyx_k_PowerInfo_state_seconds_percent[] = ""; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5power_9PowerInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5power_get_power_info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_u_; PyObject *__pyx_n_s_INVALID; PyObject *__pyx_n_s_POWERSTATE_CHARGED; PyObject *__pyx_n_s_POWERSTATE_CHARGING; PyObject *__pyx_n_s_POWERSTATE_NO_BATTERY; PyObject *__pyx_n_s_POWERSTATE_ON_BATTERY; PyObject *__pyx_n_s_POWERSTATE_UNKNOWN; PyObject *__pyx_n_s_PowerInfo; PyObject *__pyx_n_s_PowerInfo___repr; PyObject *__pyx_kp_s_PowerInfo_state_seconds_percent; PyObject *__pyx_n_s__8; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_power_info; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_object; PyObject *__pyx_n_s_percent; PyObject *__pyx_n_s_powerstate_to_name; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_pygame_sdl2_locals; PyObject *__pyx_n_s_pygame_sdl2_power; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_repr; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_seconds; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_name; PyObject *__pyx_kp_s_src_pygame_sdl2_power_pyx; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_test; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_n_s_INVALID); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_CHARGED); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_CHARGING); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_NO_BATTERY); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_ON_BATTERY); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_UNKNOWN); Py_CLEAR(clear_module_state->__pyx_n_s_PowerInfo); Py_CLEAR(clear_module_state->__pyx_n_s_PowerInfo___repr); Py_CLEAR(clear_module_state->__pyx_kp_s_PowerInfo_state_seconds_percent); Py_CLEAR(clear_module_state->__pyx_n_s__8); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_power_info); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_object); Py_CLEAR(clear_module_state->__pyx_n_s_percent); Py_CLEAR(clear_module_state->__pyx_n_s_powerstate_to_name); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_locals); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_power); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_repr); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_seconds); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_power_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_n_s_INVALID); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_CHARGED); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_CHARGING); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_NO_BATTERY); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_ON_BATTERY); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_UNKNOWN); Py_VISIT(traverse_module_state->__pyx_n_s_PowerInfo); Py_VISIT(traverse_module_state->__pyx_n_s_PowerInfo___repr); Py_VISIT(traverse_module_state->__pyx_kp_s_PowerInfo_state_seconds_percent); Py_VISIT(traverse_module_state->__pyx_n_s__8); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_power_info); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_object); Py_VISIT(traverse_module_state->__pyx_n_s_percent); Py_VISIT(traverse_module_state->__pyx_n_s_powerstate_to_name); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_locals); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_power); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_repr); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_seconds); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_power_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_n_s_INVALID __pyx_mstate_global->__pyx_n_s_INVALID #define __pyx_n_s_POWERSTATE_CHARGED __pyx_mstate_global->__pyx_n_s_POWERSTATE_CHARGED #define __pyx_n_s_POWERSTATE_CHARGING __pyx_mstate_global->__pyx_n_s_POWERSTATE_CHARGING #define __pyx_n_s_POWERSTATE_NO_BATTERY __pyx_mstate_global->__pyx_n_s_POWERSTATE_NO_BATTERY #define __pyx_n_s_POWERSTATE_ON_BATTERY __pyx_mstate_global->__pyx_n_s_POWERSTATE_ON_BATTERY #define __pyx_n_s_POWERSTATE_UNKNOWN __pyx_mstate_global->__pyx_n_s_POWERSTATE_UNKNOWN #define __pyx_n_s_PowerInfo __pyx_mstate_global->__pyx_n_s_PowerInfo #define __pyx_n_s_PowerInfo___repr __pyx_mstate_global->__pyx_n_s_PowerInfo___repr #define __pyx_kp_s_PowerInfo_state_seconds_percent __pyx_mstate_global->__pyx_kp_s_PowerInfo_state_seconds_percent #define __pyx_n_s__8 __pyx_mstate_global->__pyx_n_s__8 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_power_info __pyx_mstate_global->__pyx_n_s_get_power_info #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object #define __pyx_n_s_percent __pyx_mstate_global->__pyx_n_s_percent #define __pyx_n_s_powerstate_to_name __pyx_mstate_global->__pyx_n_s_powerstate_to_name #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_pygame_sdl2_locals __pyx_mstate_global->__pyx_n_s_pygame_sdl2_locals #define __pyx_n_s_pygame_sdl2_power __pyx_mstate_global->__pyx_n_s_pygame_sdl2_power #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_seconds __pyx_mstate_global->__pyx_n_s_seconds #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_kp_s_src_pygame_sdl2_power_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_power_pyx #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 /* #### Code section: module_code ### */ /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5power_9PowerInfo_1__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5power_9PowerInfo___repr__, "PowerInfo.__repr__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5power_9PowerInfo_1__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5power_9PowerInfo_1__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5power_9PowerInfo___repr__}; static PyObject *__pyx_pw_11pygame_sdl2_5power_9PowerInfo_1__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 33, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 33, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.power.PowerInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5power_9PowerInfo___repr__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5power_9PowerInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/power.pyx":34 * class PowerInfo(object): * def __repr__(self): * return "".format( # <<<<<<<<<<<<<< * powerstate_to_name.get(self.state, "INVALID"), * self.seconds, */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_PowerInfo_state_seconds_percent, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/power.pyx":35 * def __repr__(self): * return "".format( * powerstate_to_name.get(self.state, "INVALID"), # <<<<<<<<<<<<<< * self.seconds, * self.percent) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_powerstate_to_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_state); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_INVALID}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "pygame_sdl2/power.pyx":36 * return "".format( * powerstate_to_name.get(self.state, "INVALID"), * self.seconds, # <<<<<<<<<<<<<< * self.percent) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_seconds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/power.pyx":37 * powerstate_to_name.get(self.state, "INVALID"), * self.seconds, * self.percent) # <<<<<<<<<<<<<< * * def get_power_info(): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_percent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.power.PowerInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5power_1get_power_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5power_get_power_info, "get_power_info()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5power_1get_power_info = {"get_power_info", (PyCFunction)__pyx_pw_11pygame_sdl2_5power_1get_power_info, METH_NOARGS, __pyx_doc_11pygame_sdl2_5power_get_power_info}; static PyObject *__pyx_pw_11pygame_sdl2_5power_1get_power_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_power_info (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5power_get_power_info(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5power_get_power_info(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_seconds; int __pyx_v_percent; SDL_PowerState __pyx_v_state; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_power_info", 1); /* "pygame_sdl2/power.pyx":44 * cdef int percent * * state = SDL_GetPowerInfo(&seconds, &percent) # <<<<<<<<<<<<<< * * rv = PowerInfo() */ __pyx_v_state = SDL_GetPowerInfo((&__pyx_v_seconds), (&__pyx_v_percent)); /* "pygame_sdl2/power.pyx":46 * state = SDL_GetPowerInfo(&seconds, &percent) * * rv = PowerInfo() # <<<<<<<<<<<<<< * rv.state = state * rv.seconds = seconds */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PowerInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":47 * * rv = PowerInfo() * rv.state = state # <<<<<<<<<<<<<< * rv.seconds = seconds * rv.percent = percent */ __pyx_t_1 = __Pyx_PyInt_From_SDL_PowerState(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_state, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":48 * rv = PowerInfo() * rv.state = state * rv.seconds = seconds # <<<<<<<<<<<<<< * rv.percent = percent * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_seconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_seconds, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":49 * rv.state = state * rv.seconds = seconds * rv.percent = percent # <<<<<<<<<<<<<< * * return rv */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_percent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_percent, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":51 * rv.percent = percent * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.power.get_power_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_INVALID, __pyx_k_INVALID, sizeof(__pyx_k_INVALID), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGED, __pyx_k_POWERSTATE_CHARGED, sizeof(__pyx_k_POWERSTATE_CHARGED), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGING, __pyx_k_POWERSTATE_CHARGING, sizeof(__pyx_k_POWERSTATE_CHARGING), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_k_POWERSTATE_NO_BATTERY, sizeof(__pyx_k_POWERSTATE_NO_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_k_POWERSTATE_ON_BATTERY, sizeof(__pyx_k_POWERSTATE_ON_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_UNKNOWN, __pyx_k_POWERSTATE_UNKNOWN, sizeof(__pyx_k_POWERSTATE_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_PowerInfo, __pyx_k_PowerInfo, sizeof(__pyx_k_PowerInfo), 0, 0, 1, 1}, {&__pyx_n_s_PowerInfo___repr, __pyx_k_PowerInfo___repr, sizeof(__pyx_k_PowerInfo___repr), 0, 0, 1, 1}, {&__pyx_kp_s_PowerInfo_state_seconds_percent, __pyx_k_PowerInfo_state_seconds_percent, sizeof(__pyx_k_PowerInfo_state_seconds_percent), 0, 0, 1, 0}, {&__pyx_n_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_power_info, __pyx_k_get_power_info, sizeof(__pyx_k_get_power_info), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_percent, __pyx_k_percent, sizeof(__pyx_k_percent), 0, 0, 1, 1}, {&__pyx_n_s_powerstate_to_name, __pyx_k_powerstate_to_name, sizeof(__pyx_k_powerstate_to_name), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_power, __pyx_k_pygame_sdl2_power, sizeof(__pyx_k_pygame_sdl2_power), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_power_pyx, __pyx_k_src_pygame_sdl2_power_pyx, sizeof(__pyx_k_src_pygame_sdl2_power_pyx), 0, 0, 1, 0}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 32, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/power.pyx":32 * * * class PowerInfo(object): # <<<<<<<<<<<<<< * def __repr__(self): * return "".format( */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); __pyx_tuple__3 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_power_pyx, __pyx_n_s_repr, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 33, __pyx_L1_error) /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ __pyx_tuple__6 = PyTuple_Pack(4, __pyx_n_s_seconds, __pyx_n_s_percent, __pyx_n_s_state, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_power_pyx, __pyx_n_s_get_power_info, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_power(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_power}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "power", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initpower(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initpower(void) #else __Pyx_PyMODINIT_FUNC PyInit_power(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_power(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_power(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'power' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("power", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "power" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_power(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__power) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.power")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.power", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/power.pyx":19 * # 3. This notice may not be removed or altered from any source distribution. * * from pygame_sdl2.locals import POWERSTATE_UNKNOWN, POWERSTATE_ON_BATTERY, POWERSTATE_NO_BATTERY, POWERSTATE_CHARGING, POWERSTATE_CHARGED # <<<<<<<<<<<<<< * * from sdl2 cimport * */ __pyx_t_2 = PyList_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_POWERSTATE_UNKNOWN); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_UNKNOWN); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_POWERSTATE_UNKNOWN)) __PYX_ERR(0, 19, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_POWERSTATE_ON_BATTERY); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_ON_BATTERY); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_POWERSTATE_ON_BATTERY)) __PYX_ERR(0, 19, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_POWERSTATE_NO_BATTERY); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_NO_BATTERY); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_POWERSTATE_NO_BATTERY)) __PYX_ERR(0, 19, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_POWERSTATE_CHARGING); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_CHARGING); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_POWERSTATE_CHARGING)) __PYX_ERR(0, 19, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_POWERSTATE_CHARGED); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_CHARGED); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_POWERSTATE_CHARGED)) __PYX_ERR(0, 19, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_UNKNOWN, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGING, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGED, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/power.pyx":24 * * powerstate_to_name = { * POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", # <<<<<<<<<<<<<< * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", */ __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_POWERSTATE_UNKNOWN) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":25 * powerstate_to_name = { * POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", # <<<<<<<<<<<<<< * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_POWERSTATE_ON_BATTERY) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":26 * POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", # <<<<<<<<<<<<<< * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", * POWERSTATE_CHARGED : "POWERSTATE_CHARGED", */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_POWERSTATE_NO_BATTERY) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":27 * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", # <<<<<<<<<<<<<< * POWERSTATE_CHARGED : "POWERSTATE_CHARGED", * } */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_POWERSTATE_CHARGING) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":28 * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", * POWERSTATE_CHARGED : "POWERSTATE_CHARGED", # <<<<<<<<<<<<<< * } * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_POWERSTATE_CHARGED) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_powerstate_to_name, __pyx_t_3) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/power.pyx":32 * * * class PowerInfo(object): # <<<<<<<<<<<<<< * def __repr__(self): * return "".format( */ __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_tuple__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_PowerInfo, __pyx_n_s_PowerInfo, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_power, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_3 != __pyx_tuple__3) { if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_tuple__3) < 0))) __PYX_ERR(0, 32, __pyx_L1_error) } /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5power_9PowerInfo_1__repr__, 0, __pyx_n_s_PowerInfo___repr, NULL, __pyx_n_s_pygame_sdl2_power, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_repr, __pyx_t_5) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/power.pyx":32 * * * class PowerInfo(object): # <<<<<<<<<<<<<< * def __repr__(self): * return "".format( */ __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PowerInfo, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PowerInfo, __pyx_t_5) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5power_1get_power_info, 0, __pyx_n_s_get_power_info, NULL, __pyx_n_s_pygame_sdl2_power, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_power_info, __pyx_t_3) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/power.pyx":1 * # Copyright 2017 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.power", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.power"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_PowerState neg_one = (SDL_PowerState) -1, const_zero = (SDL_PowerState) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_PowerState) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_PowerState) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_PowerState) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_PowerState) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_PowerState) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_PowerState), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_PowerState)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__8); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709473.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.pygame_time.c0000664000175000017500000157002514760217141021323 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__pygame_time #define __PYX_HAVE_API__pygame_sdl2__pygame_time /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/pygame_time.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* dict_getitem_default.proto */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod1.proto */ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #else #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) #endif /* CallUnboundCMethod2.proto */ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); #else #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* pop_index.proto */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #else #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix)) #endif /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* PyFloatBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check); #else #define __Pyx_PyFloat_TrueDivideCObj(op1, op2, floatval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "cython" */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.pygame_time" */ static int __pyx_v_11pygame_sdl2_11pygame_time_timer_id; static PyObject *__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event = 0; static Uint32 __pyx_f_11pygame_sdl2_11pygame_time_timer_callback(Uint32, void *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.pygame_time" extern int __pyx_module_is_main_pygame_sdl2__pygame_time; int __pyx_module_is_main_pygame_sdl2__pygame_time = 0; /* Implementation of "pygame_sdl2.pygame_time" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_sum; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "*"; static const char __pyx_k__2[] = "."; static const char __pyx_k__23[] = "?"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_now[] = "now"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_sum[] = "sum"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_last[] = "last"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_math[] = "math"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_tick[] = "tick"; static const char __pyx_k_wait[] = "wait"; static const char __pyx_k_Clock[] = "Clock"; static const char __pyx_k_delay[] = "delay"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_isnan[] = "isnan"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_init_2[] = "__init__"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_eventid[] = "eventid"; static const char __pyx_k_get_fps[] = "get_fps"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_get_time[] = "get_time"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_timer_id[] = "timer_id"; static const char __pyx_k_framerate[] = "framerate"; static const char __pyx_k_frametime[] = "frametime"; static const char __pyx_k_get_ticks[] = "get_ticks"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_set_timer[] = "set_timer"; static const char __pyx_k_Clock_tick[] = "Clock.tick"; static const char __pyx_k_total_time[] = "total_time"; static const char __pyx_k_average_fps[] = "average_fps"; static const char __pyx_k_get_rawtime[] = "get_rawtime"; static const char __pyx_k_last_frames[] = "last_frames"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_Clock___init[] = "Clock.__init__"; static const char __pyx_k_average_time[] = "average_time"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_milliseconds[] = "milliseconds"; static const char __pyx_k_Clock_get_fps[] = "Clock.get_fps"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_raw_frametime[] = "raw_frametime"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_sdl_main_init[] = "sdl_main_init"; static const char __pyx_k_Clock_get_time[] = "Clock.get_time"; static const char __pyx_k_frame_duration[] = "frame_duration"; static const char __pyx_k_tick_busy_loop[] = "tick_busy_loop"; static const char __pyx_k_Clock_get_rawtime[] = "Clock.get_rawtime"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Clock_tick_busy_loop[] = "Clock.tick_busy_loop"; static const char __pyx_k_pygame_sdl2_pygame_time[] = "pygame_sdl2.pygame_time"; static const char __pyx_k_src_pygame_sdl2_pygame_time_pyx[] = "src/pygame_sdl2/pygame_time.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_4get_ticks(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_6wait(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_milliseconds); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_8delay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_milliseconds); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_10set_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_eventid, PyObject *__pyx_v_milliseconds); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_2tick(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_6get_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_10get_fps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_n_s_; PyObject *__pyx_n_s_Clock; PyObject *__pyx_n_s_Clock___init; PyObject *__pyx_n_s_Clock_get_fps; PyObject *__pyx_n_s_Clock_get_rawtime; PyObject *__pyx_n_s_Clock_get_time; PyObject *__pyx_n_s_Clock_tick; PyObject *__pyx_n_s_Clock_tick_busy_loop; PyObject *__pyx_kp_u__2; PyObject *__pyx_n_s__23; PyObject *__pyx_n_s_append; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_average_fps; PyObject *__pyx_n_s_average_time; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_delay; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_display; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_eventid; PyObject *__pyx_n_s_frame_duration; PyObject *__pyx_n_s_framerate; PyObject *__pyx_n_s_frametime; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_fps; PyObject *__pyx_n_s_get_rawtime; PyObject *__pyx_n_s_get_ticks; PyObject *__pyx_n_s_get_time; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_2; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_isnan; PyObject *__pyx_n_s_last; PyObject *__pyx_n_s_last_frames; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_math; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_milliseconds; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_now; PyObject *__pyx_n_s_pop; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_pygame_time; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_raw_frametime; PyObject *__pyx_n_s_register_init; PyObject *__pyx_n_s_register_quit; PyObject *__pyx_n_s_sdl_main_init; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_set_timer; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_pygame_time_pyx; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_sum; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_tick; PyObject *__pyx_n_s_tick_busy_loop; PyObject *__pyx_n_s_timer_id; PyObject *__pyx_n_s_total_time; PyObject *__pyx_n_s_wait; PyObject *__pyx_float_1_0; PyObject *__pyx_int_0; PyObject *__pyx_int_1000; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__21; PyObject *__pyx_codeobj__3; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_n_s_); Py_CLEAR(clear_module_state->__pyx_n_s_Clock); Py_CLEAR(clear_module_state->__pyx_n_s_Clock___init); Py_CLEAR(clear_module_state->__pyx_n_s_Clock_get_fps); Py_CLEAR(clear_module_state->__pyx_n_s_Clock_get_rawtime); Py_CLEAR(clear_module_state->__pyx_n_s_Clock_get_time); Py_CLEAR(clear_module_state->__pyx_n_s_Clock_tick); Py_CLEAR(clear_module_state->__pyx_n_s_Clock_tick_busy_loop); Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_n_s__23); Py_CLEAR(clear_module_state->__pyx_n_s_append); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_average_fps); Py_CLEAR(clear_module_state->__pyx_n_s_average_time); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_delay); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_display); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_eventid); Py_CLEAR(clear_module_state->__pyx_n_s_frame_duration); Py_CLEAR(clear_module_state->__pyx_n_s_framerate); Py_CLEAR(clear_module_state->__pyx_n_s_frametime); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_fps); Py_CLEAR(clear_module_state->__pyx_n_s_get_rawtime); Py_CLEAR(clear_module_state->__pyx_n_s_get_ticks); Py_CLEAR(clear_module_state->__pyx_n_s_get_time); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_2); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_isnan); Py_CLEAR(clear_module_state->__pyx_n_s_last); Py_CLEAR(clear_module_state->__pyx_n_s_last_frames); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_math); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_milliseconds); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_now); Py_CLEAR(clear_module_state->__pyx_n_s_pop); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_pygame_time); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_raw_frametime); Py_CLEAR(clear_module_state->__pyx_n_s_register_init); Py_CLEAR(clear_module_state->__pyx_n_s_register_quit); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_main_init); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_set_timer); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_pygame_time_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_sum); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_tick); Py_CLEAR(clear_module_state->__pyx_n_s_tick_busy_loop); Py_CLEAR(clear_module_state->__pyx_n_s_timer_id); Py_CLEAR(clear_module_state->__pyx_n_s_total_time); Py_CLEAR(clear_module_state->__pyx_n_s_wait); Py_CLEAR(clear_module_state->__pyx_float_1_0); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1000); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_codeobj__3); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_n_s_); Py_VISIT(traverse_module_state->__pyx_n_s_Clock); Py_VISIT(traverse_module_state->__pyx_n_s_Clock___init); Py_VISIT(traverse_module_state->__pyx_n_s_Clock_get_fps); Py_VISIT(traverse_module_state->__pyx_n_s_Clock_get_rawtime); Py_VISIT(traverse_module_state->__pyx_n_s_Clock_get_time); Py_VISIT(traverse_module_state->__pyx_n_s_Clock_tick); Py_VISIT(traverse_module_state->__pyx_n_s_Clock_tick_busy_loop); Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_n_s__23); Py_VISIT(traverse_module_state->__pyx_n_s_append); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_average_fps); Py_VISIT(traverse_module_state->__pyx_n_s_average_time); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_delay); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_display); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_eventid); Py_VISIT(traverse_module_state->__pyx_n_s_frame_duration); Py_VISIT(traverse_module_state->__pyx_n_s_framerate); Py_VISIT(traverse_module_state->__pyx_n_s_frametime); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_fps); Py_VISIT(traverse_module_state->__pyx_n_s_get_rawtime); Py_VISIT(traverse_module_state->__pyx_n_s_get_ticks); Py_VISIT(traverse_module_state->__pyx_n_s_get_time); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_2); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_isnan); Py_VISIT(traverse_module_state->__pyx_n_s_last); Py_VISIT(traverse_module_state->__pyx_n_s_last_frames); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_math); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_milliseconds); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_now); Py_VISIT(traverse_module_state->__pyx_n_s_pop); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_pygame_time); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_raw_frametime); Py_VISIT(traverse_module_state->__pyx_n_s_register_init); Py_VISIT(traverse_module_state->__pyx_n_s_register_quit); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_main_init); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_set_timer); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_pygame_time_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_sum); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_tick); Py_VISIT(traverse_module_state->__pyx_n_s_tick_busy_loop); Py_VISIT(traverse_module_state->__pyx_n_s_timer_id); Py_VISIT(traverse_module_state->__pyx_n_s_total_time); Py_VISIT(traverse_module_state->__pyx_n_s_wait); Py_VISIT(traverse_module_state->__pyx_float_1_0); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1000); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_codeobj__3); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ #define __pyx_n_s_Clock __pyx_mstate_global->__pyx_n_s_Clock #define __pyx_n_s_Clock___init __pyx_mstate_global->__pyx_n_s_Clock___init #define __pyx_n_s_Clock_get_fps __pyx_mstate_global->__pyx_n_s_Clock_get_fps #define __pyx_n_s_Clock_get_rawtime __pyx_mstate_global->__pyx_n_s_Clock_get_rawtime #define __pyx_n_s_Clock_get_time __pyx_mstate_global->__pyx_n_s_Clock_get_time #define __pyx_n_s_Clock_tick __pyx_mstate_global->__pyx_n_s_Clock_tick #define __pyx_n_s_Clock_tick_busy_loop __pyx_mstate_global->__pyx_n_s_Clock_tick_busy_loop #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_n_s__23 __pyx_mstate_global->__pyx_n_s__23 #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_average_fps __pyx_mstate_global->__pyx_n_s_average_fps #define __pyx_n_s_average_time __pyx_mstate_global->__pyx_n_s_average_time #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_delay __pyx_mstate_global->__pyx_n_s_delay #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_eventid __pyx_mstate_global->__pyx_n_s_eventid #define __pyx_n_s_frame_duration __pyx_mstate_global->__pyx_n_s_frame_duration #define __pyx_n_s_framerate __pyx_mstate_global->__pyx_n_s_framerate #define __pyx_n_s_frametime __pyx_mstate_global->__pyx_n_s_frametime #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_fps __pyx_mstate_global->__pyx_n_s_get_fps #define __pyx_n_s_get_rawtime __pyx_mstate_global->__pyx_n_s_get_rawtime #define __pyx_n_s_get_ticks __pyx_mstate_global->__pyx_n_s_get_ticks #define __pyx_n_s_get_time __pyx_mstate_global->__pyx_n_s_get_time #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_2 __pyx_mstate_global->__pyx_n_s_init_2 #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_isnan __pyx_mstate_global->__pyx_n_s_isnan #define __pyx_n_s_last __pyx_mstate_global->__pyx_n_s_last #define __pyx_n_s_last_frames __pyx_mstate_global->__pyx_n_s_last_frames #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_math __pyx_mstate_global->__pyx_n_s_math #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_milliseconds __pyx_mstate_global->__pyx_n_s_milliseconds #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_now __pyx_mstate_global->__pyx_n_s_now #define __pyx_n_s_pop __pyx_mstate_global->__pyx_n_s_pop #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_pygame_time __pyx_mstate_global->__pyx_n_s_pygame_sdl2_pygame_time #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_raw_frametime __pyx_mstate_global->__pyx_n_s_raw_frametime #define __pyx_n_s_register_init __pyx_mstate_global->__pyx_n_s_register_init #define __pyx_n_s_register_quit __pyx_mstate_global->__pyx_n_s_register_quit #define __pyx_n_s_sdl_main_init __pyx_mstate_global->__pyx_n_s_sdl_main_init #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_set_timer __pyx_mstate_global->__pyx_n_s_set_timer #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_pygame_time_pyx #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_sum __pyx_mstate_global->__pyx_n_s_sum #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_tick __pyx_mstate_global->__pyx_n_s_tick #define __pyx_n_s_tick_busy_loop __pyx_mstate_global->__pyx_n_s_tick_busy_loop #define __pyx_n_s_timer_id __pyx_mstate_global->__pyx_n_s_timer_id #define __pyx_n_s_total_time __pyx_mstate_global->__pyx_n_s_total_time #define __pyx_n_s_wait __pyx_mstate_global->__pyx_n_s_wait #define __pyx_float_1_0 __pyx_mstate_global->__pyx_float_1_0 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1000 __pyx_mstate_global->__pyx_int_1000 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 /* #### Code section: module_code ### */ /* "pygame_sdl2/pygame_time.pyx":27 * cdef int timer_id = 0 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_11pygame_time_init}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/pygame_time.pyx":29 * @pygame_sdl2.register_init * def init(): * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_TIMER): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":31 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_TIMER): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = (SDL_InitSubSystem(SDL_INIT_TIMER) != 0); if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/pygame_time.pyx":32 * * if SDL_InitSubSystem(SDL_INIT_TIMER): * raise error() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 32, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":31 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_TIMER): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/pygame_time.pyx":27 * cdef int timer_id = 0 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.pygame_time.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":34 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_2quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_3quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_11pygame_time_2quit}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/pygame_time.pyx":36 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) # <<<<<<<<<<<<<< * * def get_ticks(): */ SDL_QuitSubSystem(SDL_INIT_TIMER); /* "pygame_sdl2/pygame_time.pyx":34 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5get_ticks(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_4get_ticks, "get_ticks()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5get_ticks = {"get_ticks", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5get_ticks, METH_NOARGS, __pyx_doc_11pygame_sdl2_11pygame_time_4get_ticks}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5get_ticks(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_ticks (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_4get_ticks(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_4get_ticks(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_ticks", 1); /* "pygame_sdl2/pygame_time.pyx":39 * * def get_ticks(): * return SDL_GetTicks() # <<<<<<<<<<<<<< * * def wait(int milliseconds): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetTicks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.get_ticks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_7wait(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_6wait, "wait(int milliseconds)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_7wait = {"wait", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_7wait, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_6wait}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_7wait(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { int __pyx_v_milliseconds; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wait (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_milliseconds,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_milliseconds)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wait") < 0)) __PYX_ERR(0, 41, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_milliseconds = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_milliseconds == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("wait", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 41, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_6wait(__pyx_self, __pyx_v_milliseconds); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_6wait(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_milliseconds) { int __pyx_v_start; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("wait", 1); /* "pygame_sdl2/pygame_time.pyx":44 * cdef int start * * start = SDL_GetTicks() # <<<<<<<<<<<<<< * with nogil: * SDL_Delay(milliseconds) */ __pyx_v_start = SDL_GetTicks(); /* "pygame_sdl2/pygame_time.pyx":45 * * start = SDL_GetTicks() * with nogil: # <<<<<<<<<<<<<< * SDL_Delay(milliseconds) * return SDL_GetTicks() - start */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/pygame_time.pyx":46 * start = SDL_GetTicks() * with nogil: * SDL_Delay(milliseconds) # <<<<<<<<<<<<<< * return SDL_GetTicks() - start * */ SDL_Delay(__pyx_v_milliseconds); } /* "pygame_sdl2/pygame_time.pyx":45 * * start = SDL_GetTicks() * with nogil: # <<<<<<<<<<<<<< * SDL_Delay(milliseconds) * return SDL_GetTicks() - start */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/pygame_time.pyx":47 * with nogil: * SDL_Delay(milliseconds) * return SDL_GetTicks() - start # <<<<<<<<<<<<<< * * def delay(milliseconds): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t((SDL_GetTicks() - __pyx_v_start)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_9delay(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_8delay, "delay(milliseconds)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_9delay = {"delay", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_9delay, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_8delay}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_9delay(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_milliseconds = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("delay (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_milliseconds,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_milliseconds)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "delay") < 0)) __PYX_ERR(0, 49, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_milliseconds = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("delay", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 49, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.delay", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_8delay(__pyx_self, __pyx_v_milliseconds); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_8delay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_milliseconds) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("delay", 1); /* "pygame_sdl2/pygame_time.pyx":51 * def delay(milliseconds): * # SDL_Delay() should be accurate enough. * return wait(milliseconds) # <<<<<<<<<<<<<< * * cdef Uint32 timer_callback(Uint32 interval, void *param) nogil: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_wait); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_milliseconds}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.pygame_time.delay", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":53 * return wait(milliseconds) * * cdef Uint32 timer_callback(Uint32 interval, void *param) nogil: # <<<<<<<<<<<<<< * cdef SDL_Event e * e.type = param */ static Uint32 __pyx_f_11pygame_sdl2_11pygame_time_timer_callback(Uint32 __pyx_v_interval, void *__pyx_v_param) { SDL_Event __pyx_v_e; Uint32 __pyx_r; /* "pygame_sdl2/pygame_time.pyx":55 * cdef Uint32 timer_callback(Uint32 interval, void *param) nogil: * cdef SDL_Event e * e.type = param # <<<<<<<<<<<<<< * e.user.code = 0 * e.user.data1 = NULL */ __pyx_v_e.type = ((int)__pyx_v_param); /* "pygame_sdl2/pygame_time.pyx":56 * cdef SDL_Event e * e.type = param * e.user.code = 0 # <<<<<<<<<<<<<< * e.user.data1 = NULL * e.user.data2 = NULL */ __pyx_v_e.user.code = 0; /* "pygame_sdl2/pygame_time.pyx":57 * e.type = param * e.user.code = 0 * e.user.data1 = NULL # <<<<<<<<<<<<<< * e.user.data2 = NULL * SDL_PushEvent(&e) */ __pyx_v_e.user.data1 = NULL; /* "pygame_sdl2/pygame_time.pyx":58 * e.user.code = 0 * e.user.data1 = NULL * e.user.data2 = NULL # <<<<<<<<<<<<<< * SDL_PushEvent(&e) * return interval */ __pyx_v_e.user.data2 = NULL; /* "pygame_sdl2/pygame_time.pyx":59 * e.user.data1 = NULL * e.user.data2 = NULL * SDL_PushEvent(&e) # <<<<<<<<<<<<<< * return interval * */ (void)(SDL_PushEvent((&__pyx_v_e))); /* "pygame_sdl2/pygame_time.pyx":60 * e.user.data2 = NULL * SDL_PushEvent(&e) * return interval # <<<<<<<<<<<<<< * * # A map from eventid to SDL_Timer_ID. */ __pyx_r = __pyx_v_interval; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":53 * return wait(milliseconds) * * cdef Uint32 timer_callback(Uint32 interval, void *param) nogil: # <<<<<<<<<<<<<< * cdef SDL_Event e * e.type = param */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_11set_timer(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_10set_timer, "set_timer(eventid, milliseconds)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_11set_timer = {"set_timer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_11set_timer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_10set_timer}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_11set_timer(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_eventid = 0; PyObject *__pyx_v_milliseconds = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_timer (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_eventid,&__pyx_n_s_milliseconds,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eventid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_milliseconds)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_timer", 1, 2, 2, 1); __PYX_ERR(0, 65, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_timer") < 0)) __PYX_ERR(0, 65, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_eventid = values[0]; __pyx_v_milliseconds = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_timer", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 65, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.set_timer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_10set_timer(__pyx_self, __pyx_v_eventid, __pyx_v_milliseconds); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_10set_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_eventid, PyObject *__pyx_v_milliseconds) { int __pyx_v_timer_id; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Uint32 __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_timer", 1); /* "pygame_sdl2/pygame_time.pyx":67 * def set_timer(eventid, milliseconds): * * cdef int timer_id = timer_by_event.get(eventid, 0) # <<<<<<<<<<<<<< * * if timer_id != 0: */ if (unlikely(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 67, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, __pyx_v_eventid, __pyx_int_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_timer_id = __pyx_t_2; /* "pygame_sdl2/pygame_time.pyx":69 * cdef int timer_id = timer_by_event.get(eventid, 0) * * if timer_id != 0: # <<<<<<<<<<<<<< * SDL_RemoveTimer(timer_id) * timer_id = 0 */ __pyx_t_3 = (__pyx_v_timer_id != 0); if (__pyx_t_3) { /* "pygame_sdl2/pygame_time.pyx":70 * * if timer_id != 0: * SDL_RemoveTimer(timer_id) # <<<<<<<<<<<<<< * timer_id = 0 * */ (void)(SDL_RemoveTimer(__pyx_v_timer_id)); /* "pygame_sdl2/pygame_time.pyx":71 * if timer_id != 0: * SDL_RemoveTimer(timer_id) * timer_id = 0 # <<<<<<<<<<<<<< * * if milliseconds > 0: */ __pyx_v_timer_id = 0; /* "pygame_sdl2/pygame_time.pyx":69 * cdef int timer_id = timer_by_event.get(eventid, 0) * * if timer_id != 0: # <<<<<<<<<<<<<< * SDL_RemoveTimer(timer_id) * timer_id = 0 */ } /* "pygame_sdl2/pygame_time.pyx":73 * timer_id = 0 * * if milliseconds > 0: # <<<<<<<<<<<<<< * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_milliseconds, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/pygame_time.pyx":74 * * if milliseconds > 0: * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) # <<<<<<<<<<<<<< * if timer_id == 0: * raise error() */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_milliseconds); if (unlikely((__pyx_t_4 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_eventid); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L1_error) __pyx_v_timer_id = SDL_AddTimer(__pyx_t_4, ((SDL_TimerCallback)__pyx_f_11pygame_sdl2_11pygame_time_timer_callback), ((void *)((int)__pyx_t_2))); /* "pygame_sdl2/pygame_time.pyx":75 * if milliseconds > 0: * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = (__pyx_v_timer_id == 0); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/pygame_time.pyx":76 * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: * raise error() # <<<<<<<<<<<<<< * * timer_by_event[eventid] = timer_id */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_2, 0+__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 76, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":75 * if milliseconds > 0: * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/pygame_time.pyx":73 * timer_id = 0 * * if milliseconds > 0: # <<<<<<<<<<<<<< * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: */ } /* "pygame_sdl2/pygame_time.pyx":78 * raise error() * * timer_by_event[eventid] = timer_id # <<<<<<<<<<<<<< * * class Clock: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_timer_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 78, __pyx_L1_error) } if (unlikely((PyDict_SetItem(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, __pyx_v_eventid, __pyx_t_1) < 0))) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.pygame_time.set_timer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_5Clock___init__, "Clock.__init__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_5Clock___init__}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 81, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 81, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock___init__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/pygame_time.pyx":82 * class Clock: * def __init__(self): * self.last = SDL_GetTicks() # <<<<<<<<<<<<<< * self.last_frames = [] * self.frametime = 0 */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetTicks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last, __pyx_t_1) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":83 * def __init__(self): * self.last = SDL_GetTicks() * self.last_frames = [] # <<<<<<<<<<<<<< * self.frametime = 0 * self.raw_frametime = 0 */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last_frames, __pyx_t_1) < 0) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":84 * self.last = SDL_GetTicks() * self.last_frames = [] * self.frametime = 0 # <<<<<<<<<<<<<< * self.raw_frametime = 0 * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_frametime, __pyx_int_0) < 0) __PYX_ERR(0, 84, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":85 * self.last_frames = [] * self.frametime = 0 * self.raw_frametime = 0 # <<<<<<<<<<<<<< * * def tick(self, framerate=0): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime, __pyx_int_0) < 0) __PYX_ERR(0, 85, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_3tick(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_5Clock_2tick, "Clock.tick(self, framerate=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_3tick = {"tick", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_3tick, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_5Clock_2tick}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_3tick(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_framerate = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tick (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_framerate,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_framerate); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tick") < 0)) __PYX_ERR(0, 87, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_framerate = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tick", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 87, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_2tick(__pyx_self, __pyx_v_self, __pyx_v_framerate); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_2tick(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate) { int __pyx_v_now; int __pyx_v_frame_duration; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tick", 1); /* "pygame_sdl2/pygame_time.pyx":88 * * def tick(self, framerate=0): * cdef int now = SDL_GetTicks() # <<<<<<<<<<<<<< * self.raw_frametime = now - self.last * while len(self.last_frames) > 9: */ __pyx_v_now = SDL_GetTicks(); /* "pygame_sdl2/pygame_time.pyx":89 * def tick(self, framerate=0): * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last # <<<<<<<<<<<<<< * while len(self.last_frames) > 9: * self.last_frames.pop(0) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime, __pyx_t_3) < 0) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":90 * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last * while len(self.last_frames) > 9: # <<<<<<<<<<<<<< * self.last_frames.pop(0) * if framerate == 0: */ while (1) { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (__pyx_t_4 > 9); if (!__pyx_t_5) break; /* "pygame_sdl2/pygame_time.pyx":91 * self.raw_frametime = now - self.last * while len(self.last_frames) > 9: * self.last_frames.pop(0) # <<<<<<<<<<<<<< * if framerate == 0: * self.last = now */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_PopIndex(__pyx_t_3, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/pygame_time.pyx":92 * while len(self.last_frames) > 9: * self.last_frames.pop(0) * if framerate == 0: # <<<<<<<<<<<<<< * self.last = now * self.last_frames.append(self.raw_frametime) */ __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_framerate, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 92, __pyx_L1_error) if (__pyx_t_5) { /* "pygame_sdl2/pygame_time.pyx":93 * self.last_frames.pop(0) * if framerate == 0: * self.last = now # <<<<<<<<<<<<<< * self.last_frames.append(self.raw_frametime) * return self.raw_frametime */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":94 * if framerate == 0: * self.last = now * self.last_frames.append(self.raw_frametime) # <<<<<<<<<<<<<< * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":95 * self.last = now * self.last_frames.append(self.raw_frametime) * return self.raw_frametime # <<<<<<<<<<<<<< * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":92 * while len(self.last_frames) > 9: * self.last_frames.pop(0) * if framerate == 0: # <<<<<<<<<<<<<< * self.last = now * self.last_frames.append(self.raw_frametime) */ } /* "pygame_sdl2/pygame_time.pyx":96 * self.last_frames.append(self.raw_frametime) * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 # <<<<<<<<<<<<<< * if self.raw_frametime < frame_duration: * delay(frame_duration - self.raw_frametime) */ __pyx_t_3 = __Pyx_PyFloat_TrueDivideCObj(__pyx_float_1_0, __pyx_v_framerate, 1.0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_frame_duration = __pyx_t_7; /* "pygame_sdl2/pygame_time.pyx":97 * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: # <<<<<<<<<<<<<< * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_frame_duration); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/pygame_time.pyx":98 * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: * delay(frame_duration - self.raw_frametime) # <<<<<<<<<<<<<< * now = SDL_GetTicks() * self.frametime = now - self.last */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_delay); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_frame_duration); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyNumber_Subtract(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":97 * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: # <<<<<<<<<<<<<< * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() */ } /* "pygame_sdl2/pygame_time.pyx":99 * if self.raw_frametime < frame_duration: * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() # <<<<<<<<<<<<<< * self.frametime = now - self.last * self.last = now */ __pyx_v_now = SDL_GetTicks(); /* "pygame_sdl2/pygame_time.pyx":100 * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() * self.frametime = now - self.last # <<<<<<<<<<<<<< * self.last = now * self.last_frames.append(self.frametime) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_frametime, __pyx_t_9) < 0) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/pygame_time.pyx":101 * now = SDL_GetTicks() * self.frametime = now - self.last * self.last = now # <<<<<<<<<<<<<< * self.last_frames.append(self.frametime) * return self.frametime */ __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last, __pyx_t_9) < 0) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/pygame_time.pyx":102 * self.frametime = now - self.last * self.last = now * self.last_frames.append(self.frametime) # <<<<<<<<<<<<<< * return self.frametime * */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frametime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_9, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":103 * self.last = now * self.last_frames.append(self.frametime) * return self.frametime # <<<<<<<<<<<<<< * * def tick_busy_loop(self, framerate=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frametime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop, "Clock.tick_busy_loop(self, framerate=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop = {"tick_busy_loop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_framerate = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tick_busy_loop (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_framerate,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_framerate); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tick_busy_loop") < 0)) __PYX_ERR(0, 105, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_framerate = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tick_busy_loop", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 105, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick_busy_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop(__pyx_self, __pyx_v_self, __pyx_v_framerate); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tick_busy_loop", 1); /* "pygame_sdl2/pygame_time.pyx":106 * * def tick_busy_loop(self, framerate=0): * return self.tick(framerate) # <<<<<<<<<<<<<< * * def get_time(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tick); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_framerate}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick_busy_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_7get_time(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_5Clock_6get_time, "Clock.get_time(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_7get_time = {"get_time", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_7get_time, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_5Clock_6get_time}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_7get_time(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_time (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_time") < 0)) __PYX_ERR(0, 108, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_time", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 108, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_time", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_6get_time(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_6get_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_time", 1); /* "pygame_sdl2/pygame_time.pyx":109 * * def get_time(self): * return self.frametime # <<<<<<<<<<<<<< * * def get_rawtime(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frametime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_time", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime, "Clock.get_rawtime(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime = {"get_rawtime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_rawtime (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_rawtime") < 0)) __PYX_ERR(0, 111, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_rawtime", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 111, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_rawtime", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_rawtime", 1); /* "pygame_sdl2/pygame_time.pyx":112 * * def get_rawtime(self): * return self.raw_frametime # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_rawtime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":114 * return self.raw_frametime * * @cython.cdivision(True) # <<<<<<<<<<<<<< * def get_fps(self): * cdef int total_time = sum(self.last_frames) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_11get_fps(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_5Clock_10get_fps, "Clock.get_fps(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_11get_fps = {"get_fps", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_11get_fps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_5Clock_10get_fps}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_11get_fps(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_fps (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_fps") < 0)) __PYX_ERR(0, 114, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_fps", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 114, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_fps", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_10get_fps(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_10get_fps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { int __pyx_v_total_time; float __pyx_v_average_time; float __pyx_v_average_fps; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_fps", 1); /* "pygame_sdl2/pygame_time.pyx":116 * @cython.cdivision(True) * def get_fps(self): * cdef int total_time = sum(self.last_frames) # <<<<<<<<<<<<<< * cdef float average_time = total_time / 1000.0 / len(self.last_frames) * cdef float average_fps = 1.0 / average_time */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_total_time = __pyx_t_3; /* "pygame_sdl2/pygame_time.pyx":117 * def get_fps(self): * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) # <<<<<<<<<<<<<< * cdef float average_fps = 1.0 / average_time * return 0 if math.isnan(average_fps) else average_fps */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_average_time = ((((double)__pyx_v_total_time) / 1000.0) / ((double)__pyx_t_4)); /* "pygame_sdl2/pygame_time.pyx":118 * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) * cdef float average_fps = 1.0 / average_time # <<<<<<<<<<<<<< * return 0 if math.isnan(average_fps) else average_fps */ __pyx_v_average_fps = (1.0 / ((double)__pyx_v_average_time)); /* "pygame_sdl2/pygame_time.pyx":119 * cdef float average_time = total_time / 1000.0 / len(self.last_frames) * cdef float average_fps = 1.0 / average_time * return 0 if math.isnan(average_fps) else average_fps # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnan); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyFloat_FromDouble(__pyx_v_average_fps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_3 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { __Pyx_INCREF(__pyx_int_0); __pyx_t_2 = __pyx_int_0; } else { __pyx_t_1 = PyFloat_FromDouble(__pyx_v_average_fps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":114 * return self.raw_frametime * * @cython.cdivision(True) # <<<<<<<<<<<<<< * def get_fps(self): * cdef int total_time = sum(self.last_frames) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_fps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, {&__pyx_n_s_Clock, __pyx_k_Clock, sizeof(__pyx_k_Clock), 0, 0, 1, 1}, {&__pyx_n_s_Clock___init, __pyx_k_Clock___init, sizeof(__pyx_k_Clock___init), 0, 0, 1, 1}, {&__pyx_n_s_Clock_get_fps, __pyx_k_Clock_get_fps, sizeof(__pyx_k_Clock_get_fps), 0, 0, 1, 1}, {&__pyx_n_s_Clock_get_rawtime, __pyx_k_Clock_get_rawtime, sizeof(__pyx_k_Clock_get_rawtime), 0, 0, 1, 1}, {&__pyx_n_s_Clock_get_time, __pyx_k_Clock_get_time, sizeof(__pyx_k_Clock_get_time), 0, 0, 1, 1}, {&__pyx_n_s_Clock_tick, __pyx_k_Clock_tick, sizeof(__pyx_k_Clock_tick), 0, 0, 1, 1}, {&__pyx_n_s_Clock_tick_busy_loop, __pyx_k_Clock_tick_busy_loop, sizeof(__pyx_k_Clock_tick_busy_loop), 0, 0, 1, 1}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_average_fps, __pyx_k_average_fps, sizeof(__pyx_k_average_fps), 0, 0, 1, 1}, {&__pyx_n_s_average_time, __pyx_k_average_time, sizeof(__pyx_k_average_time), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_delay, __pyx_k_delay, sizeof(__pyx_k_delay), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_eventid, __pyx_k_eventid, sizeof(__pyx_k_eventid), 0, 0, 1, 1}, {&__pyx_n_s_frame_duration, __pyx_k_frame_duration, sizeof(__pyx_k_frame_duration), 0, 0, 1, 1}, {&__pyx_n_s_framerate, __pyx_k_framerate, sizeof(__pyx_k_framerate), 0, 0, 1, 1}, {&__pyx_n_s_frametime, __pyx_k_frametime, sizeof(__pyx_k_frametime), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_fps, __pyx_k_get_fps, sizeof(__pyx_k_get_fps), 0, 0, 1, 1}, {&__pyx_n_s_get_rawtime, __pyx_k_get_rawtime, sizeof(__pyx_k_get_rawtime), 0, 0, 1, 1}, {&__pyx_n_s_get_ticks, __pyx_k_get_ticks, sizeof(__pyx_k_get_ticks), 0, 0, 1, 1}, {&__pyx_n_s_get_time, __pyx_k_get_time, sizeof(__pyx_k_get_time), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_isnan, __pyx_k_isnan, sizeof(__pyx_k_isnan), 0, 0, 1, 1}, {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1}, {&__pyx_n_s_last_frames, __pyx_k_last_frames, sizeof(__pyx_k_last_frames), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_milliseconds, __pyx_k_milliseconds, sizeof(__pyx_k_milliseconds), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_pygame_time, __pyx_k_pygame_sdl2_pygame_time, sizeof(__pyx_k_pygame_sdl2_pygame_time), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_raw_frametime, __pyx_k_raw_frametime, sizeof(__pyx_k_raw_frametime), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_set_timer, __pyx_k_set_timer, sizeof(__pyx_k_set_timer), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_k_src_pygame_sdl2_pygame_time_pyx, sizeof(__pyx_k_src_pygame_sdl2_pygame_time_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_tick, __pyx_k_tick, sizeof(__pyx_k_tick), 0, 0, 1, 1}, {&__pyx_n_s_tick_busy_loop, __pyx_k_tick_busy_loop, sizeof(__pyx_k_tick_busy_loop), 0, 0, 1, 1}, {&__pyx_n_s_timer_id, __pyx_k_timer_id, sizeof(__pyx_k_timer_id), 0, 0, 1, 1}, {&__pyx_n_s_total_time, __pyx_k_total_time, sizeof(__pyx_k_total_time), 0, 0, 1, 1}, {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 116, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/pygame_time.pyx":27 * cdef int timer_id = 0 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_init, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 27, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":34 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) */ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_quit, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 34, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_ticks, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 38, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_milliseconds, __pyx_n_s_start); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_wait, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 41, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_milliseconds); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_delay, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 49, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ __pyx_tuple__10 = PyTuple_Pack(3, __pyx_n_s_eventid, __pyx_n_s_milliseconds, __pyx_n_s_timer_id); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_set_timer, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 65, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_init_2, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 81, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_framerate, __pyx_n_s_now, __pyx_n_s_frame_duration); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_tick, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 87, __pyx_L1_error) __pyx_tuple__16 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_framerate); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_tick_busy_loop, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 105, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_time, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 108, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_rawtime, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 111, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":114 * return self.raw_frametime * * @cython.cdivision(True) # <<<<<<<<<<<<<< * def get_fps(self): * cdef int total_time = sum(self.last_frames) */ __pyx_tuple__21 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_total_time, __pyx_n_s_average_time, __pyx_n_s_average_fps); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_fps, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get; if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_11pygame_time_timer_by_event = ((PyObject*)Py_None); Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_pygame_time(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_pygame_time}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "pygame_time", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initpygame_time(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initpygame_time(void) #else __Pyx_PyMODINIT_FUNC PyInit_pygame_time(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_pygame_time(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_pygame_time(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'pygame_time' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("pygame_time", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "pygame_time" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_pygame_time(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__pygame_time) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.pygame_time")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.pygame_time", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/pygame_time.pyx":20 * * import cython * import math # <<<<<<<<<<<<<< * from sdl2 cimport * * from pygame_sdl2.error import error */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_math, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":22 * import math * from sdl2 cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 22, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":23 * from sdl2 cimport * * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * cdef int timer_id = 0 */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":25 * import pygame_sdl2 * * cdef int timer_id = 0 # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_v_11pygame_sdl2_11pygame_time_timer_id = 0; /* "pygame_sdl2/pygame_time.pyx":27 * cdef int timer_id = 0 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":34 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_3quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5get_ticks, 0, __pyx_n_s_get_ticks, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ticks, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_7wait, 0, __pyx_n_s_wait, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_9delay, 0, __pyx_n_s_delay, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_delay, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":63 * * # A map from eventid to SDL_Timer_ID. * cdef dict timer_by_event = { } # <<<<<<<<<<<<<< * * def set_timer(eventid, milliseconds): */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_11set_timer, 0, __pyx_n_s_set_timer, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_timer, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":80 * timer_by_event[eventid] = timer_id * * class Clock: # <<<<<<<<<<<<<< * def __init__(self): * self.last = SDL_GetTicks() */ __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Clock, __pyx_n_s_Clock, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_pygame_time, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_1__init__, 0, __pyx_n_s_Clock___init, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_3tick, 0, __pyx_n_s_Clock_tick, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__16); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_tick, __pyx_t_4) < 0) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop, 0, __pyx_n_s_Clock_tick_busy_loop, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__16); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_tick_busy_loop, __pyx_t_4) < 0) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_7get_time, 0, __pyx_n_s_Clock_get_time, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_time, __pyx_t_4) < 0) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime, 0, __pyx_n_s_Clock_get_rawtime, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_rawtime, __pyx_t_4) < 0) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":114 * return self.raw_frametime * * @cython.cdivision(True) # <<<<<<<<<<<<<< * def get_fps(self): * cdef int total_time = sum(self.last_frames) */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_11get_fps, 0, __pyx_n_s_Clock_get_fps, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_fps, __pyx_t_4) < 0) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":80 * timer_by_event[eventid] = timer_id * * class Clock: # <<<<<<<<<<<<<< * def __init__(self): * self.last = SDL_GetTicks() */ __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Clock, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Clock, __pyx_t_4) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.pygame_time", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.pygame_time"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *result; PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); if (unlikely(!selfless_args)) return NULL; result = PyObject_Call(method, selfless_args, kwargs); Py_DECREF(selfless_args); return result; } static PyMethodDef __Pyx_UnboundCMethod_Def = { "CythonUnboundCMethod", __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), METH_VARARGS | METH_KEYWORDS, NULL }; static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #else if (likely(!__Pyx_CyOrPyCFunction_Check(method))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } else #endif #if CYTHON_COMPILING_IN_PYPY #else if (PyCFunction_Check(method)) #endif { PyObject *self; int self_found; #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY self = PyObject_GetAttrString(method, "__self__"); if (!self) { PyErr_Clear(); } #else self = PyCFunction_GET_SELF(method); #endif self_found = (self && self != Py_None); #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY Py_XDECREF(self); #endif if (self_found) { PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); if (unlikely(!unbound_method)) return -1; Py_DECREF(method); target->method = unbound_method; } } return 0; } /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { if (likely(cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); #endif } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } return __Pyx__CallUnboundCMethod1(cfunc, self, arg); } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(2, self, arg); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { if (likely(cfunc->func)) { PyObject *args[2] = {arg1, arg2}; if (cfunc->flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } #if PY_VERSION_HEX >= 0x030700A0 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); } #endif static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(3); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg1); PyTuple_SET_ITEM(args, 1, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 2, arg2); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(3, self, arg1, arg2); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* dict_getitem_default */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); if ((1)); #else if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; } Py_INCREF(value); } #endif else { if (default_value == Py_None) value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); else value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* pop_index */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { PyObject *r; if (unlikely(!py_ix)) return NULL; r = __Pyx__PyObject_PopIndex(L, py_ix); Py_DECREF(py_ix); return r; } static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); } #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { Py_ssize_t size = PyList_GET_SIZE(L); if (likely(size > (((PyListObject*)L)->allocated >> 1))) { Py_ssize_t cix = ix; if (cix < 0) { cix += size; } if (likely(__Pyx_is_valid_index(cix, size))) { PyObject* v = PyList_GET_ITEM(L, cix); __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); size -= 1; memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); return v; } } if (py_ix == Py_None) { return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); } else { return __Pyx__PyObject_PopIndex(L, py_ix); } } #endif /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 1; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a == b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) == 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 0; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 0; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal == 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a == (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_EQ)); } /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); #ifdef HAVE_LONG_LONG if (sizeof(PY_LONG_LONG) > sizeof(long)) { PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; return (result >= LONG_MIN && result <= LONG_MAX) ? PyInt_FromLong((long)result) : PyLong_FromLongLong(result); } #endif #if CYTHON_USE_TYPE_SLOTS return PyInt_Type.tp_as_number->nb_multiply(op1, op2); #else return PyNumber_Multiply(op1, op2); #endif } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } } CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); #ifdef HAVE_LONG_LONG lla = a; goto long_long; #else return PyLong_Type.tp_as_number->nb_multiply(op1, op2); #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla * llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("multiply", return NULL) result = ((double)a) * (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #endif /* PyFloatBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) { const double a = floatval; double b, result; CYTHON_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); if (likely(PyFloat_CheckExact(op2))) { #if CYTHON_COMPILING_IN_LIMITED_API b = __pyx_PyFloat_AsDouble(op2); #else b = PyFloat_AS_DOUBLE(op2); #endif if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;} } else #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { b = (double) PyInt_AS_LONG(op2); if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;} } else #endif if (likely(PyLong_CheckExact(op2))) { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsZero(op2)) { b = 0.0; if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;} } else if (__Pyx_PyLong_IsCompact(op2)) { b = (double) __Pyx_PyLong_CompactValue(op2); } else { const digit* digits = __Pyx_PyLong_Digits(op2); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2); switch (size) { case -2: case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -2) b = -b; break; } } CYTHON_FALLTHROUGH; case -3: case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -3) b = -b; break; } } CYTHON_FALLTHROUGH; case -4: case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -4) b = -b; break; } } CYTHON_FALLTHROUGH; default: #endif b = PyLong_AsDouble(op2); if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL; #if !CYTHON_USE_PYLONG_INTERNALS if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;} #endif #if CYTHON_USE_PYLONG_INTERNALS } } #endif } else { return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); } PyFPE_START_PROTECT("divide", return NULL) result = a / b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s_; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint32_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint32_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__23); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709470.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.rect.c0000664000175000017500000317147514760217136017774 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__rect #define __PYX_HAVE_API__pygame_sdl2__rect /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/rect.pyx", "src/pygame_sdl2/rect.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* pybytes_as_double.proto */ static double __Pyx_SlowPyString_AsDouble(PyObject *obj); static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length); static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) { char* as_c_string; Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS as_c_string = PyBytes_AS_STRING(obj); size = PyBytes_GET_SIZE(obj); #else if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) { return (double)-1; } #endif return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); } static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) { char* as_c_string; Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS as_c_string = PyByteArray_AS_STRING(obj); size = PyByteArray_GET_SIZE(obj); #else as_c_string = PyByteArray_AsString(obj); if (as_c_string == NULL) { return (double)-1; } size = PyByteArray_Size(obj); #endif return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); } /* pyunicode_as_double.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) { int last_was_punctuation; Py_ssize_t i; last_was_punctuation = 1; for (i=start; i <= end; i++) { Py_UCS4 chr = PyUnicode_READ(kind, data, i); int is_punctuation = (chr == '_') | (chr == '.'); *buffer = (char)chr; buffer += (chr != '_'); if (unlikely(chr > 127)) goto parse_failure; if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure; last_was_punctuation = is_punctuation; } if (unlikely(last_was_punctuation)) goto parse_failure; *buffer = '\0'; return buffer; parse_failure: return NULL; } static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) { int matches = 1; Py_UCS4 chr; Py_UCS4 sign = PyUnicode_READ(kind, data, start); int is_signed = (sign == '-') | (sign == '+'); start += is_signed; length -= is_signed; switch (PyUnicode_READ(kind, data, start)) { #ifdef Py_NAN case 'n': case 'N': if (unlikely(length != 3)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+1); matches &= (chr == 'a') | (chr == 'A'); chr = PyUnicode_READ(kind, data, start+2); matches &= (chr == 'n') | (chr == 'N'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_NAN : Py_NAN; #endif case 'i': case 'I': if (unlikely(length < 3)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+1); matches &= (chr == 'n') | (chr == 'N'); chr = PyUnicode_READ(kind, data, start+2); matches &= (chr == 'f') | (chr == 'F'); if (likely(length == 3 && matches)) return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; if (unlikely(length != 8)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+3); matches &= (chr == 'i') | (chr == 'I'); chr = PyUnicode_READ(kind, data, start+4); matches &= (chr == 'n') | (chr == 'N'); chr = PyUnicode_READ(kind, data, start+5); matches &= (chr == 'i') | (chr == 'I'); chr = PyUnicode_READ(kind, data, start+6); matches &= (chr == 't') | (chr == 'T'); chr = PyUnicode_READ(kind, data, start+7); matches &= (chr == 'y') | (chr == 'Y'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: goto parse_failure; } return 0.0; parse_failure: return -1.0; } static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) { double value; const char *last; char *end; Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj); const int kind = PyUnicode_KIND(obj); const void* data = PyUnicode_DATA(obj); start = 0; while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start))) start++; while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1))) length--; length -= start; if (unlikely(length <= 0)) goto fallback; value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length); if (unlikely(value == -1.0)) goto fallback; if (value != 0.0) return value; if (length < 40) { char number[40]; last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); if (unlikely(!last)) goto fallback; value = PyOS_string_to_double(number, &end, NULL); } else { char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char)); if (unlikely(!number)) goto fallback; last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); if (unlikely(!last)) { PyMem_Free(number); goto fallback; } value = PyOS_string_to_double(number, &end, NULL); PyMem_Free(number); } if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { return value; } fallback: return __Pyx_SlowPyString_AsDouble(obj); } #endif static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) { #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS if (unlikely(__Pyx_PyUnicode_READY(obj) == -1)) return (double)-1; if (likely(PyUnicode_IS_ASCII(obj))) { const char *s; Py_ssize_t length; s = PyUnicode_AsUTF8AndSize(obj, &length); return __Pyx__PyBytes_AsDouble(obj, s, length); } return __Pyx_PyUnicode_AsDouble_WithSpaces(obj); #else return __Pyx_SlowPyString_AsDouble(obj); #endif } /* pynumber_float.proto */ static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj); #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x)) /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ (likely(is_tuple || PyTuple_Check(tuple)) ?\ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.rect" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.rect" extern int __pyx_module_is_main_pygame_sdl2__rect; int __pyx_module_is_main_pygame_sdl2__rect = 0; /* Implementation of "pygame_sdl2.rect" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_range; /* #### Code section: string_decls ### */ static const char __pyx_k_c[] = "c"; static const char __pyx_k_d[] = "d"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__3[] = "*"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k__47[] = "?"; static const char __pyx_k_fit[] = "fit"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_ret[] = "ret"; static const char __pyx_k_top[] = "top"; static const char __pyx_k_val[] = "val"; static const char __pyx_k_zip[] = "zip"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_clip[] = "clip"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_left[] = "left"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_move[] = "move"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_clamp[] = "clamp"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_other[] = "other"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_right[] = "right"; static const char __pyx_k_union[] = "union"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_bottom[] = "bottom"; static const char __pyx_k_center[] = "center"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_factor[] = "factor"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_height[] = "height"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_centerx[] = "centerx"; static const char __pyx_k_centery[] = "centery"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_flatten[] = "flatten"; static const char __pyx_k_h_ratio[] = "h_ratio"; static const char __pyx_k_inflate[] = "inflate"; static const char __pyx_k_move_ip[] = "move_ip"; static const char __pyx_k_topleft[] = "topleft"; static const char __pyx_k_w_ratio[] = "w_ratio"; static const char __pyx_k_Rect_fit[] = "Rect.fit"; static const char __pyx_k_clamp_ip[] = "clamp_ip"; static const char __pyx_k_contains[] = "contains"; static const char __pyx_k_union_ip[] = "union_ip"; static const char __pyx_k_unionall[] = "unionall"; static const char __pyx_k_Rect_clip[] = "Rect.clip"; static const char __pyx_k_Rect_copy[] = "Rect.copy"; static const char __pyx_k_Rect_move[] = "Rect.move"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_normalize[] = "normalize"; static const char __pyx_k_other_seq[] = "other_seq"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_Rect_clamp[] = "Rect.clamp"; static const char __pyx_k_Rect_union[] = "Rect.union"; static const char __pyx_k_inflate_ip[] = "inflate_ip"; static const char __pyx_k_other_dict[] = "other_dict"; static const char __pyx_k_other_list[] = "other_list"; static const char __pyx_k_collections[] = "collections"; static const char __pyx_k_collidedict[] = "collidedict"; static const char __pyx_k_collidelist[] = "collidelist"; static const char __pyx_k_colliderect[] = "colliderect"; static const char __pyx_k_unionall_ip[] = "unionall_ip"; static const char __pyx_k_Rect_inflate[] = "Rect.inflate"; static const char __pyx_k_Rect_move_ip[] = "Rect.move_ip"; static const char __pyx_k_collidepoint[] = "collidepoint"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_rect_d_d_d_d[] = ""; static const char __pyx_k_rects_values[] = "rects_values"; static const char __pyx_k_Rect___reduce[] = "Rect.__reduce__"; static const char __pyx_k_Rect_clamp_ip[] = "Rect.clamp_ip"; static const char __pyx_k_Rect_contains[] = "Rect.contains"; static const char __pyx_k_Rect_union_ip[] = "Rect.union_ip"; static const char __pyx_k_Rect_unionall[] = "Rect.unionall"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_Rect_normalize[] = "Rect.normalize"; static const char __pyx_k_collidedictall[] = "collidedictall"; static const char __pyx_k_collidelistall[] = "collidelistall"; static const char __pyx_k_Rect_inflate_ip[] = "Rect.inflate_ip"; static const char __pyx_k_Rect_collidedict[] = "Rect.collidedict"; static const char __pyx_k_Rect_collidelist[] = "Rect.collidelist"; static const char __pyx_k_Rect_colliderect[] = "Rect.colliderect"; static const char __pyx_k_Rect_unionall_ip[] = "Rect.unionall_ip"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_Rect_collidepoint[] = "Rect.collidepoint"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Rect_collidedictall[] = "Rect.collidedictall"; static const char __pyx_k_Rect_collidelistall[] = "Rect.collidelistall"; static const char __pyx_k_src_pygame_sdl2_rect_pyx[] = "src/pygame_sdl2/rect.pyx"; static const char __pyx_k_Argument_must_be_a_rect_style_ob[] = "Argument must be a rect style object."; static const char __pyx_k_Argument_must_be_a_rect_style_ob_2[] = "Argument {} must be a rect style object."; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_flatten(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static Py_ssize_t __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10__richcmp__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_14__setitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4left_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_3top_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5width_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6height_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5right_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4size_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6center_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_18move(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_30clip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_32union(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_38unionall_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_46collidepoint(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_54collidedict(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_56collidedictall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1x_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1y_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1w_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1h_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_4rect_Rect(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_4rect_Rect; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect; PyObject *__pyx_kp_s_Argument_must_be_a_rect_style_ob; PyObject *__pyx_kp_s_Argument_must_be_a_rect_style_ob_2; PyObject *__pyx_n_s_IndexError; PyObject *__pyx_n_s_Rect; PyObject *__pyx_n_s_Rect___reduce; PyObject *__pyx_n_s_Rect_clamp; PyObject *__pyx_n_s_Rect_clamp_ip; PyObject *__pyx_n_s_Rect_clip; PyObject *__pyx_n_s_Rect_collidedict; PyObject *__pyx_n_s_Rect_collidedictall; PyObject *__pyx_n_s_Rect_collidelist; PyObject *__pyx_n_s_Rect_collidelistall; PyObject *__pyx_n_s_Rect_collidepoint; PyObject *__pyx_n_s_Rect_colliderect; PyObject *__pyx_n_s_Rect_contains; PyObject *__pyx_n_s_Rect_copy; PyObject *__pyx_n_s_Rect_fit; PyObject *__pyx_n_s_Rect_inflate; PyObject *__pyx_n_s_Rect_inflate_ip; PyObject *__pyx_n_s_Rect_move; PyObject *__pyx_n_s_Rect_move_ip; PyObject *__pyx_n_s_Rect_normalize; PyObject *__pyx_n_s_Rect_union; PyObject *__pyx_n_s_Rect_union_ip; PyObject *__pyx_n_s_Rect_unionall; PyObject *__pyx_n_s_Rect_unionall_ip; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s__3; PyObject *__pyx_n_s__47; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_bottom; PyObject *__pyx_n_s_c; PyObject *__pyx_n_s_center; PyObject *__pyx_n_s_centerx; PyObject *__pyx_n_s_centery; PyObject *__pyx_n_s_clamp; PyObject *__pyx_n_s_clamp_ip; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_clip; PyObject *__pyx_n_s_collections; PyObject *__pyx_n_s_collidedict; PyObject *__pyx_n_s_collidedictall; PyObject *__pyx_n_s_collidelist; PyObject *__pyx_n_s_collidelistall; PyObject *__pyx_n_s_collidepoint; PyObject *__pyx_n_s_colliderect; PyObject *__pyx_n_s_contains; PyObject *__pyx_n_s_copy; PyObject *__pyx_n_s_d; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_factor; PyObject *__pyx_n_s_fit; PyObject *__pyx_n_s_flatten; PyObject *__pyx_n_s_format; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_h_ratio; PyObject *__pyx_n_s_height; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_inflate; PyObject *__pyx_n_s_inflate_ip; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_items; PyObject *__pyx_n_s_key; PyObject *__pyx_n_s_left; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_move; PyObject *__pyx_n_s_move_ip; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_normalize; PyObject *__pyx_n_s_other; PyObject *__pyx_n_s_other_dict; PyObject *__pyx_n_s_other_list; PyObject *__pyx_n_s_other_seq; PyObject *__pyx_n_s_pygame_sdl2_rect; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_range; PyObject *__pyx_kp_s_rect_d_d_d_d; PyObject *__pyx_n_s_rects_values; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_ret; PyObject *__pyx_n_s_right; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_rect_pyx; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_top; PyObject *__pyx_n_s_topleft; PyObject *__pyx_n_s_union; PyObject *__pyx_n_s_union_ip; PyObject *__pyx_n_s_unionall; PyObject *__pyx_n_s_unionall_ip; PyObject *__pyx_n_s_val; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_w_ratio; PyObject *__pyx_n_s_width; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_y; PyObject *__pyx_n_s_zip; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_2; PyObject *__pyx_int_3; PyObject *__pyx_int_neg_1; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__26; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__34; PyObject *__pyx_tuple__36; PyObject *__pyx_tuple__38; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__42; PyObject *__pyx_tuple__44; PyObject *__pyx_tuple__45; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__31; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__37; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__43; PyObject *__pyx_codeobj__46; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_4rect_Rect); Py_CLEAR(clear_module_state->__pyx_kp_s_Argument_must_be_a_rect_style_ob); Py_CLEAR(clear_module_state->__pyx_kp_s_Argument_must_be_a_rect_style_ob_2); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); Py_CLEAR(clear_module_state->__pyx_n_s_Rect); Py_CLEAR(clear_module_state->__pyx_n_s_Rect___reduce); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_clamp); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_clamp_ip); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_clip); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_collidedict); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_collidedictall); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_collidelist); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_collidelistall); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_collidepoint); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_colliderect); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_contains); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_copy); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_fit); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_inflate); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_inflate_ip); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_move); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_move_ip); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_normalize); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_union); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_union_ip); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_unionall); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_unionall_ip); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s__3); Py_CLEAR(clear_module_state->__pyx_n_s__47); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_bottom); Py_CLEAR(clear_module_state->__pyx_n_s_c); Py_CLEAR(clear_module_state->__pyx_n_s_center); Py_CLEAR(clear_module_state->__pyx_n_s_centerx); Py_CLEAR(clear_module_state->__pyx_n_s_centery); Py_CLEAR(clear_module_state->__pyx_n_s_clamp); Py_CLEAR(clear_module_state->__pyx_n_s_clamp_ip); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_clip); Py_CLEAR(clear_module_state->__pyx_n_s_collections); Py_CLEAR(clear_module_state->__pyx_n_s_collidedict); Py_CLEAR(clear_module_state->__pyx_n_s_collidedictall); Py_CLEAR(clear_module_state->__pyx_n_s_collidelist); Py_CLEAR(clear_module_state->__pyx_n_s_collidelistall); Py_CLEAR(clear_module_state->__pyx_n_s_collidepoint); Py_CLEAR(clear_module_state->__pyx_n_s_colliderect); Py_CLEAR(clear_module_state->__pyx_n_s_contains); Py_CLEAR(clear_module_state->__pyx_n_s_copy); Py_CLEAR(clear_module_state->__pyx_n_s_d); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_factor); Py_CLEAR(clear_module_state->__pyx_n_s_fit); Py_CLEAR(clear_module_state->__pyx_n_s_flatten); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_h_ratio); Py_CLEAR(clear_module_state->__pyx_n_s_height); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_inflate); Py_CLEAR(clear_module_state->__pyx_n_s_inflate_ip); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_items); Py_CLEAR(clear_module_state->__pyx_n_s_key); Py_CLEAR(clear_module_state->__pyx_n_s_left); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_move); Py_CLEAR(clear_module_state->__pyx_n_s_move_ip); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_normalize); Py_CLEAR(clear_module_state->__pyx_n_s_other); Py_CLEAR(clear_module_state->__pyx_n_s_other_dict); Py_CLEAR(clear_module_state->__pyx_n_s_other_list); Py_CLEAR(clear_module_state->__pyx_n_s_other_seq); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rect); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_kp_s_rect_d_d_d_d); Py_CLEAR(clear_module_state->__pyx_n_s_rects_values); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_ret); Py_CLEAR(clear_module_state->__pyx_n_s_right); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_rect_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_top); Py_CLEAR(clear_module_state->__pyx_n_s_topleft); Py_CLEAR(clear_module_state->__pyx_n_s_union); Py_CLEAR(clear_module_state->__pyx_n_s_union_ip); Py_CLEAR(clear_module_state->__pyx_n_s_unionall); Py_CLEAR(clear_module_state->__pyx_n_s_unionall_ip); Py_CLEAR(clear_module_state->__pyx_n_s_val); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_w_ratio); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_n_s_zip); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_3); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__26); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__34); Py_CLEAR(clear_module_state->__pyx_tuple__36); Py_CLEAR(clear_module_state->__pyx_tuple__38); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__42); Py_CLEAR(clear_module_state->__pyx_tuple__44); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__31); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__37); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__43); Py_CLEAR(clear_module_state->__pyx_codeobj__46); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_4rect_Rect); Py_VISIT(traverse_module_state->__pyx_kp_s_Argument_must_be_a_rect_style_ob); Py_VISIT(traverse_module_state->__pyx_kp_s_Argument_must_be_a_rect_style_ob_2); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); Py_VISIT(traverse_module_state->__pyx_n_s_Rect); Py_VISIT(traverse_module_state->__pyx_n_s_Rect___reduce); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_clamp); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_clamp_ip); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_clip); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_collidedict); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_collidedictall); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_collidelist); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_collidelistall); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_collidepoint); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_colliderect); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_contains); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_copy); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_fit); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_inflate); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_inflate_ip); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_move); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_move_ip); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_normalize); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_union); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_union_ip); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_unionall); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_unionall_ip); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s__3); Py_VISIT(traverse_module_state->__pyx_n_s__47); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_bottom); Py_VISIT(traverse_module_state->__pyx_n_s_c); Py_VISIT(traverse_module_state->__pyx_n_s_center); Py_VISIT(traverse_module_state->__pyx_n_s_centerx); Py_VISIT(traverse_module_state->__pyx_n_s_centery); Py_VISIT(traverse_module_state->__pyx_n_s_clamp); Py_VISIT(traverse_module_state->__pyx_n_s_clamp_ip); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_clip); Py_VISIT(traverse_module_state->__pyx_n_s_collections); Py_VISIT(traverse_module_state->__pyx_n_s_collidedict); Py_VISIT(traverse_module_state->__pyx_n_s_collidedictall); Py_VISIT(traverse_module_state->__pyx_n_s_collidelist); Py_VISIT(traverse_module_state->__pyx_n_s_collidelistall); Py_VISIT(traverse_module_state->__pyx_n_s_collidepoint); Py_VISIT(traverse_module_state->__pyx_n_s_colliderect); Py_VISIT(traverse_module_state->__pyx_n_s_contains); Py_VISIT(traverse_module_state->__pyx_n_s_copy); Py_VISIT(traverse_module_state->__pyx_n_s_d); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_factor); Py_VISIT(traverse_module_state->__pyx_n_s_fit); Py_VISIT(traverse_module_state->__pyx_n_s_flatten); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_h_ratio); Py_VISIT(traverse_module_state->__pyx_n_s_height); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_inflate); Py_VISIT(traverse_module_state->__pyx_n_s_inflate_ip); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_items); Py_VISIT(traverse_module_state->__pyx_n_s_key); Py_VISIT(traverse_module_state->__pyx_n_s_left); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_move); Py_VISIT(traverse_module_state->__pyx_n_s_move_ip); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_normalize); Py_VISIT(traverse_module_state->__pyx_n_s_other); Py_VISIT(traverse_module_state->__pyx_n_s_other_dict); Py_VISIT(traverse_module_state->__pyx_n_s_other_list); Py_VISIT(traverse_module_state->__pyx_n_s_other_seq); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rect); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_kp_s_rect_d_d_d_d); Py_VISIT(traverse_module_state->__pyx_n_s_rects_values); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_ret); Py_VISIT(traverse_module_state->__pyx_n_s_right); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_rect_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_top); Py_VISIT(traverse_module_state->__pyx_n_s_topleft); Py_VISIT(traverse_module_state->__pyx_n_s_union); Py_VISIT(traverse_module_state->__pyx_n_s_union_ip); Py_VISIT(traverse_module_state->__pyx_n_s_unionall); Py_VISIT(traverse_module_state->__pyx_n_s_unionall_ip); Py_VISIT(traverse_module_state->__pyx_n_s_val); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_w_ratio); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_n_s_zip); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_3); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__26); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__34); Py_VISIT(traverse_module_state->__pyx_tuple__36); Py_VISIT(traverse_module_state->__pyx_tuple__38); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__42); Py_VISIT(traverse_module_state->__pyx_tuple__44); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__31); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__37); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__43); Py_VISIT(traverse_module_state->__pyx_codeobj__46); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_4rect_Rect __pyx_mstate_global->__pyx_type_11pygame_sdl2_4rect_Rect #endif #define __pyx_ptype_11pygame_sdl2_4rect_Rect __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_4rect_Rect #define __pyx_kp_s_Argument_must_be_a_rect_style_ob __pyx_mstate_global->__pyx_kp_s_Argument_must_be_a_rect_style_ob #define __pyx_kp_s_Argument_must_be_a_rect_style_ob_2 __pyx_mstate_global->__pyx_kp_s_Argument_must_be_a_rect_style_ob_2 #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError #define __pyx_n_s_Rect __pyx_mstate_global->__pyx_n_s_Rect #define __pyx_n_s_Rect___reduce __pyx_mstate_global->__pyx_n_s_Rect___reduce #define __pyx_n_s_Rect_clamp __pyx_mstate_global->__pyx_n_s_Rect_clamp #define __pyx_n_s_Rect_clamp_ip __pyx_mstate_global->__pyx_n_s_Rect_clamp_ip #define __pyx_n_s_Rect_clip __pyx_mstate_global->__pyx_n_s_Rect_clip #define __pyx_n_s_Rect_collidedict __pyx_mstate_global->__pyx_n_s_Rect_collidedict #define __pyx_n_s_Rect_collidedictall __pyx_mstate_global->__pyx_n_s_Rect_collidedictall #define __pyx_n_s_Rect_collidelist __pyx_mstate_global->__pyx_n_s_Rect_collidelist #define __pyx_n_s_Rect_collidelistall __pyx_mstate_global->__pyx_n_s_Rect_collidelistall #define __pyx_n_s_Rect_collidepoint __pyx_mstate_global->__pyx_n_s_Rect_collidepoint #define __pyx_n_s_Rect_colliderect __pyx_mstate_global->__pyx_n_s_Rect_colliderect #define __pyx_n_s_Rect_contains __pyx_mstate_global->__pyx_n_s_Rect_contains #define __pyx_n_s_Rect_copy __pyx_mstate_global->__pyx_n_s_Rect_copy #define __pyx_n_s_Rect_fit __pyx_mstate_global->__pyx_n_s_Rect_fit #define __pyx_n_s_Rect_inflate __pyx_mstate_global->__pyx_n_s_Rect_inflate #define __pyx_n_s_Rect_inflate_ip __pyx_mstate_global->__pyx_n_s_Rect_inflate_ip #define __pyx_n_s_Rect_move __pyx_mstate_global->__pyx_n_s_Rect_move #define __pyx_n_s_Rect_move_ip __pyx_mstate_global->__pyx_n_s_Rect_move_ip #define __pyx_n_s_Rect_normalize __pyx_mstate_global->__pyx_n_s_Rect_normalize #define __pyx_n_s_Rect_union __pyx_mstate_global->__pyx_n_s_Rect_union #define __pyx_n_s_Rect_union_ip __pyx_mstate_global->__pyx_n_s_Rect_union_ip #define __pyx_n_s_Rect_unionall __pyx_mstate_global->__pyx_n_s_Rect_unionall #define __pyx_n_s_Rect_unionall_ip __pyx_mstate_global->__pyx_n_s_Rect_unionall_ip #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3 #define __pyx_n_s__47 __pyx_mstate_global->__pyx_n_s__47 #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_bottom __pyx_mstate_global->__pyx_n_s_bottom #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c #define __pyx_n_s_center __pyx_mstate_global->__pyx_n_s_center #define __pyx_n_s_centerx __pyx_mstate_global->__pyx_n_s_centerx #define __pyx_n_s_centery __pyx_mstate_global->__pyx_n_s_centery #define __pyx_n_s_clamp __pyx_mstate_global->__pyx_n_s_clamp #define __pyx_n_s_clamp_ip __pyx_mstate_global->__pyx_n_s_clamp_ip #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_clip __pyx_mstate_global->__pyx_n_s_clip #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections #define __pyx_n_s_collidedict __pyx_mstate_global->__pyx_n_s_collidedict #define __pyx_n_s_collidedictall __pyx_mstate_global->__pyx_n_s_collidedictall #define __pyx_n_s_collidelist __pyx_mstate_global->__pyx_n_s_collidelist #define __pyx_n_s_collidelistall __pyx_mstate_global->__pyx_n_s_collidelistall #define __pyx_n_s_collidepoint __pyx_mstate_global->__pyx_n_s_collidepoint #define __pyx_n_s_colliderect __pyx_mstate_global->__pyx_n_s_colliderect #define __pyx_n_s_contains __pyx_mstate_global->__pyx_n_s_contains #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy #define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_factor __pyx_mstate_global->__pyx_n_s_factor #define __pyx_n_s_fit __pyx_mstate_global->__pyx_n_s_fit #define __pyx_n_s_flatten __pyx_mstate_global->__pyx_n_s_flatten #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_h_ratio __pyx_mstate_global->__pyx_n_s_h_ratio #define __pyx_n_s_height __pyx_mstate_global->__pyx_n_s_height #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_inflate __pyx_mstate_global->__pyx_n_s_inflate #define __pyx_n_s_inflate_ip __pyx_mstate_global->__pyx_n_s_inflate_ip #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items #define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key #define __pyx_n_s_left __pyx_mstate_global->__pyx_n_s_left #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_move __pyx_mstate_global->__pyx_n_s_move #define __pyx_n_s_move_ip __pyx_mstate_global->__pyx_n_s_move_ip #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_normalize __pyx_mstate_global->__pyx_n_s_normalize #define __pyx_n_s_other __pyx_mstate_global->__pyx_n_s_other #define __pyx_n_s_other_dict __pyx_mstate_global->__pyx_n_s_other_dict #define __pyx_n_s_other_list __pyx_mstate_global->__pyx_n_s_other_list #define __pyx_n_s_other_seq __pyx_mstate_global->__pyx_n_s_other_seq #define __pyx_n_s_pygame_sdl2_rect __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rect #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_kp_s_rect_d_d_d_d __pyx_mstate_global->__pyx_kp_s_rect_d_d_d_d #define __pyx_n_s_rects_values __pyx_mstate_global->__pyx_n_s_rects_values #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_ret __pyx_mstate_global->__pyx_n_s_ret #define __pyx_n_s_right __pyx_mstate_global->__pyx_n_s_right #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_rect_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_rect_pyx #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_top __pyx_mstate_global->__pyx_n_s_top #define __pyx_n_s_topleft __pyx_mstate_global->__pyx_n_s_topleft #define __pyx_n_s_union __pyx_mstate_global->__pyx_n_s_union #define __pyx_n_s_union_ip __pyx_mstate_global->__pyx_n_s_union_ip #define __pyx_n_s_unionall __pyx_mstate_global->__pyx_n_s_unionall #define __pyx_n_s_unionall_ip __pyx_mstate_global->__pyx_n_s_unionall_ip #define __pyx_n_s_val __pyx_mstate_global->__pyx_n_s_val #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_w_ratio __pyx_mstate_global->__pyx_n_s_w_ratio #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 #define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 /* #### Code section: module_code ### */ /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_1flatten(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_flatten, "flatten(*args)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_1flatten = {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_1flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_flatten}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_1flatten(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flatten (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "flatten", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_flatten(__pyx_self, __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_flatten(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flatten", 1); /* "pygame_sdl2/rect.pyx":23 * * def flatten(*args): * if len(args) == 1: # <<<<<<<<<<<<<< * return args[0] * else: */ __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 23, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":24 * def flatten(*args): * if len(args) == 1: * return args[0] # <<<<<<<<<<<<<< * else: * return args */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":23 * * def flatten(*args): * if len(args) == 1: # <<<<<<<<<<<<<< * return args[0] * else: */ } /* "pygame_sdl2/rect.pyx":26 * return args[0] * else: * return args # <<<<<<<<<<<<<< * * cdef class Rect: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_args); __pyx_r = __pyx_v_args; goto __pyx_L0; } /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":30 * cdef class Rect: * * def __init__(self, *args): # <<<<<<<<<<<<<< * * cdef int x, y, w, h */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { int __pyx_v_x; int __pyx_v_y; int __pyx_v_w; int __pyx_v_h; int __pyx_v_len_args; struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_rect = 0; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_t_12; int __pyx_t_13; int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/rect.pyx":36 * cdef Rect rect * * len_args = len(args) # <<<<<<<<<<<<<< * * if len_args == 1 and isinstance(args[0], Rect): */ __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 36, __pyx_L1_error) __pyx_v_len_args = __pyx_t_1; /* "pygame_sdl2/rect.pyx":38 * len_args = len(args) * * if len_args == 1 and isinstance(args[0], Rect): # <<<<<<<<<<<<<< * rect = args[0] * x = rect.x */ __pyx_t_3 = (__pyx_v_len_args == 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_4, __pyx_ptype_11pygame_sdl2_4rect_Rect); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":39 * * if len_args == 1 and isinstance(args[0], Rect): * rect = args[0] # <<<<<<<<<<<<<< * x = rect.x * y = rect.y */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11pygame_sdl2_4rect_Rect))))) __PYX_ERR(0, 39, __pyx_L1_error) __pyx_v_rect = ((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":40 * if len_args == 1 and isinstance(args[0], Rect): * rect = args[0] * x = rect.x # <<<<<<<<<<<<<< * y = rect.y * w = rect.w */ __pyx_t_5 = __pyx_v_rect->x; __pyx_v_x = __pyx_t_5; /* "pygame_sdl2/rect.pyx":41 * rect = args[0] * x = rect.x * y = rect.y # <<<<<<<<<<<<<< * w = rect.w * h = rect.h */ __pyx_t_5 = __pyx_v_rect->y; __pyx_v_y = __pyx_t_5; /* "pygame_sdl2/rect.pyx":42 * x = rect.x * y = rect.y * w = rect.w # <<<<<<<<<<<<<< * h = rect.h * */ __pyx_t_5 = __pyx_v_rect->w; __pyx_v_w = __pyx_t_5; /* "pygame_sdl2/rect.pyx":43 * y = rect.y * w = rect.w * h = rect.h # <<<<<<<<<<<<<< * * elif len_args == 1 and len(args[0]) == 4: */ __pyx_t_5 = __pyx_v_rect->h; __pyx_v_h = __pyx_t_5; /* "pygame_sdl2/rect.pyx":38 * len_args = len(args) * * if len_args == 1 and isinstance(args[0], Rect): # <<<<<<<<<<<<<< * rect = args[0] * x = rect.x */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":45 * h = rect.h * * elif len_args == 1 and len(args[0]) == 4: # <<<<<<<<<<<<<< * x, y, w, h = args[0] * */ __pyx_t_3 = (__pyx_v_len_args == 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__pyx_t_1 == 4); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":46 * * elif len_args == 1 and len(args[0]) == 4: * x, y, w, h = args[0] # <<<<<<<<<<<<<< * * elif len_args == 1 and len(args[0]) == 2: */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 46, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); __pyx_t_9 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 4) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 46, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_12; __pyx_v_w = __pyx_t_13; __pyx_v_h = __pyx_t_14; /* "pygame_sdl2/rect.pyx":45 * h = rect.h * * elif len_args == 1 and len(args[0]) == 4: # <<<<<<<<<<<<<< * x, y, w, h = args[0] * */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":48 * x, y, w, h = args[0] * * elif len_args == 1 and len(args[0]) == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w = 0 */ __pyx_t_3 = (__pyx_v_len_args == 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L10_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__pyx_t_1 == 2); __pyx_t_2 = __pyx_t_3; __pyx_L10_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":49 * * elif len_args == 1 and len(args[0]) == 2: * x, y = args[0] # <<<<<<<<<<<<<< * w = 0 * h = 0 */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 49, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_7), 2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 49, __pyx_L1_error) __pyx_L13_unpacking_done:; } __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) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_x = __pyx_t_14; __pyx_v_y = __pyx_t_13; /* "pygame_sdl2/rect.pyx":50 * elif len_args == 1 and len(args[0]) == 2: * x, y = args[0] * w = 0 # <<<<<<<<<<<<<< * h = 0 * */ __pyx_v_w = 0; /* "pygame_sdl2/rect.pyx":51 * x, y = args[0] * w = 0 * h = 0 # <<<<<<<<<<<<<< * * elif len_args == 2: */ __pyx_v_h = 0; /* "pygame_sdl2/rect.pyx":48 * x, y, w, h = args[0] * * elif len_args == 1 and len(args[0]) == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w = 0 */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":53 * h = 0 * * elif len_args == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w, h = args[1] */ __pyx_t_2 = (__pyx_v_len_args == 2); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":54 * * elif len_args == 2: * x, y = args[0] # <<<<<<<<<<<<<< * w, h = args[1] * */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 54, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_8 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_7), 2) < 0) __PYX_ERR(0, 54, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 54, __pyx_L1_error) __pyx_L15_unpacking_done:; } __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_x = __pyx_t_13; __pyx_v_y = __pyx_t_14; /* "pygame_sdl2/rect.pyx":55 * elif len_args == 2: * x, y = args[0] * w, h = args[1] # <<<<<<<<<<<<<< * * elif len_args == 4: */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 55, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_7), 2) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L17_unpacking_done; __pyx_L16_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 55, __pyx_L1_error) __pyx_L17_unpacking_done:; } __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) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_w = __pyx_t_14; __pyx_v_h = __pyx_t_13; /* "pygame_sdl2/rect.pyx":53 * h = 0 * * elif len_args == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w, h = args[1] */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":57 * w, h = args[1] * * elif len_args == 4: # <<<<<<<<<<<<<< * x, y, w, h = args * */ __pyx_t_2 = (__pyx_v_len_args == 4); if (likely(__pyx_t_2)) { /* "pygame_sdl2/rect.pyx":58 * * elif len_args == 4: * x, y, w, h = args # <<<<<<<<<<<<<< * * else: */ if (1) { PyObject* sequence = __pyx_v_args; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 58, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_8,&__pyx_t_9,&__pyx_t_7}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_x = __pyx_t_13; __pyx_v_y = __pyx_t_14; __pyx_v_w = __pyx_t_12; __pyx_v_h = __pyx_t_5; /* "pygame_sdl2/rect.pyx":57 * w, h = args[1] * * elif len_args == 4: # <<<<<<<<<<<<<< * x, y, w, h = args * */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":61 * * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< * * self.x = x */ /*else*/ { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(0, 61, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/rect.pyx":63 * raise TypeError("Argument must be a rect style object.") * * self.x = x # <<<<<<<<<<<<<< * self.y = y * self.w = w */ __pyx_v_self->x = __pyx_v_x; /* "pygame_sdl2/rect.pyx":64 * * self.x = x * self.y = y # <<<<<<<<<<<<<< * self.w = w * self.h = h */ __pyx_v_self->y = __pyx_v_y; /* "pygame_sdl2/rect.pyx":65 * self.x = x * self.y = y * self.w = w # <<<<<<<<<<<<<< * self.h = h * */ __pyx_v_self->w = __pyx_v_w; /* "pygame_sdl2/rect.pyx":66 * self.y = y * self.w = w * self.h = h # <<<<<<<<<<<<<< * * def __reduce__(self): */ __pyx_v_self->h = __pyx_v_h; /* "pygame_sdl2/rect.pyx":30 * cdef class Rect: * * def __init__(self, *args): # <<<<<<<<<<<<<< * * cdef int x, y, w, h */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rect); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":68 * self.h = h * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Rect, (self.x, self.y, self.w, self.h)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_2__reduce__, "Rect.__reduce__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_3__reduce__ = {"__reduce__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_2__reduce__}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 1); /* "pygame_sdl2/rect.pyx":69 * * def __reduce__(self): * return (Rect, (self.x, self.y, self.w, self.h)) # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect); __Pyx_GIVEREF((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect))) __PYX_ERR(0, 69, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":68 * self.h = h * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Rect, (self.x, self.y, self.w, self.h)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":71 * return (Rect, (self.x, self.y, self.w, self.h)) * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.x, self.y, self.w, self.h) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/rect.pyx":72 * * def __repr__(self): * return "" % (self.x, self.y, self.w, self.h) # <<<<<<<<<<<<<< * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_rect_d_d_d_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":71 * return (Rect, (self.x, self.y, self.w, self.h)) * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.x, self.y, self.w, self.h) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":74 * return "" % (self.x, self.y, self.w, self.h) * * def __len__(self): # <<<<<<<<<<<<<< * return 4 * */ /* Python wrapper */ static Py_ssize_t __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { Py_ssize_t __pyx_r; /* "pygame_sdl2/rect.pyx":75 * * def __len__(self): * return 4 # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_r = 4; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":74 * return "" % (self.x, self.y, self.w, self.h) * * def __len__(self): # <<<<<<<<<<<<<< * return 4 * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pyx":77 * return 4 * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.w, self.h)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 1); /* "pygame_sdl2/rect.pyx":78 * * def __iter__(self): * return iter((self.x, self.y, self.w, self.h)) # <<<<<<<<<<<<<< * * def __richcmp__(Rect a, b, int op): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":77 * return 4 * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.w, self.h)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":80 * return iter((self.x, self.y, self.w, self.h)) * * def __richcmp__(Rect a, b, int op): # <<<<<<<<<<<<<< * if not isinstance(b, Rect): * b = Rect(b) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10__richcmp__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_a), ((PyObject *)__pyx_v_b), ((int)__pyx_v_op)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10__richcmp__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 0); __Pyx_INCREF(__pyx_v_b); /* "pygame_sdl2/rect.pyx":81 * * def __richcmp__(Rect a, b, int op): * if not isinstance(b, Rect): # <<<<<<<<<<<<<< * b = Rect(b) * if op == 2: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":82 * def __richcmp__(Rect a, b, int op): * if not isinstance(b, Rect): * b = Rect(b) # <<<<<<<<<<<<<< * if op == 2: * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":81 * * def __richcmp__(Rect a, b, int op): * if not isinstance(b, Rect): # <<<<<<<<<<<<<< * b = Rect(b) * if op == 2: */ } /* "pygame_sdl2/rect.pyx":83 * if not isinstance(b, Rect): * b = Rect(b) * if op == 2: # <<<<<<<<<<<<<< * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * */ __pyx_t_2 = (__pyx_v_op == 2); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":84 * b = Rect(b) * if op == 2: * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_a->x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_a->y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_a->w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_a->h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_L5_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":83 * if not isinstance(b, Rect): * b = Rect(b) * if op == 2: # <<<<<<<<<<<<<< * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * */ } /* "pygame_sdl2/rect.pyx":80 * return iter((self.x, self.y, self.w, self.h)) * * def __richcmp__(Rect a, b, int op): # <<<<<<<<<<<<<< * if not isinstance(b, Rect): * b = Rect(b) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_b); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":86 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return (self.x, self.y, self.w, self.h)[key] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "pygame_sdl2/rect.pyx":87 * * def __getitem__(self, key): * return (self.x, self.y, self.w, self.h)[key] # <<<<<<<<<<<<<< * * def __setitem__(self, key, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":86 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return (self.x, self.y, self.w, self.h)[key] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":89 * return (self.x, self.y, self.w, self.h)[key] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if key == 0: * self.x = val */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_14__setitem__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_14__setitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); /* "pygame_sdl2/rect.pyx":90 * * def __setitem__(self, key, val): * if key == 0: # <<<<<<<<<<<<<< * self.x = val * elif key == 1: */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 90, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":91 * def __setitem__(self, key, val): * if key == 0: * self.x = val # <<<<<<<<<<<<<< * elif key == 1: * self.y = val */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error) __pyx_v_self->x = __pyx_t_2; /* "pygame_sdl2/rect.pyx":90 * * def __setitem__(self, key, val): * if key == 0: # <<<<<<<<<<<<<< * self.x = val * elif key == 1: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":92 * if key == 0: * self.x = val * elif key == 1: # <<<<<<<<<<<<<< * self.y = val * elif key == 2: */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 92, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":93 * self.x = val * elif key == 1: * self.y = val # <<<<<<<<<<<<<< * elif key == 2: * self.w = val */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) __pyx_v_self->y = __pyx_t_2; /* "pygame_sdl2/rect.pyx":92 * if key == 0: * self.x = val * elif key == 1: # <<<<<<<<<<<<<< * self.y = val * elif key == 2: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":94 * elif key == 1: * self.y = val * elif key == 2: # <<<<<<<<<<<<<< * self.w = val * elif key == 3: */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 94, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":95 * self.y = val * elif key == 2: * self.w = val # <<<<<<<<<<<<<< * elif key == 3: * self.h = val */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error) __pyx_v_self->w = __pyx_t_2; /* "pygame_sdl2/rect.pyx":94 * elif key == 1: * self.y = val * elif key == 2: # <<<<<<<<<<<<<< * self.w = val * elif key == 3: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":96 * elif key == 2: * self.w = val * elif key == 3: # <<<<<<<<<<<<<< * self.h = val * else: */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_3, 3, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 96, __pyx_L1_error) if (likely(__pyx_t_1)) { /* "pygame_sdl2/rect.pyx":97 * self.w = val * elif key == 3: * self.h = val # <<<<<<<<<<<<<< * else: * raise IndexError(key) */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error) __pyx_v_self->h = __pyx_t_2; /* "pygame_sdl2/rect.pyx":96 * elif key == 2: * self.w = val * elif key == 3: # <<<<<<<<<<<<<< * self.h = val * else: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":99 * self.h = val * else: * raise IndexError(key) # <<<<<<<<<<<<<< * * property left: */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 99, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/rect.pyx":89 * return (self.x, self.y, self.w, self.h)[key] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if key == 0: * self.x = val */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":102 * * property left: * def __get__(self): # <<<<<<<<<<<<<< * return self.x * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":103 * property left: * def __get__(self): * return self.x # <<<<<<<<<<<<<< * def __set__(self, val): * self.x = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":102 * * property left: * def __get__(self): # <<<<<<<<<<<<<< * return self.x * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.left.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":104 * def __get__(self): * return self.x * def __set__(self, val): # <<<<<<<<<<<<<< * self.x = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4left_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4left_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/rect.pyx":105 * return self.x * def __set__(self, val): * self.x = val # <<<<<<<<<<<<<< * * property top: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) __pyx_v_self->x = __pyx_t_1; /* "pygame_sdl2/rect.pyx":104 * def __get__(self): * return self.x * def __set__(self, val): # <<<<<<<<<<<<<< * self.x = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.left.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pyx":108 * * property top: * def __get__(self): # <<<<<<<<<<<<<< * return self.y * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":109 * property top: * def __get__(self): * return self.y # <<<<<<<<<<<<<< * def __set__(self, val): * self.y = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":108 * * property top: * def __get__(self): # <<<<<<<<<<<<<< * return self.y * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.top.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":110 * def __get__(self): * return self.y * def __set__(self, val): # <<<<<<<<<<<<<< * self.y = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_3top_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_3top_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/rect.pyx":111 * return self.y * def __set__(self, val): * self.y = val # <<<<<<<<<<<<<< * * property width: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_v_self->y = __pyx_t_1; /* "pygame_sdl2/rect.pyx":110 * def __get__(self): * return self.y * def __set__(self, val): # <<<<<<<<<<<<<< * self.y = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.top.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pyx":114 * * property width: * def __get__(self): # <<<<<<<<<<<<<< * return self.w * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":115 * property width: * def __get__(self): * return self.w # <<<<<<<<<<<<<< * def __set__(self, val): * self.w = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":114 * * property width: * def __get__(self): # <<<<<<<<<<<<<< * return self.w * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":116 * def __get__(self): * return self.w * def __set__(self, val): # <<<<<<<<<<<<<< * self.w = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5width_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5width_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/rect.pyx":117 * return self.w * def __set__(self, val): * self.w = val # <<<<<<<<<<<<<< * * property height: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error) __pyx_v_self->w = __pyx_t_1; /* "pygame_sdl2/rect.pyx":116 * def __get__(self): * return self.w * def __set__(self, val): # <<<<<<<<<<<<<< * self.w = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pyx":120 * * property height: * def __get__(self): # <<<<<<<<<<<<<< * return self.h * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":121 * property height: * def __get__(self): * return self.h # <<<<<<<<<<<<<< * def __set__(self, val): * self.h = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":120 * * property height: * def __get__(self): # <<<<<<<<<<<<<< * return self.h * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.height.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":122 * def __get__(self): * return self.h * def __set__(self, val): # <<<<<<<<<<<<<< * self.h = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6height_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6height_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/rect.pyx":123 * return self.h * def __set__(self, val): * self.h = val # <<<<<<<<<<<<<< * * property right: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error) __pyx_v_self->h = __pyx_t_1; /* "pygame_sdl2/rect.pyx":122 * def __get__(self): * return self.h * def __set__(self, val): # <<<<<<<<<<<<<< * self.h = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.height.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pyx":126 * * property right: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + self.width * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":127 * property right: * def __get__(self): * return self.x + self.width # <<<<<<<<<<<<<< * def __set__(self, val): * self.x += val - self.right */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":126 * * property right: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + self.width * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.right.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":128 * def __get__(self): * return self.x + self.width * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.right * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5right_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5right_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":129 * return self.x + self.width * def __set__(self, val): * self.x += val - self.right # <<<<<<<<<<<<<< * * property bottom: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->x = __pyx_t_4; /* "pygame_sdl2/rect.pyx":128 * def __get__(self): * return self.x + self.width * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.right * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.right.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":132 * * property bottom: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + self.height * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":133 * property bottom: * def __get__(self): * return self.y + self.height # <<<<<<<<<<<<<< * def __set__(self, val): * self.y += val - self.bottom */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_height); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":132 * * property bottom: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + self.height * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":134 * def __get__(self): * return self.y + self.height * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.bottom * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":135 * return self.y + self.height * def __set__(self, val): * self.y += val - self.bottom # <<<<<<<<<<<<<< * * property size: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->y = __pyx_t_4; /* "pygame_sdl2/rect.pyx":134 * def __get__(self): * return self.y + self.height * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.bottom * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":138 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return (self.w, self.h) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":139 * property size: * def __get__(self): * return (self.w, self.h) # <<<<<<<<<<<<<< * def __set__(self, val): * self.w, self.h = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":138 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return (self.w, self.h) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":140 * def __get__(self): * return (self.w, self.h) * def __set__(self, val): # <<<<<<<<<<<<<< * self.w, self.h = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4size_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4size_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":141 * return (self.w, self.h) * def __set__(self, val): * self.w, self.h = val # <<<<<<<<<<<<<< * * property topleft: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 141, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 141, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 141, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->w = __pyx_t_5; __pyx_v_self->h = __pyx_t_6; /* "pygame_sdl2/rect.pyx":140 * def __get__(self): * return (self.w, self.h) * def __set__(self, val): # <<<<<<<<<<<<<< * self.w, self.h = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":144 * * property topleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.top) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":145 * property topleft: * def __get__(self): * return (self.left, self.top) # <<<<<<<<<<<<<< * def __set__(self, val): * self.left, self.top = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":144 * * property topleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.top) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":146 * def __get__(self): * return (self.left, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.top = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":147 * return (self.left, self.top) * def __set__(self, val): * self.left, self.top = val # <<<<<<<<<<<<<< * * property topright: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 147, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 147, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":146 * def __get__(self): * return (self.left, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.top = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":150 * * property topright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.top) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":151 * property topright: * def __get__(self): * return (self.right, self.top) # <<<<<<<<<<<<<< * def __set__(self, val): * self.right, self.top = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":150 * * property topright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.top) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":152 * def __get__(self): * return (self.right, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.top = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":153 * return (self.right, self.top) * def __set__(self, val): * self.right, self.top = val # <<<<<<<<<<<<<< * * property bottomright: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 153, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 153, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":152 * def __get__(self): * return (self.right, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.top = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":156 * * property bottomright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.bottom) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":157 * property bottomright: * def __get__(self): * return (self.right, self.bottom) # <<<<<<<<<<<<<< * def __set__(self, val): * self.right, self.bottom = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":156 * * property bottomright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.bottom) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":158 * def __get__(self): * return (self.right, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.bottom = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":159 * return (self.right, self.bottom) * def __set__(self, val): * self.right, self.bottom = val # <<<<<<<<<<<<<< * * property bottomleft: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 159, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 159, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":158 * def __get__(self): * return (self.right, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.bottom = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":162 * * property bottomleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.bottom) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":163 * property bottomleft: * def __get__(self): * return (self.left, self.bottom) # <<<<<<<<<<<<<< * def __set__(self, val): * self.left, self.bottom = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":162 * * property bottomleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.bottom) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":164 * def __get__(self): * return (self.left, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.bottom = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":165 * return (self.left, self.bottom) * def __set__(self, val): * self.left, self.bottom = val # <<<<<<<<<<<<<< * * property centerx: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 165, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 165, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":164 * def __get__(self): * return (self.left, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.bottom = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":168 * * property centerx: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + (self.w / 2) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":169 * property centerx: * def __get__(self): * return self.x + (self.w / 2) # <<<<<<<<<<<<<< * def __set__(self, val): * self.x += val - self.centerx */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->x + (((double)__pyx_v_self->w) / 2.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":168 * * property centerx: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + (self.w / 2) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centerx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":170 * def __get__(self): * return self.x + (self.w / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.centerx * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":171 * return self.x + (self.w / 2) * def __set__(self, val): * self.x += val - self.centerx # <<<<<<<<<<<<<< * * property centery: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->x = __pyx_t_4; /* "pygame_sdl2/rect.pyx":170 * def __get__(self): * return self.x + (self.w / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.centerx * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centerx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":174 * * property centery: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + (self.h / 2) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":175 * property centery: * def __get__(self): * return self.y + (self.h / 2) # <<<<<<<<<<<<<< * def __set__(self, val): * self.y += val - self.centery */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->y + (((double)__pyx_v_self->h) / 2.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":174 * * property centery: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + (self.h / 2) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centery.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":176 * def __get__(self): * return self.y + (self.h / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.centery * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":177 * return self.y + (self.h / 2) * def __set__(self, val): * self.y += val - self.centery # <<<<<<<<<<<<<< * * property center: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->y = __pyx_t_4; /* "pygame_sdl2/rect.pyx":176 * def __get__(self): * return self.y + (self.h / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.centery * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centery.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":180 * * property center: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.centery) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":181 * property center: * def __get__(self): * return (self.centerx, self.centery) # <<<<<<<<<<<<<< * def __set__(self, val): * self.centerx, self.centery = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":180 * * property center: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.centery) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.center.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":182 * def __get__(self): * return (self.centerx, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.centery = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6center_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6center_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":183 * return (self.centerx, self.centery) * def __set__(self, val): * self.centerx, self.centery = val # <<<<<<<<<<<<<< * * property midtop: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 183, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 183, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 183, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":182 * def __get__(self): * return (self.centerx, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.centery = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.center.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":186 * * property midtop: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.top) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":187 * property midtop: * def __get__(self): * return (self.centerx, self.top) # <<<<<<<<<<<<<< * def __set__(self, val): * self.centerx, self.top = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":186 * * property midtop: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.top) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midtop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":188 * def __get__(self): * return (self.centerx, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.top = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":189 * return (self.centerx, self.top) * def __set__(self, val): * self.centerx, self.top = val # <<<<<<<<<<<<<< * * property midleft: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 189, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 189, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 189, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":188 * def __get__(self): * return (self.centerx, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.top = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midtop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":192 * * property midleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.centery) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":193 * property midleft: * def __get__(self): * return (self.left, self.centery) # <<<<<<<<<<<<<< * def __set__(self, val): * self.left, self.centery = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":192 * * property midleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.centery) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":194 * def __get__(self): * return (self.left, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.centery = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":195 * return (self.left, self.centery) * def __set__(self, val): * self.left, self.centery = val # <<<<<<<<<<<<<< * * property midbottom: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 195, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 195, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 195, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":194 * def __get__(self): * return (self.left, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.centery = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":198 * * property midbottom: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.bottom) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":199 * property midbottom: * def __get__(self): * return (self.centerx, self.bottom) # <<<<<<<<<<<<<< * def __set__(self, val): * self.centerx, self.bottom = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":198 * * property midbottom: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.bottom) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midbottom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":200 * def __get__(self): * return (self.centerx, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.bottom = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":201 * return (self.centerx, self.bottom) * def __set__(self, val): * self.centerx, self.bottom = val # <<<<<<<<<<<<<< * * property midright: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 201, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 201, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 201, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":200 * def __get__(self): * return (self.centerx, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.bottom = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midbottom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":204 * * property midright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.centery) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":205 * property midright: * def __get__(self): * return (self.right, self.centery) # <<<<<<<<<<<<<< * def __set__(self, val): * self.right, self.centery = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":204 * * property midright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.centery) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":206 * def __get__(self): * return (self.right, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.centery = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":207 * return (self.right, self.centery) * def __set__(self, val): * self.right, self.centery = val # <<<<<<<<<<<<<< * * def copy(self): */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 207, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 207, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 207, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":206 * def __get__(self): * return (self.right, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.centery = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":209 * self.right, self.centery = val * * def copy(self): # <<<<<<<<<<<<<< * return Rect(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_16copy, "Rect.copy(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_17copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_16copy}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); /* "pygame_sdl2/rect.pyx":210 * * def copy(self): * return Rect(self) # <<<<<<<<<<<<<< * * def move(self, *args): */ __Pyx_XDECREF(__pyx_r); __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) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":209 * self.right, self.centery = val * * def copy(self): # <<<<<<<<<<<<<< * return Rect(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":212 * return Rect(self) * * def move(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.move_ip(*args) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_19move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_18move, "Rect.move(self, *args)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_19move = {"move", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_19move, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_18move}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_19move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("move (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "move", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_18move(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_18move(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("move", 1); /* "pygame_sdl2/rect.pyx":213 * * def move(self, *args): * r = self.copy() # <<<<<<<<<<<<<< * r.move_ip(*args) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":214 * def move(self, *args): * r = self.copy() * r.move_ip(*args) # <<<<<<<<<<<<<< * return r * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_move_ip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":215 * r = self.copy() * r.move_ip(*args) * return r # <<<<<<<<<<<<<< * * def move_ip(self, *args): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":212 * return Rect(self) * * def move(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.move_ip(*args) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.move", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":217 * return r * * def move_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * self.x += x */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_20move_ip, "Rect.move_ip(self, *args)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_21move_ip = {"move_ip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_20move_ip}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("move_ip (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "move_ip", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("move_ip", 1); /* "pygame_sdl2/rect.pyx":218 * * def move_ip(self, *args): * x, y = flatten(args) # <<<<<<<<<<<<<< * self.x += x * self.y += y */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_args}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 218, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 218, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 218, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":219 * def move_ip(self, *args): * x, y = flatten(args) * self.x += x # <<<<<<<<<<<<<< * self.y += y * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->x = __pyx_t_4; /* "pygame_sdl2/rect.pyx":220 * x, y = flatten(args) * self.x += x * self.y += y # <<<<<<<<<<<<<< * * def inflate(self, *args): */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->y = __pyx_t_4; /* "pygame_sdl2/rect.pyx":217 * return r * * def move_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * self.x += x */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.move_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":222 * self.y += y * * def inflate(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.inflate_ip(*args) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_22inflate, "Rect.inflate(self, *args)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_23inflate = {"inflate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_22inflate}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("inflate (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "inflate", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("inflate", 1); /* "pygame_sdl2/rect.pyx":223 * * def inflate(self, *args): * r = self.copy() # <<<<<<<<<<<<<< * r.inflate_ip(*args) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":224 * def inflate(self, *args): * r = self.copy() * r.inflate_ip(*args) # <<<<<<<<<<<<<< * return r * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_inflate_ip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":225 * r = self.copy() * r.inflate_ip(*args) * return r # <<<<<<<<<<<<<< * * def inflate_ip(self, *args): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":222 * self.y += y * * def inflate(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.inflate_ip(*args) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.inflate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":227 * return r * * def inflate_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * c = self.center */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_24inflate_ip, "Rect.inflate_ip(self, *args)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_25inflate_ip = {"inflate_ip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_24inflate_ip}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("inflate_ip (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "inflate_ip", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("inflate_ip", 1); /* "pygame_sdl2/rect.pyx":228 * * def inflate_ip(self, *args): * x, y = flatten(args) # <<<<<<<<<<<<<< * c = self.center * self.w += x */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_args}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 228, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 228, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 228, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":229 * def inflate_ip(self, *args): * x, y = flatten(args) * c = self.center # <<<<<<<<<<<<<< * self.w += x * self.h += y */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":230 * x, y = flatten(args) * c = self.center * self.w += x # <<<<<<<<<<<<<< * self.h += y * self.center = c */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->w = __pyx_t_4; /* "pygame_sdl2/rect.pyx":231 * c = self.center * self.w += x * self.h += y # <<<<<<<<<<<<<< * self.center = c * */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->h = __pyx_t_4; /* "pygame_sdl2/rect.pyx":232 * self.w += x * self.h += y * self.center = c # <<<<<<<<<<<<<< * * def clamp(self, other): */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center, __pyx_v_c) < 0) __PYX_ERR(0, 232, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":227 * return r * * def inflate_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * c = self.center */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.inflate_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":234 * self.center = c * * def clamp(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.clamp_ip(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_26clamp, "Rect.clamp(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_27clamp = {"clamp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_26clamp}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clamp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clamp") < 0)) __PYX_ERR(0, 234, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clamp", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 234, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clamp", 1); /* "pygame_sdl2/rect.pyx":235 * * def clamp(self, other): * r = self.copy() # <<<<<<<<<<<<<< * r.clamp_ip(other) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":236 * def clamp(self, other): * r = self.copy() * r.clamp_ip(other) # <<<<<<<<<<<<<< * return r * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_clamp_ip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_other}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":237 * r = self.copy() * r.clamp_ip(other) * return r # <<<<<<<<<<<<<< * * def clamp_ip(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":234 * self.center = c * * def clamp(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.clamp_ip(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":239 * return r * * def clamp_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_28clamp_ip, "Rect.clamp_ip(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_29clamp_ip = {"clamp_ip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_28clamp_ip}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clamp_ip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clamp_ip") < 0)) __PYX_ERR(0, 239, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clamp_ip", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 239, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clamp_ip", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":240 * * def clamp_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":241 * def clamp_ip(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * if self.w > other.w or self.h > other.h: */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":240 * * def clamp_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":243 * other = Rect(other) * * if self.w > other.w or self.h > other.h: # <<<<<<<<<<<<<< * self.center = other.center * else: */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":244 * * if self.w > other.w or self.h > other.h: * self.center = other.center # <<<<<<<<<<<<<< * else: * if self.left < other.left: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_center); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center, __pyx_t_3) < 0) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":243 * other = Rect(other) * * if self.w > other.w or self.h > other.h: # <<<<<<<<<<<<<< * self.center = other.center * else: */ goto __pyx_L4; } /* "pygame_sdl2/rect.pyx":246 * self.center = other.center * else: * if self.left < other.left: # <<<<<<<<<<<<<< * self.left = other.left * elif self.right > other.right: */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":247 * else: * if self.left < other.left: * self.left = other.left # <<<<<<<<<<<<<< * elif self.right > other.right: * self.right = other.right */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_5) < 0) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":246 * self.center = other.center * else: * if self.left < other.left: # <<<<<<<<<<<<<< * self.left = other.left * elif self.right > other.right: */ goto __pyx_L7; } /* "pygame_sdl2/rect.pyx":248 * if self.left < other.left: * self.left = other.left * elif self.right > other.right: # <<<<<<<<<<<<<< * self.right = other.right * if self.top < other.top: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":249 * self.left = other.left * elif self.right > other.right: * self.right = other.right # <<<<<<<<<<<<<< * if self.top < other.top: * self.top = other.top */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_3) < 0) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":248 * if self.left < other.left: * self.left = other.left * elif self.right > other.right: # <<<<<<<<<<<<<< * self.right = other.right * if self.top < other.top: */ } __pyx_L7:; /* "pygame_sdl2/rect.pyx":250 * elif self.right > other.right: * self.right = other.right * if self.top < other.top: # <<<<<<<<<<<<<< * self.top = other.top * elif self.bottom > other.bottom: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":251 * self.right = other.right * if self.top < other.top: * self.top = other.top # <<<<<<<<<<<<<< * elif self.bottom > other.bottom: * self.bottom = other.bottom */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_5) < 0) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":250 * elif self.right > other.right: * self.right = other.right * if self.top < other.top: # <<<<<<<<<<<<<< * self.top = other.top * elif self.bottom > other.bottom: */ goto __pyx_L8; } /* "pygame_sdl2/rect.pyx":252 * if self.top < other.top: * self.top = other.top * elif self.bottom > other.bottom: # <<<<<<<<<<<<<< * self.bottom = other.bottom * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":253 * self.top = other.top * elif self.bottom > other.bottom: * self.bottom = other.bottom # <<<<<<<<<<<<<< * * def clip(self, other, y=None, w=None, h=None): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_3) < 0) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":252 * if self.top < other.top: * self.top = other.top * elif self.bottom > other.bottom: # <<<<<<<<<<<<<< * self.bottom = other.bottom * */ } __pyx_L8:; } __pyx_L4:; /* "pygame_sdl2/rect.pyx":239 * return r * * def clamp_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":255 * self.bottom = other.bottom * * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<< * if type(other) == int: * other = Rect(other, y, w, h) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_30clip, "Rect.clip(self, other, y=None, w=None, h=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_31clip = {"clip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_30clip}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_w = 0; PyObject *__pyx_v_h = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_h,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_h); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clip") < 0)) __PYX_ERR(0, 255, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_other = values[0]; __pyx_v_y = values[1]; __pyx_v_w = values[2]; __pyx_v_h = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clip", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 255, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_30clip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other, __pyx_v_y, __pyx_v_w, __pyx_v_h); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_30clip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_d = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clip", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":256 * * def clip(self, other, y=None, w=None, h=None): * if type(other) == int: # <<<<<<<<<<<<<< * other = Rect(other, y, w, h) * */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_other)), ((PyObject *)(&PyInt_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":257 * def clip(self, other, y=None, w=None, h=None): * if type(other) == int: * other = Rect(other, y, w, h) # <<<<<<<<<<<<<< * * if not isinstance(other, Rect): */ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other)) __PYX_ERR(0, 257, __pyx_L1_error); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y)) __PYX_ERR(0, 257, __pyx_L1_error); __Pyx_INCREF(__pyx_v_w); __Pyx_GIVEREF(__pyx_v_w); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_w)) __PYX_ERR(0, 257, __pyx_L1_error); __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_h)) __PYX_ERR(0, 257, __pyx_L1_error); __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":256 * * def clip(self, other, y=None, w=None, h=None): * if type(other) == int: # <<<<<<<<<<<<<< * other = Rect(other, y, w, h) * */ } /* "pygame_sdl2/rect.pyx":259 * other = Rect(other, y, w, h) * * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_4 = (!__pyx_t_2); if (__pyx_t_4) { /* "pygame_sdl2/rect.pyx":260 * * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * if not self.colliderect(other): */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":259 * other = Rect(other, y, w, h) * * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":262 * other = Rect(other) * * if not self.colliderect(other): # <<<<<<<<<<<<<< * return Rect(0,0,0,0) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_other}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = (!__pyx_t_4); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":263 * * if not self.colliderect(other): * return Rect(0,0,0,0) # <<<<<<<<<<<<<< * * r = self.copy() */ __Pyx_XDECREF(__pyx_r); __pyx_t_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) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":262 * other = Rect(other) * * if not self.colliderect(other): # <<<<<<<<<<<<<< * return Rect(0,0,0,0) * */ } /* "pygame_sdl2/rect.pyx":265 * return Rect(0,0,0,0) * * r = self.copy() # <<<<<<<<<<<<<< * * # Remember that (0,0) is the top left. */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":268 * * # Remember that (0,0) is the top left. * if r.left < other.left: # <<<<<<<<<<<<<< * d = other.left - r.left * r.left += d */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":269 * # Remember that (0,0) is the top left. * if r.left < other.left: * d = other.left - r.left # <<<<<<<<<<<<<< * r.left += d * r.width -= d */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_d = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":270 * if r.left < other.left: * d = other.left - r.left * r.left += d # <<<<<<<<<<<<<< * r.width -= d * if r.right > other.right: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_left, __pyx_t_1) < 0) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":271 * d = other.left - r.left * r.left += d * r.width -= d # <<<<<<<<<<<<<< * if r.right > other.right: * d = r.right - other.right */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_3) < 0) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":268 * * # Remember that (0,0) is the top left. * if r.left < other.left: # <<<<<<<<<<<<<< * d = other.left - r.left * r.left += d */ } /* "pygame_sdl2/rect.pyx":272 * r.left += d * r.width -= d * if r.right > other.right: # <<<<<<<<<<<<<< * d = r.right - other.right * r.width -=d */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":273 * r.width -= d * if r.right > other.right: * d = r.right - other.right # <<<<<<<<<<<<<< * r.width -=d * if r.top < other.top: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":274 * if r.right > other.right: * d = r.right - other.right * r.width -=d # <<<<<<<<<<<<<< * if r.top < other.top: * d = other.top - r.top */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_1) < 0) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":272 * r.left += d * r.width -= d * if r.right > other.right: # <<<<<<<<<<<<<< * d = r.right - other.right * r.width -=d */ } /* "pygame_sdl2/rect.pyx":275 * d = r.right - other.right * r.width -=d * if r.top < other.top: # <<<<<<<<<<<<<< * d = other.top - r.top * r.top += d */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __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) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":276 * r.width -=d * if r.top < other.top: * d = other.top - r.top # <<<<<<<<<<<<<< * r.top += d * r.height -= d */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":277 * if r.top < other.top: * d = other.top - r.top * r.top += d # <<<<<<<<<<<<<< * r.height -= d * if r.bottom > other.bottom: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_top, __pyx_t_3) < 0) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":278 * d = other.top - r.top * r.top += d * r.height -= d # <<<<<<<<<<<<<< * if r.bottom > other.bottom: * d = r.bottom - other.bottom */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_1) < 0) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":275 * d = r.right - other.right * r.width -=d * if r.top < other.top: # <<<<<<<<<<<<<< * d = other.top - r.top * r.top += d */ } /* "pygame_sdl2/rect.pyx":279 * r.top += d * r.height -= d * if r.bottom > other.bottom: # <<<<<<<<<<<<<< * d = r.bottom - other.bottom * r.height -= d */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_bottom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __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) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":280 * r.height -= d * if r.bottom > other.bottom: * d = r.bottom - other.bottom # <<<<<<<<<<<<<< * r.height -= d * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":281 * if r.bottom > other.bottom: * d = r.bottom - other.bottom * r.height -= d # <<<<<<<<<<<<<< * * return r */ __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) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_3) < 0) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":279 * r.top += d * r.height -= d * if r.bottom > other.bottom: # <<<<<<<<<<<<<< * d = r.bottom - other.bottom * r.height -= d */ } /* "pygame_sdl2/rect.pyx":283 * r.height -= d * * return r # <<<<<<<<<<<<<< * * def union(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":255 * self.bottom = other.bottom * * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<< * if type(other) == int: * other = Rect(other, y, w, h) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_d); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":285 * return r * * def union(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.union_ip(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_33union(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_32union, "Rect.union(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_33union = {"union", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_33union, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_32union}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_33union(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("union (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "union") < 0)) __PYX_ERR(0, 285, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("union", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 285, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_32union(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_32union(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("union", 1); /* "pygame_sdl2/rect.pyx":286 * * def union(self, other): * r = self.copy() # <<<<<<<<<<<<<< * r.union_ip(other) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":287 * def union(self, other): * r = self.copy() * r.union_ip(other) # <<<<<<<<<<<<<< * return r * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_other}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":288 * r = self.copy() * r.union_ip(other) * return r # <<<<<<<<<<<<<< * * def union_ip(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":285 * return r * * def union(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.union_ip(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":290 * return r * * def union_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_34union_ip, "Rect.union_ip(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_35union_ip = {"union_ip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_34union_ip}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("union_ip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "union_ip") < 0)) __PYX_ERR(0, 290, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("union_ip", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 290, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("union_ip", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":291 * * def union_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":292 * def union_ip(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * x = min(self.x, other.x) */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":291 * * def union_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":294 * other = Rect(other) * * x = min(self.x, other.x) # <<<<<<<<<<<<<< * y = min(self.y, other.y) * self.w = max(self.right, other.right) - x */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_self->x; __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_t_3; } else { __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __pyx_t_7; __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_x = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":295 * * x = min(self.x, other.x) * y = min(self.y, other.y) # <<<<<<<<<<<<<< * self.w = max(self.right, other.right) - x * self.h = max(self.bottom, other.bottom) - y */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_self->y; __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __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) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_t_3; } else { __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":296 * x = min(self.x, other.x) * y = min(self.y, other.y) * self.w = max(self.right, other.right) - x # <<<<<<<<<<<<<< * self.h = max(self.bottom, other.bottom) - y * self.x = x */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = __pyx_t_3; } else { __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = __pyx_t_5; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->w = __pyx_t_4; /* "pygame_sdl2/rect.pyx":297 * y = min(self.y, other.y) * self.w = max(self.right, other.right) - x * self.h = max(self.bottom, other.bottom) - y # <<<<<<<<<<<<<< * self.x = x * self.y = y */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_6); __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) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_t_3; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->h = __pyx_t_4; /* "pygame_sdl2/rect.pyx":298 * self.w = max(self.right, other.right) - x * self.h = max(self.bottom, other.bottom) - y * self.x = x # <<<<<<<<<<<<<< * self.y = y * */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error) __pyx_v_self->x = __pyx_t_4; /* "pygame_sdl2/rect.pyx":299 * self.h = max(self.bottom, other.bottom) - y * self.x = x * self.y = y # <<<<<<<<<<<<<< * * def unionall(self, other_seq): */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error) __pyx_v_self->y = __pyx_t_4; /* "pygame_sdl2/rect.pyx":290 * return r * * def union_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":301 * self.y = y * * def unionall(self, other_seq): # <<<<<<<<<<<<<< * r = self.copy() * r.unionall_ip(other_seq) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_36unionall, "Rect.unionall(self, other_seq)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_37unionall = {"unionall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_36unionall}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other_seq = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unionall (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_seq,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other_seq)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "unionall") < 0)) __PYX_ERR(0, 301, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other_seq = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("unionall", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 301, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_seq); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unionall", 1); /* "pygame_sdl2/rect.pyx":302 * * def unionall(self, other_seq): * r = self.copy() # <<<<<<<<<<<<<< * r.unionall_ip(other_seq) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":303 * def unionall(self, other_seq): * r = self.copy() * r.unionall_ip(other_seq) # <<<<<<<<<<<<<< * return r * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_unionall_ip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_other_seq}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":304 * r = self.copy() * r.unionall_ip(other_seq) * return r # <<<<<<<<<<<<<< * * def unionall_ip(self, other_seq): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":301 * self.y = y * * def unionall(self, other_seq): # <<<<<<<<<<<<<< * r = self.copy() * r.unionall_ip(other_seq) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":306 * return r * * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<< * for other in other_seq: * self.union_ip(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_38unionall_ip, "Rect.unionall_ip(self, other_seq)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_39unionall_ip = {"unionall_ip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_38unionall_ip}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other_seq = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unionall_ip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_seq,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other_seq)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "unionall_ip") < 0)) __PYX_ERR(0, 306, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other_seq = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("unionall_ip", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 306, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_38unionall_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_seq); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_38unionall_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq) { PyObject *__pyx_v_other = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unionall_ip", 1); /* "pygame_sdl2/rect.pyx":307 * * def unionall_ip(self, other_seq): * for other in other_seq: # <<<<<<<<<<<<<< * self.union_ip(other) * */ if (likely(PyList_CheckExact(__pyx_v_other_seq)) || PyTuple_CheckExact(__pyx_v_other_seq)) { __pyx_t_1 = __pyx_v_other_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_other_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 307, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":308 * def unionall_ip(self, other_seq): * for other in other_seq: * self.union_ip(other) # <<<<<<<<<<<<<< * * def fit(self, other): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_union_ip); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_other}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":307 * * def unionall_ip(self, other_seq): * for other in other_seq: # <<<<<<<<<<<<<< * self.union_ip(other) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":306 * return r * * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<< * for other in other_seq: * self.union_ip(other) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":310 * self.union_ip(other) * * def fit(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_40fit, "Rect.fit(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_41fit = {"fit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_40fit}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fit (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fit") < 0)) __PYX_ERR(0, 310, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fit", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 310, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.fit", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_w_ratio = NULL; PyObject *__pyx_v_h_ratio = NULL; PyObject *__pyx_v_factor = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fit", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":311 * * def fit(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":312 * def fit(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * # Not sure if this is entirely correct. Docs and tests are ambiguous. */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":311 * * def fit(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":315 * * # Not sure if this is entirely correct. Docs and tests are ambiguous. * r = self.copy() # <<<<<<<<<<<<<< * r.topleft = other.topleft * w_ratio = other.w / float(r.w) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":316 * # Not sure if this is entirely correct. Docs and tests are ambiguous. * r = self.copy() * r.topleft = other.topleft # <<<<<<<<<<<<<< * w_ratio = other.w / float(r.w) * h_ratio = other.h / float(r.h) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_topleft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_topleft, __pyx_t_3) < 0) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":317 * r = self.copy() * r.topleft = other.topleft * w_ratio = other.w / float(r.w) # <<<<<<<<<<<<<< * h_ratio = other.h / float(r.h) * factor = min(w_ratio, h_ratio) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyNumber_Float(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_w_ratio = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":318 * r.topleft = other.topleft * w_ratio = other.w / float(r.w) * h_ratio = other.h / float(r.h) # <<<<<<<<<<<<<< * factor = min(w_ratio, h_ratio) * r.w *= factor */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_h_ratio = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":319 * w_ratio = other.w / float(r.w) * h_ratio = other.h / float(r.h) * factor = min(w_ratio, h_ratio) # <<<<<<<<<<<<<< * r.w *= factor * r.h *= factor */ __Pyx_INCREF(__pyx_v_h_ratio); __pyx_t_5 = __pyx_v_h_ratio; __Pyx_INCREF(__pyx_v_w_ratio); __pyx_t_3 = __pyx_v_w_ratio; __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 319, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = __pyx_t_5; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_factor = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":320 * h_ratio = other.h / float(r.h) * factor = min(w_ratio, h_ratio) * r.w *= factor # <<<<<<<<<<<<<< * r.h *= factor * return r */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_v_factor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_w, __pyx_t_4) < 0) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":321 * factor = min(w_ratio, h_ratio) * r.w *= factor * r.h *= factor # <<<<<<<<<<<<<< * return r * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_h, __pyx_t_5) < 0) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":322 * r.w *= factor * r.h *= factor * return r # <<<<<<<<<<<<<< * * def normalize(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":310 * self.union_ip(other) * * def fit(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.fit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_w_ratio); __Pyx_XDECREF(__pyx_v_h_ratio); __Pyx_XDECREF(__pyx_v_factor); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":324 * return r * * def normalize(self): # <<<<<<<<<<<<<< * if self.w < 0: * self.x += self.w */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_42normalize, "Rect.normalize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_43normalize = {"normalize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_42normalize}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normalize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("normalize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "normalize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("normalize", 1); /* "pygame_sdl2/rect.pyx":325 * * def normalize(self): * if self.w < 0: # <<<<<<<<<<<<<< * self.x += self.w * self.w = -self.w */ __pyx_t_1 = (__pyx_v_self->w < 0); if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":326 * def normalize(self): * if self.w < 0: * self.x += self.w # <<<<<<<<<<<<<< * self.w = -self.w * if self.h < 0: */ __pyx_v_self->x = (__pyx_v_self->x + __pyx_v_self->w); /* "pygame_sdl2/rect.pyx":327 * if self.w < 0: * self.x += self.w * self.w = -self.w # <<<<<<<<<<<<<< * if self.h < 0: * self.y += self.h */ __pyx_v_self->w = (-__pyx_v_self->w); /* "pygame_sdl2/rect.pyx":325 * * def normalize(self): * if self.w < 0: # <<<<<<<<<<<<<< * self.x += self.w * self.w = -self.w */ } /* "pygame_sdl2/rect.pyx":328 * self.x += self.w * self.w = -self.w * if self.h < 0: # <<<<<<<<<<<<<< * self.y += self.h * self.h = -self.h */ __pyx_t_1 = (__pyx_v_self->h < 0); if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":329 * self.w = -self.w * if self.h < 0: * self.y += self.h # <<<<<<<<<<<<<< * self.h = -self.h * */ __pyx_v_self->y = (__pyx_v_self->y + __pyx_v_self->h); /* "pygame_sdl2/rect.pyx":330 * if self.h < 0: * self.y += self.h * self.h = -self.h # <<<<<<<<<<<<<< * * def contains(self, other): */ __pyx_v_self->h = (-__pyx_v_self->h); /* "pygame_sdl2/rect.pyx":328 * self.x += self.w * self.w = -self.w * if self.h < 0: # <<<<<<<<<<<<<< * self.y += self.h * self.h = -self.h */ } /* "pygame_sdl2/rect.pyx":324 * return r * * def normalize(self): # <<<<<<<<<<<<<< * if self.w < 0: * self.x += self.w */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":332 * self.h = -self.h * * def contains(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_44contains, "Rect.contains(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_45contains = {"contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_44contains}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "contains") < 0)) __PYX_ERR(0, 332, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("contains", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 332, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("contains", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":333 * * def contains(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":334 * def contains(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * return other.x >= self.x and other.right <= self.right and \ */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":333 * * def contains(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":336 * other = Rect(other) * * return other.x >= self.x and other.right <= self.right and \ # <<<<<<<<<<<<<< * other.y >= self.y and other.bottom <= self.bottom and \ * other.left < self.right and other.top < self.bottom */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 336, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 336, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_bool_binop_done; } /* "pygame_sdl2/rect.pyx":337 * * return other.x >= self.x and other.right <= self.right and \ * other.y >= self.y and other.bottom <= self.bottom and \ # <<<<<<<<<<<<<< * other.left < self.right and other.top < self.bottom * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 337, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 337, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_bool_binop_done; } /* "pygame_sdl2/rect.pyx":338 * return other.x >= self.x and other.right <= self.right and \ * other.y >= self.y and other.bottom <= self.bottom and \ * other.left < self.right and other.top < self.bottom # <<<<<<<<<<<<<< * * def collidepoint(self, x, y=None): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 338, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_L4_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":332 * self.h = -self.h * * def contains(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":340 * other.left < self.right and other.top < self.bottom * * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<< * if type(x) == tuple: * x, y = x */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_46collidepoint, "Rect.collidepoint(self, x, y=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_47collidepoint = {"collidepoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_46collidepoint}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidepoint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collidepoint") < 0)) __PYX_ERR(0, 340, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = values[0]; __pyx_v_y = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidepoint", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 340, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidepoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_46collidepoint(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_46collidepoint(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidepoint", 0); __Pyx_INCREF(__pyx_v_x); __Pyx_INCREF(__pyx_v_y); /* "pygame_sdl2/rect.pyx":341 * * def collidepoint(self, x, y=None): * if type(x) == tuple: # <<<<<<<<<<<<<< * x, y = x * return x >= self.x and y >= self.y and \ */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_x)), ((PyObject *)(&PyTuple_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":342 * def collidepoint(self, x, y=None): * if type(x) == tuple: * x, y = x # <<<<<<<<<<<<<< * return x >= self.x and y >= self.y and \ * x < self.right and y < self.bottom */ if ((likely(PyTuple_CheckExact(__pyx_v_x))) || (PyList_CheckExact(__pyx_v_x))) { PyObject* sequence = __pyx_v_x; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 342, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 342, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 342, __pyx_L1_error) __pyx_L5_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":341 * * def collidepoint(self, x, y=None): * if type(x) == tuple: # <<<<<<<<<<<<<< * x, y = x * return x >= self.x and y >= self.y and \ */ } /* "pygame_sdl2/rect.pyx":343 * if type(x) == tuple: * x, y = x * return x >= self.x and y >= self.y and \ # <<<<<<<<<<<<<< * x < self.right and y < self.bottom * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 343, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 343, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L6_bool_binop_done; } /* "pygame_sdl2/rect.pyx":344 * x, y = x * return x >= self.x and y >= self.y and \ * x < self.right and y < self.bottom # <<<<<<<<<<<<<< * * def colliderect(self, other): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 344, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_L6_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":340 * other.left < self.right and other.top < self.bottom * * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<< * if type(x) == tuple: * x, y = x */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidepoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":346 * x < self.right and y < self.bottom * * def colliderect(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_48colliderect, "Rect.colliderect(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_49colliderect = {"colliderect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_48colliderect}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("colliderect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "colliderect") < 0)) __PYX_ERR(0, 346, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("colliderect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 346, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.colliderect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("colliderect", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":347 * * def colliderect(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":348 * def colliderect(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * return self.left < other.right and self.top < other.bottom and \ */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":347 * * def colliderect(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":350 * other = Rect(other) * * return self.left < other.right and self.top < other.bottom and \ # <<<<<<<<<<<<<< * self.right > other.left and self.bottom > other.top * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 350, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 350, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_bool_binop_done; } /* "pygame_sdl2/rect.pyx":351 * * return self.left < other.right and self.top < other.bottom and \ * self.right > other.left and self.bottom > other.top # <<<<<<<<<<<<<< * * def collidelist(self, other_list): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_L4_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":346 * x < self.right and y < self.bottom * * def colliderect(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.colliderect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":353 * self.right > other.left and self.bottom > other.top * * def collidelist(self, other_list): # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_50collidelist, "Rect.collidelist(self, other_list)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_51collidelist = {"collidelist", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_50collidelist}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other_list = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidelist (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_list,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other_list)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collidelist") < 0)) __PYX_ERR(0, 353, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other_list = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidelist", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 353, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelist", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_list); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_other = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidelist", 1); /* "pygame_sdl2/rect.pyx":354 * * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * return n */ __pyx_t_1 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 354, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error); __Pyx_INCREF(__pyx_v_other_list); __Pyx_GIVEREF(__pyx_v_other_list); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_other_list)) __PYX_ERR(0, 354, __pyx_L1_error); __pyx_t_3 = 0; __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_4 = NULL; } else { __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 354, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 354, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 354, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 354, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 354, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 354, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":355 * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * return n * return -1 */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_other}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_10) { /* "pygame_sdl2/rect.pyx":356 * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): * return n # <<<<<<<<<<<<<< * return -1 * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_n); __pyx_r = __pyx_v_n; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":355 * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * return n * return -1 */ } /* "pygame_sdl2/rect.pyx":354 * * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * return n */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":357 * if self.colliderect(other): * return n * return -1 # <<<<<<<<<<<<<< * * def collidelistall(self, other_list): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_neg_1); __pyx_r = __pyx_int_neg_1; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":353 * self.right > other.left and self.bottom > other.top * * def collidelist(self, other_list): # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelist", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":359 * return -1 * * def collidelistall(self, other_list): # <<<<<<<<<<<<<< * ret = [] * for n, other in zip(range(len(other_list)), other_list): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_52collidelistall, "Rect.collidelistall(self, other_list)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_53collidelistall = {"collidelistall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_52collidelistall}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other_list = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidelistall (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_list,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other_list)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collidelistall") < 0)) __PYX_ERR(0, 359, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other_list = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidelistall", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 359, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelistall", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_list); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list) { PyObject *__pyx_v_ret = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_other = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidelistall", 1); /* "pygame_sdl2/rect.pyx":360 * * def collidelistall(self, other_list): * ret = [] # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":361 * def collidelistall(self, other_list): * ret = [] * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * ret.append(n) */ __pyx_t_2 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 361, __pyx_L1_error) __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error); __Pyx_INCREF(__pyx_v_other_list); __Pyx_GIVEREF(__pyx_v_other_list); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_other_list)) __PYX_ERR(0, 361, __pyx_L1_error); __pyx_t_3 = 0; __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_4 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 361, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 361, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 361, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 361, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 361, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 361, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":362 * ret = [] * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * ret.append(n) * return ret */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_other}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_10) { /* "pygame_sdl2/rect.pyx":363 * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): * ret.append(n) # <<<<<<<<<<<<<< * return ret * */ __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_n); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 363, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":362 * ret = [] * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * ret.append(n) * return ret */ } /* "pygame_sdl2/rect.pyx":361 * def collidelistall(self, other_list): * ret = [] * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * ret.append(n) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":364 * if self.colliderect(other): * ret.append(n) * return ret # <<<<<<<<<<<<<< * * def collidedict(self, other_dict, rects_values=0): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":359 * return -1 * * def collidelistall(self, other_list): # <<<<<<<<<<<<<< * ret = [] * for n, other in zip(range(len(other_list)), other_list): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelistall", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ret); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":366 * return ret * * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_54collidedict, "Rect.collidedict(self, other_dict, rects_values=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_55collidedict = {"collidedict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_54collidedict}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other_dict = 0; CYTHON_UNUSED PyObject *__pyx_v_rects_values = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidedict (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_dict,&__pyx_n_s_rects_values,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other_dict)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 366, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rects_values); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 366, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collidedict") < 0)) __PYX_ERR(0, 366, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_other_dict = values[0]; __pyx_v_rects_values = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidedict", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 366, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedict", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_54collidedict(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_dict, __pyx_v_rects_values); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_54collidedict(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values) { PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidedict", 1); /* "pygame_sdl2/rect.pyx":368 * def collidedict(self, other_dict, rects_values=0): * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): # <<<<<<<<<<<<<< * if self.colliderect(val): * return key, val */ __pyx_t_2 = 0; if (unlikely(__pyx_v_other_dict == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 368, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_other_dict, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":369 * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): * if self.colliderect(val): # <<<<<<<<<<<<<< * return key, val * return None */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_val}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { /* "pygame_sdl2/rect.pyx":370 * for key, val in other_dict.items(): * if self.colliderect(val): * return key, val # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key)) __PYX_ERR(0, 370, __pyx_L1_error); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_val)) __PYX_ERR(0, 370, __pyx_L1_error); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":369 * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): * if self.colliderect(val): # <<<<<<<<<<<<<< * return key, val * return None */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":371 * if self.colliderect(val): * return key, val * return None # <<<<<<<<<<<<<< * * def collidedictall(self, other_dict, rects_values=0): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/rect.pyx":366 * return ret * * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":373 * return None * * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * ret = [] * for key, val in other_dict.items(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_56collidedictall, "Rect.collidedictall(self, other_dict, rects_values=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_57collidedictall = {"collidedictall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_56collidedictall}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other_dict = 0; CYTHON_UNUSED PyObject *__pyx_v_rects_values = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidedictall (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_dict,&__pyx_n_s_rects_values,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other_dict)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rects_values); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collidedictall") < 0)) __PYX_ERR(0, 373, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_other_dict = values[0]; __pyx_v_rects_values = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidedictall", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 373, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedictall", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_56collidedictall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_dict, __pyx_v_rects_values); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_56collidedictall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values) { PyObject *__pyx_v_ret = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidedictall", 1); /* "pygame_sdl2/rect.pyx":374 * * def collidedictall(self, other_dict, rects_values=0): * ret = [] # <<<<<<<<<<<<<< * for key, val in other_dict.items(): * if self.colliderect(val): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":375 * def collidedictall(self, other_dict, rects_values=0): * ret = [] * for key, val in other_dict.items(): # <<<<<<<<<<<<<< * if self.colliderect(val): * ret.append((key,val)) */ __pyx_t_2 = 0; if (unlikely(__pyx_v_other_dict == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 375, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_other_dict, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":376 * ret = [] * for key, val in other_dict.items(): * if self.colliderect(val): # <<<<<<<<<<<<<< * ret.append((key,val)) * return ret */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_val}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { /* "pygame_sdl2/rect.pyx":377 * for key, val in other_dict.items(): * if self.colliderect(val): * ret.append((key,val)) # <<<<<<<<<<<<<< * return ret * */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key)) __PYX_ERR(0, 377, __pyx_L1_error); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_val)) __PYX_ERR(0, 377, __pyx_L1_error); __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_6); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":376 * ret = [] * for key, val in other_dict.items(): * if self.colliderect(val): # <<<<<<<<<<<<<< * ret.append((key,val)) * return ret */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":378 * if self.colliderect(val): * ret.append((key,val)) * return ret # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":373 * return None * * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * ret = [] * for key, val in other_dict.items(): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedictall", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ret); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pxd":25 * cdef object __weakref__ * * cdef public int x # <<<<<<<<<<<<<< * cdef public int y * cdef public int w */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.x.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1x_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1x_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __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) __pyx_v_self->x = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.x.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pxd":26 * * cdef public int x * cdef public int y # <<<<<<<<<<<<<< * cdef public int w * cdef public int h */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.y.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1y_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1y_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __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) __pyx_v_self->y = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.y.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pxd":27 * cdef public int x * cdef public int y * cdef public int w # <<<<<<<<<<<<<< * cdef public int h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1w_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1w_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __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) __pyx_v_self->w = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pxd":28 * cdef public int y * cdef public int w * cdef public int h # <<<<<<<<<<<<<< * * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.h.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1h_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1h_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __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) __pyx_v_self->h = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.h.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pyx":381 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=None) except -1: # <<<<<<<<<<<<<< * """ * Converts `rectlike` to the SDL_Rect `rect`. */ static int __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(PyObject *__pyx_v_rectlike, SDL_Rect *__pyx_v_rect, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args) { PyObject *__pyx_v_argname = ((PyObject *)Py_None); struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_rl = 0; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *(*__pyx_t_12)(PyObject *); int __pyx_t_13; int __pyx_t_14; int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_sdl_rect", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_argname = __pyx_optional_args->argname; } } /* "pygame_sdl2/rect.pyx":391 * cdef Rect rl * * try: # <<<<<<<<<<<<<< * if isinstance(rectlike, Rect): * rl = rectlike */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "pygame_sdl2/rect.pyx":392 * * try: * if isinstance(rectlike, Rect): # <<<<<<<<<<<<<< * rl = rectlike * */ __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_rectlike, __pyx_ptype_11pygame_sdl2_4rect_Rect); if (__pyx_t_4) { /* "pygame_sdl2/rect.pyx":393 * try: * if isinstance(rectlike, Rect): * rl = rectlike # <<<<<<<<<<<<<< * * rect.x = rl.x */ if (!(likely(((__pyx_v_rectlike) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rectlike, __pyx_ptype_11pygame_sdl2_4rect_Rect))))) __PYX_ERR(0, 393, __pyx_L3_error) __pyx_t_5 = __pyx_v_rectlike; __Pyx_INCREF(__pyx_t_5); __pyx_v_rl = ((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":395 * rl = rectlike * * rect.x = rl.x # <<<<<<<<<<<<<< * rect.y = rl.y * rect.w = rl.w */ __pyx_t_6 = __pyx_v_rl->x; __pyx_v_rect->x = __pyx_t_6; /* "pygame_sdl2/rect.pyx":396 * * rect.x = rl.x * rect.y = rl.y # <<<<<<<<<<<<<< * rect.w = rl.w * rect.h = rl.h */ __pyx_t_6 = __pyx_v_rl->y; __pyx_v_rect->y = __pyx_t_6; /* "pygame_sdl2/rect.pyx":397 * rect.x = rl.x * rect.y = rl.y * rect.w = rl.w # <<<<<<<<<<<<<< * rect.h = rl.h * */ __pyx_t_6 = __pyx_v_rl->w; __pyx_v_rect->w = __pyx_t_6; /* "pygame_sdl2/rect.pyx":398 * rect.y = rl.y * rect.w = rl.w * rect.h = rl.h # <<<<<<<<<<<<<< * * return 0 */ __pyx_t_6 = __pyx_v_rl->h; __pyx_v_rect->h = __pyx_t_6; /* "pygame_sdl2/rect.pyx":400 * rect.h = rl.h * * return 0 # <<<<<<<<<<<<<< * * elif len(rectlike) == 4: */ __pyx_r = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/rect.pyx":392 * * try: * if isinstance(rectlike, Rect): # <<<<<<<<<<<<<< * rl = rectlike * */ } /* "pygame_sdl2/rect.pyx":402 * return 0 * * elif len(rectlike) == 4: # <<<<<<<<<<<<<< * rect.x, rect.y, rect.w, rect.h = rectlike * return 0 */ __pyx_t_7 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 402, __pyx_L3_error) __pyx_t_4 = (__pyx_t_7 == 4); if (__pyx_t_4) { /* "pygame_sdl2/rect.pyx":403 * * elif len(rectlike) == 4: * rect.x, rect.y, rect.w, rect.h = rectlike # <<<<<<<<<<<<<< * return 0 * */ if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) { PyObject* sequence = __pyx_v_rectlike; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 403, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); __pyx_t_10 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 403, __pyx_L3_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10}; __pyx_t_11 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 403, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_12(__pyx_t_11); if (unlikely(!item)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 4) < 0) __PYX_ERR(0, 403, __pyx_L3_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L11_unpacking_done; __pyx_L10_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 403, __pyx_L3_error) __pyx_L11_unpacking_done:; } __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L3_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L3_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L3_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_rect->x = __pyx_t_6; __pyx_v_rect->y = __pyx_t_13; __pyx_v_rect->w = __pyx_t_14; __pyx_v_rect->h = __pyx_t_15; /* "pygame_sdl2/rect.pyx":404 * elif len(rectlike) == 4: * rect.x, rect.y, rect.w, rect.h = rectlike * return 0 # <<<<<<<<<<<<<< * * elif len(rectlike) == 2: */ __pyx_r = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/rect.pyx":402 * return 0 * * elif len(rectlike) == 4: # <<<<<<<<<<<<<< * rect.x, rect.y, rect.w, rect.h = rectlike * return 0 */ } /* "pygame_sdl2/rect.pyx":406 * return 0 * * elif len(rectlike) == 2: # <<<<<<<<<<<<<< * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike */ __pyx_t_7 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 406, __pyx_L3_error) __pyx_t_4 = (__pyx_t_7 == 2); if (__pyx_t_4) { /* "pygame_sdl2/rect.pyx":407 * * elif len(rectlike) == 2: * rect.x, rect.y = rectlike # <<<<<<<<<<<<<< * rect.w, rect.h = rectlike * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) { PyObject* sequence = __pyx_v_rectlike; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 407, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 407, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 407, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 407, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) __PYX_ERR(0, 407, __pyx_L3_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 407, __pyx_L3_error) __pyx_L13_unpacking_done:; } __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_rect->x = __pyx_t_15; __pyx_v_rect->y = __pyx_t_14; /* "pygame_sdl2/rect.pyx":408 * elif len(rectlike) == 2: * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike # <<<<<<<<<<<<<< * return 0 * */ if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) { PyObject* sequence = __pyx_v_rectlike; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 408, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 408, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 408, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); #endif } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) __PYX_ERR(0, 408, __pyx_L3_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 408, __pyx_L3_error) __pyx_L15_unpacking_done:; } __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_rect->w = __pyx_t_14; __pyx_v_rect->h = __pyx_t_15; /* "pygame_sdl2/rect.pyx":409 * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike * return 0 # <<<<<<<<<<<<<< * * except: */ __pyx_r = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/rect.pyx":406 * return 0 * * elif len(rectlike) == 2: # <<<<<<<<<<<<<< * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike */ } /* "pygame_sdl2/rect.pyx":391 * cdef Rect rl * * try: # <<<<<<<<<<<<<< * if isinstance(rectlike, Rect): * rl = rectlike */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/rect.pyx":411 * return 0 * * except: # <<<<<<<<<<<<<< * pass * */ /*except:*/ { __Pyx_ErrRestore(0,0,0); goto __pyx_L4_exception_handled; } /* "pygame_sdl2/rect.pyx":391 * cdef Rect rl * * try: # <<<<<<<<<<<<<< * if isinstance(rectlike, Rect): * rl = rectlike */ __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "pygame_sdl2/rect.pyx":414 * pass * * if argname: # <<<<<<<<<<<<<< * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_argname); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 414, __pyx_L1_error) if (unlikely(__pyx_t_4)) { /* "pygame_sdl2/rect.pyx":415 * * if argname: * raise TypeError("Argument {} must be a rect style object.".format(argname)) # <<<<<<<<<<<<<< * else: * raise TypeError("Argument must be a rect style object.") */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Argument_must_be_a_rect_style_ob_2, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; __pyx_t_15 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_15 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_argname}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(0, 415, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":414 * pass * * if argname: # <<<<<<<<<<<<<< * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: */ } /* "pygame_sdl2/rect.pyx":417 * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< */ /*else*/ { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(0, 417, __pyx_L1_error) } /* "pygame_sdl2/rect.pyx":381 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=None) except -1: # <<<<<<<<<<<<<< * """ * Converts `rectlike` to the SDL_Rect `rect`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.rect.to_sdl_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rl); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_4rect_Rect(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif return o; } static void __pyx_tp_dealloc_11pygame_sdl2_4rect_Rect(PyObject *o) { struct __pyx_obj_11pygame_sdl2_4rect_Rect *p = (struct __pyx_obj_11pygame_sdl2_4rect_Rect *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_4rect_Rect) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_sq_item_11pygame_sdl2_4rect_Rect(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_11pygame_sdl2_4rect_Rect(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(o, i, v); } else { __Pyx_TypeName o_type_name; o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_left(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_left(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_top(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_top(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_width(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_width(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_height(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_height(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_right(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_right(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottom(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_topleft(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_topleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_topright(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_topright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomright(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomleft(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_centerx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_centerx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_centery(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_centery(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_center(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_center(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midtop(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midtop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midleft(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midbottom(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midbottom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midright(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_x(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_x(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_y(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_y(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_w(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_w(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_h(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_h(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_specialmethod___pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(self); } static PyMethodDef __pyx_methods_11pygame_sdl2_4rect_Rect[] = { {"__reduce__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_2__reduce__}, {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__, METH_NOARGS|METH_COEXIST, 0}, {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_16copy}, {"move", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_19move, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_18move}, {"move_ip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_20move_ip}, {"inflate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_22inflate}, {"inflate_ip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_24inflate_ip}, {"clamp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_26clamp}, {"clamp_ip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_28clamp_ip}, {"clip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_30clip}, {"union", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_33union, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_32union}, {"union_ip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_34union_ip}, {"unionall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_36unionall}, {"unionall_ip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_38unionall_ip}, {"fit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_40fit}, {"normalize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_42normalize}, {"contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_44contains}, {"collidepoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_46collidepoint}, {"colliderect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_48colliderect}, {"collidelist", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_50collidelist}, {"collidelistall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_52collidelistall}, {"collidedict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_54collidedict}, {"collidedictall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_56collidedictall}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_4rect_Rect[] = { {(char *)"left", __pyx_getprop_11pygame_sdl2_4rect_4Rect_left, __pyx_setprop_11pygame_sdl2_4rect_4Rect_left, (char *)0, 0}, {(char *)"top", __pyx_getprop_11pygame_sdl2_4rect_4Rect_top, __pyx_setprop_11pygame_sdl2_4rect_4Rect_top, (char *)0, 0}, {(char *)"width", __pyx_getprop_11pygame_sdl2_4rect_4Rect_width, __pyx_setprop_11pygame_sdl2_4rect_4Rect_width, (char *)0, 0}, {(char *)"height", __pyx_getprop_11pygame_sdl2_4rect_4Rect_height, __pyx_setprop_11pygame_sdl2_4rect_4Rect_height, (char *)0, 0}, {(char *)"right", __pyx_getprop_11pygame_sdl2_4rect_4Rect_right, __pyx_setprop_11pygame_sdl2_4rect_4Rect_right, (char *)0, 0}, {(char *)"bottom", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottom, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottom, (char *)0, 0}, {(char *)"size", __pyx_getprop_11pygame_sdl2_4rect_4Rect_size, __pyx_setprop_11pygame_sdl2_4rect_4Rect_size, (char *)0, 0}, {(char *)"topleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_topleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_topleft, (char *)0, 0}, {(char *)"topright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_topright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_topright, (char *)0, 0}, {(char *)"bottomright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomright, (char *)0, 0}, {(char *)"bottomleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomleft, (char *)0, 0}, {(char *)"centerx", __pyx_getprop_11pygame_sdl2_4rect_4Rect_centerx, __pyx_setprop_11pygame_sdl2_4rect_4Rect_centerx, (char *)0, 0}, {(char *)"centery", __pyx_getprop_11pygame_sdl2_4rect_4Rect_centery, __pyx_setprop_11pygame_sdl2_4rect_4Rect_centery, (char *)0, 0}, {(char *)"center", __pyx_getprop_11pygame_sdl2_4rect_4Rect_center, __pyx_setprop_11pygame_sdl2_4rect_4Rect_center, (char *)0, 0}, {(char *)"midtop", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midtop, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midtop, (char *)0, 0}, {(char *)"midleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midleft, (char *)0, 0}, {(char *)"midbottom", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midbottom, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midbottom, (char *)0, 0}, {(char *)"midright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midright, (char *)0, 0}, {(char *)"x", __pyx_getprop_11pygame_sdl2_4rect_4Rect_x, __pyx_setprop_11pygame_sdl2_4rect_4Rect_x, (char *)PyDoc_STR("x: 'int'"), 0}, {(char *)"y", __pyx_getprop_11pygame_sdl2_4rect_4Rect_y, __pyx_setprop_11pygame_sdl2_4rect_4Rect_y, (char *)PyDoc_STR("y: 'int'"), 0}, {(char *)"w", __pyx_getprop_11pygame_sdl2_4rect_4Rect_w, __pyx_setprop_11pygame_sdl2_4rect_4Rect_w, (char *)PyDoc_STR("w: 'int'"), 0}, {(char *)"h", __pyx_getprop_11pygame_sdl2_4rect_4Rect_h, __pyx_setprop_11pygame_sdl2_4rect_4Rect_h, (char *)PyDoc_STR("h: 'int'"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_4rect_Rect_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_4rect_Rect}, {Py_tp_repr, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__}, {Py_sq_length, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__}, {Py_sq_item, (void *)__pyx_sq_item_11pygame_sdl2_4rect_Rect}, {Py_mp_length, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__}, {Py_mp_subscript, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_11pygame_sdl2_4rect_Rect}, {Py_tp_doc, (void *)PyDoc_STR("Rect(*args)")}, {Py_tp_richcompare, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__}, {Py_tp_iter, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_4rect_Rect}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_4rect_Rect}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_4rect_Rect}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_4rect_Rect_spec = { "pygame_sdl2.rect.Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_4rect_Rect_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence_Rect = { __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_4rect_Rect, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Rect = { __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__, /*mp_length*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_11pygame_sdl2_4rect_Rect, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_4rect_Rect = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.rect.""Rect", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_4rect_Rect, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_Rect, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Rect, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Rect(*args)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_4rect_Rect, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_4rect_Rect, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_4rect_Rect, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Argument_must_be_a_rect_style_ob, __pyx_k_Argument_must_be_a_rect_style_ob, sizeof(__pyx_k_Argument_must_be_a_rect_style_ob), 0, 0, 1, 0}, {&__pyx_kp_s_Argument_must_be_a_rect_style_ob_2, __pyx_k_Argument_must_be_a_rect_style_ob_2, sizeof(__pyx_k_Argument_must_be_a_rect_style_ob_2), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_Rect___reduce, __pyx_k_Rect___reduce, sizeof(__pyx_k_Rect___reduce), 0, 0, 1, 1}, {&__pyx_n_s_Rect_clamp, __pyx_k_Rect_clamp, sizeof(__pyx_k_Rect_clamp), 0, 0, 1, 1}, {&__pyx_n_s_Rect_clamp_ip, __pyx_k_Rect_clamp_ip, sizeof(__pyx_k_Rect_clamp_ip), 0, 0, 1, 1}, {&__pyx_n_s_Rect_clip, __pyx_k_Rect_clip, sizeof(__pyx_k_Rect_clip), 0, 0, 1, 1}, {&__pyx_n_s_Rect_collidedict, __pyx_k_Rect_collidedict, sizeof(__pyx_k_Rect_collidedict), 0, 0, 1, 1}, {&__pyx_n_s_Rect_collidedictall, __pyx_k_Rect_collidedictall, sizeof(__pyx_k_Rect_collidedictall), 0, 0, 1, 1}, {&__pyx_n_s_Rect_collidelist, __pyx_k_Rect_collidelist, sizeof(__pyx_k_Rect_collidelist), 0, 0, 1, 1}, {&__pyx_n_s_Rect_collidelistall, __pyx_k_Rect_collidelistall, sizeof(__pyx_k_Rect_collidelistall), 0, 0, 1, 1}, {&__pyx_n_s_Rect_collidepoint, __pyx_k_Rect_collidepoint, sizeof(__pyx_k_Rect_collidepoint), 0, 0, 1, 1}, {&__pyx_n_s_Rect_colliderect, __pyx_k_Rect_colliderect, sizeof(__pyx_k_Rect_colliderect), 0, 0, 1, 1}, {&__pyx_n_s_Rect_contains, __pyx_k_Rect_contains, sizeof(__pyx_k_Rect_contains), 0, 0, 1, 1}, {&__pyx_n_s_Rect_copy, __pyx_k_Rect_copy, sizeof(__pyx_k_Rect_copy), 0, 0, 1, 1}, {&__pyx_n_s_Rect_fit, __pyx_k_Rect_fit, sizeof(__pyx_k_Rect_fit), 0, 0, 1, 1}, {&__pyx_n_s_Rect_inflate, __pyx_k_Rect_inflate, sizeof(__pyx_k_Rect_inflate), 0, 0, 1, 1}, {&__pyx_n_s_Rect_inflate_ip, __pyx_k_Rect_inflate_ip, sizeof(__pyx_k_Rect_inflate_ip), 0, 0, 1, 1}, {&__pyx_n_s_Rect_move, __pyx_k_Rect_move, sizeof(__pyx_k_Rect_move), 0, 0, 1, 1}, {&__pyx_n_s_Rect_move_ip, __pyx_k_Rect_move_ip, sizeof(__pyx_k_Rect_move_ip), 0, 0, 1, 1}, {&__pyx_n_s_Rect_normalize, __pyx_k_Rect_normalize, sizeof(__pyx_k_Rect_normalize), 0, 0, 1, 1}, {&__pyx_n_s_Rect_union, __pyx_k_Rect_union, sizeof(__pyx_k_Rect_union), 0, 0, 1, 1}, {&__pyx_n_s_Rect_union_ip, __pyx_k_Rect_union_ip, sizeof(__pyx_k_Rect_union_ip), 0, 0, 1, 1}, {&__pyx_n_s_Rect_unionall, __pyx_k_Rect_unionall, sizeof(__pyx_k_Rect_unionall), 0, 0, 1, 1}, {&__pyx_n_s_Rect_unionall_ip, __pyx_k_Rect_unionall_ip, sizeof(__pyx_k_Rect_unionall_ip), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1}, {&__pyx_n_s__47, __pyx_k__47, sizeof(__pyx_k__47), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_bottom, __pyx_k_bottom, sizeof(__pyx_k_bottom), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 1}, {&__pyx_n_s_centerx, __pyx_k_centerx, sizeof(__pyx_k_centerx), 0, 0, 1, 1}, {&__pyx_n_s_centery, __pyx_k_centery, sizeof(__pyx_k_centery), 0, 0, 1, 1}, {&__pyx_n_s_clamp, __pyx_k_clamp, sizeof(__pyx_k_clamp), 0, 0, 1, 1}, {&__pyx_n_s_clamp_ip, __pyx_k_clamp_ip, sizeof(__pyx_k_clamp_ip), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_n_s_collidedict, __pyx_k_collidedict, sizeof(__pyx_k_collidedict), 0, 0, 1, 1}, {&__pyx_n_s_collidedictall, __pyx_k_collidedictall, sizeof(__pyx_k_collidedictall), 0, 0, 1, 1}, {&__pyx_n_s_collidelist, __pyx_k_collidelist, sizeof(__pyx_k_collidelist), 0, 0, 1, 1}, {&__pyx_n_s_collidelistall, __pyx_k_collidelistall, sizeof(__pyx_k_collidelistall), 0, 0, 1, 1}, {&__pyx_n_s_collidepoint, __pyx_k_collidepoint, sizeof(__pyx_k_collidepoint), 0, 0, 1, 1}, {&__pyx_n_s_colliderect, __pyx_k_colliderect, sizeof(__pyx_k_colliderect), 0, 0, 1, 1}, {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_factor, __pyx_k_factor, sizeof(__pyx_k_factor), 0, 0, 1, 1}, {&__pyx_n_s_fit, __pyx_k_fit, sizeof(__pyx_k_fit), 0, 0, 1, 1}, {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_h_ratio, __pyx_k_h_ratio, sizeof(__pyx_k_h_ratio), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_inflate, __pyx_k_inflate, sizeof(__pyx_k_inflate), 0, 0, 1, 1}, {&__pyx_n_s_inflate_ip, __pyx_k_inflate_ip, sizeof(__pyx_k_inflate_ip), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_move, __pyx_k_move, sizeof(__pyx_k_move), 0, 0, 1, 1}, {&__pyx_n_s_move_ip, __pyx_k_move_ip, sizeof(__pyx_k_move_ip), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_other_dict, __pyx_k_other_dict, sizeof(__pyx_k_other_dict), 0, 0, 1, 1}, {&__pyx_n_s_other_list, __pyx_k_other_list, sizeof(__pyx_k_other_list), 0, 0, 1, 1}, {&__pyx_n_s_other_seq, __pyx_k_other_seq, sizeof(__pyx_k_other_seq), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_kp_s_rect_d_d_d_d, __pyx_k_rect_d_d_d_d, sizeof(__pyx_k_rect_d_d_d_d), 0, 0, 1, 0}, {&__pyx_n_s_rects_values, __pyx_k_rects_values, sizeof(__pyx_k_rects_values), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__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}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1}, {&__pyx_n_s_topleft, __pyx_k_topleft, sizeof(__pyx_k_topleft), 0, 0, 1, 1}, {&__pyx_n_s_union, __pyx_k_union, sizeof(__pyx_k_union), 0, 0, 1, 1}, {&__pyx_n_s_union_ip, __pyx_k_union_ip, sizeof(__pyx_k_union_ip), 0, 0, 1, 1}, {&__pyx_n_s_unionall, __pyx_k_unionall, sizeof(__pyx_k_unionall), 0, 0, 1, 1}, {&__pyx_n_s_unionall_ip, __pyx_k_unionall_ip, sizeof(__pyx_k_unionall_ip), 0, 0, 1, 1}, {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_w_ratio, __pyx_k_w_ratio, sizeof(__pyx_k_w_ratio), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 61, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 99, __pyx_L1_error) __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 354, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 354, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/rect.pyx":61 * * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< * * self.x = x */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Argument_must_be_a_rect_style_ob); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/rect.pyx":263 * * if not self.colliderect(other): * return Rect(0,0,0,0) # <<<<<<<<<<<<<< * * r = self.copy() */ __pyx_tuple__2 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_args); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __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__5)) __PYX_ERR(0, 22, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":68 * self.h = h * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Rect, (self.x, self.y, self.w, self.h)) * */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_reduce, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 68, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":209 * self.right, self.centery = val * * def copy(self): # <<<<<<<<<<<<<< * return Rect(self) * */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_copy, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 209, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":212 * return Rect(self) * * def move(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.move_ip(*args) */ __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_r); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_move, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 212, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":217 * return r * * def move_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * self.x += x */ __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_move_ip, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 217, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":222 * self.y += y * * def inflate(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.inflate_ip(*args) */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_inflate, 222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 222, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":227 * return r * * def inflate_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * c = self.center */ __pyx_tuple__14 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_c); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_inflate_ip, 227, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 227, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":234 * self.center = c * * def clamp(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.clamp_ip(other) */ __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_r); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_clamp, 234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 234, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":239 * return r * * def clamp_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_clamp_ip, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 239, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":255 * self.bottom = other.bottom * * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<< * if type(other) == int: * other = Rect(other, y, w, h) */ __pyx_tuple__20 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_r, __pyx_n_s_d); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_clip, 255, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 255, __pyx_L1_error) __pyx_tuple__22 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "pygame_sdl2/rect.pyx":285 * return r * * def union(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.union_ip(other) */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_union, 285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 285, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":290 * return r * * def union_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_tuple__24 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_union_ip, 290, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 290, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":301 * self.y = y * * def unionall(self, other_seq): # <<<<<<<<<<<<<< * r = self.copy() * r.unionall_ip(other_seq) */ __pyx_tuple__26 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other_seq, __pyx_n_s_r); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_unionall, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 301, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":306 * return r * * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<< * for other in other_seq: * self.union_ip(other) */ __pyx_tuple__28 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other_seq, __pyx_n_s_other); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_unionall_ip, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 306, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":310 * self.union_ip(other) * * def fit(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_tuple__30 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_r, __pyx_n_s_w_ratio, __pyx_n_s_h_ratio, __pyx_n_s_factor); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_fit, 310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 310, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":324 * return r * * def normalize(self): # <<<<<<<<<<<<<< * if self.w < 0: * self.x += self.w */ __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_normalize, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 324, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":332 * self.h = -self.h * * def contains(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_contains, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 332, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":340 * other.left < self.right and other.top < self.bottom * * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<< * if type(x) == tuple: * x, y = x */ __pyx_tuple__34 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_collidepoint, 340, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 340, __pyx_L1_error) __pyx_tuple__36 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "pygame_sdl2/rect.pyx":346 * x < self.right and y < self.bottom * * def colliderect(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_colliderect, 346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 346, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":353 * self.right > other.left and self.bottom > other.top * * def collidelist(self, other_list): # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other_list, __pyx_n_s_n, __pyx_n_s_other); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_collidelist, 353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 353, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":359 * return -1 * * def collidelistall(self, other_list): # <<<<<<<<<<<<<< * ret = [] * for n, other in zip(range(len(other_list)), other_list): */ __pyx_tuple__40 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_other_list, __pyx_n_s_ret, __pyx_n_s_n, __pyx_n_s_other); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_collidelistall, 359, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 359, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":366 * return ret * * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): */ __pyx_tuple__42 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_other_dict, __pyx_n_s_rects_values, __pyx_n_s_key, __pyx_n_s_val); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_collidedict, 366, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 366, __pyx_L1_error) __pyx_tuple__44 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); /* "pygame_sdl2/rect.pyx":373 * return None * * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * ret = [] * for key, val in other_dict.items(): */ __pyx_tuple__45 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_other_dict, __pyx_n_s_rects_values, __pyx_n_s_ret, __pyx_n_s_key, __pyx_n_s_val); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_collidedictall, 373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("to_sdl_rect", (void (*)(void))__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_4rect_Rect = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_4rect_Rect_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(0, 28, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_4rect_Rect_spec, __pyx_ptype_11pygame_sdl2_4rect_Rect) < 0) __PYX_ERR(0, 28, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_4rect_Rect = &__pyx_type_11pygame_sdl2_4rect_Rect; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_4rect_Rect) < 0) __PYX_ERR(0, 28, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_4rect_Rect->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_4rect_Rect->tp_dictoffset && __pyx_ptype_11pygame_sdl2_4rect_Rect->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_4rect_Rect->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Rect, (PyObject *) __pyx_ptype_11pygame_sdl2_4rect_Rect) < 0) __PYX_ERR(0, 28, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_4rect_Rect->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_4rect_Rect->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_4rect_Rect, __weakref__); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_rect(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_rect}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "rect", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initrect(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initrect(void) #else __Pyx_PyMODINIT_FUNC PyInit_rect(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_rect(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_rect(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'rect' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("rect", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "rect" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_rect(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__rect) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.rect")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.rect", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/rect.pyx":20 * # 3. This notice may not be removed or altered from any source distribution. * * import collections # <<<<<<<<<<<<<< * * def flatten(*args): */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_collections, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_1flatten, 0, __pyx_n_s_flatten, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flatten, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":68 * self.h = h * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Rect, (self.x, self.y, self.w, self.h)) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_3__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect___reduce, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_reduce, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":209 * self.right, self.centery = val * * def copy(self): # <<<<<<<<<<<<<< * return Rect(self) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_17copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_copy, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":212 * return Rect(self) * * def move(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.move_ip(*args) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_19move, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_move, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_move, __pyx_t_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":217 * return r * * def move_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * self.x += x */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_21move_ip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_move_ip, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_move_ip, __pyx_t_2) < 0) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":222 * self.y += y * * def inflate(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.inflate_ip(*args) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_23inflate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_inflate, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_inflate, __pyx_t_2) < 0) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":227 * return r * * def inflate_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * c = self.center */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_25inflate_ip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_inflate_ip, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_inflate_ip, __pyx_t_2) < 0) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":234 * self.center = c * * def clamp(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.clamp_ip(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_27clamp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_clamp, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_clamp, __pyx_t_2) < 0) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":239 * return r * * def clamp_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_29clamp_ip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_clamp_ip, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_clamp_ip, __pyx_t_2) < 0) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":255 * self.bottom = other.bottom * * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<< * if type(other) == int: * other = Rect(other, y, w, h) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_31clip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_clip, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__22); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_clip, __pyx_t_2) < 0) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":285 * return r * * def union(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.union_ip(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_33union, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_union, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_union, __pyx_t_2) < 0) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":290 * return r * * def union_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_35union_ip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_union_ip, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_union_ip, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":301 * self.y = y * * def unionall(self, other_seq): # <<<<<<<<<<<<<< * r = self.copy() * r.unionall_ip(other_seq) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_37unionall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_unionall, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_unionall, __pyx_t_2) < 0) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":306 * return r * * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<< * for other in other_seq: * self.union_ip(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_39unionall_ip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_unionall_ip, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_unionall_ip, __pyx_t_2) < 0) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":310 * self.union_ip(other) * * def fit(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_41fit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_fit, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_fit, __pyx_t_2) < 0) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":324 * return r * * def normalize(self): # <<<<<<<<<<<<<< * if self.w < 0: * self.x += self.w */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_43normalize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_normalize, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_normalize, __pyx_t_2) < 0) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":332 * self.h = -self.h * * def contains(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_45contains, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_contains, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_contains, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":340 * other.left < self.right and other.top < self.bottom * * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<< * if type(x) == tuple: * x, y = x */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_47collidepoint, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_collidepoint, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__36); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_collidepoint, __pyx_t_2) < 0) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":346 * x < self.right and y < self.bottom * * def colliderect(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_49colliderect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_colliderect, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_colliderect, __pyx_t_2) < 0) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":353 * self.right > other.left and self.bottom > other.top * * def collidelist(self, other_list): # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_51collidelist, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_collidelist, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_collidelist, __pyx_t_2) < 0) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":359 * return -1 * * def collidelistall(self, other_list): # <<<<<<<<<<<<<< * ret = [] * for n, other in zip(range(len(other_list)), other_list): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_53collidelistall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_collidelistall, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_collidelistall, __pyx_t_2) < 0) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":366 * return ret * * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_55collidedict, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_collidedict, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__44); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_collidedict, __pyx_t_2) < 0) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":373 * return None * * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * ret = [] * for key, val in other_dict.items(): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_57collidedictall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_collidedictall, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__44); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_collidedictall, __pyx_t_2) < 0) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # Copyright 2014 Patrick Dawson * # */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.rect"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 1; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a == b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) == 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 0; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 0; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal == 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a == (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_EQ)); } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* pybytes_as_double */ static double __Pyx_SlowPyString_AsDouble(PyObject *obj) { PyObject *float_value; #if PY_MAJOR_VERSION >= 3 float_value = PyFloat_FromString(obj); #else float_value = PyFloat_FromString(obj, 0); #endif if (likely(float_value)) { #if CYTHON_ASSUME_SAFE_MACROS double value = PyFloat_AS_DOUBLE(float_value); #else double value = PyFloat_AsDouble(float_value); #endif Py_DECREF(float_value); return value; } return (double)-1; } static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) { int last_was_punctuation = 1; Py_ssize_t i; for (i=0; i < length; i++) { char chr = start[i]; int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E'); *buffer = chr; buffer += (chr != '_'); if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure; last_was_punctuation = is_punctuation; } if (unlikely(last_was_punctuation)) goto parse_failure; *buffer = '\0'; return buffer; parse_failure: return NULL; } static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) { int matches = 1; char sign = start[0]; int is_signed = (sign == '+') | (sign == '-'); start += is_signed; length -= is_signed; switch (start[0]) { #ifdef Py_NAN case 'n': case 'N': if (unlikely(length != 3)) goto parse_failure; matches &= (start[1] == 'a' || start[1] == 'A'); matches &= (start[2] == 'n' || start[2] == 'N'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_NAN : Py_NAN; #endif case 'i': case 'I': if (unlikely(length < 3)) goto parse_failure; matches &= (start[1] == 'n' || start[1] == 'N'); matches &= (start[2] == 'f' || start[2] == 'F'); if (likely(length == 3 && matches)) return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; if (unlikely(length != 8)) goto parse_failure; matches &= (start[3] == 'i' || start[3] == 'I'); matches &= (start[4] == 'n' || start[4] == 'N'); matches &= (start[5] == 'i' || start[5] == 'I'); matches &= (start[6] == 't' || start[6] == 'T'); matches &= (start[7] == 'y' || start[7] == 'Y'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: goto parse_failure; } return 0.0; parse_failure: return -1.0; } static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) { return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd)); } CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) { double value; Py_ssize_t i, digits; const char *last = start + length; char *end; while (__Pyx__PyBytes_AsDouble_IsSpace(*start)) start++; while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1])) last--; length = last - start; if (unlikely(length <= 0)) goto fallback; value = __Pyx__PyBytes_AsDouble_inf_nan(start, length); if (unlikely(value == -1.0)) goto fallback; if (value != 0.0) return value; digits = 0; for (i=0; i < length; digits += start[i++] != '_'); if (likely(digits == length)) { value = PyOS_string_to_double(start, &end, NULL); } else if (digits < 40) { char number[40]; last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); if (unlikely(!last)) goto fallback; value = PyOS_string_to_double(number, &end, NULL); } else { char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char)); if (unlikely(!number)) goto fallback; last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); if (unlikely(!last)) { PyMem_Free(number); goto fallback; } value = PyOS_string_to_double(number, &end, NULL); PyMem_Free(number); } if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { return value; } fallback: return __Pyx_SlowPyString_AsDouble(obj); } /* pynumber_float */ static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) { double val; if (PyLong_CheckExact(obj)) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(obj))) { val = (double) __Pyx_PyLong_CompactValue(obj); goto no_error; } #endif val = PyLong_AsDouble(obj); } else if (PyUnicode_CheckExact(obj)) { val = __Pyx_PyUnicode_AsDouble(obj); } else if (PyBytes_CheckExact(obj)) { val = __Pyx_PyBytes_AsDouble(obj); } else if (PyByteArray_CheckExact(obj)) { val = __Pyx_PyByteArray_AsDouble(obj); } else { return PyNumber_Float(obj); } if (unlikely(val == -1 && PyErr_Occurred())) { return NULL; } #if CYTHON_USE_PYLONG_INTERNALS no_error: #endif return PyFloat_FromDouble(val); } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } *pvalue1 = value1; *pvalue2 = value2; return 0; #if CYTHON_COMPILING_IN_PYPY bad: Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; #endif } static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = __Pyx_PyObject_GetIterNextFunc(iter); value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { #if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; #elif PY_MAJOR_VERSION >= 3 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { const char *name = PyUnicode_AsUTF8(method_name); if (strcmp(name, "iteritems") == 0) pp = &py_items; else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; else if (strcmp(name, "itervalues") == 0) pp = &py_values; if (pp) { if (!*pp) { *pp = PyUnicode_FromString(name + 4); if (!*pp) return NULL; } method_name = *pp; } } #endif } *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__3; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__47); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; cobj = PyCapsule_New(tmp.p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709476.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.render.c0000664000175000017500000343115114760217144020303 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__render #define __PYX_HAVE_API__pygame_sdl2__render /* Early includes */ #include #include #include #include #include "SDL.h" #include "sdl_image_compat.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/render.pyx", "", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", "src/pygame_sdl2/rect.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_6render_Renderer; struct __pyx_obj_11pygame_sdl2_6render_Texture; struct __pyx_obj_11pygame_sdl2_6render_TextureNode; struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas; struct __pyx_obj_11pygame_sdl2_6render_Sprite; struct __pyx_obj_11pygame_sdl2_6render_Container; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/render.pyx":67 * * * cdef class Renderer: # <<<<<<<<<<<<<< * cdef SDL_Renderer *renderer * cdef dict _info */ struct __pyx_obj_11pygame_sdl2_6render_Renderer { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *__pyx_vtab; SDL_Renderer *renderer; PyObject *_info; }; /* "pygame_sdl2/render.pyx":172 * * * cdef class Texture: # <<<<<<<<<<<<<< * """ Mostly for internal use. Users should only see this for RTT. """ * */ struct __pyx_obj_11pygame_sdl2_6render_Texture { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture *__pyx_vtab; SDL_Renderer *renderer; SDL_Texture *texture; int w; int h; }; /* "pygame_sdl2/render.pyx":200 * * * cdef class TextureNode: # <<<<<<<<<<<<<< * """ A specified area of a texture. """ * */ struct __pyx_obj_11pygame_sdl2_6render_TextureNode { PyObject_HEAD struct __pyx_obj_11pygame_sdl2_6render_Texture *texture; SDL_Rect source_rect; SDL_Rect trimmed_rect; int source_w; int source_h; }; /* "pygame_sdl2/render.pyx":245 * * * cdef class TextureAtlas: # <<<<<<<<<<<<<< * cdef object frames * */ struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas { PyObject_HEAD PyObject *frames; }; /* "pygame_sdl2/render.pyx":278 * * * cdef class Sprite: # <<<<<<<<<<<<<< * """ One or more TextureNodes, with possible transforms applied. """ * */ struct __pyx_obj_11pygame_sdl2_6render_Sprite { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *__pyx_vtab; PyObject *nodes; SDL_Rect _pos; SDL_Rect bounding_box; double _rotation; int _flip; SDL_Color _color; double _scalex; double _scaley; }; /* "pygame_sdl2/render.pyx":433 * * * cdef class Container: # <<<<<<<<<<<<<< * """ Multiple sprites, positioned relative to the container. """ * */ struct __pyx_obj_11pygame_sdl2_6render_Container { PyObject_HEAD SDL_Rect _rect; PyObject *sprites; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/render.pyx":67 * * * cdef class Renderer: # <<<<<<<<<<<<<< * cdef SDL_Renderer *renderer * cdef dict _info */ struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer { PyObject *(*set_drawcolor)(struct __pyx_obj_11pygame_sdl2_6render_Renderer *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *__pyx_vtabptr_11pygame_sdl2_6render_Renderer; /* "pygame_sdl2/render.pyx":172 * * * cdef class Texture: # <<<<<<<<<<<<<< * """ Mostly for internal use. Users should only see this for RTT. """ * */ struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture { PyObject *(*set)(struct __pyx_obj_11pygame_sdl2_6render_Texture *, SDL_Renderer *, SDL_Texture *); }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture *__pyx_vtabptr_11pygame_sdl2_6render_Texture; /* "pygame_sdl2/render.pyx":278 * * * cdef class Sprite: # <<<<<<<<<<<<<< * """ One or more TextureNodes, with possible transforms applied. """ * */ struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite { void (*adjust_rect)(struct __pyx_obj_11pygame_sdl2_6render_Sprite *, SDL_Rect const *, SDL_Rect const *, SDL_Rect *); }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *__pyx_vtabptr_11pygame_sdl2_6render_Sprite; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ (likely(is_tuple || PyTuple_Check(tuple)) ?\ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* ErrOccurredWithGIL.proto */ static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) #else static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 #define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_8 { __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_BlendMode(SDL_BlendMode value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* VoidPtrImport.proto */ static int __Pyx_ImportVoidPtr_3_0_8(PyObject *module, const char *name, void **p, const char *sig); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ static PyObject *__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_col); /* proto*/ static PyObject *__pyx_f_11pygame_sdl2_6render_7Texture_set(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, SDL_Renderer *__pyx_v_ren, SDL_Texture *__pyx_v_tex); /* proto*/ static void __pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, SDL_Rect const *__pyx_v_dest, SDL_Rect const *__pyx_v_rin, SDL_Rect *__pyx_v_rout); /* proto*/ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_image" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.display" */ static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.rect" */ static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.render" */ static int __pyx_v_11pygame_sdl2_6render_DEBUG_DRAW_BBOX; static PyObject *__pyx_f_11pygame_sdl2_6render_rinfo_to_dict(SDL_RendererInfo *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_6render___pyx_unpickle_TextureAtlas__set_state(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *, PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.render" extern int __pyx_module_is_main_pygame_sdl2__render; int __pyx_module_is_main_pygame_sdl2__render = 0; /* Implementation of "pygame_sdl2.render" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_open; /* #### Code section: string_decls ### */ static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k_g[] = "g"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "s"; static const char __pyx_k_t[] = "t"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__2[] = "."; static const char __pyx_k__3[] = "*"; static const char __pyx_k_fi[] = "fi"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_r1[] = "r1"; static const char __pyx_k_r2[] = "r2"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k_tn[] = "tn"; static const char __pyx_k_x1[] = "x1"; static const char __pyx_k_x2[] = "x2"; static const char __pyx_k_y1[] = "y1"; static const char __pyx_k_y2[] = "y2"; static const char __pyx_k__54[] = "?"; static const char __pyx_k_add[] = "add"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_ren[] = "ren"; static const char __pyx_k_rtt[] = "rtt"; static const char __pyx_k_tex[] = "tex"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_dest[] = "dest"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_info[] = "info"; static const char __pyx_k_json[] = "json"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_load[] = "load"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_meta[] = "meta"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_open[] = "open"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_warn[] = "warn"; static const char __pyx_k_Color[] = "Color"; static const char __pyx_k_clear[] = "clear"; static const char __pyx_k_color[] = "color"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_frame[] = "frame"; static const char __pyx_k_image[] = "image"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_nodes[] = "nodes"; static const char __pyx_k_other[] = "other"; static const char __pyx_k_pivot[] = "pivot"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_rinfo[] = "rinfo"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_vsync[] = "vsync"; static const char __pyx_k_Sprite[] = "Sprite"; static const char __pyx_k_dict_2[] = "_dict"; static const char __pyx_k_driver[] = "driver"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_frames[] = "frames"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_render[] = "render"; static const char __pyx_k_sprite[] = "sprite"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_vprect[] = "vprect"; static const char __pyx_k_window[] = "window"; static const char __pyx_k_Texture[] = "Texture"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_rotated[] = "rotated"; static const char __pyx_k_Renderer[] = "Renderer"; static const char __pyx_k_collides[] = "collides"; static const char __pyx_k_filename[] = "filename"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_software[] = "software"; static const char __pyx_k_warnings[] = "warnings"; static const char __pyx_k_Container[] = "Container"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_dest_rect[] = "dest_rect"; static const char __pyx_k_draw_line[] = "draw_line"; static const char __pyx_k_draw_rect[] = "draw_rect"; static const char __pyx_k_fill_rect[] = "fill_rect"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_real_dest[] = "real_dest"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_draw_point[] = "draw_point"; static const char __pyx_k_load_atlas[] = "load_atlas"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_sourceSize[] = "sourceSize"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_TextureNode[] = "TextureNode"; static const char __pyx_k_accelerated[] = "accelerated"; static const char __pyx_k_get_drivers[] = "get_drivers"; static const char __pyx_k_num_drivers[] = "num_drivers"; static const char __pyx_k_TextureAtlas[] = "TextureAtlas"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_load_texture[] = "load_texture"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_set_viewport[] = "set_viewport"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_use_setstate[] = "use_setstate"; static const char __pyx_k_BLENDMODE_ADD[] = "BLENDMODE_ADD"; static const char __pyx_k_BLENDMODE_MOD[] = "BLENDMODE_MOD"; static const char __pyx_k_Container_add[] = "Container.add"; static const char __pyx_k_Renderer_info[] = "Renderer.info"; static const char __pyx_k_Sprite_render[] = "Sprite.render"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_BLENDMODE_NONE[] = "BLENDMODE_NONE"; static const char __pyx_k_Renderer_clear[] = "Renderer.clear"; static const char __pyx_k_create_texture[] = "create_texture"; static const char __pyx_k_render_present[] = "render_present"; static const char __pyx_k_BLENDMODE_BLEND[] = "BLENDMODE_BLEND"; static const char __pyx_k_Sprite_collides[] = "Sprite.collides"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Container_render[] = "Container.render"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_spriteSourceSize[] = "spriteSourceSize"; static const char __pyx_k_TextureAtlas_keys[] = "TextureAtlas.keys"; static const char __pyx_k_max_texture_width[] = "max_texture_width"; static const char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_Invalid_argument_s[] = "Invalid argument: %s"; static const char __pyx_k_Renderer_draw_line[] = "Renderer.draw_line"; static const char __pyx_k_Renderer_draw_rect[] = "Renderer.draw_rect"; static const char __pyx_k_Renderer_fill_rect[] = "Renderer.fill_rect"; static const char __pyx_k_TextureNode_render[] = "TextureNode.render"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_max_texture_height[] = "max_texture_height"; static const char __pyx_k_pygame_sdl2_render[] = "pygame_sdl2.render"; static const char __pyx_k_Renderer_draw_point[] = "Renderer.draw_point"; static const char __pyx_k_Renderer_load_atlas[] = "Renderer.load_atlas"; static const char __pyx_k_Renderer_load_texture[] = "Renderer.load_texture"; static const char __pyx_k_Renderer_set_viewport[] = "Renderer.set_viewport"; static const char __pyx_k_Sprite___reduce_cython[] = "Sprite.__reduce_cython__"; static const char __pyx_k_Renderer_create_texture[] = "Renderer.create_texture"; static const char __pyx_k_Renderer_render_present[] = "Renderer.render_present"; static const char __pyx_k_Texture___reduce_cython[] = "Texture.__reduce_cython__"; static const char __pyx_k_Renderer___reduce_cython[] = "Renderer.__reduce_cython__"; static const char __pyx_k_Sprite___setstate_cython[] = "Sprite.__setstate_cython__"; static const char __pyx_k_Container___reduce_cython[] = "Container.__reduce_cython__"; static const char __pyx_k_Texture___setstate_cython[] = "Texture.__setstate_cython__"; static const char __pyx_k_pyx_unpickle_TextureAtlas[] = "__pyx_unpickle_TextureAtlas"; static const char __pyx_k_Renderer___setstate_cython[] = "Renderer.__setstate_cython__"; static const char __pyx_k_Rotation_not_supported_yet[] = "Rotation not supported yet."; static const char __pyx_k_src_pygame_sdl2_render_pyx[] = "src/pygame_sdl2/render.pyx"; static const char __pyx_k_Container___setstate_cython[] = "Container.__setstate_cython__"; static const char __pyx_k_Renderer_is_not_accelerated[] = "Renderer is not accelerated."; static const char __pyx_k_TextureNode___reduce_cython[] = "TextureNode.__reduce_cython__"; static const char __pyx_k_TextureAtlas___reduce_cython[] = "TextureAtlas.__reduce_cython__"; static const char __pyx_k_TextureNode___setstate_cython[] = "TextureNode.__setstate_cython__"; static const char __pyx_k_TextureAtlas___setstate_cython[] = "TextureAtlas.__setstate_cython__"; static const char __pyx_k_Pickling_of_struct_members_such[] = "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)"; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_Pickling_of_struct_members_such_2[] = "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)"; static const char __pyx_k_Pickling_of_struct_members_such_3[] = "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_6render_get_drivers(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_8Renderer___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_6render_8Renderer_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_8Renderer_4__init__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window, PyObject *__pyx_v_vsync, PyObject *__pyx_v_driver); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_6load_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_8load_atlas(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_10render_present(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_12info(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_14clear(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_16draw_line(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_18draw_point(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_20draw_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_22fill_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_24set_viewport(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_26create_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_28__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_30__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_7Texture___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_6render_7Texture_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1w___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_7Texture_1w_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1h___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_7Texture_1h_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_11TextureNode___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_tex); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_2render(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_dest); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_12TextureAtlas___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_ren, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_2__getitem__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_4keys(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite___init__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_nodes); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_2render(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_dest); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_4collides(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5color___set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5scale___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_arg); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_9Container___init__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_2add(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_sprite); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4render(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dest); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_9Container_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4rect___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_9Container_4rect_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_2__pyx_unpickle_TextureAtlas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Renderer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Texture(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureNode(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureAtlas(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Sprite(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Container(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect; #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_6render_Renderer; PyObject *__pyx_type_11pygame_sdl2_6render_Texture; PyObject *__pyx_type_11pygame_sdl2_6render_TextureNode; PyObject *__pyx_type_11pygame_sdl2_6render_TextureAtlas; PyObject *__pyx_type_11pygame_sdl2_6render_Sprite; PyObject *__pyx_type_11pygame_sdl2_6render_Container; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Renderer; PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Texture; PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_TextureNode; PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_TextureAtlas; PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Sprite; PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Container; PyObject *__pyx_n_s_BLENDMODE_ADD; PyObject *__pyx_n_s_BLENDMODE_BLEND; PyObject *__pyx_n_s_BLENDMODE_MOD; PyObject *__pyx_n_s_BLENDMODE_NONE; PyObject *__pyx_n_s_Color; PyObject *__pyx_n_s_Container; PyObject *__pyx_n_s_Container___reduce_cython; PyObject *__pyx_n_s_Container___setstate_cython; PyObject *__pyx_n_s_Container_add; PyObject *__pyx_n_s_Container_render; PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; PyObject *__pyx_kp_s_Invalid_argument_s; PyObject *__pyx_n_s_PickleError; PyObject *__pyx_kp_s_Pickling_of_struct_members_such; PyObject *__pyx_kp_s_Pickling_of_struct_members_such_2; PyObject *__pyx_kp_s_Pickling_of_struct_members_such_3; PyObject *__pyx_n_s_Rect; PyObject *__pyx_n_s_Renderer; PyObject *__pyx_n_s_Renderer___reduce_cython; PyObject *__pyx_n_s_Renderer___setstate_cython; PyObject *__pyx_n_s_Renderer_clear; PyObject *__pyx_n_s_Renderer_create_texture; PyObject *__pyx_n_s_Renderer_draw_line; PyObject *__pyx_n_s_Renderer_draw_point; PyObject *__pyx_n_s_Renderer_draw_rect; PyObject *__pyx_n_s_Renderer_fill_rect; PyObject *__pyx_n_s_Renderer_info; PyObject *__pyx_kp_s_Renderer_is_not_accelerated; PyObject *__pyx_n_s_Renderer_load_atlas; PyObject *__pyx_n_s_Renderer_load_texture; PyObject *__pyx_n_s_Renderer_render_present; PyObject *__pyx_n_s_Renderer_set_viewport; PyObject *__pyx_kp_s_Rotation_not_supported_yet; PyObject *__pyx_n_s_Sprite; PyObject *__pyx_n_s_Sprite___reduce_cython; PyObject *__pyx_n_s_Sprite___setstate_cython; PyObject *__pyx_n_s_Sprite_collides; PyObject *__pyx_n_s_Sprite_render; PyObject *__pyx_n_s_Texture; PyObject *__pyx_n_s_TextureAtlas; PyObject *__pyx_n_s_TextureAtlas___reduce_cython; PyObject *__pyx_n_s_TextureAtlas___setstate_cython; PyObject *__pyx_n_s_TextureAtlas_keys; PyObject *__pyx_n_s_TextureNode; PyObject *__pyx_n_s_TextureNode___reduce_cython; PyObject *__pyx_n_s_TextureNode___setstate_cython; PyObject *__pyx_n_s_TextureNode_render; PyObject *__pyx_n_s_Texture___reduce_cython; PyObject *__pyx_n_s_Texture___setstate_cython; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_kp_u__2; PyObject *__pyx_n_s__3; PyObject *__pyx_n_s__54; PyObject *__pyx_n_s_a; PyObject *__pyx_n_s_accelerated; PyObject *__pyx_n_s_add; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_b; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_clear; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_collides; PyObject *__pyx_n_s_color; PyObject *__pyx_n_s_create_texture; PyObject *__pyx_n_s_dest; PyObject *__pyx_n_s_dest_rect; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_dict_2; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_draw_line; PyObject *__pyx_n_s_draw_point; PyObject *__pyx_n_s_draw_rect; PyObject *__pyx_n_s_driver; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_fi; PyObject *__pyx_n_s_filename; PyObject *__pyx_n_s_fill_rect; PyObject *__pyx_n_s_frame; PyObject *__pyx_n_s_frames; PyObject *__pyx_n_s_g; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_drivers; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_image; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_info; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_items; PyObject *__pyx_n_s_json; PyObject *__pyx_n_s_keys; PyObject *__pyx_n_s_load; PyObject *__pyx_n_s_load_atlas; PyObject *__pyx_n_s_load_texture; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_max_texture_height; PyObject *__pyx_n_s_max_texture_width; PyObject *__pyx_n_s_meta; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_n_s_new; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_nodes; PyObject *__pyx_n_s_num_drivers; PyObject *__pyx_n_s_open; PyObject *__pyx_n_s_other; PyObject *__pyx_n_s_pickle; PyObject *__pyx_n_s_pivot; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_pygame_sdl2_color; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_rect; PyObject *__pyx_n_s_pygame_sdl2_render; PyObject *__pyx_n_s_pyx_PickleError; PyObject *__pyx_n_s_pyx_checksum; PyObject *__pyx_n_s_pyx_result; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_type; PyObject *__pyx_n_s_pyx_unpickle_TextureAtlas; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_r1; PyObject *__pyx_n_s_r2; PyObject *__pyx_n_s_range; PyObject *__pyx_n_s_real_dest; PyObject *__pyx_n_s_rect; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_ren; PyObject *__pyx_n_s_render; PyObject *__pyx_n_s_render_present; PyObject *__pyx_n_s_rinfo; PyObject *__pyx_n_s_rotated; PyObject *__pyx_n_s_rtt; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_s; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_viewport; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_software; PyObject *__pyx_n_s_sourceSize; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_sprite; PyObject *__pyx_n_s_spriteSourceSize; PyObject *__pyx_kp_s_src_pygame_sdl2_render_pyx; PyObject *__pyx_n_s_state; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_t; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_tex; PyObject *__pyx_n_s_tn; PyObject *__pyx_n_s_update; PyObject *__pyx_n_s_use_setstate; PyObject *__pyx_n_s_vprect; PyObject *__pyx_n_s_vsync; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_warn; PyObject *__pyx_n_s_warnings; PyObject *__pyx_n_s_window; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_x1; PyObject *__pyx_n_s_x2; PyObject *__pyx_n_s_y; PyObject *__pyx_n_s_y1; PyObject *__pyx_n_s_y2; PyObject *__pyx_int_0; PyObject *__pyx_int_93638610; PyObject *__pyx_int_231588268; PyObject *__pyx_int_243099540; PyObject *__pyx_int_neg_1; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__32; PyObject *__pyx_tuple__37; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__42; PyObject *__pyx_tuple__46; PyObject *__pyx_tuple__48; PyObject *__pyx_tuple__52; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__31; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__38; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__43; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__45; PyObject *__pyx_codeobj__47; PyObject *__pyx_codeobj__49; PyObject *__pyx_codeobj__50; PyObject *__pyx_codeobj__51; PyObject *__pyx_codeobj__53; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_6render_Renderer); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_6render_Renderer); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_6render_Texture); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_6render_Texture); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_6render_TextureNode); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_6render_TextureNode); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_6render_TextureAtlas); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_6render_TextureAtlas); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_6render_Sprite); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_6render_Sprite); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_6render_Container); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_6render_Container); Py_CLEAR(clear_module_state->__pyx_n_s_BLENDMODE_ADD); Py_CLEAR(clear_module_state->__pyx_n_s_BLENDMODE_BLEND); Py_CLEAR(clear_module_state->__pyx_n_s_BLENDMODE_MOD); Py_CLEAR(clear_module_state->__pyx_n_s_BLENDMODE_NONE); Py_CLEAR(clear_module_state->__pyx_n_s_Color); Py_CLEAR(clear_module_state->__pyx_n_s_Container); Py_CLEAR(clear_module_state->__pyx_n_s_Container___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Container___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Container_add); Py_CLEAR(clear_module_state->__pyx_n_s_Container_render); Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_CLEAR(clear_module_state->__pyx_kp_s_Invalid_argument_s); Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); Py_CLEAR(clear_module_state->__pyx_kp_s_Pickling_of_struct_members_such); Py_CLEAR(clear_module_state->__pyx_kp_s_Pickling_of_struct_members_such_2); Py_CLEAR(clear_module_state->__pyx_kp_s_Pickling_of_struct_members_such_3); Py_CLEAR(clear_module_state->__pyx_n_s_Rect); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_clear); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_create_texture); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_draw_line); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_draw_point); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_draw_rect); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_fill_rect); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_info); Py_CLEAR(clear_module_state->__pyx_kp_s_Renderer_is_not_accelerated); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_load_atlas); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_load_texture); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_render_present); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_set_viewport); Py_CLEAR(clear_module_state->__pyx_kp_s_Rotation_not_supported_yet); Py_CLEAR(clear_module_state->__pyx_n_s_Sprite); Py_CLEAR(clear_module_state->__pyx_n_s_Sprite___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Sprite___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Sprite_collides); Py_CLEAR(clear_module_state->__pyx_n_s_Sprite_render); Py_CLEAR(clear_module_state->__pyx_n_s_Texture); Py_CLEAR(clear_module_state->__pyx_n_s_TextureAtlas); Py_CLEAR(clear_module_state->__pyx_n_s_TextureAtlas___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_TextureAtlas___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_TextureAtlas_keys); Py_CLEAR(clear_module_state->__pyx_n_s_TextureNode); Py_CLEAR(clear_module_state->__pyx_n_s_TextureNode___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_TextureNode___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_TextureNode_render); Py_CLEAR(clear_module_state->__pyx_n_s_Texture___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Texture___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_n_s__3); Py_CLEAR(clear_module_state->__pyx_n_s__54); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_s_accelerated); Py_CLEAR(clear_module_state->__pyx_n_s_add); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_b); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_clear); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_collides); Py_CLEAR(clear_module_state->__pyx_n_s_color); Py_CLEAR(clear_module_state->__pyx_n_s_create_texture); Py_CLEAR(clear_module_state->__pyx_n_s_dest); Py_CLEAR(clear_module_state->__pyx_n_s_dest_rect); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_draw_line); Py_CLEAR(clear_module_state->__pyx_n_s_draw_point); Py_CLEAR(clear_module_state->__pyx_n_s_draw_rect); Py_CLEAR(clear_module_state->__pyx_n_s_driver); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_fi); Py_CLEAR(clear_module_state->__pyx_n_s_filename); Py_CLEAR(clear_module_state->__pyx_n_s_fill_rect); Py_CLEAR(clear_module_state->__pyx_n_s_frame); Py_CLEAR(clear_module_state->__pyx_n_s_frames); Py_CLEAR(clear_module_state->__pyx_n_s_g); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_drivers); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_image); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_info); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_items); Py_CLEAR(clear_module_state->__pyx_n_s_json); Py_CLEAR(clear_module_state->__pyx_n_s_keys); Py_CLEAR(clear_module_state->__pyx_n_s_load); Py_CLEAR(clear_module_state->__pyx_n_s_load_atlas); Py_CLEAR(clear_module_state->__pyx_n_s_load_texture); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_max_texture_height); Py_CLEAR(clear_module_state->__pyx_n_s_max_texture_width); Py_CLEAR(clear_module_state->__pyx_n_s_meta); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_n_s_new); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_nodes); Py_CLEAR(clear_module_state->__pyx_n_s_num_drivers); Py_CLEAR(clear_module_state->__pyx_n_s_open); Py_CLEAR(clear_module_state->__pyx_n_s_other); Py_CLEAR(clear_module_state->__pyx_n_s_pickle); Py_CLEAR(clear_module_state->__pyx_n_s_pivot); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_color); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rect); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_render); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_TextureAtlas); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_r1); Py_CLEAR(clear_module_state->__pyx_n_s_r2); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_s_real_dest); Py_CLEAR(clear_module_state->__pyx_n_s_rect); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_ren); Py_CLEAR(clear_module_state->__pyx_n_s_render); Py_CLEAR(clear_module_state->__pyx_n_s_render_present); Py_CLEAR(clear_module_state->__pyx_n_s_rinfo); Py_CLEAR(clear_module_state->__pyx_n_s_rotated); Py_CLEAR(clear_module_state->__pyx_n_s_rtt); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_s); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_viewport); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_software); Py_CLEAR(clear_module_state->__pyx_n_s_sourceSize); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_sprite); Py_CLEAR(clear_module_state->__pyx_n_s_spriteSourceSize); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_render_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_t); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_tex); Py_CLEAR(clear_module_state->__pyx_n_s_tn); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_vprect); Py_CLEAR(clear_module_state->__pyx_n_s_vsync); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_warn); Py_CLEAR(clear_module_state->__pyx_n_s_warnings); Py_CLEAR(clear_module_state->__pyx_n_s_window); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_x1); Py_CLEAR(clear_module_state->__pyx_n_s_x2); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_n_s_y1); Py_CLEAR(clear_module_state->__pyx_n_s_y2); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_93638610); Py_CLEAR(clear_module_state->__pyx_int_231588268); Py_CLEAR(clear_module_state->__pyx_int_243099540); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__32); Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__42); Py_CLEAR(clear_module_state->__pyx_tuple__46); Py_CLEAR(clear_module_state->__pyx_tuple__48); Py_CLEAR(clear_module_state->__pyx_tuple__52); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__31); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__38); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__43); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__45); Py_CLEAR(clear_module_state->__pyx_codeobj__47); Py_CLEAR(clear_module_state->__pyx_codeobj__49); Py_CLEAR(clear_module_state->__pyx_codeobj__50); Py_CLEAR(clear_module_state->__pyx_codeobj__51); Py_CLEAR(clear_module_state->__pyx_codeobj__53); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_6render_Renderer); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_6render_Renderer); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_6render_Texture); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_6render_Texture); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_6render_TextureNode); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_6render_TextureNode); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_6render_TextureAtlas); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_6render_TextureAtlas); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_6render_Sprite); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_6render_Sprite); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_6render_Container); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_6render_Container); Py_VISIT(traverse_module_state->__pyx_n_s_BLENDMODE_ADD); Py_VISIT(traverse_module_state->__pyx_n_s_BLENDMODE_BLEND); Py_VISIT(traverse_module_state->__pyx_n_s_BLENDMODE_MOD); Py_VISIT(traverse_module_state->__pyx_n_s_BLENDMODE_NONE); Py_VISIT(traverse_module_state->__pyx_n_s_Color); Py_VISIT(traverse_module_state->__pyx_n_s_Container); Py_VISIT(traverse_module_state->__pyx_n_s_Container___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Container___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Container_add); Py_VISIT(traverse_module_state->__pyx_n_s_Container_render); Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_VISIT(traverse_module_state->__pyx_kp_s_Invalid_argument_s); Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); Py_VISIT(traverse_module_state->__pyx_kp_s_Pickling_of_struct_members_such); Py_VISIT(traverse_module_state->__pyx_kp_s_Pickling_of_struct_members_such_2); Py_VISIT(traverse_module_state->__pyx_kp_s_Pickling_of_struct_members_such_3); Py_VISIT(traverse_module_state->__pyx_n_s_Rect); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_clear); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_create_texture); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_draw_line); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_draw_point); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_draw_rect); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_fill_rect); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_info); Py_VISIT(traverse_module_state->__pyx_kp_s_Renderer_is_not_accelerated); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_load_atlas); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_load_texture); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_render_present); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_set_viewport); Py_VISIT(traverse_module_state->__pyx_kp_s_Rotation_not_supported_yet); Py_VISIT(traverse_module_state->__pyx_n_s_Sprite); Py_VISIT(traverse_module_state->__pyx_n_s_Sprite___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Sprite___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Sprite_collides); Py_VISIT(traverse_module_state->__pyx_n_s_Sprite_render); Py_VISIT(traverse_module_state->__pyx_n_s_Texture); Py_VISIT(traverse_module_state->__pyx_n_s_TextureAtlas); Py_VISIT(traverse_module_state->__pyx_n_s_TextureAtlas___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_TextureAtlas___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_TextureAtlas_keys); Py_VISIT(traverse_module_state->__pyx_n_s_TextureNode); Py_VISIT(traverse_module_state->__pyx_n_s_TextureNode___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_TextureNode___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_TextureNode_render); Py_VISIT(traverse_module_state->__pyx_n_s_Texture___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Texture___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_n_s__3); Py_VISIT(traverse_module_state->__pyx_n_s__54); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_s_accelerated); Py_VISIT(traverse_module_state->__pyx_n_s_add); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_b); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_clear); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_collides); Py_VISIT(traverse_module_state->__pyx_n_s_color); Py_VISIT(traverse_module_state->__pyx_n_s_create_texture); Py_VISIT(traverse_module_state->__pyx_n_s_dest); Py_VISIT(traverse_module_state->__pyx_n_s_dest_rect); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_draw_line); Py_VISIT(traverse_module_state->__pyx_n_s_draw_point); Py_VISIT(traverse_module_state->__pyx_n_s_draw_rect); Py_VISIT(traverse_module_state->__pyx_n_s_driver); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_fi); Py_VISIT(traverse_module_state->__pyx_n_s_filename); Py_VISIT(traverse_module_state->__pyx_n_s_fill_rect); Py_VISIT(traverse_module_state->__pyx_n_s_frame); Py_VISIT(traverse_module_state->__pyx_n_s_frames); Py_VISIT(traverse_module_state->__pyx_n_s_g); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_drivers); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_image); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_info); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_items); Py_VISIT(traverse_module_state->__pyx_n_s_json); Py_VISIT(traverse_module_state->__pyx_n_s_keys); Py_VISIT(traverse_module_state->__pyx_n_s_load); Py_VISIT(traverse_module_state->__pyx_n_s_load_atlas); Py_VISIT(traverse_module_state->__pyx_n_s_load_texture); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_max_texture_height); Py_VISIT(traverse_module_state->__pyx_n_s_max_texture_width); Py_VISIT(traverse_module_state->__pyx_n_s_meta); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_n_s_new); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_nodes); Py_VISIT(traverse_module_state->__pyx_n_s_num_drivers); Py_VISIT(traverse_module_state->__pyx_n_s_open); Py_VISIT(traverse_module_state->__pyx_n_s_other); Py_VISIT(traverse_module_state->__pyx_n_s_pickle); Py_VISIT(traverse_module_state->__pyx_n_s_pivot); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_color); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rect); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_render); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_TextureAtlas); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_r1); Py_VISIT(traverse_module_state->__pyx_n_s_r2); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_s_real_dest); Py_VISIT(traverse_module_state->__pyx_n_s_rect); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_ren); Py_VISIT(traverse_module_state->__pyx_n_s_render); Py_VISIT(traverse_module_state->__pyx_n_s_render_present); Py_VISIT(traverse_module_state->__pyx_n_s_rinfo); Py_VISIT(traverse_module_state->__pyx_n_s_rotated); Py_VISIT(traverse_module_state->__pyx_n_s_rtt); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_s); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_viewport); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_software); Py_VISIT(traverse_module_state->__pyx_n_s_sourceSize); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_sprite); Py_VISIT(traverse_module_state->__pyx_n_s_spriteSourceSize); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_render_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_t); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_tex); Py_VISIT(traverse_module_state->__pyx_n_s_tn); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_vprect); Py_VISIT(traverse_module_state->__pyx_n_s_vsync); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_warn); Py_VISIT(traverse_module_state->__pyx_n_s_warnings); Py_VISIT(traverse_module_state->__pyx_n_s_window); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_x1); Py_VISIT(traverse_module_state->__pyx_n_s_x2); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_n_s_y1); Py_VISIT(traverse_module_state->__pyx_n_s_y2); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_93638610); Py_VISIT(traverse_module_state->__pyx_int_231588268); Py_VISIT(traverse_module_state->__pyx_int_243099540); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__32); Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__42); Py_VISIT(traverse_module_state->__pyx_tuple__46); Py_VISIT(traverse_module_state->__pyx_tuple__48); Py_VISIT(traverse_module_state->__pyx_tuple__52); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__31); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__38); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__43); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__45); Py_VISIT(traverse_module_state->__pyx_codeobj__47); Py_VISIT(traverse_module_state->__pyx_codeobj__49); Py_VISIT(traverse_module_state->__pyx_codeobj__50); Py_VISIT(traverse_module_state->__pyx_codeobj__51); Py_VISIT(traverse_module_state->__pyx_codeobj__53); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7display_Window __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7display_Window #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_4rect_Rect __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_4rect_Rect #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_6render_Renderer __pyx_mstate_global->__pyx_type_11pygame_sdl2_6render_Renderer #define __pyx_type_11pygame_sdl2_6render_Texture __pyx_mstate_global->__pyx_type_11pygame_sdl2_6render_Texture #define __pyx_type_11pygame_sdl2_6render_TextureNode __pyx_mstate_global->__pyx_type_11pygame_sdl2_6render_TextureNode #define __pyx_type_11pygame_sdl2_6render_TextureAtlas __pyx_mstate_global->__pyx_type_11pygame_sdl2_6render_TextureAtlas #define __pyx_type_11pygame_sdl2_6render_Sprite __pyx_mstate_global->__pyx_type_11pygame_sdl2_6render_Sprite #define __pyx_type_11pygame_sdl2_6render_Container __pyx_mstate_global->__pyx_type_11pygame_sdl2_6render_Container #endif #define __pyx_ptype_11pygame_sdl2_6render_Renderer __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_6render_Renderer #define __pyx_ptype_11pygame_sdl2_6render_Texture __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_6render_Texture #define __pyx_ptype_11pygame_sdl2_6render_TextureNode __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_6render_TextureNode #define __pyx_ptype_11pygame_sdl2_6render_TextureAtlas __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_6render_TextureAtlas #define __pyx_ptype_11pygame_sdl2_6render_Sprite __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_6render_Sprite #define __pyx_ptype_11pygame_sdl2_6render_Container __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_6render_Container #define __pyx_n_s_BLENDMODE_ADD __pyx_mstate_global->__pyx_n_s_BLENDMODE_ADD #define __pyx_n_s_BLENDMODE_BLEND __pyx_mstate_global->__pyx_n_s_BLENDMODE_BLEND #define __pyx_n_s_BLENDMODE_MOD __pyx_mstate_global->__pyx_n_s_BLENDMODE_MOD #define __pyx_n_s_BLENDMODE_NONE __pyx_mstate_global->__pyx_n_s_BLENDMODE_NONE #define __pyx_n_s_Color __pyx_mstate_global->__pyx_n_s_Color #define __pyx_n_s_Container __pyx_mstate_global->__pyx_n_s_Container #define __pyx_n_s_Container___reduce_cython __pyx_mstate_global->__pyx_n_s_Container___reduce_cython #define __pyx_n_s_Container___setstate_cython __pyx_mstate_global->__pyx_n_s_Container___setstate_cython #define __pyx_n_s_Container_add __pyx_mstate_global->__pyx_n_s_Container_add #define __pyx_n_s_Container_render __pyx_mstate_global->__pyx_n_s_Container_render #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 #define __pyx_kp_s_Invalid_argument_s __pyx_mstate_global->__pyx_kp_s_Invalid_argument_s #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError #define __pyx_kp_s_Pickling_of_struct_members_such __pyx_mstate_global->__pyx_kp_s_Pickling_of_struct_members_such #define __pyx_kp_s_Pickling_of_struct_members_such_2 __pyx_mstate_global->__pyx_kp_s_Pickling_of_struct_members_such_2 #define __pyx_kp_s_Pickling_of_struct_members_such_3 __pyx_mstate_global->__pyx_kp_s_Pickling_of_struct_members_such_3 #define __pyx_n_s_Rect __pyx_mstate_global->__pyx_n_s_Rect #define __pyx_n_s_Renderer __pyx_mstate_global->__pyx_n_s_Renderer #define __pyx_n_s_Renderer___reduce_cython __pyx_mstate_global->__pyx_n_s_Renderer___reduce_cython #define __pyx_n_s_Renderer___setstate_cython __pyx_mstate_global->__pyx_n_s_Renderer___setstate_cython #define __pyx_n_s_Renderer_clear __pyx_mstate_global->__pyx_n_s_Renderer_clear #define __pyx_n_s_Renderer_create_texture __pyx_mstate_global->__pyx_n_s_Renderer_create_texture #define __pyx_n_s_Renderer_draw_line __pyx_mstate_global->__pyx_n_s_Renderer_draw_line #define __pyx_n_s_Renderer_draw_point __pyx_mstate_global->__pyx_n_s_Renderer_draw_point #define __pyx_n_s_Renderer_draw_rect __pyx_mstate_global->__pyx_n_s_Renderer_draw_rect #define __pyx_n_s_Renderer_fill_rect __pyx_mstate_global->__pyx_n_s_Renderer_fill_rect #define __pyx_n_s_Renderer_info __pyx_mstate_global->__pyx_n_s_Renderer_info #define __pyx_kp_s_Renderer_is_not_accelerated __pyx_mstate_global->__pyx_kp_s_Renderer_is_not_accelerated #define __pyx_n_s_Renderer_load_atlas __pyx_mstate_global->__pyx_n_s_Renderer_load_atlas #define __pyx_n_s_Renderer_load_texture __pyx_mstate_global->__pyx_n_s_Renderer_load_texture #define __pyx_n_s_Renderer_render_present __pyx_mstate_global->__pyx_n_s_Renderer_render_present #define __pyx_n_s_Renderer_set_viewport __pyx_mstate_global->__pyx_n_s_Renderer_set_viewport #define __pyx_kp_s_Rotation_not_supported_yet __pyx_mstate_global->__pyx_kp_s_Rotation_not_supported_yet #define __pyx_n_s_Sprite __pyx_mstate_global->__pyx_n_s_Sprite #define __pyx_n_s_Sprite___reduce_cython __pyx_mstate_global->__pyx_n_s_Sprite___reduce_cython #define __pyx_n_s_Sprite___setstate_cython __pyx_mstate_global->__pyx_n_s_Sprite___setstate_cython #define __pyx_n_s_Sprite_collides __pyx_mstate_global->__pyx_n_s_Sprite_collides #define __pyx_n_s_Sprite_render __pyx_mstate_global->__pyx_n_s_Sprite_render #define __pyx_n_s_Texture __pyx_mstate_global->__pyx_n_s_Texture #define __pyx_n_s_TextureAtlas __pyx_mstate_global->__pyx_n_s_TextureAtlas #define __pyx_n_s_TextureAtlas___reduce_cython __pyx_mstate_global->__pyx_n_s_TextureAtlas___reduce_cython #define __pyx_n_s_TextureAtlas___setstate_cython __pyx_mstate_global->__pyx_n_s_TextureAtlas___setstate_cython #define __pyx_n_s_TextureAtlas_keys __pyx_mstate_global->__pyx_n_s_TextureAtlas_keys #define __pyx_n_s_TextureNode __pyx_mstate_global->__pyx_n_s_TextureNode #define __pyx_n_s_TextureNode___reduce_cython __pyx_mstate_global->__pyx_n_s_TextureNode___reduce_cython #define __pyx_n_s_TextureNode___setstate_cython __pyx_mstate_global->__pyx_n_s_TextureNode___setstate_cython #define __pyx_n_s_TextureNode_render __pyx_mstate_global->__pyx_n_s_TextureNode_render #define __pyx_n_s_Texture___reduce_cython __pyx_mstate_global->__pyx_n_s_Texture___reduce_cython #define __pyx_n_s_Texture___setstate_cython __pyx_mstate_global->__pyx_n_s_Texture___setstate_cython #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3 #define __pyx_n_s__54 __pyx_mstate_global->__pyx_n_s__54 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_n_s_accelerated __pyx_mstate_global->__pyx_n_s_accelerated #define __pyx_n_s_add __pyx_mstate_global->__pyx_n_s_add #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_clear __pyx_mstate_global->__pyx_n_s_clear #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_collides __pyx_mstate_global->__pyx_n_s_collides #define __pyx_n_s_color __pyx_mstate_global->__pyx_n_s_color #define __pyx_n_s_create_texture __pyx_mstate_global->__pyx_n_s_create_texture #define __pyx_n_s_dest __pyx_mstate_global->__pyx_n_s_dest #define __pyx_n_s_dest_rect __pyx_mstate_global->__pyx_n_s_dest_rect #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_draw_line __pyx_mstate_global->__pyx_n_s_draw_line #define __pyx_n_s_draw_point __pyx_mstate_global->__pyx_n_s_draw_point #define __pyx_n_s_draw_rect __pyx_mstate_global->__pyx_n_s_draw_rect #define __pyx_n_s_driver __pyx_mstate_global->__pyx_n_s_driver #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_fi __pyx_mstate_global->__pyx_n_s_fi #define __pyx_n_s_filename __pyx_mstate_global->__pyx_n_s_filename #define __pyx_n_s_fill_rect __pyx_mstate_global->__pyx_n_s_fill_rect #define __pyx_n_s_frame __pyx_mstate_global->__pyx_n_s_frame #define __pyx_n_s_frames __pyx_mstate_global->__pyx_n_s_frames #define __pyx_n_s_g __pyx_mstate_global->__pyx_n_s_g #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_drivers __pyx_mstate_global->__pyx_n_s_get_drivers #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_image __pyx_mstate_global->__pyx_n_s_image #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_info __pyx_mstate_global->__pyx_n_s_info #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items #define __pyx_n_s_json __pyx_mstate_global->__pyx_n_s_json #define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys #define __pyx_n_s_load __pyx_mstate_global->__pyx_n_s_load #define __pyx_n_s_load_atlas __pyx_mstate_global->__pyx_n_s_load_atlas #define __pyx_n_s_load_texture __pyx_mstate_global->__pyx_n_s_load_texture #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_max_texture_height __pyx_mstate_global->__pyx_n_s_max_texture_height #define __pyx_n_s_max_texture_width __pyx_mstate_global->__pyx_n_s_max_texture_width #define __pyx_n_s_meta __pyx_mstate_global->__pyx_n_s_meta #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_nodes __pyx_mstate_global->__pyx_n_s_nodes #define __pyx_n_s_num_drivers __pyx_mstate_global->__pyx_n_s_num_drivers #define __pyx_n_s_open __pyx_mstate_global->__pyx_n_s_open #define __pyx_n_s_other __pyx_mstate_global->__pyx_n_s_other #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle #define __pyx_n_s_pivot __pyx_mstate_global->__pyx_n_s_pivot #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_pygame_sdl2_color __pyx_mstate_global->__pyx_n_s_pygame_sdl2_color #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_rect __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rect #define __pyx_n_s_pygame_sdl2_render __pyx_mstate_global->__pyx_n_s_pygame_sdl2_render #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type #define __pyx_n_s_pyx_unpickle_TextureAtlas __pyx_mstate_global->__pyx_n_s_pyx_unpickle_TextureAtlas #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_r1 __pyx_mstate_global->__pyx_n_s_r1 #define __pyx_n_s_r2 __pyx_mstate_global->__pyx_n_s_r2 #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_n_s_real_dest __pyx_mstate_global->__pyx_n_s_real_dest #define __pyx_n_s_rect __pyx_mstate_global->__pyx_n_s_rect #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_ren __pyx_mstate_global->__pyx_n_s_ren #define __pyx_n_s_render __pyx_mstate_global->__pyx_n_s_render #define __pyx_n_s_render_present __pyx_mstate_global->__pyx_n_s_render_present #define __pyx_n_s_rinfo __pyx_mstate_global->__pyx_n_s_rinfo #define __pyx_n_s_rotated __pyx_mstate_global->__pyx_n_s_rotated #define __pyx_n_s_rtt __pyx_mstate_global->__pyx_n_s_rtt #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_viewport __pyx_mstate_global->__pyx_n_s_set_viewport #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_software __pyx_mstate_global->__pyx_n_s_software #define __pyx_n_s_sourceSize __pyx_mstate_global->__pyx_n_s_sourceSize #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_sprite __pyx_mstate_global->__pyx_n_s_sprite #define __pyx_n_s_spriteSourceSize __pyx_mstate_global->__pyx_n_s_spriteSourceSize #define __pyx_kp_s_src_pygame_sdl2_render_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_render_pyx #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_tex __pyx_mstate_global->__pyx_n_s_tex #define __pyx_n_s_tn __pyx_mstate_global->__pyx_n_s_tn #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate #define __pyx_n_s_vprect __pyx_mstate_global->__pyx_n_s_vprect #define __pyx_n_s_vsync __pyx_mstate_global->__pyx_n_s_vsync #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn #define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings #define __pyx_n_s_window __pyx_mstate_global->__pyx_n_s_window #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_x1 __pyx_mstate_global->__pyx_n_s_x1 #define __pyx_n_s_x2 __pyx_mstate_global->__pyx_n_s_x2 #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_n_s_y1 __pyx_mstate_global->__pyx_n_s_y1 #define __pyx_n_s_y2 __pyx_mstate_global->__pyx_n_s_y2 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_93638610 __pyx_mstate_global->__pyx_int_93638610 #define __pyx_int_231588268 __pyx_mstate_global->__pyx_int_231588268 #define __pyx_int_243099540 __pyx_mstate_global->__pyx_int_243099540 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 #define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46 #define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48 #define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45 #define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 #define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 /* #### Code section: module_code ### */ /* "pygame_sdl2/render.pyx":40 * cdef bint DEBUG_DRAW_BBOX = True * * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): # <<<<<<<<<<<<<< * # Ignore texture_formats for now. * return { */ static PyObject *__pyx_f_11pygame_sdl2_6render_rinfo_to_dict(SDL_RendererInfo *__pyx_v_rinfo) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rinfo_to_dict", 1); /* "pygame_sdl2/render.pyx":42 * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): * # Ignore texture_formats for now. * return { # <<<<<<<<<<<<<< * "name" : rinfo.name, * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, */ __Pyx_XDECREF(__pyx_r); /* "pygame_sdl2/render.pyx":43 * # Ignore texture_formats for now. * return { * "name" : rinfo.name, # <<<<<<<<<<<<<< * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, */ __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rinfo->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":44 * return { * "name" : rinfo.name, * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, # <<<<<<<<<<<<<< * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_SOFTWARE) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_software, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":45 * "name" : rinfo.name, * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, # <<<<<<<<<<<<<< * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_ACCELERATED) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_accelerated, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":46 * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, # <<<<<<<<<<<<<< * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, * "max_texture_width" : rinfo.max_texture_width, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_PRESENTVSYNC) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_vsync, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":47 * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, # <<<<<<<<<<<<<< * "max_texture_width" : rinfo.max_texture_width, * "max_texture_height" : rinfo.max_texture_height, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_TARGETTEXTURE) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rtt, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":48 * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, * "max_texture_width" : rinfo.max_texture_width, # <<<<<<<<<<<<<< * "max_texture_height" : rinfo.max_texture_height, * } */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rinfo->max_texture_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_max_texture_width, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":49 * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, * "max_texture_width" : rinfo.max_texture_width, * "max_texture_height" : rinfo.max_texture_height, # <<<<<<<<<<<<<< * } * */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rinfo->max_texture_height); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_max_texture_height, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":40 * cdef bint DEBUG_DRAW_BBOX = True * * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): # <<<<<<<<<<<<<< * # Ignore texture_formats for now. * return { */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.rinfo_to_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_1get_drivers(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_get_drivers, "get_drivers()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_1get_drivers = {"get_drivers", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_1get_drivers, METH_NOARGS, __pyx_doc_11pygame_sdl2_6render_get_drivers}; static PyObject *__pyx_pw_11pygame_sdl2_6render_1get_drivers(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_drivers (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_get_drivers(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_get_drivers(CYTHON_UNUSED PyObject *__pyx_self) { SDL_RendererInfo __pyx_v_rinfo; int __pyx_v_num_drivers; PyObject *__pyx_v_rv = NULL; int __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_drivers", 1); /* "pygame_sdl2/render.pyx":55 * cdef SDL_RendererInfo rinfo * cdef int num_drivers * rv = [] # <<<<<<<<<<<<<< * * num_drivers = SDL_GetNumRenderDrivers() */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":57 * rv = [] * * num_drivers = SDL_GetNumRenderDrivers() # <<<<<<<<<<<<<< * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: */ __pyx_v_num_drivers = SDL_GetNumRenderDrivers(); /* "pygame_sdl2/render.pyx":58 * * num_drivers = SDL_GetNumRenderDrivers() * for n in range(num_drivers): # <<<<<<<<<<<<<< * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: * raise error() */ __pyx_t_2 = __pyx_v_num_drivers; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_n = __pyx_t_4; /* "pygame_sdl2/render.pyx":59 * num_drivers = SDL_GetNumRenderDrivers() * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = (SDL_GetRenderDriverInfo(__pyx_v_n, (&__pyx_v_rinfo)) != 0); if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/render.pyx":60 * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: * raise error() # <<<<<<<<<<<<<< * * rv.append(rinfo_to_dict(&rinfo)) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 60, __pyx_L1_error) /* "pygame_sdl2/render.pyx":59 * num_drivers = SDL_GetNumRenderDrivers() * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":62 * raise error() * * rv.append(rinfo_to_dict(&rinfo)) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_1 = __pyx_f_11pygame_sdl2_6render_rinfo_to_dict((&__pyx_v_rinfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "pygame_sdl2/render.pyx":64 * rv.append(rinfo_to_dict(&rinfo)) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.render.get_drivers", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":71 * cdef dict _info * * def __cinit__(self): # <<<<<<<<<<<<<< * self.renderer = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer___cinit__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_8Renderer___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/render.pyx":72 * * def __cinit__(self): * self.renderer = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->renderer = NULL; /* "pygame_sdl2/render.pyx":71 * cdef dict _info * * def __cinit__(self): # <<<<<<<<<<<<<< * self.renderer = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/render.pyx":74 * self.renderer = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.renderer: * SDL_DestroyRenderer(self.renderer) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_6render_8Renderer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_6render_8Renderer_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_6render_8Renderer_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_6render_8Renderer_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { int __pyx_t_1; /* "pygame_sdl2/render.pyx":75 * * def __dealloc__(self): * if self.renderer: # <<<<<<<<<<<<<< * SDL_DestroyRenderer(self.renderer) * */ __pyx_t_1 = (__pyx_v_self->renderer != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":76 * def __dealloc__(self): * if self.renderer: * SDL_DestroyRenderer(self.renderer) # <<<<<<<<<<<<<< * * def __init__(self, Window window=None, vsync=False, driver=-1): */ SDL_DestroyRenderer(__pyx_v_self->renderer); /* "pygame_sdl2/render.pyx":75 * * def __dealloc__(self): * if self.renderer: # <<<<<<<<<<<<<< * SDL_DestroyRenderer(self.renderer) * */ } /* "pygame_sdl2/render.pyx":74 * self.renderer = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.renderer: * SDL_DestroyRenderer(self.renderer) */ /* function exit code */ } /* "pygame_sdl2/render.pyx":78 * SDL_DestroyRenderer(self.renderer) * * def __init__(self, Window window=None, vsync=False, driver=-1): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window = 0; PyObject *__pyx_v_vsync = 0; PyObject *__pyx_v_driver = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_window,&__pyx_n_s_vsync,&__pyx_n_s_driver,0}; values[0] = __Pyx_Arg_NewRef_VARARGS((PyObject *)((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_False)); values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_neg_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_window); if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vsync); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_driver); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 78, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)values[0]); __pyx_v_vsync = values[1]; __pyx_v_driver = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 78, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_window), __pyx_ptype_11pygame_sdl2_7display_Window, 1, "window", 0))) __PYX_ERR(0, 78, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_4__init__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_window, __pyx_v_vsync, __pyx_v_driver); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_8Renderer_4__init__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window, PyObject *__pyx_v_vsync, PyObject *__pyx_v_driver) { uint32_t __pyx_v_flags; SDL_RendererInfo __pyx_v_rinfo; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF((PyObject *)__pyx_v_window); /* "pygame_sdl2/render.pyx":79 * * def __init__(self, Window window=None, vsync=False, driver=-1): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ __pyx_t_1 = (((PyObject *)__pyx_v_window) == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":80 * def __init__(self, Window window=None, vsync=False, driver=-1): * if window is None: * window = main_window # <<<<<<<<<<<<<< * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED */ __Pyx_INCREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_window, __pyx_v_11pygame_sdl2_7display_main_window); /* "pygame_sdl2/render.pyx":79 * * def __init__(self, Window window=None, vsync=False, driver=-1): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ } /* "pygame_sdl2/render.pyx":82 * window = main_window * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED # <<<<<<<<<<<<<< * if vsync: * flags |= SDL_RENDERER_PRESENTVSYNC */ __pyx_v_flags = SDL_RENDERER_ACCELERATED; /* "pygame_sdl2/render.pyx":83 * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED * if vsync: # <<<<<<<<<<<<<< * flags |= SDL_RENDERER_PRESENTVSYNC * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_vsync); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 83, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":84 * cdef uint32_t flags = SDL_RENDERER_ACCELERATED * if vsync: * flags |= SDL_RENDERER_PRESENTVSYNC # <<<<<<<<<<<<<< * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) */ __pyx_v_flags = (__pyx_v_flags | SDL_RENDERER_PRESENTVSYNC); /* "pygame_sdl2/render.pyx":83 * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED * if vsync: # <<<<<<<<<<<<<< * flags |= SDL_RENDERER_PRESENTVSYNC * */ } /* "pygame_sdl2/render.pyx":86 * flags |= SDL_RENDERER_PRESENTVSYNC * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) # <<<<<<<<<<<<<< * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_driver); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_v_self->renderer = SDL_CreateRenderer(__pyx_v_window->window, __pyx_t_2, __pyx_v_flags); /* "pygame_sdl2/render.pyx":87 * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) * if self.renderer == NULL: # <<<<<<<<<<<<<< * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: */ __pyx_t_1 = (__pyx_v_self->renderer == NULL); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":88 * self.renderer = SDL_CreateRenderer(window.window, driver, flags) * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) # <<<<<<<<<<<<<< * if self.renderer == NULL: * raise error() */ __pyx_v_self->renderer = SDL_GetRenderer(__pyx_v_window->window); /* "pygame_sdl2/render.pyx":89 * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_self->renderer == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/render.pyx":90 * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: * raise error() # <<<<<<<<<<<<<< * * cdef SDL_RendererInfo rinfo */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_2, 0+__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 90, __pyx_L1_error) /* "pygame_sdl2/render.pyx":89 * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":87 * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) * if self.renderer == NULL: # <<<<<<<<<<<<<< * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: */ } /* "pygame_sdl2/render.pyx":93 * * cdef SDL_RendererInfo rinfo * if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetRendererInfo(__pyx_v_self->renderer, (&__pyx_v_rinfo)) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/render.pyx":94 * cdef SDL_RendererInfo rinfo * if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: * raise error() # <<<<<<<<<<<<<< * * self._info = rinfo_to_dict(&rinfo) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_2, 0+__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 94, __pyx_L1_error) /* "pygame_sdl2/render.pyx":93 * * cdef SDL_RendererInfo rinfo * if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":96 * raise error() * * self._info = rinfo_to_dict(&rinfo) # <<<<<<<<<<<<<< * * if not self.info()["accelerated"]: */ __pyx_t_3 = __pyx_f_11pygame_sdl2_6render_rinfo_to_dict((&__pyx_v_rinfo)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyDict_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_3))) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_info); __Pyx_DECREF(__pyx_v_self->_info); __pyx_v_self->_info = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":98 * self._info = rinfo_to_dict(&rinfo) * * if not self.info()["accelerated"]: # <<<<<<<<<<<<<< * warnings.warn("Renderer is not accelerated.") * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_2, 0+__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_accelerated); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (!__pyx_t_1); if (__pyx_t_6) { /* "pygame_sdl2/render.pyx":99 * * if not self.info()["accelerated"]: * warnings.warn("Renderer is not accelerated.") # <<<<<<<<<<<<<< * * def load_texture(self, fi): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Renderer_is_not_accelerated}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":98 * self._info = rinfo_to_dict(&rinfo) * * if not self.info()["accelerated"]: # <<<<<<<<<<<<<< * warnings.warn("Renderer is not accelerated.") * */ } /* "pygame_sdl2/render.pyx":78 * SDL_DestroyRenderer(self.renderer) * * def __init__(self, Window window=None, vsync=False, driver=-1): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_window); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":101 * warnings.warn("Renderer is not accelerated.") * * def load_texture(self, fi): # <<<<<<<<<<<<<< * cdef SDL_Texture *tex * cdef Texture t = Texture() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_6load_texture, "Renderer.load_texture(self, fi)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_7load_texture = {"load_texture", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_6load_texture}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fi = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load_texture (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load_texture") < 0)) __PYX_ERR(0, 101, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fi = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load_texture", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 101, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.load_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_6load_texture(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_fi); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_6load_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_fi) { SDL_Texture *__pyx_v_tex; struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_t = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; SDL_RWops *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load_texture", 1); /* "pygame_sdl2/render.pyx":103 * def load_texture(self, fi): * cdef SDL_Texture *tex * cdef Texture t = Texture() # <<<<<<<<<<<<<< * * if isinstance(fi, Surface): */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Texture)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_t = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":105 * cdef Texture t = Texture() * * if isinstance(fi, Surface): # <<<<<<<<<<<<<< * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_fi, __pyx_ptype_11pygame_sdl2_7surface_Surface); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":106 * * if isinstance(fi, Surface): * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) # <<<<<<<<<<<<<< * else: * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) */ __pyx_v_tex = SDL_CreateTextureFromSurface(__pyx_v_self->renderer, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_fi)->surface); /* "pygame_sdl2/render.pyx":105 * cdef Texture t = Texture() * * if isinstance(fi, Surface): # <<<<<<<<<<<<<< * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":108 * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) * else: * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) # <<<<<<<<<<<<<< * * if tex == NULL: */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_3 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 108, __pyx_L1_error) __pyx_v_tex = IMG_LoadTexture_RW(__pyx_v_self->renderer, __pyx_t_3, 1); } __pyx_L3:; /* "pygame_sdl2/render.pyx":110 * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) * * if tex == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_tex == NULL); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/render.pyx":111 * * if tex == NULL: * raise error() # <<<<<<<<<<<<<< * * t.set(self.renderer, tex) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 111, __pyx_L1_error) /* "pygame_sdl2/render.pyx":110 * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) * * if tex == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":113 * raise error() * * t.set(self.renderer, tex) # <<<<<<<<<<<<<< * return TextureNode(t) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture *)__pyx_v_t->__pyx_vtab)->set(__pyx_v_t, __pyx_v_self->renderer, __pyx_v_tex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":114 * * t.set(self.renderer, tex) * return TextureNode(t) # <<<<<<<<<<<<<< * * def load_atlas(self, filename): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode), ((PyObject *)__pyx_v_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":101 * warnings.warn("Renderer is not accelerated.") * * def load_texture(self, fi): # <<<<<<<<<<<<<< * cdef SDL_Texture *tex * cdef Texture t = Texture() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.load_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_t); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":116 * return TextureNode(t) * * def load_atlas(self, filename): # <<<<<<<<<<<<<< * """ Loads a file in the popular JSON (Hash) format exported by * TexturePacker and other software. """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_8load_atlas, "Renderer.load_atlas(self, filename)\n Loads a file in the popular JSON (Hash) format exported by\n TexturePacker and other software. "); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_9load_atlas = {"load_atlas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_8load_atlas}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_filename = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load_atlas (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load_atlas") < 0)) __PYX_ERR(0, 116, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_filename = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load_atlas", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 116, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.load_atlas", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_8load_atlas(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_filename); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_8load_atlas(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_filename) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load_atlas", 1); /* "pygame_sdl2/render.pyx":120 * TexturePacker and other software. """ * * return TextureAtlas(self, filename) # <<<<<<<<<<<<<< * * def render_present(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 120, __pyx_L1_error); __Pyx_INCREF(__pyx_v_filename); __Pyx_GIVEREF(__pyx_v_filename); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_filename)) __PYX_ERR(0, 120, __pyx_L1_error); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureAtlas), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":116 * return TextureNode(t) * * def load_atlas(self, filename): # <<<<<<<<<<<<<< * """ Loads a file in the popular JSON (Hash) format exported by * TexturePacker and other software. """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.load_atlas", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":122 * return TextureAtlas(self, filename) * * def render_present(self): # <<<<<<<<<<<<<< * with nogil: * SDL_RenderPresent(self.renderer) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_10render_present, "Renderer.render_present(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_11render_present = {"render_present", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_10render_present}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render_present (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("render_present", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "render_present", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_10render_present(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_10render_present(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render_present", 1); /* "pygame_sdl2/render.pyx":123 * * def render_present(self): * with nogil: # <<<<<<<<<<<<<< * SDL_RenderPresent(self.renderer) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/render.pyx":124 * def render_present(self): * with nogil: * SDL_RenderPresent(self.renderer) # <<<<<<<<<<<<<< * * def info(self): */ SDL_RenderPresent(__pyx_v_self->renderer); } /* "pygame_sdl2/render.pyx":123 * * def render_present(self): * with nogil: # <<<<<<<<<<<<<< * SDL_RenderPresent(self.renderer) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/render.pyx":122 * return TextureAtlas(self, filename) * * def render_present(self): # <<<<<<<<<<<<<< * with nogil: * SDL_RenderPresent(self.renderer) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":126 * SDL_RenderPresent(self.renderer) * * def info(self): # <<<<<<<<<<<<<< * return self._info * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_13info(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_12info, "Renderer.info(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_13info = {"info", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_13info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_12info}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_13info(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("info (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("info", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "info", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_12info(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_12info(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("info", 1); /* "pygame_sdl2/render.pyx":127 * * def info(self): * return self._info # <<<<<<<<<<<<<< * * cdef set_drawcolor(self, col): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_info); __pyx_r = __pyx_v_self->_info; goto __pyx_L0; /* "pygame_sdl2/render.pyx":126 * SDL_RenderPresent(self.renderer) * * def info(self): # <<<<<<<<<<<<<< * return self._info * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":129 * return self._info * * cdef set_drawcolor(self, col): # <<<<<<<<<<<<<< * if not isinstance(col, Color): * col = Color(col) */ static PyObject *__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_col) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Uint8 __pyx_t_7; Uint8 __pyx_t_8; Uint8 __pyx_t_9; Uint8 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_drawcolor", 0); __Pyx_INCREF(__pyx_v_col); /* "pygame_sdl2/render.pyx":130 * * cdef set_drawcolor(self, col): * if not isinstance(col, Color): # <<<<<<<<<<<<<< * col = Color(col) * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_col, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":131 * cdef set_drawcolor(self, col): * if not isinstance(col, Color): * col = Color(col) # <<<<<<<<<<<<<< * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Color); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_col}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_col, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":130 * * cdef set_drawcolor(self, col): * if not isinstance(col, Color): # <<<<<<<<<<<<<< * col = Color(col) * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) */ } /* "pygame_sdl2/render.pyx":132 * if not isinstance(col, Color): * col = Color(col) * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) # <<<<<<<<<<<<<< * * def clear(self, color): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_9 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (void)(SDL_SetRenderDrawColor(__pyx_v_self->renderer, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10)); /* "pygame_sdl2/render.pyx":129 * return self._info * * cdef set_drawcolor(self, col): # <<<<<<<<<<<<<< * if not isinstance(col, Color): * col = Color(col) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.set_drawcolor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_col); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":134 * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * * def clear(self, color): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_14clear, "Renderer.clear(self, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_15clear = {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_14clear}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clear") < 0)) __PYX_ERR(0, 134, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_color = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clear", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 134, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_14clear(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_14clear(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear", 1); /* "pygame_sdl2/render.pyx":135 * * def clear(self, color): * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderClear(self.renderer) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":136 * def clear(self, color): * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) # <<<<<<<<<<<<<< * * def draw_line(self, color not None, x1, y1, x2, y2): */ (void)(SDL_RenderClear(__pyx_v_self->renderer)); /* "pygame_sdl2/render.pyx":134 * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * * def clear(self, color): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":138 * SDL_RenderClear(self.renderer) * * def draw_line(self, color not None, x1, y1, x2, y2): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_16draw_line, "Renderer.draw_line(self, color, x1, y1, x2, y2)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_17draw_line = {"draw_line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_16draw_line}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("draw_line (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 1); __PYX_ERR(0, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 2); __PYX_ERR(0, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 3); __PYX_ERR(0, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 4); __PYX_ERR(0, 138, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_line") < 0)) __PYX_ERR(0, 138, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_color = values[0]; __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 138, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); __PYX_ERR(0, 138, __pyx_L1_error) } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_16draw_line(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_16draw_line(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_line", 1); /* "pygame_sdl2/render.pyx":139 * * def draw_line(self, color not None, x1, y1, x2, y2): * self.set_drawcolor(color) # <<<<<<<<<<<<<< * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: * raise error() */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":140 * def draw_line(self, color not None, x1, y1, x2, y2): * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_x2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_y2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_6 = (SDL_RenderDrawLine(__pyx_v_self->renderer, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5) != 0); if (unlikely(__pyx_t_6)) { /* "pygame_sdl2/render.pyx":141 * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: * raise error() # <<<<<<<<<<<<<< * * def draw_point(self, color not None, x, y): */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 141, __pyx_L1_error) /* "pygame_sdl2/render.pyx":140 * def draw_line(self, color not None, x1, y1, x2, y2): * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":138 * SDL_RenderClear(self.renderer) * * def draw_line(self, color not None, x1, y1, x2, y2): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":143 * raise error() * * def draw_point(self, color not None, x, y): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_18draw_point, "Renderer.draw_point(self, color, x, y)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_19draw_point = {"draw_point", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_18draw_point}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("draw_point (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, 1); __PYX_ERR(0, 143, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, 2); __PYX_ERR(0, 143, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_point") < 0)) __PYX_ERR(0, 143, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_color = values[0]; __pyx_v_x = values[1]; __pyx_v_y = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 143, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); __PYX_ERR(0, 143, __pyx_L1_error) } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_18draw_point(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_18draw_point(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_point", 1); /* "pygame_sdl2/render.pyx":144 * * def draw_point(self, color not None, x, y): * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderDrawPoint(self.renderer, x, y) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":145 * def draw_point(self, color not None, x, y): * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) # <<<<<<<<<<<<<< * * def draw_rect(self, color not None, rect): */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) (void)(SDL_RenderDrawPoint(__pyx_v_self->renderer, __pyx_t_2, __pyx_t_3)); /* "pygame_sdl2/render.pyx":143 * raise error() * * def draw_point(self, color not None, x, y): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":147 * SDL_RenderDrawPoint(self.renderer, x, y) * * def draw_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_20draw_rect, "Renderer.draw_rect(self, color, rect)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_21draw_rect = {"draw_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_20draw_rect}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("draw_rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_rect,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_rect", 1, 2, 2, 1); __PYX_ERR(0, 147, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_rect") < 0)) __PYX_ERR(0, 147, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_color = values[0]; __pyx_v_rect = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("draw_rect", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 147, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); __PYX_ERR(0, 147, __pyx_L1_error) } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_20draw_rect(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_rect); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_20draw_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_r; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_rect", 1); /* "pygame_sdl2/render.pyx":149 * def draw_rect(self, color not None, rect): * cdef SDL_Rect r * to_sdl_rect(rect, &r) # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawRect(self.renderer, &r) */ __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_r), NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error) /* "pygame_sdl2/render.pyx":150 * cdef SDL_Rect r * to_sdl_rect(rect, &r) * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderDrawRect(self.renderer, &r) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":151 * to_sdl_rect(rect, &r) * self.set_drawcolor(color) * SDL_RenderDrawRect(self.renderer, &r) # <<<<<<<<<<<<<< * * def fill_rect(self, color not None, rect): */ (void)(SDL_RenderDrawRect(__pyx_v_self->renderer, (&__pyx_v_r))); /* "pygame_sdl2/render.pyx":147 * SDL_RenderDrawPoint(self.renderer, x, y) * * def draw_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":153 * SDL_RenderDrawRect(self.renderer, &r) * * def fill_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_22fill_rect, "Renderer.fill_rect(self, color, rect)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_23fill_rect = {"fill_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_22fill_rect}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fill_rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_rect,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("fill_rect", 1, 2, 2, 1); __PYX_ERR(0, 153, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fill_rect") < 0)) __PYX_ERR(0, 153, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_color = values[0]; __pyx_v_rect = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fill_rect", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 153, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.fill_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); __PYX_ERR(0, 153, __pyx_L1_error) } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_22fill_rect(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_rect); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_22fill_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_r; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fill_rect", 1); /* "pygame_sdl2/render.pyx":155 * def fill_rect(self, color not None, rect): * cdef SDL_Rect r * to_sdl_rect(rect, &r) # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderFillRect(self.renderer, &r) */ __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_r), NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 155, __pyx_L1_error) /* "pygame_sdl2/render.pyx":156 * cdef SDL_Rect r * to_sdl_rect(rect, &r) * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderFillRect(self.renderer, &r) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":157 * to_sdl_rect(rect, &r) * self.set_drawcolor(color) * SDL_RenderFillRect(self.renderer, &r) # <<<<<<<<<<<<<< * * def set_viewport(self, rect=None): */ (void)(SDL_RenderFillRect(__pyx_v_self->renderer, (&__pyx_v_r))); /* "pygame_sdl2/render.pyx":153 * SDL_RenderDrawRect(self.renderer, &r) * * def fill_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.fill_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":159 * SDL_RenderFillRect(self.renderer, &r) * * def set_viewport(self, rect=None): # <<<<<<<<<<<<<< * cdef SDL_Rect vprect * if rect is None: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_24set_viewport, "Renderer.set_viewport(self, rect=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_25set_viewport = {"set_viewport", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_24set_viewport}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rect = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_viewport (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rect,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_viewport") < 0)) __PYX_ERR(0, 159, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rect = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_viewport", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 159, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.set_viewport", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_24set_viewport(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_rect); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_24set_viewport(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_vprect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_viewport", 1); /* "pygame_sdl2/render.pyx":161 * def set_viewport(self, rect=None): * cdef SDL_Rect vprect * if rect is None: # <<<<<<<<<<<<<< * SDL_RenderSetViewport(self.renderer, NULL) * else: */ __pyx_t_1 = (__pyx_v_rect == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":162 * cdef SDL_Rect vprect * if rect is None: * SDL_RenderSetViewport(self.renderer, NULL) # <<<<<<<<<<<<<< * else: * to_sdl_rect(rect, &vprect) */ (void)(SDL_RenderSetViewport(__pyx_v_self->renderer, NULL)); /* "pygame_sdl2/render.pyx":161 * def set_viewport(self, rect=None): * cdef SDL_Rect vprect * if rect is None: # <<<<<<<<<<<<<< * SDL_RenderSetViewport(self.renderer, NULL) * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":164 * SDL_RenderSetViewport(self.renderer, NULL) * else: * to_sdl_rect(rect, &vprect) # <<<<<<<<<<<<<< * SDL_RenderSetViewport(self.renderer, &vprect) * */ /*else*/ { __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_vprect), NULL); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 164, __pyx_L1_error) /* "pygame_sdl2/render.pyx":165 * else: * to_sdl_rect(rect, &vprect) * SDL_RenderSetViewport(self.renderer, &vprect) # <<<<<<<<<<<<<< * * def create_texture(self, size): */ (void)(SDL_RenderSetViewport(__pyx_v_self->renderer, (&__pyx_v_vprect))); } __pyx_L3:; /* "pygame_sdl2/render.pyx":159 * SDL_RenderFillRect(self.renderer, &r) * * def set_viewport(self, rect=None): # <<<<<<<<<<<<<< * cdef SDL_Rect vprect * if rect is None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.set_viewport", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":167 * SDL_RenderSetViewport(self.renderer, &vprect) * * def create_texture(self, size): # <<<<<<<<<<<<<< * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_26create_texture, "Renderer.create_texture(self, size)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_27create_texture = {"create_texture", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_26create_texture}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create_texture (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create_texture") < 0)) __PYX_ERR(0, 167, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_size = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create_texture", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 167, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.create_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_26create_texture(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_26create_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_texture", 1); /* "pygame_sdl2/render.pyx":168 * * def create_texture(self, size): * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_RenderTargetSupported(__pyx_v_self->renderer) != SDL_TRUE); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/render.pyx":169 * def create_texture(self, size): * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 169, __pyx_L1_error) /* "pygame_sdl2/render.pyx":168 * * def create_texture(self, size): * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":167 * SDL_RenderSetViewport(self.renderer, &vprect) * * def create_texture(self, size): # <<<<<<<<<<<<<< * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.create_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_29__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_28__reduce_cython__, "Renderer.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_29__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_29__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_28__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_29__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_28__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_28__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_31__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_30__setstate_cython__, "Renderer.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_31__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_31__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_30__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_31__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_30__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_30__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":179 * cdef public int w, h * * def __cinit__(self): # <<<<<<<<<<<<<< * self.texture = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture___cinit__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_7Texture___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/render.pyx":180 * * def __cinit__(self): * self.texture = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->texture = NULL; /* "pygame_sdl2/render.pyx":179 * cdef public int w, h * * def __cinit__(self): # <<<<<<<<<<<<<< * self.texture = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/render.pyx":182 * self.texture = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.texture: * SDL_DestroyTexture(self.texture) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_6render_7Texture_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_6render_7Texture_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_6render_7Texture_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_6render_7Texture_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { int __pyx_t_1; /* "pygame_sdl2/render.pyx":183 * * def __dealloc__(self): * if self.texture: # <<<<<<<<<<<<<< * SDL_DestroyTexture(self.texture) * */ __pyx_t_1 = (__pyx_v_self->texture != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":184 * def __dealloc__(self): * if self.texture: * SDL_DestroyTexture(self.texture) # <<<<<<<<<<<<<< * * cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): */ SDL_DestroyTexture(__pyx_v_self->texture); /* "pygame_sdl2/render.pyx":183 * * def __dealloc__(self): * if self.texture: # <<<<<<<<<<<<<< * SDL_DestroyTexture(self.texture) * */ } /* "pygame_sdl2/render.pyx":182 * self.texture = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.texture: * SDL_DestroyTexture(self.texture) */ /* function exit code */ } /* "pygame_sdl2/render.pyx":186 * SDL_DestroyTexture(self.texture) * * cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): # <<<<<<<<<<<<<< * cdef Uint32 format * cdef int access, w, h */ static PyObject *__pyx_f_11pygame_sdl2_6render_7Texture_set(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, SDL_Renderer *__pyx_v_ren, SDL_Texture *__pyx_v_tex) { Uint32 __pyx_v_format; int __pyx_v_access; int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 1); /* "pygame_sdl2/render.pyx":190 * cdef int access, w, h * * self.renderer = ren # <<<<<<<<<<<<<< * self.texture = tex * */ __pyx_v_self->renderer = __pyx_v_ren; /* "pygame_sdl2/render.pyx":191 * * self.renderer = ren * self.texture = tex # <<<<<<<<<<<<<< * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: */ __pyx_v_self->texture = __pyx_v_tex; /* "pygame_sdl2/render.pyx":193 * self.texture = tex * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_QueryTexture(__pyx_v_self->texture, (&__pyx_v_format), (&__pyx_v_access), (&__pyx_v_w), (&__pyx_v_h)) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/render.pyx":194 * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: * raise error() # <<<<<<<<<<<<<< * * self.w = w */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 194, __pyx_L1_error) /* "pygame_sdl2/render.pyx":193 * self.texture = tex * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":196 * raise error() * * self.w = w # <<<<<<<<<<<<<< * self.h = h * */ __pyx_v_self->w = __pyx_v_w; /* "pygame_sdl2/render.pyx":197 * * self.w = w * self.h = h # <<<<<<<<<<<<<< * * */ __pyx_v_self->h = __pyx_v_h; /* "pygame_sdl2/render.pyx":186 * SDL_DestroyTexture(self.texture) * * cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): # <<<<<<<<<<<<<< * cdef Uint32 format * cdef int access, w, h */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Texture.set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":177 * cdef SDL_Renderer *renderer * cdef SDL_Texture *texture * cdef public int w, h # <<<<<<<<<<<<<< * * def __cinit__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1w_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1w_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1w___get__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1w___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Texture.w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1w_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_7Texture_1w_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_v_self->w = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Texture.w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1h_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1h_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1h___get__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1h___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Texture.h.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1h_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_7Texture_1h_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_v_self->h = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Texture.h.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_7Texture_4__reduce_cython__, "Texture.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_7Texture_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_7Texture_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_7Texture_4__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_4__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Texture.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_7Texture_6__setstate_cython__, "Texture.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_7Texture_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_7Texture_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_7Texture_6__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Texture.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_6__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Texture.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":215 * cdef int source_h * * def __init__(self, tex): # <<<<<<<<<<<<<< * if isinstance(tex, Texture): * self.texture = tex */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tex = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tex,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tex)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 215, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_tex = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 215, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode___init__(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self), __pyx_v_tex); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_11TextureNode___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_tex) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/render.pyx":216 * * def __init__(self, tex): * if isinstance(tex, Texture): # <<<<<<<<<<<<<< * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_tex, __pyx_ptype_11pygame_sdl2_6render_Texture); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":217 * def __init__(self, tex): * if isinstance(tex, Texture): * self.texture = tex # <<<<<<<<<<<<<< * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) */ if (!(likely(((__pyx_v_tex) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_tex, __pyx_ptype_11pygame_sdl2_6render_Texture))))) __PYX_ERR(0, 217, __pyx_L1_error) __pyx_t_2 = __pyx_v_tex; __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF((PyObject *)__pyx_v_self->texture); __Pyx_DECREF((PyObject *)__pyx_v_self->texture); __pyx_v_self->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":218 * if isinstance(tex, Texture): * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) # <<<<<<<<<<<<<< * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) * self.source_w = tex.w */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0)) __PYX_ERR(0, 218, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0)) __PYX_ERR(0, 218, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_5 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_4, (&__pyx_v_self->source_rect), NULL); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":219 * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) # <<<<<<<<<<<<<< * self.source_w = tex.w * self.source_h = tex.h */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0)) __PYX_ERR(0, 219, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0)) __PYX_ERR(0, 219, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_5 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_2, (&__pyx_v_self->trimmed_rect), NULL); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":220 * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) * self.source_w = tex.w # <<<<<<<<<<<<<< * self.source_h = tex.h * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->source_w = __pyx_t_5; /* "pygame_sdl2/render.pyx":221 * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) * self.source_w = tex.w * self.source_h = tex.h # <<<<<<<<<<<<<< * * elif isinstance(tex, TextureNode): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->source_h = __pyx_t_5; /* "pygame_sdl2/render.pyx":216 * * def __init__(self, tex): * if isinstance(tex, Texture): # <<<<<<<<<<<<<< * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":223 * self.source_h = tex.h * * elif isinstance(tex, TextureNode): # <<<<<<<<<<<<<< * self.texture = (tex).texture * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_tex, __pyx_ptype_11pygame_sdl2_6render_TextureNode); if (likely(__pyx_t_1)) { /* "pygame_sdl2/render.pyx":224 * * elif isinstance(tex, TextureNode): * self.texture = (tex).texture # <<<<<<<<<<<<<< * * else: */ __pyx_t_2 = ((PyObject *)((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_tex)->texture); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF((PyObject *)__pyx_v_self->texture); __Pyx_DECREF((PyObject *)__pyx_v_self->texture); __pyx_v_self->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":223 * self.source_h = tex.h * * elif isinstance(tex, TextureNode): # <<<<<<<<<<<<<< * self.texture = (tex).texture * */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":227 * * else: * raise ValueError() # <<<<<<<<<<<<<< * * def render(self, dest=None): */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_builtin_ValueError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 227, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/render.pyx":215 * cdef int source_h * * def __init__(self, tex): # <<<<<<<<<<<<<< * if isinstance(tex, Texture): * self.texture = tex */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":229 * raise ValueError() * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_11TextureNode_2render, "TextureNode.render(self, dest=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_11TextureNode_3render = {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_11TextureNode_2render}; static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dest = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dest,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dest); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "render") < 0)) __PYX_ERR(0, 229, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dest = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 229, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode_2render(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self), __pyx_v_dest); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_2render(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_dest) { SDL_Rect __pyx_v_dest_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 1); /* "pygame_sdl2/render.pyx":232 * cdef SDL_Rect dest_rect * * if dest is None: # <<<<<<<<<<<<<< * with nogil: * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) */ __pyx_t_1 = (__pyx_v_dest == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":233 * * if dest is None: * with nogil: # <<<<<<<<<<<<<< * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/render.pyx":234 * if dest is None: * with nogil: * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) # <<<<<<<<<<<<<< * * else: */ (void)(SDL_RenderCopy(__pyx_v_self->texture->renderer, __pyx_v_self->texture->texture, NULL, NULL)); } /* "pygame_sdl2/render.pyx":233 * * if dest is None: * with nogil: # <<<<<<<<<<<<<< * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/render.pyx":232 * cdef SDL_Rect dest_rect * * if dest is None: # <<<<<<<<<<<<<< * with nogil: * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":237 * * else: * to_sdl_rect(dest, &dest_rect) # <<<<<<<<<<<<<< * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: */ /*else*/ { __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), NULL); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 237, __pyx_L1_error) /* "pygame_sdl2/render.pyx":238 * else: * to_sdl_rect(dest, &dest_rect) * with nogil: # <<<<<<<<<<<<<< * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/render.pyx":239 * to_sdl_rect(dest, &dest_rect) * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: # <<<<<<<<<<<<<< * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h */ __pyx_t_3 = (__pyx_v_dest_rect.w == 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L11_bool_binop_done; } __pyx_t_3 = (__pyx_v_dest_rect.h == 0); __pyx_t_1 = __pyx_t_3; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":240 * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w # <<<<<<<<<<<<<< * dest_rect.h = self.trimmed_rect.h * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) */ __pyx_t_2 = __pyx_v_self->trimmed_rect.w; __pyx_v_dest_rect.w = __pyx_t_2; /* "pygame_sdl2/render.pyx":241 * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h # <<<<<<<<<<<<<< * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) * */ __pyx_t_2 = __pyx_v_self->trimmed_rect.h; __pyx_v_dest_rect.h = __pyx_t_2; /* "pygame_sdl2/render.pyx":239 * to_sdl_rect(dest, &dest_rect) * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: # <<<<<<<<<<<<<< * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h */ } /* "pygame_sdl2/render.pyx":242 * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) # <<<<<<<<<<<<<< * * */ (void)(SDL_RenderCopy(__pyx_v_self->texture->renderer, __pyx_v_self->texture->texture, NULL, (&__pyx_v_dest_rect))); } /* "pygame_sdl2/render.pyx":238 * else: * to_sdl_rect(dest, &dest_rect) * with nogil: # <<<<<<<<<<<<<< * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } } __pyx_L3:; /* "pygame_sdl2/render.pyx":229 * raise ValueError() * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__, "TextureNode.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__, "TextureNode.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":248 * cdef object frames * * def __init__(self, Renderer ren, fi): # <<<<<<<<<<<<<< * jdata = json.load(open(fi, "r")) * image = jdata["meta"]["image"] */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_ren = 0; PyObject *__pyx_v_fi = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ren,&__pyx_n_s_fi,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ren)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 248, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 248, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); } __pyx_v_ren = ((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)values[0]); __pyx_v_fi = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 248, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ren), __pyx_ptype_11pygame_sdl2_6render_Renderer, 1, "ren", 0))) __PYX_ERR(0, 248, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas___init__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self), __pyx_v_ren, __pyx_v_fi); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_12TextureAtlas___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_ren, PyObject *__pyx_v_fi) { PyObject *__pyx_v_jdata = NULL; PyObject *__pyx_v_image = NULL; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_tn = 0; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_itex = 0; PyObject *__pyx_v_itm = NULL; PyObject *__pyx_v_iname = NULL; PyObject *__pyx_v_idict = NULL; PyObject *__pyx_v_f = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/render.pyx":249 * * def __init__(self, Renderer ren, fi): * jdata = json.load(open(fi, "r")) # <<<<<<<<<<<<<< * image = jdata["meta"]["image"] * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_json); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_load); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_fi); __Pyx_GIVEREF(__pyx_v_fi); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fi)) __PYX_ERR(0, 249, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_r); __Pyx_GIVEREF(__pyx_n_s_r); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_r)) __PYX_ERR(0, 249, __pyx_L1_error); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_jdata = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":250 * def __init__(self, Renderer ren, fi): * jdata = json.load(open(fi, "r")) * image = jdata["meta"]["image"] # <<<<<<<<<<<<<< * * cdef TextureNode tn = ren.load_texture(image) */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_jdata, __pyx_n_s_meta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_image); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_image = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":252 * image = jdata["meta"]["image"] * * cdef TextureNode tn = ren.load_texture(image) # <<<<<<<<<<<<<< * * self.frames = {} */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ren), __pyx_n_s_load_texture); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_image}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11pygame_sdl2_6render_TextureNode))))) __PYX_ERR(0, 252, __pyx_L1_error) __pyx_v_tn = ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":254 * cdef TextureNode tn = ren.load_texture(image) * * self.frames = {} # <<<<<<<<<<<<<< * * cdef TextureNode itex */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->frames); __Pyx_DECREF(__pyx_v_self->frames); __pyx_v_self->frames = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":257 * * cdef TextureNode itex * for itm in jdata["frames"].items(): # <<<<<<<<<<<<<< * iname, idict = itm * itex = TextureNode(tn) */ __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_jdata, __pyx_n_s_frames); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 257, __pyx_L1_error) } __pyx_t_4 = __Pyx_dict_iterator(__pyx_t_1, 0, __pyx_n_s_items, (&__pyx_t_7), (&__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_7, &__pyx_t_6, NULL, NULL, &__pyx_t_4, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_itm, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":258 * cdef TextureNode itex * for itm in jdata["frames"].items(): * iname, idict = itm # <<<<<<<<<<<<<< * itex = TextureNode(tn) * f = idict["frame"] */ if ((likely(PyTuple_CheckExact(__pyx_v_itm))) || (PyList_CheckExact(__pyx_v_itm))) { PyObject* sequence = __pyx_v_itm; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 258, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { Py_ssize_t index = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_itm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_2), 2) < 0) __PYX_ERR(0, 258, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 258, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_iname, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_idict, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":259 * for itm in jdata["frames"].items(): * iname, idict = itm * itex = TextureNode(tn) # <<<<<<<<<<<<<< * f = idict["frame"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode), ((PyObject *)__pyx_v_tn)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_itex, ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_1)); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":260 * iname, idict = itm * itex = TextureNode(tn) * f = idict["frame"] # <<<<<<<<<<<<<< * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") * f = idict["spriteSourceSize"] */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_s_frame); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":261 * itex = TextureNode(tn) * f = idict["frame"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") # <<<<<<<<<<<<<< * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_h); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_10)) __PYX_ERR(0, 261, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_10 = 0; __pyx_t_12.__pyx_n = 1; __pyx_t_12.argname = __pyx_n_s_frame; __pyx_t_8 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_11, (&__pyx_v_itex->source_rect), &__pyx_t_12); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/render.pyx":262 * f = idict["frame"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") * f = idict["spriteSourceSize"] # <<<<<<<<<<<<<< * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: */ __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_s_spriteSourceSize); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/render.pyx":263 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") # <<<<<<<<<<<<<< * if idict["rotated"]: * raise error("Rotation not supported yet.") */ __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_x); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11)) __PYX_ERR(0, 263, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_10)) __PYX_ERR(0, 263, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error); __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_12.__pyx_n = 1; __pyx_t_12.argname = __pyx_n_s_spriteSourceSize; __pyx_t_8 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_1, (&__pyx_v_itex->trimmed_rect), &__pyx_t_12); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":264 * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: # <<<<<<<<<<<<<< * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_s_rotated); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_13)) { /* "pygame_sdl2/render.pyx":265 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: * raise error("Rotation not supported yet.") # <<<<<<<<<<<<<< * itex.source_w = idict["sourceSize"]["w"] * itex.source_h = idict["sourceSize"]["h"] */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s_Rotation_not_supported_yet}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 265, __pyx_L1_error) /* "pygame_sdl2/render.pyx":264 * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: # <<<<<<<<<<<<<< * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] */ } /* "pygame_sdl2/render.pyx":266 * if idict["rotated"]: * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] # <<<<<<<<<<<<<< * itex.source_h = idict["sourceSize"]["h"] * */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_s_sourceSize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_itex->source_w = __pyx_t_8; /* "pygame_sdl2/render.pyx":267 * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] * itex.source_h = idict["sourceSize"]["h"] # <<<<<<<<<<<<<< * * self.frames[iname] = itex */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_s_sourceSize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_itex->source_h = __pyx_t_8; /* "pygame_sdl2/render.pyx":269 * itex.source_h = idict["sourceSize"]["h"] * * self.frames[iname] = itex # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ if (unlikely((PyObject_SetItem(__pyx_v_self->frames, __pyx_v_iname, ((PyObject *)__pyx_v_itex)) < 0))) __PYX_ERR(0, 269, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":248 * cdef object frames * * def __init__(self, Renderer ren, fi): # <<<<<<<<<<<<<< * jdata = json.load(open(fi, "r")) * image = jdata["meta"]["image"] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_jdata); __Pyx_XDECREF(__pyx_v_image); __Pyx_XDECREF((PyObject *)__pyx_v_tn); __Pyx_XDECREF((PyObject *)__pyx_v_itex); __Pyx_XDECREF(__pyx_v_itm); __Pyx_XDECREF(__pyx_v_iname); __Pyx_XDECREF(__pyx_v_idict); __Pyx_XDECREF(__pyx_v_f); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":271 * self.frames[iname] = itex * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return self.frames[key] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_2__getitem__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_2__getitem__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "pygame_sdl2/render.pyx":272 * * def __getitem__(self, key): * return self.frames[key] # <<<<<<<<<<<<<< * * def keys(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->frames, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":271 * self.frames[iname] = itex * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return self.frames[key] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":274 * return self.frames[key] * * def keys(self): # <<<<<<<<<<<<<< * return self.frames.keys() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_12TextureAtlas_4keys, "TextureAtlas.keys(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_12TextureAtlas_5keys = {"keys", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_12TextureAtlas_4keys}; static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("keys (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("keys", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "keys", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_4keys(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_4keys(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("keys", 1); /* "pygame_sdl2/render.pyx":275 * * def keys(self): * return self.frames.keys() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frames, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":274 * return self.frames[key] * * def keys(self): # <<<<<<<<<<<<<< * return self.frames.keys() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__, "TextureAtlas.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self.frames,) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->frames); __Pyx_GIVEREF(__pyx_v_self->frames); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->frames)) __PYX_ERR(1, 5, __pyx_L1_error); __pyx_v_state = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self.frames,) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__dict = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":7 * state = (self.frames,) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_2 = (__pyx_v__dict != Py_None); if (__pyx_t_2) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self.frames is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self.frames,) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self.frames is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, None), state */ /*else*/ { __pyx_t_2 = (__pyx_v_self->frames != Py_None); __pyx_v_use_setstate = __pyx_t_2; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self.frames is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, None), state * else: */ if (__pyx_v_use_setstate) { /* "(tree fragment)":13 * use_setstate = self.frames is not None * if use_setstate: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_TextureAtlas); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_int_93638610); __Pyx_GIVEREF(__pyx_int_93638610); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_93638610)) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self.frames is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, None), state * else: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_TextureAtlas); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_int_93638610); __Pyx_GIVEREF(__pyx_int_93638610); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_93638610)) __PYX_ERR(1, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__, "TextureAtlas.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_11pygame_sdl2_6render___pyx_unpickle_TextureAtlas__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":291 * cdef double _scaley * * def __init__(self, nodes): # <<<<<<<<<<<<<< * self._color.r = 255 * self._color.g = 255 */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nodes = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodes,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nodes)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 291, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 291, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_nodes = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 291, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite___init__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), __pyx_v_nodes); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite___init__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_nodes) { PyObject *__pyx_v_node = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_nodes); /* "pygame_sdl2/render.pyx":292 * * def __init__(self, nodes): * self._color.r = 255 # <<<<<<<<<<<<<< * self._color.g = 255 * self._color.b = 255 */ __pyx_v_self->_color.r = 0xFF; /* "pygame_sdl2/render.pyx":293 * def __init__(self, nodes): * self._color.r = 255 * self._color.g = 255 # <<<<<<<<<<<<<< * self._color.b = 255 * self._color.a = 255 */ __pyx_v_self->_color.g = 0xFF; /* "pygame_sdl2/render.pyx":294 * self._color.r = 255 * self._color.g = 255 * self._color.b = 255 # <<<<<<<<<<<<<< * self._color.a = 255 * self._scalex = 1.0 */ __pyx_v_self->_color.b = 0xFF; /* "pygame_sdl2/render.pyx":295 * self._color.g = 255 * self._color.b = 255 * self._color.a = 255 # <<<<<<<<<<<<<< * self._scalex = 1.0 * self._scaley = 1.0 */ __pyx_v_self->_color.a = 0xFF; /* "pygame_sdl2/render.pyx":296 * self._color.b = 255 * self._color.a = 255 * self._scalex = 1.0 # <<<<<<<<<<<<<< * self._scaley = 1.0 * self._flip = SDL_FLIP_NONE */ __pyx_v_self->_scalex = 1.0; /* "pygame_sdl2/render.pyx":297 * self._color.a = 255 * self._scalex = 1.0 * self._scaley = 1.0 # <<<<<<<<<<<<<< * self._flip = SDL_FLIP_NONE * */ __pyx_v_self->_scaley = 1.0; /* "pygame_sdl2/render.pyx":298 * self._scalex = 1.0 * self._scaley = 1.0 * self._flip = SDL_FLIP_NONE # <<<<<<<<<<<<<< * * memset(&self._pos, 0, sizeof(SDL_Rect)) */ __pyx_v_self->_flip = SDL_FLIP_NONE; /* "pygame_sdl2/render.pyx":300 * self._flip = SDL_FLIP_NONE * * memset(&self._pos, 0, sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) * */ (void)(memset((&__pyx_v_self->_pos), 0, (sizeof(SDL_Rect)))); /* "pygame_sdl2/render.pyx":301 * * memset(&self._pos, 0, sizeof(SDL_Rect)) * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * * if isinstance(nodes, TextureNode): */ (void)(memset((&__pyx_v_self->bounding_box), 0, (sizeof(SDL_Rect)))); /* "pygame_sdl2/render.pyx":303 * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) * * if isinstance(nodes, TextureNode): # <<<<<<<<<<<<<< * nodes = [nodes] * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_nodes, __pyx_ptype_11pygame_sdl2_6render_TextureNode); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":304 * * if isinstance(nodes, TextureNode): * nodes = [nodes] # <<<<<<<<<<<<<< * * self.nodes = [] */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_nodes); __Pyx_GIVEREF(__pyx_v_nodes); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_nodes)) __PYX_ERR(0, 304, __pyx_L1_error); __Pyx_DECREF_SET(__pyx_v_nodes, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":303 * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) * * if isinstance(nodes, TextureNode): # <<<<<<<<<<<<<< * nodes = [nodes] * */ } /* "pygame_sdl2/render.pyx":306 * nodes = [nodes] * * self.nodes = [] # <<<<<<<<<<<<<< * # TODO: Check that they're all from the same texture. * for node in nodes: */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->nodes); __Pyx_DECREF(__pyx_v_self->nodes); __pyx_v_self->nodes = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":308 * self.nodes = [] * # TODO: Check that they're all from the same texture. * for node in nodes: # <<<<<<<<<<<<<< * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) */ if (likely(PyList_CheckExact(__pyx_v_nodes)) || PyTuple_CheckExact(__pyx_v_nodes)) { __pyx_t_2 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_nodes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 308, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":309 * # TODO: Check that they're all from the same texture. * for node in nodes: * if not isinstance(node, TextureNode): # <<<<<<<<<<<<<< * raise ValueError("Invalid argument: %s" % node) * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_node, __pyx_ptype_11pygame_sdl2_6render_TextureNode); __pyx_t_6 = (!__pyx_t_1); if (unlikely(__pyx_t_6)) { /* "pygame_sdl2/render.pyx":310 * for node in nodes: * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) # <<<<<<<<<<<<<< * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, * &self.bounding_box) */ __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_argument_s, __pyx_v_node); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(0, 310, __pyx_L1_error) /* "pygame_sdl2/render.pyx":309 * # TODO: Check that they're all from the same texture. * for node in nodes: * if not isinstance(node, TextureNode): # <<<<<<<<<<<<<< * raise ValueError("Invalid argument: %s" % node) * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, */ } /* "pygame_sdl2/render.pyx":311 * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, # <<<<<<<<<<<<<< * &self.bounding_box) * self.nodes.append(node) */ SDL_UnionRect((&__pyx_v_self->bounding_box), (&((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_node)->trimmed_rect), (&__pyx_v_self->bounding_box)); /* "pygame_sdl2/render.pyx":313 * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, * &self.bounding_box) * self.nodes.append(node) # <<<<<<<<<<<<<< * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); __PYX_ERR(0, 313, __pyx_L1_error) } __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->nodes, __pyx_v_node); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 313, __pyx_L1_error) /* "pygame_sdl2/render.pyx":308 * self.nodes = [] * # TODO: Check that they're all from the same texture. * for node in nodes: # <<<<<<<<<<<<<< * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":291 * cdef double _scaley * * def __init__(self, nodes): # <<<<<<<<<<<<<< * self._color.r = 255 * self._color.g = 255 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_node); __Pyx_XDECREF(__pyx_v_nodes); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":315 * self.nodes.append(node) * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: # <<<<<<<<<<<<<< * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) */ static void __pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, SDL_Rect const *__pyx_v_dest, SDL_Rect const *__pyx_v_rin, SDL_Rect *__pyx_v_rout) { /* "pygame_sdl2/render.pyx":316 * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: * rout.x = dest.x + (self._scalex * rin.x) # <<<<<<<<<<<<<< * rout.y = dest.y + (self._scaley * rin.y) * rout.w = (self._scalex * rin.w) */ __pyx_v_rout->x = (__pyx_v_dest->x + ((int)(__pyx_v_self->_scalex * __pyx_v_rin->x))); /* "pygame_sdl2/render.pyx":317 * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) # <<<<<<<<<<<<<< * rout.w = (self._scalex * rin.w) * rout.h = (self._scaley * rin.h) */ __pyx_v_rout->y = (__pyx_v_dest->y + ((int)(__pyx_v_self->_scaley * __pyx_v_rin->y))); /* "pygame_sdl2/render.pyx":318 * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) * rout.w = (self._scalex * rin.w) # <<<<<<<<<<<<<< * rout.h = (self._scaley * rin.h) * */ __pyx_v_rout->w = ((int)(__pyx_v_self->_scalex * __pyx_v_rin->w)); /* "pygame_sdl2/render.pyx":319 * rout.y = dest.y + (self._scaley * rin.y) * rout.w = (self._scalex * rin.w) * rout.h = (self._scaley * rin.h) # <<<<<<<<<<<<<< * * def render(self, dest=None): */ __pyx_v_rout->h = ((int)(__pyx_v_self->_scaley * __pyx_v_rin->h)); /* "pygame_sdl2/render.pyx":315 * self.nodes.append(node) * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: # <<<<<<<<<<<<<< * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) */ /* function exit code */ } /* "pygame_sdl2/render.pyx":321 * rout.h = (self._scaley * rin.h) * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef Texture tex = (self.nodes[0]).texture * cdef SDL_Rect dest_rect */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_6Sprite_2render, "Sprite.render(self, dest=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_6Sprite_3render = {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_3render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_2render}; static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dest = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dest,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dest); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "render") < 0)) __PYX_ERR(0, 321, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dest = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 321, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Sprite.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_2render(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), __pyx_v_dest); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_2render(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_dest) { struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_tex = 0; SDL_Rect __pyx_v_dest_rect; SDL_Rect __pyx_v_real_dest; SDL_Point __pyx_v_pivot; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_tn = 0; PyObject *__pyx_v_x = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 1); /* "pygame_sdl2/render.pyx":322 * * def render(self, dest=None): * cdef Texture tex = (self.nodes[0]).texture # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect real_dest */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 322, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->nodes, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_1)->texture); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tex = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":327 * cdef SDL_Point pivot * * if dest is None: # <<<<<<<<<<<<<< * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) * else: */ __pyx_t_3 = (__pyx_v_dest == Py_None); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":328 * * if dest is None: * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * else: * to_sdl_rect(dest, &dest_rect) */ (void)(memcpy((&__pyx_v_dest_rect), (&__pyx_v_self->_pos), (sizeof(SDL_Rect)))); /* "pygame_sdl2/render.pyx":327 * cdef SDL_Point pivot * * if dest is None: # <<<<<<<<<<<<<< * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":330 * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) * else: * to_sdl_rect(dest, &dest_rect) # <<<<<<<<<<<<<< * * with nogil: */ /*else*/ { __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), NULL); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 330, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/render.pyx":332 * to_sdl_rect(dest, &dest_rect) * * with nogil: # <<<<<<<<<<<<<< * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) * SDL_SetTextureAlphaMod(tex.texture, self._color.a) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/render.pyx":333 * * with nogil: * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) # <<<<<<<<<<<<<< * SDL_SetTextureAlphaMod(tex.texture, self._color.a) * */ (void)(SDL_SetTextureColorMod(__pyx_v_tex->texture, __pyx_v_self->_color.r, __pyx_v_self->_color.g, __pyx_v_self->_color.b)); /* "pygame_sdl2/render.pyx":334 * with nogil: * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) * SDL_SetTextureAlphaMod(tex.texture, self._color.a) # <<<<<<<<<<<<<< * * if DEBUG_DRAW_BBOX: */ (void)(SDL_SetTextureAlphaMod(__pyx_v_tex->texture, __pyx_v_self->_color.a)); /* "pygame_sdl2/render.pyx":336 * SDL_SetTextureAlphaMod(tex.texture, self._color.a) * * if DEBUG_DRAW_BBOX: # <<<<<<<<<<<<<< * # TODO: Adjust for rotation. * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) */ if (__pyx_v_11pygame_sdl2_6render_DEBUG_DRAW_BBOX) { /* "pygame_sdl2/render.pyx":338 * if DEBUG_DRAW_BBOX: * # TODO: Adjust for rotation. * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) # <<<<<<<<<<<<<< * * SDL_SetRenderDrawColor(tex.renderer, 0x00, 0x00, 0x00, 0x00) */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_self->__pyx_vtab)->adjust_rect(__pyx_v_self, (&__pyx_v_dest_rect), (&__pyx_v_self->bounding_box), (&__pyx_v_real_dest)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 338, __pyx_L5_error) /* "pygame_sdl2/render.pyx":340 * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) * * SDL_SetRenderDrawColor(tex.renderer, 0x00, 0x00, 0x00, 0x00) # <<<<<<<<<<<<<< * * cdef TextureNode tn */ (void)(SDL_SetRenderDrawColor(__pyx_v_tex->renderer, 0x00, 0x00, 0x00, 0x00)); /* "pygame_sdl2/render.pyx":336 * SDL_SetTextureAlphaMod(tex.texture, self._color.a) * * if DEBUG_DRAW_BBOX: # <<<<<<<<<<<<<< * # TODO: Adjust for rotation. * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) */ } } /* "pygame_sdl2/render.pyx":332 * to_sdl_rect(dest, &dest_rect) * * with nogil: # <<<<<<<<<<<<<< * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) * SDL_SetTextureAlphaMod(tex.texture, self._color.a) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L5_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } __pyx_L6:; } } /* "pygame_sdl2/render.pyx":343 * * cdef TextureNode tn * for x in self.nodes: # <<<<<<<<<<<<<< * tn = x * */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 343, __pyx_L1_error) } __pyx_t_2 = __pyx_v_self->nodes; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":344 * cdef TextureNode tn * for x in self.nodes: * tn = x # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_1 = __pyx_v_x; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_tn, ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_1)); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":346 * tn = x * * with nogil: # <<<<<<<<<<<<<< * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/render.pyx":347 * * with nogil: * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) # <<<<<<<<<<<<<< * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) * */ __pyx_v_pivot.x = ((int)(__pyx_v_self->_scalex * ((((double)__pyx_v_tn->source_w) / 2.0) - __pyx_v_tn->trimmed_rect.x))); /* "pygame_sdl2/render.pyx":348 * with nogil: * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) # <<<<<<<<<<<<<< * * self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) */ __pyx_v_pivot.y = ((int)(__pyx_v_self->_scaley * ((((double)__pyx_v_tn->source_h) / 2.0) - __pyx_v_tn->trimmed_rect.y))); /* "pygame_sdl2/render.pyx":350 * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) * * self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) # <<<<<<<<<<<<<< * * SDL_RenderCopyEx(tex.renderer, tex.texture, &tn.source_rect, */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_self->__pyx_vtab)->adjust_rect(__pyx_v_self, (&__pyx_v_dest_rect), (&__pyx_v_tn->trimmed_rect), (&__pyx_v_real_dest)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 350, __pyx_L13_error) /* "pygame_sdl2/render.pyx":352 * self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) * * SDL_RenderCopyEx(tex.renderer, tex.texture, &tn.source_rect, # <<<<<<<<<<<<<< * &real_dest, self._rotation, &pivot, * self._flip) */ (void)(SDL_RenderCopyEx(__pyx_v_tex->renderer, __pyx_v_tex->texture, (&__pyx_v_tn->source_rect), (&__pyx_v_real_dest), __pyx_v_self->_rotation, (&__pyx_v_pivot), ((SDL_RendererFlip)__pyx_v_self->_flip))); } /* "pygame_sdl2/render.pyx":346 * tn = x * * with nogil: # <<<<<<<<<<<<<< * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L14; } __pyx_L13_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } __pyx_L14:; } } /* "pygame_sdl2/render.pyx":343 * * cdef TextureNode tn * for x in self.nodes: # <<<<<<<<<<<<<< * tn = x * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":321 * rout.h = (self._scaley * rin.h) * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef Texture tex = (self.nodes[0]).texture * cdef SDL_Rect dest_rect */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tex); __Pyx_XDECREF((PyObject *)__pyx_v_tn); __Pyx_XDECREF(__pyx_v_x); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":356 * self._flip) * * def collides(self, Sprite other not None): # <<<<<<<<<<<<<< * cdef SDL_Rect r1, r2 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_6Sprite_4collides, "Sprite.collides(self, Sprite other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_6Sprite_5collides = {"collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_4collides}; static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collides (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collides") < 0)) __PYX_ERR(0, 356, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = ((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collides", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 356, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Sprite.collides", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_11pygame_sdl2_6render_Sprite, 0, "other", 0))) __PYX_ERR(0, 356, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_4collides(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), __pyx_v_other); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_4collides(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_other) { SDL_Rect __pyx_v_r1; SDL_Rect __pyx_v_r2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collides", 1); /* "pygame_sdl2/render.pyx":359 * cdef SDL_Rect r1, r2 * * self.adjust_rect(&self._pos, &self.bounding_box, &r1) # <<<<<<<<<<<<<< * other.adjust_rect(&other._pos, &other.bounding_box, &r2) * */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_self->__pyx_vtab)->adjust_rect(__pyx_v_self, (&__pyx_v_self->_pos), (&__pyx_v_self->bounding_box), (&__pyx_v_r1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L1_error) /* "pygame_sdl2/render.pyx":360 * * self.adjust_rect(&self._pos, &self.bounding_box, &r1) * other.adjust_rect(&other._pos, &other.bounding_box, &r2) # <<<<<<<<<<<<<< * * return SDL_HasIntersection(&r1, &r2) == SDL_TRUE */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_other->__pyx_vtab)->adjust_rect(__pyx_v_other, (&__pyx_v_other->_pos), (&__pyx_v_other->bounding_box), (&__pyx_v_r2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L1_error) /* "pygame_sdl2/render.pyx":362 * other.adjust_rect(&other._pos, &other.bounding_box, &r2) * * return SDL_HasIntersection(&r1, &r2) == SDL_TRUE # <<<<<<<<<<<<<< * * property pos: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_HasIntersection((&__pyx_v_r1), (&__pyx_v_r2)) == SDL_TRUE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":356 * self._flip) * * def collides(self, Sprite other not None): # <<<<<<<<<<<<<< * cdef SDL_Rect r1, r2 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.collides", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":365 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._pos.x, self._pos.y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":366 * property pos: * def __get__(self): * return self._pos.x, self._pos.y # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_pos.x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_pos.y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":365 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._pos.x, self._pos.y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":368 * return self._pos.x, self._pos.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._pos.x = val[0] * self._pos.y = val[1] */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/render.pyx":369 * * def __set__(self, val): * self._pos.x = val[0] # <<<<<<<<<<<<<< * self._pos.y = val[1] * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_pos.x = __pyx_t_2; /* "pygame_sdl2/render.pyx":370 * def __set__(self, val): * self._pos.x = val[0] * self._pos.y = val[1] # <<<<<<<<<<<<<< * * property color: */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_pos.y = __pyx_t_2; /* "pygame_sdl2/render.pyx":368 * return self._pos.x, self._pos.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._pos.x = val[0] * self._pos.y = val[1] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":373 * * property color: * def __set__(self, val): # <<<<<<<<<<<<<< * if not isinstance(val, Color): * val = Color(val) */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5color_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5color_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5color___set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5color___set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Uint8 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_val); /* "pygame_sdl2/render.pyx":374 * property color: * def __set__(self, val): * if not isinstance(val, Color): # <<<<<<<<<<<<<< * val = Color(val) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_val, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":375 * def __set__(self, val): * if not isinstance(val, Color): * val = Color(val) # <<<<<<<<<<<<<< * * self._color.r = val.r */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Color); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_val}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":374 * property color: * def __set__(self, val): * if not isinstance(val, Color): # <<<<<<<<<<<<<< * val = Color(val) * */ } /* "pygame_sdl2/render.pyx":377 * val = Color(val) * * self._color.r = val.r # <<<<<<<<<<<<<< * self._color.g = val.g * self._color.b = val.b */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.r = __pyx_t_7; /* "pygame_sdl2/render.pyx":378 * * self._color.r = val.r * self._color.g = val.g # <<<<<<<<<<<<<< * self._color.b = val.b * self._color.a = val.a */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.g = __pyx_t_7; /* "pygame_sdl2/render.pyx":379 * self._color.r = val.r * self._color.g = val.g * self._color.b = val.b # <<<<<<<<<<<<<< * self._color.a = val.a * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.b = __pyx_t_7; /* "pygame_sdl2/render.pyx":380 * self._color.g = val.g * self._color.b = val.b * self._color.a = val.a # <<<<<<<<<<<<<< * * property alpha: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.a = __pyx_t_7; /* "pygame_sdl2/render.pyx":373 * * property color: * def __set__(self, val): # <<<<<<<<<<<<<< * if not isinstance(val, Color): * val = Color(val) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.color.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_val); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":383 * * property alpha: * def __get__(self): # <<<<<<<<<<<<<< * return self._color.a * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":384 * property alpha: * def __get__(self): * return self._color.a # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->_color.a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":383 * * property alpha: * def __get__(self): # <<<<<<<<<<<<<< * return self._color.a * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.alpha.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":386 * return self._color.a * * def __set__(self, val): # <<<<<<<<<<<<<< * self._color.a = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/render.pyx":387 * * def __set__(self, val): * self._color.a = val # <<<<<<<<<<<<<< * * property rotation: */ __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_1 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) __pyx_v_self->_color.a = __pyx_t_1; /* "pygame_sdl2/render.pyx":386 * return self._color.a * * def __set__(self, val): # <<<<<<<<<<<<<< * self._color.a = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.alpha.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/render.pyx":390 * * property rotation: * def __get__(self): # <<<<<<<<<<<<<< * return self._rotation * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":391 * property rotation: * def __get__(self): * return self._rotation # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_rotation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":390 * * property rotation: * def __get__(self): # <<<<<<<<<<<<<< * return self._rotation * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.rotation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":393 * return self._rotation * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rotation = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; double __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/render.pyx":394 * * def __set__(self, val): * self._rotation = val # <<<<<<<<<<<<<< * * property scale: */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error) __pyx_v_self->_rotation = __pyx_t_1; /* "pygame_sdl2/render.pyx":393 * return self._rotation * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rotation = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.rotation.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/render.pyx":397 * * property scale: * def __get__(self): # <<<<<<<<<<<<<< * if self._scalex == self._scaley: * return self._scalex */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5scale___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":398 * property scale: * def __get__(self): * if self._scalex == self._scaley: # <<<<<<<<<<<<<< * return self._scalex * else: */ __pyx_t_1 = (__pyx_v_self->_scalex == __pyx_v_self->_scaley); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":399 * def __get__(self): * if self._scalex == self._scaley: * return self._scalex # <<<<<<<<<<<<<< * else: * return self._scalex, self._scaley */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_scalex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":398 * property scale: * def __get__(self): * if self._scalex == self._scaley: # <<<<<<<<<<<<<< * return self._scalex * else: */ } /* "pygame_sdl2/render.pyx":401 * return self._scalex * else: * return self._scalex, self._scaley # <<<<<<<<<<<<<< * * def __set__(self, arg): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_scalex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->_scaley); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/render.pyx":397 * * property scale: * def __get__(self): # <<<<<<<<<<<<<< * if self._scalex == self._scaley: * return self._scalex */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.scale.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":403 * return self._scalex, self._scaley * * def __set__(self, arg): # <<<<<<<<<<<<<< * if type(arg) == tuple: * x, y = arg */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_arg); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_arg) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_arg)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_arg) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); double __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/render.pyx":404 * * def __set__(self, arg): * if type(arg) == tuple: # <<<<<<<<<<<<<< * x, y = arg * else: */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_arg)), ((PyObject *)(&PyTuple_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":405 * def __set__(self, arg): * if type(arg) == tuple: * x, y = arg # <<<<<<<<<<<<<< * else: * x = y = arg */ if ((likely(PyTuple_CheckExact(__pyx_v_arg))) || (PyList_CheckExact(__pyx_v_arg))) { PyObject* sequence = __pyx_v_arg; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 405, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 405, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 405, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":404 * * def __set__(self, arg): * if type(arg) == tuple: # <<<<<<<<<<<<<< * x, y = arg * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":407 * x, y = arg * else: * x = y = arg # <<<<<<<<<<<<<< * * self._scalex = x */ /*else*/ { __Pyx_INCREF(__pyx_v_arg); __pyx_v_x = __pyx_v_arg; __Pyx_INCREF(__pyx_v_arg); __pyx_v_y = __pyx_v_arg; } __pyx_L3:; /* "pygame_sdl2/render.pyx":409 * x = y = arg * * self._scalex = x # <<<<<<<<<<<<<< * self._scaley = y * */ __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_x); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L1_error) __pyx_v_self->_scalex = __pyx_t_6; /* "pygame_sdl2/render.pyx":410 * * self._scalex = x * self._scaley = y # <<<<<<<<<<<<<< * * property hflip: */ __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_y); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error) __pyx_v_self->_scaley = __pyx_t_6; /* "pygame_sdl2/render.pyx":403 * return self._scalex, self._scaley * * def __set__(self, arg): # <<<<<<<<<<<<<< * if type(arg) == tuple: * x, y = arg */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.scale.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":413 * * property hflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_HORIZONTAL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":414 * property hflip: * def __get__(self): * return self._flip & SDL_FLIP_HORIZONTAL # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->_flip & SDL_FLIP_HORIZONTAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":413 * * property hflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_HORIZONTAL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.hflip.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":416 * return self._flip & SDL_FLIP_HORIZONTAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_HORIZONTAL */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/render.pyx":417 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_HORIZONTAL * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 417, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":418 * def __set__(self, val): * if val: * self._flip |= SDL_FLIP_HORIZONTAL # <<<<<<<<<<<<<< * else: * self._flip &= ~SDL_FLIP_HORIZONTAL */ __pyx_v_self->_flip = (__pyx_v_self->_flip | SDL_FLIP_HORIZONTAL); /* "pygame_sdl2/render.pyx":417 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_HORIZONTAL * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":420 * self._flip |= SDL_FLIP_HORIZONTAL * else: * self._flip &= ~SDL_FLIP_HORIZONTAL # <<<<<<<<<<<<<< * * property vflip: */ /*else*/ { __pyx_v_self->_flip = (__pyx_v_self->_flip & (~SDL_FLIP_HORIZONTAL)); } __pyx_L3:; /* "pygame_sdl2/render.pyx":416 * return self._flip & SDL_FLIP_HORIZONTAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_HORIZONTAL */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.hflip.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/render.pyx":423 * * property vflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_VERTICAL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":424 * property vflip: * def __get__(self): * return self._flip & SDL_FLIP_VERTICAL # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->_flip & SDL_FLIP_VERTICAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":423 * * property vflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_VERTICAL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.vflip.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":426 * return self._flip & SDL_FLIP_VERTICAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_VERTICAL */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/render.pyx":427 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_VERTICAL * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 427, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":428 * def __set__(self, val): * if val: * self._flip |= SDL_FLIP_VERTICAL # <<<<<<<<<<<<<< * else: * self._flip &= ~SDL_FLIP_VERTICAL */ __pyx_v_self->_flip = (__pyx_v_self->_flip | SDL_FLIP_VERTICAL); /* "pygame_sdl2/render.pyx":427 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_VERTICAL * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":430 * self._flip |= SDL_FLIP_VERTICAL * else: * self._flip &= ~SDL_FLIP_VERTICAL # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_v_self->_flip = (__pyx_v_self->_flip & (~SDL_FLIP_VERTICAL)); } __pyx_L3:; /* "pygame_sdl2/render.pyx":426 * return self._flip & SDL_FLIP_VERTICAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_VERTICAL */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.vflip.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_6Sprite_6__reduce_cython__, "Sprite.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_6Sprite_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_6__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_6__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such_2, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_6Sprite_8__setstate_cython__, "Sprite.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_6Sprite_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_8__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_8__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such_2, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":439 * cdef list sprites * * def __init__(self, rect): # <<<<<<<<<<<<<< * """ Parameter may be a position (no clipping) or a rect (clipped). """ * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_9Container_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_9Container___init__, " Parameter may be a position (no clipping) or a rect (clipped). "); #if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__; #endif static int __pyx_pw_11pygame_sdl2_6render_9Container_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rect = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rect,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 439, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_rect = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 439, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Container.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container___init__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), __pyx_v_rect); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_9Container___init__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_rect) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/render.pyx":442 * """ Parameter may be a position (no clipping) or a rect (clipped). """ * * self.sprites = [] # <<<<<<<<<<<<<< * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->sprites); __Pyx_DECREF(__pyx_v_self->sprites); __pyx_v_self->sprites = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":443 * * self.sprites = [] * to_sdl_rect(rect, &self._rect) # <<<<<<<<<<<<<< * if len(rect) == 2: * self._rect.w = self._rect.h = 0 */ __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_self->_rect), NULL); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 443, __pyx_L1_error) /* "pygame_sdl2/render.pyx":444 * self.sprites = [] * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: # <<<<<<<<<<<<<< * self._rect.w = self._rect.h = 0 * */ __pyx_t_3 = PyObject_Length(__pyx_v_rect); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 444, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 == 2); if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":445 * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: * self._rect.w = self._rect.h = 0 # <<<<<<<<<<<<<< * * def add(self, Sprite sprite not None): */ __pyx_v_self->_rect.w = 0; __pyx_v_self->_rect.h = 0; /* "pygame_sdl2/render.pyx":444 * self.sprites = [] * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: # <<<<<<<<<<<<<< * self._rect.w = self._rect.h = 0 * */ } /* "pygame_sdl2/render.pyx":439 * cdef list sprites * * def __init__(self, rect): # <<<<<<<<<<<<<< * """ Parameter may be a position (no clipping) or a rect (clipped). """ * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Container.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":447 * self._rect.w = self._rect.h = 0 * * def add(self, Sprite sprite not None): # <<<<<<<<<<<<<< * self.sprites.append(sprite) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3add(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_9Container_2add, "Container.add(self, Sprite sprite)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_9Container_3add = {"add", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_3add, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_2add}; static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3add(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_sprite = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sprite,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sprite)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add") < 0)) __PYX_ERR(0, 447, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sprite = ((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 447, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Container.add", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sprite), __pyx_ptype_11pygame_sdl2_6render_Sprite, 0, "sprite", 0))) __PYX_ERR(0, 447, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_2add(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), __pyx_v_sprite); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_2add(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_sprite) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add", 1); /* "pygame_sdl2/render.pyx":448 * * def add(self, Sprite sprite not None): * self.sprites.append(sprite) # <<<<<<<<<<<<<< * * def render(self, dest=None): */ if (unlikely(__pyx_v_self->sprites == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); __PYX_ERR(0, 448, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->sprites, ((PyObject *)__pyx_v_sprite)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 448, __pyx_L1_error) /* "pygame_sdl2/render.pyx":447 * self._rect.w = self._rect.h = 0 * * def add(self, Sprite sprite not None): # <<<<<<<<<<<<<< * self.sprites.append(sprite) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.add", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":450 * self.sprites.append(sprite) * * def render(self, dest=None): # <<<<<<<<<<<<<< * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_5render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_9Container_4render, "Container.render(self, dest=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_9Container_5render = {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_5render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_4render}; static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_5render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_dest = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dest,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dest); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "render") < 0)) __PYX_ERR(0, 450, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dest = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 450, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Container.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_4render(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), __pyx_v_dest); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4render(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dest) { SDL_Renderer *__pyx_v_ren; PyObject *__pyx_v_s = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; SDL_Renderer *__pyx_t_3; int __pyx_t_4; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 1); /* "pygame_sdl2/render.pyx":452 * def render(self, dest=None): * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer # <<<<<<<<<<<<<< * * if self._rect.w != 0 and self._rect.h != 0: */ if (unlikely(__pyx_v_self->sprites == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 452, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->sprites, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_t_1)->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 452, __pyx_L1_error) } __pyx_t_2 = __Pyx_GetItemInt_List(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_t_1)->nodes, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_2)->texture->renderer; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ren = __pyx_t_3; /* "pygame_sdl2/render.pyx":454 * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer * * if self._rect.w != 0 and self._rect.h != 0: # <<<<<<<<<<<<<< * SDL_RenderSetClipRect(ren, &self._rect) * */ __pyx_t_5 = (__pyx_v_self->_rect.w != 0); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = (__pyx_v_self->_rect.h != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":455 * * if self._rect.w != 0 and self._rect.h != 0: * SDL_RenderSetClipRect(ren, &self._rect) # <<<<<<<<<<<<<< * * for s in self.sprites: */ (void)(SDL_RenderSetClipRect(__pyx_v_ren, (&__pyx_v_self->_rect))); /* "pygame_sdl2/render.pyx":454 * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer * * if self._rect.w != 0 and self._rect.h != 0: # <<<<<<<<<<<<<< * SDL_RenderSetClipRect(ren, &self._rect) * */ } /* "pygame_sdl2/render.pyx":457 * SDL_RenderSetClipRect(ren, &self._rect) * * for s in self.sprites: # <<<<<<<<<<<<<< * s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) * */ if (unlikely(__pyx_v_self->sprites == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 457, __pyx_L1_error) } __pyx_t_2 = __pyx_v_self->sprites; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 457, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 457, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":458 * * for s in self.sprites: * s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) # <<<<<<<<<<<<<< * * # TODO: Save and restore previous clip rect instead? */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_render); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_pos); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyNumber_Add(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_pos); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = PyNumber_Add(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10)) __PYX_ERR(0, 458, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_11)) __PYX_ERR(0, 458, __pyx_L1_error); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":457 * SDL_RenderSetClipRect(ren, &self._rect) * * for s in self.sprites: # <<<<<<<<<<<<<< * s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":461 * * # TODO: Save and restore previous clip rect instead? * SDL_RenderSetClipRect(ren, NULL) # <<<<<<<<<<<<<< * * property pos: */ (void)(SDL_RenderSetClipRect(__pyx_v_ren, NULL)); /* "pygame_sdl2/render.pyx":450 * self.sprites.append(sprite) * * def render(self, dest=None): # <<<<<<<<<<<<<< * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.render.Container.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":464 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._rect.x, self._rect.y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3pos_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_3pos___get__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":465 * property pos: * def __get__(self): * return self._rect.x, self._rect.y # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":464 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._rect.x, self._rect.y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.render.Container.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":467 * return self._rect.x, self._rect.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rect.x = val[0] * self._rect.y = val[1] */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_9Container_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_9Container_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_3pos_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_9Container_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/render.pyx":468 * * def __set__(self, val): * self._rect.x = val[0] # <<<<<<<<<<<<<< * self._rect.y = val[1] * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_rect.x = __pyx_t_2; /* "pygame_sdl2/render.pyx":469 * def __set__(self, val): * self._rect.x = val[0] * self._rect.y = val[1] # <<<<<<<<<<<<<< * * property rect: */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_rect.y = __pyx_t_2; /* "pygame_sdl2/render.pyx":467 * return self._rect.x, self._rect.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rect.x = val[0] * self._rect.y = val[1] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Container.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":472 * * property rect: * def __get__(self): # <<<<<<<<<<<<<< * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_4rect_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_4rect_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_4rect___get__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4rect___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":473 * property rect: * def __get__(self): * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":472 * * property rect: * def __get__(self): # <<<<<<<<<<<<<< * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.render.Container.rect.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":475 * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * * def __set__(self, val): # <<<<<<<<<<<<<< * to_sdl_rect(val, &self._rect) * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_9Container_4rect_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_9Container_4rect_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_4rect_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_9Container_4rect_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/render.pyx":476 * * def __set__(self, val): * to_sdl_rect(val, &self._rect) # <<<<<<<<<<<<<< * */ __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_val, (&__pyx_v_self->_rect), NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 476, __pyx_L1_error) /* "pygame_sdl2/render.pyx":475 * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * * def __set__(self, val): # <<<<<<<<<<<<<< * to_sdl_rect(val, &self._rect) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.rect.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_9Container_6__reduce_cython__, "Container.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_9Container_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_6__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_6__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such_3, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_9Container_8__setstate_cython__, "Container.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_9Container_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_8__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Container.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_8__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such_3, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_2__pyx_unpickle_TextureAtlas, "__pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas = {"__pyx_unpickle_TextureAtlas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_2__pyx_unpickle_TextureAtlas}; static PyObject *__pyx_pw_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_TextureAtlas (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TextureAtlas", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TextureAtlas", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_TextureAtlas") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TextureAtlas", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.__pyx_unpickle_TextureAtlas", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_2__pyx_unpickle_TextureAtlas(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_2__pyx_unpickle_TextureAtlas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_TextureAtlas", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x594cfd2, 0xe7d6794, 0xdcdc1ac): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple_, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum not in (0x594cfd2, 0xe7d6794, 0xdcdc1ac): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum * __pyx_result = TextureAtlas.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v___pyx_PickleError = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum not in (0x594cfd2, 0xe7d6794, 0xdcdc1ac): * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum # <<<<<<<<<<<<<< * __pyx_result = TextureAtlas.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x594cfd2, 0xe7d6794, 0xdcdc1ac): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum * __pyx_result = TextureAtlas.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureAtlas), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v___pyx_result = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum * __pyx_result = TextureAtlas.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_2 = (__pyx_v___pyx_state != Py_None); if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = TextureAtlas.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_t_1 = __pyx_f_11pygame_sdl2_6render___pyx_unpickle_TextureAtlas__set_state(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum * __pyx_result = TextureAtlas.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): * __pyx_result.frames = __pyx_state[0] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.__pyx_unpickle_TextureAtlas", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.frames = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_11pygame_sdl2_6render___pyx_unpickle_TextureAtlas__set_state(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_TextureAtlas__set_state", 1); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): * __pyx_result.frames = __pyx_state[0] # <<<<<<<<<<<<<< * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->frames); __Pyx_DECREF(__pyx_v___pyx_result->frames); __pyx_v___pyx_result->frames = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): * __pyx_result.frames = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 13, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 > 1); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":14 * __pyx_result.frames = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 14, __pyx_L1_error) } __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): * __pyx_result.frames = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ } /* "(tree fragment)":11 * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.frames = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.render.__pyx_unpickle_TextureAtlas__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer __pyx_vtable_11pygame_sdl2_6render_Renderer; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Renderer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Renderer *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_6render_Renderer; p->_info = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_11pygame_sdl2_6render_8Renderer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Renderer(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_Renderer *p = (struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_6render_Renderer) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_6render_8Renderer_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->_info); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_6render_Renderer(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_Renderer *p = (struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o; if (p->_info) { e = (*v)(p->_info, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_Renderer(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_Renderer *p = (struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o; tmp = ((PyObject*)p->_info); p->_info = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Renderer[] = { {"load_texture", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_6load_texture}, {"load_atlas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_8load_atlas}, {"render_present", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_10render_present}, {"info", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_13info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_12info}, {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_14clear}, {"draw_line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_16draw_line}, {"draw_point", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_18draw_point}, {"draw_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_20draw_rect}, {"fill_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_22fill_rect}, {"set_viewport", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_24set_viewport}, {"create_texture", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_26create_texture}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_29__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_28__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_31__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_30__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_6render_Renderer_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_6render_Renderer}, {Py_tp_doc, (void *)PyDoc_STR("Renderer(Window window=None, vsync=False, driver=-1)")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_6render_Renderer}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_6render_Renderer}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_6render_Renderer}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_6render_Renderer}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_6render_Renderer_spec = { "pygame_sdl2.render.Renderer", sizeof(struct __pyx_obj_11pygame_sdl2_6render_Renderer), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_6render_Renderer_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_6render_Renderer = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.""Renderer", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Renderer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Renderer, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Renderer(Window window=None, vsync=False, driver=-1)"), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_Renderer, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_Renderer, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Renderer, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Renderer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture __pyx_vtable_11pygame_sdl2_6render_Texture; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Texture(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Texture *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_6render_Texture; if (unlikely(__pyx_pw_11pygame_sdl2_6render_7Texture_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Texture(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_6render_Texture) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_6render_7Texture_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_getprop_11pygame_sdl2_6render_7Texture_w(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1w_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_7Texture_w(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1w_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_7Texture_h(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1h_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_7Texture_h(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1h_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Texture[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_7Texture_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_7Texture_4__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_7Texture_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_7Texture_6__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_6render_Texture[] = { {(char *)"w", __pyx_getprop_11pygame_sdl2_6render_7Texture_w, __pyx_setprop_11pygame_sdl2_6render_7Texture_w, (char *)PyDoc_STR("w: 'int'"), 0}, {(char *)"h", __pyx_getprop_11pygame_sdl2_6render_7Texture_h, __pyx_setprop_11pygame_sdl2_6render_7Texture_h, (char *)PyDoc_STR("h: 'int'"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_6render_Texture_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_6render_Texture}, {Py_tp_doc, (void *)PyDoc_STR(" Mostly for internal use. Users should only see this for RTT. ")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_6render_Texture}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_6render_Texture}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_6render_Texture}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_6render_Texture_spec = { "pygame_sdl2.render.Texture", sizeof(struct __pyx_obj_11pygame_sdl2_6render_Texture), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_6render_Texture_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_6render_Texture = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.""Texture", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Texture), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Texture, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR(" Mostly for internal use. Users should only see this for RTT. "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Texture, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_6render_Texture, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Texture, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureNode(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o); p->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_TextureNode(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_6render_TextureNode) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->texture); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_6render_TextureNode(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o; if (p->texture) { e = (*v)(((PyObject *)p->texture), a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_TextureNode(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o; tmp = ((PyObject*)p->texture); p->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_TextureNode[] = { {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_11TextureNode_2render}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_6render_TextureNode_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_6render_TextureNode}, {Py_tp_doc, (void *)PyDoc_STR("TextureNode(tex)\n A specified area of a texture. ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_6render_TextureNode}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_6render_TextureNode}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_6render_TextureNode}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_6render_TextureNode}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_6render_TextureNode_spec = { "pygame_sdl2.render.TextureNode", sizeof(struct __pyx_obj_11pygame_sdl2_6render_TextureNode), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_6render_TextureNode_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_6render_TextureNode = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.""TextureNode", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_TextureNode), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_TextureNode, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("TextureNode(tex)\n A specified area of a texture. "), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_TextureNode, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_TextureNode, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_TextureNode, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_TextureNode, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureAtlas(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o); p->frames = Py_None; Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_TextureAtlas(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_6render_TextureAtlas) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->frames); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_6render_TextureAtlas(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o; if (p->frames) { e = (*v)(p->frames, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_TextureAtlas(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o; tmp = ((PyObject*)p->frames); p->frames = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_sq_item_11pygame_sdl2_6render_TextureAtlas(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_TextureAtlas[] = { {"keys", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_12TextureAtlas_4keys}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_6render_TextureAtlas_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_6render_TextureAtlas}, {Py_sq_item, (void *)__pyx_sq_item_11pygame_sdl2_6render_TextureAtlas}, {Py_mp_subscript, (void *)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__}, {Py_tp_doc, (void *)PyDoc_STR("TextureAtlas(Renderer ren, fi)")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_6render_TextureAtlas}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_6render_TextureAtlas}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_6render_TextureAtlas}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_6render_TextureAtlas}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_6render_TextureAtlas_spec = { "pygame_sdl2.render.TextureAtlas", sizeof(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_6render_TextureAtlas_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence_TextureAtlas = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_6render_TextureAtlas, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_TextureAtlas = { 0, /*mp_length*/ __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_TextureAtlas = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.""TextureAtlas", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_TextureAtlas, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_TextureAtlas, /*tp_as_sequence*/ &__pyx_tp_as_mapping_TextureAtlas, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("TextureAtlas(Renderer ren, fi)"), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_TextureAtlas, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_TextureAtlas, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_TextureAtlas, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_TextureAtlas, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite __pyx_vtable_11pygame_sdl2_6render_Sprite; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Sprite(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Sprite *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_6render_Sprite; p->nodes = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Sprite(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_Sprite *p = (struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_6render_Sprite) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->nodes); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_6render_Sprite(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_Sprite *p = (struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o; if (p->nodes) { e = (*v)(p->nodes, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_Sprite(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_Sprite *p = (struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o; tmp = ((PyObject*)p->nodes); p->nodes = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_pos(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_color(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5color_1__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_alpha(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_alpha(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_rotation(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_rotation(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_scale(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_scale(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_hflip(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_hflip(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_vflip(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_vflip(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Sprite[] = { {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_3render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_2render}, {"collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_4collides}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_8__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_6render_Sprite[] = { {(char *)"pos", __pyx_getprop_11pygame_sdl2_6render_6Sprite_pos, __pyx_setprop_11pygame_sdl2_6render_6Sprite_pos, (char *)0, 0}, {(char *)"color", 0, __pyx_setprop_11pygame_sdl2_6render_6Sprite_color, (char *)0, 0}, {(char *)"alpha", __pyx_getprop_11pygame_sdl2_6render_6Sprite_alpha, __pyx_setprop_11pygame_sdl2_6render_6Sprite_alpha, (char *)0, 0}, {(char *)"rotation", __pyx_getprop_11pygame_sdl2_6render_6Sprite_rotation, __pyx_setprop_11pygame_sdl2_6render_6Sprite_rotation, (char *)0, 0}, {(char *)"scale", __pyx_getprop_11pygame_sdl2_6render_6Sprite_scale, __pyx_setprop_11pygame_sdl2_6render_6Sprite_scale, (char *)0, 0}, {(char *)"hflip", __pyx_getprop_11pygame_sdl2_6render_6Sprite_hflip, __pyx_setprop_11pygame_sdl2_6render_6Sprite_hflip, (char *)0, 0}, {(char *)"vflip", __pyx_getprop_11pygame_sdl2_6render_6Sprite_vflip, __pyx_setprop_11pygame_sdl2_6render_6Sprite_vflip, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_6render_Sprite_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_6render_Sprite}, {Py_tp_doc, (void *)PyDoc_STR("Sprite(nodes)\n One or more TextureNodes, with possible transforms applied. ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_6render_Sprite}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_6render_Sprite}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_6render_Sprite}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_6render_Sprite}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_6render_Sprite}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_6render_Sprite_spec = { "pygame_sdl2.render.Sprite", sizeof(struct __pyx_obj_11pygame_sdl2_6render_Sprite), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_6render_Sprite_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_6render_Sprite = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.""Sprite", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Sprite), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Sprite, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Sprite(nodes)\n One or more TextureNodes, with possible transforms applied. "), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_Sprite, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_Sprite, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Sprite, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_6render_Sprite, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Sprite, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Container(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Container *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_6render_Container *)o); p->sprites = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Container(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_Container *p = (struct __pyx_obj_11pygame_sdl2_6render_Container *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_6render_Container) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->sprites); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_6render_Container(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_Container *p = (struct __pyx_obj_11pygame_sdl2_6render_Container *)o; if (p->sprites) { e = (*v)(p->sprites, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_Container(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_Container *p = (struct __pyx_obj_11pygame_sdl2_6render_Container *)o; tmp = ((PyObject*)p->sprites); p->sprites = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_6render_9Container_pos(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_9Container_3pos_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_9Container_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_9Container_3pos_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_9Container_rect(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_9Container_4rect_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_9Container_rect(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_9Container_4rect_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Container[] = { {"add", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_3add, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_2add}, {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_5render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_4render}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_8__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_6render_Container[] = { {(char *)"pos", __pyx_getprop_11pygame_sdl2_6render_9Container_pos, __pyx_setprop_11pygame_sdl2_6render_9Container_pos, (char *)0, 0}, {(char *)"rect", __pyx_getprop_11pygame_sdl2_6render_9Container_rect, __pyx_setprop_11pygame_sdl2_6render_9Container_rect, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_6render_Container_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_6render_Container}, {Py_tp_doc, (void *)PyDoc_STR("Container(rect)\n Multiple sprites, positioned relative to the container. ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_6render_Container}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_6render_Container}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_6render_Container}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_6render_Container}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_6render_9Container_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_6render_Container}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_6render_Container_spec = { "pygame_sdl2.render.Container", sizeof(struct __pyx_obj_11pygame_sdl2_6render_Container), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_6render_Container_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_6render_Container = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.""Container", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Container), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Container, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Container(rect)\n Multiple sprites, positioned relative to the container. "), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_Container, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_Container, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Container, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_6render_Container, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_6render_9Container_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Container, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_BLENDMODE_ADD, __pyx_k_BLENDMODE_ADD, sizeof(__pyx_k_BLENDMODE_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLENDMODE_BLEND, __pyx_k_BLENDMODE_BLEND, sizeof(__pyx_k_BLENDMODE_BLEND), 0, 0, 1, 1}, {&__pyx_n_s_BLENDMODE_MOD, __pyx_k_BLENDMODE_MOD, sizeof(__pyx_k_BLENDMODE_MOD), 0, 0, 1, 1}, {&__pyx_n_s_BLENDMODE_NONE, __pyx_k_BLENDMODE_NONE, sizeof(__pyx_k_BLENDMODE_NONE), 0, 0, 1, 1}, {&__pyx_n_s_Color, __pyx_k_Color, sizeof(__pyx_k_Color), 0, 0, 1, 1}, {&__pyx_n_s_Container, __pyx_k_Container, sizeof(__pyx_k_Container), 0, 0, 1, 1}, {&__pyx_n_s_Container___reduce_cython, __pyx_k_Container___reduce_cython, sizeof(__pyx_k_Container___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Container___setstate_cython, __pyx_k_Container___setstate_cython, sizeof(__pyx_k_Container___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Container_add, __pyx_k_Container_add, sizeof(__pyx_k_Container_add), 0, 0, 1, 1}, {&__pyx_n_s_Container_render, __pyx_k_Container_render, sizeof(__pyx_k_Container_render), 0, 0, 1, 1}, {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_argument_s, __pyx_k_Invalid_argument_s, sizeof(__pyx_k_Invalid_argument_s), 0, 0, 1, 0}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_kp_s_Pickling_of_struct_members_such, __pyx_k_Pickling_of_struct_members_such, sizeof(__pyx_k_Pickling_of_struct_members_such), 0, 0, 1, 0}, {&__pyx_kp_s_Pickling_of_struct_members_such_2, __pyx_k_Pickling_of_struct_members_such_2, sizeof(__pyx_k_Pickling_of_struct_members_such_2), 0, 0, 1, 0}, {&__pyx_kp_s_Pickling_of_struct_members_such_3, __pyx_k_Pickling_of_struct_members_such_3, sizeof(__pyx_k_Pickling_of_struct_members_such_3), 0, 0, 1, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_Renderer, __pyx_k_Renderer, sizeof(__pyx_k_Renderer), 0, 0, 1, 1}, {&__pyx_n_s_Renderer___reduce_cython, __pyx_k_Renderer___reduce_cython, sizeof(__pyx_k_Renderer___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Renderer___setstate_cython, __pyx_k_Renderer___setstate_cython, sizeof(__pyx_k_Renderer___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_clear, __pyx_k_Renderer_clear, sizeof(__pyx_k_Renderer_clear), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_create_texture, __pyx_k_Renderer_create_texture, sizeof(__pyx_k_Renderer_create_texture), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_draw_line, __pyx_k_Renderer_draw_line, sizeof(__pyx_k_Renderer_draw_line), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_draw_point, __pyx_k_Renderer_draw_point, sizeof(__pyx_k_Renderer_draw_point), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_draw_rect, __pyx_k_Renderer_draw_rect, sizeof(__pyx_k_Renderer_draw_rect), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_fill_rect, __pyx_k_Renderer_fill_rect, sizeof(__pyx_k_Renderer_fill_rect), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_info, __pyx_k_Renderer_info, sizeof(__pyx_k_Renderer_info), 0, 0, 1, 1}, {&__pyx_kp_s_Renderer_is_not_accelerated, __pyx_k_Renderer_is_not_accelerated, sizeof(__pyx_k_Renderer_is_not_accelerated), 0, 0, 1, 0}, {&__pyx_n_s_Renderer_load_atlas, __pyx_k_Renderer_load_atlas, sizeof(__pyx_k_Renderer_load_atlas), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_load_texture, __pyx_k_Renderer_load_texture, sizeof(__pyx_k_Renderer_load_texture), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_render_present, __pyx_k_Renderer_render_present, sizeof(__pyx_k_Renderer_render_present), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_set_viewport, __pyx_k_Renderer_set_viewport, sizeof(__pyx_k_Renderer_set_viewport), 0, 0, 1, 1}, {&__pyx_kp_s_Rotation_not_supported_yet, __pyx_k_Rotation_not_supported_yet, sizeof(__pyx_k_Rotation_not_supported_yet), 0, 0, 1, 0}, {&__pyx_n_s_Sprite, __pyx_k_Sprite, sizeof(__pyx_k_Sprite), 0, 0, 1, 1}, {&__pyx_n_s_Sprite___reduce_cython, __pyx_k_Sprite___reduce_cython, sizeof(__pyx_k_Sprite___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Sprite___setstate_cython, __pyx_k_Sprite___setstate_cython, sizeof(__pyx_k_Sprite___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Sprite_collides, __pyx_k_Sprite_collides, sizeof(__pyx_k_Sprite_collides), 0, 0, 1, 1}, {&__pyx_n_s_Sprite_render, __pyx_k_Sprite_render, sizeof(__pyx_k_Sprite_render), 0, 0, 1, 1}, {&__pyx_n_s_Texture, __pyx_k_Texture, sizeof(__pyx_k_Texture), 0, 0, 1, 1}, {&__pyx_n_s_TextureAtlas, __pyx_k_TextureAtlas, sizeof(__pyx_k_TextureAtlas), 0, 0, 1, 1}, {&__pyx_n_s_TextureAtlas___reduce_cython, __pyx_k_TextureAtlas___reduce_cython, sizeof(__pyx_k_TextureAtlas___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_TextureAtlas___setstate_cython, __pyx_k_TextureAtlas___setstate_cython, sizeof(__pyx_k_TextureAtlas___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_TextureAtlas_keys, __pyx_k_TextureAtlas_keys, sizeof(__pyx_k_TextureAtlas_keys), 0, 0, 1, 1}, {&__pyx_n_s_TextureNode, __pyx_k_TextureNode, sizeof(__pyx_k_TextureNode), 0, 0, 1, 1}, {&__pyx_n_s_TextureNode___reduce_cython, __pyx_k_TextureNode___reduce_cython, sizeof(__pyx_k_TextureNode___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_TextureNode___setstate_cython, __pyx_k_TextureNode___setstate_cython, sizeof(__pyx_k_TextureNode___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_TextureNode_render, __pyx_k_TextureNode_render, sizeof(__pyx_k_TextureNode_render), 0, 0, 1, 1}, {&__pyx_n_s_Texture___reduce_cython, __pyx_k_Texture___reduce_cython, sizeof(__pyx_k_Texture___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Texture___setstate_cython, __pyx_k_Texture___setstate_cython, sizeof(__pyx_k_Texture___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1}, {&__pyx_n_s__54, __pyx_k__54, sizeof(__pyx_k__54), 0, 0, 1, 1}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_accelerated, __pyx_k_accelerated, sizeof(__pyx_k_accelerated), 0, 0, 1, 1}, {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_collides, __pyx_k_collides, sizeof(__pyx_k_collides), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_create_texture, __pyx_k_create_texture, sizeof(__pyx_k_create_texture), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_dest_rect, __pyx_k_dest_rect, sizeof(__pyx_k_dest_rect), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_draw_line, __pyx_k_draw_line, sizeof(__pyx_k_draw_line), 0, 0, 1, 1}, {&__pyx_n_s_draw_point, __pyx_k_draw_point, sizeof(__pyx_k_draw_point), 0, 0, 1, 1}, {&__pyx_n_s_draw_rect, __pyx_k_draw_rect, sizeof(__pyx_k_draw_rect), 0, 0, 1, 1}, {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, {&__pyx_n_s_fill_rect, __pyx_k_fill_rect, sizeof(__pyx_k_fill_rect), 0, 0, 1, 1}, {&__pyx_n_s_frame, __pyx_k_frame, sizeof(__pyx_k_frame), 0, 0, 1, 1}, {&__pyx_n_s_frames, __pyx_k_frames, sizeof(__pyx_k_frames), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_drivers, __pyx_k_get_drivers, sizeof(__pyx_k_get_drivers), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_image, __pyx_k_image, sizeof(__pyx_k_image), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1}, {&__pyx_n_s_load_atlas, __pyx_k_load_atlas, sizeof(__pyx_k_load_atlas), 0, 0, 1, 1}, {&__pyx_n_s_load_texture, __pyx_k_load_texture, sizeof(__pyx_k_load_texture), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_max_texture_height, __pyx_k_max_texture_height, sizeof(__pyx_k_max_texture_height), 0, 0, 1, 1}, {&__pyx_n_s_max_texture_width, __pyx_k_max_texture_width, sizeof(__pyx_k_max_texture_width), 0, 0, 1, 1}, {&__pyx_n_s_meta, __pyx_k_meta, sizeof(__pyx_k_meta), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1}, {&__pyx_n_s_num_drivers, __pyx_k_num_drivers, sizeof(__pyx_k_num_drivers), 0, 0, 1, 1}, {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_pivot, __pyx_k_pivot, sizeof(__pyx_k_pivot), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_render, __pyx_k_pygame_sdl2_render, sizeof(__pyx_k_pygame_sdl2_render), 0, 0, 1, 1}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_TextureAtlas, __pyx_k_pyx_unpickle_TextureAtlas, sizeof(__pyx_k_pyx_unpickle_TextureAtlas), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_r1, __pyx_k_r1, sizeof(__pyx_k_r1), 0, 0, 1, 1}, {&__pyx_n_s_r2, __pyx_k_r2, sizeof(__pyx_k_r2), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_real_dest, __pyx_k_real_dest, sizeof(__pyx_k_real_dest), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_ren, __pyx_k_ren, sizeof(__pyx_k_ren), 0, 0, 1, 1}, {&__pyx_n_s_render, __pyx_k_render, sizeof(__pyx_k_render), 0, 0, 1, 1}, {&__pyx_n_s_render_present, __pyx_k_render_present, sizeof(__pyx_k_render_present), 0, 0, 1, 1}, {&__pyx_n_s_rinfo, __pyx_k_rinfo, sizeof(__pyx_k_rinfo), 0, 0, 1, 1}, {&__pyx_n_s_rotated, __pyx_k_rotated, sizeof(__pyx_k_rotated), 0, 0, 1, 1}, {&__pyx_n_s_rtt, __pyx_k_rtt, sizeof(__pyx_k_rtt), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_viewport, __pyx_k_set_viewport, sizeof(__pyx_k_set_viewport), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_software, __pyx_k_software, sizeof(__pyx_k_software), 0, 0, 1, 1}, {&__pyx_n_s_sourceSize, __pyx_k_sourceSize, sizeof(__pyx_k_sourceSize), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_sprite, __pyx_k_sprite, sizeof(__pyx_k_sprite), 0, 0, 1, 1}, {&__pyx_n_s_spriteSourceSize, __pyx_k_spriteSourceSize, sizeof(__pyx_k_spriteSourceSize), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_k_src_pygame_sdl2_render_pyx, sizeof(__pyx_k_src_pygame_sdl2_render_pyx), 0, 0, 1, 0}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_tex, __pyx_k_tex, sizeof(__pyx_k_tex), 0, 0, 1, 1}, {&__pyx_n_s_tn, __pyx_k_tn, sizeof(__pyx_k_tn), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, {&__pyx_n_s_vprect, __pyx_k_vprect, sizeof(__pyx_k_vprect), 0, 0, 1, 1}, {&__pyx_n_s_vsync, __pyx_k_vsync, sizeof(__pyx_k_vsync), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 58, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 227, __pyx_L1_error) __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 249, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x594cfd2, 0xe7d6794, 0xdcdc1ac): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum */ __pyx_tuple_ = PyTuple_Pack(3, __pyx_int_93638610, __pyx_int_243099540, __pyx_int_231588268); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ __pyx_tuple__4 = PyTuple_Pack(4, __pyx_n_s_rinfo, __pyx_n_s_num_drivers, __pyx_n_s_rv, __pyx_n_s_n); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_get_drivers, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 52, __pyx_L1_error) /* "pygame_sdl2/render.pyx":101 * warnings.warn("Renderer is not accelerated.") * * def load_texture(self, fi): # <<<<<<<<<<<<<< * cdef SDL_Texture *tex * cdef Texture t = Texture() */ __pyx_tuple__6 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_fi, __pyx_n_s_tex, __pyx_n_s_t); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_load_texture, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 101, __pyx_L1_error) /* "pygame_sdl2/render.pyx":116 * return TextureNode(t) * * def load_atlas(self, filename): # <<<<<<<<<<<<<< * """ Loads a file in the popular JSON (Hash) format exported by * TexturePacker and other software. """ */ __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_load_atlas, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 116, __pyx_L1_error) /* "pygame_sdl2/render.pyx":122 * return TextureAtlas(self, filename) * * def render_present(self): # <<<<<<<<<<<<<< * with nogil: * SDL_RenderPresent(self.renderer) */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_render_present, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 122, __pyx_L1_error) /* "pygame_sdl2/render.pyx":126 * SDL_RenderPresent(self.renderer) * * def info(self): # <<<<<<<<<<<<<< * return self._info * */ __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_info, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 126, __pyx_L1_error) /* "pygame_sdl2/render.pyx":134 * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * * def clear(self, color): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) */ __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_color); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_clear, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 134, __pyx_L1_error) /* "pygame_sdl2/render.pyx":138 * SDL_RenderClear(self.renderer) * * def draw_line(self, color not None, x1, y1, x2, y2): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: */ __pyx_tuple__15 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_draw_line, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 138, __pyx_L1_error) /* "pygame_sdl2/render.pyx":143 * raise error() * * def draw_point(self, color not None, x, y): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) */ __pyx_tuple__17 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_draw_point, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 143, __pyx_L1_error) /* "pygame_sdl2/render.pyx":147 * SDL_RenderDrawPoint(self.renderer, x, y) * * def draw_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ __pyx_tuple__19 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_r); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_draw_rect, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 147, __pyx_L1_error) /* "pygame_sdl2/render.pyx":153 * SDL_RenderDrawRect(self.renderer, &r) * * def fill_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_fill_rect, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 153, __pyx_L1_error) /* "pygame_sdl2/render.pyx":159 * SDL_RenderFillRect(self.renderer, &r) * * def set_viewport(self, rect=None): # <<<<<<<<<<<<<< * cdef SDL_Rect vprect * if rect is None: */ __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_rect, __pyx_n_s_vprect); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_set_viewport, 159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 159, __pyx_L1_error) __pyx_tuple__24 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "pygame_sdl2/render.pyx":167 * SDL_RenderSetViewport(self.renderer, &vprect) * * def create_texture(self, size): # <<<<<<<<<<<<<< * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() */ __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_size); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_create_texture, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 167, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(1, 3, __pyx_L1_error) /* "pygame_sdl2/render.pyx":229 * raise ValueError() * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * */ __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dest, __pyx_n_s_dest_rect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_render, 229, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 229, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" */ __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(1, 3, __pyx_L1_error) /* "pygame_sdl2/render.pyx":274 * return self.frames[key] * * def keys(self): # <<<<<<<<<<<<<< * return self.frames.keys() * */ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_keys, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 274, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_tuple__37 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state) */ __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 16, __pyx_L1_error) /* "pygame_sdl2/render.pyx":321 * rout.h = (self._scaley * rin.h) * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef Texture tex = (self.nodes[0]).texture * cdef SDL_Rect dest_rect */ __pyx_tuple__40 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_dest, __pyx_n_s_tex, __pyx_n_s_dest_rect, __pyx_n_s_real_dest, __pyx_n_s_pivot, __pyx_n_s_tn, __pyx_n_s_x); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_render, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 321, __pyx_L1_error) /* "pygame_sdl2/render.pyx":356 * self._flip) * * def collides(self, Sprite other not None): # <<<<<<<<<<<<<< * cdef SDL_Rect r1, r2 * */ __pyx_tuple__42 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_r1, __pyx_n_s_r2); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_collides, 356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 356, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" */ __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(1, 3, __pyx_L1_error) /* "pygame_sdl2/render.pyx":447 * self._rect.w = self._rect.h = 0 * * def add(self, Sprite sprite not None): # <<<<<<<<<<<<<< * self.sprites.append(sprite) * */ __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_sprite); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_add, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 447, __pyx_L1_error) /* "pygame_sdl2/render.pyx":450 * self.sprites.append(sprite) * * def render(self, dest=None): # <<<<<<<<<<<<<< * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer */ __pyx_tuple__48 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_dest, __pyx_n_s_ren, __pyx_n_s_s); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_render, 450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 450, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" */ __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_TextureAtlas, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_93638610 = PyInt_FromLong(93638610L); if (unlikely(!__pyx_int_93638610)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_231588268 = PyInt_FromLong(231588268L); if (unlikely(!__pyx_int_231588268)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_243099540 = PyInt_FromLong(243099540L); if (unlikely(!__pyx_int_243099540)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_6render_Renderer = &__pyx_vtable_11pygame_sdl2_6render_Renderer; __pyx_vtable_11pygame_sdl2_6render_Renderer.set_drawcolor = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_6render_Renderer *, PyObject *))__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_6render_Renderer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_6render_Renderer_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_6render_Renderer)) __PYX_ERR(0, 67, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_6render_Renderer_spec, __pyx_ptype_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_6render_Renderer = &__pyx_type_11pygame_sdl2_6render_Renderer; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_6render_Renderer->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_6render_Renderer->tp_dictoffset && __pyx_ptype_11pygame_sdl2_6render_Renderer->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_6render_Renderer->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_vtabptr_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Renderer, (PyObject *) __pyx_ptype_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error) #endif __pyx_vtabptr_11pygame_sdl2_6render_Texture = &__pyx_vtable_11pygame_sdl2_6render_Texture; __pyx_vtable_11pygame_sdl2_6render_Texture.set = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_6render_Texture *, SDL_Renderer *, SDL_Texture *))__pyx_f_11pygame_sdl2_6render_7Texture_set; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_6render_Texture = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_6render_Texture_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_6render_Texture)) __PYX_ERR(0, 172, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_6render_Texture_spec, __pyx_ptype_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_6render_Texture = &__pyx_type_11pygame_sdl2_6render_Texture; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_6render_Texture->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_6render_Texture->tp_dictoffset && __pyx_ptype_11pygame_sdl2_6render_Texture->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_6render_Texture->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_11pygame_sdl2_6render_Texture, __pyx_vtabptr_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Texture, (PyObject *) __pyx_ptype_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_6render_TextureNode = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_6render_TextureNode_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_6render_TextureNode)) __PYX_ERR(0, 200, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_6render_TextureNode_spec, __pyx_ptype_11pygame_sdl2_6render_TextureNode) < 0) __PYX_ERR(0, 200, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_6render_TextureNode = &__pyx_type_11pygame_sdl2_6render_TextureNode; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_6render_TextureNode) < 0) __PYX_ERR(0, 200, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_6render_TextureNode->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_6render_TextureNode->tp_dictoffset && __pyx_ptype_11pygame_sdl2_6render_TextureNode->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_6render_TextureNode->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TextureNode, (PyObject *) __pyx_ptype_11pygame_sdl2_6render_TextureNode) < 0) __PYX_ERR(0, 200, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_6render_TextureNode) < 0) __PYX_ERR(0, 200, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_6render_TextureAtlas = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_6render_TextureAtlas_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_6render_TextureAtlas)) __PYX_ERR(0, 245, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_6render_TextureAtlas_spec, __pyx_ptype_11pygame_sdl2_6render_TextureAtlas) < 0) __PYX_ERR(0, 245, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_6render_TextureAtlas = &__pyx_type_11pygame_sdl2_6render_TextureAtlas; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_6render_TextureAtlas) < 0) __PYX_ERR(0, 245, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_6render_TextureAtlas->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_6render_TextureAtlas->tp_dictoffset && __pyx_ptype_11pygame_sdl2_6render_TextureAtlas->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_6render_TextureAtlas->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TextureAtlas, (PyObject *) __pyx_ptype_11pygame_sdl2_6render_TextureAtlas) < 0) __PYX_ERR(0, 245, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_6render_TextureAtlas) < 0) __PYX_ERR(0, 245, __pyx_L1_error) #endif __pyx_vtabptr_11pygame_sdl2_6render_Sprite = &__pyx_vtable_11pygame_sdl2_6render_Sprite; __pyx_vtable_11pygame_sdl2_6render_Sprite.adjust_rect = (void (*)(struct __pyx_obj_11pygame_sdl2_6render_Sprite *, SDL_Rect const *, SDL_Rect const *, SDL_Rect *))__pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_6render_Sprite = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_6render_Sprite_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_6render_Sprite)) __PYX_ERR(0, 278, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_6render_Sprite_spec, __pyx_ptype_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_6render_Sprite = &__pyx_type_11pygame_sdl2_6render_Sprite; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_6render_Sprite->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_6render_Sprite->tp_dictoffset && __pyx_ptype_11pygame_sdl2_6render_Sprite->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_6render_Sprite->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_11pygame_sdl2_6render_Sprite, __pyx_vtabptr_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Sprite, (PyObject *) __pyx_ptype_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_6render_Container = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_6render_Container_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_6render_Container)) __PYX_ERR(0, 433, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_6render_Container_spec, __pyx_ptype_11pygame_sdl2_6render_Container) < 0) __PYX_ERR(0, 433, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_6render_Container = &__pyx_type_11pygame_sdl2_6render_Container; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_6render_Container) < 0) __PYX_ERR(0, 433, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_6render_Container->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_6render_Container->tp_dictoffset && __pyx_ptype_11pygame_sdl2_6render_Container->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_6render_Container->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Container, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 433, __pyx_L1_error) if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__.doc = __pyx_doc_11pygame_sdl2_6render_9Container___init__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__; } } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Container, (PyObject *) __pyx_ptype_11pygame_sdl2_6render_Container) < 0) __PYX_ERR(0, 433, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_6render_Container) < 0) __PYX_ERR(0, 433, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7display_Window),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7display_Window) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_4rect_Rect),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_4rect_Rect) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportVoidPtr_3_0_8(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_8(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_8(__pyx_t_1, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_render(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_render}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "render", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initrender(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initrender(void) #else __Pyx_PyMODINIT_FUNC PyInit_render(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_render(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_render(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'render' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("render", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "render" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_render(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__render) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.render")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.render", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_variable_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/render.pyx":27 * from pygame_sdl2.rect cimport to_sdl_rect * * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * from pygame_sdl2.color import Color */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Rect)) __PYX_ERR(0, 27, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":28 * * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.color import Color * import json */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error)) __PYX_ERR(0, 28, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":29 * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error * from pygame_sdl2.color import Color # <<<<<<<<<<<<<< * import json * import warnings */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Color); __Pyx_GIVEREF(__pyx_n_s_Color); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Color)) __PYX_ERR(0, 29, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_color, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Color, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":30 * from pygame_sdl2.error import error * from pygame_sdl2.color import Color * import json # <<<<<<<<<<<<<< * import warnings * */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_json, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":31 * from pygame_sdl2.color import Color * import json * import warnings # <<<<<<<<<<<<<< * * BLENDMODE_NONE = SDL_BLENDMODE_NONE */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":33 * import warnings * * BLENDMODE_NONE = SDL_BLENDMODE_NONE # <<<<<<<<<<<<<< * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND * BLENDMODE_ADD = SDL_BLENDMODE_ADD */ __pyx_t_3 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_NONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_NONE, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":34 * * BLENDMODE_NONE = SDL_BLENDMODE_NONE * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND # <<<<<<<<<<<<<< * BLENDMODE_ADD = SDL_BLENDMODE_ADD * BLENDMODE_MOD = SDL_BLENDMODE_MOD */ __pyx_t_3 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_BLEND); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_BLEND, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":35 * BLENDMODE_NONE = SDL_BLENDMODE_NONE * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND * BLENDMODE_ADD = SDL_BLENDMODE_ADD # <<<<<<<<<<<<<< * BLENDMODE_MOD = SDL_BLENDMODE_MOD * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_ADD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_ADD, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":36 * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND * BLENDMODE_ADD = SDL_BLENDMODE_ADD * BLENDMODE_MOD = SDL_BLENDMODE_MOD # <<<<<<<<<<<<<< * * cdef bint DEBUG_DRAW_BBOX = True */ __pyx_t_3 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_MOD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_MOD, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":38 * BLENDMODE_MOD = SDL_BLENDMODE_MOD * * cdef bint DEBUG_DRAW_BBOX = True # <<<<<<<<<<<<<< * * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): */ __pyx_v_11pygame_sdl2_6render_DEBUG_DRAW_BBOX = 1; /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_1get_drivers, 0, __pyx_n_s_get_drivers, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drivers, __pyx_t_3) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":101 * warnings.warn("Renderer is not accelerated.") * * def load_texture(self, fi): # <<<<<<<<<<<<<< * cdef SDL_Texture *tex * cdef Texture t = Texture() */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_7load_texture, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_load_texture, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_load_texture, __pyx_t_3) < 0) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":116 * return TextureNode(t) * * def load_atlas(self, filename): # <<<<<<<<<<<<<< * """ Loads a file in the popular JSON (Hash) format exported by * TexturePacker and other software. """ */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_9load_atlas, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_load_atlas, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_load_atlas, __pyx_t_3) < 0) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":122 * return TextureAtlas(self, filename) * * def render_present(self): # <<<<<<<<<<<<<< * with nogil: * SDL_RenderPresent(self.renderer) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_11render_present, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_render_present, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_render_present, __pyx_t_3) < 0) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":126 * SDL_RenderPresent(self.renderer) * * def info(self): # <<<<<<<<<<<<<< * return self._info * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_13info, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_info, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_info, __pyx_t_3) < 0) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":134 * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * * def clear(self, color): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_15clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_clear, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_clear, __pyx_t_3) < 0) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":138 * SDL_RenderClear(self.renderer) * * def draw_line(self, color not None, x1, y1, x2, y2): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_17draw_line, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_line, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_draw_line, __pyx_t_3) < 0) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":143 * raise error() * * def draw_point(self, color not None, x, y): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_19draw_point, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_point, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_draw_point, __pyx_t_3) < 0) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":147 * SDL_RenderDrawPoint(self.renderer, x, y) * * def draw_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_21draw_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_rect, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_draw_rect, __pyx_t_3) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":153 * SDL_RenderDrawRect(self.renderer, &r) * * def fill_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_23fill_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_fill_rect, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_fill_rect, __pyx_t_3) < 0) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":159 * SDL_RenderFillRect(self.renderer, &r) * * def set_viewport(self, rect=None): # <<<<<<<<<<<<<< * cdef SDL_Rect vprect * if rect is None: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_25set_viewport, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_set_viewport, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_set_viewport, __pyx_t_3) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":167 * SDL_RenderSetViewport(self.renderer, &vprect) * * def create_texture(self, size): # <<<<<<<<<<<<<< * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_27create_texture, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_create_texture, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_create_texture, __pyx_t_3) < 0) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_29__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_31__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_7Texture_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Texture___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_7Texture_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Texture___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":229 * raise ValueError() * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_11TextureNode_3render, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TextureNode_render, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode, __pyx_n_s_render, __pyx_t_3) < 0) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_TextureNode); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TextureNode___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TextureNode___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":274 * return self.frames[key] * * def keys(self): # <<<<<<<<<<<<<< * return self.frames.keys() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_12TextureAtlas_5keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TextureAtlas_keys, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureAtlas, __pyx_n_s_keys, __pyx_t_3) < 0) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_TextureAtlas); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TextureAtlas___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureAtlas, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_TextureAtlas); /* "(tree fragment)":16 * else: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TextureAtlas___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureAtlas, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_TextureAtlas); /* "pygame_sdl2/render.pyx":321 * rout.h = (self._scaley * rin.h) * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef Texture tex = (self.nodes[0]).texture * cdef SDL_Rect dest_rect */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_6Sprite_3render, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sprite_render, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Sprite, __pyx_n_s_render, __pyx_t_3) < 0) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Sprite); /* "pygame_sdl2/render.pyx":356 * self._flip) * * def collides(self, Sprite other not None): # <<<<<<<<<<<<<< * cdef SDL_Rect r1, r2 * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_6Sprite_5collides, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sprite_collides, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Sprite, __pyx_n_s_collides, __pyx_t_3) < 0) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Sprite); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_6Sprite_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sprite___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_6Sprite_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sprite___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":447 * self._rect.w = self._rect.h = 0 * * def add(self, Sprite sprite not None): # <<<<<<<<<<<<<< * self.sprites.append(sprite) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_9Container_3add, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Container_add, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Container, __pyx_n_s_add, __pyx_t_3) < 0) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Container); /* "pygame_sdl2/render.pyx":450 * self.sprites.append(sprite) * * def render(self, dest=None): # <<<<<<<<<<<<<< * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_9Container_5render, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Container_render, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Container, __pyx_n_s_render, __pyx_t_3) < 0) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Container); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_9Container_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Container___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_9Container_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Container___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":1 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas, 0, __pyx_n_s_pyx_unpickle_TextureAtlas, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_TextureAtlas, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.render", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.render"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } *pvalue1 = value1; *pvalue2 = value2; return 0; #if CYTHON_COMPILING_IN_PYPY bad: Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; #endif } static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = __Pyx_PyObject_GetIterNextFunc(iter); value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { #if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; #elif PY_MAJOR_VERSION >= 3 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { const char *name = PyUnicode_AsUTF8(method_name); if (strcmp(name, "iteritems") == 0) pp = &py_items; else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; else if (strcmp(name, "itervalues") == 0) pp = &py_values; if (pp) { if (!*pp) { *pp = PyUnicode_FromString(name + 4); if (!*pp) return NULL; } method_name = *pp; } } #endif } *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* GetAttr3 */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } #endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { r = __Pyx_NewRef(d); } return r; } #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); #endif } /* ErrOccurredWithGIL */ static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void) { int err; #ifdef WITH_THREAD PyGILState_STATE _save = PyGILState_Ensure(); #endif err = !!PyErr_Occurred(); #ifdef WITH_THREAD PyGILState_Release(_save); #endif return err; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* HasAttr */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (!r) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } #endif /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetVTable */ static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { PyObject *ob = PyCapsule_New(vtable, 0, 0); if (unlikely(!ob)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* MergeVTables */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type) { int i; void** base_vtables; __Pyx_TypeName tp_base_name; __Pyx_TypeName base_name; void* unknown = (void*)-1; PyObject* bases = type->tp_bases; int base_depth = 0; { PyTypeObject* base = type->tp_base; while (base) { base_depth += 1; base = base->tp_base; } } base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); if (base_vtable != NULL) { int j; PyTypeObject* base = type->tp_base; for (j = 0; j < base_depth; j++) { if (base_vtables[j] == unknown) { base_vtables[j] = __Pyx_GetVtable(base); base_vtables[j + 1] = unknown; } if (base_vtables[j] == base_vtable) { break; } else if (base_vtables[j] == NULL) { goto bad; } base = base->tp_base; } } } PyErr_Clear(); free(base_vtables); return 0; bad: tp_base_name = __Pyx_PyType_GetName(type->tp_base); base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); free(base_vtables); return -1; } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_8 #define __PYX_HAVE_RT_ImportType_3_0_8 static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__3; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_BlendMode(SDL_BlendMode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_BlendMode neg_one = (SDL_BlendMode) -1, const_zero = (SDL_BlendMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_BlendMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_BlendMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_BlendMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_BlendMode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_BlendMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(SDL_BlendMode), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_BlendMode)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint8_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT)) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT)) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT)) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint8_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } } #endif if ((sizeof(uint8_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint8_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint8_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint8_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint8_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint8_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint8_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint8_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint8_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint8_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint8_t) 1) << (sizeof(uint8_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint8_t) -1; } } else { uint8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__54); } return name; } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* VoidPtrImport */ #ifndef __PYX_HAVE_RT_ImportVoidPtr_3_0_8 #define __PYX_HAVE_RT_ImportVoidPtr_3_0_8 static int __Pyx_ImportVoidPtr_3_0_8(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_8 #define __PYX_HAVE_RT_ImportFunction_3_0_8 static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709470.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.rwobject.c0000664000175000017500000300767314760217136020654 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__rwobject #define __PYX_HAVE_API__pygame_sdl2__rwobject /* Early includes */ #include #include #include #include #include "SDL.h" #include #include "python_threads.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/rwobject.pyx", "", "type.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; struct __pyx_t_11pygame_sdl2_8rwobject_SubFile; struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile; struct __pyx_t_11pygame_sdl2_8rwobject_BufFile; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; /* "pygame_sdl2/rwobject.pyx":132 * return 0 * * cdef struct SubFile: # <<<<<<<<<<<<<< * SDL_RWops *rw * Sint64 base */ struct __pyx_t_11pygame_sdl2_8rwobject_SubFile { SDL_RWops *rw; Sint64 base; Sint64 length; Sint64 tell; }; /* "pygame_sdl2/rwobject.pyx":188 * * * cdef struct SplitFile: # <<<<<<<<<<<<<< * SDL_RWops *a * SDL_RWops *b */ struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile { SDL_RWops *a; SDL_RWops *b; Sint64 split; Sint64 tell; }; /* "pygame_sdl2/rwobject.pyx":271 * * * cdef struct BufFile: # <<<<<<<<<<<<<< * Py_buffer view * Uint8 *base */ struct __pyx_t_11pygame_sdl2_8rwobject_BufFile { Py_buffer view; Uint8 *base; Uint8 *here; Uint8 *stop; }; /* "pygame_sdl2/rwobject.pyx":491 * } * * cdef class RWopsIOImpl: # <<<<<<<<<<<<<< * """ * This wraps an SDL_RWops object in a Python file-like object. */ struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl { PyObject_HEAD SDL_RWops *ops; PyObject *name; PyObject *base; PyObject *length; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* PyObject_Str.proto */ #define __Pyx_PyObject_Str(obj)\ (likely(PyString_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* DivInt[ptrdiff_t].proto */ static CYTHON_INLINE ptrdiff_t __Pyx_div_ptrdiff_t(ptrdiff_t, ptrdiff_t); /* UnaryNegOverflows.proto */ #define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\ (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) #else static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); #endif /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 #define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_8 { __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value); /* CIntFromPy.proto */ static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.type" */ /* Module declarations from "cpython" */ /* Module declarations from "cpython.object" */ /* Module declarations from "cpython.ref" */ /* Module declarations from "cpython.buffer" */ /* Module declarations from "libc.stdlib" */ /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_to_rwops(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_8rwobject_set_error(PyObject *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_size(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_seek(SDL_RWops *, Sint64, int); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_read(SDL_RWops *, void *, size_t, size_t); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_write(SDL_RWops *, void const *, size_t, size_t); /*proto*/ static int __pyx_f_11pygame_sdl2_8rwobject_python_close(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_size(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_seek(SDL_RWops *, Sint64, int); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_subfile_read(SDL_RWops *, void *, size_t, size_t); /*proto*/ static int __pyx_f_11pygame_sdl2_8rwobject_subfile_close(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_splitfile_size(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_splitfile_seek(SDL_RWops *, Sint64, int); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_splitfile_read(SDL_RWops *, void *, size_t, size_t); /*proto*/ static int __pyx_f_11pygame_sdl2_8rwobject_splitfile_close(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_buffile_size(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_buffile_seek(SDL_RWops *, Sint64, int); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_buffile_read(SDL_RWops *, void *, size_t, size_t); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_buffile_write(SDL_RWops *, void const *, size_t, size_t); /*proto*/ static int __pyx_f_11pygame_sdl2_8rwobject_buffile_close(SDL_RWops *); /*proto*/ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython(PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.rwobject" extern int __pyx_module_is_main_pygame_sdl2__rwobject; int __pyx_module_is_main_pygame_sdl2__rwobject = 0; /* Implementation of "pygame_sdl2.rwobject" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_staticmethod; static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_IOError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_OSError; static PyObject *__pyx_builtin_MemoryError; /* #### Code section: string_decls ### */ static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k__7[] = "."; static const char __pyx_k__8[] = "*"; static const char __pyx_k_bf[] = "bf"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_io[] = "io"; static const char __pyx_k_rb[] = "rb"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k_rw[] = "rw"; static const char __pyx_k_sf[] = "sf"; static const char __pyx_k__39[] = "?"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_raw[] = "raw"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_read[] = "read"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_seek[] = "seek"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_tell[] = "tell"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_view[] = "view"; static const char __pyx_k_ascii[] = "ascii"; static const char __pyx_k_bytes[] = "bytes_"; static const char __pyx_k_close[] = "close"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_write[] = "write"; static const char __pyx_k_IOBase[] = "IOBase"; static const char __pyx_k_buffer[] = "buffer"; static const char __pyx_k_closed[] = "closed"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_fileno[] = "fileno"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_length[] = "length"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_offset[] = "offset"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_whence[] = "whence"; static const char __pyx_k_IOError[] = "IOError"; static const char __pyx_k_OSError[] = "OSError"; static const char __pyx_k_RWopsIO[] = "RWopsIO"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_unicode[] = "unicode_"; static const char __pyx_k_SEEK_CUR[] = "SEEK_CUR"; static const char __pyx_k_SEEK_END[] = "SEEK_END"; static const char __pyx_k_SEEK_SET[] = "SEEK_SET"; static const char __pyx_k_filelike[] = "filelike"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_property[] = "property"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_readable[] = "readable"; static const char __pyx_k_readinto[] = "readinto"; static const char __pyx_k_seekable[] = "seekable"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_truncate[] = "truncate"; static const char __pyx_k_writable[] = "writable"; static const char __pyx_k_RWopsIO_r[] = ""; static const char __pyx_k_RawIOBase[] = "RawIOBase"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_file_type[] = "file_type"; static const char __pyx_k_is_closed[] = "is_closed"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_whence_rw[] = "whence_rw"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_from_split[] = "from_split"; static const char __pyx_k_fsencoding[] = "fsencoding"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_RWopsIOImpl[] = "RWopsIOImpl"; static const char __pyx_k_from_buffer[] = "from_buffer"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_staticmethod[] = "staticmethod"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_AttributeError[] = "AttributeError"; static const char __pyx_k_Could_not_read[] = "Could not read: {}"; static const char __pyx_k_Could_not_seek[] = "Could not seek: {}"; static const char __pyx_k_RWopsIO___init[] = "RWopsIO.__init__"; static const char __pyx_k_RWopsIO___repr[] = "RWopsIO.__repr__"; static const char __pyx_k_RWopsIO_closed[] = "RWopsIO.closed"; static const char __pyx_k_RWopsIO_fileno[] = "RWopsIO.fileno"; static const char __pyx_k_whence_mapping[] = "whence_mapping"; static const char __pyx_k_Could_not_write[] = "Could not write: {}"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Could_not_open_r[] = "Could not open {!r}: {}"; static const char __pyx_k_RWopsIOImpl_seek[] = "RWopsIOImpl.seek"; static const char __pyx_k_RWopsIOImpl_tell[] = "RWopsIOImpl.tell"; static const char __pyx_k_RWopsIO_readable[] = "RWopsIO.readable"; static const char __pyx_k_RWopsIO_seekable[] = "RWopsIO.seekable"; static const char __pyx_k_RWopsIO_truncate[] = "RWopsIO.truncate"; static const char __pyx_k_RWopsIO_writable[] = "RWopsIO.writable"; static const char __pyx_k_RWopsIOImpl_close[] = "RWopsIOImpl.close"; static const char __pyx_k_RWopsIOImpl_write[] = "RWopsIOImpl.write"; static const char __pyx_k_I_O_on_closed_file[] = "I/O on closed file."; static const char __pyx_k_RWopsIO_from_split[] = "RWopsIO.from_split"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat"; static const char __pyx_k_RWopsIO_from_buffer[] = "RWopsIO.from_buffer"; static const char __pyx_k_Could_not_get_buffer[] = "Could not get buffer."; static const char __pyx_k_RWopsIOImpl_readinto[] = "RWopsIOImpl.readinto"; static const char __pyx_k_pygame_sdl2_rwobject[] = "pygame_sdl2.rwobject"; static const char __pyx_k_RWopsIOImpl_is_closed[] = "RWopsIOImpl.is_closed"; static const char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; static const char __pyx_k_Unknown_value_for_whence[] = "Unknown value for 'whence'"; static const char __pyx_k_RWopsIO_r_base_r_length_r[] = ""; static const char __pyx_k_RWopsIOImpl___reduce_cython[] = "RWopsIOImpl.__reduce_cython__"; static const char __pyx_k_I_O_operation_on_closed_file[] = "I/O operation on closed file."; static const char __pyx_k_src_pygame_sdl2_rwobject_pyx[] = "src/pygame_sdl2/rwobject.pyx"; static const char __pyx_k_RWopsIOImpl___setstate_cython[] = "RWopsIOImpl.__setstate_cython__"; static const char __pyx_k_r_is_not_a_filename_or_file_lik[] = "{!r} is not a filename or file-like object."; static const char __pyx_k_self_ops_cannot_be_converted_to[] = "self.ops cannot be converted to a Python object for pickling"; static const char __pyx_k_Passed_in_object_does_not_suppor[] = "Passed in object does not support buffer protocol"; /* #### Code section: decls ### */ static void __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl___dealloc__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_filelike, PyObject *__pyx_v_mode, PyObject *__pyx_v_base, PyObject *__pyx_v_length, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4close(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6is_closed(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_8seek(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PY_LONG_LONG __pyx_v_offset, PyObject *__pyx_v_whence); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_10tell(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_12readinto(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_14write(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name___get__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_2__set__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_4__del__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base___get__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_2__set__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_4__del__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length___get__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_2__set__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_4__del__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filelike, PyObject *__pyx_v_mode, PyObject *__pyx_v_base, PyObject *__pyx_v_length, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_4closed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_6fileno(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_8readable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_10seekable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_12truncate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_14writable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_16from_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buffer, CYTHON_UNUSED PyObject *__pyx_v_mode, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_18from_split(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_8rwobject_RWopsIOImpl(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl; PyObject *__pyx_n_s_AttributeError; PyObject *__pyx_kp_s_Could_not_get_buffer; PyObject *__pyx_kp_s_Could_not_open_r; PyObject *__pyx_kp_s_Could_not_read; PyObject *__pyx_kp_s_Could_not_seek; PyObject *__pyx_kp_s_Could_not_write; PyObject *__pyx_n_s_IOBase; PyObject *__pyx_n_s_IOError; PyObject *__pyx_kp_s_I_O_on_closed_file; PyObject *__pyx_kp_s_I_O_operation_on_closed_file; PyObject *__pyx_n_s_MemoryError; PyObject *__pyx_n_s_OSError; PyObject *__pyx_kp_s_Passed_in_object_does_not_suppor; PyObject *__pyx_n_s_RWopsIO; PyObject *__pyx_n_s_RWopsIOImpl; PyObject *__pyx_n_s_RWopsIOImpl___reduce_cython; PyObject *__pyx_n_s_RWopsIOImpl___setstate_cython; PyObject *__pyx_n_s_RWopsIOImpl_close; PyObject *__pyx_n_s_RWopsIOImpl_is_closed; PyObject *__pyx_n_s_RWopsIOImpl_readinto; PyObject *__pyx_n_s_RWopsIOImpl_seek; PyObject *__pyx_n_s_RWopsIOImpl_tell; PyObject *__pyx_n_s_RWopsIOImpl_write; PyObject *__pyx_n_s_RWopsIO___init; PyObject *__pyx_n_s_RWopsIO___repr; PyObject *__pyx_n_s_RWopsIO_closed; PyObject *__pyx_n_s_RWopsIO_fileno; PyObject *__pyx_n_s_RWopsIO_from_buffer; PyObject *__pyx_n_s_RWopsIO_from_split; PyObject *__pyx_kp_s_RWopsIO_r; PyObject *__pyx_kp_s_RWopsIO_r_base_r_length_r; PyObject *__pyx_n_s_RWopsIO_readable; PyObject *__pyx_n_s_RWopsIO_seekable; PyObject *__pyx_n_s_RWopsIO_truncate; PyObject *__pyx_n_s_RWopsIO_writable; PyObject *__pyx_n_s_RawIOBase; PyObject *__pyx_n_s_SEEK_CUR; PyObject *__pyx_n_s_SEEK_END; PyObject *__pyx_n_s_SEEK_SET; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_kp_s_Unknown_value_for_whence; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s__39; PyObject *__pyx_kp_u__7; PyObject *__pyx_n_s__8; PyObject *__pyx_n_s_a; PyObject *__pyx_n_s_ascii; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_b; PyObject *__pyx_n_s_base; PyObject *__pyx_n_s_bf; PyObject *__pyx_n_s_buffer; PyObject *__pyx_n_s_bytes; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_close; PyObject *__pyx_n_s_closed; PyObject *__pyx_n_s_decode; PyObject *__pyx_n_s_dict; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_doc; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_file_type; PyObject *__pyx_n_s_filelike; PyObject *__pyx_n_s_fileno; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_from_buffer; PyObject *__pyx_n_s_from_split; PyObject *__pyx_n_s_fsencoding; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_getfilesystemencoding; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_io; PyObject *__pyx_n_s_is_closed; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_length; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_mode; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_n_s_offset; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_property; PyObject *__pyx_n_s_pygame_sdl2_compat; PyObject *__pyx_n_s_pygame_sdl2_rwobject; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_qualname; PyObject *__pyx_kp_s_r_is_not_a_filename_or_file_lik; PyObject *__pyx_n_s_raw; PyObject *__pyx_n_b_rb; PyObject *__pyx_n_s_rb; PyObject *__pyx_n_s_read; PyObject *__pyx_n_s_readable; PyObject *__pyx_n_s_readinto; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_repr; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_rw; PyObject *__pyx_n_s_seek; PyObject *__pyx_n_s_seekable; PyObject *__pyx_n_s_self; PyObject *__pyx_kp_s_self_ops_cannot_be_converted_to; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_sf; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_rwobject_pyx; PyObject *__pyx_n_s_staticmethod; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_sys; PyObject *__pyx_n_s_tell; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_truncate; PyObject *__pyx_n_s_unicode; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_n_s_view; PyObject *__pyx_n_s_whence; PyObject *__pyx_n_s_whence_mapping; PyObject *__pyx_n_s_whence_rw; PyObject *__pyx_n_s_writable; PyObject *__pyx_n_s_write; PyObject *__pyx_int_0; PyObject *__pyx_int_2; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__34; PyObject *__pyx_tuple__36; PyObject *__pyx_tuple__37; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__24; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__38; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl); Py_CLEAR(clear_module_state->__pyx_n_s_AttributeError); Py_CLEAR(clear_module_state->__pyx_kp_s_Could_not_get_buffer); Py_CLEAR(clear_module_state->__pyx_kp_s_Could_not_open_r); Py_CLEAR(clear_module_state->__pyx_kp_s_Could_not_read); Py_CLEAR(clear_module_state->__pyx_kp_s_Could_not_seek); Py_CLEAR(clear_module_state->__pyx_kp_s_Could_not_write); Py_CLEAR(clear_module_state->__pyx_n_s_IOBase); Py_CLEAR(clear_module_state->__pyx_n_s_IOError); Py_CLEAR(clear_module_state->__pyx_kp_s_I_O_on_closed_file); Py_CLEAR(clear_module_state->__pyx_kp_s_I_O_operation_on_closed_file); Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); Py_CLEAR(clear_module_state->__pyx_n_s_OSError); Py_CLEAR(clear_module_state->__pyx_kp_s_Passed_in_object_does_not_suppor); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl_close); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl_is_closed); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl_readinto); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl_seek); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl_tell); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl_write); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO___init); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO___repr); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_closed); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_fileno); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_from_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_from_split); Py_CLEAR(clear_module_state->__pyx_kp_s_RWopsIO_r); Py_CLEAR(clear_module_state->__pyx_kp_s_RWopsIO_r_base_r_length_r); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_readable); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_seekable); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_truncate); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_writable); Py_CLEAR(clear_module_state->__pyx_n_s_RawIOBase); Py_CLEAR(clear_module_state->__pyx_n_s_SEEK_CUR); Py_CLEAR(clear_module_state->__pyx_n_s_SEEK_END); Py_CLEAR(clear_module_state->__pyx_n_s_SEEK_SET); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_kp_s_Unknown_value_for_whence); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_n_s__39); Py_CLEAR(clear_module_state->__pyx_kp_u__7); Py_CLEAR(clear_module_state->__pyx_n_s__8); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_s_ascii); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_b); Py_CLEAR(clear_module_state->__pyx_n_s_base); Py_CLEAR(clear_module_state->__pyx_n_s_bf); Py_CLEAR(clear_module_state->__pyx_n_s_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_bytes); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_close); Py_CLEAR(clear_module_state->__pyx_n_s_closed); Py_CLEAR(clear_module_state->__pyx_n_s_decode); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_file_type); Py_CLEAR(clear_module_state->__pyx_n_s_filelike); Py_CLEAR(clear_module_state->__pyx_n_s_fileno); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_from_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_from_split); Py_CLEAR(clear_module_state->__pyx_n_s_fsencoding); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_getfilesystemencoding); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_io); Py_CLEAR(clear_module_state->__pyx_n_s_is_closed); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_length); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_mode); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_n_s_offset); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_property); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_compat); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rwobject); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_kp_s_r_is_not_a_filename_or_file_lik); Py_CLEAR(clear_module_state->__pyx_n_s_raw); Py_CLEAR(clear_module_state->__pyx_n_b_rb); Py_CLEAR(clear_module_state->__pyx_n_s_rb); Py_CLEAR(clear_module_state->__pyx_n_s_read); Py_CLEAR(clear_module_state->__pyx_n_s_readable); Py_CLEAR(clear_module_state->__pyx_n_s_readinto); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_repr); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_rw); Py_CLEAR(clear_module_state->__pyx_n_s_seek); Py_CLEAR(clear_module_state->__pyx_n_s_seekable); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_kp_s_self_ops_cannot_be_converted_to); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_sf); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_rwobject_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_staticmethod); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_sys); Py_CLEAR(clear_module_state->__pyx_n_s_tell); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_truncate); Py_CLEAR(clear_module_state->__pyx_n_s_unicode); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_n_s_view); Py_CLEAR(clear_module_state->__pyx_n_s_whence); Py_CLEAR(clear_module_state->__pyx_n_s_whence_mapping); Py_CLEAR(clear_module_state->__pyx_n_s_whence_rw); Py_CLEAR(clear_module_state->__pyx_n_s_writable); Py_CLEAR(clear_module_state->__pyx_n_s_write); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__34); Py_CLEAR(clear_module_state->__pyx_tuple__36); Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__24); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__38); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl); Py_VISIT(traverse_module_state->__pyx_n_s_AttributeError); Py_VISIT(traverse_module_state->__pyx_kp_s_Could_not_get_buffer); Py_VISIT(traverse_module_state->__pyx_kp_s_Could_not_open_r); Py_VISIT(traverse_module_state->__pyx_kp_s_Could_not_read); Py_VISIT(traverse_module_state->__pyx_kp_s_Could_not_seek); Py_VISIT(traverse_module_state->__pyx_kp_s_Could_not_write); Py_VISIT(traverse_module_state->__pyx_n_s_IOBase); Py_VISIT(traverse_module_state->__pyx_n_s_IOError); Py_VISIT(traverse_module_state->__pyx_kp_s_I_O_on_closed_file); Py_VISIT(traverse_module_state->__pyx_kp_s_I_O_operation_on_closed_file); Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); Py_VISIT(traverse_module_state->__pyx_n_s_OSError); Py_VISIT(traverse_module_state->__pyx_kp_s_Passed_in_object_does_not_suppor); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl_close); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl_is_closed); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl_readinto); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl_seek); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl_tell); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl_write); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO___init); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO___repr); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_closed); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_fileno); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_from_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_from_split); Py_VISIT(traverse_module_state->__pyx_kp_s_RWopsIO_r); Py_VISIT(traverse_module_state->__pyx_kp_s_RWopsIO_r_base_r_length_r); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_readable); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_seekable); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_truncate); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_writable); Py_VISIT(traverse_module_state->__pyx_n_s_RawIOBase); Py_VISIT(traverse_module_state->__pyx_n_s_SEEK_CUR); Py_VISIT(traverse_module_state->__pyx_n_s_SEEK_END); Py_VISIT(traverse_module_state->__pyx_n_s_SEEK_SET); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_kp_s_Unknown_value_for_whence); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_n_s__39); Py_VISIT(traverse_module_state->__pyx_kp_u__7); Py_VISIT(traverse_module_state->__pyx_n_s__8); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_s_ascii); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_b); Py_VISIT(traverse_module_state->__pyx_n_s_base); Py_VISIT(traverse_module_state->__pyx_n_s_bf); Py_VISIT(traverse_module_state->__pyx_n_s_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_bytes); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_close); Py_VISIT(traverse_module_state->__pyx_n_s_closed); Py_VISIT(traverse_module_state->__pyx_n_s_decode); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_file_type); Py_VISIT(traverse_module_state->__pyx_n_s_filelike); Py_VISIT(traverse_module_state->__pyx_n_s_fileno); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_from_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_from_split); Py_VISIT(traverse_module_state->__pyx_n_s_fsencoding); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_getfilesystemencoding); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_io); Py_VISIT(traverse_module_state->__pyx_n_s_is_closed); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_length); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_mode); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_n_s_offset); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_property); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_compat); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rwobject); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_kp_s_r_is_not_a_filename_or_file_lik); Py_VISIT(traverse_module_state->__pyx_n_s_raw); Py_VISIT(traverse_module_state->__pyx_n_b_rb); Py_VISIT(traverse_module_state->__pyx_n_s_rb); Py_VISIT(traverse_module_state->__pyx_n_s_read); Py_VISIT(traverse_module_state->__pyx_n_s_readable); Py_VISIT(traverse_module_state->__pyx_n_s_readinto); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_repr); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_rw); Py_VISIT(traverse_module_state->__pyx_n_s_seek); Py_VISIT(traverse_module_state->__pyx_n_s_seekable); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_kp_s_self_ops_cannot_be_converted_to); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_sf); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_rwobject_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_staticmethod); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_sys); Py_VISIT(traverse_module_state->__pyx_n_s_tell); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_truncate); Py_VISIT(traverse_module_state->__pyx_n_s_unicode); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_n_s_view); Py_VISIT(traverse_module_state->__pyx_n_s_whence); Py_VISIT(traverse_module_state->__pyx_n_s_whence_mapping); Py_VISIT(traverse_module_state->__pyx_n_s_whence_rw); Py_VISIT(traverse_module_state->__pyx_n_s_writable); Py_VISIT(traverse_module_state->__pyx_n_s_write); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__34); Py_VISIT(traverse_module_state->__pyx_tuple__36); Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__24); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__38); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl __pyx_mstate_global->__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl #endif #define __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl #define __pyx_n_s_AttributeError __pyx_mstate_global->__pyx_n_s_AttributeError #define __pyx_kp_s_Could_not_get_buffer __pyx_mstate_global->__pyx_kp_s_Could_not_get_buffer #define __pyx_kp_s_Could_not_open_r __pyx_mstate_global->__pyx_kp_s_Could_not_open_r #define __pyx_kp_s_Could_not_read __pyx_mstate_global->__pyx_kp_s_Could_not_read #define __pyx_kp_s_Could_not_seek __pyx_mstate_global->__pyx_kp_s_Could_not_seek #define __pyx_kp_s_Could_not_write __pyx_mstate_global->__pyx_kp_s_Could_not_write #define __pyx_n_s_IOBase __pyx_mstate_global->__pyx_n_s_IOBase #define __pyx_n_s_IOError __pyx_mstate_global->__pyx_n_s_IOError #define __pyx_kp_s_I_O_on_closed_file __pyx_mstate_global->__pyx_kp_s_I_O_on_closed_file #define __pyx_kp_s_I_O_operation_on_closed_file __pyx_mstate_global->__pyx_kp_s_I_O_operation_on_closed_file #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError #define __pyx_n_s_OSError __pyx_mstate_global->__pyx_n_s_OSError #define __pyx_kp_s_Passed_in_object_does_not_suppor __pyx_mstate_global->__pyx_kp_s_Passed_in_object_does_not_suppor #define __pyx_n_s_RWopsIO __pyx_mstate_global->__pyx_n_s_RWopsIO #define __pyx_n_s_RWopsIOImpl __pyx_mstate_global->__pyx_n_s_RWopsIOImpl #define __pyx_n_s_RWopsIOImpl___reduce_cython __pyx_mstate_global->__pyx_n_s_RWopsIOImpl___reduce_cython #define __pyx_n_s_RWopsIOImpl___setstate_cython __pyx_mstate_global->__pyx_n_s_RWopsIOImpl___setstate_cython #define __pyx_n_s_RWopsIOImpl_close __pyx_mstate_global->__pyx_n_s_RWopsIOImpl_close #define __pyx_n_s_RWopsIOImpl_is_closed __pyx_mstate_global->__pyx_n_s_RWopsIOImpl_is_closed #define __pyx_n_s_RWopsIOImpl_readinto __pyx_mstate_global->__pyx_n_s_RWopsIOImpl_readinto #define __pyx_n_s_RWopsIOImpl_seek __pyx_mstate_global->__pyx_n_s_RWopsIOImpl_seek #define __pyx_n_s_RWopsIOImpl_tell __pyx_mstate_global->__pyx_n_s_RWopsIOImpl_tell #define __pyx_n_s_RWopsIOImpl_write __pyx_mstate_global->__pyx_n_s_RWopsIOImpl_write #define __pyx_n_s_RWopsIO___init __pyx_mstate_global->__pyx_n_s_RWopsIO___init #define __pyx_n_s_RWopsIO___repr __pyx_mstate_global->__pyx_n_s_RWopsIO___repr #define __pyx_n_s_RWopsIO_closed __pyx_mstate_global->__pyx_n_s_RWopsIO_closed #define __pyx_n_s_RWopsIO_fileno __pyx_mstate_global->__pyx_n_s_RWopsIO_fileno #define __pyx_n_s_RWopsIO_from_buffer __pyx_mstate_global->__pyx_n_s_RWopsIO_from_buffer #define __pyx_n_s_RWopsIO_from_split __pyx_mstate_global->__pyx_n_s_RWopsIO_from_split #define __pyx_kp_s_RWopsIO_r __pyx_mstate_global->__pyx_kp_s_RWopsIO_r #define __pyx_kp_s_RWopsIO_r_base_r_length_r __pyx_mstate_global->__pyx_kp_s_RWopsIO_r_base_r_length_r #define __pyx_n_s_RWopsIO_readable __pyx_mstate_global->__pyx_n_s_RWopsIO_readable #define __pyx_n_s_RWopsIO_seekable __pyx_mstate_global->__pyx_n_s_RWopsIO_seekable #define __pyx_n_s_RWopsIO_truncate __pyx_mstate_global->__pyx_n_s_RWopsIO_truncate #define __pyx_n_s_RWopsIO_writable __pyx_mstate_global->__pyx_n_s_RWopsIO_writable #define __pyx_n_s_RawIOBase __pyx_mstate_global->__pyx_n_s_RawIOBase #define __pyx_n_s_SEEK_CUR __pyx_mstate_global->__pyx_n_s_SEEK_CUR #define __pyx_n_s_SEEK_END __pyx_mstate_global->__pyx_n_s_SEEK_END #define __pyx_n_s_SEEK_SET __pyx_mstate_global->__pyx_n_s_SEEK_SET #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_kp_s_Unknown_value_for_whence __pyx_mstate_global->__pyx_kp_s_Unknown_value_for_whence #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_n_s__39 __pyx_mstate_global->__pyx_n_s__39 #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 #define __pyx_n_s__8 __pyx_mstate_global->__pyx_n_s__8 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_n_s_ascii __pyx_mstate_global->__pyx_n_s_ascii #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base #define __pyx_n_s_bf __pyx_mstate_global->__pyx_n_s_bf #define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer #define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close #define __pyx_n_s_closed __pyx_mstate_global->__pyx_n_s_closed #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_file_type __pyx_mstate_global->__pyx_n_s_file_type #define __pyx_n_s_filelike __pyx_mstate_global->__pyx_n_s_filelike #define __pyx_n_s_fileno __pyx_mstate_global->__pyx_n_s_fileno #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_from_buffer __pyx_mstate_global->__pyx_n_s_from_buffer #define __pyx_n_s_from_split __pyx_mstate_global->__pyx_n_s_from_split #define __pyx_n_s_fsencoding __pyx_mstate_global->__pyx_n_s_fsencoding #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_getfilesystemencoding __pyx_mstate_global->__pyx_n_s_getfilesystemencoding #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_io __pyx_mstate_global->__pyx_n_s_io #define __pyx_n_s_is_closed __pyx_mstate_global->__pyx_n_s_is_closed #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_length __pyx_mstate_global->__pyx_n_s_length #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_property __pyx_mstate_global->__pyx_n_s_property #define __pyx_n_s_pygame_sdl2_compat __pyx_mstate_global->__pyx_n_s_pygame_sdl2_compat #define __pyx_n_s_pygame_sdl2_rwobject __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rwobject #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_kp_s_r_is_not_a_filename_or_file_lik __pyx_mstate_global->__pyx_kp_s_r_is_not_a_filename_or_file_lik #define __pyx_n_s_raw __pyx_mstate_global->__pyx_n_s_raw #define __pyx_n_b_rb __pyx_mstate_global->__pyx_n_b_rb #define __pyx_n_s_rb __pyx_mstate_global->__pyx_n_s_rb #define __pyx_n_s_read __pyx_mstate_global->__pyx_n_s_read #define __pyx_n_s_readable __pyx_mstate_global->__pyx_n_s_readable #define __pyx_n_s_readinto __pyx_mstate_global->__pyx_n_s_readinto #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_rw __pyx_mstate_global->__pyx_n_s_rw #define __pyx_n_s_seek __pyx_mstate_global->__pyx_n_s_seek #define __pyx_n_s_seekable __pyx_mstate_global->__pyx_n_s_seekable #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_kp_s_self_ops_cannot_be_converted_to __pyx_mstate_global->__pyx_kp_s_self_ops_cannot_be_converted_to #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_sf __pyx_mstate_global->__pyx_n_s_sf #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_rwobject_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_rwobject_pyx #define __pyx_n_s_staticmethod __pyx_mstate_global->__pyx_n_s_staticmethod #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys #define __pyx_n_s_tell __pyx_mstate_global->__pyx_n_s_tell #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_truncate __pyx_mstate_global->__pyx_n_s_truncate #define __pyx_n_s_unicode __pyx_mstate_global->__pyx_n_s_unicode #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_n_s_view __pyx_mstate_global->__pyx_n_s_view #define __pyx_n_s_whence __pyx_mstate_global->__pyx_n_s_whence #define __pyx_n_s_whence_mapping __pyx_mstate_global->__pyx_n_s_whence_mapping #define __pyx_n_s_whence_rw __pyx_mstate_global->__pyx_n_s_whence_rw #define __pyx_n_s_writable __pyx_mstate_global->__pyx_n_s_writable #define __pyx_n_s_write __pyx_mstate_global->__pyx_n_s_write #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 /* #### Code section: module_code ### */ /* "pygame_sdl2/rwobject.pyx":60 * void init_python_threads() * * cdef set_error(e): # <<<<<<<<<<<<<< * cdef char *msg * e = str(e) */ static PyObject *__pyx_f_11pygame_sdl2_8rwobject_set_error(PyObject *__pyx_v_e) { char *__pyx_v_msg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_error", 0); __Pyx_INCREF(__pyx_v_e); /* "pygame_sdl2/rwobject.pyx":62 * cdef set_error(e): * cdef char *msg * e = str(e) # <<<<<<<<<<<<<< * msg = e * SDL_SetError("%s", msg) */ __pyx_t_1 = __Pyx_PyObject_Str(__pyx_v_e); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_e, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":63 * cdef char *msg * e = str(e) * msg = e # <<<<<<<<<<<<<< * SDL_SetError("%s", msg) * */ __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_e); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_v_msg = ((char *)__pyx_t_2); /* "pygame_sdl2/rwobject.pyx":64 * e = str(e) * msg = e * SDL_SetError("%s", msg) # <<<<<<<<<<<<<< * * cdef Sint64 python_size(SDL_RWops *context) noexcept with gil: */ (void)(SDL_SetError(((char const *)"%s"), __pyx_v_msg)); /* "pygame_sdl2/rwobject.pyx":60 * void init_python_threads() * * cdef set_error(e): # <<<<<<<<<<<<<< * cdef char *msg * e = str(e) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rwobject.set_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_e); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":66 * SDL_SetError("%s", msg) * * cdef Sint64 python_size(SDL_RWops *context) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_size(SDL_RWops *__pyx_v_context) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_cur = NULL; PyObject *__pyx_v_rv = NULL; CYTHON_UNUSED PyObject *__pyx_v_e = NULL; Sint64 __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Sint64 __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_size", 0); /* "pygame_sdl2/rwobject.pyx":67 * * cdef Sint64 python_size(SDL_RWops *context) noexcept with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":69 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * cur = f.tell() * f.seek(0, 2) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":70 * * try: * cur = f.tell() # <<<<<<<<<<<<<< * f.seek(0, 2) * rv = f.tell() */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_tell); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_cur = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":71 * try: * cur = f.tell() * f.seek(0, 2) # <<<<<<<<<<<<<< * rv = f.tell() * f.seek(cur, 0) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":72 * cur = f.tell() * f.seek(0, 2) * rv = f.tell() # <<<<<<<<<<<<<< * f.seek(cur, 0) * except Exception as e: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_tell); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_rv = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":73 * f.seek(0, 2) * rv = f.tell() * f.seek(cur, 0) # <<<<<<<<<<<<<< * except Exception as e: * return -1 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_cur, __pyx_int_0}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":69 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * cur = f.tell() * f.seek(0, 2) */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":74 * rv = f.tell() * f.seek(cur, 0) * except Exception as e: # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_7) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_size", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_6) < 0) __PYX_ERR(0, 74, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_v_e = __pyx_t_1; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":75 * f.seek(cur, 0) * except Exception as e: * return -1 # <<<<<<<<<<<<<< * * return rv */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L13_return; } /* "pygame_sdl2/rwobject.pyx":74 * rv = f.tell() * f.seek(cur, 0) * except Exception as e: # <<<<<<<<<<<<<< * return -1 * */ /*finally:*/ { __pyx_L13_return: { __pyx_t_8 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; __pyx_r = __pyx_t_8; goto __pyx_L6_except_return; } } } goto __pyx_L5_except_error; /* "pygame_sdl2/rwobject.pyx":69 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * cur = f.tell() * f.seek(0, 2) */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L8_try_end:; } /* "pygame_sdl2/rwobject.pyx":77 * return -1 * * return rv # <<<<<<<<<<<<<< * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept with gil: */ __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_rv); if (unlikely((__pyx_t_8 == ((Sint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_r = __pyx_t_8; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":66 * SDL_SetError("%s", msg) * * cdef Sint64 python_size(SDL_RWops *context) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_cur); __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":79 * return rv * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_seek(SDL_RWops *__pyx_v_context, Sint64 __pyx_v_seek, int __pyx_v_whence) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_e = NULL; Sint64 __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; char const *__pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; Sint64 __pyx_t_18; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_seek", 0); /* "pygame_sdl2/rwobject.pyx":80 * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":82 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.seek(seek, whence) * rv = f.tell() */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":83 * * try: * f.seek(seek, whence) # <<<<<<<<<<<<<< * rv = f.tell() * except Exception as e: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_seek); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 83, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_whence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":84 * try: * f.seek(seek, whence) * rv = f.tell() # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_tell); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":82 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.seek(seek, whence) * rv = f.tell() */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pygame_sdl2/rwobject.pyx":85 * f.seek(seek, whence) * rv = f.tell() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_9) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_seek", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 85, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":86 * rv = f.tell() * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":87 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * return rv */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L13_return; } /* "pygame_sdl2/rwobject.pyx":85 * f.seek(seek, whence) * rv = f.tell() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ /*finally:*/ { __pyx_L14_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L5_except_error; } __pyx_L13_return: { __pyx_t_18 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; __pyx_r = __pyx_t_18; goto __pyx_L6_except_return; } } } goto __pyx_L5_except_error; /* "pygame_sdl2/rwobject.pyx":82 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.seek(seek, whence) * rv = f.tell() */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L8_try_end:; } /* "pygame_sdl2/rwobject.pyx":89 * return -1 * * return rv # <<<<<<<<<<<<<< * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept with gil: */ __pyx_t_18 = __Pyx_PyInt_As_int64_t(__pyx_v_rv); if (unlikely((__pyx_t_18 == ((Sint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error) __pyx_r = __pyx_t_18; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":79 * return rv * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_seek", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":91 * return rv * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_read(SDL_RWops *__pyx_v_context, void *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_data = NULL; PyObject *__pyx_v_e = NULL; size_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; char const *__pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; size_t __pyx_t_17; char *__pyx_t_18; Py_ssize_t __pyx_t_19; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_read", 0); /* "pygame_sdl2/rwobject.pyx":92 * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":94 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * data = f.read(size * maxnum) * except Exception as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":95 * * try: * data = f.read(size * maxnum) # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_FromSize_t((__pyx_v_size * __pyx_v_maxnum)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":94 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * data = f.read(size * maxnum) * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":96 * try: * data = f.read(size * maxnum) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_read", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 96, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":97 * data = f.read(size * maxnum) * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_7 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":98 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * memcpy(ptr, data, len(data)) */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L13_return; } /* "pygame_sdl2/rwobject.pyx":96 * try: * data = f.read(size * maxnum) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ /*finally:*/ { __pyx_L14_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L5_except_error; } __pyx_L13_return: { __pyx_t_17 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; __pyx_r = __pyx_t_17; goto __pyx_L6_except_return; } } } goto __pyx_L5_except_error; /* "pygame_sdl2/rwobject.pyx":94 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * data = f.read(size * maxnum) * except Exception as e: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L8_try_end:; } /* "pygame_sdl2/rwobject.pyx":100 * return -1 * * memcpy(ptr, data, len(data)) # <<<<<<<<<<<<<< * return len(data) * */ __pyx_t_18 = __Pyx_PyObject_AsWritableString(__pyx_v_data); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_19 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_19 == ((Py_ssize_t)-1))) __PYX_ERR(0, 100, __pyx_L1_error) (void)(memcpy(__pyx_v_ptr, ((void *)((char *)__pyx_t_18)), __pyx_t_19)); /* "pygame_sdl2/rwobject.pyx":101 * * memcpy(ptr, data, len(data)) * return len(data) # <<<<<<<<<<<<<< * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) noexcept with gil: */ __pyx_t_19 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_19 == ((Py_ssize_t)-1))) __PYX_ERR(0, 101, __pyx_L1_error) __pyx_r = __pyx_t_19; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":91 * return rv * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":103 * return len(data) * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * data = ( ptr)[:size * maxnum] */ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_write(SDL_RWops *__pyx_v_context, void const *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_data = NULL; PyObject *__pyx_v_e = NULL; size_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; char const *__pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; size_t __pyx_t_17; Py_ssize_t __pyx_t_18; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_write", 0); /* "pygame_sdl2/rwobject.pyx":104 * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) noexcept with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * data = ( ptr)[:size * maxnum] * */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":105 * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) noexcept with gil: * f = context.hidden.unknown.data1 * data = ( ptr)[:size * maxnum] # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_ptr) + 0, (__pyx_v_size * __pyx_v_maxnum) - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":107 * data = ( ptr)[:size * maxnum] * * try: # <<<<<<<<<<<<<< * f.write(data) * except Exception as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":108 * * try: * f.write(data) # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":107 * data = ( ptr)[:size * maxnum] * * try: # <<<<<<<<<<<<<< * f.write(data) * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":109 * try: * f.write(data) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_7) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_write", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 109, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":110 * f.write(data) * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_8 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 110, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pygame_sdl2/rwobject.pyx":111 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * return len(data) */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L13_return; } /* "pygame_sdl2/rwobject.pyx":109 * try: * f.write(data) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ /*finally:*/ { __pyx_L14_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_7 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L5_except_error; } __pyx_L13_return: { __pyx_t_17 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; __pyx_r = __pyx_t_17; goto __pyx_L6_except_return; } } } goto __pyx_L5_except_error; /* "pygame_sdl2/rwobject.pyx":107 * data = ( ptr)[:size * maxnum] * * try: # <<<<<<<<<<<<<< * f.write(data) * except Exception as e: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L8_try_end:; } /* "pygame_sdl2/rwobject.pyx":113 * return -1 * * return len(data) # <<<<<<<<<<<<<< * * cdef int python_close(SDL_RWops *context) noexcept with gil: */ __pyx_t_18 = __Pyx_PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 113, __pyx_L1_error) __pyx_r = __pyx_t_18; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":103 * return len(data) * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * data = ( ptr)[:size * maxnum] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_write", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":115 * return len(data) * * cdef int python_close(SDL_RWops *context) noexcept with gil: # <<<<<<<<<<<<<< * if context != NULL: * if context.hidden.unknown.data1 != NULL: */ static int __pyx_f_11pygame_sdl2_8rwobject_python_close(SDL_RWops *__pyx_v_context) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_e = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; char const *__pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_close", 0); /* "pygame_sdl2/rwobject.pyx":116 * * cdef int python_close(SDL_RWops *context) noexcept with gil: * if context != NULL: # <<<<<<<<<<<<<< * if context.hidden.unknown.data1 != NULL: * f = context.hidden.unknown.data1 */ __pyx_t_1 = (__pyx_v_context != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":117 * cdef int python_close(SDL_RWops *context) noexcept with gil: * if context != NULL: * if context.hidden.unknown.data1 != NULL: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ __pyx_t_1 = (__pyx_v_context->hidden.unknown.data1 != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":118 * if context != NULL: * if context.hidden.unknown.data1 != NULL: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_2); __pyx_v_f = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":120 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.close() * except Exception as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":121 * * try: * f.close() # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":120 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.close() * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L10_try_end; __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":122 * try: * f.close() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_close", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 122, __pyx_L7_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_v_e = __pyx_t_6; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":123 * f.close() * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_9 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 123, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/rwobject.pyx":124 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * Py_DECREF(f) */ __pyx_r = -1; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L15_return; } /* "pygame_sdl2/rwobject.pyx":122 * try: * f.close() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ /*finally:*/ { __pyx_L16_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_8 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L7_except_error; } __pyx_L15_return: { __pyx_t_10 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; __pyx_r = __pyx_t_10; goto __pyx_L8_except_return; } } } goto __pyx_L7_except_error; /* "pygame_sdl2/rwobject.pyx":120 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.close() * except Exception as e: */ __pyx_L7_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L8_except_return:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; __pyx_L10_try_end:; } /* "pygame_sdl2/rwobject.pyx":126 * return -1 * * Py_DECREF(f) # <<<<<<<<<<<<<< * * context.hidden.unknown.data1 = NULL */ Py_DECREF(__pyx_v_f); /* "pygame_sdl2/rwobject.pyx":128 * Py_DECREF(f) * * context.hidden.unknown.data1 = NULL # <<<<<<<<<<<<<< * SDL_FreeRW(context) * return 0 */ __pyx_v_context->hidden.unknown.data1 = NULL; /* "pygame_sdl2/rwobject.pyx":117 * cdef int python_close(SDL_RWops *context) noexcept with gil: * if context != NULL: * if context.hidden.unknown.data1 != NULL: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ } /* "pygame_sdl2/rwobject.pyx":129 * * context.hidden.unknown.data1 = NULL * SDL_FreeRW(context) # <<<<<<<<<<<<<< * return 0 * */ SDL_FreeRW(__pyx_v_context); /* "pygame_sdl2/rwobject.pyx":116 * * cdef int python_close(SDL_RWops *context) noexcept with gil: * if context != NULL: # <<<<<<<<<<<<<< * if context.hidden.unknown.data1 != NULL: * f = context.hidden.unknown.data1 */ } /* "pygame_sdl2/rwobject.pyx":130 * context.hidden.unknown.data1 = NULL * SDL_FreeRW(context) * return 0 # <<<<<<<<<<<<<< * * cdef struct SubFile: */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":115 * return len(data) * * cdef int python_close(SDL_RWops *context) noexcept with gil: # <<<<<<<<<<<<<< * if context != NULL: * if context.hidden.unknown.data1 != NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_close", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":138 * Sint64 tell * * cdef Sint64 subfile_size(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * return sf.length */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_size(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; Sint64 __pyx_r; /* "pygame_sdl2/rwobject.pyx":139 * * cdef Sint64 subfile_size(SDL_RWops *context) noexcept nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * return sf.length * */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":140 * cdef Sint64 subfile_size(SDL_RWops *context) noexcept nogil: * cdef SubFile *sf = context.hidden.unknown.data1 * return sf.length # <<<<<<<<<<<<<< * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: */ __pyx_r = __pyx_v_sf->length; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":138 * Sint64 tell * * cdef Sint64 subfile_size(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * return sf.length */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":142 * return sf.length * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_seek(SDL_RWops *__pyx_v_context, Sint64 __pyx_v_seek, int __pyx_v_whence) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; Sint64 __pyx_r; /* "pygame_sdl2/rwobject.pyx":143 * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * if whence == RW_SEEK_SET: */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":145 * cdef SubFile *sf = context.hidden.unknown.data1 * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: */ switch (__pyx_v_whence) { case RW_SEEK_SET: /* "pygame_sdl2/rwobject.pyx":146 * * if whence == RW_SEEK_SET: * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base # <<<<<<<<<<<<<< * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base */ __pyx_v_sf->tell = (SDL_RWseek(__pyx_v_sf->rw, (__pyx_v_seek + __pyx_v_sf->base), RW_SEEK_SET) - __pyx_v_sf->base); /* "pygame_sdl2/rwobject.pyx":145 * cdef SubFile *sf = context.hidden.unknown.data1 * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: */ break; case RW_SEEK_CUR: /* "pygame_sdl2/rwobject.pyx":148 * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base # <<<<<<<<<<<<<< * elif whence == RW_SEEK_END: * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base */ __pyx_v_sf->tell = (SDL_RWseek(__pyx_v_sf->rw, __pyx_v_seek, RW_SEEK_CUR) - __pyx_v_sf->base); /* "pygame_sdl2/rwobject.pyx":147 * if whence == RW_SEEK_SET: * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: */ break; case RW_SEEK_END: /* "pygame_sdl2/rwobject.pyx":150 * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base # <<<<<<<<<<<<<< * * return sf.tell */ __pyx_v_sf->tell = (SDL_RWseek(__pyx_v_sf->rw, ((__pyx_v_sf->base + __pyx_v_sf->length) + __pyx_v_seek), RW_SEEK_SET) - __pyx_v_sf->base); /* "pygame_sdl2/rwobject.pyx":149 * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base * */ break; default: break; } /* "pygame_sdl2/rwobject.pyx":152 * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base * * return sf.tell # <<<<<<<<<<<<<< * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: */ __pyx_r = __pyx_v_sf->tell; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":142 * return sf.length * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":154 * return sf.tell * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ static size_t __pyx_f_11pygame_sdl2_8rwobject_subfile_read(SDL_RWops *__pyx_v_context, void *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; Sint64 __pyx_v_left; size_t __pyx_v_rv; size_t __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "pygame_sdl2/rwobject.pyx":155 * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * cdef Sint64 left = sf.length - sf.tell */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":157 * cdef SubFile *sf = context.hidden.unknown.data1 * * cdef Sint64 left = sf.length - sf.tell # <<<<<<<<<<<<<< * cdef size_t rv * */ __pyx_v_left = (__pyx_v_sf->length - __pyx_v_sf->tell); /* "pygame_sdl2/rwobject.pyx":160 * cdef size_t rv * * if size * maxnum > left: # <<<<<<<<<<<<<< * maxnum = left // size * */ __pyx_t_1 = ((__pyx_v_size * __pyx_v_maxnum) > __pyx_v_left); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":161 * * if size * maxnum > left: * maxnum = left // size # <<<<<<<<<<<<<< * * if maxnum == 0: */ if (unlikely(__pyx_v_size == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 161, __pyx_L1_error) } __pyx_v_maxnum = (__pyx_v_left / __pyx_v_size); /* "pygame_sdl2/rwobject.pyx":160 * cdef size_t rv * * if size * maxnum > left: # <<<<<<<<<<<<<< * maxnum = left // size * */ } /* "pygame_sdl2/rwobject.pyx":163 * maxnum = left // size * * if maxnum == 0: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = (__pyx_v_maxnum == 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":164 * * if maxnum == 0: * return 0 # <<<<<<<<<<<<<< * * rv = SDL_RWread(sf.rw, ptr, size, maxnum) */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":163 * maxnum = left // size * * if maxnum == 0: # <<<<<<<<<<<<<< * return 0 * */ } /* "pygame_sdl2/rwobject.pyx":166 * return 0 * * rv = SDL_RWread(sf.rw, ptr, size, maxnum) # <<<<<<<<<<<<<< * * if rv > 0: */ __pyx_v_rv = SDL_RWread(__pyx_v_sf->rw, __pyx_v_ptr, __pyx_v_size, __pyx_v_maxnum); /* "pygame_sdl2/rwobject.pyx":168 * rv = SDL_RWread(sf.rw, ptr, size, maxnum) * * if rv > 0: # <<<<<<<<<<<<<< * sf.tell += size * rv * */ __pyx_t_1 = (__pyx_v_rv > 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":169 * * if rv > 0: * sf.tell += size * rv # <<<<<<<<<<<<<< * * return rv */ __pyx_v_sf->tell = (__pyx_v_sf->tell + (__pyx_v_size * __pyx_v_rv)); /* "pygame_sdl2/rwobject.pyx":168 * rv = SDL_RWread(sf.rw, ptr, size, maxnum) * * if rv > 0: # <<<<<<<<<<<<<< * sf.tell += size * rv * */ } /* "pygame_sdl2/rwobject.pyx":171 * sf.tell += size * rv * * return rv # <<<<<<<<<<<<<< * * cdef int subfile_close(SDL_RWops *context) noexcept nogil: */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":154 * return sf.tell * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_WriteUnraisable("pygame_sdl2.rwobject.subfile_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":173 * return rv * * cdef int subfile_close(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf * */ static int __pyx_f_11pygame_sdl2_8rwobject_subfile_close(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; int __pyx_r; int __pyx_t_1; /* "pygame_sdl2/rwobject.pyx":176 * cdef SubFile *sf * * if context != NULL: # <<<<<<<<<<<<<< * sf = context.hidden.unknown.data1 * if sf.rw != NULL: */ __pyx_t_1 = (__pyx_v_context != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":177 * * if context != NULL: * sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * if sf.rw != NULL: * SDL_RWclose(sf.rw) */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":178 * if context != NULL: * sf = context.hidden.unknown.data1 * if sf.rw != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(sf.rw) * if sf != NULL: */ __pyx_t_1 = (__pyx_v_sf->rw != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":179 * sf = context.hidden.unknown.data1 * if sf.rw != NULL: * SDL_RWclose(sf.rw) # <<<<<<<<<<<<<< * if sf != NULL: * free(sf) */ (void)(SDL_RWclose(__pyx_v_sf->rw)); /* "pygame_sdl2/rwobject.pyx":178 * if context != NULL: * sf = context.hidden.unknown.data1 * if sf.rw != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(sf.rw) * if sf != NULL: */ } /* "pygame_sdl2/rwobject.pyx":180 * if sf.rw != NULL: * SDL_RWclose(sf.rw) * if sf != NULL: # <<<<<<<<<<<<<< * free(sf) * context.hidden.unknown.data1 = NULL */ __pyx_t_1 = (__pyx_v_sf != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":181 * SDL_RWclose(sf.rw) * if sf != NULL: * free(sf) # <<<<<<<<<<<<<< * context.hidden.unknown.data1 = NULL * SDL_FreeRW(context) */ free(__pyx_v_sf); /* "pygame_sdl2/rwobject.pyx":182 * if sf != NULL: * free(sf) * context.hidden.unknown.data1 = NULL # <<<<<<<<<<<<<< * SDL_FreeRW(context) * */ __pyx_v_context->hidden.unknown.data1 = NULL; /* "pygame_sdl2/rwobject.pyx":180 * if sf.rw != NULL: * SDL_RWclose(sf.rw) * if sf != NULL: # <<<<<<<<<<<<<< * free(sf) * context.hidden.unknown.data1 = NULL */ } /* "pygame_sdl2/rwobject.pyx":183 * free(sf) * context.hidden.unknown.data1 = NULL * SDL_FreeRW(context) # <<<<<<<<<<<<<< * * return 0 */ SDL_FreeRW(__pyx_v_context); /* "pygame_sdl2/rwobject.pyx":176 * cdef SubFile *sf * * if context != NULL: # <<<<<<<<<<<<<< * sf = context.hidden.unknown.data1 * if sf.rw != NULL: */ } /* "pygame_sdl2/rwobject.pyx":185 * SDL_FreeRW(context) * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":173 * return rv * * cdef int subfile_close(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":194 * Sint64 tell * * cdef Sint64 splitfile_size(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 rv */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_splitfile_size(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *__pyx_v_sf; Sint64 __pyx_r; /* "pygame_sdl2/rwobject.pyx":195 * * cdef Sint64 splitfile_size(SDL_RWops *context) noexcept nogil: * cdef SplitFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * cdef Sint64 rv * */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":198 * cdef Sint64 rv * * return SDL_RWsize(sf.a) + SDL_RWsize(sf.b) # <<<<<<<<<<<<<< * * cdef Sint64 splitfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: */ __pyx_r = (SDL_RWsize(__pyx_v_sf->a) + SDL_RWsize(__pyx_v_sf->b)); goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":194 * Sint64 tell * * cdef Sint64 splitfile_size(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 rv */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":200 * return SDL_RWsize(sf.a) + SDL_RWsize(sf.b) * * cdef Sint64 splitfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 rv */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_splitfile_seek(SDL_RWops *__pyx_v_context, Sint64 __pyx_v_seek, int __pyx_v_whence) { struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *__pyx_v_sf; Sint64 __pyx_v_rv; Sint64 __pyx_r; int __pyx_t_1; /* "pygame_sdl2/rwobject.pyx":201 * * cdef Sint64 splitfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: * cdef SplitFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * cdef Sint64 rv * */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":204 * cdef Sint64 rv * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * sf.tell = seek * elif whence == RW_SEEK_CUR: */ switch (__pyx_v_whence) { case RW_SEEK_SET: /* "pygame_sdl2/rwobject.pyx":205 * * if whence == RW_SEEK_SET: * sf.tell = seek # <<<<<<<<<<<<<< * elif whence == RW_SEEK_CUR: * sf.tell += seek */ __pyx_v_sf->tell = __pyx_v_seek; /* "pygame_sdl2/rwobject.pyx":204 * cdef Sint64 rv * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * sf.tell = seek * elif whence == RW_SEEK_CUR: */ break; case RW_SEEK_CUR: /* "pygame_sdl2/rwobject.pyx":207 * sf.tell = seek * elif whence == RW_SEEK_CUR: * sf.tell += seek # <<<<<<<<<<<<<< * elif whence == RW_SEEK_END: * sf.tell = splitfile_size(context) + seek */ __pyx_v_sf->tell = (__pyx_v_sf->tell + __pyx_v_seek); /* "pygame_sdl2/rwobject.pyx":206 * if whence == RW_SEEK_SET: * sf.tell = seek * elif whence == RW_SEEK_CUR: # <<<<<<<<<<<<<< * sf.tell += seek * elif whence == RW_SEEK_END: */ break; case RW_SEEK_END: /* "pygame_sdl2/rwobject.pyx":209 * sf.tell += seek * elif whence == RW_SEEK_END: * sf.tell = splitfile_size(context) + seek # <<<<<<<<<<<<<< * * if sf.tell < sf.split: */ __pyx_v_sf->tell = (__pyx_f_11pygame_sdl2_8rwobject_splitfile_size(__pyx_v_context) + __pyx_v_seek); /* "pygame_sdl2/rwobject.pyx":208 * elif whence == RW_SEEK_CUR: * sf.tell += seek * elif whence == RW_SEEK_END: # <<<<<<<<<<<<<< * sf.tell = splitfile_size(context) + seek * */ break; default: break; } /* "pygame_sdl2/rwobject.pyx":211 * sf.tell = splitfile_size(context) + seek * * if sf.tell < sf.split: # <<<<<<<<<<<<<< * rv = SDL_RWseek(sf.a, sf.tell, RW_SEEK_SET) * SDL_RWseek(sf.b, 0, RW_SEEK_SET) */ __pyx_t_1 = (__pyx_v_sf->tell < __pyx_v_sf->split); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":212 * * if sf.tell < sf.split: * rv = SDL_RWseek(sf.a, sf.tell, RW_SEEK_SET) # <<<<<<<<<<<<<< * SDL_RWseek(sf.b, 0, RW_SEEK_SET) * else: */ __pyx_v_rv = SDL_RWseek(__pyx_v_sf->a, __pyx_v_sf->tell, RW_SEEK_SET); /* "pygame_sdl2/rwobject.pyx":213 * if sf.tell < sf.split: * rv = SDL_RWseek(sf.a, sf.tell, RW_SEEK_SET) * SDL_RWseek(sf.b, 0, RW_SEEK_SET) # <<<<<<<<<<<<<< * else: * SDL_RWseek(sf.a, sf.split, RW_SEEK_SET) */ (void)(SDL_RWseek(__pyx_v_sf->b, 0, RW_SEEK_SET)); /* "pygame_sdl2/rwobject.pyx":211 * sf.tell = splitfile_size(context) + seek * * if sf.tell < sf.split: # <<<<<<<<<<<<<< * rv = SDL_RWseek(sf.a, sf.tell, RW_SEEK_SET) * SDL_RWseek(sf.b, 0, RW_SEEK_SET) */ goto __pyx_L3; } /* "pygame_sdl2/rwobject.pyx":215 * SDL_RWseek(sf.b, 0, RW_SEEK_SET) * else: * SDL_RWseek(sf.a, sf.split, RW_SEEK_SET) # <<<<<<<<<<<<<< * rv = SDL_RWseek(sf.b, sf.tell - sf.split, RW_SEEK_SET) * */ /*else*/ { (void)(SDL_RWseek(__pyx_v_sf->a, __pyx_v_sf->split, RW_SEEK_SET)); /* "pygame_sdl2/rwobject.pyx":216 * else: * SDL_RWseek(sf.a, sf.split, RW_SEEK_SET) * rv = SDL_RWseek(sf.b, sf.tell - sf.split, RW_SEEK_SET) # <<<<<<<<<<<<<< * * if rv < 0: */ __pyx_v_rv = SDL_RWseek(__pyx_v_sf->b, (__pyx_v_sf->tell - __pyx_v_sf->split), RW_SEEK_SET); } __pyx_L3:; /* "pygame_sdl2/rwobject.pyx":218 * rv = SDL_RWseek(sf.b, sf.tell - sf.split, RW_SEEK_SET) * * if rv < 0: # <<<<<<<<<<<<<< * return rv * else: */ __pyx_t_1 = (__pyx_v_rv < 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":219 * * if rv < 0: * return rv # <<<<<<<<<<<<<< * else: * return sf.tell */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":218 * rv = SDL_RWseek(sf.b, sf.tell - sf.split, RW_SEEK_SET) * * if rv < 0: # <<<<<<<<<<<<<< * return rv * else: */ } /* "pygame_sdl2/rwobject.pyx":221 * return rv * else: * return sf.tell # <<<<<<<<<<<<<< * * cdef size_t splitfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: */ /*else*/ { __pyx_r = __pyx_v_sf->tell; goto __pyx_L0; } /* "pygame_sdl2/rwobject.pyx":200 * return SDL_RWsize(sf.a) + SDL_RWsize(sf.b) * * cdef Sint64 splitfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 rv */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":223 * return sf.tell * * cdef size_t splitfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 left = splitfile_size(context) - sf.tell */ static size_t __pyx_f_11pygame_sdl2_8rwobject_splitfile_read(SDL_RWops *__pyx_v_context, void *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *__pyx_v_sf; CYTHON_UNUSED Sint64 __pyx_v_left; size_t __pyx_v_total_read; size_t __pyx_v_left_read; size_t __pyx_v_right_read; size_t __pyx_r; Sint64 __pyx_t_1; size_t __pyx_t_2; size_t __pyx_t_3; int __pyx_t_4; long __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "pygame_sdl2/rwobject.pyx":224 * * cdef size_t splitfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: * cdef SplitFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * cdef Sint64 left = splitfile_size(context) - sf.tell * cdef size_t rv */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":225 * cdef size_t splitfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 left = splitfile_size(context) - sf.tell # <<<<<<<<<<<<<< * cdef size_t rv * */ __pyx_v_left = (__pyx_f_11pygame_sdl2_8rwobject_splitfile_size(__pyx_v_context) - __pyx_v_sf->tell); /* "pygame_sdl2/rwobject.pyx":233 * cdef size_t ret * * total_read = size * maxnum # <<<<<<<<<<<<<< * * left_read = min(total_read, sf.split - sf.tell) */ __pyx_v_total_read = (__pyx_v_size * __pyx_v_maxnum); /* "pygame_sdl2/rwobject.pyx":235 * total_read = size * maxnum * * left_read = min(total_read, sf.split - sf.tell) # <<<<<<<<<<<<<< * left_read = max(left_read, 0) * */ __pyx_t_1 = (__pyx_v_sf->split - __pyx_v_sf->tell); __pyx_t_2 = __pyx_v_total_read; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_left_read = __pyx_t_3; /* "pygame_sdl2/rwobject.pyx":236 * * left_read = min(total_read, sf.split - sf.tell) * left_read = max(left_read, 0) # <<<<<<<<<<<<<< * * if left_read > 0: */ __pyx_t_5 = 0; __pyx_t_3 = __pyx_v_left_read; __pyx_t_4 = (__pyx_t_5 > __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_5; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_left_read = __pyx_t_2; /* "pygame_sdl2/rwobject.pyx":238 * left_read = max(left_read, 0) * * if left_read > 0: # <<<<<<<<<<<<<< * left_read = SDL_RWread(sf.a, ptr, 1, left_read) * if left_read < 0: */ __pyx_t_4 = (__pyx_v_left_read > 0); if (__pyx_t_4) { /* "pygame_sdl2/rwobject.pyx":239 * * if left_read > 0: * left_read = SDL_RWread(sf.a, ptr, 1, left_read) # <<<<<<<<<<<<<< * if left_read < 0: * return left_read */ __pyx_v_left_read = SDL_RWread(__pyx_v_sf->a, __pyx_v_ptr, 1, __pyx_v_left_read); /* "pygame_sdl2/rwobject.pyx":240 * if left_read > 0: * left_read = SDL_RWread(sf.a, ptr, 1, left_read) * if left_read < 0: # <<<<<<<<<<<<<< * return left_read * */ __pyx_t_4 = (__pyx_v_left_read < 0); if (__pyx_t_4) { /* "pygame_sdl2/rwobject.pyx":241 * left_read = SDL_RWread(sf.a, ptr, 1, left_read) * if left_read < 0: * return left_read # <<<<<<<<<<<<<< * * right_read = total_read - left_read */ __pyx_r = __pyx_v_left_read; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":240 * if left_read > 0: * left_read = SDL_RWread(sf.a, ptr, 1, left_read) * if left_read < 0: # <<<<<<<<<<<<<< * return left_read * */ } /* "pygame_sdl2/rwobject.pyx":238 * left_read = max(left_read, 0) * * if left_read > 0: # <<<<<<<<<<<<<< * left_read = SDL_RWread(sf.a, ptr, 1, left_read) * if left_read < 0: */ } /* "pygame_sdl2/rwobject.pyx":243 * return left_read * * right_read = total_read - left_read # <<<<<<<<<<<<<< * * if right_read > 0: */ __pyx_v_right_read = (__pyx_v_total_read - __pyx_v_left_read); /* "pygame_sdl2/rwobject.pyx":245 * right_read = total_read - left_read * * if right_read > 0: # <<<<<<<<<<<<<< * right_read = SDL_RWread(sf.b, ptr + left_read, 1, right_read) * if right_read < 0: */ __pyx_t_4 = (__pyx_v_right_read > 0); if (__pyx_t_4) { /* "pygame_sdl2/rwobject.pyx":246 * * if right_read > 0: * right_read = SDL_RWread(sf.b, ptr + left_read, 1, right_read) # <<<<<<<<<<<<<< * if right_read < 0: * return right_read */ __pyx_v_right_read = SDL_RWread(__pyx_v_sf->b, (((char *)__pyx_v_ptr) + __pyx_v_left_read), 1, __pyx_v_right_read); /* "pygame_sdl2/rwobject.pyx":247 * if right_read > 0: * right_read = SDL_RWread(sf.b, ptr + left_read, 1, right_read) * if right_read < 0: # <<<<<<<<<<<<<< * return right_read * */ __pyx_t_4 = (__pyx_v_right_read < 0); if (__pyx_t_4) { /* "pygame_sdl2/rwobject.pyx":248 * right_read = SDL_RWread(sf.b, ptr + left_read, 1, right_read) * if right_read < 0: * return right_read # <<<<<<<<<<<<<< * * sf.tell += left_read + right_read */ __pyx_r = __pyx_v_right_read; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":247 * if right_read > 0: * right_read = SDL_RWread(sf.b, ptr + left_read, 1, right_read) * if right_read < 0: # <<<<<<<<<<<<<< * return right_read * */ } /* "pygame_sdl2/rwobject.pyx":245 * right_read = total_read - left_read * * if right_read > 0: # <<<<<<<<<<<<<< * right_read = SDL_RWread(sf.b, ptr + left_read, 1, right_read) * if right_read < 0: */ } /* "pygame_sdl2/rwobject.pyx":250 * return right_read * * sf.tell += left_read + right_read # <<<<<<<<<<<<<< * * return (left_read + right_read) // size */ __pyx_v_sf->tell = (__pyx_v_sf->tell + (__pyx_v_left_read + __pyx_v_right_read)); /* "pygame_sdl2/rwobject.pyx":252 * sf.tell += left_read + right_read * * return (left_read + right_read) // size # <<<<<<<<<<<<<< * * cdef int splitfile_close(SDL_RWops *context) noexcept nogil: */ __pyx_t_2 = (__pyx_v_left_read + __pyx_v_right_read); if (unlikely(__pyx_v_size == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 252, __pyx_L1_error) } __pyx_r = (__pyx_t_2 / __pyx_v_size); goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":223 * return sf.tell * * cdef size_t splitfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 left = splitfile_size(context) - sf.tell */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_WriteUnraisable("pygame_sdl2.rwobject.splitfile_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":254 * return (left_read + right_read) // size * * cdef int splitfile_close(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf * */ static int __pyx_f_11pygame_sdl2_8rwobject_splitfile_close(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *__pyx_v_sf; int __pyx_r; int __pyx_t_1; /* "pygame_sdl2/rwobject.pyx":257 * cdef SplitFile *sf * * if context != NULL: # <<<<<<<<<<<<<< * sf = context.hidden.unknown.data1 * if sf.a != NULL: */ __pyx_t_1 = (__pyx_v_context != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":258 * * if context != NULL: * sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * if sf.a != NULL: * SDL_RWclose(sf.a) */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":259 * if context != NULL: * sf = context.hidden.unknown.data1 * if sf.a != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(sf.a) * if sf.b != NULL: */ __pyx_t_1 = (__pyx_v_sf->a != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":260 * sf = context.hidden.unknown.data1 * if sf.a != NULL: * SDL_RWclose(sf.a) # <<<<<<<<<<<<<< * if sf.b != NULL: * SDL_RWclose(sf.b) */ (void)(SDL_RWclose(__pyx_v_sf->a)); /* "pygame_sdl2/rwobject.pyx":259 * if context != NULL: * sf = context.hidden.unknown.data1 * if sf.a != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(sf.a) * if sf.b != NULL: */ } /* "pygame_sdl2/rwobject.pyx":261 * if sf.a != NULL: * SDL_RWclose(sf.a) * if sf.b != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(sf.b) * if sf != NULL: */ __pyx_t_1 = (__pyx_v_sf->b != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":262 * SDL_RWclose(sf.a) * if sf.b != NULL: * SDL_RWclose(sf.b) # <<<<<<<<<<<<<< * if sf != NULL: * free(sf) */ (void)(SDL_RWclose(__pyx_v_sf->b)); /* "pygame_sdl2/rwobject.pyx":261 * if sf.a != NULL: * SDL_RWclose(sf.a) * if sf.b != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(sf.b) * if sf != NULL: */ } /* "pygame_sdl2/rwobject.pyx":263 * if sf.b != NULL: * SDL_RWclose(sf.b) * if sf != NULL: # <<<<<<<<<<<<<< * free(sf) * context.hidden.unknown.data1 = NULL */ __pyx_t_1 = (__pyx_v_sf != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":264 * SDL_RWclose(sf.b) * if sf != NULL: * free(sf) # <<<<<<<<<<<<<< * context.hidden.unknown.data1 = NULL * SDL_FreeRW(context) */ free(__pyx_v_sf); /* "pygame_sdl2/rwobject.pyx":265 * if sf != NULL: * free(sf) * context.hidden.unknown.data1 = NULL # <<<<<<<<<<<<<< * SDL_FreeRW(context) * */ __pyx_v_context->hidden.unknown.data1 = NULL; /* "pygame_sdl2/rwobject.pyx":263 * if sf.b != NULL: * SDL_RWclose(sf.b) * if sf != NULL: # <<<<<<<<<<<<<< * free(sf) * context.hidden.unknown.data1 = NULL */ } /* "pygame_sdl2/rwobject.pyx":266 * free(sf) * context.hidden.unknown.data1 = NULL * SDL_FreeRW(context) # <<<<<<<<<<<<<< * * return 0 */ SDL_FreeRW(__pyx_v_context); /* "pygame_sdl2/rwobject.pyx":257 * cdef SplitFile *sf * * if context != NULL: # <<<<<<<<<<<<<< * sf = context.hidden.unknown.data1 * if sf.a != NULL: */ } /* "pygame_sdl2/rwobject.pyx":268 * SDL_FreeRW(context) * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":254 * return (left_read + right_read) // size * * cdef int splitfile_close(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":277 * Uint8 *stop * * cdef Sint64 buffile_size(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_buffile_size(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *__pyx_v_bf; Sint64 __pyx_r; /* "pygame_sdl2/rwobject.pyx":278 * * cdef Sint64 buffile_size(SDL_RWops *context) noexcept nogil: * cdef BufFile *bf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * return bf.stop - bf.base */ __pyx_v_bf = ((struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":280 * cdef BufFile *bf = context.hidden.unknown.data1 * * return bf.stop - bf.base # <<<<<<<<<<<<<< * * cdef Sint64 buffile_seek(SDL_RWops *context, Sint64 offset, int whence) noexcept nogil: */ __pyx_r = (__pyx_v_bf->stop - __pyx_v_bf->base); goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":277 * Uint8 *stop * * cdef Sint64 buffile_size(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":282 * return bf.stop - bf.base * * cdef Sint64 buffile_seek(SDL_RWops *context, Sint64 offset, int whence) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_buffile_seek(SDL_RWops *__pyx_v_context, Sint64 __pyx_v_offset, int __pyx_v_whence) { struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *__pyx_v_bf; Uint8 *__pyx_v_newpos; Sint64 __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Uint8 *__pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif __Pyx_RefNannySetupContext("buffile_seek", 1); /* "pygame_sdl2/rwobject.pyx":283 * * cdef Sint64 buffile_seek(SDL_RWops *context, Sint64 offset, int whence) noexcept nogil: * cdef BufFile *bf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * cdef Uint8 *newpos */ __pyx_v_bf = ((struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":287 * cdef Uint8 *newpos * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * newpos = bf.base + offset * elif whence == RW_SEEK_CUR: */ switch (__pyx_v_whence) { case RW_SEEK_SET: /* "pygame_sdl2/rwobject.pyx":288 * * if whence == RW_SEEK_SET: * newpos = bf.base + offset # <<<<<<<<<<<<<< * elif whence == RW_SEEK_CUR: * newpos = bf.here + offset */ __pyx_v_newpos = (__pyx_v_bf->base + __pyx_v_offset); /* "pygame_sdl2/rwobject.pyx":287 * cdef Uint8 *newpos * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * newpos = bf.base + offset * elif whence == RW_SEEK_CUR: */ break; case RW_SEEK_CUR: /* "pygame_sdl2/rwobject.pyx":290 * newpos = bf.base + offset * elif whence == RW_SEEK_CUR: * newpos = bf.here + offset # <<<<<<<<<<<<<< * elif whence == RW_SEEK_END: * newpos = bf.stop + offset */ __pyx_v_newpos = (__pyx_v_bf->here + __pyx_v_offset); /* "pygame_sdl2/rwobject.pyx":289 * if whence == RW_SEEK_SET: * newpos = bf.base + offset * elif whence == RW_SEEK_CUR: # <<<<<<<<<<<<<< * newpos = bf.here + offset * elif whence == RW_SEEK_END: */ break; case RW_SEEK_END: /* "pygame_sdl2/rwobject.pyx":292 * newpos = bf.here + offset * elif whence == RW_SEEK_END: * newpos = bf.stop + offset # <<<<<<<<<<<<<< * else: * with gil: */ __pyx_v_newpos = (__pyx_v_bf->stop + __pyx_v_offset); /* "pygame_sdl2/rwobject.pyx":291 * elif whence == RW_SEEK_CUR: * newpos = bf.here + offset * elif whence == RW_SEEK_END: # <<<<<<<<<<<<<< * newpos = bf.stop + offset * else: */ break; default: /* "pygame_sdl2/rwobject.pyx":294 * newpos = bf.stop + offset * else: * with gil: # <<<<<<<<<<<<<< * set_error("Unknown value for 'whence'") * return -1 */ { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":295 * else: * with gil: * set_error("Unknown value for 'whence'") # <<<<<<<<<<<<<< * return -1 * if newpos < bf.base: */ __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_kp_s_Unknown_value_for_whence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "pygame_sdl2/rwobject.pyx":294 * newpos = bf.stop + offset * else: * with gil: # <<<<<<<<<<<<<< * set_error("Unknown value for 'whence'") * return -1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif goto __pyx_L5; } __pyx_L4_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif goto __pyx_L1_error; } __pyx_L5:; } } /* "pygame_sdl2/rwobject.pyx":296 * with gil: * set_error("Unknown value for 'whence'") * return -1 # <<<<<<<<<<<<<< * if newpos < bf.base: * newpos = bf.base */ __pyx_r = -1L; goto __pyx_L0; break; } /* "pygame_sdl2/rwobject.pyx":297 * set_error("Unknown value for 'whence'") * return -1 * if newpos < bf.base: # <<<<<<<<<<<<<< * newpos = bf.base * if newpos > bf.stop: */ __pyx_t_2 = (__pyx_v_newpos < __pyx_v_bf->base); if (__pyx_t_2) { /* "pygame_sdl2/rwobject.pyx":298 * return -1 * if newpos < bf.base: * newpos = bf.base # <<<<<<<<<<<<<< * if newpos > bf.stop: * newpos = bf.stop */ __pyx_t_3 = __pyx_v_bf->base; __pyx_v_newpos = __pyx_t_3; /* "pygame_sdl2/rwobject.pyx":297 * set_error("Unknown value for 'whence'") * return -1 * if newpos < bf.base: # <<<<<<<<<<<<<< * newpos = bf.base * if newpos > bf.stop: */ } /* "pygame_sdl2/rwobject.pyx":299 * if newpos < bf.base: * newpos = bf.base * if newpos > bf.stop: # <<<<<<<<<<<<<< * newpos = bf.stop * bf.here = newpos */ __pyx_t_2 = (__pyx_v_newpos > __pyx_v_bf->stop); if (__pyx_t_2) { /* "pygame_sdl2/rwobject.pyx":300 * newpos = bf.base * if newpos > bf.stop: * newpos = bf.stop # <<<<<<<<<<<<<< * bf.here = newpos * */ __pyx_t_3 = __pyx_v_bf->stop; __pyx_v_newpos = __pyx_t_3; /* "pygame_sdl2/rwobject.pyx":299 * if newpos < bf.base: * newpos = bf.base * if newpos > bf.stop: # <<<<<<<<<<<<<< * newpos = bf.stop * bf.here = newpos */ } /* "pygame_sdl2/rwobject.pyx":301 * if newpos > bf.stop: * newpos = bf.stop * bf.here = newpos # <<<<<<<<<<<<<< * * return bf.here - bf.base */ __pyx_v_bf->here = __pyx_v_newpos; /* "pygame_sdl2/rwobject.pyx":303 * bf.here = newpos * * return bf.here - bf.base # <<<<<<<<<<<<<< * * cdef size_t buffile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: */ __pyx_r = (__pyx_v_bf->here - __pyx_v_bf->base); goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":282 * return bf.stop - bf.base * * cdef Sint64 buffile_seek(SDL_RWops *context, Sint64 offset, int whence) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_XDECREF(__pyx_t_1); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.buffile_seek", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; __Pyx_RefNannyFinishContextNogil() return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":305 * return bf.here - bf.base * * cdef size_t buffile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * cdef size_t total_bytes = 0 */ static size_t __pyx_f_11pygame_sdl2_8rwobject_buffile_read(SDL_RWops *__pyx_v_context, void *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *__pyx_v_bf; size_t __pyx_v_total_bytes; size_t __pyx_v_mem_available; size_t __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "pygame_sdl2/rwobject.pyx":306 * * cdef size_t buffile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: * cdef BufFile *bf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * cdef size_t total_bytes = 0 * cdef size_t mem_available = 0 */ __pyx_v_bf = ((struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":307 * cdef size_t buffile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: * cdef BufFile *bf = context.hidden.unknown.data1 * cdef size_t total_bytes = 0 # <<<<<<<<<<<<<< * cdef size_t mem_available = 0 * */ __pyx_v_total_bytes = 0; /* "pygame_sdl2/rwobject.pyx":308 * cdef BufFile *bf = context.hidden.unknown.data1 * cdef size_t total_bytes = 0 * cdef size_t mem_available = 0 # <<<<<<<<<<<<<< * * total_bytes = maxnum * size */ __pyx_v_mem_available = 0; /* "pygame_sdl2/rwobject.pyx":310 * cdef size_t mem_available = 0 * * total_bytes = maxnum * size # <<<<<<<<<<<<<< * if (maxnum == 0) or (size == 0) or ((total_bytes // maxnum) != size): * return 0 */ __pyx_v_total_bytes = (__pyx_v_maxnum * __pyx_v_size); /* "pygame_sdl2/rwobject.pyx":311 * * total_bytes = maxnum * size * if (maxnum == 0) or (size == 0) or ((total_bytes // maxnum) != size): # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_2 = (__pyx_v_maxnum == 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_size == 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } if (unlikely(__pyx_v_maxnum == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 311, __pyx_L1_error) } __pyx_t_2 = ((__pyx_v_total_bytes / __pyx_v_maxnum) != __pyx_v_size); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":312 * total_bytes = maxnum * size * if (maxnum == 0) or (size == 0) or ((total_bytes // maxnum) != size): * return 0 # <<<<<<<<<<<<<< * * mem_available = bf.stop - bf.here */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":311 * * total_bytes = maxnum * size * if (maxnum == 0) or (size == 0) or ((total_bytes // maxnum) != size): # <<<<<<<<<<<<<< * return 0 * */ } /* "pygame_sdl2/rwobject.pyx":314 * return 0 * * mem_available = bf.stop - bf.here # <<<<<<<<<<<<<< * if total_bytes > mem_available: * total_bytes = mem_available */ __pyx_v_mem_available = (__pyx_v_bf->stop - __pyx_v_bf->here); /* "pygame_sdl2/rwobject.pyx":315 * * mem_available = bf.stop - bf.here * if total_bytes > mem_available: # <<<<<<<<<<<<<< * total_bytes = mem_available * */ __pyx_t_1 = (__pyx_v_total_bytes > __pyx_v_mem_available); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":316 * mem_available = bf.stop - bf.here * if total_bytes > mem_available: * total_bytes = mem_available # <<<<<<<<<<<<<< * * SDL_memcpy(ptr, bf.here, total_bytes) */ __pyx_v_total_bytes = __pyx_v_mem_available; /* "pygame_sdl2/rwobject.pyx":315 * * mem_available = bf.stop - bf.here * if total_bytes > mem_available: # <<<<<<<<<<<<<< * total_bytes = mem_available * */ } /* "pygame_sdl2/rwobject.pyx":318 * total_bytes = mem_available * * SDL_memcpy(ptr, bf.here, total_bytes) # <<<<<<<<<<<<<< * bf.here += total_bytes * */ (void)(SDL_memcpy(__pyx_v_ptr, __pyx_v_bf->here, __pyx_v_total_bytes)); /* "pygame_sdl2/rwobject.pyx":319 * * SDL_memcpy(ptr, bf.here, total_bytes) * bf.here += total_bytes # <<<<<<<<<<<<<< * * return (total_bytes // size) */ __pyx_v_bf->here = (__pyx_v_bf->here + __pyx_v_total_bytes); /* "pygame_sdl2/rwobject.pyx":321 * bf.here += total_bytes * * return (total_bytes // size) # <<<<<<<<<<<<<< * * cdef size_t buffile_write(SDL_RWops *context, const void *ptr, size_t size, size_t num) noexcept nogil: */ if (unlikely(__pyx_v_size == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 321, __pyx_L1_error) } __pyx_r = (__pyx_v_total_bytes / __pyx_v_size); goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":305 * return bf.here - bf.base * * cdef size_t buffile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * cdef size_t total_bytes = 0 */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_WriteUnraisable("pygame_sdl2.rwobject.buffile_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":323 * return (total_bytes // size) * * cdef size_t buffile_write(SDL_RWops *context, const void *ptr, size_t size, size_t num) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * */ static size_t __pyx_f_11pygame_sdl2_8rwobject_buffile_write(SDL_RWops *__pyx_v_context, void const *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_num) { struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *__pyx_v_bf; size_t __pyx_r; int __pyx_t_1; ptrdiff_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "pygame_sdl2/rwobject.pyx":324 * * cdef size_t buffile_write(SDL_RWops *context, const void *ptr, size_t size, size_t num) noexcept nogil: * cdef BufFile *bf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * if bf.view.readonly != 0: */ __pyx_v_bf = ((struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":326 * cdef BufFile *bf = context.hidden.unknown.data1 * * if bf.view.readonly != 0: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = (__pyx_v_bf->view.readonly != 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":327 * * if bf.view.readonly != 0: * return 0 # <<<<<<<<<<<<<< * * if (bf.here + (num * size)) > bf.stop: */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":326 * cdef BufFile *bf = context.hidden.unknown.data1 * * if bf.view.readonly != 0: # <<<<<<<<<<<<<< * return 0 * */ } /* "pygame_sdl2/rwobject.pyx":329 * return 0 * * if (bf.here + (num * size)) > bf.stop: # <<<<<<<<<<<<<< * num = (bf.stop - bf.here) // size * SDL_memcpy(bf.here, ptr, num * size) */ __pyx_t_1 = ((__pyx_v_bf->here + (__pyx_v_num * __pyx_v_size)) > __pyx_v_bf->stop); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":330 * * if (bf.here + (num * size)) > bf.stop: * num = (bf.stop - bf.here) // size # <<<<<<<<<<<<<< * SDL_memcpy(bf.here, ptr, num * size) * bf.here += num * size */ __pyx_t_2 = (__pyx_v_bf->stop - __pyx_v_bf->here); if (unlikely(__pyx_v_size == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 330, __pyx_L1_error) } else if (sizeof(ptrdiff_t) == sizeof(long) && (!(((size_t)-1) > 0)) && unlikely(__pyx_v_size == (size_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_t_2))) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 330, __pyx_L1_error) } __pyx_v_num = __Pyx_div_ptrdiff_t(__pyx_t_2, __pyx_v_size); /* "pygame_sdl2/rwobject.pyx":329 * return 0 * * if (bf.here + (num * size)) > bf.stop: # <<<<<<<<<<<<<< * num = (bf.stop - bf.here) // size * SDL_memcpy(bf.here, ptr, num * size) */ } /* "pygame_sdl2/rwobject.pyx":331 * if (bf.here + (num * size)) > bf.stop: * num = (bf.stop - bf.here) // size * SDL_memcpy(bf.here, ptr, num * size) # <<<<<<<<<<<<<< * bf.here += num * size * */ (void)(SDL_memcpy(__pyx_v_bf->here, __pyx_v_ptr, (__pyx_v_num * __pyx_v_size))); /* "pygame_sdl2/rwobject.pyx":332 * num = (bf.stop - bf.here) // size * SDL_memcpy(bf.here, ptr, num * size) * bf.here += num * size # <<<<<<<<<<<<<< * * return num */ __pyx_v_bf->here = (__pyx_v_bf->here + (__pyx_v_num * __pyx_v_size)); /* "pygame_sdl2/rwobject.pyx":334 * bf.here += num * size * * return num # <<<<<<<<<<<<<< * * cdef int buffile_close(SDL_RWops *context) noexcept with gil: */ __pyx_r = __pyx_v_num; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":323 * return (total_bytes // size) * * cdef size_t buffile_write(SDL_RWops *context, const void *ptr, size_t size, size_t num) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_WriteUnraisable("pygame_sdl2.rwobject.buffile_write", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":336 * return num * * cdef int buffile_close(SDL_RWops *context) noexcept with gil: # <<<<<<<<<<<<<< * cdef BufFile *bf * */ static int __pyx_f_11pygame_sdl2_8rwobject_buffile_close(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *__pyx_v_bf; int __pyx_r; int __pyx_t_1; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /* "pygame_sdl2/rwobject.pyx":339 * cdef BufFile *bf * * if context != NULL: # <<<<<<<<<<<<<< * bf = context.hidden.unknown.data1 * if bf != NULL: */ __pyx_t_1 = (__pyx_v_context != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":340 * * if context != NULL: * bf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * if bf != NULL: * PyBuffer_Release(&bf.view) */ __pyx_v_bf = ((struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":341 * if context != NULL: * bf = context.hidden.unknown.data1 * if bf != NULL: # <<<<<<<<<<<<<< * PyBuffer_Release(&bf.view) * free(bf) */ __pyx_t_1 = (__pyx_v_bf != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":342 * bf = context.hidden.unknown.data1 * if bf != NULL: * PyBuffer_Release(&bf.view) # <<<<<<<<<<<<<< * free(bf) * bf = NULL */ PyBuffer_Release((&__pyx_v_bf->view)); /* "pygame_sdl2/rwobject.pyx":343 * if bf != NULL: * PyBuffer_Release(&bf.view) * free(bf) # <<<<<<<<<<<<<< * bf = NULL * SDL_FreeRW(context) */ free(__pyx_v_bf); /* "pygame_sdl2/rwobject.pyx":344 * PyBuffer_Release(&bf.view) * free(bf) * bf = NULL # <<<<<<<<<<<<<< * SDL_FreeRW(context) * */ __pyx_v_bf = NULL; /* "pygame_sdl2/rwobject.pyx":341 * if context != NULL: * bf = context.hidden.unknown.data1 * if bf != NULL: # <<<<<<<<<<<<<< * PyBuffer_Release(&bf.view) * free(bf) */ } /* "pygame_sdl2/rwobject.pyx":345 * free(bf) * bf = NULL * SDL_FreeRW(context) # <<<<<<<<<<<<<< * * return 0 */ SDL_FreeRW(__pyx_v_context); /* "pygame_sdl2/rwobject.pyx":339 * cdef BufFile *bf * * if context != NULL: # <<<<<<<<<<<<<< * bf = context.hidden.unknown.data1 * if bf != NULL: */ } /* "pygame_sdl2/rwobject.pyx":347 * SDL_FreeRW(context) * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":336 * return num * * cdef int buffile_close(SDL_RWops *context) noexcept with gil: # <<<<<<<<<<<<<< * cdef BufFile *bf * */ /* function exit code */ __pyx_L0:; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":350 * * * cdef SDL_RWops *to_rwops(filelike, mode="rb", base=None, length=None) except NULL: # <<<<<<<<<<<<<< * """ * This accepts, in order: */ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_to_rwops(PyObject *__pyx_v_filelike, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args) { PyObject *__pyx_v_mode = ((PyObject *)__pyx_n_s_rb); PyObject *__pyx_v_base = ((PyObject *)Py_None); PyObject *__pyx_v_length = ((PyObject *)Py_None); struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; SDL_RWops *__pyx_v_rv; SDL_RWops *__pyx_v_rw; char *__pyx_v_cname; char *__pyx_v_cmode; struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_rwopsio = 0; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_dname = NULL; SDL_RWops *__pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; SDL_RWops *__pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; char *__pyx_t_13; Sint64 __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_rwops", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_mode = __pyx_optional_args->mode; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_base = __pyx_optional_args->base; if (__pyx_optional_args->__pyx_n > 2) { __pyx_v_length = __pyx_optional_args->length; } } } } __Pyx_INCREF(__pyx_v_filelike); __Pyx_INCREF(__pyx_v_mode); __Pyx_INCREF(__pyx_v_base); __Pyx_INCREF(__pyx_v_length); /* "pygame_sdl2/rwobject.pyx":385 * cdef RWopsIOImpl rwopsio * * if not isinstance(mode, bytes_): # <<<<<<<<<<<<<< * mode = mode.encode("ascii") * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_mode, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":386 * * if not isinstance(mode, bytes_): * mode = mode.encode("ascii") # <<<<<<<<<<<<<< * * name = filelike */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_mode, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_n_s_ascii}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":385 * cdef RWopsIOImpl rwopsio * * if not isinstance(mode, bytes_): # <<<<<<<<<<<<<< * mode = mode.encode("ascii") * */ } /* "pygame_sdl2/rwobject.pyx":388 * mode = mode.encode("ascii") * * name = filelike # <<<<<<<<<<<<<< * * # Handle turning BufferedIOBase and RWopsIO objects into their underlying */ __Pyx_INCREF(__pyx_v_filelike); __pyx_v_name = __pyx_v_filelike; /* "pygame_sdl2/rwobject.pyx":392 * # Handle turning BufferedIOBase and RWopsIO objects into their underlying * # objects. * try: # <<<<<<<<<<<<<< * while True: * filelike = filelike.raw */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":393 * # objects. * try: * while True: # <<<<<<<<<<<<<< * filelike = filelike.raw * except AttributeError: */ while (1) { /* "pygame_sdl2/rwobject.pyx":394 * try: * while True: * filelike = filelike.raw # <<<<<<<<<<<<<< * except AttributeError: * pass */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_raw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_filelike, __pyx_t_1); __pyx_t_1 = 0; } /* "pygame_sdl2/rwobject.pyx":392 * # Handle turning BufferedIOBase and RWopsIO objects into their underlying * # objects. * try: # <<<<<<<<<<<<<< * while True: * filelike = filelike.raw */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":395 * while True: * filelike = filelike.raw * except AttributeError: # <<<<<<<<<<<<<< * pass * */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_6) { __Pyx_ErrRestore(0,0,0); goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; /* "pygame_sdl2/rwobject.pyx":392 * # Handle turning BufferedIOBase and RWopsIO objects into their underlying * # objects. * try: # <<<<<<<<<<<<<< * while True: * filelike = filelike.raw */ __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L5_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L9_try_end:; } /* "pygame_sdl2/rwobject.pyx":398 * pass * * if isinstance(filelike, RWopsIOImpl): # <<<<<<<<<<<<<< * rwopsio = filelike * if not rwopsio.ops: */ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_filelike, __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":399 * * if isinstance(filelike, RWopsIOImpl): * rwopsio = filelike # <<<<<<<<<<<<<< * if not rwopsio.ops: * raise ValueError("I/O on closed file.") */ __pyx_t_1 = __pyx_v_filelike; __Pyx_INCREF(__pyx_t_1); __pyx_v_rwopsio = ((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":400 * if isinstance(filelike, RWopsIOImpl): * rwopsio = filelike * if not rwopsio.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O on closed file.") * */ __pyx_t_3 = (!(__pyx_v_rwopsio->ops != 0)); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/rwobject.pyx":401 * rwopsio = filelike * if not rwopsio.ops: * raise ValueError("I/O on closed file.") # <<<<<<<<<<<<<< * * rv = rwopsio.ops */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 401, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":400 * if isinstance(filelike, RWopsIOImpl): * rwopsio = filelike * if not rwopsio.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O on closed file.") * */ } /* "pygame_sdl2/rwobject.pyx":403 * raise ValueError("I/O on closed file.") * * rv = rwopsio.ops # <<<<<<<<<<<<<< * rwopsio.ops = NULL * return rv */ __pyx_t_10 = __pyx_v_rwopsio->ops; __pyx_v_rv = __pyx_t_10; /* "pygame_sdl2/rwobject.pyx":404 * * rv = rwopsio.ops * rwopsio.ops = NULL # <<<<<<<<<<<<<< * return rv * */ __pyx_v_rwopsio->ops = NULL; /* "pygame_sdl2/rwobject.pyx":405 * rv = rwopsio.ops * rwopsio.ops = NULL * return rv # <<<<<<<<<<<<<< * * if isinstance(filelike, (file_type, io.IOBase)) and mode == "rb": */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":398 * pass * * if isinstance(filelike, RWopsIOImpl): # <<<<<<<<<<<<<< * rwopsio = filelike * if not rwopsio.ops: */ } /* "pygame_sdl2/rwobject.pyx":407 * return rv * * if isinstance(filelike, (file_type, io.IOBase)) and mode == "rb": # <<<<<<<<<<<<<< * name = getattr(filelike, "name", None) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_file_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_io); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_IOBase); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_1); if (!__pyx_t_11) { } else { __pyx_t_2 = __pyx_t_11; goto __pyx_L17_bool_binop_done; } __pyx_t_11 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_5); __pyx_t_2 = __pyx_t_11; __pyx_L17_bool_binop_done:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L15_bool_binop_done; } __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_rb, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 407, __pyx_L1_error) __pyx_t_3 = __pyx_t_2; __pyx_L15_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":408 * * if isinstance(filelike, (file_type, io.IOBase)) and mode == "rb": * name = getattr(filelike, "name", None) # <<<<<<<<<<<<<< * * # Try to open as a file. */ __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_filelike, __pyx_n_s_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":407 * return rv * * if isinstance(filelike, (file_type, io.IOBase)) and mode == "rb": # <<<<<<<<<<<<<< * name = getattr(filelike, "name", None) * */ } /* "pygame_sdl2/rwobject.pyx":411 * * # Try to open as a file. * if isinstance(name, bytes_): # <<<<<<<<<<<<<< * name = name.decode(fsencoding) * elif isinstance(name, unicode_): */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_name, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":412 * # Try to open as a file. * if isinstance(name, bytes_): * name = name.decode(fsencoding) # <<<<<<<<<<<<<< * elif isinstance(name, unicode_): * pass */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fsencoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":411 * * # Try to open as a file. * if isinstance(name, bytes_): # <<<<<<<<<<<<<< * name = name.decode(fsencoding) * elif isinstance(name, unicode_): */ goto __pyx_L19; } /* "pygame_sdl2/rwobject.pyx":413 * if isinstance(name, bytes_): * name = name.decode(fsencoding) * elif isinstance(name, unicode_): # <<<<<<<<<<<<<< * pass * else: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_name, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { goto __pyx_L19; } /* "pygame_sdl2/rwobject.pyx":416 * pass * else: * name = None # <<<<<<<<<<<<<< * * if (mode == b"rb") and (name is not None): */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_name, Py_None); } __pyx_L19:; /* "pygame_sdl2/rwobject.pyx":418 * name = None * * if (mode == b"rb") and (name is not None): # <<<<<<<<<<<<<< * * dname = name.encode("utf-8") */ __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_mode, __pyx_n_b_rb, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 418, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L21_bool_binop_done; } __pyx_t_2 = (__pyx_v_name != Py_None); __pyx_t_3 = __pyx_t_2; __pyx_L21_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":420 * if (mode == b"rb") and (name is not None): * * dname = name.encode("utf-8") # <<<<<<<<<<<<<< * cname = dname * cmode = mode */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_dname = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":421 * * dname = name.encode("utf-8") * cname = dname # <<<<<<<<<<<<<< * cmode = mode * */ __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_dname); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 421, __pyx_L1_error) __pyx_v_cname = __pyx_t_13; /* "pygame_sdl2/rwobject.pyx":422 * dname = name.encode("utf-8") * cname = dname * cmode = mode # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_13 = __Pyx_PyObject_AsWritableString(__pyx_v_mode); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 422, __pyx_L1_error) __pyx_v_cmode = __pyx_t_13; /* "pygame_sdl2/rwobject.pyx":424 * cmode = mode * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWFromFile(cname, cmode) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":425 * * with nogil: * rv = SDL_RWFromFile(cname, cmode) # <<<<<<<<<<<<<< * * if rv == NULL: */ __pyx_v_rv = SDL_RWFromFile(__pyx_v_cname, __pyx_v_cmode); } /* "pygame_sdl2/rwobject.pyx":424 * cmode = mode * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWFromFile(cname, cmode) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L25; } __pyx_L25:; } } /* "pygame_sdl2/rwobject.pyx":427 * rv = SDL_RWFromFile(cname, cmode) * * if rv == NULL: # <<<<<<<<<<<<<< * raise IOError("Could not open {!r}: {}".format(name, SDL_GetError())) * */ __pyx_t_3 = (__pyx_v_rv == NULL); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/rwobject.pyx":428 * * if rv == NULL: * raise IOError("Could not open {!r}: {}".format(name, SDL_GetError())) # <<<<<<<<<<<<<< * * if base is None and length is None: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Could_not_open_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_name, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 428, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":427 * rv = SDL_RWFromFile(cname, cmode) * * if rv == NULL: # <<<<<<<<<<<<<< * raise IOError("Could not open {!r}: {}".format(name, SDL_GetError())) * */ } /* "pygame_sdl2/rwobject.pyx":430 * raise IOError("Could not open {!r}: {}".format(name, SDL_GetError())) * * if base is None and length is None: # <<<<<<<<<<<<<< * try: * base = filelike.base */ __pyx_t_2 = (__pyx_v_base == Py_None); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } __pyx_t_2 = (__pyx_v_length == Py_None); __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":431 * * if base is None and length is None: * try: # <<<<<<<<<<<<<< * base = filelike.base * length = filelike.length */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":432 * if base is None and length is None: * try: * base = filelike.base # <<<<<<<<<<<<<< * length = filelike.length * except AttributeError: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_base); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_base, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":433 * try: * base = filelike.base * length = filelike.length # <<<<<<<<<<<<<< * except AttributeError: * pass */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 433, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_length, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":431 * * if base is None and length is None: * try: # <<<<<<<<<<<<<< * base = filelike.base * length = filelike.length */ } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L35_try_end; __pyx_L30_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":434 * base = filelike.base * length = filelike.length * except AttributeError: # <<<<<<<<<<<<<< * pass * */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_6) { __Pyx_ErrRestore(0,0,0); goto __pyx_L31_exception_handled; } goto __pyx_L32_except_error; /* "pygame_sdl2/rwobject.pyx":431 * * if base is None and length is None: * try: # <<<<<<<<<<<<<< * base = filelike.base * length = filelike.length */ __pyx_L32_except_error:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7); goto __pyx_L1_error; __pyx_L31_exception_handled:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7); __pyx_L35_try_end:; } /* "pygame_sdl2/rwobject.pyx":430 * raise IOError("Could not open {!r}: {}".format(name, SDL_GetError())) * * if base is None and length is None: # <<<<<<<<<<<<<< * try: * base = filelike.base */ } /* "pygame_sdl2/rwobject.pyx":437 * pass * * if base is not None and length is not None: # <<<<<<<<<<<<<< * * # If we have these properties, we're either an APK asset or a Ren'Py-style */ __pyx_t_2 = (__pyx_v_base != Py_None); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L37_bool_binop_done; } __pyx_t_2 = (__pyx_v_length != Py_None); __pyx_t_3 = __pyx_t_2; __pyx_L37_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":442 * # subfile, so use an optimized path. * * rw = rv # <<<<<<<<<<<<<< * * SDL_RWseek(rw, base, RW_SEEK_SET); */ __pyx_v_rw = __pyx_v_rv; /* "pygame_sdl2/rwobject.pyx":444 * rw = rv * * SDL_RWseek(rw, base, RW_SEEK_SET); # <<<<<<<<<<<<<< * * sf = calloc(sizeof(SubFile), 1) */ __pyx_t_14 = __Pyx_PyInt_As_int64_t(__pyx_v_base); if (unlikely((__pyx_t_14 == ((Sint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L1_error) (void)(SDL_RWseek(__pyx_v_rw, __pyx_t_14, RW_SEEK_SET)); /* "pygame_sdl2/rwobject.pyx":446 * SDL_RWseek(rw, base, RW_SEEK_SET); * * sf = calloc(sizeof(SubFile), 1) # <<<<<<<<<<<<<< * sf.rw = rw * sf.base = base */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)calloc((sizeof(struct __pyx_t_11pygame_sdl2_8rwobject_SubFile)), 1)); /* "pygame_sdl2/rwobject.pyx":447 * * sf = calloc(sizeof(SubFile), 1) * sf.rw = rw # <<<<<<<<<<<<<< * sf.base = base * sf.length = length */ __pyx_v_sf->rw = __pyx_v_rw; /* "pygame_sdl2/rwobject.pyx":448 * sf = calloc(sizeof(SubFile), 1) * sf.rw = rw * sf.base = base # <<<<<<<<<<<<<< * sf.length = length * sf.tell = 0 */ __pyx_t_14 = __Pyx_PyInt_As_int64_t(__pyx_v_base); if (unlikely((__pyx_t_14 == ((Sint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error) __pyx_v_sf->base = __pyx_t_14; /* "pygame_sdl2/rwobject.pyx":449 * sf.rw = rw * sf.base = base * sf.length = length # <<<<<<<<<<<<<< * sf.tell = 0 * */ __pyx_t_14 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_14 == ((Sint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) __pyx_v_sf->length = __pyx_t_14; /* "pygame_sdl2/rwobject.pyx":450 * sf.base = base * sf.length = length * sf.tell = 0 # <<<<<<<<<<<<<< * * rv = SDL_AllocRW() */ __pyx_v_sf->tell = 0; /* "pygame_sdl2/rwobject.pyx":452 * sf.tell = 0 * * rv = SDL_AllocRW() # <<<<<<<<<<<<<< * rv.size = subfile_size * rv.seek = subfile_seek */ __pyx_v_rv = SDL_AllocRW(); /* "pygame_sdl2/rwobject.pyx":453 * * rv = SDL_AllocRW() * rv.size = subfile_size # <<<<<<<<<<<<<< * rv.seek = subfile_seek * rv.read = subfile_read */ __pyx_v_rv->size = __pyx_f_11pygame_sdl2_8rwobject_subfile_size; /* "pygame_sdl2/rwobject.pyx":454 * rv = SDL_AllocRW() * rv.size = subfile_size * rv.seek = subfile_seek # <<<<<<<<<<<<<< * rv.read = subfile_read * rv.write = NULL */ __pyx_v_rv->seek = __pyx_f_11pygame_sdl2_8rwobject_subfile_seek; /* "pygame_sdl2/rwobject.pyx":455 * rv.size = subfile_size * rv.seek = subfile_seek * rv.read = subfile_read # <<<<<<<<<<<<<< * rv.write = NULL * rv.close = subfile_close */ __pyx_v_rv->read = __pyx_f_11pygame_sdl2_8rwobject_subfile_read; /* "pygame_sdl2/rwobject.pyx":456 * rv.seek = subfile_seek * rv.read = subfile_read * rv.write = NULL # <<<<<<<<<<<<<< * rv.close = subfile_close * rv.type = 0 */ __pyx_v_rv->write = NULL; /* "pygame_sdl2/rwobject.pyx":457 * rv.read = subfile_read * rv.write = NULL * rv.close = subfile_close # <<<<<<<<<<<<<< * rv.type = 0 * rv.hidden.unknown.data1 = sf */ __pyx_v_rv->close = __pyx_f_11pygame_sdl2_8rwobject_subfile_close; /* "pygame_sdl2/rwobject.pyx":458 * rv.write = NULL * rv.close = subfile_close * rv.type = 0 # <<<<<<<<<<<<<< * rv.hidden.unknown.data1 = sf * */ __pyx_v_rv->type = 0; /* "pygame_sdl2/rwobject.pyx":459 * rv.close = subfile_close * rv.type = 0 * rv.hidden.unknown.data1 = sf # <<<<<<<<<<<<<< * * try: */ __pyx_v_rv->hidden.unknown.data1 = ((void *)__pyx_v_sf); /* "pygame_sdl2/rwobject.pyx":437 * pass * * if base is not None and length is not None: # <<<<<<<<<<<<<< * * # If we have these properties, we're either an APK asset or a Ren'Py-style */ } /* "pygame_sdl2/rwobject.pyx":461 * rv.hidden.unknown.data1 = sf * * try: # <<<<<<<<<<<<<< * filelike.close() * except: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":462 * * try: * filelike.close() # <<<<<<<<<<<<<< * except: * pass */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_close); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L39_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L39_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":461 * rv.hidden.unknown.data1 = sf * * try: # <<<<<<<<<<<<<< * filelike.close() * except: */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L44_try_end; __pyx_L39_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":463 * try: * filelike.close() * except: # <<<<<<<<<<<<<< * pass * */ /*except:*/ { __Pyx_ErrRestore(0,0,0); goto __pyx_L40_exception_handled; } __pyx_L40_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L44_try_end:; } /* "pygame_sdl2/rwobject.pyx":466 * pass * * return rv # <<<<<<<<<<<<<< * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":418 * name = None * * if (mode == b"rb") and (name is not None): # <<<<<<<<<<<<<< * * dname = name.encode("utf-8") */ } /* "pygame_sdl2/rwobject.pyx":468 * return rv * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): # <<<<<<<<<<<<<< * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) * */ __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filelike, __pyx_n_s_read); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 468, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L46_bool_binop_done; } __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filelike, __pyx_n_s_write); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 468, __pyx_L1_error) __pyx_t_3 = __pyx_t_2; __pyx_L46_bool_binop_done:; __pyx_t_2 = (!__pyx_t_3); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/rwobject.pyx":469 * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) # <<<<<<<<<<<<<< * * Py_INCREF(filelike) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_r_is_not_a_filename_or_file_lik, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_filelike}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 469, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":468 * return rv * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): # <<<<<<<<<<<<<< * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) * */ } /* "pygame_sdl2/rwobject.pyx":471 * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) * * Py_INCREF(filelike) # <<<<<<<<<<<<<< * * rv = SDL_AllocRW() */ Py_INCREF(__pyx_v_filelike); /* "pygame_sdl2/rwobject.pyx":473 * Py_INCREF(filelike) * * rv = SDL_AllocRW() # <<<<<<<<<<<<<< * rv.size = python_size * rv.seek = python_seek */ __pyx_v_rv = SDL_AllocRW(); /* "pygame_sdl2/rwobject.pyx":474 * * rv = SDL_AllocRW() * rv.size = python_size # <<<<<<<<<<<<<< * rv.seek = python_seek * rv.read = python_read */ __pyx_v_rv->size = __pyx_f_11pygame_sdl2_8rwobject_python_size; /* "pygame_sdl2/rwobject.pyx":475 * rv = SDL_AllocRW() * rv.size = python_size * rv.seek = python_seek # <<<<<<<<<<<<<< * rv.read = python_read * rv.write = python_write */ __pyx_v_rv->seek = __pyx_f_11pygame_sdl2_8rwobject_python_seek; /* "pygame_sdl2/rwobject.pyx":476 * rv.size = python_size * rv.seek = python_seek * rv.read = python_read # <<<<<<<<<<<<<< * rv.write = python_write * rv.close = python_close */ __pyx_v_rv->read = __pyx_f_11pygame_sdl2_8rwobject_python_read; /* "pygame_sdl2/rwobject.pyx":477 * rv.seek = python_seek * rv.read = python_read * rv.write = python_write # <<<<<<<<<<<<<< * rv.close = python_close * rv.type = 0 */ __pyx_v_rv->write = __pyx_f_11pygame_sdl2_8rwobject_python_write; /* "pygame_sdl2/rwobject.pyx":478 * rv.read = python_read * rv.write = python_write * rv.close = python_close # <<<<<<<<<<<<<< * rv.type = 0 * rv.hidden.unknown.data1 = filelike */ __pyx_v_rv->close = __pyx_f_11pygame_sdl2_8rwobject_python_close; /* "pygame_sdl2/rwobject.pyx":479 * rv.write = python_write * rv.close = python_close * rv.type = 0 # <<<<<<<<<<<<<< * rv.hidden.unknown.data1 = filelike * */ __pyx_v_rv->type = 0; /* "pygame_sdl2/rwobject.pyx":480 * rv.close = python_close * rv.type = 0 * rv.hidden.unknown.data1 = filelike # <<<<<<<<<<<<<< * * return rv */ __pyx_v_rv->hidden.unknown.data1 = ((void *)__pyx_v_filelike); /* "pygame_sdl2/rwobject.pyx":482 * rv.hidden.unknown.data1 = filelike * * return rv # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":350 * * * cdef SDL_RWops *to_rwops(filelike, mode="rb", base=None, length=None) except NULL: # <<<<<<<<<<<<<< * """ * This accepts, in order: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.rwobject.to_rwops", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rwopsio); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_dname); __Pyx_XDECREF(__pyx_v_filelike); __Pyx_XDECREF(__pyx_v_mode); __Pyx_XDECREF(__pyx_v_base); __Pyx_XDECREF(__pyx_v_length); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":501 * cdef public object length * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.ops != NULL: * SDL_RWclose(self.ops) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_1__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl___dealloc__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl___dealloc__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { int __pyx_t_1; /* "pygame_sdl2/rwobject.pyx":502 * * def __dealloc__(self): * if self.ops != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(self.ops) * self.ops = NULL */ __pyx_t_1 = (__pyx_v_self->ops != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":503 * def __dealloc__(self): * if self.ops != NULL: * SDL_RWclose(self.ops) # <<<<<<<<<<<<<< * self.ops = NULL * */ (void)(SDL_RWclose(__pyx_v_self->ops)); /* "pygame_sdl2/rwobject.pyx":504 * if self.ops != NULL: * SDL_RWclose(self.ops) * self.ops = NULL # <<<<<<<<<<<<<< * * def __init__(self, filelike, mode="rb", base=None, length=None, name=None): */ __pyx_v_self->ops = NULL; /* "pygame_sdl2/rwobject.pyx":502 * * def __dealloc__(self): * if self.ops != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(self.ops) * self.ops = NULL */ } /* "pygame_sdl2/rwobject.pyx":501 * cdef public object length * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.ops != NULL: * SDL_RWclose(self.ops) */ /* function exit code */ } /* "pygame_sdl2/rwobject.pyx":506 * self.ops = NULL * * def __init__(self, filelike, mode="rb", base=None, length=None, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object. All parameter are passed to to_rwops */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__, "\n Creates a new RWopsIO object. All parameter are passed to to_rwops\n to create the SDL_RWops object.\n "); #if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__; #endif static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filelike = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_base = 0; PyObject *__pyx_v_length = 0; PyObject *__pyx_v_name = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filelike,&__pyx_n_s_mode,&__pyx_n_s_base,&__pyx_n_s_length,&__pyx_n_s_name,0}; values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_s_rb)); values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filelike)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_base); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name); if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 506, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_filelike = values[0]; __pyx_v_mode = values[1]; __pyx_v_base = values[2]; __pyx_v_length = values[3]; __pyx_v_name = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 506, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), __pyx_v_filelike, __pyx_v_mode, __pyx_v_base, __pyx_v_length, __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_filelike, PyObject *__pyx_v_mode, PyObject *__pyx_v_base, PyObject *__pyx_v_length, PyObject *__pyx_v_name) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; SDL_RWops *__pyx_t_3; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/rwobject.pyx":512 * """ * * if name is not None: # <<<<<<<<<<<<<< * self.name = name * elif isinstance(filelike, basestring): */ __pyx_t_1 = (__pyx_v_name != Py_None); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":513 * * if name is not None: * self.name = name # <<<<<<<<<<<<<< * elif isinstance(filelike, basestring): * self.name = filelike */ __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_name; /* "pygame_sdl2/rwobject.pyx":512 * """ * * if name is not None: # <<<<<<<<<<<<<< * self.name = name * elif isinstance(filelike, basestring): */ goto __pyx_L3; } /* "pygame_sdl2/rwobject.pyx":514 * if name is not None: * self.name = name * elif isinstance(filelike, basestring): # <<<<<<<<<<<<<< * self.name = filelike * else: */ __pyx_t_1 = __Pyx_PyBaseString_Check(__pyx_v_filelike); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":515 * self.name = name * elif isinstance(filelike, basestring): * self.name = filelike # <<<<<<<<<<<<<< * else: * self.name = getattr(filelike, "name", name) */ __Pyx_INCREF(__pyx_v_filelike); __Pyx_GIVEREF(__pyx_v_filelike); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_filelike; /* "pygame_sdl2/rwobject.pyx":514 * if name is not None: * self.name = name * elif isinstance(filelike, basestring): # <<<<<<<<<<<<<< * self.name = filelike * else: */ goto __pyx_L3; } /* "pygame_sdl2/rwobject.pyx":517 * self.name = filelike * else: * self.name = getattr(filelike, "name", name) # <<<<<<<<<<<<<< * * self.base = base */ /*else*/ { __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_filelike, __pyx_n_s_name, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L3:; /* "pygame_sdl2/rwobject.pyx":519 * self.name = getattr(filelike, "name", name) * * self.base = base # <<<<<<<<<<<<<< * self.length = length * */ __Pyx_INCREF(__pyx_v_base); __Pyx_GIVEREF(__pyx_v_base); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = __pyx_v_base; /* "pygame_sdl2/rwobject.pyx":520 * * self.base = base * self.length = length # <<<<<<<<<<<<<< * * if filelike is not None: */ __Pyx_INCREF(__pyx_v_length); __Pyx_GIVEREF(__pyx_v_length); __Pyx_GOTREF(__pyx_v_self->length); __Pyx_DECREF(__pyx_v_self->length); __pyx_v_self->length = __pyx_v_length; /* "pygame_sdl2/rwobject.pyx":522 * self.length = length * * if filelike is not None: # <<<<<<<<<<<<<< * self.ops = to_rwops(filelike, mode, base, length) * else: */ __pyx_t_1 = (__pyx_v_filelike != Py_None); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":523 * * if filelike is not None: * self.ops = to_rwops(filelike, mode, base, length) # <<<<<<<<<<<<<< * else: * self.ops = NULL */ __pyx_t_4.__pyx_n = 3; __pyx_t_4.mode = __pyx_v_mode; __pyx_t_4.base = __pyx_v_base; __pyx_t_4.length = __pyx_v_length; __pyx_t_3 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filelike, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 523, __pyx_L1_error) __pyx_v_self->ops = __pyx_t_3; /* "pygame_sdl2/rwobject.pyx":522 * self.length = length * * if filelike is not None: # <<<<<<<<<<<<<< * self.ops = to_rwops(filelike, mode, base, length) * else: */ goto __pyx_L4; } /* "pygame_sdl2/rwobject.pyx":525 * self.ops = to_rwops(filelike, mode, base, length) * else: * self.ops = NULL # <<<<<<<<<<<<<< * * def close(self): */ /*else*/ { __pyx_v_self->ops = NULL; } __pyx_L4:; /* "pygame_sdl2/rwobject.pyx":506 * self.ops = NULL * * def __init__(self, filelike, mode="rb", base=None, length=None, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object. All parameter are passed to to_rwops */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":527 * self.ops = NULL * * def close(self): # <<<<<<<<<<<<<< * * # A closed file may be closed again. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_5close(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_4close, "RWopsIOImpl.close(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_5close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_5close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_4close}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_5close(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("close", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "close", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4close(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4close(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("close", 1); /* "pygame_sdl2/rwobject.pyx":531 * # A closed file may be closed again. * * if self.ops: # <<<<<<<<<<<<<< * SDL_RWclose(self.ops) * self.ops = NULL */ __pyx_t_1 = (__pyx_v_self->ops != 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":532 * * if self.ops: * SDL_RWclose(self.ops) # <<<<<<<<<<<<<< * self.ops = NULL * */ (void)(SDL_RWclose(__pyx_v_self->ops)); /* "pygame_sdl2/rwobject.pyx":533 * if self.ops: * SDL_RWclose(self.ops) * self.ops = NULL # <<<<<<<<<<<<<< * * def is_closed(self): */ __pyx_v_self->ops = NULL; /* "pygame_sdl2/rwobject.pyx":531 * # A closed file may be closed again. * * if self.ops: # <<<<<<<<<<<<<< * SDL_RWclose(self.ops) * self.ops = NULL */ } /* "pygame_sdl2/rwobject.pyx":527 * self.ops = NULL * * def close(self): # <<<<<<<<<<<<<< * * # A closed file may be closed again. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":535 * self.ops = NULL * * def is_closed(self): # <<<<<<<<<<<<<< * return not self.ops * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_7is_closed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_6is_closed, "RWopsIOImpl.is_closed(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_7is_closed = {"is_closed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_7is_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_6is_closed}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_7is_closed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_closed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_closed", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_closed", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6is_closed(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6is_closed(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_closed", 1); /* "pygame_sdl2/rwobject.pyx":536 * * def is_closed(self): * return not self.ops # <<<<<<<<<<<<<< * * def seek(self, long long offset, whence=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((!(__pyx_v_self->ops != 0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":535 * self.ops = NULL * * def is_closed(self): # <<<<<<<<<<<<<< * return not self.ops * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.is_closed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":538 * return not self.ops * * def seek(self, long long offset, whence=0): # <<<<<<<<<<<<<< * cdef int whence_rw * cdef long long rv */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_9seek(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_8seek, "RWopsIOImpl.seek(self, long long offset, whence=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_9seek = {"seek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_9seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_8seek}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_9seek(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PY_LONG_LONG __pyx_v_offset; PyObject *__pyx_v_whence = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_whence,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 538, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_whence); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 538, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "seek") < 0)) __PYX_ERR(0, 538, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_offset = __Pyx_PyInt_As_PY_LONG_LONG(values[0]); if (unlikely((__pyx_v_offset == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 538, __pyx_L3_error) __pyx_v_whence = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 538, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.seek", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_8seek(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), __pyx_v_offset, __pyx_v_whence); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_8seek(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PY_LONG_LONG __pyx_v_offset, PyObject *__pyx_v_whence) { int __pyx_v_whence_rw; PY_LONG_LONG __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("seek", 1); /* "pygame_sdl2/rwobject.pyx":542 * cdef long long rv * * if not self.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O operation on closed file.") * */ __pyx_t_1 = (!(__pyx_v_self->ops != 0)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":543 * * if not self.ops: * raise ValueError("I/O operation on closed file.") # <<<<<<<<<<<<<< * * whence_rw = whence_mapping.get(whence, RW_SEEK_SET) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 543, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":542 * cdef long long rv * * if not self.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O operation on closed file.") * */ } /* "pygame_sdl2/rwobject.pyx":545 * raise ValueError("I/O operation on closed file.") * * whence_rw = whence_mapping.get(whence, RW_SEEK_SET) # <<<<<<<<<<<<<< * * with nogil: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_whence_mapping); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(RW_SEEK_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_whence, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_whence_rw = __pyx_t_6; /* "pygame_sdl2/rwobject.pyx":547 * whence_rw = whence_mapping.get(whence, RW_SEEK_SET) * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWseek(self.ops, offset, whence_rw) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":548 * * with nogil: * rv = SDL_RWseek(self.ops, offset, whence_rw) # <<<<<<<<<<<<<< * * if rv < 0: */ __pyx_v_rv = SDL_RWseek(__pyx_v_self->ops, __pyx_v_offset, __pyx_v_whence_rw); } /* "pygame_sdl2/rwobject.pyx":547 * whence_rw = whence_mapping.get(whence, RW_SEEK_SET) * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWseek(self.ops, offset, whence_rw) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/rwobject.pyx":550 * rv = SDL_RWseek(self.ops, offset, whence_rw) * * if rv < 0: # <<<<<<<<<<<<<< * raise IOError("Could not seek: {}".format(SDL_GetError())) * */ __pyx_t_1 = (__pyx_v_rv < 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":551 * * if rv < 0: * raise IOError("Could not seek: {}".format(SDL_GetError())) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Could_not_seek, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 551, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":550 * rv = SDL_RWseek(self.ops, offset, whence_rw) * * if rv < 0: # <<<<<<<<<<<<<< * raise IOError("Could not seek: {}".format(SDL_GetError())) * */ } /* "pygame_sdl2/rwobject.pyx":553 * raise IOError("Could not seek: {}".format(SDL_GetError())) * * return rv # <<<<<<<<<<<<<< * * def tell(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":538 * return not self.ops * * def seek(self, long long offset, whence=0): # <<<<<<<<<<<<<< * cdef int whence_rw * cdef long long rv */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.seek", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":555 * return rv * * def tell(self): # <<<<<<<<<<<<<< * cdef long long rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_11tell(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_10tell, "RWopsIOImpl.tell(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_11tell = {"tell", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_11tell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_10tell}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_11tell(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tell (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("tell", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "tell", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_10tell(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_10tell(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PY_LONG_LONG __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tell", 1); /* "pygame_sdl2/rwobject.pyx":558 * cdef long long rv * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWtell(self.ops) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":559 * * with nogil: * rv = SDL_RWtell(self.ops) # <<<<<<<<<<<<<< * * return rv */ __pyx_v_rv = SDL_RWtell(__pyx_v_self->ops); } /* "pygame_sdl2/rwobject.pyx":558 * cdef long long rv * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWtell(self.ops) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/rwobject.pyx":561 * rv = SDL_RWtell(self.ops) * * return rv # <<<<<<<<<<<<<< * * def readinto(self, b): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":555 * return rv * * def tell(self): # <<<<<<<<<<<<<< * cdef long long rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.tell", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":563 * return rv * * def readinto(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_13readinto(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_12readinto, "RWopsIOImpl.readinto(self, b)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_13readinto = {"readinto", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_13readinto, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_12readinto}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_13readinto(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("readinto (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 563, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "readinto") < 0)) __PYX_ERR(0, 563, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_b = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("readinto", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 563, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.readinto", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_12readinto(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), __pyx_v_b); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_12readinto(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_b) { Py_buffer __pyx_v_view; PY_LONG_LONG __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("readinto", 1); /* "pygame_sdl2/rwobject.pyx":565 * def readinto(self, b): * cdef Py_buffer view * cdef long long rv = 0 # <<<<<<<<<<<<<< * * if not self.ops: */ __pyx_v_rv = 0; /* "pygame_sdl2/rwobject.pyx":567 * cdef long long rv = 0 * * if not self.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O operation on closed file.") * */ __pyx_t_1 = (!(__pyx_v_self->ops != 0)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":568 * * if not self.ops: * raise ValueError("I/O operation on closed file.") # <<<<<<<<<<<<<< * * if not PyObject_CheckBuffer(b): */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 568, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":567 * cdef long long rv = 0 * * if not self.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O operation on closed file.") * */ } /* "pygame_sdl2/rwobject.pyx":570 * raise ValueError("I/O operation on closed file.") * * if not PyObject_CheckBuffer(b): # <<<<<<<<<<<<<< * raise ValueError("Passed in object does not support buffer protocol") * */ __pyx_t_1 = (!PyObject_CheckBuffer(__pyx_v_b)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":571 * * if not PyObject_CheckBuffer(b): * raise ValueError("Passed in object does not support buffer protocol") # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 571, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":570 * raise ValueError("I/O operation on closed file.") * * if not PyObject_CheckBuffer(b): # <<<<<<<<<<<<<< * raise ValueError("Passed in object does not support buffer protocol") * */ } /* "pygame_sdl2/rwobject.pyx":573 * raise ValueError("Passed in object does not support buffer protocol") * * try: # <<<<<<<<<<<<<< * PyObject_GetBuffer(b, &view, PyBUF_CONTIG) * */ /*try:*/ { /* "pygame_sdl2/rwobject.pyx":574 * * try: * PyObject_GetBuffer(b, &view, PyBUF_CONTIG) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_b, (&__pyx_v_view), PyBUF_CONTIG); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 574, __pyx_L6_error) /* "pygame_sdl2/rwobject.pyx":576 * PyObject_GetBuffer(b, &view, PyBUF_CONTIG) * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWread(self.ops, view.buf, 1, view.len) * finally: */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":577 * * with nogil: * rv = SDL_RWread(self.ops, view.buf, 1, view.len) # <<<<<<<<<<<<<< * finally: * PyBuffer_Release(&view) */ __pyx_v_rv = SDL_RWread(__pyx_v_self->ops, __pyx_v_view.buf, 1, __pyx_v_view.len); } /* "pygame_sdl2/rwobject.pyx":576 * PyObject_GetBuffer(b, &view, PyBUF_CONTIG) * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWread(self.ops, view.buf, 1, view.len) * finally: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } } /* "pygame_sdl2/rwobject.pyx":579 * rv = SDL_RWread(self.ops, view.buf, 1, view.len) * finally: * PyBuffer_Release(&view) # <<<<<<<<<<<<<< * * if rv < 0: */ /*finally:*/ { /*normal exit:*/{ PyBuffer_Release((&__pyx_v_view)); goto __pyx_L7; } __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { PyBuffer_Release((&__pyx_v_view)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; } __pyx_L7:; } /* "pygame_sdl2/rwobject.pyx":581 * PyBuffer_Release(&view) * * if rv < 0: # <<<<<<<<<<<<<< * raise IOError("Could not read: {}".format(SDL_GetError())) * */ __pyx_t_1 = (__pyx_v_rv < 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":582 * * if rv < 0: * raise IOError("Could not read: {}".format(SDL_GetError())) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Could_not_read, __pyx_n_s_format); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_13}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_12, 0, 0, 0); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(0, 582, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":581 * PyBuffer_Release(&view) * * if rv < 0: # <<<<<<<<<<<<<< * raise IOError("Could not read: {}".format(SDL_GetError())) * */ } /* "pygame_sdl2/rwobject.pyx":584 * raise IOError("Could not read: {}".format(SDL_GetError())) * * return rv # <<<<<<<<<<<<<< * * def write(self, b): */ __Pyx_XDECREF(__pyx_r); __pyx_t_12 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_r = __pyx_t_12; __pyx_t_12 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":563 * return rv * * def readinto(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.readinto", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":586 * return rv * * def write(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_15write(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_14write, "RWopsIOImpl.write(self, b)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_15write = {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_15write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_14write}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_15write(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "write") < 0)) __PYX_ERR(0, 586, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_b = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 586, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.write", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_14write(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), __pyx_v_b); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_14write(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_b) { Py_buffer __pyx_v_view; PY_LONG_LONG __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write", 1); /* "pygame_sdl2/rwobject.pyx":588 * def write(self, b): * cdef Py_buffer view * cdef long long rv = 0 # <<<<<<<<<<<<<< * * if not self.ops: */ __pyx_v_rv = 0; /* "pygame_sdl2/rwobject.pyx":590 * cdef long long rv = 0 * * if not self.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O operation on closed file.") * */ __pyx_t_1 = (!(__pyx_v_self->ops != 0)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":591 * * if not self.ops: * raise ValueError("I/O operation on closed file.") # <<<<<<<<<<<<<< * * if not PyObject_CheckBuffer(b): */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 591, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":590 * cdef long long rv = 0 * * if not self.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O operation on closed file.") * */ } /* "pygame_sdl2/rwobject.pyx":593 * raise ValueError("I/O operation on closed file.") * * if not PyObject_CheckBuffer(b): # <<<<<<<<<<<<<< * raise ValueError("Passed in object does not support buffer protocol") * */ __pyx_t_1 = (!PyObject_CheckBuffer(__pyx_v_b)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":594 * * if not PyObject_CheckBuffer(b): * raise ValueError("Passed in object does not support buffer protocol") # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 594, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":593 * raise ValueError("I/O operation on closed file.") * * if not PyObject_CheckBuffer(b): # <<<<<<<<<<<<<< * raise ValueError("Passed in object does not support buffer protocol") * */ } /* "pygame_sdl2/rwobject.pyx":596 * raise ValueError("Passed in object does not support buffer protocol") * * try: # <<<<<<<<<<<<<< * PyObject_GetBuffer(b, &view, PyBUF_CONTIG_RO) * with nogil: */ /*try:*/ { /* "pygame_sdl2/rwobject.pyx":597 * * try: * PyObject_GetBuffer(b, &view, PyBUF_CONTIG_RO) # <<<<<<<<<<<<<< * with nogil: * rv = SDL_RWwrite(self.ops, view.buf, 1, view.len) */ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_b, (&__pyx_v_view), PyBUF_CONTIG_RO); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 597, __pyx_L6_error) /* "pygame_sdl2/rwobject.pyx":598 * try: * PyObject_GetBuffer(b, &view, PyBUF_CONTIG_RO) * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWwrite(self.ops, view.buf, 1, view.len) * finally: */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":599 * PyObject_GetBuffer(b, &view, PyBUF_CONTIG_RO) * with nogil: * rv = SDL_RWwrite(self.ops, view.buf, 1, view.len) # <<<<<<<<<<<<<< * finally: * PyBuffer_Release(&view) */ __pyx_v_rv = SDL_RWwrite(__pyx_v_self->ops, __pyx_v_view.buf, 1, __pyx_v_view.len); } /* "pygame_sdl2/rwobject.pyx":598 * try: * PyObject_GetBuffer(b, &view, PyBUF_CONTIG_RO) * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWwrite(self.ops, view.buf, 1, view.len) * finally: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } } /* "pygame_sdl2/rwobject.pyx":601 * rv = SDL_RWwrite(self.ops, view.buf, 1, view.len) * finally: * PyBuffer_Release(&view) # <<<<<<<<<<<<<< * * if rv < 0: */ /*finally:*/ { /*normal exit:*/{ PyBuffer_Release((&__pyx_v_view)); goto __pyx_L7; } __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { PyBuffer_Release((&__pyx_v_view)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; } __pyx_L7:; } /* "pygame_sdl2/rwobject.pyx":603 * PyBuffer_Release(&view) * * if rv < 0: # <<<<<<<<<<<<<< * raise IOError("Could not write: {}".format(SDL_GetError())) * */ __pyx_t_1 = (__pyx_v_rv < 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":604 * * if rv < 0: * raise IOError("Could not write: {}".format(SDL_GetError())) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Could_not_write, __pyx_n_s_format); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_13}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_12, 0, 0, 0); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(0, 604, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":603 * PyBuffer_Release(&view) * * if rv < 0: # <<<<<<<<<<<<<< * raise IOError("Could not write: {}".format(SDL_GetError())) * */ } /* "pygame_sdl2/rwobject.pyx":606 * raise IOError("Could not write: {}".format(SDL_GetError())) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_12 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_r = __pyx_t_12; __pyx_t_12 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":586 * return rv * * def write(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.write", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":497 * * cdef SDL_RWops *ops * cdef public object name # <<<<<<<<<<<<<< * cdef public object base * cdef public object length */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name___get__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name___get__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->name); __pyx_r = __pyx_v_self->name; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_2__set__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_2__set__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 1); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_5__del__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_4__del__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_4__del__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":498 * cdef SDL_RWops *ops * cdef public object name * cdef public object base # <<<<<<<<<<<<<< * cdef public object length * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base___get__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base___get__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->base); __pyx_r = __pyx_v_self->base; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_2__set__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_2__set__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 1); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_5__del__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_4__del__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_4__del__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":499 * cdef public object name * cdef public object base * cdef public object length # <<<<<<<<<<<<<< * * def __dealloc__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length___get__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length___get__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->length); __pyx_r = __pyx_v_self->length; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_2__set__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_2__set__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 1); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->length); __Pyx_DECREF(__pyx_v_self->length); __pyx_v_self->length = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_5__del__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_4__del__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_4__del__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->length); __Pyx_DECREF(__pyx_v_self->length); __pyx_v_self->length = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_17__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_16__reduce_cython__, "RWopsIOImpl.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_17__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_16__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_17__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_16__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_ops_cannot_be_converted_to, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_19__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_18__setstate_cython__, "RWopsIOImpl.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_19__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_18__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_19__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_18__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_ops_cannot_be_converted_to, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":609 * * * cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: # <<<<<<<<<<<<<< * return to_rwops(filelike, "rb", None, None) * */ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython(PyObject *__pyx_v_filelike) { SDL_RWops *__pyx_r; SDL_RWops *__pyx_t_1; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/rwobject.pyx":610 * * cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: * return to_rwops(filelike, "rb", None, None) # <<<<<<<<<<<<<< * * */ __pyx_t_2.__pyx_n = 3; __pyx_t_2.mode = __pyx_n_s_rb; __pyx_t_2.base = Py_None; __pyx_t_2.length = Py_None; __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filelike, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 610, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":609 * * * cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: # <<<<<<<<<<<<<< * return to_rwops(filelike, "rb", None, None) * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsFromPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":615 * class RWopsIO(io.RawIOBase): * * def __init__(self, filelike, mode='rb', base=None, length=None, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object. All parameter are passed to to_rwops */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO___init__, "RWopsIO.__init__(self, filelike, mode='rb', base=None, length=None, name=None)\n\n Creates a new RWopsIO object. All parameter are passed to to_rwops\n to create the SDL_RWops object.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO___init__}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_filelike = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_base = 0; PyObject *__pyx_v_length = 0; PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filelike,&__pyx_n_s_mode,&__pyx_n_s_base,&__pyx_n_s_length,&__pyx_n_s_name,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_s_rb))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filelike)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 6, 1); __PYX_ERR(0, 615, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_base); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 615, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_filelike = values[1]; __pyx_v_mode = values[2]; __pyx_v_base = values[3]; __pyx_v_length = values[4]; __pyx_v_name = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 6, __pyx_nargs); __PYX_ERR(0, 615, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO___init__(__pyx_self, __pyx_v_self, __pyx_v_filelike, __pyx_v_mode, __pyx_v_base, __pyx_v_length, __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filelike, PyObject *__pyx_v_mode, PyObject *__pyx_v_base, PyObject *__pyx_v_length, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/rwobject.pyx":621 * """ * * io.RawIOBase.__init__(self) # <<<<<<<<<<<<<< * * self.raw = RWopsIOImpl(filelike, mode=mode, base=base, length=length, name=name) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RawIOBase); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":623 * io.RawIOBase.__init__(self) * * self.raw = RWopsIOImpl(filelike, mode=mode, base=base, length=length, name=name) # <<<<<<<<<<<<<< * * self.close = self.raw.close */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_filelike); __Pyx_GIVEREF(__pyx_v_filelike); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filelike)) __PYX_ERR(0, 623, __pyx_L1_error); __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mode, __pyx_v_mode) < 0) __PYX_ERR(0, 623, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_base, __pyx_v_base) < 0) __PYX_ERR(0, 623, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_length, __pyx_v_length) < 0) __PYX_ERR(0, 623, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 623, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_raw, __pyx_t_3) < 0) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":625 * self.raw = RWopsIOImpl(filelike, mode=mode, base=base, length=length, name=name) * * self.close = self.raw.close # <<<<<<<<<<<<<< * self.seek = self.raw.seek * self.tell = self.raw.tell */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":626 * * self.close = self.raw.close * self.seek = self.raw.seek # <<<<<<<<<<<<<< * self.tell = self.raw.tell * self.write = self.raw.write */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_seek); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_seek, __pyx_t_3) < 0) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":627 * self.close = self.raw.close * self.seek = self.raw.seek * self.tell = self.raw.tell # <<<<<<<<<<<<<< * self.write = self.raw.write * self.readinto = self.raw.readinto */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tell); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tell, __pyx_t_2) < 0) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":628 * self.seek = self.raw.seek * self.tell = self.raw.tell * self.write = self.raw.write # <<<<<<<<<<<<<< * self.readinto = self.raw.readinto * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_write, __pyx_t_3) < 0) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":629 * self.tell = self.raw.tell * self.write = self.raw.write * self.readinto = self.raw.readinto # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_readinto); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_readinto, __pyx_t_2) < 0) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":615 * class RWopsIO(io.RawIOBase): * * def __init__(self, filelike, mode='rb', base=None, length=None, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object. All parameter are passed to to_rwops */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":631 * self.readinto = self.raw.readinto * * def __repr__(self): # <<<<<<<<<<<<<< * if self.raw.base is not None: * return "".format(self.raw.name, self.raw.base, self.raw.length) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_3__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_2__repr__, "RWopsIO.__repr__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_3__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_2__repr__}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_3__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 631, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 631, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 631, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_2__repr__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/rwobject.pyx":632 * * def __repr__(self): * if self.raw.base is not None: # <<<<<<<<<<<<<< * return "".format(self.raw.name, self.raw.base, self.raw.length) * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":633 * def __repr__(self): * if self.raw.base is not None: * return "".format(self.raw.name, self.raw.base, self.raw.length) # <<<<<<<<<<<<<< * else: * return "".format(self.raw.name) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_RWopsIO_r_base_r_length_r, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":632 * * def __repr__(self): * if self.raw.base is not None: # <<<<<<<<<<<<<< * return "".format(self.raw.name, self.raw.base, self.raw.length) * else: */ } /* "pygame_sdl2/rwobject.pyx":635 * return "".format(self.raw.name, self.raw.base, self.raw.length) * else: * return "".format(self.raw.name) # <<<<<<<<<<<<<< * * # Implemented class: io.IOBase */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_RWopsIO_r, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/rwobject.pyx":631 * self.readinto = self.raw.readinto * * def __repr__(self): # <<<<<<<<<<<<<< * if self.raw.base is not None: * return "".format(self.raw.name, self.raw.base, self.raw.length) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":641 * # close is taken from RWopsIOImpl. * * @property # <<<<<<<<<<<<<< * def closed(self): * return self.raw.is_closed() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_5closed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_4closed, "RWopsIO.closed(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_5closed = {"closed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_5closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_4closed}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_5closed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("closed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closed") < 0)) __PYX_ERR(0, 641, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("closed", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 641, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.closed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_4closed(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_4closed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("closed", 1); /* "pygame_sdl2/rwobject.pyx":643 * @property * def closed(self): * return self.raw.is_closed() # <<<<<<<<<<<<<< * * def fileno(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_closed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":641 * # close is taken from RWopsIOImpl. * * @property # <<<<<<<<<<<<<< * def closed(self): * return self.raw.is_closed() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.closed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":645 * return self.raw.is_closed() * * def fileno(self): # <<<<<<<<<<<<<< * raise OSError() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_7fileno(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_6fileno, "RWopsIO.fileno(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_7fileno = {"fileno", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_7fileno, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_6fileno}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_7fileno(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fileno (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fileno") < 0)) __PYX_ERR(0, 645, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fileno", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 645, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_6fileno(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_6fileno(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fileno", 1); /* "pygame_sdl2/rwobject.pyx":646 * * def fileno(self): * raise OSError() # <<<<<<<<<<<<<< * * # inherited flush is used */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_OSError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 646, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":645 * return self.raw.is_closed() * * def fileno(self): # <<<<<<<<<<<<<< * raise OSError() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":652 * # inherited isatty is used * * def readable(self): # <<<<<<<<<<<<<< * return True * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_9readable(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_8readable, "RWopsIO.readable(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_9readable = {"readable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_9readable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_8readable}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_9readable(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("readable (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 652, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "readable") < 0)) __PYX_ERR(0, 652, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("readable", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 652, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.readable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_8readable(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_8readable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("readable", 1); /* "pygame_sdl2/rwobject.pyx":653 * * def readable(self): * return True # <<<<<<<<<<<<<< * * # inherited readline is used */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":652 * # inherited isatty is used * * def readable(self): # <<<<<<<<<<<<<< * return True * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":661 * # seek is taken from RWopsIOImpl. * * def seekable(self): # <<<<<<<<<<<<<< * return True * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_11seekable(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_10seekable, "RWopsIO.seekable(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_11seekable = {"seekable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_11seekable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_10seekable}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_11seekable(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seekable (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 661, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "seekable") < 0)) __PYX_ERR(0, 661, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("seekable", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 661, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.seekable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_10seekable(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_10seekable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seekable", 1); /* "pygame_sdl2/rwobject.pyx":662 * * def seekable(self): * return True # <<<<<<<<<<<<<< * * # tell is taken from RWopsIOImpl. */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":661 * # seek is taken from RWopsIOImpl. * * def seekable(self): # <<<<<<<<<<<<<< * return True * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":666 * # tell is taken from RWopsIOImpl. * * def truncate(self, size=None): # <<<<<<<<<<<<<< * raise OSError() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_13truncate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_12truncate, "RWopsIO.truncate(self, size=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_13truncate = {"truncate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_13truncate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_12truncate}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_13truncate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("truncate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_size,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "truncate") < 0)) __PYX_ERR(0, 666, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_size = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("truncate", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 666, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_12truncate(__pyx_self, __pyx_v_self, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_12truncate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("truncate", 1); /* "pygame_sdl2/rwobject.pyx":667 * * def truncate(self, size=None): * raise OSError() # <<<<<<<<<<<<<< * * def writable(self): */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_OSError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 667, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":666 * # tell is taken from RWopsIOImpl. * * def truncate(self, size=None): # <<<<<<<<<<<<<< * raise OSError() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":669 * raise OSError() * * def writable(self): # <<<<<<<<<<<<<< * return True * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_15writable(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_14writable, "RWopsIO.writable(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_15writable = {"writable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_15writable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_14writable}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_15writable(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("writable (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 669, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "writable") < 0)) __PYX_ERR(0, 669, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("writable", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 669, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.writable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_14writable(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_14writable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("writable", 1); /* "pygame_sdl2/rwobject.pyx":670 * * def writable(self): * return True # <<<<<<<<<<<<<< * * # inherited writelines is used */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":669 * raise OSError() * * def writable(self): # <<<<<<<<<<<<<< * return True * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":686 * # write is taken from RWopsIOImpl. * * @staticmethod # <<<<<<<<<<<<<< * def from_buffer(buffer, mode="rb", name=None): * """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_17from_buffer(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_16from_buffer, "RWopsIO.from_buffer(buffer, mode='rb', name=None)\n\n Creates a new RWopsIO object from a buffer.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_17from_buffer = {"from_buffer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_17from_buffer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_16from_buffer}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_17from_buffer(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_buffer = 0; CYTHON_UNUSED PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("from_buffer (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buffer,&__pyx_n_s_mode,&__pyx_n_s_name,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_s_rb))); /* "pygame_sdl2/rwobject.pyx":687 * * @staticmethod * def from_buffer(buffer, mode="rb", name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object from a buffer. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_buffer") < 0)) __PYX_ERR(0, 686, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_buffer = values[0]; __pyx_v_mode = values[1]; __pyx_v_name = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("from_buffer", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 686, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.from_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_16from_buffer(__pyx_self, __pyx_v_buffer, __pyx_v_mode, __pyx_v_name); /* "pygame_sdl2/rwobject.pyx":686 * # write is taken from RWopsIOImpl. * * @staticmethod # <<<<<<<<<<<<<< * def from_buffer(buffer, mode="rb", name=None): * """ */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_16from_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buffer, CYTHON_UNUSED PyObject *__pyx_v_mode, PyObject *__pyx_v_name) { struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *__pyx_v_bf; SDL_RWops *__pyx_v_rw; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; Uint8 *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_buffer", 1); /* "pygame_sdl2/rwobject.pyx":695 * cdef SDL_RWops *rw * * if not PyObject_CheckBuffer(buffer): # <<<<<<<<<<<<<< * raise ValueError("Passed in object does not support buffer protocol") * */ __pyx_t_1 = (!PyObject_CheckBuffer(__pyx_v_buffer)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":696 * * if not PyObject_CheckBuffer(buffer): * raise ValueError("Passed in object does not support buffer protocol") # <<<<<<<<<<<<<< * * bf = calloc(sizeof(BufFile), 1) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 696, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":695 * cdef SDL_RWops *rw * * if not PyObject_CheckBuffer(buffer): # <<<<<<<<<<<<<< * raise ValueError("Passed in object does not support buffer protocol") * */ } /* "pygame_sdl2/rwobject.pyx":698 * raise ValueError("Passed in object does not support buffer protocol") * * bf = calloc(sizeof(BufFile), 1) # <<<<<<<<<<<<<< * if bf == NULL: * raise MemoryError() */ __pyx_v_bf = ((struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *)calloc((sizeof(struct __pyx_t_11pygame_sdl2_8rwobject_BufFile)), 1)); /* "pygame_sdl2/rwobject.pyx":699 * * bf = calloc(sizeof(BufFile), 1) * if bf == NULL: # <<<<<<<<<<<<<< * raise MemoryError() * */ __pyx_t_1 = (__pyx_v_bf == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":700 * bf = calloc(sizeof(BufFile), 1) * if bf == NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * if PyObject_GetBuffer(buffer, &bf.view, PyBUF_CONTIG_RO) < 0: */ PyErr_NoMemory(); __PYX_ERR(0, 700, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":699 * * bf = calloc(sizeof(BufFile), 1) * if bf == NULL: # <<<<<<<<<<<<<< * raise MemoryError() * */ } /* "pygame_sdl2/rwobject.pyx":702 * raise MemoryError() * * if PyObject_GetBuffer(buffer, &bf.view, PyBUF_CONTIG_RO) < 0: # <<<<<<<<<<<<<< * free(bf) * raise ValueError("Could not get buffer.") */ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_buffer, (&__pyx_v_bf->view), PyBUF_CONTIG_RO); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 702, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 < 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":703 * * if PyObject_GetBuffer(buffer, &bf.view, PyBUF_CONTIG_RO) < 0: * free(bf) # <<<<<<<<<<<<<< * raise ValueError("Could not get buffer.") * */ free(__pyx_v_bf); /* "pygame_sdl2/rwobject.pyx":704 * if PyObject_GetBuffer(buffer, &bf.view, PyBUF_CONTIG_RO) < 0: * free(bf) * raise ValueError("Could not get buffer.") # <<<<<<<<<<<<<< * * bf.base = bf.view.buf */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 704, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":702 * raise MemoryError() * * if PyObject_GetBuffer(buffer, &bf.view, PyBUF_CONTIG_RO) < 0: # <<<<<<<<<<<<<< * free(bf) * raise ValueError("Could not get buffer.") */ } /* "pygame_sdl2/rwobject.pyx":706 * raise ValueError("Could not get buffer.") * * bf.base = bf.view.buf # <<<<<<<<<<<<<< * bf.here = bf.base * bf.stop = bf.base + bf.view.len */ __pyx_v_bf->base = ((Uint8 *)__pyx_v_bf->view.buf); /* "pygame_sdl2/rwobject.pyx":707 * * bf.base = bf.view.buf * bf.here = bf.base # <<<<<<<<<<<<<< * bf.stop = bf.base + bf.view.len * */ __pyx_t_4 = __pyx_v_bf->base; __pyx_v_bf->here = __pyx_t_4; /* "pygame_sdl2/rwobject.pyx":708 * bf.base = bf.view.buf * bf.here = bf.base * bf.stop = bf.base + bf.view.len # <<<<<<<<<<<<<< * * rw = SDL_AllocRW() */ __pyx_v_bf->stop = (__pyx_v_bf->base + __pyx_v_bf->view.len); /* "pygame_sdl2/rwobject.pyx":710 * bf.stop = bf.base + bf.view.len * * rw = SDL_AllocRW() # <<<<<<<<<<<<<< * rw.size = buffile_size * rw.seek = buffile_seek */ __pyx_v_rw = SDL_AllocRW(); /* "pygame_sdl2/rwobject.pyx":711 * * rw = SDL_AllocRW() * rw.size = buffile_size # <<<<<<<<<<<<<< * rw.seek = buffile_seek * rw.read = buffile_read */ __pyx_v_rw->size = __pyx_f_11pygame_sdl2_8rwobject_buffile_size; /* "pygame_sdl2/rwobject.pyx":712 * rw = SDL_AllocRW() * rw.size = buffile_size * rw.seek = buffile_seek # <<<<<<<<<<<<<< * rw.read = buffile_read * rw.write = buffile_write */ __pyx_v_rw->seek = __pyx_f_11pygame_sdl2_8rwobject_buffile_seek; /* "pygame_sdl2/rwobject.pyx":713 * rw.size = buffile_size * rw.seek = buffile_seek * rw.read = buffile_read # <<<<<<<<<<<<<< * rw.write = buffile_write * rw.close = buffile_close */ __pyx_v_rw->read = __pyx_f_11pygame_sdl2_8rwobject_buffile_read; /* "pygame_sdl2/rwobject.pyx":714 * rw.seek = buffile_seek * rw.read = buffile_read * rw.write = buffile_write # <<<<<<<<<<<<<< * rw.close = buffile_close * rw.type = 0 */ __pyx_v_rw->write = __pyx_f_11pygame_sdl2_8rwobject_buffile_write; /* "pygame_sdl2/rwobject.pyx":715 * rw.read = buffile_read * rw.write = buffile_write * rw.close = buffile_close # <<<<<<<<<<<<<< * rw.type = 0 * rw.hidden.unknown.data1 = bf */ __pyx_v_rw->close = __pyx_f_11pygame_sdl2_8rwobject_buffile_close; /* "pygame_sdl2/rwobject.pyx":716 * rw.write = buffile_write * rw.close = buffile_close * rw.type = 0 # <<<<<<<<<<<<<< * rw.hidden.unknown.data1 = bf * */ __pyx_v_rw->type = 0; /* "pygame_sdl2/rwobject.pyx":717 * rw.close = buffile_close * rw.type = 0 * rw.hidden.unknown.data1 = bf # <<<<<<<<<<<<<< * * rv = RWopsIO(None, name=name) */ __pyx_v_rw->hidden.unknown.data1 = ((void *)__pyx_v_bf); /* "pygame_sdl2/rwobject.pyx":719 * rw.hidden.unknown.data1 = bf * * rv = RWopsIO(None, name=name) # <<<<<<<<<<<<<< * ( rv.raw).ops = rw * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RWopsIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 719, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_rv = __pyx_t_6; __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":720 * * rv = RWopsIO(None, name=name) * ( rv.raw).ops = rw # <<<<<<<<<<<<<< * return rv * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rv, __pyx_n_s_raw); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); ((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_t_6)->ops = __pyx_v_rw; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":721 * rv = RWopsIO(None, name=name) * ( rv.raw).ops = rw * return rv # <<<<<<<<<<<<<< * * @staticmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":686 * # write is taken from RWopsIOImpl. * * @staticmethod # <<<<<<<<<<<<<< * def from_buffer(buffer, mode="rb", name=None): * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.from_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":723 * return rv * * @staticmethod # <<<<<<<<<<<<<< * def from_split(a, b, name=None): * """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_19from_split(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_18from_split, "RWopsIO.from_split(a, b, name=None)\n\n Creates a new RWopsIO object from two other RWopsIO objects,\n representing the concatenation of the two.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_19from_split = {"from_split", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_19from_split, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_18from_split}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_19from_split(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_a = 0; PyObject *__pyx_v_b = 0; PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("from_split (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_name,0}; /* "pygame_sdl2/rwobject.pyx":724 * * @staticmethod * def from_split(a, b, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object from two other RWopsIO objects, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("from_split", 0, 2, 3, 1); __PYX_ERR(0, 723, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_split") < 0)) __PYX_ERR(0, 723, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_a = values[0]; __pyx_v_b = values[1]; __pyx_v_name = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("from_split", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 723, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.from_split", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_18from_split(__pyx_self, __pyx_v_a, __pyx_v_b, __pyx_v_name); /* "pygame_sdl2/rwobject.pyx":723 * return rv * * @staticmethod # <<<<<<<<<<<<<< * def from_split(a, b, name=None): * """ */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_18from_split(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_name) { struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *__pyx_v_sf; SDL_RWops *__pyx_v_rw; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; SDL_RWops *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_split", 1); /* "pygame_sdl2/rwobject.pyx":733 * cdef SDL_RWops *rw * * sf = calloc(sizeof(SplitFile), 1) # <<<<<<<<<<<<<< * if sf == NULL: * raise MemoryError() */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *)calloc((sizeof(struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile)), 1)); /* "pygame_sdl2/rwobject.pyx":734 * * sf = calloc(sizeof(SplitFile), 1) * if sf == NULL: # <<<<<<<<<<<<<< * raise MemoryError() * */ __pyx_t_1 = (__pyx_v_sf == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":735 * sf = calloc(sizeof(SplitFile), 1) * if sf == NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * sf.a = to_rwops(a) */ PyErr_NoMemory(); __PYX_ERR(0, 735, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":734 * * sf = calloc(sizeof(SplitFile), 1) * if sf == NULL: # <<<<<<<<<<<<<< * raise MemoryError() * */ } /* "pygame_sdl2/rwobject.pyx":737 * raise MemoryError() * * sf.a = to_rwops(a) # <<<<<<<<<<<<<< * sf.b = to_rwops(b) * sf.split = SDL_RWsize(sf.a) */ __pyx_t_2 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_a, NULL); if (unlikely(__pyx_t_2 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 737, __pyx_L1_error) __pyx_v_sf->a = __pyx_t_2; /* "pygame_sdl2/rwobject.pyx":738 * * sf.a = to_rwops(a) * sf.b = to_rwops(b) # <<<<<<<<<<<<<< * sf.split = SDL_RWsize(sf.a) * sf.tell = 0 */ __pyx_t_2 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_b, NULL); if (unlikely(__pyx_t_2 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 738, __pyx_L1_error) __pyx_v_sf->b = __pyx_t_2; /* "pygame_sdl2/rwobject.pyx":739 * sf.a = to_rwops(a) * sf.b = to_rwops(b) * sf.split = SDL_RWsize(sf.a) # <<<<<<<<<<<<<< * sf.tell = 0 * */ __pyx_v_sf->split = SDL_RWsize(__pyx_v_sf->a); /* "pygame_sdl2/rwobject.pyx":740 * sf.b = to_rwops(b) * sf.split = SDL_RWsize(sf.a) * sf.tell = 0 # <<<<<<<<<<<<<< * * rw = SDL_AllocRW() */ __pyx_v_sf->tell = 0; /* "pygame_sdl2/rwobject.pyx":742 * sf.tell = 0 * * rw = SDL_AllocRW() # <<<<<<<<<<<<<< * rw.size = splitfile_size * rw.seek = splitfile_seek */ __pyx_v_rw = SDL_AllocRW(); /* "pygame_sdl2/rwobject.pyx":743 * * rw = SDL_AllocRW() * rw.size = splitfile_size # <<<<<<<<<<<<<< * rw.seek = splitfile_seek * rw.read = splitfile_read */ __pyx_v_rw->size = __pyx_f_11pygame_sdl2_8rwobject_splitfile_size; /* "pygame_sdl2/rwobject.pyx":744 * rw = SDL_AllocRW() * rw.size = splitfile_size * rw.seek = splitfile_seek # <<<<<<<<<<<<<< * rw.read = splitfile_read * rw.write = NULL */ __pyx_v_rw->seek = __pyx_f_11pygame_sdl2_8rwobject_splitfile_seek; /* "pygame_sdl2/rwobject.pyx":745 * rw.size = splitfile_size * rw.seek = splitfile_seek * rw.read = splitfile_read # <<<<<<<<<<<<<< * rw.write = NULL * rw.close = splitfile_close */ __pyx_v_rw->read = __pyx_f_11pygame_sdl2_8rwobject_splitfile_read; /* "pygame_sdl2/rwobject.pyx":746 * rw.seek = splitfile_seek * rw.read = splitfile_read * rw.write = NULL # <<<<<<<<<<<<<< * rw.close = splitfile_close * rw.type = 0 */ __pyx_v_rw->write = NULL; /* "pygame_sdl2/rwobject.pyx":747 * rw.read = splitfile_read * rw.write = NULL * rw.close = splitfile_close # <<<<<<<<<<<<<< * rw.type = 0 * rw.hidden.unknown.data1 = sf */ __pyx_v_rw->close = __pyx_f_11pygame_sdl2_8rwobject_splitfile_close; /* "pygame_sdl2/rwobject.pyx":748 * rw.write = NULL * rw.close = splitfile_close * rw.type = 0 # <<<<<<<<<<<<<< * rw.hidden.unknown.data1 = sf * */ __pyx_v_rw->type = 0; /* "pygame_sdl2/rwobject.pyx":749 * rw.close = splitfile_close * rw.type = 0 * rw.hidden.unknown.data1 = sf # <<<<<<<<<<<<<< * * rv = RWopsIO(None, name=name) */ __pyx_v_rw->hidden.unknown.data1 = ((void *)__pyx_v_sf); /* "pygame_sdl2/rwobject.pyx":751 * rw.hidden.unknown.data1 = sf * * rv = RWopsIO(None, name=name) # <<<<<<<<<<<<<< * ( rv.raw).ops = rw * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RWopsIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 751, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_rv = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":752 * * rv = RWopsIO(None, name=name) * ( rv.raw).ops = rw # <<<<<<<<<<<<<< * return rv * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rv, __pyx_n_s_raw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); ((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_t_5)->ops = __pyx_v_rw; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":753 * rv = RWopsIO(None, name=name) * ( rv.raw).ops = rw * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":723 * return rv * * @staticmethod # <<<<<<<<<<<<<< * def from_split(a, b, name=None): * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.from_split", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_8rwobject_RWopsIOImpl(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)o); p->name = Py_None; Py_INCREF(Py_None); p->base = Py_None; Py_INCREF(Py_None); p->length = Py_None; Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_8rwobject_RWopsIOImpl(PyObject *o) { struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *p = (struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_8rwobject_RWopsIOImpl) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_1__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->name); Py_CLEAR(p->base); Py_CLEAR(p->length); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_8rwobject_RWopsIOImpl(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *p = (struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)o; if (p->name) { e = (*v)(p->name, a); if (e) return e; } if (p->base) { e = (*v)(p->base, a); if (e) return e; } if (p->length) { e = (*v)(p->length, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_8rwobject_RWopsIOImpl(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *p = (struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)o; tmp = ((PyObject*)p->name); p->name = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->base); p->base = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->length); p->length = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_3__set__(o, v); } else { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_5__del__(o); } } static PyObject *__pyx_getprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_base(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_base(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_3__set__(o, v); } else { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_5__del__(o); } } static PyObject *__pyx_getprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_length(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_length(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_3__set__(o, v); } else { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_5__del__(o); } } static PyMethodDef __pyx_methods_11pygame_sdl2_8rwobject_RWopsIOImpl[] = { {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_5close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_4close}, {"is_closed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_7is_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_6is_closed}, {"seek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_9seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_8seek}, {"tell", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_11tell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_10tell}, {"readinto", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_13readinto, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_12readinto}, {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_15write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_14write}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_16__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_18__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_8rwobject_RWopsIOImpl[] = { {(char *)"name", __pyx_getprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_name, __pyx_setprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_name, (char *)PyDoc_STR("name: object"), 0}, {(char *)"base", __pyx_getprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_base, __pyx_setprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_base, (char *)PyDoc_STR("base: object"), 0}, {(char *)"length", __pyx_getprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_length, __pyx_setprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_length, (char *)PyDoc_STR("length: object"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_8rwobject_RWopsIOImpl}, {Py_tp_doc, (void *)PyDoc_STR("RWopsIOImpl(filelike, mode='rb', base=None, length=None, name=None)\n\n This wraps an SDL_RWops object in a Python file-like object.\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_8rwobject_RWopsIOImpl}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_8rwobject_RWopsIOImpl}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_8rwobject_RWopsIOImpl}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_8rwobject_RWopsIOImpl}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_3__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_8rwobject_RWopsIOImpl}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl_spec = { "pygame_sdl2.rwobject.RWopsIOImpl", sizeof(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.rwobject.""RWopsIOImpl", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_8rwobject_RWopsIOImpl, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("RWopsIOImpl(filelike, mode='rb', base=None, length=None, name=None)\n\n This wraps an SDL_RWops object in a Python file-like object.\n "), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_8rwobject_RWopsIOImpl, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_8rwobject_RWopsIOImpl, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_8rwobject_RWopsIOImpl, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_8rwobject_RWopsIOImpl, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_8rwobject_RWopsIOImpl, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_kp_s_Could_not_get_buffer, __pyx_k_Could_not_get_buffer, sizeof(__pyx_k_Could_not_get_buffer), 0, 0, 1, 0}, {&__pyx_kp_s_Could_not_open_r, __pyx_k_Could_not_open_r, sizeof(__pyx_k_Could_not_open_r), 0, 0, 1, 0}, {&__pyx_kp_s_Could_not_read, __pyx_k_Could_not_read, sizeof(__pyx_k_Could_not_read), 0, 0, 1, 0}, {&__pyx_kp_s_Could_not_seek, __pyx_k_Could_not_seek, sizeof(__pyx_k_Could_not_seek), 0, 0, 1, 0}, {&__pyx_kp_s_Could_not_write, __pyx_k_Could_not_write, sizeof(__pyx_k_Could_not_write), 0, 0, 1, 0}, {&__pyx_n_s_IOBase, __pyx_k_IOBase, sizeof(__pyx_k_IOBase), 0, 0, 1, 1}, {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, {&__pyx_kp_s_I_O_on_closed_file, __pyx_k_I_O_on_closed_file, sizeof(__pyx_k_I_O_on_closed_file), 0, 0, 1, 0}, {&__pyx_kp_s_I_O_operation_on_closed_file, __pyx_k_I_O_operation_on_closed_file, sizeof(__pyx_k_I_O_operation_on_closed_file), 0, 0, 1, 0}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1}, {&__pyx_kp_s_Passed_in_object_does_not_suppor, __pyx_k_Passed_in_object_does_not_suppor, sizeof(__pyx_k_Passed_in_object_does_not_suppor), 0, 0, 1, 0}, {&__pyx_n_s_RWopsIO, __pyx_k_RWopsIO, sizeof(__pyx_k_RWopsIO), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl, __pyx_k_RWopsIOImpl, sizeof(__pyx_k_RWopsIOImpl), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl___reduce_cython, __pyx_k_RWopsIOImpl___reduce_cython, sizeof(__pyx_k_RWopsIOImpl___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl___setstate_cython, __pyx_k_RWopsIOImpl___setstate_cython, sizeof(__pyx_k_RWopsIOImpl___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl_close, __pyx_k_RWopsIOImpl_close, sizeof(__pyx_k_RWopsIOImpl_close), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl_is_closed, __pyx_k_RWopsIOImpl_is_closed, sizeof(__pyx_k_RWopsIOImpl_is_closed), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl_readinto, __pyx_k_RWopsIOImpl_readinto, sizeof(__pyx_k_RWopsIOImpl_readinto), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl_seek, __pyx_k_RWopsIOImpl_seek, sizeof(__pyx_k_RWopsIOImpl_seek), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl_tell, __pyx_k_RWopsIOImpl_tell, sizeof(__pyx_k_RWopsIOImpl_tell), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl_write, __pyx_k_RWopsIOImpl_write, sizeof(__pyx_k_RWopsIOImpl_write), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO___init, __pyx_k_RWopsIO___init, sizeof(__pyx_k_RWopsIO___init), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO___repr, __pyx_k_RWopsIO___repr, sizeof(__pyx_k_RWopsIO___repr), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_closed, __pyx_k_RWopsIO_closed, sizeof(__pyx_k_RWopsIO_closed), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_fileno, __pyx_k_RWopsIO_fileno, sizeof(__pyx_k_RWopsIO_fileno), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_from_buffer, __pyx_k_RWopsIO_from_buffer, sizeof(__pyx_k_RWopsIO_from_buffer), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_from_split, __pyx_k_RWopsIO_from_split, sizeof(__pyx_k_RWopsIO_from_split), 0, 0, 1, 1}, {&__pyx_kp_s_RWopsIO_r, __pyx_k_RWopsIO_r, sizeof(__pyx_k_RWopsIO_r), 0, 0, 1, 0}, {&__pyx_kp_s_RWopsIO_r_base_r_length_r, __pyx_k_RWopsIO_r_base_r_length_r, sizeof(__pyx_k_RWopsIO_r_base_r_length_r), 0, 0, 1, 0}, {&__pyx_n_s_RWopsIO_readable, __pyx_k_RWopsIO_readable, sizeof(__pyx_k_RWopsIO_readable), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_seekable, __pyx_k_RWopsIO_seekable, sizeof(__pyx_k_RWopsIO_seekable), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_truncate, __pyx_k_RWopsIO_truncate, sizeof(__pyx_k_RWopsIO_truncate), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_writable, __pyx_k_RWopsIO_writable, sizeof(__pyx_k_RWopsIO_writable), 0, 0, 1, 1}, {&__pyx_n_s_RawIOBase, __pyx_k_RawIOBase, sizeof(__pyx_k_RawIOBase), 0, 0, 1, 1}, {&__pyx_n_s_SEEK_CUR, __pyx_k_SEEK_CUR, sizeof(__pyx_k_SEEK_CUR), 0, 0, 1, 1}, {&__pyx_n_s_SEEK_END, __pyx_k_SEEK_END, sizeof(__pyx_k_SEEK_END), 0, 0, 1, 1}, {&__pyx_n_s_SEEK_SET, __pyx_k_SEEK_SET, sizeof(__pyx_k_SEEK_SET), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_s_Unknown_value_for_whence, __pyx_k_Unknown_value_for_whence, sizeof(__pyx_k_Unknown_value_for_whence), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 0, 1, 1}, {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, {&__pyx_n_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 1}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_s_bf, __pyx_k_bf, sizeof(__pyx_k_bf), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_file_type, __pyx_k_file_type, sizeof(__pyx_k_file_type), 0, 0, 1, 1}, {&__pyx_n_s_filelike, __pyx_k_filelike, sizeof(__pyx_k_filelike), 0, 0, 1, 1}, {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_from_buffer, __pyx_k_from_buffer, sizeof(__pyx_k_from_buffer), 0, 0, 1, 1}, {&__pyx_n_s_from_split, __pyx_k_from_split, sizeof(__pyx_k_from_split), 0, 0, 1, 1}, {&__pyx_n_s_fsencoding, __pyx_k_fsencoding, sizeof(__pyx_k_fsencoding), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1}, {&__pyx_n_s_is_closed, __pyx_k_is_closed, sizeof(__pyx_k_is_closed), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_compat, __pyx_k_pygame_sdl2_compat, sizeof(__pyx_k_pygame_sdl2_compat), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rwobject, __pyx_k_pygame_sdl2_rwobject, sizeof(__pyx_k_pygame_sdl2_rwobject), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_kp_s_r_is_not_a_filename_or_file_lik, __pyx_k_r_is_not_a_filename_or_file_lik, sizeof(__pyx_k_r_is_not_a_filename_or_file_lik), 0, 0, 1, 0}, {&__pyx_n_s_raw, __pyx_k_raw, sizeof(__pyx_k_raw), 0, 0, 1, 1}, {&__pyx_n_b_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 0, 1}, {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1}, {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, {&__pyx_n_s_readable, __pyx_k_readable, sizeof(__pyx_k_readable), 0, 0, 1, 1}, {&__pyx_n_s_readinto, __pyx_k_readinto, sizeof(__pyx_k_readinto), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_rw, __pyx_k_rw, sizeof(__pyx_k_rw), 0, 0, 1, 1}, {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1}, {&__pyx_n_s_seekable, __pyx_k_seekable, sizeof(__pyx_k_seekable), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_kp_s_self_ops_cannot_be_converted_to, __pyx_k_self_ops_cannot_be_converted_to, sizeof(__pyx_k_self_ops_cannot_be_converted_to), 0, 0, 1, 0}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_sf, __pyx_k_sf, sizeof(__pyx_k_sf), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_k_src_pygame_sdl2_rwobject_pyx, sizeof(__pyx_k_src_pygame_sdl2_rwobject_pyx), 0, 0, 1, 0}, {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1}, {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, {&__pyx_n_s_whence, __pyx_k_whence, sizeof(__pyx_k_whence), 0, 0, 1, 1}, {&__pyx_n_s_whence_mapping, __pyx_k_whence_mapping, sizeof(__pyx_k_whence_mapping), 0, 0, 1, 1}, {&__pyx_n_s_whence_rw, __pyx_k_whence_rw, sizeof(__pyx_k_whence_rw), 0, 0, 1, 1}, {&__pyx_n_s_writable, __pyx_k_writable, sizeof(__pyx_k_writable), 0, 0, 1, 1}, {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 641, __pyx_L1_error) __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 686, __pyx_L1_error) __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 395, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 401, __pyx_L1_error) __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 428, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 646, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 700, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/rwobject.pyx":71 * try: * cur = f.tell() * f.seek(0, 2) # <<<<<<<<<<<<<< * rv = f.tell() * f.seek(cur, 0) */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_0, __pyx_int_2); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/rwobject.pyx":401 * rwopsio = filelike * if not rwopsio.ops: * raise ValueError("I/O on closed file.") # <<<<<<<<<<<<<< * * rv = rwopsio.ops */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_I_O_on_closed_file); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/rwobject.pyx":543 * * if not self.ops: * raise ValueError("I/O operation on closed file.") # <<<<<<<<<<<<<< * * whence_rw = whence_mapping.get(whence, RW_SEEK_SET) */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/rwobject.pyx":571 * * if not PyObject_CheckBuffer(b): * raise ValueError("Passed in object does not support buffer protocol") # <<<<<<<<<<<<<< * * try: */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Passed_in_object_does_not_suppor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/rwobject.pyx":704 * if PyObject_GetBuffer(buffer, &bf.view, PyBUF_CONTIG_RO) < 0: * free(bf) * raise ValueError("Could not get buffer.") # <<<<<<<<<<<<<< * * bf.base = bf.view.buf */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Could_not_get_buffer); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/rwobject.pyx":719 * rw.hidden.unknown.data1 = bf * * rv = RWopsIO(None, name=name) # <<<<<<<<<<<<<< * ( rv.raw).ops = rw * return rv */ __pyx_tuple__6 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/rwobject.pyx":527 * self.ops = NULL * * def close(self): # <<<<<<<<<<<<<< * * # A closed file may be closed again. */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_close, 527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 527, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":535 * self.ops = NULL * * def is_closed(self): # <<<<<<<<<<<<<< * return not self.ops * */ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_is_closed, 535, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 535, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":538 * return not self.ops * * def seek(self, long long offset, whence=0): # <<<<<<<<<<<<<< * cdef int whence_rw * cdef long long rv */ __pyx_tuple__12 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_offset, __pyx_n_s_whence, __pyx_n_s_whence_rw, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_seek, 538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 538, __pyx_L1_error) __pyx_tuple__14 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "pygame_sdl2/rwobject.pyx":555 * return rv * * def tell(self): # <<<<<<<<<<<<<< * cdef long long rv * */ __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_tell, 555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 555, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":563 * return rv * * def readinto(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ __pyx_tuple__17 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_b, __pyx_n_s_view, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_readinto, 563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 563, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":586 * return rv * * def write(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_write, 586, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 586, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" */ __pyx_tuple__21 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 3, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":615 * class RWopsIO(io.RawIOBase): * * def __init__(self, filelike, mode='rb', base=None, length=None, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object. All parameter are passed to to_rwops */ __pyx_tuple__23 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_filelike, __pyx_n_s_mode, __pyx_n_s_base, __pyx_n_s_length, __pyx_n_s_name); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_init, 615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 615, __pyx_L1_error) __pyx_tuple__25 = PyTuple_Pack(4, ((PyObject*)__pyx_n_s_rb), Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "pygame_sdl2/rwobject.pyx":631 * self.readinto = self.raw.readinto * * def __repr__(self): # <<<<<<<<<<<<<< * if self.raw.base is not None: * return "".format(self.raw.name, self.raw.base, self.raw.length) */ __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_repr, 631, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 631, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":641 * # close is taken from RWopsIOImpl. * * @property # <<<<<<<<<<<<<< * def closed(self): * return self.raw.is_closed() */ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_closed, 641, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 641, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":645 * return self.raw.is_closed() * * def fileno(self): # <<<<<<<<<<<<<< * raise OSError() * */ __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_fileno, 645, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 645, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":652 * # inherited isatty is used * * def readable(self): # <<<<<<<<<<<<<< * return True * */ __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_readable, 652, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 652, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":661 * # seek is taken from RWopsIOImpl. * * def seekable(self): # <<<<<<<<<<<<<< * return True * */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_seekable, 661, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 661, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":666 * # tell is taken from RWopsIOImpl. * * def truncate(self, size=None): # <<<<<<<<<<<<<< * raise OSError() * */ __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_size); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_truncate, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 666, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":669 * raise OSError() * * def writable(self): # <<<<<<<<<<<<<< * return True * */ __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_writable, 669, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 669, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":686 * # write is taken from RWopsIOImpl. * * @staticmethod # <<<<<<<<<<<<<< * def from_buffer(buffer, mode="rb", name=None): * """ */ __pyx_tuple__34 = PyTuple_Pack(6, __pyx_n_s_buffer, __pyx_n_s_mode, __pyx_n_s_name, __pyx_n_s_bf, __pyx_n_s_rw, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_from_buffer, 686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 686, __pyx_L1_error) __pyx_tuple__36 = PyTuple_Pack(2, ((PyObject*)__pyx_n_s_rb), Py_None); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "pygame_sdl2/rwobject.pyx":723 * return rv * * @staticmethod # <<<<<<<<<<<<<< * def from_split(a, b, name=None): * """ */ __pyx_tuple__37 = PyTuple_Pack(6, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_name, __pyx_n_s_sf, __pyx_n_s_rw, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_from_split, 723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("to_rwops", (void (*)(void))__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("RWopsFromPython", (void (*)(void))__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython, "SDL_RWops *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl)) __PYX_ERR(0, 491, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl_spec, __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl) < 0) __PYX_ERR(0, 491, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl = &__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl) < 0) __PYX_ERR(0, 491, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl->tp_dictoffset && __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 491, __pyx_L1_error) if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { __pyx_wrapperbase_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__.doc = __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__; } } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RWopsIOImpl, (PyObject *) __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl) < 0) __PYX_ERR(0, 491, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl) < 0) __PYX_ERR(0, 491, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_8(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyTypeObject), #else sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_rwobject(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_rwobject}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "rwobject", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initrwobject(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initrwobject(void) #else __Pyx_PyMODINIT_FUNC PyInit_rwobject(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_rwobject(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_rwobject(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'rwobject' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("rwobject", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "rwobject" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_rwobject(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__rwobject) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.rwobject")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.rwobject", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/rwobject.pyx":27 * from libc.stdint cimport uintptr_t * * from pygame_sdl2.compat import file_type, bytes_, unicode_ # <<<<<<<<<<<<<< * * import sys */ __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_file_type); __Pyx_GIVEREF(__pyx_n_s_file_type); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_file_type)) __PYX_ERR(0, 27, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_bytes); __Pyx_GIVEREF(__pyx_n_s_bytes); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_bytes)) __PYX_ERR(0, 27, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_unicode); __Pyx_GIVEREF(__pyx_n_s_unicode); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_unicode)) __PYX_ERR(0, 27, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_file_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_type, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":29 * from pygame_sdl2.compat import file_type, bytes_, unicode_ * * import sys # <<<<<<<<<<<<<< * import io * */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_3) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":30 * * import sys * import io # <<<<<<<<<<<<<< * * # The fsencoding. */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_io, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_io, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":33 * * # The fsencoding. * fsencoding = sys.getfilesystemencoding() or "utf-8" # <<<<<<<<<<<<<< * * cdef extern from "SDL.h" nogil: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 33, __pyx_L1_error) if (!__pyx_t_5) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L2_bool_binop_done; } __Pyx_INCREF(__pyx_kp_s_utf_8); __pyx_t_3 = __pyx_kp_s_utf_8; __pyx_L2_bool_binop_done:; if (PyDict_SetItem(__pyx_d, __pyx_n_s_fsencoding, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":486 * * whence_mapping = { * io.SEEK_SET : RW_SEEK_SET, # <<<<<<<<<<<<<< * io.SEEK_CUR : RW_SEEK_CUR, * io.SEEK_END : RW_SEEK_END, */ __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SEEK_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(RW_SEEK_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":487 * whence_mapping = { * io.SEEK_SET : RW_SEEK_SET, * io.SEEK_CUR : RW_SEEK_CUR, # <<<<<<<<<<<<<< * io.SEEK_END : RW_SEEK_END, * } */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SEEK_CUR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(RW_SEEK_CUR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":488 * io.SEEK_SET : RW_SEEK_SET, * io.SEEK_CUR : RW_SEEK_CUR, * io.SEEK_END : RW_SEEK_END, # <<<<<<<<<<<<<< * } * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SEEK_END); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(RW_SEEK_END); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_whence_mapping, __pyx_t_3) < 0) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":527 * self.ops = NULL * * def close(self): # <<<<<<<<<<<<<< * * # A closed file may be closed again. */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_5close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl_close, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, __pyx_n_s_close, __pyx_t_3) < 0) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); /* "pygame_sdl2/rwobject.pyx":535 * self.ops = NULL * * def is_closed(self): # <<<<<<<<<<<<<< * return not self.ops * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_7is_closed, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl_is_closed, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, __pyx_n_s_is_closed, __pyx_t_3) < 0) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); /* "pygame_sdl2/rwobject.pyx":538 * return not self.ops * * def seek(self, long long offset, whence=0): # <<<<<<<<<<<<<< * cdef int whence_rw * cdef long long rv */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_9seek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl_seek, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, __pyx_n_s_seek, __pyx_t_3) < 0) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); /* "pygame_sdl2/rwobject.pyx":555 * return rv * * def tell(self): # <<<<<<<<<<<<<< * cdef long long rv * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_11tell, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl_tell, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, __pyx_n_s_tell, __pyx_t_3) < 0) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); /* "pygame_sdl2/rwobject.pyx":563 * return rv * * def readinto(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_13readinto, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl_readinto, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, __pyx_n_s_readinto, __pyx_t_3) < 0) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); /* "pygame_sdl2/rwobject.pyx":586 * return rv * * def write(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_15write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl_write, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, __pyx_n_s_write, __pyx_t_3) < 0) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":613 * * * class RWopsIO(io.RawIOBase): # <<<<<<<<<<<<<< * * def __init__(self, filelike, mode='rb', base=None, length=None, name=None): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_io); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RawIOBase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_n_s_RWopsIO, __pyx_n_s_RWopsIO, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_rwobject, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2 != __pyx_t_3) { if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 613, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":615 * class RWopsIO(io.RawIOBase): * * def __init__(self, filelike, mode='rb', base=None, length=None, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object. All parameter are passed to to_rwops */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_1__init__, 0, __pyx_n_s_RWopsIO___init, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__25); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":631 * self.readinto = self.raw.readinto * * def __repr__(self): # <<<<<<<<<<<<<< * if self.raw.base is not None: * return "".format(self.raw.name, self.raw.base, self.raw.length) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_3__repr__, 0, __pyx_n_s_RWopsIO___repr, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_repr, __pyx_t_3) < 0) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":641 * # close is taken from RWopsIOImpl. * * @property # <<<<<<<<<<<<<< * def closed(self): * return self.raw.is_closed() */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_5closed, 0, __pyx_n_s_RWopsIO_closed, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_closed, __pyx_t_7) < 0) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":645 * return self.raw.is_closed() * * def fileno(self): # <<<<<<<<<<<<<< * raise OSError() * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_7fileno, 0, __pyx_n_s_RWopsIO_fileno, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fileno, __pyx_t_7) < 0) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":652 * # inherited isatty is used * * def readable(self): # <<<<<<<<<<<<<< * return True * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_9readable, 0, __pyx_n_s_RWopsIO_readable, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_readable, __pyx_t_7) < 0) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":661 * # seek is taken from RWopsIOImpl. * * def seekable(self): # <<<<<<<<<<<<<< * return True * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_11seekable, 0, __pyx_n_s_RWopsIO_seekable, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_seekable, __pyx_t_7) < 0) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":666 * # tell is taken from RWopsIOImpl. * * def truncate(self, size=None): # <<<<<<<<<<<<<< * raise OSError() * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_13truncate, 0, __pyx_n_s_RWopsIO_truncate, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__6); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_truncate, __pyx_t_7) < 0) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":669 * raise OSError() * * def writable(self): # <<<<<<<<<<<<<< * return True * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_15writable, 0, __pyx_n_s_RWopsIO_writable, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_writable, __pyx_t_7) < 0) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":686 * # write is taken from RWopsIOImpl. * * @staticmethod # <<<<<<<<<<<<<< * def from_buffer(buffer, mode="rb", name=None): * """ */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_17from_buffer, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_RWopsIO_from_buffer, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__36); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_from_buffer, __pyx_t_3) < 0) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":723 * return rv * * @staticmethod # <<<<<<<<<<<<<< * def from_split(a, b, name=None): * """ */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_19from_split, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_RWopsIO_from_split, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__6); __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_from_split, __pyx_t_7) < 0) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":613 * * * class RWopsIO(io.RawIOBase): # <<<<<<<<<<<<<< * * def __init__(self, filelike, mode='rb', base=None, length=None, name=None): */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_RWopsIO, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RWopsIO, __pyx_t_7) < 0) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":757 * * * init_python_threads() # <<<<<<<<<<<<<< */ init_python_threads(); /* "pygame_sdl2/rwobject.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.rwobject", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.rwobject"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); else state = (PyGILState_STATE)0; #endif CYTHON_UNUSED_VAR(clineno); CYTHON_UNUSED_VAR(lineno); CYTHON_UNUSED_VAR(filename); CYTHON_MAYBE_UNUSED_VAR(nogil); __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* DivInt[ptrdiff_t] */ static CYTHON_INLINE ptrdiff_t __Pyx_div_ptrdiff_t(ptrdiff_t a, ptrdiff_t b) { ptrdiff_t q = a / b; ptrdiff_t r = a - q*b; q -= ((r != 0) & ((r ^ b) < 0)); return q; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* GetAttr3 */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } #endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { r = __Pyx_NewRef(d); } return r; } #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* HasAttr */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (!r) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } #endif /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_8 #define __PYX_HAVE_RT_ImportType_3_0_8 static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__7); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__8; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PY_LONG_LONG) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PY_LONG_LONG) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) >= 2 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])); } } break; case 3: if ((8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) >= 3 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])); } } break; case 4: if ((8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) >= 4 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PY_LONG_LONG) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PY_LONG_LONG) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case 2: if ((8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { return (PY_LONG_LONG) ((((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case -3: if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case 3: if ((8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { return (PY_LONG_LONG) ((((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case -4: if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case 4: if ((8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) { return (PY_LONG_LONG) ((((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; } } #endif if ((sizeof(PY_LONG_LONG) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { PY_LONG_LONG val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (PY_LONG_LONG) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (PY_LONG_LONG) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PY_LONG_LONG) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (PY_LONG_LONG) -1; } else { stepval = __Pyx_NewRef(v); } val = (PY_LONG_LONG) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(PY_LONG_LONG) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((PY_LONG_LONG) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(PY_LONG_LONG) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((PY_LONG_LONG) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((PY_LONG_LONG) 1) << (sizeof(PY_LONG_LONG) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (PY_LONG_LONG) -1; } } else { PY_LONG_LONG val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PY_LONG_LONG) -1; val = __Pyx_PyInt_As_PY_LONG_LONG(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PY_LONG_LONG"); return (PY_LONG_LONG) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PY_LONG_LONG"); return (PY_LONG_LONG) -1; } /* CIntFromPy */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int64_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int64_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 2 * PyLong_SHIFT)) { return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 3: if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 3 * PyLong_SHIFT)) { return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 4: if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 4 * PyLong_SHIFT)) { return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int64_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int64_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 2: if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -3: if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 3: if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -4: if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 4: if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; } } #endif if ((sizeof(int64_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int64_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int64_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int64_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int64_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int64_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (int64_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int64_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int64_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int64_t) -1; } } else { int64_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int64_t) -1; val = __Pyx_PyInt_As_int64_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int64_t"); return (int64_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int64_t"); return (int64_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PY_LONG_LONG) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PY_LONG_LONG) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PY_LONG_LONG)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__39); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; cobj = PyCapsule_New(tmp.p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709470.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.rwobject_api.h0000664000175000017500000000360614760217136021477 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef __PYX_HAVE_API__pygame_sdl2__rwobject #define __PYX_HAVE_API__pygame_sdl2__rwobject #ifdef __MINGW64__ #define MS_WIN64 #endif #include "Python.h" static SDL_RWops *(*__pyx_api_f_11pygame_sdl2_8rwobject_RWopsFromPython)(PyObject *) = 0; #define RWopsFromPython __pyx_api_f_11pygame_sdl2_8rwobject_RWopsFromPython #ifndef __PYX_HAVE_RT_ImportFunction_3_0_8 #define __PYX_HAVE_RT_ImportFunction_3_0_8 static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int import_pygame_sdl2__rwobject(void) { PyObject *module = 0; module = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!module) goto bad; if (__Pyx_ImportFunction_3_0_8(module, "RWopsFromPython", (void (**)(void))&__pyx_api_f_11pygame_sdl2_8rwobject_RWopsFromPython, "SDL_RWops *(PyObject *)") < 0) goto bad; Py_DECREF(module); module = 0; return 0; bad: Py_XDECREF(module); return -1; } #endif /* !__PYX_HAVE_API__pygame_sdl2__rwobject */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709476.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.scrap.c0000664000175000017500000121252614760217144020135 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__scrap #define __PYX_HAVE_API__pygame_sdl2__scrap /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/scrap.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.scrap" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.scrap" extern int __pyx_module_is_main_pygame_sdl2__scrap; int __pyx_module_is_main_pygame_sdl2__scrap = 0; /* Implementation of "pygame_sdl2.scrap" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_ImportError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "*"; static const char __pyx_k_1[] = "\\\\\\1"; static const char __pyx_k__2[] = "([\\\\`$])"; static const char __pyx_k__3[] = "."; static const char __pyx_k_re[] = "re"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__15[] = "?"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_put[] = "put"; static const char __pyx_k_sub[] = "sub"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_lost[] = "lost"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_text[] = "text"; static const char __pyx_k_type[] = "type"; static const char __pyx_k_bytes[] = "bytes_"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_types[] = "_types"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_script[] = "script"; static const char __pyx_k_contains[] = "contains"; static const char __pyx_k_set_mode[] = "set_mode"; static const char __pyx_k_get_types[] = "get_types"; static const char __pyx_k_SCRAP_TEXT[] = "SCRAP_TEXT"; static const char __pyx_k_emscripten[] = "emscripten"; static const char __pyx_k_run_script[] = "run_script"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_SCRAP_TEXT_int[] = "\nSCRAP_TEXT : int \n"; static const char __pyx_k_Not_implemented[] = "Not implemented."; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_pygame_sdl2_scrap[] = "pygame_sdl2.scrap"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat"; static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static const char __pyx_k_src_pygame_sdl2_scrap_pyx[] = "src/pygame_sdl2/scrap.pyx"; static const char __pyx_k_navigator_clipboard_writeText_s[] = "navigator.clipboard.writeText(`%s`)"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_4get_types(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_6put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_8contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_10lost(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_mode); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_n_s_; PyObject *__pyx_kp_s_1; PyObject *__pyx_n_s_ImportError; PyObject *__pyx_kp_s_Not_implemented; PyObject *__pyx_n_s_SCRAP_TEXT; PyObject *__pyx_kp_s_SCRAP_TEXT_int; PyObject *__pyx_n_s__15; PyObject *__pyx_kp_s__2; PyObject *__pyx_kp_u__3; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_bytes; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_contains; PyObject *__pyx_n_s_data; PyObject *__pyx_n_s_decode; PyObject *__pyx_n_s_emscripten; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_types; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_lost; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_mode; PyObject *__pyx_n_s_name; PyObject *__pyx_kp_s_navigator_clipboard_writeText_s; PyObject *__pyx_n_s_put; PyObject *__pyx_n_s_pygame_sdl2_compat; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_locals; PyObject *__pyx_n_s_pygame_sdl2_scrap; PyObject *__pyx_n_s_re; PyObject *__pyx_n_s_run_script; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_script; PyObject *__pyx_n_s_set_mode; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_scrap_pyx; PyObject *__pyx_n_s_sub; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_text; PyObject *__pyx_n_s_type; PyObject *__pyx_n_s_types; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__13; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__14; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_n_s_); Py_CLEAR(clear_module_state->__pyx_kp_s_1); Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); Py_CLEAR(clear_module_state->__pyx_kp_s_Not_implemented); Py_CLEAR(clear_module_state->__pyx_n_s_SCRAP_TEXT); Py_CLEAR(clear_module_state->__pyx_kp_s_SCRAP_TEXT_int); Py_CLEAR(clear_module_state->__pyx_n_s__15); Py_CLEAR(clear_module_state->__pyx_kp_s__2); Py_CLEAR(clear_module_state->__pyx_kp_u__3); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_bytes); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_contains); Py_CLEAR(clear_module_state->__pyx_n_s_data); Py_CLEAR(clear_module_state->__pyx_n_s_decode); Py_CLEAR(clear_module_state->__pyx_n_s_emscripten); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_types); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_lost); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_mode); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_kp_s_navigator_clipboard_writeText_s); Py_CLEAR(clear_module_state->__pyx_n_s_put); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_compat); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_locals); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_scrap); Py_CLEAR(clear_module_state->__pyx_n_s_re); Py_CLEAR(clear_module_state->__pyx_n_s_run_script); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_script); Py_CLEAR(clear_module_state->__pyx_n_s_set_mode); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_scrap_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_sub); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_text); Py_CLEAR(clear_module_state->__pyx_n_s_type); Py_CLEAR(clear_module_state->__pyx_n_s_types); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__14); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_n_s_); Py_VISIT(traverse_module_state->__pyx_kp_s_1); Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); Py_VISIT(traverse_module_state->__pyx_kp_s_Not_implemented); Py_VISIT(traverse_module_state->__pyx_n_s_SCRAP_TEXT); Py_VISIT(traverse_module_state->__pyx_kp_s_SCRAP_TEXT_int); Py_VISIT(traverse_module_state->__pyx_n_s__15); Py_VISIT(traverse_module_state->__pyx_kp_s__2); Py_VISIT(traverse_module_state->__pyx_kp_u__3); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_bytes); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_contains); Py_VISIT(traverse_module_state->__pyx_n_s_data); Py_VISIT(traverse_module_state->__pyx_n_s_decode); Py_VISIT(traverse_module_state->__pyx_n_s_emscripten); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_types); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_lost); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_mode); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_kp_s_navigator_clipboard_writeText_s); Py_VISIT(traverse_module_state->__pyx_n_s_put); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_compat); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_locals); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_scrap); Py_VISIT(traverse_module_state->__pyx_n_s_re); Py_VISIT(traverse_module_state->__pyx_n_s_run_script); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_script); Py_VISIT(traverse_module_state->__pyx_n_s_set_mode); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_scrap_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_sub); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_text); Py_VISIT(traverse_module_state->__pyx_n_s_type); Py_VISIT(traverse_module_state->__pyx_n_s_types); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__14); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ #define __pyx_kp_s_1 __pyx_mstate_global->__pyx_kp_s_1 #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError #define __pyx_kp_s_Not_implemented __pyx_mstate_global->__pyx_kp_s_Not_implemented #define __pyx_n_s_SCRAP_TEXT __pyx_mstate_global->__pyx_n_s_SCRAP_TEXT #define __pyx_kp_s_SCRAP_TEXT_int __pyx_mstate_global->__pyx_kp_s_SCRAP_TEXT_int #define __pyx_n_s__15 __pyx_mstate_global->__pyx_n_s__15 #define __pyx_kp_s__2 __pyx_mstate_global->__pyx_kp_s__2 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_contains __pyx_mstate_global->__pyx_n_s_contains #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode #define __pyx_n_s_emscripten __pyx_mstate_global->__pyx_n_s_emscripten #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_types __pyx_mstate_global->__pyx_n_s_get_types #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_lost __pyx_mstate_global->__pyx_n_s_lost #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_kp_s_navigator_clipboard_writeText_s __pyx_mstate_global->__pyx_kp_s_navigator_clipboard_writeText_s #define __pyx_n_s_put __pyx_mstate_global->__pyx_n_s_put #define __pyx_n_s_pygame_sdl2_compat __pyx_mstate_global->__pyx_n_s_pygame_sdl2_compat #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_locals __pyx_mstate_global->__pyx_n_s_pygame_sdl2_locals #define __pyx_n_s_pygame_sdl2_scrap __pyx_mstate_global->__pyx_n_s_pygame_sdl2_scrap #define __pyx_n_s_re __pyx_mstate_global->__pyx_n_s_re #define __pyx_n_s_run_script __pyx_mstate_global->__pyx_n_s_run_script #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_script __pyx_mstate_global->__pyx_n_s_script #define __pyx_n_s_set_mode __pyx_mstate_global->__pyx_n_s_set_mode #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_scrap_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_scrap_pyx #define __pyx_n_s_sub __pyx_mstate_global->__pyx_n_s_sub #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_text __pyx_mstate_global->__pyx_n_s_text #define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type #define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 /* #### Code section: module_code ### */ /* "pygame_sdl2/scrap.pyx":31 * emscripten = None * * def init(): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_5scrap_init}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":34 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_3get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_2get, "get(type)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_3get = {"get", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5scrap_3get, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5scrap_2get}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_3get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get") < 0)) __PYX_ERR(0, 34, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 34, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.scrap.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_2get(__pyx_self, __pyx_v_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type) { char *__pyx_v_text; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get", 1); /* "pygame_sdl2/scrap.pyx":35 * * def get(type): * cdef char *text = NULL # <<<<<<<<<<<<<< * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() */ __pyx_v_text = NULL; /* "pygame_sdl2/scrap.pyx":36 * def get(type): * cdef char *text = NULL * if type == SCRAP_TEXT: # <<<<<<<<<<<<<< * text = SDL_GetClipboardText() * if text == NULL: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_type, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(__pyx_t_3)) { /* "pygame_sdl2/scrap.pyx":37 * cdef char *text = NULL * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() # <<<<<<<<<<<<<< * if text == NULL: * raise error() */ __pyx_v_text = SDL_GetClipboardText(); /* "pygame_sdl2/scrap.pyx":38 * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() * if text == NULL: # <<<<<<<<<<<<<< * raise error() * rv = bytes_(text) */ __pyx_t_3 = (__pyx_v_text == NULL); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/scrap.pyx":39 * text = SDL_GetClipboardText() * if text == NULL: * raise error() # <<<<<<<<<<<<<< * rv = bytes_(text) * SDL_free(text) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 39, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":38 * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() * if text == NULL: # <<<<<<<<<<<<<< * raise error() * rv = bytes_(text) */ } /* "pygame_sdl2/scrap.pyx":40 * if text == NULL: * raise error() * rv = bytes_(text) # <<<<<<<<<<<<<< * SDL_free(text) * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_rv = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":41 * raise error() * rv = bytes_(text) * SDL_free(text) # <<<<<<<<<<<<<< * return rv * else: */ SDL_free(__pyx_v_text); /* "pygame_sdl2/scrap.pyx":42 * rv = bytes_(text) * SDL_free(text) * return rv # <<<<<<<<<<<<<< * else: * raise error("Not implemented.") */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":36 * def get(type): * cdef char *text = NULL * if type == SCRAP_TEXT: # <<<<<<<<<<<<<< * text = SDL_GetClipboardText() * if text == NULL: */ } /* "pygame_sdl2/scrap.pyx":44 * return rv * else: * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def get_types(): */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_Not_implemented}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 44, __pyx_L1_error) } /* "pygame_sdl2/scrap.pyx":34 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.scrap.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":46 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_5get_types(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_4get_types, "get_types()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_5get_types = {"get_types", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_5get_types, METH_NOARGS, __pyx_doc_11pygame_sdl2_5scrap_4get_types}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_5get_types(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_types (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_4get_types(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_4get_types(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_types", 1); /* "pygame_sdl2/scrap.pyx":47 * * def get_types(): * return [SCRAP_TEXT] # <<<<<<<<<<<<<< * * def put(type, data): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":46 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.scrap.get_types", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":49 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_7put(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_6put, "put(type, data)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_7put = {"put", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5scrap_7put, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5scrap_6put}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_7put(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_type = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("put (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, 1); __PYX_ERR(0, 49, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "put") < 0)) __PYX_ERR(0, 49, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_type = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 49, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.scrap.put", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_6put(__pyx_self, __pyx_v_type, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_6put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type, PyObject *__pyx_v_data) { PyObject *__pyx_v_re = NULL; PyObject *__pyx_v_text = NULL; PyObject *__pyx_v_script = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; char const *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("put", 0); __Pyx_INCREF(__pyx_v_data); /* "pygame_sdl2/scrap.pyx":50 * * def put(type, data): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_type, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/scrap.pyx":51 * def put(type, data): * if type != SCRAP_TEXT: * raise error("Not implemented.") # <<<<<<<<<<<<<< * * if emscripten is not None: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_Not_implemented}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 51, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":50 * * def put(type, data): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ } /* "pygame_sdl2/scrap.pyx":53 * raise error("Not implemented.") * * if emscripten is not None: # <<<<<<<<<<<<<< * # SDL_SetClipboardText() is not implemented for Web * import re */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_emscripten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":55 * if emscripten is not None: * # SDL_SetClipboardText() is not implemented for Web * import re # <<<<<<<<<<<<<< * text = data.decode('utf-8') * script = 'navigator.clipboard.writeText(`%s`)' % (re.sub(r'([\\`$])', r'\\\1', text),) */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_re = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":56 * # SDL_SetClipboardText() is not implemented for Web * import re * text = data.decode('utf-8') # <<<<<<<<<<<<<< * script = 'navigator.clipboard.writeText(`%s`)' % (re.sub(r'([\\`$])', r'\\\1', text),) * emscripten.run_script(script) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_utf_8}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_text = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":57 * import re * text = data.decode('utf-8') * script = 'navigator.clipboard.writeText(`%s`)' % (re.sub(r'([\\`$])', r'\\\1', text),) # <<<<<<<<<<<<<< * emscripten.run_script(script) * return */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_re, __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_kp_s__2, __pyx_kp_s_1, __pyx_v_text}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_navigator_clipboard_writeText_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_script = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":58 * text = data.decode('utf-8') * script = 'navigator.clipboard.writeText(`%s`)' % (re.sub(r'([\\`$])', r'\\\1', text),) * emscripten.run_script(script) # <<<<<<<<<<<<<< * return * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_emscripten); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_run_script); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_script}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":59 * script = 'navigator.clipboard.writeText(`%s`)' % (re.sub(r'([\\`$])', r'\\\1', text),) * emscripten.run_script(script) * return # <<<<<<<<<<<<<< * * data = bytes_(data) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":53 * raise error("Not implemented.") * * if emscripten is not None: # <<<<<<<<<<<<<< * # SDL_SetClipboardText() is not implemented for Web * import re */ } /* "pygame_sdl2/scrap.pyx":61 * return * * data = bytes_(data) # <<<<<<<<<<<<<< * * if SDL_SetClipboardText(data) != 0: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_data}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":63 * data = bytes_(data) * * if SDL_SetClipboardText(data) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_t_3 = (SDL_SetClipboardText(__pyx_t_6) != 0); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/scrap.pyx":64 * * if SDL_SetClipboardText(data) != 0: * raise error() # <<<<<<<<<<<<<< * * def contains(type): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 64, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":63 * data = bytes_(data) * * if SDL_SetClipboardText(data) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/scrap.pyx":49 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.scrap.put", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_re); __Pyx_XDECREF(__pyx_v_text); __Pyx_XDECREF(__pyx_v_script); __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":66 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_9contains(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_8contains, "contains(type)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_9contains = {"contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5scrap_9contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5scrap_8contains}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_9contains(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "contains") < 0)) __PYX_ERR(0, 66, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("contains", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 66, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.scrap.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_8contains(__pyx_self, __pyx_v_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_8contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("contains", 1); /* "pygame_sdl2/scrap.pyx":67 * * def contains(type): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * return False * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_type, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":68 * def contains(type): * if type != SCRAP_TEXT: * return False # <<<<<<<<<<<<<< * * return SDL_HasClipboardText() == SDL_TRUE */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":67 * * def contains(type): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/scrap.pyx":70 * return False * * return SDL_HasClipboardText() == SDL_TRUE # <<<<<<<<<<<<<< * * def lost(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong((SDL_HasClipboardText() == SDL_TRUE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":66 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.scrap.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":72 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_11lost(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_10lost, "lost()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_11lost = {"lost", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_11lost, METH_NOARGS, __pyx_doc_11pygame_sdl2_5scrap_10lost}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_11lost(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lost (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_10lost(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_10lost(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lost", 1); /* "pygame_sdl2/scrap.pyx":73 * * def lost(): * return False # <<<<<<<<<<<<<< * * def set_mode(mode): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":72 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":75 * return False * * def set_mode(mode): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_13set_mode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_12set_mode, "set_mode(mode)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_13set_mode = {"set_mode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5scrap_13set_mode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5scrap_12set_mode}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_13set_mode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mode (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_mode") < 0)) __PYX_ERR(0, 75, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mode = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_mode", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 75, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.scrap.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_12set_mode(__pyx_self, __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_mode) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mode", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0}, {&__pyx_n_s_SCRAP_TEXT, __pyx_k_SCRAP_TEXT, sizeof(__pyx_k_SCRAP_TEXT), 0, 0, 1, 1}, {&__pyx_kp_s_SCRAP_TEXT_int, __pyx_k_SCRAP_TEXT_int, sizeof(__pyx_k_SCRAP_TEXT_int), 0, 0, 1, 0}, {&__pyx_n_s__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_emscripten, __pyx_k_emscripten, sizeof(__pyx_k_emscripten), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_types, __pyx_k_get_types, sizeof(__pyx_k_get_types), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_lost, __pyx_k_lost, sizeof(__pyx_k_lost), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_kp_s_navigator_clipboard_writeText_s, __pyx_k_navigator_clipboard_writeText_s, sizeof(__pyx_k_navigator_clipboard_writeText_s), 0, 0, 1, 0}, {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_compat, __pyx_k_pygame_sdl2_compat, sizeof(__pyx_k_pygame_sdl2_compat), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_scrap, __pyx_k_pygame_sdl2_scrap, sizeof(__pyx_k_pygame_sdl2_scrap), 0, 0, 1, 1}, {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, {&__pyx_n_s_run_script, __pyx_k_run_script, sizeof(__pyx_k_run_script), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_script, __pyx_k_script, sizeof(__pyx_k_script), 0, 0, 1, 1}, {&__pyx_n_s_set_mode, __pyx_k_set_mode, sizeof(__pyx_k_set_mode), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_k_src_pygame_sdl2_scrap_pyx, sizeof(__pyx_k_src_pygame_sdl2_scrap_pyx), 0, 0, 1, 0}, {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 28, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/scrap.pyx":31 * emscripten = None * * def init(): # <<<<<<<<<<<<<< * pass * */ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_init, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 31, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":34 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_type, __pyx_n_s_text, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_get, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 34, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":46 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_get_types, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 46, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":49 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ __pyx_tuple__8 = PyTuple_Pack(5, __pyx_n_s_type, __pyx_n_s_data, __pyx_n_s_re, __pyx_n_s_text, __pyx_n_s_script); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_put, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 49, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":66 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_type); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_contains, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 66, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":72 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_lost, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 72, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":75 * return False * * def set_mode(mode): # <<<<<<<<<<<<<< * pass * */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_mode); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_set_mode, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_scrap(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_scrap}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "scrap", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initscrap(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initscrap(void) #else __Pyx_PyMODINIT_FUNC PyInit_scrap(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_scrap(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_scrap(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'scrap' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("scrap", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "scrap" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_scrap(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__scrap) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.scrap")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.scrap", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/scrap.pyx":21 * from sdl2 cimport * * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.locals import SCRAP_TEXT * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 21, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/scrap.pyx":22 * * from pygame_sdl2.error import error * from pygame_sdl2.locals import SCRAP_TEXT # <<<<<<<<<<<<<< * * from pygame_sdl2.compat import bytes_ */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_SCRAP_TEXT); __Pyx_GIVEREF(__pyx_n_s_SCRAP_TEXT); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_SCRAP_TEXT)) __PYX_ERR(0, 22, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCRAP_TEXT, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":24 * from pygame_sdl2.locals import SCRAP_TEXT * * from pygame_sdl2.compat import bytes_ # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_bytes); __Pyx_GIVEREF(__pyx_n_s_bytes); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_bytes)) __PYX_ERR(0, 24, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/scrap.pyx":26 * from pygame_sdl2.compat import bytes_ * * try: # <<<<<<<<<<<<<< * import emscripten * except ImportError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "pygame_sdl2/scrap.pyx":27 * * try: * import emscripten # <<<<<<<<<<<<<< * except ImportError: * emscripten = None */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_emscripten, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_emscripten, __pyx_t_3) < 0) __PYX_ERR(0, 27, __pyx_L2_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/scrap.pyx":26 * from pygame_sdl2.compat import bytes_ * * try: # <<<<<<<<<<<<<< * import emscripten * except ImportError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L7_try_end; __pyx_L2_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/scrap.pyx":28 * try: * import emscripten * except ImportError: # <<<<<<<<<<<<<< * emscripten = None * */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); if (__pyx_t_6) { __Pyx_AddTraceback("pygame_sdl2.scrap", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 28, __pyx_L4_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_7); /* "pygame_sdl2/scrap.pyx":29 * import emscripten * except ImportError: * emscripten = None # <<<<<<<<<<<<<< * * def init(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_emscripten, Py_None) < 0) __PYX_ERR(0, 29, __pyx_L4_except_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L3_exception_handled; } goto __pyx_L4_except_error; /* "pygame_sdl2/scrap.pyx":26 * from pygame_sdl2.compat import bytes_ * * try: # <<<<<<<<<<<<<< * import emscripten * except ImportError: */ __pyx_L4_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L3_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); __pyx_L7_try_end:; } /* "pygame_sdl2/scrap.pyx":31 * emscripten = None * * def init(): # <<<<<<<<<<<<<< * pass * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":34 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_3get, 0, __pyx_n_s_get, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get, __pyx_t_7) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":46 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_5get_types, 0, __pyx_n_s_get_types, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_types, __pyx_t_7) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":49 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_7put, 0, __pyx_n_s_put, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_put, __pyx_t_7) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":66 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_9contains, 0, __pyx_n_s_contains, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_contains, __pyx_t_7) < 0) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":72 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_11lost, 0, __pyx_n_s_lost, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_lost, __pyx_t_7) < 0) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":75 * return False * * def set_mode(mode): # <<<<<<<<<<<<<< * pass * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_13set_mode, 0, __pyx_n_s_set_mode, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_7) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":78 * pass * * _types = """ # <<<<<<<<<<<<<< * SCRAP_TEXT : int * """ */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_kp_s_SCRAP_TEXT_int) < 0) __PYX_ERR(0, 78, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.scrap", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.scrap"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s_; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__3); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__15); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709470.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.surface.c0000664000175000017500000401723314760217136020457 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__surface #define __PYX_HAVE_API__pygame_sdl2__surface /* Early includes */ #include #include #include #include #include "SDL.h" #include "src/surface.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/surface.pyx", "", "src/pygame_sdl2/color.pxd", "src/pygame_sdl2/rect.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_5color_Color; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* "pygame_sdl2/surface.pyx":53 * total_size = 0 * * cdef class Surface: # <<<<<<<<<<<<<< * * def __cinit__(self): */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* AssertionsEnabled.proto */ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (1) #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) static int __Pyx_init_assertions_enabled(void) { PyObject *builtins, *debug, *debug_str; int flag; builtins = PyEval_GetBuiltins(); if (!builtins) goto bad; debug_str = PyUnicode_FromStringAndSize("__debug__", 9); if (!debug_str) goto bad; debug = PyObject_GetItem(builtins, debug_str); Py_DECREF(debug_str); if (!debug) goto bad; flag = PyObject_IsTrue(debug); Py_DECREF(debug); if (flag == -1) goto bad; __pyx_assertions_enabled_flag = flag; return 0; bad: __pyx_assertions_enabled_flag = 1; return -1; } #else #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ (likely(is_tuple || PyTuple_Check(tuple)) ?\ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 #define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_8 { __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ static void __pyx_f_11pygame_sdl2_7surface_7Surface_take_surface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, SDL_Surface *__pyx_v_surface); /* proto*/ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.color" */ static Uint32 (*__pyx_f_11pygame_sdl2_5color_map_color)(SDL_Surface *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_11pygame_sdl2_5color_get_color)(Uint32, SDL_Surface *); /*proto*/ /* Module declarations from "pygame_sdl2.rect" */ static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.surface" */ static void __pyx_f_11pygame_sdl2_7surface_move_pixels(Uint8 *, Uint8 *, int, int, int, int); /*proto*/ static SDL_Surface *__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface(PyObject *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_7surface_PySurface_New(SDL_Surface *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.surface" extern int __pyx_module_is_main_pygame_sdl2__surface; int __pyx_module_is_main_pygame_sdl2__surface = 0; /* Implementation of "pygame_sdl2.surface" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_2[] = "2"; static const char __pyx_k_d[] = "d"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_k[] = "k"; static const char __pyx_k_p[] = "p"; static const char __pyx_k_v[] = "v"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__5[] = "."; static const char __pyx_k__6[] = "*"; static const char __pyx_k_dx[] = "dx"; static const char __pyx_k_dy[] = "dy"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__89[] = "?"; static const char __pyx_k_err[] = "err"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_row[] = "row"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_amin[] = "amin"; static const char __pyx_k_area[] = "area"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_blit[] = "blit"; static const char __pyx_k_clip[] = "clip"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_dest[] = "dest"; static const char __pyx_k_fill[] = "fill"; static const char __pyx_k_kind[] = "kind"; static const char __pyx_k_lock[] = "lock"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_maxx[] = "maxx"; static const char __pyx_k_maxy[] = "maxy"; static const char __pyx_k_minx[] = "minx"; static const char __pyx_k_miny[] = "miny"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_root[] = "root"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_srcx[] = "srcx"; static const char __pyx_k_srcy[] = "srcy"; static const char __pyx_k_surf[] = "surf"; static const char __pyx_k_temp[] = "temp"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_warn[] = "warn"; static const char __pyx_k_alpha[] = "alpha"; static const char __pyx_k_amask[] = "amask"; static const char __pyx_k_bmask[] = "bmask"; static const char __pyx_k_color[] = "color"; static const char __pyx_k_depth[] = "depth"; static const char __pyx_k_destx[] = "destx"; static const char __pyx_k_desty[] = "desty"; static const char __pyx_k_dirty[] = "dirty"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_gmask[] = "gmask"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_masks[] = "masks"; static const char __pyx_k_pixel[] = "pixel"; static const char __pyx_k_rmask[] = "rmask"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_get_at[] = "get_at"; static const char __pyx_k_height[] = "height"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_kwargs[] = "kwargs"; static const char __pyx_k_pixels[] = "pixels"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_remove[] = "remove"; static const char __pyx_k_scroll[] = "scroll"; static const char __pyx_k_set_at[] = "set_at"; static const char __pyx_k_shifts[] = "shifts"; static const char __pyx_k_sizeof[] = "__sizeof__"; static const char __pyx_k_source[] = "source"; static const char __pyx_k_srcptr[] = "srcptr"; static const char __pyx_k_unlock[] = "unlock"; static const char __pyx_k_Surface[] = "Surface"; static const char __pyx_k_convert[] = "convert"; static const char __pyx_k_destptr[] = "destptr"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_map_rgb[] = "map_rgb"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_topleft[] = "topleft"; static const char __pyx_k_SRCALPHA[] = "SRCALPHA"; static const char __pyx_k_area_ptr[] = "area_ptr"; static const char __pyx_k_botright[] = "botright"; static const char __pyx_k_colorkey[] = "colorkey"; static const char __pyx_k_get_clip[] = "get_clip"; static const char __pyx_k_get_rect[] = "get_rect"; static const char __pyx_k_get_size[] = "get_size"; static const char __pyx_k_get_view[] = "get_view"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_mustlock[] = "mustlock"; static const char __pyx_k_offset_x[] = "offset_x"; static const char __pyx_k_offset_y[] = "offset_y"; static const char __pyx_k_sdl_rect[] = "sdl_rect"; static const char __pyx_k_set_clip[] = "set_clip"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_warnings[] = "warnings"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_area_rect[] = "area_rect"; static const char __pyx_k_dest_rect[] = "dest_rect"; static const char __pyx_k_from_data[] = "from_data"; static const char __pyx_k_get_alpha[] = "get_alpha"; static const char __pyx_k_get_flags[] = "get_flags"; static const char __pyx_k_get_locks[] = "get_locks"; static const char __pyx_k_get_masks[] = "get_masks"; static const char __pyx_k_get_pitch[] = "get_pitch"; static const char __pyx_k_get_width[] = "get_width"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_min_alpha[] = "min_alpha"; static const char __pyx_k_per_pixel[] = "per_pixel"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_set_alpha[] = "set_alpha"; static const char __pyx_k_set_masks[] = "set_masks"; static const char __pyx_k_unmap_rgb[] = "unmap_rgb"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_get_buffer[] = "get_buffer"; static const char __pyx_k_get_height[] = "get_height"; static const char __pyx_k_get_locked[] = "get_locked"; static const char __pyx_k_get_losses[] = "get_losses"; static const char __pyx_k_get_offset[] = "get_offset"; static const char __pyx_k_get_parent[] = "get_parent"; static const char __pyx_k_get_shifts[] = "get_shifts"; static const char __pyx_k_move_width[] = "move_width"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_set_shifts[] = "set_shifts"; static const char __pyx_k_subsurface[] = "subsurface"; static const char __pyx_k_total_size[] = "total_size"; static const char __pyx_k_use_format[] = "use_format"; static const char __pyx_k_Surface_x_x[] = ""; static const char __pyx_k_get_bitsize[] = "get_bitsize"; static const char __pyx_k_get_surface[] = "get_surface"; static const char __pyx_k_move_height[] = "move_height"; static const char __pyx_k_new_surface[] = "new_surface"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_Surface_blit[] = "Surface.blit"; static const char __pyx_k_Surface_copy[] = "Surface.copy"; static const char __pyx_k_Surface_fill[] = "Surface.fill"; static const char __pyx_k_Surface_lock[] = "Surface.lock"; static const char __pyx_k_get_bytesize[] = "get_bytesize"; static const char __pyx_k_get_colorkey[] = "get_colorkey"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_pixel_format[] = "pixel_format"; static const char __pyx_k_set_colorkey[] = "set_colorkey"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_convert_alpha[] = "convert_alpha"; static const char __pyx_k_get_at_mapped[] = "get_at_mapped"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_sample_format[] = "sample_format"; static const char __pyx_k_special_flags[] = "special_flags"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_Surface_get_at[] = "Surface.get_at"; static const char __pyx_k_Surface_scroll[] = "Surface.scroll"; static const char __pyx_k_Surface_set_at[] = "Surface.set_at"; static const char __pyx_k_Surface_unlock[] = "Surface.unlock"; static const char __pyx_k_get_abs_offset[] = "get_abs_offset"; static const char __pyx_k_get_abs_parent[] = "get_abs_parent"; static const char __pyx_k_Surface_convert[] = "Surface.convert"; static const char __pyx_k_Surface_map_rgb[] = "Surface.map_rgb"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Surface___sizeof[] = "Surface.__sizeof__"; static const char __pyx_k_Surface_get_clip[] = "Surface.get_clip"; static const char __pyx_k_Surface_get_rect[] = "Surface.get_rect"; static const char __pyx_k_Surface_get_size[] = "Surface.get_size"; static const char __pyx_k_Surface_get_view[] = "Surface.get_view"; static const char __pyx_k_Surface_mustlock[] = "Surface.mustlock"; static const char __pyx_k_Surface_set_clip[] = "Surface.set_clip"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_Surface_from_data[] = "Surface.from_data"; static const char __pyx_k_Surface_get_alpha[] = "Surface.get_alpha"; static const char __pyx_k_Surface_get_flags[] = "Surface.get_flags"; static const char __pyx_k_Surface_get_locks[] = "Surface.get_locks"; static const char __pyx_k_Surface_get_masks[] = "Surface.get_masks"; static const char __pyx_k_Surface_get_pitch[] = "Surface.get_pitch"; static const char __pyx_k_Surface_get_width[] = "Surface.get_width"; static const char __pyx_k_Surface_set_alpha[] = "Surface.set_alpha"; static const char __pyx_k_Surface_set_masks[] = "Surface.set_masks"; static const char __pyx_k_Surface_unmap_rgb[] = "Surface.unmap_rgb"; static const char __pyx_k_get_bounding_rect[] = "get_bounding_rect"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_Surface_get_buffer[] = "Surface.get_buffer"; static const char __pyx_k_Surface_get_height[] = "Surface.get_height"; static const char __pyx_k_Surface_get_locked[] = "Surface.get_locked"; static const char __pyx_k_Surface_get_losses[] = "Surface.get_losses"; static const char __pyx_k_Surface_get_offset[] = "Surface.get_offset"; static const char __pyx_k_Surface_get_parent[] = "Surface.get_parent"; static const char __pyx_k_Surface_get_shifts[] = "Surface.get_shifts"; static const char __pyx_k_Surface_set_shifts[] = "Surface.set_shifts"; static const char __pyx_k_Surface_subsurface[] = "Surface.subsurface"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static const char __pyx_k_Surface_get_bitsize[] = "Surface.get_bitsize"; static const char __pyx_k_pygame_sdl2_surface[] = "pygame_sdl2.surface"; static const char __pyx_k_Surface_get_bytesize[] = "Surface.get_bytesize"; static const char __pyx_k_Surface_get_colorkey[] = "Surface.get_colorkey"; static const char __pyx_k_Surface_set_colorkey[] = "Surface.set_colorkey"; static const char __pyx_k_Surface_convert_alpha[] = "Surface.convert_alpha"; static const char __pyx_k_Surface_get_at_mapped[] = "Surface.get_at_mapped"; static const char __pyx_k_Surface_get_abs_offset[] = "Surface.get_abs_offset"; static const char __pyx_k_Surface_get_abs_parent[] = "Surface.get_abs_parent"; static const char __pyx_k_Surface___reduce_cython[] = "Surface.__reduce_cython__"; static const char __pyx_k_Position_outside_surface[] = "Position outside surface."; static const char __pyx_k_Surface___setstate_cython[] = "Surface.__setstate_cython__"; static const char __pyx_k_Surface_get_bounding_rect[] = "Surface.get_bounding_rect"; static const char __pyx_k_src_pygame_sdl2_surface_pyx[] = "src/pygame_sdl2/surface.pyx"; static const char __pyx_k_A_null_pointer_was_passed_in[] = "A null pointer was passed in."; static const char __pyx_k_The_data_must_fill_the_surface[] = "The data must fill the surface."; static const char __pyx_k_Memory_leak_via_Surface_in_pygam[] = "Memory leak via Surface in pygame_sdl2."; static const char __pyx_k_Surface_get_view_is_not_supporte[] = "Surface.get_view is not supported."; static const char __pyx_k_Surface_has_unsupported_bytesize[] = "Surface has unsupported bytesize."; static const char __pyx_k_Surface_set_masks_is_not_support[] = "Surface.set_masks is not supported."; static const char __pyx_k_Surface_set_shifts_is_not_suppor[] = "Surface.set_shifts is not supported."; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_subsurface_rectangle_outside_sur[] = "subsurface rectangle outside surface area."; static const char __pyx_k_subsurface_size_must_be_non_nega[] = "subsurface size must be non-negative."; /* #### Code section: decls ### */ static int __pyx_pf_11pygame_sdl2_7surface_7Surface___cinit__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_7surface_7Surface_2__dealloc__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_4__sizeof__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_7surface_7Surface_6__init__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_masks); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_8__repr__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_10blit(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_source, PyObject *__pyx_v_dest, PyObject *__pyx_v_area, int __pyx_v_special_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_12convert(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_14convert_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_16copy(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_18fill(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_special_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_20scroll(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, int __pyx_v_dx, int __pyx_v_dy); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_22set_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_24get_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_26set_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_28get_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_30lock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_32unlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_34mustlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_36get_locked(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_38get_locks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_40get_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_42set_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_44get_at_mapped(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_46map_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_48unmap_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pixel); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_50set_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_52get_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_54subsurface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_56get_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_58get_abs_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_60get_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_62get_abs_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_64get_size(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_66get_width(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_68get_height(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_70get_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_72get_bitsize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_74get_bytesize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_76get_flags(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_78get_pitch(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_80get_masks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_82set_masks(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_masks); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_84get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_86set_shifts(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_shifts); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_88get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_90get_losses(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_92get_bounding_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_min_alpha); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_94get_view(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kind); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_96get_buffer(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_15_pixels_address___get__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_98from_data(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_100__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_102__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_7surface_Surface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect; #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_7surface_Surface; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; PyObject *__pyx_kp_s_2; PyObject *__pyx_kp_s_A_null_pointer_was_passed_in; PyObject *__pyx_n_s_AssertionError; PyObject *__pyx_n_s_IndexError; PyObject *__pyx_kp_s_Memory_leak_via_Surface_in_pygam; PyObject *__pyx_kp_s_Position_outside_surface; PyObject *__pyx_n_s_Rect; PyObject *__pyx_n_s_SRCALPHA; PyObject *__pyx_n_s_Surface; PyObject *__pyx_n_s_Surface___reduce_cython; PyObject *__pyx_n_s_Surface___setstate_cython; PyObject *__pyx_n_s_Surface___sizeof; PyObject *__pyx_n_s_Surface_blit; PyObject *__pyx_n_s_Surface_convert; PyObject *__pyx_n_s_Surface_convert_alpha; PyObject *__pyx_n_s_Surface_copy; PyObject *__pyx_n_s_Surface_fill; PyObject *__pyx_n_s_Surface_from_data; PyObject *__pyx_n_s_Surface_get_abs_offset; PyObject *__pyx_n_s_Surface_get_abs_parent; PyObject *__pyx_n_s_Surface_get_alpha; PyObject *__pyx_n_s_Surface_get_at; PyObject *__pyx_n_s_Surface_get_at_mapped; PyObject *__pyx_n_s_Surface_get_bitsize; PyObject *__pyx_n_s_Surface_get_bounding_rect; PyObject *__pyx_n_s_Surface_get_buffer; PyObject *__pyx_n_s_Surface_get_bytesize; PyObject *__pyx_n_s_Surface_get_clip; PyObject *__pyx_n_s_Surface_get_colorkey; PyObject *__pyx_n_s_Surface_get_flags; PyObject *__pyx_n_s_Surface_get_height; PyObject *__pyx_n_s_Surface_get_locked; PyObject *__pyx_n_s_Surface_get_locks; PyObject *__pyx_n_s_Surface_get_losses; PyObject *__pyx_n_s_Surface_get_masks; PyObject *__pyx_n_s_Surface_get_offset; PyObject *__pyx_n_s_Surface_get_parent; PyObject *__pyx_n_s_Surface_get_pitch; PyObject *__pyx_n_s_Surface_get_rect; PyObject *__pyx_n_s_Surface_get_shifts; PyObject *__pyx_n_s_Surface_get_size; PyObject *__pyx_n_s_Surface_get_view; PyObject *__pyx_kp_s_Surface_get_view_is_not_supporte; PyObject *__pyx_n_s_Surface_get_width; PyObject *__pyx_kp_s_Surface_has_unsupported_bytesize; PyObject *__pyx_n_s_Surface_lock; PyObject *__pyx_n_s_Surface_map_rgb; PyObject *__pyx_n_s_Surface_mustlock; PyObject *__pyx_n_s_Surface_scroll; PyObject *__pyx_n_s_Surface_set_alpha; PyObject *__pyx_n_s_Surface_set_at; PyObject *__pyx_n_s_Surface_set_clip; PyObject *__pyx_n_s_Surface_set_colorkey; PyObject *__pyx_n_s_Surface_set_masks; PyObject *__pyx_kp_s_Surface_set_masks_is_not_support; PyObject *__pyx_n_s_Surface_set_shifts; PyObject *__pyx_kp_s_Surface_set_shifts_is_not_suppor; PyObject *__pyx_n_s_Surface_subsurface; PyObject *__pyx_n_s_Surface_unlock; PyObject *__pyx_n_s_Surface_unmap_rgb; PyObject *__pyx_kp_s_Surface_x_x; PyObject *__pyx_kp_s_The_data_must_fill_the_surface; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_kp_u__5; PyObject *__pyx_n_s__6; PyObject *__pyx_n_s__89; PyObject *__pyx_n_s_alpha; PyObject *__pyx_n_s_amask; PyObject *__pyx_n_s_amin; PyObject *__pyx_n_s_append; PyObject *__pyx_n_s_area; PyObject *__pyx_n_s_area_ptr; PyObject *__pyx_n_s_area_rect; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_blit; PyObject *__pyx_n_s_bmask; PyObject *__pyx_n_s_botright; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_clip; PyObject *__pyx_n_s_color; PyObject *__pyx_n_s_colorkey; PyObject *__pyx_n_s_convert; PyObject *__pyx_n_s_convert_alpha; PyObject *__pyx_n_s_copy; PyObject *__pyx_n_s_d; PyObject *__pyx_n_s_data; PyObject *__pyx_n_s_depth; PyObject *__pyx_n_s_dest; PyObject *__pyx_n_s_dest_rect; PyObject *__pyx_n_s_destptr; PyObject *__pyx_n_s_destx; PyObject *__pyx_n_s_desty; PyObject *__pyx_n_s_dirty; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_display; PyObject *__pyx_n_s_dx; PyObject *__pyx_n_s_dy; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_err; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_fill; PyObject *__pyx_n_s_flags; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_from_data; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_abs_offset; PyObject *__pyx_n_s_get_abs_parent; PyObject *__pyx_n_s_get_alpha; PyObject *__pyx_n_s_get_at; PyObject *__pyx_n_s_get_at_mapped; PyObject *__pyx_n_s_get_bitsize; PyObject *__pyx_n_s_get_bounding_rect; PyObject *__pyx_n_s_get_buffer; PyObject *__pyx_n_s_get_bytesize; PyObject *__pyx_n_s_get_clip; PyObject *__pyx_n_s_get_colorkey; PyObject *__pyx_n_s_get_flags; PyObject *__pyx_n_s_get_height; PyObject *__pyx_n_s_get_locked; PyObject *__pyx_n_s_get_locks; PyObject *__pyx_n_s_get_losses; PyObject *__pyx_n_s_get_masks; PyObject *__pyx_n_s_get_offset; PyObject *__pyx_n_s_get_parent; PyObject *__pyx_n_s_get_pitch; PyObject *__pyx_n_s_get_rect; PyObject *__pyx_n_s_get_shifts; PyObject *__pyx_n_s_get_size; PyObject *__pyx_n_s_get_surface; PyObject *__pyx_n_s_get_view; PyObject *__pyx_n_s_get_width; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_gmask; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_height; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_items; PyObject *__pyx_n_s_k; PyObject *__pyx_n_s_key; PyObject *__pyx_n_s_kind; PyObject *__pyx_n_s_kwargs; PyObject *__pyx_n_s_lock; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_map_rgb; PyObject *__pyx_n_s_masks; PyObject *__pyx_n_s_maxx; PyObject *__pyx_n_s_maxy; PyObject *__pyx_n_s_min_alpha; PyObject *__pyx_n_s_minx; PyObject *__pyx_n_s_miny; PyObject *__pyx_n_s_move_height; PyObject *__pyx_n_s_move_width; PyObject *__pyx_n_s_mustlock; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_new_surface; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_offset_x; PyObject *__pyx_n_s_offset_y; PyObject *__pyx_n_s_p; PyObject *__pyx_n_s_per_pixel; PyObject *__pyx_n_s_pixel; PyObject *__pyx_n_s_pixel_format; PyObject *__pyx_n_s_pixels; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_locals; PyObject *__pyx_n_s_pygame_sdl2_rect; PyObject *__pyx_n_s_pygame_sdl2_surface; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_rect; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_remove; PyObject *__pyx_n_s_rmask; PyObject *__pyx_n_s_root; PyObject *__pyx_n_s_row; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_sample_format; PyObject *__pyx_n_s_scroll; PyObject *__pyx_n_s_sdl_rect; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_alpha; PyObject *__pyx_n_s_set_at; PyObject *__pyx_n_s_set_clip; PyObject *__pyx_n_s_set_colorkey; PyObject *__pyx_n_s_set_masks; PyObject *__pyx_n_s_set_shifts; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_shifts; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_sizeof; PyObject *__pyx_n_s_source; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_special_flags; PyObject *__pyx_kp_s_src_pygame_sdl2_surface_pyx; PyObject *__pyx_n_s_srcptr; PyObject *__pyx_n_s_srcx; PyObject *__pyx_n_s_srcy; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_subsurface; PyObject *__pyx_kp_s_subsurface_rectangle_outside_sur; PyObject *__pyx_kp_s_subsurface_size_must_be_non_nega; PyObject *__pyx_n_s_surf; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_temp; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_topleft; PyObject *__pyx_n_s_total_size; PyObject *__pyx_n_s_unlock; PyObject *__pyx_n_s_unmap_rgb; PyObject *__pyx_n_s_use_format; PyObject *__pyx_n_s_v; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_warn; PyObject *__pyx_n_s_warnings; PyObject *__pyx_n_s_width; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_y; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_32; PyObject *__pyx_int_255; PyObject *__pyx_int_16843009; PyObject *__pyx_int_4294967295; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__34; PyObject *__pyx_tuple__38; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__45; PyObject *__pyx_tuple__47; PyObject *__pyx_tuple__49; PyObject *__pyx_tuple__51; PyObject *__pyx_tuple__56; PyObject *__pyx_tuple__61; PyObject *__pyx_tuple__67; PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__72; PyObject *__pyx_tuple__76; PyObject *__pyx_tuple__78; PyObject *__pyx_tuple__79; PyObject *__pyx_tuple__81; PyObject *__pyx_tuple__82; PyObject *__pyx_tuple__84; PyObject *__pyx_tuple__87; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__37; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__42; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__48; PyObject *__pyx_codeobj__50; PyObject *__pyx_codeobj__52; PyObject *__pyx_codeobj__53; PyObject *__pyx_codeobj__54; PyObject *__pyx_codeobj__55; PyObject *__pyx_codeobj__57; PyObject *__pyx_codeobj__58; PyObject *__pyx_codeobj__59; PyObject *__pyx_codeobj__60; PyObject *__pyx_codeobj__62; PyObject *__pyx_codeobj__63; PyObject *__pyx_codeobj__64; PyObject *__pyx_codeobj__65; PyObject *__pyx_codeobj__66; PyObject *__pyx_codeobj__68; PyObject *__pyx_codeobj__70; PyObject *__pyx_codeobj__71; PyObject *__pyx_codeobj__73; PyObject *__pyx_codeobj__74; PyObject *__pyx_codeobj__75; PyObject *__pyx_codeobj__77; PyObject *__pyx_codeobj__80; PyObject *__pyx_codeobj__83; PyObject *__pyx_codeobj__85; PyObject *__pyx_codeobj__86; PyObject *__pyx_codeobj__88; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_kp_s_2); Py_CLEAR(clear_module_state->__pyx_kp_s_A_null_pointer_was_passed_in); Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); Py_CLEAR(clear_module_state->__pyx_kp_s_Memory_leak_via_Surface_in_pygam); Py_CLEAR(clear_module_state->__pyx_kp_s_Position_outside_surface); Py_CLEAR(clear_module_state->__pyx_n_s_Rect); Py_CLEAR(clear_module_state->__pyx_n_s_SRCALPHA); Py_CLEAR(clear_module_state->__pyx_n_s_Surface); Py_CLEAR(clear_module_state->__pyx_n_s_Surface___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Surface___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Surface___sizeof); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_blit); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_convert); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_convert_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_copy); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_fill); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_from_data); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_abs_offset); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_abs_parent); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_at); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_at_mapped); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_bitsize); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_bounding_rect); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_bytesize); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_clip); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_colorkey); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_flags); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_height); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_locked); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_locks); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_losses); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_masks); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_offset); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_parent); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_pitch); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_rect); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_shifts); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_size); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_view); Py_CLEAR(clear_module_state->__pyx_kp_s_Surface_get_view_is_not_supporte); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_width); Py_CLEAR(clear_module_state->__pyx_kp_s_Surface_has_unsupported_bytesize); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_lock); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_map_rgb); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_mustlock); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_scroll); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_set_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_set_at); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_set_clip); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_set_colorkey); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_set_masks); Py_CLEAR(clear_module_state->__pyx_kp_s_Surface_set_masks_is_not_support); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_set_shifts); Py_CLEAR(clear_module_state->__pyx_kp_s_Surface_set_shifts_is_not_suppor); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_subsurface); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_unlock); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_unmap_rgb); Py_CLEAR(clear_module_state->__pyx_kp_s_Surface_x_x); Py_CLEAR(clear_module_state->__pyx_kp_s_The_data_must_fill_the_surface); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_kp_u__5); Py_CLEAR(clear_module_state->__pyx_n_s__6); Py_CLEAR(clear_module_state->__pyx_n_s__89); Py_CLEAR(clear_module_state->__pyx_n_s_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_amask); Py_CLEAR(clear_module_state->__pyx_n_s_amin); Py_CLEAR(clear_module_state->__pyx_n_s_append); Py_CLEAR(clear_module_state->__pyx_n_s_area); Py_CLEAR(clear_module_state->__pyx_n_s_area_ptr); Py_CLEAR(clear_module_state->__pyx_n_s_area_rect); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_blit); Py_CLEAR(clear_module_state->__pyx_n_s_bmask); Py_CLEAR(clear_module_state->__pyx_n_s_botright); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_clip); Py_CLEAR(clear_module_state->__pyx_n_s_color); Py_CLEAR(clear_module_state->__pyx_n_s_colorkey); Py_CLEAR(clear_module_state->__pyx_n_s_convert); Py_CLEAR(clear_module_state->__pyx_n_s_convert_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_copy); Py_CLEAR(clear_module_state->__pyx_n_s_d); Py_CLEAR(clear_module_state->__pyx_n_s_data); Py_CLEAR(clear_module_state->__pyx_n_s_depth); Py_CLEAR(clear_module_state->__pyx_n_s_dest); Py_CLEAR(clear_module_state->__pyx_n_s_dest_rect); Py_CLEAR(clear_module_state->__pyx_n_s_destptr); Py_CLEAR(clear_module_state->__pyx_n_s_destx); Py_CLEAR(clear_module_state->__pyx_n_s_desty); Py_CLEAR(clear_module_state->__pyx_n_s_dirty); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_display); Py_CLEAR(clear_module_state->__pyx_n_s_dx); Py_CLEAR(clear_module_state->__pyx_n_s_dy); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_err); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_fill); Py_CLEAR(clear_module_state->__pyx_n_s_flags); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_from_data); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_abs_offset); Py_CLEAR(clear_module_state->__pyx_n_s_get_abs_parent); Py_CLEAR(clear_module_state->__pyx_n_s_get_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_get_at); Py_CLEAR(clear_module_state->__pyx_n_s_get_at_mapped); Py_CLEAR(clear_module_state->__pyx_n_s_get_bitsize); Py_CLEAR(clear_module_state->__pyx_n_s_get_bounding_rect); Py_CLEAR(clear_module_state->__pyx_n_s_get_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_get_bytesize); Py_CLEAR(clear_module_state->__pyx_n_s_get_clip); Py_CLEAR(clear_module_state->__pyx_n_s_get_colorkey); Py_CLEAR(clear_module_state->__pyx_n_s_get_flags); Py_CLEAR(clear_module_state->__pyx_n_s_get_height); Py_CLEAR(clear_module_state->__pyx_n_s_get_locked); Py_CLEAR(clear_module_state->__pyx_n_s_get_locks); Py_CLEAR(clear_module_state->__pyx_n_s_get_losses); Py_CLEAR(clear_module_state->__pyx_n_s_get_masks); Py_CLEAR(clear_module_state->__pyx_n_s_get_offset); Py_CLEAR(clear_module_state->__pyx_n_s_get_parent); Py_CLEAR(clear_module_state->__pyx_n_s_get_pitch); Py_CLEAR(clear_module_state->__pyx_n_s_get_rect); Py_CLEAR(clear_module_state->__pyx_n_s_get_shifts); Py_CLEAR(clear_module_state->__pyx_n_s_get_size); Py_CLEAR(clear_module_state->__pyx_n_s_get_surface); Py_CLEAR(clear_module_state->__pyx_n_s_get_view); Py_CLEAR(clear_module_state->__pyx_n_s_get_width); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_gmask); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_height); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_items); Py_CLEAR(clear_module_state->__pyx_n_s_k); Py_CLEAR(clear_module_state->__pyx_n_s_key); Py_CLEAR(clear_module_state->__pyx_n_s_kind); Py_CLEAR(clear_module_state->__pyx_n_s_kwargs); Py_CLEAR(clear_module_state->__pyx_n_s_lock); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_map_rgb); Py_CLEAR(clear_module_state->__pyx_n_s_masks); Py_CLEAR(clear_module_state->__pyx_n_s_maxx); Py_CLEAR(clear_module_state->__pyx_n_s_maxy); Py_CLEAR(clear_module_state->__pyx_n_s_min_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_minx); Py_CLEAR(clear_module_state->__pyx_n_s_miny); Py_CLEAR(clear_module_state->__pyx_n_s_move_height); Py_CLEAR(clear_module_state->__pyx_n_s_move_width); Py_CLEAR(clear_module_state->__pyx_n_s_mustlock); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_new_surface); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_offset_x); Py_CLEAR(clear_module_state->__pyx_n_s_offset_y); Py_CLEAR(clear_module_state->__pyx_n_s_p); Py_CLEAR(clear_module_state->__pyx_n_s_per_pixel); Py_CLEAR(clear_module_state->__pyx_n_s_pixel); Py_CLEAR(clear_module_state->__pyx_n_s_pixel_format); Py_CLEAR(clear_module_state->__pyx_n_s_pixels); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_locals); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rect); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_surface); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_rect); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_remove); Py_CLEAR(clear_module_state->__pyx_n_s_rmask); Py_CLEAR(clear_module_state->__pyx_n_s_root); Py_CLEAR(clear_module_state->__pyx_n_s_row); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_sample_format); Py_CLEAR(clear_module_state->__pyx_n_s_scroll); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_rect); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_set_at); Py_CLEAR(clear_module_state->__pyx_n_s_set_clip); Py_CLEAR(clear_module_state->__pyx_n_s_set_colorkey); Py_CLEAR(clear_module_state->__pyx_n_s_set_masks); Py_CLEAR(clear_module_state->__pyx_n_s_set_shifts); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_shifts); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_sizeof); Py_CLEAR(clear_module_state->__pyx_n_s_source); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_special_flags); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_surface_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_srcptr); Py_CLEAR(clear_module_state->__pyx_n_s_srcx); Py_CLEAR(clear_module_state->__pyx_n_s_srcy); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_subsurface); Py_CLEAR(clear_module_state->__pyx_kp_s_subsurface_rectangle_outside_sur); Py_CLEAR(clear_module_state->__pyx_kp_s_subsurface_size_must_be_non_nega); Py_CLEAR(clear_module_state->__pyx_n_s_surf); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_temp); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_topleft); Py_CLEAR(clear_module_state->__pyx_n_s_total_size); Py_CLEAR(clear_module_state->__pyx_n_s_unlock); Py_CLEAR(clear_module_state->__pyx_n_s_unmap_rgb); Py_CLEAR(clear_module_state->__pyx_n_s_use_format); Py_CLEAR(clear_module_state->__pyx_n_s_v); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_warn); Py_CLEAR(clear_module_state->__pyx_n_s_warnings); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_32); Py_CLEAR(clear_module_state->__pyx_int_255); Py_CLEAR(clear_module_state->__pyx_int_16843009); Py_CLEAR(clear_module_state->__pyx_int_4294967295); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__34); Py_CLEAR(clear_module_state->__pyx_tuple__38); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_tuple__47); Py_CLEAR(clear_module_state->__pyx_tuple__49); Py_CLEAR(clear_module_state->__pyx_tuple__51); Py_CLEAR(clear_module_state->__pyx_tuple__56); Py_CLEAR(clear_module_state->__pyx_tuple__61); Py_CLEAR(clear_module_state->__pyx_tuple__67); Py_CLEAR(clear_module_state->__pyx_tuple__69); Py_CLEAR(clear_module_state->__pyx_tuple__72); Py_CLEAR(clear_module_state->__pyx_tuple__76); Py_CLEAR(clear_module_state->__pyx_tuple__78); Py_CLEAR(clear_module_state->__pyx_tuple__79); Py_CLEAR(clear_module_state->__pyx_tuple__81); Py_CLEAR(clear_module_state->__pyx_tuple__82); Py_CLEAR(clear_module_state->__pyx_tuple__84); Py_CLEAR(clear_module_state->__pyx_tuple__87); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__37); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__42); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__48); Py_CLEAR(clear_module_state->__pyx_codeobj__50); Py_CLEAR(clear_module_state->__pyx_codeobj__52); Py_CLEAR(clear_module_state->__pyx_codeobj__53); Py_CLEAR(clear_module_state->__pyx_codeobj__54); Py_CLEAR(clear_module_state->__pyx_codeobj__55); Py_CLEAR(clear_module_state->__pyx_codeobj__57); Py_CLEAR(clear_module_state->__pyx_codeobj__58); Py_CLEAR(clear_module_state->__pyx_codeobj__59); Py_CLEAR(clear_module_state->__pyx_codeobj__60); Py_CLEAR(clear_module_state->__pyx_codeobj__62); Py_CLEAR(clear_module_state->__pyx_codeobj__63); Py_CLEAR(clear_module_state->__pyx_codeobj__64); Py_CLEAR(clear_module_state->__pyx_codeobj__65); Py_CLEAR(clear_module_state->__pyx_codeobj__66); Py_CLEAR(clear_module_state->__pyx_codeobj__68); Py_CLEAR(clear_module_state->__pyx_codeobj__70); Py_CLEAR(clear_module_state->__pyx_codeobj__71); Py_CLEAR(clear_module_state->__pyx_codeobj__73); Py_CLEAR(clear_module_state->__pyx_codeobj__74); Py_CLEAR(clear_module_state->__pyx_codeobj__75); Py_CLEAR(clear_module_state->__pyx_codeobj__77); Py_CLEAR(clear_module_state->__pyx_codeobj__80); Py_CLEAR(clear_module_state->__pyx_codeobj__83); Py_CLEAR(clear_module_state->__pyx_codeobj__85); Py_CLEAR(clear_module_state->__pyx_codeobj__86); Py_CLEAR(clear_module_state->__pyx_codeobj__88); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_kp_s_2); Py_VISIT(traverse_module_state->__pyx_kp_s_A_null_pointer_was_passed_in); Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); Py_VISIT(traverse_module_state->__pyx_kp_s_Memory_leak_via_Surface_in_pygam); Py_VISIT(traverse_module_state->__pyx_kp_s_Position_outside_surface); Py_VISIT(traverse_module_state->__pyx_n_s_Rect); Py_VISIT(traverse_module_state->__pyx_n_s_SRCALPHA); Py_VISIT(traverse_module_state->__pyx_n_s_Surface); Py_VISIT(traverse_module_state->__pyx_n_s_Surface___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Surface___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Surface___sizeof); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_blit); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_convert); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_convert_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_copy); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_fill); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_from_data); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_abs_offset); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_abs_parent); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_at); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_at_mapped); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_bitsize); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_bounding_rect); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_bytesize); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_clip); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_colorkey); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_flags); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_height); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_locked); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_locks); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_losses); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_masks); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_offset); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_parent); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_pitch); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_rect); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_shifts); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_size); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_view); Py_VISIT(traverse_module_state->__pyx_kp_s_Surface_get_view_is_not_supporte); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_width); Py_VISIT(traverse_module_state->__pyx_kp_s_Surface_has_unsupported_bytesize); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_lock); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_map_rgb); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_mustlock); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_scroll); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_set_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_set_at); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_set_clip); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_set_colorkey); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_set_masks); Py_VISIT(traverse_module_state->__pyx_kp_s_Surface_set_masks_is_not_support); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_set_shifts); Py_VISIT(traverse_module_state->__pyx_kp_s_Surface_set_shifts_is_not_suppor); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_subsurface); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_unlock); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_unmap_rgb); Py_VISIT(traverse_module_state->__pyx_kp_s_Surface_x_x); Py_VISIT(traverse_module_state->__pyx_kp_s_The_data_must_fill_the_surface); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_kp_u__5); Py_VISIT(traverse_module_state->__pyx_n_s__6); Py_VISIT(traverse_module_state->__pyx_n_s__89); Py_VISIT(traverse_module_state->__pyx_n_s_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_amask); Py_VISIT(traverse_module_state->__pyx_n_s_amin); Py_VISIT(traverse_module_state->__pyx_n_s_append); Py_VISIT(traverse_module_state->__pyx_n_s_area); Py_VISIT(traverse_module_state->__pyx_n_s_area_ptr); Py_VISIT(traverse_module_state->__pyx_n_s_area_rect); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_blit); Py_VISIT(traverse_module_state->__pyx_n_s_bmask); Py_VISIT(traverse_module_state->__pyx_n_s_botright); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_clip); Py_VISIT(traverse_module_state->__pyx_n_s_color); Py_VISIT(traverse_module_state->__pyx_n_s_colorkey); Py_VISIT(traverse_module_state->__pyx_n_s_convert); Py_VISIT(traverse_module_state->__pyx_n_s_convert_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_copy); Py_VISIT(traverse_module_state->__pyx_n_s_d); Py_VISIT(traverse_module_state->__pyx_n_s_data); Py_VISIT(traverse_module_state->__pyx_n_s_depth); Py_VISIT(traverse_module_state->__pyx_n_s_dest); Py_VISIT(traverse_module_state->__pyx_n_s_dest_rect); Py_VISIT(traverse_module_state->__pyx_n_s_destptr); Py_VISIT(traverse_module_state->__pyx_n_s_destx); Py_VISIT(traverse_module_state->__pyx_n_s_desty); Py_VISIT(traverse_module_state->__pyx_n_s_dirty); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_display); Py_VISIT(traverse_module_state->__pyx_n_s_dx); Py_VISIT(traverse_module_state->__pyx_n_s_dy); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_err); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_fill); Py_VISIT(traverse_module_state->__pyx_n_s_flags); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_from_data); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_abs_offset); Py_VISIT(traverse_module_state->__pyx_n_s_get_abs_parent); Py_VISIT(traverse_module_state->__pyx_n_s_get_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_get_at); Py_VISIT(traverse_module_state->__pyx_n_s_get_at_mapped); Py_VISIT(traverse_module_state->__pyx_n_s_get_bitsize); Py_VISIT(traverse_module_state->__pyx_n_s_get_bounding_rect); Py_VISIT(traverse_module_state->__pyx_n_s_get_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_get_bytesize); Py_VISIT(traverse_module_state->__pyx_n_s_get_clip); Py_VISIT(traverse_module_state->__pyx_n_s_get_colorkey); Py_VISIT(traverse_module_state->__pyx_n_s_get_flags); Py_VISIT(traverse_module_state->__pyx_n_s_get_height); Py_VISIT(traverse_module_state->__pyx_n_s_get_locked); Py_VISIT(traverse_module_state->__pyx_n_s_get_locks); Py_VISIT(traverse_module_state->__pyx_n_s_get_losses); Py_VISIT(traverse_module_state->__pyx_n_s_get_masks); Py_VISIT(traverse_module_state->__pyx_n_s_get_offset); Py_VISIT(traverse_module_state->__pyx_n_s_get_parent); Py_VISIT(traverse_module_state->__pyx_n_s_get_pitch); Py_VISIT(traverse_module_state->__pyx_n_s_get_rect); Py_VISIT(traverse_module_state->__pyx_n_s_get_shifts); Py_VISIT(traverse_module_state->__pyx_n_s_get_size); Py_VISIT(traverse_module_state->__pyx_n_s_get_surface); Py_VISIT(traverse_module_state->__pyx_n_s_get_view); Py_VISIT(traverse_module_state->__pyx_n_s_get_width); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_gmask); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_height); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_items); Py_VISIT(traverse_module_state->__pyx_n_s_k); Py_VISIT(traverse_module_state->__pyx_n_s_key); Py_VISIT(traverse_module_state->__pyx_n_s_kind); Py_VISIT(traverse_module_state->__pyx_n_s_kwargs); Py_VISIT(traverse_module_state->__pyx_n_s_lock); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_map_rgb); Py_VISIT(traverse_module_state->__pyx_n_s_masks); Py_VISIT(traverse_module_state->__pyx_n_s_maxx); Py_VISIT(traverse_module_state->__pyx_n_s_maxy); Py_VISIT(traverse_module_state->__pyx_n_s_min_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_minx); Py_VISIT(traverse_module_state->__pyx_n_s_miny); Py_VISIT(traverse_module_state->__pyx_n_s_move_height); Py_VISIT(traverse_module_state->__pyx_n_s_move_width); Py_VISIT(traverse_module_state->__pyx_n_s_mustlock); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_new_surface); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_offset_x); Py_VISIT(traverse_module_state->__pyx_n_s_offset_y); Py_VISIT(traverse_module_state->__pyx_n_s_p); Py_VISIT(traverse_module_state->__pyx_n_s_per_pixel); Py_VISIT(traverse_module_state->__pyx_n_s_pixel); Py_VISIT(traverse_module_state->__pyx_n_s_pixel_format); Py_VISIT(traverse_module_state->__pyx_n_s_pixels); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_locals); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rect); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_surface); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_rect); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_remove); Py_VISIT(traverse_module_state->__pyx_n_s_rmask); Py_VISIT(traverse_module_state->__pyx_n_s_root); Py_VISIT(traverse_module_state->__pyx_n_s_row); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_sample_format); Py_VISIT(traverse_module_state->__pyx_n_s_scroll); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_rect); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_set_at); Py_VISIT(traverse_module_state->__pyx_n_s_set_clip); Py_VISIT(traverse_module_state->__pyx_n_s_set_colorkey); Py_VISIT(traverse_module_state->__pyx_n_s_set_masks); Py_VISIT(traverse_module_state->__pyx_n_s_set_shifts); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_shifts); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_sizeof); Py_VISIT(traverse_module_state->__pyx_n_s_source); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_special_flags); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_surface_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_srcptr); Py_VISIT(traverse_module_state->__pyx_n_s_srcx); Py_VISIT(traverse_module_state->__pyx_n_s_srcy); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_subsurface); Py_VISIT(traverse_module_state->__pyx_kp_s_subsurface_rectangle_outside_sur); Py_VISIT(traverse_module_state->__pyx_kp_s_subsurface_size_must_be_non_nega); Py_VISIT(traverse_module_state->__pyx_n_s_surf); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_temp); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_topleft); Py_VISIT(traverse_module_state->__pyx_n_s_total_size); Py_VISIT(traverse_module_state->__pyx_n_s_unlock); Py_VISIT(traverse_module_state->__pyx_n_s_unmap_rgb); Py_VISIT(traverse_module_state->__pyx_n_s_use_format); Py_VISIT(traverse_module_state->__pyx_n_s_v); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_warn); Py_VISIT(traverse_module_state->__pyx_n_s_warnings); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_32); Py_VISIT(traverse_module_state->__pyx_int_255); Py_VISIT(traverse_module_state->__pyx_int_16843009); Py_VISIT(traverse_module_state->__pyx_int_4294967295); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__34); Py_VISIT(traverse_module_state->__pyx_tuple__38); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_tuple__47); Py_VISIT(traverse_module_state->__pyx_tuple__49); Py_VISIT(traverse_module_state->__pyx_tuple__51); Py_VISIT(traverse_module_state->__pyx_tuple__56); Py_VISIT(traverse_module_state->__pyx_tuple__61); Py_VISIT(traverse_module_state->__pyx_tuple__67); Py_VISIT(traverse_module_state->__pyx_tuple__69); Py_VISIT(traverse_module_state->__pyx_tuple__72); Py_VISIT(traverse_module_state->__pyx_tuple__76); Py_VISIT(traverse_module_state->__pyx_tuple__78); Py_VISIT(traverse_module_state->__pyx_tuple__79); Py_VISIT(traverse_module_state->__pyx_tuple__81); Py_VISIT(traverse_module_state->__pyx_tuple__82); Py_VISIT(traverse_module_state->__pyx_tuple__84); Py_VISIT(traverse_module_state->__pyx_tuple__87); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__37); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__42); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__48); Py_VISIT(traverse_module_state->__pyx_codeobj__50); Py_VISIT(traverse_module_state->__pyx_codeobj__52); Py_VISIT(traverse_module_state->__pyx_codeobj__53); Py_VISIT(traverse_module_state->__pyx_codeobj__54); Py_VISIT(traverse_module_state->__pyx_codeobj__55); Py_VISIT(traverse_module_state->__pyx_codeobj__57); Py_VISIT(traverse_module_state->__pyx_codeobj__58); Py_VISIT(traverse_module_state->__pyx_codeobj__59); Py_VISIT(traverse_module_state->__pyx_codeobj__60); Py_VISIT(traverse_module_state->__pyx_codeobj__62); Py_VISIT(traverse_module_state->__pyx_codeobj__63); Py_VISIT(traverse_module_state->__pyx_codeobj__64); Py_VISIT(traverse_module_state->__pyx_codeobj__65); Py_VISIT(traverse_module_state->__pyx_codeobj__66); Py_VISIT(traverse_module_state->__pyx_codeobj__68); Py_VISIT(traverse_module_state->__pyx_codeobj__70); Py_VISIT(traverse_module_state->__pyx_codeobj__71); Py_VISIT(traverse_module_state->__pyx_codeobj__73); Py_VISIT(traverse_module_state->__pyx_codeobj__74); Py_VISIT(traverse_module_state->__pyx_codeobj__75); Py_VISIT(traverse_module_state->__pyx_codeobj__77); Py_VISIT(traverse_module_state->__pyx_codeobj__80); Py_VISIT(traverse_module_state->__pyx_codeobj__83); Py_VISIT(traverse_module_state->__pyx_codeobj__85); Py_VISIT(traverse_module_state->__pyx_codeobj__86); Py_VISIT(traverse_module_state->__pyx_codeobj__88); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_5color_Color __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5color_Color #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_4rect_Rect __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_4rect_Rect #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_type_11pygame_sdl2_7surface_Surface #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #define __pyx_kp_s_2 __pyx_mstate_global->__pyx_kp_s_2 #define __pyx_kp_s_A_null_pointer_was_passed_in __pyx_mstate_global->__pyx_kp_s_A_null_pointer_was_passed_in #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError #define __pyx_kp_s_Memory_leak_via_Surface_in_pygam __pyx_mstate_global->__pyx_kp_s_Memory_leak_via_Surface_in_pygam #define __pyx_kp_s_Position_outside_surface __pyx_mstate_global->__pyx_kp_s_Position_outside_surface #define __pyx_n_s_Rect __pyx_mstate_global->__pyx_n_s_Rect #define __pyx_n_s_SRCALPHA __pyx_mstate_global->__pyx_n_s_SRCALPHA #define __pyx_n_s_Surface __pyx_mstate_global->__pyx_n_s_Surface #define __pyx_n_s_Surface___reduce_cython __pyx_mstate_global->__pyx_n_s_Surface___reduce_cython #define __pyx_n_s_Surface___setstate_cython __pyx_mstate_global->__pyx_n_s_Surface___setstate_cython #define __pyx_n_s_Surface___sizeof __pyx_mstate_global->__pyx_n_s_Surface___sizeof #define __pyx_n_s_Surface_blit __pyx_mstate_global->__pyx_n_s_Surface_blit #define __pyx_n_s_Surface_convert __pyx_mstate_global->__pyx_n_s_Surface_convert #define __pyx_n_s_Surface_convert_alpha __pyx_mstate_global->__pyx_n_s_Surface_convert_alpha #define __pyx_n_s_Surface_copy __pyx_mstate_global->__pyx_n_s_Surface_copy #define __pyx_n_s_Surface_fill __pyx_mstate_global->__pyx_n_s_Surface_fill #define __pyx_n_s_Surface_from_data __pyx_mstate_global->__pyx_n_s_Surface_from_data #define __pyx_n_s_Surface_get_abs_offset __pyx_mstate_global->__pyx_n_s_Surface_get_abs_offset #define __pyx_n_s_Surface_get_abs_parent __pyx_mstate_global->__pyx_n_s_Surface_get_abs_parent #define __pyx_n_s_Surface_get_alpha __pyx_mstate_global->__pyx_n_s_Surface_get_alpha #define __pyx_n_s_Surface_get_at __pyx_mstate_global->__pyx_n_s_Surface_get_at #define __pyx_n_s_Surface_get_at_mapped __pyx_mstate_global->__pyx_n_s_Surface_get_at_mapped #define __pyx_n_s_Surface_get_bitsize __pyx_mstate_global->__pyx_n_s_Surface_get_bitsize #define __pyx_n_s_Surface_get_bounding_rect __pyx_mstate_global->__pyx_n_s_Surface_get_bounding_rect #define __pyx_n_s_Surface_get_buffer __pyx_mstate_global->__pyx_n_s_Surface_get_buffer #define __pyx_n_s_Surface_get_bytesize __pyx_mstate_global->__pyx_n_s_Surface_get_bytesize #define __pyx_n_s_Surface_get_clip __pyx_mstate_global->__pyx_n_s_Surface_get_clip #define __pyx_n_s_Surface_get_colorkey __pyx_mstate_global->__pyx_n_s_Surface_get_colorkey #define __pyx_n_s_Surface_get_flags __pyx_mstate_global->__pyx_n_s_Surface_get_flags #define __pyx_n_s_Surface_get_height __pyx_mstate_global->__pyx_n_s_Surface_get_height #define __pyx_n_s_Surface_get_locked __pyx_mstate_global->__pyx_n_s_Surface_get_locked #define __pyx_n_s_Surface_get_locks __pyx_mstate_global->__pyx_n_s_Surface_get_locks #define __pyx_n_s_Surface_get_losses __pyx_mstate_global->__pyx_n_s_Surface_get_losses #define __pyx_n_s_Surface_get_masks __pyx_mstate_global->__pyx_n_s_Surface_get_masks #define __pyx_n_s_Surface_get_offset __pyx_mstate_global->__pyx_n_s_Surface_get_offset #define __pyx_n_s_Surface_get_parent __pyx_mstate_global->__pyx_n_s_Surface_get_parent #define __pyx_n_s_Surface_get_pitch __pyx_mstate_global->__pyx_n_s_Surface_get_pitch #define __pyx_n_s_Surface_get_rect __pyx_mstate_global->__pyx_n_s_Surface_get_rect #define __pyx_n_s_Surface_get_shifts __pyx_mstate_global->__pyx_n_s_Surface_get_shifts #define __pyx_n_s_Surface_get_size __pyx_mstate_global->__pyx_n_s_Surface_get_size #define __pyx_n_s_Surface_get_view __pyx_mstate_global->__pyx_n_s_Surface_get_view #define __pyx_kp_s_Surface_get_view_is_not_supporte __pyx_mstate_global->__pyx_kp_s_Surface_get_view_is_not_supporte #define __pyx_n_s_Surface_get_width __pyx_mstate_global->__pyx_n_s_Surface_get_width #define __pyx_kp_s_Surface_has_unsupported_bytesize __pyx_mstate_global->__pyx_kp_s_Surface_has_unsupported_bytesize #define __pyx_n_s_Surface_lock __pyx_mstate_global->__pyx_n_s_Surface_lock #define __pyx_n_s_Surface_map_rgb __pyx_mstate_global->__pyx_n_s_Surface_map_rgb #define __pyx_n_s_Surface_mustlock __pyx_mstate_global->__pyx_n_s_Surface_mustlock #define __pyx_n_s_Surface_scroll __pyx_mstate_global->__pyx_n_s_Surface_scroll #define __pyx_n_s_Surface_set_alpha __pyx_mstate_global->__pyx_n_s_Surface_set_alpha #define __pyx_n_s_Surface_set_at __pyx_mstate_global->__pyx_n_s_Surface_set_at #define __pyx_n_s_Surface_set_clip __pyx_mstate_global->__pyx_n_s_Surface_set_clip #define __pyx_n_s_Surface_set_colorkey __pyx_mstate_global->__pyx_n_s_Surface_set_colorkey #define __pyx_n_s_Surface_set_masks __pyx_mstate_global->__pyx_n_s_Surface_set_masks #define __pyx_kp_s_Surface_set_masks_is_not_support __pyx_mstate_global->__pyx_kp_s_Surface_set_masks_is_not_support #define __pyx_n_s_Surface_set_shifts __pyx_mstate_global->__pyx_n_s_Surface_set_shifts #define __pyx_kp_s_Surface_set_shifts_is_not_suppor __pyx_mstate_global->__pyx_kp_s_Surface_set_shifts_is_not_suppor #define __pyx_n_s_Surface_subsurface __pyx_mstate_global->__pyx_n_s_Surface_subsurface #define __pyx_n_s_Surface_unlock __pyx_mstate_global->__pyx_n_s_Surface_unlock #define __pyx_n_s_Surface_unmap_rgb __pyx_mstate_global->__pyx_n_s_Surface_unmap_rgb #define __pyx_kp_s_Surface_x_x __pyx_mstate_global->__pyx_kp_s_Surface_x_x #define __pyx_kp_s_The_data_must_fill_the_surface __pyx_mstate_global->__pyx_kp_s_The_data_must_fill_the_surface #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 #define __pyx_n_s__6 __pyx_mstate_global->__pyx_n_s__6 #define __pyx_n_s__89 __pyx_mstate_global->__pyx_n_s__89 #define __pyx_n_s_alpha __pyx_mstate_global->__pyx_n_s_alpha #define __pyx_n_s_amask __pyx_mstate_global->__pyx_n_s_amask #define __pyx_n_s_amin __pyx_mstate_global->__pyx_n_s_amin #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append #define __pyx_n_s_area __pyx_mstate_global->__pyx_n_s_area #define __pyx_n_s_area_ptr __pyx_mstate_global->__pyx_n_s_area_ptr #define __pyx_n_s_area_rect __pyx_mstate_global->__pyx_n_s_area_rect #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_blit __pyx_mstate_global->__pyx_n_s_blit #define __pyx_n_s_bmask __pyx_mstate_global->__pyx_n_s_bmask #define __pyx_n_s_botright __pyx_mstate_global->__pyx_n_s_botright #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_clip __pyx_mstate_global->__pyx_n_s_clip #define __pyx_n_s_color __pyx_mstate_global->__pyx_n_s_color #define __pyx_n_s_colorkey __pyx_mstate_global->__pyx_n_s_colorkey #define __pyx_n_s_convert __pyx_mstate_global->__pyx_n_s_convert #define __pyx_n_s_convert_alpha __pyx_mstate_global->__pyx_n_s_convert_alpha #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy #define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data #define __pyx_n_s_depth __pyx_mstate_global->__pyx_n_s_depth #define __pyx_n_s_dest __pyx_mstate_global->__pyx_n_s_dest #define __pyx_n_s_dest_rect __pyx_mstate_global->__pyx_n_s_dest_rect #define __pyx_n_s_destptr __pyx_mstate_global->__pyx_n_s_destptr #define __pyx_n_s_destx __pyx_mstate_global->__pyx_n_s_destx #define __pyx_n_s_desty __pyx_mstate_global->__pyx_n_s_desty #define __pyx_n_s_dirty __pyx_mstate_global->__pyx_n_s_dirty #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display #define __pyx_n_s_dx __pyx_mstate_global->__pyx_n_s_dx #define __pyx_n_s_dy __pyx_mstate_global->__pyx_n_s_dy #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_fill __pyx_mstate_global->__pyx_n_s_fill #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_from_data __pyx_mstate_global->__pyx_n_s_from_data #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_abs_offset __pyx_mstate_global->__pyx_n_s_get_abs_offset #define __pyx_n_s_get_abs_parent __pyx_mstate_global->__pyx_n_s_get_abs_parent #define __pyx_n_s_get_alpha __pyx_mstate_global->__pyx_n_s_get_alpha #define __pyx_n_s_get_at __pyx_mstate_global->__pyx_n_s_get_at #define __pyx_n_s_get_at_mapped __pyx_mstate_global->__pyx_n_s_get_at_mapped #define __pyx_n_s_get_bitsize __pyx_mstate_global->__pyx_n_s_get_bitsize #define __pyx_n_s_get_bounding_rect __pyx_mstate_global->__pyx_n_s_get_bounding_rect #define __pyx_n_s_get_buffer __pyx_mstate_global->__pyx_n_s_get_buffer #define __pyx_n_s_get_bytesize __pyx_mstate_global->__pyx_n_s_get_bytesize #define __pyx_n_s_get_clip __pyx_mstate_global->__pyx_n_s_get_clip #define __pyx_n_s_get_colorkey __pyx_mstate_global->__pyx_n_s_get_colorkey #define __pyx_n_s_get_flags __pyx_mstate_global->__pyx_n_s_get_flags #define __pyx_n_s_get_height __pyx_mstate_global->__pyx_n_s_get_height #define __pyx_n_s_get_locked __pyx_mstate_global->__pyx_n_s_get_locked #define __pyx_n_s_get_locks __pyx_mstate_global->__pyx_n_s_get_locks #define __pyx_n_s_get_losses __pyx_mstate_global->__pyx_n_s_get_losses #define __pyx_n_s_get_masks __pyx_mstate_global->__pyx_n_s_get_masks #define __pyx_n_s_get_offset __pyx_mstate_global->__pyx_n_s_get_offset #define __pyx_n_s_get_parent __pyx_mstate_global->__pyx_n_s_get_parent #define __pyx_n_s_get_pitch __pyx_mstate_global->__pyx_n_s_get_pitch #define __pyx_n_s_get_rect __pyx_mstate_global->__pyx_n_s_get_rect #define __pyx_n_s_get_shifts __pyx_mstate_global->__pyx_n_s_get_shifts #define __pyx_n_s_get_size __pyx_mstate_global->__pyx_n_s_get_size #define __pyx_n_s_get_surface __pyx_mstate_global->__pyx_n_s_get_surface #define __pyx_n_s_get_view __pyx_mstate_global->__pyx_n_s_get_view #define __pyx_n_s_get_width __pyx_mstate_global->__pyx_n_s_get_width #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_gmask __pyx_mstate_global->__pyx_n_s_gmask #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_height __pyx_mstate_global->__pyx_n_s_height #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items #define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k #define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key #define __pyx_n_s_kind __pyx_mstate_global->__pyx_n_s_kind #define __pyx_n_s_kwargs __pyx_mstate_global->__pyx_n_s_kwargs #define __pyx_n_s_lock __pyx_mstate_global->__pyx_n_s_lock #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_map_rgb __pyx_mstate_global->__pyx_n_s_map_rgb #define __pyx_n_s_masks __pyx_mstate_global->__pyx_n_s_masks #define __pyx_n_s_maxx __pyx_mstate_global->__pyx_n_s_maxx #define __pyx_n_s_maxy __pyx_mstate_global->__pyx_n_s_maxy #define __pyx_n_s_min_alpha __pyx_mstate_global->__pyx_n_s_min_alpha #define __pyx_n_s_minx __pyx_mstate_global->__pyx_n_s_minx #define __pyx_n_s_miny __pyx_mstate_global->__pyx_n_s_miny #define __pyx_n_s_move_height __pyx_mstate_global->__pyx_n_s_move_height #define __pyx_n_s_move_width __pyx_mstate_global->__pyx_n_s_move_width #define __pyx_n_s_mustlock __pyx_mstate_global->__pyx_n_s_mustlock #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_new_surface __pyx_mstate_global->__pyx_n_s_new_surface #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_offset_x __pyx_mstate_global->__pyx_n_s_offset_x #define __pyx_n_s_offset_y __pyx_mstate_global->__pyx_n_s_offset_y #define __pyx_n_s_p __pyx_mstate_global->__pyx_n_s_p #define __pyx_n_s_per_pixel __pyx_mstate_global->__pyx_n_s_per_pixel #define __pyx_n_s_pixel __pyx_mstate_global->__pyx_n_s_pixel #define __pyx_n_s_pixel_format __pyx_mstate_global->__pyx_n_s_pixel_format #define __pyx_n_s_pixels __pyx_mstate_global->__pyx_n_s_pixels #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_locals __pyx_mstate_global->__pyx_n_s_pygame_sdl2_locals #define __pyx_n_s_pygame_sdl2_rect __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rect #define __pyx_n_s_pygame_sdl2_surface __pyx_mstate_global->__pyx_n_s_pygame_sdl2_surface #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_rect __pyx_mstate_global->__pyx_n_s_rect #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_remove __pyx_mstate_global->__pyx_n_s_remove #define __pyx_n_s_rmask __pyx_mstate_global->__pyx_n_s_rmask #define __pyx_n_s_root __pyx_mstate_global->__pyx_n_s_root #define __pyx_n_s_row __pyx_mstate_global->__pyx_n_s_row #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_sample_format __pyx_mstate_global->__pyx_n_s_sample_format #define __pyx_n_s_scroll __pyx_mstate_global->__pyx_n_s_scroll #define __pyx_n_s_sdl_rect __pyx_mstate_global->__pyx_n_s_sdl_rect #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_alpha __pyx_mstate_global->__pyx_n_s_set_alpha #define __pyx_n_s_set_at __pyx_mstate_global->__pyx_n_s_set_at #define __pyx_n_s_set_clip __pyx_mstate_global->__pyx_n_s_set_clip #define __pyx_n_s_set_colorkey __pyx_mstate_global->__pyx_n_s_set_colorkey #define __pyx_n_s_set_masks __pyx_mstate_global->__pyx_n_s_set_masks #define __pyx_n_s_set_shifts __pyx_mstate_global->__pyx_n_s_set_shifts #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_shifts __pyx_mstate_global->__pyx_n_s_shifts #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_sizeof __pyx_mstate_global->__pyx_n_s_sizeof #define __pyx_n_s_source __pyx_mstate_global->__pyx_n_s_source #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_special_flags __pyx_mstate_global->__pyx_n_s_special_flags #define __pyx_kp_s_src_pygame_sdl2_surface_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_surface_pyx #define __pyx_n_s_srcptr __pyx_mstate_global->__pyx_n_s_srcptr #define __pyx_n_s_srcx __pyx_mstate_global->__pyx_n_s_srcx #define __pyx_n_s_srcy __pyx_mstate_global->__pyx_n_s_srcy #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_subsurface __pyx_mstate_global->__pyx_n_s_subsurface #define __pyx_kp_s_subsurface_rectangle_outside_sur __pyx_mstate_global->__pyx_kp_s_subsurface_rectangle_outside_sur #define __pyx_kp_s_subsurface_size_must_be_non_nega __pyx_mstate_global->__pyx_kp_s_subsurface_size_must_be_non_nega #define __pyx_n_s_surf __pyx_mstate_global->__pyx_n_s_surf #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_temp __pyx_mstate_global->__pyx_n_s_temp #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_topleft __pyx_mstate_global->__pyx_n_s_topleft #define __pyx_n_s_total_size __pyx_mstate_global->__pyx_n_s_total_size #define __pyx_n_s_unlock __pyx_mstate_global->__pyx_n_s_unlock #define __pyx_n_s_unmap_rgb __pyx_mstate_global->__pyx_n_s_unmap_rgb #define __pyx_n_s_use_format __pyx_mstate_global->__pyx_n_s_use_format #define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn #define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 #define __pyx_int_255 __pyx_mstate_global->__pyx_int_255 #define __pyx_int_16843009 __pyx_mstate_global->__pyx_int_16843009 #define __pyx_int_4294967295 __pyx_mstate_global->__pyx_int_4294967295 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 #define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 #define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 #define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72 #define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 #define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 #define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81 #define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82 #define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 #define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 #define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 #define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54 #define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 #define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 #define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 #define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 #define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62 #define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63 #define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64 #define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 #define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 #define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68 #define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 #define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71 #define __pyx_codeobj__73 __pyx_mstate_global->__pyx_codeobj__73 #define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74 #define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75 #define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 #define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 #define __pyx_codeobj__83 __pyx_mstate_global->__pyx_codeobj__83 #define __pyx_codeobj__85 __pyx_mstate_global->__pyx_codeobj__85 #define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86 #define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88 /* #### Code section: module_code ### */ /* "pygame_sdl2/surface.pyx":37 * SDL_Surface * dst, SDL_Rect * dstrect, int the_args); * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) noexcept nogil: # <<<<<<<<<<<<<< * if src < dst: * src += (h - 1) * srcpitch; */ static void __pyx_f_11pygame_sdl2_7surface_move_pixels(Uint8 *__pyx_v_src, Uint8 *__pyx_v_dst, int __pyx_v_h, int __pyx_v_span, int __pyx_v_srcpitch, int __pyx_v_dstpitch) { int __pyx_t_1; /* "pygame_sdl2/surface.pyx":38 * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) noexcept nogil: * if src < dst: # <<<<<<<<<<<<<< * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; */ __pyx_t_1 = (__pyx_v_src < __pyx_v_dst); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":39 * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) noexcept nogil: * if src < dst: * src += (h - 1) * srcpitch; # <<<<<<<<<<<<<< * dst += (h - 1) * dstpitch; * srcpitch = -srcpitch; */ __pyx_v_src = (__pyx_v_src + ((__pyx_v_h - 1) * __pyx_v_srcpitch)); /* "pygame_sdl2/surface.pyx":40 * if src < dst: * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; # <<<<<<<<<<<<<< * srcpitch = -srcpitch; * dstpitch = -dstpitch; */ __pyx_v_dst = (__pyx_v_dst + ((__pyx_v_h - 1) * __pyx_v_dstpitch)); /* "pygame_sdl2/surface.pyx":41 * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; * srcpitch = -srcpitch; # <<<<<<<<<<<<<< * dstpitch = -dstpitch; * */ __pyx_v_srcpitch = (-__pyx_v_srcpitch); /* "pygame_sdl2/surface.pyx":42 * dst += (h - 1) * dstpitch; * srcpitch = -srcpitch; * dstpitch = -dstpitch; # <<<<<<<<<<<<<< * * while h: */ __pyx_v_dstpitch = (-__pyx_v_dstpitch); /* "pygame_sdl2/surface.pyx":38 * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) noexcept nogil: * if src < dst: # <<<<<<<<<<<<<< * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; */ } /* "pygame_sdl2/surface.pyx":44 * dstpitch = -dstpitch; * * while h: # <<<<<<<<<<<<<< * h -= 1 * memmove(dst, src, span); */ while (1) { __pyx_t_1 = (__pyx_v_h != 0); if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":45 * * while h: * h -= 1 # <<<<<<<<<<<<<< * memmove(dst, src, span); * src += srcpitch; */ __pyx_v_h = (__pyx_v_h - 1); /* "pygame_sdl2/surface.pyx":46 * while h: * h -= 1 * memmove(dst, src, span); # <<<<<<<<<<<<<< * src += srcpitch; * dst += dstpitch; */ (void)(memmove(__pyx_v_dst, __pyx_v_src, __pyx_v_span)); /* "pygame_sdl2/surface.pyx":47 * h -= 1 * memmove(dst, src, span); * src += srcpitch; # <<<<<<<<<<<<<< * dst += dstpitch; * */ __pyx_v_src = (__pyx_v_src + __pyx_v_srcpitch); /* "pygame_sdl2/surface.pyx":48 * memmove(dst, src, span); * src += srcpitch; * dst += dstpitch; # <<<<<<<<<<<<<< * * # The total size of all allocated surfaces */ __pyx_v_dst = (__pyx_v_dst + __pyx_v_dstpitch); } /* "pygame_sdl2/surface.pyx":37 * SDL_Surface * dst, SDL_Rect * dstrect, int the_args); * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) noexcept nogil: # <<<<<<<<<<<<<< * if src < dst: * src += (h - 1) * srcpitch; */ /* function exit code */ } /* "pygame_sdl2/surface.pyx":55 * cdef class Surface: * * def __cinit__(self): # <<<<<<<<<<<<<< * self.surface = NULL * self.owns_surface = False */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface___cinit__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7surface_7Surface___cinit__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/surface.pyx":56 * * def __cinit__(self): * self.surface = NULL # <<<<<<<<<<<<<< * self.owns_surface = False * self.window_surface = False */ __pyx_v_self->surface = NULL; /* "pygame_sdl2/surface.pyx":57 * def __cinit__(self): * self.surface = NULL * self.owns_surface = False # <<<<<<<<<<<<<< * self.window_surface = False * self.has_alpha = False */ __pyx_v_self->owns_surface = 0; /* "pygame_sdl2/surface.pyx":58 * self.surface = NULL * self.owns_surface = False * self.window_surface = False # <<<<<<<<<<<<<< * self.has_alpha = False * */ __pyx_v_self->window_surface = 0; /* "pygame_sdl2/surface.pyx":59 * self.owns_surface = False * self.window_surface = False * self.has_alpha = False # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->has_alpha = 0; /* "pygame_sdl2/surface.pyx":55 * cdef class Surface: * * def __cinit__(self): # <<<<<<<<<<<<<< * self.surface = NULL * self.owns_surface = False */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/surface.pyx":61 * self.has_alpha = False * * def __dealloc__(self): # <<<<<<<<<<<<<< * global total_size * */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_7surface_7Surface_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_7surface_7Surface_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_7surface_7Surface_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_7surface_7Surface_2__dealloc__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 1); /* "pygame_sdl2/surface.pyx":64 * global total_size * * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * if total_size: * total_size -= self.surface.pitch * self.surface.h */ __pyx_t_2 = (__pyx_v_self->surface != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = __pyx_v_self->owns_surface; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":65 * * if self.surface and self.owns_surface: * if total_size: # <<<<<<<<<<<<<< * total_size -= self.surface.pitch * self.surface.h * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_total_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":66 * if self.surface and self.owns_surface: * if total_size: * total_size -= self.surface.pitch * self.surface.h # <<<<<<<<<<<<<< * * SDL_FreeSurface(self.surface) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_total_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->surface->pitch * __pyx_v_self->surface->h)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_size, __pyx_t_5) < 0) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/surface.pyx":65 * * if self.surface and self.owns_surface: * if total_size: # <<<<<<<<<<<<<< * total_size -= self.surface.pitch * self.surface.h * */ } /* "pygame_sdl2/surface.pyx":68 * total_size -= self.surface.pitch * self.surface.h * * SDL_FreeSurface(self.surface) # <<<<<<<<<<<<<< * return * elif self.window_surface: */ SDL_FreeSurface(__pyx_v_self->surface); /* "pygame_sdl2/surface.pyx":69 * * SDL_FreeSurface(self.surface) * return # <<<<<<<<<<<<<< * elif self.window_surface: * return */ goto __pyx_L0; /* "pygame_sdl2/surface.pyx":64 * global total_size * * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * if total_size: * total_size -= self.surface.pitch * self.surface.h */ } /* "pygame_sdl2/surface.pyx":70 * SDL_FreeSurface(self.surface) * return * elif self.window_surface: # <<<<<<<<<<<<<< * return * elif self.parent: */ if (__pyx_v_self->window_surface) { /* "pygame_sdl2/surface.pyx":71 * return * elif self.window_surface: * return # <<<<<<<<<<<<<< * elif self.parent: * SDL_FreeSurface(self.surface) */ goto __pyx_L0; /* "pygame_sdl2/surface.pyx":70 * SDL_FreeSurface(self.surface) * return * elif self.window_surface: # <<<<<<<<<<<<<< * return * elif self.parent: */ } /* "pygame_sdl2/surface.pyx":72 * elif self.window_surface: * return * elif self.parent: # <<<<<<<<<<<<<< * SDL_FreeSurface(self.surface) * return */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->parent)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 72, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":73 * return * elif self.parent: * SDL_FreeSurface(self.surface) # <<<<<<<<<<<<<< * return * */ SDL_FreeSurface(__pyx_v_self->surface); /* "pygame_sdl2/surface.pyx":74 * elif self.parent: * SDL_FreeSurface(self.surface) * return # <<<<<<<<<<<<<< * * warnings.warn("Memory leak via Surface in pygame_sdl2.") */ goto __pyx_L0; /* "pygame_sdl2/surface.pyx":72 * elif self.window_surface: * return * elif self.parent: # <<<<<<<<<<<<<< * SDL_FreeSurface(self.surface) * return */ } /* "pygame_sdl2/surface.pyx":76 * return * * warnings.warn("Memory leak via Surface in pygame_sdl2.") # <<<<<<<<<<<<<< * * def __sizeof__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_Memory_leak_via_Surface_in_pygam}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/surface.pyx":61 * self.has_alpha = False * * def __dealloc__(self): # <<<<<<<<<<<<<< * global total_size * */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_WriteUnraisable("pygame_sdl2.surface.Surface.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/surface.pyx":78 * warnings.warn("Memory leak via Surface in pygame_sdl2.") * * def __sizeof__(self): # <<<<<<<<<<<<<< * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_4__sizeof__, "Surface.__sizeof__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_5__sizeof__ = {"__sizeof__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_4__sizeof__}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__sizeof__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__sizeof__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__sizeof__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_4__sizeof__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_4__sizeof__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__sizeof__", 1); /* "pygame_sdl2/surface.pyx":79 * * def __sizeof__(self): * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * return self.surface.pitch * self.surface.h * else: */ __pyx_t_2 = (__pyx_v_self->surface != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = __pyx_v_self->owns_surface; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":80 * def __sizeof__(self): * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h # <<<<<<<<<<<<<< * else: * return 0 */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->surface->pitch * __pyx_v_self->surface->h)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":79 * * def __sizeof__(self): * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * return self.surface.pitch * self.surface.h * else: */ } /* "pygame_sdl2/surface.pyx":82 * return self.surface.pitch * self.surface.h * else: * return 0 # <<<<<<<<<<<<<< * * def __init__(self, size, flags=0, depth=32, masks=None): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":78 * warnings.warn("Memory leak via Surface in pygame_sdl2.") * * def __sizeof__(self): # <<<<<<<<<<<<<< * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__sizeof__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":84 * return 0 * * def __init__(self, size, flags=0, depth=32, masks=None): # <<<<<<<<<<<<<< * * self.locklist = None */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_depth = 0; PyObject *__pyx_v_masks = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_flags,&__pyx_n_s_depth,&__pyx_n_s_masks,0}; values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_0)); values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_32)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depth); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_masks); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 84, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_flags = values[1]; __pyx_v_depth = values[2]; __pyx_v_masks = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 84, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_6__init__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_size, __pyx_v_flags, __pyx_v_depth, __pyx_v_masks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7surface_7Surface_6__init__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_masks) { int __pyx_v_w; int __pyx_v_h; Uint32 __pyx_v_Rmask; Uint32 __pyx_v_Gmask; Uint32 __pyx_v_Bmask; Uint32 __pyx_v_Amask; SDL_Surface *__pyx_v_sample; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_pysample = 0; int __pyx_v_depth_int; SDL_Surface *__pyx_v_surface; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Uint32 __pyx_t_10; Uint32 __pyx_t_11; Uint32 __pyx_t_12; Uint32 __pyx_t_13; SDL_Surface *__pyx_t_14; Uint8 __pyx_t_15; int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/surface.pyx":86 * def __init__(self, size, flags=0, depth=32, masks=None): * * self.locklist = None # <<<<<<<<<<<<<< * self.parent = None * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->locklist); __Pyx_DECREF(__pyx_v_self->locklist); __pyx_v_self->locklist = Py_None; /* "pygame_sdl2/surface.pyx":87 * * self.locklist = None * self.parent = None # <<<<<<<<<<<<<< * * self.offset_x = 0 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF((PyObject *)__pyx_v_self->parent); __Pyx_DECREF((PyObject *)__pyx_v_self->parent); __pyx_v_self->parent = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); /* "pygame_sdl2/surface.pyx":89 * self.parent = None * * self.offset_x = 0 # <<<<<<<<<<<<<< * self.offset_y = 0 * */ __pyx_v_self->offset_x = 0; /* "pygame_sdl2/surface.pyx":90 * * self.offset_x = 0 * self.offset_y = 0 # <<<<<<<<<<<<<< * * self.get_window_flags = None */ __pyx_v_self->offset_y = 0; /* "pygame_sdl2/surface.pyx":92 * self.offset_y = 0 * * self.get_window_flags = None # <<<<<<<<<<<<<< * * # When size is an empty tuple, we do not create a surface, and */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->get_window_flags); __Pyx_DECREF(__pyx_v_self->get_window_flags); __pyx_v_self->get_window_flags = Py_None; /* "pygame_sdl2/surface.pyx":96 * # When size is an empty tuple, we do not create a surface, and * # expect our caller to set this object up. * if size == (): # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_size, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":97 * # expect our caller to set this object up. * if size == (): * return # <<<<<<<<<<<<<< * * cdef int w */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":96 * # When size is an empty tuple, we do not create a surface, and * # expect our caller to set this object up. * if size == (): # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/surface.pyx":102 * cdef int h * * w, h = size # <<<<<<<<<<<<<< * assert w >= 0 * assert h >= 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 102, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 102, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_w = __pyx_t_6; __pyx_v_h = __pyx_t_7; /* "pygame_sdl2/surface.pyx":103 * * w, h = size * assert w >= 0 # <<<<<<<<<<<<<< * assert h >= 0 * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_w >= 0); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 103, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 103, __pyx_L1_error) #endif /* "pygame_sdl2/surface.pyx":104 * w, h = size * assert w >= 0 * assert h >= 0 # <<<<<<<<<<<<<< * * cdef Uint32 Rmask, Gmask, Bmask, Amask */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_h >= 0); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 104, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 104, __pyx_L1_error) #endif /* "pygame_sdl2/surface.pyx":111 * cdef int depth_int * * if masks is not None: # <<<<<<<<<<<<<< * Rmask, Gmask, Bmask, Amask = masks * depth_int = depth */ __pyx_t_2 = (__pyx_v_masks != Py_None); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":112 * * if masks is not None: * Rmask, Gmask, Bmask, Amask = masks # <<<<<<<<<<<<<< * depth_int = depth * */ if ((likely(PyTuple_CheckExact(__pyx_v_masks))) || (PyList_CheckExact(__pyx_v_masks))) { PyObject* sequence = __pyx_v_masks; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 112, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_8 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_1,&__pyx_t_4,&__pyx_t_8}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_1,&__pyx_t_4,&__pyx_t_8}; __pyx_t_9 = PyObject_GetIter(__pyx_v_masks); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_5(__pyx_t_9); if (unlikely(!item)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_9), 4) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 112, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_10 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_10 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_11 = __Pyx_PyInt_As_uint32_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_12 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint32_t(__pyx_t_8); if (unlikely((__pyx_t_13 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_Rmask = __pyx_t_10; __pyx_v_Gmask = __pyx_t_11; __pyx_v_Bmask = __pyx_t_12; __pyx_v_Amask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":113 * if masks is not None: * Rmask, Gmask, Bmask, Amask = masks * depth_int = depth # <<<<<<<<<<<<<< * * elif isinstance(depth, Surface): */ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_depth); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error) __pyx_v_depth_int = __pyx_t_7; /* "pygame_sdl2/surface.pyx":111 * cdef int depth_int * * if masks is not None: # <<<<<<<<<<<<<< * Rmask, Gmask, Bmask, Amask = masks * depth_int = depth */ goto __pyx_L6; } /* "pygame_sdl2/surface.pyx":115 * depth_int = depth * * elif isinstance(depth, Surface): # <<<<<<<<<<<<<< * * pysample = depth */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_depth, __pyx_ptype_11pygame_sdl2_7surface_Surface); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":117 * elif isinstance(depth, Surface): * * pysample = depth # <<<<<<<<<<<<<< * sample = pysample.surface * Rmask = sample.format.Rmask */ if (!(likely(((__pyx_v_depth) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_depth, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 117, __pyx_L1_error) __pyx_t_8 = __pyx_v_depth; __Pyx_INCREF(__pyx_t_8); __pyx_v_pysample = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_8); __pyx_t_8 = 0; /* "pygame_sdl2/surface.pyx":118 * * pysample = depth * sample = pysample.surface # <<<<<<<<<<<<<< * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask */ __pyx_t_14 = __pyx_v_pysample->surface; __pyx_v_sample = __pyx_t_14; /* "pygame_sdl2/surface.pyx":119 * pysample = depth * sample = pysample.surface * Rmask = sample.format.Rmask # <<<<<<<<<<<<<< * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask */ __pyx_t_13 = __pyx_v_sample->format->Rmask; __pyx_v_Rmask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":120 * sample = pysample.surface * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask # <<<<<<<<<<<<<< * Bmask = sample.format.Bmask * Amask = sample.format.Amask */ __pyx_t_13 = __pyx_v_sample->format->Gmask; __pyx_v_Gmask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":121 * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask # <<<<<<<<<<<<<< * Amask = sample.format.Amask * depth_int = sample.format.BitsPerPixel */ __pyx_t_13 = __pyx_v_sample->format->Bmask; __pyx_v_Bmask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":122 * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask * Amask = sample.format.Amask # <<<<<<<<<<<<<< * depth_int = sample.format.BitsPerPixel * */ __pyx_t_13 = __pyx_v_sample->format->Amask; __pyx_v_Amask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":123 * Bmask = sample.format.Bmask * Amask = sample.format.Amask * depth_int = sample.format.BitsPerPixel # <<<<<<<<<<<<<< * * else: */ __pyx_t_15 = __pyx_v_sample->format->BitsPerPixel; __pyx_v_depth_int = __pyx_t_15; /* "pygame_sdl2/surface.pyx":115 * depth_int = depth * * elif isinstance(depth, Surface): # <<<<<<<<<<<<<< * * pysample = depth */ goto __pyx_L6; } /* "pygame_sdl2/surface.pyx":127 * else: * * pysample = pygame_sdl2.display.get_surface() # <<<<<<<<<<<<<< * * if pysample and pysample.surface.format.BitsPerPixel == 32: */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 127, __pyx_L1_error) __pyx_v_pysample = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_8); __pyx_t_8 = 0; /* "pygame_sdl2/surface.pyx":129 * pysample = pygame_sdl2.display.get_surface() * * if pysample and pysample.surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * sample = pysample.surface * Rmask = sample.format.Rmask */ __pyx_t_16 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_pysample)); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 129, __pyx_L1_error) if (__pyx_t_16) { } else { __pyx_t_2 = __pyx_t_16; goto __pyx_L10_bool_binop_done; } __pyx_t_16 = (__pyx_v_pysample->surface->format->BitsPerPixel == 32); __pyx_t_2 = __pyx_t_16; __pyx_L10_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":130 * * if pysample and pysample.surface.format.BitsPerPixel == 32: * sample = pysample.surface # <<<<<<<<<<<<<< * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask */ __pyx_t_14 = __pyx_v_pysample->surface; __pyx_v_sample = __pyx_t_14; /* "pygame_sdl2/surface.pyx":131 * if pysample and pysample.surface.format.BitsPerPixel == 32: * sample = pysample.surface * Rmask = sample.format.Rmask # <<<<<<<<<<<<<< * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask */ __pyx_t_13 = __pyx_v_sample->format->Rmask; __pyx_v_Rmask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":132 * sample = pysample.surface * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask # <<<<<<<<<<<<<< * Bmask = sample.format.Bmask * Amask = sample.format.Amask */ __pyx_t_13 = __pyx_v_sample->format->Gmask; __pyx_v_Gmask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":133 * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask # <<<<<<<<<<<<<< * Amask = sample.format.Amask * */ __pyx_t_13 = __pyx_v_sample->format->Bmask; __pyx_v_Bmask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":134 * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask * Amask = sample.format.Amask # <<<<<<<<<<<<<< * * else: */ __pyx_t_13 = __pyx_v_sample->format->Amask; __pyx_v_Amask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":129 * pysample = pygame_sdl2.display.get_surface() * * if pysample and pysample.surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * sample = pysample.surface * Rmask = sample.format.Rmask */ goto __pyx_L9; } /* "pygame_sdl2/surface.pyx":139 * * # RGB(A) * if SDL_BYTEORDER == SDL_BIG_ENDIAN: # <<<<<<<<<<<<<< * Rmask = 0xff000000 * Gmask = 0x00ff0000 */ /*else*/ { __pyx_t_2 = (SDL_BYTEORDER == SDL_BIG_ENDIAN); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":140 * # RGB(A) * if SDL_BYTEORDER == SDL_BIG_ENDIAN: * Rmask = 0xff000000 # <<<<<<<<<<<<<< * Gmask = 0x00ff0000 * Bmask = 0x0000ff00 */ __pyx_v_Rmask = 0xff000000; /* "pygame_sdl2/surface.pyx":141 * if SDL_BYTEORDER == SDL_BIG_ENDIAN: * Rmask = 0xff000000 * Gmask = 0x00ff0000 # <<<<<<<<<<<<<< * Bmask = 0x0000ff00 * Amask = 0 */ __pyx_v_Gmask = 0x00ff0000; /* "pygame_sdl2/surface.pyx":142 * Rmask = 0xff000000 * Gmask = 0x00ff0000 * Bmask = 0x0000ff00 # <<<<<<<<<<<<<< * Amask = 0 * else: */ __pyx_v_Bmask = 0x0000ff00; /* "pygame_sdl2/surface.pyx":143 * Gmask = 0x00ff0000 * Bmask = 0x0000ff00 * Amask = 0 # <<<<<<<<<<<<<< * else: * Rmask = 0x000000ff */ __pyx_v_Amask = 0; /* "pygame_sdl2/surface.pyx":139 * * # RGB(A) * if SDL_BYTEORDER == SDL_BIG_ENDIAN: # <<<<<<<<<<<<<< * Rmask = 0xff000000 * Gmask = 0x00ff0000 */ goto __pyx_L12; } /* "pygame_sdl2/surface.pyx":145 * Amask = 0 * else: * Rmask = 0x000000ff # <<<<<<<<<<<<<< * Gmask = 0x0000ff00 * Bmask = 0x00ff0000 */ /*else*/ { __pyx_v_Rmask = 0x000000ff; /* "pygame_sdl2/surface.pyx":146 * else: * Rmask = 0x000000ff * Gmask = 0x0000ff00 # <<<<<<<<<<<<<< * Bmask = 0x00ff0000 * Amask = 0 */ __pyx_v_Gmask = 0x0000ff00; /* "pygame_sdl2/surface.pyx":147 * Rmask = 0x000000ff * Gmask = 0x0000ff00 * Bmask = 0x00ff0000 # <<<<<<<<<<<<<< * Amask = 0 * */ __pyx_v_Bmask = 0x00ff0000; /* "pygame_sdl2/surface.pyx":148 * Gmask = 0x0000ff00 * Bmask = 0x00ff0000 * Amask = 0 # <<<<<<<<<<<<<< * * if (flags & SRCALPHA): */ __pyx_v_Amask = 0; } __pyx_L12:; } __pyx_L9:; /* "pygame_sdl2/surface.pyx":150 * Amask = 0 * * if (flags & SRCALPHA): # <<<<<<<<<<<<<< * if not Amask: * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = PyNumber_And(__pyx_v_flags, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":151 * * if (flags & SRCALPHA): * if not Amask: # <<<<<<<<<<<<<< * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) * else: */ __pyx_t_2 = (!(__pyx_v_Amask != 0)); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":152 * if (flags & SRCALPHA): * if not Amask: * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) # <<<<<<<<<<<<<< * else: * Amask = 0 */ __pyx_t_4 = __Pyx_PyInt_From_uint32_t((~((__pyx_v_Rmask | __pyx_v_Gmask) | __pyx_v_Bmask))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PyNumber_And(__pyx_int_4294967295, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint32_t(__pyx_t_8); if (unlikely((__pyx_t_13 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_Amask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":151 * * if (flags & SRCALPHA): * if not Amask: # <<<<<<<<<<<<<< * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) * else: */ } /* "pygame_sdl2/surface.pyx":150 * Amask = 0 * * if (flags & SRCALPHA): # <<<<<<<<<<<<<< * if not Amask: * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) */ goto __pyx_L13; } /* "pygame_sdl2/surface.pyx":154 * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) * else: * Amask = 0 # <<<<<<<<<<<<<< * * depth_int = 32 */ /*else*/ { __pyx_v_Amask = 0; } __pyx_L13:; /* "pygame_sdl2/surface.pyx":156 * Amask = 0 * * depth_int = 32 # <<<<<<<<<<<<<< * * cdef SDL_Surface *surface */ __pyx_v_depth_int = 32; } __pyx_L6:; /* "pygame_sdl2/surface.pyx":160 * cdef SDL_Surface *surface * * with nogil: # <<<<<<<<<<<<<< * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":161 * * with nogil: * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) # <<<<<<<<<<<<<< * * if not surface: */ __pyx_v_surface = SDL_CreateRGBSurface(0, __pyx_v_w, __pyx_v_h, __pyx_v_depth_int, __pyx_v_Rmask, __pyx_v_Gmask, __pyx_v_Bmask, __pyx_v_Amask); } /* "pygame_sdl2/surface.pyx":160 * cdef SDL_Surface *surface * * with nogil: # <<<<<<<<<<<<<< * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } /* "pygame_sdl2/surface.pyx":163 * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * * if not surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (!(__pyx_v_surface != 0)); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":164 * * if not surface: * raise error() # <<<<<<<<<<<<<< * * self.take_surface(surface) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 164, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":163 * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * * if not surface: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":166 * raise error() * * self.take_surface(surface) # <<<<<<<<<<<<<< * * cdef void take_surface(self, SDL_Surface *surface): */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_self->__pyx_vtab)->take_surface(__pyx_v_self, __pyx_v_surface); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":84 * return 0 * * def __init__(self, size, flags=0, depth=32, masks=None): # <<<<<<<<<<<<<< * * self.locklist = None */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_pysample); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":168 * self.take_surface(surface) * * cdef void take_surface(self, SDL_Surface *surface): # <<<<<<<<<<<<<< * if not surface: * raise error("A null pointer was passed in.") */ static void __pyx_f_11pygame_sdl2_7surface_7Surface_take_surface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, SDL_Surface *__pyx_v_surface) { __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("take_surface", 1); /* "pygame_sdl2/surface.pyx":169 * * cdef void take_surface(self, SDL_Surface *surface): * if not surface: # <<<<<<<<<<<<<< * raise error("A null pointer was passed in.") * */ __pyx_t_1 = (!(__pyx_v_surface != 0)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":170 * cdef void take_surface(self, SDL_Surface *surface): * if not surface: * raise error("A null pointer was passed in.") # <<<<<<<<<<<<<< * * self.surface = surface */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_A_null_pointer_was_passed_in}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 170, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":169 * * cdef void take_surface(self, SDL_Surface *surface): * if not surface: # <<<<<<<<<<<<<< * raise error("A null pointer was passed in.") * */ } /* "pygame_sdl2/surface.pyx":172 * raise error("A null pointer was passed in.") * * self.surface = surface # <<<<<<<<<<<<<< * self.owns_surface = True * */ __pyx_v_self->surface = __pyx_v_surface; /* "pygame_sdl2/surface.pyx":173 * * self.surface = surface * self.owns_surface = True # <<<<<<<<<<<<<< * * global total_size */ __pyx_v_self->owns_surface = 1; /* "pygame_sdl2/surface.pyx":177 * global total_size * * total_size += self.surface.pitch * self.surface.h # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_total_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->surface->pitch * __pyx_v_self->surface->h)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_size, __pyx_t_4) < 0) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":168 * self.take_surface(surface) * * cdef void take_surface(self, SDL_Surface *surface): # <<<<<<<<<<<<<< * if not surface: * raise error("A null pointer was passed in.") */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.take_surface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/surface.pyx":179 * total_size += self.surface.pitch * self.surface.h * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_8__repr__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_8__repr__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/surface.pyx":180 * * def __repr__(self): * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) # <<<<<<<<<<<<<< * * def blit(self, Surface source, dest, area=None, int special_flags=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Surface_x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->surface->format->BitsPerPixel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":179 * total_size += self.surface.pitch * self.surface.h * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":182 * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * * def blit(self, Surface source, dest, area=None, int special_flags=0): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_10blit, "Surface.blit(self, Surface source, dest, area=None, int special_flags=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_11blit = {"blit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_10blit}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_source = 0; PyObject *__pyx_v_dest = 0; PyObject *__pyx_v_area = 0; int __pyx_v_special_flags; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("blit (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_dest,&__pyx_n_s_area,&__pyx_n_s_special_flags,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_source)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dest)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("blit", 0, 2, 4, 1); __PYX_ERR(0, 182, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_area); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_special_flags); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "blit") < 0)) __PYX_ERR(0, 182, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_source = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_dest = values[1]; __pyx_v_area = values[2]; if (values[3]) { __pyx_v_special_flags = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_special_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) } else { __pyx_v_special_flags = ((int)0); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("blit", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 182, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.blit", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "source", 0))) __PYX_ERR(0, 182, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_10blit(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_source, __pyx_v_dest, __pyx_v_area, __pyx_v_special_flags); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_10blit(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_source, PyObject *__pyx_v_dest, PyObject *__pyx_v_area, int __pyx_v_special_flags) { SDL_Rect __pyx_v_dest_rect; SDL_Rect __pyx_v_area_rect; SDL_Rect *__pyx_v_area_ptr; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_temp = 0; int __pyx_v_err; Uint32 __pyx_v_key; Uint8 __pyx_v_alpha; int __pyx_v_colorkey; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("blit", 0); __Pyx_INCREF((PyObject *)__pyx_v_source); __Pyx_INCREF(__pyx_v_area); /* "pygame_sdl2/surface.pyx":185 * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect * cdef SDL_Rect *area_ptr = NULL # <<<<<<<<<<<<<< * * cdef Surface temp */ __pyx_v_area_ptr = NULL; /* "pygame_sdl2/surface.pyx":194 * cdef bint colorkey * * colorkey = (SDL_GetColorKey(source.surface, &key) == 0) # <<<<<<<<<<<<<< * * if not source.surface.format.Amask: */ __pyx_v_colorkey = (SDL_GetColorKey(__pyx_v_source->surface, (&__pyx_v_key)) == 0); /* "pygame_sdl2/surface.pyx":196 * colorkey = (SDL_GetColorKey(source.surface, &key) == 0) * * if not source.surface.format.Amask: # <<<<<<<<<<<<<< * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): * raise error() */ __pyx_t_1 = (!(__pyx_v_source->surface->format->Amask != 0)); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":197 * * if not source.surface.format.Amask: * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetSurfaceAlphaMod(__pyx_v_source->surface, (&__pyx_v_alpha)) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":198 * if not source.surface.format.Amask: * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): * raise error() # <<<<<<<<<<<<<< * * if alpha != 255 and (self.surface.format.Amask or colorkey): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 198, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":197 * * if not source.surface.format.Amask: * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":200 * raise error() * * if alpha != 255 and (self.surface.format.Amask or colorkey): # <<<<<<<<<<<<<< * * if area: */ __pyx_t_6 = (__pyx_v_alpha != 0xFF); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __pyx_t_6 = (__pyx_v_self->surface->format->Amask != 0); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __pyx_t_1 = __pyx_v_colorkey; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":202 * if alpha != 255 and (self.surface.format.Amask or colorkey): * * if area: # <<<<<<<<<<<<<< * source = source.subsurface(area) * area = None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_area); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":203 * * if area: * source = source.subsurface(area) # <<<<<<<<<<<<<< * area = None * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_subsurface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_area}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_source, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":204 * if area: * source = source.subsurface(area) * area = None # <<<<<<<<<<<<<< * * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_area, Py_None); /* "pygame_sdl2/surface.pyx":202 * if alpha != 255 and (self.surface.format.Amask or colorkey): * * if area: # <<<<<<<<<<<<<< * source = source.subsurface(area) * area = None */ } /* "pygame_sdl2/surface.pyx":206 * area = None * * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): # <<<<<<<<<<<<<< * raise error() * temp = Surface(source.get_size(), SRCALPHA) */ __pyx_t_1 = (SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_NONE) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":207 * * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): * raise error() # <<<<<<<<<<<<<< * temp = Surface(source.get_size(), SRCALPHA) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 207, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":206 * area = None * * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): # <<<<<<<<<<<<<< * raise error() * temp = Surface(source.get_size(), SRCALPHA) */ } /* "pygame_sdl2/surface.pyx":208 * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): * raise error() * temp = Surface(source.get_size(), SRCALPHA) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_temp = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":210 * temp = Surface(source.get_size(), SRCALPHA) * * with nogil: # <<<<<<<<<<<<<< * err = SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":211 * * with nogil: * err = SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) # <<<<<<<<<<<<<< * * if err: */ __pyx_v_err = SDL_UpperBlit(__pyx_v_source->surface, NULL, __pyx_v_temp->surface, NULL); } /* "pygame_sdl2/surface.pyx":210 * temp = Surface(source.get_size(), SRCALPHA) * * with nogil: # <<<<<<<<<<<<<< * err = SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L13; } __pyx_L13:; } } /* "pygame_sdl2/surface.pyx":213 * err = SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_err != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":214 * * if err: * raise error() # <<<<<<<<<<<<<< * * source = temp */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 214, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":213 * err = SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":216 * raise error() * * source = temp # <<<<<<<<<<<<<< * colorkey = False * */ __Pyx_INCREF((PyObject *)__pyx_v_temp); __Pyx_DECREF_SET(__pyx_v_source, __pyx_v_temp); /* "pygame_sdl2/surface.pyx":217 * * source = temp * colorkey = False # <<<<<<<<<<<<<< * * if colorkey: */ __pyx_v_colorkey = 0; /* "pygame_sdl2/surface.pyx":200 * raise error() * * if alpha != 255 and (self.surface.format.Amask or colorkey): # <<<<<<<<<<<<<< * * if area: */ } /* "pygame_sdl2/surface.pyx":196 * colorkey = (SDL_GetColorKey(source.surface, &key) == 0) * * if not source.surface.format.Amask: # <<<<<<<<<<<<<< * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): * raise error() */ } /* "pygame_sdl2/surface.pyx":219 * colorkey = False * * if colorkey: # <<<<<<<<<<<<<< * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): * raise error() */ if (__pyx_v_colorkey) { /* "pygame_sdl2/surface.pyx":220 * * if colorkey: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): # <<<<<<<<<<<<<< * raise error() * else: */ __pyx_t_1 = (SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_NONE) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":221 * if colorkey: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): * raise error() # <<<<<<<<<<<<<< * else: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 221, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":220 * * if colorkey: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): # <<<<<<<<<<<<<< * raise error() * else: */ } /* "pygame_sdl2/surface.pyx":219 * colorkey = False * * if colorkey: # <<<<<<<<<<<<<< * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): * raise error() */ goto __pyx_L15; } /* "pygame_sdl2/surface.pyx":223 * raise error() * else: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_1 = (SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_BLEND) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":224 * else: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND): * raise error() # <<<<<<<<<<<<<< * * to_sdl_rect(dest, &dest_rect, "dest") */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 224, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":223 * raise error() * else: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L15:; /* "pygame_sdl2/surface.pyx":226 * raise error() * * to_sdl_rect(dest, &dest_rect, "dest") # <<<<<<<<<<<<<< * * if area is not None: */ __pyx_t_7.__pyx_n = 1; __pyx_t_7.argname = __pyx_n_s_dest; __pyx_t_5 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), &__pyx_t_7); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 226, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":228 * to_sdl_rect(dest, &dest_rect, "dest") * * if area is not None: # <<<<<<<<<<<<<< * to_sdl_rect(area, &area_rect, "area") * area_ptr = &area_rect */ __pyx_t_1 = (__pyx_v_area != Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":229 * * if area is not None: * to_sdl_rect(area, &area_rect, "area") # <<<<<<<<<<<<<< * area_ptr = &area_rect * */ __pyx_t_7.__pyx_n = 1; __pyx_t_7.argname = __pyx_n_s_area; __pyx_t_5 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_area, (&__pyx_v_area_rect), &__pyx_t_7); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 229, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":230 * if area is not None: * to_sdl_rect(area, &area_rect, "area") * area_ptr = &area_rect # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_area_ptr = (&__pyx_v_area_rect); /* "pygame_sdl2/surface.pyx":228 * to_sdl_rect(dest, &dest_rect, "dest") * * if area is not None: # <<<<<<<<<<<<<< * to_sdl_rect(area, &area_rect, "area") * area_ptr = &area_rect */ } /* "pygame_sdl2/surface.pyx":232 * area_ptr = &area_rect * * with nogil: # <<<<<<<<<<<<<< * * if source.surface.format.Amask or special_flags: */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":234 * with nogil: * * if source.surface.format.Amask or special_flags: # <<<<<<<<<<<<<< * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) * else: */ __pyx_t_6 = (__pyx_v_source->surface->format->Amask != 0); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L23_bool_binop_done; } __pyx_t_6 = (__pyx_v_special_flags != 0); __pyx_t_1 = __pyx_t_6; __pyx_L23_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":235 * * if source.surface.format.Amask or special_flags: * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) # <<<<<<<<<<<<<< * else: * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) */ __pyx_v_err = pygame_Blit(__pyx_v_source->surface, __pyx_v_area_ptr, __pyx_v_self->surface, (&__pyx_v_dest_rect), __pyx_v_special_flags); /* "pygame_sdl2/surface.pyx":234 * with nogil: * * if source.surface.format.Amask or special_flags: # <<<<<<<<<<<<<< * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) * else: */ goto __pyx_L22; } /* "pygame_sdl2/surface.pyx":237 * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) * else: * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) # <<<<<<<<<<<<<< * * if err: */ /*else*/ { __pyx_v_err = SDL_UpperBlit(__pyx_v_source->surface, __pyx_v_area_ptr, __pyx_v_self->surface, (&__pyx_v_dest_rect)); } __pyx_L22:; } /* "pygame_sdl2/surface.pyx":232 * area_ptr = &area_rect * * with nogil: # <<<<<<<<<<<<<< * * if source.surface.format.Amask or special_flags: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L21; } __pyx_L21:; } } /* "pygame_sdl2/surface.pyx":239 * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_err != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":240 * * if err: * raise error() # <<<<<<<<<<<<<< * * dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 240, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":239 * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":242 * raise error() * * dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) # <<<<<<<<<<<<<< * return dirty.clip(self.get_rect()) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_dest, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_dest, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_source->surface->w); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_source->surface->h); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_t_2, __pyx_t_8, __pyx_t_9, __pyx_t_10}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_dirty = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":243 * * dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) * return dirty.clip(self.get_rect()) # <<<<<<<<<<<<<< * * def convert(self, surface=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":182 * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * * def blit(self, Surface source, dest, area=None, int special_flags=0): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.blit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_temp); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF((PyObject *)__pyx_v_source); __Pyx_XDECREF(__pyx_v_area); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":245 * return dirty.clip(self.get_rect()) * * def convert(self, surface=None): # <<<<<<<<<<<<<< * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_12convert, "Surface.convert(self, surface=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_13convert = {"convert", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_12convert}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_surface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("convert (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "convert") < 0)) __PYX_ERR(0, 245, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("convert", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 245, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_12convert(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_surface); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_12convert(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_surface) { SDL_PixelFormat *__pyx_v_sample_format; Uint32 __pyx_v_amask; Uint32 __pyx_v_rmask; Uint32 __pyx_v_gmask; Uint32 __pyx_v_bmask; Uint32 __pyx_v_pixel_format; SDL_Surface *__pyx_v_new_surface; CYTHON_UNUSED SDL_PixelFormat *__pyx_v_use_format; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; SDL_PixelFormat *__pyx_t_7; Uint32 __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert", 0); __Pyx_INCREF(__pyx_v_surface); /* "pygame_sdl2/surface.pyx":246 * * def convert(self, surface=None): * if not isinstance(surface, Surface): # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_surface, __pyx_ptype_11pygame_sdl2_7surface_Surface); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":247 * def convert(self, surface=None): * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() # <<<<<<<<<<<<<< * * cdef SDL_PixelFormat *sample_format */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_surface, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":246 * * def convert(self, surface=None): * if not isinstance(surface, Surface): # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ } /* "pygame_sdl2/surface.pyx":251 * cdef SDL_PixelFormat *sample_format * * if surface is None: # <<<<<<<<<<<<<< * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRX8888) * else: */ __pyx_t_2 = (__pyx_v_surface == Py_None); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":252 * * if surface is None: * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRX8888) # <<<<<<<<<<<<<< * else: * sample_format = ( surface).surface.format */ __pyx_v_sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRX8888); /* "pygame_sdl2/surface.pyx":251 * cdef SDL_PixelFormat *sample_format * * if surface is None: # <<<<<<<<<<<<<< * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRX8888) * else: */ goto __pyx_L4; } /* "pygame_sdl2/surface.pyx":254 * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRX8888) * else: * sample_format = ( surface).surface.format # <<<<<<<<<<<<<< * * cdef Uint32 amask */ /*else*/ { __pyx_t_7 = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_surface)->surface->format; __pyx_v_sample_format = __pyx_t_7; } __pyx_L4:; /* "pygame_sdl2/surface.pyx":265 * * # If the sample surface has alpha, use it. * if not sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ __pyx_t_2 = (!(__pyx_v_sample_format->Amask != 0)); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":266 * # If the sample surface has alpha, use it. * if not sample_format.Amask: * use_format = sample_format # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_use_format = __pyx_v_sample_format; /* "pygame_sdl2/surface.pyx":268 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":269 * * with nogil: * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) # <<<<<<<<<<<<<< * * if not new_surface: */ __pyx_v_new_surface = SDL_ConvertSurface(__pyx_v_self->surface, __pyx_v_sample_format, 0); } /* "pygame_sdl2/surface.pyx":268 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "pygame_sdl2/surface.pyx":271 * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (!(__pyx_v_new_surface != 0)); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":272 * * if not new_surface: * raise error() # <<<<<<<<<<<<<< * * else: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 272, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":271 * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":265 * * # If the sample surface has alpha, use it. * if not sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ goto __pyx_L5; } /* "pygame_sdl2/surface.pyx":276 * else: * * rmask = sample_format.Rmask # <<<<<<<<<<<<<< * gmask = sample_format.Gmask * bmask = sample_format.Bmask */ /*else*/ { __pyx_t_8 = __pyx_v_sample_format->Rmask; __pyx_v_rmask = __pyx_t_8; /* "pygame_sdl2/surface.pyx":277 * * rmask = sample_format.Rmask * gmask = sample_format.Gmask # <<<<<<<<<<<<<< * bmask = sample_format.Bmask * amask = 0 */ __pyx_t_8 = __pyx_v_sample_format->Gmask; __pyx_v_gmask = __pyx_t_8; /* "pygame_sdl2/surface.pyx":278 * rmask = sample_format.Rmask * gmask = sample_format.Gmask * bmask = sample_format.Bmask # <<<<<<<<<<<<<< * amask = 0 * */ __pyx_t_8 = __pyx_v_sample_format->Bmask; __pyx_v_bmask = __pyx_t_8; /* "pygame_sdl2/surface.pyx":279 * gmask = sample_format.Gmask * bmask = sample_format.Bmask * amask = 0 # <<<<<<<<<<<<<< * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) */ __pyx_v_amask = 0; /* "pygame_sdl2/surface.pyx":281 * amask = 0 * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_pixel_format = SDL_MasksToPixelFormatEnum(32, __pyx_v_rmask, __pyx_v_gmask, __pyx_v_bmask, __pyx_v_amask); /* "pygame_sdl2/surface.pyx":283 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":284 * * with nogil: * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) # <<<<<<<<<<<<<< * * if not new_surface: */ __pyx_v_new_surface = SDL_ConvertSurfaceFormat(__pyx_v_self->surface, __pyx_v_pixel_format, 0); } /* "pygame_sdl2/surface.pyx":283 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L12; } __pyx_L12:; } } /* "pygame_sdl2/surface.pyx":286 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (!(__pyx_v_new_surface != 0)); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":287 * * if not new_surface: * raise error() # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 287, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":286 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L5:; /* "pygame_sdl2/surface.pyx":289 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":290 * * cdef Surface rv = Surface(()) * rv.take_surface(new_surface) # <<<<<<<<<<<<<< * * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_new_surface); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":292 * rv.take_surface(new_surface) * * return rv # <<<<<<<<<<<<<< * * def convert_alpha(self, Surface surface=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":245 * return dirty.clip(self.get_rect()) * * def convert(self, surface=None): # <<<<<<<<<<<<<< * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XDECREF(__pyx_v_surface); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":294 * return rv * * def convert_alpha(self, Surface surface=None): # <<<<<<<<<<<<<< * if surface is None: * surface = pygame_sdl2.display.get_surface() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_14convert_alpha, "Surface.convert_alpha(self, Surface surface=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_15convert_alpha = {"convert_alpha", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_14convert_alpha}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("convert_alpha (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "convert_alpha") < 0)) __PYX_ERR(0, 294, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("convert_alpha", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 294, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 294, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_14convert_alpha(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_surface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_14convert_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface) { SDL_PixelFormat *__pyx_v_sample_format; Uint32 __pyx_v_amask; Uint32 __pyx_v_rmask; Uint32 __pyx_v_gmask; Uint32 __pyx_v_bmask; Uint32 __pyx_v_pixel_format; SDL_Surface *__pyx_v_new_surface; CYTHON_UNUSED SDL_PixelFormat *__pyx_v_use_format; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; SDL_PixelFormat *__pyx_t_6; Uint32 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_alpha", 0); __Pyx_INCREF((PyObject *)__pyx_v_surface); /* "pygame_sdl2/surface.pyx":295 * * def convert_alpha(self, Surface surface=None): * if surface is None: # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ __pyx_t_1 = (((PyObject *)__pyx_v_surface) == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":296 * def convert_alpha(self, Surface surface=None): * if surface is None: * surface = pygame_sdl2.display.get_surface() # <<<<<<<<<<<<<< * * cdef SDL_PixelFormat *sample_format */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_surface, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":295 * * def convert_alpha(self, Surface surface=None): * if surface is None: # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ } /* "pygame_sdl2/surface.pyx":300 * cdef SDL_PixelFormat *sample_format * * if surface is None: # <<<<<<<<<<<<<< * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRA8888) * else: */ __pyx_t_1 = (((PyObject *)__pyx_v_surface) == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":301 * * if surface is None: * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRA8888) # <<<<<<<<<<<<<< * else: * sample_format = ( surface).surface.format */ __pyx_v_sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRA8888); /* "pygame_sdl2/surface.pyx":300 * cdef SDL_PixelFormat *sample_format * * if surface is None: # <<<<<<<<<<<<<< * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRA8888) * else: */ goto __pyx_L4; } /* "pygame_sdl2/surface.pyx":303 * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRA8888) * else: * sample_format = ( surface).surface.format # <<<<<<<<<<<<<< * * cdef Uint32 amask = 0xff000000 */ /*else*/ { __pyx_t_6 = __pyx_v_surface->surface->format; __pyx_v_sample_format = __pyx_t_6; } __pyx_L4:; /* "pygame_sdl2/surface.pyx":305 * sample_format = ( surface).surface.format * * cdef Uint32 amask = 0xff000000 # <<<<<<<<<<<<<< * cdef Uint32 rmask = 0x00ff0000 * cdef Uint32 gmask = 0x0000ff00 */ __pyx_v_amask = 0xff000000; /* "pygame_sdl2/surface.pyx":306 * * cdef Uint32 amask = 0xff000000 * cdef Uint32 rmask = 0x00ff0000 # <<<<<<<<<<<<<< * cdef Uint32 gmask = 0x0000ff00 * cdef Uint32 bmask = 0x000000ff */ __pyx_v_rmask = 0x00ff0000; /* "pygame_sdl2/surface.pyx":307 * cdef Uint32 amask = 0xff000000 * cdef Uint32 rmask = 0x00ff0000 * cdef Uint32 gmask = 0x0000ff00 # <<<<<<<<<<<<<< * cdef Uint32 bmask = 0x000000ff * */ __pyx_v_gmask = 0x0000ff00; /* "pygame_sdl2/surface.pyx":308 * cdef Uint32 rmask = 0x00ff0000 * cdef Uint32 gmask = 0x0000ff00 * cdef Uint32 bmask = 0x000000ff # <<<<<<<<<<<<<< * * cdef Uint32 pixel_format */ __pyx_v_bmask = 0x000000ff; /* "pygame_sdl2/surface.pyx":314 * * # If the sample surface has alpha, use it. * if sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ __pyx_t_1 = (__pyx_v_sample_format->Amask != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":315 * # If the sample surface has alpha, use it. * if sample_format.Amask: * use_format = sample_format # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_use_format = __pyx_v_sample_format; /* "pygame_sdl2/surface.pyx":317 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":318 * * with nogil: * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) # <<<<<<<<<<<<<< * * if not new_surface: */ __pyx_v_new_surface = SDL_ConvertSurface(__pyx_v_self->surface, __pyx_v_sample_format, 0); } /* "pygame_sdl2/surface.pyx":317 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "pygame_sdl2/surface.pyx":320 * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (!(__pyx_v_new_surface != 0)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":321 * * if not new_surface: * raise error() # <<<<<<<<<<<<<< * * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 321, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":320 * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":314 * * # If the sample surface has alpha, use it. * if sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ goto __pyx_L5; } /* "pygame_sdl2/surface.pyx":325 * else: * * if sample_format.BytesPerPixel == 4: # <<<<<<<<<<<<<< * rmask = sample_format.Rmask * gmask = sample_format.Gmask */ /*else*/ { __pyx_t_1 = (__pyx_v_sample_format->BytesPerPixel == 4); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":326 * * if sample_format.BytesPerPixel == 4: * rmask = sample_format.Rmask # <<<<<<<<<<<<<< * gmask = sample_format.Gmask * bmask = sample_format.Bmask */ __pyx_t_7 = __pyx_v_sample_format->Rmask; __pyx_v_rmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":327 * if sample_format.BytesPerPixel == 4: * rmask = sample_format.Rmask * gmask = sample_format.Gmask # <<<<<<<<<<<<<< * bmask = sample_format.Bmask * amask = 0xffffffff & ~(rmask | gmask | bmask) */ __pyx_t_7 = __pyx_v_sample_format->Gmask; __pyx_v_gmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":328 * rmask = sample_format.Rmask * gmask = sample_format.Gmask * bmask = sample_format.Bmask # <<<<<<<<<<<<<< * amask = 0xffffffff & ~(rmask | gmask | bmask) * */ __pyx_t_7 = __pyx_v_sample_format->Bmask; __pyx_v_bmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":329 * gmask = sample_format.Gmask * bmask = sample_format.Bmask * amask = 0xffffffff & ~(rmask | gmask | bmask) # <<<<<<<<<<<<<< * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t((~((__pyx_v_rmask | __pyx_v_gmask) | __pyx_v_bmask))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_And(__pyx_int_4294967295, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_7 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_amask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":325 * else: * * if sample_format.BytesPerPixel == 4: # <<<<<<<<<<<<<< * rmask = sample_format.Rmask * gmask = sample_format.Gmask */ } /* "pygame_sdl2/surface.pyx":331 * amask = 0xffffffff & ~(rmask | gmask | bmask) * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_pixel_format = SDL_MasksToPixelFormatEnum(32, __pyx_v_rmask, __pyx_v_gmask, __pyx_v_bmask, __pyx_v_amask); /* "pygame_sdl2/surface.pyx":333 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":334 * * with nogil: * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) # <<<<<<<<<<<<<< * * if not new_surface: */ __pyx_v_new_surface = SDL_ConvertSurfaceFormat(__pyx_v_self->surface, __pyx_v_pixel_format, 0); } /* "pygame_sdl2/surface.pyx":333 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L13; } __pyx_L13:; } } /* "pygame_sdl2/surface.pyx":336 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (!(__pyx_v_new_surface != 0)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":337 * * if not new_surface: * raise error() # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 337, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":336 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L5:; /* "pygame_sdl2/surface.pyx":339 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":340 * * cdef Surface rv = Surface(()) * rv.take_surface(new_surface) # <<<<<<<<<<<<<< * * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_new_surface); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":342 * rv.take_surface(new_surface) * * return rv # <<<<<<<<<<<<<< * * def copy(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":294 * return rv * * def convert_alpha(self, Surface surface=None): # <<<<<<<<<<<<<< * if surface is None: * surface = pygame_sdl2.display.get_surface() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XDECREF((PyObject *)__pyx_v_surface); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":344 * return rv * * def copy(self): # <<<<<<<<<<<<<< * if self.surface.format.Amask: * return self.convert_alpha(self) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_16copy, "Surface.copy(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_17copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_16copy}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_16copy(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_16copy(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); /* "pygame_sdl2/surface.pyx":345 * * def copy(self): * if self.surface.format.Amask: # <<<<<<<<<<<<<< * return self.convert_alpha(self) * else: */ __pyx_t_1 = (__pyx_v_self->surface->format->Amask != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":346 * def copy(self): * if self.surface.format.Amask: * return self.convert_alpha(self) # <<<<<<<<<<<<<< * else: * return self.convert(self) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert_alpha); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":345 * * def copy(self): * if self.surface.format.Amask: # <<<<<<<<<<<<<< * return self.convert_alpha(self) * else: */ } /* "pygame_sdl2/surface.pyx":348 * return self.convert_alpha(self) * else: * return self.convert(self) # <<<<<<<<<<<<<< * * def fill(self, color, rect=None, special_flags=0): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":344 * return rv * * def copy(self): # <<<<<<<<<<<<<< * if self.surface.format.Amask: * return self.convert_alpha(self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":350 * return self.convert(self) * * def fill(self, color, rect=None, special_flags=0): # <<<<<<<<<<<<<< * * cdef SDL_Rect sdl_rect */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_18fill, "Surface.fill(self, color, rect=None, special_flags=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_19fill = {"fill", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_18fill}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; CYTHON_UNUSED PyObject *__pyx_v_special_flags = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fill (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_special_flags,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_special_flags); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fill") < 0)) __PYX_ERR(0, 350, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_color = values[0]; __pyx_v_rect = values[1]; __pyx_v_special_flags = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fill", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 350, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.fill", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_18fill(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_color, __pyx_v_rect, __pyx_v_special_flags); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_18fill(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_special_flags) { SDL_Rect __pyx_v_sdl_rect; Uint32 __pyx_v_pixel; int __pyx_v_err; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fill", 1); /* "pygame_sdl2/surface.pyx":353 * * cdef SDL_Rect sdl_rect * cdef Uint32 pixel = map_color(self.surface, color) # <<<<<<<<<<<<<< * cdef int err * */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_1 == ((Uint32)0xaabbccdd) && PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L1_error) __pyx_v_pixel = __pyx_t_1; /* "pygame_sdl2/surface.pyx":356 * cdef int err * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * */ __pyx_t_2 = (__pyx_v_rect != Py_None); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":357 * * if rect is not None: * to_sdl_rect(rect, &sdl_rect) # <<<<<<<<<<<<<< * * if sdl_rect.x < 0: */ __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 357, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":359 * to_sdl_rect(rect, &sdl_rect) * * if sdl_rect.x < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.w + sdl_rect.x * sdl_rect.x = 0 */ __pyx_t_2 = (__pyx_v_sdl_rect.x < 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":360 * * if sdl_rect.x < 0: * sdl_rect.w = sdl_rect.w + sdl_rect.x # <<<<<<<<<<<<<< * sdl_rect.x = 0 * */ __pyx_v_sdl_rect.w = (__pyx_v_sdl_rect.w + __pyx_v_sdl_rect.x); /* "pygame_sdl2/surface.pyx":361 * if sdl_rect.x < 0: * sdl_rect.w = sdl_rect.w + sdl_rect.x * sdl_rect.x = 0 # <<<<<<<<<<<<<< * * if sdl_rect.y < 0: */ __pyx_v_sdl_rect.x = 0; /* "pygame_sdl2/surface.pyx":359 * to_sdl_rect(rect, &sdl_rect) * * if sdl_rect.x < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.w + sdl_rect.x * sdl_rect.x = 0 */ } /* "pygame_sdl2/surface.pyx":363 * sdl_rect.x = 0 * * if sdl_rect.y < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.h + sdl_rect.y * sdl_rect.y = 0 */ __pyx_t_2 = (__pyx_v_sdl_rect.y < 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":364 * * if sdl_rect.y < 0: * sdl_rect.w = sdl_rect.h + sdl_rect.y # <<<<<<<<<<<<<< * sdl_rect.y = 0 * */ __pyx_v_sdl_rect.w = (__pyx_v_sdl_rect.h + __pyx_v_sdl_rect.y); /* "pygame_sdl2/surface.pyx":365 * if sdl_rect.y < 0: * sdl_rect.w = sdl_rect.h + sdl_rect.y * sdl_rect.y = 0 # <<<<<<<<<<<<<< * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: */ __pyx_v_sdl_rect.y = 0; /* "pygame_sdl2/surface.pyx":363 * sdl_rect.x = 0 * * if sdl_rect.y < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.h + sdl_rect.y * sdl_rect.y = 0 */ } /* "pygame_sdl2/surface.pyx":367 * sdl_rect.y = 0 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: # <<<<<<<<<<<<<< * return Rect(0, 0, 0, 0) * */ __pyx_t_4 = (__pyx_v_sdl_rect.w <= 0); if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L7_bool_binop_done; } __pyx_t_4 = (__pyx_v_sdl_rect.h <= 0); __pyx_t_2 = __pyx_t_4; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":368 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: * return Rect(0, 0, 0, 0) # <<<<<<<<<<<<<< * * with nogil: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":367 * sdl_rect.y = 0 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: # <<<<<<<<<<<<<< * return Rect(0, 0, 0, 0) * */ } /* "pygame_sdl2/surface.pyx":370 * return Rect(0, 0, 0, 0) * * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":371 * * with nogil: * err = SDL_FillRect(self.surface, &sdl_rect, pixel) # <<<<<<<<<<<<<< * * if err: */ __pyx_v_err = SDL_FillRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect), __pyx_v_pixel); } /* "pygame_sdl2/surface.pyx":370 * return Rect(0, 0, 0, 0) * * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } /* "pygame_sdl2/surface.pyx":373 * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_err != 0); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":374 * * if err: * raise error() # <<<<<<<<<<<<<< * * return Rect(sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_3 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_3, 0+__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 374, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":373 * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":376 * raise error() * * return Rect(sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.w); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.h); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_3 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_3, 4+__pyx_t_3); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":356 * cdef int err * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * */ } /* "pygame_sdl2/surface.pyx":379 * * else: * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, NULL, pixel) * */ /*else*/ { { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":380 * else: * with nogil: * err = SDL_FillRect(self.surface, NULL, pixel) # <<<<<<<<<<<<<< * * if err: */ __pyx_v_err = SDL_FillRect(__pyx_v_self->surface, NULL, __pyx_v_pixel); } /* "pygame_sdl2/surface.pyx":379 * * else: * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, NULL, pixel) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L15; } __pyx_L15:; } } /* "pygame_sdl2/surface.pyx":382 * err = SDL_FillRect(self.surface, NULL, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_err != 0); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":383 * * if err: * raise error() # <<<<<<<<<<<<<< * * return Rect(0, 0, self.surface.w, self.surface.h) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_3 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_3, 0+__pyx_t_3); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 383, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":382 * err = SDL_FillRect(self.surface, NULL, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":385 * raise error() * * return Rect(0, 0, self.surface.w, self.surface.h) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_3 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_int_0, __pyx_int_0, __pyx_t_10, __pyx_t_9}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_3, 4+__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":350 * return self.convert(self) * * def fill(self, color, rect=None, special_flags=0): # <<<<<<<<<<<<<< * * cdef SDL_Rect sdl_rect */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.fill", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":388 * * * def scroll(self, int dx=0, int dy=0): # <<<<<<<<<<<<<< * cdef int srcx, destx, move_width * cdef int srcy, desty, move_height */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_20scroll, "Surface.scroll(self, int dx=0, int dy=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_21scroll = {"scroll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_20scroll}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { int __pyx_v_dx; int __pyx_v_dy; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scroll (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dx,&__pyx_n_s_dy,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dx); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dy); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scroll") < 0)) __PYX_ERR(0, 388, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } if (values[0]) { __pyx_v_dx = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_dx == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error) } else { __pyx_v_dx = ((int)0); } if (values[1]) { __pyx_v_dy = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error) } else { __pyx_v_dy = ((int)0); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scroll", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 388, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.scroll", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_20scroll(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_dx, __pyx_v_dy); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_20scroll(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, int __pyx_v_dx, int __pyx_v_dy) { int __pyx_v_srcx; int __pyx_v_destx; int __pyx_v_move_width; int __pyx_v_srcy; int __pyx_v_desty; int __pyx_v_move_height; int __pyx_v_width; int __pyx_v_height; int __pyx_v_per_pixel; Uint8 *__pyx_v_srcptr; Uint8 *__pyx_v_destptr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Uint8 __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scroll", 1); /* "pygame_sdl2/surface.pyx":392 * cdef int srcy, desty, move_height * * cdef int width = self.surface.w # <<<<<<<<<<<<<< * cdef int height = self.surface.h * */ __pyx_t_1 = __pyx_v_self->surface->w; __pyx_v_width = __pyx_t_1; /* "pygame_sdl2/surface.pyx":393 * * cdef int width = self.surface.w * cdef int height = self.surface.h # <<<<<<<<<<<<<< * * cdef int per_pixel = self.surface.format.BytesPerPixel */ __pyx_t_1 = __pyx_v_self->surface->h; __pyx_v_height = __pyx_t_1; /* "pygame_sdl2/surface.pyx":395 * cdef int height = self.surface.h * * cdef int per_pixel = self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * * if dx >= 0: */ __pyx_t_2 = __pyx_v_self->surface->format->BytesPerPixel; __pyx_v_per_pixel = __pyx_t_2; /* "pygame_sdl2/surface.pyx":397 * cdef int per_pixel = self.surface.format.BytesPerPixel * * if dx >= 0: # <<<<<<<<<<<<<< * srcx = 0 * destx = dx */ __pyx_t_3 = (__pyx_v_dx >= 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":398 * * if dx >= 0: * srcx = 0 # <<<<<<<<<<<<<< * destx = dx * move_width = width - dx */ __pyx_v_srcx = 0; /* "pygame_sdl2/surface.pyx":399 * if dx >= 0: * srcx = 0 * destx = dx # <<<<<<<<<<<<<< * move_width = width - dx * else: */ __pyx_v_destx = __pyx_v_dx; /* "pygame_sdl2/surface.pyx":400 * srcx = 0 * destx = dx * move_width = width - dx # <<<<<<<<<<<<<< * else: * srcx = -dx */ __pyx_v_move_width = (__pyx_v_width - __pyx_v_dx); /* "pygame_sdl2/surface.pyx":397 * cdef int per_pixel = self.surface.format.BytesPerPixel * * if dx >= 0: # <<<<<<<<<<<<<< * srcx = 0 * destx = dx */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":402 * move_width = width - dx * else: * srcx = -dx # <<<<<<<<<<<<<< * destx = 0 * move_width = width + dx */ /*else*/ { __pyx_v_srcx = (-__pyx_v_dx); /* "pygame_sdl2/surface.pyx":403 * else: * srcx = -dx * destx = 0 # <<<<<<<<<<<<<< * move_width = width + dx * */ __pyx_v_destx = 0; /* "pygame_sdl2/surface.pyx":404 * srcx = -dx * destx = 0 * move_width = width + dx # <<<<<<<<<<<<<< * * if dy >= 0: */ __pyx_v_move_width = (__pyx_v_width + __pyx_v_dx); } __pyx_L3:; /* "pygame_sdl2/surface.pyx":406 * move_width = width + dx * * if dy >= 0: # <<<<<<<<<<<<<< * srcy = 0 * desty = dy */ __pyx_t_3 = (__pyx_v_dy >= 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":407 * * if dy >= 0: * srcy = 0 # <<<<<<<<<<<<<< * desty = dy * move_height = height - dy */ __pyx_v_srcy = 0; /* "pygame_sdl2/surface.pyx":408 * if dy >= 0: * srcy = 0 * desty = dy # <<<<<<<<<<<<<< * move_height = height - dy * else: */ __pyx_v_desty = __pyx_v_dy; /* "pygame_sdl2/surface.pyx":409 * srcy = 0 * desty = dy * move_height = height - dy # <<<<<<<<<<<<<< * else: * srcy = -dy */ __pyx_v_move_height = (__pyx_v_height - __pyx_v_dy); /* "pygame_sdl2/surface.pyx":406 * move_width = width + dx * * if dy >= 0: # <<<<<<<<<<<<<< * srcy = 0 * desty = dy */ goto __pyx_L4; } /* "pygame_sdl2/surface.pyx":411 * move_height = height - dy * else: * srcy = -dy # <<<<<<<<<<<<<< * desty = 0 * move_height = height + dy */ /*else*/ { __pyx_v_srcy = (-__pyx_v_dy); /* "pygame_sdl2/surface.pyx":412 * else: * srcy = -dy * desty = 0 # <<<<<<<<<<<<<< * move_height = height + dy * */ __pyx_v_desty = 0; /* "pygame_sdl2/surface.pyx":413 * srcy = -dy * desty = 0 * move_height = height + dy # <<<<<<<<<<<<<< * * cdef Uint8 *srcptr = self.surface.pixels */ __pyx_v_move_height = (__pyx_v_height + __pyx_v_dy); } __pyx_L4:; /* "pygame_sdl2/surface.pyx":415 * move_height = height + dy * * cdef Uint8 *srcptr = self.surface.pixels # <<<<<<<<<<<<<< * cdef Uint8 *destptr = self.surface.pixels * */ __pyx_v_srcptr = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":416 * * cdef Uint8 *srcptr = self.surface.pixels * cdef Uint8 *destptr = self.surface.pixels # <<<<<<<<<<<<<< * * srcptr += srcy * self.surface.pitch + srcx * per_pixel */ __pyx_v_destptr = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":418 * cdef Uint8 *destptr = self.surface.pixels * * srcptr += srcy * self.surface.pitch + srcx * per_pixel # <<<<<<<<<<<<<< * destptr += desty * self.surface.pitch + destx * per_pixel * */ __pyx_v_srcptr = (__pyx_v_srcptr + ((__pyx_v_srcy * __pyx_v_self->surface->pitch) + (__pyx_v_srcx * __pyx_v_per_pixel))); /* "pygame_sdl2/surface.pyx":419 * * srcptr += srcy * self.surface.pitch + srcx * per_pixel * destptr += desty * self.surface.pitch + destx * per_pixel # <<<<<<<<<<<<<< * * self.lock() */ __pyx_v_destptr = (__pyx_v_destptr + ((__pyx_v_desty * __pyx_v_self->surface->pitch) + (__pyx_v_destx * __pyx_v_per_pixel))); /* "pygame_sdl2/surface.pyx":421 * destptr += desty * self.surface.pitch + destx * per_pixel * * self.lock() # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_1 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_1 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_1, 0+__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":423 * self.lock() * * with nogil: # <<<<<<<<<<<<<< * move_pixels( * srcptr, */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":424 * * with nogil: * move_pixels( # <<<<<<<<<<<<<< * srcptr, * destptr, */ __pyx_f_11pygame_sdl2_7surface_move_pixels(__pyx_v_srcptr, __pyx_v_destptr, __pyx_v_move_height, (__pyx_v_move_width * __pyx_v_per_pixel), __pyx_v_self->surface->pitch, __pyx_v_self->surface->pitch); } /* "pygame_sdl2/surface.pyx":423 * self.lock() * * with nogil: # <<<<<<<<<<<<<< * move_pixels( * srcptr, */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L7; } __pyx_L7:; } } /* "pygame_sdl2/surface.pyx":432 * self.surface.pitch) * * self.unlock() # <<<<<<<<<<<<<< * * def set_colorkey(self, color, flags=0): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_1 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_1 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_1, 0+__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":388 * * * def scroll(self, int dx=0, int dy=0): # <<<<<<<<<<<<<< * cdef int srcx, destx, move_width * cdef int srcy, desty, move_height */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.scroll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":434 * self.unlock() * * def set_colorkey(self, color, flags=0): # <<<<<<<<<<<<<< * * if color is None: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_22set_colorkey, "Surface.set_colorkey(self, color, flags=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_23set_colorkey = {"set_colorkey", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_22set_colorkey}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_colorkey (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_flags,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 434, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 434, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_colorkey") < 0)) __PYX_ERR(0, 434, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_color = values[0]; __pyx_v_flags = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_colorkey", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 434, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_colorkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_22set_colorkey(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_color, __pyx_v_flags); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_22set_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Uint32 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_colorkey", 1); /* "pygame_sdl2/surface.pyx":436 * def set_colorkey(self, color, flags=0): * * if color is None: # <<<<<<<<<<<<<< * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): * raise error() */ __pyx_t_1 = (__pyx_v_color == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":437 * * if color is None: * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_SetColorKey(__pyx_v_self->surface, SDL_FALSE, 0) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":438 * if color is None: * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): * raise error() # <<<<<<<<<<<<<< * * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 438, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":437 * * if color is None: * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":436 * def set_colorkey(self, color, flags=0): * * if color is None: # <<<<<<<<<<<<<< * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): * raise error() */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":441 * * else: * if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_6 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_6 == ((Uint32)0xaabbccdd) && PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L1_error) __pyx_t_1 = (SDL_SetColorKey(__pyx_v_self->surface, SDL_TRUE, __pyx_t_6) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":442 * else: * if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): * raise error() # <<<<<<<<<<<<<< * * def get_colorkey(self): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 442, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":441 * * else: * if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L3:; /* "pygame_sdl2/surface.pyx":434 * self.unlock() * * def set_colorkey(self, color, flags=0): # <<<<<<<<<<<<<< * * if color is None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_colorkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":444 * raise error() * * def get_colorkey(self): # <<<<<<<<<<<<<< * cdef Uint32 key * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_24get_colorkey, "Surface.get_colorkey(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_25get_colorkey = {"get_colorkey", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_24get_colorkey}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_colorkey (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_colorkey", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_colorkey", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_24get_colorkey(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_24get_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { Uint32 __pyx_v_key; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_colorkey", 1); /* "pygame_sdl2/surface.pyx":447 * cdef Uint32 key * * if SDL_GetColorKey(self.surface, &key): # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = (SDL_GetColorKey(__pyx_v_self->surface, (&__pyx_v_key)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":448 * * if SDL_GetColorKey(self.surface, &key): * return None # <<<<<<<<<<<<<< * * return get_color(key, self.surface) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":447 * cdef Uint32 key * * if SDL_GetColorKey(self.surface, &key): # <<<<<<<<<<<<<< * return None * */ } /* "pygame_sdl2/surface.pyx":450 * return None * * return get_color(key, self.surface) # <<<<<<<<<<<<<< * * def set_alpha(self, value, flags=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5color_get_color(__pyx_v_key, __pyx_v_self->surface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":444 * raise error() * * def get_colorkey(self): # <<<<<<<<<<<<<< * cdef Uint32 key * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_colorkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":452 * return get_color(key, self.surface) * * def set_alpha(self, value, flags=0): # <<<<<<<<<<<<<< * if value is None: * value = 255 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_26set_alpha, "Surface.set_alpha(self, value, flags=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_27set_alpha = {"set_alpha", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_26set_alpha}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_value = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_alpha (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_flags,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_alpha") < 0)) __PYX_ERR(0, 452, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_value = values[0]; __pyx_v_flags = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_alpha", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 452, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_26set_alpha(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_value, __pyx_v_flags); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_26set_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Uint8 __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_alpha", 0); __Pyx_INCREF(__pyx_v_value); /* "pygame_sdl2/surface.pyx":453 * * def set_alpha(self, value, flags=0): * if value is None: # <<<<<<<<<<<<<< * value = 255 * self.has_alpha = False */ __pyx_t_1 = (__pyx_v_value == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":454 * def set_alpha(self, value, flags=0): * if value is None: * value = 255 # <<<<<<<<<<<<<< * self.has_alpha = False * else: */ __Pyx_INCREF(__pyx_int_255); __Pyx_DECREF_SET(__pyx_v_value, __pyx_int_255); /* "pygame_sdl2/surface.pyx":455 * if value is None: * value = 255 * self.has_alpha = False # <<<<<<<<<<<<<< * else: * self.has_alpha = True */ __pyx_v_self->has_alpha = 0; /* "pygame_sdl2/surface.pyx":453 * * def set_alpha(self, value, flags=0): * if value is None: # <<<<<<<<<<<<<< * value = 255 * self.has_alpha = False */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":457 * self.has_alpha = False * else: * self.has_alpha = True # <<<<<<<<<<<<<< * * if SDL_SetSurfaceAlphaMod(self.surface, value): */ /*else*/ { __pyx_v_self->has_alpha = 1; } __pyx_L3:; /* "pygame_sdl2/surface.pyx":459 * self.has_alpha = True * * if SDL_SetSurfaceAlphaMod(self.surface, value): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_2 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 459, __pyx_L1_error) __pyx_t_1 = (SDL_SetSurfaceAlphaMod(__pyx_v_self->surface, __pyx_t_2) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":460 * * if SDL_SetSurfaceAlphaMod(self.surface, value): * raise error() # <<<<<<<<<<<<<< * * def get_alpha(self): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 460, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":459 * self.has_alpha = True * * if SDL_SetSurfaceAlphaMod(self.surface, value): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":452 * return get_color(key, self.surface) * * def set_alpha(self, value, flags=0): # <<<<<<<<<<<<<< * if value is None: * value = 255 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":462 * raise error() * * def get_alpha(self): # <<<<<<<<<<<<<< * cdef Uint8 rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_28get_alpha, "Surface.get_alpha(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_29get_alpha = {"get_alpha", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_28get_alpha}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_alpha (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_alpha", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_alpha", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_28get_alpha(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_28get_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { Uint8 __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_alpha", 1); /* "pygame_sdl2/surface.pyx":465 * cdef Uint8 rv * * if self.has_alpha or self.surface.format.Amask: # <<<<<<<<<<<<<< * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): */ if (!__pyx_v_self->has_alpha) { } else { __pyx_t_1 = __pyx_v_self->has_alpha; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->surface->format->Amask != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":467 * if self.has_alpha or self.surface.format.Amask: * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetSurfaceAlphaMod(__pyx_v_self->surface, (&__pyx_v_rv)) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":468 * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): * raise error() # <<<<<<<<<<<<<< * * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 468, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":467 * if self.has_alpha or self.surface.format.Amask: * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":470 * raise error() * * return rv # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":465 * cdef Uint8 rv * * if self.has_alpha or self.surface.format.Amask: # <<<<<<<<<<<<<< * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): */ } /* "pygame_sdl2/surface.pyx":473 * * else: * return None # <<<<<<<<<<<<<< * * def lock(self, lock=None): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":462 * raise error() * * def get_alpha(self): # <<<<<<<<<<<<<< * cdef Uint8 rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":475 * return None * * def lock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_30lock, "Surface.lock(self, lock=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_31lock = {"lock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_30lock}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_lock = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lock (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lock,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lock); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lock") < 0)) __PYX_ERR(0, 475, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_lock = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lock", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 475, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.lock", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_30lock(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_lock); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_30lock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lock", 0); __Pyx_INCREF(__pyx_v_lock); /* "pygame_sdl2/surface.pyx":476 * * def lock(self, lock=None): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":478 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 478, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":479 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * if lock is None: */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":481 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ __pyx_t_1 = (__pyx_v_lock == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":482 * * if lock is None: * lock = self # <<<<<<<<<<<<<< * * if root.locklist is None: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_DECREF_SET(__pyx_v_lock, ((PyObject *)__pyx_v_self)); /* "pygame_sdl2/surface.pyx":481 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ } /* "pygame_sdl2/surface.pyx":484 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ __pyx_t_1 = (__pyx_v_root->locklist == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":485 * * if root.locklist is None: * root.locklist = [ ] # <<<<<<<<<<<<<< * * root.locklist.append(lock) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_root->locklist); __Pyx_DECREF(__pyx_v_root->locklist); __pyx_v_root->locklist = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":484 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ } /* "pygame_sdl2/surface.pyx":487 * root.locklist = [ ] * * root.locklist.append(lock) # <<<<<<<<<<<<<< * * if SDL_LockSurface(root.surface): */ __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_root->locklist, __pyx_v_lock); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 487, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":489 * root.locklist.append(lock) * * if SDL_LockSurface(root.surface): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_LockSurface(__pyx_v_root->surface) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":490 * * if SDL_LockSurface(root.surface): * raise error() # <<<<<<<<<<<<<< * * def unlock(self, lock=None): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 490, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":489 * root.locklist.append(lock) * * if SDL_LockSurface(root.surface): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":475 * return None * * def lock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.lock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XDECREF(__pyx_v_lock); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":492 * raise error() * * def unlock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_32unlock, "Surface.unlock(self, lock=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_33unlock = {"unlock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_32unlock}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_lock = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unlock (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lock,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lock); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "unlock") < 0)) __PYX_ERR(0, 492, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_lock = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("unlock", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 492, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_32unlock(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_lock); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_32unlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unlock", 0); __Pyx_INCREF(__pyx_v_lock); /* "pygame_sdl2/surface.pyx":493 * * def unlock(self, lock=None): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":495 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 495, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":496 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * if lock is None: */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":498 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ __pyx_t_1 = (__pyx_v_lock == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":499 * * if lock is None: * lock = self # <<<<<<<<<<<<<< * * if root.locklist is None: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_DECREF_SET(__pyx_v_lock, ((PyObject *)__pyx_v_self)); /* "pygame_sdl2/surface.pyx":498 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ } /* "pygame_sdl2/surface.pyx":501 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ __pyx_t_1 = (__pyx_v_root->locklist == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":502 * * if root.locklist is None: * root.locklist = [ ] # <<<<<<<<<<<<<< * * root.locklist.remove(lock) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_root->locklist); __Pyx_DECREF(__pyx_v_root->locklist); __pyx_v_root->locklist = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":501 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ } /* "pygame_sdl2/surface.pyx":504 * root.locklist = [ ] * * root.locklist.remove(lock) # <<<<<<<<<<<<<< * * SDL_UnlockSurface(root.surface) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_root->locklist, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_lock}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":506 * root.locklist.remove(lock) * * SDL_UnlockSurface(root.surface) # <<<<<<<<<<<<<< * * def mustlock(self): */ SDL_UnlockSurface(__pyx_v_root->surface); /* "pygame_sdl2/surface.pyx":492 * raise error() * * def unlock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XDECREF(__pyx_v_lock); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":508 * SDL_UnlockSurface(root.surface) * * def mustlock(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_34mustlock, "Surface.mustlock(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_35mustlock = {"mustlock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_34mustlock}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mustlock (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("mustlock", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "mustlock", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_34mustlock(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_34mustlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mustlock", 1); /* "pygame_sdl2/surface.pyx":509 * * def mustlock(self): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":511 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 511, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":512 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * return SDL_MUSTLOCK(root.surface) */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":514 * root = root.parent * * return SDL_MUSTLOCK(root.surface) # <<<<<<<<<<<<<< * * def get_locked(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_MUSTLOCK(__pyx_v_root->surface)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":508 * SDL_UnlockSurface(root.surface) * * def mustlock(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.mustlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":516 * return SDL_MUSTLOCK(root.surface) * * def get_locked(self): # <<<<<<<<<<<<<< * if self.locklist: * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_36get_locked, "Surface.get_locked(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_37get_locked = {"get_locked", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_36get_locked}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_locked (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_locked", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_locked", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_36get_locked(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_36get_locked(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_locked", 1); /* "pygame_sdl2/surface.pyx":517 * * def get_locked(self): * if self.locklist: # <<<<<<<<<<<<<< * return True * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->locklist); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 517, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":518 * def get_locked(self): * if self.locklist: * return True # <<<<<<<<<<<<<< * * def get_locks(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":517 * * def get_locked(self): * if self.locklist: # <<<<<<<<<<<<<< * return True * */ } /* "pygame_sdl2/surface.pyx":516 * return SDL_MUSTLOCK(root.surface) * * def get_locked(self): # <<<<<<<<<<<<<< * if self.locklist: * return True */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_locked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":520 * return True * * def get_locks(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_38get_locks, "Surface.get_locks(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_39get_locks = {"get_locks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_38get_locks}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_locks (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_locks", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_locks", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_38get_locks(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_38get_locks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_locks", 1); /* "pygame_sdl2/surface.pyx":521 * * def get_locks(self): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":523 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 523, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":524 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * if root.locklist is None: */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":526 * root = root.parent * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ __pyx_t_1 = (__pyx_v_root->locklist == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":527 * * if root.locklist is None: * root.locklist = [ ] # <<<<<<<<<<<<<< * * return root.locklist */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_root->locklist); __Pyx_DECREF(__pyx_v_root->locklist); __pyx_v_root->locklist = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":526 * root = root.parent * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ } /* "pygame_sdl2/surface.pyx":529 * root.locklist = [ ] * * return root.locklist # <<<<<<<<<<<<<< * * def get_at(self, pos): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_root->locklist); __pyx_r = __pyx_v_root->locklist; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":520 * return True * * def get_locks(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_locks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":531 * return root.locklist * * def get_at(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_40get_at, "Surface.get_at(self, pos)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_41get_at = {"get_at", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_40get_at}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pos = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_at (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 531, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_at") < 0)) __PYX_ERR(0, 531, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pos = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_at", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 531, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_40get_at(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_40get_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos) { int __pyx_v_x; int __pyx_v_y; Uint8 *__pyx_v_p; Uint32 __pyx_v_pixel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_at", 1); /* "pygame_sdl2/surface.pyx":535 * cdef Uint8 *p * * x, y = pos # <<<<<<<<<<<<<< * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 535, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 535, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 535, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/surface.pyx":537 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise IndexError("Position outside surface.") * */ __pyx_t_8 = (0 <= __pyx_v_x); if (__pyx_t_8) { __pyx_t_8 = (__pyx_v_x < __pyx_v_self->surface->w); } __pyx_t_9 = (!__pyx_t_8); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = (0 <= __pyx_v_y); if (__pyx_t_9) { __pyx_t_9 = (__pyx_v_y < __pyx_v_self->surface->h); } __pyx_t_8 = (!__pyx_t_9); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_7)) { /* "pygame_sdl2/surface.pyx":538 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise IndexError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 538, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":537 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise IndexError("Position outside surface.") * */ } /* "pygame_sdl2/surface.pyx":540 * raise IndexError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_7 = (__pyx_v_self->surface->format->BytesPerPixel != 4); if (unlikely(__pyx_t_7)) { /* "pygame_sdl2/surface.pyx":541 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * self.lock() */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Surface_has_unsupported_bytesize}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 541, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":540 * raise IndexError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/surface.pyx":543 * raise error("Surface has unsupported bytesize.") * * self.lock() # <<<<<<<<<<<<<< * * p = self.surface.pixels */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":545 * self.lock() * * p = self.surface.pixels # <<<<<<<<<<<<<< * p += y * self.surface.pitch * p += x * 4 */ __pyx_v_p = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":546 * * p = self.surface.pixels * p += y * self.surface.pitch # <<<<<<<<<<<<<< * p += x * 4 * */ __pyx_v_p = (__pyx_v_p + (__pyx_v_y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":547 * p = self.surface.pixels * p += y * self.surface.pitch * p += x * 4 # <<<<<<<<<<<<<< * * cdef Uint32 pixel = ( p)[0] */ __pyx_v_p = (__pyx_v_p + (__pyx_v_x * 4)); /* "pygame_sdl2/surface.pyx":549 * p += x * 4 * * cdef Uint32 pixel = ( p)[0] # <<<<<<<<<<<<<< * * self.unlock() */ __pyx_v_pixel = (((Uint32 *)__pyx_v_p)[0]); /* "pygame_sdl2/surface.pyx":551 * cdef Uint32 pixel = ( p)[0] * * self.unlock() # <<<<<<<<<<<<<< * * return get_color(pixel, self.surface) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":553 * self.unlock() * * return get_color(pixel, self.surface) # <<<<<<<<<<<<<< * * def set_at(self, pos, color): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5color_get_color(__pyx_v_pixel, __pyx_v_self->surface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":531 * return root.locklist * * def get_at(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":555 * return get_color(pixel, self.surface) * * def set_at(self, pos, color): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_42set_at, "Surface.set_at(self, pos, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_43set_at = {"set_at", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_42set_at}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pos = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_at (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_at", 1, 2, 2, 1); __PYX_ERR(0, 555, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_at") < 0)) __PYX_ERR(0, 555, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_pos = values[0]; __pyx_v_color = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_at", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 555, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_42set_at(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_pos, __pyx_v_color); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_42set_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos, PyObject *__pyx_v_color) { int __pyx_v_x; int __pyx_v_y; Uint8 *__pyx_v_p; Uint32 __pyx_v_pixel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; Uint32 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_at", 1); /* "pygame_sdl2/surface.pyx":560 * cdef Uint32 pixel * * x, y = pos # <<<<<<<<<<<<<< * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 560, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 560, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 560, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/surface.pyx":562 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ __pyx_t_8 = (0 <= __pyx_v_x); if (__pyx_t_8) { __pyx_t_8 = (__pyx_v_x < __pyx_v_self->surface->w); } __pyx_t_9 = (!__pyx_t_8); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = (0 <= __pyx_v_y); if (__pyx_t_9) { __pyx_t_9 = (__pyx_v_y < __pyx_v_self->surface->h); } __pyx_t_8 = (!__pyx_t_9); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_7)) { /* "pygame_sdl2/surface.pyx":563 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise ValueError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 563, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":562 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ } /* "pygame_sdl2/surface.pyx":565 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_7 = (__pyx_v_self->surface->format->BytesPerPixel != 4); if (unlikely(__pyx_t_7)) { /* "pygame_sdl2/surface.pyx":566 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * pixel = map_color(self.surface, color) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Surface_has_unsupported_bytesize}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 566, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":565 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/surface.pyx":568 * raise error("Surface has unsupported bytesize.") * * pixel = map_color(self.surface, color) # <<<<<<<<<<<<<< * * self.lock() */ __pyx_t_10 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_10 == ((Uint32)0xaabbccdd) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L1_error) __pyx_v_pixel = __pyx_t_10; /* "pygame_sdl2/surface.pyx":570 * pixel = map_color(self.surface, color) * * self.lock() # <<<<<<<<<<<<<< * * p = self.surface.pixels */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":572 * self.lock() * * p = self.surface.pixels # <<<<<<<<<<<<<< * p += y * self.surface.pitch * p += x * 4 */ __pyx_v_p = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":573 * * p = self.surface.pixels * p += y * self.surface.pitch # <<<<<<<<<<<<<< * p += x * 4 * */ __pyx_v_p = (__pyx_v_p + (__pyx_v_y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":574 * p = self.surface.pixels * p += y * self.surface.pitch * p += x * 4 # <<<<<<<<<<<<<< * * ( p)[0] = pixel */ __pyx_v_p = (__pyx_v_p + (__pyx_v_x * 4)); /* "pygame_sdl2/surface.pyx":576 * p += x * 4 * * ( p)[0] = pixel # <<<<<<<<<<<<<< * * self.unlock() */ (((Uint32 *)__pyx_v_p)[0]) = __pyx_v_pixel; /* "pygame_sdl2/surface.pyx":578 * ( p)[0] = pixel * * self.unlock() # <<<<<<<<<<<<<< * * def get_at_mapped(self, pos): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":555 * return get_color(pixel, self.surface) * * def set_at(self, pos, color): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":580 * self.unlock() * * def get_at_mapped(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_44get_at_mapped, "Surface.get_at_mapped(self, pos)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_45get_at_mapped = {"get_at_mapped", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_44get_at_mapped}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pos = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_at_mapped (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_at_mapped") < 0)) __PYX_ERR(0, 580, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pos = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_at_mapped", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 580, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_at_mapped", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_44get_at_mapped(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_44get_at_mapped(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos) { int __pyx_v_x; int __pyx_v_y; Uint8 *__pyx_v_p; Uint32 __pyx_v_pixel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_at_mapped", 1); /* "pygame_sdl2/surface.pyx":584 * cdef Uint8 *p * * x, y = pos # <<<<<<<<<<<<<< * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 584, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 584, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/surface.pyx":586 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ __pyx_t_8 = (0 <= __pyx_v_x); if (__pyx_t_8) { __pyx_t_8 = (__pyx_v_x < __pyx_v_self->surface->w); } __pyx_t_9 = (!__pyx_t_8); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = (0 <= __pyx_v_y); if (__pyx_t_9) { __pyx_t_9 = (__pyx_v_y < __pyx_v_self->surface->h); } __pyx_t_8 = (!__pyx_t_9); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_7)) { /* "pygame_sdl2/surface.pyx":587 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise ValueError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 587, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":586 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ } /* "pygame_sdl2/surface.pyx":589 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_7 = (__pyx_v_self->surface->format->BytesPerPixel != 4); if (unlikely(__pyx_t_7)) { /* "pygame_sdl2/surface.pyx":590 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * self.lock() */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Surface_has_unsupported_bytesize}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 590, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":589 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/surface.pyx":592 * raise error("Surface has unsupported bytesize.") * * self.lock() # <<<<<<<<<<<<<< * * p = self.surface.pixels */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":594 * self.lock() * * p = self.surface.pixels # <<<<<<<<<<<<<< * p += y * self.surface.pitch * p += x * 4 */ __pyx_v_p = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":595 * * p = self.surface.pixels * p += y * self.surface.pitch # <<<<<<<<<<<<<< * p += x * 4 * */ __pyx_v_p = (__pyx_v_p + (__pyx_v_y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":596 * p = self.surface.pixels * p += y * self.surface.pitch * p += x * 4 # <<<<<<<<<<<<<< * * cdef Uint32 pixel = ( p)[0] */ __pyx_v_p = (__pyx_v_p + (__pyx_v_x * 4)); /* "pygame_sdl2/surface.pyx":598 * p += x * 4 * * cdef Uint32 pixel = ( p)[0] # <<<<<<<<<<<<<< * * self.unlock() */ __pyx_v_pixel = (((Uint32 *)__pyx_v_p)[0]); /* "pygame_sdl2/surface.pyx":600 * cdef Uint32 pixel = ( p)[0] * * self.unlock() # <<<<<<<<<<<<<< * * return pixel */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":602 * self.unlock() * * return pixel # <<<<<<<<<<<<<< * * def map_rgb(self, color): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_pixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":580 * self.unlock() * * def get_at_mapped(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_at_mapped", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":604 * return pixel * * def map_rgb(self, color): # <<<<<<<<<<<<<< * return map_color(self.surface, color) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_46map_rgb, "Surface.map_rgb(self, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_47map_rgb = {"map_rgb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_46map_rgb}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("map_rgb (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "map_rgb") < 0)) __PYX_ERR(0, 604, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_color = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("map_rgb", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 604, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.map_rgb", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_46map_rgb(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_color); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_46map_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("map_rgb", 1); /* "pygame_sdl2/surface.pyx":605 * * def map_rgb(self, color): * return map_color(self.surface, color) # <<<<<<<<<<<<<< * * def unmap_rgb(self, pixel): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_1 == ((Uint32)0xaabbccdd) && PyErr_Occurred())) __PYX_ERR(0, 605, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":604 * return pixel * * def map_rgb(self, color): # <<<<<<<<<<<<<< * return map_color(self.surface, color) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.map_rgb", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":607 * return map_color(self.surface, color) * * def unmap_rgb(self, pixel): # <<<<<<<<<<<<<< * return get_color(pixel, self.surface) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_48unmap_rgb, "Surface.unmap_rgb(self, pixel)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_49unmap_rgb = {"unmap_rgb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_48unmap_rgb}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pixel = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unmap_rgb (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pixel,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pixel)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 607, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "unmap_rgb") < 0)) __PYX_ERR(0, 607, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pixel = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("unmap_rgb", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 607, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unmap_rgb", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_48unmap_rgb(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_pixel); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_48unmap_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pixel) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unmap_rgb", 1); /* "pygame_sdl2/surface.pyx":608 * * def unmap_rgb(self, pixel): * return get_color(pixel, self.surface) # <<<<<<<<<<<<<< * * def set_clip(self, rect): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_v_pixel); if (unlikely((__pyx_t_1 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 608, __pyx_L1_error) __pyx_t_2 = __pyx_f_11pygame_sdl2_5color_get_color(__pyx_t_1, __pyx_v_self->surface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":607 * return map_color(self.surface, color) * * def unmap_rgb(self, pixel): # <<<<<<<<<<<<<< * return get_color(pixel, self.surface) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unmap_rgb", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":610 * return get_color(pixel, self.surface) * * def set_clip(self, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_50set_clip, "Surface.set_clip(self, rect)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_51set_clip = {"set_clip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_50set_clip}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rect = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_clip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rect,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_clip") < 0)) __PYX_ERR(0, 610, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_rect = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_clip", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 610, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_50set_clip(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_rect); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_50set_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_sdl_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_clip", 1); /* "pygame_sdl2/surface.pyx":613 * cdef SDL_Rect sdl_rect * * if rect is None: # <<<<<<<<<<<<<< * SDL_SetClipRect(self.surface, NULL) * else: */ __pyx_t_1 = (__pyx_v_rect == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":614 * * if rect is None: * SDL_SetClipRect(self.surface, NULL) # <<<<<<<<<<<<<< * else: * to_sdl_rect(rect, &sdl_rect) */ (void)(SDL_SetClipRect(__pyx_v_self->surface, NULL)); /* "pygame_sdl2/surface.pyx":613 * cdef SDL_Rect sdl_rect * * if rect is None: # <<<<<<<<<<<<<< * SDL_SetClipRect(self.surface, NULL) * else: */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":616 * SDL_SetClipRect(self.surface, NULL) * else: * to_sdl_rect(rect, &sdl_rect) # <<<<<<<<<<<<<< * SDL_SetClipRect(self.surface, &sdl_rect) * */ /*else*/ { __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 616, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":617 * else: * to_sdl_rect(rect, &sdl_rect) * SDL_SetClipRect(self.surface, &sdl_rect) # <<<<<<<<<<<<<< * * def get_clip(self): */ (void)(SDL_SetClipRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect))); } __pyx_L3:; /* "pygame_sdl2/surface.pyx":610 * return get_color(pixel, self.surface) * * def set_clip(self, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":619 * SDL_SetClipRect(self.surface, &sdl_rect) * * def get_clip(self): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_52get_clip, "Surface.get_clip(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_53get_clip = {"get_clip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_52get_clip}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_clip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_clip", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_clip", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_52get_clip(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_52get_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_Rect __pyx_v_sdl_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_clip", 1); /* "pygame_sdl2/surface.pyx":622 * cdef SDL_Rect sdl_rect * * SDL_GetClipRect(self.surface, &sdl_rect) # <<<<<<<<<<<<<< * * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) */ SDL_GetClipRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect)); /* "pygame_sdl2/surface.pyx":624 * SDL_GetClipRect(self.surface, &sdl_rect) * * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) # <<<<<<<<<<<<<< * * def subsurface(self, *args): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":619 * SDL_SetClipRect(self.surface, &sdl_rect) * * def get_clip(self): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":626 * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) * * def subsurface(self, *args): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_54subsurface, "Surface.subsurface(self, *args)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_55subsurface = {"subsurface", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_54subsurface}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("subsurface (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "subsurface", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_54subsurface(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_54subsurface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_args) { SDL_Rect __pyx_v_sdl_rect; Uint8 *__pyx_v_pixels; SDL_Surface *__pyx_v_new_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("subsurface", 1); /* "pygame_sdl2/surface.pyx":629 * cdef SDL_Rect sdl_rect * * if len(args) == 1: # <<<<<<<<<<<<<< * to_sdl_rect(args[0], &sdl_rect) * else: */ __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 629, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 1); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":630 * * if len(args) == 1: * to_sdl_rect(args[0], &sdl_rect) # <<<<<<<<<<<<<< * else: * to_sdl_rect(args, &sdl_rect) */ __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_3, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":629 * cdef SDL_Rect sdl_rect * * if len(args) == 1: # <<<<<<<<<<<<<< * to_sdl_rect(args[0], &sdl_rect) * else: */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":632 * to_sdl_rect(args[0], &sdl_rect) * else: * to_sdl_rect(args, &sdl_rect) # <<<<<<<<<<<<<< * * if sdl_rect.w < 0 or sdl_rect.h < 0: */ /*else*/ { __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_args, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 632, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/surface.pyx":634 * to_sdl_rect(args, &sdl_rect) * * if sdl_rect.w < 0 or sdl_rect.h < 0: # <<<<<<<<<<<<<< * raise error("subsurface size must be non-negative.") * */ __pyx_t_5 = (__pyx_v_sdl_rect.w < 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = (__pyx_v_sdl_rect.h < 0); __pyx_t_2 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":635 * * if sdl_rect.w < 0 or sdl_rect.h < 0: * raise error("subsurface size must be non-negative.") # <<<<<<<<<<<<<< * * if ((sdl_rect.x < 0) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_s_subsurface_size_must_be_non_nega}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 635, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":634 * to_sdl_rect(args, &sdl_rect) * * if sdl_rect.w < 0 or sdl_rect.h < 0: # <<<<<<<<<<<<<< * raise error("subsurface size must be non-negative.") * */ } /* "pygame_sdl2/surface.pyx":637 * raise error("subsurface size must be non-negative.") * * if ((sdl_rect.x < 0) # <<<<<<<<<<<<<< * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) */ __pyx_t_5 = (__pyx_v_sdl_rect.x < 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } /* "pygame_sdl2/surface.pyx":638 * * if ((sdl_rect.x < 0) * or (sdl_rect.y < 0) # <<<<<<<<<<<<<< * or (sdl_rect.x + sdl_rect.w > self.surface.w) * or (sdl_rect.y + sdl_rect.h > self.surface.h)): */ __pyx_t_5 = (__pyx_v_sdl_rect.y < 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } /* "pygame_sdl2/surface.pyx":639 * if ((sdl_rect.x < 0) * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) # <<<<<<<<<<<<<< * or (sdl_rect.y + sdl_rect.h > self.surface.h)): * */ __pyx_t_5 = ((__pyx_v_sdl_rect.x + __pyx_v_sdl_rect.w) > __pyx_v_self->surface->w); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } /* "pygame_sdl2/surface.pyx":640 * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) * or (sdl_rect.y + sdl_rect.h > self.surface.h)): # <<<<<<<<<<<<<< * * raise error("subsurface rectangle outside surface area.") */ __pyx_t_5 = ((__pyx_v_sdl_rect.y + __pyx_v_sdl_rect.h) > __pyx_v_self->surface->h); __pyx_t_2 = __pyx_t_5; __pyx_L8_bool_binop_done:; /* "pygame_sdl2/surface.pyx":637 * raise error("subsurface size must be non-negative.") * * if ((sdl_rect.x < 0) # <<<<<<<<<<<<<< * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) */ if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":642 * or (sdl_rect.y + sdl_rect.h > self.surface.h)): * * raise error("subsurface rectangle outside surface area.") # <<<<<<<<<<<<<< * * cdef Uint8 *pixels = self.surface.pixels */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_s_subsurface_rectangle_outside_sur}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 642, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":637 * raise error("subsurface size must be non-negative.") * * if ((sdl_rect.x < 0) # <<<<<<<<<<<<<< * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) */ } /* "pygame_sdl2/surface.pyx":644 * raise error("subsurface rectangle outside surface area.") * * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * pixels += sdl_rect.y * self.surface.pitch * pixels += sdl_rect.x * self.surface.format.BytesPerPixel */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":645 * * cdef Uint8 *pixels = self.surface.pixels * pixels += sdl_rect.y * self.surface.pitch # <<<<<<<<<<<<<< * pixels += sdl_rect.x * self.surface.format.BytesPerPixel * */ __pyx_v_pixels = (__pyx_v_pixels + (__pyx_v_sdl_rect.y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":646 * cdef Uint8 *pixels = self.surface.pixels * pixels += sdl_rect.y * self.surface.pitch * pixels += sdl_rect.x * self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * * cdef SDL_Surface *new_surface = SDL_CreateRGBSurfaceFrom( */ __pyx_v_pixels = (__pyx_v_pixels + (__pyx_v_sdl_rect.x * __pyx_v_self->surface->format->BytesPerPixel)); /* "pygame_sdl2/surface.pyx":648 * pixels += sdl_rect.x * self.surface.format.BytesPerPixel * * cdef SDL_Surface *new_surface = SDL_CreateRGBSurfaceFrom( # <<<<<<<<<<<<<< * pixels, * sdl_rect.w, */ __pyx_v_new_surface = SDL_CreateRGBSurfaceFrom(__pyx_v_pixels, __pyx_v_sdl_rect.w, __pyx_v_sdl_rect.h, __pyx_v_self->surface->format->BitsPerPixel, __pyx_v_self->surface->pitch, __pyx_v_self->surface->format->Rmask, __pyx_v_self->surface->format->Gmask, __pyx_v_self->surface->format->Bmask, __pyx_v_self->surface->format->Amask); /* "pygame_sdl2/surface.pyx":659 * self.surface.format.Amask) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (!(__pyx_v_new_surface != 0)); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":660 * * if not new_surface: * raise error() # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 660, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":659 * self.surface.format.Amask) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":662 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * * rv.surface = new_surface */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":664 * cdef Surface rv = Surface(()) * * rv.surface = new_surface # <<<<<<<<<<<<<< * rv.parent = self * rv.offset_x = sdl_rect.x */ __pyx_v_rv->surface = __pyx_v_new_surface; /* "pygame_sdl2/surface.pyx":665 * * rv.surface = new_surface * rv.parent = self # <<<<<<<<<<<<<< * rv.offset_x = sdl_rect.x * rv.offset_y = sdl_rect.y */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); __Pyx_GOTREF((PyObject *)__pyx_v_rv->parent); __Pyx_DECREF((PyObject *)__pyx_v_rv->parent); __pyx_v_rv->parent = __pyx_v_self; /* "pygame_sdl2/surface.pyx":666 * rv.surface = new_surface * rv.parent = self * rv.offset_x = sdl_rect.x # <<<<<<<<<<<<<< * rv.offset_y = sdl_rect.y * */ __pyx_t_4 = __pyx_v_sdl_rect.x; __pyx_v_rv->offset_x = __pyx_t_4; /* "pygame_sdl2/surface.pyx":667 * rv.parent = self * rv.offset_x = sdl_rect.x * rv.offset_y = sdl_rect.y # <<<<<<<<<<<<<< * * if self.has_alpha: */ __pyx_t_4 = __pyx_v_sdl_rect.y; __pyx_v_rv->offset_y = __pyx_t_4; /* "pygame_sdl2/surface.pyx":669 * rv.offset_y = sdl_rect.y * * if self.has_alpha: # <<<<<<<<<<<<<< * rv.set_alpha(self.get_alpha()) * */ if (__pyx_v_self->has_alpha) { /* "pygame_sdl2/surface.pyx":670 * * if self.has_alpha: * rv.set_alpha(self.get_alpha()) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_set_alpha); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_alpha); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":669 * rv.offset_y = sdl_rect.y * * if self.has_alpha: # <<<<<<<<<<<<<< * rv.set_alpha(self.get_alpha()) * */ } /* "pygame_sdl2/surface.pyx":672 * rv.set_alpha(self.get_alpha()) * * return rv # <<<<<<<<<<<<<< * * def get_parent(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":626 * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) * * def subsurface(self, *args): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.subsurface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":674 * return rv * * def get_parent(self): # <<<<<<<<<<<<<< * return self.parent * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_56get_parent, "Surface.get_parent(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_57get_parent = {"get_parent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_56get_parent}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_parent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_parent", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_parent", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_56get_parent(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_56get_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_parent", 1); /* "pygame_sdl2/surface.pyx":675 * * def get_parent(self): * return self.parent # <<<<<<<<<<<<<< * * def get_abs_parent(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->parent); __pyx_r = ((PyObject *)__pyx_v_self->parent); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":674 * return rv * * def get_parent(self): # <<<<<<<<<<<<<< * return self.parent * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":677 * return self.parent * * def get_abs_parent(self): # <<<<<<<<<<<<<< * rv = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_58get_abs_parent, "Surface.get_abs_parent(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_59get_abs_parent = {"get_abs_parent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_58get_abs_parent}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_abs_parent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_abs_parent", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_abs_parent", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_58get_abs_parent(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_58get_abs_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_abs_parent", 1); /* "pygame_sdl2/surface.pyx":678 * * def get_abs_parent(self): * rv = self # <<<<<<<<<<<<<< * * while rv.parent: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_rv = __pyx_v_self; /* "pygame_sdl2/surface.pyx":680 * rv = self * * while rv.parent: # <<<<<<<<<<<<<< * rv = rv.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_rv->parent)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 680, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":681 * * while rv.parent: * rv = rv.parent # <<<<<<<<<<<<<< * * return rv */ __pyx_t_2 = ((PyObject *)__pyx_v_rv->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_rv, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":683 * rv = rv.parent * * return rv # <<<<<<<<<<<<<< * * def get_offset(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":677 * return self.parent * * def get_abs_parent(self): # <<<<<<<<<<<<<< * rv = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_abs_parent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":685 * return rv * * def get_offset(self): # <<<<<<<<<<<<<< * return (self.offset_x, self.offset_y) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_60get_offset, "Surface.get_offset(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_61get_offset = {"get_offset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_60get_offset}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_offset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_offset", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_offset", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_60get_offset(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_60get_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_offset", 1); /* "pygame_sdl2/surface.pyx":686 * * def get_offset(self): * return (self.offset_x, self.offset_y) # <<<<<<<<<<<<<< * * def get_abs_offset(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->offset_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->offset_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":685 * return rv * * def get_offset(self): # <<<<<<<<<<<<<< * return (self.offset_x, self.offset_y) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":688 * return (self.offset_x, self.offset_y) * * def get_abs_offset(self): # <<<<<<<<<<<<<< * cdef Surface surf = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_62get_abs_offset, "Surface.get_abs_offset(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_63get_abs_offset = {"get_abs_offset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_62get_abs_offset}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_abs_offset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_abs_offset", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_abs_offset", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_62get_abs_offset(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_62get_abs_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf = 0; int __pyx_v_offset_x; int __pyx_v_offset_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_abs_offset", 1); /* "pygame_sdl2/surface.pyx":689 * * def get_abs_offset(self): * cdef Surface surf = self # <<<<<<<<<<<<<< * * cdef int offset_x = 0 */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_surf = __pyx_v_self; /* "pygame_sdl2/surface.pyx":691 * cdef Surface surf = self * * cdef int offset_x = 0 # <<<<<<<<<<<<<< * cdef int offset_y = 0 * */ __pyx_v_offset_x = 0; /* "pygame_sdl2/surface.pyx":692 * * cdef int offset_x = 0 * cdef int offset_y = 0 # <<<<<<<<<<<<<< * * while surf: */ __pyx_v_offset_y = 0; /* "pygame_sdl2/surface.pyx":694 * cdef int offset_y = 0 * * while surf: # <<<<<<<<<<<<<< * offset_x += surf.offset_x * offset_y += surf.offset_y */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_surf)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 694, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":695 * * while surf: * offset_x += surf.offset_x # <<<<<<<<<<<<<< * offset_y += surf.offset_y * surf = surf.parent */ __pyx_v_offset_x = (__pyx_v_offset_x + __pyx_v_surf->offset_x); /* "pygame_sdl2/surface.pyx":696 * while surf: * offset_x += surf.offset_x * offset_y += surf.offset_y # <<<<<<<<<<<<<< * surf = surf.parent * */ __pyx_v_offset_y = (__pyx_v_offset_y + __pyx_v_surf->offset_y); /* "pygame_sdl2/surface.pyx":697 * offset_x += surf.offset_x * offset_y += surf.offset_y * surf = surf.parent # <<<<<<<<<<<<<< * * return (offset_x, offset_y) */ __pyx_t_2 = ((PyObject *)__pyx_v_surf->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_surf, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":699 * surf = surf.parent * * return (offset_x, offset_y) # <<<<<<<<<<<<<< * * def get_size(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_offset_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_offset_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":688 * return (self.offset_x, self.offset_y) * * def get_abs_offset(self): # <<<<<<<<<<<<<< * cdef Surface surf = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_abs_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":701 * return (offset_x, offset_y) * * def get_size(self): # <<<<<<<<<<<<<< * return self.surface.w, self.surface.h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_64get_size, "Surface.get_size(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_65get_size = {"get_size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_64get_size}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_size (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_size", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_size", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_64get_size(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_64get_size(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_size", 1); /* "pygame_sdl2/surface.pyx":702 * * def get_size(self): * return self.surface.w, self.surface.h # <<<<<<<<<<<<<< * * def get_width(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":701 * return (offset_x, offset_y) * * def get_size(self): # <<<<<<<<<<<<<< * return self.surface.w, self.surface.h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":704 * return self.surface.w, self.surface.h * * def get_width(self): # <<<<<<<<<<<<<< * return self.surface.w * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_66get_width, "Surface.get_width(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_67get_width = {"get_width", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_66get_width}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_width (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_width", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_width", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_66get_width(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_66get_width(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_width", 1); /* "pygame_sdl2/surface.pyx":705 * * def get_width(self): * return self.surface.w # <<<<<<<<<<<<<< * * def get_height(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":704 * return self.surface.w, self.surface.h * * def get_width(self): # <<<<<<<<<<<<<< * return self.surface.w * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_width", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":707 * return self.surface.w * * def get_height(self): # <<<<<<<<<<<<<< * return self.surface.h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_68get_height, "Surface.get_height(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_69get_height = {"get_height", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_68get_height}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_height (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_height", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_height", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_68get_height(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_68get_height(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_height", 1); /* "pygame_sdl2/surface.pyx":708 * * def get_height(self): * return self.surface.h # <<<<<<<<<<<<<< * * def get_rect(self, **kwargs): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":707 * return self.surface.w * * def get_height(self): # <<<<<<<<<<<<<< * return self.surface.h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_height", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":710 * return self.surface.h * * def get_rect(self, **kwargs): # <<<<<<<<<<<<<< * rv = Rect((0, 0, self.surface.w, self.surface.h)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_70get_rect, "Surface.get_rect(self, **kwargs)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_71get_rect = {"get_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_70get_rect}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_kwargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_rect", 1, 0, 0, __pyx_nargs); return NULL;} if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_rect", 1))) return NULL; if (__pyx_kwds) { __pyx_v_kwargs = __Pyx_KwargsAsDict_FASTCALL(__pyx_kwds, __pyx_kwvalues); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); } else { __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); } __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_70get_rect(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_kwargs); /* function exit code */ __Pyx_DECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_70get_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_rect", 1); /* "pygame_sdl2/surface.pyx":711 * * def get_rect(self, **kwargs): * rv = Rect((0, 0, self.surface.w, self.surface.h)) # <<<<<<<<<<<<<< * * for k, v in kwargs.items(): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0)) __PYX_ERR(0, 711, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0)) __PYX_ERR(0, 711, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":713 * rv = Rect((0, 0, self.surface.w, self.surface.h)) * * for k, v in kwargs.items(): # <<<<<<<<<<<<<< * setattr(rv, k, v) * */ __pyx_t_7 = 0; __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_kwargs, 1, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_8, &__pyx_t_7, &__pyx_t_2, &__pyx_t_5, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/surface.pyx":714 * * for k, v in kwargs.items(): * setattr(rv, k, v) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_10 = PyObject_SetAttr(__pyx_v_rv, __pyx_v_k, __pyx_v_v); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 714, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":716 * setattr(rv, k, v) * * return rv # <<<<<<<<<<<<<< * * def get_bitsize(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":710 * return self.surface.h * * def get_rect(self, **kwargs): # <<<<<<<<<<<<<< * rv = Rect((0, 0, self.surface.w, self.surface.h)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":718 * return rv * * def get_bitsize(self): # <<<<<<<<<<<<<< * return self.surface.format.BitsPerPixel * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_72get_bitsize, "Surface.get_bitsize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_73get_bitsize = {"get_bitsize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_72get_bitsize}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bitsize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_bitsize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_bitsize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_72get_bitsize(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_72get_bitsize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_bitsize", 1); /* "pygame_sdl2/surface.pyx":719 * * def get_bitsize(self): * return self.surface.format.BitsPerPixel # <<<<<<<<<<<<<< * * def get_bytesize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->surface->format->BitsPerPixel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":718 * return rv * * def get_bitsize(self): # <<<<<<<<<<<<<< * return self.surface.format.BitsPerPixel * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bitsize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":721 * return self.surface.format.BitsPerPixel * * def get_bytesize(self): # <<<<<<<<<<<<<< * return self.surface.format.BytesPerPixel * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_74get_bytesize, "Surface.get_bytesize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_75get_bytesize = {"get_bytesize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_74get_bytesize}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bytesize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_bytesize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_bytesize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_74get_bytesize(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_74get_bytesize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_bytesize", 1); /* "pygame_sdl2/surface.pyx":722 * * def get_bytesize(self): * return self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * * def get_flags(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->surface->format->BytesPerPixel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":721 * return self.surface.format.BitsPerPixel * * def get_bytesize(self): # <<<<<<<<<<<<<< * return self.surface.format.BytesPerPixel * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bytesize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":724 * return self.surface.format.BytesPerPixel * * def get_flags(self): # <<<<<<<<<<<<<< * * if self.get_window_flags: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_76get_flags, "Surface.get_flags(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_77get_flags = {"get_flags", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_76get_flags}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_flags (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_flags", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_flags", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_76get_flags(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_76get_flags(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_flags", 1); /* "pygame_sdl2/surface.pyx":726 * def get_flags(self): * * if self.get_window_flags: # <<<<<<<<<<<<<< * rv = self.get_window_flags() * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->get_window_flags); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":727 * * if self.get_window_flags: * rv = self.get_window_flags() # <<<<<<<<<<<<<< * else: * rv = 0 */ __Pyx_INCREF(__pyx_v_self->get_window_flags); __pyx_t_3 = __pyx_v_self->get_window_flags; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_rv = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":726 * def get_flags(self): * * if self.get_window_flags: # <<<<<<<<<<<<<< * rv = self.get_window_flags() * else: */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":729 * rv = self.get_window_flags() * else: * rv = 0 # <<<<<<<<<<<<<< * * if self.surface.format.Amask or self.has_alpha: */ /*else*/ { __Pyx_INCREF(__pyx_int_0); __pyx_v_rv = __pyx_int_0; } __pyx_L3:; /* "pygame_sdl2/surface.pyx":731 * rv = 0 * * if self.surface.format.Amask or self.has_alpha: # <<<<<<<<<<<<<< * rv = rv | SRCALPHA * */ __pyx_t_6 = (__pyx_v_self->surface->format->Amask != 0); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L5_bool_binop_done; } __pyx_t_1 = __pyx_v_self->has_alpha; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":732 * * if self.surface.format.Amask or self.has_alpha: * rv = rv | SRCALPHA # <<<<<<<<<<<<<< * * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Or(__pyx_v_rv, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":731 * rv = 0 * * if self.surface.format.Amask or self.has_alpha: # <<<<<<<<<<<<<< * rv = rv | SRCALPHA * */ } /* "pygame_sdl2/surface.pyx":734 * rv = rv | SRCALPHA * * return rv # <<<<<<<<<<<<<< * * def get_pitch(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":724 * return self.surface.format.BytesPerPixel * * def get_flags(self): # <<<<<<<<<<<<<< * * if self.get_window_flags: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":736 * return rv * * def get_pitch(self): # <<<<<<<<<<<<<< * return self.surface.pitch * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_78get_pitch, "Surface.get_pitch(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_79get_pitch = {"get_pitch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_78get_pitch}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pitch (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_pitch", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_pitch", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_78get_pitch(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_78get_pitch(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pitch", 1); /* "pygame_sdl2/surface.pyx":737 * * def get_pitch(self): * return self.surface.pitch # <<<<<<<<<<<<<< * * def get_masks(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->pitch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":736 * return rv * * def get_pitch(self): # <<<<<<<<<<<<<< * return self.surface.pitch * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_pitch", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":739 * return self.surface.pitch * * def get_masks(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_80get_masks, "Surface.get_masks(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_81get_masks = {"get_masks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_80get_masks}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_masks (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_masks", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_masks", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_80get_masks(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_80get_masks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_masks", 1); /* "pygame_sdl2/surface.pyx":740 * * def get_masks(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":741 * def get_masks(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) # <<<<<<<<<<<<<< * * def set_masks(self, masks): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":739 * return self.surface.pitch * * def get_masks(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_masks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":743 * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * * def set_masks(self, masks): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_masks is not supported.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_82set_masks, "Surface.set_masks(self, masks)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_83set_masks = {"set_masks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_82set_masks}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_masks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_masks (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_masks,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_masks)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 743, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_masks") < 0)) __PYX_ERR(0, 743, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_masks = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_masks", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 743, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_masks", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_82set_masks(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_masks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_82set_masks(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_masks) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_masks", 1); /* "pygame_sdl2/surface.pyx":744 * * def set_masks(self, masks): * warnings.warn("Surface.set_masks is not supported.") # <<<<<<<<<<<<<< * * def get_shifts(self): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_warnings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s_Surface_set_masks_is_not_support}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":743 * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * * def set_masks(self, masks): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_masks is not supported.") * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_masks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":746 * warnings.warn("Surface.set_masks is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_84get_shifts, "Surface.get_shifts(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_85get_shifts = {"get_shifts", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_84get_shifts}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_shifts (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_shifts", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_shifts", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_84get_shifts(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_84get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_shifts", 1); /* "pygame_sdl2/surface.pyx":747 * * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":748 * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) # <<<<<<<<<<<<<< * * def set_shifts(self, shifts): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 748, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":746 * warnings.warn("Surface.set_masks is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":750 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def set_shifts(self, shifts): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_shifts is not supported.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_86set_shifts, "Surface.set_shifts(self, shifts)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_87set_shifts = {"set_shifts", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_86set_shifts}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_shifts = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_shifts (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shifts,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shifts)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 750, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_shifts") < 0)) __PYX_ERR(0, 750, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_shifts = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_shifts", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 750, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_86set_shifts(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_shifts); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_86set_shifts(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_shifts) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_shifts", 1); /* "pygame_sdl2/surface.pyx":751 * * def set_shifts(self, shifts): * warnings.warn("Surface.set_shifts is not supported.") # <<<<<<<<<<<<<< * * def get_shifts(self): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_warnings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s_Surface_set_shifts_is_not_suppor}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":750 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def set_shifts(self, shifts): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_shifts is not supported.") * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":753 * warnings.warn("Surface.set_shifts is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_88get_shifts, "Surface.get_shifts(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_89get_shifts = {"get_shifts", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_88get_shifts}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_shifts (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_shifts", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_shifts", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_88get_shifts(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_88get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_shifts", 1); /* "pygame_sdl2/surface.pyx":754 * * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":755 * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) # <<<<<<<<<<<<<< * * def get_losses(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 755, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":753 * warnings.warn("Surface.set_shifts is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":757 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def get_losses(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_90get_losses, "Surface.get_losses(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_91get_losses = {"get_losses", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_90get_losses}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_losses (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_losses", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_losses", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_90get_losses(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_90get_losses(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_losses", 1); /* "pygame_sdl2/surface.pyx":758 * * def get_losses(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":759 * def get_losses(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) # <<<<<<<<<<<<<< * * def get_bounding_rect(self, min_alpha=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":757 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def get_losses(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_losses", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":761 * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * * def get_bounding_rect(self, min_alpha=1): # <<<<<<<<<<<<<< * * cdef Uint32 amask = self.surface.format.Amask */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_92get_bounding_rect, "Surface.get_bounding_rect(self, min_alpha=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_93get_bounding_rect = {"get_bounding_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_92get_bounding_rect}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_min_alpha = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bounding_rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_min_alpha,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_min_alpha); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_bounding_rect") < 0)) __PYX_ERR(0, 761, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_min_alpha = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_bounding_rect", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 761, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bounding_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_92get_bounding_rect(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_min_alpha); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_92get_bounding_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_min_alpha) { Uint32 __pyx_v_amask; Uint32 __pyx_v_amin; int __pyx_v_x; int __pyx_v_y; int __pyx_v_w; int __pyx_v_h; int __pyx_v_minx; int __pyx_v_maxx; int __pyx_v_miny; int __pyx_v_maxy; Uint32 *__pyx_v_row; Uint32 __pyx_v_topleft; Uint32 __pyx_v_botright; Uint8 *__pyx_v_pixels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; long __pyx_t_11; long __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_bounding_rect", 1); /* "pygame_sdl2/surface.pyx":763 * def get_bounding_rect(self, min_alpha=1): * * cdef Uint32 amask = self.surface.format.Amask # <<<<<<<<<<<<<< * cdef Uint32 amin = (0x01010101 * min_alpha) & amask * */ __pyx_t_1 = __pyx_v_self->surface->format->Amask; __pyx_v_amask = __pyx_t_1; /* "pygame_sdl2/surface.pyx":764 * * cdef Uint32 amask = self.surface.format.Amask * cdef Uint32 amin = (0x01010101 * min_alpha) & amask # <<<<<<<<<<<<<< * * cdef int x */ __pyx_t_2 = __Pyx_PyInt_MultiplyCObj(__pyx_int_16843009, __pyx_v_min_alpha, 0x01010101, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_amask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_1 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_amin = __pyx_t_1; /* "pygame_sdl2/surface.pyx":771 * cdef int h * * cdef int minx = self.surface.w - 1 # <<<<<<<<<<<<<< * cdef int maxx = 0 * cdef int miny = self.surface.h - 1 */ __pyx_v_minx = (__pyx_v_self->surface->w - 1); /* "pygame_sdl2/surface.pyx":772 * * cdef int minx = self.surface.w - 1 * cdef int maxx = 0 # <<<<<<<<<<<<<< * cdef int miny = self.surface.h - 1 * cdef int maxy = 0 */ __pyx_v_maxx = 0; /* "pygame_sdl2/surface.pyx":773 * cdef int minx = self.surface.w - 1 * cdef int maxx = 0 * cdef int miny = self.surface.h - 1 # <<<<<<<<<<<<<< * cdef int maxy = 0 * */ __pyx_v_miny = (__pyx_v_self->surface->h - 1); /* "pygame_sdl2/surface.pyx":774 * cdef int maxx = 0 * cdef int miny = self.surface.h - 1 * cdef int maxy = 0 # <<<<<<<<<<<<<< * * cdef Uint32 *row */ __pyx_v_maxy = 0; /* "pygame_sdl2/surface.pyx":781 * cdef Uint32 botright * * if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): # <<<<<<<<<<<<<< * return Rect((0, 0, self.surface.w, self.surface.h)) * */ __pyx_t_6 = (!(__pyx_v_amask != 0)); if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = (__pyx_v_self->surface->w == 0); if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = (__pyx_v_self->surface->h == 0); __pyx_t_5 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":782 * * if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): * return Rect((0, 0, self.surface.w, self.surface.h)) # <<<<<<<<<<<<<< * * self.lock() */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_int_0)) __PYX_ERR(0, 782, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_0)) __PYX_ERR(0, 782, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7)) __PYX_ERR(0, 782, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":781 * cdef Uint32 botright * * if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): # <<<<<<<<<<<<<< * return Rect((0, 0, self.surface.w, self.surface.h)) * */ } /* "pygame_sdl2/surface.pyx":784 * return Rect((0, 0, self.surface.w, self.surface.h)) * * self.lock() # <<<<<<<<<<<<<< * * cdef Uint8 *pixels = self.surface.pixels */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":786 * self.lock() * * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":788 * cdef Uint8 *pixels = self.surface.pixels * * with nogil: # <<<<<<<<<<<<<< * * topleft = ( pixels)[0] */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":790 * with nogil: * * topleft = ( pixels)[0] # <<<<<<<<<<<<<< * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] * */ __pyx_v_topleft = (((Uint32 *)__pyx_v_pixels)[0]); /* "pygame_sdl2/surface.pyx":791 * * topleft = ( pixels)[0] * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] # <<<<<<<<<<<<<< * * if ((topleft & amask) > amin) and ((botright & amask) > amin): */ __pyx_v_botright = (((Uint32 *)(__pyx_v_pixels + (__pyx_v_self->surface->pitch * (__pyx_v_self->surface->h - 1))))[(__pyx_v_self->surface->w - 1)]); /* "pygame_sdl2/surface.pyx":793 * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] * * if ((topleft & amask) > amin) and ((botright & amask) > amin): # <<<<<<<<<<<<<< * * # Bounding box covers image. */ __pyx_t_6 = ((__pyx_v_topleft & __pyx_v_amask) > __pyx_v_amin); if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L11_bool_binop_done; } __pyx_t_6 = ((__pyx_v_botright & __pyx_v_amask) > __pyx_v_amin); __pyx_t_5 = __pyx_t_6; __pyx_L11_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":797 * # Bounding box covers image. * * minx = 0 # <<<<<<<<<<<<<< * miny = 0 * maxx = self.surface.w - 1 */ __pyx_v_minx = 0; /* "pygame_sdl2/surface.pyx":798 * * minx = 0 * miny = 0 # <<<<<<<<<<<<<< * maxx = self.surface.w - 1 * maxy = self.surface.h - 1 */ __pyx_v_miny = 0; /* "pygame_sdl2/surface.pyx":799 * minx = 0 * miny = 0 * maxx = self.surface.w - 1 # <<<<<<<<<<<<<< * maxy = self.surface.h - 1 * */ __pyx_v_maxx = (__pyx_v_self->surface->w - 1); /* "pygame_sdl2/surface.pyx":800 * miny = 0 * maxx = self.surface.w - 1 * maxy = self.surface.h - 1 # <<<<<<<<<<<<<< * * else: */ __pyx_v_maxy = (__pyx_v_self->surface->h - 1); /* "pygame_sdl2/surface.pyx":793 * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] * * if ((topleft & amask) > amin) and ((botright & amask) > amin): # <<<<<<<<<<<<<< * * # Bounding box covers image. */ goto __pyx_L10; } /* "pygame_sdl2/surface.pyx":806 * # Bounding box is smaller than image. * * for 0 <= y < self.surface.h: # <<<<<<<<<<<<<< * row = (pixels + self.surface.pitch * y) * */ /*else*/ { __pyx_t_9 = __pyx_v_self->surface->h; for (__pyx_v_y = 0; __pyx_v_y < __pyx_t_9; __pyx_v_y++) { /* "pygame_sdl2/surface.pyx":807 * * for 0 <= y < self.surface.h: * row = (pixels + self.surface.pitch * y) # <<<<<<<<<<<<<< * * for 0 <= x < self.surface.w: */ __pyx_v_row = ((Uint32 *)(__pyx_v_pixels + (__pyx_v_self->surface->pitch * __pyx_v_y))); /* "pygame_sdl2/surface.pyx":809 * row = (pixels + self.surface.pitch * y) * * for 0 <= x < self.surface.w: # <<<<<<<<<<<<<< * * if (row[x] & amask) >= amin: */ __pyx_t_10 = __pyx_v_self->surface->w; for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_10; __pyx_v_x++) { /* "pygame_sdl2/surface.pyx":811 * for 0 <= x < self.surface.w: * * if (row[x] & amask) >= amin: # <<<<<<<<<<<<<< * * if minx > x: */ __pyx_t_5 = (((__pyx_v_row[__pyx_v_x]) & __pyx_v_amask) >= __pyx_v_amin); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":813 * if (row[x] & amask) >= amin: * * if minx > x: # <<<<<<<<<<<<<< * minx = x * if miny > y: */ __pyx_t_5 = (__pyx_v_minx > __pyx_v_x); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":814 * * if minx > x: * minx = x # <<<<<<<<<<<<<< * if miny > y: * miny = y */ __pyx_v_minx = __pyx_v_x; /* "pygame_sdl2/surface.pyx":813 * if (row[x] & amask) >= amin: * * if minx > x: # <<<<<<<<<<<<<< * minx = x * if miny > y: */ } /* "pygame_sdl2/surface.pyx":815 * if minx > x: * minx = x * if miny > y: # <<<<<<<<<<<<<< * miny = y * if maxx < x: */ __pyx_t_5 = (__pyx_v_miny > __pyx_v_y); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":816 * minx = x * if miny > y: * miny = y # <<<<<<<<<<<<<< * if maxx < x: * maxx = x */ __pyx_v_miny = __pyx_v_y; /* "pygame_sdl2/surface.pyx":815 * if minx > x: * minx = x * if miny > y: # <<<<<<<<<<<<<< * miny = y * if maxx < x: */ } /* "pygame_sdl2/surface.pyx":817 * if miny > y: * miny = y * if maxx < x: # <<<<<<<<<<<<<< * maxx = x * if maxy < y: */ __pyx_t_5 = (__pyx_v_maxx < __pyx_v_x); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":818 * miny = y * if maxx < x: * maxx = x # <<<<<<<<<<<<<< * if maxy < y: * maxy = y */ __pyx_v_maxx = __pyx_v_x; /* "pygame_sdl2/surface.pyx":817 * if miny > y: * miny = y * if maxx < x: # <<<<<<<<<<<<<< * maxx = x * if maxy < y: */ } /* "pygame_sdl2/surface.pyx":819 * if maxx < x: * maxx = x * if maxy < y: # <<<<<<<<<<<<<< * maxy = y * */ __pyx_t_5 = (__pyx_v_maxy < __pyx_v_y); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":820 * maxx = x * if maxy < y: * maxy = y # <<<<<<<<<<<<<< * * self.unlock() */ __pyx_v_maxy = __pyx_v_y; /* "pygame_sdl2/surface.pyx":819 * if maxx < x: * maxx = x * if maxy < y: # <<<<<<<<<<<<<< * maxy = y * */ } /* "pygame_sdl2/surface.pyx":811 * for 0 <= x < self.surface.w: * * if (row[x] & amask) >= amin: # <<<<<<<<<<<<<< * * if minx > x: */ } } } } __pyx_L10:; } /* "pygame_sdl2/surface.pyx":788 * cdef Uint8 *pixels = self.surface.pixels * * with nogil: # <<<<<<<<<<<<<< * * topleft = ( pixels)[0] */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } /* "pygame_sdl2/surface.pyx":822 * maxy = y * * self.unlock() # <<<<<<<<<<<<<< * * # Totally empty surface. */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":825 * * # Totally empty surface. * if minx > maxx: # <<<<<<<<<<<<<< * return Rect((0, 0, 0, 0)) * */ __pyx_t_5 = (__pyx_v_minx > __pyx_v_maxx); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":826 * # Totally empty surface. * if minx > maxx: * return Rect((0, 0, 0, 0)) # <<<<<<<<<<<<<< * * x = minx */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_tuple__2}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":825 * * # Totally empty surface. * if minx > maxx: # <<<<<<<<<<<<<< * return Rect((0, 0, 0, 0)) * */ } /* "pygame_sdl2/surface.pyx":828 * return Rect((0, 0, 0, 0)) * * x = minx # <<<<<<<<<<<<<< * y = miny * w = min(maxx - minx + 1, self.surface.w - x) */ __pyx_v_x = __pyx_v_minx; /* "pygame_sdl2/surface.pyx":829 * * x = minx * y = miny # <<<<<<<<<<<<<< * w = min(maxx - minx + 1, self.surface.w - x) * h = min(maxy - miny + 1, self.surface.h - y) */ __pyx_v_y = __pyx_v_miny; /* "pygame_sdl2/surface.pyx":830 * x = minx * y = miny * w = min(maxx - minx + 1, self.surface.w - x) # <<<<<<<<<<<<<< * h = min(maxy - miny + 1, self.surface.h - y) * */ __pyx_t_9 = (__pyx_v_self->surface->w - __pyx_v_x); __pyx_t_11 = ((__pyx_v_maxx - __pyx_v_minx) + 1); __pyx_t_5 = (__pyx_t_9 < __pyx_t_11); if (__pyx_t_5) { __pyx_t_12 = __pyx_t_9; } else { __pyx_t_12 = __pyx_t_11; } __pyx_v_w = __pyx_t_12; /* "pygame_sdl2/surface.pyx":831 * y = miny * w = min(maxx - minx + 1, self.surface.w - x) * h = min(maxy - miny + 1, self.surface.h - y) # <<<<<<<<<<<<<< * * return Rect((x, y, w, h)) */ __pyx_t_9 = (__pyx_v_self->surface->h - __pyx_v_y); __pyx_t_12 = ((__pyx_v_maxy - __pyx_v_miny) + 1); __pyx_t_5 = (__pyx_t_9 < __pyx_t_12); if (__pyx_t_5) { __pyx_t_11 = __pyx_t_9; } else { __pyx_t_11 = __pyx_t_12; } __pyx_v_h = __pyx_t_11; /* "pygame_sdl2/surface.pyx":833 * h = min(maxy - miny + 1, self.surface.h - y) * * return Rect((x, y, w, h)) # <<<<<<<<<<<<<< * * def get_view(self, kind='2'): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8)) __PYX_ERR(0, 833, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_13); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_13)) __PYX_ERR(0, 833, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_2 = 0; __pyx_t_13 = 0; __pyx_t_13 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":761 * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * * def get_bounding_rect(self, min_alpha=1): # <<<<<<<<<<<<<< * * cdef Uint32 amask = self.surface.format.Amask */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bounding_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":835 * return Rect((x, y, w, h)) * * def get_view(self, kind='2'): # <<<<<<<<<<<<<< * raise error("Surface.get_view is not supported.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_94get_view, "Surface.get_view(self, kind='2')"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_95get_view = {"get_view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_94get_view}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_kind = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_kind,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_kp_s_2)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kind); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 835, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_view") < 0)) __PYX_ERR(0, 835, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_kind = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_view", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 835, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_94get_view(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_kind); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_94get_view(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kind) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_view", 1); /* "pygame_sdl2/surface.pyx":836 * * def get_view(self, kind='2'): * raise error("Surface.get_view is not supported.") # <<<<<<<<<<<<<< * * def get_buffer(self): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Surface_get_view_is_not_supporte}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 836, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":835 * return Rect((x, y, w, h)) * * def get_view(self, kind='2'): # <<<<<<<<<<<<<< * raise error("Surface.get_view is not supported.") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":838 * raise error("Surface.get_view is not supported.") * * def get_buffer(self): # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_96get_buffer, "Surface.get_buffer(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_97get_buffer = {"get_buffer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_96get_buffer}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_buffer (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_buffer", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_buffer", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_96get_buffer(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_96get_buffer(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { Uint8 *__pyx_v_pixels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_buffer", 1); /* "pygame_sdl2/surface.pyx":839 * * def get_buffer(self): * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * return pixels[self.surface.h * self.surface.pitch] * */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":840 * def get_buffer(self): * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] # <<<<<<<<<<<<<< * * property _pixels_address: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t((__pyx_v_pixels[(__pyx_v_self->surface->h * __pyx_v_self->surface->pitch)])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":838 * raise error("Surface.get_view is not supported.") * * def get_buffer(self): # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":843 * * property _pixels_address: * def __get__(self): # <<<<<<<<<<<<<< * return self.surface.pixels * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15_pixels_address_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15_pixels_address_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_15_pixels_address___get__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_15_pixels_address___get__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/surface.pyx":844 * property _pixels_address: * def __get__(self): * return self.surface.pixels # <<<<<<<<<<<<<< * * def from_data(self, data): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint64_t(((Uint64)__pyx_v_self->surface->pixels)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":843 * * property _pixels_address: * def __get__(self): # <<<<<<<<<<<<<< * return self.surface.pixels * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface._pixels_address.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":846 * return self.surface.pixels * * def from_data(self, data): # <<<<<<<<<<<<<< * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: * raise ValueError("The data must fill the surface.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_99from_data(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_98from_data, "Surface.from_data(self, data)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_99from_data = {"from_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_99from_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_98from_data}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_99from_data(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("from_data (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 846, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_data") < 0)) __PYX_ERR(0, 846, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("from_data", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 846, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.from_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_98from_data(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_98from_data(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_data) { Uint8 *__pyx_v_d; Uint8 *__pyx_v_pixels; CYTHON_UNUSED int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Uint8 *__pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_data", 1); /* "pygame_sdl2/surface.pyx":847 * * def from_data(self, data): * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: # <<<<<<<<<<<<<< * raise ValueError("The data must fill the surface.") * */ __pyx_t_1 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 847, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != ((__pyx_v_self->surface->w * __pyx_v_self->surface->h) * __pyx_v_self->surface->format->BytesPerPixel)); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":848 * def from_data(self, data): * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: * raise ValueError("The data must fill the surface.") # <<<<<<<<<<<<<< * * cdef Uint8 *d = data */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 848, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":847 * * def from_data(self, data): * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: # <<<<<<<<<<<<<< * raise ValueError("The data must fill the surface.") * */ } /* "pygame_sdl2/surface.pyx":850 * raise ValueError("The data must fill the surface.") * * cdef Uint8 *d = data # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * */ __pyx_t_4 = __Pyx_PyObject_AsWritableUString(__pyx_v_data); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 850, __pyx_L1_error) __pyx_v_d = ((Uint8 *)__pyx_t_4); /* "pygame_sdl2/surface.pyx":851 * * cdef Uint8 *d = data * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * * cdef int i */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":855 * cdef int i * * for 0 <= i < self.surface.h: # <<<<<<<<<<<<<< * memmove(pixels, d, self.surface.w * self.surface.format.BytesPerPixel) * d += self.surface.w * self.surface.format.BytesPerPixel */ __pyx_t_5 = __pyx_v_self->surface->h; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "pygame_sdl2/surface.pyx":856 * * for 0 <= i < self.surface.h: * memmove(pixels, d, self.surface.w * self.surface.format.BytesPerPixel) # <<<<<<<<<<<<<< * d += self.surface.w * self.surface.format.BytesPerPixel * pixels += self.surface.pitch */ (void)(memmove(__pyx_v_pixels, __pyx_v_d, (__pyx_v_self->surface->w * __pyx_v_self->surface->format->BytesPerPixel))); /* "pygame_sdl2/surface.pyx":857 * for 0 <= i < self.surface.h: * memmove(pixels, d, self.surface.w * self.surface.format.BytesPerPixel) * d += self.surface.w * self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * pixels += self.surface.pitch * */ __pyx_v_d = (__pyx_v_d + (__pyx_v_self->surface->w * __pyx_v_self->surface->format->BytesPerPixel)); /* "pygame_sdl2/surface.pyx":858 * memmove(pixels, d, self.surface.w * self.surface.format.BytesPerPixel) * d += self.surface.w * self.surface.format.BytesPerPixel * pixels += self.surface.pitch # <<<<<<<<<<<<<< * * cdef api SDL_Surface *PySurface_AsSurface(surface): */ __pyx_v_pixels = (__pyx_v_pixels + __pyx_v_self->surface->pitch); } /* "pygame_sdl2/surface.pyx":846 * return self.surface.pixels * * def from_data(self, data): # <<<<<<<<<<<<<< * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: * raise ValueError("The data must fill the surface.") */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.from_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_101__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_100__reduce_cython__, "Surface.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_101__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_101__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_100__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_101__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_100__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_100__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_103__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_102__setstate_cython__, "Surface.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_103__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_103__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_102__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_103__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_102__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_102__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":860 * pixels += self.surface.pitch * * cdef api SDL_Surface *PySurface_AsSurface(surface): # <<<<<<<<<<<<<< * return ( surface).surface * */ static SDL_Surface *__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface(PyObject *__pyx_v_surface) { SDL_Surface *__pyx_r; /* "pygame_sdl2/surface.pyx":861 * * cdef api SDL_Surface *PySurface_AsSurface(surface): * return ( surface).surface # <<<<<<<<<<<<<< * * cdef api object PySurface_New(SDL_Surface *surf): */ __pyx_r = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_surface)->surface; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":860 * pixels += self.surface.pitch * * cdef api SDL_Surface *PySurface_AsSurface(surface): # <<<<<<<<<<<<<< * return ( surface).surface * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/surface.pyx":863 * return ( surface).surface * * cdef api object PySurface_New(SDL_Surface *surf): # <<<<<<<<<<<<<< * cdef Surface rv = Surface(()) * rv.take_surface(surf) */ static PyObject *__pyx_f_11pygame_sdl2_7surface_PySurface_New(SDL_Surface *__pyx_v_surf) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PySurface_New", 1); /* "pygame_sdl2/surface.pyx":864 * * cdef api object PySurface_New(SDL_Surface *surf): * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * return rv */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":865 * cdef api object PySurface_New(SDL_Surface *surf): * cdef Surface rv = Surface(()) * rv.take_surface(surf) # <<<<<<<<<<<<<< * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_surf); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 865, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":866 * cdef Surface rv = Surface(()) * rv.take_surface(surf) * return rv # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":863 * return ( surface).surface * * cdef api object PySurface_New(SDL_Surface *surf): # <<<<<<<<<<<<<< * cdef Surface rv = Surface(()) * rv.take_surface(surf) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.PySurface_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface __pyx_vtable_11pygame_sdl2_7surface_Surface; static PyObject *__pyx_tp_new_11pygame_sdl2_7surface_Surface(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_7surface_Surface; p->locklist = Py_None; Py_INCREF(Py_None); p->parent = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); p->root = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); p->get_window_flags = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_11pygame_sdl2_7surface_7Surface_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_7surface_Surface(PyObject *o) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *p = (struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_7surface_Surface) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); if (p->__weakref__) PyObject_ClearWeakRefs(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_7surface_7Surface_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->locklist); Py_CLEAR(p->parent); Py_CLEAR(p->root); Py_CLEAR(p->get_window_flags); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_7surface_Surface(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_7surface_Surface *p = (struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o; if (p->locklist) { e = (*v)(p->locklist, a); if (e) return e; } if (p->parent) { e = (*v)(((PyObject *)p->parent), a); if (e) return e; } if (p->root) { e = (*v)(((PyObject *)p->root), a); if (e) return e; } if (p->get_window_flags) { e = (*v)(p->get_window_flags, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_7surface_Surface(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_7surface_Surface *p = (struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o; tmp = ((PyObject*)p->locklist); p->locklist = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->parent); p->parent = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->root); p->root = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->get_window_flags); p->get_window_flags = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_7surface_7Surface__pixels_address(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_7surface_7Surface_15_pixels_address_1__get__(o); } static PyObject *__pyx_specialmethod___pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__(self); } static PyMethodDef __pyx_methods_11pygame_sdl2_7surface_Surface[] = { {"__sizeof__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_4__sizeof__}, {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__, METH_NOARGS|METH_COEXIST, 0}, {"blit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_10blit}, {"convert", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_12convert}, {"convert_alpha", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_14convert_alpha}, {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_16copy}, {"fill", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_18fill}, {"scroll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_20scroll}, {"set_colorkey", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_22set_colorkey}, {"get_colorkey", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_24get_colorkey}, {"set_alpha", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_26set_alpha}, {"get_alpha", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_28get_alpha}, {"lock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_30lock}, {"unlock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_32unlock}, {"mustlock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_34mustlock}, {"get_locked", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_36get_locked}, {"get_locks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_38get_locks}, {"get_at", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_40get_at}, {"set_at", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_42set_at}, {"get_at_mapped", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_44get_at_mapped}, {"map_rgb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_46map_rgb}, {"unmap_rgb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_48unmap_rgb}, {"set_clip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_50set_clip}, {"get_clip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_52get_clip}, {"subsurface", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_54subsurface}, {"get_parent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_56get_parent}, {"get_abs_parent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_58get_abs_parent}, {"get_offset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_60get_offset}, {"get_abs_offset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_62get_abs_offset}, {"get_size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_64get_size}, {"get_width", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_66get_width}, {"get_height", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_68get_height}, {"get_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_70get_rect}, {"get_bitsize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_72get_bitsize}, {"get_bytesize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_74get_bytesize}, {"get_flags", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_76get_flags}, {"get_pitch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_78get_pitch}, {"get_masks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_80get_masks}, {"set_masks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_82set_masks}, {"get_shifts", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_84get_shifts}, {"set_shifts", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_86set_shifts}, {"get_shifts", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_88get_shifts}, {"get_losses", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_90get_losses}, {"get_bounding_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_92get_bounding_rect}, {"get_view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_94get_view}, {"get_buffer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_96get_buffer}, {"from_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_99from_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_98from_data}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_101__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_100__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_103__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_102__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_7surface_Surface[] = { {(char *)"_pixels_address", __pyx_getprop_11pygame_sdl2_7surface_7Surface__pixels_address, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_7surface_Surface_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_7surface_Surface}, {Py_tp_repr, (void *)__pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__}, {Py_tp_doc, (void *)PyDoc_STR("Surface(size, flags=0, depth=32, masks=None)")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_7surface_Surface}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_7surface_Surface}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_7surface_Surface}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_7surface_Surface}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_7surface_Surface}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_7surface_Surface_spec = { "pygame_sdl2.surface.Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_7surface_Surface_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_7surface_Surface = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.surface.""Surface", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_7surface_Surface, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Surface(size, flags=0, depth=32, masks=None)"), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_7surface_Surface, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_7surface_Surface, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_7surface_Surface, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_7surface_Surface, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_7surface_Surface, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, {&__pyx_kp_s_A_null_pointer_was_passed_in, __pyx_k_A_null_pointer_was_passed_in, sizeof(__pyx_k_A_null_pointer_was_passed_in), 0, 0, 1, 0}, {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_s_Memory_leak_via_Surface_in_pygam, __pyx_k_Memory_leak_via_Surface_in_pygam, sizeof(__pyx_k_Memory_leak_via_Surface_in_pygam), 0, 0, 1, 0}, {&__pyx_kp_s_Position_outside_surface, __pyx_k_Position_outside_surface, sizeof(__pyx_k_Position_outside_surface), 0, 0, 1, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_SRCALPHA, __pyx_k_SRCALPHA, sizeof(__pyx_k_SRCALPHA), 0, 0, 1, 1}, {&__pyx_n_s_Surface, __pyx_k_Surface, sizeof(__pyx_k_Surface), 0, 0, 1, 1}, {&__pyx_n_s_Surface___reduce_cython, __pyx_k_Surface___reduce_cython, sizeof(__pyx_k_Surface___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Surface___setstate_cython, __pyx_k_Surface___setstate_cython, sizeof(__pyx_k_Surface___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Surface___sizeof, __pyx_k_Surface___sizeof, sizeof(__pyx_k_Surface___sizeof), 0, 0, 1, 1}, {&__pyx_n_s_Surface_blit, __pyx_k_Surface_blit, sizeof(__pyx_k_Surface_blit), 0, 0, 1, 1}, {&__pyx_n_s_Surface_convert, __pyx_k_Surface_convert, sizeof(__pyx_k_Surface_convert), 0, 0, 1, 1}, {&__pyx_n_s_Surface_convert_alpha, __pyx_k_Surface_convert_alpha, sizeof(__pyx_k_Surface_convert_alpha), 0, 0, 1, 1}, {&__pyx_n_s_Surface_copy, __pyx_k_Surface_copy, sizeof(__pyx_k_Surface_copy), 0, 0, 1, 1}, {&__pyx_n_s_Surface_fill, __pyx_k_Surface_fill, sizeof(__pyx_k_Surface_fill), 0, 0, 1, 1}, {&__pyx_n_s_Surface_from_data, __pyx_k_Surface_from_data, sizeof(__pyx_k_Surface_from_data), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_abs_offset, __pyx_k_Surface_get_abs_offset, sizeof(__pyx_k_Surface_get_abs_offset), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_abs_parent, __pyx_k_Surface_get_abs_parent, sizeof(__pyx_k_Surface_get_abs_parent), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_alpha, __pyx_k_Surface_get_alpha, sizeof(__pyx_k_Surface_get_alpha), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_at, __pyx_k_Surface_get_at, sizeof(__pyx_k_Surface_get_at), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_at_mapped, __pyx_k_Surface_get_at_mapped, sizeof(__pyx_k_Surface_get_at_mapped), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_bitsize, __pyx_k_Surface_get_bitsize, sizeof(__pyx_k_Surface_get_bitsize), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_bounding_rect, __pyx_k_Surface_get_bounding_rect, sizeof(__pyx_k_Surface_get_bounding_rect), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_buffer, __pyx_k_Surface_get_buffer, sizeof(__pyx_k_Surface_get_buffer), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_bytesize, __pyx_k_Surface_get_bytesize, sizeof(__pyx_k_Surface_get_bytesize), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_clip, __pyx_k_Surface_get_clip, sizeof(__pyx_k_Surface_get_clip), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_colorkey, __pyx_k_Surface_get_colorkey, sizeof(__pyx_k_Surface_get_colorkey), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_flags, __pyx_k_Surface_get_flags, sizeof(__pyx_k_Surface_get_flags), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_height, __pyx_k_Surface_get_height, sizeof(__pyx_k_Surface_get_height), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_locked, __pyx_k_Surface_get_locked, sizeof(__pyx_k_Surface_get_locked), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_locks, __pyx_k_Surface_get_locks, sizeof(__pyx_k_Surface_get_locks), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_losses, __pyx_k_Surface_get_losses, sizeof(__pyx_k_Surface_get_losses), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_masks, __pyx_k_Surface_get_masks, sizeof(__pyx_k_Surface_get_masks), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_offset, __pyx_k_Surface_get_offset, sizeof(__pyx_k_Surface_get_offset), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_parent, __pyx_k_Surface_get_parent, sizeof(__pyx_k_Surface_get_parent), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_pitch, __pyx_k_Surface_get_pitch, sizeof(__pyx_k_Surface_get_pitch), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_rect, __pyx_k_Surface_get_rect, sizeof(__pyx_k_Surface_get_rect), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_shifts, __pyx_k_Surface_get_shifts, sizeof(__pyx_k_Surface_get_shifts), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_size, __pyx_k_Surface_get_size, sizeof(__pyx_k_Surface_get_size), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_view, __pyx_k_Surface_get_view, sizeof(__pyx_k_Surface_get_view), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_get_view_is_not_supporte, __pyx_k_Surface_get_view_is_not_supporte, sizeof(__pyx_k_Surface_get_view_is_not_supporte), 0, 0, 1, 0}, {&__pyx_n_s_Surface_get_width, __pyx_k_Surface_get_width, sizeof(__pyx_k_Surface_get_width), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_has_unsupported_bytesize, __pyx_k_Surface_has_unsupported_bytesize, sizeof(__pyx_k_Surface_has_unsupported_bytesize), 0, 0, 1, 0}, {&__pyx_n_s_Surface_lock, __pyx_k_Surface_lock, sizeof(__pyx_k_Surface_lock), 0, 0, 1, 1}, {&__pyx_n_s_Surface_map_rgb, __pyx_k_Surface_map_rgb, sizeof(__pyx_k_Surface_map_rgb), 0, 0, 1, 1}, {&__pyx_n_s_Surface_mustlock, __pyx_k_Surface_mustlock, sizeof(__pyx_k_Surface_mustlock), 0, 0, 1, 1}, {&__pyx_n_s_Surface_scroll, __pyx_k_Surface_scroll, sizeof(__pyx_k_Surface_scroll), 0, 0, 1, 1}, {&__pyx_n_s_Surface_set_alpha, __pyx_k_Surface_set_alpha, sizeof(__pyx_k_Surface_set_alpha), 0, 0, 1, 1}, {&__pyx_n_s_Surface_set_at, __pyx_k_Surface_set_at, sizeof(__pyx_k_Surface_set_at), 0, 0, 1, 1}, {&__pyx_n_s_Surface_set_clip, __pyx_k_Surface_set_clip, sizeof(__pyx_k_Surface_set_clip), 0, 0, 1, 1}, {&__pyx_n_s_Surface_set_colorkey, __pyx_k_Surface_set_colorkey, sizeof(__pyx_k_Surface_set_colorkey), 0, 0, 1, 1}, {&__pyx_n_s_Surface_set_masks, __pyx_k_Surface_set_masks, sizeof(__pyx_k_Surface_set_masks), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_set_masks_is_not_support, __pyx_k_Surface_set_masks_is_not_support, sizeof(__pyx_k_Surface_set_masks_is_not_support), 0, 0, 1, 0}, {&__pyx_n_s_Surface_set_shifts, __pyx_k_Surface_set_shifts, sizeof(__pyx_k_Surface_set_shifts), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_set_shifts_is_not_suppor, __pyx_k_Surface_set_shifts_is_not_suppor, sizeof(__pyx_k_Surface_set_shifts_is_not_suppor), 0, 0, 1, 0}, {&__pyx_n_s_Surface_subsurface, __pyx_k_Surface_subsurface, sizeof(__pyx_k_Surface_subsurface), 0, 0, 1, 1}, {&__pyx_n_s_Surface_unlock, __pyx_k_Surface_unlock, sizeof(__pyx_k_Surface_unlock), 0, 0, 1, 1}, {&__pyx_n_s_Surface_unmap_rgb, __pyx_k_Surface_unmap_rgb, sizeof(__pyx_k_Surface_unmap_rgb), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_x_x, __pyx_k_Surface_x_x, sizeof(__pyx_k_Surface_x_x), 0, 0, 1, 0}, {&__pyx_kp_s_The_data_must_fill_the_surface, __pyx_k_The_data_must_fill_the_surface, sizeof(__pyx_k_The_data_must_fill_the_surface), 0, 0, 1, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, {&__pyx_n_s__89, __pyx_k__89, sizeof(__pyx_k__89), 0, 0, 1, 1}, {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1}, {&__pyx_n_s_amask, __pyx_k_amask, sizeof(__pyx_k_amask), 0, 0, 1, 1}, {&__pyx_n_s_amin, __pyx_k_amin, sizeof(__pyx_k_amin), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_area, __pyx_k_area, sizeof(__pyx_k_area), 0, 0, 1, 1}, {&__pyx_n_s_area_ptr, __pyx_k_area_ptr, sizeof(__pyx_k_area_ptr), 0, 0, 1, 1}, {&__pyx_n_s_area_rect, __pyx_k_area_rect, sizeof(__pyx_k_area_rect), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_blit, __pyx_k_blit, sizeof(__pyx_k_blit), 0, 0, 1, 1}, {&__pyx_n_s_bmask, __pyx_k_bmask, sizeof(__pyx_k_bmask), 0, 0, 1, 1}, {&__pyx_n_s_botright, __pyx_k_botright, sizeof(__pyx_k_botright), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_colorkey, __pyx_k_colorkey, sizeof(__pyx_k_colorkey), 0, 0, 1, 1}, {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, {&__pyx_n_s_convert_alpha, __pyx_k_convert_alpha, sizeof(__pyx_k_convert_alpha), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_dest_rect, __pyx_k_dest_rect, sizeof(__pyx_k_dest_rect), 0, 0, 1, 1}, {&__pyx_n_s_destptr, __pyx_k_destptr, sizeof(__pyx_k_destptr), 0, 0, 1, 1}, {&__pyx_n_s_destx, __pyx_k_destx, sizeof(__pyx_k_destx), 0, 0, 1, 1}, {&__pyx_n_s_desty, __pyx_k_desty, sizeof(__pyx_k_desty), 0, 0, 1, 1}, {&__pyx_n_s_dirty, __pyx_k_dirty, sizeof(__pyx_k_dirty), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1}, {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_from_data, __pyx_k_from_data, sizeof(__pyx_k_from_data), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_abs_offset, __pyx_k_get_abs_offset, sizeof(__pyx_k_get_abs_offset), 0, 0, 1, 1}, {&__pyx_n_s_get_abs_parent, __pyx_k_get_abs_parent, sizeof(__pyx_k_get_abs_parent), 0, 0, 1, 1}, {&__pyx_n_s_get_alpha, __pyx_k_get_alpha, sizeof(__pyx_k_get_alpha), 0, 0, 1, 1}, {&__pyx_n_s_get_at, __pyx_k_get_at, sizeof(__pyx_k_get_at), 0, 0, 1, 1}, {&__pyx_n_s_get_at_mapped, __pyx_k_get_at_mapped, sizeof(__pyx_k_get_at_mapped), 0, 0, 1, 1}, {&__pyx_n_s_get_bitsize, __pyx_k_get_bitsize, sizeof(__pyx_k_get_bitsize), 0, 0, 1, 1}, {&__pyx_n_s_get_bounding_rect, __pyx_k_get_bounding_rect, sizeof(__pyx_k_get_bounding_rect), 0, 0, 1, 1}, {&__pyx_n_s_get_buffer, __pyx_k_get_buffer, sizeof(__pyx_k_get_buffer), 0, 0, 1, 1}, {&__pyx_n_s_get_bytesize, __pyx_k_get_bytesize, sizeof(__pyx_k_get_bytesize), 0, 0, 1, 1}, {&__pyx_n_s_get_clip, __pyx_k_get_clip, sizeof(__pyx_k_get_clip), 0, 0, 1, 1}, {&__pyx_n_s_get_colorkey, __pyx_k_get_colorkey, sizeof(__pyx_k_get_colorkey), 0, 0, 1, 1}, {&__pyx_n_s_get_flags, __pyx_k_get_flags, sizeof(__pyx_k_get_flags), 0, 0, 1, 1}, {&__pyx_n_s_get_height, __pyx_k_get_height, sizeof(__pyx_k_get_height), 0, 0, 1, 1}, {&__pyx_n_s_get_locked, __pyx_k_get_locked, sizeof(__pyx_k_get_locked), 0, 0, 1, 1}, {&__pyx_n_s_get_locks, __pyx_k_get_locks, sizeof(__pyx_k_get_locks), 0, 0, 1, 1}, {&__pyx_n_s_get_losses, __pyx_k_get_losses, sizeof(__pyx_k_get_losses), 0, 0, 1, 1}, {&__pyx_n_s_get_masks, __pyx_k_get_masks, sizeof(__pyx_k_get_masks), 0, 0, 1, 1}, {&__pyx_n_s_get_offset, __pyx_k_get_offset, sizeof(__pyx_k_get_offset), 0, 0, 1, 1}, {&__pyx_n_s_get_parent, __pyx_k_get_parent, sizeof(__pyx_k_get_parent), 0, 0, 1, 1}, {&__pyx_n_s_get_pitch, __pyx_k_get_pitch, sizeof(__pyx_k_get_pitch), 0, 0, 1, 1}, {&__pyx_n_s_get_rect, __pyx_k_get_rect, sizeof(__pyx_k_get_rect), 0, 0, 1, 1}, {&__pyx_n_s_get_shifts, __pyx_k_get_shifts, sizeof(__pyx_k_get_shifts), 0, 0, 1, 1}, {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1}, {&__pyx_n_s_get_surface, __pyx_k_get_surface, sizeof(__pyx_k_get_surface), 0, 0, 1, 1}, {&__pyx_n_s_get_view, __pyx_k_get_view, sizeof(__pyx_k_get_view), 0, 0, 1, 1}, {&__pyx_n_s_get_width, __pyx_k_get_width, sizeof(__pyx_k_get_width), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_gmask, __pyx_k_gmask, sizeof(__pyx_k_gmask), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_map_rgb, __pyx_k_map_rgb, sizeof(__pyx_k_map_rgb), 0, 0, 1, 1}, {&__pyx_n_s_masks, __pyx_k_masks, sizeof(__pyx_k_masks), 0, 0, 1, 1}, {&__pyx_n_s_maxx, __pyx_k_maxx, sizeof(__pyx_k_maxx), 0, 0, 1, 1}, {&__pyx_n_s_maxy, __pyx_k_maxy, sizeof(__pyx_k_maxy), 0, 0, 1, 1}, {&__pyx_n_s_min_alpha, __pyx_k_min_alpha, sizeof(__pyx_k_min_alpha), 0, 0, 1, 1}, {&__pyx_n_s_minx, __pyx_k_minx, sizeof(__pyx_k_minx), 0, 0, 1, 1}, {&__pyx_n_s_miny, __pyx_k_miny, sizeof(__pyx_k_miny), 0, 0, 1, 1}, {&__pyx_n_s_move_height, __pyx_k_move_height, sizeof(__pyx_k_move_height), 0, 0, 1, 1}, {&__pyx_n_s_move_width, __pyx_k_move_width, sizeof(__pyx_k_move_width), 0, 0, 1, 1}, {&__pyx_n_s_mustlock, __pyx_k_mustlock, sizeof(__pyx_k_mustlock), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_new_surface, __pyx_k_new_surface, sizeof(__pyx_k_new_surface), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_offset_x, __pyx_k_offset_x, sizeof(__pyx_k_offset_x), 0, 0, 1, 1}, {&__pyx_n_s_offset_y, __pyx_k_offset_y, sizeof(__pyx_k_offset_y), 0, 0, 1, 1}, {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, {&__pyx_n_s_per_pixel, __pyx_k_per_pixel, sizeof(__pyx_k_per_pixel), 0, 0, 1, 1}, {&__pyx_n_s_pixel, __pyx_k_pixel, sizeof(__pyx_k_pixel), 0, 0, 1, 1}, {&__pyx_n_s_pixel_format, __pyx_k_pixel_format, sizeof(__pyx_k_pixel_format), 0, 0, 1, 1}, {&__pyx_n_s_pixels, __pyx_k_pixels, sizeof(__pyx_k_pixels), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_surface, __pyx_k_pygame_sdl2_surface, sizeof(__pyx_k_pygame_sdl2_surface), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, {&__pyx_n_s_rmask, __pyx_k_rmask, sizeof(__pyx_k_rmask), 0, 0, 1, 1}, {&__pyx_n_s_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 0, 1, 1}, {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_sample_format, __pyx_k_sample_format, sizeof(__pyx_k_sample_format), 0, 0, 1, 1}, {&__pyx_n_s_scroll, __pyx_k_scroll, sizeof(__pyx_k_scroll), 0, 0, 1, 1}, {&__pyx_n_s_sdl_rect, __pyx_k_sdl_rect, sizeof(__pyx_k_sdl_rect), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_alpha, __pyx_k_set_alpha, sizeof(__pyx_k_set_alpha), 0, 0, 1, 1}, {&__pyx_n_s_set_at, __pyx_k_set_at, sizeof(__pyx_k_set_at), 0, 0, 1, 1}, {&__pyx_n_s_set_clip, __pyx_k_set_clip, sizeof(__pyx_k_set_clip), 0, 0, 1, 1}, {&__pyx_n_s_set_colorkey, __pyx_k_set_colorkey, sizeof(__pyx_k_set_colorkey), 0, 0, 1, 1}, {&__pyx_n_s_set_masks, __pyx_k_set_masks, sizeof(__pyx_k_set_masks), 0, 0, 1, 1}, {&__pyx_n_s_set_shifts, __pyx_k_set_shifts, sizeof(__pyx_k_set_shifts), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_shifts, __pyx_k_shifts, sizeof(__pyx_k_shifts), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_sizeof, __pyx_k_sizeof, sizeof(__pyx_k_sizeof), 0, 0, 1, 1}, {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_special_flags, __pyx_k_special_flags, sizeof(__pyx_k_special_flags), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_k_src_pygame_sdl2_surface_pyx, sizeof(__pyx_k_src_pygame_sdl2_surface_pyx), 0, 0, 1, 0}, {&__pyx_n_s_srcptr, __pyx_k_srcptr, sizeof(__pyx_k_srcptr), 0, 0, 1, 1}, {&__pyx_n_s_srcx, __pyx_k_srcx, sizeof(__pyx_k_srcx), 0, 0, 1, 1}, {&__pyx_n_s_srcy, __pyx_k_srcy, sizeof(__pyx_k_srcy), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_subsurface, __pyx_k_subsurface, sizeof(__pyx_k_subsurface), 0, 0, 1, 1}, {&__pyx_kp_s_subsurface_rectangle_outside_sur, __pyx_k_subsurface_rectangle_outside_sur, sizeof(__pyx_k_subsurface_rectangle_outside_sur), 0, 0, 1, 0}, {&__pyx_kp_s_subsurface_size_must_be_non_nega, __pyx_k_subsurface_size_must_be_non_nega, sizeof(__pyx_k_subsurface_size_must_be_non_nega), 0, 0, 1, 0}, {&__pyx_n_s_surf, __pyx_k_surf, sizeof(__pyx_k_surf), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_temp, __pyx_k_temp, sizeof(__pyx_k_temp), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_topleft, __pyx_k_topleft, sizeof(__pyx_k_topleft), 0, 0, 1, 1}, {&__pyx_n_s_total_size, __pyx_k_total_size, sizeof(__pyx_k_total_size), 0, 0, 1, 1}, {&__pyx_n_s_unlock, __pyx_k_unlock, sizeof(__pyx_k_unlock), 0, 0, 1, 1}, {&__pyx_n_s_unmap_rgb, __pyx_k_unmap_rgb, sizeof(__pyx_k_unmap_rgb), 0, 0, 1, 1}, {&__pyx_n_s_use_format, __pyx_k_use_format, sizeof(__pyx_k_use_format), 0, 0, 1, 1}, {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 103, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 538, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 563, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/surface.pyx":289 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/surface.pyx":368 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: * return Rect(0, 0, 0, 0) # <<<<<<<<<<<<<< * * with nogil: */ __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, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/surface.pyx":538 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise IndexError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Position_outside_surface); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/surface.pyx":848 * def from_data(self, data): * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: * raise ValueError("The data must fill the surface.") # <<<<<<<<<<<<<< * * cdef Uint8 *d = data */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_The_data_must_fill_the_surface); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/surface.pyx":78 * warnings.warn("Memory leak via Surface in pygame_sdl2.") * * def __sizeof__(self): # <<<<<<<<<<<<<< * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_sizeof, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 78, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":182 * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * * def blit(self, Surface source, dest, area=None, int special_flags=0): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect */ __pyx_tuple__9 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_source, __pyx_n_s_dest, __pyx_n_s_area, __pyx_n_s_special_flags, __pyx_n_s_dest_rect, __pyx_n_s_area_rect, __pyx_n_s_area_ptr, __pyx_n_s_temp, __pyx_n_s_err, __pyx_n_s_key, __pyx_n_s_alpha, __pyx_n_s_colorkey, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_blit, 182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 182, __pyx_L1_error) __pyx_tuple__11 = PyTuple_Pack(2, Py_None, __pyx_int_0); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "pygame_sdl2/surface.pyx":245 * return dirty.clip(self.get_rect()) * * def convert(self, surface=None): # <<<<<<<<<<<<<< * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() */ __pyx_tuple__12 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_surface, __pyx_n_s_sample_format, __pyx_n_s_amask, __pyx_n_s_rmask, __pyx_n_s_gmask, __pyx_n_s_bmask, __pyx_n_s_pixel_format, __pyx_n_s_new_surface, __pyx_n_s_use_format, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_convert, 245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 245, __pyx_L1_error) __pyx_tuple__14 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "pygame_sdl2/surface.pyx":294 * return rv * * def convert_alpha(self, Surface surface=None): # <<<<<<<<<<<<<< * if surface is None: * surface = pygame_sdl2.display.get_surface() */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_convert_alpha, 294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 294, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":344 * return rv * * def copy(self): # <<<<<<<<<<<<<< * if self.surface.format.Amask: * return self.convert_alpha(self) */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_copy, 344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 344, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":350 * return self.convert(self) * * def fill(self, color, rect=None, special_flags=0): # <<<<<<<<<<<<<< * * cdef SDL_Rect sdl_rect */ __pyx_tuple__17 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_special_flags, __pyx_n_s_sdl_rect, __pyx_n_s_pixel, __pyx_n_s_err); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_fill, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 350, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":388 * * * def scroll(self, int dx=0, int dy=0): # <<<<<<<<<<<<<< * cdef int srcx, destx, move_width * cdef int srcy, desty, move_height */ __pyx_tuple__19 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_srcx, __pyx_n_s_destx, __pyx_n_s_move_width, __pyx_n_s_srcy, __pyx_n_s_desty, __pyx_n_s_move_height, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_per_pixel, __pyx_n_s_srcptr, __pyx_n_s_destptr); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_scroll, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 388, __pyx_L1_error) __pyx_tuple__21 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "pygame_sdl2/surface.pyx":434 * self.unlock() * * def set_colorkey(self, color, flags=0): # <<<<<<<<<<<<<< * * if color is None: */ __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_flags); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_set_colorkey, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 434, __pyx_L1_error) __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "pygame_sdl2/surface.pyx":444 * raise error() * * def get_colorkey(self): # <<<<<<<<<<<<<< * cdef Uint32 key * */ __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_colorkey, 444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 444, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":452 * return get_color(key, self.surface) * * def set_alpha(self, value, flags=0): # <<<<<<<<<<<<<< * if value is None: * value = 255 */ __pyx_tuple__27 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_flags); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_set_alpha, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 452, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":462 * raise error() * * def get_alpha(self): # <<<<<<<<<<<<<< * cdef Uint8 rv * */ __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_alpha, 462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 462, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":475 * return None * * def lock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_tuple__31 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_lock, __pyx_n_s_root); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_lock, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 475, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":492 * raise error() * * def unlock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_unlock, 492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 492, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":508 * SDL_UnlockSurface(root.surface) * * def mustlock(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_root); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_mustlock, 508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 508, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":516 * return SDL_MUSTLOCK(root.surface) * * def get_locked(self): # <<<<<<<<<<<<<< * if self.locklist: * return True */ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_locked, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 516, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":520 * return True * * def get_locks(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_locks, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 520, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":531 * return root.locklist * * def get_at(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ __pyx_tuple__38 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_pos, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_p, __pyx_n_s_pixel); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_at, 531, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 531, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":555 * return get_color(pixel, self.surface) * * def set_at(self, pos, color): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ __pyx_tuple__40 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_pos, __pyx_n_s_color, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_p, __pyx_n_s_pixel); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_set_at, 555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 555, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":580 * self.unlock() * * def get_at_mapped(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_at_mapped, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 580, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":604 * return pixel * * def map_rgb(self, color): # <<<<<<<<<<<<<< * return map_color(self.surface, color) * */ __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_color); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_map_rgb, 604, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 604, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":607 * return map_color(self.surface, color) * * def unmap_rgb(self, pixel): # <<<<<<<<<<<<<< * return get_color(pixel, self.surface) * */ __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pixel); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_unmap_rgb, 607, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 607, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":610 * return get_color(pixel, self.surface) * * def set_clip(self, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ __pyx_tuple__47 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_rect, __pyx_n_s_sdl_rect); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_set_clip, 610, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 610, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":619 * SDL_SetClipRect(self.surface, &sdl_rect) * * def get_clip(self): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_sdl_rect); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_clip, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 619, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":626 * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) * * def subsurface(self, *args): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ __pyx_tuple__51 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_sdl_rect, __pyx_n_s_pixels, __pyx_n_s_new_surface, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_subsurface, 626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 626, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":674 * return rv * * def get_parent(self): # <<<<<<<<<<<<<< * return self.parent * */ __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_parent, 674, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 674, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":677 * return self.parent * * def get_abs_parent(self): # <<<<<<<<<<<<<< * rv = self * */ __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_abs_parent, 677, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 677, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":685 * return rv * * def get_offset(self): # <<<<<<<<<<<<<< * return (self.offset_x, self.offset_y) * */ __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_offset, 685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 685, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":688 * return (self.offset_x, self.offset_y) * * def get_abs_offset(self): # <<<<<<<<<<<<<< * cdef Surface surf = self * */ __pyx_tuple__56 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_surf, __pyx_n_s_offset_x, __pyx_n_s_offset_y); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_abs_offset, 688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 688, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":701 * return (offset_x, offset_y) * * def get_size(self): # <<<<<<<<<<<<<< * return self.surface.w, self.surface.h * */ __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_size, 701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 701, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":704 * return self.surface.w, self.surface.h * * def get_width(self): # <<<<<<<<<<<<<< * return self.surface.w * */ __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_width, 704, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 704, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":707 * return self.surface.w * * def get_height(self): # <<<<<<<<<<<<<< * return self.surface.h * */ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_height, 707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 707, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":710 * return self.surface.h * * def get_rect(self, **kwargs): # <<<<<<<<<<<<<< * rv = Rect((0, 0, self.surface.w, self.surface.h)) * */ __pyx_tuple__61 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_kwargs, __pyx_n_s_rv, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_rect, 710, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 710, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":718 * return rv * * def get_bitsize(self): # <<<<<<<<<<<<<< * return self.surface.format.BitsPerPixel * */ __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_bitsize, 718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 718, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":721 * return self.surface.format.BitsPerPixel * * def get_bytesize(self): # <<<<<<<<<<<<<< * return self.surface.format.BytesPerPixel * */ __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_bytesize, 721, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 721, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":724 * return self.surface.format.BytesPerPixel * * def get_flags(self): # <<<<<<<<<<<<<< * * if self.get_window_flags: */ __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_flags, 724, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 724, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":736 * return rv * * def get_pitch(self): # <<<<<<<<<<<<<< * return self.surface.pitch * */ __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_pitch, 736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 736, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":739 * return self.surface.pitch * * def get_masks(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) */ __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_format); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_masks, 739, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 739, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":743 * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * * def set_masks(self, masks): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_masks is not supported.") * */ __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_masks); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_set_masks, 743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 743, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":746 * warnings.warn("Surface.set_masks is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_shifts, 746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 746, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":750 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def set_shifts(self, shifts): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_shifts is not supported.") * */ __pyx_tuple__72 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_shifts); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_set_shifts, 750, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 750, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":753 * warnings.warn("Surface.set_shifts is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_shifts, 753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 753, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":757 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def get_losses(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) */ __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_losses, 757, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 757, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":761 * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * * def get_bounding_rect(self, min_alpha=1): # <<<<<<<<<<<<<< * * cdef Uint32 amask = self.surface.format.Amask */ __pyx_tuple__76 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_min_alpha, __pyx_n_s_amask, __pyx_n_s_amin, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_minx, __pyx_n_s_maxx, __pyx_n_s_miny, __pyx_n_s_maxy, __pyx_n_s_row, __pyx_n_s_topleft, __pyx_n_s_botright, __pyx_n_s_pixels); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_bounding_rect, 761, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 761, __pyx_L1_error) __pyx_tuple__78 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); /* "pygame_sdl2/surface.pyx":835 * return Rect((x, y, w, h)) * * def get_view(self, kind='2'): # <<<<<<<<<<<<<< * raise error("Surface.get_view is not supported.") * */ __pyx_tuple__79 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_kind); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_view, 835, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 835, __pyx_L1_error) __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_2); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); /* "pygame_sdl2/surface.pyx":838 * raise error("Surface.get_view is not supported.") * * def get_buffer(self): # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] */ __pyx_tuple__82 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pixels); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__82); __Pyx_GIVEREF(__pyx_tuple__82); __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_buffer, 838, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 838, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":846 * return self.surface.pixels * * def from_data(self, data): # <<<<<<<<<<<<<< * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: * raise ValueError("The data must fill the surface.") */ __pyx_tuple__84 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_d, __pyx_n_s_pixels, __pyx_n_s_i); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84); __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_from_data, 846, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 846, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__87 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87); __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16843009 = PyInt_FromLong(16843009L); if (unlikely(!__pyx_int_16843009)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4294967295 = PyInt_FromString((char *)"4294967295", 0, 0); if (unlikely(!__pyx_int_4294967295)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("PySurface_AsSurface", (void (*)(void))__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface, "SDL_Surface *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PySurface_New", (void (*)(void))__pyx_f_11pygame_sdl2_7surface_PySurface_New, "PyObject *(SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_7surface_Surface = &__pyx_vtable_11pygame_sdl2_7surface_Surface; __pyx_vtable_11pygame_sdl2_7surface_Surface.take_surface = (void (*)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *))__pyx_f_11pygame_sdl2_7surface_7Surface_take_surface; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_7surface_Surface = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_7surface_Surface_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(0, 53, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_7surface_Surface_spec, __pyx_ptype_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_7surface_Surface = &__pyx_type_11pygame_sdl2_7surface_Surface; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_7surface_Surface->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dictoffset && __pyx_ptype_11pygame_sdl2_7surface_Surface->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_7surface_Surface->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_vtabptr_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Surface, (PyObject *) __pyx_ptype_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_7surface_Surface->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7surface_Surface, __weakref__); #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.color"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_5color_Color),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_5color_Color) __PYX_ERR(2, 26, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_4rect_Rect),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_4rect_Rect) __PYX_ERR(3, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.color"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_8(__pyx_t_1, "map_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_map_color, "Uint32 (SDL_Surface *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_8(__pyx_t_1, "get_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_get_color, "PyObject *(Uint32, SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_8(__pyx_t_1, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_surface(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_surface}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "surface", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initsurface(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initsurface(void) #else __Pyx_PyMODINIT_FUNC PyInit_surface(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_surface(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_surface(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'surface' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("surface", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "surface" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_surface(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__surface) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.surface")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.surface", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/surface.pyx":25 * from pygame_sdl2.color cimport map_color, get_color * from pygame_sdl2.rect cimport to_sdl_rect * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * * from pygame_sdl2.error import error */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Rect)) __PYX_ERR(0, 25, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":27 * from pygame_sdl2.rect import Rect * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.locals import SRCALPHA * import pygame_sdl2 */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error)) __PYX_ERR(0, 27, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":28 * * from pygame_sdl2.error import error * from pygame_sdl2.locals import SRCALPHA # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_SRCALPHA); __Pyx_GIVEREF(__pyx_n_s_SRCALPHA); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SRCALPHA)) __PYX_ERR(0, 28, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":29 * from pygame_sdl2.error import error * from pygame_sdl2.locals import SRCALPHA * import pygame_sdl2 # <<<<<<<<<<<<<< * * import warnings */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":31 * import pygame_sdl2 * * import warnings # <<<<<<<<<<<<<< * * cdef extern from "src/surface.h" nogil: */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":51 * * # The total size of all allocated surfaces * total_size = 0 # <<<<<<<<<<<<<< * * cdef class Surface: */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_size, __pyx_int_0) < 0) __PYX_ERR(0, 51, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":78 * warnings.warn("Memory leak via Surface in pygame_sdl2.") * * def __sizeof__(self): # <<<<<<<<<<<<<< * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_5__sizeof__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface___sizeof, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_sizeof, __pyx_t_3) < 0) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":182 * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * * def blit(self, Surface source, dest, area=None, int special_flags=0): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_11blit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_blit, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__11); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_blit, __pyx_t_3) < 0) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":245 * return dirty.clip(self.get_rect()) * * def convert(self, surface=None): # <<<<<<<<<<<<<< * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_13convert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_convert, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_convert, __pyx_t_3) < 0) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":294 * return rv * * def convert_alpha(self, Surface surface=None): # <<<<<<<<<<<<<< * if surface is None: * surface = pygame_sdl2.display.get_surface() */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_15convert_alpha, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_convert_alpha, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_convert_alpha, __pyx_t_3) < 0) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":344 * return rv * * def copy(self): # <<<<<<<<<<<<<< * if self.surface.format.Amask: * return self.convert_alpha(self) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_17copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_copy, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_copy, __pyx_t_3) < 0) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":350 * return self.convert(self) * * def fill(self, color, rect=None, special_flags=0): # <<<<<<<<<<<<<< * * cdef SDL_Rect sdl_rect */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_19fill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_fill, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__11); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":388 * * * def scroll(self, int dx=0, int dy=0): # <<<<<<<<<<<<<< * cdef int srcx, destx, move_width * cdef int srcy, desty, move_height */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_21scroll, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_scroll, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__21); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_scroll, __pyx_t_3) < 0) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":434 * self.unlock() * * def set_colorkey(self, color, flags=0): # <<<<<<<<<<<<<< * * if color is None: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_23set_colorkey, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_set_colorkey, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_set_colorkey, __pyx_t_3) < 0) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":444 * raise error() * * def get_colorkey(self): # <<<<<<<<<<<<<< * cdef Uint32 key * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_25get_colorkey, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_colorkey, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_colorkey, __pyx_t_3) < 0) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":452 * return get_color(key, self.surface) * * def set_alpha(self, value, flags=0): # <<<<<<<<<<<<<< * if value is None: * value = 255 */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_27set_alpha, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_set_alpha, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_set_alpha, __pyx_t_3) < 0) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":462 * raise error() * * def get_alpha(self): # <<<<<<<<<<<<<< * cdef Uint8 rv * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_29get_alpha, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_alpha, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_alpha, __pyx_t_3) < 0) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":475 * return None * * def lock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_31lock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_lock, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_lock, __pyx_t_3) < 0) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":492 * raise error() * * def unlock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_33unlock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_unlock, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_unlock, __pyx_t_3) < 0) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":508 * SDL_UnlockSurface(root.surface) * * def mustlock(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_35mustlock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_mustlock, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_mustlock, __pyx_t_3) < 0) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":516 * return SDL_MUSTLOCK(root.surface) * * def get_locked(self): # <<<<<<<<<<<<<< * if self.locklist: * return True */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_37get_locked, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_locked, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_locked, __pyx_t_3) < 0) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":520 * return True * * def get_locks(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_39get_locks, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_locks, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_locks, __pyx_t_3) < 0) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":531 * return root.locklist * * def get_at(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_41get_at, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_at, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_at, __pyx_t_3) < 0) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":555 * return get_color(pixel, self.surface) * * def set_at(self, pos, color): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_43set_at, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_set_at, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_set_at, __pyx_t_3) < 0) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":580 * self.unlock() * * def get_at_mapped(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_45get_at_mapped, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_at_mapped, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_at_mapped, __pyx_t_3) < 0) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":604 * return pixel * * def map_rgb(self, color): # <<<<<<<<<<<<<< * return map_color(self.surface, color) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_47map_rgb, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_map_rgb, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_map_rgb, __pyx_t_3) < 0) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":607 * return map_color(self.surface, color) * * def unmap_rgb(self, pixel): # <<<<<<<<<<<<<< * return get_color(pixel, self.surface) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_49unmap_rgb, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_unmap_rgb, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_unmap_rgb, __pyx_t_3) < 0) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":610 * return get_color(pixel, self.surface) * * def set_clip(self, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_51set_clip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_set_clip, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_set_clip, __pyx_t_3) < 0) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":619 * SDL_SetClipRect(self.surface, &sdl_rect) * * def get_clip(self): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_53get_clip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_clip, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_clip, __pyx_t_3) < 0) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":626 * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) * * def subsurface(self, *args): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_55subsurface, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_subsurface, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_subsurface, __pyx_t_3) < 0) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":674 * return rv * * def get_parent(self): # <<<<<<<<<<<<<< * return self.parent * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_57get_parent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_parent, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_parent, __pyx_t_3) < 0) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":677 * return self.parent * * def get_abs_parent(self): # <<<<<<<<<<<<<< * rv = self * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_59get_abs_parent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_abs_parent, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_abs_parent, __pyx_t_3) < 0) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":685 * return rv * * def get_offset(self): # <<<<<<<<<<<<<< * return (self.offset_x, self.offset_y) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_61get_offset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_offset, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_offset, __pyx_t_3) < 0) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":688 * return (self.offset_x, self.offset_y) * * def get_abs_offset(self): # <<<<<<<<<<<<<< * cdef Surface surf = self * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_63get_abs_offset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_abs_offset, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_abs_offset, __pyx_t_3) < 0) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":701 * return (offset_x, offset_y) * * def get_size(self): # <<<<<<<<<<<<<< * return self.surface.w, self.surface.h * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_65get_size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_size, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_size, __pyx_t_3) < 0) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":704 * return self.surface.w, self.surface.h * * def get_width(self): # <<<<<<<<<<<<<< * return self.surface.w * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_67get_width, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_width, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_width, __pyx_t_3) < 0) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":707 * return self.surface.w * * def get_height(self): # <<<<<<<<<<<<<< * return self.surface.h * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_69get_height, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_height, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_height, __pyx_t_3) < 0) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":710 * return self.surface.h * * def get_rect(self, **kwargs): # <<<<<<<<<<<<<< * rv = Rect((0, 0, self.surface.w, self.surface.h)) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_71get_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_rect, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_rect, __pyx_t_3) < 0) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":718 * return rv * * def get_bitsize(self): # <<<<<<<<<<<<<< * return self.surface.format.BitsPerPixel * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_73get_bitsize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_bitsize, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_bitsize, __pyx_t_3) < 0) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":721 * return self.surface.format.BitsPerPixel * * def get_bytesize(self): # <<<<<<<<<<<<<< * return self.surface.format.BytesPerPixel * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_75get_bytesize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_bytesize, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_bytesize, __pyx_t_3) < 0) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":724 * return self.surface.format.BytesPerPixel * * def get_flags(self): # <<<<<<<<<<<<<< * * if self.get_window_flags: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_77get_flags, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_flags, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_flags, __pyx_t_3) < 0) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":736 * return rv * * def get_pitch(self): # <<<<<<<<<<<<<< * return self.surface.pitch * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_79get_pitch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_pitch, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_pitch, __pyx_t_3) < 0) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":739 * return self.surface.pitch * * def get_masks(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_81get_masks, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_masks, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_masks, __pyx_t_3) < 0) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":743 * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * * def set_masks(self, masks): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_masks is not supported.") * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_83set_masks, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_set_masks, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_set_masks, __pyx_t_3) < 0) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":746 * warnings.warn("Surface.set_masks is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_85get_shifts, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_shifts, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_shifts, __pyx_t_3) < 0) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":750 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def set_shifts(self, shifts): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_shifts is not supported.") * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_87set_shifts, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_set_shifts, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_set_shifts, __pyx_t_3) < 0) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":753 * warnings.warn("Surface.set_shifts is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_89get_shifts, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_shifts, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_shifts, __pyx_t_3) < 0) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":757 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def get_losses(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_91get_losses, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_losses, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_losses, __pyx_t_3) < 0) __PYX_ERR(0, 757, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":761 * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * * def get_bounding_rect(self, min_alpha=1): # <<<<<<<<<<<<<< * * cdef Uint32 amask = self.surface.format.Amask */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_93get_bounding_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_bounding_rect, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__78); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_bounding_rect, __pyx_t_3) < 0) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":835 * return Rect((x, y, w, h)) * * def get_view(self, kind='2'): # <<<<<<<<<<<<<< * raise error("Surface.get_view is not supported.") * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_95get_view, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_view, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__81); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_view, __pyx_t_3) < 0) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":838 * raise error("Surface.get_view is not supported.") * * def get_buffer(self): # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_97get_buffer, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_buffer, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_buffer, __pyx_t_3) < 0) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":846 * return self.surface.pixels * * def from_data(self, data): # <<<<<<<<<<<<<< * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: * raise ValueError("The data must fill the surface.") */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_99from_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_from_data, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_from_data, __pyx_t_3) < 0) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_101__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_103__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Copyright 2014 Tom Rothamel * # */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.surface", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.surface"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); else state = (PyGILState_STATE)0; #endif CYTHON_UNUSED_VAR(clineno); CYTHON_UNUSED_VAR(lineno); CYTHON_UNUSED_VAR(filename); CYTHON_MAYBE_UNUSED_VAR(nogil); __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } *pvalue1 = value1; *pvalue2 = value2; return 0; #if CYTHON_COMPILING_IN_PYPY bad: Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; #endif } static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = __Pyx_PyObject_GetIterNextFunc(iter); value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { #if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; #elif PY_MAJOR_VERSION >= 3 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { const char *name = PyUnicode_AsUTF8(method_name); if (strcmp(name, "iteritems") == 0) pp = &py_items; else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; else if (strcmp(name, "itervalues") == 0) pp = &py_values; if (pp) { if (!*pp) { *pp = PyUnicode_FromString(name + 4); if (!*pp) return NULL; } method_name = *pp; } } #endif } *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { const long a = intval; long b = PyInt_AS_LONG(op2); #ifdef HAVE_LONG_LONG if (sizeof(PY_LONG_LONG) > sizeof(long)) { PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; return (result >= LONG_MIN && result <= LONG_MAX) ? PyInt_FromLong((long)result) : PyLong_FromLongLong(result); } #endif #if CYTHON_USE_TYPE_SLOTS return PyInt_Type.tp_as_number->nb_multiply(op1, op2); #else return PyNumber_Multiply(op1, op2); #endif } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op2))) { const long a = intval; long b, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG lla = intval; PY_LONG_LONG llb, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op2))) { return __Pyx_NewRef(op2); } if (likely(__Pyx_PyLong_IsCompact(op2))) { b = __Pyx_PyLong_CompactValue(op2); } else { const digit* digits = __Pyx_PyLong_Digits(op2); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } } CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); #ifdef HAVE_LONG_LONG llb = b; goto long_long; #else return PyLong_Type.tp_as_number->nb_multiply(op1, op2); #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla * llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op2)) { const long a = intval; #if CYTHON_COMPILING_IN_LIMITED_API double b = __pyx_PyFloat_AsDouble(op2); #else double b = PyFloat_AS_DOUBLE(op2); #endif double result; PyFPE_START_PROTECT("multiply", return NULL) result = ((double)a) * (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #endif /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetVTable */ static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { PyObject *ob = PyCapsule_New(vtable, 0, 0); if (unlikely(!ob)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* MergeVTables */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type) { int i; void** base_vtables; __Pyx_TypeName tp_base_name; __Pyx_TypeName base_name; void* unknown = (void*)-1; PyObject* bases = type->tp_bases; int base_depth = 0; { PyTypeObject* base = type->tp_base; while (base) { base_depth += 1; base = base->tp_base; } } base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); if (base_vtable != NULL) { int j; PyTypeObject* base = type->tp_base; for (j = 0; j < base_depth; j++) { if (base_vtables[j] == unknown) { base_vtables[j] = __Pyx_GetVtable(base); base_vtables[j + 1] = unknown; } if (base_vtables[j] == base_vtable) { break; } else if (base_vtables[j] == NULL) { goto bad; } base = base->tp_base; } } } PyErr_Clear(); free(base_vtables); return 0; bad: tp_base_name = __Pyx_PyType_GetName(type->tp_base); base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); free(base_vtables); return -1; } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_8 #define __PYX_HAVE_RT_ImportType_3_0_8 static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__5); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__6; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint32_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint32_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint8_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT)) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT)) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT)) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint8_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } } #endif if ((sizeof(uint8_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint8_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint8_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint8_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint8_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint8_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint8_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint8_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint8_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint8_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint8_t) 1) << (sizeof(uint8_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint8_t) -1; } } else { uint8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint64_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__89); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; cobj = PyCapsule_New(tmp.p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_8 #define __PYX_HAVE_RT_ImportFunction_3_0_8 static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709471.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.surface_api.h0000664000175000017500000000434014760217137021305 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef __PYX_HAVE_API__pygame_sdl2__surface #define __PYX_HAVE_API__pygame_sdl2__surface #ifdef __MINGW64__ #define MS_WIN64 #endif #include "Python.h" static SDL_Surface *(*__pyx_api_f_11pygame_sdl2_7surface_PySurface_AsSurface)(PyObject *) = 0; #define PySurface_AsSurface __pyx_api_f_11pygame_sdl2_7surface_PySurface_AsSurface static PyObject *(*__pyx_api_f_11pygame_sdl2_7surface_PySurface_New)(SDL_Surface *) = 0; #define PySurface_New __pyx_api_f_11pygame_sdl2_7surface_PySurface_New #ifndef __PYX_HAVE_RT_ImportFunction_3_0_8 #define __PYX_HAVE_RT_ImportFunction_3_0_8 static int __Pyx_ImportFunction_3_0_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int import_pygame_sdl2__surface(void) { PyObject *module = 0; module = PyImport_ImportModule("pygame_sdl2.surface"); if (!module) goto bad; if (__Pyx_ImportFunction_3_0_8(module, "PySurface_AsSurface", (void (**)(void))&__pyx_api_f_11pygame_sdl2_7surface_PySurface_AsSurface, "SDL_Surface *(PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction_3_0_8(module, "PySurface_New", (void (**)(void))&__pyx_api_f_11pygame_sdl2_7surface_PySurface_New, "PyObject *(SDL_Surface *)") < 0) goto bad; Py_DECREF(module); module = 0; return 0; bad: Py_XDECREF(module); return -1; } #endif /* !__PYX_HAVE_API__pygame_sdl2__surface */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740709474.0 pygame_sdl2-2.1.0+renpy8.4.1/gen/pygame_sdl2.transform.c0000664000175000017500000147562414760217142021050 0ustar00tomtom/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__transform #define __PYX_HAVE_API__pygame_sdl2__transform /* Early includes */ #include #include #include #include #include "SDL.h" #include "SDL2_rotozoom.h" #include "SDL_gfxPrimitives.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) { const wchar_t *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/transform.pyx", "src/pygame_sdl2/surface.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 #define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_8 { __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_gfx" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.transform" */ static uint32_t __pyx_f_11pygame_sdl2_9transform_get_at(SDL_Surface *, int, int); /*proto*/ static void __pyx_f_11pygame_sdl2_9transform_set_at(SDL_Surface *, int, int, uint32_t); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.transform" extern int __pyx_module_is_main_pygame_sdl2__transform; int __pyx_module_is_main_pygame_sdl2__transform = 0; /* Implementation of "pygame_sdl2.transform" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_range; /* #### Code section: string_decls ### */ static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k_c[] = "c"; static const char __pyx_k_d[] = "d"; static const char __pyx_k_e[] = "e"; static const char __pyx_k_f[] = "f"; static const char __pyx_k_g[] = "g"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__2[] = "."; static const char __pyx_k_e0[] = "e0"; static const char __pyx_k_e1[] = "e1"; static const char __pyx_k_e2[] = "e2"; static const char __pyx_k_e3[] = "e3"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__16[] = "?"; static const char __pyx_k_err[] = "err"; static const char __pyx_k_src[] = "src"; static const char __pyx_k_dest[] = "dest"; static const char __pyx_k_flip[] = "flip"; static const char __pyx_k_lock[] = "lock"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_angle[] = "angle"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_rsurf[] = "rsurf"; static const char __pyx_k_scale[] = "scale"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_xbool[] = "xbool"; static const char __pyx_k_ybool[] = "ybool"; static const char __pyx_k_height[] = "height"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_rotate[] = "rotate"; static const char __pyx_k_smooth[] = "smooth"; static const char __pyx_k_unlock[] = "unlock"; static const char __pyx_k_scale2x[] = "scale2x"; static const char __pyx_k_scale_x[] = "scale_x"; static const char __pyx_k_scale_y[] = "scale_y"; static const char __pyx_k_src_end[] = "src_end"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_get_size[] = "get_size"; static const char __pyx_k_rotozoom[] = "rotozoom"; static const char __pyx_k_surf_out[] = "surf_out"; static const char __pyx_k_get_flags[] = "get_flags"; static const char __pyx_k_get_width[] = "get_width"; static const char __pyx_k_src_pixel[] = "src_pixel"; static const char __pyx_k_dest_delta[] = "dest_delta"; static const char __pyx_k_dest_pixel[] = "dest_pixel"; static const char __pyx_k_get_height[] = "get_height"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_DestSurface[] = "DestSurface"; static const char __pyx_k_smoothscale[] = "smoothscale"; static const char __pyx_k_get_bytesize[] = "get_bytesize"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_transform[] = "pygame_sdl2.transform"; static const char __pyx_k_src_pygame_sdl2_transform_pyx[] = "src/pygame_sdl2/transform.pyx"; static const char __pyx_k_Surface_has_unsupported_bytesize[] = "Surface has unsupported bytesize."; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_flip(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, int __pyx_v_xbool, int __pyx_v_ybool); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_2scale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_4rotate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_angle); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_6rotozoom(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, double __pyx_v_angle, double __pyx_v_scale, int __pyx_v_smooth); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_8scale2x(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_10smoothscale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_n_s_DestSurface; PyObject *__pyx_kp_s_Surface_has_unsupported_bytesize; PyObject *__pyx_n_s__16; PyObject *__pyx_kp_u__2; PyObject *__pyx_n_s_a; PyObject *__pyx_n_s_angle; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_b; PyObject *__pyx_n_s_c; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_d; PyObject *__pyx_n_s_dest; PyObject *__pyx_n_s_dest_delta; PyObject *__pyx_n_s_dest_pixel; PyObject *__pyx_n_s_e; PyObject *__pyx_n_s_e0; PyObject *__pyx_n_s_e1; PyObject *__pyx_n_s_e2; PyObject *__pyx_n_s_e3; PyObject *__pyx_n_s_err; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_f; PyObject *__pyx_n_s_flip; PyObject *__pyx_n_s_g; PyObject *__pyx_n_s_get_bytesize; PyObject *__pyx_n_s_get_flags; PyObject *__pyx_n_s_get_height; PyObject *__pyx_n_s_get_size; PyObject *__pyx_n_s_get_width; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_height; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_lock; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_transform; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_range; PyObject *__pyx_n_s_rotate; PyObject *__pyx_n_s_rotozoom; PyObject *__pyx_n_s_rsurf; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_scale; PyObject *__pyx_n_s_scale2x; PyObject *__pyx_n_s_scale_x; PyObject *__pyx_n_s_scale_y; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_smooth; PyObject *__pyx_n_s_smoothscale; PyObject *__pyx_n_s_src; PyObject *__pyx_n_s_src_end; PyObject *__pyx_n_s_src_pixel; PyObject *__pyx_kp_s_src_pygame_sdl2_transform_pyx; PyObject *__pyx_n_s_surf_out; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_unlock; PyObject *__pyx_n_s_width; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_xbool; PyObject *__pyx_n_s_y; PyObject *__pyx_n_s_ybool; PyObject *__pyx_float_1_0; PyObject *__pyx_int_0; PyObject *__pyx_int_2; PyObject *__pyx_int_4; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_n_s_DestSurface); Py_CLEAR(clear_module_state->__pyx_kp_s_Surface_has_unsupported_bytesize); Py_CLEAR(clear_module_state->__pyx_n_s__16); Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_s_angle); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_b); Py_CLEAR(clear_module_state->__pyx_n_s_c); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_d); Py_CLEAR(clear_module_state->__pyx_n_s_dest); Py_CLEAR(clear_module_state->__pyx_n_s_dest_delta); Py_CLEAR(clear_module_state->__pyx_n_s_dest_pixel); Py_CLEAR(clear_module_state->__pyx_n_s_e); Py_CLEAR(clear_module_state->__pyx_n_s_e0); Py_CLEAR(clear_module_state->__pyx_n_s_e1); Py_CLEAR(clear_module_state->__pyx_n_s_e2); Py_CLEAR(clear_module_state->__pyx_n_s_e3); Py_CLEAR(clear_module_state->__pyx_n_s_err); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_f); Py_CLEAR(clear_module_state->__pyx_n_s_flip); Py_CLEAR(clear_module_state->__pyx_n_s_g); Py_CLEAR(clear_module_state->__pyx_n_s_get_bytesize); Py_CLEAR(clear_module_state->__pyx_n_s_get_flags); Py_CLEAR(clear_module_state->__pyx_n_s_get_height); Py_CLEAR(clear_module_state->__pyx_n_s_get_size); Py_CLEAR(clear_module_state->__pyx_n_s_get_width); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_height); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_lock); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_transform); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_s_rotate); Py_CLEAR(clear_module_state->__pyx_n_s_rotozoom); Py_CLEAR(clear_module_state->__pyx_n_s_rsurf); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_scale); Py_CLEAR(clear_module_state->__pyx_n_s_scale2x); Py_CLEAR(clear_module_state->__pyx_n_s_scale_x); Py_CLEAR(clear_module_state->__pyx_n_s_scale_y); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_smooth); Py_CLEAR(clear_module_state->__pyx_n_s_smoothscale); Py_CLEAR(clear_module_state->__pyx_n_s_src); Py_CLEAR(clear_module_state->__pyx_n_s_src_end); Py_CLEAR(clear_module_state->__pyx_n_s_src_pixel); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_transform_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_surf_out); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_unlock); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_xbool); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_n_s_ybool); Py_CLEAR(clear_module_state->__pyx_float_1_0); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_4); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_n_s_DestSurface); Py_VISIT(traverse_module_state->__pyx_kp_s_Surface_has_unsupported_bytesize); Py_VISIT(traverse_module_state->__pyx_n_s__16); Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_s_angle); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_b); Py_VISIT(traverse_module_state->__pyx_n_s_c); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_d); Py_VISIT(traverse_module_state->__pyx_n_s_dest); Py_VISIT(traverse_module_state->__pyx_n_s_dest_delta); Py_VISIT(traverse_module_state->__pyx_n_s_dest_pixel); Py_VISIT(traverse_module_state->__pyx_n_s_e); Py_VISIT(traverse_module_state->__pyx_n_s_e0); Py_VISIT(traverse_module_state->__pyx_n_s_e1); Py_VISIT(traverse_module_state->__pyx_n_s_e2); Py_VISIT(traverse_module_state->__pyx_n_s_e3); Py_VISIT(traverse_module_state->__pyx_n_s_err); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_f); Py_VISIT(traverse_module_state->__pyx_n_s_flip); Py_VISIT(traverse_module_state->__pyx_n_s_g); Py_VISIT(traverse_module_state->__pyx_n_s_get_bytesize); Py_VISIT(traverse_module_state->__pyx_n_s_get_flags); Py_VISIT(traverse_module_state->__pyx_n_s_get_height); Py_VISIT(traverse_module_state->__pyx_n_s_get_size); Py_VISIT(traverse_module_state->__pyx_n_s_get_width); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_height); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_lock); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_transform); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_s_rotate); Py_VISIT(traverse_module_state->__pyx_n_s_rotozoom); Py_VISIT(traverse_module_state->__pyx_n_s_rsurf); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_scale); Py_VISIT(traverse_module_state->__pyx_n_s_scale2x); Py_VISIT(traverse_module_state->__pyx_n_s_scale_x); Py_VISIT(traverse_module_state->__pyx_n_s_scale_y); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_smooth); Py_VISIT(traverse_module_state->__pyx_n_s_smoothscale); Py_VISIT(traverse_module_state->__pyx_n_s_src); Py_VISIT(traverse_module_state->__pyx_n_s_src_end); Py_VISIT(traverse_module_state->__pyx_n_s_src_pixel); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_transform_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_surf_out); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_unlock); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_xbool); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_n_s_ybool); Py_VISIT(traverse_module_state->__pyx_float_1_0); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_4); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_n_s_DestSurface __pyx_mstate_global->__pyx_n_s_DestSurface #define __pyx_kp_s_Surface_has_unsupported_bytesize __pyx_mstate_global->__pyx_kp_s_Surface_has_unsupported_bytesize #define __pyx_n_s__16 __pyx_mstate_global->__pyx_n_s__16 #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_n_s_angle __pyx_mstate_global->__pyx_n_s_angle #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d #define __pyx_n_s_dest __pyx_mstate_global->__pyx_n_s_dest #define __pyx_n_s_dest_delta __pyx_mstate_global->__pyx_n_s_dest_delta #define __pyx_n_s_dest_pixel __pyx_mstate_global->__pyx_n_s_dest_pixel #define __pyx_n_s_e __pyx_mstate_global->__pyx_n_s_e #define __pyx_n_s_e0 __pyx_mstate_global->__pyx_n_s_e0 #define __pyx_n_s_e1 __pyx_mstate_global->__pyx_n_s_e1 #define __pyx_n_s_e2 __pyx_mstate_global->__pyx_n_s_e2 #define __pyx_n_s_e3 __pyx_mstate_global->__pyx_n_s_e3 #define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_f __pyx_mstate_global->__pyx_n_s_f #define __pyx_n_s_flip __pyx_mstate_global->__pyx_n_s_flip #define __pyx_n_s_g __pyx_mstate_global->__pyx_n_s_g #define __pyx_n_s_get_bytesize __pyx_mstate_global->__pyx_n_s_get_bytesize #define __pyx_n_s_get_flags __pyx_mstate_global->__pyx_n_s_get_flags #define __pyx_n_s_get_height __pyx_mstate_global->__pyx_n_s_get_height #define __pyx_n_s_get_size __pyx_mstate_global->__pyx_n_s_get_size #define __pyx_n_s_get_width __pyx_mstate_global->__pyx_n_s_get_width #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_height __pyx_mstate_global->__pyx_n_s_height #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_lock __pyx_mstate_global->__pyx_n_s_lock #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_transform __pyx_mstate_global->__pyx_n_s_pygame_sdl2_transform #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_n_s_rotate __pyx_mstate_global->__pyx_n_s_rotate #define __pyx_n_s_rotozoom __pyx_mstate_global->__pyx_n_s_rotozoom #define __pyx_n_s_rsurf __pyx_mstate_global->__pyx_n_s_rsurf #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_scale __pyx_mstate_global->__pyx_n_s_scale #define __pyx_n_s_scale2x __pyx_mstate_global->__pyx_n_s_scale2x #define __pyx_n_s_scale_x __pyx_mstate_global->__pyx_n_s_scale_x #define __pyx_n_s_scale_y __pyx_mstate_global->__pyx_n_s_scale_y #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_smooth __pyx_mstate_global->__pyx_n_s_smooth #define __pyx_n_s_smoothscale __pyx_mstate_global->__pyx_n_s_smoothscale #define __pyx_n_s_src __pyx_mstate_global->__pyx_n_s_src #define __pyx_n_s_src_end __pyx_mstate_global->__pyx_n_s_src_end #define __pyx_n_s_src_pixel __pyx_mstate_global->__pyx_n_s_src_pixel #define __pyx_kp_s_src_pygame_sdl2_transform_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_transform_pyx #define __pyx_n_s_surf_out __pyx_mstate_global->__pyx_n_s_surf_out #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_unlock __pyx_mstate_global->__pyx_n_s_unlock #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_xbool __pyx_mstate_global->__pyx_n_s_xbool #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_n_s_ybool __pyx_mstate_global->__pyx_n_s_ybool #define __pyx_float_1_0 __pyx_mstate_global->__pyx_float_1_0 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 /* #### Code section: module_code ### */ /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_1flip(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_9transform_flip, "flip(Surface surface, bool xbool, bool ybool)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_1flip = {"flip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_9transform_1flip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_9transform_flip}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_1flip(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; int __pyx_v_xbool; int __pyx_v_ybool; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_xbool,&__pyx_n_s_ybool,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xbool)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, 1); __PYX_ERR(0, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ybool)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, 2); __PYX_ERR(0, 26, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "flip") < 0)) __PYX_ERR(0, 26, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_xbool = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_xbool == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) __pyx_v_ybool = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_ybool == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 26, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.transform.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 26, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_9transform_flip(__pyx_self, __pyx_v_surface, __pyx_v_xbool, __pyx_v_ybool); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_flip(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, int __pyx_v_xbool, int __pyx_v_ybool) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; SDL_Surface *__pyx_v_src; SDL_Surface *__pyx_v_dest; Uint32 *__pyx_v_src_pixel; Uint32 *__pyx_v_src_end; Uint32 *__pyx_v_dest_pixel; int __pyx_v_dest_delta; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; SDL_Surface *__pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flip", 1); /* "pygame_sdl2/transform.pyx":28 * def flip(Surface surface, bint xbool, bint ybool): * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) # <<<<<<<<<<<<<< * cdef SDL_Surface *src = surface.surface * cdef SDL_Surface *dest = rv.surface */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_surface); __Pyx_GIVEREF((PyObject *)__pyx_v_surface); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_surface))) __PYX_ERR(0, 28, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":29 * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) * cdef SDL_Surface *src = surface.surface # <<<<<<<<<<<<<< * cdef SDL_Surface *dest = rv.surface * */ __pyx_t_6 = __pyx_v_surface->surface; __pyx_v_src = __pyx_t_6; /* "pygame_sdl2/transform.pyx":30 * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) * cdef SDL_Surface *src = surface.surface * cdef SDL_Surface *dest = rv.surface # <<<<<<<<<<<<<< * * cdef Uint32 *src_pixel */ __pyx_t_6 = __pyx_v_rv->surface; __pyx_v_dest = __pyx_t_6; /* "pygame_sdl2/transform.pyx":40 * cdef int y * * with nogil: # <<<<<<<<<<<<<< * for 0 <= y < src.h: * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":41 * * with nogil: * for 0 <= y < src.h: # <<<<<<<<<<<<<< * * src_pixel = (( src.pixels) + y * src.pitch) */ __pyx_t_4 = __pyx_v_src->h; for (__pyx_v_y = 0; __pyx_v_y < __pyx_t_4; __pyx_v_y++) { /* "pygame_sdl2/transform.pyx":43 * for 0 <= y < src.h: * * src_pixel = (( src.pixels) + y * src.pitch) # <<<<<<<<<<<<<< * src_end = src_pixel + src.w * */ __pyx_v_src_pixel = ((Uint32 *)(((Uint8 *)__pyx_v_src->pixels) + (__pyx_v_y * __pyx_v_src->pitch))); /* "pygame_sdl2/transform.pyx":44 * * src_pixel = (( src.pixels) + y * src.pitch) * src_end = src_pixel + src.w # <<<<<<<<<<<<<< * * if ybool: */ __pyx_v_src_end = (__pyx_v_src_pixel + __pyx_v_src->w); /* "pygame_sdl2/transform.pyx":46 * src_end = src_pixel + src.w * * if ybool: # <<<<<<<<<<<<<< * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) * else: */ if (__pyx_v_ybool) { /* "pygame_sdl2/transform.pyx":47 * * if ybool: * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) # <<<<<<<<<<<<<< * else: * dest_pixel = (( dest.pixels) + y * dest.pitch) */ __pyx_v_dest_pixel = ((Uint32 *)(((Uint8 *)__pyx_v_dest->pixels) + (((__pyx_v_dest->h - __pyx_v_y) - 1) * __pyx_v_dest->pitch))); /* "pygame_sdl2/transform.pyx":46 * src_end = src_pixel + src.w * * if ybool: # <<<<<<<<<<<<<< * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) * else: */ goto __pyx_L8; } /* "pygame_sdl2/transform.pyx":49 * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) * else: * dest_pixel = (( dest.pixels) + y * dest.pitch) # <<<<<<<<<<<<<< * * if xbool: */ /*else*/ { __pyx_v_dest_pixel = ((Uint32 *)(((Uint8 *)__pyx_v_dest->pixels) + (__pyx_v_y * __pyx_v_dest->pitch))); } __pyx_L8:; /* "pygame_sdl2/transform.pyx":51 * dest_pixel = (( dest.pixels) + y * dest.pitch) * * if xbool: # <<<<<<<<<<<<<< * dest_pixel += (src.w - 1) * dest_delta = -1 */ if (__pyx_v_xbool) { /* "pygame_sdl2/transform.pyx":52 * * if xbool: * dest_pixel += (src.w - 1) # <<<<<<<<<<<<<< * dest_delta = -1 * else: */ __pyx_v_dest_pixel = (__pyx_v_dest_pixel + (__pyx_v_src->w - 1)); /* "pygame_sdl2/transform.pyx":53 * if xbool: * dest_pixel += (src.w - 1) * dest_delta = -1 # <<<<<<<<<<<<<< * else: * dest_delta = 1 */ __pyx_v_dest_delta = -1; /* "pygame_sdl2/transform.pyx":51 * dest_pixel = (( dest.pixels) + y * dest.pitch) * * if xbool: # <<<<<<<<<<<<<< * dest_pixel += (src.w - 1) * dest_delta = -1 */ goto __pyx_L9; } /* "pygame_sdl2/transform.pyx":55 * dest_delta = -1 * else: * dest_delta = 1 # <<<<<<<<<<<<<< * * while src_pixel < src_end: */ /*else*/ { __pyx_v_dest_delta = 1; } __pyx_L9:; /* "pygame_sdl2/transform.pyx":57 * dest_delta = 1 * * while src_pixel < src_end: # <<<<<<<<<<<<<< * dest_pixel[0] = src_pixel[0] * src_pixel += 1 */ while (1) { __pyx_t_7 = (__pyx_v_src_pixel < __pyx_v_src_end); if (!__pyx_t_7) break; /* "pygame_sdl2/transform.pyx":58 * * while src_pixel < src_end: * dest_pixel[0] = src_pixel[0] # <<<<<<<<<<<<<< * src_pixel += 1 * dest_pixel += dest_delta */ (__pyx_v_dest_pixel[0]) = (__pyx_v_src_pixel[0]); /* "pygame_sdl2/transform.pyx":59 * while src_pixel < src_end: * dest_pixel[0] = src_pixel[0] * src_pixel += 1 # <<<<<<<<<<<<<< * dest_pixel += dest_delta * */ __pyx_v_src_pixel = (__pyx_v_src_pixel + 1); /* "pygame_sdl2/transform.pyx":60 * dest_pixel[0] = src_pixel[0] * src_pixel += 1 * dest_pixel += dest_delta # <<<<<<<<<<<<<< * * return rv */ __pyx_v_dest_pixel = (__pyx_v_dest_pixel + __pyx_v_dest_delta); } } } /* "pygame_sdl2/transform.pyx":40 * cdef int y * * with nogil: # <<<<<<<<<<<<<< * for 0 <= y < src.h: * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/transform.pyx":62 * dest_pixel += dest_delta * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.transform.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_3scale(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_9transform_2scale, "scale(Surface surface, size, Surface DestSurface=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_3scale = {"scale", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_9transform_3scale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_9transform_2scale}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_3scale(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_size = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scale (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_size,&__pyx_n_s_DestSurface,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("scale", 0, 2, 3, 1); __PYX_ERR(0, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_DestSurface); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scale") < 0)) __PYX_ERR(0, 65, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_size = values[1]; __pyx_v_DestSurface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scale", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 65, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.transform.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 65, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_DestSurface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "DestSurface", 0))) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_9transform_2scale(__pyx_self, __pyx_v_surface, __pyx_v_size, __pyx_v_DestSurface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_2scale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf_out = 0; int __pyx_v_err; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scale", 1); /* "pygame_sdl2/transform.pyx":67 * def scale(Surface surface, size, Surface DestSurface=None): * cdef Surface surf_out * cdef int err = -1 # <<<<<<<<<<<<<< * * if DestSurface == None: */ __pyx_v_err = -1; /* "pygame_sdl2/transform.pyx":69 * cdef int err = -1 * * if DestSurface == None: # <<<<<<<<<<<<<< * surf_out = Surface(size, 0, surface) * else: */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_DestSurface), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/transform.pyx":70 * * if DestSurface == None: * surf_out = Surface(size, 0, surface) # <<<<<<<<<<<<<< * else: * surf_out = DestSurface */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size)) __PYX_ERR(0, 70, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 70, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_surface); __Pyx_GIVEREF((PyObject *)__pyx_v_surface); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_surface))) __PYX_ERR(0, 70, __pyx_L1_error); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_surf_out = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":69 * cdef int err = -1 * * if DestSurface == None: # <<<<<<<<<<<<<< * surf_out = Surface(size, 0, surface) * else: */ goto __pyx_L3; } /* "pygame_sdl2/transform.pyx":72 * surf_out = Surface(size, 0, surface) * else: * surf_out = DestSurface # <<<<<<<<<<<<<< * * with nogil: */ /*else*/ { __Pyx_INCREF((PyObject *)__pyx_v_DestSurface); __pyx_v_surf_out = __pyx_v_DestSurface; } __pyx_L3:; /* "pygame_sdl2/transform.pyx":74 * surf_out = DestSurface * * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":75 * * with nogil: * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) # <<<<<<<<<<<<<< * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) * */ (void)(SDL_SetSurfaceBlendMode(__pyx_v_surface->surface, SDL_BLENDMODE_NONE)); /* "pygame_sdl2/transform.pyx":76 * with nogil: * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) # <<<<<<<<<<<<<< * * if err != 0: */ __pyx_v_err = SDL_UpperBlitScaled(__pyx_v_surface->surface, NULL, __pyx_v_surf_out->surface, NULL); } /* "pygame_sdl2/transform.pyx":74 * surf_out = DestSurface * * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/transform.pyx":78 * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_err != 0); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/transform.pyx":79 * * if err != 0: * raise error() # <<<<<<<<<<<<<< * * return surf_out */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 79, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":78 * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/transform.pyx":81 * raise error() * * return surf_out # <<<<<<<<<<<<<< * * def rotate(Surface surface, angle): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_surf_out); __pyx_r = ((PyObject *)__pyx_v_surf_out); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.transform.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_5rotate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_9transform_4rotate, "rotate(Surface surface, angle)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_5rotate = {"rotate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_9transform_5rotate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_9transform_4rotate}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_5rotate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_angle = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rotate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_angle,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_angle)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rotate", 1, 2, 2, 1); __PYX_ERR(0, 83, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rotate") < 0)) __PYX_ERR(0, 83, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_angle = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rotate", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 83, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.transform.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 83, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_9transform_4rotate(__pyx_self, __pyx_v_surface, __pyx_v_angle); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_4rotate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_angle) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rotate", 1); /* "pygame_sdl2/transform.pyx":90 * # if rsurf == NULL: * # raise error() * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) # <<<<<<<<<<<<<< * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_rotozoom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SMOOTHING_OFF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, ((PyObject *)__pyx_v_surface), __pyx_v_angle, __pyx_float_1_0, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.transform.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_7rotozoom(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_9transform_6rotozoom, "rotozoom(Surface surface, double angle, double scale, int smooth=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_7rotozoom = {"rotozoom", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_9transform_7rotozoom, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_9transform_6rotozoom}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_7rotozoom(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; double __pyx_v_angle; double __pyx_v_scale; int __pyx_v_smooth; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rotozoom (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_angle,&__pyx_n_s_scale,&__pyx_n_s_smooth,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_angle)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, 1); __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scale)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, 2); __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_smooth); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rotozoom") < 0)) __PYX_ERR(0, 92, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_angle = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_angle == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) __pyx_v_scale = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_scale == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) if (values[3]) { __pyx_v_smooth = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_smooth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) } else { __pyx_v_smooth = ((int)((int)1)); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 92, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.transform.rotozoom", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 92, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_9transform_6rotozoom(__pyx_self, __pyx_v_surface, __pyx_v_angle, __pyx_v_scale, __pyx_v_smooth); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_6rotozoom(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, double __pyx_v_angle, double __pyx_v_scale, int __pyx_v_smooth) { SDL_Surface *__pyx_v_rsurf; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rotozoom", 1); /* "pygame_sdl2/transform.pyx":93 * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): * cdef SDL_Surface *rsurf = NULL # <<<<<<<<<<<<<< * cdef Surface rv * */ __pyx_v_rsurf = NULL; /* "pygame_sdl2/transform.pyx":96 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":97 * * with nogil: * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) # <<<<<<<<<<<<<< * * if rsurf == NULL: */ __pyx_v_rsurf = rotozoomSurface(__pyx_v_surface->surface, __pyx_v_angle, __pyx_v_scale, __pyx_v_smooth); } /* "pygame_sdl2/transform.pyx":96 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/transform.pyx":99 * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_rsurf == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/transform.pyx":100 * * if rsurf == NULL: * raise error() # <<<<<<<<<<<<<< * * rv = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 100, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":99 * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/transform.pyx":102 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":103 * * rv = Surface(()) * rv.take_surface(rsurf) # <<<<<<<<<<<<<< * * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_rsurf); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":105 * rv.take_surface(rsurf) * * return rv # <<<<<<<<<<<<<< * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) noexcept nogil: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.transform.rotozoom", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":107 * return rv * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) noexcept nogil: # <<<<<<<<<<<<<< * if x < 0: * x = 0 */ static uint32_t __pyx_f_11pygame_sdl2_9transform_get_at(SDL_Surface *__pyx_v_surf, int __pyx_v_x, int __pyx_v_y) { uint32_t *__pyx_v_p; uint32_t __pyx_r; int __pyx_t_1; size_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "pygame_sdl2/transform.pyx":108 * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) noexcept nogil: * if x < 0: # <<<<<<<<<<<<<< * x = 0 * elif x >= surf.w: */ __pyx_t_1 = (__pyx_v_x < 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":109 * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) noexcept nogil: * if x < 0: * x = 0 # <<<<<<<<<<<<<< * elif x >= surf.w: * x = surf.w - 1 */ __pyx_v_x = 0; /* "pygame_sdl2/transform.pyx":108 * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) noexcept nogil: * if x < 0: # <<<<<<<<<<<<<< * x = 0 * elif x >= surf.w: */ goto __pyx_L3; } /* "pygame_sdl2/transform.pyx":110 * if x < 0: * x = 0 * elif x >= surf.w: # <<<<<<<<<<<<<< * x = surf.w - 1 * if y < 0: */ __pyx_t_1 = (__pyx_v_x >= __pyx_v_surf->w); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":111 * x = 0 * elif x >= surf.w: * x = surf.w - 1 # <<<<<<<<<<<<<< * if y < 0: * y = 0 */ __pyx_v_x = (__pyx_v_surf->w - 1); /* "pygame_sdl2/transform.pyx":110 * if x < 0: * x = 0 * elif x >= surf.w: # <<<<<<<<<<<<<< * x = surf.w - 1 * if y < 0: */ } __pyx_L3:; /* "pygame_sdl2/transform.pyx":112 * elif x >= surf.w: * x = surf.w - 1 * if y < 0: # <<<<<<<<<<<<<< * y = 0 * elif y >= surf.h: */ __pyx_t_1 = (__pyx_v_y < 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":113 * x = surf.w - 1 * if y < 0: * y = 0 # <<<<<<<<<<<<<< * elif y >= surf.h: * y = surf.h - 1 */ __pyx_v_y = 0; /* "pygame_sdl2/transform.pyx":112 * elif x >= surf.w: * x = surf.w - 1 * if y < 0: # <<<<<<<<<<<<<< * y = 0 * elif y >= surf.h: */ goto __pyx_L4; } /* "pygame_sdl2/transform.pyx":114 * if y < 0: * y = 0 * elif y >= surf.h: # <<<<<<<<<<<<<< * y = surf.h - 1 * */ __pyx_t_1 = (__pyx_v_y >= __pyx_v_surf->h); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":115 * y = 0 * elif y >= surf.h: * y = surf.h - 1 # <<<<<<<<<<<<<< * * cdef uint32_t *p = surf.pixels */ __pyx_v_y = (__pyx_v_surf->h - 1); /* "pygame_sdl2/transform.pyx":114 * if y < 0: * y = 0 * elif y >= surf.h: # <<<<<<<<<<<<<< * y = surf.h - 1 * */ } __pyx_L4:; /* "pygame_sdl2/transform.pyx":117 * y = surf.h - 1 * * cdef uint32_t *p = surf.pixels # <<<<<<<<<<<<<< * p += y * (surf.pitch // sizeof(uint32_t)) * p += x */ __pyx_v_p = ((uint32_t *)__pyx_v_surf->pixels); /* "pygame_sdl2/transform.pyx":118 * * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) # <<<<<<<<<<<<<< * p += x * return p[0] */ __pyx_t_2 = (sizeof(uint32_t)); if (unlikely(__pyx_t_2 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 118, __pyx_L1_error) } __pyx_v_p = (__pyx_v_p + (__pyx_v_y * (__pyx_v_surf->pitch / __pyx_t_2))); /* "pygame_sdl2/transform.pyx":119 * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) * p += x # <<<<<<<<<<<<<< * return p[0] * */ __pyx_v_p = (__pyx_v_p + __pyx_v_x); /* "pygame_sdl2/transform.pyx":120 * p += y * (surf.pitch // sizeof(uint32_t)) * p += x * return p[0] # <<<<<<<<<<<<<< * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) noexcept nogil: */ __pyx_r = (__pyx_v_p[0]); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":107 * return rv * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) noexcept nogil: # <<<<<<<<<<<<<< * if x < 0: * x = 0 */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_WriteUnraisable("pygame_sdl2.transform.get_at", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/transform.pyx":122 * return p[0] * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) noexcept nogil: # <<<<<<<<<<<<<< * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) */ static void __pyx_f_11pygame_sdl2_9transform_set_at(SDL_Surface *__pyx_v_surf, int __pyx_v_x, int __pyx_v_y, uint32_t __pyx_v_color) { uint32_t *__pyx_v_p; size_t __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "pygame_sdl2/transform.pyx":123 * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) noexcept nogil: * cdef uint32_t *p = surf.pixels # <<<<<<<<<<<<<< * p += y * (surf.pitch // sizeof(uint32_t)) * p += x */ __pyx_v_p = ((uint32_t *)__pyx_v_surf->pixels); /* "pygame_sdl2/transform.pyx":124 * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) noexcept nogil: * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) # <<<<<<<<<<<<<< * p += x * p[0] = color */ __pyx_t_1 = (sizeof(uint32_t)); if (unlikely(__pyx_t_1 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 124, __pyx_L1_error) } __pyx_v_p = (__pyx_v_p + (__pyx_v_y * (__pyx_v_surf->pitch / __pyx_t_1))); /* "pygame_sdl2/transform.pyx":125 * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) * p += x # <<<<<<<<<<<<<< * p[0] = color * */ __pyx_v_p = (__pyx_v_p + __pyx_v_x); /* "pygame_sdl2/transform.pyx":126 * p += y * (surf.pitch // sizeof(uint32_t)) * p += x * p[0] = color # <<<<<<<<<<<<<< * * def scale2x(Surface surface, Surface DestSurface=None): */ (__pyx_v_p[0]) = __pyx_v_color; /* "pygame_sdl2/transform.pyx":122 * return p[0] * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) noexcept nogil: # <<<<<<<<<<<<<< * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_WriteUnraisable("pygame_sdl2.transform.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; } /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_9scale2x(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_9transform_8scale2x, "scale2x(Surface surface, Surface DestSurface=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_9scale2x = {"scale2x", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_9transform_9scale2x, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_9transform_8scale2x}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_9scale2x(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scale2x (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_DestSurface,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_DestSurface); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scale2x") < 0)) __PYX_ERR(0, 128, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_DestSurface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scale2x", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 128, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.transform.scale2x", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 128, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_DestSurface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "DestSurface", 0))) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_9transform_8scale2x(__pyx_self, __pyx_v_surface, __pyx_v_DestSurface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_8scale2x(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface) { int __pyx_v_x; int __pyx_v_y; CYTHON_UNUSED uint32_t __pyx_v_a; uint32_t __pyx_v_b; CYTHON_UNUSED uint32_t __pyx_v_c; uint32_t __pyx_v_d; uint32_t __pyx_v_e; uint32_t __pyx_v_f; CYTHON_UNUSED uint32_t __pyx_v_g; uint32_t __pyx_v_h; CYTHON_UNUSED uint32_t __pyx_v_i; uint32_t __pyx_v_e0; uint32_t __pyx_v_e1; uint32_t __pyx_v_e2; uint32_t __pyx_v_e3; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf_out = 0; int __pyx_v_width; int __pyx_v_height; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; uint32_t __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scale2x", 1); /* "pygame_sdl2/transform.pyx":134 * cdef uint32_t e0, e1, e2, e3 * * if surface.get_bytesize() != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_bytesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_t_1, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/transform.pyx":135 * * if surface.get_bytesize() != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * cdef Surface surf_out = DestSurface */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Surface_has_unsupported_bytesize}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 135, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":134 * cdef uint32_t e0, e1, e2, e3 * * if surface.get_bytesize() != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/transform.pyx":137 * raise error("Surface has unsupported bytesize.") * * cdef Surface surf_out = DestSurface # <<<<<<<<<<<<<< * if surf_out == None: * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) */ __Pyx_INCREF((PyObject *)__pyx_v_DestSurface); __pyx_v_surf_out = __pyx_v_DestSurface; /* "pygame_sdl2/transform.pyx":138 * * cdef Surface surf_out = DestSurface * if surf_out == None: # <<<<<<<<<<<<<< * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) * */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_surf_out), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/transform.pyx":139 * cdef Surface surf_out = DestSurface * if surf_out == None: * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) # <<<<<<<<<<<<<< * * surface.lock() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(0, 139, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_surface); __Pyx_GIVEREF((PyObject *)__pyx_v_surface); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_surface))) __PYX_ERR(0, 139, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_surf_out, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1)); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":138 * * cdef Surface surf_out = DestSurface * if surf_out == None: # <<<<<<<<<<<<<< * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) * */ } /* "pygame_sdl2/transform.pyx":141 * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) * * surface.lock() # <<<<<<<<<<<<<< * surf_out.lock() * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":142 * * surface.lock() * surf_out.lock() # <<<<<<<<<<<<<< * * cdef int width, height */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf_out), __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":145 * * cdef int width, height * width, height = surface.get_size() # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 145, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 145, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 145, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_width = __pyx_t_4; __pyx_v_height = __pyx_t_8; /* "pygame_sdl2/transform.pyx":147 * width, height = surface.get_size() * * with nogil: # <<<<<<<<<<<<<< * for x in range(width): * for y in range(height): */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":148 * * with nogil: * for x in range(width): # <<<<<<<<<<<<<< * for y in range(height): * # Get the surrounding 9 pixels. */ __pyx_t_8 = __pyx_v_width; __pyx_t_4 = __pyx_t_8; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_4; __pyx_t_9+=1) { __pyx_v_x = __pyx_t_9; /* "pygame_sdl2/transform.pyx":149 * with nogil: * for x in range(width): * for y in range(height): # <<<<<<<<<<<<<< * # Get the surrounding 9 pixels. * a = get_at(surface.surface, x - 1, y - 1) */ __pyx_t_10 = __pyx_v_height; __pyx_t_11 = __pyx_t_10; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_y = __pyx_t_12; /* "pygame_sdl2/transform.pyx":151 * for y in range(height): * # Get the surrounding 9 pixels. * a = get_at(surface.surface, x - 1, y - 1) # <<<<<<<<<<<<<< * b = get_at(surface.surface, x, y - 1) * c = get_at(surface.surface, x + 1, y - 1) */ __pyx_v_a = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x - 1), (__pyx_v_y - 1)); /* "pygame_sdl2/transform.pyx":152 * # Get the surrounding 9 pixels. * a = get_at(surface.surface, x - 1, y - 1) * b = get_at(surface.surface, x, y - 1) # <<<<<<<<<<<<<< * c = get_at(surface.surface, x + 1, y - 1) * */ __pyx_v_b = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, __pyx_v_x, (__pyx_v_y - 1)); /* "pygame_sdl2/transform.pyx":153 * a = get_at(surface.surface, x - 1, y - 1) * b = get_at(surface.surface, x, y - 1) * c = get_at(surface.surface, x + 1, y - 1) # <<<<<<<<<<<<<< * * d = get_at(surface.surface, x - 1, y) */ __pyx_v_c = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x + 1), (__pyx_v_y - 1)); /* "pygame_sdl2/transform.pyx":155 * c = get_at(surface.surface, x + 1, y - 1) * * d = get_at(surface.surface, x - 1, y) # <<<<<<<<<<<<<< * e = get_at(surface.surface, x, y) * f = get_at(surface.surface, x + 1, y) */ __pyx_v_d = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x - 1), __pyx_v_y); /* "pygame_sdl2/transform.pyx":156 * * d = get_at(surface.surface, x - 1, y) * e = get_at(surface.surface, x, y) # <<<<<<<<<<<<<< * f = get_at(surface.surface, x + 1, y) * */ __pyx_v_e = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, __pyx_v_x, __pyx_v_y); /* "pygame_sdl2/transform.pyx":157 * d = get_at(surface.surface, x - 1, y) * e = get_at(surface.surface, x, y) * f = get_at(surface.surface, x + 1, y) # <<<<<<<<<<<<<< * * g = get_at(surface.surface, x - 1, y + 1) */ __pyx_v_f = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x + 1), __pyx_v_y); /* "pygame_sdl2/transform.pyx":159 * f = get_at(surface.surface, x + 1, y) * * g = get_at(surface.surface, x - 1, y + 1) # <<<<<<<<<<<<<< * h = get_at(surface.surface, x, y + 1) * i = get_at(surface.surface, x + 1, y + 1) */ __pyx_v_g = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x - 1), (__pyx_v_y + 1)); /* "pygame_sdl2/transform.pyx":160 * * g = get_at(surface.surface, x - 1, y + 1) * h = get_at(surface.surface, x, y + 1) # <<<<<<<<<<<<<< * i = get_at(surface.surface, x + 1, y + 1) * */ __pyx_v_h = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, __pyx_v_x, (__pyx_v_y + 1)); /* "pygame_sdl2/transform.pyx":161 * g = get_at(surface.surface, x - 1, y + 1) * h = get_at(surface.surface, x, y + 1) * i = get_at(surface.surface, x + 1, y + 1) # <<<<<<<<<<<<<< * * # Expand the center pixel. */ __pyx_v_i = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x + 1), (__pyx_v_y + 1)); /* "pygame_sdl2/transform.pyx":164 * * # Expand the center pixel. * if b != h and d != f: # <<<<<<<<<<<<<< * e0 = d if d == b else e * e1 = f if b == f else e */ __pyx_t_13 = (__pyx_v_b != __pyx_v_h); if (__pyx_t_13) { } else { __pyx_t_5 = __pyx_t_13; goto __pyx_L15_bool_binop_done; } __pyx_t_13 = (__pyx_v_d != __pyx_v_f); __pyx_t_5 = __pyx_t_13; __pyx_L15_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/transform.pyx":165 * # Expand the center pixel. * if b != h and d != f: * e0 = d if d == b else e # <<<<<<<<<<<<<< * e1 = f if b == f else e * e2 = d if d == h else e */ __pyx_t_5 = (__pyx_v_d == __pyx_v_b); if (__pyx_t_5) { __pyx_t_14 = __pyx_v_d; } else { __pyx_t_14 = __pyx_v_e; } __pyx_v_e0 = __pyx_t_14; /* "pygame_sdl2/transform.pyx":166 * if b != h and d != f: * e0 = d if d == b else e * e1 = f if b == f else e # <<<<<<<<<<<<<< * e2 = d if d == h else e * e3 = f if h == f else e */ __pyx_t_5 = (__pyx_v_b == __pyx_v_f); if (__pyx_t_5) { __pyx_t_14 = __pyx_v_f; } else { __pyx_t_14 = __pyx_v_e; } __pyx_v_e1 = __pyx_t_14; /* "pygame_sdl2/transform.pyx":167 * e0 = d if d == b else e * e1 = f if b == f else e * e2 = d if d == h else e # <<<<<<<<<<<<<< * e3 = f if h == f else e * else: */ __pyx_t_5 = (__pyx_v_d == __pyx_v_h); if (__pyx_t_5) { __pyx_t_14 = __pyx_v_d; } else { __pyx_t_14 = __pyx_v_e; } __pyx_v_e2 = __pyx_t_14; /* "pygame_sdl2/transform.pyx":168 * e1 = f if b == f else e * e2 = d if d == h else e * e3 = f if h == f else e # <<<<<<<<<<<<<< * else: * e0 = e1 = e2 = e3 = e */ __pyx_t_5 = (__pyx_v_h == __pyx_v_f); if (__pyx_t_5) { __pyx_t_14 = __pyx_v_f; } else { __pyx_t_14 = __pyx_v_e; } __pyx_v_e3 = __pyx_t_14; /* "pygame_sdl2/transform.pyx":164 * * # Expand the center pixel. * if b != h and d != f: # <<<<<<<<<<<<<< * e0 = d if d == b else e * e1 = f if b == f else e */ goto __pyx_L14; } /* "pygame_sdl2/transform.pyx":170 * e3 = f if h == f else e * else: * e0 = e1 = e2 = e3 = e # <<<<<<<<<<<<<< * * set_at(surf_out.surface, x*2, y*2, e0) */ /*else*/ { __pyx_v_e0 = __pyx_v_e; __pyx_v_e1 = __pyx_v_e; __pyx_v_e2 = __pyx_v_e; __pyx_v_e3 = __pyx_v_e; } __pyx_L14:; /* "pygame_sdl2/transform.pyx":172 * e0 = e1 = e2 = e3 = e * * set_at(surf_out.surface, x*2, y*2, e0) # <<<<<<<<<<<<<< * set_at(surf_out.surface, (x*2)+1, y*2, e1) * set_at(surf_out.surface, x*2, (y*2)+1, e2) */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, (__pyx_v_x * 2), (__pyx_v_y * 2), __pyx_v_e0); /* "pygame_sdl2/transform.pyx":173 * * set_at(surf_out.surface, x*2, y*2, e0) * set_at(surf_out.surface, (x*2)+1, y*2, e1) # <<<<<<<<<<<<<< * set_at(surf_out.surface, x*2, (y*2)+1, e2) * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, ((__pyx_v_x * 2) + 1), (__pyx_v_y * 2), __pyx_v_e1); /* "pygame_sdl2/transform.pyx":174 * set_at(surf_out.surface, x*2, y*2, e0) * set_at(surf_out.surface, (x*2)+1, y*2, e1) * set_at(surf_out.surface, x*2, (y*2)+1, e2) # <<<<<<<<<<<<<< * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) * */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, (__pyx_v_x * 2), ((__pyx_v_y * 2) + 1), __pyx_v_e2); /* "pygame_sdl2/transform.pyx":175 * set_at(surf_out.surface, (x*2)+1, y*2, e1) * set_at(surf_out.surface, x*2, (y*2)+1, e2) * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) # <<<<<<<<<<<<<< * * surf_out.unlock() */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, ((__pyx_v_x * 2) + 1), ((__pyx_v_y * 2) + 1), __pyx_v_e3); } } } /* "pygame_sdl2/transform.pyx":147 * width, height = surface.get_size() * * with nogil: # <<<<<<<<<<<<<< * for x in range(width): * for y in range(height): */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } /* "pygame_sdl2/transform.pyx":177 * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) * * surf_out.unlock() # <<<<<<<<<<<<<< * surface.unlock() * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf_out), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":178 * * surf_out.unlock() * surface.unlock() # <<<<<<<<<<<<<< * * return surf_out */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":180 * surface.unlock() * * return surf_out # <<<<<<<<<<<<<< * * def smoothscale(Surface surface, size, Surface DestSurface=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_surf_out); __pyx_r = ((PyObject *)__pyx_v_surf_out); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.transform.scale2x", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_11smoothscale(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_9transform_10smoothscale, "smoothscale(Surface surface, size, Surface DestSurface=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_11smoothscale = {"smoothscale", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_9transform_11smoothscale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_9transform_10smoothscale}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_11smoothscale(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_size = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("smoothscale (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_size,&__pyx_n_s_DestSurface,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("smoothscale", 0, 2, 3, 1); __PYX_ERR(0, 182, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_DestSurface); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "smoothscale") < 0)) __PYX_ERR(0, 182, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_size = values[1]; __pyx_v_DestSurface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("smoothscale", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 182, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.transform.smoothscale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 182, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_DestSurface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "DestSurface", 0))) __PYX_ERR(0, 182, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_9transform_10smoothscale(__pyx_self, __pyx_v_surface, __pyx_v_size, __pyx_v_DestSurface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_10smoothscale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface) { double __pyx_v_scale_x; double __pyx_v_scale_y; SDL_Surface *__pyx_v_rsurf; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; double __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("smoothscale", 1); /* "pygame_sdl2/transform.pyx":183 * * def smoothscale(Surface surface, size, Surface DestSurface=None): * cdef double scale_x = size[0] / surface.surface.w # <<<<<<<<<<<<<< * cdef double scale_y = size[1] / surface.surface.h * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_v_surface->surface->w)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_scale_x = __pyx_t_4; /* "pygame_sdl2/transform.pyx":184 * def smoothscale(Surface surface, size, Surface DestSurface=None): * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h # <<<<<<<<<<<<<< * * cdef SDL_Surface *rsurf = NULL */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_v_surface->surface->h)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_scale_y = __pyx_t_4; /* "pygame_sdl2/transform.pyx":186 * cdef double scale_y = size[1] / surface.surface.h * * cdef SDL_Surface *rsurf = NULL # <<<<<<<<<<<<<< * cdef Surface rv * */ __pyx_v_rsurf = NULL; /* "pygame_sdl2/transform.pyx":189 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":190 * * with nogil: * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) # <<<<<<<<<<<<<< * * if rsurf == NULL: */ __pyx_v_rsurf = rotozoomSurfaceXY(__pyx_v_surface->surface, 0.0, __pyx_v_scale_x, __pyx_v_scale_y, SMOOTHING_ON); } /* "pygame_sdl2/transform.pyx":189 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/transform.pyx":192 * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = (__pyx_v_rsurf == NULL); if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/transform.pyx":193 * * if rsurf == NULL: * raise error() # <<<<<<<<<<<<<< * * rv = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 193, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":192 * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/transform.pyx":195 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":196 * * rv = Surface(()) * rv.take_surface(rsurf) # <<<<<<<<<<<<<< * * # This is inefficient. */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_rsurf); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":199 * * # This is inefficient. * if DestSurface: # <<<<<<<<<<<<<< * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) */ __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_DestSurface)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 199, __pyx_L1_error) if (__pyx_t_5) { /* "pygame_sdl2/transform.pyx":200 * # This is inefficient. * if DestSurface: * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":201 * if DestSurface: * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) # <<<<<<<<<<<<<< * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) * */ (void)(SDL_SetSurfaceBlendMode(__pyx_v_rv->surface, SDL_BLENDMODE_NONE)); /* "pygame_sdl2/transform.pyx":202 * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) # <<<<<<<<<<<<<< * * return rv */ (void)(SDL_UpperBlit(__pyx_v_rv->surface, NULL, __pyx_v_DestSurface->surface, NULL)); } /* "pygame_sdl2/transform.pyx":200 * # This is inefficient. * if DestSurface: * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/transform.pyx":199 * * # This is inefficient. * if DestSurface: # <<<<<<<<<<<<<< * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) */ } /* "pygame_sdl2/transform.pyx":204 * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) * * return rv # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.transform.smoothscale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_DestSurface, __pyx_k_DestSurface, sizeof(__pyx_k_DestSurface), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_has_unsupported_bytesize, __pyx_k_Surface_has_unsupported_bytesize, sizeof(__pyx_k_Surface_has_unsupported_bytesize), 0, 0, 1, 0}, {&__pyx_n_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 1}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_angle, __pyx_k_angle, sizeof(__pyx_k_angle), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_dest_delta, __pyx_k_dest_delta, sizeof(__pyx_k_dest_delta), 0, 0, 1, 1}, {&__pyx_n_s_dest_pixel, __pyx_k_dest_pixel, sizeof(__pyx_k_dest_pixel), 0, 0, 1, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_e0, __pyx_k_e0, sizeof(__pyx_k_e0), 0, 0, 1, 1}, {&__pyx_n_s_e1, __pyx_k_e1, sizeof(__pyx_k_e1), 0, 0, 1, 1}, {&__pyx_n_s_e2, __pyx_k_e2, sizeof(__pyx_k_e2), 0, 0, 1, 1}, {&__pyx_n_s_e3, __pyx_k_e3, sizeof(__pyx_k_e3), 0, 0, 1, 1}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, {&__pyx_n_s_flip, __pyx_k_flip, sizeof(__pyx_k_flip), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_get_bytesize, __pyx_k_get_bytesize, sizeof(__pyx_k_get_bytesize), 0, 0, 1, 1}, {&__pyx_n_s_get_flags, __pyx_k_get_flags, sizeof(__pyx_k_get_flags), 0, 0, 1, 1}, {&__pyx_n_s_get_height, __pyx_k_get_height, sizeof(__pyx_k_get_height), 0, 0, 1, 1}, {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1}, {&__pyx_n_s_get_width, __pyx_k_get_width, sizeof(__pyx_k_get_width), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_transform, __pyx_k_pygame_sdl2_transform, sizeof(__pyx_k_pygame_sdl2_transform), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rotate, __pyx_k_rotate, sizeof(__pyx_k_rotate), 0, 0, 1, 1}, {&__pyx_n_s_rotozoom, __pyx_k_rotozoom, sizeof(__pyx_k_rotozoom), 0, 0, 1, 1}, {&__pyx_n_s_rsurf, __pyx_k_rsurf, sizeof(__pyx_k_rsurf), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1}, {&__pyx_n_s_scale2x, __pyx_k_scale2x, sizeof(__pyx_k_scale2x), 0, 0, 1, 1}, {&__pyx_n_s_scale_x, __pyx_k_scale_x, sizeof(__pyx_k_scale_x), 0, 0, 1, 1}, {&__pyx_n_s_scale_y, __pyx_k_scale_y, sizeof(__pyx_k_scale_y), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_smooth, __pyx_k_smooth, sizeof(__pyx_k_smooth), 0, 0, 1, 1}, {&__pyx_n_s_smoothscale, __pyx_k_smoothscale, sizeof(__pyx_k_smoothscale), 0, 0, 1, 1}, {&__pyx_n_s_src, __pyx_k_src, sizeof(__pyx_k_src), 0, 0, 1, 1}, {&__pyx_n_s_src_end, __pyx_k_src_end, sizeof(__pyx_k_src_end), 0, 0, 1, 1}, {&__pyx_n_s_src_pixel, __pyx_k_src_pixel, sizeof(__pyx_k_src_pixel), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_k_src_pygame_sdl2_transform_pyx, sizeof(__pyx_k_src_pygame_sdl2_transform_pyx), 0, 0, 1, 0}, {&__pyx_n_s_surf_out, __pyx_k_surf_out, sizeof(__pyx_k_surf_out), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_unlock, __pyx_k_unlock, sizeof(__pyx_k_unlock), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_xbool, __pyx_k_xbool, sizeof(__pyx_k_xbool), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_ybool, __pyx_k_ybool, sizeof(__pyx_k_ybool), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 148, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/transform.pyx":102 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ __pyx_tuple__3 = PyTuple_Pack(11, __pyx_n_s_surface, __pyx_n_s_xbool, __pyx_n_s_ybool, __pyx_n_s_rv, __pyx_n_s_src, __pyx_n_s_dest, __pyx_n_s_src_pixel, __pyx_n_s_src_end, __pyx_n_s_dest_pixel, __pyx_n_s_dest_delta, __pyx_n_s_y); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_flip, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 26, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ __pyx_tuple__5 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_size, __pyx_n_s_DestSurface, __pyx_n_s_surf_out, __pyx_n_s_err); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_scale, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_tuple__7 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_surface, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_rotate, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 83, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_angle, __pyx_n_s_scale, __pyx_n_s_smooth, __pyx_n_s_rsurf, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_rotozoom, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 92, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ __pyx_tuple__12 = PyTuple_Pack(20, __pyx_n_s_surface, __pyx_n_s_DestSurface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_c, __pyx_n_s_d, __pyx_n_s_e, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_h, __pyx_n_s_i, __pyx_n_s_e0, __pyx_n_s_e1, __pyx_n_s_e2, __pyx_n_s_e3, __pyx_n_s_surf_out, __pyx_n_s_width, __pyx_n_s_height); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_scale2x, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 128, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ __pyx_tuple__14 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_size, __pyx_n_s_DestSurface, __pyx_n_s_scale_x, __pyx_n_s_scale_y, __pyx_n_s_rsurf, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_smoothscale, 182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_8(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(1, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_transform(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_transform}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "transform", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC inittransform(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC inittransform(void) #else __Pyx_PyMODINIT_FUNC PyInit_transform(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_transform(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_transform(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'transform' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("transform", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "transform" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_transform(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__transform) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.transform")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.transform", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/transform.pyx":23 * from sdl2_gfx cimport * * from pygame_sdl2.surface cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 23, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_9transform_1flip, 0, __pyx_n_s_flip, NULL, __pyx_n_s_pygame_sdl2_transform, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_9transform_3scale, 0, __pyx_n_s_scale, NULL, __pyx_n_s_pygame_sdl2_transform, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_scale, __pyx_t_3) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_9transform_5rotate, 0, __pyx_n_s_rotate, NULL, __pyx_n_s_pygame_sdl2_transform, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotate, __pyx_t_3) < 0) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ __pyx_t_3 = __Pyx_PyInt_From_int(((int)1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_9transform_7rotozoom, 0, __pyx_n_s_rotozoom, NULL, __pyx_n_s_pygame_sdl2_transform, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotozoom, __pyx_t_3) < 0) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_9transform_9scale2x, 0, __pyx_n_s_scale2x, NULL, __pyx_n_s_pygame_sdl2_transform, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_scale2x, __pyx_t_3) < 0) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_9transform_11smoothscale, 0, __pyx_n_s_smoothscale, NULL, __pyx_n_s_pygame_sdl2_transform, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_smoothscale, __pyx_t_3) < 0) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Tom Rothamel * # */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.transform", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.transform"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); else state = (PyGILState_STATE)0; #endif CYTHON_UNUSED_VAR(clineno); CYTHON_UNUSED_VAR(lineno); CYTHON_UNUSED_VAR(filename); CYTHON_MAYBE_UNUSED_VAR(nogil); __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 0; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a != b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) != 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 1; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 1; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal != 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a != (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_NE)); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); #ifdef HAVE_LONG_LONG if (sizeof(PY_LONG_LONG) > sizeof(long)) { PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; return (result >= LONG_MIN && result <= LONG_MAX) ? PyInt_FromLong((long)result) : PyLong_FromLongLong(result); } #endif #if CYTHON_USE_TYPE_SLOTS return PyInt_Type.tp_as_number->nb_multiply(op1, op2); #else return PyNumber_Multiply(op1, op2); #endif } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } } CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); #ifdef HAVE_LONG_LONG lla = a; goto long_long; #else return PyLong_Type.tp_as_number->nb_multiply(op1, op2); #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla * llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("multiply", return NULL) result = ((double)a) * (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #endif /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_8 #define __PYX_HAVE_RT_ImportType_3_0_8 static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__16); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000003100000000000010207 xustar0025 mtime=1753336711.1462 pygame_sdl2-2.1.0+renpy8.4.1/gen3/0000775000175000017500000000000015040345607014524 5ustar00tomtom././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635908.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.color.c0000664000175000017500000621172015026112604020215 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__color #define __PYX_HAVE_API__pygame_sdl2__color /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/color.pyx", "src/pygame_sdl2/color.pxd", "include/color_dict.pxi", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_5color_Color; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma { PyObject_HEAD PyObject *__pyx_v_gamma; }; /* "pygame_sdl2/color.pyx":63 * out.a = color.a * * cdef class Color: # <<<<<<<<<<<<<< * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): * self.r = r */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* PyObject_Str.proto */ #define __Pyx_PyObject_Str(obj)\ (likely(PyString_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) /* pybytes_as_double.proto */ static double __Pyx_SlowPyString_AsDouble(PyObject *obj); static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length); static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) { char* as_c_string; Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS as_c_string = PyBytes_AS_STRING(obj); size = PyBytes_GET_SIZE(obj); #else if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) { return (double)-1; } #endif return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); } static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) { char* as_c_string; Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS as_c_string = PyByteArray_AS_STRING(obj); size = PyByteArray_GET_SIZE(obj); #else as_c_string = PyByteArray_AsString(obj); if (as_c_string == NULL) { return (double)-1; } size = PyByteArray_Size(obj); #endif return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); } /* pyunicode_as_double.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) { int last_was_punctuation; Py_ssize_t i; last_was_punctuation = 1; for (i=start; i <= end; i++) { Py_UCS4 chr = PyUnicode_READ(kind, data, i); int is_punctuation = (chr == '_') | (chr == '.'); *buffer = (char)chr; buffer += (chr != '_'); if (unlikely(chr > 127)) goto parse_failure; if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure; last_was_punctuation = is_punctuation; } if (unlikely(last_was_punctuation)) goto parse_failure; *buffer = '\0'; return buffer; parse_failure: return NULL; } static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) { int matches = 1; Py_UCS4 chr; Py_UCS4 sign = PyUnicode_READ(kind, data, start); int is_signed = (sign == '-') | (sign == '+'); start += is_signed; length -= is_signed; switch (PyUnicode_READ(kind, data, start)) { #ifdef Py_NAN case 'n': case 'N': if (unlikely(length != 3)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+1); matches &= (chr == 'a') | (chr == 'A'); chr = PyUnicode_READ(kind, data, start+2); matches &= (chr == 'n') | (chr == 'N'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_NAN : Py_NAN; #endif case 'i': case 'I': if (unlikely(length < 3)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+1); matches &= (chr == 'n') | (chr == 'N'); chr = PyUnicode_READ(kind, data, start+2); matches &= (chr == 'f') | (chr == 'F'); if (likely(length == 3 && matches)) return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; if (unlikely(length != 8)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+3); matches &= (chr == 'i') | (chr == 'I'); chr = PyUnicode_READ(kind, data, start+4); matches &= (chr == 'n') | (chr == 'N'); chr = PyUnicode_READ(kind, data, start+5); matches &= (chr == 'i') | (chr == 'I'); chr = PyUnicode_READ(kind, data, start+6); matches &= (chr == 't') | (chr == 'T'); chr = PyUnicode_READ(kind, data, start+7); matches &= (chr == 'y') | (chr == 'Y'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: goto parse_failure; } return 0.0; parse_failure: return -1.0; } static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) { double value; const char *last; char *end; Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj); const int kind = PyUnicode_KIND(obj); const void* data = PyUnicode_DATA(obj); start = 0; while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start))) start++; while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1))) length--; length -= start; if (unlikely(length <= 0)) goto fallback; value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length); if (unlikely(value == -1.0)) goto fallback; if (value != 0.0) return value; if (length < 40) { char number[40]; last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); if (unlikely(!last)) goto fallback; value = PyOS_string_to_double(number, &end, NULL); } else { char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char)); if (unlikely(!number)) goto fallback; last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); if (unlikely(!last)) { PyMem_Free(number); goto fallback; } value = PyOS_string_to_double(number, &end, NULL); PyMem_Free(number); } if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { return value; } fallback: return __Pyx_SlowPyString_AsDouble(obj); } #endif static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) { #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS if (unlikely(__Pyx_PyUnicode_READY(obj) == -1)) return (double)-1; if (likely(PyUnicode_IS_ASCII(obj))) { const char *s; Py_ssize_t length; s = PyUnicode_AsUTF8AndSize(obj, &length); return __Pyx__PyBytes_AsDouble(obj, s, length); } return __Pyx_PyUnicode_AsDouble_WithSpaces(obj); #else return __Pyx_SlowPyString_AsDouble(obj); #endif } /* pynumber_float.proto */ static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj); #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x)) /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_SubtractCObj(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif /* ModFloat[double].proto */ static CYTHON_INLINE double __Pyx_mod_double(double, double); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyFloatBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_RemainderObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check); #else #define __Pyx_PyFloat_RemainderObjC(op1, op2, floatval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2)) #endif /* pow2.proto */ #define __Pyx_PyNumber_Power2(a, b) PyNumber_Power(a, b, Py_None) /* PyFloatBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check); #else #define __Pyx_PyFloat_TrueDivideObjC(op1, op2, floatval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) #endif /* RaiseClosureNameError.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_rgba(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, Uint8 __pyx_v_r, Uint8 __pyx_v_g, Uint8 __pyx_v_b, Uint8 __pyx_v_a); /* proto*/ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_hex(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c); /* proto*/ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_name(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c); /* proto*/ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.color" */ static PyObject *__pyx_v_11pygame_sdl2_5color_colors = 0; /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.color" extern int __pyx_module_is_main_pygame_sdl2__color; int __pyx_module_is_main_pygame_sdl2__color = 0; /* Implementation of "pygame_sdl2.color" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_map; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_hex; static PyObject *__pyx_builtin_oct; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_round; /* #### Code section: string_decls ### */ static const char __pyx_k_L[] = ">L"; static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k_c[] = "c"; static const char __pyx_k_d[] = "d"; static const char __pyx_k_g[] = "g"; static const char __pyx_k_l[] = "l"; static const char __pyx_k_m[] = "m"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_0x[] = "0x"; static const char __pyx_k__2[] = ""; static const char __pyx_k__3[] = "#"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_08x[] = "%08x"; static const char __pyx_k_BBB[] = "BBB"; static const char __pyx_k__10[] = "*"; static const char __pyx_k_div[] = "div"; static const char __pyx_k_hex[] = "hex"; static const char __pyx_k_map[] = "map"; static const char __pyx_k_mod[] = "mod"; static const char __pyx_k_oct[] = "oct"; static const char __pyx_k_red[] = "red"; static const char __pyx_k_tan[] = "tan"; static const char __pyx_k_BBBB[] = "BBBB"; static const char __pyx_k__523[] = "?"; static const char __pyx_k_blue[] = "blue"; static const char __pyx_k_cyan[] = "cyan"; static const char __pyx_k_gold[] = "gold"; static const char __pyx_k_gray[] = "gray"; static const char __pyx_k_grey[] = "grey"; static const char __pyx_k_hsva[] = "hsva"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_navy[] = "navy"; static const char __pyx_k_pack[] = "pack"; static const char __pyx_k_peru[] = "peru"; static const char __pyx_k_pink[] = "pink"; static const char __pyx_k_plum[] = "plum"; static const char __pyx_k_red1[] = "red1"; static const char __pyx_k_red2[] = "red2"; static const char __pyx_k_red3[] = "red3"; static const char __pyx_k_red4[] = "red4"; static const char __pyx_k_rgba[] = "rgba"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_snow[] = "snow"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_tan1[] = "tan1"; static const char __pyx_k_tan2[] = "tan2"; static const char __pyx_k_tan3[] = "tan3"; static const char __pyx_k_tan4[] = "tan4"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_Color[] = "Color"; static const char __pyx_k_azure[] = "azure"; static const char __pyx_k_beige[] = "beige"; static const char __pyx_k_black[] = "black"; static const char __pyx_k_blue1[] = "blue1"; static const char __pyx_k_blue2[] = "blue2"; static const char __pyx_k_blue3[] = "blue3"; static const char __pyx_k_blue4[] = "blue4"; static const char __pyx_k_brown[] = "brown"; static const char __pyx_k_coral[] = "coral"; static const char __pyx_k_cyan1[] = "cyan1"; static const char __pyx_k_cyan2[] = "cyan2"; static const char __pyx_k_cyan3[] = "cyan3"; static const char __pyx_k_cyan4[] = "cyan4"; static const char __pyx_k_gamma[] = "gamma"; static const char __pyx_k_gold1[] = "gold1"; static const char __pyx_k_gold2[] = "gold2"; static const char __pyx_k_gold3[] = "gold3"; static const char __pyx_k_gold4[] = "gold4"; static const char __pyx_k_gray0[] = "gray0"; static const char __pyx_k_gray1[] = "gray1"; static const char __pyx_k_gray2[] = "gray2"; static const char __pyx_k_gray3[] = "gray3"; static const char __pyx_k_gray4[] = "gray4"; static const char __pyx_k_gray5[] = "gray5"; static const char __pyx_k_gray6[] = "gray6"; static const char __pyx_k_gray7[] = "gray7"; static const char __pyx_k_gray8[] = "gray8"; static const char __pyx_k_gray9[] = "gray9"; static const char __pyx_k_green[] = "green"; static const char __pyx_k_grey0[] = "grey0"; static const char __pyx_k_grey1[] = "grey1"; static const char __pyx_k_grey2[] = "grey2"; static const char __pyx_k_grey3[] = "grey3"; static const char __pyx_k_grey4[] = "grey4"; static const char __pyx_k_grey5[] = "grey5"; static const char __pyx_k_grey6[] = "grey6"; static const char __pyx_k_grey7[] = "grey7"; static const char __pyx_k_grey8[] = "grey8"; static const char __pyx_k_grey9[] = "grey9"; static const char __pyx_k_ivory[] = "ivory"; static const char __pyx_k_khaki[] = "khaki"; static const char __pyx_k_linen[] = "linen"; static const char __pyx_k_lower[] = "lower"; static const char __pyx_k_pink1[] = "pink1"; static const char __pyx_k_pink2[] = "pink2"; static const char __pyx_k_pink3[] = "pink3"; static const char __pyx_k_pink4[] = "pink4"; static const char __pyx_k_plum1[] = "plum1"; static const char __pyx_k_plum2[] = "plum2"; static const char __pyx_k_plum3[] = "plum3"; static const char __pyx_k_plum4[] = "plum4"; static const char __pyx_k_round[] = "round"; static const char __pyx_k_snow1[] = "snow1"; static const char __pyx_k_snow2[] = "snow2"; static const char __pyx_k_snow3[] = "snow3"; static const char __pyx_k_snow4[] = "snow4"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_wheat[] = "wheat"; static const char __pyx_k_white[] = "white"; static const char __pyx_k_azure1[] = "azure1"; static const char __pyx_k_azure2[] = "azure2"; static const char __pyx_k_azure3[] = "azure3"; static const char __pyx_k_azure4[] = "azure4"; static const char __pyx_k_bisque[] = "bisque"; static const char __pyx_k_brown1[] = "brown1"; static const char __pyx_k_brown2[] = "brown2"; static const char __pyx_k_brown3[] = "brown3"; static const char __pyx_k_brown4[] = "brown4"; static const char __pyx_k_coral1[] = "coral1"; static const char __pyx_k_coral2[] = "coral2"; static const char __pyx_k_coral3[] = "coral3"; static const char __pyx_k_coral4[] = "coral4"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_gray10[] = "gray10"; static const char __pyx_k_gray11[] = "gray11"; static const char __pyx_k_gray12[] = "gray12"; static const char __pyx_k_gray13[] = "gray13"; static const char __pyx_k_gray14[] = "gray14"; static const char __pyx_k_gray15[] = "gray15"; static const char __pyx_k_gray16[] = "gray16"; static const char __pyx_k_gray17[] = "gray17"; static const char __pyx_k_gray18[] = "gray18"; static const char __pyx_k_gray19[] = "gray19"; static const char __pyx_k_gray20[] = "gray20"; static const char __pyx_k_gray21[] = "gray21"; static const char __pyx_k_gray22[] = "gray22"; static const char __pyx_k_gray23[] = "gray23"; static const char __pyx_k_gray24[] = "gray24"; static const char __pyx_k_gray25[] = "gray25"; static const char __pyx_k_gray26[] = "gray26"; static const char __pyx_k_gray27[] = "gray27"; static const char __pyx_k_gray28[] = "gray28"; static const char __pyx_k_gray29[] = "gray29"; static const char __pyx_k_gray30[] = "gray30"; static const char __pyx_k_gray31[] = "gray31"; static const char __pyx_k_gray32[] = "gray32"; static const char __pyx_k_gray33[] = "gray33"; static const char __pyx_k_gray34[] = "gray34"; static const char __pyx_k_gray35[] = "gray35"; static const char __pyx_k_gray36[] = "gray36"; static const char __pyx_k_gray37[] = "gray37"; static const char __pyx_k_gray38[] = "gray38"; static const char __pyx_k_gray39[] = "gray39"; static const char __pyx_k_gray40[] = "gray40"; static const char __pyx_k_gray41[] = "gray41"; static const char __pyx_k_gray42[] = "gray42"; static const char __pyx_k_gray43[] = "gray43"; static const char __pyx_k_gray44[] = "gray44"; static const char __pyx_k_gray45[] = "gray45"; static const char __pyx_k_gray46[] = "gray46"; static const char __pyx_k_gray47[] = "gray47"; static const char __pyx_k_gray48[] = "gray48"; static const char __pyx_k_gray49[] = "gray49"; static const char __pyx_k_gray50[] = "gray50"; static const char __pyx_k_gray51[] = "gray51"; static const char __pyx_k_gray52[] = "gray52"; static const char __pyx_k_gray53[] = "gray53"; static const char __pyx_k_gray54[] = "gray54"; static const char __pyx_k_gray55[] = "gray55"; static const char __pyx_k_gray56[] = "gray56"; static const char __pyx_k_gray57[] = "gray57"; static const char __pyx_k_gray58[] = "gray58"; static const char __pyx_k_gray59[] = "gray59"; static const char __pyx_k_gray60[] = "gray60"; static const char __pyx_k_gray61[] = "gray61"; static const char __pyx_k_gray62[] = "gray62"; static const char __pyx_k_gray63[] = "gray63"; static const char __pyx_k_gray64[] = "gray64"; static const char __pyx_k_gray65[] = "gray65"; static const char __pyx_k_gray66[] = "gray66"; static const char __pyx_k_gray67[] = "gray67"; static const char __pyx_k_gray68[] = "gray68"; static const char __pyx_k_gray69[] = "gray69"; static const char __pyx_k_gray70[] = "gray70"; static const char __pyx_k_gray71[] = "gray71"; static const char __pyx_k_gray72[] = "gray72"; static const char __pyx_k_gray73[] = "gray73"; static const char __pyx_k_gray74[] = "gray74"; static const char __pyx_k_gray75[] = "gray75"; static const char __pyx_k_gray76[] = "gray76"; static const char __pyx_k_gray77[] = "gray77"; static const char __pyx_k_gray78[] = "gray78"; static const char __pyx_k_gray79[] = "gray79"; static const char __pyx_k_gray80[] = "gray80"; static const char __pyx_k_gray81[] = "gray81"; static const char __pyx_k_gray82[] = "gray82"; static const char __pyx_k_gray83[] = "gray83"; static const char __pyx_k_gray84[] = "gray84"; static const char __pyx_k_gray85[] = "gray85"; static const char __pyx_k_gray86[] = "gray86"; static const char __pyx_k_gray87[] = "gray87"; static const char __pyx_k_gray88[] = "gray88"; static const char __pyx_k_gray89[] = "gray89"; static const char __pyx_k_gray90[] = "gray90"; static const char __pyx_k_gray91[] = "gray91"; static const char __pyx_k_gray92[] = "gray92"; static const char __pyx_k_gray93[] = "gray93"; static const char __pyx_k_gray94[] = "gray94"; static const char __pyx_k_gray95[] = "gray95"; static const char __pyx_k_gray96[] = "gray96"; static const char __pyx_k_gray97[] = "gray97"; static const char __pyx_k_gray98[] = "gray98"; static const char __pyx_k_gray99[] = "gray99"; static const char __pyx_k_green1[] = "green1"; static const char __pyx_k_green2[] = "green2"; static const char __pyx_k_green3[] = "green3"; static const char __pyx_k_green4[] = "green4"; static const char __pyx_k_grey10[] = "grey10"; static const char __pyx_k_grey11[] = "grey11"; static const char __pyx_k_grey12[] = "grey12"; static const char __pyx_k_grey13[] = "grey13"; static const char __pyx_k_grey14[] = "grey14"; static const char __pyx_k_grey15[] = "grey15"; static const char __pyx_k_grey16[] = "grey16"; static const char __pyx_k_grey17[] = "grey17"; static const char __pyx_k_grey18[] = "grey18"; static const char __pyx_k_grey19[] = "grey19"; static const char __pyx_k_grey20[] = "grey20"; static const char __pyx_k_grey21[] = "grey21"; static const char __pyx_k_grey22[] = "grey22"; static const char __pyx_k_grey23[] = "grey23"; static const char __pyx_k_grey24[] = "grey24"; static const char __pyx_k_grey25[] = "grey25"; static const char __pyx_k_grey26[] = "grey26"; static const char __pyx_k_grey27[] = "grey27"; static const char __pyx_k_grey28[] = "grey28"; static const char __pyx_k_grey29[] = "grey29"; static const char __pyx_k_grey30[] = "grey30"; static const char __pyx_k_grey31[] = "grey31"; static const char __pyx_k_grey32[] = "grey32"; static const char __pyx_k_grey33[] = "grey33"; static const char __pyx_k_grey34[] = "grey34"; static const char __pyx_k_grey35[] = "grey35"; static const char __pyx_k_grey36[] = "grey36"; static const char __pyx_k_grey37[] = "grey37"; static const char __pyx_k_grey38[] = "grey38"; static const char __pyx_k_grey39[] = "grey39"; static const char __pyx_k_grey40[] = "grey40"; static const char __pyx_k_grey41[] = "grey41"; static const char __pyx_k_grey42[] = "grey42"; static const char __pyx_k_grey43[] = "grey43"; static const char __pyx_k_grey44[] = "grey44"; static const char __pyx_k_grey45[] = "grey45"; static const char __pyx_k_grey46[] = "grey46"; static const char __pyx_k_grey47[] = "grey47"; static const char __pyx_k_grey48[] = "grey48"; static const char __pyx_k_grey49[] = "grey49"; static const char __pyx_k_grey50[] = "grey50"; static const char __pyx_k_grey51[] = "grey51"; static const char __pyx_k_grey52[] = "grey52"; static const char __pyx_k_grey53[] = "grey53"; static const char __pyx_k_grey54[] = "grey54"; static const char __pyx_k_grey55[] = "grey55"; static const char __pyx_k_grey56[] = "grey56"; static const char __pyx_k_grey57[] = "grey57"; static const char __pyx_k_grey58[] = "grey58"; static const char __pyx_k_grey59[] = "grey59"; static const char __pyx_k_grey60[] = "grey60"; static const char __pyx_k_grey61[] = "grey61"; static const char __pyx_k_grey62[] = "grey62"; static const char __pyx_k_grey63[] = "grey63"; static const char __pyx_k_grey64[] = "grey64"; static const char __pyx_k_grey65[] = "grey65"; static const char __pyx_k_grey66[] = "grey66"; static const char __pyx_k_grey67[] = "grey67"; static const char __pyx_k_grey68[] = "grey68"; static const char __pyx_k_grey69[] = "grey69"; static const char __pyx_k_grey70[] = "grey70"; static const char __pyx_k_grey71[] = "grey71"; static const char __pyx_k_grey72[] = "grey72"; static const char __pyx_k_grey73[] = "grey73"; static const char __pyx_k_grey74[] = "grey74"; static const char __pyx_k_grey75[] = "grey75"; static const char __pyx_k_grey76[] = "grey76"; static const char __pyx_k_grey77[] = "grey77"; static const char __pyx_k_grey78[] = "grey78"; static const char __pyx_k_grey79[] = "grey79"; static const char __pyx_k_grey80[] = "grey80"; static const char __pyx_k_grey81[] = "grey81"; static const char __pyx_k_grey82[] = "grey82"; static const char __pyx_k_grey83[] = "grey83"; static const char __pyx_k_grey84[] = "grey84"; static const char __pyx_k_grey85[] = "grey85"; static const char __pyx_k_grey86[] = "grey86"; static const char __pyx_k_grey87[] = "grey87"; static const char __pyx_k_grey88[] = "grey88"; static const char __pyx_k_grey89[] = "grey89"; static const char __pyx_k_grey90[] = "grey90"; static const char __pyx_k_grey91[] = "grey91"; static const char __pyx_k_grey92[] = "grey92"; static const char __pyx_k_grey93[] = "grey93"; static const char __pyx_k_grey94[] = "grey94"; static const char __pyx_k_grey95[] = "grey95"; static const char __pyx_k_grey96[] = "grey96"; static const char __pyx_k_grey97[] = "grey97"; static const char __pyx_k_grey98[] = "grey98"; static const char __pyx_k_grey99[] = "grey99"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_ivory1[] = "ivory1"; static const char __pyx_k_ivory2[] = "ivory2"; static const char __pyx_k_ivory3[] = "ivory3"; static const char __pyx_k_ivory4[] = "ivory4"; static const char __pyx_k_khaki1[] = "khaki1"; static const char __pyx_k_khaki2[] = "khaki2"; static const char __pyx_k_khaki3[] = "khaki3"; static const char __pyx_k_khaki4[] = "khaki4"; static const char __pyx_k_maroon[] = "maroon"; static const char __pyx_k_orange[] = "orange"; static const char __pyx_k_orchid[] = "orchid"; static const char __pyx_k_purple[] = "purple"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_salmon[] = "salmon"; static const char __pyx_k_sienna[] = "sienna"; static const char __pyx_k_struct[] = "struct"; static const char __pyx_k_tomato[] = "tomato"; static const char __pyx_k_unpack[] = "unpack"; static const char __pyx_k_violet[] = "violet"; static const char __pyx_k_wheat1[] = "wheat1"; static const char __pyx_k_wheat2[] = "wheat2"; static const char __pyx_k_wheat3[] = "wheat3"; static const char __pyx_k_wheat4[] = "wheat4"; static const char __pyx_k_yellow[] = "yellow"; static const char __pyx_k_bisque1[] = "bisque1"; static const char __pyx_k_bisque2[] = "bisque2"; static const char __pyx_k_bisque3[] = "bisque3"; static const char __pyx_k_bisque4[] = "bisque4"; static const char __pyx_k_darkred[] = "darkred"; static const char __pyx_k_dimgray[] = "dimgray"; static const char __pyx_k_dimgrey[] = "dimgrey"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_gray100[] = "gray100"; static const char __pyx_k_grey100[] = "grey100"; static const char __pyx_k_hotpink[] = "hotpink"; static const char __pyx_k_magenta[] = "magenta"; static const char __pyx_k_maroon1[] = "maroon1"; static const char __pyx_k_maroon2[] = "maroon2"; static const char __pyx_k_maroon3[] = "maroon3"; static const char __pyx_k_maroon4[] = "maroon4"; static const char __pyx_k_oldlace[] = "oldlace"; static const char __pyx_k_orange1[] = "orange1"; static const char __pyx_k_orange2[] = "orange2"; static const char __pyx_k_orange3[] = "orange3"; static const char __pyx_k_orange4[] = "orange4"; static const char __pyx_k_orchid1[] = "orchid1"; static const char __pyx_k_orchid2[] = "orchid2"; static const char __pyx_k_orchid3[] = "orchid3"; static const char __pyx_k_orchid4[] = "orchid4"; static const char __pyx_k_purple1[] = "purple1"; static const char __pyx_k_purple2[] = "purple2"; static const char __pyx_k_purple3[] = "purple3"; static const char __pyx_k_purple4[] = "purple4"; static const char __pyx_k_salmon1[] = "salmon1"; static const char __pyx_k_salmon2[] = "salmon2"; static const char __pyx_k_salmon3[] = "salmon3"; static const char __pyx_k_salmon4[] = "salmon4"; static const char __pyx_k_sienna1[] = "sienna1"; static const char __pyx_k_sienna2[] = "sienna2"; static const char __pyx_k_sienna3[] = "sienna3"; static const char __pyx_k_sienna4[] = "sienna4"; static const char __pyx_k_skyblue[] = "skyblue"; static const char __pyx_k_thistle[] = "thistle"; static const char __pyx_k_tomato1[] = "tomato1"; static const char __pyx_k_tomato2[] = "tomato2"; static const char __pyx_k_tomato3[] = "tomato3"; static const char __pyx_k_tomato4[] = "tomato4"; static const char __pyx_k_yellow1[] = "yellow1"; static const char __pyx_k_yellow2[] = "yellow2"; static const char __pyx_k_yellow3[] = "yellow3"; static const char __pyx_k_yellow4[] = "yellow4"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_binascii[] = "binascii"; static const char __pyx_k_cornsilk[] = "cornsilk"; static const char __pyx_k_darkblue[] = "darkblue"; static const char __pyx_k_darkcyan[] = "darkcyan"; static const char __pyx_k_darkgray[] = "darkgray"; static const char __pyx_k_darkgrey[] = "darkgrey"; static const char __pyx_k_deeppink[] = "deeppink"; static const char __pyx_k_honeydew[] = "honeydew"; static const char __pyx_k_hotpink1[] = "hotpink1"; static const char __pyx_k_hotpink2[] = "hotpink2"; static const char __pyx_k_hotpink3[] = "hotpink3"; static const char __pyx_k_hotpink4[] = "hotpink4"; static const char __pyx_k_lavender[] = "lavender"; static const char __pyx_k_magenta1[] = "magenta1"; static const char __pyx_k_magenta2[] = "magenta2"; static const char __pyx_k_magenta3[] = "magenta3"; static const char __pyx_k_magenta4[] = "magenta4"; static const char __pyx_k_moccasin[] = "moccasin"; static const char __pyx_k_navyblue[] = "navyblue"; static const char __pyx_k_seagreen[] = "seagreen"; static const char __pyx_k_seashell[] = "seashell"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_skyblue1[] = "skyblue1"; static const char __pyx_k_skyblue2[] = "skyblue2"; static const char __pyx_k_skyblue3[] = "skyblue3"; static const char __pyx_k_skyblue4[] = "skyblue4"; static const char __pyx_k_thistle1[] = "thistle1"; static const char __pyx_k_thistle2[] = "thistle2"; static const char __pyx_k_thistle3[] = "thistle3"; static const char __pyx_k_thistle4[] = "thistle4"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_aliceblue[] = "aliceblue"; static const char __pyx_k_burlywood[] = "burlywood"; static const char __pyx_k_cadetblue[] = "cadetblue"; static const char __pyx_k_chocolate[] = "chocolate"; static const char __pyx_k_cornsilk1[] = "cornsilk1"; static const char __pyx_k_cornsilk2[] = "cornsilk2"; static const char __pyx_k_cornsilk3[] = "cornsilk3"; static const char __pyx_k_cornsilk4[] = "cornsilk4"; static const char __pyx_k_darkgreen[] = "darkgreen"; static const char __pyx_k_darkkhaki[] = "darkkhaki"; static const char __pyx_k_debianred[] = "debianred"; static const char __pyx_k_deeppink1[] = "deeppink1"; static const char __pyx_k_deeppink2[] = "deeppink2"; static const char __pyx_k_deeppink3[] = "deeppink3"; static const char __pyx_k_deeppink4[] = "deeppink4"; static const char __pyx_k_firebrick[] = "firebrick"; static const char __pyx_k_gainsboro[] = "gainsboro"; static const char __pyx_k_goldenrod[] = "goldenrod"; static const char __pyx_k_honeydew1[] = "honeydew1"; static const char __pyx_k_honeydew2[] = "honeydew2"; static const char __pyx_k_honeydew3[] = "honeydew3"; static const char __pyx_k_honeydew4[] = "honeydew4"; static const char __pyx_k_indianred[] = "indianred"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_lawngreen[] = "lawngreen"; static const char __pyx_k_lightblue[] = "lightblue"; static const char __pyx_k_lightcyan[] = "lightcyan"; static const char __pyx_k_lightgray[] = "lightgray"; static const char __pyx_k_lightgrey[] = "lightgrey"; static const char __pyx_k_lightpink[] = "lightpink"; static const char __pyx_k_limegreen[] = "limegreen"; static const char __pyx_k_mintcream[] = "mintcream"; static const char __pyx_k_mistyrose[] = "mistyrose"; static const char __pyx_k_normalize[] = "normalize"; static const char __pyx_k_olivedrab[] = "olivedrab"; static const char __pyx_k_orangered[] = "orangered"; static const char __pyx_k_palegreen[] = "palegreen"; static const char __pyx_k_peachpuff[] = "peachpuff"; static const char __pyx_k_rosybrown[] = "rosybrown"; static const char __pyx_k_royalblue[] = "royalblue"; static const char __pyx_k_seagreen1[] = "seagreen1"; static const char __pyx_k_seagreen2[] = "seagreen2"; static const char __pyx_k_seagreen3[] = "seagreen3"; static const char __pyx_k_seagreen4[] = "seagreen4"; static const char __pyx_k_seashell1[] = "seashell1"; static const char __pyx_k_seashell2[] = "seashell2"; static const char __pyx_k_seashell3[] = "seashell3"; static const char __pyx_k_seashell4[] = "seashell4"; static const char __pyx_k_slateblue[] = "slateblue"; static const char __pyx_k_slategray[] = "slategray"; static const char __pyx_k_slategrey[] = "slategrey"; static const char __pyx_k_steelblue[] = "steelblue"; static const char __pyx_k_turquoise[] = "turquoise"; static const char __pyx_k_unhexlify[] = "unhexlify"; static const char __pyx_k_violetred[] = "violetred"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_aquamarine[] = "aquamarine"; static const char __pyx_k_blueviolet[] = "blueviolet"; static const char __pyx_k_burlywood1[] = "burlywood1"; static const char __pyx_k_burlywood2[] = "burlywood2"; static const char __pyx_k_burlywood3[] = "burlywood3"; static const char __pyx_k_burlywood4[] = "burlywood4"; static const char __pyx_k_cadetblue1[] = "cadetblue1"; static const char __pyx_k_cadetblue2[] = "cadetblue2"; static const char __pyx_k_cadetblue3[] = "cadetblue3"; static const char __pyx_k_cadetblue4[] = "cadetblue4"; static const char __pyx_k_chartreuse[] = "chartreuse"; static const char __pyx_k_chocolate1[] = "chocolate1"; static const char __pyx_k_chocolate2[] = "chocolate2"; static const char __pyx_k_chocolate3[] = "chocolate3"; static const char __pyx_k_chocolate4[] = "chocolate4"; static const char __pyx_k_darkorange[] = "darkorange"; static const char __pyx_k_darkorchid[] = "darkorchid"; static const char __pyx_k_darksalmon[] = "darksalmon"; static const char __pyx_k_darkviolet[] = "darkviolet"; static const char __pyx_k_dodgerblue[] = "dodgerblue"; static const char __pyx_k_firebrick1[] = "firebrick1"; static const char __pyx_k_firebrick2[] = "firebrick2"; static const char __pyx_k_firebrick3[] = "firebrick3"; static const char __pyx_k_firebrick4[] = "firebrick4"; static const char __pyx_k_ghostwhite[] = "ghostwhite"; static const char __pyx_k_goldenrod1[] = "goldenrod1"; static const char __pyx_k_goldenrod2[] = "goldenrod2"; static const char __pyx_k_goldenrod3[] = "goldenrod3"; static const char __pyx_k_goldenrod4[] = "goldenrod4"; static const char __pyx_k_indianred1[] = "indianred1"; static const char __pyx_k_indianred2[] = "indianred2"; static const char __pyx_k_indianred3[] = "indianred3"; static const char __pyx_k_indianred4[] = "indianred4"; static const char __pyx_k_lightblue1[] = "lightblue1"; static const char __pyx_k_lightblue2[] = "lightblue2"; static const char __pyx_k_lightblue3[] = "lightblue3"; static const char __pyx_k_lightblue4[] = "lightblue4"; static const char __pyx_k_lightcoral[] = "lightcoral"; static const char __pyx_k_lightcyan1[] = "lightcyan1"; static const char __pyx_k_lightcyan2[] = "lightcyan2"; static const char __pyx_k_lightcyan3[] = "lightcyan3"; static const char __pyx_k_lightcyan4[] = "lightcyan4"; static const char __pyx_k_lightgreen[] = "lightgreen"; static const char __pyx_k_lightpink1[] = "lightpink1"; static const char __pyx_k_lightpink2[] = "lightpink2"; static const char __pyx_k_lightpink3[] = "lightpink3"; static const char __pyx_k_lightpink4[] = "lightpink4"; static const char __pyx_k_mediumblue[] = "mediumblue"; static const char __pyx_k_mistyrose1[] = "mistyrose1"; static const char __pyx_k_mistyrose2[] = "mistyrose2"; static const char __pyx_k_mistyrose3[] = "mistyrose3"; static const char __pyx_k_mistyrose4[] = "mistyrose4"; static const char __pyx_k_olivedrab1[] = "olivedrab1"; static const char __pyx_k_olivedrab2[] = "olivedrab2"; static const char __pyx_k_olivedrab3[] = "olivedrab3"; static const char __pyx_k_olivedrab4[] = "olivedrab4"; static const char __pyx_k_orangered1[] = "orangered1"; static const char __pyx_k_orangered2[] = "orangered2"; static const char __pyx_k_orangered3[] = "orangered3"; static const char __pyx_k_orangered4[] = "orangered4"; static const char __pyx_k_palegreen1[] = "palegreen1"; static const char __pyx_k_palegreen2[] = "palegreen2"; static const char __pyx_k_palegreen3[] = "palegreen3"; static const char __pyx_k_palegreen4[] = "palegreen4"; static const char __pyx_k_papayawhip[] = "papayawhip"; static const char __pyx_k_peachpuff1[] = "peachpuff1"; static const char __pyx_k_peachpuff2[] = "peachpuff2"; static const char __pyx_k_peachpuff3[] = "peachpuff3"; static const char __pyx_k_peachpuff4[] = "peachpuff4"; static const char __pyx_k_powderblue[] = "powderblue"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_rosybrown1[] = "rosybrown1"; static const char __pyx_k_rosybrown2[] = "rosybrown2"; static const char __pyx_k_rosybrown3[] = "rosybrown3"; static const char __pyx_k_rosybrown4[] = "rosybrown4"; static const char __pyx_k_royalblue1[] = "royalblue1"; static const char __pyx_k_royalblue2[] = "royalblue2"; static const char __pyx_k_royalblue3[] = "royalblue3"; static const char __pyx_k_royalblue4[] = "royalblue4"; static const char __pyx_k_sandybrown[] = "sandybrown"; static const char __pyx_k_set_length[] = "set_length"; static const char __pyx_k_slateblue1[] = "slateblue1"; static const char __pyx_k_slateblue2[] = "slateblue2"; static const char __pyx_k_slateblue3[] = "slateblue3"; static const char __pyx_k_slateblue4[] = "slateblue4"; static const char __pyx_k_slategray1[] = "slategray1"; static const char __pyx_k_slategray2[] = "slategray2"; static const char __pyx_k_slategray3[] = "slategray3"; static const char __pyx_k_slategray4[] = "slategray4"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_steelblue1[] = "steelblue1"; static const char __pyx_k_steelblue2[] = "steelblue2"; static const char __pyx_k_steelblue3[] = "steelblue3"; static const char __pyx_k_steelblue4[] = "steelblue4"; static const char __pyx_k_turquoise1[] = "turquoise1"; static const char __pyx_k_turquoise2[] = "turquoise2"; static const char __pyx_k_turquoise3[] = "turquoise3"; static const char __pyx_k_turquoise4[] = "turquoise4"; static const char __pyx_k_violetred1[] = "violetred1"; static const char __pyx_k_violetred2[] = "violetred2"; static const char __pyx_k_violetred3[] = "violetred3"; static const char __pyx_k_violetred4[] = "violetred4"; static const char __pyx_k_whitesmoke[] = "whitesmoke"; static const char __pyx_k_aquamarine1[] = "aquamarine1"; static const char __pyx_k_aquamarine2[] = "aquamarine2"; static const char __pyx_k_aquamarine3[] = "aquamarine3"; static const char __pyx_k_aquamarine4[] = "aquamarine4"; static const char __pyx_k_chartreuse1[] = "chartreuse1"; static const char __pyx_k_chartreuse2[] = "chartreuse2"; static const char __pyx_k_chartreuse3[] = "chartreuse3"; static const char __pyx_k_chartreuse4[] = "chartreuse4"; static const char __pyx_k_darkmagenta[] = "darkmagenta"; static const char __pyx_k_darkorange1[] = "darkorange1"; static const char __pyx_k_darkorange2[] = "darkorange2"; static const char __pyx_k_darkorange3[] = "darkorange3"; static const char __pyx_k_darkorange4[] = "darkorange4"; static const char __pyx_k_darkorchid1[] = "darkorchid1"; static const char __pyx_k_darkorchid2[] = "darkorchid2"; static const char __pyx_k_darkorchid3[] = "darkorchid3"; static const char __pyx_k_darkorchid4[] = "darkorchid4"; static const char __pyx_k_deepskyblue[] = "deepskyblue"; static const char __pyx_k_dodgerblue1[] = "dodgerblue1"; static const char __pyx_k_dodgerblue2[] = "dodgerblue2"; static const char __pyx_k_dodgerblue3[] = "dodgerblue3"; static const char __pyx_k_dodgerblue4[] = "dodgerblue4"; static const char __pyx_k_floralwhite[] = "floralwhite"; static const char __pyx_k_forestgreen[] = "forestgreen"; static const char __pyx_k_greenyellow[] = "greenyellow"; static const char __pyx_k_lightsalmon[] = "lightsalmon"; static const char __pyx_k_lightyellow[] = "lightyellow"; static const char __pyx_k_navajowhite[] = "navajowhite"; static const char __pyx_k_saddlebrown[] = "saddlebrown"; static const char __pyx_k_springgreen[] = "springgreen"; static const char __pyx_k_yellowgreen[] = "yellowgreen"; static const char __pyx_k_antiquewhite[] = "antiquewhite"; static const char __pyx_k_darkseagreen[] = "darkseagreen"; static const char __pyx_k_deepskyblue1[] = "deepskyblue1"; static const char __pyx_k_deepskyblue2[] = "deepskyblue2"; static const char __pyx_k_deepskyblue3[] = "deepskyblue3"; static const char __pyx_k_deepskyblue4[] = "deepskyblue4"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_lemonchiffon[] = "lemonchiffon"; static const char __pyx_k_lightsalmon1[] = "lightsalmon1"; static const char __pyx_k_lightsalmon2[] = "lightsalmon2"; static const char __pyx_k_lightsalmon3[] = "lightsalmon3"; static const char __pyx_k_lightsalmon4[] = "lightsalmon4"; static const char __pyx_k_lightskyblue[] = "lightskyblue"; static const char __pyx_k_lightyellow1[] = "lightyellow1"; static const char __pyx_k_lightyellow2[] = "lightyellow2"; static const char __pyx_k_lightyellow3[] = "lightyellow3"; static const char __pyx_k_lightyellow4[] = "lightyellow4"; static const char __pyx_k_mediumorchid[] = "mediumorchid"; static const char __pyx_k_mediumpurple[] = "mediumpurple"; static const char __pyx_k_midnightblue[] = "midnightblue"; static const char __pyx_k_navajowhite1[] = "navajowhite1"; static const char __pyx_k_navajowhite2[] = "navajowhite2"; static const char __pyx_k_navajowhite3[] = "navajowhite3"; static const char __pyx_k_navajowhite4[] = "navajowhite4"; static const char __pyx_k_springgreen1[] = "springgreen1"; static const char __pyx_k_springgreen2[] = "springgreen2"; static const char __pyx_k_springgreen3[] = "springgreen3"; static const char __pyx_k_springgreen4[] = "springgreen4"; static const char __pyx_k_antiquewhite1[] = "antiquewhite1"; static const char __pyx_k_antiquewhite2[] = "antiquewhite2"; static const char __pyx_k_antiquewhite3[] = "antiquewhite3"; static const char __pyx_k_antiquewhite4[] = "antiquewhite4"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_correct_gamma[] = "correct_gamma"; static const char __pyx_k_darkgoldenrod[] = "darkgoldenrod"; static const char __pyx_k_darkseagreen1[] = "darkseagreen1"; static const char __pyx_k_darkseagreen2[] = "darkseagreen2"; static const char __pyx_k_darkseagreen3[] = "darkseagreen3"; static const char __pyx_k_darkseagreen4[] = "darkseagreen4"; static const char __pyx_k_darkslateblue[] = "darkslateblue"; static const char __pyx_k_darkslategray[] = "darkslategray"; static const char __pyx_k_darkslategrey[] = "darkslategrey"; static const char __pyx_k_darkturquoise[] = "darkturquoise"; static const char __pyx_k_lavenderblush[] = "lavenderblush"; static const char __pyx_k_lemonchiffon1[] = "lemonchiffon1"; static const char __pyx_k_lemonchiffon2[] = "lemonchiffon2"; static const char __pyx_k_lemonchiffon3[] = "lemonchiffon3"; static const char __pyx_k_lemonchiffon4[] = "lemonchiffon4"; static const char __pyx_k_lightseagreen[] = "lightseagreen"; static const char __pyx_k_lightskyblue1[] = "lightskyblue1"; static const char __pyx_k_lightskyblue2[] = "lightskyblue2"; static const char __pyx_k_lightskyblue3[] = "lightskyblue3"; static const char __pyx_k_lightskyblue4[] = "lightskyblue4"; static const char __pyx_k_mediumorchid1[] = "mediumorchid1"; static const char __pyx_k_mediumorchid2[] = "mediumorchid2"; static const char __pyx_k_mediumorchid3[] = "mediumorchid3"; static const char __pyx_k_mediumorchid4[] = "mediumorchid4"; static const char __pyx_k_mediumpurple1[] = "mediumpurple1"; static const char __pyx_k_mediumpurple2[] = "mediumpurple2"; static const char __pyx_k_mediumpurple3[] = "mediumpurple3"; static const char __pyx_k_mediumpurple4[] = "mediumpurple4"; static const char __pyx_k_palegoldenrod[] = "palegoldenrod"; static const char __pyx_k_paleturquoise[] = "paleturquoise"; static const char __pyx_k_palevioletred[] = "palevioletred"; static const char __pyx_k_Color___reduce[] = "Color.__reduce__"; static const char __pyx_k_blanchedalmond[] = "blanchedalmond"; static const char __pyx_k_cornflowerblue[] = "cornflowerblue"; static const char __pyx_k_darkgoldenrod1[] = "darkgoldenrod1"; static const char __pyx_k_darkgoldenrod2[] = "darkgoldenrod2"; static const char __pyx_k_darkgoldenrod3[] = "darkgoldenrod3"; static const char __pyx_k_darkgoldenrod4[] = "darkgoldenrod4"; static const char __pyx_k_darkolivegreen[] = "darkolivegreen"; static const char __pyx_k_darkslategray1[] = "darkslategray1"; static const char __pyx_k_darkslategray2[] = "darkslategray2"; static const char __pyx_k_darkslategray3[] = "darkslategray3"; static const char __pyx_k_darkslategray4[] = "darkslategray4"; static const char __pyx_k_lavenderblush1[] = "lavenderblush1"; static const char __pyx_k_lavenderblush2[] = "lavenderblush2"; static const char __pyx_k_lavenderblush3[] = "lavenderblush3"; static const char __pyx_k_lavenderblush4[] = "lavenderblush4"; static const char __pyx_k_lightgoldenrod[] = "lightgoldenrod"; static const char __pyx_k_lightslateblue[] = "lightslateblue"; static const char __pyx_k_lightslategray[] = "lightslategray"; static const char __pyx_k_lightslategrey[] = "lightslategrey"; static const char __pyx_k_lightsteelblue[] = "lightsteelblue"; static const char __pyx_k_mediumseagreen[] = "mediumseagreen"; static const char __pyx_k_paleturquoise1[] = "paleturquoise1"; static const char __pyx_k_paleturquoise2[] = "paleturquoise2"; static const char __pyx_k_paleturquoise3[] = "paleturquoise3"; static const char __pyx_k_paleturquoise4[] = "paleturquoise4"; static const char __pyx_k_palevioletred1[] = "palevioletred1"; static const char __pyx_k_palevioletred2[] = "palevioletred2"; static const char __pyx_k_palevioletred3[] = "palevioletred3"; static const char __pyx_k_palevioletred4[] = "palevioletred4"; static const char __pyx_k_Color_normalize[] = "Color.normalize"; static const char __pyx_k_darkolivegreen1[] = "darkolivegreen1"; static const char __pyx_k_darkolivegreen2[] = "darkolivegreen2"; static const char __pyx_k_darkolivegreen3[] = "darkolivegreen3"; static const char __pyx_k_darkolivegreen4[] = "darkolivegreen4"; static const char __pyx_k_lightgoldenrod1[] = "lightgoldenrod1"; static const char __pyx_k_lightgoldenrod2[] = "lightgoldenrod2"; static const char __pyx_k_lightgoldenrod3[] = "lightgoldenrod3"; static const char __pyx_k_lightgoldenrod4[] = "lightgoldenrod4"; static const char __pyx_k_lightsteelblue1[] = "lightsteelblue1"; static const char __pyx_k_lightsteelblue2[] = "lightsteelblue2"; static const char __pyx_k_lightsteelblue3[] = "lightsteelblue3"; static const char __pyx_k_lightsteelblue4[] = "lightsteelblue4"; static const char __pyx_k_mediumslateblue[] = "mediumslateblue"; static const char __pyx_k_mediumturquoise[] = "mediumturquoise"; static const char __pyx_k_mediumvioletred[] = "mediumvioletred"; static const char __pyx_k_Color___setstate[] = "Color.__setstate__"; static const char __pyx_k_Color_set_length[] = "Color.set_length"; static const char __pyx_k_Expected_a_color[] = "Expected a color."; static const char __pyx_k_mediumaquamarine[] = "mediumaquamarine"; static const char __pyx_k_mod___locals_mod[] = "__mod__..mod"; static const char __pyx_k_mediumspringgreen[] = "mediumspringgreen"; static const char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Color_correct_gamma[] = "Color.correct_gamma"; static const char __pyx_k_lightgoldenrodyellow[] = "lightgoldenrodyellow"; static const char __pyx_k_floordiv___locals_div[] = "__floordiv__..div"; static const char __pyx_k_src_pygame_sdl2_color_pyx[] = "src/pygame_sdl2/color.pyx"; static const char __pyx_k_correct_gamma_locals_lambda[] = "correct_gamma.."; static const char __pyx_k_Color_from_hex_locals_lambda[] = "Color.from_hex.."; /* #### Code section: decls ### */ static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color___richcmp__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_2__cinit__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_4__init__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6__repr__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_8__int__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ #endif static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_14__float__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_16__reduce__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_18__setstate__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_d); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_20__setitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_22__getitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static Py_ssize_t __pyx_pf_11pygame_sdl2_5color_5Color_24__len__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_26__mul__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_28__add__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_30__sub__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_r); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_32__mod__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_34__div__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ #endif static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_36__floordiv__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_3cmy___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_3cmy_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsva___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsva_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsla___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsla_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_38normalize(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_40correct_gamma(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_gamma); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_42set_length(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1r___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1r_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1g___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1g_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1b___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1b_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1a___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1a_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_5color_Color(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_5color_Color; PyObject *__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color; PyTypeObject *__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma; PyObject *__pyx_kp_s_08x; PyObject *__pyx_kp_s_0x; PyObject *__pyx_n_s_BBB; PyObject *__pyx_n_s_BBBB; PyObject *__pyx_n_s_Color; PyObject *__pyx_n_s_Color___reduce; PyObject *__pyx_n_s_Color___setstate; PyObject *__pyx_n_s_Color_correct_gamma; PyObject *__pyx_n_s_Color_from_hex_locals_lambda; PyObject *__pyx_n_s_Color_normalize; PyObject *__pyx_n_s_Color_set_length; PyObject *__pyx_kp_s_Expected_a_color; PyObject *__pyx_n_s_IndexError; PyObject *__pyx_n_s_KeyError; PyObject *__pyx_kp_s_L; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s__10; PyObject *__pyx_kp_s__2; PyObject *__pyx_kp_s__3; PyObject *__pyx_n_s__523; PyObject *__pyx_n_s_a; PyObject *__pyx_n_s_aliceblue; PyObject *__pyx_n_s_antiquewhite; PyObject *__pyx_n_s_antiquewhite1; PyObject *__pyx_n_s_antiquewhite2; PyObject *__pyx_n_s_antiquewhite3; PyObject *__pyx_n_s_antiquewhite4; PyObject *__pyx_n_s_aquamarine; PyObject *__pyx_n_s_aquamarine1; PyObject *__pyx_n_s_aquamarine2; PyObject *__pyx_n_s_aquamarine3; PyObject *__pyx_n_s_aquamarine4; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_azure; PyObject *__pyx_n_s_azure1; PyObject *__pyx_n_s_azure2; PyObject *__pyx_n_s_azure3; PyObject *__pyx_n_s_azure4; PyObject *__pyx_n_s_b; PyObject *__pyx_n_s_beige; PyObject *__pyx_n_s_binascii; PyObject *__pyx_n_s_bisque; PyObject *__pyx_n_s_bisque1; PyObject *__pyx_n_s_bisque2; PyObject *__pyx_n_s_bisque3; PyObject *__pyx_n_s_bisque4; PyObject *__pyx_n_s_black; PyObject *__pyx_n_s_blanchedalmond; PyObject *__pyx_n_s_blue; PyObject *__pyx_n_s_blue1; PyObject *__pyx_n_s_blue2; PyObject *__pyx_n_s_blue3; PyObject *__pyx_n_s_blue4; PyObject *__pyx_n_s_blueviolet; PyObject *__pyx_n_s_brown; PyObject *__pyx_n_s_brown1; PyObject *__pyx_n_s_brown2; PyObject *__pyx_n_s_brown3; PyObject *__pyx_n_s_brown4; PyObject *__pyx_n_s_burlywood; PyObject *__pyx_n_s_burlywood1; PyObject *__pyx_n_s_burlywood2; PyObject *__pyx_n_s_burlywood3; PyObject *__pyx_n_s_burlywood4; PyObject *__pyx_n_s_c; PyObject *__pyx_n_s_cadetblue; PyObject *__pyx_n_s_cadetblue1; PyObject *__pyx_n_s_cadetblue2; PyObject *__pyx_n_s_cadetblue3; PyObject *__pyx_n_s_cadetblue4; PyObject *__pyx_n_s_chartreuse; PyObject *__pyx_n_s_chartreuse1; PyObject *__pyx_n_s_chartreuse2; PyObject *__pyx_n_s_chartreuse3; PyObject *__pyx_n_s_chartreuse4; PyObject *__pyx_n_s_chocolate; PyObject *__pyx_n_s_chocolate1; PyObject *__pyx_n_s_chocolate2; PyObject *__pyx_n_s_chocolate3; PyObject *__pyx_n_s_chocolate4; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_coral; PyObject *__pyx_n_s_coral1; PyObject *__pyx_n_s_coral2; PyObject *__pyx_n_s_coral3; PyObject *__pyx_n_s_coral4; PyObject *__pyx_n_s_cornflowerblue; PyObject *__pyx_n_s_cornsilk; PyObject *__pyx_n_s_cornsilk1; PyObject *__pyx_n_s_cornsilk2; PyObject *__pyx_n_s_cornsilk3; PyObject *__pyx_n_s_cornsilk4; PyObject *__pyx_n_s_correct_gamma; PyObject *__pyx_n_s_correct_gamma_locals_lambda; PyObject *__pyx_n_s_cyan; PyObject *__pyx_n_s_cyan1; PyObject *__pyx_n_s_cyan2; PyObject *__pyx_n_s_cyan3; PyObject *__pyx_n_s_cyan4; PyObject *__pyx_n_s_d; PyObject *__pyx_n_s_darkblue; PyObject *__pyx_n_s_darkcyan; PyObject *__pyx_n_s_darkgoldenrod; PyObject *__pyx_n_s_darkgoldenrod1; PyObject *__pyx_n_s_darkgoldenrod2; PyObject *__pyx_n_s_darkgoldenrod3; PyObject *__pyx_n_s_darkgoldenrod4; PyObject *__pyx_n_s_darkgray; PyObject *__pyx_n_s_darkgreen; PyObject *__pyx_n_s_darkgrey; PyObject *__pyx_n_s_darkkhaki; PyObject *__pyx_n_s_darkmagenta; PyObject *__pyx_n_s_darkolivegreen; PyObject *__pyx_n_s_darkolivegreen1; PyObject *__pyx_n_s_darkolivegreen2; PyObject *__pyx_n_s_darkolivegreen3; PyObject *__pyx_n_s_darkolivegreen4; PyObject *__pyx_n_s_darkorange; PyObject *__pyx_n_s_darkorange1; PyObject *__pyx_n_s_darkorange2; PyObject *__pyx_n_s_darkorange3; PyObject *__pyx_n_s_darkorange4; PyObject *__pyx_n_s_darkorchid; PyObject *__pyx_n_s_darkorchid1; PyObject *__pyx_n_s_darkorchid2; PyObject *__pyx_n_s_darkorchid3; PyObject *__pyx_n_s_darkorchid4; PyObject *__pyx_n_s_darkred; PyObject *__pyx_n_s_darksalmon; PyObject *__pyx_n_s_darkseagreen; PyObject *__pyx_n_s_darkseagreen1; PyObject *__pyx_n_s_darkseagreen2; PyObject *__pyx_n_s_darkseagreen3; PyObject *__pyx_n_s_darkseagreen4; PyObject *__pyx_n_s_darkslateblue; PyObject *__pyx_n_s_darkslategray; PyObject *__pyx_n_s_darkslategray1; PyObject *__pyx_n_s_darkslategray2; PyObject *__pyx_n_s_darkslategray3; PyObject *__pyx_n_s_darkslategray4; PyObject *__pyx_n_s_darkslategrey; PyObject *__pyx_n_s_darkturquoise; PyObject *__pyx_n_s_darkviolet; PyObject *__pyx_n_s_debianred; PyObject *__pyx_n_s_deeppink; PyObject *__pyx_n_s_deeppink1; PyObject *__pyx_n_s_deeppink2; PyObject *__pyx_n_s_deeppink3; PyObject *__pyx_n_s_deeppink4; PyObject *__pyx_n_s_deepskyblue; PyObject *__pyx_n_s_deepskyblue1; PyObject *__pyx_n_s_deepskyblue2; PyObject *__pyx_n_s_deepskyblue3; PyObject *__pyx_n_s_deepskyblue4; PyObject *__pyx_n_s_dimgray; PyObject *__pyx_n_s_dimgrey; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_div; PyObject *__pyx_n_s_dodgerblue; PyObject *__pyx_n_s_dodgerblue1; PyObject *__pyx_n_s_dodgerblue2; PyObject *__pyx_n_s_dodgerblue3; PyObject *__pyx_n_s_dodgerblue4; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_firebrick; PyObject *__pyx_n_s_firebrick1; PyObject *__pyx_n_s_firebrick2; PyObject *__pyx_n_s_firebrick3; PyObject *__pyx_n_s_firebrick4; PyObject *__pyx_n_s_floordiv___locals_div; PyObject *__pyx_n_s_floralwhite; PyObject *__pyx_n_s_forestgreen; PyObject *__pyx_n_s_g; PyObject *__pyx_n_s_gainsboro; PyObject *__pyx_n_s_gamma; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_ghostwhite; PyObject *__pyx_n_s_gold; PyObject *__pyx_n_s_gold1; PyObject *__pyx_n_s_gold2; PyObject *__pyx_n_s_gold3; PyObject *__pyx_n_s_gold4; PyObject *__pyx_n_s_goldenrod; PyObject *__pyx_n_s_goldenrod1; PyObject *__pyx_n_s_goldenrod2; PyObject *__pyx_n_s_goldenrod3; PyObject *__pyx_n_s_goldenrod4; PyObject *__pyx_n_s_gray; PyObject *__pyx_n_s_gray0; PyObject *__pyx_n_s_gray1; PyObject *__pyx_n_s_gray10; PyObject *__pyx_n_s_gray100; PyObject *__pyx_n_s_gray11; PyObject *__pyx_n_s_gray12; PyObject *__pyx_n_s_gray13; PyObject *__pyx_n_s_gray14; PyObject *__pyx_n_s_gray15; PyObject *__pyx_n_s_gray16; PyObject *__pyx_n_s_gray17; PyObject *__pyx_n_s_gray18; PyObject *__pyx_n_s_gray19; PyObject *__pyx_n_s_gray2; PyObject *__pyx_n_s_gray20; PyObject *__pyx_n_s_gray21; PyObject *__pyx_n_s_gray22; PyObject *__pyx_n_s_gray23; PyObject *__pyx_n_s_gray24; PyObject *__pyx_n_s_gray25; PyObject *__pyx_n_s_gray26; PyObject *__pyx_n_s_gray27; PyObject *__pyx_n_s_gray28; PyObject *__pyx_n_s_gray29; PyObject *__pyx_n_s_gray3; PyObject *__pyx_n_s_gray30; PyObject *__pyx_n_s_gray31; PyObject *__pyx_n_s_gray32; PyObject *__pyx_n_s_gray33; PyObject *__pyx_n_s_gray34; PyObject *__pyx_n_s_gray35; PyObject *__pyx_n_s_gray36; PyObject *__pyx_n_s_gray37; PyObject *__pyx_n_s_gray38; PyObject *__pyx_n_s_gray39; PyObject *__pyx_n_s_gray4; PyObject *__pyx_n_s_gray40; PyObject *__pyx_n_s_gray41; PyObject *__pyx_n_s_gray42; PyObject *__pyx_n_s_gray43; PyObject *__pyx_n_s_gray44; PyObject *__pyx_n_s_gray45; PyObject *__pyx_n_s_gray46; PyObject *__pyx_n_s_gray47; PyObject *__pyx_n_s_gray48; PyObject *__pyx_n_s_gray49; PyObject *__pyx_n_s_gray5; PyObject *__pyx_n_s_gray50; PyObject *__pyx_n_s_gray51; PyObject *__pyx_n_s_gray52; PyObject *__pyx_n_s_gray53; PyObject *__pyx_n_s_gray54; PyObject *__pyx_n_s_gray55; PyObject *__pyx_n_s_gray56; PyObject *__pyx_n_s_gray57; PyObject *__pyx_n_s_gray58; PyObject *__pyx_n_s_gray59; PyObject *__pyx_n_s_gray6; PyObject *__pyx_n_s_gray60; PyObject *__pyx_n_s_gray61; PyObject *__pyx_n_s_gray62; PyObject *__pyx_n_s_gray63; PyObject *__pyx_n_s_gray64; PyObject *__pyx_n_s_gray65; PyObject *__pyx_n_s_gray66; PyObject *__pyx_n_s_gray67; PyObject *__pyx_n_s_gray68; PyObject *__pyx_n_s_gray69; PyObject *__pyx_n_s_gray7; PyObject *__pyx_n_s_gray70; PyObject *__pyx_n_s_gray71; PyObject *__pyx_n_s_gray72; PyObject *__pyx_n_s_gray73; PyObject *__pyx_n_s_gray74; PyObject *__pyx_n_s_gray75; PyObject *__pyx_n_s_gray76; PyObject *__pyx_n_s_gray77; PyObject *__pyx_n_s_gray78; PyObject *__pyx_n_s_gray79; PyObject *__pyx_n_s_gray8; PyObject *__pyx_n_s_gray80; PyObject *__pyx_n_s_gray81; PyObject *__pyx_n_s_gray82; PyObject *__pyx_n_s_gray83; PyObject *__pyx_n_s_gray84; PyObject *__pyx_n_s_gray85; PyObject *__pyx_n_s_gray86; PyObject *__pyx_n_s_gray87; PyObject *__pyx_n_s_gray88; PyObject *__pyx_n_s_gray89; PyObject *__pyx_n_s_gray9; PyObject *__pyx_n_s_gray90; PyObject *__pyx_n_s_gray91; PyObject *__pyx_n_s_gray92; PyObject *__pyx_n_s_gray93; PyObject *__pyx_n_s_gray94; PyObject *__pyx_n_s_gray95; PyObject *__pyx_n_s_gray96; PyObject *__pyx_n_s_gray97; PyObject *__pyx_n_s_gray98; PyObject *__pyx_n_s_gray99; PyObject *__pyx_n_s_green; PyObject *__pyx_n_s_green1; PyObject *__pyx_n_s_green2; PyObject *__pyx_n_s_green3; PyObject *__pyx_n_s_green4; PyObject *__pyx_n_s_greenyellow; PyObject *__pyx_n_s_grey; PyObject *__pyx_n_s_grey0; PyObject *__pyx_n_s_grey1; PyObject *__pyx_n_s_grey10; PyObject *__pyx_n_s_grey100; PyObject *__pyx_n_s_grey11; PyObject *__pyx_n_s_grey12; PyObject *__pyx_n_s_grey13; PyObject *__pyx_n_s_grey14; PyObject *__pyx_n_s_grey15; PyObject *__pyx_n_s_grey16; PyObject *__pyx_n_s_grey17; PyObject *__pyx_n_s_grey18; PyObject *__pyx_n_s_grey19; PyObject *__pyx_n_s_grey2; PyObject *__pyx_n_s_grey20; PyObject *__pyx_n_s_grey21; PyObject *__pyx_n_s_grey22; PyObject *__pyx_n_s_grey23; PyObject *__pyx_n_s_grey24; PyObject *__pyx_n_s_grey25; PyObject *__pyx_n_s_grey26; PyObject *__pyx_n_s_grey27; PyObject *__pyx_n_s_grey28; PyObject *__pyx_n_s_grey29; PyObject *__pyx_n_s_grey3; PyObject *__pyx_n_s_grey30; PyObject *__pyx_n_s_grey31; PyObject *__pyx_n_s_grey32; PyObject *__pyx_n_s_grey33; PyObject *__pyx_n_s_grey34; PyObject *__pyx_n_s_grey35; PyObject *__pyx_n_s_grey36; PyObject *__pyx_n_s_grey37; PyObject *__pyx_n_s_grey38; PyObject *__pyx_n_s_grey39; PyObject *__pyx_n_s_grey4; PyObject *__pyx_n_s_grey40; PyObject *__pyx_n_s_grey41; PyObject *__pyx_n_s_grey42; PyObject *__pyx_n_s_grey43; PyObject *__pyx_n_s_grey44; PyObject *__pyx_n_s_grey45; PyObject *__pyx_n_s_grey46; PyObject *__pyx_n_s_grey47; PyObject *__pyx_n_s_grey48; PyObject *__pyx_n_s_grey49; PyObject *__pyx_n_s_grey5; PyObject *__pyx_n_s_grey50; PyObject *__pyx_n_s_grey51; PyObject *__pyx_n_s_grey52; PyObject *__pyx_n_s_grey53; PyObject *__pyx_n_s_grey54; PyObject *__pyx_n_s_grey55; PyObject *__pyx_n_s_grey56; PyObject *__pyx_n_s_grey57; PyObject *__pyx_n_s_grey58; PyObject *__pyx_n_s_grey59; PyObject *__pyx_n_s_grey6; PyObject *__pyx_n_s_grey60; PyObject *__pyx_n_s_grey61; PyObject *__pyx_n_s_grey62; PyObject *__pyx_n_s_grey63; PyObject *__pyx_n_s_grey64; PyObject *__pyx_n_s_grey65; PyObject *__pyx_n_s_grey66; PyObject *__pyx_n_s_grey67; PyObject *__pyx_n_s_grey68; PyObject *__pyx_n_s_grey69; PyObject *__pyx_n_s_grey7; PyObject *__pyx_n_s_grey70; PyObject *__pyx_n_s_grey71; PyObject *__pyx_n_s_grey72; PyObject *__pyx_n_s_grey73; PyObject *__pyx_n_s_grey74; PyObject *__pyx_n_s_grey75; PyObject *__pyx_n_s_grey76; PyObject *__pyx_n_s_grey77; PyObject *__pyx_n_s_grey78; PyObject *__pyx_n_s_grey79; PyObject *__pyx_n_s_grey8; PyObject *__pyx_n_s_grey80; PyObject *__pyx_n_s_grey81; PyObject *__pyx_n_s_grey82; PyObject *__pyx_n_s_grey83; PyObject *__pyx_n_s_grey84; PyObject *__pyx_n_s_grey85; PyObject *__pyx_n_s_grey86; PyObject *__pyx_n_s_grey87; PyObject *__pyx_n_s_grey88; PyObject *__pyx_n_s_grey89; PyObject *__pyx_n_s_grey9; PyObject *__pyx_n_s_grey90; PyObject *__pyx_n_s_grey91; PyObject *__pyx_n_s_grey92; PyObject *__pyx_n_s_grey93; PyObject *__pyx_n_s_grey94; PyObject *__pyx_n_s_grey95; PyObject *__pyx_n_s_grey96; PyObject *__pyx_n_s_grey97; PyObject *__pyx_n_s_grey98; PyObject *__pyx_n_s_grey99; PyObject *__pyx_n_s_hex; PyObject *__pyx_n_s_honeydew; PyObject *__pyx_n_s_honeydew1; PyObject *__pyx_n_s_honeydew2; PyObject *__pyx_n_s_honeydew3; PyObject *__pyx_n_s_honeydew4; PyObject *__pyx_n_s_hotpink; PyObject *__pyx_n_s_hotpink1; PyObject *__pyx_n_s_hotpink2; PyObject *__pyx_n_s_hotpink3; PyObject *__pyx_n_s_hotpink4; PyObject *__pyx_n_s_hsva; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_indianred; PyObject *__pyx_n_s_indianred1; PyObject *__pyx_n_s_indianred2; PyObject *__pyx_n_s_indianred3; PyObject *__pyx_n_s_indianred4; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_ivory; PyObject *__pyx_n_s_ivory1; PyObject *__pyx_n_s_ivory2; PyObject *__pyx_n_s_ivory3; PyObject *__pyx_n_s_ivory4; PyObject *__pyx_n_s_join; PyObject *__pyx_n_s_khaki; PyObject *__pyx_n_s_khaki1; PyObject *__pyx_n_s_khaki2; PyObject *__pyx_n_s_khaki3; PyObject *__pyx_n_s_khaki4; PyObject *__pyx_n_s_l; PyObject *__pyx_n_s_lavender; PyObject *__pyx_n_s_lavenderblush; PyObject *__pyx_n_s_lavenderblush1; PyObject *__pyx_n_s_lavenderblush2; PyObject *__pyx_n_s_lavenderblush3; PyObject *__pyx_n_s_lavenderblush4; PyObject *__pyx_n_s_lawngreen; PyObject *__pyx_n_s_lemonchiffon; PyObject *__pyx_n_s_lemonchiffon1; PyObject *__pyx_n_s_lemonchiffon2; PyObject *__pyx_n_s_lemonchiffon3; PyObject *__pyx_n_s_lemonchiffon4; PyObject *__pyx_n_s_lightblue; PyObject *__pyx_n_s_lightblue1; PyObject *__pyx_n_s_lightblue2; PyObject *__pyx_n_s_lightblue3; PyObject *__pyx_n_s_lightblue4; PyObject *__pyx_n_s_lightcoral; PyObject *__pyx_n_s_lightcyan; PyObject *__pyx_n_s_lightcyan1; PyObject *__pyx_n_s_lightcyan2; PyObject *__pyx_n_s_lightcyan3; PyObject *__pyx_n_s_lightcyan4; PyObject *__pyx_n_s_lightgoldenrod; PyObject *__pyx_n_s_lightgoldenrod1; PyObject *__pyx_n_s_lightgoldenrod2; PyObject *__pyx_n_s_lightgoldenrod3; PyObject *__pyx_n_s_lightgoldenrod4; PyObject *__pyx_n_s_lightgoldenrodyellow; PyObject *__pyx_n_s_lightgray; PyObject *__pyx_n_s_lightgreen; PyObject *__pyx_n_s_lightgrey; PyObject *__pyx_n_s_lightpink; PyObject *__pyx_n_s_lightpink1; PyObject *__pyx_n_s_lightpink2; PyObject *__pyx_n_s_lightpink3; PyObject *__pyx_n_s_lightpink4; PyObject *__pyx_n_s_lightsalmon; PyObject *__pyx_n_s_lightsalmon1; PyObject *__pyx_n_s_lightsalmon2; PyObject *__pyx_n_s_lightsalmon3; PyObject *__pyx_n_s_lightsalmon4; PyObject *__pyx_n_s_lightseagreen; PyObject *__pyx_n_s_lightskyblue; PyObject *__pyx_n_s_lightskyblue1; PyObject *__pyx_n_s_lightskyblue2; PyObject *__pyx_n_s_lightskyblue3; PyObject *__pyx_n_s_lightskyblue4; PyObject *__pyx_n_s_lightslateblue; PyObject *__pyx_n_s_lightslategray; PyObject *__pyx_n_s_lightslategrey; PyObject *__pyx_n_s_lightsteelblue; PyObject *__pyx_n_s_lightsteelblue1; PyObject *__pyx_n_s_lightsteelblue2; PyObject *__pyx_n_s_lightsteelblue3; PyObject *__pyx_n_s_lightsteelblue4; PyObject *__pyx_n_s_lightyellow; PyObject *__pyx_n_s_lightyellow1; PyObject *__pyx_n_s_lightyellow2; PyObject *__pyx_n_s_lightyellow3; PyObject *__pyx_n_s_lightyellow4; PyObject *__pyx_n_s_limegreen; PyObject *__pyx_n_s_linen; PyObject *__pyx_n_s_lower; PyObject *__pyx_n_s_m; PyObject *__pyx_n_s_magenta; PyObject *__pyx_n_s_magenta1; PyObject *__pyx_n_s_magenta2; PyObject *__pyx_n_s_magenta3; PyObject *__pyx_n_s_magenta4; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_map; PyObject *__pyx_n_s_maroon; PyObject *__pyx_n_s_maroon1; PyObject *__pyx_n_s_maroon2; PyObject *__pyx_n_s_maroon3; PyObject *__pyx_n_s_maroon4; PyObject *__pyx_n_s_mediumaquamarine; PyObject *__pyx_n_s_mediumblue; PyObject *__pyx_n_s_mediumorchid; PyObject *__pyx_n_s_mediumorchid1; PyObject *__pyx_n_s_mediumorchid2; PyObject *__pyx_n_s_mediumorchid3; PyObject *__pyx_n_s_mediumorchid4; PyObject *__pyx_n_s_mediumpurple; PyObject *__pyx_n_s_mediumpurple1; PyObject *__pyx_n_s_mediumpurple2; PyObject *__pyx_n_s_mediumpurple3; PyObject *__pyx_n_s_mediumpurple4; PyObject *__pyx_n_s_mediumseagreen; PyObject *__pyx_n_s_mediumslateblue; PyObject *__pyx_n_s_mediumspringgreen; PyObject *__pyx_n_s_mediumturquoise; PyObject *__pyx_n_s_mediumvioletred; PyObject *__pyx_n_s_midnightblue; PyObject *__pyx_n_s_mintcream; PyObject *__pyx_n_s_mistyrose; PyObject *__pyx_n_s_mistyrose1; PyObject *__pyx_n_s_mistyrose2; PyObject *__pyx_n_s_mistyrose3; PyObject *__pyx_n_s_mistyrose4; PyObject *__pyx_n_s_moccasin; PyObject *__pyx_n_s_mod; PyObject *__pyx_n_s_mod___locals_mod; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_navajowhite; PyObject *__pyx_n_s_navajowhite1; PyObject *__pyx_n_s_navajowhite2; PyObject *__pyx_n_s_navajowhite3; PyObject *__pyx_n_s_navajowhite4; PyObject *__pyx_n_s_navy; PyObject *__pyx_n_s_navyblue; PyObject *__pyx_n_s_normalize; PyObject *__pyx_n_s_oct; PyObject *__pyx_n_s_oldlace; PyObject *__pyx_n_s_olivedrab; PyObject *__pyx_n_s_olivedrab1; PyObject *__pyx_n_s_olivedrab2; PyObject *__pyx_n_s_olivedrab3; PyObject *__pyx_n_s_olivedrab4; PyObject *__pyx_n_s_orange; PyObject *__pyx_n_s_orange1; PyObject *__pyx_n_s_orange2; PyObject *__pyx_n_s_orange3; PyObject *__pyx_n_s_orange4; PyObject *__pyx_n_s_orangered; PyObject *__pyx_n_s_orangered1; PyObject *__pyx_n_s_orangered2; PyObject *__pyx_n_s_orangered3; PyObject *__pyx_n_s_orangered4; PyObject *__pyx_n_s_orchid; PyObject *__pyx_n_s_orchid1; PyObject *__pyx_n_s_orchid2; PyObject *__pyx_n_s_orchid3; PyObject *__pyx_n_s_orchid4; PyObject *__pyx_n_s_pack; PyObject *__pyx_n_s_palegoldenrod; PyObject *__pyx_n_s_palegreen; PyObject *__pyx_n_s_palegreen1; PyObject *__pyx_n_s_palegreen2; PyObject *__pyx_n_s_palegreen3; PyObject *__pyx_n_s_palegreen4; PyObject *__pyx_n_s_paleturquoise; PyObject *__pyx_n_s_paleturquoise1; PyObject *__pyx_n_s_paleturquoise2; PyObject *__pyx_n_s_paleturquoise3; PyObject *__pyx_n_s_paleturquoise4; PyObject *__pyx_n_s_palevioletred; PyObject *__pyx_n_s_palevioletred1; PyObject *__pyx_n_s_palevioletred2; PyObject *__pyx_n_s_palevioletred3; PyObject *__pyx_n_s_palevioletred4; PyObject *__pyx_n_s_papayawhip; PyObject *__pyx_n_s_peachpuff; PyObject *__pyx_n_s_peachpuff1; PyObject *__pyx_n_s_peachpuff2; PyObject *__pyx_n_s_peachpuff3; PyObject *__pyx_n_s_peachpuff4; PyObject *__pyx_n_s_peru; PyObject *__pyx_n_s_pink; PyObject *__pyx_n_s_pink1; PyObject *__pyx_n_s_pink2; PyObject *__pyx_n_s_pink3; PyObject *__pyx_n_s_pink4; PyObject *__pyx_n_s_plum; PyObject *__pyx_n_s_plum1; PyObject *__pyx_n_s_plum2; PyObject *__pyx_n_s_plum3; PyObject *__pyx_n_s_plum4; PyObject *__pyx_n_s_powderblue; PyObject *__pyx_n_s_purple; PyObject *__pyx_n_s_purple1; PyObject *__pyx_n_s_purple2; PyObject *__pyx_n_s_purple3; PyObject *__pyx_n_s_purple4; PyObject *__pyx_n_s_pygame_sdl2_color; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_red; PyObject *__pyx_n_s_red1; PyObject *__pyx_n_s_red2; PyObject *__pyx_n_s_red3; PyObject *__pyx_n_s_red4; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_rgba; PyObject *__pyx_n_s_rosybrown; PyObject *__pyx_n_s_rosybrown1; PyObject *__pyx_n_s_rosybrown2; PyObject *__pyx_n_s_rosybrown3; PyObject *__pyx_n_s_rosybrown4; PyObject *__pyx_n_s_round; PyObject *__pyx_n_s_royalblue; PyObject *__pyx_n_s_royalblue1; PyObject *__pyx_n_s_royalblue2; PyObject *__pyx_n_s_royalblue3; PyObject *__pyx_n_s_royalblue4; PyObject *__pyx_n_s_saddlebrown; PyObject *__pyx_n_s_salmon; PyObject *__pyx_n_s_salmon1; PyObject *__pyx_n_s_salmon2; PyObject *__pyx_n_s_salmon3; PyObject *__pyx_n_s_salmon4; PyObject *__pyx_n_s_sandybrown; PyObject *__pyx_n_s_seagreen; PyObject *__pyx_n_s_seagreen1; PyObject *__pyx_n_s_seagreen2; PyObject *__pyx_n_s_seagreen3; PyObject *__pyx_n_s_seagreen4; PyObject *__pyx_n_s_seashell; PyObject *__pyx_n_s_seashell1; PyObject *__pyx_n_s_seashell2; PyObject *__pyx_n_s_seashell3; PyObject *__pyx_n_s_seashell4; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_length; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_sienna; PyObject *__pyx_n_s_sienna1; PyObject *__pyx_n_s_sienna2; PyObject *__pyx_n_s_sienna3; PyObject *__pyx_n_s_sienna4; PyObject *__pyx_n_s_skyblue; PyObject *__pyx_n_s_skyblue1; PyObject *__pyx_n_s_skyblue2; PyObject *__pyx_n_s_skyblue3; PyObject *__pyx_n_s_skyblue4; PyObject *__pyx_n_s_slateblue; PyObject *__pyx_n_s_slateblue1; PyObject *__pyx_n_s_slateblue2; PyObject *__pyx_n_s_slateblue3; PyObject *__pyx_n_s_slateblue4; PyObject *__pyx_n_s_slategray; PyObject *__pyx_n_s_slategray1; PyObject *__pyx_n_s_slategray2; PyObject *__pyx_n_s_slategray3; PyObject *__pyx_n_s_slategray4; PyObject *__pyx_n_s_slategrey; PyObject *__pyx_n_s_snow; PyObject *__pyx_n_s_snow1; PyObject *__pyx_n_s_snow2; PyObject *__pyx_n_s_snow3; PyObject *__pyx_n_s_snow4; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_split; PyObject *__pyx_n_s_springgreen; PyObject *__pyx_n_s_springgreen1; PyObject *__pyx_n_s_springgreen2; PyObject *__pyx_n_s_springgreen3; PyObject *__pyx_n_s_springgreen4; PyObject *__pyx_kp_s_src_pygame_sdl2_color_pyx; PyObject *__pyx_n_s_startswith; PyObject *__pyx_n_s_steelblue; PyObject *__pyx_n_s_steelblue1; PyObject *__pyx_n_s_steelblue2; PyObject *__pyx_n_s_steelblue3; PyObject *__pyx_n_s_steelblue4; PyObject *__pyx_n_s_struct; PyObject *__pyx_n_s_tan; PyObject *__pyx_n_s_tan1; PyObject *__pyx_n_s_tan2; PyObject *__pyx_n_s_tan3; PyObject *__pyx_n_s_tan4; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_thistle; PyObject *__pyx_n_s_thistle1; PyObject *__pyx_n_s_thistle2; PyObject *__pyx_n_s_thistle3; PyObject *__pyx_n_s_thistle4; PyObject *__pyx_n_s_tomato; PyObject *__pyx_n_s_tomato1; PyObject *__pyx_n_s_tomato2; PyObject *__pyx_n_s_tomato3; PyObject *__pyx_n_s_tomato4; PyObject *__pyx_n_s_turquoise; PyObject *__pyx_n_s_turquoise1; PyObject *__pyx_n_s_turquoise2; PyObject *__pyx_n_s_turquoise3; PyObject *__pyx_n_s_turquoise4; PyObject *__pyx_n_s_unhexlify; PyObject *__pyx_n_s_unpack; PyObject *__pyx_n_s_violet; PyObject *__pyx_n_s_violetred; PyObject *__pyx_n_s_violetred1; PyObject *__pyx_n_s_violetred2; PyObject *__pyx_n_s_violetred3; PyObject *__pyx_n_s_violetred4; PyObject *__pyx_n_s_wheat; PyObject *__pyx_n_s_wheat1; PyObject *__pyx_n_s_wheat2; PyObject *__pyx_n_s_wheat3; PyObject *__pyx_n_s_wheat4; PyObject *__pyx_n_s_white; PyObject *__pyx_n_s_whitesmoke; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_yellow; PyObject *__pyx_n_s_yellow1; PyObject *__pyx_n_s_yellow2; PyObject *__pyx_n_s_yellow3; PyObject *__pyx_n_s_yellow4; PyObject *__pyx_n_s_yellowgreen; PyObject *__pyx_float_255_0; PyObject *__pyx_float_360_0; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_2; PyObject *__pyx_int_3; PyObject *__pyx_int_4; PyObject *__pyx_int_5; PyObject *__pyx_int_7; PyObject *__pyx_int_8; PyObject *__pyx_int_10; PyObject *__pyx_int_11; PyObject *__pyx_int_12; PyObject *__pyx_int_13; PyObject *__pyx_int_14; PyObject *__pyx_int_15; PyObject *__pyx_int_16; PyObject *__pyx_int_18; PyObject *__pyx_int_19; PyObject *__pyx_int_20; PyObject *__pyx_int_21; PyObject *__pyx_int_23; PyObject *__pyx_int_24; PyObject *__pyx_int_25; PyObject *__pyx_int_26; PyObject *__pyx_int_28; PyObject *__pyx_int_29; PyObject *__pyx_int_30; PyObject *__pyx_int_31; PyObject *__pyx_int_32; PyObject *__pyx_int_33; PyObject *__pyx_int_34; PyObject *__pyx_int_35; PyObject *__pyx_int_36; PyObject *__pyx_int_37; PyObject *__pyx_int_38; PyObject *__pyx_int_39; PyObject *__pyx_int_41; PyObject *__pyx_int_42; PyObject *__pyx_int_43; PyObject *__pyx_int_44; PyObject *__pyx_int_45; PyObject *__pyx_int_46; PyObject *__pyx_int_47; PyObject *__pyx_int_48; PyObject *__pyx_int_50; PyObject *__pyx_int_51; PyObject *__pyx_int_52; PyObject *__pyx_int_54; PyObject *__pyx_int_55; PyObject *__pyx_int_56; PyObject *__pyx_int_57; PyObject *__pyx_int_58; PyObject *__pyx_int_59; PyObject *__pyx_int_60; PyObject *__pyx_int_61; PyObject *__pyx_int_62; PyObject *__pyx_int_63; PyObject *__pyx_int_64; PyObject *__pyx_int_65; PyObject *__pyx_int_66; PyObject *__pyx_int_67; PyObject *__pyx_int_69; PyObject *__pyx_int_70; PyObject *__pyx_int_71; PyObject *__pyx_int_72; PyObject *__pyx_int_73; PyObject *__pyx_int_74; PyObject *__pyx_int_76; PyObject *__pyx_int_77; PyObject *__pyx_int_78; PyObject *__pyx_int_79; PyObject *__pyx_int_80; PyObject *__pyx_int_81; PyObject *__pyx_int_82; PyObject *__pyx_int_83; PyObject *__pyx_int_84; PyObject *__pyx_int_85; PyObject *__pyx_int_86; PyObject *__pyx_int_87; PyObject *__pyx_int_89; PyObject *__pyx_int_90; PyObject *__pyx_int_91; PyObject *__pyx_int_92; PyObject *__pyx_int_93; PyObject *__pyx_int_94; PyObject *__pyx_int_95; PyObject *__pyx_int_96; PyObject *__pyx_int_97; PyObject *__pyx_int_98; PyObject *__pyx_int_99; PyObject *__pyx_int_100; PyObject *__pyx_int_101; PyObject *__pyx_int_102; PyObject *__pyx_int_103; PyObject *__pyx_int_104; PyObject *__pyx_int_105; PyObject *__pyx_int_106; PyObject *__pyx_int_107; PyObject *__pyx_int_108; PyObject *__pyx_int_110; PyObject *__pyx_int_111; PyObject *__pyx_int_112; PyObject *__pyx_int_113; PyObject *__pyx_int_114; PyObject *__pyx_int_115; PyObject *__pyx_int_116; PyObject *__pyx_int_117; PyObject *__pyx_int_118; PyObject *__pyx_int_119; PyObject *__pyx_int_120; PyObject *__pyx_int_121; PyObject *__pyx_int_122; PyObject *__pyx_int_123; PyObject *__pyx_int_124; PyObject *__pyx_int_125; PyObject *__pyx_int_126; PyObject *__pyx_int_127; PyObject *__pyx_int_128; PyObject *__pyx_int_129; PyObject *__pyx_int_130; PyObject *__pyx_int_131; PyObject *__pyx_int_132; PyObject *__pyx_int_133; PyObject *__pyx_int_134; PyObject *__pyx_int_135; PyObject *__pyx_int_136; PyObject *__pyx_int_137; PyObject *__pyx_int_138; PyObject *__pyx_int_139; PyObject *__pyx_int_140; PyObject *__pyx_int_141; PyObject *__pyx_int_142; PyObject *__pyx_int_143; PyObject *__pyx_int_144; PyObject *__pyx_int_145; PyObject *__pyx_int_147; PyObject *__pyx_int_148; PyObject *__pyx_int_149; PyObject *__pyx_int_150; PyObject *__pyx_int_151; PyObject *__pyx_int_152; PyObject *__pyx_int_153; PyObject *__pyx_int_154; PyObject *__pyx_int_155; PyObject *__pyx_int_156; PyObject *__pyx_int_158; PyObject *__pyx_int_159; PyObject *__pyx_int_160; PyObject *__pyx_int_161; PyObject *__pyx_int_162; PyObject *__pyx_int_163; PyObject *__pyx_int_164; PyObject *__pyx_int_165; PyObject *__pyx_int_166; PyObject *__pyx_int_167; PyObject *__pyx_int_168; PyObject *__pyx_int_169; PyObject *__pyx_int_170; PyObject *__pyx_int_171; PyObject *__pyx_int_172; PyObject *__pyx_int_173; PyObject *__pyx_int_174; PyObject *__pyx_int_175; PyObject *__pyx_int_176; PyObject *__pyx_int_177; PyObject *__pyx_int_178; PyObject *__pyx_int_179; PyObject *__pyx_int_180; PyObject *__pyx_int_181; PyObject *__pyx_int_182; PyObject *__pyx_int_183; PyObject *__pyx_int_184; PyObject *__pyx_int_185; PyObject *__pyx_int_186; PyObject *__pyx_int_187; PyObject *__pyx_int_188; PyObject *__pyx_int_189; PyObject *__pyx_int_190; PyObject *__pyx_int_191; PyObject *__pyx_int_192; PyObject *__pyx_int_193; PyObject *__pyx_int_194; PyObject *__pyx_int_196; PyObject *__pyx_int_197; PyObject *__pyx_int_198; PyObject *__pyx_int_199; PyObject *__pyx_int_200; PyObject *__pyx_int_201; PyObject *__pyx_int_202; PyObject *__pyx_int_203; PyObject *__pyx_int_204; PyObject *__pyx_int_205; PyObject *__pyx_int_206; PyObject *__pyx_int_207; PyObject *__pyx_int_208; PyObject *__pyx_int_209; PyObject *__pyx_int_210; PyObject *__pyx_int_211; PyObject *__pyx_int_212; PyObject *__pyx_int_213; PyObject *__pyx_int_214; PyObject *__pyx_int_215; PyObject *__pyx_int_216; PyObject *__pyx_int_217; PyObject *__pyx_int_218; PyObject *__pyx_int_219; PyObject *__pyx_int_220; PyObject *__pyx_int_221; PyObject *__pyx_int_222; PyObject *__pyx_int_223; PyObject *__pyx_int_224; PyObject *__pyx_int_225; PyObject *__pyx_int_226; PyObject *__pyx_int_227; PyObject *__pyx_int_228; PyObject *__pyx_int_229; PyObject *__pyx_int_230; PyObject *__pyx_int_231; PyObject *__pyx_int_232; PyObject *__pyx_int_233; PyObject *__pyx_int_235; PyObject *__pyx_int_236; PyObject *__pyx_int_237; PyObject *__pyx_int_238; PyObject *__pyx_int_239; PyObject *__pyx_int_240; PyObject *__pyx_int_242; PyObject *__pyx_int_244; PyObject *__pyx_int_245; PyObject *__pyx_int_246; PyObject *__pyx_int_247; PyObject *__pyx_int_248; PyObject *__pyx_int_250; PyObject *__pyx_int_251; PyObject *__pyx_int_252; PyObject *__pyx_int_253; PyObject *__pyx_int_255; PyObject *__pyx_tuple_; PyObject *__pyx_slice__4; PyObject *__pyx_slice__5; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__26; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__32; PyObject *__pyx_tuple__33; PyObject *__pyx_tuple__34; PyObject *__pyx_tuple__35; PyObject *__pyx_tuple__36; PyObject *__pyx_tuple__37; PyObject *__pyx_tuple__38; PyObject *__pyx_tuple__39; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__41; PyObject *__pyx_tuple__42; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__44; PyObject *__pyx_tuple__45; PyObject *__pyx_tuple__46; PyObject *__pyx_tuple__47; PyObject *__pyx_tuple__48; PyObject *__pyx_tuple__49; PyObject *__pyx_tuple__50; PyObject *__pyx_tuple__51; PyObject *__pyx_tuple__52; PyObject *__pyx_tuple__53; PyObject *__pyx_tuple__54; PyObject *__pyx_tuple__55; PyObject *__pyx_tuple__56; PyObject *__pyx_tuple__57; PyObject *__pyx_tuple__58; PyObject *__pyx_tuple__59; PyObject *__pyx_tuple__60; PyObject *__pyx_tuple__61; PyObject *__pyx_tuple__62; PyObject *__pyx_tuple__63; PyObject *__pyx_tuple__64; PyObject *__pyx_tuple__65; PyObject *__pyx_tuple__66; PyObject *__pyx_tuple__67; PyObject *__pyx_tuple__68; PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__70; PyObject *__pyx_tuple__71; PyObject *__pyx_tuple__72; PyObject *__pyx_tuple__73; PyObject *__pyx_tuple__74; PyObject *__pyx_tuple__75; PyObject *__pyx_tuple__76; PyObject *__pyx_tuple__77; PyObject *__pyx_tuple__78; PyObject *__pyx_tuple__79; PyObject *__pyx_tuple__80; PyObject *__pyx_tuple__81; PyObject *__pyx_tuple__82; PyObject *__pyx_tuple__83; PyObject *__pyx_tuple__84; PyObject *__pyx_tuple__85; PyObject *__pyx_tuple__86; PyObject *__pyx_tuple__87; PyObject *__pyx_tuple__88; PyObject *__pyx_tuple__89; PyObject *__pyx_tuple__90; PyObject *__pyx_tuple__91; PyObject *__pyx_tuple__92; PyObject *__pyx_tuple__93; PyObject *__pyx_tuple__94; PyObject *__pyx_tuple__95; PyObject *__pyx_tuple__96; PyObject *__pyx_tuple__97; PyObject *__pyx_tuple__98; PyObject *__pyx_tuple__99; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; PyObject *__pyx_tuple__100; PyObject *__pyx_tuple__101; PyObject *__pyx_tuple__102; PyObject *__pyx_tuple__103; PyObject *__pyx_tuple__104; PyObject *__pyx_tuple__105; PyObject *__pyx_tuple__106; PyObject *__pyx_tuple__107; PyObject *__pyx_tuple__108; PyObject *__pyx_tuple__109; PyObject *__pyx_tuple__110; PyObject *__pyx_tuple__111; PyObject *__pyx_tuple__112; PyObject *__pyx_tuple__113; PyObject *__pyx_tuple__114; PyObject *__pyx_tuple__115; PyObject *__pyx_tuple__116; PyObject *__pyx_tuple__117; PyObject *__pyx_tuple__118; PyObject *__pyx_tuple__119; PyObject *__pyx_tuple__120; PyObject *__pyx_tuple__121; PyObject *__pyx_tuple__122; PyObject *__pyx_tuple__123; PyObject *__pyx_tuple__124; PyObject *__pyx_tuple__125; PyObject *__pyx_tuple__126; PyObject *__pyx_tuple__127; PyObject *__pyx_tuple__128; PyObject *__pyx_tuple__129; PyObject *__pyx_tuple__130; PyObject *__pyx_tuple__131; PyObject *__pyx_tuple__132; PyObject *__pyx_tuple__133; PyObject *__pyx_tuple__134; PyObject *__pyx_tuple__135; PyObject *__pyx_tuple__136; PyObject *__pyx_tuple__137; PyObject *__pyx_tuple__138; PyObject *__pyx_tuple__139; PyObject *__pyx_tuple__140; PyObject *__pyx_tuple__141; PyObject *__pyx_tuple__142; PyObject *__pyx_tuple__143; PyObject *__pyx_tuple__144; PyObject *__pyx_tuple__145; PyObject *__pyx_tuple__146; PyObject *__pyx_tuple__147; PyObject *__pyx_tuple__148; PyObject *__pyx_tuple__149; PyObject *__pyx_tuple__150; PyObject *__pyx_tuple__151; PyObject *__pyx_tuple__152; PyObject *__pyx_tuple__153; PyObject *__pyx_tuple__154; PyObject *__pyx_tuple__155; PyObject *__pyx_tuple__156; PyObject *__pyx_tuple__157; PyObject *__pyx_tuple__158; PyObject *__pyx_tuple__159; PyObject *__pyx_tuple__160; PyObject *__pyx_tuple__161; PyObject *__pyx_tuple__162; PyObject *__pyx_tuple__163; PyObject *__pyx_tuple__164; PyObject *__pyx_tuple__165; PyObject *__pyx_tuple__166; PyObject *__pyx_tuple__167; PyObject *__pyx_tuple__168; PyObject *__pyx_tuple__169; PyObject *__pyx_tuple__170; PyObject *__pyx_tuple__171; PyObject *__pyx_tuple__172; PyObject *__pyx_tuple__173; PyObject *__pyx_tuple__174; PyObject *__pyx_tuple__175; PyObject *__pyx_tuple__176; PyObject *__pyx_tuple__177; PyObject *__pyx_tuple__178; PyObject *__pyx_tuple__179; PyObject *__pyx_tuple__180; PyObject *__pyx_tuple__181; PyObject *__pyx_tuple__182; PyObject *__pyx_tuple__183; PyObject *__pyx_tuple__184; PyObject *__pyx_tuple__185; PyObject *__pyx_tuple__186; PyObject *__pyx_tuple__187; PyObject *__pyx_tuple__188; PyObject *__pyx_tuple__189; PyObject *__pyx_tuple__190; PyObject *__pyx_tuple__191; PyObject *__pyx_tuple__192; PyObject *__pyx_tuple__193; PyObject *__pyx_tuple__194; PyObject *__pyx_tuple__195; PyObject *__pyx_tuple__196; PyObject *__pyx_tuple__197; PyObject *__pyx_tuple__198; PyObject *__pyx_tuple__199; PyObject *__pyx_tuple__200; PyObject *__pyx_tuple__201; PyObject *__pyx_tuple__202; PyObject *__pyx_tuple__203; PyObject *__pyx_tuple__204; PyObject *__pyx_tuple__205; PyObject *__pyx_tuple__206; PyObject *__pyx_tuple__207; PyObject *__pyx_tuple__208; PyObject *__pyx_tuple__209; PyObject *__pyx_tuple__210; PyObject *__pyx_tuple__211; PyObject *__pyx_tuple__212; PyObject *__pyx_tuple__213; PyObject *__pyx_tuple__214; PyObject *__pyx_tuple__215; PyObject *__pyx_tuple__216; PyObject *__pyx_tuple__217; PyObject *__pyx_tuple__218; PyObject *__pyx_tuple__219; PyObject *__pyx_tuple__220; PyObject *__pyx_tuple__221; PyObject *__pyx_tuple__222; PyObject *__pyx_tuple__223; PyObject *__pyx_tuple__224; PyObject *__pyx_tuple__225; PyObject *__pyx_tuple__226; PyObject *__pyx_tuple__227; PyObject *__pyx_tuple__228; PyObject *__pyx_tuple__229; PyObject *__pyx_tuple__230; PyObject *__pyx_tuple__231; PyObject *__pyx_tuple__232; PyObject *__pyx_tuple__233; PyObject *__pyx_tuple__234; PyObject *__pyx_tuple__235; PyObject *__pyx_tuple__236; PyObject *__pyx_tuple__237; PyObject *__pyx_tuple__238; PyObject *__pyx_tuple__239; PyObject *__pyx_tuple__240; PyObject *__pyx_tuple__241; PyObject *__pyx_tuple__242; PyObject *__pyx_tuple__243; PyObject *__pyx_tuple__244; PyObject *__pyx_tuple__245; PyObject *__pyx_tuple__246; PyObject *__pyx_tuple__247; PyObject *__pyx_tuple__248; PyObject *__pyx_tuple__249; PyObject *__pyx_tuple__250; PyObject *__pyx_tuple__251; PyObject *__pyx_tuple__252; PyObject *__pyx_tuple__253; PyObject *__pyx_tuple__254; PyObject *__pyx_tuple__255; PyObject *__pyx_tuple__256; PyObject *__pyx_tuple__257; PyObject *__pyx_tuple__258; PyObject *__pyx_tuple__259; PyObject *__pyx_tuple__260; PyObject *__pyx_tuple__261; PyObject *__pyx_tuple__262; PyObject *__pyx_tuple__263; PyObject *__pyx_tuple__264; PyObject *__pyx_tuple__265; PyObject *__pyx_tuple__266; PyObject *__pyx_tuple__267; PyObject *__pyx_tuple__268; PyObject *__pyx_tuple__269; PyObject *__pyx_tuple__270; PyObject *__pyx_tuple__271; PyObject *__pyx_tuple__272; PyObject *__pyx_tuple__273; PyObject *__pyx_tuple__274; PyObject *__pyx_tuple__275; PyObject *__pyx_tuple__276; PyObject *__pyx_tuple__277; PyObject *__pyx_tuple__278; PyObject *__pyx_tuple__279; PyObject *__pyx_tuple__280; PyObject *__pyx_tuple__281; PyObject *__pyx_tuple__282; PyObject *__pyx_tuple__283; PyObject *__pyx_tuple__284; PyObject *__pyx_tuple__285; PyObject *__pyx_tuple__286; PyObject *__pyx_tuple__287; PyObject *__pyx_tuple__288; PyObject *__pyx_tuple__289; PyObject *__pyx_tuple__290; PyObject *__pyx_tuple__291; PyObject *__pyx_tuple__292; PyObject *__pyx_tuple__293; PyObject *__pyx_tuple__294; PyObject *__pyx_tuple__295; PyObject *__pyx_tuple__296; PyObject *__pyx_tuple__297; PyObject *__pyx_tuple__298; PyObject *__pyx_tuple__299; PyObject *__pyx_tuple__300; PyObject *__pyx_tuple__301; PyObject *__pyx_tuple__302; PyObject *__pyx_tuple__303; PyObject *__pyx_tuple__304; PyObject *__pyx_tuple__305; PyObject *__pyx_tuple__306; PyObject *__pyx_tuple__307; PyObject *__pyx_tuple__308; PyObject *__pyx_tuple__309; PyObject *__pyx_tuple__310; PyObject *__pyx_tuple__311; PyObject *__pyx_tuple__312; PyObject *__pyx_tuple__313; PyObject *__pyx_tuple__314; PyObject *__pyx_tuple__315; PyObject *__pyx_tuple__316; PyObject *__pyx_tuple__317; PyObject *__pyx_tuple__318; PyObject *__pyx_tuple__319; PyObject *__pyx_tuple__320; PyObject *__pyx_tuple__321; PyObject *__pyx_tuple__322; PyObject *__pyx_tuple__323; PyObject *__pyx_tuple__324; PyObject *__pyx_tuple__325; PyObject *__pyx_tuple__326; PyObject *__pyx_tuple__327; PyObject *__pyx_tuple__328; PyObject *__pyx_tuple__329; PyObject *__pyx_tuple__330; PyObject *__pyx_tuple__331; PyObject *__pyx_tuple__332; PyObject *__pyx_tuple__333; PyObject *__pyx_tuple__334; PyObject *__pyx_tuple__335; PyObject *__pyx_tuple__336; PyObject *__pyx_tuple__337; PyObject *__pyx_tuple__338; PyObject *__pyx_tuple__339; PyObject *__pyx_tuple__340; PyObject *__pyx_tuple__341; PyObject *__pyx_tuple__342; PyObject *__pyx_tuple__343; PyObject *__pyx_tuple__344; PyObject *__pyx_tuple__345; PyObject *__pyx_tuple__346; PyObject *__pyx_tuple__347; PyObject *__pyx_tuple__348; PyObject *__pyx_tuple__349; PyObject *__pyx_tuple__350; PyObject *__pyx_tuple__351; PyObject *__pyx_tuple__352; PyObject *__pyx_tuple__353; PyObject *__pyx_tuple__354; PyObject *__pyx_tuple__355; PyObject *__pyx_tuple__356; PyObject *__pyx_tuple__357; PyObject *__pyx_tuple__358; PyObject *__pyx_tuple__359; PyObject *__pyx_tuple__360; PyObject *__pyx_tuple__361; PyObject *__pyx_tuple__362; PyObject *__pyx_tuple__363; PyObject *__pyx_tuple__364; PyObject *__pyx_tuple__365; PyObject *__pyx_tuple__366; PyObject *__pyx_tuple__367; PyObject *__pyx_tuple__368; PyObject *__pyx_tuple__369; PyObject *__pyx_tuple__370; PyObject *__pyx_tuple__371; PyObject *__pyx_tuple__372; PyObject *__pyx_tuple__373; PyObject *__pyx_tuple__374; PyObject *__pyx_tuple__375; PyObject *__pyx_tuple__376; PyObject *__pyx_tuple__377; PyObject *__pyx_tuple__378; PyObject *__pyx_tuple__379; PyObject *__pyx_tuple__380; PyObject *__pyx_tuple__381; PyObject *__pyx_tuple__382; PyObject *__pyx_tuple__383; PyObject *__pyx_tuple__384; PyObject *__pyx_tuple__385; PyObject *__pyx_tuple__386; PyObject *__pyx_tuple__387; PyObject *__pyx_tuple__388; PyObject *__pyx_tuple__389; PyObject *__pyx_tuple__390; PyObject *__pyx_tuple__391; PyObject *__pyx_tuple__392; PyObject *__pyx_tuple__393; PyObject *__pyx_tuple__394; PyObject *__pyx_tuple__395; PyObject *__pyx_tuple__396; PyObject *__pyx_tuple__397; PyObject *__pyx_tuple__398; PyObject *__pyx_tuple__399; PyObject *__pyx_tuple__400; PyObject *__pyx_tuple__401; PyObject *__pyx_tuple__402; PyObject *__pyx_tuple__403; PyObject *__pyx_tuple__404; PyObject *__pyx_tuple__405; PyObject *__pyx_tuple__406; PyObject *__pyx_tuple__407; PyObject *__pyx_tuple__408; PyObject *__pyx_tuple__409; PyObject *__pyx_tuple__410; PyObject *__pyx_tuple__411; PyObject *__pyx_tuple__412; PyObject *__pyx_tuple__413; PyObject *__pyx_tuple__414; PyObject *__pyx_tuple__415; PyObject *__pyx_tuple__416; PyObject *__pyx_tuple__417; PyObject *__pyx_tuple__418; PyObject *__pyx_tuple__419; PyObject *__pyx_tuple__420; PyObject *__pyx_tuple__421; PyObject *__pyx_tuple__422; PyObject *__pyx_tuple__423; PyObject *__pyx_tuple__424; PyObject *__pyx_tuple__425; PyObject *__pyx_tuple__426; PyObject *__pyx_tuple__427; PyObject *__pyx_tuple__428; PyObject *__pyx_tuple__429; PyObject *__pyx_tuple__430; PyObject *__pyx_tuple__431; PyObject *__pyx_tuple__432; PyObject *__pyx_tuple__433; PyObject *__pyx_tuple__434; PyObject *__pyx_tuple__435; PyObject *__pyx_tuple__436; PyObject *__pyx_tuple__437; PyObject *__pyx_tuple__438; PyObject *__pyx_tuple__439; PyObject *__pyx_tuple__440; PyObject *__pyx_tuple__441; PyObject *__pyx_tuple__442; PyObject *__pyx_tuple__443; PyObject *__pyx_tuple__444; PyObject *__pyx_tuple__445; PyObject *__pyx_tuple__446; PyObject *__pyx_tuple__447; PyObject *__pyx_tuple__448; PyObject *__pyx_tuple__449; PyObject *__pyx_tuple__450; PyObject *__pyx_tuple__451; PyObject *__pyx_tuple__452; PyObject *__pyx_tuple__453; PyObject *__pyx_tuple__454; PyObject *__pyx_tuple__455; PyObject *__pyx_tuple__456; PyObject *__pyx_tuple__457; PyObject *__pyx_tuple__458; PyObject *__pyx_tuple__459; PyObject *__pyx_tuple__460; PyObject *__pyx_tuple__461; PyObject *__pyx_tuple__462; PyObject *__pyx_tuple__463; PyObject *__pyx_tuple__464; PyObject *__pyx_tuple__465; PyObject *__pyx_tuple__466; PyObject *__pyx_tuple__467; PyObject *__pyx_tuple__468; PyObject *__pyx_tuple__469; PyObject *__pyx_tuple__470; PyObject *__pyx_tuple__471; PyObject *__pyx_tuple__472; PyObject *__pyx_tuple__473; PyObject *__pyx_tuple__474; PyObject *__pyx_tuple__475; PyObject *__pyx_tuple__476; PyObject *__pyx_tuple__477; PyObject *__pyx_tuple__478; PyObject *__pyx_tuple__479; PyObject *__pyx_tuple__480; PyObject *__pyx_tuple__481; PyObject *__pyx_tuple__482; PyObject *__pyx_tuple__483; PyObject *__pyx_tuple__484; PyObject *__pyx_tuple__485; PyObject *__pyx_tuple__486; PyObject *__pyx_tuple__487; PyObject *__pyx_tuple__488; PyObject *__pyx_tuple__489; PyObject *__pyx_tuple__490; PyObject *__pyx_tuple__491; PyObject *__pyx_tuple__492; PyObject *__pyx_tuple__493; PyObject *__pyx_tuple__494; PyObject *__pyx_tuple__495; PyObject *__pyx_tuple__496; PyObject *__pyx_tuple__497; PyObject *__pyx_tuple__498; PyObject *__pyx_tuple__499; PyObject *__pyx_tuple__500; PyObject *__pyx_tuple__501; PyObject *__pyx_tuple__502; PyObject *__pyx_tuple__503; PyObject *__pyx_tuple__504; PyObject *__pyx_tuple__505; PyObject *__pyx_tuple__506; PyObject *__pyx_tuple__507; PyObject *__pyx_tuple__508; PyObject *__pyx_tuple__509; PyObject *__pyx_tuple__510; PyObject *__pyx_tuple__511; PyObject *__pyx_tuple__512; PyObject *__pyx_tuple__513; PyObject *__pyx_tuple__514; PyObject *__pyx_tuple__517; PyObject *__pyx_tuple__519; PyObject *__pyx_tuple__521; PyObject *__pyx_codeobj__515; PyObject *__pyx_codeobj__516; PyObject *__pyx_codeobj__518; PyObject *__pyx_codeobj__520; PyObject *__pyx_codeobj__522; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_5color_Color); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma); Py_CLEAR(clear_module_state->__pyx_kp_s_08x); Py_CLEAR(clear_module_state->__pyx_kp_s_0x); Py_CLEAR(clear_module_state->__pyx_n_s_BBB); Py_CLEAR(clear_module_state->__pyx_n_s_BBBB); Py_CLEAR(clear_module_state->__pyx_n_s_Color); Py_CLEAR(clear_module_state->__pyx_n_s_Color___reduce); Py_CLEAR(clear_module_state->__pyx_n_s_Color___setstate); Py_CLEAR(clear_module_state->__pyx_n_s_Color_correct_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_Color_from_hex_locals_lambda); Py_CLEAR(clear_module_state->__pyx_n_s_Color_normalize); Py_CLEAR(clear_module_state->__pyx_n_s_Color_set_length); Py_CLEAR(clear_module_state->__pyx_kp_s_Expected_a_color); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); Py_CLEAR(clear_module_state->__pyx_kp_s_L); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_n_s__10); Py_CLEAR(clear_module_state->__pyx_kp_s__2); Py_CLEAR(clear_module_state->__pyx_kp_s__3); Py_CLEAR(clear_module_state->__pyx_n_s__523); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_s_aliceblue); Py_CLEAR(clear_module_state->__pyx_n_s_antiquewhite); Py_CLEAR(clear_module_state->__pyx_n_s_antiquewhite1); Py_CLEAR(clear_module_state->__pyx_n_s_antiquewhite2); Py_CLEAR(clear_module_state->__pyx_n_s_antiquewhite3); Py_CLEAR(clear_module_state->__pyx_n_s_antiquewhite4); Py_CLEAR(clear_module_state->__pyx_n_s_aquamarine); Py_CLEAR(clear_module_state->__pyx_n_s_aquamarine1); Py_CLEAR(clear_module_state->__pyx_n_s_aquamarine2); Py_CLEAR(clear_module_state->__pyx_n_s_aquamarine3); Py_CLEAR(clear_module_state->__pyx_n_s_aquamarine4); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_azure); Py_CLEAR(clear_module_state->__pyx_n_s_azure1); Py_CLEAR(clear_module_state->__pyx_n_s_azure2); Py_CLEAR(clear_module_state->__pyx_n_s_azure3); Py_CLEAR(clear_module_state->__pyx_n_s_azure4); Py_CLEAR(clear_module_state->__pyx_n_s_b); Py_CLEAR(clear_module_state->__pyx_n_s_beige); Py_CLEAR(clear_module_state->__pyx_n_s_binascii); Py_CLEAR(clear_module_state->__pyx_n_s_bisque); Py_CLEAR(clear_module_state->__pyx_n_s_bisque1); Py_CLEAR(clear_module_state->__pyx_n_s_bisque2); Py_CLEAR(clear_module_state->__pyx_n_s_bisque3); Py_CLEAR(clear_module_state->__pyx_n_s_bisque4); Py_CLEAR(clear_module_state->__pyx_n_s_black); Py_CLEAR(clear_module_state->__pyx_n_s_blanchedalmond); Py_CLEAR(clear_module_state->__pyx_n_s_blue); Py_CLEAR(clear_module_state->__pyx_n_s_blue1); Py_CLEAR(clear_module_state->__pyx_n_s_blue2); Py_CLEAR(clear_module_state->__pyx_n_s_blue3); Py_CLEAR(clear_module_state->__pyx_n_s_blue4); Py_CLEAR(clear_module_state->__pyx_n_s_blueviolet); Py_CLEAR(clear_module_state->__pyx_n_s_brown); Py_CLEAR(clear_module_state->__pyx_n_s_brown1); Py_CLEAR(clear_module_state->__pyx_n_s_brown2); Py_CLEAR(clear_module_state->__pyx_n_s_brown3); Py_CLEAR(clear_module_state->__pyx_n_s_brown4); Py_CLEAR(clear_module_state->__pyx_n_s_burlywood); Py_CLEAR(clear_module_state->__pyx_n_s_burlywood1); Py_CLEAR(clear_module_state->__pyx_n_s_burlywood2); Py_CLEAR(clear_module_state->__pyx_n_s_burlywood3); Py_CLEAR(clear_module_state->__pyx_n_s_burlywood4); Py_CLEAR(clear_module_state->__pyx_n_s_c); Py_CLEAR(clear_module_state->__pyx_n_s_cadetblue); Py_CLEAR(clear_module_state->__pyx_n_s_cadetblue1); Py_CLEAR(clear_module_state->__pyx_n_s_cadetblue2); Py_CLEAR(clear_module_state->__pyx_n_s_cadetblue3); Py_CLEAR(clear_module_state->__pyx_n_s_cadetblue4); Py_CLEAR(clear_module_state->__pyx_n_s_chartreuse); Py_CLEAR(clear_module_state->__pyx_n_s_chartreuse1); Py_CLEAR(clear_module_state->__pyx_n_s_chartreuse2); Py_CLEAR(clear_module_state->__pyx_n_s_chartreuse3); Py_CLEAR(clear_module_state->__pyx_n_s_chartreuse4); Py_CLEAR(clear_module_state->__pyx_n_s_chocolate); Py_CLEAR(clear_module_state->__pyx_n_s_chocolate1); Py_CLEAR(clear_module_state->__pyx_n_s_chocolate2); Py_CLEAR(clear_module_state->__pyx_n_s_chocolate3); Py_CLEAR(clear_module_state->__pyx_n_s_chocolate4); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_coral); Py_CLEAR(clear_module_state->__pyx_n_s_coral1); Py_CLEAR(clear_module_state->__pyx_n_s_coral2); Py_CLEAR(clear_module_state->__pyx_n_s_coral3); Py_CLEAR(clear_module_state->__pyx_n_s_coral4); Py_CLEAR(clear_module_state->__pyx_n_s_cornflowerblue); Py_CLEAR(clear_module_state->__pyx_n_s_cornsilk); Py_CLEAR(clear_module_state->__pyx_n_s_cornsilk1); Py_CLEAR(clear_module_state->__pyx_n_s_cornsilk2); Py_CLEAR(clear_module_state->__pyx_n_s_cornsilk3); Py_CLEAR(clear_module_state->__pyx_n_s_cornsilk4); Py_CLEAR(clear_module_state->__pyx_n_s_correct_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_correct_gamma_locals_lambda); Py_CLEAR(clear_module_state->__pyx_n_s_cyan); Py_CLEAR(clear_module_state->__pyx_n_s_cyan1); Py_CLEAR(clear_module_state->__pyx_n_s_cyan2); Py_CLEAR(clear_module_state->__pyx_n_s_cyan3); Py_CLEAR(clear_module_state->__pyx_n_s_cyan4); Py_CLEAR(clear_module_state->__pyx_n_s_d); Py_CLEAR(clear_module_state->__pyx_n_s_darkblue); Py_CLEAR(clear_module_state->__pyx_n_s_darkcyan); Py_CLEAR(clear_module_state->__pyx_n_s_darkgoldenrod); Py_CLEAR(clear_module_state->__pyx_n_s_darkgoldenrod1); Py_CLEAR(clear_module_state->__pyx_n_s_darkgoldenrod2); Py_CLEAR(clear_module_state->__pyx_n_s_darkgoldenrod3); Py_CLEAR(clear_module_state->__pyx_n_s_darkgoldenrod4); Py_CLEAR(clear_module_state->__pyx_n_s_darkgray); Py_CLEAR(clear_module_state->__pyx_n_s_darkgreen); Py_CLEAR(clear_module_state->__pyx_n_s_darkgrey); Py_CLEAR(clear_module_state->__pyx_n_s_darkkhaki); Py_CLEAR(clear_module_state->__pyx_n_s_darkmagenta); Py_CLEAR(clear_module_state->__pyx_n_s_darkolivegreen); Py_CLEAR(clear_module_state->__pyx_n_s_darkolivegreen1); Py_CLEAR(clear_module_state->__pyx_n_s_darkolivegreen2); Py_CLEAR(clear_module_state->__pyx_n_s_darkolivegreen3); Py_CLEAR(clear_module_state->__pyx_n_s_darkolivegreen4); Py_CLEAR(clear_module_state->__pyx_n_s_darkorange); Py_CLEAR(clear_module_state->__pyx_n_s_darkorange1); Py_CLEAR(clear_module_state->__pyx_n_s_darkorange2); Py_CLEAR(clear_module_state->__pyx_n_s_darkorange3); Py_CLEAR(clear_module_state->__pyx_n_s_darkorange4); Py_CLEAR(clear_module_state->__pyx_n_s_darkorchid); Py_CLEAR(clear_module_state->__pyx_n_s_darkorchid1); Py_CLEAR(clear_module_state->__pyx_n_s_darkorchid2); Py_CLEAR(clear_module_state->__pyx_n_s_darkorchid3); Py_CLEAR(clear_module_state->__pyx_n_s_darkorchid4); Py_CLEAR(clear_module_state->__pyx_n_s_darkred); Py_CLEAR(clear_module_state->__pyx_n_s_darksalmon); Py_CLEAR(clear_module_state->__pyx_n_s_darkseagreen); Py_CLEAR(clear_module_state->__pyx_n_s_darkseagreen1); Py_CLEAR(clear_module_state->__pyx_n_s_darkseagreen2); Py_CLEAR(clear_module_state->__pyx_n_s_darkseagreen3); Py_CLEAR(clear_module_state->__pyx_n_s_darkseagreen4); Py_CLEAR(clear_module_state->__pyx_n_s_darkslateblue); Py_CLEAR(clear_module_state->__pyx_n_s_darkslategray); Py_CLEAR(clear_module_state->__pyx_n_s_darkslategray1); Py_CLEAR(clear_module_state->__pyx_n_s_darkslategray2); Py_CLEAR(clear_module_state->__pyx_n_s_darkslategray3); Py_CLEAR(clear_module_state->__pyx_n_s_darkslategray4); Py_CLEAR(clear_module_state->__pyx_n_s_darkslategrey); Py_CLEAR(clear_module_state->__pyx_n_s_darkturquoise); Py_CLEAR(clear_module_state->__pyx_n_s_darkviolet); Py_CLEAR(clear_module_state->__pyx_n_s_debianred); Py_CLEAR(clear_module_state->__pyx_n_s_deeppink); Py_CLEAR(clear_module_state->__pyx_n_s_deeppink1); Py_CLEAR(clear_module_state->__pyx_n_s_deeppink2); Py_CLEAR(clear_module_state->__pyx_n_s_deeppink3); Py_CLEAR(clear_module_state->__pyx_n_s_deeppink4); Py_CLEAR(clear_module_state->__pyx_n_s_deepskyblue); Py_CLEAR(clear_module_state->__pyx_n_s_deepskyblue1); Py_CLEAR(clear_module_state->__pyx_n_s_deepskyblue2); Py_CLEAR(clear_module_state->__pyx_n_s_deepskyblue3); Py_CLEAR(clear_module_state->__pyx_n_s_deepskyblue4); Py_CLEAR(clear_module_state->__pyx_n_s_dimgray); Py_CLEAR(clear_module_state->__pyx_n_s_dimgrey); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_div); Py_CLEAR(clear_module_state->__pyx_n_s_dodgerblue); Py_CLEAR(clear_module_state->__pyx_n_s_dodgerblue1); Py_CLEAR(clear_module_state->__pyx_n_s_dodgerblue2); Py_CLEAR(clear_module_state->__pyx_n_s_dodgerblue3); Py_CLEAR(clear_module_state->__pyx_n_s_dodgerblue4); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_firebrick); Py_CLEAR(clear_module_state->__pyx_n_s_firebrick1); Py_CLEAR(clear_module_state->__pyx_n_s_firebrick2); Py_CLEAR(clear_module_state->__pyx_n_s_firebrick3); Py_CLEAR(clear_module_state->__pyx_n_s_firebrick4); Py_CLEAR(clear_module_state->__pyx_n_s_floordiv___locals_div); Py_CLEAR(clear_module_state->__pyx_n_s_floralwhite); Py_CLEAR(clear_module_state->__pyx_n_s_forestgreen); Py_CLEAR(clear_module_state->__pyx_n_s_g); Py_CLEAR(clear_module_state->__pyx_n_s_gainsboro); Py_CLEAR(clear_module_state->__pyx_n_s_gamma); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_ghostwhite); Py_CLEAR(clear_module_state->__pyx_n_s_gold); Py_CLEAR(clear_module_state->__pyx_n_s_gold1); Py_CLEAR(clear_module_state->__pyx_n_s_gold2); Py_CLEAR(clear_module_state->__pyx_n_s_gold3); Py_CLEAR(clear_module_state->__pyx_n_s_gold4); Py_CLEAR(clear_module_state->__pyx_n_s_goldenrod); Py_CLEAR(clear_module_state->__pyx_n_s_goldenrod1); Py_CLEAR(clear_module_state->__pyx_n_s_goldenrod2); Py_CLEAR(clear_module_state->__pyx_n_s_goldenrod3); Py_CLEAR(clear_module_state->__pyx_n_s_goldenrod4); Py_CLEAR(clear_module_state->__pyx_n_s_gray); Py_CLEAR(clear_module_state->__pyx_n_s_gray0); Py_CLEAR(clear_module_state->__pyx_n_s_gray1); Py_CLEAR(clear_module_state->__pyx_n_s_gray10); Py_CLEAR(clear_module_state->__pyx_n_s_gray100); Py_CLEAR(clear_module_state->__pyx_n_s_gray11); Py_CLEAR(clear_module_state->__pyx_n_s_gray12); Py_CLEAR(clear_module_state->__pyx_n_s_gray13); Py_CLEAR(clear_module_state->__pyx_n_s_gray14); Py_CLEAR(clear_module_state->__pyx_n_s_gray15); Py_CLEAR(clear_module_state->__pyx_n_s_gray16); Py_CLEAR(clear_module_state->__pyx_n_s_gray17); Py_CLEAR(clear_module_state->__pyx_n_s_gray18); Py_CLEAR(clear_module_state->__pyx_n_s_gray19); Py_CLEAR(clear_module_state->__pyx_n_s_gray2); Py_CLEAR(clear_module_state->__pyx_n_s_gray20); Py_CLEAR(clear_module_state->__pyx_n_s_gray21); Py_CLEAR(clear_module_state->__pyx_n_s_gray22); Py_CLEAR(clear_module_state->__pyx_n_s_gray23); Py_CLEAR(clear_module_state->__pyx_n_s_gray24); Py_CLEAR(clear_module_state->__pyx_n_s_gray25); Py_CLEAR(clear_module_state->__pyx_n_s_gray26); Py_CLEAR(clear_module_state->__pyx_n_s_gray27); Py_CLEAR(clear_module_state->__pyx_n_s_gray28); Py_CLEAR(clear_module_state->__pyx_n_s_gray29); Py_CLEAR(clear_module_state->__pyx_n_s_gray3); Py_CLEAR(clear_module_state->__pyx_n_s_gray30); Py_CLEAR(clear_module_state->__pyx_n_s_gray31); Py_CLEAR(clear_module_state->__pyx_n_s_gray32); Py_CLEAR(clear_module_state->__pyx_n_s_gray33); Py_CLEAR(clear_module_state->__pyx_n_s_gray34); Py_CLEAR(clear_module_state->__pyx_n_s_gray35); Py_CLEAR(clear_module_state->__pyx_n_s_gray36); Py_CLEAR(clear_module_state->__pyx_n_s_gray37); Py_CLEAR(clear_module_state->__pyx_n_s_gray38); Py_CLEAR(clear_module_state->__pyx_n_s_gray39); Py_CLEAR(clear_module_state->__pyx_n_s_gray4); Py_CLEAR(clear_module_state->__pyx_n_s_gray40); Py_CLEAR(clear_module_state->__pyx_n_s_gray41); Py_CLEAR(clear_module_state->__pyx_n_s_gray42); Py_CLEAR(clear_module_state->__pyx_n_s_gray43); Py_CLEAR(clear_module_state->__pyx_n_s_gray44); Py_CLEAR(clear_module_state->__pyx_n_s_gray45); Py_CLEAR(clear_module_state->__pyx_n_s_gray46); Py_CLEAR(clear_module_state->__pyx_n_s_gray47); Py_CLEAR(clear_module_state->__pyx_n_s_gray48); Py_CLEAR(clear_module_state->__pyx_n_s_gray49); Py_CLEAR(clear_module_state->__pyx_n_s_gray5); Py_CLEAR(clear_module_state->__pyx_n_s_gray50); Py_CLEAR(clear_module_state->__pyx_n_s_gray51); Py_CLEAR(clear_module_state->__pyx_n_s_gray52); Py_CLEAR(clear_module_state->__pyx_n_s_gray53); Py_CLEAR(clear_module_state->__pyx_n_s_gray54); Py_CLEAR(clear_module_state->__pyx_n_s_gray55); Py_CLEAR(clear_module_state->__pyx_n_s_gray56); Py_CLEAR(clear_module_state->__pyx_n_s_gray57); Py_CLEAR(clear_module_state->__pyx_n_s_gray58); Py_CLEAR(clear_module_state->__pyx_n_s_gray59); Py_CLEAR(clear_module_state->__pyx_n_s_gray6); Py_CLEAR(clear_module_state->__pyx_n_s_gray60); Py_CLEAR(clear_module_state->__pyx_n_s_gray61); Py_CLEAR(clear_module_state->__pyx_n_s_gray62); Py_CLEAR(clear_module_state->__pyx_n_s_gray63); Py_CLEAR(clear_module_state->__pyx_n_s_gray64); Py_CLEAR(clear_module_state->__pyx_n_s_gray65); Py_CLEAR(clear_module_state->__pyx_n_s_gray66); Py_CLEAR(clear_module_state->__pyx_n_s_gray67); Py_CLEAR(clear_module_state->__pyx_n_s_gray68); Py_CLEAR(clear_module_state->__pyx_n_s_gray69); Py_CLEAR(clear_module_state->__pyx_n_s_gray7); Py_CLEAR(clear_module_state->__pyx_n_s_gray70); Py_CLEAR(clear_module_state->__pyx_n_s_gray71); Py_CLEAR(clear_module_state->__pyx_n_s_gray72); Py_CLEAR(clear_module_state->__pyx_n_s_gray73); Py_CLEAR(clear_module_state->__pyx_n_s_gray74); Py_CLEAR(clear_module_state->__pyx_n_s_gray75); Py_CLEAR(clear_module_state->__pyx_n_s_gray76); Py_CLEAR(clear_module_state->__pyx_n_s_gray77); Py_CLEAR(clear_module_state->__pyx_n_s_gray78); Py_CLEAR(clear_module_state->__pyx_n_s_gray79); Py_CLEAR(clear_module_state->__pyx_n_s_gray8); Py_CLEAR(clear_module_state->__pyx_n_s_gray80); Py_CLEAR(clear_module_state->__pyx_n_s_gray81); Py_CLEAR(clear_module_state->__pyx_n_s_gray82); Py_CLEAR(clear_module_state->__pyx_n_s_gray83); Py_CLEAR(clear_module_state->__pyx_n_s_gray84); Py_CLEAR(clear_module_state->__pyx_n_s_gray85); Py_CLEAR(clear_module_state->__pyx_n_s_gray86); Py_CLEAR(clear_module_state->__pyx_n_s_gray87); Py_CLEAR(clear_module_state->__pyx_n_s_gray88); Py_CLEAR(clear_module_state->__pyx_n_s_gray89); Py_CLEAR(clear_module_state->__pyx_n_s_gray9); Py_CLEAR(clear_module_state->__pyx_n_s_gray90); Py_CLEAR(clear_module_state->__pyx_n_s_gray91); Py_CLEAR(clear_module_state->__pyx_n_s_gray92); Py_CLEAR(clear_module_state->__pyx_n_s_gray93); Py_CLEAR(clear_module_state->__pyx_n_s_gray94); Py_CLEAR(clear_module_state->__pyx_n_s_gray95); Py_CLEAR(clear_module_state->__pyx_n_s_gray96); Py_CLEAR(clear_module_state->__pyx_n_s_gray97); Py_CLEAR(clear_module_state->__pyx_n_s_gray98); Py_CLEAR(clear_module_state->__pyx_n_s_gray99); Py_CLEAR(clear_module_state->__pyx_n_s_green); Py_CLEAR(clear_module_state->__pyx_n_s_green1); Py_CLEAR(clear_module_state->__pyx_n_s_green2); Py_CLEAR(clear_module_state->__pyx_n_s_green3); Py_CLEAR(clear_module_state->__pyx_n_s_green4); Py_CLEAR(clear_module_state->__pyx_n_s_greenyellow); Py_CLEAR(clear_module_state->__pyx_n_s_grey); Py_CLEAR(clear_module_state->__pyx_n_s_grey0); Py_CLEAR(clear_module_state->__pyx_n_s_grey1); Py_CLEAR(clear_module_state->__pyx_n_s_grey10); Py_CLEAR(clear_module_state->__pyx_n_s_grey100); Py_CLEAR(clear_module_state->__pyx_n_s_grey11); Py_CLEAR(clear_module_state->__pyx_n_s_grey12); Py_CLEAR(clear_module_state->__pyx_n_s_grey13); Py_CLEAR(clear_module_state->__pyx_n_s_grey14); Py_CLEAR(clear_module_state->__pyx_n_s_grey15); Py_CLEAR(clear_module_state->__pyx_n_s_grey16); Py_CLEAR(clear_module_state->__pyx_n_s_grey17); Py_CLEAR(clear_module_state->__pyx_n_s_grey18); Py_CLEAR(clear_module_state->__pyx_n_s_grey19); Py_CLEAR(clear_module_state->__pyx_n_s_grey2); Py_CLEAR(clear_module_state->__pyx_n_s_grey20); Py_CLEAR(clear_module_state->__pyx_n_s_grey21); Py_CLEAR(clear_module_state->__pyx_n_s_grey22); Py_CLEAR(clear_module_state->__pyx_n_s_grey23); Py_CLEAR(clear_module_state->__pyx_n_s_grey24); Py_CLEAR(clear_module_state->__pyx_n_s_grey25); Py_CLEAR(clear_module_state->__pyx_n_s_grey26); Py_CLEAR(clear_module_state->__pyx_n_s_grey27); Py_CLEAR(clear_module_state->__pyx_n_s_grey28); Py_CLEAR(clear_module_state->__pyx_n_s_grey29); Py_CLEAR(clear_module_state->__pyx_n_s_grey3); Py_CLEAR(clear_module_state->__pyx_n_s_grey30); Py_CLEAR(clear_module_state->__pyx_n_s_grey31); Py_CLEAR(clear_module_state->__pyx_n_s_grey32); Py_CLEAR(clear_module_state->__pyx_n_s_grey33); Py_CLEAR(clear_module_state->__pyx_n_s_grey34); Py_CLEAR(clear_module_state->__pyx_n_s_grey35); Py_CLEAR(clear_module_state->__pyx_n_s_grey36); Py_CLEAR(clear_module_state->__pyx_n_s_grey37); Py_CLEAR(clear_module_state->__pyx_n_s_grey38); Py_CLEAR(clear_module_state->__pyx_n_s_grey39); Py_CLEAR(clear_module_state->__pyx_n_s_grey4); Py_CLEAR(clear_module_state->__pyx_n_s_grey40); Py_CLEAR(clear_module_state->__pyx_n_s_grey41); Py_CLEAR(clear_module_state->__pyx_n_s_grey42); Py_CLEAR(clear_module_state->__pyx_n_s_grey43); Py_CLEAR(clear_module_state->__pyx_n_s_grey44); Py_CLEAR(clear_module_state->__pyx_n_s_grey45); Py_CLEAR(clear_module_state->__pyx_n_s_grey46); Py_CLEAR(clear_module_state->__pyx_n_s_grey47); Py_CLEAR(clear_module_state->__pyx_n_s_grey48); Py_CLEAR(clear_module_state->__pyx_n_s_grey49); Py_CLEAR(clear_module_state->__pyx_n_s_grey5); Py_CLEAR(clear_module_state->__pyx_n_s_grey50); Py_CLEAR(clear_module_state->__pyx_n_s_grey51); Py_CLEAR(clear_module_state->__pyx_n_s_grey52); Py_CLEAR(clear_module_state->__pyx_n_s_grey53); Py_CLEAR(clear_module_state->__pyx_n_s_grey54); Py_CLEAR(clear_module_state->__pyx_n_s_grey55); Py_CLEAR(clear_module_state->__pyx_n_s_grey56); Py_CLEAR(clear_module_state->__pyx_n_s_grey57); Py_CLEAR(clear_module_state->__pyx_n_s_grey58); Py_CLEAR(clear_module_state->__pyx_n_s_grey59); Py_CLEAR(clear_module_state->__pyx_n_s_grey6); Py_CLEAR(clear_module_state->__pyx_n_s_grey60); Py_CLEAR(clear_module_state->__pyx_n_s_grey61); Py_CLEAR(clear_module_state->__pyx_n_s_grey62); Py_CLEAR(clear_module_state->__pyx_n_s_grey63); Py_CLEAR(clear_module_state->__pyx_n_s_grey64); Py_CLEAR(clear_module_state->__pyx_n_s_grey65); Py_CLEAR(clear_module_state->__pyx_n_s_grey66); Py_CLEAR(clear_module_state->__pyx_n_s_grey67); Py_CLEAR(clear_module_state->__pyx_n_s_grey68); Py_CLEAR(clear_module_state->__pyx_n_s_grey69); Py_CLEAR(clear_module_state->__pyx_n_s_grey7); Py_CLEAR(clear_module_state->__pyx_n_s_grey70); Py_CLEAR(clear_module_state->__pyx_n_s_grey71); Py_CLEAR(clear_module_state->__pyx_n_s_grey72); Py_CLEAR(clear_module_state->__pyx_n_s_grey73); Py_CLEAR(clear_module_state->__pyx_n_s_grey74); Py_CLEAR(clear_module_state->__pyx_n_s_grey75); Py_CLEAR(clear_module_state->__pyx_n_s_grey76); Py_CLEAR(clear_module_state->__pyx_n_s_grey77); Py_CLEAR(clear_module_state->__pyx_n_s_grey78); Py_CLEAR(clear_module_state->__pyx_n_s_grey79); Py_CLEAR(clear_module_state->__pyx_n_s_grey8); Py_CLEAR(clear_module_state->__pyx_n_s_grey80); Py_CLEAR(clear_module_state->__pyx_n_s_grey81); Py_CLEAR(clear_module_state->__pyx_n_s_grey82); Py_CLEAR(clear_module_state->__pyx_n_s_grey83); Py_CLEAR(clear_module_state->__pyx_n_s_grey84); Py_CLEAR(clear_module_state->__pyx_n_s_grey85); Py_CLEAR(clear_module_state->__pyx_n_s_grey86); Py_CLEAR(clear_module_state->__pyx_n_s_grey87); Py_CLEAR(clear_module_state->__pyx_n_s_grey88); Py_CLEAR(clear_module_state->__pyx_n_s_grey89); Py_CLEAR(clear_module_state->__pyx_n_s_grey9); Py_CLEAR(clear_module_state->__pyx_n_s_grey90); Py_CLEAR(clear_module_state->__pyx_n_s_grey91); Py_CLEAR(clear_module_state->__pyx_n_s_grey92); Py_CLEAR(clear_module_state->__pyx_n_s_grey93); Py_CLEAR(clear_module_state->__pyx_n_s_grey94); Py_CLEAR(clear_module_state->__pyx_n_s_grey95); Py_CLEAR(clear_module_state->__pyx_n_s_grey96); Py_CLEAR(clear_module_state->__pyx_n_s_grey97); Py_CLEAR(clear_module_state->__pyx_n_s_grey98); Py_CLEAR(clear_module_state->__pyx_n_s_grey99); Py_CLEAR(clear_module_state->__pyx_n_s_hex); Py_CLEAR(clear_module_state->__pyx_n_s_honeydew); Py_CLEAR(clear_module_state->__pyx_n_s_honeydew1); Py_CLEAR(clear_module_state->__pyx_n_s_honeydew2); Py_CLEAR(clear_module_state->__pyx_n_s_honeydew3); Py_CLEAR(clear_module_state->__pyx_n_s_honeydew4); Py_CLEAR(clear_module_state->__pyx_n_s_hotpink); Py_CLEAR(clear_module_state->__pyx_n_s_hotpink1); Py_CLEAR(clear_module_state->__pyx_n_s_hotpink2); Py_CLEAR(clear_module_state->__pyx_n_s_hotpink3); Py_CLEAR(clear_module_state->__pyx_n_s_hotpink4); Py_CLEAR(clear_module_state->__pyx_n_s_hsva); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_indianred); Py_CLEAR(clear_module_state->__pyx_n_s_indianred1); Py_CLEAR(clear_module_state->__pyx_n_s_indianred2); Py_CLEAR(clear_module_state->__pyx_n_s_indianred3); Py_CLEAR(clear_module_state->__pyx_n_s_indianred4); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_ivory); Py_CLEAR(clear_module_state->__pyx_n_s_ivory1); Py_CLEAR(clear_module_state->__pyx_n_s_ivory2); Py_CLEAR(clear_module_state->__pyx_n_s_ivory3); Py_CLEAR(clear_module_state->__pyx_n_s_ivory4); Py_CLEAR(clear_module_state->__pyx_n_s_join); Py_CLEAR(clear_module_state->__pyx_n_s_khaki); Py_CLEAR(clear_module_state->__pyx_n_s_khaki1); Py_CLEAR(clear_module_state->__pyx_n_s_khaki2); Py_CLEAR(clear_module_state->__pyx_n_s_khaki3); Py_CLEAR(clear_module_state->__pyx_n_s_khaki4); Py_CLEAR(clear_module_state->__pyx_n_s_l); Py_CLEAR(clear_module_state->__pyx_n_s_lavender); Py_CLEAR(clear_module_state->__pyx_n_s_lavenderblush); Py_CLEAR(clear_module_state->__pyx_n_s_lavenderblush1); Py_CLEAR(clear_module_state->__pyx_n_s_lavenderblush2); Py_CLEAR(clear_module_state->__pyx_n_s_lavenderblush3); Py_CLEAR(clear_module_state->__pyx_n_s_lavenderblush4); Py_CLEAR(clear_module_state->__pyx_n_s_lawngreen); Py_CLEAR(clear_module_state->__pyx_n_s_lemonchiffon); Py_CLEAR(clear_module_state->__pyx_n_s_lemonchiffon1); Py_CLEAR(clear_module_state->__pyx_n_s_lemonchiffon2); Py_CLEAR(clear_module_state->__pyx_n_s_lemonchiffon3); Py_CLEAR(clear_module_state->__pyx_n_s_lemonchiffon4); Py_CLEAR(clear_module_state->__pyx_n_s_lightblue); Py_CLEAR(clear_module_state->__pyx_n_s_lightblue1); Py_CLEAR(clear_module_state->__pyx_n_s_lightblue2); Py_CLEAR(clear_module_state->__pyx_n_s_lightblue3); Py_CLEAR(clear_module_state->__pyx_n_s_lightblue4); Py_CLEAR(clear_module_state->__pyx_n_s_lightcoral); Py_CLEAR(clear_module_state->__pyx_n_s_lightcyan); Py_CLEAR(clear_module_state->__pyx_n_s_lightcyan1); Py_CLEAR(clear_module_state->__pyx_n_s_lightcyan2); Py_CLEAR(clear_module_state->__pyx_n_s_lightcyan3); Py_CLEAR(clear_module_state->__pyx_n_s_lightcyan4); Py_CLEAR(clear_module_state->__pyx_n_s_lightgoldenrod); Py_CLEAR(clear_module_state->__pyx_n_s_lightgoldenrod1); Py_CLEAR(clear_module_state->__pyx_n_s_lightgoldenrod2); Py_CLEAR(clear_module_state->__pyx_n_s_lightgoldenrod3); Py_CLEAR(clear_module_state->__pyx_n_s_lightgoldenrod4); Py_CLEAR(clear_module_state->__pyx_n_s_lightgoldenrodyellow); Py_CLEAR(clear_module_state->__pyx_n_s_lightgray); Py_CLEAR(clear_module_state->__pyx_n_s_lightgreen); Py_CLEAR(clear_module_state->__pyx_n_s_lightgrey); Py_CLEAR(clear_module_state->__pyx_n_s_lightpink); Py_CLEAR(clear_module_state->__pyx_n_s_lightpink1); Py_CLEAR(clear_module_state->__pyx_n_s_lightpink2); Py_CLEAR(clear_module_state->__pyx_n_s_lightpink3); Py_CLEAR(clear_module_state->__pyx_n_s_lightpink4); Py_CLEAR(clear_module_state->__pyx_n_s_lightsalmon); Py_CLEAR(clear_module_state->__pyx_n_s_lightsalmon1); Py_CLEAR(clear_module_state->__pyx_n_s_lightsalmon2); Py_CLEAR(clear_module_state->__pyx_n_s_lightsalmon3); Py_CLEAR(clear_module_state->__pyx_n_s_lightsalmon4); Py_CLEAR(clear_module_state->__pyx_n_s_lightseagreen); Py_CLEAR(clear_module_state->__pyx_n_s_lightskyblue); Py_CLEAR(clear_module_state->__pyx_n_s_lightskyblue1); Py_CLEAR(clear_module_state->__pyx_n_s_lightskyblue2); Py_CLEAR(clear_module_state->__pyx_n_s_lightskyblue3); Py_CLEAR(clear_module_state->__pyx_n_s_lightskyblue4); Py_CLEAR(clear_module_state->__pyx_n_s_lightslateblue); Py_CLEAR(clear_module_state->__pyx_n_s_lightslategray); Py_CLEAR(clear_module_state->__pyx_n_s_lightslategrey); Py_CLEAR(clear_module_state->__pyx_n_s_lightsteelblue); Py_CLEAR(clear_module_state->__pyx_n_s_lightsteelblue1); Py_CLEAR(clear_module_state->__pyx_n_s_lightsteelblue2); Py_CLEAR(clear_module_state->__pyx_n_s_lightsteelblue3); Py_CLEAR(clear_module_state->__pyx_n_s_lightsteelblue4); Py_CLEAR(clear_module_state->__pyx_n_s_lightyellow); Py_CLEAR(clear_module_state->__pyx_n_s_lightyellow1); Py_CLEAR(clear_module_state->__pyx_n_s_lightyellow2); Py_CLEAR(clear_module_state->__pyx_n_s_lightyellow3); Py_CLEAR(clear_module_state->__pyx_n_s_lightyellow4); Py_CLEAR(clear_module_state->__pyx_n_s_limegreen); Py_CLEAR(clear_module_state->__pyx_n_s_linen); Py_CLEAR(clear_module_state->__pyx_n_s_lower); Py_CLEAR(clear_module_state->__pyx_n_s_m); Py_CLEAR(clear_module_state->__pyx_n_s_magenta); Py_CLEAR(clear_module_state->__pyx_n_s_magenta1); Py_CLEAR(clear_module_state->__pyx_n_s_magenta2); Py_CLEAR(clear_module_state->__pyx_n_s_magenta3); Py_CLEAR(clear_module_state->__pyx_n_s_magenta4); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_map); Py_CLEAR(clear_module_state->__pyx_n_s_maroon); Py_CLEAR(clear_module_state->__pyx_n_s_maroon1); Py_CLEAR(clear_module_state->__pyx_n_s_maroon2); Py_CLEAR(clear_module_state->__pyx_n_s_maroon3); Py_CLEAR(clear_module_state->__pyx_n_s_maroon4); Py_CLEAR(clear_module_state->__pyx_n_s_mediumaquamarine); Py_CLEAR(clear_module_state->__pyx_n_s_mediumblue); Py_CLEAR(clear_module_state->__pyx_n_s_mediumorchid); Py_CLEAR(clear_module_state->__pyx_n_s_mediumorchid1); Py_CLEAR(clear_module_state->__pyx_n_s_mediumorchid2); Py_CLEAR(clear_module_state->__pyx_n_s_mediumorchid3); Py_CLEAR(clear_module_state->__pyx_n_s_mediumorchid4); Py_CLEAR(clear_module_state->__pyx_n_s_mediumpurple); Py_CLEAR(clear_module_state->__pyx_n_s_mediumpurple1); Py_CLEAR(clear_module_state->__pyx_n_s_mediumpurple2); Py_CLEAR(clear_module_state->__pyx_n_s_mediumpurple3); Py_CLEAR(clear_module_state->__pyx_n_s_mediumpurple4); Py_CLEAR(clear_module_state->__pyx_n_s_mediumseagreen); Py_CLEAR(clear_module_state->__pyx_n_s_mediumslateblue); Py_CLEAR(clear_module_state->__pyx_n_s_mediumspringgreen); Py_CLEAR(clear_module_state->__pyx_n_s_mediumturquoise); Py_CLEAR(clear_module_state->__pyx_n_s_mediumvioletred); Py_CLEAR(clear_module_state->__pyx_n_s_midnightblue); Py_CLEAR(clear_module_state->__pyx_n_s_mintcream); Py_CLEAR(clear_module_state->__pyx_n_s_mistyrose); Py_CLEAR(clear_module_state->__pyx_n_s_mistyrose1); Py_CLEAR(clear_module_state->__pyx_n_s_mistyrose2); Py_CLEAR(clear_module_state->__pyx_n_s_mistyrose3); Py_CLEAR(clear_module_state->__pyx_n_s_mistyrose4); Py_CLEAR(clear_module_state->__pyx_n_s_moccasin); Py_CLEAR(clear_module_state->__pyx_n_s_mod); Py_CLEAR(clear_module_state->__pyx_n_s_mod___locals_mod); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_navajowhite); Py_CLEAR(clear_module_state->__pyx_n_s_navajowhite1); Py_CLEAR(clear_module_state->__pyx_n_s_navajowhite2); Py_CLEAR(clear_module_state->__pyx_n_s_navajowhite3); Py_CLEAR(clear_module_state->__pyx_n_s_navajowhite4); Py_CLEAR(clear_module_state->__pyx_n_s_navy); Py_CLEAR(clear_module_state->__pyx_n_s_navyblue); Py_CLEAR(clear_module_state->__pyx_n_s_normalize); Py_CLEAR(clear_module_state->__pyx_n_s_oct); Py_CLEAR(clear_module_state->__pyx_n_s_oldlace); Py_CLEAR(clear_module_state->__pyx_n_s_olivedrab); Py_CLEAR(clear_module_state->__pyx_n_s_olivedrab1); Py_CLEAR(clear_module_state->__pyx_n_s_olivedrab2); Py_CLEAR(clear_module_state->__pyx_n_s_olivedrab3); Py_CLEAR(clear_module_state->__pyx_n_s_olivedrab4); Py_CLEAR(clear_module_state->__pyx_n_s_orange); Py_CLEAR(clear_module_state->__pyx_n_s_orange1); Py_CLEAR(clear_module_state->__pyx_n_s_orange2); Py_CLEAR(clear_module_state->__pyx_n_s_orange3); Py_CLEAR(clear_module_state->__pyx_n_s_orange4); Py_CLEAR(clear_module_state->__pyx_n_s_orangered); Py_CLEAR(clear_module_state->__pyx_n_s_orangered1); Py_CLEAR(clear_module_state->__pyx_n_s_orangered2); Py_CLEAR(clear_module_state->__pyx_n_s_orangered3); Py_CLEAR(clear_module_state->__pyx_n_s_orangered4); Py_CLEAR(clear_module_state->__pyx_n_s_orchid); Py_CLEAR(clear_module_state->__pyx_n_s_orchid1); Py_CLEAR(clear_module_state->__pyx_n_s_orchid2); Py_CLEAR(clear_module_state->__pyx_n_s_orchid3); Py_CLEAR(clear_module_state->__pyx_n_s_orchid4); Py_CLEAR(clear_module_state->__pyx_n_s_pack); Py_CLEAR(clear_module_state->__pyx_n_s_palegoldenrod); Py_CLEAR(clear_module_state->__pyx_n_s_palegreen); Py_CLEAR(clear_module_state->__pyx_n_s_palegreen1); Py_CLEAR(clear_module_state->__pyx_n_s_palegreen2); Py_CLEAR(clear_module_state->__pyx_n_s_palegreen3); Py_CLEAR(clear_module_state->__pyx_n_s_palegreen4); Py_CLEAR(clear_module_state->__pyx_n_s_paleturquoise); Py_CLEAR(clear_module_state->__pyx_n_s_paleturquoise1); Py_CLEAR(clear_module_state->__pyx_n_s_paleturquoise2); Py_CLEAR(clear_module_state->__pyx_n_s_paleturquoise3); Py_CLEAR(clear_module_state->__pyx_n_s_paleturquoise4); Py_CLEAR(clear_module_state->__pyx_n_s_palevioletred); Py_CLEAR(clear_module_state->__pyx_n_s_palevioletred1); Py_CLEAR(clear_module_state->__pyx_n_s_palevioletred2); Py_CLEAR(clear_module_state->__pyx_n_s_palevioletred3); Py_CLEAR(clear_module_state->__pyx_n_s_palevioletred4); Py_CLEAR(clear_module_state->__pyx_n_s_papayawhip); Py_CLEAR(clear_module_state->__pyx_n_s_peachpuff); Py_CLEAR(clear_module_state->__pyx_n_s_peachpuff1); Py_CLEAR(clear_module_state->__pyx_n_s_peachpuff2); Py_CLEAR(clear_module_state->__pyx_n_s_peachpuff3); Py_CLEAR(clear_module_state->__pyx_n_s_peachpuff4); Py_CLEAR(clear_module_state->__pyx_n_s_peru); Py_CLEAR(clear_module_state->__pyx_n_s_pink); Py_CLEAR(clear_module_state->__pyx_n_s_pink1); Py_CLEAR(clear_module_state->__pyx_n_s_pink2); Py_CLEAR(clear_module_state->__pyx_n_s_pink3); Py_CLEAR(clear_module_state->__pyx_n_s_pink4); Py_CLEAR(clear_module_state->__pyx_n_s_plum); Py_CLEAR(clear_module_state->__pyx_n_s_plum1); Py_CLEAR(clear_module_state->__pyx_n_s_plum2); Py_CLEAR(clear_module_state->__pyx_n_s_plum3); Py_CLEAR(clear_module_state->__pyx_n_s_plum4); Py_CLEAR(clear_module_state->__pyx_n_s_powderblue); Py_CLEAR(clear_module_state->__pyx_n_s_purple); Py_CLEAR(clear_module_state->__pyx_n_s_purple1); Py_CLEAR(clear_module_state->__pyx_n_s_purple2); Py_CLEAR(clear_module_state->__pyx_n_s_purple3); Py_CLEAR(clear_module_state->__pyx_n_s_purple4); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_color); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_red); Py_CLEAR(clear_module_state->__pyx_n_s_red1); Py_CLEAR(clear_module_state->__pyx_n_s_red2); Py_CLEAR(clear_module_state->__pyx_n_s_red3); Py_CLEAR(clear_module_state->__pyx_n_s_red4); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_rgba); Py_CLEAR(clear_module_state->__pyx_n_s_rosybrown); Py_CLEAR(clear_module_state->__pyx_n_s_rosybrown1); Py_CLEAR(clear_module_state->__pyx_n_s_rosybrown2); Py_CLEAR(clear_module_state->__pyx_n_s_rosybrown3); Py_CLEAR(clear_module_state->__pyx_n_s_rosybrown4); Py_CLEAR(clear_module_state->__pyx_n_s_round); Py_CLEAR(clear_module_state->__pyx_n_s_royalblue); Py_CLEAR(clear_module_state->__pyx_n_s_royalblue1); Py_CLEAR(clear_module_state->__pyx_n_s_royalblue2); Py_CLEAR(clear_module_state->__pyx_n_s_royalblue3); Py_CLEAR(clear_module_state->__pyx_n_s_royalblue4); Py_CLEAR(clear_module_state->__pyx_n_s_saddlebrown); Py_CLEAR(clear_module_state->__pyx_n_s_salmon); Py_CLEAR(clear_module_state->__pyx_n_s_salmon1); Py_CLEAR(clear_module_state->__pyx_n_s_salmon2); Py_CLEAR(clear_module_state->__pyx_n_s_salmon3); Py_CLEAR(clear_module_state->__pyx_n_s_salmon4); Py_CLEAR(clear_module_state->__pyx_n_s_sandybrown); Py_CLEAR(clear_module_state->__pyx_n_s_seagreen); Py_CLEAR(clear_module_state->__pyx_n_s_seagreen1); Py_CLEAR(clear_module_state->__pyx_n_s_seagreen2); Py_CLEAR(clear_module_state->__pyx_n_s_seagreen3); Py_CLEAR(clear_module_state->__pyx_n_s_seagreen4); Py_CLEAR(clear_module_state->__pyx_n_s_seashell); Py_CLEAR(clear_module_state->__pyx_n_s_seashell1); Py_CLEAR(clear_module_state->__pyx_n_s_seashell2); Py_CLEAR(clear_module_state->__pyx_n_s_seashell3); Py_CLEAR(clear_module_state->__pyx_n_s_seashell4); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_length); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_sienna); Py_CLEAR(clear_module_state->__pyx_n_s_sienna1); Py_CLEAR(clear_module_state->__pyx_n_s_sienna2); Py_CLEAR(clear_module_state->__pyx_n_s_sienna3); Py_CLEAR(clear_module_state->__pyx_n_s_sienna4); Py_CLEAR(clear_module_state->__pyx_n_s_skyblue); Py_CLEAR(clear_module_state->__pyx_n_s_skyblue1); Py_CLEAR(clear_module_state->__pyx_n_s_skyblue2); Py_CLEAR(clear_module_state->__pyx_n_s_skyblue3); Py_CLEAR(clear_module_state->__pyx_n_s_skyblue4); Py_CLEAR(clear_module_state->__pyx_n_s_slateblue); Py_CLEAR(clear_module_state->__pyx_n_s_slateblue1); Py_CLEAR(clear_module_state->__pyx_n_s_slateblue2); Py_CLEAR(clear_module_state->__pyx_n_s_slateblue3); Py_CLEAR(clear_module_state->__pyx_n_s_slateblue4); Py_CLEAR(clear_module_state->__pyx_n_s_slategray); Py_CLEAR(clear_module_state->__pyx_n_s_slategray1); Py_CLEAR(clear_module_state->__pyx_n_s_slategray2); Py_CLEAR(clear_module_state->__pyx_n_s_slategray3); Py_CLEAR(clear_module_state->__pyx_n_s_slategray4); Py_CLEAR(clear_module_state->__pyx_n_s_slategrey); Py_CLEAR(clear_module_state->__pyx_n_s_snow); Py_CLEAR(clear_module_state->__pyx_n_s_snow1); Py_CLEAR(clear_module_state->__pyx_n_s_snow2); Py_CLEAR(clear_module_state->__pyx_n_s_snow3); Py_CLEAR(clear_module_state->__pyx_n_s_snow4); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_split); Py_CLEAR(clear_module_state->__pyx_n_s_springgreen); Py_CLEAR(clear_module_state->__pyx_n_s_springgreen1); Py_CLEAR(clear_module_state->__pyx_n_s_springgreen2); Py_CLEAR(clear_module_state->__pyx_n_s_springgreen3); Py_CLEAR(clear_module_state->__pyx_n_s_springgreen4); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_color_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_startswith); Py_CLEAR(clear_module_state->__pyx_n_s_steelblue); Py_CLEAR(clear_module_state->__pyx_n_s_steelblue1); Py_CLEAR(clear_module_state->__pyx_n_s_steelblue2); Py_CLEAR(clear_module_state->__pyx_n_s_steelblue3); Py_CLEAR(clear_module_state->__pyx_n_s_steelblue4); Py_CLEAR(clear_module_state->__pyx_n_s_struct); Py_CLEAR(clear_module_state->__pyx_n_s_tan); Py_CLEAR(clear_module_state->__pyx_n_s_tan1); Py_CLEAR(clear_module_state->__pyx_n_s_tan2); Py_CLEAR(clear_module_state->__pyx_n_s_tan3); Py_CLEAR(clear_module_state->__pyx_n_s_tan4); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_thistle); Py_CLEAR(clear_module_state->__pyx_n_s_thistle1); Py_CLEAR(clear_module_state->__pyx_n_s_thistle2); Py_CLEAR(clear_module_state->__pyx_n_s_thistle3); Py_CLEAR(clear_module_state->__pyx_n_s_thistle4); Py_CLEAR(clear_module_state->__pyx_n_s_tomato); Py_CLEAR(clear_module_state->__pyx_n_s_tomato1); Py_CLEAR(clear_module_state->__pyx_n_s_tomato2); Py_CLEAR(clear_module_state->__pyx_n_s_tomato3); Py_CLEAR(clear_module_state->__pyx_n_s_tomato4); Py_CLEAR(clear_module_state->__pyx_n_s_turquoise); Py_CLEAR(clear_module_state->__pyx_n_s_turquoise1); Py_CLEAR(clear_module_state->__pyx_n_s_turquoise2); Py_CLEAR(clear_module_state->__pyx_n_s_turquoise3); Py_CLEAR(clear_module_state->__pyx_n_s_turquoise4); Py_CLEAR(clear_module_state->__pyx_n_s_unhexlify); Py_CLEAR(clear_module_state->__pyx_n_s_unpack); Py_CLEAR(clear_module_state->__pyx_n_s_violet); Py_CLEAR(clear_module_state->__pyx_n_s_violetred); Py_CLEAR(clear_module_state->__pyx_n_s_violetred1); Py_CLEAR(clear_module_state->__pyx_n_s_violetred2); Py_CLEAR(clear_module_state->__pyx_n_s_violetred3); Py_CLEAR(clear_module_state->__pyx_n_s_violetred4); Py_CLEAR(clear_module_state->__pyx_n_s_wheat); Py_CLEAR(clear_module_state->__pyx_n_s_wheat1); Py_CLEAR(clear_module_state->__pyx_n_s_wheat2); Py_CLEAR(clear_module_state->__pyx_n_s_wheat3); Py_CLEAR(clear_module_state->__pyx_n_s_wheat4); Py_CLEAR(clear_module_state->__pyx_n_s_white); Py_CLEAR(clear_module_state->__pyx_n_s_whitesmoke); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_yellow); Py_CLEAR(clear_module_state->__pyx_n_s_yellow1); Py_CLEAR(clear_module_state->__pyx_n_s_yellow2); Py_CLEAR(clear_module_state->__pyx_n_s_yellow3); Py_CLEAR(clear_module_state->__pyx_n_s_yellow4); Py_CLEAR(clear_module_state->__pyx_n_s_yellowgreen); Py_CLEAR(clear_module_state->__pyx_float_255_0); Py_CLEAR(clear_module_state->__pyx_float_360_0); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_3); Py_CLEAR(clear_module_state->__pyx_int_4); Py_CLEAR(clear_module_state->__pyx_int_5); Py_CLEAR(clear_module_state->__pyx_int_7); Py_CLEAR(clear_module_state->__pyx_int_8); Py_CLEAR(clear_module_state->__pyx_int_10); Py_CLEAR(clear_module_state->__pyx_int_11); Py_CLEAR(clear_module_state->__pyx_int_12); Py_CLEAR(clear_module_state->__pyx_int_13); Py_CLEAR(clear_module_state->__pyx_int_14); Py_CLEAR(clear_module_state->__pyx_int_15); Py_CLEAR(clear_module_state->__pyx_int_16); Py_CLEAR(clear_module_state->__pyx_int_18); Py_CLEAR(clear_module_state->__pyx_int_19); Py_CLEAR(clear_module_state->__pyx_int_20); Py_CLEAR(clear_module_state->__pyx_int_21); Py_CLEAR(clear_module_state->__pyx_int_23); Py_CLEAR(clear_module_state->__pyx_int_24); Py_CLEAR(clear_module_state->__pyx_int_25); Py_CLEAR(clear_module_state->__pyx_int_26); Py_CLEAR(clear_module_state->__pyx_int_28); Py_CLEAR(clear_module_state->__pyx_int_29); Py_CLEAR(clear_module_state->__pyx_int_30); Py_CLEAR(clear_module_state->__pyx_int_31); Py_CLEAR(clear_module_state->__pyx_int_32); Py_CLEAR(clear_module_state->__pyx_int_33); Py_CLEAR(clear_module_state->__pyx_int_34); Py_CLEAR(clear_module_state->__pyx_int_35); Py_CLEAR(clear_module_state->__pyx_int_36); Py_CLEAR(clear_module_state->__pyx_int_37); Py_CLEAR(clear_module_state->__pyx_int_38); Py_CLEAR(clear_module_state->__pyx_int_39); Py_CLEAR(clear_module_state->__pyx_int_41); Py_CLEAR(clear_module_state->__pyx_int_42); Py_CLEAR(clear_module_state->__pyx_int_43); Py_CLEAR(clear_module_state->__pyx_int_44); Py_CLEAR(clear_module_state->__pyx_int_45); Py_CLEAR(clear_module_state->__pyx_int_46); Py_CLEAR(clear_module_state->__pyx_int_47); Py_CLEAR(clear_module_state->__pyx_int_48); Py_CLEAR(clear_module_state->__pyx_int_50); Py_CLEAR(clear_module_state->__pyx_int_51); Py_CLEAR(clear_module_state->__pyx_int_52); Py_CLEAR(clear_module_state->__pyx_int_54); Py_CLEAR(clear_module_state->__pyx_int_55); Py_CLEAR(clear_module_state->__pyx_int_56); Py_CLEAR(clear_module_state->__pyx_int_57); Py_CLEAR(clear_module_state->__pyx_int_58); Py_CLEAR(clear_module_state->__pyx_int_59); Py_CLEAR(clear_module_state->__pyx_int_60); Py_CLEAR(clear_module_state->__pyx_int_61); Py_CLEAR(clear_module_state->__pyx_int_62); Py_CLEAR(clear_module_state->__pyx_int_63); Py_CLEAR(clear_module_state->__pyx_int_64); Py_CLEAR(clear_module_state->__pyx_int_65); Py_CLEAR(clear_module_state->__pyx_int_66); Py_CLEAR(clear_module_state->__pyx_int_67); Py_CLEAR(clear_module_state->__pyx_int_69); Py_CLEAR(clear_module_state->__pyx_int_70); Py_CLEAR(clear_module_state->__pyx_int_71); Py_CLEAR(clear_module_state->__pyx_int_72); Py_CLEAR(clear_module_state->__pyx_int_73); Py_CLEAR(clear_module_state->__pyx_int_74); Py_CLEAR(clear_module_state->__pyx_int_76); Py_CLEAR(clear_module_state->__pyx_int_77); Py_CLEAR(clear_module_state->__pyx_int_78); Py_CLEAR(clear_module_state->__pyx_int_79); Py_CLEAR(clear_module_state->__pyx_int_80); Py_CLEAR(clear_module_state->__pyx_int_81); Py_CLEAR(clear_module_state->__pyx_int_82); Py_CLEAR(clear_module_state->__pyx_int_83); Py_CLEAR(clear_module_state->__pyx_int_84); Py_CLEAR(clear_module_state->__pyx_int_85); Py_CLEAR(clear_module_state->__pyx_int_86); Py_CLEAR(clear_module_state->__pyx_int_87); Py_CLEAR(clear_module_state->__pyx_int_89); Py_CLEAR(clear_module_state->__pyx_int_90); Py_CLEAR(clear_module_state->__pyx_int_91); Py_CLEAR(clear_module_state->__pyx_int_92); Py_CLEAR(clear_module_state->__pyx_int_93); Py_CLEAR(clear_module_state->__pyx_int_94); Py_CLEAR(clear_module_state->__pyx_int_95); Py_CLEAR(clear_module_state->__pyx_int_96); Py_CLEAR(clear_module_state->__pyx_int_97); Py_CLEAR(clear_module_state->__pyx_int_98); Py_CLEAR(clear_module_state->__pyx_int_99); Py_CLEAR(clear_module_state->__pyx_int_100); Py_CLEAR(clear_module_state->__pyx_int_101); Py_CLEAR(clear_module_state->__pyx_int_102); Py_CLEAR(clear_module_state->__pyx_int_103); Py_CLEAR(clear_module_state->__pyx_int_104); Py_CLEAR(clear_module_state->__pyx_int_105); Py_CLEAR(clear_module_state->__pyx_int_106); Py_CLEAR(clear_module_state->__pyx_int_107); Py_CLEAR(clear_module_state->__pyx_int_108); Py_CLEAR(clear_module_state->__pyx_int_110); Py_CLEAR(clear_module_state->__pyx_int_111); Py_CLEAR(clear_module_state->__pyx_int_112); Py_CLEAR(clear_module_state->__pyx_int_113); Py_CLEAR(clear_module_state->__pyx_int_114); Py_CLEAR(clear_module_state->__pyx_int_115); Py_CLEAR(clear_module_state->__pyx_int_116); Py_CLEAR(clear_module_state->__pyx_int_117); Py_CLEAR(clear_module_state->__pyx_int_118); Py_CLEAR(clear_module_state->__pyx_int_119); Py_CLEAR(clear_module_state->__pyx_int_120); Py_CLEAR(clear_module_state->__pyx_int_121); Py_CLEAR(clear_module_state->__pyx_int_122); Py_CLEAR(clear_module_state->__pyx_int_123); Py_CLEAR(clear_module_state->__pyx_int_124); Py_CLEAR(clear_module_state->__pyx_int_125); Py_CLEAR(clear_module_state->__pyx_int_126); Py_CLEAR(clear_module_state->__pyx_int_127); Py_CLEAR(clear_module_state->__pyx_int_128); Py_CLEAR(clear_module_state->__pyx_int_129); Py_CLEAR(clear_module_state->__pyx_int_130); Py_CLEAR(clear_module_state->__pyx_int_131); Py_CLEAR(clear_module_state->__pyx_int_132); Py_CLEAR(clear_module_state->__pyx_int_133); Py_CLEAR(clear_module_state->__pyx_int_134); Py_CLEAR(clear_module_state->__pyx_int_135); Py_CLEAR(clear_module_state->__pyx_int_136); Py_CLEAR(clear_module_state->__pyx_int_137); Py_CLEAR(clear_module_state->__pyx_int_138); Py_CLEAR(clear_module_state->__pyx_int_139); Py_CLEAR(clear_module_state->__pyx_int_140); Py_CLEAR(clear_module_state->__pyx_int_141); Py_CLEAR(clear_module_state->__pyx_int_142); Py_CLEAR(clear_module_state->__pyx_int_143); Py_CLEAR(clear_module_state->__pyx_int_144); Py_CLEAR(clear_module_state->__pyx_int_145); Py_CLEAR(clear_module_state->__pyx_int_147); Py_CLEAR(clear_module_state->__pyx_int_148); Py_CLEAR(clear_module_state->__pyx_int_149); Py_CLEAR(clear_module_state->__pyx_int_150); Py_CLEAR(clear_module_state->__pyx_int_151); Py_CLEAR(clear_module_state->__pyx_int_152); Py_CLEAR(clear_module_state->__pyx_int_153); Py_CLEAR(clear_module_state->__pyx_int_154); Py_CLEAR(clear_module_state->__pyx_int_155); Py_CLEAR(clear_module_state->__pyx_int_156); Py_CLEAR(clear_module_state->__pyx_int_158); Py_CLEAR(clear_module_state->__pyx_int_159); Py_CLEAR(clear_module_state->__pyx_int_160); Py_CLEAR(clear_module_state->__pyx_int_161); Py_CLEAR(clear_module_state->__pyx_int_162); Py_CLEAR(clear_module_state->__pyx_int_163); Py_CLEAR(clear_module_state->__pyx_int_164); Py_CLEAR(clear_module_state->__pyx_int_165); Py_CLEAR(clear_module_state->__pyx_int_166); Py_CLEAR(clear_module_state->__pyx_int_167); Py_CLEAR(clear_module_state->__pyx_int_168); Py_CLEAR(clear_module_state->__pyx_int_169); Py_CLEAR(clear_module_state->__pyx_int_170); Py_CLEAR(clear_module_state->__pyx_int_171); Py_CLEAR(clear_module_state->__pyx_int_172); Py_CLEAR(clear_module_state->__pyx_int_173); Py_CLEAR(clear_module_state->__pyx_int_174); Py_CLEAR(clear_module_state->__pyx_int_175); Py_CLEAR(clear_module_state->__pyx_int_176); Py_CLEAR(clear_module_state->__pyx_int_177); Py_CLEAR(clear_module_state->__pyx_int_178); Py_CLEAR(clear_module_state->__pyx_int_179); Py_CLEAR(clear_module_state->__pyx_int_180); Py_CLEAR(clear_module_state->__pyx_int_181); Py_CLEAR(clear_module_state->__pyx_int_182); Py_CLEAR(clear_module_state->__pyx_int_183); Py_CLEAR(clear_module_state->__pyx_int_184); Py_CLEAR(clear_module_state->__pyx_int_185); Py_CLEAR(clear_module_state->__pyx_int_186); Py_CLEAR(clear_module_state->__pyx_int_187); Py_CLEAR(clear_module_state->__pyx_int_188); Py_CLEAR(clear_module_state->__pyx_int_189); Py_CLEAR(clear_module_state->__pyx_int_190); Py_CLEAR(clear_module_state->__pyx_int_191); Py_CLEAR(clear_module_state->__pyx_int_192); Py_CLEAR(clear_module_state->__pyx_int_193); Py_CLEAR(clear_module_state->__pyx_int_194); Py_CLEAR(clear_module_state->__pyx_int_196); Py_CLEAR(clear_module_state->__pyx_int_197); Py_CLEAR(clear_module_state->__pyx_int_198); Py_CLEAR(clear_module_state->__pyx_int_199); Py_CLEAR(clear_module_state->__pyx_int_200); Py_CLEAR(clear_module_state->__pyx_int_201); Py_CLEAR(clear_module_state->__pyx_int_202); Py_CLEAR(clear_module_state->__pyx_int_203); Py_CLEAR(clear_module_state->__pyx_int_204); Py_CLEAR(clear_module_state->__pyx_int_205); Py_CLEAR(clear_module_state->__pyx_int_206); Py_CLEAR(clear_module_state->__pyx_int_207); Py_CLEAR(clear_module_state->__pyx_int_208); Py_CLEAR(clear_module_state->__pyx_int_209); Py_CLEAR(clear_module_state->__pyx_int_210); Py_CLEAR(clear_module_state->__pyx_int_211); Py_CLEAR(clear_module_state->__pyx_int_212); Py_CLEAR(clear_module_state->__pyx_int_213); Py_CLEAR(clear_module_state->__pyx_int_214); Py_CLEAR(clear_module_state->__pyx_int_215); Py_CLEAR(clear_module_state->__pyx_int_216); Py_CLEAR(clear_module_state->__pyx_int_217); Py_CLEAR(clear_module_state->__pyx_int_218); Py_CLEAR(clear_module_state->__pyx_int_219); Py_CLEAR(clear_module_state->__pyx_int_220); Py_CLEAR(clear_module_state->__pyx_int_221); Py_CLEAR(clear_module_state->__pyx_int_222); Py_CLEAR(clear_module_state->__pyx_int_223); Py_CLEAR(clear_module_state->__pyx_int_224); Py_CLEAR(clear_module_state->__pyx_int_225); Py_CLEAR(clear_module_state->__pyx_int_226); Py_CLEAR(clear_module_state->__pyx_int_227); Py_CLEAR(clear_module_state->__pyx_int_228); Py_CLEAR(clear_module_state->__pyx_int_229); Py_CLEAR(clear_module_state->__pyx_int_230); Py_CLEAR(clear_module_state->__pyx_int_231); Py_CLEAR(clear_module_state->__pyx_int_232); Py_CLEAR(clear_module_state->__pyx_int_233); Py_CLEAR(clear_module_state->__pyx_int_235); Py_CLEAR(clear_module_state->__pyx_int_236); Py_CLEAR(clear_module_state->__pyx_int_237); Py_CLEAR(clear_module_state->__pyx_int_238); Py_CLEAR(clear_module_state->__pyx_int_239); Py_CLEAR(clear_module_state->__pyx_int_240); Py_CLEAR(clear_module_state->__pyx_int_242); Py_CLEAR(clear_module_state->__pyx_int_244); Py_CLEAR(clear_module_state->__pyx_int_245); Py_CLEAR(clear_module_state->__pyx_int_246); Py_CLEAR(clear_module_state->__pyx_int_247); Py_CLEAR(clear_module_state->__pyx_int_248); Py_CLEAR(clear_module_state->__pyx_int_250); Py_CLEAR(clear_module_state->__pyx_int_251); Py_CLEAR(clear_module_state->__pyx_int_252); Py_CLEAR(clear_module_state->__pyx_int_253); Py_CLEAR(clear_module_state->__pyx_int_255); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_slice__4); Py_CLEAR(clear_module_state->__pyx_slice__5); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__26); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__32); Py_CLEAR(clear_module_state->__pyx_tuple__33); Py_CLEAR(clear_module_state->__pyx_tuple__34); Py_CLEAR(clear_module_state->__pyx_tuple__35); Py_CLEAR(clear_module_state->__pyx_tuple__36); Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_tuple__38); Py_CLEAR(clear_module_state->__pyx_tuple__39); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__41); Py_CLEAR(clear_module_state->__pyx_tuple__42); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__44); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_tuple__46); Py_CLEAR(clear_module_state->__pyx_tuple__47); Py_CLEAR(clear_module_state->__pyx_tuple__48); Py_CLEAR(clear_module_state->__pyx_tuple__49); Py_CLEAR(clear_module_state->__pyx_tuple__50); Py_CLEAR(clear_module_state->__pyx_tuple__51); Py_CLEAR(clear_module_state->__pyx_tuple__52); Py_CLEAR(clear_module_state->__pyx_tuple__53); Py_CLEAR(clear_module_state->__pyx_tuple__54); Py_CLEAR(clear_module_state->__pyx_tuple__55); Py_CLEAR(clear_module_state->__pyx_tuple__56); Py_CLEAR(clear_module_state->__pyx_tuple__57); Py_CLEAR(clear_module_state->__pyx_tuple__58); Py_CLEAR(clear_module_state->__pyx_tuple__59); Py_CLEAR(clear_module_state->__pyx_tuple__60); Py_CLEAR(clear_module_state->__pyx_tuple__61); Py_CLEAR(clear_module_state->__pyx_tuple__62); Py_CLEAR(clear_module_state->__pyx_tuple__63); Py_CLEAR(clear_module_state->__pyx_tuple__64); Py_CLEAR(clear_module_state->__pyx_tuple__65); Py_CLEAR(clear_module_state->__pyx_tuple__66); Py_CLEAR(clear_module_state->__pyx_tuple__67); Py_CLEAR(clear_module_state->__pyx_tuple__68); Py_CLEAR(clear_module_state->__pyx_tuple__69); Py_CLEAR(clear_module_state->__pyx_tuple__70); Py_CLEAR(clear_module_state->__pyx_tuple__71); Py_CLEAR(clear_module_state->__pyx_tuple__72); Py_CLEAR(clear_module_state->__pyx_tuple__73); Py_CLEAR(clear_module_state->__pyx_tuple__74); Py_CLEAR(clear_module_state->__pyx_tuple__75); Py_CLEAR(clear_module_state->__pyx_tuple__76); Py_CLEAR(clear_module_state->__pyx_tuple__77); Py_CLEAR(clear_module_state->__pyx_tuple__78); Py_CLEAR(clear_module_state->__pyx_tuple__79); Py_CLEAR(clear_module_state->__pyx_tuple__80); Py_CLEAR(clear_module_state->__pyx_tuple__81); Py_CLEAR(clear_module_state->__pyx_tuple__82); Py_CLEAR(clear_module_state->__pyx_tuple__83); Py_CLEAR(clear_module_state->__pyx_tuple__84); Py_CLEAR(clear_module_state->__pyx_tuple__85); Py_CLEAR(clear_module_state->__pyx_tuple__86); Py_CLEAR(clear_module_state->__pyx_tuple__87); Py_CLEAR(clear_module_state->__pyx_tuple__88); Py_CLEAR(clear_module_state->__pyx_tuple__89); Py_CLEAR(clear_module_state->__pyx_tuple__90); Py_CLEAR(clear_module_state->__pyx_tuple__91); Py_CLEAR(clear_module_state->__pyx_tuple__92); Py_CLEAR(clear_module_state->__pyx_tuple__93); Py_CLEAR(clear_module_state->__pyx_tuple__94); Py_CLEAR(clear_module_state->__pyx_tuple__95); Py_CLEAR(clear_module_state->__pyx_tuple__96); Py_CLEAR(clear_module_state->__pyx_tuple__97); Py_CLEAR(clear_module_state->__pyx_tuple__98); Py_CLEAR(clear_module_state->__pyx_tuple__99); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_tuple__100); Py_CLEAR(clear_module_state->__pyx_tuple__101); Py_CLEAR(clear_module_state->__pyx_tuple__102); Py_CLEAR(clear_module_state->__pyx_tuple__103); Py_CLEAR(clear_module_state->__pyx_tuple__104); Py_CLEAR(clear_module_state->__pyx_tuple__105); Py_CLEAR(clear_module_state->__pyx_tuple__106); Py_CLEAR(clear_module_state->__pyx_tuple__107); Py_CLEAR(clear_module_state->__pyx_tuple__108); Py_CLEAR(clear_module_state->__pyx_tuple__109); Py_CLEAR(clear_module_state->__pyx_tuple__110); Py_CLEAR(clear_module_state->__pyx_tuple__111); Py_CLEAR(clear_module_state->__pyx_tuple__112); Py_CLEAR(clear_module_state->__pyx_tuple__113); Py_CLEAR(clear_module_state->__pyx_tuple__114); Py_CLEAR(clear_module_state->__pyx_tuple__115); Py_CLEAR(clear_module_state->__pyx_tuple__116); Py_CLEAR(clear_module_state->__pyx_tuple__117); Py_CLEAR(clear_module_state->__pyx_tuple__118); Py_CLEAR(clear_module_state->__pyx_tuple__119); Py_CLEAR(clear_module_state->__pyx_tuple__120); Py_CLEAR(clear_module_state->__pyx_tuple__121); Py_CLEAR(clear_module_state->__pyx_tuple__122); Py_CLEAR(clear_module_state->__pyx_tuple__123); Py_CLEAR(clear_module_state->__pyx_tuple__124); Py_CLEAR(clear_module_state->__pyx_tuple__125); Py_CLEAR(clear_module_state->__pyx_tuple__126); Py_CLEAR(clear_module_state->__pyx_tuple__127); Py_CLEAR(clear_module_state->__pyx_tuple__128); Py_CLEAR(clear_module_state->__pyx_tuple__129); Py_CLEAR(clear_module_state->__pyx_tuple__130); Py_CLEAR(clear_module_state->__pyx_tuple__131); Py_CLEAR(clear_module_state->__pyx_tuple__132); Py_CLEAR(clear_module_state->__pyx_tuple__133); Py_CLEAR(clear_module_state->__pyx_tuple__134); Py_CLEAR(clear_module_state->__pyx_tuple__135); Py_CLEAR(clear_module_state->__pyx_tuple__136); Py_CLEAR(clear_module_state->__pyx_tuple__137); Py_CLEAR(clear_module_state->__pyx_tuple__138); Py_CLEAR(clear_module_state->__pyx_tuple__139); Py_CLEAR(clear_module_state->__pyx_tuple__140); Py_CLEAR(clear_module_state->__pyx_tuple__141); Py_CLEAR(clear_module_state->__pyx_tuple__142); Py_CLEAR(clear_module_state->__pyx_tuple__143); Py_CLEAR(clear_module_state->__pyx_tuple__144); Py_CLEAR(clear_module_state->__pyx_tuple__145); Py_CLEAR(clear_module_state->__pyx_tuple__146); Py_CLEAR(clear_module_state->__pyx_tuple__147); Py_CLEAR(clear_module_state->__pyx_tuple__148); Py_CLEAR(clear_module_state->__pyx_tuple__149); Py_CLEAR(clear_module_state->__pyx_tuple__150); Py_CLEAR(clear_module_state->__pyx_tuple__151); Py_CLEAR(clear_module_state->__pyx_tuple__152); Py_CLEAR(clear_module_state->__pyx_tuple__153); Py_CLEAR(clear_module_state->__pyx_tuple__154); Py_CLEAR(clear_module_state->__pyx_tuple__155); Py_CLEAR(clear_module_state->__pyx_tuple__156); Py_CLEAR(clear_module_state->__pyx_tuple__157); Py_CLEAR(clear_module_state->__pyx_tuple__158); Py_CLEAR(clear_module_state->__pyx_tuple__159); Py_CLEAR(clear_module_state->__pyx_tuple__160); Py_CLEAR(clear_module_state->__pyx_tuple__161); Py_CLEAR(clear_module_state->__pyx_tuple__162); Py_CLEAR(clear_module_state->__pyx_tuple__163); Py_CLEAR(clear_module_state->__pyx_tuple__164); Py_CLEAR(clear_module_state->__pyx_tuple__165); Py_CLEAR(clear_module_state->__pyx_tuple__166); Py_CLEAR(clear_module_state->__pyx_tuple__167); Py_CLEAR(clear_module_state->__pyx_tuple__168); Py_CLEAR(clear_module_state->__pyx_tuple__169); Py_CLEAR(clear_module_state->__pyx_tuple__170); Py_CLEAR(clear_module_state->__pyx_tuple__171); Py_CLEAR(clear_module_state->__pyx_tuple__172); Py_CLEAR(clear_module_state->__pyx_tuple__173); Py_CLEAR(clear_module_state->__pyx_tuple__174); Py_CLEAR(clear_module_state->__pyx_tuple__175); Py_CLEAR(clear_module_state->__pyx_tuple__176); Py_CLEAR(clear_module_state->__pyx_tuple__177); Py_CLEAR(clear_module_state->__pyx_tuple__178); Py_CLEAR(clear_module_state->__pyx_tuple__179); Py_CLEAR(clear_module_state->__pyx_tuple__180); Py_CLEAR(clear_module_state->__pyx_tuple__181); Py_CLEAR(clear_module_state->__pyx_tuple__182); Py_CLEAR(clear_module_state->__pyx_tuple__183); Py_CLEAR(clear_module_state->__pyx_tuple__184); Py_CLEAR(clear_module_state->__pyx_tuple__185); Py_CLEAR(clear_module_state->__pyx_tuple__186); Py_CLEAR(clear_module_state->__pyx_tuple__187); Py_CLEAR(clear_module_state->__pyx_tuple__188); Py_CLEAR(clear_module_state->__pyx_tuple__189); Py_CLEAR(clear_module_state->__pyx_tuple__190); Py_CLEAR(clear_module_state->__pyx_tuple__191); Py_CLEAR(clear_module_state->__pyx_tuple__192); Py_CLEAR(clear_module_state->__pyx_tuple__193); Py_CLEAR(clear_module_state->__pyx_tuple__194); Py_CLEAR(clear_module_state->__pyx_tuple__195); Py_CLEAR(clear_module_state->__pyx_tuple__196); Py_CLEAR(clear_module_state->__pyx_tuple__197); Py_CLEAR(clear_module_state->__pyx_tuple__198); Py_CLEAR(clear_module_state->__pyx_tuple__199); Py_CLEAR(clear_module_state->__pyx_tuple__200); Py_CLEAR(clear_module_state->__pyx_tuple__201); Py_CLEAR(clear_module_state->__pyx_tuple__202); Py_CLEAR(clear_module_state->__pyx_tuple__203); Py_CLEAR(clear_module_state->__pyx_tuple__204); Py_CLEAR(clear_module_state->__pyx_tuple__205); Py_CLEAR(clear_module_state->__pyx_tuple__206); Py_CLEAR(clear_module_state->__pyx_tuple__207); Py_CLEAR(clear_module_state->__pyx_tuple__208); Py_CLEAR(clear_module_state->__pyx_tuple__209); Py_CLEAR(clear_module_state->__pyx_tuple__210); Py_CLEAR(clear_module_state->__pyx_tuple__211); Py_CLEAR(clear_module_state->__pyx_tuple__212); Py_CLEAR(clear_module_state->__pyx_tuple__213); Py_CLEAR(clear_module_state->__pyx_tuple__214); Py_CLEAR(clear_module_state->__pyx_tuple__215); Py_CLEAR(clear_module_state->__pyx_tuple__216); Py_CLEAR(clear_module_state->__pyx_tuple__217); Py_CLEAR(clear_module_state->__pyx_tuple__218); Py_CLEAR(clear_module_state->__pyx_tuple__219); Py_CLEAR(clear_module_state->__pyx_tuple__220); Py_CLEAR(clear_module_state->__pyx_tuple__221); Py_CLEAR(clear_module_state->__pyx_tuple__222); Py_CLEAR(clear_module_state->__pyx_tuple__223); Py_CLEAR(clear_module_state->__pyx_tuple__224); Py_CLEAR(clear_module_state->__pyx_tuple__225); Py_CLEAR(clear_module_state->__pyx_tuple__226); Py_CLEAR(clear_module_state->__pyx_tuple__227); Py_CLEAR(clear_module_state->__pyx_tuple__228); Py_CLEAR(clear_module_state->__pyx_tuple__229); Py_CLEAR(clear_module_state->__pyx_tuple__230); Py_CLEAR(clear_module_state->__pyx_tuple__231); Py_CLEAR(clear_module_state->__pyx_tuple__232); Py_CLEAR(clear_module_state->__pyx_tuple__233); Py_CLEAR(clear_module_state->__pyx_tuple__234); Py_CLEAR(clear_module_state->__pyx_tuple__235); Py_CLEAR(clear_module_state->__pyx_tuple__236); Py_CLEAR(clear_module_state->__pyx_tuple__237); Py_CLEAR(clear_module_state->__pyx_tuple__238); Py_CLEAR(clear_module_state->__pyx_tuple__239); Py_CLEAR(clear_module_state->__pyx_tuple__240); Py_CLEAR(clear_module_state->__pyx_tuple__241); Py_CLEAR(clear_module_state->__pyx_tuple__242); Py_CLEAR(clear_module_state->__pyx_tuple__243); Py_CLEAR(clear_module_state->__pyx_tuple__244); Py_CLEAR(clear_module_state->__pyx_tuple__245); Py_CLEAR(clear_module_state->__pyx_tuple__246); Py_CLEAR(clear_module_state->__pyx_tuple__247); Py_CLEAR(clear_module_state->__pyx_tuple__248); Py_CLEAR(clear_module_state->__pyx_tuple__249); Py_CLEAR(clear_module_state->__pyx_tuple__250); Py_CLEAR(clear_module_state->__pyx_tuple__251); Py_CLEAR(clear_module_state->__pyx_tuple__252); Py_CLEAR(clear_module_state->__pyx_tuple__253); Py_CLEAR(clear_module_state->__pyx_tuple__254); Py_CLEAR(clear_module_state->__pyx_tuple__255); Py_CLEAR(clear_module_state->__pyx_tuple__256); Py_CLEAR(clear_module_state->__pyx_tuple__257); Py_CLEAR(clear_module_state->__pyx_tuple__258); Py_CLEAR(clear_module_state->__pyx_tuple__259); Py_CLEAR(clear_module_state->__pyx_tuple__260); Py_CLEAR(clear_module_state->__pyx_tuple__261); Py_CLEAR(clear_module_state->__pyx_tuple__262); Py_CLEAR(clear_module_state->__pyx_tuple__263); Py_CLEAR(clear_module_state->__pyx_tuple__264); Py_CLEAR(clear_module_state->__pyx_tuple__265); Py_CLEAR(clear_module_state->__pyx_tuple__266); Py_CLEAR(clear_module_state->__pyx_tuple__267); Py_CLEAR(clear_module_state->__pyx_tuple__268); Py_CLEAR(clear_module_state->__pyx_tuple__269); Py_CLEAR(clear_module_state->__pyx_tuple__270); Py_CLEAR(clear_module_state->__pyx_tuple__271); Py_CLEAR(clear_module_state->__pyx_tuple__272); Py_CLEAR(clear_module_state->__pyx_tuple__273); Py_CLEAR(clear_module_state->__pyx_tuple__274); Py_CLEAR(clear_module_state->__pyx_tuple__275); Py_CLEAR(clear_module_state->__pyx_tuple__276); Py_CLEAR(clear_module_state->__pyx_tuple__277); Py_CLEAR(clear_module_state->__pyx_tuple__278); Py_CLEAR(clear_module_state->__pyx_tuple__279); Py_CLEAR(clear_module_state->__pyx_tuple__280); Py_CLEAR(clear_module_state->__pyx_tuple__281); Py_CLEAR(clear_module_state->__pyx_tuple__282); Py_CLEAR(clear_module_state->__pyx_tuple__283); Py_CLEAR(clear_module_state->__pyx_tuple__284); Py_CLEAR(clear_module_state->__pyx_tuple__285); Py_CLEAR(clear_module_state->__pyx_tuple__286); Py_CLEAR(clear_module_state->__pyx_tuple__287); Py_CLEAR(clear_module_state->__pyx_tuple__288); Py_CLEAR(clear_module_state->__pyx_tuple__289); Py_CLEAR(clear_module_state->__pyx_tuple__290); Py_CLEAR(clear_module_state->__pyx_tuple__291); Py_CLEAR(clear_module_state->__pyx_tuple__292); Py_CLEAR(clear_module_state->__pyx_tuple__293); Py_CLEAR(clear_module_state->__pyx_tuple__294); Py_CLEAR(clear_module_state->__pyx_tuple__295); Py_CLEAR(clear_module_state->__pyx_tuple__296); Py_CLEAR(clear_module_state->__pyx_tuple__297); Py_CLEAR(clear_module_state->__pyx_tuple__298); Py_CLEAR(clear_module_state->__pyx_tuple__299); Py_CLEAR(clear_module_state->__pyx_tuple__300); Py_CLEAR(clear_module_state->__pyx_tuple__301); Py_CLEAR(clear_module_state->__pyx_tuple__302); Py_CLEAR(clear_module_state->__pyx_tuple__303); Py_CLEAR(clear_module_state->__pyx_tuple__304); Py_CLEAR(clear_module_state->__pyx_tuple__305); Py_CLEAR(clear_module_state->__pyx_tuple__306); Py_CLEAR(clear_module_state->__pyx_tuple__307); Py_CLEAR(clear_module_state->__pyx_tuple__308); Py_CLEAR(clear_module_state->__pyx_tuple__309); Py_CLEAR(clear_module_state->__pyx_tuple__310); Py_CLEAR(clear_module_state->__pyx_tuple__311); Py_CLEAR(clear_module_state->__pyx_tuple__312); Py_CLEAR(clear_module_state->__pyx_tuple__313); Py_CLEAR(clear_module_state->__pyx_tuple__314); Py_CLEAR(clear_module_state->__pyx_tuple__315); Py_CLEAR(clear_module_state->__pyx_tuple__316); Py_CLEAR(clear_module_state->__pyx_tuple__317); Py_CLEAR(clear_module_state->__pyx_tuple__318); Py_CLEAR(clear_module_state->__pyx_tuple__319); Py_CLEAR(clear_module_state->__pyx_tuple__320); Py_CLEAR(clear_module_state->__pyx_tuple__321); Py_CLEAR(clear_module_state->__pyx_tuple__322); Py_CLEAR(clear_module_state->__pyx_tuple__323); Py_CLEAR(clear_module_state->__pyx_tuple__324); Py_CLEAR(clear_module_state->__pyx_tuple__325); Py_CLEAR(clear_module_state->__pyx_tuple__326); Py_CLEAR(clear_module_state->__pyx_tuple__327); Py_CLEAR(clear_module_state->__pyx_tuple__328); Py_CLEAR(clear_module_state->__pyx_tuple__329); Py_CLEAR(clear_module_state->__pyx_tuple__330); Py_CLEAR(clear_module_state->__pyx_tuple__331); Py_CLEAR(clear_module_state->__pyx_tuple__332); Py_CLEAR(clear_module_state->__pyx_tuple__333); Py_CLEAR(clear_module_state->__pyx_tuple__334); Py_CLEAR(clear_module_state->__pyx_tuple__335); Py_CLEAR(clear_module_state->__pyx_tuple__336); Py_CLEAR(clear_module_state->__pyx_tuple__337); Py_CLEAR(clear_module_state->__pyx_tuple__338); Py_CLEAR(clear_module_state->__pyx_tuple__339); Py_CLEAR(clear_module_state->__pyx_tuple__340); Py_CLEAR(clear_module_state->__pyx_tuple__341); Py_CLEAR(clear_module_state->__pyx_tuple__342); Py_CLEAR(clear_module_state->__pyx_tuple__343); Py_CLEAR(clear_module_state->__pyx_tuple__344); Py_CLEAR(clear_module_state->__pyx_tuple__345); Py_CLEAR(clear_module_state->__pyx_tuple__346); Py_CLEAR(clear_module_state->__pyx_tuple__347); Py_CLEAR(clear_module_state->__pyx_tuple__348); Py_CLEAR(clear_module_state->__pyx_tuple__349); Py_CLEAR(clear_module_state->__pyx_tuple__350); Py_CLEAR(clear_module_state->__pyx_tuple__351); Py_CLEAR(clear_module_state->__pyx_tuple__352); Py_CLEAR(clear_module_state->__pyx_tuple__353); Py_CLEAR(clear_module_state->__pyx_tuple__354); Py_CLEAR(clear_module_state->__pyx_tuple__355); Py_CLEAR(clear_module_state->__pyx_tuple__356); Py_CLEAR(clear_module_state->__pyx_tuple__357); Py_CLEAR(clear_module_state->__pyx_tuple__358); Py_CLEAR(clear_module_state->__pyx_tuple__359); Py_CLEAR(clear_module_state->__pyx_tuple__360); Py_CLEAR(clear_module_state->__pyx_tuple__361); Py_CLEAR(clear_module_state->__pyx_tuple__362); Py_CLEAR(clear_module_state->__pyx_tuple__363); Py_CLEAR(clear_module_state->__pyx_tuple__364); Py_CLEAR(clear_module_state->__pyx_tuple__365); Py_CLEAR(clear_module_state->__pyx_tuple__366); Py_CLEAR(clear_module_state->__pyx_tuple__367); Py_CLEAR(clear_module_state->__pyx_tuple__368); Py_CLEAR(clear_module_state->__pyx_tuple__369); Py_CLEAR(clear_module_state->__pyx_tuple__370); Py_CLEAR(clear_module_state->__pyx_tuple__371); Py_CLEAR(clear_module_state->__pyx_tuple__372); Py_CLEAR(clear_module_state->__pyx_tuple__373); Py_CLEAR(clear_module_state->__pyx_tuple__374); Py_CLEAR(clear_module_state->__pyx_tuple__375); Py_CLEAR(clear_module_state->__pyx_tuple__376); Py_CLEAR(clear_module_state->__pyx_tuple__377); Py_CLEAR(clear_module_state->__pyx_tuple__378); Py_CLEAR(clear_module_state->__pyx_tuple__379); Py_CLEAR(clear_module_state->__pyx_tuple__380); Py_CLEAR(clear_module_state->__pyx_tuple__381); Py_CLEAR(clear_module_state->__pyx_tuple__382); Py_CLEAR(clear_module_state->__pyx_tuple__383); Py_CLEAR(clear_module_state->__pyx_tuple__384); Py_CLEAR(clear_module_state->__pyx_tuple__385); Py_CLEAR(clear_module_state->__pyx_tuple__386); Py_CLEAR(clear_module_state->__pyx_tuple__387); Py_CLEAR(clear_module_state->__pyx_tuple__388); Py_CLEAR(clear_module_state->__pyx_tuple__389); Py_CLEAR(clear_module_state->__pyx_tuple__390); Py_CLEAR(clear_module_state->__pyx_tuple__391); Py_CLEAR(clear_module_state->__pyx_tuple__392); Py_CLEAR(clear_module_state->__pyx_tuple__393); Py_CLEAR(clear_module_state->__pyx_tuple__394); Py_CLEAR(clear_module_state->__pyx_tuple__395); Py_CLEAR(clear_module_state->__pyx_tuple__396); Py_CLEAR(clear_module_state->__pyx_tuple__397); Py_CLEAR(clear_module_state->__pyx_tuple__398); Py_CLEAR(clear_module_state->__pyx_tuple__399); Py_CLEAR(clear_module_state->__pyx_tuple__400); Py_CLEAR(clear_module_state->__pyx_tuple__401); Py_CLEAR(clear_module_state->__pyx_tuple__402); Py_CLEAR(clear_module_state->__pyx_tuple__403); Py_CLEAR(clear_module_state->__pyx_tuple__404); Py_CLEAR(clear_module_state->__pyx_tuple__405); Py_CLEAR(clear_module_state->__pyx_tuple__406); Py_CLEAR(clear_module_state->__pyx_tuple__407); Py_CLEAR(clear_module_state->__pyx_tuple__408); Py_CLEAR(clear_module_state->__pyx_tuple__409); Py_CLEAR(clear_module_state->__pyx_tuple__410); Py_CLEAR(clear_module_state->__pyx_tuple__411); Py_CLEAR(clear_module_state->__pyx_tuple__412); Py_CLEAR(clear_module_state->__pyx_tuple__413); Py_CLEAR(clear_module_state->__pyx_tuple__414); Py_CLEAR(clear_module_state->__pyx_tuple__415); Py_CLEAR(clear_module_state->__pyx_tuple__416); Py_CLEAR(clear_module_state->__pyx_tuple__417); Py_CLEAR(clear_module_state->__pyx_tuple__418); Py_CLEAR(clear_module_state->__pyx_tuple__419); Py_CLEAR(clear_module_state->__pyx_tuple__420); Py_CLEAR(clear_module_state->__pyx_tuple__421); Py_CLEAR(clear_module_state->__pyx_tuple__422); Py_CLEAR(clear_module_state->__pyx_tuple__423); Py_CLEAR(clear_module_state->__pyx_tuple__424); Py_CLEAR(clear_module_state->__pyx_tuple__425); Py_CLEAR(clear_module_state->__pyx_tuple__426); Py_CLEAR(clear_module_state->__pyx_tuple__427); Py_CLEAR(clear_module_state->__pyx_tuple__428); Py_CLEAR(clear_module_state->__pyx_tuple__429); Py_CLEAR(clear_module_state->__pyx_tuple__430); Py_CLEAR(clear_module_state->__pyx_tuple__431); Py_CLEAR(clear_module_state->__pyx_tuple__432); Py_CLEAR(clear_module_state->__pyx_tuple__433); Py_CLEAR(clear_module_state->__pyx_tuple__434); Py_CLEAR(clear_module_state->__pyx_tuple__435); Py_CLEAR(clear_module_state->__pyx_tuple__436); Py_CLEAR(clear_module_state->__pyx_tuple__437); Py_CLEAR(clear_module_state->__pyx_tuple__438); Py_CLEAR(clear_module_state->__pyx_tuple__439); Py_CLEAR(clear_module_state->__pyx_tuple__440); Py_CLEAR(clear_module_state->__pyx_tuple__441); Py_CLEAR(clear_module_state->__pyx_tuple__442); Py_CLEAR(clear_module_state->__pyx_tuple__443); Py_CLEAR(clear_module_state->__pyx_tuple__444); Py_CLEAR(clear_module_state->__pyx_tuple__445); Py_CLEAR(clear_module_state->__pyx_tuple__446); Py_CLEAR(clear_module_state->__pyx_tuple__447); Py_CLEAR(clear_module_state->__pyx_tuple__448); Py_CLEAR(clear_module_state->__pyx_tuple__449); Py_CLEAR(clear_module_state->__pyx_tuple__450); Py_CLEAR(clear_module_state->__pyx_tuple__451); Py_CLEAR(clear_module_state->__pyx_tuple__452); Py_CLEAR(clear_module_state->__pyx_tuple__453); Py_CLEAR(clear_module_state->__pyx_tuple__454); Py_CLEAR(clear_module_state->__pyx_tuple__455); Py_CLEAR(clear_module_state->__pyx_tuple__456); Py_CLEAR(clear_module_state->__pyx_tuple__457); Py_CLEAR(clear_module_state->__pyx_tuple__458); Py_CLEAR(clear_module_state->__pyx_tuple__459); Py_CLEAR(clear_module_state->__pyx_tuple__460); Py_CLEAR(clear_module_state->__pyx_tuple__461); Py_CLEAR(clear_module_state->__pyx_tuple__462); Py_CLEAR(clear_module_state->__pyx_tuple__463); Py_CLEAR(clear_module_state->__pyx_tuple__464); Py_CLEAR(clear_module_state->__pyx_tuple__465); Py_CLEAR(clear_module_state->__pyx_tuple__466); Py_CLEAR(clear_module_state->__pyx_tuple__467); Py_CLEAR(clear_module_state->__pyx_tuple__468); Py_CLEAR(clear_module_state->__pyx_tuple__469); Py_CLEAR(clear_module_state->__pyx_tuple__470); Py_CLEAR(clear_module_state->__pyx_tuple__471); Py_CLEAR(clear_module_state->__pyx_tuple__472); Py_CLEAR(clear_module_state->__pyx_tuple__473); Py_CLEAR(clear_module_state->__pyx_tuple__474); Py_CLEAR(clear_module_state->__pyx_tuple__475); Py_CLEAR(clear_module_state->__pyx_tuple__476); Py_CLEAR(clear_module_state->__pyx_tuple__477); Py_CLEAR(clear_module_state->__pyx_tuple__478); Py_CLEAR(clear_module_state->__pyx_tuple__479); Py_CLEAR(clear_module_state->__pyx_tuple__480); Py_CLEAR(clear_module_state->__pyx_tuple__481); Py_CLEAR(clear_module_state->__pyx_tuple__482); Py_CLEAR(clear_module_state->__pyx_tuple__483); Py_CLEAR(clear_module_state->__pyx_tuple__484); Py_CLEAR(clear_module_state->__pyx_tuple__485); Py_CLEAR(clear_module_state->__pyx_tuple__486); Py_CLEAR(clear_module_state->__pyx_tuple__487); Py_CLEAR(clear_module_state->__pyx_tuple__488); Py_CLEAR(clear_module_state->__pyx_tuple__489); Py_CLEAR(clear_module_state->__pyx_tuple__490); Py_CLEAR(clear_module_state->__pyx_tuple__491); Py_CLEAR(clear_module_state->__pyx_tuple__492); Py_CLEAR(clear_module_state->__pyx_tuple__493); Py_CLEAR(clear_module_state->__pyx_tuple__494); Py_CLEAR(clear_module_state->__pyx_tuple__495); Py_CLEAR(clear_module_state->__pyx_tuple__496); Py_CLEAR(clear_module_state->__pyx_tuple__497); Py_CLEAR(clear_module_state->__pyx_tuple__498); Py_CLEAR(clear_module_state->__pyx_tuple__499); Py_CLEAR(clear_module_state->__pyx_tuple__500); Py_CLEAR(clear_module_state->__pyx_tuple__501); Py_CLEAR(clear_module_state->__pyx_tuple__502); Py_CLEAR(clear_module_state->__pyx_tuple__503); Py_CLEAR(clear_module_state->__pyx_tuple__504); Py_CLEAR(clear_module_state->__pyx_tuple__505); Py_CLEAR(clear_module_state->__pyx_tuple__506); Py_CLEAR(clear_module_state->__pyx_tuple__507); Py_CLEAR(clear_module_state->__pyx_tuple__508); Py_CLEAR(clear_module_state->__pyx_tuple__509); Py_CLEAR(clear_module_state->__pyx_tuple__510); Py_CLEAR(clear_module_state->__pyx_tuple__511); Py_CLEAR(clear_module_state->__pyx_tuple__512); Py_CLEAR(clear_module_state->__pyx_tuple__513); Py_CLEAR(clear_module_state->__pyx_tuple__514); Py_CLEAR(clear_module_state->__pyx_tuple__517); Py_CLEAR(clear_module_state->__pyx_tuple__519); Py_CLEAR(clear_module_state->__pyx_tuple__521); Py_CLEAR(clear_module_state->__pyx_codeobj__515); Py_CLEAR(clear_module_state->__pyx_codeobj__516); Py_CLEAR(clear_module_state->__pyx_codeobj__518); Py_CLEAR(clear_module_state->__pyx_codeobj__520); Py_CLEAR(clear_module_state->__pyx_codeobj__522); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_5color_Color); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma); Py_VISIT(traverse_module_state->__pyx_kp_s_08x); Py_VISIT(traverse_module_state->__pyx_kp_s_0x); Py_VISIT(traverse_module_state->__pyx_n_s_BBB); Py_VISIT(traverse_module_state->__pyx_n_s_BBBB); Py_VISIT(traverse_module_state->__pyx_n_s_Color); Py_VISIT(traverse_module_state->__pyx_n_s_Color___reduce); Py_VISIT(traverse_module_state->__pyx_n_s_Color___setstate); Py_VISIT(traverse_module_state->__pyx_n_s_Color_correct_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_Color_from_hex_locals_lambda); Py_VISIT(traverse_module_state->__pyx_n_s_Color_normalize); Py_VISIT(traverse_module_state->__pyx_n_s_Color_set_length); Py_VISIT(traverse_module_state->__pyx_kp_s_Expected_a_color); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); Py_VISIT(traverse_module_state->__pyx_kp_s_L); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_n_s__10); Py_VISIT(traverse_module_state->__pyx_kp_s__2); Py_VISIT(traverse_module_state->__pyx_kp_s__3); Py_VISIT(traverse_module_state->__pyx_n_s__523); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_s_aliceblue); Py_VISIT(traverse_module_state->__pyx_n_s_antiquewhite); Py_VISIT(traverse_module_state->__pyx_n_s_antiquewhite1); Py_VISIT(traverse_module_state->__pyx_n_s_antiquewhite2); Py_VISIT(traverse_module_state->__pyx_n_s_antiquewhite3); Py_VISIT(traverse_module_state->__pyx_n_s_antiquewhite4); Py_VISIT(traverse_module_state->__pyx_n_s_aquamarine); Py_VISIT(traverse_module_state->__pyx_n_s_aquamarine1); Py_VISIT(traverse_module_state->__pyx_n_s_aquamarine2); Py_VISIT(traverse_module_state->__pyx_n_s_aquamarine3); Py_VISIT(traverse_module_state->__pyx_n_s_aquamarine4); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_azure); Py_VISIT(traverse_module_state->__pyx_n_s_azure1); Py_VISIT(traverse_module_state->__pyx_n_s_azure2); Py_VISIT(traverse_module_state->__pyx_n_s_azure3); Py_VISIT(traverse_module_state->__pyx_n_s_azure4); Py_VISIT(traverse_module_state->__pyx_n_s_b); Py_VISIT(traverse_module_state->__pyx_n_s_beige); Py_VISIT(traverse_module_state->__pyx_n_s_binascii); Py_VISIT(traverse_module_state->__pyx_n_s_bisque); Py_VISIT(traverse_module_state->__pyx_n_s_bisque1); Py_VISIT(traverse_module_state->__pyx_n_s_bisque2); Py_VISIT(traverse_module_state->__pyx_n_s_bisque3); Py_VISIT(traverse_module_state->__pyx_n_s_bisque4); Py_VISIT(traverse_module_state->__pyx_n_s_black); Py_VISIT(traverse_module_state->__pyx_n_s_blanchedalmond); Py_VISIT(traverse_module_state->__pyx_n_s_blue); Py_VISIT(traverse_module_state->__pyx_n_s_blue1); Py_VISIT(traverse_module_state->__pyx_n_s_blue2); Py_VISIT(traverse_module_state->__pyx_n_s_blue3); Py_VISIT(traverse_module_state->__pyx_n_s_blue4); Py_VISIT(traverse_module_state->__pyx_n_s_blueviolet); Py_VISIT(traverse_module_state->__pyx_n_s_brown); Py_VISIT(traverse_module_state->__pyx_n_s_brown1); Py_VISIT(traverse_module_state->__pyx_n_s_brown2); Py_VISIT(traverse_module_state->__pyx_n_s_brown3); Py_VISIT(traverse_module_state->__pyx_n_s_brown4); Py_VISIT(traverse_module_state->__pyx_n_s_burlywood); Py_VISIT(traverse_module_state->__pyx_n_s_burlywood1); Py_VISIT(traverse_module_state->__pyx_n_s_burlywood2); Py_VISIT(traverse_module_state->__pyx_n_s_burlywood3); Py_VISIT(traverse_module_state->__pyx_n_s_burlywood4); Py_VISIT(traverse_module_state->__pyx_n_s_c); Py_VISIT(traverse_module_state->__pyx_n_s_cadetblue); Py_VISIT(traverse_module_state->__pyx_n_s_cadetblue1); Py_VISIT(traverse_module_state->__pyx_n_s_cadetblue2); Py_VISIT(traverse_module_state->__pyx_n_s_cadetblue3); Py_VISIT(traverse_module_state->__pyx_n_s_cadetblue4); Py_VISIT(traverse_module_state->__pyx_n_s_chartreuse); Py_VISIT(traverse_module_state->__pyx_n_s_chartreuse1); Py_VISIT(traverse_module_state->__pyx_n_s_chartreuse2); Py_VISIT(traverse_module_state->__pyx_n_s_chartreuse3); Py_VISIT(traverse_module_state->__pyx_n_s_chartreuse4); Py_VISIT(traverse_module_state->__pyx_n_s_chocolate); Py_VISIT(traverse_module_state->__pyx_n_s_chocolate1); Py_VISIT(traverse_module_state->__pyx_n_s_chocolate2); Py_VISIT(traverse_module_state->__pyx_n_s_chocolate3); Py_VISIT(traverse_module_state->__pyx_n_s_chocolate4); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_coral); Py_VISIT(traverse_module_state->__pyx_n_s_coral1); Py_VISIT(traverse_module_state->__pyx_n_s_coral2); Py_VISIT(traverse_module_state->__pyx_n_s_coral3); Py_VISIT(traverse_module_state->__pyx_n_s_coral4); Py_VISIT(traverse_module_state->__pyx_n_s_cornflowerblue); Py_VISIT(traverse_module_state->__pyx_n_s_cornsilk); Py_VISIT(traverse_module_state->__pyx_n_s_cornsilk1); Py_VISIT(traverse_module_state->__pyx_n_s_cornsilk2); Py_VISIT(traverse_module_state->__pyx_n_s_cornsilk3); Py_VISIT(traverse_module_state->__pyx_n_s_cornsilk4); Py_VISIT(traverse_module_state->__pyx_n_s_correct_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_correct_gamma_locals_lambda); Py_VISIT(traverse_module_state->__pyx_n_s_cyan); Py_VISIT(traverse_module_state->__pyx_n_s_cyan1); Py_VISIT(traverse_module_state->__pyx_n_s_cyan2); Py_VISIT(traverse_module_state->__pyx_n_s_cyan3); Py_VISIT(traverse_module_state->__pyx_n_s_cyan4); Py_VISIT(traverse_module_state->__pyx_n_s_d); Py_VISIT(traverse_module_state->__pyx_n_s_darkblue); Py_VISIT(traverse_module_state->__pyx_n_s_darkcyan); Py_VISIT(traverse_module_state->__pyx_n_s_darkgoldenrod); Py_VISIT(traverse_module_state->__pyx_n_s_darkgoldenrod1); Py_VISIT(traverse_module_state->__pyx_n_s_darkgoldenrod2); Py_VISIT(traverse_module_state->__pyx_n_s_darkgoldenrod3); Py_VISIT(traverse_module_state->__pyx_n_s_darkgoldenrod4); Py_VISIT(traverse_module_state->__pyx_n_s_darkgray); Py_VISIT(traverse_module_state->__pyx_n_s_darkgreen); Py_VISIT(traverse_module_state->__pyx_n_s_darkgrey); Py_VISIT(traverse_module_state->__pyx_n_s_darkkhaki); Py_VISIT(traverse_module_state->__pyx_n_s_darkmagenta); Py_VISIT(traverse_module_state->__pyx_n_s_darkolivegreen); Py_VISIT(traverse_module_state->__pyx_n_s_darkolivegreen1); Py_VISIT(traverse_module_state->__pyx_n_s_darkolivegreen2); Py_VISIT(traverse_module_state->__pyx_n_s_darkolivegreen3); Py_VISIT(traverse_module_state->__pyx_n_s_darkolivegreen4); Py_VISIT(traverse_module_state->__pyx_n_s_darkorange); Py_VISIT(traverse_module_state->__pyx_n_s_darkorange1); Py_VISIT(traverse_module_state->__pyx_n_s_darkorange2); Py_VISIT(traverse_module_state->__pyx_n_s_darkorange3); Py_VISIT(traverse_module_state->__pyx_n_s_darkorange4); Py_VISIT(traverse_module_state->__pyx_n_s_darkorchid); Py_VISIT(traverse_module_state->__pyx_n_s_darkorchid1); Py_VISIT(traverse_module_state->__pyx_n_s_darkorchid2); Py_VISIT(traverse_module_state->__pyx_n_s_darkorchid3); Py_VISIT(traverse_module_state->__pyx_n_s_darkorchid4); Py_VISIT(traverse_module_state->__pyx_n_s_darkred); Py_VISIT(traverse_module_state->__pyx_n_s_darksalmon); Py_VISIT(traverse_module_state->__pyx_n_s_darkseagreen); Py_VISIT(traverse_module_state->__pyx_n_s_darkseagreen1); Py_VISIT(traverse_module_state->__pyx_n_s_darkseagreen2); Py_VISIT(traverse_module_state->__pyx_n_s_darkseagreen3); Py_VISIT(traverse_module_state->__pyx_n_s_darkseagreen4); Py_VISIT(traverse_module_state->__pyx_n_s_darkslateblue); Py_VISIT(traverse_module_state->__pyx_n_s_darkslategray); Py_VISIT(traverse_module_state->__pyx_n_s_darkslategray1); Py_VISIT(traverse_module_state->__pyx_n_s_darkslategray2); Py_VISIT(traverse_module_state->__pyx_n_s_darkslategray3); Py_VISIT(traverse_module_state->__pyx_n_s_darkslategray4); Py_VISIT(traverse_module_state->__pyx_n_s_darkslategrey); Py_VISIT(traverse_module_state->__pyx_n_s_darkturquoise); Py_VISIT(traverse_module_state->__pyx_n_s_darkviolet); Py_VISIT(traverse_module_state->__pyx_n_s_debianred); Py_VISIT(traverse_module_state->__pyx_n_s_deeppink); Py_VISIT(traverse_module_state->__pyx_n_s_deeppink1); Py_VISIT(traverse_module_state->__pyx_n_s_deeppink2); Py_VISIT(traverse_module_state->__pyx_n_s_deeppink3); Py_VISIT(traverse_module_state->__pyx_n_s_deeppink4); Py_VISIT(traverse_module_state->__pyx_n_s_deepskyblue); Py_VISIT(traverse_module_state->__pyx_n_s_deepskyblue1); Py_VISIT(traverse_module_state->__pyx_n_s_deepskyblue2); Py_VISIT(traverse_module_state->__pyx_n_s_deepskyblue3); Py_VISIT(traverse_module_state->__pyx_n_s_deepskyblue4); Py_VISIT(traverse_module_state->__pyx_n_s_dimgray); Py_VISIT(traverse_module_state->__pyx_n_s_dimgrey); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_div); Py_VISIT(traverse_module_state->__pyx_n_s_dodgerblue); Py_VISIT(traverse_module_state->__pyx_n_s_dodgerblue1); Py_VISIT(traverse_module_state->__pyx_n_s_dodgerblue2); Py_VISIT(traverse_module_state->__pyx_n_s_dodgerblue3); Py_VISIT(traverse_module_state->__pyx_n_s_dodgerblue4); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_firebrick); Py_VISIT(traverse_module_state->__pyx_n_s_firebrick1); Py_VISIT(traverse_module_state->__pyx_n_s_firebrick2); Py_VISIT(traverse_module_state->__pyx_n_s_firebrick3); Py_VISIT(traverse_module_state->__pyx_n_s_firebrick4); Py_VISIT(traverse_module_state->__pyx_n_s_floordiv___locals_div); Py_VISIT(traverse_module_state->__pyx_n_s_floralwhite); Py_VISIT(traverse_module_state->__pyx_n_s_forestgreen); Py_VISIT(traverse_module_state->__pyx_n_s_g); Py_VISIT(traverse_module_state->__pyx_n_s_gainsboro); Py_VISIT(traverse_module_state->__pyx_n_s_gamma); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_ghostwhite); Py_VISIT(traverse_module_state->__pyx_n_s_gold); Py_VISIT(traverse_module_state->__pyx_n_s_gold1); Py_VISIT(traverse_module_state->__pyx_n_s_gold2); Py_VISIT(traverse_module_state->__pyx_n_s_gold3); Py_VISIT(traverse_module_state->__pyx_n_s_gold4); Py_VISIT(traverse_module_state->__pyx_n_s_goldenrod); Py_VISIT(traverse_module_state->__pyx_n_s_goldenrod1); Py_VISIT(traverse_module_state->__pyx_n_s_goldenrod2); Py_VISIT(traverse_module_state->__pyx_n_s_goldenrod3); Py_VISIT(traverse_module_state->__pyx_n_s_goldenrod4); Py_VISIT(traverse_module_state->__pyx_n_s_gray); Py_VISIT(traverse_module_state->__pyx_n_s_gray0); Py_VISIT(traverse_module_state->__pyx_n_s_gray1); Py_VISIT(traverse_module_state->__pyx_n_s_gray10); Py_VISIT(traverse_module_state->__pyx_n_s_gray100); Py_VISIT(traverse_module_state->__pyx_n_s_gray11); Py_VISIT(traverse_module_state->__pyx_n_s_gray12); Py_VISIT(traverse_module_state->__pyx_n_s_gray13); Py_VISIT(traverse_module_state->__pyx_n_s_gray14); Py_VISIT(traverse_module_state->__pyx_n_s_gray15); Py_VISIT(traverse_module_state->__pyx_n_s_gray16); Py_VISIT(traverse_module_state->__pyx_n_s_gray17); Py_VISIT(traverse_module_state->__pyx_n_s_gray18); Py_VISIT(traverse_module_state->__pyx_n_s_gray19); Py_VISIT(traverse_module_state->__pyx_n_s_gray2); Py_VISIT(traverse_module_state->__pyx_n_s_gray20); Py_VISIT(traverse_module_state->__pyx_n_s_gray21); Py_VISIT(traverse_module_state->__pyx_n_s_gray22); Py_VISIT(traverse_module_state->__pyx_n_s_gray23); Py_VISIT(traverse_module_state->__pyx_n_s_gray24); Py_VISIT(traverse_module_state->__pyx_n_s_gray25); Py_VISIT(traverse_module_state->__pyx_n_s_gray26); Py_VISIT(traverse_module_state->__pyx_n_s_gray27); Py_VISIT(traverse_module_state->__pyx_n_s_gray28); Py_VISIT(traverse_module_state->__pyx_n_s_gray29); Py_VISIT(traverse_module_state->__pyx_n_s_gray3); Py_VISIT(traverse_module_state->__pyx_n_s_gray30); Py_VISIT(traverse_module_state->__pyx_n_s_gray31); Py_VISIT(traverse_module_state->__pyx_n_s_gray32); Py_VISIT(traverse_module_state->__pyx_n_s_gray33); Py_VISIT(traverse_module_state->__pyx_n_s_gray34); Py_VISIT(traverse_module_state->__pyx_n_s_gray35); Py_VISIT(traverse_module_state->__pyx_n_s_gray36); Py_VISIT(traverse_module_state->__pyx_n_s_gray37); Py_VISIT(traverse_module_state->__pyx_n_s_gray38); Py_VISIT(traverse_module_state->__pyx_n_s_gray39); Py_VISIT(traverse_module_state->__pyx_n_s_gray4); Py_VISIT(traverse_module_state->__pyx_n_s_gray40); Py_VISIT(traverse_module_state->__pyx_n_s_gray41); Py_VISIT(traverse_module_state->__pyx_n_s_gray42); Py_VISIT(traverse_module_state->__pyx_n_s_gray43); Py_VISIT(traverse_module_state->__pyx_n_s_gray44); Py_VISIT(traverse_module_state->__pyx_n_s_gray45); Py_VISIT(traverse_module_state->__pyx_n_s_gray46); Py_VISIT(traverse_module_state->__pyx_n_s_gray47); Py_VISIT(traverse_module_state->__pyx_n_s_gray48); Py_VISIT(traverse_module_state->__pyx_n_s_gray49); Py_VISIT(traverse_module_state->__pyx_n_s_gray5); Py_VISIT(traverse_module_state->__pyx_n_s_gray50); Py_VISIT(traverse_module_state->__pyx_n_s_gray51); Py_VISIT(traverse_module_state->__pyx_n_s_gray52); Py_VISIT(traverse_module_state->__pyx_n_s_gray53); Py_VISIT(traverse_module_state->__pyx_n_s_gray54); Py_VISIT(traverse_module_state->__pyx_n_s_gray55); Py_VISIT(traverse_module_state->__pyx_n_s_gray56); Py_VISIT(traverse_module_state->__pyx_n_s_gray57); Py_VISIT(traverse_module_state->__pyx_n_s_gray58); Py_VISIT(traverse_module_state->__pyx_n_s_gray59); Py_VISIT(traverse_module_state->__pyx_n_s_gray6); Py_VISIT(traverse_module_state->__pyx_n_s_gray60); Py_VISIT(traverse_module_state->__pyx_n_s_gray61); Py_VISIT(traverse_module_state->__pyx_n_s_gray62); Py_VISIT(traverse_module_state->__pyx_n_s_gray63); Py_VISIT(traverse_module_state->__pyx_n_s_gray64); Py_VISIT(traverse_module_state->__pyx_n_s_gray65); Py_VISIT(traverse_module_state->__pyx_n_s_gray66); Py_VISIT(traverse_module_state->__pyx_n_s_gray67); Py_VISIT(traverse_module_state->__pyx_n_s_gray68); Py_VISIT(traverse_module_state->__pyx_n_s_gray69); Py_VISIT(traverse_module_state->__pyx_n_s_gray7); Py_VISIT(traverse_module_state->__pyx_n_s_gray70); Py_VISIT(traverse_module_state->__pyx_n_s_gray71); Py_VISIT(traverse_module_state->__pyx_n_s_gray72); Py_VISIT(traverse_module_state->__pyx_n_s_gray73); Py_VISIT(traverse_module_state->__pyx_n_s_gray74); Py_VISIT(traverse_module_state->__pyx_n_s_gray75); Py_VISIT(traverse_module_state->__pyx_n_s_gray76); Py_VISIT(traverse_module_state->__pyx_n_s_gray77); Py_VISIT(traverse_module_state->__pyx_n_s_gray78); Py_VISIT(traverse_module_state->__pyx_n_s_gray79); Py_VISIT(traverse_module_state->__pyx_n_s_gray8); Py_VISIT(traverse_module_state->__pyx_n_s_gray80); Py_VISIT(traverse_module_state->__pyx_n_s_gray81); Py_VISIT(traverse_module_state->__pyx_n_s_gray82); Py_VISIT(traverse_module_state->__pyx_n_s_gray83); Py_VISIT(traverse_module_state->__pyx_n_s_gray84); Py_VISIT(traverse_module_state->__pyx_n_s_gray85); Py_VISIT(traverse_module_state->__pyx_n_s_gray86); Py_VISIT(traverse_module_state->__pyx_n_s_gray87); Py_VISIT(traverse_module_state->__pyx_n_s_gray88); Py_VISIT(traverse_module_state->__pyx_n_s_gray89); Py_VISIT(traverse_module_state->__pyx_n_s_gray9); Py_VISIT(traverse_module_state->__pyx_n_s_gray90); Py_VISIT(traverse_module_state->__pyx_n_s_gray91); Py_VISIT(traverse_module_state->__pyx_n_s_gray92); Py_VISIT(traverse_module_state->__pyx_n_s_gray93); Py_VISIT(traverse_module_state->__pyx_n_s_gray94); Py_VISIT(traverse_module_state->__pyx_n_s_gray95); Py_VISIT(traverse_module_state->__pyx_n_s_gray96); Py_VISIT(traverse_module_state->__pyx_n_s_gray97); Py_VISIT(traverse_module_state->__pyx_n_s_gray98); Py_VISIT(traverse_module_state->__pyx_n_s_gray99); Py_VISIT(traverse_module_state->__pyx_n_s_green); Py_VISIT(traverse_module_state->__pyx_n_s_green1); Py_VISIT(traverse_module_state->__pyx_n_s_green2); Py_VISIT(traverse_module_state->__pyx_n_s_green3); Py_VISIT(traverse_module_state->__pyx_n_s_green4); Py_VISIT(traverse_module_state->__pyx_n_s_greenyellow); Py_VISIT(traverse_module_state->__pyx_n_s_grey); Py_VISIT(traverse_module_state->__pyx_n_s_grey0); Py_VISIT(traverse_module_state->__pyx_n_s_grey1); Py_VISIT(traverse_module_state->__pyx_n_s_grey10); Py_VISIT(traverse_module_state->__pyx_n_s_grey100); Py_VISIT(traverse_module_state->__pyx_n_s_grey11); Py_VISIT(traverse_module_state->__pyx_n_s_grey12); Py_VISIT(traverse_module_state->__pyx_n_s_grey13); Py_VISIT(traverse_module_state->__pyx_n_s_grey14); Py_VISIT(traverse_module_state->__pyx_n_s_grey15); Py_VISIT(traverse_module_state->__pyx_n_s_grey16); Py_VISIT(traverse_module_state->__pyx_n_s_grey17); Py_VISIT(traverse_module_state->__pyx_n_s_grey18); Py_VISIT(traverse_module_state->__pyx_n_s_grey19); Py_VISIT(traverse_module_state->__pyx_n_s_grey2); Py_VISIT(traverse_module_state->__pyx_n_s_grey20); Py_VISIT(traverse_module_state->__pyx_n_s_grey21); Py_VISIT(traverse_module_state->__pyx_n_s_grey22); Py_VISIT(traverse_module_state->__pyx_n_s_grey23); Py_VISIT(traverse_module_state->__pyx_n_s_grey24); Py_VISIT(traverse_module_state->__pyx_n_s_grey25); Py_VISIT(traverse_module_state->__pyx_n_s_grey26); Py_VISIT(traverse_module_state->__pyx_n_s_grey27); Py_VISIT(traverse_module_state->__pyx_n_s_grey28); Py_VISIT(traverse_module_state->__pyx_n_s_grey29); Py_VISIT(traverse_module_state->__pyx_n_s_grey3); Py_VISIT(traverse_module_state->__pyx_n_s_grey30); Py_VISIT(traverse_module_state->__pyx_n_s_grey31); Py_VISIT(traverse_module_state->__pyx_n_s_grey32); Py_VISIT(traverse_module_state->__pyx_n_s_grey33); Py_VISIT(traverse_module_state->__pyx_n_s_grey34); Py_VISIT(traverse_module_state->__pyx_n_s_grey35); Py_VISIT(traverse_module_state->__pyx_n_s_grey36); Py_VISIT(traverse_module_state->__pyx_n_s_grey37); Py_VISIT(traverse_module_state->__pyx_n_s_grey38); Py_VISIT(traverse_module_state->__pyx_n_s_grey39); Py_VISIT(traverse_module_state->__pyx_n_s_grey4); Py_VISIT(traverse_module_state->__pyx_n_s_grey40); Py_VISIT(traverse_module_state->__pyx_n_s_grey41); Py_VISIT(traverse_module_state->__pyx_n_s_grey42); Py_VISIT(traverse_module_state->__pyx_n_s_grey43); Py_VISIT(traverse_module_state->__pyx_n_s_grey44); Py_VISIT(traverse_module_state->__pyx_n_s_grey45); Py_VISIT(traverse_module_state->__pyx_n_s_grey46); Py_VISIT(traverse_module_state->__pyx_n_s_grey47); Py_VISIT(traverse_module_state->__pyx_n_s_grey48); Py_VISIT(traverse_module_state->__pyx_n_s_grey49); Py_VISIT(traverse_module_state->__pyx_n_s_grey5); Py_VISIT(traverse_module_state->__pyx_n_s_grey50); Py_VISIT(traverse_module_state->__pyx_n_s_grey51); Py_VISIT(traverse_module_state->__pyx_n_s_grey52); Py_VISIT(traverse_module_state->__pyx_n_s_grey53); Py_VISIT(traverse_module_state->__pyx_n_s_grey54); Py_VISIT(traverse_module_state->__pyx_n_s_grey55); Py_VISIT(traverse_module_state->__pyx_n_s_grey56); Py_VISIT(traverse_module_state->__pyx_n_s_grey57); Py_VISIT(traverse_module_state->__pyx_n_s_grey58); Py_VISIT(traverse_module_state->__pyx_n_s_grey59); Py_VISIT(traverse_module_state->__pyx_n_s_grey6); Py_VISIT(traverse_module_state->__pyx_n_s_grey60); Py_VISIT(traverse_module_state->__pyx_n_s_grey61); Py_VISIT(traverse_module_state->__pyx_n_s_grey62); Py_VISIT(traverse_module_state->__pyx_n_s_grey63); Py_VISIT(traverse_module_state->__pyx_n_s_grey64); Py_VISIT(traverse_module_state->__pyx_n_s_grey65); Py_VISIT(traverse_module_state->__pyx_n_s_grey66); Py_VISIT(traverse_module_state->__pyx_n_s_grey67); Py_VISIT(traverse_module_state->__pyx_n_s_grey68); Py_VISIT(traverse_module_state->__pyx_n_s_grey69); Py_VISIT(traverse_module_state->__pyx_n_s_grey7); Py_VISIT(traverse_module_state->__pyx_n_s_grey70); Py_VISIT(traverse_module_state->__pyx_n_s_grey71); Py_VISIT(traverse_module_state->__pyx_n_s_grey72); Py_VISIT(traverse_module_state->__pyx_n_s_grey73); Py_VISIT(traverse_module_state->__pyx_n_s_grey74); Py_VISIT(traverse_module_state->__pyx_n_s_grey75); Py_VISIT(traverse_module_state->__pyx_n_s_grey76); Py_VISIT(traverse_module_state->__pyx_n_s_grey77); Py_VISIT(traverse_module_state->__pyx_n_s_grey78); Py_VISIT(traverse_module_state->__pyx_n_s_grey79); Py_VISIT(traverse_module_state->__pyx_n_s_grey8); Py_VISIT(traverse_module_state->__pyx_n_s_grey80); Py_VISIT(traverse_module_state->__pyx_n_s_grey81); Py_VISIT(traverse_module_state->__pyx_n_s_grey82); Py_VISIT(traverse_module_state->__pyx_n_s_grey83); Py_VISIT(traverse_module_state->__pyx_n_s_grey84); Py_VISIT(traverse_module_state->__pyx_n_s_grey85); Py_VISIT(traverse_module_state->__pyx_n_s_grey86); Py_VISIT(traverse_module_state->__pyx_n_s_grey87); Py_VISIT(traverse_module_state->__pyx_n_s_grey88); Py_VISIT(traverse_module_state->__pyx_n_s_grey89); Py_VISIT(traverse_module_state->__pyx_n_s_grey9); Py_VISIT(traverse_module_state->__pyx_n_s_grey90); Py_VISIT(traverse_module_state->__pyx_n_s_grey91); Py_VISIT(traverse_module_state->__pyx_n_s_grey92); Py_VISIT(traverse_module_state->__pyx_n_s_grey93); Py_VISIT(traverse_module_state->__pyx_n_s_grey94); Py_VISIT(traverse_module_state->__pyx_n_s_grey95); Py_VISIT(traverse_module_state->__pyx_n_s_grey96); Py_VISIT(traverse_module_state->__pyx_n_s_grey97); Py_VISIT(traverse_module_state->__pyx_n_s_grey98); Py_VISIT(traverse_module_state->__pyx_n_s_grey99); Py_VISIT(traverse_module_state->__pyx_n_s_hex); Py_VISIT(traverse_module_state->__pyx_n_s_honeydew); Py_VISIT(traverse_module_state->__pyx_n_s_honeydew1); Py_VISIT(traverse_module_state->__pyx_n_s_honeydew2); Py_VISIT(traverse_module_state->__pyx_n_s_honeydew3); Py_VISIT(traverse_module_state->__pyx_n_s_honeydew4); Py_VISIT(traverse_module_state->__pyx_n_s_hotpink); Py_VISIT(traverse_module_state->__pyx_n_s_hotpink1); Py_VISIT(traverse_module_state->__pyx_n_s_hotpink2); Py_VISIT(traverse_module_state->__pyx_n_s_hotpink3); Py_VISIT(traverse_module_state->__pyx_n_s_hotpink4); Py_VISIT(traverse_module_state->__pyx_n_s_hsva); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_indianred); Py_VISIT(traverse_module_state->__pyx_n_s_indianred1); Py_VISIT(traverse_module_state->__pyx_n_s_indianred2); Py_VISIT(traverse_module_state->__pyx_n_s_indianred3); Py_VISIT(traverse_module_state->__pyx_n_s_indianred4); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_ivory); Py_VISIT(traverse_module_state->__pyx_n_s_ivory1); Py_VISIT(traverse_module_state->__pyx_n_s_ivory2); Py_VISIT(traverse_module_state->__pyx_n_s_ivory3); Py_VISIT(traverse_module_state->__pyx_n_s_ivory4); Py_VISIT(traverse_module_state->__pyx_n_s_join); Py_VISIT(traverse_module_state->__pyx_n_s_khaki); Py_VISIT(traverse_module_state->__pyx_n_s_khaki1); Py_VISIT(traverse_module_state->__pyx_n_s_khaki2); Py_VISIT(traverse_module_state->__pyx_n_s_khaki3); Py_VISIT(traverse_module_state->__pyx_n_s_khaki4); Py_VISIT(traverse_module_state->__pyx_n_s_l); Py_VISIT(traverse_module_state->__pyx_n_s_lavender); Py_VISIT(traverse_module_state->__pyx_n_s_lavenderblush); Py_VISIT(traverse_module_state->__pyx_n_s_lavenderblush1); Py_VISIT(traverse_module_state->__pyx_n_s_lavenderblush2); Py_VISIT(traverse_module_state->__pyx_n_s_lavenderblush3); Py_VISIT(traverse_module_state->__pyx_n_s_lavenderblush4); Py_VISIT(traverse_module_state->__pyx_n_s_lawngreen); Py_VISIT(traverse_module_state->__pyx_n_s_lemonchiffon); Py_VISIT(traverse_module_state->__pyx_n_s_lemonchiffon1); Py_VISIT(traverse_module_state->__pyx_n_s_lemonchiffon2); Py_VISIT(traverse_module_state->__pyx_n_s_lemonchiffon3); Py_VISIT(traverse_module_state->__pyx_n_s_lemonchiffon4); Py_VISIT(traverse_module_state->__pyx_n_s_lightblue); Py_VISIT(traverse_module_state->__pyx_n_s_lightblue1); Py_VISIT(traverse_module_state->__pyx_n_s_lightblue2); Py_VISIT(traverse_module_state->__pyx_n_s_lightblue3); Py_VISIT(traverse_module_state->__pyx_n_s_lightblue4); Py_VISIT(traverse_module_state->__pyx_n_s_lightcoral); Py_VISIT(traverse_module_state->__pyx_n_s_lightcyan); Py_VISIT(traverse_module_state->__pyx_n_s_lightcyan1); Py_VISIT(traverse_module_state->__pyx_n_s_lightcyan2); Py_VISIT(traverse_module_state->__pyx_n_s_lightcyan3); Py_VISIT(traverse_module_state->__pyx_n_s_lightcyan4); Py_VISIT(traverse_module_state->__pyx_n_s_lightgoldenrod); Py_VISIT(traverse_module_state->__pyx_n_s_lightgoldenrod1); Py_VISIT(traverse_module_state->__pyx_n_s_lightgoldenrod2); Py_VISIT(traverse_module_state->__pyx_n_s_lightgoldenrod3); Py_VISIT(traverse_module_state->__pyx_n_s_lightgoldenrod4); Py_VISIT(traverse_module_state->__pyx_n_s_lightgoldenrodyellow); Py_VISIT(traverse_module_state->__pyx_n_s_lightgray); Py_VISIT(traverse_module_state->__pyx_n_s_lightgreen); Py_VISIT(traverse_module_state->__pyx_n_s_lightgrey); Py_VISIT(traverse_module_state->__pyx_n_s_lightpink); Py_VISIT(traverse_module_state->__pyx_n_s_lightpink1); Py_VISIT(traverse_module_state->__pyx_n_s_lightpink2); Py_VISIT(traverse_module_state->__pyx_n_s_lightpink3); Py_VISIT(traverse_module_state->__pyx_n_s_lightpink4); Py_VISIT(traverse_module_state->__pyx_n_s_lightsalmon); Py_VISIT(traverse_module_state->__pyx_n_s_lightsalmon1); Py_VISIT(traverse_module_state->__pyx_n_s_lightsalmon2); Py_VISIT(traverse_module_state->__pyx_n_s_lightsalmon3); Py_VISIT(traverse_module_state->__pyx_n_s_lightsalmon4); Py_VISIT(traverse_module_state->__pyx_n_s_lightseagreen); Py_VISIT(traverse_module_state->__pyx_n_s_lightskyblue); Py_VISIT(traverse_module_state->__pyx_n_s_lightskyblue1); Py_VISIT(traverse_module_state->__pyx_n_s_lightskyblue2); Py_VISIT(traverse_module_state->__pyx_n_s_lightskyblue3); Py_VISIT(traverse_module_state->__pyx_n_s_lightskyblue4); Py_VISIT(traverse_module_state->__pyx_n_s_lightslateblue); Py_VISIT(traverse_module_state->__pyx_n_s_lightslategray); Py_VISIT(traverse_module_state->__pyx_n_s_lightslategrey); Py_VISIT(traverse_module_state->__pyx_n_s_lightsteelblue); Py_VISIT(traverse_module_state->__pyx_n_s_lightsteelblue1); Py_VISIT(traverse_module_state->__pyx_n_s_lightsteelblue2); Py_VISIT(traverse_module_state->__pyx_n_s_lightsteelblue3); Py_VISIT(traverse_module_state->__pyx_n_s_lightsteelblue4); Py_VISIT(traverse_module_state->__pyx_n_s_lightyellow); Py_VISIT(traverse_module_state->__pyx_n_s_lightyellow1); Py_VISIT(traverse_module_state->__pyx_n_s_lightyellow2); Py_VISIT(traverse_module_state->__pyx_n_s_lightyellow3); Py_VISIT(traverse_module_state->__pyx_n_s_lightyellow4); Py_VISIT(traverse_module_state->__pyx_n_s_limegreen); Py_VISIT(traverse_module_state->__pyx_n_s_linen); Py_VISIT(traverse_module_state->__pyx_n_s_lower); Py_VISIT(traverse_module_state->__pyx_n_s_m); Py_VISIT(traverse_module_state->__pyx_n_s_magenta); Py_VISIT(traverse_module_state->__pyx_n_s_magenta1); Py_VISIT(traverse_module_state->__pyx_n_s_magenta2); Py_VISIT(traverse_module_state->__pyx_n_s_magenta3); Py_VISIT(traverse_module_state->__pyx_n_s_magenta4); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_map); Py_VISIT(traverse_module_state->__pyx_n_s_maroon); Py_VISIT(traverse_module_state->__pyx_n_s_maroon1); Py_VISIT(traverse_module_state->__pyx_n_s_maroon2); Py_VISIT(traverse_module_state->__pyx_n_s_maroon3); Py_VISIT(traverse_module_state->__pyx_n_s_maroon4); Py_VISIT(traverse_module_state->__pyx_n_s_mediumaquamarine); Py_VISIT(traverse_module_state->__pyx_n_s_mediumblue); Py_VISIT(traverse_module_state->__pyx_n_s_mediumorchid); Py_VISIT(traverse_module_state->__pyx_n_s_mediumorchid1); Py_VISIT(traverse_module_state->__pyx_n_s_mediumorchid2); Py_VISIT(traverse_module_state->__pyx_n_s_mediumorchid3); Py_VISIT(traverse_module_state->__pyx_n_s_mediumorchid4); Py_VISIT(traverse_module_state->__pyx_n_s_mediumpurple); Py_VISIT(traverse_module_state->__pyx_n_s_mediumpurple1); Py_VISIT(traverse_module_state->__pyx_n_s_mediumpurple2); Py_VISIT(traverse_module_state->__pyx_n_s_mediumpurple3); Py_VISIT(traverse_module_state->__pyx_n_s_mediumpurple4); Py_VISIT(traverse_module_state->__pyx_n_s_mediumseagreen); Py_VISIT(traverse_module_state->__pyx_n_s_mediumslateblue); Py_VISIT(traverse_module_state->__pyx_n_s_mediumspringgreen); Py_VISIT(traverse_module_state->__pyx_n_s_mediumturquoise); Py_VISIT(traverse_module_state->__pyx_n_s_mediumvioletred); Py_VISIT(traverse_module_state->__pyx_n_s_midnightblue); Py_VISIT(traverse_module_state->__pyx_n_s_mintcream); Py_VISIT(traverse_module_state->__pyx_n_s_mistyrose); Py_VISIT(traverse_module_state->__pyx_n_s_mistyrose1); Py_VISIT(traverse_module_state->__pyx_n_s_mistyrose2); Py_VISIT(traverse_module_state->__pyx_n_s_mistyrose3); Py_VISIT(traverse_module_state->__pyx_n_s_mistyrose4); Py_VISIT(traverse_module_state->__pyx_n_s_moccasin); Py_VISIT(traverse_module_state->__pyx_n_s_mod); Py_VISIT(traverse_module_state->__pyx_n_s_mod___locals_mod); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_navajowhite); Py_VISIT(traverse_module_state->__pyx_n_s_navajowhite1); Py_VISIT(traverse_module_state->__pyx_n_s_navajowhite2); Py_VISIT(traverse_module_state->__pyx_n_s_navajowhite3); Py_VISIT(traverse_module_state->__pyx_n_s_navajowhite4); Py_VISIT(traverse_module_state->__pyx_n_s_navy); Py_VISIT(traverse_module_state->__pyx_n_s_navyblue); Py_VISIT(traverse_module_state->__pyx_n_s_normalize); Py_VISIT(traverse_module_state->__pyx_n_s_oct); Py_VISIT(traverse_module_state->__pyx_n_s_oldlace); Py_VISIT(traverse_module_state->__pyx_n_s_olivedrab); Py_VISIT(traverse_module_state->__pyx_n_s_olivedrab1); Py_VISIT(traverse_module_state->__pyx_n_s_olivedrab2); Py_VISIT(traverse_module_state->__pyx_n_s_olivedrab3); Py_VISIT(traverse_module_state->__pyx_n_s_olivedrab4); Py_VISIT(traverse_module_state->__pyx_n_s_orange); Py_VISIT(traverse_module_state->__pyx_n_s_orange1); Py_VISIT(traverse_module_state->__pyx_n_s_orange2); Py_VISIT(traverse_module_state->__pyx_n_s_orange3); Py_VISIT(traverse_module_state->__pyx_n_s_orange4); Py_VISIT(traverse_module_state->__pyx_n_s_orangered); Py_VISIT(traverse_module_state->__pyx_n_s_orangered1); Py_VISIT(traverse_module_state->__pyx_n_s_orangered2); Py_VISIT(traverse_module_state->__pyx_n_s_orangered3); Py_VISIT(traverse_module_state->__pyx_n_s_orangered4); Py_VISIT(traverse_module_state->__pyx_n_s_orchid); Py_VISIT(traverse_module_state->__pyx_n_s_orchid1); Py_VISIT(traverse_module_state->__pyx_n_s_orchid2); Py_VISIT(traverse_module_state->__pyx_n_s_orchid3); Py_VISIT(traverse_module_state->__pyx_n_s_orchid4); Py_VISIT(traverse_module_state->__pyx_n_s_pack); Py_VISIT(traverse_module_state->__pyx_n_s_palegoldenrod); Py_VISIT(traverse_module_state->__pyx_n_s_palegreen); Py_VISIT(traverse_module_state->__pyx_n_s_palegreen1); Py_VISIT(traverse_module_state->__pyx_n_s_palegreen2); Py_VISIT(traverse_module_state->__pyx_n_s_palegreen3); Py_VISIT(traverse_module_state->__pyx_n_s_palegreen4); Py_VISIT(traverse_module_state->__pyx_n_s_paleturquoise); Py_VISIT(traverse_module_state->__pyx_n_s_paleturquoise1); Py_VISIT(traverse_module_state->__pyx_n_s_paleturquoise2); Py_VISIT(traverse_module_state->__pyx_n_s_paleturquoise3); Py_VISIT(traverse_module_state->__pyx_n_s_paleturquoise4); Py_VISIT(traverse_module_state->__pyx_n_s_palevioletred); Py_VISIT(traverse_module_state->__pyx_n_s_palevioletred1); Py_VISIT(traverse_module_state->__pyx_n_s_palevioletred2); Py_VISIT(traverse_module_state->__pyx_n_s_palevioletred3); Py_VISIT(traverse_module_state->__pyx_n_s_palevioletred4); Py_VISIT(traverse_module_state->__pyx_n_s_papayawhip); Py_VISIT(traverse_module_state->__pyx_n_s_peachpuff); Py_VISIT(traverse_module_state->__pyx_n_s_peachpuff1); Py_VISIT(traverse_module_state->__pyx_n_s_peachpuff2); Py_VISIT(traverse_module_state->__pyx_n_s_peachpuff3); Py_VISIT(traverse_module_state->__pyx_n_s_peachpuff4); Py_VISIT(traverse_module_state->__pyx_n_s_peru); Py_VISIT(traverse_module_state->__pyx_n_s_pink); Py_VISIT(traverse_module_state->__pyx_n_s_pink1); Py_VISIT(traverse_module_state->__pyx_n_s_pink2); Py_VISIT(traverse_module_state->__pyx_n_s_pink3); Py_VISIT(traverse_module_state->__pyx_n_s_pink4); Py_VISIT(traverse_module_state->__pyx_n_s_plum); Py_VISIT(traverse_module_state->__pyx_n_s_plum1); Py_VISIT(traverse_module_state->__pyx_n_s_plum2); Py_VISIT(traverse_module_state->__pyx_n_s_plum3); Py_VISIT(traverse_module_state->__pyx_n_s_plum4); Py_VISIT(traverse_module_state->__pyx_n_s_powderblue); Py_VISIT(traverse_module_state->__pyx_n_s_purple); Py_VISIT(traverse_module_state->__pyx_n_s_purple1); Py_VISIT(traverse_module_state->__pyx_n_s_purple2); Py_VISIT(traverse_module_state->__pyx_n_s_purple3); Py_VISIT(traverse_module_state->__pyx_n_s_purple4); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_color); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_red); Py_VISIT(traverse_module_state->__pyx_n_s_red1); Py_VISIT(traverse_module_state->__pyx_n_s_red2); Py_VISIT(traverse_module_state->__pyx_n_s_red3); Py_VISIT(traverse_module_state->__pyx_n_s_red4); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_rgba); Py_VISIT(traverse_module_state->__pyx_n_s_rosybrown); Py_VISIT(traverse_module_state->__pyx_n_s_rosybrown1); Py_VISIT(traverse_module_state->__pyx_n_s_rosybrown2); Py_VISIT(traverse_module_state->__pyx_n_s_rosybrown3); Py_VISIT(traverse_module_state->__pyx_n_s_rosybrown4); Py_VISIT(traverse_module_state->__pyx_n_s_round); Py_VISIT(traverse_module_state->__pyx_n_s_royalblue); Py_VISIT(traverse_module_state->__pyx_n_s_royalblue1); Py_VISIT(traverse_module_state->__pyx_n_s_royalblue2); Py_VISIT(traverse_module_state->__pyx_n_s_royalblue3); Py_VISIT(traverse_module_state->__pyx_n_s_royalblue4); Py_VISIT(traverse_module_state->__pyx_n_s_saddlebrown); Py_VISIT(traverse_module_state->__pyx_n_s_salmon); Py_VISIT(traverse_module_state->__pyx_n_s_salmon1); Py_VISIT(traverse_module_state->__pyx_n_s_salmon2); Py_VISIT(traverse_module_state->__pyx_n_s_salmon3); Py_VISIT(traverse_module_state->__pyx_n_s_salmon4); Py_VISIT(traverse_module_state->__pyx_n_s_sandybrown); Py_VISIT(traverse_module_state->__pyx_n_s_seagreen); Py_VISIT(traverse_module_state->__pyx_n_s_seagreen1); Py_VISIT(traverse_module_state->__pyx_n_s_seagreen2); Py_VISIT(traverse_module_state->__pyx_n_s_seagreen3); Py_VISIT(traverse_module_state->__pyx_n_s_seagreen4); Py_VISIT(traverse_module_state->__pyx_n_s_seashell); Py_VISIT(traverse_module_state->__pyx_n_s_seashell1); Py_VISIT(traverse_module_state->__pyx_n_s_seashell2); Py_VISIT(traverse_module_state->__pyx_n_s_seashell3); Py_VISIT(traverse_module_state->__pyx_n_s_seashell4); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_length); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_sienna); Py_VISIT(traverse_module_state->__pyx_n_s_sienna1); Py_VISIT(traverse_module_state->__pyx_n_s_sienna2); Py_VISIT(traverse_module_state->__pyx_n_s_sienna3); Py_VISIT(traverse_module_state->__pyx_n_s_sienna4); Py_VISIT(traverse_module_state->__pyx_n_s_skyblue); Py_VISIT(traverse_module_state->__pyx_n_s_skyblue1); Py_VISIT(traverse_module_state->__pyx_n_s_skyblue2); Py_VISIT(traverse_module_state->__pyx_n_s_skyblue3); Py_VISIT(traverse_module_state->__pyx_n_s_skyblue4); Py_VISIT(traverse_module_state->__pyx_n_s_slateblue); Py_VISIT(traverse_module_state->__pyx_n_s_slateblue1); Py_VISIT(traverse_module_state->__pyx_n_s_slateblue2); Py_VISIT(traverse_module_state->__pyx_n_s_slateblue3); Py_VISIT(traverse_module_state->__pyx_n_s_slateblue4); Py_VISIT(traverse_module_state->__pyx_n_s_slategray); Py_VISIT(traverse_module_state->__pyx_n_s_slategray1); Py_VISIT(traverse_module_state->__pyx_n_s_slategray2); Py_VISIT(traverse_module_state->__pyx_n_s_slategray3); Py_VISIT(traverse_module_state->__pyx_n_s_slategray4); Py_VISIT(traverse_module_state->__pyx_n_s_slategrey); Py_VISIT(traverse_module_state->__pyx_n_s_snow); Py_VISIT(traverse_module_state->__pyx_n_s_snow1); Py_VISIT(traverse_module_state->__pyx_n_s_snow2); Py_VISIT(traverse_module_state->__pyx_n_s_snow3); Py_VISIT(traverse_module_state->__pyx_n_s_snow4); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_split); Py_VISIT(traverse_module_state->__pyx_n_s_springgreen); Py_VISIT(traverse_module_state->__pyx_n_s_springgreen1); Py_VISIT(traverse_module_state->__pyx_n_s_springgreen2); Py_VISIT(traverse_module_state->__pyx_n_s_springgreen3); Py_VISIT(traverse_module_state->__pyx_n_s_springgreen4); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_color_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_startswith); Py_VISIT(traverse_module_state->__pyx_n_s_steelblue); Py_VISIT(traverse_module_state->__pyx_n_s_steelblue1); Py_VISIT(traverse_module_state->__pyx_n_s_steelblue2); Py_VISIT(traverse_module_state->__pyx_n_s_steelblue3); Py_VISIT(traverse_module_state->__pyx_n_s_steelblue4); Py_VISIT(traverse_module_state->__pyx_n_s_struct); Py_VISIT(traverse_module_state->__pyx_n_s_tan); Py_VISIT(traverse_module_state->__pyx_n_s_tan1); Py_VISIT(traverse_module_state->__pyx_n_s_tan2); Py_VISIT(traverse_module_state->__pyx_n_s_tan3); Py_VISIT(traverse_module_state->__pyx_n_s_tan4); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_thistle); Py_VISIT(traverse_module_state->__pyx_n_s_thistle1); Py_VISIT(traverse_module_state->__pyx_n_s_thistle2); Py_VISIT(traverse_module_state->__pyx_n_s_thistle3); Py_VISIT(traverse_module_state->__pyx_n_s_thistle4); Py_VISIT(traverse_module_state->__pyx_n_s_tomato); Py_VISIT(traverse_module_state->__pyx_n_s_tomato1); Py_VISIT(traverse_module_state->__pyx_n_s_tomato2); Py_VISIT(traverse_module_state->__pyx_n_s_tomato3); Py_VISIT(traverse_module_state->__pyx_n_s_tomato4); Py_VISIT(traverse_module_state->__pyx_n_s_turquoise); Py_VISIT(traverse_module_state->__pyx_n_s_turquoise1); Py_VISIT(traverse_module_state->__pyx_n_s_turquoise2); Py_VISIT(traverse_module_state->__pyx_n_s_turquoise3); Py_VISIT(traverse_module_state->__pyx_n_s_turquoise4); Py_VISIT(traverse_module_state->__pyx_n_s_unhexlify); Py_VISIT(traverse_module_state->__pyx_n_s_unpack); Py_VISIT(traverse_module_state->__pyx_n_s_violet); Py_VISIT(traverse_module_state->__pyx_n_s_violetred); Py_VISIT(traverse_module_state->__pyx_n_s_violetred1); Py_VISIT(traverse_module_state->__pyx_n_s_violetred2); Py_VISIT(traverse_module_state->__pyx_n_s_violetred3); Py_VISIT(traverse_module_state->__pyx_n_s_violetred4); Py_VISIT(traverse_module_state->__pyx_n_s_wheat); Py_VISIT(traverse_module_state->__pyx_n_s_wheat1); Py_VISIT(traverse_module_state->__pyx_n_s_wheat2); Py_VISIT(traverse_module_state->__pyx_n_s_wheat3); Py_VISIT(traverse_module_state->__pyx_n_s_wheat4); Py_VISIT(traverse_module_state->__pyx_n_s_white); Py_VISIT(traverse_module_state->__pyx_n_s_whitesmoke); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_yellow); Py_VISIT(traverse_module_state->__pyx_n_s_yellow1); Py_VISIT(traverse_module_state->__pyx_n_s_yellow2); Py_VISIT(traverse_module_state->__pyx_n_s_yellow3); Py_VISIT(traverse_module_state->__pyx_n_s_yellow4); Py_VISIT(traverse_module_state->__pyx_n_s_yellowgreen); Py_VISIT(traverse_module_state->__pyx_float_255_0); Py_VISIT(traverse_module_state->__pyx_float_360_0); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_3); Py_VISIT(traverse_module_state->__pyx_int_4); Py_VISIT(traverse_module_state->__pyx_int_5); Py_VISIT(traverse_module_state->__pyx_int_7); Py_VISIT(traverse_module_state->__pyx_int_8); Py_VISIT(traverse_module_state->__pyx_int_10); Py_VISIT(traverse_module_state->__pyx_int_11); Py_VISIT(traverse_module_state->__pyx_int_12); Py_VISIT(traverse_module_state->__pyx_int_13); Py_VISIT(traverse_module_state->__pyx_int_14); Py_VISIT(traverse_module_state->__pyx_int_15); Py_VISIT(traverse_module_state->__pyx_int_16); Py_VISIT(traverse_module_state->__pyx_int_18); Py_VISIT(traverse_module_state->__pyx_int_19); Py_VISIT(traverse_module_state->__pyx_int_20); Py_VISIT(traverse_module_state->__pyx_int_21); Py_VISIT(traverse_module_state->__pyx_int_23); Py_VISIT(traverse_module_state->__pyx_int_24); Py_VISIT(traverse_module_state->__pyx_int_25); Py_VISIT(traverse_module_state->__pyx_int_26); Py_VISIT(traverse_module_state->__pyx_int_28); Py_VISIT(traverse_module_state->__pyx_int_29); Py_VISIT(traverse_module_state->__pyx_int_30); Py_VISIT(traverse_module_state->__pyx_int_31); Py_VISIT(traverse_module_state->__pyx_int_32); Py_VISIT(traverse_module_state->__pyx_int_33); Py_VISIT(traverse_module_state->__pyx_int_34); Py_VISIT(traverse_module_state->__pyx_int_35); Py_VISIT(traverse_module_state->__pyx_int_36); Py_VISIT(traverse_module_state->__pyx_int_37); Py_VISIT(traverse_module_state->__pyx_int_38); Py_VISIT(traverse_module_state->__pyx_int_39); Py_VISIT(traverse_module_state->__pyx_int_41); Py_VISIT(traverse_module_state->__pyx_int_42); Py_VISIT(traverse_module_state->__pyx_int_43); Py_VISIT(traverse_module_state->__pyx_int_44); Py_VISIT(traverse_module_state->__pyx_int_45); Py_VISIT(traverse_module_state->__pyx_int_46); Py_VISIT(traverse_module_state->__pyx_int_47); Py_VISIT(traverse_module_state->__pyx_int_48); Py_VISIT(traverse_module_state->__pyx_int_50); Py_VISIT(traverse_module_state->__pyx_int_51); Py_VISIT(traverse_module_state->__pyx_int_52); Py_VISIT(traverse_module_state->__pyx_int_54); Py_VISIT(traverse_module_state->__pyx_int_55); Py_VISIT(traverse_module_state->__pyx_int_56); Py_VISIT(traverse_module_state->__pyx_int_57); Py_VISIT(traverse_module_state->__pyx_int_58); Py_VISIT(traverse_module_state->__pyx_int_59); Py_VISIT(traverse_module_state->__pyx_int_60); Py_VISIT(traverse_module_state->__pyx_int_61); Py_VISIT(traverse_module_state->__pyx_int_62); Py_VISIT(traverse_module_state->__pyx_int_63); Py_VISIT(traverse_module_state->__pyx_int_64); Py_VISIT(traverse_module_state->__pyx_int_65); Py_VISIT(traverse_module_state->__pyx_int_66); Py_VISIT(traverse_module_state->__pyx_int_67); Py_VISIT(traverse_module_state->__pyx_int_69); Py_VISIT(traverse_module_state->__pyx_int_70); Py_VISIT(traverse_module_state->__pyx_int_71); Py_VISIT(traverse_module_state->__pyx_int_72); Py_VISIT(traverse_module_state->__pyx_int_73); Py_VISIT(traverse_module_state->__pyx_int_74); Py_VISIT(traverse_module_state->__pyx_int_76); Py_VISIT(traverse_module_state->__pyx_int_77); Py_VISIT(traverse_module_state->__pyx_int_78); Py_VISIT(traverse_module_state->__pyx_int_79); Py_VISIT(traverse_module_state->__pyx_int_80); Py_VISIT(traverse_module_state->__pyx_int_81); Py_VISIT(traverse_module_state->__pyx_int_82); Py_VISIT(traverse_module_state->__pyx_int_83); Py_VISIT(traverse_module_state->__pyx_int_84); Py_VISIT(traverse_module_state->__pyx_int_85); Py_VISIT(traverse_module_state->__pyx_int_86); Py_VISIT(traverse_module_state->__pyx_int_87); Py_VISIT(traverse_module_state->__pyx_int_89); Py_VISIT(traverse_module_state->__pyx_int_90); Py_VISIT(traverse_module_state->__pyx_int_91); Py_VISIT(traverse_module_state->__pyx_int_92); Py_VISIT(traverse_module_state->__pyx_int_93); Py_VISIT(traverse_module_state->__pyx_int_94); Py_VISIT(traverse_module_state->__pyx_int_95); Py_VISIT(traverse_module_state->__pyx_int_96); Py_VISIT(traverse_module_state->__pyx_int_97); Py_VISIT(traverse_module_state->__pyx_int_98); Py_VISIT(traverse_module_state->__pyx_int_99); Py_VISIT(traverse_module_state->__pyx_int_100); Py_VISIT(traverse_module_state->__pyx_int_101); Py_VISIT(traverse_module_state->__pyx_int_102); Py_VISIT(traverse_module_state->__pyx_int_103); Py_VISIT(traverse_module_state->__pyx_int_104); Py_VISIT(traverse_module_state->__pyx_int_105); Py_VISIT(traverse_module_state->__pyx_int_106); Py_VISIT(traverse_module_state->__pyx_int_107); Py_VISIT(traverse_module_state->__pyx_int_108); Py_VISIT(traverse_module_state->__pyx_int_110); Py_VISIT(traverse_module_state->__pyx_int_111); Py_VISIT(traverse_module_state->__pyx_int_112); Py_VISIT(traverse_module_state->__pyx_int_113); Py_VISIT(traverse_module_state->__pyx_int_114); Py_VISIT(traverse_module_state->__pyx_int_115); Py_VISIT(traverse_module_state->__pyx_int_116); Py_VISIT(traverse_module_state->__pyx_int_117); Py_VISIT(traverse_module_state->__pyx_int_118); Py_VISIT(traverse_module_state->__pyx_int_119); Py_VISIT(traverse_module_state->__pyx_int_120); Py_VISIT(traverse_module_state->__pyx_int_121); Py_VISIT(traverse_module_state->__pyx_int_122); Py_VISIT(traverse_module_state->__pyx_int_123); Py_VISIT(traverse_module_state->__pyx_int_124); Py_VISIT(traverse_module_state->__pyx_int_125); Py_VISIT(traverse_module_state->__pyx_int_126); Py_VISIT(traverse_module_state->__pyx_int_127); Py_VISIT(traverse_module_state->__pyx_int_128); Py_VISIT(traverse_module_state->__pyx_int_129); Py_VISIT(traverse_module_state->__pyx_int_130); Py_VISIT(traverse_module_state->__pyx_int_131); Py_VISIT(traverse_module_state->__pyx_int_132); Py_VISIT(traverse_module_state->__pyx_int_133); Py_VISIT(traverse_module_state->__pyx_int_134); Py_VISIT(traverse_module_state->__pyx_int_135); Py_VISIT(traverse_module_state->__pyx_int_136); Py_VISIT(traverse_module_state->__pyx_int_137); Py_VISIT(traverse_module_state->__pyx_int_138); Py_VISIT(traverse_module_state->__pyx_int_139); Py_VISIT(traverse_module_state->__pyx_int_140); Py_VISIT(traverse_module_state->__pyx_int_141); Py_VISIT(traverse_module_state->__pyx_int_142); Py_VISIT(traverse_module_state->__pyx_int_143); Py_VISIT(traverse_module_state->__pyx_int_144); Py_VISIT(traverse_module_state->__pyx_int_145); Py_VISIT(traverse_module_state->__pyx_int_147); Py_VISIT(traverse_module_state->__pyx_int_148); Py_VISIT(traverse_module_state->__pyx_int_149); Py_VISIT(traverse_module_state->__pyx_int_150); Py_VISIT(traverse_module_state->__pyx_int_151); Py_VISIT(traverse_module_state->__pyx_int_152); Py_VISIT(traverse_module_state->__pyx_int_153); Py_VISIT(traverse_module_state->__pyx_int_154); Py_VISIT(traverse_module_state->__pyx_int_155); Py_VISIT(traverse_module_state->__pyx_int_156); Py_VISIT(traverse_module_state->__pyx_int_158); Py_VISIT(traverse_module_state->__pyx_int_159); Py_VISIT(traverse_module_state->__pyx_int_160); Py_VISIT(traverse_module_state->__pyx_int_161); Py_VISIT(traverse_module_state->__pyx_int_162); Py_VISIT(traverse_module_state->__pyx_int_163); Py_VISIT(traverse_module_state->__pyx_int_164); Py_VISIT(traverse_module_state->__pyx_int_165); Py_VISIT(traverse_module_state->__pyx_int_166); Py_VISIT(traverse_module_state->__pyx_int_167); Py_VISIT(traverse_module_state->__pyx_int_168); Py_VISIT(traverse_module_state->__pyx_int_169); Py_VISIT(traverse_module_state->__pyx_int_170); Py_VISIT(traverse_module_state->__pyx_int_171); Py_VISIT(traverse_module_state->__pyx_int_172); Py_VISIT(traverse_module_state->__pyx_int_173); Py_VISIT(traverse_module_state->__pyx_int_174); Py_VISIT(traverse_module_state->__pyx_int_175); Py_VISIT(traverse_module_state->__pyx_int_176); Py_VISIT(traverse_module_state->__pyx_int_177); Py_VISIT(traverse_module_state->__pyx_int_178); Py_VISIT(traverse_module_state->__pyx_int_179); Py_VISIT(traverse_module_state->__pyx_int_180); Py_VISIT(traverse_module_state->__pyx_int_181); Py_VISIT(traverse_module_state->__pyx_int_182); Py_VISIT(traverse_module_state->__pyx_int_183); Py_VISIT(traverse_module_state->__pyx_int_184); Py_VISIT(traverse_module_state->__pyx_int_185); Py_VISIT(traverse_module_state->__pyx_int_186); Py_VISIT(traverse_module_state->__pyx_int_187); Py_VISIT(traverse_module_state->__pyx_int_188); Py_VISIT(traverse_module_state->__pyx_int_189); Py_VISIT(traverse_module_state->__pyx_int_190); Py_VISIT(traverse_module_state->__pyx_int_191); Py_VISIT(traverse_module_state->__pyx_int_192); Py_VISIT(traverse_module_state->__pyx_int_193); Py_VISIT(traverse_module_state->__pyx_int_194); Py_VISIT(traverse_module_state->__pyx_int_196); Py_VISIT(traverse_module_state->__pyx_int_197); Py_VISIT(traverse_module_state->__pyx_int_198); Py_VISIT(traverse_module_state->__pyx_int_199); Py_VISIT(traverse_module_state->__pyx_int_200); Py_VISIT(traverse_module_state->__pyx_int_201); Py_VISIT(traverse_module_state->__pyx_int_202); Py_VISIT(traverse_module_state->__pyx_int_203); Py_VISIT(traverse_module_state->__pyx_int_204); Py_VISIT(traverse_module_state->__pyx_int_205); Py_VISIT(traverse_module_state->__pyx_int_206); Py_VISIT(traverse_module_state->__pyx_int_207); Py_VISIT(traverse_module_state->__pyx_int_208); Py_VISIT(traverse_module_state->__pyx_int_209); Py_VISIT(traverse_module_state->__pyx_int_210); Py_VISIT(traverse_module_state->__pyx_int_211); Py_VISIT(traverse_module_state->__pyx_int_212); Py_VISIT(traverse_module_state->__pyx_int_213); Py_VISIT(traverse_module_state->__pyx_int_214); Py_VISIT(traverse_module_state->__pyx_int_215); Py_VISIT(traverse_module_state->__pyx_int_216); Py_VISIT(traverse_module_state->__pyx_int_217); Py_VISIT(traverse_module_state->__pyx_int_218); Py_VISIT(traverse_module_state->__pyx_int_219); Py_VISIT(traverse_module_state->__pyx_int_220); Py_VISIT(traverse_module_state->__pyx_int_221); Py_VISIT(traverse_module_state->__pyx_int_222); Py_VISIT(traverse_module_state->__pyx_int_223); Py_VISIT(traverse_module_state->__pyx_int_224); Py_VISIT(traverse_module_state->__pyx_int_225); Py_VISIT(traverse_module_state->__pyx_int_226); Py_VISIT(traverse_module_state->__pyx_int_227); Py_VISIT(traverse_module_state->__pyx_int_228); Py_VISIT(traverse_module_state->__pyx_int_229); Py_VISIT(traverse_module_state->__pyx_int_230); Py_VISIT(traverse_module_state->__pyx_int_231); Py_VISIT(traverse_module_state->__pyx_int_232); Py_VISIT(traverse_module_state->__pyx_int_233); Py_VISIT(traverse_module_state->__pyx_int_235); Py_VISIT(traverse_module_state->__pyx_int_236); Py_VISIT(traverse_module_state->__pyx_int_237); Py_VISIT(traverse_module_state->__pyx_int_238); Py_VISIT(traverse_module_state->__pyx_int_239); Py_VISIT(traverse_module_state->__pyx_int_240); Py_VISIT(traverse_module_state->__pyx_int_242); Py_VISIT(traverse_module_state->__pyx_int_244); Py_VISIT(traverse_module_state->__pyx_int_245); Py_VISIT(traverse_module_state->__pyx_int_246); Py_VISIT(traverse_module_state->__pyx_int_247); Py_VISIT(traverse_module_state->__pyx_int_248); Py_VISIT(traverse_module_state->__pyx_int_250); Py_VISIT(traverse_module_state->__pyx_int_251); Py_VISIT(traverse_module_state->__pyx_int_252); Py_VISIT(traverse_module_state->__pyx_int_253); Py_VISIT(traverse_module_state->__pyx_int_255); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_slice__4); Py_VISIT(traverse_module_state->__pyx_slice__5); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__26); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__32); Py_VISIT(traverse_module_state->__pyx_tuple__33); Py_VISIT(traverse_module_state->__pyx_tuple__34); Py_VISIT(traverse_module_state->__pyx_tuple__35); Py_VISIT(traverse_module_state->__pyx_tuple__36); Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_tuple__38); Py_VISIT(traverse_module_state->__pyx_tuple__39); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__41); Py_VISIT(traverse_module_state->__pyx_tuple__42); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__44); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_tuple__46); Py_VISIT(traverse_module_state->__pyx_tuple__47); Py_VISIT(traverse_module_state->__pyx_tuple__48); Py_VISIT(traverse_module_state->__pyx_tuple__49); Py_VISIT(traverse_module_state->__pyx_tuple__50); Py_VISIT(traverse_module_state->__pyx_tuple__51); Py_VISIT(traverse_module_state->__pyx_tuple__52); Py_VISIT(traverse_module_state->__pyx_tuple__53); Py_VISIT(traverse_module_state->__pyx_tuple__54); Py_VISIT(traverse_module_state->__pyx_tuple__55); Py_VISIT(traverse_module_state->__pyx_tuple__56); Py_VISIT(traverse_module_state->__pyx_tuple__57); Py_VISIT(traverse_module_state->__pyx_tuple__58); Py_VISIT(traverse_module_state->__pyx_tuple__59); Py_VISIT(traverse_module_state->__pyx_tuple__60); Py_VISIT(traverse_module_state->__pyx_tuple__61); Py_VISIT(traverse_module_state->__pyx_tuple__62); Py_VISIT(traverse_module_state->__pyx_tuple__63); Py_VISIT(traverse_module_state->__pyx_tuple__64); Py_VISIT(traverse_module_state->__pyx_tuple__65); Py_VISIT(traverse_module_state->__pyx_tuple__66); Py_VISIT(traverse_module_state->__pyx_tuple__67); Py_VISIT(traverse_module_state->__pyx_tuple__68); Py_VISIT(traverse_module_state->__pyx_tuple__69); Py_VISIT(traverse_module_state->__pyx_tuple__70); Py_VISIT(traverse_module_state->__pyx_tuple__71); Py_VISIT(traverse_module_state->__pyx_tuple__72); Py_VISIT(traverse_module_state->__pyx_tuple__73); Py_VISIT(traverse_module_state->__pyx_tuple__74); Py_VISIT(traverse_module_state->__pyx_tuple__75); Py_VISIT(traverse_module_state->__pyx_tuple__76); Py_VISIT(traverse_module_state->__pyx_tuple__77); Py_VISIT(traverse_module_state->__pyx_tuple__78); Py_VISIT(traverse_module_state->__pyx_tuple__79); Py_VISIT(traverse_module_state->__pyx_tuple__80); Py_VISIT(traverse_module_state->__pyx_tuple__81); Py_VISIT(traverse_module_state->__pyx_tuple__82); Py_VISIT(traverse_module_state->__pyx_tuple__83); Py_VISIT(traverse_module_state->__pyx_tuple__84); Py_VISIT(traverse_module_state->__pyx_tuple__85); Py_VISIT(traverse_module_state->__pyx_tuple__86); Py_VISIT(traverse_module_state->__pyx_tuple__87); Py_VISIT(traverse_module_state->__pyx_tuple__88); Py_VISIT(traverse_module_state->__pyx_tuple__89); Py_VISIT(traverse_module_state->__pyx_tuple__90); Py_VISIT(traverse_module_state->__pyx_tuple__91); Py_VISIT(traverse_module_state->__pyx_tuple__92); Py_VISIT(traverse_module_state->__pyx_tuple__93); Py_VISIT(traverse_module_state->__pyx_tuple__94); Py_VISIT(traverse_module_state->__pyx_tuple__95); Py_VISIT(traverse_module_state->__pyx_tuple__96); Py_VISIT(traverse_module_state->__pyx_tuple__97); Py_VISIT(traverse_module_state->__pyx_tuple__98); Py_VISIT(traverse_module_state->__pyx_tuple__99); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_tuple__100); Py_VISIT(traverse_module_state->__pyx_tuple__101); Py_VISIT(traverse_module_state->__pyx_tuple__102); Py_VISIT(traverse_module_state->__pyx_tuple__103); Py_VISIT(traverse_module_state->__pyx_tuple__104); Py_VISIT(traverse_module_state->__pyx_tuple__105); Py_VISIT(traverse_module_state->__pyx_tuple__106); Py_VISIT(traverse_module_state->__pyx_tuple__107); Py_VISIT(traverse_module_state->__pyx_tuple__108); Py_VISIT(traverse_module_state->__pyx_tuple__109); Py_VISIT(traverse_module_state->__pyx_tuple__110); Py_VISIT(traverse_module_state->__pyx_tuple__111); Py_VISIT(traverse_module_state->__pyx_tuple__112); Py_VISIT(traverse_module_state->__pyx_tuple__113); Py_VISIT(traverse_module_state->__pyx_tuple__114); Py_VISIT(traverse_module_state->__pyx_tuple__115); Py_VISIT(traverse_module_state->__pyx_tuple__116); Py_VISIT(traverse_module_state->__pyx_tuple__117); Py_VISIT(traverse_module_state->__pyx_tuple__118); Py_VISIT(traverse_module_state->__pyx_tuple__119); Py_VISIT(traverse_module_state->__pyx_tuple__120); Py_VISIT(traverse_module_state->__pyx_tuple__121); Py_VISIT(traverse_module_state->__pyx_tuple__122); Py_VISIT(traverse_module_state->__pyx_tuple__123); Py_VISIT(traverse_module_state->__pyx_tuple__124); Py_VISIT(traverse_module_state->__pyx_tuple__125); Py_VISIT(traverse_module_state->__pyx_tuple__126); Py_VISIT(traverse_module_state->__pyx_tuple__127); Py_VISIT(traverse_module_state->__pyx_tuple__128); Py_VISIT(traverse_module_state->__pyx_tuple__129); Py_VISIT(traverse_module_state->__pyx_tuple__130); Py_VISIT(traverse_module_state->__pyx_tuple__131); Py_VISIT(traverse_module_state->__pyx_tuple__132); Py_VISIT(traverse_module_state->__pyx_tuple__133); Py_VISIT(traverse_module_state->__pyx_tuple__134); Py_VISIT(traverse_module_state->__pyx_tuple__135); Py_VISIT(traverse_module_state->__pyx_tuple__136); Py_VISIT(traverse_module_state->__pyx_tuple__137); Py_VISIT(traverse_module_state->__pyx_tuple__138); Py_VISIT(traverse_module_state->__pyx_tuple__139); Py_VISIT(traverse_module_state->__pyx_tuple__140); Py_VISIT(traverse_module_state->__pyx_tuple__141); Py_VISIT(traverse_module_state->__pyx_tuple__142); Py_VISIT(traverse_module_state->__pyx_tuple__143); Py_VISIT(traverse_module_state->__pyx_tuple__144); Py_VISIT(traverse_module_state->__pyx_tuple__145); Py_VISIT(traverse_module_state->__pyx_tuple__146); Py_VISIT(traverse_module_state->__pyx_tuple__147); Py_VISIT(traverse_module_state->__pyx_tuple__148); Py_VISIT(traverse_module_state->__pyx_tuple__149); Py_VISIT(traverse_module_state->__pyx_tuple__150); Py_VISIT(traverse_module_state->__pyx_tuple__151); Py_VISIT(traverse_module_state->__pyx_tuple__152); Py_VISIT(traverse_module_state->__pyx_tuple__153); Py_VISIT(traverse_module_state->__pyx_tuple__154); Py_VISIT(traverse_module_state->__pyx_tuple__155); Py_VISIT(traverse_module_state->__pyx_tuple__156); Py_VISIT(traverse_module_state->__pyx_tuple__157); Py_VISIT(traverse_module_state->__pyx_tuple__158); Py_VISIT(traverse_module_state->__pyx_tuple__159); Py_VISIT(traverse_module_state->__pyx_tuple__160); Py_VISIT(traverse_module_state->__pyx_tuple__161); Py_VISIT(traverse_module_state->__pyx_tuple__162); Py_VISIT(traverse_module_state->__pyx_tuple__163); Py_VISIT(traverse_module_state->__pyx_tuple__164); Py_VISIT(traverse_module_state->__pyx_tuple__165); Py_VISIT(traverse_module_state->__pyx_tuple__166); Py_VISIT(traverse_module_state->__pyx_tuple__167); Py_VISIT(traverse_module_state->__pyx_tuple__168); Py_VISIT(traverse_module_state->__pyx_tuple__169); Py_VISIT(traverse_module_state->__pyx_tuple__170); Py_VISIT(traverse_module_state->__pyx_tuple__171); Py_VISIT(traverse_module_state->__pyx_tuple__172); Py_VISIT(traverse_module_state->__pyx_tuple__173); Py_VISIT(traverse_module_state->__pyx_tuple__174); Py_VISIT(traverse_module_state->__pyx_tuple__175); Py_VISIT(traverse_module_state->__pyx_tuple__176); Py_VISIT(traverse_module_state->__pyx_tuple__177); Py_VISIT(traverse_module_state->__pyx_tuple__178); Py_VISIT(traverse_module_state->__pyx_tuple__179); Py_VISIT(traverse_module_state->__pyx_tuple__180); Py_VISIT(traverse_module_state->__pyx_tuple__181); Py_VISIT(traverse_module_state->__pyx_tuple__182); Py_VISIT(traverse_module_state->__pyx_tuple__183); Py_VISIT(traverse_module_state->__pyx_tuple__184); Py_VISIT(traverse_module_state->__pyx_tuple__185); Py_VISIT(traverse_module_state->__pyx_tuple__186); Py_VISIT(traverse_module_state->__pyx_tuple__187); Py_VISIT(traverse_module_state->__pyx_tuple__188); Py_VISIT(traverse_module_state->__pyx_tuple__189); Py_VISIT(traverse_module_state->__pyx_tuple__190); Py_VISIT(traverse_module_state->__pyx_tuple__191); Py_VISIT(traverse_module_state->__pyx_tuple__192); Py_VISIT(traverse_module_state->__pyx_tuple__193); Py_VISIT(traverse_module_state->__pyx_tuple__194); Py_VISIT(traverse_module_state->__pyx_tuple__195); Py_VISIT(traverse_module_state->__pyx_tuple__196); Py_VISIT(traverse_module_state->__pyx_tuple__197); Py_VISIT(traverse_module_state->__pyx_tuple__198); Py_VISIT(traverse_module_state->__pyx_tuple__199); Py_VISIT(traverse_module_state->__pyx_tuple__200); Py_VISIT(traverse_module_state->__pyx_tuple__201); Py_VISIT(traverse_module_state->__pyx_tuple__202); Py_VISIT(traverse_module_state->__pyx_tuple__203); Py_VISIT(traverse_module_state->__pyx_tuple__204); Py_VISIT(traverse_module_state->__pyx_tuple__205); Py_VISIT(traverse_module_state->__pyx_tuple__206); Py_VISIT(traverse_module_state->__pyx_tuple__207); Py_VISIT(traverse_module_state->__pyx_tuple__208); Py_VISIT(traverse_module_state->__pyx_tuple__209); Py_VISIT(traverse_module_state->__pyx_tuple__210); Py_VISIT(traverse_module_state->__pyx_tuple__211); Py_VISIT(traverse_module_state->__pyx_tuple__212); Py_VISIT(traverse_module_state->__pyx_tuple__213); Py_VISIT(traverse_module_state->__pyx_tuple__214); Py_VISIT(traverse_module_state->__pyx_tuple__215); Py_VISIT(traverse_module_state->__pyx_tuple__216); Py_VISIT(traverse_module_state->__pyx_tuple__217); Py_VISIT(traverse_module_state->__pyx_tuple__218); Py_VISIT(traverse_module_state->__pyx_tuple__219); Py_VISIT(traverse_module_state->__pyx_tuple__220); Py_VISIT(traverse_module_state->__pyx_tuple__221); Py_VISIT(traverse_module_state->__pyx_tuple__222); Py_VISIT(traverse_module_state->__pyx_tuple__223); Py_VISIT(traverse_module_state->__pyx_tuple__224); Py_VISIT(traverse_module_state->__pyx_tuple__225); Py_VISIT(traverse_module_state->__pyx_tuple__226); Py_VISIT(traverse_module_state->__pyx_tuple__227); Py_VISIT(traverse_module_state->__pyx_tuple__228); Py_VISIT(traverse_module_state->__pyx_tuple__229); Py_VISIT(traverse_module_state->__pyx_tuple__230); Py_VISIT(traverse_module_state->__pyx_tuple__231); Py_VISIT(traverse_module_state->__pyx_tuple__232); Py_VISIT(traverse_module_state->__pyx_tuple__233); Py_VISIT(traverse_module_state->__pyx_tuple__234); Py_VISIT(traverse_module_state->__pyx_tuple__235); Py_VISIT(traverse_module_state->__pyx_tuple__236); Py_VISIT(traverse_module_state->__pyx_tuple__237); Py_VISIT(traverse_module_state->__pyx_tuple__238); Py_VISIT(traverse_module_state->__pyx_tuple__239); Py_VISIT(traverse_module_state->__pyx_tuple__240); Py_VISIT(traverse_module_state->__pyx_tuple__241); Py_VISIT(traverse_module_state->__pyx_tuple__242); Py_VISIT(traverse_module_state->__pyx_tuple__243); Py_VISIT(traverse_module_state->__pyx_tuple__244); Py_VISIT(traverse_module_state->__pyx_tuple__245); Py_VISIT(traverse_module_state->__pyx_tuple__246); Py_VISIT(traverse_module_state->__pyx_tuple__247); Py_VISIT(traverse_module_state->__pyx_tuple__248); Py_VISIT(traverse_module_state->__pyx_tuple__249); Py_VISIT(traverse_module_state->__pyx_tuple__250); Py_VISIT(traverse_module_state->__pyx_tuple__251); Py_VISIT(traverse_module_state->__pyx_tuple__252); Py_VISIT(traverse_module_state->__pyx_tuple__253); Py_VISIT(traverse_module_state->__pyx_tuple__254); Py_VISIT(traverse_module_state->__pyx_tuple__255); Py_VISIT(traverse_module_state->__pyx_tuple__256); Py_VISIT(traverse_module_state->__pyx_tuple__257); Py_VISIT(traverse_module_state->__pyx_tuple__258); Py_VISIT(traverse_module_state->__pyx_tuple__259); Py_VISIT(traverse_module_state->__pyx_tuple__260); Py_VISIT(traverse_module_state->__pyx_tuple__261); Py_VISIT(traverse_module_state->__pyx_tuple__262); Py_VISIT(traverse_module_state->__pyx_tuple__263); Py_VISIT(traverse_module_state->__pyx_tuple__264); Py_VISIT(traverse_module_state->__pyx_tuple__265); Py_VISIT(traverse_module_state->__pyx_tuple__266); Py_VISIT(traverse_module_state->__pyx_tuple__267); Py_VISIT(traverse_module_state->__pyx_tuple__268); Py_VISIT(traverse_module_state->__pyx_tuple__269); Py_VISIT(traverse_module_state->__pyx_tuple__270); Py_VISIT(traverse_module_state->__pyx_tuple__271); Py_VISIT(traverse_module_state->__pyx_tuple__272); Py_VISIT(traverse_module_state->__pyx_tuple__273); Py_VISIT(traverse_module_state->__pyx_tuple__274); Py_VISIT(traverse_module_state->__pyx_tuple__275); Py_VISIT(traverse_module_state->__pyx_tuple__276); Py_VISIT(traverse_module_state->__pyx_tuple__277); Py_VISIT(traverse_module_state->__pyx_tuple__278); Py_VISIT(traverse_module_state->__pyx_tuple__279); Py_VISIT(traverse_module_state->__pyx_tuple__280); Py_VISIT(traverse_module_state->__pyx_tuple__281); Py_VISIT(traverse_module_state->__pyx_tuple__282); Py_VISIT(traverse_module_state->__pyx_tuple__283); Py_VISIT(traverse_module_state->__pyx_tuple__284); Py_VISIT(traverse_module_state->__pyx_tuple__285); Py_VISIT(traverse_module_state->__pyx_tuple__286); Py_VISIT(traverse_module_state->__pyx_tuple__287); Py_VISIT(traverse_module_state->__pyx_tuple__288); Py_VISIT(traverse_module_state->__pyx_tuple__289); Py_VISIT(traverse_module_state->__pyx_tuple__290); Py_VISIT(traverse_module_state->__pyx_tuple__291); Py_VISIT(traverse_module_state->__pyx_tuple__292); Py_VISIT(traverse_module_state->__pyx_tuple__293); Py_VISIT(traverse_module_state->__pyx_tuple__294); Py_VISIT(traverse_module_state->__pyx_tuple__295); Py_VISIT(traverse_module_state->__pyx_tuple__296); Py_VISIT(traverse_module_state->__pyx_tuple__297); Py_VISIT(traverse_module_state->__pyx_tuple__298); Py_VISIT(traverse_module_state->__pyx_tuple__299); Py_VISIT(traverse_module_state->__pyx_tuple__300); Py_VISIT(traverse_module_state->__pyx_tuple__301); Py_VISIT(traverse_module_state->__pyx_tuple__302); Py_VISIT(traverse_module_state->__pyx_tuple__303); Py_VISIT(traverse_module_state->__pyx_tuple__304); Py_VISIT(traverse_module_state->__pyx_tuple__305); Py_VISIT(traverse_module_state->__pyx_tuple__306); Py_VISIT(traverse_module_state->__pyx_tuple__307); Py_VISIT(traverse_module_state->__pyx_tuple__308); Py_VISIT(traverse_module_state->__pyx_tuple__309); Py_VISIT(traverse_module_state->__pyx_tuple__310); Py_VISIT(traverse_module_state->__pyx_tuple__311); Py_VISIT(traverse_module_state->__pyx_tuple__312); Py_VISIT(traverse_module_state->__pyx_tuple__313); Py_VISIT(traverse_module_state->__pyx_tuple__314); Py_VISIT(traverse_module_state->__pyx_tuple__315); Py_VISIT(traverse_module_state->__pyx_tuple__316); Py_VISIT(traverse_module_state->__pyx_tuple__317); Py_VISIT(traverse_module_state->__pyx_tuple__318); Py_VISIT(traverse_module_state->__pyx_tuple__319); Py_VISIT(traverse_module_state->__pyx_tuple__320); Py_VISIT(traverse_module_state->__pyx_tuple__321); Py_VISIT(traverse_module_state->__pyx_tuple__322); Py_VISIT(traverse_module_state->__pyx_tuple__323); Py_VISIT(traverse_module_state->__pyx_tuple__324); Py_VISIT(traverse_module_state->__pyx_tuple__325); Py_VISIT(traverse_module_state->__pyx_tuple__326); Py_VISIT(traverse_module_state->__pyx_tuple__327); Py_VISIT(traverse_module_state->__pyx_tuple__328); Py_VISIT(traverse_module_state->__pyx_tuple__329); Py_VISIT(traverse_module_state->__pyx_tuple__330); Py_VISIT(traverse_module_state->__pyx_tuple__331); Py_VISIT(traverse_module_state->__pyx_tuple__332); Py_VISIT(traverse_module_state->__pyx_tuple__333); Py_VISIT(traverse_module_state->__pyx_tuple__334); Py_VISIT(traverse_module_state->__pyx_tuple__335); Py_VISIT(traverse_module_state->__pyx_tuple__336); Py_VISIT(traverse_module_state->__pyx_tuple__337); Py_VISIT(traverse_module_state->__pyx_tuple__338); Py_VISIT(traverse_module_state->__pyx_tuple__339); Py_VISIT(traverse_module_state->__pyx_tuple__340); Py_VISIT(traverse_module_state->__pyx_tuple__341); Py_VISIT(traverse_module_state->__pyx_tuple__342); Py_VISIT(traverse_module_state->__pyx_tuple__343); Py_VISIT(traverse_module_state->__pyx_tuple__344); Py_VISIT(traverse_module_state->__pyx_tuple__345); Py_VISIT(traverse_module_state->__pyx_tuple__346); Py_VISIT(traverse_module_state->__pyx_tuple__347); Py_VISIT(traverse_module_state->__pyx_tuple__348); Py_VISIT(traverse_module_state->__pyx_tuple__349); Py_VISIT(traverse_module_state->__pyx_tuple__350); Py_VISIT(traverse_module_state->__pyx_tuple__351); Py_VISIT(traverse_module_state->__pyx_tuple__352); Py_VISIT(traverse_module_state->__pyx_tuple__353); Py_VISIT(traverse_module_state->__pyx_tuple__354); Py_VISIT(traverse_module_state->__pyx_tuple__355); Py_VISIT(traverse_module_state->__pyx_tuple__356); Py_VISIT(traverse_module_state->__pyx_tuple__357); Py_VISIT(traverse_module_state->__pyx_tuple__358); Py_VISIT(traverse_module_state->__pyx_tuple__359); Py_VISIT(traverse_module_state->__pyx_tuple__360); Py_VISIT(traverse_module_state->__pyx_tuple__361); Py_VISIT(traverse_module_state->__pyx_tuple__362); Py_VISIT(traverse_module_state->__pyx_tuple__363); Py_VISIT(traverse_module_state->__pyx_tuple__364); Py_VISIT(traverse_module_state->__pyx_tuple__365); Py_VISIT(traverse_module_state->__pyx_tuple__366); Py_VISIT(traverse_module_state->__pyx_tuple__367); Py_VISIT(traverse_module_state->__pyx_tuple__368); Py_VISIT(traverse_module_state->__pyx_tuple__369); Py_VISIT(traverse_module_state->__pyx_tuple__370); Py_VISIT(traverse_module_state->__pyx_tuple__371); Py_VISIT(traverse_module_state->__pyx_tuple__372); Py_VISIT(traverse_module_state->__pyx_tuple__373); Py_VISIT(traverse_module_state->__pyx_tuple__374); Py_VISIT(traverse_module_state->__pyx_tuple__375); Py_VISIT(traverse_module_state->__pyx_tuple__376); Py_VISIT(traverse_module_state->__pyx_tuple__377); Py_VISIT(traverse_module_state->__pyx_tuple__378); Py_VISIT(traverse_module_state->__pyx_tuple__379); Py_VISIT(traverse_module_state->__pyx_tuple__380); Py_VISIT(traverse_module_state->__pyx_tuple__381); Py_VISIT(traverse_module_state->__pyx_tuple__382); Py_VISIT(traverse_module_state->__pyx_tuple__383); Py_VISIT(traverse_module_state->__pyx_tuple__384); Py_VISIT(traverse_module_state->__pyx_tuple__385); Py_VISIT(traverse_module_state->__pyx_tuple__386); Py_VISIT(traverse_module_state->__pyx_tuple__387); Py_VISIT(traverse_module_state->__pyx_tuple__388); Py_VISIT(traverse_module_state->__pyx_tuple__389); Py_VISIT(traverse_module_state->__pyx_tuple__390); Py_VISIT(traverse_module_state->__pyx_tuple__391); Py_VISIT(traverse_module_state->__pyx_tuple__392); Py_VISIT(traverse_module_state->__pyx_tuple__393); Py_VISIT(traverse_module_state->__pyx_tuple__394); Py_VISIT(traverse_module_state->__pyx_tuple__395); Py_VISIT(traverse_module_state->__pyx_tuple__396); Py_VISIT(traverse_module_state->__pyx_tuple__397); Py_VISIT(traverse_module_state->__pyx_tuple__398); Py_VISIT(traverse_module_state->__pyx_tuple__399); Py_VISIT(traverse_module_state->__pyx_tuple__400); Py_VISIT(traverse_module_state->__pyx_tuple__401); Py_VISIT(traverse_module_state->__pyx_tuple__402); Py_VISIT(traverse_module_state->__pyx_tuple__403); Py_VISIT(traverse_module_state->__pyx_tuple__404); Py_VISIT(traverse_module_state->__pyx_tuple__405); Py_VISIT(traverse_module_state->__pyx_tuple__406); Py_VISIT(traverse_module_state->__pyx_tuple__407); Py_VISIT(traverse_module_state->__pyx_tuple__408); Py_VISIT(traverse_module_state->__pyx_tuple__409); Py_VISIT(traverse_module_state->__pyx_tuple__410); Py_VISIT(traverse_module_state->__pyx_tuple__411); Py_VISIT(traverse_module_state->__pyx_tuple__412); Py_VISIT(traverse_module_state->__pyx_tuple__413); Py_VISIT(traverse_module_state->__pyx_tuple__414); Py_VISIT(traverse_module_state->__pyx_tuple__415); Py_VISIT(traverse_module_state->__pyx_tuple__416); Py_VISIT(traverse_module_state->__pyx_tuple__417); Py_VISIT(traverse_module_state->__pyx_tuple__418); Py_VISIT(traverse_module_state->__pyx_tuple__419); Py_VISIT(traverse_module_state->__pyx_tuple__420); Py_VISIT(traverse_module_state->__pyx_tuple__421); Py_VISIT(traverse_module_state->__pyx_tuple__422); Py_VISIT(traverse_module_state->__pyx_tuple__423); Py_VISIT(traverse_module_state->__pyx_tuple__424); Py_VISIT(traverse_module_state->__pyx_tuple__425); Py_VISIT(traverse_module_state->__pyx_tuple__426); Py_VISIT(traverse_module_state->__pyx_tuple__427); Py_VISIT(traverse_module_state->__pyx_tuple__428); Py_VISIT(traverse_module_state->__pyx_tuple__429); Py_VISIT(traverse_module_state->__pyx_tuple__430); Py_VISIT(traverse_module_state->__pyx_tuple__431); Py_VISIT(traverse_module_state->__pyx_tuple__432); Py_VISIT(traverse_module_state->__pyx_tuple__433); Py_VISIT(traverse_module_state->__pyx_tuple__434); Py_VISIT(traverse_module_state->__pyx_tuple__435); Py_VISIT(traverse_module_state->__pyx_tuple__436); Py_VISIT(traverse_module_state->__pyx_tuple__437); Py_VISIT(traverse_module_state->__pyx_tuple__438); Py_VISIT(traverse_module_state->__pyx_tuple__439); Py_VISIT(traverse_module_state->__pyx_tuple__440); Py_VISIT(traverse_module_state->__pyx_tuple__441); Py_VISIT(traverse_module_state->__pyx_tuple__442); Py_VISIT(traverse_module_state->__pyx_tuple__443); Py_VISIT(traverse_module_state->__pyx_tuple__444); Py_VISIT(traverse_module_state->__pyx_tuple__445); Py_VISIT(traverse_module_state->__pyx_tuple__446); Py_VISIT(traverse_module_state->__pyx_tuple__447); Py_VISIT(traverse_module_state->__pyx_tuple__448); Py_VISIT(traverse_module_state->__pyx_tuple__449); Py_VISIT(traverse_module_state->__pyx_tuple__450); Py_VISIT(traverse_module_state->__pyx_tuple__451); Py_VISIT(traverse_module_state->__pyx_tuple__452); Py_VISIT(traverse_module_state->__pyx_tuple__453); Py_VISIT(traverse_module_state->__pyx_tuple__454); Py_VISIT(traverse_module_state->__pyx_tuple__455); Py_VISIT(traverse_module_state->__pyx_tuple__456); Py_VISIT(traverse_module_state->__pyx_tuple__457); Py_VISIT(traverse_module_state->__pyx_tuple__458); Py_VISIT(traverse_module_state->__pyx_tuple__459); Py_VISIT(traverse_module_state->__pyx_tuple__460); Py_VISIT(traverse_module_state->__pyx_tuple__461); Py_VISIT(traverse_module_state->__pyx_tuple__462); Py_VISIT(traverse_module_state->__pyx_tuple__463); Py_VISIT(traverse_module_state->__pyx_tuple__464); Py_VISIT(traverse_module_state->__pyx_tuple__465); Py_VISIT(traverse_module_state->__pyx_tuple__466); Py_VISIT(traverse_module_state->__pyx_tuple__467); Py_VISIT(traverse_module_state->__pyx_tuple__468); Py_VISIT(traverse_module_state->__pyx_tuple__469); Py_VISIT(traverse_module_state->__pyx_tuple__470); Py_VISIT(traverse_module_state->__pyx_tuple__471); Py_VISIT(traverse_module_state->__pyx_tuple__472); Py_VISIT(traverse_module_state->__pyx_tuple__473); Py_VISIT(traverse_module_state->__pyx_tuple__474); Py_VISIT(traverse_module_state->__pyx_tuple__475); Py_VISIT(traverse_module_state->__pyx_tuple__476); Py_VISIT(traverse_module_state->__pyx_tuple__477); Py_VISIT(traverse_module_state->__pyx_tuple__478); Py_VISIT(traverse_module_state->__pyx_tuple__479); Py_VISIT(traverse_module_state->__pyx_tuple__480); Py_VISIT(traverse_module_state->__pyx_tuple__481); Py_VISIT(traverse_module_state->__pyx_tuple__482); Py_VISIT(traverse_module_state->__pyx_tuple__483); Py_VISIT(traverse_module_state->__pyx_tuple__484); Py_VISIT(traverse_module_state->__pyx_tuple__485); Py_VISIT(traverse_module_state->__pyx_tuple__486); Py_VISIT(traverse_module_state->__pyx_tuple__487); Py_VISIT(traverse_module_state->__pyx_tuple__488); Py_VISIT(traverse_module_state->__pyx_tuple__489); Py_VISIT(traverse_module_state->__pyx_tuple__490); Py_VISIT(traverse_module_state->__pyx_tuple__491); Py_VISIT(traverse_module_state->__pyx_tuple__492); Py_VISIT(traverse_module_state->__pyx_tuple__493); Py_VISIT(traverse_module_state->__pyx_tuple__494); Py_VISIT(traverse_module_state->__pyx_tuple__495); Py_VISIT(traverse_module_state->__pyx_tuple__496); Py_VISIT(traverse_module_state->__pyx_tuple__497); Py_VISIT(traverse_module_state->__pyx_tuple__498); Py_VISIT(traverse_module_state->__pyx_tuple__499); Py_VISIT(traverse_module_state->__pyx_tuple__500); Py_VISIT(traverse_module_state->__pyx_tuple__501); Py_VISIT(traverse_module_state->__pyx_tuple__502); Py_VISIT(traverse_module_state->__pyx_tuple__503); Py_VISIT(traverse_module_state->__pyx_tuple__504); Py_VISIT(traverse_module_state->__pyx_tuple__505); Py_VISIT(traverse_module_state->__pyx_tuple__506); Py_VISIT(traverse_module_state->__pyx_tuple__507); Py_VISIT(traverse_module_state->__pyx_tuple__508); Py_VISIT(traverse_module_state->__pyx_tuple__509); Py_VISIT(traverse_module_state->__pyx_tuple__510); Py_VISIT(traverse_module_state->__pyx_tuple__511); Py_VISIT(traverse_module_state->__pyx_tuple__512); Py_VISIT(traverse_module_state->__pyx_tuple__513); Py_VISIT(traverse_module_state->__pyx_tuple__514); Py_VISIT(traverse_module_state->__pyx_tuple__517); Py_VISIT(traverse_module_state->__pyx_tuple__519); Py_VISIT(traverse_module_state->__pyx_tuple__521); Py_VISIT(traverse_module_state->__pyx_codeobj__515); Py_VISIT(traverse_module_state->__pyx_codeobj__516); Py_VISIT(traverse_module_state->__pyx_codeobj__518); Py_VISIT(traverse_module_state->__pyx_codeobj__520); Py_VISIT(traverse_module_state->__pyx_codeobj__522); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_5color_Color __pyx_mstate_global->__pyx_type_11pygame_sdl2_5color_Color #define __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma __pyx_mstate_global->__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma #endif #define __pyx_ptype_11pygame_sdl2_5color_Color __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5color_Color #define __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma #define __pyx_kp_s_08x __pyx_mstate_global->__pyx_kp_s_08x #define __pyx_kp_s_0x __pyx_mstate_global->__pyx_kp_s_0x #define __pyx_n_s_BBB __pyx_mstate_global->__pyx_n_s_BBB #define __pyx_n_s_BBBB __pyx_mstate_global->__pyx_n_s_BBBB #define __pyx_n_s_Color __pyx_mstate_global->__pyx_n_s_Color #define __pyx_n_s_Color___reduce __pyx_mstate_global->__pyx_n_s_Color___reduce #define __pyx_n_s_Color___setstate __pyx_mstate_global->__pyx_n_s_Color___setstate #define __pyx_n_s_Color_correct_gamma __pyx_mstate_global->__pyx_n_s_Color_correct_gamma #define __pyx_n_s_Color_from_hex_locals_lambda __pyx_mstate_global->__pyx_n_s_Color_from_hex_locals_lambda #define __pyx_n_s_Color_normalize __pyx_mstate_global->__pyx_n_s_Color_normalize #define __pyx_n_s_Color_set_length __pyx_mstate_global->__pyx_n_s_Color_set_length #define __pyx_kp_s_Expected_a_color __pyx_mstate_global->__pyx_kp_s_Expected_a_color #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError #define __pyx_kp_s_L __pyx_mstate_global->__pyx_kp_s_L #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_n_s__10 __pyx_mstate_global->__pyx_n_s__10 #define __pyx_kp_s__2 __pyx_mstate_global->__pyx_kp_s__2 #define __pyx_kp_s__3 __pyx_mstate_global->__pyx_kp_s__3 #define __pyx_n_s__523 __pyx_mstate_global->__pyx_n_s__523 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_n_s_aliceblue __pyx_mstate_global->__pyx_n_s_aliceblue #define __pyx_n_s_antiquewhite __pyx_mstate_global->__pyx_n_s_antiquewhite #define __pyx_n_s_antiquewhite1 __pyx_mstate_global->__pyx_n_s_antiquewhite1 #define __pyx_n_s_antiquewhite2 __pyx_mstate_global->__pyx_n_s_antiquewhite2 #define __pyx_n_s_antiquewhite3 __pyx_mstate_global->__pyx_n_s_antiquewhite3 #define __pyx_n_s_antiquewhite4 __pyx_mstate_global->__pyx_n_s_antiquewhite4 #define __pyx_n_s_aquamarine __pyx_mstate_global->__pyx_n_s_aquamarine #define __pyx_n_s_aquamarine1 __pyx_mstate_global->__pyx_n_s_aquamarine1 #define __pyx_n_s_aquamarine2 __pyx_mstate_global->__pyx_n_s_aquamarine2 #define __pyx_n_s_aquamarine3 __pyx_mstate_global->__pyx_n_s_aquamarine3 #define __pyx_n_s_aquamarine4 __pyx_mstate_global->__pyx_n_s_aquamarine4 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_azure __pyx_mstate_global->__pyx_n_s_azure #define __pyx_n_s_azure1 __pyx_mstate_global->__pyx_n_s_azure1 #define __pyx_n_s_azure2 __pyx_mstate_global->__pyx_n_s_azure2 #define __pyx_n_s_azure3 __pyx_mstate_global->__pyx_n_s_azure3 #define __pyx_n_s_azure4 __pyx_mstate_global->__pyx_n_s_azure4 #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b #define __pyx_n_s_beige __pyx_mstate_global->__pyx_n_s_beige #define __pyx_n_s_binascii __pyx_mstate_global->__pyx_n_s_binascii #define __pyx_n_s_bisque __pyx_mstate_global->__pyx_n_s_bisque #define __pyx_n_s_bisque1 __pyx_mstate_global->__pyx_n_s_bisque1 #define __pyx_n_s_bisque2 __pyx_mstate_global->__pyx_n_s_bisque2 #define __pyx_n_s_bisque3 __pyx_mstate_global->__pyx_n_s_bisque3 #define __pyx_n_s_bisque4 __pyx_mstate_global->__pyx_n_s_bisque4 #define __pyx_n_s_black __pyx_mstate_global->__pyx_n_s_black #define __pyx_n_s_blanchedalmond __pyx_mstate_global->__pyx_n_s_blanchedalmond #define __pyx_n_s_blue __pyx_mstate_global->__pyx_n_s_blue #define __pyx_n_s_blue1 __pyx_mstate_global->__pyx_n_s_blue1 #define __pyx_n_s_blue2 __pyx_mstate_global->__pyx_n_s_blue2 #define __pyx_n_s_blue3 __pyx_mstate_global->__pyx_n_s_blue3 #define __pyx_n_s_blue4 __pyx_mstate_global->__pyx_n_s_blue4 #define __pyx_n_s_blueviolet __pyx_mstate_global->__pyx_n_s_blueviolet #define __pyx_n_s_brown __pyx_mstate_global->__pyx_n_s_brown #define __pyx_n_s_brown1 __pyx_mstate_global->__pyx_n_s_brown1 #define __pyx_n_s_brown2 __pyx_mstate_global->__pyx_n_s_brown2 #define __pyx_n_s_brown3 __pyx_mstate_global->__pyx_n_s_brown3 #define __pyx_n_s_brown4 __pyx_mstate_global->__pyx_n_s_brown4 #define __pyx_n_s_burlywood __pyx_mstate_global->__pyx_n_s_burlywood #define __pyx_n_s_burlywood1 __pyx_mstate_global->__pyx_n_s_burlywood1 #define __pyx_n_s_burlywood2 __pyx_mstate_global->__pyx_n_s_burlywood2 #define __pyx_n_s_burlywood3 __pyx_mstate_global->__pyx_n_s_burlywood3 #define __pyx_n_s_burlywood4 __pyx_mstate_global->__pyx_n_s_burlywood4 #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c #define __pyx_n_s_cadetblue __pyx_mstate_global->__pyx_n_s_cadetblue #define __pyx_n_s_cadetblue1 __pyx_mstate_global->__pyx_n_s_cadetblue1 #define __pyx_n_s_cadetblue2 __pyx_mstate_global->__pyx_n_s_cadetblue2 #define __pyx_n_s_cadetblue3 __pyx_mstate_global->__pyx_n_s_cadetblue3 #define __pyx_n_s_cadetblue4 __pyx_mstate_global->__pyx_n_s_cadetblue4 #define __pyx_n_s_chartreuse __pyx_mstate_global->__pyx_n_s_chartreuse #define __pyx_n_s_chartreuse1 __pyx_mstate_global->__pyx_n_s_chartreuse1 #define __pyx_n_s_chartreuse2 __pyx_mstate_global->__pyx_n_s_chartreuse2 #define __pyx_n_s_chartreuse3 __pyx_mstate_global->__pyx_n_s_chartreuse3 #define __pyx_n_s_chartreuse4 __pyx_mstate_global->__pyx_n_s_chartreuse4 #define __pyx_n_s_chocolate __pyx_mstate_global->__pyx_n_s_chocolate #define __pyx_n_s_chocolate1 __pyx_mstate_global->__pyx_n_s_chocolate1 #define __pyx_n_s_chocolate2 __pyx_mstate_global->__pyx_n_s_chocolate2 #define __pyx_n_s_chocolate3 __pyx_mstate_global->__pyx_n_s_chocolate3 #define __pyx_n_s_chocolate4 __pyx_mstate_global->__pyx_n_s_chocolate4 #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_coral __pyx_mstate_global->__pyx_n_s_coral #define __pyx_n_s_coral1 __pyx_mstate_global->__pyx_n_s_coral1 #define __pyx_n_s_coral2 __pyx_mstate_global->__pyx_n_s_coral2 #define __pyx_n_s_coral3 __pyx_mstate_global->__pyx_n_s_coral3 #define __pyx_n_s_coral4 __pyx_mstate_global->__pyx_n_s_coral4 #define __pyx_n_s_cornflowerblue __pyx_mstate_global->__pyx_n_s_cornflowerblue #define __pyx_n_s_cornsilk __pyx_mstate_global->__pyx_n_s_cornsilk #define __pyx_n_s_cornsilk1 __pyx_mstate_global->__pyx_n_s_cornsilk1 #define __pyx_n_s_cornsilk2 __pyx_mstate_global->__pyx_n_s_cornsilk2 #define __pyx_n_s_cornsilk3 __pyx_mstate_global->__pyx_n_s_cornsilk3 #define __pyx_n_s_cornsilk4 __pyx_mstate_global->__pyx_n_s_cornsilk4 #define __pyx_n_s_correct_gamma __pyx_mstate_global->__pyx_n_s_correct_gamma #define __pyx_n_s_correct_gamma_locals_lambda __pyx_mstate_global->__pyx_n_s_correct_gamma_locals_lambda #define __pyx_n_s_cyan __pyx_mstate_global->__pyx_n_s_cyan #define __pyx_n_s_cyan1 __pyx_mstate_global->__pyx_n_s_cyan1 #define __pyx_n_s_cyan2 __pyx_mstate_global->__pyx_n_s_cyan2 #define __pyx_n_s_cyan3 __pyx_mstate_global->__pyx_n_s_cyan3 #define __pyx_n_s_cyan4 __pyx_mstate_global->__pyx_n_s_cyan4 #define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d #define __pyx_n_s_darkblue __pyx_mstate_global->__pyx_n_s_darkblue #define __pyx_n_s_darkcyan __pyx_mstate_global->__pyx_n_s_darkcyan #define __pyx_n_s_darkgoldenrod __pyx_mstate_global->__pyx_n_s_darkgoldenrod #define __pyx_n_s_darkgoldenrod1 __pyx_mstate_global->__pyx_n_s_darkgoldenrod1 #define __pyx_n_s_darkgoldenrod2 __pyx_mstate_global->__pyx_n_s_darkgoldenrod2 #define __pyx_n_s_darkgoldenrod3 __pyx_mstate_global->__pyx_n_s_darkgoldenrod3 #define __pyx_n_s_darkgoldenrod4 __pyx_mstate_global->__pyx_n_s_darkgoldenrod4 #define __pyx_n_s_darkgray __pyx_mstate_global->__pyx_n_s_darkgray #define __pyx_n_s_darkgreen __pyx_mstate_global->__pyx_n_s_darkgreen #define __pyx_n_s_darkgrey __pyx_mstate_global->__pyx_n_s_darkgrey #define __pyx_n_s_darkkhaki __pyx_mstate_global->__pyx_n_s_darkkhaki #define __pyx_n_s_darkmagenta __pyx_mstate_global->__pyx_n_s_darkmagenta #define __pyx_n_s_darkolivegreen __pyx_mstate_global->__pyx_n_s_darkolivegreen #define __pyx_n_s_darkolivegreen1 __pyx_mstate_global->__pyx_n_s_darkolivegreen1 #define __pyx_n_s_darkolivegreen2 __pyx_mstate_global->__pyx_n_s_darkolivegreen2 #define __pyx_n_s_darkolivegreen3 __pyx_mstate_global->__pyx_n_s_darkolivegreen3 #define __pyx_n_s_darkolivegreen4 __pyx_mstate_global->__pyx_n_s_darkolivegreen4 #define __pyx_n_s_darkorange __pyx_mstate_global->__pyx_n_s_darkorange #define __pyx_n_s_darkorange1 __pyx_mstate_global->__pyx_n_s_darkorange1 #define __pyx_n_s_darkorange2 __pyx_mstate_global->__pyx_n_s_darkorange2 #define __pyx_n_s_darkorange3 __pyx_mstate_global->__pyx_n_s_darkorange3 #define __pyx_n_s_darkorange4 __pyx_mstate_global->__pyx_n_s_darkorange4 #define __pyx_n_s_darkorchid __pyx_mstate_global->__pyx_n_s_darkorchid #define __pyx_n_s_darkorchid1 __pyx_mstate_global->__pyx_n_s_darkorchid1 #define __pyx_n_s_darkorchid2 __pyx_mstate_global->__pyx_n_s_darkorchid2 #define __pyx_n_s_darkorchid3 __pyx_mstate_global->__pyx_n_s_darkorchid3 #define __pyx_n_s_darkorchid4 __pyx_mstate_global->__pyx_n_s_darkorchid4 #define __pyx_n_s_darkred __pyx_mstate_global->__pyx_n_s_darkred #define __pyx_n_s_darksalmon __pyx_mstate_global->__pyx_n_s_darksalmon #define __pyx_n_s_darkseagreen __pyx_mstate_global->__pyx_n_s_darkseagreen #define __pyx_n_s_darkseagreen1 __pyx_mstate_global->__pyx_n_s_darkseagreen1 #define __pyx_n_s_darkseagreen2 __pyx_mstate_global->__pyx_n_s_darkseagreen2 #define __pyx_n_s_darkseagreen3 __pyx_mstate_global->__pyx_n_s_darkseagreen3 #define __pyx_n_s_darkseagreen4 __pyx_mstate_global->__pyx_n_s_darkseagreen4 #define __pyx_n_s_darkslateblue __pyx_mstate_global->__pyx_n_s_darkslateblue #define __pyx_n_s_darkslategray __pyx_mstate_global->__pyx_n_s_darkslategray #define __pyx_n_s_darkslategray1 __pyx_mstate_global->__pyx_n_s_darkslategray1 #define __pyx_n_s_darkslategray2 __pyx_mstate_global->__pyx_n_s_darkslategray2 #define __pyx_n_s_darkslategray3 __pyx_mstate_global->__pyx_n_s_darkslategray3 #define __pyx_n_s_darkslategray4 __pyx_mstate_global->__pyx_n_s_darkslategray4 #define __pyx_n_s_darkslategrey __pyx_mstate_global->__pyx_n_s_darkslategrey #define __pyx_n_s_darkturquoise __pyx_mstate_global->__pyx_n_s_darkturquoise #define __pyx_n_s_darkviolet __pyx_mstate_global->__pyx_n_s_darkviolet #define __pyx_n_s_debianred __pyx_mstate_global->__pyx_n_s_debianred #define __pyx_n_s_deeppink __pyx_mstate_global->__pyx_n_s_deeppink #define __pyx_n_s_deeppink1 __pyx_mstate_global->__pyx_n_s_deeppink1 #define __pyx_n_s_deeppink2 __pyx_mstate_global->__pyx_n_s_deeppink2 #define __pyx_n_s_deeppink3 __pyx_mstate_global->__pyx_n_s_deeppink3 #define __pyx_n_s_deeppink4 __pyx_mstate_global->__pyx_n_s_deeppink4 #define __pyx_n_s_deepskyblue __pyx_mstate_global->__pyx_n_s_deepskyblue #define __pyx_n_s_deepskyblue1 __pyx_mstate_global->__pyx_n_s_deepskyblue1 #define __pyx_n_s_deepskyblue2 __pyx_mstate_global->__pyx_n_s_deepskyblue2 #define __pyx_n_s_deepskyblue3 __pyx_mstate_global->__pyx_n_s_deepskyblue3 #define __pyx_n_s_deepskyblue4 __pyx_mstate_global->__pyx_n_s_deepskyblue4 #define __pyx_n_s_dimgray __pyx_mstate_global->__pyx_n_s_dimgray #define __pyx_n_s_dimgrey __pyx_mstate_global->__pyx_n_s_dimgrey #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_div __pyx_mstate_global->__pyx_n_s_div #define __pyx_n_s_dodgerblue __pyx_mstate_global->__pyx_n_s_dodgerblue #define __pyx_n_s_dodgerblue1 __pyx_mstate_global->__pyx_n_s_dodgerblue1 #define __pyx_n_s_dodgerblue2 __pyx_mstate_global->__pyx_n_s_dodgerblue2 #define __pyx_n_s_dodgerblue3 __pyx_mstate_global->__pyx_n_s_dodgerblue3 #define __pyx_n_s_dodgerblue4 __pyx_mstate_global->__pyx_n_s_dodgerblue4 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_firebrick __pyx_mstate_global->__pyx_n_s_firebrick #define __pyx_n_s_firebrick1 __pyx_mstate_global->__pyx_n_s_firebrick1 #define __pyx_n_s_firebrick2 __pyx_mstate_global->__pyx_n_s_firebrick2 #define __pyx_n_s_firebrick3 __pyx_mstate_global->__pyx_n_s_firebrick3 #define __pyx_n_s_firebrick4 __pyx_mstate_global->__pyx_n_s_firebrick4 #define __pyx_n_s_floordiv___locals_div __pyx_mstate_global->__pyx_n_s_floordiv___locals_div #define __pyx_n_s_floralwhite __pyx_mstate_global->__pyx_n_s_floralwhite #define __pyx_n_s_forestgreen __pyx_mstate_global->__pyx_n_s_forestgreen #define __pyx_n_s_g __pyx_mstate_global->__pyx_n_s_g #define __pyx_n_s_gainsboro __pyx_mstate_global->__pyx_n_s_gainsboro #define __pyx_n_s_gamma __pyx_mstate_global->__pyx_n_s_gamma #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_ghostwhite __pyx_mstate_global->__pyx_n_s_ghostwhite #define __pyx_n_s_gold __pyx_mstate_global->__pyx_n_s_gold #define __pyx_n_s_gold1 __pyx_mstate_global->__pyx_n_s_gold1 #define __pyx_n_s_gold2 __pyx_mstate_global->__pyx_n_s_gold2 #define __pyx_n_s_gold3 __pyx_mstate_global->__pyx_n_s_gold3 #define __pyx_n_s_gold4 __pyx_mstate_global->__pyx_n_s_gold4 #define __pyx_n_s_goldenrod __pyx_mstate_global->__pyx_n_s_goldenrod #define __pyx_n_s_goldenrod1 __pyx_mstate_global->__pyx_n_s_goldenrod1 #define __pyx_n_s_goldenrod2 __pyx_mstate_global->__pyx_n_s_goldenrod2 #define __pyx_n_s_goldenrod3 __pyx_mstate_global->__pyx_n_s_goldenrod3 #define __pyx_n_s_goldenrod4 __pyx_mstate_global->__pyx_n_s_goldenrod4 #define __pyx_n_s_gray __pyx_mstate_global->__pyx_n_s_gray #define __pyx_n_s_gray0 __pyx_mstate_global->__pyx_n_s_gray0 #define __pyx_n_s_gray1 __pyx_mstate_global->__pyx_n_s_gray1 #define __pyx_n_s_gray10 __pyx_mstate_global->__pyx_n_s_gray10 #define __pyx_n_s_gray100 __pyx_mstate_global->__pyx_n_s_gray100 #define __pyx_n_s_gray11 __pyx_mstate_global->__pyx_n_s_gray11 #define __pyx_n_s_gray12 __pyx_mstate_global->__pyx_n_s_gray12 #define __pyx_n_s_gray13 __pyx_mstate_global->__pyx_n_s_gray13 #define __pyx_n_s_gray14 __pyx_mstate_global->__pyx_n_s_gray14 #define __pyx_n_s_gray15 __pyx_mstate_global->__pyx_n_s_gray15 #define __pyx_n_s_gray16 __pyx_mstate_global->__pyx_n_s_gray16 #define __pyx_n_s_gray17 __pyx_mstate_global->__pyx_n_s_gray17 #define __pyx_n_s_gray18 __pyx_mstate_global->__pyx_n_s_gray18 #define __pyx_n_s_gray19 __pyx_mstate_global->__pyx_n_s_gray19 #define __pyx_n_s_gray2 __pyx_mstate_global->__pyx_n_s_gray2 #define __pyx_n_s_gray20 __pyx_mstate_global->__pyx_n_s_gray20 #define __pyx_n_s_gray21 __pyx_mstate_global->__pyx_n_s_gray21 #define __pyx_n_s_gray22 __pyx_mstate_global->__pyx_n_s_gray22 #define __pyx_n_s_gray23 __pyx_mstate_global->__pyx_n_s_gray23 #define __pyx_n_s_gray24 __pyx_mstate_global->__pyx_n_s_gray24 #define __pyx_n_s_gray25 __pyx_mstate_global->__pyx_n_s_gray25 #define __pyx_n_s_gray26 __pyx_mstate_global->__pyx_n_s_gray26 #define __pyx_n_s_gray27 __pyx_mstate_global->__pyx_n_s_gray27 #define __pyx_n_s_gray28 __pyx_mstate_global->__pyx_n_s_gray28 #define __pyx_n_s_gray29 __pyx_mstate_global->__pyx_n_s_gray29 #define __pyx_n_s_gray3 __pyx_mstate_global->__pyx_n_s_gray3 #define __pyx_n_s_gray30 __pyx_mstate_global->__pyx_n_s_gray30 #define __pyx_n_s_gray31 __pyx_mstate_global->__pyx_n_s_gray31 #define __pyx_n_s_gray32 __pyx_mstate_global->__pyx_n_s_gray32 #define __pyx_n_s_gray33 __pyx_mstate_global->__pyx_n_s_gray33 #define __pyx_n_s_gray34 __pyx_mstate_global->__pyx_n_s_gray34 #define __pyx_n_s_gray35 __pyx_mstate_global->__pyx_n_s_gray35 #define __pyx_n_s_gray36 __pyx_mstate_global->__pyx_n_s_gray36 #define __pyx_n_s_gray37 __pyx_mstate_global->__pyx_n_s_gray37 #define __pyx_n_s_gray38 __pyx_mstate_global->__pyx_n_s_gray38 #define __pyx_n_s_gray39 __pyx_mstate_global->__pyx_n_s_gray39 #define __pyx_n_s_gray4 __pyx_mstate_global->__pyx_n_s_gray4 #define __pyx_n_s_gray40 __pyx_mstate_global->__pyx_n_s_gray40 #define __pyx_n_s_gray41 __pyx_mstate_global->__pyx_n_s_gray41 #define __pyx_n_s_gray42 __pyx_mstate_global->__pyx_n_s_gray42 #define __pyx_n_s_gray43 __pyx_mstate_global->__pyx_n_s_gray43 #define __pyx_n_s_gray44 __pyx_mstate_global->__pyx_n_s_gray44 #define __pyx_n_s_gray45 __pyx_mstate_global->__pyx_n_s_gray45 #define __pyx_n_s_gray46 __pyx_mstate_global->__pyx_n_s_gray46 #define __pyx_n_s_gray47 __pyx_mstate_global->__pyx_n_s_gray47 #define __pyx_n_s_gray48 __pyx_mstate_global->__pyx_n_s_gray48 #define __pyx_n_s_gray49 __pyx_mstate_global->__pyx_n_s_gray49 #define __pyx_n_s_gray5 __pyx_mstate_global->__pyx_n_s_gray5 #define __pyx_n_s_gray50 __pyx_mstate_global->__pyx_n_s_gray50 #define __pyx_n_s_gray51 __pyx_mstate_global->__pyx_n_s_gray51 #define __pyx_n_s_gray52 __pyx_mstate_global->__pyx_n_s_gray52 #define __pyx_n_s_gray53 __pyx_mstate_global->__pyx_n_s_gray53 #define __pyx_n_s_gray54 __pyx_mstate_global->__pyx_n_s_gray54 #define __pyx_n_s_gray55 __pyx_mstate_global->__pyx_n_s_gray55 #define __pyx_n_s_gray56 __pyx_mstate_global->__pyx_n_s_gray56 #define __pyx_n_s_gray57 __pyx_mstate_global->__pyx_n_s_gray57 #define __pyx_n_s_gray58 __pyx_mstate_global->__pyx_n_s_gray58 #define __pyx_n_s_gray59 __pyx_mstate_global->__pyx_n_s_gray59 #define __pyx_n_s_gray6 __pyx_mstate_global->__pyx_n_s_gray6 #define __pyx_n_s_gray60 __pyx_mstate_global->__pyx_n_s_gray60 #define __pyx_n_s_gray61 __pyx_mstate_global->__pyx_n_s_gray61 #define __pyx_n_s_gray62 __pyx_mstate_global->__pyx_n_s_gray62 #define __pyx_n_s_gray63 __pyx_mstate_global->__pyx_n_s_gray63 #define __pyx_n_s_gray64 __pyx_mstate_global->__pyx_n_s_gray64 #define __pyx_n_s_gray65 __pyx_mstate_global->__pyx_n_s_gray65 #define __pyx_n_s_gray66 __pyx_mstate_global->__pyx_n_s_gray66 #define __pyx_n_s_gray67 __pyx_mstate_global->__pyx_n_s_gray67 #define __pyx_n_s_gray68 __pyx_mstate_global->__pyx_n_s_gray68 #define __pyx_n_s_gray69 __pyx_mstate_global->__pyx_n_s_gray69 #define __pyx_n_s_gray7 __pyx_mstate_global->__pyx_n_s_gray7 #define __pyx_n_s_gray70 __pyx_mstate_global->__pyx_n_s_gray70 #define __pyx_n_s_gray71 __pyx_mstate_global->__pyx_n_s_gray71 #define __pyx_n_s_gray72 __pyx_mstate_global->__pyx_n_s_gray72 #define __pyx_n_s_gray73 __pyx_mstate_global->__pyx_n_s_gray73 #define __pyx_n_s_gray74 __pyx_mstate_global->__pyx_n_s_gray74 #define __pyx_n_s_gray75 __pyx_mstate_global->__pyx_n_s_gray75 #define __pyx_n_s_gray76 __pyx_mstate_global->__pyx_n_s_gray76 #define __pyx_n_s_gray77 __pyx_mstate_global->__pyx_n_s_gray77 #define __pyx_n_s_gray78 __pyx_mstate_global->__pyx_n_s_gray78 #define __pyx_n_s_gray79 __pyx_mstate_global->__pyx_n_s_gray79 #define __pyx_n_s_gray8 __pyx_mstate_global->__pyx_n_s_gray8 #define __pyx_n_s_gray80 __pyx_mstate_global->__pyx_n_s_gray80 #define __pyx_n_s_gray81 __pyx_mstate_global->__pyx_n_s_gray81 #define __pyx_n_s_gray82 __pyx_mstate_global->__pyx_n_s_gray82 #define __pyx_n_s_gray83 __pyx_mstate_global->__pyx_n_s_gray83 #define __pyx_n_s_gray84 __pyx_mstate_global->__pyx_n_s_gray84 #define __pyx_n_s_gray85 __pyx_mstate_global->__pyx_n_s_gray85 #define __pyx_n_s_gray86 __pyx_mstate_global->__pyx_n_s_gray86 #define __pyx_n_s_gray87 __pyx_mstate_global->__pyx_n_s_gray87 #define __pyx_n_s_gray88 __pyx_mstate_global->__pyx_n_s_gray88 #define __pyx_n_s_gray89 __pyx_mstate_global->__pyx_n_s_gray89 #define __pyx_n_s_gray9 __pyx_mstate_global->__pyx_n_s_gray9 #define __pyx_n_s_gray90 __pyx_mstate_global->__pyx_n_s_gray90 #define __pyx_n_s_gray91 __pyx_mstate_global->__pyx_n_s_gray91 #define __pyx_n_s_gray92 __pyx_mstate_global->__pyx_n_s_gray92 #define __pyx_n_s_gray93 __pyx_mstate_global->__pyx_n_s_gray93 #define __pyx_n_s_gray94 __pyx_mstate_global->__pyx_n_s_gray94 #define __pyx_n_s_gray95 __pyx_mstate_global->__pyx_n_s_gray95 #define __pyx_n_s_gray96 __pyx_mstate_global->__pyx_n_s_gray96 #define __pyx_n_s_gray97 __pyx_mstate_global->__pyx_n_s_gray97 #define __pyx_n_s_gray98 __pyx_mstate_global->__pyx_n_s_gray98 #define __pyx_n_s_gray99 __pyx_mstate_global->__pyx_n_s_gray99 #define __pyx_n_s_green __pyx_mstate_global->__pyx_n_s_green #define __pyx_n_s_green1 __pyx_mstate_global->__pyx_n_s_green1 #define __pyx_n_s_green2 __pyx_mstate_global->__pyx_n_s_green2 #define __pyx_n_s_green3 __pyx_mstate_global->__pyx_n_s_green3 #define __pyx_n_s_green4 __pyx_mstate_global->__pyx_n_s_green4 #define __pyx_n_s_greenyellow __pyx_mstate_global->__pyx_n_s_greenyellow #define __pyx_n_s_grey __pyx_mstate_global->__pyx_n_s_grey #define __pyx_n_s_grey0 __pyx_mstate_global->__pyx_n_s_grey0 #define __pyx_n_s_grey1 __pyx_mstate_global->__pyx_n_s_grey1 #define __pyx_n_s_grey10 __pyx_mstate_global->__pyx_n_s_grey10 #define __pyx_n_s_grey100 __pyx_mstate_global->__pyx_n_s_grey100 #define __pyx_n_s_grey11 __pyx_mstate_global->__pyx_n_s_grey11 #define __pyx_n_s_grey12 __pyx_mstate_global->__pyx_n_s_grey12 #define __pyx_n_s_grey13 __pyx_mstate_global->__pyx_n_s_grey13 #define __pyx_n_s_grey14 __pyx_mstate_global->__pyx_n_s_grey14 #define __pyx_n_s_grey15 __pyx_mstate_global->__pyx_n_s_grey15 #define __pyx_n_s_grey16 __pyx_mstate_global->__pyx_n_s_grey16 #define __pyx_n_s_grey17 __pyx_mstate_global->__pyx_n_s_grey17 #define __pyx_n_s_grey18 __pyx_mstate_global->__pyx_n_s_grey18 #define __pyx_n_s_grey19 __pyx_mstate_global->__pyx_n_s_grey19 #define __pyx_n_s_grey2 __pyx_mstate_global->__pyx_n_s_grey2 #define __pyx_n_s_grey20 __pyx_mstate_global->__pyx_n_s_grey20 #define __pyx_n_s_grey21 __pyx_mstate_global->__pyx_n_s_grey21 #define __pyx_n_s_grey22 __pyx_mstate_global->__pyx_n_s_grey22 #define __pyx_n_s_grey23 __pyx_mstate_global->__pyx_n_s_grey23 #define __pyx_n_s_grey24 __pyx_mstate_global->__pyx_n_s_grey24 #define __pyx_n_s_grey25 __pyx_mstate_global->__pyx_n_s_grey25 #define __pyx_n_s_grey26 __pyx_mstate_global->__pyx_n_s_grey26 #define __pyx_n_s_grey27 __pyx_mstate_global->__pyx_n_s_grey27 #define __pyx_n_s_grey28 __pyx_mstate_global->__pyx_n_s_grey28 #define __pyx_n_s_grey29 __pyx_mstate_global->__pyx_n_s_grey29 #define __pyx_n_s_grey3 __pyx_mstate_global->__pyx_n_s_grey3 #define __pyx_n_s_grey30 __pyx_mstate_global->__pyx_n_s_grey30 #define __pyx_n_s_grey31 __pyx_mstate_global->__pyx_n_s_grey31 #define __pyx_n_s_grey32 __pyx_mstate_global->__pyx_n_s_grey32 #define __pyx_n_s_grey33 __pyx_mstate_global->__pyx_n_s_grey33 #define __pyx_n_s_grey34 __pyx_mstate_global->__pyx_n_s_grey34 #define __pyx_n_s_grey35 __pyx_mstate_global->__pyx_n_s_grey35 #define __pyx_n_s_grey36 __pyx_mstate_global->__pyx_n_s_grey36 #define __pyx_n_s_grey37 __pyx_mstate_global->__pyx_n_s_grey37 #define __pyx_n_s_grey38 __pyx_mstate_global->__pyx_n_s_grey38 #define __pyx_n_s_grey39 __pyx_mstate_global->__pyx_n_s_grey39 #define __pyx_n_s_grey4 __pyx_mstate_global->__pyx_n_s_grey4 #define __pyx_n_s_grey40 __pyx_mstate_global->__pyx_n_s_grey40 #define __pyx_n_s_grey41 __pyx_mstate_global->__pyx_n_s_grey41 #define __pyx_n_s_grey42 __pyx_mstate_global->__pyx_n_s_grey42 #define __pyx_n_s_grey43 __pyx_mstate_global->__pyx_n_s_grey43 #define __pyx_n_s_grey44 __pyx_mstate_global->__pyx_n_s_grey44 #define __pyx_n_s_grey45 __pyx_mstate_global->__pyx_n_s_grey45 #define __pyx_n_s_grey46 __pyx_mstate_global->__pyx_n_s_grey46 #define __pyx_n_s_grey47 __pyx_mstate_global->__pyx_n_s_grey47 #define __pyx_n_s_grey48 __pyx_mstate_global->__pyx_n_s_grey48 #define __pyx_n_s_grey49 __pyx_mstate_global->__pyx_n_s_grey49 #define __pyx_n_s_grey5 __pyx_mstate_global->__pyx_n_s_grey5 #define __pyx_n_s_grey50 __pyx_mstate_global->__pyx_n_s_grey50 #define __pyx_n_s_grey51 __pyx_mstate_global->__pyx_n_s_grey51 #define __pyx_n_s_grey52 __pyx_mstate_global->__pyx_n_s_grey52 #define __pyx_n_s_grey53 __pyx_mstate_global->__pyx_n_s_grey53 #define __pyx_n_s_grey54 __pyx_mstate_global->__pyx_n_s_grey54 #define __pyx_n_s_grey55 __pyx_mstate_global->__pyx_n_s_grey55 #define __pyx_n_s_grey56 __pyx_mstate_global->__pyx_n_s_grey56 #define __pyx_n_s_grey57 __pyx_mstate_global->__pyx_n_s_grey57 #define __pyx_n_s_grey58 __pyx_mstate_global->__pyx_n_s_grey58 #define __pyx_n_s_grey59 __pyx_mstate_global->__pyx_n_s_grey59 #define __pyx_n_s_grey6 __pyx_mstate_global->__pyx_n_s_grey6 #define __pyx_n_s_grey60 __pyx_mstate_global->__pyx_n_s_grey60 #define __pyx_n_s_grey61 __pyx_mstate_global->__pyx_n_s_grey61 #define __pyx_n_s_grey62 __pyx_mstate_global->__pyx_n_s_grey62 #define __pyx_n_s_grey63 __pyx_mstate_global->__pyx_n_s_grey63 #define __pyx_n_s_grey64 __pyx_mstate_global->__pyx_n_s_grey64 #define __pyx_n_s_grey65 __pyx_mstate_global->__pyx_n_s_grey65 #define __pyx_n_s_grey66 __pyx_mstate_global->__pyx_n_s_grey66 #define __pyx_n_s_grey67 __pyx_mstate_global->__pyx_n_s_grey67 #define __pyx_n_s_grey68 __pyx_mstate_global->__pyx_n_s_grey68 #define __pyx_n_s_grey69 __pyx_mstate_global->__pyx_n_s_grey69 #define __pyx_n_s_grey7 __pyx_mstate_global->__pyx_n_s_grey7 #define __pyx_n_s_grey70 __pyx_mstate_global->__pyx_n_s_grey70 #define __pyx_n_s_grey71 __pyx_mstate_global->__pyx_n_s_grey71 #define __pyx_n_s_grey72 __pyx_mstate_global->__pyx_n_s_grey72 #define __pyx_n_s_grey73 __pyx_mstate_global->__pyx_n_s_grey73 #define __pyx_n_s_grey74 __pyx_mstate_global->__pyx_n_s_grey74 #define __pyx_n_s_grey75 __pyx_mstate_global->__pyx_n_s_grey75 #define __pyx_n_s_grey76 __pyx_mstate_global->__pyx_n_s_grey76 #define __pyx_n_s_grey77 __pyx_mstate_global->__pyx_n_s_grey77 #define __pyx_n_s_grey78 __pyx_mstate_global->__pyx_n_s_grey78 #define __pyx_n_s_grey79 __pyx_mstate_global->__pyx_n_s_grey79 #define __pyx_n_s_grey8 __pyx_mstate_global->__pyx_n_s_grey8 #define __pyx_n_s_grey80 __pyx_mstate_global->__pyx_n_s_grey80 #define __pyx_n_s_grey81 __pyx_mstate_global->__pyx_n_s_grey81 #define __pyx_n_s_grey82 __pyx_mstate_global->__pyx_n_s_grey82 #define __pyx_n_s_grey83 __pyx_mstate_global->__pyx_n_s_grey83 #define __pyx_n_s_grey84 __pyx_mstate_global->__pyx_n_s_grey84 #define __pyx_n_s_grey85 __pyx_mstate_global->__pyx_n_s_grey85 #define __pyx_n_s_grey86 __pyx_mstate_global->__pyx_n_s_grey86 #define __pyx_n_s_grey87 __pyx_mstate_global->__pyx_n_s_grey87 #define __pyx_n_s_grey88 __pyx_mstate_global->__pyx_n_s_grey88 #define __pyx_n_s_grey89 __pyx_mstate_global->__pyx_n_s_grey89 #define __pyx_n_s_grey9 __pyx_mstate_global->__pyx_n_s_grey9 #define __pyx_n_s_grey90 __pyx_mstate_global->__pyx_n_s_grey90 #define __pyx_n_s_grey91 __pyx_mstate_global->__pyx_n_s_grey91 #define __pyx_n_s_grey92 __pyx_mstate_global->__pyx_n_s_grey92 #define __pyx_n_s_grey93 __pyx_mstate_global->__pyx_n_s_grey93 #define __pyx_n_s_grey94 __pyx_mstate_global->__pyx_n_s_grey94 #define __pyx_n_s_grey95 __pyx_mstate_global->__pyx_n_s_grey95 #define __pyx_n_s_grey96 __pyx_mstate_global->__pyx_n_s_grey96 #define __pyx_n_s_grey97 __pyx_mstate_global->__pyx_n_s_grey97 #define __pyx_n_s_grey98 __pyx_mstate_global->__pyx_n_s_grey98 #define __pyx_n_s_grey99 __pyx_mstate_global->__pyx_n_s_grey99 #define __pyx_n_s_hex __pyx_mstate_global->__pyx_n_s_hex #define __pyx_n_s_honeydew __pyx_mstate_global->__pyx_n_s_honeydew #define __pyx_n_s_honeydew1 __pyx_mstate_global->__pyx_n_s_honeydew1 #define __pyx_n_s_honeydew2 __pyx_mstate_global->__pyx_n_s_honeydew2 #define __pyx_n_s_honeydew3 __pyx_mstate_global->__pyx_n_s_honeydew3 #define __pyx_n_s_honeydew4 __pyx_mstate_global->__pyx_n_s_honeydew4 #define __pyx_n_s_hotpink __pyx_mstate_global->__pyx_n_s_hotpink #define __pyx_n_s_hotpink1 __pyx_mstate_global->__pyx_n_s_hotpink1 #define __pyx_n_s_hotpink2 __pyx_mstate_global->__pyx_n_s_hotpink2 #define __pyx_n_s_hotpink3 __pyx_mstate_global->__pyx_n_s_hotpink3 #define __pyx_n_s_hotpink4 __pyx_mstate_global->__pyx_n_s_hotpink4 #define __pyx_n_s_hsva __pyx_mstate_global->__pyx_n_s_hsva #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_indianred __pyx_mstate_global->__pyx_n_s_indianred #define __pyx_n_s_indianred1 __pyx_mstate_global->__pyx_n_s_indianred1 #define __pyx_n_s_indianred2 __pyx_mstate_global->__pyx_n_s_indianred2 #define __pyx_n_s_indianred3 __pyx_mstate_global->__pyx_n_s_indianred3 #define __pyx_n_s_indianred4 __pyx_mstate_global->__pyx_n_s_indianred4 #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_ivory __pyx_mstate_global->__pyx_n_s_ivory #define __pyx_n_s_ivory1 __pyx_mstate_global->__pyx_n_s_ivory1 #define __pyx_n_s_ivory2 __pyx_mstate_global->__pyx_n_s_ivory2 #define __pyx_n_s_ivory3 __pyx_mstate_global->__pyx_n_s_ivory3 #define __pyx_n_s_ivory4 __pyx_mstate_global->__pyx_n_s_ivory4 #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join #define __pyx_n_s_khaki __pyx_mstate_global->__pyx_n_s_khaki #define __pyx_n_s_khaki1 __pyx_mstate_global->__pyx_n_s_khaki1 #define __pyx_n_s_khaki2 __pyx_mstate_global->__pyx_n_s_khaki2 #define __pyx_n_s_khaki3 __pyx_mstate_global->__pyx_n_s_khaki3 #define __pyx_n_s_khaki4 __pyx_mstate_global->__pyx_n_s_khaki4 #define __pyx_n_s_l __pyx_mstate_global->__pyx_n_s_l #define __pyx_n_s_lavender __pyx_mstate_global->__pyx_n_s_lavender #define __pyx_n_s_lavenderblush __pyx_mstate_global->__pyx_n_s_lavenderblush #define __pyx_n_s_lavenderblush1 __pyx_mstate_global->__pyx_n_s_lavenderblush1 #define __pyx_n_s_lavenderblush2 __pyx_mstate_global->__pyx_n_s_lavenderblush2 #define __pyx_n_s_lavenderblush3 __pyx_mstate_global->__pyx_n_s_lavenderblush3 #define __pyx_n_s_lavenderblush4 __pyx_mstate_global->__pyx_n_s_lavenderblush4 #define __pyx_n_s_lawngreen __pyx_mstate_global->__pyx_n_s_lawngreen #define __pyx_n_s_lemonchiffon __pyx_mstate_global->__pyx_n_s_lemonchiffon #define __pyx_n_s_lemonchiffon1 __pyx_mstate_global->__pyx_n_s_lemonchiffon1 #define __pyx_n_s_lemonchiffon2 __pyx_mstate_global->__pyx_n_s_lemonchiffon2 #define __pyx_n_s_lemonchiffon3 __pyx_mstate_global->__pyx_n_s_lemonchiffon3 #define __pyx_n_s_lemonchiffon4 __pyx_mstate_global->__pyx_n_s_lemonchiffon4 #define __pyx_n_s_lightblue __pyx_mstate_global->__pyx_n_s_lightblue #define __pyx_n_s_lightblue1 __pyx_mstate_global->__pyx_n_s_lightblue1 #define __pyx_n_s_lightblue2 __pyx_mstate_global->__pyx_n_s_lightblue2 #define __pyx_n_s_lightblue3 __pyx_mstate_global->__pyx_n_s_lightblue3 #define __pyx_n_s_lightblue4 __pyx_mstate_global->__pyx_n_s_lightblue4 #define __pyx_n_s_lightcoral __pyx_mstate_global->__pyx_n_s_lightcoral #define __pyx_n_s_lightcyan __pyx_mstate_global->__pyx_n_s_lightcyan #define __pyx_n_s_lightcyan1 __pyx_mstate_global->__pyx_n_s_lightcyan1 #define __pyx_n_s_lightcyan2 __pyx_mstate_global->__pyx_n_s_lightcyan2 #define __pyx_n_s_lightcyan3 __pyx_mstate_global->__pyx_n_s_lightcyan3 #define __pyx_n_s_lightcyan4 __pyx_mstate_global->__pyx_n_s_lightcyan4 #define __pyx_n_s_lightgoldenrod __pyx_mstate_global->__pyx_n_s_lightgoldenrod #define __pyx_n_s_lightgoldenrod1 __pyx_mstate_global->__pyx_n_s_lightgoldenrod1 #define __pyx_n_s_lightgoldenrod2 __pyx_mstate_global->__pyx_n_s_lightgoldenrod2 #define __pyx_n_s_lightgoldenrod3 __pyx_mstate_global->__pyx_n_s_lightgoldenrod3 #define __pyx_n_s_lightgoldenrod4 __pyx_mstate_global->__pyx_n_s_lightgoldenrod4 #define __pyx_n_s_lightgoldenrodyellow __pyx_mstate_global->__pyx_n_s_lightgoldenrodyellow #define __pyx_n_s_lightgray __pyx_mstate_global->__pyx_n_s_lightgray #define __pyx_n_s_lightgreen __pyx_mstate_global->__pyx_n_s_lightgreen #define __pyx_n_s_lightgrey __pyx_mstate_global->__pyx_n_s_lightgrey #define __pyx_n_s_lightpink __pyx_mstate_global->__pyx_n_s_lightpink #define __pyx_n_s_lightpink1 __pyx_mstate_global->__pyx_n_s_lightpink1 #define __pyx_n_s_lightpink2 __pyx_mstate_global->__pyx_n_s_lightpink2 #define __pyx_n_s_lightpink3 __pyx_mstate_global->__pyx_n_s_lightpink3 #define __pyx_n_s_lightpink4 __pyx_mstate_global->__pyx_n_s_lightpink4 #define __pyx_n_s_lightsalmon __pyx_mstate_global->__pyx_n_s_lightsalmon #define __pyx_n_s_lightsalmon1 __pyx_mstate_global->__pyx_n_s_lightsalmon1 #define __pyx_n_s_lightsalmon2 __pyx_mstate_global->__pyx_n_s_lightsalmon2 #define __pyx_n_s_lightsalmon3 __pyx_mstate_global->__pyx_n_s_lightsalmon3 #define __pyx_n_s_lightsalmon4 __pyx_mstate_global->__pyx_n_s_lightsalmon4 #define __pyx_n_s_lightseagreen __pyx_mstate_global->__pyx_n_s_lightseagreen #define __pyx_n_s_lightskyblue __pyx_mstate_global->__pyx_n_s_lightskyblue #define __pyx_n_s_lightskyblue1 __pyx_mstate_global->__pyx_n_s_lightskyblue1 #define __pyx_n_s_lightskyblue2 __pyx_mstate_global->__pyx_n_s_lightskyblue2 #define __pyx_n_s_lightskyblue3 __pyx_mstate_global->__pyx_n_s_lightskyblue3 #define __pyx_n_s_lightskyblue4 __pyx_mstate_global->__pyx_n_s_lightskyblue4 #define __pyx_n_s_lightslateblue __pyx_mstate_global->__pyx_n_s_lightslateblue #define __pyx_n_s_lightslategray __pyx_mstate_global->__pyx_n_s_lightslategray #define __pyx_n_s_lightslategrey __pyx_mstate_global->__pyx_n_s_lightslategrey #define __pyx_n_s_lightsteelblue __pyx_mstate_global->__pyx_n_s_lightsteelblue #define __pyx_n_s_lightsteelblue1 __pyx_mstate_global->__pyx_n_s_lightsteelblue1 #define __pyx_n_s_lightsteelblue2 __pyx_mstate_global->__pyx_n_s_lightsteelblue2 #define __pyx_n_s_lightsteelblue3 __pyx_mstate_global->__pyx_n_s_lightsteelblue3 #define __pyx_n_s_lightsteelblue4 __pyx_mstate_global->__pyx_n_s_lightsteelblue4 #define __pyx_n_s_lightyellow __pyx_mstate_global->__pyx_n_s_lightyellow #define __pyx_n_s_lightyellow1 __pyx_mstate_global->__pyx_n_s_lightyellow1 #define __pyx_n_s_lightyellow2 __pyx_mstate_global->__pyx_n_s_lightyellow2 #define __pyx_n_s_lightyellow3 __pyx_mstate_global->__pyx_n_s_lightyellow3 #define __pyx_n_s_lightyellow4 __pyx_mstate_global->__pyx_n_s_lightyellow4 #define __pyx_n_s_limegreen __pyx_mstate_global->__pyx_n_s_limegreen #define __pyx_n_s_linen __pyx_mstate_global->__pyx_n_s_linen #define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower #define __pyx_n_s_m __pyx_mstate_global->__pyx_n_s_m #define __pyx_n_s_magenta __pyx_mstate_global->__pyx_n_s_magenta #define __pyx_n_s_magenta1 __pyx_mstate_global->__pyx_n_s_magenta1 #define __pyx_n_s_magenta2 __pyx_mstate_global->__pyx_n_s_magenta2 #define __pyx_n_s_magenta3 __pyx_mstate_global->__pyx_n_s_magenta3 #define __pyx_n_s_magenta4 __pyx_mstate_global->__pyx_n_s_magenta4 #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_map __pyx_mstate_global->__pyx_n_s_map #define __pyx_n_s_maroon __pyx_mstate_global->__pyx_n_s_maroon #define __pyx_n_s_maroon1 __pyx_mstate_global->__pyx_n_s_maroon1 #define __pyx_n_s_maroon2 __pyx_mstate_global->__pyx_n_s_maroon2 #define __pyx_n_s_maroon3 __pyx_mstate_global->__pyx_n_s_maroon3 #define __pyx_n_s_maroon4 __pyx_mstate_global->__pyx_n_s_maroon4 #define __pyx_n_s_mediumaquamarine __pyx_mstate_global->__pyx_n_s_mediumaquamarine #define __pyx_n_s_mediumblue __pyx_mstate_global->__pyx_n_s_mediumblue #define __pyx_n_s_mediumorchid __pyx_mstate_global->__pyx_n_s_mediumorchid #define __pyx_n_s_mediumorchid1 __pyx_mstate_global->__pyx_n_s_mediumorchid1 #define __pyx_n_s_mediumorchid2 __pyx_mstate_global->__pyx_n_s_mediumorchid2 #define __pyx_n_s_mediumorchid3 __pyx_mstate_global->__pyx_n_s_mediumorchid3 #define __pyx_n_s_mediumorchid4 __pyx_mstate_global->__pyx_n_s_mediumorchid4 #define __pyx_n_s_mediumpurple __pyx_mstate_global->__pyx_n_s_mediumpurple #define __pyx_n_s_mediumpurple1 __pyx_mstate_global->__pyx_n_s_mediumpurple1 #define __pyx_n_s_mediumpurple2 __pyx_mstate_global->__pyx_n_s_mediumpurple2 #define __pyx_n_s_mediumpurple3 __pyx_mstate_global->__pyx_n_s_mediumpurple3 #define __pyx_n_s_mediumpurple4 __pyx_mstate_global->__pyx_n_s_mediumpurple4 #define __pyx_n_s_mediumseagreen __pyx_mstate_global->__pyx_n_s_mediumseagreen #define __pyx_n_s_mediumslateblue __pyx_mstate_global->__pyx_n_s_mediumslateblue #define __pyx_n_s_mediumspringgreen __pyx_mstate_global->__pyx_n_s_mediumspringgreen #define __pyx_n_s_mediumturquoise __pyx_mstate_global->__pyx_n_s_mediumturquoise #define __pyx_n_s_mediumvioletred __pyx_mstate_global->__pyx_n_s_mediumvioletred #define __pyx_n_s_midnightblue __pyx_mstate_global->__pyx_n_s_midnightblue #define __pyx_n_s_mintcream __pyx_mstate_global->__pyx_n_s_mintcream #define __pyx_n_s_mistyrose __pyx_mstate_global->__pyx_n_s_mistyrose #define __pyx_n_s_mistyrose1 __pyx_mstate_global->__pyx_n_s_mistyrose1 #define __pyx_n_s_mistyrose2 __pyx_mstate_global->__pyx_n_s_mistyrose2 #define __pyx_n_s_mistyrose3 __pyx_mstate_global->__pyx_n_s_mistyrose3 #define __pyx_n_s_mistyrose4 __pyx_mstate_global->__pyx_n_s_mistyrose4 #define __pyx_n_s_moccasin __pyx_mstate_global->__pyx_n_s_moccasin #define __pyx_n_s_mod __pyx_mstate_global->__pyx_n_s_mod #define __pyx_n_s_mod___locals_mod __pyx_mstate_global->__pyx_n_s_mod___locals_mod #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_navajowhite __pyx_mstate_global->__pyx_n_s_navajowhite #define __pyx_n_s_navajowhite1 __pyx_mstate_global->__pyx_n_s_navajowhite1 #define __pyx_n_s_navajowhite2 __pyx_mstate_global->__pyx_n_s_navajowhite2 #define __pyx_n_s_navajowhite3 __pyx_mstate_global->__pyx_n_s_navajowhite3 #define __pyx_n_s_navajowhite4 __pyx_mstate_global->__pyx_n_s_navajowhite4 #define __pyx_n_s_navy __pyx_mstate_global->__pyx_n_s_navy #define __pyx_n_s_navyblue __pyx_mstate_global->__pyx_n_s_navyblue #define __pyx_n_s_normalize __pyx_mstate_global->__pyx_n_s_normalize #define __pyx_n_s_oct __pyx_mstate_global->__pyx_n_s_oct #define __pyx_n_s_oldlace __pyx_mstate_global->__pyx_n_s_oldlace #define __pyx_n_s_olivedrab __pyx_mstate_global->__pyx_n_s_olivedrab #define __pyx_n_s_olivedrab1 __pyx_mstate_global->__pyx_n_s_olivedrab1 #define __pyx_n_s_olivedrab2 __pyx_mstate_global->__pyx_n_s_olivedrab2 #define __pyx_n_s_olivedrab3 __pyx_mstate_global->__pyx_n_s_olivedrab3 #define __pyx_n_s_olivedrab4 __pyx_mstate_global->__pyx_n_s_olivedrab4 #define __pyx_n_s_orange __pyx_mstate_global->__pyx_n_s_orange #define __pyx_n_s_orange1 __pyx_mstate_global->__pyx_n_s_orange1 #define __pyx_n_s_orange2 __pyx_mstate_global->__pyx_n_s_orange2 #define __pyx_n_s_orange3 __pyx_mstate_global->__pyx_n_s_orange3 #define __pyx_n_s_orange4 __pyx_mstate_global->__pyx_n_s_orange4 #define __pyx_n_s_orangered __pyx_mstate_global->__pyx_n_s_orangered #define __pyx_n_s_orangered1 __pyx_mstate_global->__pyx_n_s_orangered1 #define __pyx_n_s_orangered2 __pyx_mstate_global->__pyx_n_s_orangered2 #define __pyx_n_s_orangered3 __pyx_mstate_global->__pyx_n_s_orangered3 #define __pyx_n_s_orangered4 __pyx_mstate_global->__pyx_n_s_orangered4 #define __pyx_n_s_orchid __pyx_mstate_global->__pyx_n_s_orchid #define __pyx_n_s_orchid1 __pyx_mstate_global->__pyx_n_s_orchid1 #define __pyx_n_s_orchid2 __pyx_mstate_global->__pyx_n_s_orchid2 #define __pyx_n_s_orchid3 __pyx_mstate_global->__pyx_n_s_orchid3 #define __pyx_n_s_orchid4 __pyx_mstate_global->__pyx_n_s_orchid4 #define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack #define __pyx_n_s_palegoldenrod __pyx_mstate_global->__pyx_n_s_palegoldenrod #define __pyx_n_s_palegreen __pyx_mstate_global->__pyx_n_s_palegreen #define __pyx_n_s_palegreen1 __pyx_mstate_global->__pyx_n_s_palegreen1 #define __pyx_n_s_palegreen2 __pyx_mstate_global->__pyx_n_s_palegreen2 #define __pyx_n_s_palegreen3 __pyx_mstate_global->__pyx_n_s_palegreen3 #define __pyx_n_s_palegreen4 __pyx_mstate_global->__pyx_n_s_palegreen4 #define __pyx_n_s_paleturquoise __pyx_mstate_global->__pyx_n_s_paleturquoise #define __pyx_n_s_paleturquoise1 __pyx_mstate_global->__pyx_n_s_paleturquoise1 #define __pyx_n_s_paleturquoise2 __pyx_mstate_global->__pyx_n_s_paleturquoise2 #define __pyx_n_s_paleturquoise3 __pyx_mstate_global->__pyx_n_s_paleturquoise3 #define __pyx_n_s_paleturquoise4 __pyx_mstate_global->__pyx_n_s_paleturquoise4 #define __pyx_n_s_palevioletred __pyx_mstate_global->__pyx_n_s_palevioletred #define __pyx_n_s_palevioletred1 __pyx_mstate_global->__pyx_n_s_palevioletred1 #define __pyx_n_s_palevioletred2 __pyx_mstate_global->__pyx_n_s_palevioletred2 #define __pyx_n_s_palevioletred3 __pyx_mstate_global->__pyx_n_s_palevioletred3 #define __pyx_n_s_palevioletred4 __pyx_mstate_global->__pyx_n_s_palevioletred4 #define __pyx_n_s_papayawhip __pyx_mstate_global->__pyx_n_s_papayawhip #define __pyx_n_s_peachpuff __pyx_mstate_global->__pyx_n_s_peachpuff #define __pyx_n_s_peachpuff1 __pyx_mstate_global->__pyx_n_s_peachpuff1 #define __pyx_n_s_peachpuff2 __pyx_mstate_global->__pyx_n_s_peachpuff2 #define __pyx_n_s_peachpuff3 __pyx_mstate_global->__pyx_n_s_peachpuff3 #define __pyx_n_s_peachpuff4 __pyx_mstate_global->__pyx_n_s_peachpuff4 #define __pyx_n_s_peru __pyx_mstate_global->__pyx_n_s_peru #define __pyx_n_s_pink __pyx_mstate_global->__pyx_n_s_pink #define __pyx_n_s_pink1 __pyx_mstate_global->__pyx_n_s_pink1 #define __pyx_n_s_pink2 __pyx_mstate_global->__pyx_n_s_pink2 #define __pyx_n_s_pink3 __pyx_mstate_global->__pyx_n_s_pink3 #define __pyx_n_s_pink4 __pyx_mstate_global->__pyx_n_s_pink4 #define __pyx_n_s_plum __pyx_mstate_global->__pyx_n_s_plum #define __pyx_n_s_plum1 __pyx_mstate_global->__pyx_n_s_plum1 #define __pyx_n_s_plum2 __pyx_mstate_global->__pyx_n_s_plum2 #define __pyx_n_s_plum3 __pyx_mstate_global->__pyx_n_s_plum3 #define __pyx_n_s_plum4 __pyx_mstate_global->__pyx_n_s_plum4 #define __pyx_n_s_powderblue __pyx_mstate_global->__pyx_n_s_powderblue #define __pyx_n_s_purple __pyx_mstate_global->__pyx_n_s_purple #define __pyx_n_s_purple1 __pyx_mstate_global->__pyx_n_s_purple1 #define __pyx_n_s_purple2 __pyx_mstate_global->__pyx_n_s_purple2 #define __pyx_n_s_purple3 __pyx_mstate_global->__pyx_n_s_purple3 #define __pyx_n_s_purple4 __pyx_mstate_global->__pyx_n_s_purple4 #define __pyx_n_s_pygame_sdl2_color __pyx_mstate_global->__pyx_n_s_pygame_sdl2_color #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_red __pyx_mstate_global->__pyx_n_s_red #define __pyx_n_s_red1 __pyx_mstate_global->__pyx_n_s_red1 #define __pyx_n_s_red2 __pyx_mstate_global->__pyx_n_s_red2 #define __pyx_n_s_red3 __pyx_mstate_global->__pyx_n_s_red3 #define __pyx_n_s_red4 __pyx_mstate_global->__pyx_n_s_red4 #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_rgba __pyx_mstate_global->__pyx_n_s_rgba #define __pyx_n_s_rosybrown __pyx_mstate_global->__pyx_n_s_rosybrown #define __pyx_n_s_rosybrown1 __pyx_mstate_global->__pyx_n_s_rosybrown1 #define __pyx_n_s_rosybrown2 __pyx_mstate_global->__pyx_n_s_rosybrown2 #define __pyx_n_s_rosybrown3 __pyx_mstate_global->__pyx_n_s_rosybrown3 #define __pyx_n_s_rosybrown4 __pyx_mstate_global->__pyx_n_s_rosybrown4 #define __pyx_n_s_round __pyx_mstate_global->__pyx_n_s_round #define __pyx_n_s_royalblue __pyx_mstate_global->__pyx_n_s_royalblue #define __pyx_n_s_royalblue1 __pyx_mstate_global->__pyx_n_s_royalblue1 #define __pyx_n_s_royalblue2 __pyx_mstate_global->__pyx_n_s_royalblue2 #define __pyx_n_s_royalblue3 __pyx_mstate_global->__pyx_n_s_royalblue3 #define __pyx_n_s_royalblue4 __pyx_mstate_global->__pyx_n_s_royalblue4 #define __pyx_n_s_saddlebrown __pyx_mstate_global->__pyx_n_s_saddlebrown #define __pyx_n_s_salmon __pyx_mstate_global->__pyx_n_s_salmon #define __pyx_n_s_salmon1 __pyx_mstate_global->__pyx_n_s_salmon1 #define __pyx_n_s_salmon2 __pyx_mstate_global->__pyx_n_s_salmon2 #define __pyx_n_s_salmon3 __pyx_mstate_global->__pyx_n_s_salmon3 #define __pyx_n_s_salmon4 __pyx_mstate_global->__pyx_n_s_salmon4 #define __pyx_n_s_sandybrown __pyx_mstate_global->__pyx_n_s_sandybrown #define __pyx_n_s_seagreen __pyx_mstate_global->__pyx_n_s_seagreen #define __pyx_n_s_seagreen1 __pyx_mstate_global->__pyx_n_s_seagreen1 #define __pyx_n_s_seagreen2 __pyx_mstate_global->__pyx_n_s_seagreen2 #define __pyx_n_s_seagreen3 __pyx_mstate_global->__pyx_n_s_seagreen3 #define __pyx_n_s_seagreen4 __pyx_mstate_global->__pyx_n_s_seagreen4 #define __pyx_n_s_seashell __pyx_mstate_global->__pyx_n_s_seashell #define __pyx_n_s_seashell1 __pyx_mstate_global->__pyx_n_s_seashell1 #define __pyx_n_s_seashell2 __pyx_mstate_global->__pyx_n_s_seashell2 #define __pyx_n_s_seashell3 __pyx_mstate_global->__pyx_n_s_seashell3 #define __pyx_n_s_seashell4 __pyx_mstate_global->__pyx_n_s_seashell4 #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_length __pyx_mstate_global->__pyx_n_s_set_length #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_sienna __pyx_mstate_global->__pyx_n_s_sienna #define __pyx_n_s_sienna1 __pyx_mstate_global->__pyx_n_s_sienna1 #define __pyx_n_s_sienna2 __pyx_mstate_global->__pyx_n_s_sienna2 #define __pyx_n_s_sienna3 __pyx_mstate_global->__pyx_n_s_sienna3 #define __pyx_n_s_sienna4 __pyx_mstate_global->__pyx_n_s_sienna4 #define __pyx_n_s_skyblue __pyx_mstate_global->__pyx_n_s_skyblue #define __pyx_n_s_skyblue1 __pyx_mstate_global->__pyx_n_s_skyblue1 #define __pyx_n_s_skyblue2 __pyx_mstate_global->__pyx_n_s_skyblue2 #define __pyx_n_s_skyblue3 __pyx_mstate_global->__pyx_n_s_skyblue3 #define __pyx_n_s_skyblue4 __pyx_mstate_global->__pyx_n_s_skyblue4 #define __pyx_n_s_slateblue __pyx_mstate_global->__pyx_n_s_slateblue #define __pyx_n_s_slateblue1 __pyx_mstate_global->__pyx_n_s_slateblue1 #define __pyx_n_s_slateblue2 __pyx_mstate_global->__pyx_n_s_slateblue2 #define __pyx_n_s_slateblue3 __pyx_mstate_global->__pyx_n_s_slateblue3 #define __pyx_n_s_slateblue4 __pyx_mstate_global->__pyx_n_s_slateblue4 #define __pyx_n_s_slategray __pyx_mstate_global->__pyx_n_s_slategray #define __pyx_n_s_slategray1 __pyx_mstate_global->__pyx_n_s_slategray1 #define __pyx_n_s_slategray2 __pyx_mstate_global->__pyx_n_s_slategray2 #define __pyx_n_s_slategray3 __pyx_mstate_global->__pyx_n_s_slategray3 #define __pyx_n_s_slategray4 __pyx_mstate_global->__pyx_n_s_slategray4 #define __pyx_n_s_slategrey __pyx_mstate_global->__pyx_n_s_slategrey #define __pyx_n_s_snow __pyx_mstate_global->__pyx_n_s_snow #define __pyx_n_s_snow1 __pyx_mstate_global->__pyx_n_s_snow1 #define __pyx_n_s_snow2 __pyx_mstate_global->__pyx_n_s_snow2 #define __pyx_n_s_snow3 __pyx_mstate_global->__pyx_n_s_snow3 #define __pyx_n_s_snow4 __pyx_mstate_global->__pyx_n_s_snow4 #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split #define __pyx_n_s_springgreen __pyx_mstate_global->__pyx_n_s_springgreen #define __pyx_n_s_springgreen1 __pyx_mstate_global->__pyx_n_s_springgreen1 #define __pyx_n_s_springgreen2 __pyx_mstate_global->__pyx_n_s_springgreen2 #define __pyx_n_s_springgreen3 __pyx_mstate_global->__pyx_n_s_springgreen3 #define __pyx_n_s_springgreen4 __pyx_mstate_global->__pyx_n_s_springgreen4 #define __pyx_kp_s_src_pygame_sdl2_color_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_color_pyx #define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith #define __pyx_n_s_steelblue __pyx_mstate_global->__pyx_n_s_steelblue #define __pyx_n_s_steelblue1 __pyx_mstate_global->__pyx_n_s_steelblue1 #define __pyx_n_s_steelblue2 __pyx_mstate_global->__pyx_n_s_steelblue2 #define __pyx_n_s_steelblue3 __pyx_mstate_global->__pyx_n_s_steelblue3 #define __pyx_n_s_steelblue4 __pyx_mstate_global->__pyx_n_s_steelblue4 #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct #define __pyx_n_s_tan __pyx_mstate_global->__pyx_n_s_tan #define __pyx_n_s_tan1 __pyx_mstate_global->__pyx_n_s_tan1 #define __pyx_n_s_tan2 __pyx_mstate_global->__pyx_n_s_tan2 #define __pyx_n_s_tan3 __pyx_mstate_global->__pyx_n_s_tan3 #define __pyx_n_s_tan4 __pyx_mstate_global->__pyx_n_s_tan4 #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_thistle __pyx_mstate_global->__pyx_n_s_thistle #define __pyx_n_s_thistle1 __pyx_mstate_global->__pyx_n_s_thistle1 #define __pyx_n_s_thistle2 __pyx_mstate_global->__pyx_n_s_thistle2 #define __pyx_n_s_thistle3 __pyx_mstate_global->__pyx_n_s_thistle3 #define __pyx_n_s_thistle4 __pyx_mstate_global->__pyx_n_s_thistle4 #define __pyx_n_s_tomato __pyx_mstate_global->__pyx_n_s_tomato #define __pyx_n_s_tomato1 __pyx_mstate_global->__pyx_n_s_tomato1 #define __pyx_n_s_tomato2 __pyx_mstate_global->__pyx_n_s_tomato2 #define __pyx_n_s_tomato3 __pyx_mstate_global->__pyx_n_s_tomato3 #define __pyx_n_s_tomato4 __pyx_mstate_global->__pyx_n_s_tomato4 #define __pyx_n_s_turquoise __pyx_mstate_global->__pyx_n_s_turquoise #define __pyx_n_s_turquoise1 __pyx_mstate_global->__pyx_n_s_turquoise1 #define __pyx_n_s_turquoise2 __pyx_mstate_global->__pyx_n_s_turquoise2 #define __pyx_n_s_turquoise3 __pyx_mstate_global->__pyx_n_s_turquoise3 #define __pyx_n_s_turquoise4 __pyx_mstate_global->__pyx_n_s_turquoise4 #define __pyx_n_s_unhexlify __pyx_mstate_global->__pyx_n_s_unhexlify #define __pyx_n_s_unpack __pyx_mstate_global->__pyx_n_s_unpack #define __pyx_n_s_violet __pyx_mstate_global->__pyx_n_s_violet #define __pyx_n_s_violetred __pyx_mstate_global->__pyx_n_s_violetred #define __pyx_n_s_violetred1 __pyx_mstate_global->__pyx_n_s_violetred1 #define __pyx_n_s_violetred2 __pyx_mstate_global->__pyx_n_s_violetred2 #define __pyx_n_s_violetred3 __pyx_mstate_global->__pyx_n_s_violetred3 #define __pyx_n_s_violetred4 __pyx_mstate_global->__pyx_n_s_violetred4 #define __pyx_n_s_wheat __pyx_mstate_global->__pyx_n_s_wheat #define __pyx_n_s_wheat1 __pyx_mstate_global->__pyx_n_s_wheat1 #define __pyx_n_s_wheat2 __pyx_mstate_global->__pyx_n_s_wheat2 #define __pyx_n_s_wheat3 __pyx_mstate_global->__pyx_n_s_wheat3 #define __pyx_n_s_wheat4 __pyx_mstate_global->__pyx_n_s_wheat4 #define __pyx_n_s_white __pyx_mstate_global->__pyx_n_s_white #define __pyx_n_s_whitesmoke __pyx_mstate_global->__pyx_n_s_whitesmoke #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_yellow __pyx_mstate_global->__pyx_n_s_yellow #define __pyx_n_s_yellow1 __pyx_mstate_global->__pyx_n_s_yellow1 #define __pyx_n_s_yellow2 __pyx_mstate_global->__pyx_n_s_yellow2 #define __pyx_n_s_yellow3 __pyx_mstate_global->__pyx_n_s_yellow3 #define __pyx_n_s_yellow4 __pyx_mstate_global->__pyx_n_s_yellow4 #define __pyx_n_s_yellowgreen __pyx_mstate_global->__pyx_n_s_yellowgreen #define __pyx_float_255_0 __pyx_mstate_global->__pyx_float_255_0 #define __pyx_float_360_0 __pyx_mstate_global->__pyx_float_360_0 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 #define __pyx_int_5 __pyx_mstate_global->__pyx_int_5 #define __pyx_int_7 __pyx_mstate_global->__pyx_int_7 #define __pyx_int_8 __pyx_mstate_global->__pyx_int_8 #define __pyx_int_10 __pyx_mstate_global->__pyx_int_10 #define __pyx_int_11 __pyx_mstate_global->__pyx_int_11 #define __pyx_int_12 __pyx_mstate_global->__pyx_int_12 #define __pyx_int_13 __pyx_mstate_global->__pyx_int_13 #define __pyx_int_14 __pyx_mstate_global->__pyx_int_14 #define __pyx_int_15 __pyx_mstate_global->__pyx_int_15 #define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 #define __pyx_int_18 __pyx_mstate_global->__pyx_int_18 #define __pyx_int_19 __pyx_mstate_global->__pyx_int_19 #define __pyx_int_20 __pyx_mstate_global->__pyx_int_20 #define __pyx_int_21 __pyx_mstate_global->__pyx_int_21 #define __pyx_int_23 __pyx_mstate_global->__pyx_int_23 #define __pyx_int_24 __pyx_mstate_global->__pyx_int_24 #define __pyx_int_25 __pyx_mstate_global->__pyx_int_25 #define __pyx_int_26 __pyx_mstate_global->__pyx_int_26 #define __pyx_int_28 __pyx_mstate_global->__pyx_int_28 #define __pyx_int_29 __pyx_mstate_global->__pyx_int_29 #define __pyx_int_30 __pyx_mstate_global->__pyx_int_30 #define __pyx_int_31 __pyx_mstate_global->__pyx_int_31 #define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 #define __pyx_int_33 __pyx_mstate_global->__pyx_int_33 #define __pyx_int_34 __pyx_mstate_global->__pyx_int_34 #define __pyx_int_35 __pyx_mstate_global->__pyx_int_35 #define __pyx_int_36 __pyx_mstate_global->__pyx_int_36 #define __pyx_int_37 __pyx_mstate_global->__pyx_int_37 #define __pyx_int_38 __pyx_mstate_global->__pyx_int_38 #define __pyx_int_39 __pyx_mstate_global->__pyx_int_39 #define __pyx_int_41 __pyx_mstate_global->__pyx_int_41 #define __pyx_int_42 __pyx_mstate_global->__pyx_int_42 #define __pyx_int_43 __pyx_mstate_global->__pyx_int_43 #define __pyx_int_44 __pyx_mstate_global->__pyx_int_44 #define __pyx_int_45 __pyx_mstate_global->__pyx_int_45 #define __pyx_int_46 __pyx_mstate_global->__pyx_int_46 #define __pyx_int_47 __pyx_mstate_global->__pyx_int_47 #define __pyx_int_48 __pyx_mstate_global->__pyx_int_48 #define __pyx_int_50 __pyx_mstate_global->__pyx_int_50 #define __pyx_int_51 __pyx_mstate_global->__pyx_int_51 #define __pyx_int_52 __pyx_mstate_global->__pyx_int_52 #define __pyx_int_54 __pyx_mstate_global->__pyx_int_54 #define __pyx_int_55 __pyx_mstate_global->__pyx_int_55 #define __pyx_int_56 __pyx_mstate_global->__pyx_int_56 #define __pyx_int_57 __pyx_mstate_global->__pyx_int_57 #define __pyx_int_58 __pyx_mstate_global->__pyx_int_58 #define __pyx_int_59 __pyx_mstate_global->__pyx_int_59 #define __pyx_int_60 __pyx_mstate_global->__pyx_int_60 #define __pyx_int_61 __pyx_mstate_global->__pyx_int_61 #define __pyx_int_62 __pyx_mstate_global->__pyx_int_62 #define __pyx_int_63 __pyx_mstate_global->__pyx_int_63 #define __pyx_int_64 __pyx_mstate_global->__pyx_int_64 #define __pyx_int_65 __pyx_mstate_global->__pyx_int_65 #define __pyx_int_66 __pyx_mstate_global->__pyx_int_66 #define __pyx_int_67 __pyx_mstate_global->__pyx_int_67 #define __pyx_int_69 __pyx_mstate_global->__pyx_int_69 #define __pyx_int_70 __pyx_mstate_global->__pyx_int_70 #define __pyx_int_71 __pyx_mstate_global->__pyx_int_71 #define __pyx_int_72 __pyx_mstate_global->__pyx_int_72 #define __pyx_int_73 __pyx_mstate_global->__pyx_int_73 #define __pyx_int_74 __pyx_mstate_global->__pyx_int_74 #define __pyx_int_76 __pyx_mstate_global->__pyx_int_76 #define __pyx_int_77 __pyx_mstate_global->__pyx_int_77 #define __pyx_int_78 __pyx_mstate_global->__pyx_int_78 #define __pyx_int_79 __pyx_mstate_global->__pyx_int_79 #define __pyx_int_80 __pyx_mstate_global->__pyx_int_80 #define __pyx_int_81 __pyx_mstate_global->__pyx_int_81 #define __pyx_int_82 __pyx_mstate_global->__pyx_int_82 #define __pyx_int_83 __pyx_mstate_global->__pyx_int_83 #define __pyx_int_84 __pyx_mstate_global->__pyx_int_84 #define __pyx_int_85 __pyx_mstate_global->__pyx_int_85 #define __pyx_int_86 __pyx_mstate_global->__pyx_int_86 #define __pyx_int_87 __pyx_mstate_global->__pyx_int_87 #define __pyx_int_89 __pyx_mstate_global->__pyx_int_89 #define __pyx_int_90 __pyx_mstate_global->__pyx_int_90 #define __pyx_int_91 __pyx_mstate_global->__pyx_int_91 #define __pyx_int_92 __pyx_mstate_global->__pyx_int_92 #define __pyx_int_93 __pyx_mstate_global->__pyx_int_93 #define __pyx_int_94 __pyx_mstate_global->__pyx_int_94 #define __pyx_int_95 __pyx_mstate_global->__pyx_int_95 #define __pyx_int_96 __pyx_mstate_global->__pyx_int_96 #define __pyx_int_97 __pyx_mstate_global->__pyx_int_97 #define __pyx_int_98 __pyx_mstate_global->__pyx_int_98 #define __pyx_int_99 __pyx_mstate_global->__pyx_int_99 #define __pyx_int_100 __pyx_mstate_global->__pyx_int_100 #define __pyx_int_101 __pyx_mstate_global->__pyx_int_101 #define __pyx_int_102 __pyx_mstate_global->__pyx_int_102 #define __pyx_int_103 __pyx_mstate_global->__pyx_int_103 #define __pyx_int_104 __pyx_mstate_global->__pyx_int_104 #define __pyx_int_105 __pyx_mstate_global->__pyx_int_105 #define __pyx_int_106 __pyx_mstate_global->__pyx_int_106 #define __pyx_int_107 __pyx_mstate_global->__pyx_int_107 #define __pyx_int_108 __pyx_mstate_global->__pyx_int_108 #define __pyx_int_110 __pyx_mstate_global->__pyx_int_110 #define __pyx_int_111 __pyx_mstate_global->__pyx_int_111 #define __pyx_int_112 __pyx_mstate_global->__pyx_int_112 #define __pyx_int_113 __pyx_mstate_global->__pyx_int_113 #define __pyx_int_114 __pyx_mstate_global->__pyx_int_114 #define __pyx_int_115 __pyx_mstate_global->__pyx_int_115 #define __pyx_int_116 __pyx_mstate_global->__pyx_int_116 #define __pyx_int_117 __pyx_mstate_global->__pyx_int_117 #define __pyx_int_118 __pyx_mstate_global->__pyx_int_118 #define __pyx_int_119 __pyx_mstate_global->__pyx_int_119 #define __pyx_int_120 __pyx_mstate_global->__pyx_int_120 #define __pyx_int_121 __pyx_mstate_global->__pyx_int_121 #define __pyx_int_122 __pyx_mstate_global->__pyx_int_122 #define __pyx_int_123 __pyx_mstate_global->__pyx_int_123 #define __pyx_int_124 __pyx_mstate_global->__pyx_int_124 #define __pyx_int_125 __pyx_mstate_global->__pyx_int_125 #define __pyx_int_126 __pyx_mstate_global->__pyx_int_126 #define __pyx_int_127 __pyx_mstate_global->__pyx_int_127 #define __pyx_int_128 __pyx_mstate_global->__pyx_int_128 #define __pyx_int_129 __pyx_mstate_global->__pyx_int_129 #define __pyx_int_130 __pyx_mstate_global->__pyx_int_130 #define __pyx_int_131 __pyx_mstate_global->__pyx_int_131 #define __pyx_int_132 __pyx_mstate_global->__pyx_int_132 #define __pyx_int_133 __pyx_mstate_global->__pyx_int_133 #define __pyx_int_134 __pyx_mstate_global->__pyx_int_134 #define __pyx_int_135 __pyx_mstate_global->__pyx_int_135 #define __pyx_int_136 __pyx_mstate_global->__pyx_int_136 #define __pyx_int_137 __pyx_mstate_global->__pyx_int_137 #define __pyx_int_138 __pyx_mstate_global->__pyx_int_138 #define __pyx_int_139 __pyx_mstate_global->__pyx_int_139 #define __pyx_int_140 __pyx_mstate_global->__pyx_int_140 #define __pyx_int_141 __pyx_mstate_global->__pyx_int_141 #define __pyx_int_142 __pyx_mstate_global->__pyx_int_142 #define __pyx_int_143 __pyx_mstate_global->__pyx_int_143 #define __pyx_int_144 __pyx_mstate_global->__pyx_int_144 #define __pyx_int_145 __pyx_mstate_global->__pyx_int_145 #define __pyx_int_147 __pyx_mstate_global->__pyx_int_147 #define __pyx_int_148 __pyx_mstate_global->__pyx_int_148 #define __pyx_int_149 __pyx_mstate_global->__pyx_int_149 #define __pyx_int_150 __pyx_mstate_global->__pyx_int_150 #define __pyx_int_151 __pyx_mstate_global->__pyx_int_151 #define __pyx_int_152 __pyx_mstate_global->__pyx_int_152 #define __pyx_int_153 __pyx_mstate_global->__pyx_int_153 #define __pyx_int_154 __pyx_mstate_global->__pyx_int_154 #define __pyx_int_155 __pyx_mstate_global->__pyx_int_155 #define __pyx_int_156 __pyx_mstate_global->__pyx_int_156 #define __pyx_int_158 __pyx_mstate_global->__pyx_int_158 #define __pyx_int_159 __pyx_mstate_global->__pyx_int_159 #define __pyx_int_160 __pyx_mstate_global->__pyx_int_160 #define __pyx_int_161 __pyx_mstate_global->__pyx_int_161 #define __pyx_int_162 __pyx_mstate_global->__pyx_int_162 #define __pyx_int_163 __pyx_mstate_global->__pyx_int_163 #define __pyx_int_164 __pyx_mstate_global->__pyx_int_164 #define __pyx_int_165 __pyx_mstate_global->__pyx_int_165 #define __pyx_int_166 __pyx_mstate_global->__pyx_int_166 #define __pyx_int_167 __pyx_mstate_global->__pyx_int_167 #define __pyx_int_168 __pyx_mstate_global->__pyx_int_168 #define __pyx_int_169 __pyx_mstate_global->__pyx_int_169 #define __pyx_int_170 __pyx_mstate_global->__pyx_int_170 #define __pyx_int_171 __pyx_mstate_global->__pyx_int_171 #define __pyx_int_172 __pyx_mstate_global->__pyx_int_172 #define __pyx_int_173 __pyx_mstate_global->__pyx_int_173 #define __pyx_int_174 __pyx_mstate_global->__pyx_int_174 #define __pyx_int_175 __pyx_mstate_global->__pyx_int_175 #define __pyx_int_176 __pyx_mstate_global->__pyx_int_176 #define __pyx_int_177 __pyx_mstate_global->__pyx_int_177 #define __pyx_int_178 __pyx_mstate_global->__pyx_int_178 #define __pyx_int_179 __pyx_mstate_global->__pyx_int_179 #define __pyx_int_180 __pyx_mstate_global->__pyx_int_180 #define __pyx_int_181 __pyx_mstate_global->__pyx_int_181 #define __pyx_int_182 __pyx_mstate_global->__pyx_int_182 #define __pyx_int_183 __pyx_mstate_global->__pyx_int_183 #define __pyx_int_184 __pyx_mstate_global->__pyx_int_184 #define __pyx_int_185 __pyx_mstate_global->__pyx_int_185 #define __pyx_int_186 __pyx_mstate_global->__pyx_int_186 #define __pyx_int_187 __pyx_mstate_global->__pyx_int_187 #define __pyx_int_188 __pyx_mstate_global->__pyx_int_188 #define __pyx_int_189 __pyx_mstate_global->__pyx_int_189 #define __pyx_int_190 __pyx_mstate_global->__pyx_int_190 #define __pyx_int_191 __pyx_mstate_global->__pyx_int_191 #define __pyx_int_192 __pyx_mstate_global->__pyx_int_192 #define __pyx_int_193 __pyx_mstate_global->__pyx_int_193 #define __pyx_int_194 __pyx_mstate_global->__pyx_int_194 #define __pyx_int_196 __pyx_mstate_global->__pyx_int_196 #define __pyx_int_197 __pyx_mstate_global->__pyx_int_197 #define __pyx_int_198 __pyx_mstate_global->__pyx_int_198 #define __pyx_int_199 __pyx_mstate_global->__pyx_int_199 #define __pyx_int_200 __pyx_mstate_global->__pyx_int_200 #define __pyx_int_201 __pyx_mstate_global->__pyx_int_201 #define __pyx_int_202 __pyx_mstate_global->__pyx_int_202 #define __pyx_int_203 __pyx_mstate_global->__pyx_int_203 #define __pyx_int_204 __pyx_mstate_global->__pyx_int_204 #define __pyx_int_205 __pyx_mstate_global->__pyx_int_205 #define __pyx_int_206 __pyx_mstate_global->__pyx_int_206 #define __pyx_int_207 __pyx_mstate_global->__pyx_int_207 #define __pyx_int_208 __pyx_mstate_global->__pyx_int_208 #define __pyx_int_209 __pyx_mstate_global->__pyx_int_209 #define __pyx_int_210 __pyx_mstate_global->__pyx_int_210 #define __pyx_int_211 __pyx_mstate_global->__pyx_int_211 #define __pyx_int_212 __pyx_mstate_global->__pyx_int_212 #define __pyx_int_213 __pyx_mstate_global->__pyx_int_213 #define __pyx_int_214 __pyx_mstate_global->__pyx_int_214 #define __pyx_int_215 __pyx_mstate_global->__pyx_int_215 #define __pyx_int_216 __pyx_mstate_global->__pyx_int_216 #define __pyx_int_217 __pyx_mstate_global->__pyx_int_217 #define __pyx_int_218 __pyx_mstate_global->__pyx_int_218 #define __pyx_int_219 __pyx_mstate_global->__pyx_int_219 #define __pyx_int_220 __pyx_mstate_global->__pyx_int_220 #define __pyx_int_221 __pyx_mstate_global->__pyx_int_221 #define __pyx_int_222 __pyx_mstate_global->__pyx_int_222 #define __pyx_int_223 __pyx_mstate_global->__pyx_int_223 #define __pyx_int_224 __pyx_mstate_global->__pyx_int_224 #define __pyx_int_225 __pyx_mstate_global->__pyx_int_225 #define __pyx_int_226 __pyx_mstate_global->__pyx_int_226 #define __pyx_int_227 __pyx_mstate_global->__pyx_int_227 #define __pyx_int_228 __pyx_mstate_global->__pyx_int_228 #define __pyx_int_229 __pyx_mstate_global->__pyx_int_229 #define __pyx_int_230 __pyx_mstate_global->__pyx_int_230 #define __pyx_int_231 __pyx_mstate_global->__pyx_int_231 #define __pyx_int_232 __pyx_mstate_global->__pyx_int_232 #define __pyx_int_233 __pyx_mstate_global->__pyx_int_233 #define __pyx_int_235 __pyx_mstate_global->__pyx_int_235 #define __pyx_int_236 __pyx_mstate_global->__pyx_int_236 #define __pyx_int_237 __pyx_mstate_global->__pyx_int_237 #define __pyx_int_238 __pyx_mstate_global->__pyx_int_238 #define __pyx_int_239 __pyx_mstate_global->__pyx_int_239 #define __pyx_int_240 __pyx_mstate_global->__pyx_int_240 #define __pyx_int_242 __pyx_mstate_global->__pyx_int_242 #define __pyx_int_244 __pyx_mstate_global->__pyx_int_244 #define __pyx_int_245 __pyx_mstate_global->__pyx_int_245 #define __pyx_int_246 __pyx_mstate_global->__pyx_int_246 #define __pyx_int_247 __pyx_mstate_global->__pyx_int_247 #define __pyx_int_248 __pyx_mstate_global->__pyx_int_248 #define __pyx_int_250 __pyx_mstate_global->__pyx_int_250 #define __pyx_int_251 __pyx_mstate_global->__pyx_int_251 #define __pyx_int_252 __pyx_mstate_global->__pyx_int_252 #define __pyx_int_253 __pyx_mstate_global->__pyx_int_253 #define __pyx_int_255 __pyx_mstate_global->__pyx_int_255 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_slice__4 __pyx_mstate_global->__pyx_slice__4 #define __pyx_slice__5 __pyx_mstate_global->__pyx_slice__5 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 #define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 #define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46 #define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 #define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48 #define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 #define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50 #define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 #define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 #define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 #define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 #define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57 #define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58 #define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59 #define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60 #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 #define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 #define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 #define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 #define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 #define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 #define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 #define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70 #define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 #define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72 #define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 #define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 #define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75 #define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 #define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77 #define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 #define __pyx_tuple__80 __pyx_mstate_global->__pyx_tuple__80 #define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81 #define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82 #define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83 #define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 #define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85 #define __pyx_tuple__86 __pyx_mstate_global->__pyx_tuple__86 #define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 #define __pyx_tuple__88 __pyx_mstate_global->__pyx_tuple__88 #define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 #define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90 #define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 #define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92 #define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93 #define __pyx_tuple__94 __pyx_mstate_global->__pyx_tuple__94 #define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95 #define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96 #define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97 #define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98 #define __pyx_tuple__99 __pyx_mstate_global->__pyx_tuple__99 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100 #define __pyx_tuple__101 __pyx_mstate_global->__pyx_tuple__101 #define __pyx_tuple__102 __pyx_mstate_global->__pyx_tuple__102 #define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103 #define __pyx_tuple__104 __pyx_mstate_global->__pyx_tuple__104 #define __pyx_tuple__105 __pyx_mstate_global->__pyx_tuple__105 #define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106 #define __pyx_tuple__107 __pyx_mstate_global->__pyx_tuple__107 #define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108 #define __pyx_tuple__109 __pyx_mstate_global->__pyx_tuple__109 #define __pyx_tuple__110 __pyx_mstate_global->__pyx_tuple__110 #define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111 #define __pyx_tuple__112 __pyx_mstate_global->__pyx_tuple__112 #define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113 #define __pyx_tuple__114 __pyx_mstate_global->__pyx_tuple__114 #define __pyx_tuple__115 __pyx_mstate_global->__pyx_tuple__115 #define __pyx_tuple__116 __pyx_mstate_global->__pyx_tuple__116 #define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117 #define __pyx_tuple__118 __pyx_mstate_global->__pyx_tuple__118 #define __pyx_tuple__119 __pyx_mstate_global->__pyx_tuple__119 #define __pyx_tuple__120 __pyx_mstate_global->__pyx_tuple__120 #define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121 #define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122 #define __pyx_tuple__123 __pyx_mstate_global->__pyx_tuple__123 #define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124 #define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125 #define __pyx_tuple__126 __pyx_mstate_global->__pyx_tuple__126 #define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127 #define __pyx_tuple__128 __pyx_mstate_global->__pyx_tuple__128 #define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129 #define __pyx_tuple__130 __pyx_mstate_global->__pyx_tuple__130 #define __pyx_tuple__131 __pyx_mstate_global->__pyx_tuple__131 #define __pyx_tuple__132 __pyx_mstate_global->__pyx_tuple__132 #define __pyx_tuple__133 __pyx_mstate_global->__pyx_tuple__133 #define __pyx_tuple__134 __pyx_mstate_global->__pyx_tuple__134 #define __pyx_tuple__135 __pyx_mstate_global->__pyx_tuple__135 #define __pyx_tuple__136 __pyx_mstate_global->__pyx_tuple__136 #define __pyx_tuple__137 __pyx_mstate_global->__pyx_tuple__137 #define __pyx_tuple__138 __pyx_mstate_global->__pyx_tuple__138 #define __pyx_tuple__139 __pyx_mstate_global->__pyx_tuple__139 #define __pyx_tuple__140 __pyx_mstate_global->__pyx_tuple__140 #define __pyx_tuple__141 __pyx_mstate_global->__pyx_tuple__141 #define __pyx_tuple__142 __pyx_mstate_global->__pyx_tuple__142 #define __pyx_tuple__143 __pyx_mstate_global->__pyx_tuple__143 #define __pyx_tuple__144 __pyx_mstate_global->__pyx_tuple__144 #define __pyx_tuple__145 __pyx_mstate_global->__pyx_tuple__145 #define __pyx_tuple__146 __pyx_mstate_global->__pyx_tuple__146 #define __pyx_tuple__147 __pyx_mstate_global->__pyx_tuple__147 #define __pyx_tuple__148 __pyx_mstate_global->__pyx_tuple__148 #define __pyx_tuple__149 __pyx_mstate_global->__pyx_tuple__149 #define __pyx_tuple__150 __pyx_mstate_global->__pyx_tuple__150 #define __pyx_tuple__151 __pyx_mstate_global->__pyx_tuple__151 #define __pyx_tuple__152 __pyx_mstate_global->__pyx_tuple__152 #define __pyx_tuple__153 __pyx_mstate_global->__pyx_tuple__153 #define __pyx_tuple__154 __pyx_mstate_global->__pyx_tuple__154 #define __pyx_tuple__155 __pyx_mstate_global->__pyx_tuple__155 #define __pyx_tuple__156 __pyx_mstate_global->__pyx_tuple__156 #define __pyx_tuple__157 __pyx_mstate_global->__pyx_tuple__157 #define __pyx_tuple__158 __pyx_mstate_global->__pyx_tuple__158 #define __pyx_tuple__159 __pyx_mstate_global->__pyx_tuple__159 #define __pyx_tuple__160 __pyx_mstate_global->__pyx_tuple__160 #define __pyx_tuple__161 __pyx_mstate_global->__pyx_tuple__161 #define __pyx_tuple__162 __pyx_mstate_global->__pyx_tuple__162 #define __pyx_tuple__163 __pyx_mstate_global->__pyx_tuple__163 #define __pyx_tuple__164 __pyx_mstate_global->__pyx_tuple__164 #define __pyx_tuple__165 __pyx_mstate_global->__pyx_tuple__165 #define __pyx_tuple__166 __pyx_mstate_global->__pyx_tuple__166 #define __pyx_tuple__167 __pyx_mstate_global->__pyx_tuple__167 #define __pyx_tuple__168 __pyx_mstate_global->__pyx_tuple__168 #define __pyx_tuple__169 __pyx_mstate_global->__pyx_tuple__169 #define __pyx_tuple__170 __pyx_mstate_global->__pyx_tuple__170 #define __pyx_tuple__171 __pyx_mstate_global->__pyx_tuple__171 #define __pyx_tuple__172 __pyx_mstate_global->__pyx_tuple__172 #define __pyx_tuple__173 __pyx_mstate_global->__pyx_tuple__173 #define __pyx_tuple__174 __pyx_mstate_global->__pyx_tuple__174 #define __pyx_tuple__175 __pyx_mstate_global->__pyx_tuple__175 #define __pyx_tuple__176 __pyx_mstate_global->__pyx_tuple__176 #define __pyx_tuple__177 __pyx_mstate_global->__pyx_tuple__177 #define __pyx_tuple__178 __pyx_mstate_global->__pyx_tuple__178 #define __pyx_tuple__179 __pyx_mstate_global->__pyx_tuple__179 #define __pyx_tuple__180 __pyx_mstate_global->__pyx_tuple__180 #define __pyx_tuple__181 __pyx_mstate_global->__pyx_tuple__181 #define __pyx_tuple__182 __pyx_mstate_global->__pyx_tuple__182 #define __pyx_tuple__183 __pyx_mstate_global->__pyx_tuple__183 #define __pyx_tuple__184 __pyx_mstate_global->__pyx_tuple__184 #define __pyx_tuple__185 __pyx_mstate_global->__pyx_tuple__185 #define __pyx_tuple__186 __pyx_mstate_global->__pyx_tuple__186 #define __pyx_tuple__187 __pyx_mstate_global->__pyx_tuple__187 #define __pyx_tuple__188 __pyx_mstate_global->__pyx_tuple__188 #define __pyx_tuple__189 __pyx_mstate_global->__pyx_tuple__189 #define __pyx_tuple__190 __pyx_mstate_global->__pyx_tuple__190 #define __pyx_tuple__191 __pyx_mstate_global->__pyx_tuple__191 #define __pyx_tuple__192 __pyx_mstate_global->__pyx_tuple__192 #define __pyx_tuple__193 __pyx_mstate_global->__pyx_tuple__193 #define __pyx_tuple__194 __pyx_mstate_global->__pyx_tuple__194 #define __pyx_tuple__195 __pyx_mstate_global->__pyx_tuple__195 #define __pyx_tuple__196 __pyx_mstate_global->__pyx_tuple__196 #define __pyx_tuple__197 __pyx_mstate_global->__pyx_tuple__197 #define __pyx_tuple__198 __pyx_mstate_global->__pyx_tuple__198 #define __pyx_tuple__199 __pyx_mstate_global->__pyx_tuple__199 #define __pyx_tuple__200 __pyx_mstate_global->__pyx_tuple__200 #define __pyx_tuple__201 __pyx_mstate_global->__pyx_tuple__201 #define __pyx_tuple__202 __pyx_mstate_global->__pyx_tuple__202 #define __pyx_tuple__203 __pyx_mstate_global->__pyx_tuple__203 #define __pyx_tuple__204 __pyx_mstate_global->__pyx_tuple__204 #define __pyx_tuple__205 __pyx_mstate_global->__pyx_tuple__205 #define __pyx_tuple__206 __pyx_mstate_global->__pyx_tuple__206 #define __pyx_tuple__207 __pyx_mstate_global->__pyx_tuple__207 #define __pyx_tuple__208 __pyx_mstate_global->__pyx_tuple__208 #define __pyx_tuple__209 __pyx_mstate_global->__pyx_tuple__209 #define __pyx_tuple__210 __pyx_mstate_global->__pyx_tuple__210 #define __pyx_tuple__211 __pyx_mstate_global->__pyx_tuple__211 #define __pyx_tuple__212 __pyx_mstate_global->__pyx_tuple__212 #define __pyx_tuple__213 __pyx_mstate_global->__pyx_tuple__213 #define __pyx_tuple__214 __pyx_mstate_global->__pyx_tuple__214 #define __pyx_tuple__215 __pyx_mstate_global->__pyx_tuple__215 #define __pyx_tuple__216 __pyx_mstate_global->__pyx_tuple__216 #define __pyx_tuple__217 __pyx_mstate_global->__pyx_tuple__217 #define __pyx_tuple__218 __pyx_mstate_global->__pyx_tuple__218 #define __pyx_tuple__219 __pyx_mstate_global->__pyx_tuple__219 #define __pyx_tuple__220 __pyx_mstate_global->__pyx_tuple__220 #define __pyx_tuple__221 __pyx_mstate_global->__pyx_tuple__221 #define __pyx_tuple__222 __pyx_mstate_global->__pyx_tuple__222 #define __pyx_tuple__223 __pyx_mstate_global->__pyx_tuple__223 #define __pyx_tuple__224 __pyx_mstate_global->__pyx_tuple__224 #define __pyx_tuple__225 __pyx_mstate_global->__pyx_tuple__225 #define __pyx_tuple__226 __pyx_mstate_global->__pyx_tuple__226 #define __pyx_tuple__227 __pyx_mstate_global->__pyx_tuple__227 #define __pyx_tuple__228 __pyx_mstate_global->__pyx_tuple__228 #define __pyx_tuple__229 __pyx_mstate_global->__pyx_tuple__229 #define __pyx_tuple__230 __pyx_mstate_global->__pyx_tuple__230 #define __pyx_tuple__231 __pyx_mstate_global->__pyx_tuple__231 #define __pyx_tuple__232 __pyx_mstate_global->__pyx_tuple__232 #define __pyx_tuple__233 __pyx_mstate_global->__pyx_tuple__233 #define __pyx_tuple__234 __pyx_mstate_global->__pyx_tuple__234 #define __pyx_tuple__235 __pyx_mstate_global->__pyx_tuple__235 #define __pyx_tuple__236 __pyx_mstate_global->__pyx_tuple__236 #define __pyx_tuple__237 __pyx_mstate_global->__pyx_tuple__237 #define __pyx_tuple__238 __pyx_mstate_global->__pyx_tuple__238 #define __pyx_tuple__239 __pyx_mstate_global->__pyx_tuple__239 #define __pyx_tuple__240 __pyx_mstate_global->__pyx_tuple__240 #define __pyx_tuple__241 __pyx_mstate_global->__pyx_tuple__241 #define __pyx_tuple__242 __pyx_mstate_global->__pyx_tuple__242 #define __pyx_tuple__243 __pyx_mstate_global->__pyx_tuple__243 #define __pyx_tuple__244 __pyx_mstate_global->__pyx_tuple__244 #define __pyx_tuple__245 __pyx_mstate_global->__pyx_tuple__245 #define __pyx_tuple__246 __pyx_mstate_global->__pyx_tuple__246 #define __pyx_tuple__247 __pyx_mstate_global->__pyx_tuple__247 #define __pyx_tuple__248 __pyx_mstate_global->__pyx_tuple__248 #define __pyx_tuple__249 __pyx_mstate_global->__pyx_tuple__249 #define __pyx_tuple__250 __pyx_mstate_global->__pyx_tuple__250 #define __pyx_tuple__251 __pyx_mstate_global->__pyx_tuple__251 #define __pyx_tuple__252 __pyx_mstate_global->__pyx_tuple__252 #define __pyx_tuple__253 __pyx_mstate_global->__pyx_tuple__253 #define __pyx_tuple__254 __pyx_mstate_global->__pyx_tuple__254 #define __pyx_tuple__255 __pyx_mstate_global->__pyx_tuple__255 #define __pyx_tuple__256 __pyx_mstate_global->__pyx_tuple__256 #define __pyx_tuple__257 __pyx_mstate_global->__pyx_tuple__257 #define __pyx_tuple__258 __pyx_mstate_global->__pyx_tuple__258 #define __pyx_tuple__259 __pyx_mstate_global->__pyx_tuple__259 #define __pyx_tuple__260 __pyx_mstate_global->__pyx_tuple__260 #define __pyx_tuple__261 __pyx_mstate_global->__pyx_tuple__261 #define __pyx_tuple__262 __pyx_mstate_global->__pyx_tuple__262 #define __pyx_tuple__263 __pyx_mstate_global->__pyx_tuple__263 #define __pyx_tuple__264 __pyx_mstate_global->__pyx_tuple__264 #define __pyx_tuple__265 __pyx_mstate_global->__pyx_tuple__265 #define __pyx_tuple__266 __pyx_mstate_global->__pyx_tuple__266 #define __pyx_tuple__267 __pyx_mstate_global->__pyx_tuple__267 #define __pyx_tuple__268 __pyx_mstate_global->__pyx_tuple__268 #define __pyx_tuple__269 __pyx_mstate_global->__pyx_tuple__269 #define __pyx_tuple__270 __pyx_mstate_global->__pyx_tuple__270 #define __pyx_tuple__271 __pyx_mstate_global->__pyx_tuple__271 #define __pyx_tuple__272 __pyx_mstate_global->__pyx_tuple__272 #define __pyx_tuple__273 __pyx_mstate_global->__pyx_tuple__273 #define __pyx_tuple__274 __pyx_mstate_global->__pyx_tuple__274 #define __pyx_tuple__275 __pyx_mstate_global->__pyx_tuple__275 #define __pyx_tuple__276 __pyx_mstate_global->__pyx_tuple__276 #define __pyx_tuple__277 __pyx_mstate_global->__pyx_tuple__277 #define __pyx_tuple__278 __pyx_mstate_global->__pyx_tuple__278 #define __pyx_tuple__279 __pyx_mstate_global->__pyx_tuple__279 #define __pyx_tuple__280 __pyx_mstate_global->__pyx_tuple__280 #define __pyx_tuple__281 __pyx_mstate_global->__pyx_tuple__281 #define __pyx_tuple__282 __pyx_mstate_global->__pyx_tuple__282 #define __pyx_tuple__283 __pyx_mstate_global->__pyx_tuple__283 #define __pyx_tuple__284 __pyx_mstate_global->__pyx_tuple__284 #define __pyx_tuple__285 __pyx_mstate_global->__pyx_tuple__285 #define __pyx_tuple__286 __pyx_mstate_global->__pyx_tuple__286 #define __pyx_tuple__287 __pyx_mstate_global->__pyx_tuple__287 #define __pyx_tuple__288 __pyx_mstate_global->__pyx_tuple__288 #define __pyx_tuple__289 __pyx_mstate_global->__pyx_tuple__289 #define __pyx_tuple__290 __pyx_mstate_global->__pyx_tuple__290 #define __pyx_tuple__291 __pyx_mstate_global->__pyx_tuple__291 #define __pyx_tuple__292 __pyx_mstate_global->__pyx_tuple__292 #define __pyx_tuple__293 __pyx_mstate_global->__pyx_tuple__293 #define __pyx_tuple__294 __pyx_mstate_global->__pyx_tuple__294 #define __pyx_tuple__295 __pyx_mstate_global->__pyx_tuple__295 #define __pyx_tuple__296 __pyx_mstate_global->__pyx_tuple__296 #define __pyx_tuple__297 __pyx_mstate_global->__pyx_tuple__297 #define __pyx_tuple__298 __pyx_mstate_global->__pyx_tuple__298 #define __pyx_tuple__299 __pyx_mstate_global->__pyx_tuple__299 #define __pyx_tuple__300 __pyx_mstate_global->__pyx_tuple__300 #define __pyx_tuple__301 __pyx_mstate_global->__pyx_tuple__301 #define __pyx_tuple__302 __pyx_mstate_global->__pyx_tuple__302 #define __pyx_tuple__303 __pyx_mstate_global->__pyx_tuple__303 #define __pyx_tuple__304 __pyx_mstate_global->__pyx_tuple__304 #define __pyx_tuple__305 __pyx_mstate_global->__pyx_tuple__305 #define __pyx_tuple__306 __pyx_mstate_global->__pyx_tuple__306 #define __pyx_tuple__307 __pyx_mstate_global->__pyx_tuple__307 #define __pyx_tuple__308 __pyx_mstate_global->__pyx_tuple__308 #define __pyx_tuple__309 __pyx_mstate_global->__pyx_tuple__309 #define __pyx_tuple__310 __pyx_mstate_global->__pyx_tuple__310 #define __pyx_tuple__311 __pyx_mstate_global->__pyx_tuple__311 #define __pyx_tuple__312 __pyx_mstate_global->__pyx_tuple__312 #define __pyx_tuple__313 __pyx_mstate_global->__pyx_tuple__313 #define __pyx_tuple__314 __pyx_mstate_global->__pyx_tuple__314 #define __pyx_tuple__315 __pyx_mstate_global->__pyx_tuple__315 #define __pyx_tuple__316 __pyx_mstate_global->__pyx_tuple__316 #define __pyx_tuple__317 __pyx_mstate_global->__pyx_tuple__317 #define __pyx_tuple__318 __pyx_mstate_global->__pyx_tuple__318 #define __pyx_tuple__319 __pyx_mstate_global->__pyx_tuple__319 #define __pyx_tuple__320 __pyx_mstate_global->__pyx_tuple__320 #define __pyx_tuple__321 __pyx_mstate_global->__pyx_tuple__321 #define __pyx_tuple__322 __pyx_mstate_global->__pyx_tuple__322 #define __pyx_tuple__323 __pyx_mstate_global->__pyx_tuple__323 #define __pyx_tuple__324 __pyx_mstate_global->__pyx_tuple__324 #define __pyx_tuple__325 __pyx_mstate_global->__pyx_tuple__325 #define __pyx_tuple__326 __pyx_mstate_global->__pyx_tuple__326 #define __pyx_tuple__327 __pyx_mstate_global->__pyx_tuple__327 #define __pyx_tuple__328 __pyx_mstate_global->__pyx_tuple__328 #define __pyx_tuple__329 __pyx_mstate_global->__pyx_tuple__329 #define __pyx_tuple__330 __pyx_mstate_global->__pyx_tuple__330 #define __pyx_tuple__331 __pyx_mstate_global->__pyx_tuple__331 #define __pyx_tuple__332 __pyx_mstate_global->__pyx_tuple__332 #define __pyx_tuple__333 __pyx_mstate_global->__pyx_tuple__333 #define __pyx_tuple__334 __pyx_mstate_global->__pyx_tuple__334 #define __pyx_tuple__335 __pyx_mstate_global->__pyx_tuple__335 #define __pyx_tuple__336 __pyx_mstate_global->__pyx_tuple__336 #define __pyx_tuple__337 __pyx_mstate_global->__pyx_tuple__337 #define __pyx_tuple__338 __pyx_mstate_global->__pyx_tuple__338 #define __pyx_tuple__339 __pyx_mstate_global->__pyx_tuple__339 #define __pyx_tuple__340 __pyx_mstate_global->__pyx_tuple__340 #define __pyx_tuple__341 __pyx_mstate_global->__pyx_tuple__341 #define __pyx_tuple__342 __pyx_mstate_global->__pyx_tuple__342 #define __pyx_tuple__343 __pyx_mstate_global->__pyx_tuple__343 #define __pyx_tuple__344 __pyx_mstate_global->__pyx_tuple__344 #define __pyx_tuple__345 __pyx_mstate_global->__pyx_tuple__345 #define __pyx_tuple__346 __pyx_mstate_global->__pyx_tuple__346 #define __pyx_tuple__347 __pyx_mstate_global->__pyx_tuple__347 #define __pyx_tuple__348 __pyx_mstate_global->__pyx_tuple__348 #define __pyx_tuple__349 __pyx_mstate_global->__pyx_tuple__349 #define __pyx_tuple__350 __pyx_mstate_global->__pyx_tuple__350 #define __pyx_tuple__351 __pyx_mstate_global->__pyx_tuple__351 #define __pyx_tuple__352 __pyx_mstate_global->__pyx_tuple__352 #define __pyx_tuple__353 __pyx_mstate_global->__pyx_tuple__353 #define __pyx_tuple__354 __pyx_mstate_global->__pyx_tuple__354 #define __pyx_tuple__355 __pyx_mstate_global->__pyx_tuple__355 #define __pyx_tuple__356 __pyx_mstate_global->__pyx_tuple__356 #define __pyx_tuple__357 __pyx_mstate_global->__pyx_tuple__357 #define __pyx_tuple__358 __pyx_mstate_global->__pyx_tuple__358 #define __pyx_tuple__359 __pyx_mstate_global->__pyx_tuple__359 #define __pyx_tuple__360 __pyx_mstate_global->__pyx_tuple__360 #define __pyx_tuple__361 __pyx_mstate_global->__pyx_tuple__361 #define __pyx_tuple__362 __pyx_mstate_global->__pyx_tuple__362 #define __pyx_tuple__363 __pyx_mstate_global->__pyx_tuple__363 #define __pyx_tuple__364 __pyx_mstate_global->__pyx_tuple__364 #define __pyx_tuple__365 __pyx_mstate_global->__pyx_tuple__365 #define __pyx_tuple__366 __pyx_mstate_global->__pyx_tuple__366 #define __pyx_tuple__367 __pyx_mstate_global->__pyx_tuple__367 #define __pyx_tuple__368 __pyx_mstate_global->__pyx_tuple__368 #define __pyx_tuple__369 __pyx_mstate_global->__pyx_tuple__369 #define __pyx_tuple__370 __pyx_mstate_global->__pyx_tuple__370 #define __pyx_tuple__371 __pyx_mstate_global->__pyx_tuple__371 #define __pyx_tuple__372 __pyx_mstate_global->__pyx_tuple__372 #define __pyx_tuple__373 __pyx_mstate_global->__pyx_tuple__373 #define __pyx_tuple__374 __pyx_mstate_global->__pyx_tuple__374 #define __pyx_tuple__375 __pyx_mstate_global->__pyx_tuple__375 #define __pyx_tuple__376 __pyx_mstate_global->__pyx_tuple__376 #define __pyx_tuple__377 __pyx_mstate_global->__pyx_tuple__377 #define __pyx_tuple__378 __pyx_mstate_global->__pyx_tuple__378 #define __pyx_tuple__379 __pyx_mstate_global->__pyx_tuple__379 #define __pyx_tuple__380 __pyx_mstate_global->__pyx_tuple__380 #define __pyx_tuple__381 __pyx_mstate_global->__pyx_tuple__381 #define __pyx_tuple__382 __pyx_mstate_global->__pyx_tuple__382 #define __pyx_tuple__383 __pyx_mstate_global->__pyx_tuple__383 #define __pyx_tuple__384 __pyx_mstate_global->__pyx_tuple__384 #define __pyx_tuple__385 __pyx_mstate_global->__pyx_tuple__385 #define __pyx_tuple__386 __pyx_mstate_global->__pyx_tuple__386 #define __pyx_tuple__387 __pyx_mstate_global->__pyx_tuple__387 #define __pyx_tuple__388 __pyx_mstate_global->__pyx_tuple__388 #define __pyx_tuple__389 __pyx_mstate_global->__pyx_tuple__389 #define __pyx_tuple__390 __pyx_mstate_global->__pyx_tuple__390 #define __pyx_tuple__391 __pyx_mstate_global->__pyx_tuple__391 #define __pyx_tuple__392 __pyx_mstate_global->__pyx_tuple__392 #define __pyx_tuple__393 __pyx_mstate_global->__pyx_tuple__393 #define __pyx_tuple__394 __pyx_mstate_global->__pyx_tuple__394 #define __pyx_tuple__395 __pyx_mstate_global->__pyx_tuple__395 #define __pyx_tuple__396 __pyx_mstate_global->__pyx_tuple__396 #define __pyx_tuple__397 __pyx_mstate_global->__pyx_tuple__397 #define __pyx_tuple__398 __pyx_mstate_global->__pyx_tuple__398 #define __pyx_tuple__399 __pyx_mstate_global->__pyx_tuple__399 #define __pyx_tuple__400 __pyx_mstate_global->__pyx_tuple__400 #define __pyx_tuple__401 __pyx_mstate_global->__pyx_tuple__401 #define __pyx_tuple__402 __pyx_mstate_global->__pyx_tuple__402 #define __pyx_tuple__403 __pyx_mstate_global->__pyx_tuple__403 #define __pyx_tuple__404 __pyx_mstate_global->__pyx_tuple__404 #define __pyx_tuple__405 __pyx_mstate_global->__pyx_tuple__405 #define __pyx_tuple__406 __pyx_mstate_global->__pyx_tuple__406 #define __pyx_tuple__407 __pyx_mstate_global->__pyx_tuple__407 #define __pyx_tuple__408 __pyx_mstate_global->__pyx_tuple__408 #define __pyx_tuple__409 __pyx_mstate_global->__pyx_tuple__409 #define __pyx_tuple__410 __pyx_mstate_global->__pyx_tuple__410 #define __pyx_tuple__411 __pyx_mstate_global->__pyx_tuple__411 #define __pyx_tuple__412 __pyx_mstate_global->__pyx_tuple__412 #define __pyx_tuple__413 __pyx_mstate_global->__pyx_tuple__413 #define __pyx_tuple__414 __pyx_mstate_global->__pyx_tuple__414 #define __pyx_tuple__415 __pyx_mstate_global->__pyx_tuple__415 #define __pyx_tuple__416 __pyx_mstate_global->__pyx_tuple__416 #define __pyx_tuple__417 __pyx_mstate_global->__pyx_tuple__417 #define __pyx_tuple__418 __pyx_mstate_global->__pyx_tuple__418 #define __pyx_tuple__419 __pyx_mstate_global->__pyx_tuple__419 #define __pyx_tuple__420 __pyx_mstate_global->__pyx_tuple__420 #define __pyx_tuple__421 __pyx_mstate_global->__pyx_tuple__421 #define __pyx_tuple__422 __pyx_mstate_global->__pyx_tuple__422 #define __pyx_tuple__423 __pyx_mstate_global->__pyx_tuple__423 #define __pyx_tuple__424 __pyx_mstate_global->__pyx_tuple__424 #define __pyx_tuple__425 __pyx_mstate_global->__pyx_tuple__425 #define __pyx_tuple__426 __pyx_mstate_global->__pyx_tuple__426 #define __pyx_tuple__427 __pyx_mstate_global->__pyx_tuple__427 #define __pyx_tuple__428 __pyx_mstate_global->__pyx_tuple__428 #define __pyx_tuple__429 __pyx_mstate_global->__pyx_tuple__429 #define __pyx_tuple__430 __pyx_mstate_global->__pyx_tuple__430 #define __pyx_tuple__431 __pyx_mstate_global->__pyx_tuple__431 #define __pyx_tuple__432 __pyx_mstate_global->__pyx_tuple__432 #define __pyx_tuple__433 __pyx_mstate_global->__pyx_tuple__433 #define __pyx_tuple__434 __pyx_mstate_global->__pyx_tuple__434 #define __pyx_tuple__435 __pyx_mstate_global->__pyx_tuple__435 #define __pyx_tuple__436 __pyx_mstate_global->__pyx_tuple__436 #define __pyx_tuple__437 __pyx_mstate_global->__pyx_tuple__437 #define __pyx_tuple__438 __pyx_mstate_global->__pyx_tuple__438 #define __pyx_tuple__439 __pyx_mstate_global->__pyx_tuple__439 #define __pyx_tuple__440 __pyx_mstate_global->__pyx_tuple__440 #define __pyx_tuple__441 __pyx_mstate_global->__pyx_tuple__441 #define __pyx_tuple__442 __pyx_mstate_global->__pyx_tuple__442 #define __pyx_tuple__443 __pyx_mstate_global->__pyx_tuple__443 #define __pyx_tuple__444 __pyx_mstate_global->__pyx_tuple__444 #define __pyx_tuple__445 __pyx_mstate_global->__pyx_tuple__445 #define __pyx_tuple__446 __pyx_mstate_global->__pyx_tuple__446 #define __pyx_tuple__447 __pyx_mstate_global->__pyx_tuple__447 #define __pyx_tuple__448 __pyx_mstate_global->__pyx_tuple__448 #define __pyx_tuple__449 __pyx_mstate_global->__pyx_tuple__449 #define __pyx_tuple__450 __pyx_mstate_global->__pyx_tuple__450 #define __pyx_tuple__451 __pyx_mstate_global->__pyx_tuple__451 #define __pyx_tuple__452 __pyx_mstate_global->__pyx_tuple__452 #define __pyx_tuple__453 __pyx_mstate_global->__pyx_tuple__453 #define __pyx_tuple__454 __pyx_mstate_global->__pyx_tuple__454 #define __pyx_tuple__455 __pyx_mstate_global->__pyx_tuple__455 #define __pyx_tuple__456 __pyx_mstate_global->__pyx_tuple__456 #define __pyx_tuple__457 __pyx_mstate_global->__pyx_tuple__457 #define __pyx_tuple__458 __pyx_mstate_global->__pyx_tuple__458 #define __pyx_tuple__459 __pyx_mstate_global->__pyx_tuple__459 #define __pyx_tuple__460 __pyx_mstate_global->__pyx_tuple__460 #define __pyx_tuple__461 __pyx_mstate_global->__pyx_tuple__461 #define __pyx_tuple__462 __pyx_mstate_global->__pyx_tuple__462 #define __pyx_tuple__463 __pyx_mstate_global->__pyx_tuple__463 #define __pyx_tuple__464 __pyx_mstate_global->__pyx_tuple__464 #define __pyx_tuple__465 __pyx_mstate_global->__pyx_tuple__465 #define __pyx_tuple__466 __pyx_mstate_global->__pyx_tuple__466 #define __pyx_tuple__467 __pyx_mstate_global->__pyx_tuple__467 #define __pyx_tuple__468 __pyx_mstate_global->__pyx_tuple__468 #define __pyx_tuple__469 __pyx_mstate_global->__pyx_tuple__469 #define __pyx_tuple__470 __pyx_mstate_global->__pyx_tuple__470 #define __pyx_tuple__471 __pyx_mstate_global->__pyx_tuple__471 #define __pyx_tuple__472 __pyx_mstate_global->__pyx_tuple__472 #define __pyx_tuple__473 __pyx_mstate_global->__pyx_tuple__473 #define __pyx_tuple__474 __pyx_mstate_global->__pyx_tuple__474 #define __pyx_tuple__475 __pyx_mstate_global->__pyx_tuple__475 #define __pyx_tuple__476 __pyx_mstate_global->__pyx_tuple__476 #define __pyx_tuple__477 __pyx_mstate_global->__pyx_tuple__477 #define __pyx_tuple__478 __pyx_mstate_global->__pyx_tuple__478 #define __pyx_tuple__479 __pyx_mstate_global->__pyx_tuple__479 #define __pyx_tuple__480 __pyx_mstate_global->__pyx_tuple__480 #define __pyx_tuple__481 __pyx_mstate_global->__pyx_tuple__481 #define __pyx_tuple__482 __pyx_mstate_global->__pyx_tuple__482 #define __pyx_tuple__483 __pyx_mstate_global->__pyx_tuple__483 #define __pyx_tuple__484 __pyx_mstate_global->__pyx_tuple__484 #define __pyx_tuple__485 __pyx_mstate_global->__pyx_tuple__485 #define __pyx_tuple__486 __pyx_mstate_global->__pyx_tuple__486 #define __pyx_tuple__487 __pyx_mstate_global->__pyx_tuple__487 #define __pyx_tuple__488 __pyx_mstate_global->__pyx_tuple__488 #define __pyx_tuple__489 __pyx_mstate_global->__pyx_tuple__489 #define __pyx_tuple__490 __pyx_mstate_global->__pyx_tuple__490 #define __pyx_tuple__491 __pyx_mstate_global->__pyx_tuple__491 #define __pyx_tuple__492 __pyx_mstate_global->__pyx_tuple__492 #define __pyx_tuple__493 __pyx_mstate_global->__pyx_tuple__493 #define __pyx_tuple__494 __pyx_mstate_global->__pyx_tuple__494 #define __pyx_tuple__495 __pyx_mstate_global->__pyx_tuple__495 #define __pyx_tuple__496 __pyx_mstate_global->__pyx_tuple__496 #define __pyx_tuple__497 __pyx_mstate_global->__pyx_tuple__497 #define __pyx_tuple__498 __pyx_mstate_global->__pyx_tuple__498 #define __pyx_tuple__499 __pyx_mstate_global->__pyx_tuple__499 #define __pyx_tuple__500 __pyx_mstate_global->__pyx_tuple__500 #define __pyx_tuple__501 __pyx_mstate_global->__pyx_tuple__501 #define __pyx_tuple__502 __pyx_mstate_global->__pyx_tuple__502 #define __pyx_tuple__503 __pyx_mstate_global->__pyx_tuple__503 #define __pyx_tuple__504 __pyx_mstate_global->__pyx_tuple__504 #define __pyx_tuple__505 __pyx_mstate_global->__pyx_tuple__505 #define __pyx_tuple__506 __pyx_mstate_global->__pyx_tuple__506 #define __pyx_tuple__507 __pyx_mstate_global->__pyx_tuple__507 #define __pyx_tuple__508 __pyx_mstate_global->__pyx_tuple__508 #define __pyx_tuple__509 __pyx_mstate_global->__pyx_tuple__509 #define __pyx_tuple__510 __pyx_mstate_global->__pyx_tuple__510 #define __pyx_tuple__511 __pyx_mstate_global->__pyx_tuple__511 #define __pyx_tuple__512 __pyx_mstate_global->__pyx_tuple__512 #define __pyx_tuple__513 __pyx_mstate_global->__pyx_tuple__513 #define __pyx_tuple__514 __pyx_mstate_global->__pyx_tuple__514 #define __pyx_tuple__517 __pyx_mstate_global->__pyx_tuple__517 #define __pyx_tuple__519 __pyx_mstate_global->__pyx_tuple__519 #define __pyx_tuple__521 __pyx_mstate_global->__pyx_tuple__521 #define __pyx_codeobj__515 __pyx_mstate_global->__pyx_codeobj__515 #define __pyx_codeobj__516 __pyx_mstate_global->__pyx_codeobj__516 #define __pyx_codeobj__518 __pyx_mstate_global->__pyx_codeobj__518 #define __pyx_codeobj__520 __pyx_mstate_global->__pyx_codeobj__520 #define __pyx_codeobj__522 __pyx_mstate_global->__pyx_codeobj__522 /* #### Code section: module_code ### */ /* "pygame_sdl2/color.pyx":26 * include "color_dict.pxi" * * cdef Uint32 map_color(SDL_Surface *surface, color) except? 0xaabbccdd: # <<<<<<<<<<<<<< * """ * Maps `color` into an RGBA color value that can be used with `surface`. */ static Uint32 __pyx_f_11pygame_sdl2_5color_map_color(SDL_Surface *__pyx_v_surface, PyObject *__pyx_v_color) { Uint8 __pyx_v_r; Uint8 __pyx_v_g; Uint8 __pyx_v_b; Uint8 __pyx_v_a; Uint32 __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); Uint8 __pyx_t_11; Uint8 __pyx_t_12; Uint8 __pyx_t_13; Uint8 __pyx_t_14; Uint32 __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("map_color", 1); /* "pygame_sdl2/color.pyx":33 * cdef Uint8 r, g, b, a * * if isinstance(color, (tuple, list, Color)) and len(color) == 4: # <<<<<<<<<<<<<< * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: */ __pyx_t_3 = PyTuple_Check(__pyx_v_color); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = PyList_Check(__pyx_v_color); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_color, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = PyObject_Length(__pyx_v_color); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 33, __pyx_L1_error) __pyx_t_2 = (__pyx_t_4 == 4); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":34 * * if isinstance(color, (tuple, list, Color)) and len(color) == 4: * r, g, b, a = color # <<<<<<<<<<<<<< * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: * r, g, b = color */ if ((likely(PyTuple_CheckExact(__pyx_v_color))) || (PyList_CheckExact(__pyx_v_color))) { PyObject* sequence = __pyx_v_color; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 34, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); __pyx_t_8 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8}; __pyx_t_9 = PyObject_GetIter(__pyx_v_color); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 4) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 34, __pyx_L1_error) __pyx_L10_unpacking_done:; } __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_t_5); if (unlikely((__pyx_t_11 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_12 = __Pyx_PyInt_As_uint8_t(__pyx_t_6); if (unlikely((__pyx_t_12 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint8_t(__pyx_t_7); if (unlikely((__pyx_t_13 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = __Pyx_PyInt_As_uint8_t(__pyx_t_8); if (unlikely((__pyx_t_14 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_r = __pyx_t_11; __pyx_v_g = __pyx_t_12; __pyx_v_b = __pyx_t_13; __pyx_v_a = __pyx_t_14; /* "pygame_sdl2/color.pyx":33 * cdef Uint8 r, g, b, a * * if isinstance(color, (tuple, list, Color)) and len(color) == 4: # <<<<<<<<<<<<<< * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":35 * if isinstance(color, (tuple, list, Color)) and len(color) == 4: * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: # <<<<<<<<<<<<<< * r, g, b = color * a = 255 */ __pyx_t_3 = PyTuple_Check(__pyx_v_color); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L13_bool_binop_done; } __pyx_t_3 = PyList_Check(__pyx_v_color); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L13_bool_binop_done; } __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_color, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_2 = __pyx_t_3; __pyx_L13_bool_binop_done:; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L11_bool_binop_done; } __pyx_t_4 = PyObject_Length(__pyx_v_color); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_t_2 = (__pyx_t_4 == 3); __pyx_t_1 = __pyx_t_2; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":36 * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: * r, g, b = color # <<<<<<<<<<<<<< * a = 255 * elif isinstance(color, int): */ if ((likely(PyTuple_CheckExact(__pyx_v_color))) || (PyList_CheckExact(__pyx_v_color))) { PyObject* sequence = __pyx_v_color; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 36, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_8 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_color); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_8 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 2; __pyx_t_6 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_5), 3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L17_unpacking_done; __pyx_L16_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 36, __pyx_L1_error) __pyx_L17_unpacking_done:; } __pyx_t_14 = __Pyx_PyInt_As_uint8_t(__pyx_t_8); if (unlikely((__pyx_t_14 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint8_t(__pyx_t_7); if (unlikely((__pyx_t_13 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_12 = __Pyx_PyInt_As_uint8_t(__pyx_t_6); if (unlikely((__pyx_t_12 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_r = __pyx_t_14; __pyx_v_g = __pyx_t_13; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":37 * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: * r, g, b = color * a = 255 # <<<<<<<<<<<<<< * elif isinstance(color, int): * return color */ __pyx_v_a = 0xFF; /* "pygame_sdl2/color.pyx":35 * if isinstance(color, (tuple, list, Color)) and len(color) == 4: * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: # <<<<<<<<<<<<<< * r, g, b = color * a = 255 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":38 * r, g, b = color * a = 255 * elif isinstance(color, int): # <<<<<<<<<<<<<< * return color * else: */ __pyx_t_1 = PyInt_Check(__pyx_v_color); if (likely(__pyx_t_1)) { /* "pygame_sdl2/color.pyx":39 * a = 255 * elif isinstance(color, int): * return color # <<<<<<<<<<<<<< * else: * raise TypeError("Expected a color.") */ __pyx_t_15 = __Pyx_PyInt_As_uint32_t(__pyx_v_color); if (unlikely((__pyx_t_15 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error) __pyx_r = __pyx_t_15; goto __pyx_L0; /* "pygame_sdl2/color.pyx":38 * r, g, b = color * a = 255 * elif isinstance(color, int): # <<<<<<<<<<<<<< * return color * else: */ } /* "pygame_sdl2/color.pyx":41 * return color * else: * raise TypeError("Expected a color.") # <<<<<<<<<<<<<< * * return SDL_MapRGBA(surface.format, r, g, b, a) */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 41, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/color.pyx":43 * raise TypeError("Expected a color.") * * return SDL_MapRGBA(surface.format, r, g, b, a) # <<<<<<<<<<<<<< * * cdef object get_color(Uint32 pixel, SDL_Surface *surface): */ __pyx_r = SDL_MapRGBA(__pyx_v_surface->format, __pyx_v_r, __pyx_v_g, __pyx_v_b, __pyx_v_a); goto __pyx_L0; /* "pygame_sdl2/color.pyx":26 * include "color_dict.pxi" * * cdef Uint32 map_color(SDL_Surface *surface, color) except? 0xaabbccdd: # <<<<<<<<<<<<<< * """ * Maps `color` into an RGBA color value that can be used with `surface`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.color.map_color", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0xaabbccdd; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":45 * return SDL_MapRGBA(surface.format, r, g, b, a) * * cdef object get_color(Uint32 pixel, SDL_Surface *surface): # <<<<<<<<<<<<<< * cdef Uint8 r * cdef Uint8 g */ static PyObject *__pyx_f_11pygame_sdl2_5color_get_color(Uint32 __pyx_v_pixel, SDL_Surface *__pyx_v_surface) { Uint8 __pyx_v_r; Uint8 __pyx_v_g; Uint8 __pyx_v_b; Uint8 __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_color", 1); /* "pygame_sdl2/color.pyx":51 * cdef Uint8 a * * SDL_GetRGBA(pixel, surface.format, &r, &g, &b, &a) # <<<<<<<<<<<<<< * * return Color(r, g, b, a) */ SDL_GetRGBA(__pyx_v_pixel, __pyx_v_surface->format, (&__pyx_v_r), (&__pyx_v_g), (&__pyx_v_b), (&__pyx_v_a)); /* "pygame_sdl2/color.pyx":53 * SDL_GetRGBA(pixel, surface.format, &r, &g, &b, &a) * * return Color(r, g, b, a) # <<<<<<<<<<<<<< * * cdef to_sdl_color(color, SDL_Color *out): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":45 * return SDL_MapRGBA(surface.format, r, g, b, a) * * cdef object get_color(Uint32 pixel, SDL_Surface *surface): # <<<<<<<<<<<<<< * cdef Uint8 r * cdef Uint8 g */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.get_color", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":55 * return Color(r, g, b, a) * * cdef to_sdl_color(color, SDL_Color *out): # <<<<<<<<<<<<<< * if not isinstance(color, Color): * color = Color(color) */ static PyObject *__pyx_f_11pygame_sdl2_5color_to_sdl_color(PyObject *__pyx_v_color, SDL_Color *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Uint8 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_sdl_color", 0); __Pyx_INCREF(__pyx_v_color); /* "pygame_sdl2/color.pyx":56 * * cdef to_sdl_color(color, SDL_Color *out): * if not isinstance(color, Color): # <<<<<<<<<<<<<< * color = Color(color) * out.r = color.r */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_color, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":57 * cdef to_sdl_color(color, SDL_Color *out): * if not isinstance(color, Color): * color = Color(color) # <<<<<<<<<<<<<< * out.r = color.r * out.g = color.g */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_color, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":56 * * cdef to_sdl_color(color, SDL_Color *out): * if not isinstance(color, Color): # <<<<<<<<<<<<<< * color = Color(color) * out.r = color.r */ } /* "pygame_sdl2/color.pyx":58 * if not isinstance(color, Color): * color = Color(color) * out.r = color.r # <<<<<<<<<<<<<< * out.g = color.g * out.b = color.b */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_out->r = __pyx_t_4; /* "pygame_sdl2/color.pyx":59 * color = Color(color) * out.r = color.r * out.g = color.g # <<<<<<<<<<<<<< * out.b = color.b * out.a = color.a */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_out->g = __pyx_t_4; /* "pygame_sdl2/color.pyx":60 * out.r = color.r * out.g = color.g * out.b = color.b # <<<<<<<<<<<<<< * out.a = color.a * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_out->b = __pyx_t_4; /* "pygame_sdl2/color.pyx":61 * out.g = color.g * out.b = color.b * out.a = color.a # <<<<<<<<<<<<<< * * cdef class Color: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_out->a = __pyx_t_4; /* "pygame_sdl2/color.pyx":55 * return Color(r, g, b, a) * * cdef to_sdl_color(color, SDL_Color *out): # <<<<<<<<<<<<<< * if not isinstance(color, Color): * color = Color(color) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.color.to_sdl_color", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_color); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":64 * * cdef class Color: * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): # <<<<<<<<<<<<<< * self.r = r * self.g = g */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_rgba(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, Uint8 __pyx_v_r, Uint8 __pyx_v_g, Uint8 __pyx_v_b, Uint8 __pyx_v_a) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("from_rgba", 1); /* "pygame_sdl2/color.pyx":65 * cdef class Color: * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): * self.r = r # <<<<<<<<<<<<<< * self.g = g * self.b = b */ __pyx_v_self->r = __pyx_v_r; /* "pygame_sdl2/color.pyx":66 * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): * self.r = r * self.g = g # <<<<<<<<<<<<<< * self.b = b * self.a = a */ __pyx_v_self->g = __pyx_v_g; /* "pygame_sdl2/color.pyx":67 * self.r = r * self.g = g * self.b = b # <<<<<<<<<<<<<< * self.a = a * */ __pyx_v_self->b = __pyx_v_b; /* "pygame_sdl2/color.pyx":68 * self.g = g * self.b = b * self.a = a # <<<<<<<<<<<<<< * * cdef from_hex(self, c): */ __pyx_v_self->a = __pyx_v_a; /* "pygame_sdl2/color.pyx":64 * * cdef class Color: * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): # <<<<<<<<<<<<<< * self.r = r * self.g = g */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":73 * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: * c = "".join(map(lambda x: x*2, c)) # <<<<<<<<<<<<<< * * try: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_8from_hex_lambda(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_8from_hex_lambda = {"lambda", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_8from_hex_lambda, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_8from_hex_lambda(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda") < 0)) __PYX_ERR(0, 73, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_x = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lambda", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 73, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_v_x, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":70 * self.a = a * * cdef from_hex(self, c): # <<<<<<<<<<<<<< * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_hex(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; CYTHON_UNUSED PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned int __pyx_t_12; PyObject *(*__pyx_t_13)(PyObject *); PyObject *__pyx_t_14 = NULL; int __pyx_t_15; int __pyx_t_16; char const *__pyx_t_17; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; Uint8 __pyx_t_24; Uint8 __pyx_t_25; Uint8 __pyx_t_26; Uint8 __pyx_t_27; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_hex", 0); __Pyx_INCREF(__pyx_v_c); /* "pygame_sdl2/color.pyx":72 * cdef from_hex(self, c): * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: # <<<<<<<<<<<<<< * c = "".join(map(lambda x: x*2, c)) * */ __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 == 3); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 == 4); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":73 * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: * c = "".join(map(lambda x: x*2, c)) # <<<<<<<<<<<<<< * * try: */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_8from_hex_lambda, 0, __pyx_n_s_Color_from_hex_locals_lambda, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_c)) __PYX_ERR(0, 73, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":72 * cdef from_hex(self, c): * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: # <<<<<<<<<<<<<< * c = "".join(map(lambda x: x*2, c)) * */ } /* "pygame_sdl2/color.pyx":75 * c = "".join(map(lambda x: x*2, c)) * * try: # <<<<<<<<<<<<<< * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/color.pyx":76 * * try: * if len(c) == 6: # <<<<<<<<<<<<<< * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 */ __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 76, __pyx_L6_error) __pyx_t_1 = (__pyx_t_2 == 6); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":77 * try: * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) # <<<<<<<<<<<<<< * a = 255 * elif len(c) == 8: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_struct); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unpack); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_binascii); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_unhexlify); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_c}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_n_s_BBB, __pyx_t_4}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_12, 2+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 77, __pyx_L6_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_11 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_11); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); index = 0; __pyx_t_9 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_11)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_10), 3) < 0) __PYX_ERR(0, 77, __pyx_L6_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L14_unpacking_done; __pyx_L13_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 77, __pyx_L6_error) __pyx_L14_unpacking_done:; } __pyx_v_r = __pyx_t_9; __pyx_t_9 = 0; __pyx_v_g = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_b = __pyx_t_11; __pyx_t_11 = 0; /* "pygame_sdl2/color.pyx":78 * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 # <<<<<<<<<<<<<< * elif len(c) == 8: * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) */ __Pyx_INCREF(__pyx_int_255); __pyx_v_a = __pyx_int_255; /* "pygame_sdl2/color.pyx":76 * * try: * if len(c) == 6: # <<<<<<<<<<<<<< * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 */ goto __pyx_L12; } /* "pygame_sdl2/color.pyx":79 * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 * elif len(c) == 8: # <<<<<<<<<<<<<< * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) * else: */ __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 79, __pyx_L6_error) __pyx_t_1 = (__pyx_t_2 == 8); if (likely(__pyx_t_1)) { /* "pygame_sdl2/color.pyx":80 * a = 255 * elif len(c) == 8: * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) # <<<<<<<<<<<<<< * else: * raise ValueError(c) */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_struct); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_unpack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_binascii); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_unhexlify); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_c}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_t_10 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_n_s_BBBB, __pyx_t_11}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_12, 2+__pyx_t_12); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 80, __pyx_L6_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_11 = PyList_GET_ITEM(sequence, 1); __pyx_t_10 = PyList_GET_ITEM(sequence, 2); __pyx_t_9 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_11,&__pyx_t_10,&__pyx_t_9}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_11,&__pyx_t_10,&__pyx_t_9}; __pyx_t_14 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_13(__pyx_t_14); if (unlikely(!item)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_14), 4) < 0) __PYX_ERR(0, 80, __pyx_L6_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L16_unpacking_done; __pyx_L15_unpacking_failed:; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 80, __pyx_L6_error) __pyx_L16_unpacking_done:; } __pyx_v_r = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_g = __pyx_t_11; __pyx_t_11 = 0; __pyx_v_b = __pyx_t_10; __pyx_t_10 = 0; __pyx_v_a = __pyx_t_9; __pyx_t_9 = 0; /* "pygame_sdl2/color.pyx":79 * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 * elif len(c) == 8: # <<<<<<<<<<<<<< * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) * else: */ goto __pyx_L12; } /* "pygame_sdl2/color.pyx":82 * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) * else: * raise ValueError(c) # <<<<<<<<<<<<<< * except TypeError as e: * raise ValueError(c) */ /*else*/ { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 82, __pyx_L6_error) } __pyx_L12:; /* "pygame_sdl2/color.pyx":75 * c = "".join(map(lambda x: x*2, c)) * * try: # <<<<<<<<<<<<<< * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L11_try_end; __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/color.pyx":83 * else: * raise ValueError(c) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * */ __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_15) { __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 83, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_v_e = __pyx_t_9; /*try:*/ { /* "pygame_sdl2/color.pyx":84 * raise ValueError(c) * except TypeError as e: * raise ValueError(c) # <<<<<<<<<<<<<< * * self.from_rgba(r, g, b, a) */ __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_c); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 84, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(0, 84, __pyx_L22_error) } /* "pygame_sdl2/color.pyx":83 * else: * raise ValueError(c) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * */ /*finally:*/ { __pyx_L22_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __pyx_t_15 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); } __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20); __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17; goto __pyx_L8_except_error; } } } goto __pyx_L8_except_error; /* "pygame_sdl2/color.pyx":75 * c = "".join(map(lambda x: x*2, c)) * * try: # <<<<<<<<<<<<<< * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) */ __pyx_L8_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_end:; } /* "pygame_sdl2/color.pyx":86 * raise ValueError(c) * * self.from_rgba(r, g, b, a) # <<<<<<<<<<<<<< * * cdef from_name(self, c): */ __pyx_t_24 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_24 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_25 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_25 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_26 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_26 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_27 = __Pyx_PyInt_As_uint8_t(__pyx_v_a); if (unlikely((__pyx_t_27 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_10 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_24, __pyx_t_25, __pyx_t_26, __pyx_t_27); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "pygame_sdl2/color.pyx":70 * self.a = a * * cdef from_hex(self, c): # <<<<<<<<<<<<<< * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":88 * self.from_rgba(r, g, b, a) * * cdef from_name(self, c): # <<<<<<<<<<<<<< * # Remove all whitespace. * c = "".join(c.split()).lower() */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_name(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; CYTHON_UNUSED PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_t_11; int __pyx_t_12; char const *__pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; Uint8 __pyx_t_20; Uint8 __pyx_t_21; Uint8 __pyx_t_22; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_name", 0); __Pyx_INCREF(__pyx_v_c); /* "pygame_sdl2/color.pyx":90 * cdef from_name(self, c): * # Remove all whitespace. * c = "".join(c.split()).lower() # <<<<<<<<<<<<<< * * try: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":92 * c = "".join(c.split()).lower() * * try: # <<<<<<<<<<<<<< * r, g, b = colors[c] * except KeyError as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/color.pyx":93 * * try: * r, g, b = colors[c] # <<<<<<<<<<<<<< * except KeyError as e: * raise ValueError(c) */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_11pygame_sdl2_5color_colors, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 93, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(0, 93, __pyx_L3_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 93, __pyx_L3_error) __pyx_L10_unpacking_done:; } __pyx_v_r = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_g = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_b = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":92 * c = "".join(c.split()).lower() * * try: # <<<<<<<<<<<<<< * r, g, b = colors[c] * except KeyError as e: */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/color.pyx":94 * try: * r, g, b = colors[c] * except KeyError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * self.from_rgba(r, g, b, 255) */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_11) { __Pyx_AddTraceback("pygame_sdl2.color.Color.from_name", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 94, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_v_e = __pyx_t_4; /*try:*/ { /* "pygame_sdl2/color.pyx":95 * r, g, b = colors[c] * except KeyError as e: * raise ValueError(c) # <<<<<<<<<<<<<< * self.from_rgba(r, g, b, 255) * */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 95, __pyx_L16_error) } /* "pygame_sdl2/color.pyx":94 * try: * r, g, b = colors[c] * except KeyError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * self.from_rgba(r, g, b, 255) */ /*finally:*/ { __pyx_L16_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); } __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16); __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; /* "pygame_sdl2/color.pyx":92 * c = "".join(c.split()).lower() * * try: # <<<<<<<<<<<<<< * r, g, b = colors[c] * except KeyError as e: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_try_end:; } /* "pygame_sdl2/color.pyx":96 * except KeyError as e: * raise ValueError(c) * self.from_rgba(r, g, b, 255) # <<<<<<<<<<<<<< * * def __richcmp__(Color x, y, int op): */ __pyx_t_20 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_20 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_21 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_21 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_22 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_22 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_20, __pyx_t_21, __pyx_t_22, 0xFF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":88 * self.from_rgba(r, g, b, a) * * cdef from_name(self, c): # <<<<<<<<<<<<<< * # Remove all whitespace. * c = "".join(c.split()).lower() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.color.Color.from_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":98 * self.from_rgba(r, g, b, 255) * * def __richcmp__(Color x, y, int op): # <<<<<<<<<<<<<< * if op == 3: * return not (x == y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color___richcmp__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_x), ((PyObject *)__pyx_v_y), ((int)__pyx_v_op)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color___richcmp__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 0); __Pyx_INCREF(__pyx_v_y); /* "pygame_sdl2/color.pyx":99 * * def __richcmp__(Color x, y, int op): * if op == 3: # <<<<<<<<<<<<<< * return not (x == y) * */ __pyx_t_1 = (__pyx_v_op == 3); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":100 * def __richcmp__(Color x, y, int op): * if op == 3: * return not (x == y) # <<<<<<<<<<<<<< * * if isinstance(y, tuple): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_x), __pyx_v_y, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong((!__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":99 * * def __richcmp__(Color x, y, int op): * if op == 3: # <<<<<<<<<<<<<< * return not (x == y) * */ } /* "pygame_sdl2/color.pyx":102 * return not (x == y) * * if isinstance(y, tuple): # <<<<<<<<<<<<<< * y = Color(y) * if not isinstance(y, Color): */ __pyx_t_1 = PyTuple_Check(__pyx_v_y); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":103 * * if isinstance(y, tuple): * y = Color(y) # <<<<<<<<<<<<<< * if not isinstance(y, Color): * return False */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":102 * return not (x == y) * * if isinstance(y, tuple): # <<<<<<<<<<<<<< * y = Color(y) * if not isinstance(y, Color): */ } /* "pygame_sdl2/color.pyx":104 * if isinstance(y, tuple): * y = Color(y) * if not isinstance(y, Color): # <<<<<<<<<<<<<< * return False * if op == 2: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_y, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_3 = (!__pyx_t_1); if (__pyx_t_3) { /* "pygame_sdl2/color.pyx":105 * y = Color(y) * if not isinstance(y, Color): * return False # <<<<<<<<<<<<<< * if op == 2: * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/color.pyx":104 * if isinstance(y, tuple): * y = Color(y) * if not isinstance(y, Color): # <<<<<<<<<<<<<< * return False * if op == 2: */ } /* "pygame_sdl2/color.pyx":106 * if not isinstance(y, Color): * return False * if op == 2: # <<<<<<<<<<<<<< * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * */ __pyx_t_3 = (__pyx_v_op == 2); if (__pyx_t_3) { /* "pygame_sdl2/color.pyx":107 * return False * if op == 2: * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 107, __pyx_L1_error) if (__pyx_t_3) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_2 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->g); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_g); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 107, __pyx_L1_error) if (__pyx_t_3) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 107, __pyx_L1_error) if (__pyx_t_3) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_2 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->a); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_a); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_L7_bool_binop_done:; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":106 * if not isinstance(y, Color): * return False * if op == 2: # <<<<<<<<<<<<<< * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * */ } /* "pygame_sdl2/color.pyx":98 * self.from_rgba(r, g, b, 255) * * def __richcmp__(Color x, y, int op): # <<<<<<<<<<<<<< * if op == 3: * return not (x == y) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.color.Color.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":109 * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * * def __cinit__(self): # <<<<<<<<<<<<<< * self.length = 4 * self.r = 0 */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_2__cinit__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_2__cinit__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/color.pyx":110 * * def __cinit__(self): * self.length = 4 # <<<<<<<<<<<<<< * self.r = 0 * self.g = 0 */ __pyx_v_self->length = 4; /* "pygame_sdl2/color.pyx":111 * def __cinit__(self): * self.length = 4 * self.r = 0 # <<<<<<<<<<<<<< * self.g = 0 * self.b = 0 */ __pyx_v_self->r = 0; /* "pygame_sdl2/color.pyx":112 * self.length = 4 * self.r = 0 * self.g = 0 # <<<<<<<<<<<<<< * self.b = 0 * self.a = 255 */ __pyx_v_self->g = 0; /* "pygame_sdl2/color.pyx":113 * self.r = 0 * self.g = 0 * self.b = 0 # <<<<<<<<<<<<<< * self.a = 255 * */ __pyx_v_self->b = 0; /* "pygame_sdl2/color.pyx":114 * self.g = 0 * self.b = 0 * self.a = 255 # <<<<<<<<<<<<<< * * def __init__(self, *args): */ __pyx_v_self->a = 0xFF; /* "pygame_sdl2/color.pyx":109 * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * * def __cinit__(self): # <<<<<<<<<<<<<< * self.length = 4 * self.r = 0 */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/color.pyx":116 * self.a = 255 * * def __init__(self, *args): # <<<<<<<<<<<<<< * self.length = 4 * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4__init__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_4__init__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_c = NULL; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_t_7; Uint8 __pyx_t_8; Uint8 __pyx_t_9; Uint8 __pyx_t_10; Uint8 __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/color.pyx":117 * * def __init__(self, *args): * self.length = 4 # <<<<<<<<<<<<<< * * if len(args) == 1: */ __pyx_v_self->length = 4; /* "pygame_sdl2/color.pyx":119 * self.length = 4 * * if len(args) == 1: # <<<<<<<<<<<<<< * c = args[0] * if isinstance(c, basestring): */ __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 119, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 1); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":120 * * if len(args) == 1: * c = args[0] # <<<<<<<<<<<<<< * if isinstance(c, basestring): * if c.startswith('#'): */ __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_c = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":121 * if len(args) == 1: * c = args[0] * if isinstance(c, basestring): # <<<<<<<<<<<<<< * if c.startswith('#'): * self.from_hex(c[1:]) */ __pyx_t_2 = __Pyx_PyBaseString_Check(__pyx_v_c); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":122 * c = args[0] * if isinstance(c, basestring): * if c.startswith('#'): # <<<<<<<<<<<<<< * self.from_hex(c[1:]) * elif c.startswith('0x'): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s__3}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":123 * if isinstance(c, basestring): * if c.startswith('#'): * self.from_hex(c[1:]) # <<<<<<<<<<<<<< * elif c.startswith('0x'): * self.from_hex(c[2:]) */ __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_c, 1, 0, NULL, NULL, &__pyx_slice__4, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":122 * c = args[0] * if isinstance(c, basestring): * if c.startswith('#'): # <<<<<<<<<<<<<< * self.from_hex(c[1:]) * elif c.startswith('0x'): */ goto __pyx_L5; } /* "pygame_sdl2/color.pyx":124 * if c.startswith('#'): * self.from_hex(c[1:]) * elif c.startswith('0x'): # <<<<<<<<<<<<<< * self.from_hex(c[2:]) * else: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_0x}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":125 * self.from_hex(c[1:]) * elif c.startswith('0x'): * self.from_hex(c[2:]) # <<<<<<<<<<<<<< * else: * self.from_name(c) */ __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_c, 2, 0, NULL, NULL, &__pyx_slice__5, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":124 * if c.startswith('#'): * self.from_hex(c[1:]) * elif c.startswith('0x'): # <<<<<<<<<<<<<< * self.from_hex(c[2:]) * else: */ goto __pyx_L5; } /* "pygame_sdl2/color.pyx":127 * self.from_hex(c[2:]) * else: * self.from_name(c) # <<<<<<<<<<<<<< * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: */ /*else*/ { __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_name(__pyx_v_self, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L5:; /* "pygame_sdl2/color.pyx":121 * if len(args) == 1: * c = args[0] * if isinstance(c, basestring): # <<<<<<<<<<<<<< * if c.startswith('#'): * self.from_hex(c[1:]) */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":128 * else: * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): # <<<<<<<<<<<<<< * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) */ __pyx_t_7 = PyTuple_Check(__pyx_v_c); if (!__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L6_bool_binop_done; } __pyx_t_7 = PyList_Check(__pyx_v_c); if (!__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L6_bool_binop_done; } __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_c, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_2 = __pyx_t_7; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":129 * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: */ __pyx_t_1 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 129, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 4); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":130 * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) # <<<<<<<<<<<<<< * elif len(c) == 3: * self.from_rgba(c[0], c[1], c[2], 255) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_8 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_10 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":129 * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: */ goto __pyx_L9; } /* "pygame_sdl2/color.pyx":131 * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], 255) * else: */ __pyx_t_1 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 131, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 3); if (likely(__pyx_t_2)) { /* "pygame_sdl2/color.pyx":132 * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: * self.from_rgba(c[0], c[1], c[2], 255) # <<<<<<<<<<<<<< * else: * raise ValueError(c) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_10 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_11, __pyx_t_10, __pyx_t_9, 0xFF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":131 * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], 255) * else: */ goto __pyx_L9; } /* "pygame_sdl2/color.pyx":134 * self.from_rgba(c[0], c[1], c[2], 255) * else: * raise ValueError(c) # <<<<<<<<<<<<<< * else: * self.from_hex("%08x" % c) */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 134, __pyx_L1_error) } __pyx_L9:; /* "pygame_sdl2/color.pyx":128 * else: * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): # <<<<<<<<<<<<<< * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":136 * raise ValueError(c) * else: * self.from_hex("%08x" % c) # <<<<<<<<<<<<<< * * elif len(args) == 3: */ /*else*/ { __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_08x, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L4:; /* "pygame_sdl2/color.pyx":119 * self.length = 4 * * if len(args) == 1: # <<<<<<<<<<<<<< * c = args[0] * if isinstance(c, basestring): */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":138 * self.from_hex("%08x" % c) * * elif len(args) == 3: # <<<<<<<<<<<<<< * r, g, b = args * self.from_rgba(r, g, b, 255) */ __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 138, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 3); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":139 * * elif len(args) == 3: * r, g, b = args # <<<<<<<<<<<<<< * self.from_rgba(r, g, b, 255) * elif len(args) == 4: */ if (1) { PyObject* sequence = __pyx_v_args; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 139, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } __pyx_v_r = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_g = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_b = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":140 * elif len(args) == 3: * r, g, b = args * self.from_rgba(r, g, b, 255) # <<<<<<<<<<<<<< * elif len(args) == 4: * r, g, b, a = args */ __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_9 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_10 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_11 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_5 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_9, __pyx_t_10, __pyx_t_11, 0xFF); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":138 * self.from_hex("%08x" % c) * * elif len(args) == 3: # <<<<<<<<<<<<<< * r, g, b = args * self.from_rgba(r, g, b, 255) */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":141 * r, g, b = args * self.from_rgba(r, g, b, 255) * elif len(args) == 4: # <<<<<<<<<<<<<< * r, g, b, a = args * self.from_rgba(r, g, b, a) */ __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 141, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 4); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":142 * self.from_rgba(r, g, b, 255) * elif len(args) == 4: * r, g, b, a = args # <<<<<<<<<<<<<< * self.from_rgba(r, g, b, a) * */ if (1) { PyObject* sequence = __pyx_v_args; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 142, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_12); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_3,&__pyx_t_4,&__pyx_t_12}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } __pyx_v_r = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_g = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_b = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_a = __pyx_t_12; __pyx_t_12 = 0; /* "pygame_sdl2/color.pyx":143 * elif len(args) == 4: * r, g, b, a = args * self.from_rgba(r, g, b, a) # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_11 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_10 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_9 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_v_a); if (unlikely((__pyx_t_8 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_t_12 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_11, __pyx_t_10, __pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "pygame_sdl2/color.pyx":141 * r, g, b = args * self.from_rgba(r, g, b, 255) * elif len(args) == 4: # <<<<<<<<<<<<<< * r, g, b, a = args * self.from_rgba(r, g, b, a) */ } __pyx_L3:; /* "pygame_sdl2/color.pyx":116 * self.a = 255 * * def __init__(self, *args): # <<<<<<<<<<<<<< * self.length = 4 * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.color.Color.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":145 * self.from_rgba(r, g, b, a) * * def __repr__(self): # <<<<<<<<<<<<<< * return str((self.r, self.g, self.b, self.a)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__repr__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_6__repr__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6__repr__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/color.pyx":146 * * def __repr__(self): * return str((self.r, self.g, self.b, self.a)) # <<<<<<<<<<<<<< * * def __int__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Str(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":145 * self.from_rgba(r, g, b, a) * * def __repr__(self): # <<<<<<<<<<<<<< * return str((self.r, self.g, self.b, self.a)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":148 * return str((self.r, self.g, self.b, self.a)) * * def __int__(self): # <<<<<<<<<<<<<< * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) * return struct.unpack('>L', packed)[0] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_9__int__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_9__int__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__int__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_8__int__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_8__int__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_v_packed = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__int__", 1); /* "pygame_sdl2/color.pyx":149 * * def __int__(self): * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) # <<<<<<<<<<<<<< * return struct.unpack('>L', packed)[0] * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_struct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pack); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_7, __pyx_n_s_BBBB, __pyx_t_2, __pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 5+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_packed = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":150 * def __int__(self): * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) * return struct.unpack('>L', packed)[0] # <<<<<<<<<<<<<< * * def __hex__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_struct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_unpack); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_kp_s_L, __pyx_v_packed}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":148 * return str((self.r, self.g, self.b, self.a)) * * def __int__(self): # <<<<<<<<<<<<<< * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) * return struct.unpack('>L', packed)[0] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.color.Color.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_packed); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":152 * return struct.unpack('>L', packed)[0] * * def __hex__(self): # <<<<<<<<<<<<<< * return hex(int(self)) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_11__hex__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_11__hex__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hex__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__hex__", 1); /* "pygame_sdl2/color.pyx":153 * * def __hex__(self): * return hex(int(self)) # <<<<<<<<<<<<<< * * def __oct__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":152 * return struct.unpack('>L', packed)[0] * * def __hex__(self): # <<<<<<<<<<<<<< * return hex(int(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.__hex__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "pygame_sdl2/color.pyx":155 * return hex(int(self)) * * def __oct__(self): # <<<<<<<<<<<<<< * return oct(int(self)) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13__oct__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13__oct__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__oct__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__oct__", 1); /* "pygame_sdl2/color.pyx":156 * * def __oct__(self): * return oct(int(self)) # <<<<<<<<<<<<<< * * def __float__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_oct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":155 * return hex(int(self)) * * def __oct__(self): # <<<<<<<<<<<<<< * return oct(int(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.__oct__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "pygame_sdl2/color.pyx":158 * return oct(int(self)) * * def __float__(self): # <<<<<<<<<<<<<< * return float(int(self)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_15__float__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_15__float__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__float__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_14__float__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_14__float__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__float__", 1); /* "pygame_sdl2/color.pyx":159 * * def __float__(self): * return float(int(self)) # <<<<<<<<<<<<<< * * def __reduce__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":158 * return oct(int(self)) * * def __float__(self): # <<<<<<<<<<<<<< * return float(int(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.__float__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":161 * return float(int(self)) * * def __reduce__(self): # <<<<<<<<<<<<<< * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5color_5Color_16__reduce__, "Color.__reduce__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_17__reduce__ = {"__reduce__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_16__reduce__}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_16__reduce__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_16__reduce__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_v_d = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 1); /* "pygame_sdl2/color.pyx":162 * * def __reduce__(self): * d = {} # <<<<<<<<<<<<<< * d['rgba'] = (self.r, self.g, self.b, self.a) * return (Color, (), d) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_d = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":163 * def __reduce__(self): * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) # <<<<<<<<<<<<<< * return (Color, (), d) * */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; if (unlikely((PyDict_SetItem(__pyx_v_d, __pyx_n_s_rgba, __pyx_t_5) < 0))) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":164 * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) * return (Color, (), d) # <<<<<<<<<<<<<< * * def __setstate__(self, d): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color); __Pyx_GIVEREF((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color))) __PYX_ERR(0, 164, __pyx_L1_error); __Pyx_INCREF(__pyx_empty_tuple); __Pyx_GIVEREF(__pyx_empty_tuple); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_empty_tuple)) __PYX_ERR(0, 164, __pyx_L1_error); __Pyx_INCREF(__pyx_v_d); __Pyx_GIVEREF(__pyx_v_d); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_d)) __PYX_ERR(0, 164, __pyx_L1_error); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":161 * return float(int(self)) * * def __reduce__(self): # <<<<<<<<<<<<<< * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":166 * return (Color, (), d) * * def __setstate__(self, d): # <<<<<<<<<<<<<< * self.r, self.g, self.b, self.a = d['rgba'] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5color_5Color_18__setstate__, "Color.__setstate__(self, d)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_19__setstate__ = {"__setstate__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_18__setstate__}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_d = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_d,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_d)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate__") < 0)) __PYX_ERR(0, 166, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_d = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 166, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_18__setstate__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), __pyx_v_d); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_18__setstate__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_d) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); Uint8 __pyx_t_8; Uint8 __pyx_t_9; Uint8 __pyx_t_10; Uint8 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate__", 1); /* "pygame_sdl2/color.pyx":167 * * def __setstate__(self, d): * self.r, self.g, self.b, self.a = d['rgba'] # <<<<<<<<<<<<<< * * def __setitem__(self, key, val): */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_d, __pyx_n_s_rgba); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 167, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_5 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) __PYX_ERR(0, 167, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 167, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_10 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_t_5); if (unlikely((__pyx_t_11 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->r = __pyx_t_8; __pyx_v_self->g = __pyx_t_9; __pyx_v_self->b = __pyx_t_10; __pyx_v_self->a = __pyx_t_11; /* "pygame_sdl2/color.pyx":166 * return (Color, (), d) * * def __setstate__(self, d): # <<<<<<<<<<<<<< * self.r, self.g, self.b, self.a = d['rgba'] * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.color.Color.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":169 * self.r, self.g, self.b, self.a = d['rgba'] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if not isinstance(val, int): * raise ValueError(val) */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_21__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_21__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_20__setitem__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_20__setitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Uint8 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); /* "pygame_sdl2/color.pyx":170 * * def __setitem__(self, key, val): * if not isinstance(val, int): # <<<<<<<<<<<<<< * raise ValueError(val) * if key >= self.length: */ __pyx_t_1 = PyInt_Check(__pyx_v_val); __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/color.pyx":171 * def __setitem__(self, key, val): * if not isinstance(val, int): * raise ValueError(val) # <<<<<<<<<<<<<< * if key >= self.length: * raise IndexError(key) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 171, __pyx_L1_error) /* "pygame_sdl2/color.pyx":170 * * def __setitem__(self, key, val): * if not isinstance(val, int): # <<<<<<<<<<<<<< * raise ValueError(val) * if key >= self.length: */ } /* "pygame_sdl2/color.pyx":172 * if not isinstance(val, int): * raise ValueError(val) * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if val < 0 or val > 255: */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_key, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/color.pyx":173 * raise ValueError(val) * if key >= self.length: * raise IndexError(key) # <<<<<<<<<<<<<< * if val < 0 or val > 255: * raise ValueError(val) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 173, __pyx_L1_error) /* "pygame_sdl2/color.pyx":172 * if not isinstance(val, int): * raise ValueError(val) * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if val < 0 or val > 255: */ } /* "pygame_sdl2/color.pyx":174 * if key >= self.length: * raise IndexError(key) * if val < 0 or val > 255: # <<<<<<<<<<<<<< * raise ValueError(val) * */ __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/color.pyx":175 * raise IndexError(key) * if val < 0 or val > 255: * raise ValueError(val) # <<<<<<<<<<<<<< * * if key == 0: self.r = val */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 175, __pyx_L1_error) /* "pygame_sdl2/color.pyx":174 * if key >= self.length: * raise IndexError(key) * if val < 0 or val > 255: # <<<<<<<<<<<<<< * raise ValueError(val) * */ } /* "pygame_sdl2/color.pyx":177 * raise ValueError(val) * * if key == 0: self.r = val # <<<<<<<<<<<<<< * elif key == 1: self.g = val * elif key == 2: self.b = val */ __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_v_self->r = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":178 * * if key == 0: self.r = val * elif key == 1: self.g = val # <<<<<<<<<<<<<< * elif key == 2: self.b = val * elif key == 3: self.a = val */ __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error) __pyx_v_self->g = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":179 * if key == 0: self.r = val * elif key == 1: self.g = val * elif key == 2: self.b = val # <<<<<<<<<<<<<< * elif key == 3: self.a = val * else: */ __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 179, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error) __pyx_v_self->b = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":180 * elif key == 1: self.g = val * elif key == 2: self.b = val * elif key == 3: self.a = val # <<<<<<<<<<<<<< * else: * raise IndexError(key) */ __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_3, 3, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) if (likely(__pyx_t_2)) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error) __pyx_v_self->a = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":182 * elif key == 3: self.a = val * else: * raise IndexError(key) # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 182, __pyx_L1_error) } __pyx_L8:; /* "pygame_sdl2/color.pyx":169 * self.r, self.g, self.b, self.a = d['rgba'] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if not isinstance(val, int): * raise ValueError(val) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":184 * raise IndexError(key) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * if isinstance(key, slice): * return tuple(self)[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_22__getitem__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_22__getitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "pygame_sdl2/color.pyx":185 * * def __getitem__(self, key): * if isinstance(key, slice): # <<<<<<<<<<<<<< * return tuple(self)[key] * if key >= self.length: */ __pyx_t_1 = PySlice_Check(__pyx_v_key); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":186 * def __getitem__(self, key): * if isinstance(key, slice): * return tuple(self)[key] # <<<<<<<<<<<<<< * if key >= self.length: * raise IndexError(key) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PySequence_Tuple(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":185 * * def __getitem__(self, key): * if isinstance(key, slice): # <<<<<<<<<<<<<< * return tuple(self)[key] * if key >= self.length: */ } /* "pygame_sdl2/color.pyx":187 * if isinstance(key, slice): * return tuple(self)[key] * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if key == 0: return self.r */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_v_key, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/color.pyx":188 * return tuple(self)[key] * if key >= self.length: * raise IndexError(key) # <<<<<<<<<<<<<< * if key == 0: return self.r * elif key == 1: return self.g */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 188, __pyx_L1_error) /* "pygame_sdl2/color.pyx":187 * if isinstance(key, slice): * return tuple(self)[key] * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if key == 0: return self.r */ } /* "pygame_sdl2/color.pyx":189 * if key >= self.length: * raise IndexError(key) * if key == 0: return self.r # <<<<<<<<<<<<<< * elif key == 1: return self.g * elif key == 2: return self.b */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 189, __pyx_L1_error) if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":190 * raise IndexError(key) * if key == 0: return self.r * elif key == 1: return self.g # <<<<<<<<<<<<<< * elif key == 2: return self.b * elif key == 3: return self.a */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 190, __pyx_L1_error) if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":191 * if key == 0: return self.r * elif key == 1: return self.g * elif key == 2: return self.b # <<<<<<<<<<<<<< * elif key == 3: return self.a * else: */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":192 * elif key == 1: return self.g * elif key == 2: return self.b * elif key == 3: return self.a # <<<<<<<<<<<<<< * else: * raise IndexError(key) */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_3, 3, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 192, __pyx_L1_error) if (likely(__pyx_t_1)) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":194 * elif key == 3: return self.a * else: * raise IndexError(key) # <<<<<<<<<<<<<< * * def __len__(self): */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 194, __pyx_L1_error) } /* "pygame_sdl2/color.pyx":184 * raise IndexError(key) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * if isinstance(key, slice): * return tuple(self)[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.color.Color.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":196 * raise IndexError(key) * * def __len__(self): # <<<<<<<<<<<<<< * return self.length * */ /* Python wrapper */ static Py_ssize_t __pyx_pw_11pygame_sdl2_5color_5Color_25__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_11pygame_sdl2_5color_5Color_25__len__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_24__len__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_11pygame_sdl2_5color_5Color_24__len__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { Py_ssize_t __pyx_r; /* "pygame_sdl2/color.pyx":197 * * def __len__(self): * return self.length # <<<<<<<<<<<<<< * * def __mul__(self not None, Color rhs not None): */ __pyx_r = __pyx_v_self->length; goto __pyx_L0; /* "pygame_sdl2/color.pyx":196 * raise IndexError(key) * * def __len__(self): # <<<<<<<<<<<<<< * return self.length * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/color.pyx":199 * return self.length * * def __mul__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * # Multiplying this way doesn't make much sense, * # but it's how pygame does it. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 199, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 199, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_26__mul__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_26__mul__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { long __pyx_v_r; long __pyx_v_g; long __pyx_v_b; long __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; long __pyx_t_2; long __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__mul__", 1); /* "pygame_sdl2/color.pyx":203 * # but it's how pygame does it. * * r = min(255, self.r * rhs.r) # <<<<<<<<<<<<<< * g = min(255, self.g * rhs.g) * b = min(255, self.b * rhs.b) */ __pyx_t_1 = (__pyx_v_self->r * __pyx_v_rhs->r); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_r = __pyx_t_3; /* "pygame_sdl2/color.pyx":204 * * r = min(255, self.r * rhs.r) * g = min(255, self.g * rhs.g) # <<<<<<<<<<<<<< * b = min(255, self.b * rhs.b) * a = min(255, self.a * rhs.a) */ __pyx_t_1 = (__pyx_v_self->g * __pyx_v_rhs->g); __pyx_t_3 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_1; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_g = __pyx_t_2; /* "pygame_sdl2/color.pyx":205 * r = min(255, self.r * rhs.r) * g = min(255, self.g * rhs.g) * b = min(255, self.b * rhs.b) # <<<<<<<<<<<<<< * a = min(255, self.a * rhs.a) * */ __pyx_t_1 = (__pyx_v_self->b * __pyx_v_rhs->b); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_b = __pyx_t_3; /* "pygame_sdl2/color.pyx":206 * g = min(255, self.g * rhs.g) * b = min(255, self.b * rhs.b) * a = min(255, self.a * rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = (__pyx_v_self->a * __pyx_v_rhs->a); __pyx_t_3 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_1; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_a = __pyx_t_2; /* "pygame_sdl2/color.pyx":208 * a = min(255, self.a * rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __add__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_g); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_b); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_10 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 4+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":199 * return self.length * * def __mul__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * # Multiplying this way doesn't make much sense, * # but it's how pygame does it. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":210 * return type(self)(r, g, b, a) * * def __add__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_29__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_29__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 210, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 210, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_28__add__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_28__add__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { long __pyx_v_r; long __pyx_v_g; long __pyx_v_b; long __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; long __pyx_t_2; long __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__add__", 1); /* "pygame_sdl2/color.pyx":211 * * def __add__(self not None, Color rhs not None): * r = min(255, self.r + rhs.r) # <<<<<<<<<<<<<< * g = min(255, self.g + rhs.g) * b = min(255, self.b + rhs.b) */ __pyx_t_1 = (__pyx_v_self->r + __pyx_v_rhs->r); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_r = __pyx_t_3; /* "pygame_sdl2/color.pyx":212 * def __add__(self not None, Color rhs not None): * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) # <<<<<<<<<<<<<< * b = min(255, self.b + rhs.b) * a = min(255, self.a + rhs.a) */ __pyx_t_1 = (__pyx_v_self->g + __pyx_v_rhs->g); __pyx_t_3 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_1; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_g = __pyx_t_2; /* "pygame_sdl2/color.pyx":213 * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) * b = min(255, self.b + rhs.b) # <<<<<<<<<<<<<< * a = min(255, self.a + rhs.a) * */ __pyx_t_1 = (__pyx_v_self->b + __pyx_v_rhs->b); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_b = __pyx_t_3; /* "pygame_sdl2/color.pyx":214 * g = min(255, self.g + rhs.g) * b = min(255, self.b + rhs.b) * a = min(255, self.a + rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = (__pyx_v_self->a + __pyx_v_rhs->a); __pyx_t_3 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_1; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_a = __pyx_t_2; /* "pygame_sdl2/color.pyx":216 * a = min(255, self.a + rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __sub__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_g); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_b); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_10 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 4+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":210 * return type(self)(r, g, b, a) * * def __add__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":218 * return type(self)(r, g, b, a) * * def __sub__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_31__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_31__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 218, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 218, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_30__sub__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_30__sub__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { long __pyx_v_r; long __pyx_v_g; long __pyx_v_b; long __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; long __pyx_t_2; long __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__sub__", 1); /* "pygame_sdl2/color.pyx":219 * * def __sub__(self not None, Color rhs not None): * r = max(0, self.r - rhs.r) # <<<<<<<<<<<<<< * g = max(0, self.g - rhs.g) * b = max(0, self.b - rhs.b) */ __pyx_t_1 = (__pyx_v_self->r - __pyx_v_rhs->r); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_1 > __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_r = __pyx_t_3; /* "pygame_sdl2/color.pyx":220 * def __sub__(self not None, Color rhs not None): * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) # <<<<<<<<<<<<<< * b = max(0, self.b - rhs.b) * a = max(0, self.a - rhs.a) */ __pyx_t_1 = (__pyx_v_self->g - __pyx_v_rhs->g); __pyx_t_3 = 0; __pyx_t_4 = (__pyx_t_1 > __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_1; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_g = __pyx_t_2; /* "pygame_sdl2/color.pyx":221 * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) * b = max(0, self.b - rhs.b) # <<<<<<<<<<<<<< * a = max(0, self.a - rhs.a) * */ __pyx_t_1 = (__pyx_v_self->b - __pyx_v_rhs->b); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_1 > __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_b = __pyx_t_3; /* "pygame_sdl2/color.pyx":222 * g = max(0, self.g - rhs.g) * b = max(0, self.b - rhs.b) * a = max(0, self.a - rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = (__pyx_v_self->a - __pyx_v_rhs->a); __pyx_t_3 = 0; __pyx_t_4 = (__pyx_t_1 > __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_1; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_a = __pyx_t_2; /* "pygame_sdl2/color.pyx":224 * a = max(0, self.a - rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __mod__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_g); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_b); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_10 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 4+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":218 * return type(self)(r, g, b, a) * * def __sub__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":226 * return type(self)(r, g, b, a) * * def __mod__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def mod(l, r): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_33__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_33__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__mod__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 226, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 226, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_32__mod__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__mod___1mod(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_7__mod___1mod = {"mod", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_7__mod___1mod, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__mod___1mod(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_l = 0; PyObject *__pyx_v_r = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mod (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_l,&__pyx_n_s_r,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_l)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("mod", 1, 2, 2, 1); __PYX_ERR(0, 228, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mod") < 0)) __PYX_ERR(0, 228, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_l = values[0]; __pyx_v_r = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mod", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 228, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.__mod__.mod", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_self, __pyx_v_l, __pyx_v_r); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_r) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mod", 1); /* "pygame_sdl2/color.pyx":229 * * def mod(l, r): * if r == 0: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_r, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 229, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":230 * def mod(l, r): * if r == 0: * return 0 # <<<<<<<<<<<<<< * * return l % r */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":229 * * def mod(l, r): * if r == 0: # <<<<<<<<<<<<<< * return 0 * */ } /* "pygame_sdl2/color.pyx":232 * return 0 * * return l % r # <<<<<<<<<<<<<< * * r = mod(self.r, rhs.r) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyNumber_Remainder(__pyx_v_l, __pyx_v_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.__mod__.mod", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":226 * return type(self)(r, g, b, a) * * def __mod__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def mod(l, r): */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_32__mod__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_mod = 0; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__mod__", 1); /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_7__mod___1mod, 0, __pyx_n_s_mod___locals_mod, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mod = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":234 * return l % r * * r = mod(self.r, rhs.r) # <<<<<<<<<<<<<< * g = mod(self.g, rhs.g) * b = mod(self.b, rhs.b) */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":235 * * r = mod(self.r, rhs.r) * g = mod(self.g, rhs.g) # <<<<<<<<<<<<<< * b = mod(self.b, rhs.b) * a = mod(self.a, rhs.a) */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":236 * r = mod(self.r, rhs.r) * g = mod(self.g, rhs.g) * b = mod(self.b, rhs.b) # <<<<<<<<<<<<<< * a = mod(self.a, rhs.a) * */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":237 * g = mod(self.g, rhs.g) * b = mod(self.b, rhs.b) * a = mod(self.a, rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":239 * a = mod(self.a, rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __div__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_r, __pyx_v_g, __pyx_v_b, __pyx_v_a}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":226 * return type(self)(r, g, b, a) * * def __mod__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def mod(l, r): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.color.Color.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mod); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":241 * return type(self)(r, g, b, a) * * def __div__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_35__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_35__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__div__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 241, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_34__div__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_34__div__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; double __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; long __pyx_t_2; double __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__div__", 1); /* "pygame_sdl2/color.pyx":242 * * def __div__(self not None, Color rhs not None): * r = min(255, self.r / rhs.r) # <<<<<<<<<<<<<< * g = min(255, self.g / rhs.g) * b = min(255, self.b / rhs.b) */ if (unlikely(__pyx_v_rhs->r == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 242, __pyx_L1_error) } __pyx_t_1 = (((double)__pyx_v_self->r) / ((double)__pyx_v_rhs->r)); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_r = __pyx_t_3; /* "pygame_sdl2/color.pyx":243 * def __div__(self not None, Color rhs not None): * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) # <<<<<<<<<<<<<< * b = min(255, self.b / rhs.b) * a = min(255, self.a / rhs.a) */ if (unlikely(__pyx_v_rhs->g == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 243, __pyx_L1_error) } __pyx_t_3 = (((double)__pyx_v_self->g) / ((double)__pyx_v_rhs->g)); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_3 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_1 = __pyx_t_3; } else { __pyx_t_1 = __pyx_t_2; } __pyx_v_g = __pyx_t_1; /* "pygame_sdl2/color.pyx":244 * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) * b = min(255, self.b / rhs.b) # <<<<<<<<<<<<<< * a = min(255, self.a / rhs.a) * */ if (unlikely(__pyx_v_rhs->b == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 244, __pyx_L1_error) } __pyx_t_1 = (((double)__pyx_v_self->b) / ((double)__pyx_v_rhs->b)); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_b = __pyx_t_3; /* "pygame_sdl2/color.pyx":245 * g = min(255, self.g / rhs.g) * b = min(255, self.b / rhs.b) * a = min(255, self.a / rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ if (unlikely(__pyx_v_rhs->a == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 245, __pyx_L1_error) } __pyx_t_3 = (((double)__pyx_v_self->a) / ((double)__pyx_v_rhs->a)); __pyx_t_2 = 0xFF; __pyx_t_4 = (__pyx_t_3 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_1 = __pyx_t_3; } else { __pyx_t_1 = __pyx_t_2; } __pyx_v_a = __pyx_t_1; /* "pygame_sdl2/color.pyx":247 * a = min(255, self.a / rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __floordiv__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_g); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyFloat_FromDouble(__pyx_v_b); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_10 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 4+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":241 * return type(self)(r, g, b, a) * * def __div__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "pygame_sdl2/color.pyx":249 * return type(self)(r, g, b, a) * * def __floordiv__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def div(a, b): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_37__floordiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_37__floordiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__floordiv__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 249, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 249, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_36__floordiv__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_12__floordiv___1div(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_12__floordiv___1div = {"div", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_12__floordiv___1div, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_12__floordiv___1div(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_a = 0; PyObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("div (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("div", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "div") < 0)) __PYX_ERR(0, 251, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_a = values[0]; __pyx_v_b = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("div", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 251, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.__floordiv__.div", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_self, __pyx_v_a, __pyx_v_b); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; long __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("div", 1); /* "pygame_sdl2/color.pyx":252 * * def div(a, b): * if b == 0: # <<<<<<<<<<<<<< * return b * */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_b, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":253 * def div(a, b): * if b == 0: * return b # <<<<<<<<<<<<<< * * return min(255, a // b) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_b); __pyx_r = __pyx_v_b; goto __pyx_L0; /* "pygame_sdl2/color.pyx":252 * * def div(a, b): * if b == 0: # <<<<<<<<<<<<<< * return b * */ } /* "pygame_sdl2/color.pyx":255 * return b * * return min(255, a // b) # <<<<<<<<<<<<<< * * r = div(self.r, rhs.r) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyNumber_FloorDivide(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = 0xFF; __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = __pyx_t_2; } else { __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_r = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.color.Color.__floordiv__.div", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":249 * return type(self)(r, g, b, a) * * def __floordiv__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def div(a, b): */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_36__floordiv__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_div = 0; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__floordiv__", 1); /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_12__floordiv___1div, 0, __pyx_n_s_floordiv___locals_div, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_div = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":257 * return min(255, a // b) * * r = div(self.r, rhs.r) # <<<<<<<<<<<<<< * g = div(self.g, rhs.g) * b = div(self.b, rhs.b) */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":258 * * r = div(self.r, rhs.r) * g = div(self.g, rhs.g) # <<<<<<<<<<<<<< * b = div(self.b, rhs.b) * a = div(self.a, rhs.a) */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":259 * r = div(self.r, rhs.r) * g = div(self.g, rhs.g) * b = div(self.b, rhs.b) # <<<<<<<<<<<<<< * a = div(self.a, rhs.a) * */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":260 * g = div(self.g, rhs.g) * b = div(self.b, rhs.b) * a = div(self.a, rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":262 * a = div(self.a, rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * property cmy: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_r, __pyx_v_g, __pyx_v_b, __pyx_v_a}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":249 * return type(self)(r, g, b, a) * * def __floordiv__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def div(a, b): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.color.Color.__floordiv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_div); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":265 * * property cmy: * def __get__(self): # <<<<<<<<<<<<<< * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_3cmy_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_3cmy_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_3cmy___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_3cmy___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/color.pyx":266 * property cmy: * def __get__(self): * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((1.0 - (((double)__pyx_v_self->r) / 255.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble((1.0 - (((double)__pyx_v_self->g) / 255.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble((1.0 - (((double)__pyx_v_self->b) / 255.0))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":265 * * property cmy: * def __get__(self): # <<<<<<<<<<<<<< * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.cmy.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":268 * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * * def __set__(self, val): # <<<<<<<<<<<<<< * c, m, y = val * self.r = (1 - c) * 255 */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_3cmy_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_3cmy_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { PyObject *__pyx_v_c = NULL; PyObject *__pyx_v_m = NULL; PyObject *__pyx_v_y = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); Uint8 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/color.pyx":269 * * def __set__(self, val): * c, m, y = val # <<<<<<<<<<<<<< * self.r = (1 - c) * 255 * self.g = (1 - m) * 255 */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 269, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) __PYX_ERR(0, 269, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 269, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_c = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_m = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":270 * def __set__(self, val): * c, m, y = val * self.r = (1 - c) * 255 # <<<<<<<<<<<<<< * self.g = (1 - m) * 255 * self.b = (1 - y) * 255 */ __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_c, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_255, 0xFF, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->r = __pyx_t_6; /* "pygame_sdl2/color.pyx":271 * c, m, y = val * self.r = (1 - c) * 255 * self.g = (1 - m) * 255 # <<<<<<<<<<<<<< * self.b = (1 - y) * 255 * */ __pyx_t_2 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_m, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_t_2, __pyx_int_255, 0xFF, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_6 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->g = __pyx_t_6; /* "pygame_sdl2/color.pyx":272 * self.r = (1 - c) * 255 * self.g = (1 - m) * 255 * self.b = (1 - y) * 255 # <<<<<<<<<<<<<< * * property hsva: */ __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_y, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_255, 0xFF, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->b = __pyx_t_6; /* "pygame_sdl2/color.pyx":268 * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * * def __set__(self, val): # <<<<<<<<<<<<<< * c, m, y = val * self.r = (1 - c) * 255 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.cmy.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF(__pyx_v_m); __Pyx_XDECREF(__pyx_v_y); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":275 * * property hsva: * def __get__(self): # <<<<<<<<<<<<<< * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsva_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsva_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsva___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsva___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; double __pyx_v_cmax; double __pyx_v_cmin; double __pyx_v_delta; double __pyx_v_h; double __pyx_v_s; double __pyx_v_v; double __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; double __pyx_t_2; double __pyx_t_3; double __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/color.pyx":276 * property hsva: * def __get__(self): * cdef double r = self.r / 255.0 # <<<<<<<<<<<<<< * cdef double g = self.g / 255.0 * cdef double b = self.b / 255.0 */ __pyx_v_r = (((double)__pyx_v_self->r) / 255.0); /* "pygame_sdl2/color.pyx":277 * def __get__(self): * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 # <<<<<<<<<<<<<< * cdef double b = self.b / 255.0 * */ __pyx_v_g = (((double)__pyx_v_self->g) / 255.0); /* "pygame_sdl2/color.pyx":278 * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 * cdef double b = self.b / 255.0 # <<<<<<<<<<<<<< * * cdef double cmax = max(r, g, b) */ __pyx_v_b = (((double)__pyx_v_self->b) / 255.0); /* "pygame_sdl2/color.pyx":280 * cdef double b = self.b / 255.0 * * cdef double cmax = max(r, g, b) # <<<<<<<<<<<<<< * cdef double cmin = min(r, g, b) * cdef double delta = cmax - cmin */ __pyx_t_1 = __pyx_v_g; __pyx_t_2 = __pyx_v_b; __pyx_t_3 = __pyx_v_r; __pyx_t_5 = (__pyx_t_1 > __pyx_t_3); if (__pyx_t_5) { __pyx_t_4 = __pyx_t_1; } else { __pyx_t_4 = __pyx_t_3; } __pyx_t_3 = __pyx_t_4; __pyx_t_5 = (__pyx_t_2 > __pyx_t_3); if (__pyx_t_5) { __pyx_t_4 = __pyx_t_2; } else { __pyx_t_4 = __pyx_t_3; } __pyx_v_cmax = __pyx_t_4; /* "pygame_sdl2/color.pyx":281 * * cdef double cmax = max(r, g, b) * cdef double cmin = min(r, g, b) # <<<<<<<<<<<<<< * cdef double delta = cmax - cmin * */ __pyx_t_4 = __pyx_v_g; __pyx_t_1 = __pyx_v_b; __pyx_t_2 = __pyx_v_r; __pyx_t_5 = (__pyx_t_4 < __pyx_t_2); if (__pyx_t_5) { __pyx_t_3 = __pyx_t_4; } else { __pyx_t_3 = __pyx_t_2; } __pyx_t_2 = __pyx_t_3; __pyx_t_5 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_5) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_cmin = __pyx_t_3; /* "pygame_sdl2/color.pyx":282 * cdef double cmax = max(r, g, b) * cdef double cmin = min(r, g, b) * cdef double delta = cmax - cmin # <<<<<<<<<<<<<< * * cdef double h, s, v, a */ __pyx_v_delta = (__pyx_v_cmax - __pyx_v_cmin); /* "pygame_sdl2/color.pyx":286 * cdef double h, s, v, a * * if r == g == b: # <<<<<<<<<<<<<< * h = 0.0 * s = 0.0 */ __pyx_t_5 = (__pyx_v_r == __pyx_v_g); if (__pyx_t_5) { __pyx_t_5 = (__pyx_v_g == __pyx_v_b); } if (__pyx_t_5) { /* "pygame_sdl2/color.pyx":287 * * if r == g == b: * h = 0.0 # <<<<<<<<<<<<<< * s = 0.0 * else: */ __pyx_v_h = 0.0; /* "pygame_sdl2/color.pyx":288 * if r == g == b: * h = 0.0 * s = 0.0 # <<<<<<<<<<<<<< * else: * if cmax == r: */ __pyx_v_s = 0.0; /* "pygame_sdl2/color.pyx":286 * cdef double h, s, v, a * * if r == g == b: # <<<<<<<<<<<<<< * h = 0.0 * s = 0.0 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":290 * s = 0.0 * else: * if cmax == r: # <<<<<<<<<<<<<< * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: */ /*else*/ { __pyx_t_5 = (__pyx_v_cmax == __pyx_v_r); if (__pyx_t_5) { /* "pygame_sdl2/color.pyx":291 * else: * if cmax == r: * h = 60.0 * ((g - b) / delta % 6) # <<<<<<<<<<<<<< * elif cmax == g: * h = 60.0 * ((b - r) / delta + 2) */ __pyx_t_3 = (__pyx_v_g - __pyx_v_b); if (unlikely(__pyx_v_delta == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 291, __pyx_L1_error) } __pyx_v_h = (60.0 * __Pyx_mod_double((__pyx_t_3 / __pyx_v_delta), 6.0)); /* "pygame_sdl2/color.pyx":290 * s = 0.0 * else: * if cmax == r: # <<<<<<<<<<<<<< * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":292 * if cmax == r: * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: # <<<<<<<<<<<<<< * h = 60.0 * ((b - r) / delta + 2) * else: */ __pyx_t_5 = (__pyx_v_cmax == __pyx_v_g); if (__pyx_t_5) { /* "pygame_sdl2/color.pyx":293 * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: * h = 60.0 * ((b - r) / delta + 2) # <<<<<<<<<<<<<< * else: * h = 60.0 * ((r - g) / delta + 4) */ __pyx_t_3 = (__pyx_v_b - __pyx_v_r); if (unlikely(__pyx_v_delta == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 293, __pyx_L1_error) } __pyx_v_h = (60.0 * ((__pyx_t_3 / __pyx_v_delta) + 2.0)); /* "pygame_sdl2/color.pyx":292 * if cmax == r: * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: # <<<<<<<<<<<<<< * h = 60.0 * ((b - r) / delta + 2) * else: */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":295 * h = 60.0 * ((b - r) / delta + 2) * else: * h = 60.0 * ((r - g) / delta + 4) # <<<<<<<<<<<<<< * * if cmax == 0.0: */ /*else*/ { __pyx_t_3 = (__pyx_v_r - __pyx_v_g); if (unlikely(__pyx_v_delta == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 295, __pyx_L1_error) } __pyx_v_h = (60.0 * ((__pyx_t_3 / __pyx_v_delta) + 4.0)); } __pyx_L4:; /* "pygame_sdl2/color.pyx":297 * h = 60.0 * ((r - g) / delta + 4) * * if cmax == 0.0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ __pyx_t_5 = (__pyx_v_cmax == 0.0); if (__pyx_t_5) { /* "pygame_sdl2/color.pyx":298 * * if cmax == 0.0: * s = 0.0 # <<<<<<<<<<<<<< * else: * s = delta / cmax * 100 */ __pyx_v_s = 0.0; /* "pygame_sdl2/color.pyx":297 * h = 60.0 * ((r - g) / delta + 4) * * if cmax == 0.0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ goto __pyx_L5; } /* "pygame_sdl2/color.pyx":300 * s = 0.0 * else: * s = delta / cmax * 100 # <<<<<<<<<<<<<< * * v = cmax * 100 */ /*else*/ { if (unlikely(__pyx_v_cmax == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 300, __pyx_L1_error) } __pyx_v_s = ((__pyx_v_delta / __pyx_v_cmax) * 100.0); } __pyx_L5:; } __pyx_L3:; /* "pygame_sdl2/color.pyx":302 * s = delta / cmax * 100 * * v = cmax * 100 # <<<<<<<<<<<<<< * a = self.a / 255.0 * 100 * return h, s, v, a */ __pyx_v_v = (__pyx_v_cmax * 100.0); /* "pygame_sdl2/color.pyx":303 * * v = cmax * 100 * a = self.a / 255.0 * 100 # <<<<<<<<<<<<<< * return h, s, v, a * */ __pyx_v_a = ((((double)__pyx_v_self->a) / 255.0) * 100.0); /* "pygame_sdl2/color.pyx":304 * v = cmax * 100 * a = self.a / 255.0 * 100 * return h, s, v, a # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_8)) __PYX_ERR(0, 304, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_9)) __PYX_ERR(0, 304, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":275 * * property hsva: * def __get__(self): # <<<<<<<<<<<<<< * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsva.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":306 * return h, s, v, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, v, a * if len(val) == 3: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsva_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsva_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { double __pyx_v_h; double __pyx_v_s; double __pyx_v_v; double __pyx_v_a; double __pyx_v_c; double __pyx_v_x; double __pyx_v_m; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); double __pyx_t_8; double __pyx_t_9; double __pyx_t_10; PyObject *__pyx_t_11 = NULL; double __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/color.pyx":308 * def __set__(self, val): * cdef double h, s, v, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, v = val * a = 0.0 */ __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 308, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 3); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":309 * cdef double h, s, v, a * if len(val) == 3: * h, s, v = val # <<<<<<<<<<<<<< * a = 0.0 * else: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 309, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 309, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 309, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_h = __pyx_t_8; __pyx_v_s = __pyx_t_9; __pyx_v_v = __pyx_t_10; /* "pygame_sdl2/color.pyx":310 * if len(val) == 3: * h, s, v = val * a = 0.0 # <<<<<<<<<<<<<< * else: * h, s, v, a = val */ __pyx_v_a = 0.0; /* "pygame_sdl2/color.pyx":308 * def __set__(self, val): * cdef double h, s, v, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, v = val * a = 0.0 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":312 * a = 0.0 * else: * h, s, v, a = val # <<<<<<<<<<<<<< * * h = h % 360.0 */ /*else*/ { if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 312, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; __pyx_t_11 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_11); if (unlikely(!item)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_11), 4) < 0) __PYX_ERR(0, 312, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 312, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_h = __pyx_t_10; __pyx_v_s = __pyx_t_9; __pyx_v_v = __pyx_t_8; __pyx_v_a = __pyx_t_12; } __pyx_L3:; /* "pygame_sdl2/color.pyx":314 * h, s, v, a = val * * h = h % 360.0 # <<<<<<<<<<<<<< * * # These should be in a range of [0.0, 1.0] */ __pyx_v_h = __Pyx_mod_double(__pyx_v_h, 360.0); /* "pygame_sdl2/color.pyx":317 * * # These should be in a range of [0.0, 1.0] * s /= 100.0 # <<<<<<<<<<<<<< * v /= 100.0 * a /= 100.0 */ __pyx_v_s = (__pyx_v_s / 100.0); /* "pygame_sdl2/color.pyx":318 * # These should be in a range of [0.0, 1.0] * s /= 100.0 * v /= 100.0 # <<<<<<<<<<<<<< * a /= 100.0 * */ __pyx_v_v = (__pyx_v_v / 100.0); /* "pygame_sdl2/color.pyx":319 * s /= 100.0 * v /= 100.0 * a /= 100.0 # <<<<<<<<<<<<<< * * cdef double c = v * s */ __pyx_v_a = (__pyx_v_a / 100.0); /* "pygame_sdl2/color.pyx":321 * a /= 100.0 * * cdef double c = v * s # <<<<<<<<<<<<<< * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = v - c */ __pyx_v_c = (__pyx_v_v * __pyx_v_s); /* "pygame_sdl2/color.pyx":322 * * cdef double c = v * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) # <<<<<<<<<<<<<< * cdef double m = v - c * */ __pyx_v_x = (__pyx_v_c * (1.0 - fabs((__Pyx_mod_double((__pyx_v_h / 60.0), 2.0) - 1.0)))); /* "pygame_sdl2/color.pyx":323 * cdef double c = v * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = v - c # <<<<<<<<<<<<<< * * cdef double r, g, b */ __pyx_v_m = (__pyx_v_v - __pyx_v_c); /* "pygame_sdl2/color.pyx":327 * cdef double r, g, b * * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ __pyx_t_2 = (0.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 60.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":328 * * if 0 <= h < 60: * r, g, b = c, x, 0 # <<<<<<<<<<<<<< * elif 60 <= h < 120: * r, g, b = x, c, 0 */ __pyx_t_12 = __pyx_v_c; __pyx_t_8 = __pyx_v_x; __pyx_t_9 = 0.0; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":327 * cdef double r, g, b * * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":329 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ __pyx_t_2 = (60.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 120.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":330 * r, g, b = c, x, 0 * elif 60 <= h < 120: * r, g, b = x, c, 0 # <<<<<<<<<<<<<< * elif 120 <= h < 180: * r, g, b = 0, c, x */ __pyx_t_9 = __pyx_v_x; __pyx_t_8 = __pyx_v_c; __pyx_t_12 = 0.0; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":329 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":331 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ __pyx_t_2 = (120.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 180.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":332 * r, g, b = x, c, 0 * elif 120 <= h < 180: * r, g, b = 0, c, x # <<<<<<<<<<<<<< * elif 180 <= h < 240: * r, g, b = 0, x, c */ __pyx_t_12 = 0.0; __pyx_t_8 = __pyx_v_c; __pyx_t_9 = __pyx_v_x; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":331 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":333 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ __pyx_t_2 = (180.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 240.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":334 * r, g, b = 0, c, x * elif 180 <= h < 240: * r, g, b = 0, x, c # <<<<<<<<<<<<<< * elif 240 <= h < 300: * r, g, b = x, 0, c */ __pyx_t_9 = 0.0; __pyx_t_8 = __pyx_v_x; __pyx_t_12 = __pyx_v_c; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":333 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":335 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ __pyx_t_2 = (240.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 300.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":336 * r, g, b = 0, x, c * elif 240 <= h < 300: * r, g, b = x, 0, c # <<<<<<<<<<<<<< * elif 300 <= h < 360: * r, g, b = c, 0, x */ __pyx_t_12 = __pyx_v_x; __pyx_t_8 = 0.0; __pyx_t_9 = __pyx_v_c; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":335 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":337 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ __pyx_t_2 = (300.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 360.0); } if (likely(__pyx_t_2)) { /* "pygame_sdl2/color.pyx":338 * r, g, b = x, 0, c * elif 300 <= h < 360: * r, g, b = c, 0, x # <<<<<<<<<<<<<< * else: * raise ValueError() */ __pyx_t_9 = __pyx_v_c; __pyx_t_8 = 0.0; __pyx_t_12 = __pyx_v_x; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":337 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":340 * r, g, b = c, 0, x * else: * raise ValueError() # <<<<<<<<<<<<<< * * self.r = int(255 * (r + m)) */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_builtin_ValueError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 340, __pyx_L1_error) } __pyx_L8:; /* "pygame_sdl2/color.pyx":342 * raise ValueError() * * self.r = int(255 * (r + m)) # <<<<<<<<<<<<<< * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) */ __pyx_v_self->r = ((Uint8)(255.0 * (__pyx_v_r + __pyx_v_m))); /* "pygame_sdl2/color.pyx":343 * * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) # <<<<<<<<<<<<<< * self.b = int(255 * (b + m)) * self.a = int(255 * a) */ __pyx_v_self->g = ((Uint8)(255.0 * (__pyx_v_g + __pyx_v_m))); /* "pygame_sdl2/color.pyx":344 * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) # <<<<<<<<<<<<<< * self.a = int(255 * a) * */ __pyx_v_self->b = ((Uint8)(255.0 * (__pyx_v_b + __pyx_v_m))); /* "pygame_sdl2/color.pyx":345 * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) * self.a = int(255 * a) # <<<<<<<<<<<<<< * * property hsla: */ __pyx_v_self->a = ((Uint8)(255.0 * __pyx_v_a)); /* "pygame_sdl2/color.pyx":306 * return h, s, v, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, v, a * if len(val) == 3: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsva.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":348 * * property hsla: * def __get__(self): # <<<<<<<<<<<<<< * cdef double h, s, l, a * cdef double r, g, b */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsla_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsla_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsla___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsla___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { double __pyx_v_h; double __pyx_v_s; double __pyx_v_l; double __pyx_v_a; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; double __pyx_v_cmin; double __pyx_v_cmax; double __pyx_v_delta; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; double __pyx_t_3; double __pyx_t_4; double __pyx_t_5; double __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/color.pyx":353 * cdef double cmin, cmax, delta * * h = self.hsva[0] % 360.0 # <<<<<<<<<<<<<< * * r = self.r / 255.0 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hsva); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyFloat_RemainderObjC(__pyx_t_2, __pyx_float_360_0, 360.0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_h = __pyx_t_3; /* "pygame_sdl2/color.pyx":355 * h = self.hsva[0] % 360.0 * * r = self.r / 255.0 # <<<<<<<<<<<<<< * g = self.g / 255.0 * b = self.b / 255.0 */ __pyx_v_r = (((double)__pyx_v_self->r) / 255.0); /* "pygame_sdl2/color.pyx":356 * * r = self.r / 255.0 * g = self.g / 255.0 # <<<<<<<<<<<<<< * b = self.b / 255.0 * */ __pyx_v_g = (((double)__pyx_v_self->g) / 255.0); /* "pygame_sdl2/color.pyx":357 * r = self.r / 255.0 * g = self.g / 255.0 * b = self.b / 255.0 # <<<<<<<<<<<<<< * * cmin = min(r, g, b) */ __pyx_v_b = (((double)__pyx_v_self->b) / 255.0); /* "pygame_sdl2/color.pyx":359 * b = self.b / 255.0 * * cmin = min(r, g, b) # <<<<<<<<<<<<<< * cmax = max(r, g, b) * delta = cmax - cmin */ __pyx_t_3 = __pyx_v_g; __pyx_t_4 = __pyx_v_b; __pyx_t_5 = __pyx_v_r; __pyx_t_7 = (__pyx_t_3 < __pyx_t_5); if (__pyx_t_7) { __pyx_t_6 = __pyx_t_3; } else { __pyx_t_6 = __pyx_t_5; } __pyx_t_5 = __pyx_t_6; __pyx_t_7 = (__pyx_t_4 < __pyx_t_5); if (__pyx_t_7) { __pyx_t_6 = __pyx_t_4; } else { __pyx_t_6 = __pyx_t_5; } __pyx_v_cmin = __pyx_t_6; /* "pygame_sdl2/color.pyx":360 * * cmin = min(r, g, b) * cmax = max(r, g, b) # <<<<<<<<<<<<<< * delta = cmax - cmin * */ __pyx_t_6 = __pyx_v_g; __pyx_t_3 = __pyx_v_b; __pyx_t_4 = __pyx_v_r; __pyx_t_7 = (__pyx_t_6 > __pyx_t_4); if (__pyx_t_7) { __pyx_t_5 = __pyx_t_6; } else { __pyx_t_5 = __pyx_t_4; } __pyx_t_4 = __pyx_t_5; __pyx_t_7 = (__pyx_t_3 > __pyx_t_4); if (__pyx_t_7) { __pyx_t_5 = __pyx_t_3; } else { __pyx_t_5 = __pyx_t_4; } __pyx_v_cmax = __pyx_t_5; /* "pygame_sdl2/color.pyx":361 * cmin = min(r, g, b) * cmax = max(r, g, b) * delta = cmax - cmin # <<<<<<<<<<<<<< * * l = (cmax + cmin) / 2.0 */ __pyx_v_delta = (__pyx_v_cmax - __pyx_v_cmin); /* "pygame_sdl2/color.pyx":363 * delta = cmax - cmin * * l = (cmax + cmin) / 2.0 # <<<<<<<<<<<<<< * * if delta == 0: */ __pyx_v_l = ((__pyx_v_cmax + __pyx_v_cmin) / 2.0); /* "pygame_sdl2/color.pyx":365 * l = (cmax + cmin) / 2.0 * * if delta == 0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ __pyx_t_7 = (__pyx_v_delta == 0.0); if (__pyx_t_7) { /* "pygame_sdl2/color.pyx":366 * * if delta == 0: * s = 0.0 # <<<<<<<<<<<<<< * else: * s = delta / (1 - abs(2 * l - 1)) */ __pyx_v_s = 0.0; /* "pygame_sdl2/color.pyx":365 * l = (cmax + cmin) / 2.0 * * if delta == 0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":368 * s = 0.0 * else: * s = delta / (1 - abs(2 * l - 1)) # <<<<<<<<<<<<<< * * a = self.a / 255.0 * 100 */ /*else*/ { __pyx_t_5 = (1.0 - fabs(((2.0 * __pyx_v_l) - 1.0))); if (unlikely(__pyx_t_5 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 368, __pyx_L1_error) } __pyx_v_s = (__pyx_v_delta / __pyx_t_5); } __pyx_L3:; /* "pygame_sdl2/color.pyx":370 * s = delta / (1 - abs(2 * l - 1)) * * a = self.a / 255.0 * 100 # <<<<<<<<<<<<<< * * s = min(100.0, s * 100) */ __pyx_v_a = ((((double)__pyx_v_self->a) / 255.0) * 100.0); /* "pygame_sdl2/color.pyx":372 * a = self.a / 255.0 * 100 * * s = min(100.0, s * 100) # <<<<<<<<<<<<<< * l = min(100.0, l * 100) * */ __pyx_t_5 = (__pyx_v_s * 100.0); __pyx_t_6 = 100.0; __pyx_t_7 = (__pyx_t_5 < __pyx_t_6); if (__pyx_t_7) { __pyx_t_3 = __pyx_t_5; } else { __pyx_t_3 = __pyx_t_6; } __pyx_v_s = __pyx_t_3; /* "pygame_sdl2/color.pyx":373 * * s = min(100.0, s * 100) * l = min(100.0, l * 100) # <<<<<<<<<<<<<< * * return h, s, l, a */ __pyx_t_3 = (__pyx_v_l * 100.0); __pyx_t_5 = 100.0; __pyx_t_7 = (__pyx_t_3 < __pyx_t_5); if (__pyx_t_7) { __pyx_t_6 = __pyx_t_3; } else { __pyx_t_6 = __pyx_t_5; } __pyx_v_l = __pyx_t_6; /* "pygame_sdl2/color.pyx":375 * l = min(100.0, l * 100) * * return h, s, l, a # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = PyFloat_FromDouble(__pyx_v_l); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_9)) __PYX_ERR(0, 375, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":348 * * property hsla: * def __get__(self): # <<<<<<<<<<<<<< * cdef double h, s, l, a * cdef double r, g, b */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsla.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":377 * return h, s, l, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, l, a * if len(val) == 3: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsla_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsla_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { double __pyx_v_h; double __pyx_v_s; double __pyx_v_l; double __pyx_v_a; double __pyx_v_c; double __pyx_v_x; double __pyx_v_m; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); double __pyx_t_8; double __pyx_t_9; double __pyx_t_10; PyObject *__pyx_t_11 = NULL; double __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/color.pyx":379 * def __set__(self, val): * cdef double h, s, l, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, l = val * a = 0.0 */ __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 379, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 3); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":380 * cdef double h, s, l, a * if len(val) == 3: * h, s, l = val # <<<<<<<<<<<<<< * a = 0.0 * else: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 380, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 380, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 380, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_h = __pyx_t_8; __pyx_v_s = __pyx_t_9; __pyx_v_l = __pyx_t_10; /* "pygame_sdl2/color.pyx":381 * if len(val) == 3: * h, s, l = val * a = 0.0 # <<<<<<<<<<<<<< * else: * h, s, l, a = val */ __pyx_v_a = 0.0; /* "pygame_sdl2/color.pyx":379 * def __set__(self, val): * cdef double h, s, l, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, l = val * a = 0.0 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":383 * a = 0.0 * else: * h, s, l, a = val # <<<<<<<<<<<<<< * * s /= 100.0 */ /*else*/ { if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 383, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; __pyx_t_11 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_11); if (unlikely(!item)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_11), 4) < 0) __PYX_ERR(0, 383, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 383, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_h = __pyx_t_10; __pyx_v_s = __pyx_t_9; __pyx_v_l = __pyx_t_8; __pyx_v_a = __pyx_t_12; } __pyx_L3:; /* "pygame_sdl2/color.pyx":385 * h, s, l, a = val * * s /= 100.0 # <<<<<<<<<<<<<< * l /= 100.0 * a /= 100.0 */ __pyx_v_s = (__pyx_v_s / 100.0); /* "pygame_sdl2/color.pyx":386 * * s /= 100.0 * l /= 100.0 # <<<<<<<<<<<<<< * a /= 100.0 * */ __pyx_v_l = (__pyx_v_l / 100.0); /* "pygame_sdl2/color.pyx":387 * s /= 100.0 * l /= 100.0 * a /= 100.0 # <<<<<<<<<<<<<< * * cdef double c = (1 - abs(2*l - 1)) * s */ __pyx_v_a = (__pyx_v_a / 100.0); /* "pygame_sdl2/color.pyx":389 * a /= 100.0 * * cdef double c = (1 - abs(2*l - 1)) * s # <<<<<<<<<<<<<< * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = l - c / 2.0 */ __pyx_v_c = ((1.0 - fabs(((2.0 * __pyx_v_l) - 1.0))) * __pyx_v_s); /* "pygame_sdl2/color.pyx":390 * * cdef double c = (1 - abs(2*l - 1)) * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) # <<<<<<<<<<<<<< * cdef double m = l - c / 2.0 * */ __pyx_v_x = (__pyx_v_c * (1.0 - fabs((__Pyx_mod_double((__pyx_v_h / 60.0), 2.0) - 1.0)))); /* "pygame_sdl2/color.pyx":391 * cdef double c = (1 - abs(2*l - 1)) * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = l - c / 2.0 # <<<<<<<<<<<<<< * * cdef double r, g, b */ __pyx_v_m = (__pyx_v_l - (__pyx_v_c / 2.0)); /* "pygame_sdl2/color.pyx":394 * * cdef double r, g, b * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ __pyx_t_2 = (0.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 60.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":395 * cdef double r, g, b * if 0 <= h < 60: * r, g, b = c, x, 0 # <<<<<<<<<<<<<< * elif 60 <= h < 120: * r, g, b = x, c, 0 */ __pyx_t_12 = __pyx_v_c; __pyx_t_8 = __pyx_v_x; __pyx_t_9 = 0.0; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":394 * * cdef double r, g, b * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":396 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ __pyx_t_2 = (60.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 120.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":397 * r, g, b = c, x, 0 * elif 60 <= h < 120: * r, g, b = x, c, 0 # <<<<<<<<<<<<<< * elif 120 <= h < 180: * r, g, b = 0, c, x */ __pyx_t_9 = __pyx_v_x; __pyx_t_8 = __pyx_v_c; __pyx_t_12 = 0.0; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":396 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":398 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ __pyx_t_2 = (120.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 180.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":399 * r, g, b = x, c, 0 * elif 120 <= h < 180: * r, g, b = 0, c, x # <<<<<<<<<<<<<< * elif 180 <= h < 240: * r, g, b = 0, x, c */ __pyx_t_12 = 0.0; __pyx_t_8 = __pyx_v_c; __pyx_t_9 = __pyx_v_x; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":398 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":400 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ __pyx_t_2 = (180.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 240.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":401 * r, g, b = 0, c, x * elif 180 <= h < 240: * r, g, b = 0, x, c # <<<<<<<<<<<<<< * elif 240 <= h < 300: * r, g, b = x, 0, c */ __pyx_t_9 = 0.0; __pyx_t_8 = __pyx_v_x; __pyx_t_12 = __pyx_v_c; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":400 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":402 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ __pyx_t_2 = (240.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 300.0); } if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":403 * r, g, b = 0, x, c * elif 240 <= h < 300: * r, g, b = x, 0, c # <<<<<<<<<<<<<< * elif 300 <= h < 360: * r, g, b = c, 0, x */ __pyx_t_12 = __pyx_v_x; __pyx_t_8 = 0.0; __pyx_t_9 = __pyx_v_c; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":402 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":404 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ __pyx_t_2 = (300.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 360.0); } if (likely(__pyx_t_2)) { /* "pygame_sdl2/color.pyx":405 * r, g, b = x, 0, c * elif 300 <= h < 360: * r, g, b = c, 0, x # <<<<<<<<<<<<<< * else: * raise ValueError() */ __pyx_t_9 = __pyx_v_c; __pyx_t_8 = 0.0; __pyx_t_12 = __pyx_v_x; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":404 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":407 * r, g, b = c, 0, x * else: * raise ValueError() # <<<<<<<<<<<<<< * * self.r = int(255 * (r + m)) */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_builtin_ValueError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 407, __pyx_L1_error) } __pyx_L8:; /* "pygame_sdl2/color.pyx":409 * raise ValueError() * * self.r = int(255 * (r + m)) # <<<<<<<<<<<<<< * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) */ __pyx_v_self->r = ((Uint8)(255.0 * (__pyx_v_r + __pyx_v_m))); /* "pygame_sdl2/color.pyx":410 * * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) # <<<<<<<<<<<<<< * self.b = int(255 * (b + m)) * self.a = int(255 * a) */ __pyx_v_self->g = ((Uint8)(255.0 * (__pyx_v_g + __pyx_v_m))); /* "pygame_sdl2/color.pyx":411 * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) # <<<<<<<<<<<<<< * self.a = int(255 * a) * */ __pyx_v_self->b = ((Uint8)(255.0 * (__pyx_v_b + __pyx_v_m))); /* "pygame_sdl2/color.pyx":412 * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) * self.a = int(255 * a) # <<<<<<<<<<<<<< * * property i1i2i3: */ __pyx_v_self->a = ((Uint8)(255.0 * __pyx_v_a)); /* "pygame_sdl2/color.pyx":377 * return h, s, l, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, l, a * if len(val) == 3: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsla.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":415 * * property i1i2i3: * def __get__(self): # <<<<<<<<<<<<<< * # Take the dot product as described here: * # http://de.wikipedia.org/wiki/I1I2I3-Farbraum */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { double __pyx_v_i1; double __pyx_v_i2; double __pyx_v_i3; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/color.pyx":422 * cdef double r, g, b * * r = self.r / 255.0 # <<<<<<<<<<<<<< * g = self.g / 255.0 * b = self.b / 255.0 */ __pyx_v_r = (((double)__pyx_v_self->r) / 255.0); /* "pygame_sdl2/color.pyx":423 * * r = self.r / 255.0 * g = self.g / 255.0 # <<<<<<<<<<<<<< * b = self.b / 255.0 * */ __pyx_v_g = (((double)__pyx_v_self->g) / 255.0); /* "pygame_sdl2/color.pyx":424 * r = self.r / 255.0 * g = self.g / 255.0 * b = self.b / 255.0 # <<<<<<<<<<<<<< * * i1 = (r + g + b) / 3.0 */ __pyx_v_b = (((double)__pyx_v_self->b) / 255.0); /* "pygame_sdl2/color.pyx":426 * b = self.b / 255.0 * * i1 = (r + g + b) / 3.0 # <<<<<<<<<<<<<< * i2 = (r - b) / 2.0 * i3 = (2*g - r - b) / 4.0 */ __pyx_v_i1 = (((__pyx_v_r + __pyx_v_g) + __pyx_v_b) / 3.0); /* "pygame_sdl2/color.pyx":427 * * i1 = (r + g + b) / 3.0 * i2 = (r - b) / 2.0 # <<<<<<<<<<<<<< * i3 = (2*g - r - b) / 4.0 * */ __pyx_v_i2 = ((__pyx_v_r - __pyx_v_b) / 2.0); /* "pygame_sdl2/color.pyx":428 * i1 = (r + g + b) / 3.0 * i2 = (r - b) / 2.0 * i3 = (2*g - r - b) / 4.0 # <<<<<<<<<<<<<< * * return i1, i2, i3 */ __pyx_v_i3 = ((((2.0 * __pyx_v_g) - __pyx_v_r) - __pyx_v_b) / 4.0); /* "pygame_sdl2/color.pyx":430 * i3 = (2*g - r - b) / 4.0 * * return i1, i2, i3 # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_i1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_i2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_i3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":415 * * property i1i2i3: * def __get__(self): # <<<<<<<<<<<<<< * # Take the dot product as described here: * # http://de.wikipedia.org/wiki/I1I2I3-Farbraum */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.i1i2i3.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":432 * return i1, i2, i3 * * def __set__(self, val): # <<<<<<<<<<<<<< * # Dot product with the inverted matrix. * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { double __pyx_v_i1; double __pyx_v_i2; double __pyx_v_i3; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); double __pyx_t_6; double __pyx_t_7; double __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/color.pyx":438 * cdef double r, g, b * * i1, i2, i3 = val # <<<<<<<<<<<<<< * * r = i1 + i2 - (2.0/3.0 * i3) */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 438, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) __PYX_ERR(0, 438, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 438, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_i1 = __pyx_t_6; __pyx_v_i2 = __pyx_t_7; __pyx_v_i3 = __pyx_t_8; /* "pygame_sdl2/color.pyx":440 * i1, i2, i3 = val * * r = i1 + i2 - (2.0/3.0 * i3) # <<<<<<<<<<<<<< * g = i1 + (4.0/3.0 * i3) * b = i1 - i2 - (2.0/3.0 * i3) */ __pyx_v_r = ((__pyx_v_i1 + __pyx_v_i2) - ((2.0 / 3.0) * __pyx_v_i3)); /* "pygame_sdl2/color.pyx":441 * * r = i1 + i2 - (2.0/3.0 * i3) * g = i1 + (4.0/3.0 * i3) # <<<<<<<<<<<<<< * b = i1 - i2 - (2.0/3.0 * i3) * */ __pyx_v_g = (__pyx_v_i1 + ((4.0 / 3.0) * __pyx_v_i3)); /* "pygame_sdl2/color.pyx":442 * r = i1 + i2 - (2.0/3.0 * i3) * g = i1 + (4.0/3.0 * i3) * b = i1 - i2 - (2.0/3.0 * i3) # <<<<<<<<<<<<<< * * # Don't change alpha. */ __pyx_v_b = ((__pyx_v_i1 - __pyx_v_i2) - ((2.0 / 3.0) * __pyx_v_i3)); /* "pygame_sdl2/color.pyx":445 * * # Don't change alpha. * self.r = int(r * 255) # <<<<<<<<<<<<<< * self.g = int(g * 255) * self.b = int(b * 255) */ __pyx_v_self->r = ((Uint8)(__pyx_v_r * 255.0)); /* "pygame_sdl2/color.pyx":446 * # Don't change alpha. * self.r = int(r * 255) * self.g = int(g * 255) # <<<<<<<<<<<<<< * self.b = int(b * 255) * */ __pyx_v_self->g = ((Uint8)(__pyx_v_g * 255.0)); /* "pygame_sdl2/color.pyx":447 * self.r = int(r * 255) * self.g = int(g * 255) * self.b = int(b * 255) # <<<<<<<<<<<<<< * * def normalize(self): */ __pyx_v_self->b = ((Uint8)(__pyx_v_b * 255.0)); /* "pygame_sdl2/color.pyx":432 * return i1, i2, i3 * * def __set__(self, val): # <<<<<<<<<<<<<< * # Dot product with the inverted matrix. * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.i1i2i3.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":449 * self.b = int(b * 255) * * def normalize(self): # <<<<<<<<<<<<<< * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_39normalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5color_5Color_38normalize, "Color.normalize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_39normalize = {"normalize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_39normalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_38normalize}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_39normalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normalize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("normalize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "normalize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_38normalize(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_38normalize(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("normalize", 1); /* "pygame_sdl2/color.pyx":450 * * def normalize(self): * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 # <<<<<<<<<<<<<< * * def correct_gamma(self, gamma): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((((double)__pyx_v_self->r) / 255.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble((((double)__pyx_v_self->g) / 255.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble((((double)__pyx_v_self->b) / 255.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyFloat_FromDouble((((double)__pyx_v_self->a) / 255.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":449 * self.b = int(b * 255) * * def normalize(self): # <<<<<<<<<<<<<< * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.normalize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5color_5Color_40correct_gamma, "Color.correct_gamma(self, gamma)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_41correct_gamma = {"correct_gamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_40correct_gamma}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_gamma = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("correct_gamma (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gamma,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gamma)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "correct_gamma") < 0)) __PYX_ERR(0, 452, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_gamma = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("correct_gamma", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 452, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.correct_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_40correct_gamma(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), __pyx_v_gamma); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":453 * * def correct_gamma(self, gamma): * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) # <<<<<<<<<<<<<< * c = type(self)(tuple(m)) * return c */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1 = {"lambda1", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda1") < 0)) __PYX_ERR(0, 453, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_x = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lambda1", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 453, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.correct_gamma.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_cur_scope; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda1", 1); __pyx_outer_scope = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyFloat_TrueDivideObjC(__pyx_v_x, __pyx_float_255_0, 255.0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(!__pyx_cur_scope->__pyx_v_gamma)) { __Pyx_RaiseClosureNameError("gamma"); __PYX_ERR(0, 453, __pyx_L1_error) } __pyx_t_2 = __pyx_cur_scope->__pyx_v_gamma; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Power2(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_255, 0xFF, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_round, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.color.Color.correct_gamma.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_40correct_gamma(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_gamma) { struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_cur_scope; PyObject *__pyx_v_m = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("correct_gamma", 0); __pyx_cur_scope = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 452, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_gamma = __pyx_v_gamma; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_gamma); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_gamma); /* "pygame_sdl2/color.pyx":453 * * def correct_gamma(self, gamma): * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) # <<<<<<<<<<<<<< * c = type(self)(tuple(m)) * return c */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1, 0, __pyx_n_s_correct_gamma_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pygame_sdl2_color, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_Tuple(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_m = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":454 * def correct_gamma(self, gamma): * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) # <<<<<<<<<<<<<< * return c * */ __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_1 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_c = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":455 * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) * return c # <<<<<<<<<<<<<< * * def set_length(self, n): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_c); __pyx_r = __pyx_v_c; goto __pyx_L0; /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.correct_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_m); __Pyx_XDECREF(__pyx_v_c); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":457 * return c * * def set_length(self, n): # <<<<<<<<<<<<<< * if n > 4 or n < 1: * raise ValueError(n) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_43set_length(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5color_5Color_42set_length, "Color.set_length(self, n)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_43set_length = {"set_length", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_43set_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_42set_length}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_43set_length(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_n = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_length (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_length") < 0)) __PYX_ERR(0, 457, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_n = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_length", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 457, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.color.Color.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_42set_length(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), __pyx_v_n); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_42set_length(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_n) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; uint8_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_length", 1); /* "pygame_sdl2/color.pyx":458 * * def set_length(self, n): * if n > 4 or n < 1: # <<<<<<<<<<<<<< * raise ValueError(n) * self.length = n */ __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_int_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/color.pyx":459 * def set_length(self, n): * if n > 4 or n < 1: * raise ValueError(n) # <<<<<<<<<<<<<< * self.length = n */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 459, __pyx_L1_error) /* "pygame_sdl2/color.pyx":458 * * def set_length(self, n): * if n > 4 or n < 1: # <<<<<<<<<<<<<< * raise ValueError(n) * self.length = n */ } /* "pygame_sdl2/color.pyx":460 * if n > 4 or n < 1: * raise ValueError(n) * self.length = n # <<<<<<<<<<<<<< */ __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_v_n); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_v_self->length = __pyx_t_4; /* "pygame_sdl2/color.pyx":457 * return c * * def set_length(self, n): # <<<<<<<<<<<<<< * if n > 4 or n < 1: * raise ValueError(n) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pxd":30 * cdef object __weakref__ * * cdef public Uint8 r, g, b, a # <<<<<<<<<<<<<< * cdef uint8_t length * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1r_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1r_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1r___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1r___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.r.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1r_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1r_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1r_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1r_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_self->r = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.r.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1g_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1g_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1g___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1g___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.g.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1g_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1g_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1g_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1g_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_self->g = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.g.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1b_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1b_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1b___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1b___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.b.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1b_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1b_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1b_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1b_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_self->b = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.b.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1a_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1a_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1a___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1a___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.a.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1a_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1a_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1a_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1a_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_self->a = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.a.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color __pyx_vtable_11pygame_sdl2_5color_Color; static PyObject *__pyx_tp_new_11pygame_sdl2_5color_Color(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_5color_Color *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_5color_Color; if (unlikely(__pyx_pw_11pygame_sdl2_5color_5Color_3__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_5color_Color(PyObject *o) { struct __pyx_obj_11pygame_sdl2_5color_Color *p = (struct __pyx_obj_11pygame_sdl2_5color_Color *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_5color_Color) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_sq_item_11pygame_sdl2_5color_Color(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_11pygame_sdl2_5color_Color(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_21__setitem__(o, i, v); } else { __Pyx_TypeName o_type_name; o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); return -1; } } static CYTHON_INLINE PyObject *__pyx_nb_add_11pygame_sdl2_5color_Color_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_add : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_add); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_add_11pygame_sdl2_5color_Color(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_add == &__pyx_nb_add_11pygame_sdl2_5color_Color) #endif || __Pyx_TypeCheck(left, __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_11pygame_sdl2_5color_5Color_29__add__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_add == &__pyx_nb_add_11pygame_sdl2_5color_Color) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_right) { return __pyx_nb_add_11pygame_sdl2_5color_Color_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_11pygame_sdl2_5color_Color, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } static CYTHON_INLINE PyObject *__pyx_nb_subtract_11pygame_sdl2_5color_Color_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_subtract : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_subtract); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_subtract_11pygame_sdl2_5color_Color(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_subtract == &__pyx_nb_subtract_11pygame_sdl2_5color_Color) #endif || __Pyx_TypeCheck(left, __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_11pygame_sdl2_5color_5Color_31__sub__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_subtract == &__pyx_nb_subtract_11pygame_sdl2_5color_Color) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_right) { return __pyx_nb_subtract_11pygame_sdl2_5color_Color_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_11pygame_sdl2_5color_Color, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } static CYTHON_INLINE PyObject *__pyx_nb_multiply_11pygame_sdl2_5color_Color_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_multiply : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_multiply); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_multiply_11pygame_sdl2_5color_Color(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_multiply == &__pyx_nb_multiply_11pygame_sdl2_5color_Color) #endif || __Pyx_TypeCheck(left, __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_11pygame_sdl2_5color_5Color_27__mul__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_multiply == &__pyx_nb_multiply_11pygame_sdl2_5color_Color) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_right) { return __pyx_nb_multiply_11pygame_sdl2_5color_Color_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_11pygame_sdl2_5color_Color, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static CYTHON_INLINE PyObject *__pyx_nb_divide_11pygame_sdl2_5color_Color_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_divide : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_divide); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_divide_11pygame_sdl2_5color_Color(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_divide == &__pyx_nb_divide_11pygame_sdl2_5color_Color) #endif || __Pyx_TypeCheck(left, __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_11pygame_sdl2_5color_5Color_35__div__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_divide == &__pyx_nb_divide_11pygame_sdl2_5color_Color) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_right) { return __pyx_nb_divide_11pygame_sdl2_5color_Color_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_11pygame_sdl2_5color_Color, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } #endif static CYTHON_INLINE PyObject *__pyx_nb_remainder_11pygame_sdl2_5color_Color_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_remainder : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_remainder); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_remainder_11pygame_sdl2_5color_Color(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_remainder == &__pyx_nb_remainder_11pygame_sdl2_5color_Color) #endif || __Pyx_TypeCheck(left, __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_11pygame_sdl2_5color_5Color_33__mod__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_remainder == &__pyx_nb_remainder_11pygame_sdl2_5color_Color) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_right) { return __pyx_nb_remainder_11pygame_sdl2_5color_Color_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_11pygame_sdl2_5color_Color, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } static CYTHON_INLINE PyObject *__pyx_nb_floor_divide_11pygame_sdl2_5color_Color_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) { binaryfunc slot; #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY slot = type->tp_as_number ? type->tp_as_number->nb_floor_divide : NULL; #else slot = (binaryfunc) PyType_GetSlot(type, Py_nb_floor_divide); #endif return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_nb_floor_divide_11pygame_sdl2_5color_Color(PyObject *left, PyObject *right ) { int maybe_self_is_left, maybe_self_is_right = 0; maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_floor_divide == &__pyx_nb_floor_divide_11pygame_sdl2_5color_Color) #endif || __Pyx_TypeCheck(left, __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_left) { PyObject *res; res = __pyx_pw_11pygame_sdl2_5color_5Color_37__floordiv__(left, right); if (res != Py_NotImplemented) return res; Py_DECREF(res); } maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right) #if CYTHON_USE_TYPE_SLOTS || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_floor_divide == &__pyx_nb_floor_divide_11pygame_sdl2_5color_Color) #endif || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_11pygame_sdl2_5color_Color); if (maybe_self_is_right) { return __pyx_nb_floor_divide_11pygame_sdl2_5color_Color_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_11pygame_sdl2_5color_Color, tp_base, PyTypeObject*), left, right ); } return __Pyx_NewRef(Py_NotImplemented); } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_cmy(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_cmy(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_hsva(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_hsva(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_hsla(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_hsla(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_i1i2i3(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_i1i2i3(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_r(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1r_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_r(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1r_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_g(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1g_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_g(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1g_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_b(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1b_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_b(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1b_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_a(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1a_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_a(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1a_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_specialmethod___pyx_pw_11pygame_sdl2_5color_5Color_7__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __pyx_pw_11pygame_sdl2_5color_5Color_7__repr__(self); } static PyMethodDef __pyx_methods_11pygame_sdl2_5color_Color[] = { {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_11pygame_sdl2_5color_5Color_7__repr__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_16__reduce__}, {"__setstate__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_18__setstate__}, {"normalize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_39normalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_38normalize}, {"correct_gamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_40correct_gamma}, {"set_length", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5color_5Color_43set_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5color_5Color_42set_length}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_5color_Color[] = { {(char *)"cmy", __pyx_getprop_11pygame_sdl2_5color_5Color_cmy, __pyx_setprop_11pygame_sdl2_5color_5Color_cmy, (char *)0, 0}, {(char *)"hsva", __pyx_getprop_11pygame_sdl2_5color_5Color_hsva, __pyx_setprop_11pygame_sdl2_5color_5Color_hsva, (char *)0, 0}, {(char *)"hsla", __pyx_getprop_11pygame_sdl2_5color_5Color_hsla, __pyx_setprop_11pygame_sdl2_5color_5Color_hsla, (char *)0, 0}, {(char *)"i1i2i3", __pyx_getprop_11pygame_sdl2_5color_5Color_i1i2i3, __pyx_setprop_11pygame_sdl2_5color_5Color_i1i2i3, (char *)0, 0}, {(char *)"r", __pyx_getprop_11pygame_sdl2_5color_5Color_r, __pyx_setprop_11pygame_sdl2_5color_5Color_r, (char *)PyDoc_STR("r: 'Uint8'"), 0}, {(char *)"g", __pyx_getprop_11pygame_sdl2_5color_5Color_g, __pyx_setprop_11pygame_sdl2_5color_5Color_g, (char *)PyDoc_STR("g: 'Uint8'"), 0}, {(char *)"b", __pyx_getprop_11pygame_sdl2_5color_5Color_b, __pyx_setprop_11pygame_sdl2_5color_5Color_b, (char *)PyDoc_STR("b: 'Uint8'"), 0}, {(char *)"a", __pyx_getprop_11pygame_sdl2_5color_5Color_a, __pyx_setprop_11pygame_sdl2_5color_5Color_a, (char *)PyDoc_STR("a: 'Uint8'"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_5color_Color_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_5color_Color}, {Py_tp_repr, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_7__repr__}, {Py_nb_add, (void *)__pyx_nb_add_11pygame_sdl2_5color_Color}, {Py_nb_subtract, (void *)__pyx_nb_subtract_11pygame_sdl2_5color_Color}, {Py_nb_multiply, (void *)__pyx_nb_multiply_11pygame_sdl2_5color_Color}, #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) {Py_nb_divide, (void *)__pyx_nb_divide_11pygame_sdl2_5color_Color}, #endif {Py_nb_remainder, (void *)__pyx_nb_remainder_11pygame_sdl2_5color_Color}, {Py_nb_int, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_9__int__}, #if PY_MAJOR_VERSION < 3 {Py_nb_long, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_9__int__}, #endif {Py_nb_float, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_15__float__}, #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) {Py_nb_oct, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_13__oct__}, #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) {Py_nb_hex, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_11__hex__}, #endif {Py_nb_floor_divide, (void *)__pyx_nb_floor_divide_11pygame_sdl2_5color_Color}, {Py_sq_length, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_25__len__}, {Py_sq_item, (void *)__pyx_sq_item_11pygame_sdl2_5color_Color}, {Py_mp_length, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_25__len__}, {Py_mp_subscript, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_11pygame_sdl2_5color_Color}, {Py_tp_doc, (void *)PyDoc_STR("Color(*args)")}, {Py_tp_richcompare, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_5color_Color}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_5color_Color}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_5color_5Color_5__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_5color_Color}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_5color_Color_spec = { "pygame_sdl2.color.Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_5color_Color_slots, }; #else static PyNumberMethods __pyx_tp_as_number_Color = { __pyx_nb_add_11pygame_sdl2_5color_Color, /*nb_add*/ __pyx_nb_subtract_11pygame_sdl2_5color_Color, /*nb_subtract*/ __pyx_nb_multiply_11pygame_sdl2_5color_Color, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_nb_divide_11pygame_sdl2_5color_Color, /*nb_divide*/ #endif __pyx_nb_remainder_11pygame_sdl2_5color_Color, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_bool*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_9__int__, /*nb_int*/ #if PY_MAJOR_VERSION < 3 __pyx_pw_11pygame_sdl2_5color_5Color_9__int__, /*nb_long*/ #else 0, /*reserved*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_15__float__, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_pw_11pygame_sdl2_5color_5Color_13__oct__, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_pw_11pygame_sdl2_5color_5Color_11__hex__, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ __pyx_nb_floor_divide_11pygame_sdl2_5color_Color, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_Color = { __pyx_pw_11pygame_sdl2_5color_5Color_25__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_5color_Color, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Color = { __pyx_pw_11pygame_sdl2_5color_5Color_25__len__, /*mp_length*/ __pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_11pygame_sdl2_5color_Color, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_5color_Color = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.color.""Color", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5color_Color, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_7__repr__, /*tp_repr*/ &__pyx_tp_as_number_Color, /*tp_as_number*/ &__pyx_tp_as_sequence_Color, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Color, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Color(*args)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ __pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5color_Color, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_5color_Color, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5color_Color, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_freelist_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma[8]; static int __pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = 0; #endif static PyObject *__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)))) { o = (PyObject*)__pyx_freelist_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma[--__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma]; memset(o, 0, sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyObject *o) { struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *p = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_gamma); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)))) { __pyx_freelist_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma[__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma++] = ((struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *p = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o; if (p->__pyx_v_gamma) { e = (*v)(p->__pyx_v_gamma, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *p = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o; tmp = ((PyObject*)p->__pyx_v_gamma); p->__pyx_v_gamma = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma_spec = { "pygame_sdl2.color.__pyx_scope_struct__correct_gamma", sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.color.""__pyx_scope_struct__correct_gamma", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_08x, __pyx_k_08x, sizeof(__pyx_k_08x), 0, 0, 1, 0}, {&__pyx_kp_s_0x, __pyx_k_0x, sizeof(__pyx_k_0x), 0, 0, 1, 0}, {&__pyx_n_s_BBB, __pyx_k_BBB, sizeof(__pyx_k_BBB), 0, 0, 1, 1}, {&__pyx_n_s_BBBB, __pyx_k_BBBB, sizeof(__pyx_k_BBBB), 0, 0, 1, 1}, {&__pyx_n_s_Color, __pyx_k_Color, sizeof(__pyx_k_Color), 0, 0, 1, 1}, {&__pyx_n_s_Color___reduce, __pyx_k_Color___reduce, sizeof(__pyx_k_Color___reduce), 0, 0, 1, 1}, {&__pyx_n_s_Color___setstate, __pyx_k_Color___setstate, sizeof(__pyx_k_Color___setstate), 0, 0, 1, 1}, {&__pyx_n_s_Color_correct_gamma, __pyx_k_Color_correct_gamma, sizeof(__pyx_k_Color_correct_gamma), 0, 0, 1, 1}, {&__pyx_n_s_Color_from_hex_locals_lambda, __pyx_k_Color_from_hex_locals_lambda, sizeof(__pyx_k_Color_from_hex_locals_lambda), 0, 0, 1, 1}, {&__pyx_n_s_Color_normalize, __pyx_k_Color_normalize, sizeof(__pyx_k_Color_normalize), 0, 0, 1, 1}, {&__pyx_n_s_Color_set_length, __pyx_k_Color_set_length, sizeof(__pyx_k_Color_set_length), 0, 0, 1, 1}, {&__pyx_kp_s_Expected_a_color, __pyx_k_Expected_a_color, sizeof(__pyx_k_Expected_a_color), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_kp_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, {&__pyx_n_s__523, __pyx_k__523, sizeof(__pyx_k__523), 0, 0, 1, 1}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_aliceblue, __pyx_k_aliceblue, sizeof(__pyx_k_aliceblue), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite, __pyx_k_antiquewhite, sizeof(__pyx_k_antiquewhite), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite1, __pyx_k_antiquewhite1, sizeof(__pyx_k_antiquewhite1), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite2, __pyx_k_antiquewhite2, sizeof(__pyx_k_antiquewhite2), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite3, __pyx_k_antiquewhite3, sizeof(__pyx_k_antiquewhite3), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite4, __pyx_k_antiquewhite4, sizeof(__pyx_k_antiquewhite4), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine, __pyx_k_aquamarine, sizeof(__pyx_k_aquamarine), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine1, __pyx_k_aquamarine1, sizeof(__pyx_k_aquamarine1), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine2, __pyx_k_aquamarine2, sizeof(__pyx_k_aquamarine2), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine3, __pyx_k_aquamarine3, sizeof(__pyx_k_aquamarine3), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine4, __pyx_k_aquamarine4, sizeof(__pyx_k_aquamarine4), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_azure, __pyx_k_azure, sizeof(__pyx_k_azure), 0, 0, 1, 1}, {&__pyx_n_s_azure1, __pyx_k_azure1, sizeof(__pyx_k_azure1), 0, 0, 1, 1}, {&__pyx_n_s_azure2, __pyx_k_azure2, sizeof(__pyx_k_azure2), 0, 0, 1, 1}, {&__pyx_n_s_azure3, __pyx_k_azure3, sizeof(__pyx_k_azure3), 0, 0, 1, 1}, {&__pyx_n_s_azure4, __pyx_k_azure4, sizeof(__pyx_k_azure4), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_beige, __pyx_k_beige, sizeof(__pyx_k_beige), 0, 0, 1, 1}, {&__pyx_n_s_binascii, __pyx_k_binascii, sizeof(__pyx_k_binascii), 0, 0, 1, 1}, {&__pyx_n_s_bisque, __pyx_k_bisque, sizeof(__pyx_k_bisque), 0, 0, 1, 1}, {&__pyx_n_s_bisque1, __pyx_k_bisque1, sizeof(__pyx_k_bisque1), 0, 0, 1, 1}, {&__pyx_n_s_bisque2, __pyx_k_bisque2, sizeof(__pyx_k_bisque2), 0, 0, 1, 1}, {&__pyx_n_s_bisque3, __pyx_k_bisque3, sizeof(__pyx_k_bisque3), 0, 0, 1, 1}, {&__pyx_n_s_bisque4, __pyx_k_bisque4, sizeof(__pyx_k_bisque4), 0, 0, 1, 1}, {&__pyx_n_s_black, __pyx_k_black, sizeof(__pyx_k_black), 0, 0, 1, 1}, {&__pyx_n_s_blanchedalmond, __pyx_k_blanchedalmond, sizeof(__pyx_k_blanchedalmond), 0, 0, 1, 1}, {&__pyx_n_s_blue, __pyx_k_blue, sizeof(__pyx_k_blue), 0, 0, 1, 1}, {&__pyx_n_s_blue1, __pyx_k_blue1, sizeof(__pyx_k_blue1), 0, 0, 1, 1}, {&__pyx_n_s_blue2, __pyx_k_blue2, sizeof(__pyx_k_blue2), 0, 0, 1, 1}, {&__pyx_n_s_blue3, __pyx_k_blue3, sizeof(__pyx_k_blue3), 0, 0, 1, 1}, {&__pyx_n_s_blue4, __pyx_k_blue4, sizeof(__pyx_k_blue4), 0, 0, 1, 1}, {&__pyx_n_s_blueviolet, __pyx_k_blueviolet, sizeof(__pyx_k_blueviolet), 0, 0, 1, 1}, {&__pyx_n_s_brown, __pyx_k_brown, sizeof(__pyx_k_brown), 0, 0, 1, 1}, {&__pyx_n_s_brown1, __pyx_k_brown1, sizeof(__pyx_k_brown1), 0, 0, 1, 1}, {&__pyx_n_s_brown2, __pyx_k_brown2, sizeof(__pyx_k_brown2), 0, 0, 1, 1}, {&__pyx_n_s_brown3, __pyx_k_brown3, sizeof(__pyx_k_brown3), 0, 0, 1, 1}, {&__pyx_n_s_brown4, __pyx_k_brown4, sizeof(__pyx_k_brown4), 0, 0, 1, 1}, {&__pyx_n_s_burlywood, __pyx_k_burlywood, sizeof(__pyx_k_burlywood), 0, 0, 1, 1}, {&__pyx_n_s_burlywood1, __pyx_k_burlywood1, sizeof(__pyx_k_burlywood1), 0, 0, 1, 1}, {&__pyx_n_s_burlywood2, __pyx_k_burlywood2, sizeof(__pyx_k_burlywood2), 0, 0, 1, 1}, {&__pyx_n_s_burlywood3, __pyx_k_burlywood3, sizeof(__pyx_k_burlywood3), 0, 0, 1, 1}, {&__pyx_n_s_burlywood4, __pyx_k_burlywood4, sizeof(__pyx_k_burlywood4), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue, __pyx_k_cadetblue, sizeof(__pyx_k_cadetblue), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue1, __pyx_k_cadetblue1, sizeof(__pyx_k_cadetblue1), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue2, __pyx_k_cadetblue2, sizeof(__pyx_k_cadetblue2), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue3, __pyx_k_cadetblue3, sizeof(__pyx_k_cadetblue3), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue4, __pyx_k_cadetblue4, sizeof(__pyx_k_cadetblue4), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse, __pyx_k_chartreuse, sizeof(__pyx_k_chartreuse), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse1, __pyx_k_chartreuse1, sizeof(__pyx_k_chartreuse1), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse2, __pyx_k_chartreuse2, sizeof(__pyx_k_chartreuse2), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse3, __pyx_k_chartreuse3, sizeof(__pyx_k_chartreuse3), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse4, __pyx_k_chartreuse4, sizeof(__pyx_k_chartreuse4), 0, 0, 1, 1}, {&__pyx_n_s_chocolate, __pyx_k_chocolate, sizeof(__pyx_k_chocolate), 0, 0, 1, 1}, {&__pyx_n_s_chocolate1, __pyx_k_chocolate1, sizeof(__pyx_k_chocolate1), 0, 0, 1, 1}, {&__pyx_n_s_chocolate2, __pyx_k_chocolate2, sizeof(__pyx_k_chocolate2), 0, 0, 1, 1}, {&__pyx_n_s_chocolate3, __pyx_k_chocolate3, sizeof(__pyx_k_chocolate3), 0, 0, 1, 1}, {&__pyx_n_s_chocolate4, __pyx_k_chocolate4, sizeof(__pyx_k_chocolate4), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_coral, __pyx_k_coral, sizeof(__pyx_k_coral), 0, 0, 1, 1}, {&__pyx_n_s_coral1, __pyx_k_coral1, sizeof(__pyx_k_coral1), 0, 0, 1, 1}, {&__pyx_n_s_coral2, __pyx_k_coral2, sizeof(__pyx_k_coral2), 0, 0, 1, 1}, {&__pyx_n_s_coral3, __pyx_k_coral3, sizeof(__pyx_k_coral3), 0, 0, 1, 1}, {&__pyx_n_s_coral4, __pyx_k_coral4, sizeof(__pyx_k_coral4), 0, 0, 1, 1}, {&__pyx_n_s_cornflowerblue, __pyx_k_cornflowerblue, sizeof(__pyx_k_cornflowerblue), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk, __pyx_k_cornsilk, sizeof(__pyx_k_cornsilk), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk1, __pyx_k_cornsilk1, sizeof(__pyx_k_cornsilk1), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk2, __pyx_k_cornsilk2, sizeof(__pyx_k_cornsilk2), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk3, __pyx_k_cornsilk3, sizeof(__pyx_k_cornsilk3), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk4, __pyx_k_cornsilk4, sizeof(__pyx_k_cornsilk4), 0, 0, 1, 1}, {&__pyx_n_s_correct_gamma, __pyx_k_correct_gamma, sizeof(__pyx_k_correct_gamma), 0, 0, 1, 1}, {&__pyx_n_s_correct_gamma_locals_lambda, __pyx_k_correct_gamma_locals_lambda, sizeof(__pyx_k_correct_gamma_locals_lambda), 0, 0, 1, 1}, {&__pyx_n_s_cyan, __pyx_k_cyan, sizeof(__pyx_k_cyan), 0, 0, 1, 1}, {&__pyx_n_s_cyan1, __pyx_k_cyan1, sizeof(__pyx_k_cyan1), 0, 0, 1, 1}, {&__pyx_n_s_cyan2, __pyx_k_cyan2, sizeof(__pyx_k_cyan2), 0, 0, 1, 1}, {&__pyx_n_s_cyan3, __pyx_k_cyan3, sizeof(__pyx_k_cyan3), 0, 0, 1, 1}, {&__pyx_n_s_cyan4, __pyx_k_cyan4, sizeof(__pyx_k_cyan4), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_darkblue, __pyx_k_darkblue, sizeof(__pyx_k_darkblue), 0, 0, 1, 1}, {&__pyx_n_s_darkcyan, __pyx_k_darkcyan, sizeof(__pyx_k_darkcyan), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod, __pyx_k_darkgoldenrod, sizeof(__pyx_k_darkgoldenrod), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod1, __pyx_k_darkgoldenrod1, sizeof(__pyx_k_darkgoldenrod1), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod2, __pyx_k_darkgoldenrod2, sizeof(__pyx_k_darkgoldenrod2), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod3, __pyx_k_darkgoldenrod3, sizeof(__pyx_k_darkgoldenrod3), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod4, __pyx_k_darkgoldenrod4, sizeof(__pyx_k_darkgoldenrod4), 0, 0, 1, 1}, {&__pyx_n_s_darkgray, __pyx_k_darkgray, sizeof(__pyx_k_darkgray), 0, 0, 1, 1}, {&__pyx_n_s_darkgreen, __pyx_k_darkgreen, sizeof(__pyx_k_darkgreen), 0, 0, 1, 1}, {&__pyx_n_s_darkgrey, __pyx_k_darkgrey, sizeof(__pyx_k_darkgrey), 0, 0, 1, 1}, {&__pyx_n_s_darkkhaki, __pyx_k_darkkhaki, sizeof(__pyx_k_darkkhaki), 0, 0, 1, 1}, {&__pyx_n_s_darkmagenta, __pyx_k_darkmagenta, sizeof(__pyx_k_darkmagenta), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen, __pyx_k_darkolivegreen, sizeof(__pyx_k_darkolivegreen), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen1, __pyx_k_darkolivegreen1, sizeof(__pyx_k_darkolivegreen1), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen2, __pyx_k_darkolivegreen2, sizeof(__pyx_k_darkolivegreen2), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen3, __pyx_k_darkolivegreen3, sizeof(__pyx_k_darkolivegreen3), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen4, __pyx_k_darkolivegreen4, sizeof(__pyx_k_darkolivegreen4), 0, 0, 1, 1}, {&__pyx_n_s_darkorange, __pyx_k_darkorange, sizeof(__pyx_k_darkorange), 0, 0, 1, 1}, {&__pyx_n_s_darkorange1, __pyx_k_darkorange1, sizeof(__pyx_k_darkorange1), 0, 0, 1, 1}, {&__pyx_n_s_darkorange2, __pyx_k_darkorange2, sizeof(__pyx_k_darkorange2), 0, 0, 1, 1}, {&__pyx_n_s_darkorange3, __pyx_k_darkorange3, sizeof(__pyx_k_darkorange3), 0, 0, 1, 1}, {&__pyx_n_s_darkorange4, __pyx_k_darkorange4, sizeof(__pyx_k_darkorange4), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid, __pyx_k_darkorchid, sizeof(__pyx_k_darkorchid), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid1, __pyx_k_darkorchid1, sizeof(__pyx_k_darkorchid1), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid2, __pyx_k_darkorchid2, sizeof(__pyx_k_darkorchid2), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid3, __pyx_k_darkorchid3, sizeof(__pyx_k_darkorchid3), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid4, __pyx_k_darkorchid4, sizeof(__pyx_k_darkorchid4), 0, 0, 1, 1}, {&__pyx_n_s_darkred, __pyx_k_darkred, sizeof(__pyx_k_darkred), 0, 0, 1, 1}, {&__pyx_n_s_darksalmon, __pyx_k_darksalmon, sizeof(__pyx_k_darksalmon), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen, __pyx_k_darkseagreen, sizeof(__pyx_k_darkseagreen), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen1, __pyx_k_darkseagreen1, sizeof(__pyx_k_darkseagreen1), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen2, __pyx_k_darkseagreen2, sizeof(__pyx_k_darkseagreen2), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen3, __pyx_k_darkseagreen3, sizeof(__pyx_k_darkseagreen3), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen4, __pyx_k_darkseagreen4, sizeof(__pyx_k_darkseagreen4), 0, 0, 1, 1}, {&__pyx_n_s_darkslateblue, __pyx_k_darkslateblue, sizeof(__pyx_k_darkslateblue), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray, __pyx_k_darkslategray, sizeof(__pyx_k_darkslategray), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray1, __pyx_k_darkslategray1, sizeof(__pyx_k_darkslategray1), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray2, __pyx_k_darkslategray2, sizeof(__pyx_k_darkslategray2), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray3, __pyx_k_darkslategray3, sizeof(__pyx_k_darkslategray3), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray4, __pyx_k_darkslategray4, sizeof(__pyx_k_darkslategray4), 0, 0, 1, 1}, {&__pyx_n_s_darkslategrey, __pyx_k_darkslategrey, sizeof(__pyx_k_darkslategrey), 0, 0, 1, 1}, {&__pyx_n_s_darkturquoise, __pyx_k_darkturquoise, sizeof(__pyx_k_darkturquoise), 0, 0, 1, 1}, {&__pyx_n_s_darkviolet, __pyx_k_darkviolet, sizeof(__pyx_k_darkviolet), 0, 0, 1, 1}, {&__pyx_n_s_debianred, __pyx_k_debianred, sizeof(__pyx_k_debianred), 0, 0, 1, 1}, {&__pyx_n_s_deeppink, __pyx_k_deeppink, sizeof(__pyx_k_deeppink), 0, 0, 1, 1}, {&__pyx_n_s_deeppink1, __pyx_k_deeppink1, sizeof(__pyx_k_deeppink1), 0, 0, 1, 1}, {&__pyx_n_s_deeppink2, __pyx_k_deeppink2, sizeof(__pyx_k_deeppink2), 0, 0, 1, 1}, {&__pyx_n_s_deeppink3, __pyx_k_deeppink3, sizeof(__pyx_k_deeppink3), 0, 0, 1, 1}, {&__pyx_n_s_deeppink4, __pyx_k_deeppink4, sizeof(__pyx_k_deeppink4), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue, __pyx_k_deepskyblue, sizeof(__pyx_k_deepskyblue), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue1, __pyx_k_deepskyblue1, sizeof(__pyx_k_deepskyblue1), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue2, __pyx_k_deepskyblue2, sizeof(__pyx_k_deepskyblue2), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue3, __pyx_k_deepskyblue3, sizeof(__pyx_k_deepskyblue3), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue4, __pyx_k_deepskyblue4, sizeof(__pyx_k_deepskyblue4), 0, 0, 1, 1}, {&__pyx_n_s_dimgray, __pyx_k_dimgray, sizeof(__pyx_k_dimgray), 0, 0, 1, 1}, {&__pyx_n_s_dimgrey, __pyx_k_dimgrey, sizeof(__pyx_k_dimgrey), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_div, __pyx_k_div, sizeof(__pyx_k_div), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue, __pyx_k_dodgerblue, sizeof(__pyx_k_dodgerblue), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue1, __pyx_k_dodgerblue1, sizeof(__pyx_k_dodgerblue1), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue2, __pyx_k_dodgerblue2, sizeof(__pyx_k_dodgerblue2), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue3, __pyx_k_dodgerblue3, sizeof(__pyx_k_dodgerblue3), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue4, __pyx_k_dodgerblue4, sizeof(__pyx_k_dodgerblue4), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_firebrick, __pyx_k_firebrick, sizeof(__pyx_k_firebrick), 0, 0, 1, 1}, {&__pyx_n_s_firebrick1, __pyx_k_firebrick1, sizeof(__pyx_k_firebrick1), 0, 0, 1, 1}, {&__pyx_n_s_firebrick2, __pyx_k_firebrick2, sizeof(__pyx_k_firebrick2), 0, 0, 1, 1}, {&__pyx_n_s_firebrick3, __pyx_k_firebrick3, sizeof(__pyx_k_firebrick3), 0, 0, 1, 1}, {&__pyx_n_s_firebrick4, __pyx_k_firebrick4, sizeof(__pyx_k_firebrick4), 0, 0, 1, 1}, {&__pyx_n_s_floordiv___locals_div, __pyx_k_floordiv___locals_div, sizeof(__pyx_k_floordiv___locals_div), 0, 0, 1, 1}, {&__pyx_n_s_floralwhite, __pyx_k_floralwhite, sizeof(__pyx_k_floralwhite), 0, 0, 1, 1}, {&__pyx_n_s_forestgreen, __pyx_k_forestgreen, sizeof(__pyx_k_forestgreen), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_gainsboro, __pyx_k_gainsboro, sizeof(__pyx_k_gainsboro), 0, 0, 1, 1}, {&__pyx_n_s_gamma, __pyx_k_gamma, sizeof(__pyx_k_gamma), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_ghostwhite, __pyx_k_ghostwhite, sizeof(__pyx_k_ghostwhite), 0, 0, 1, 1}, {&__pyx_n_s_gold, __pyx_k_gold, sizeof(__pyx_k_gold), 0, 0, 1, 1}, {&__pyx_n_s_gold1, __pyx_k_gold1, sizeof(__pyx_k_gold1), 0, 0, 1, 1}, {&__pyx_n_s_gold2, __pyx_k_gold2, sizeof(__pyx_k_gold2), 0, 0, 1, 1}, {&__pyx_n_s_gold3, __pyx_k_gold3, sizeof(__pyx_k_gold3), 0, 0, 1, 1}, {&__pyx_n_s_gold4, __pyx_k_gold4, sizeof(__pyx_k_gold4), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod, __pyx_k_goldenrod, sizeof(__pyx_k_goldenrod), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod1, __pyx_k_goldenrod1, sizeof(__pyx_k_goldenrod1), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod2, __pyx_k_goldenrod2, sizeof(__pyx_k_goldenrod2), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod3, __pyx_k_goldenrod3, sizeof(__pyx_k_goldenrod3), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod4, __pyx_k_goldenrod4, sizeof(__pyx_k_goldenrod4), 0, 0, 1, 1}, {&__pyx_n_s_gray, __pyx_k_gray, sizeof(__pyx_k_gray), 0, 0, 1, 1}, {&__pyx_n_s_gray0, __pyx_k_gray0, sizeof(__pyx_k_gray0), 0, 0, 1, 1}, {&__pyx_n_s_gray1, __pyx_k_gray1, sizeof(__pyx_k_gray1), 0, 0, 1, 1}, {&__pyx_n_s_gray10, __pyx_k_gray10, sizeof(__pyx_k_gray10), 0, 0, 1, 1}, {&__pyx_n_s_gray100, __pyx_k_gray100, sizeof(__pyx_k_gray100), 0, 0, 1, 1}, {&__pyx_n_s_gray11, __pyx_k_gray11, sizeof(__pyx_k_gray11), 0, 0, 1, 1}, {&__pyx_n_s_gray12, __pyx_k_gray12, sizeof(__pyx_k_gray12), 0, 0, 1, 1}, {&__pyx_n_s_gray13, __pyx_k_gray13, sizeof(__pyx_k_gray13), 0, 0, 1, 1}, {&__pyx_n_s_gray14, __pyx_k_gray14, sizeof(__pyx_k_gray14), 0, 0, 1, 1}, {&__pyx_n_s_gray15, __pyx_k_gray15, sizeof(__pyx_k_gray15), 0, 0, 1, 1}, {&__pyx_n_s_gray16, __pyx_k_gray16, sizeof(__pyx_k_gray16), 0, 0, 1, 1}, {&__pyx_n_s_gray17, __pyx_k_gray17, sizeof(__pyx_k_gray17), 0, 0, 1, 1}, {&__pyx_n_s_gray18, __pyx_k_gray18, sizeof(__pyx_k_gray18), 0, 0, 1, 1}, {&__pyx_n_s_gray19, __pyx_k_gray19, sizeof(__pyx_k_gray19), 0, 0, 1, 1}, {&__pyx_n_s_gray2, __pyx_k_gray2, sizeof(__pyx_k_gray2), 0, 0, 1, 1}, {&__pyx_n_s_gray20, __pyx_k_gray20, sizeof(__pyx_k_gray20), 0, 0, 1, 1}, {&__pyx_n_s_gray21, __pyx_k_gray21, sizeof(__pyx_k_gray21), 0, 0, 1, 1}, {&__pyx_n_s_gray22, __pyx_k_gray22, sizeof(__pyx_k_gray22), 0, 0, 1, 1}, {&__pyx_n_s_gray23, __pyx_k_gray23, sizeof(__pyx_k_gray23), 0, 0, 1, 1}, {&__pyx_n_s_gray24, __pyx_k_gray24, sizeof(__pyx_k_gray24), 0, 0, 1, 1}, {&__pyx_n_s_gray25, __pyx_k_gray25, sizeof(__pyx_k_gray25), 0, 0, 1, 1}, {&__pyx_n_s_gray26, __pyx_k_gray26, sizeof(__pyx_k_gray26), 0, 0, 1, 1}, {&__pyx_n_s_gray27, __pyx_k_gray27, sizeof(__pyx_k_gray27), 0, 0, 1, 1}, {&__pyx_n_s_gray28, __pyx_k_gray28, sizeof(__pyx_k_gray28), 0, 0, 1, 1}, {&__pyx_n_s_gray29, __pyx_k_gray29, sizeof(__pyx_k_gray29), 0, 0, 1, 1}, {&__pyx_n_s_gray3, __pyx_k_gray3, sizeof(__pyx_k_gray3), 0, 0, 1, 1}, {&__pyx_n_s_gray30, __pyx_k_gray30, sizeof(__pyx_k_gray30), 0, 0, 1, 1}, {&__pyx_n_s_gray31, __pyx_k_gray31, sizeof(__pyx_k_gray31), 0, 0, 1, 1}, {&__pyx_n_s_gray32, __pyx_k_gray32, sizeof(__pyx_k_gray32), 0, 0, 1, 1}, {&__pyx_n_s_gray33, __pyx_k_gray33, sizeof(__pyx_k_gray33), 0, 0, 1, 1}, {&__pyx_n_s_gray34, __pyx_k_gray34, sizeof(__pyx_k_gray34), 0, 0, 1, 1}, {&__pyx_n_s_gray35, __pyx_k_gray35, sizeof(__pyx_k_gray35), 0, 0, 1, 1}, {&__pyx_n_s_gray36, __pyx_k_gray36, sizeof(__pyx_k_gray36), 0, 0, 1, 1}, {&__pyx_n_s_gray37, __pyx_k_gray37, sizeof(__pyx_k_gray37), 0, 0, 1, 1}, {&__pyx_n_s_gray38, __pyx_k_gray38, sizeof(__pyx_k_gray38), 0, 0, 1, 1}, {&__pyx_n_s_gray39, __pyx_k_gray39, sizeof(__pyx_k_gray39), 0, 0, 1, 1}, {&__pyx_n_s_gray4, __pyx_k_gray4, sizeof(__pyx_k_gray4), 0, 0, 1, 1}, {&__pyx_n_s_gray40, __pyx_k_gray40, sizeof(__pyx_k_gray40), 0, 0, 1, 1}, {&__pyx_n_s_gray41, __pyx_k_gray41, sizeof(__pyx_k_gray41), 0, 0, 1, 1}, {&__pyx_n_s_gray42, __pyx_k_gray42, sizeof(__pyx_k_gray42), 0, 0, 1, 1}, {&__pyx_n_s_gray43, __pyx_k_gray43, sizeof(__pyx_k_gray43), 0, 0, 1, 1}, {&__pyx_n_s_gray44, __pyx_k_gray44, sizeof(__pyx_k_gray44), 0, 0, 1, 1}, {&__pyx_n_s_gray45, __pyx_k_gray45, sizeof(__pyx_k_gray45), 0, 0, 1, 1}, {&__pyx_n_s_gray46, __pyx_k_gray46, sizeof(__pyx_k_gray46), 0, 0, 1, 1}, {&__pyx_n_s_gray47, __pyx_k_gray47, sizeof(__pyx_k_gray47), 0, 0, 1, 1}, {&__pyx_n_s_gray48, __pyx_k_gray48, sizeof(__pyx_k_gray48), 0, 0, 1, 1}, {&__pyx_n_s_gray49, __pyx_k_gray49, sizeof(__pyx_k_gray49), 0, 0, 1, 1}, {&__pyx_n_s_gray5, __pyx_k_gray5, sizeof(__pyx_k_gray5), 0, 0, 1, 1}, {&__pyx_n_s_gray50, __pyx_k_gray50, sizeof(__pyx_k_gray50), 0, 0, 1, 1}, {&__pyx_n_s_gray51, __pyx_k_gray51, sizeof(__pyx_k_gray51), 0, 0, 1, 1}, {&__pyx_n_s_gray52, __pyx_k_gray52, sizeof(__pyx_k_gray52), 0, 0, 1, 1}, {&__pyx_n_s_gray53, __pyx_k_gray53, sizeof(__pyx_k_gray53), 0, 0, 1, 1}, {&__pyx_n_s_gray54, __pyx_k_gray54, sizeof(__pyx_k_gray54), 0, 0, 1, 1}, {&__pyx_n_s_gray55, __pyx_k_gray55, sizeof(__pyx_k_gray55), 0, 0, 1, 1}, {&__pyx_n_s_gray56, __pyx_k_gray56, sizeof(__pyx_k_gray56), 0, 0, 1, 1}, {&__pyx_n_s_gray57, __pyx_k_gray57, sizeof(__pyx_k_gray57), 0, 0, 1, 1}, {&__pyx_n_s_gray58, __pyx_k_gray58, sizeof(__pyx_k_gray58), 0, 0, 1, 1}, {&__pyx_n_s_gray59, __pyx_k_gray59, sizeof(__pyx_k_gray59), 0, 0, 1, 1}, {&__pyx_n_s_gray6, __pyx_k_gray6, sizeof(__pyx_k_gray6), 0, 0, 1, 1}, {&__pyx_n_s_gray60, __pyx_k_gray60, sizeof(__pyx_k_gray60), 0, 0, 1, 1}, {&__pyx_n_s_gray61, __pyx_k_gray61, sizeof(__pyx_k_gray61), 0, 0, 1, 1}, {&__pyx_n_s_gray62, __pyx_k_gray62, sizeof(__pyx_k_gray62), 0, 0, 1, 1}, {&__pyx_n_s_gray63, __pyx_k_gray63, sizeof(__pyx_k_gray63), 0, 0, 1, 1}, {&__pyx_n_s_gray64, __pyx_k_gray64, sizeof(__pyx_k_gray64), 0, 0, 1, 1}, {&__pyx_n_s_gray65, __pyx_k_gray65, sizeof(__pyx_k_gray65), 0, 0, 1, 1}, {&__pyx_n_s_gray66, __pyx_k_gray66, sizeof(__pyx_k_gray66), 0, 0, 1, 1}, {&__pyx_n_s_gray67, __pyx_k_gray67, sizeof(__pyx_k_gray67), 0, 0, 1, 1}, {&__pyx_n_s_gray68, __pyx_k_gray68, sizeof(__pyx_k_gray68), 0, 0, 1, 1}, {&__pyx_n_s_gray69, __pyx_k_gray69, sizeof(__pyx_k_gray69), 0, 0, 1, 1}, {&__pyx_n_s_gray7, __pyx_k_gray7, sizeof(__pyx_k_gray7), 0, 0, 1, 1}, {&__pyx_n_s_gray70, __pyx_k_gray70, sizeof(__pyx_k_gray70), 0, 0, 1, 1}, {&__pyx_n_s_gray71, __pyx_k_gray71, sizeof(__pyx_k_gray71), 0, 0, 1, 1}, {&__pyx_n_s_gray72, __pyx_k_gray72, sizeof(__pyx_k_gray72), 0, 0, 1, 1}, {&__pyx_n_s_gray73, __pyx_k_gray73, sizeof(__pyx_k_gray73), 0, 0, 1, 1}, {&__pyx_n_s_gray74, __pyx_k_gray74, sizeof(__pyx_k_gray74), 0, 0, 1, 1}, {&__pyx_n_s_gray75, __pyx_k_gray75, sizeof(__pyx_k_gray75), 0, 0, 1, 1}, {&__pyx_n_s_gray76, __pyx_k_gray76, sizeof(__pyx_k_gray76), 0, 0, 1, 1}, {&__pyx_n_s_gray77, __pyx_k_gray77, sizeof(__pyx_k_gray77), 0, 0, 1, 1}, {&__pyx_n_s_gray78, __pyx_k_gray78, sizeof(__pyx_k_gray78), 0, 0, 1, 1}, {&__pyx_n_s_gray79, __pyx_k_gray79, sizeof(__pyx_k_gray79), 0, 0, 1, 1}, {&__pyx_n_s_gray8, __pyx_k_gray8, sizeof(__pyx_k_gray8), 0, 0, 1, 1}, {&__pyx_n_s_gray80, __pyx_k_gray80, sizeof(__pyx_k_gray80), 0, 0, 1, 1}, {&__pyx_n_s_gray81, __pyx_k_gray81, sizeof(__pyx_k_gray81), 0, 0, 1, 1}, {&__pyx_n_s_gray82, __pyx_k_gray82, sizeof(__pyx_k_gray82), 0, 0, 1, 1}, {&__pyx_n_s_gray83, __pyx_k_gray83, sizeof(__pyx_k_gray83), 0, 0, 1, 1}, {&__pyx_n_s_gray84, __pyx_k_gray84, sizeof(__pyx_k_gray84), 0, 0, 1, 1}, {&__pyx_n_s_gray85, __pyx_k_gray85, sizeof(__pyx_k_gray85), 0, 0, 1, 1}, {&__pyx_n_s_gray86, __pyx_k_gray86, sizeof(__pyx_k_gray86), 0, 0, 1, 1}, {&__pyx_n_s_gray87, __pyx_k_gray87, sizeof(__pyx_k_gray87), 0, 0, 1, 1}, {&__pyx_n_s_gray88, __pyx_k_gray88, sizeof(__pyx_k_gray88), 0, 0, 1, 1}, {&__pyx_n_s_gray89, __pyx_k_gray89, sizeof(__pyx_k_gray89), 0, 0, 1, 1}, {&__pyx_n_s_gray9, __pyx_k_gray9, sizeof(__pyx_k_gray9), 0, 0, 1, 1}, {&__pyx_n_s_gray90, __pyx_k_gray90, sizeof(__pyx_k_gray90), 0, 0, 1, 1}, {&__pyx_n_s_gray91, __pyx_k_gray91, sizeof(__pyx_k_gray91), 0, 0, 1, 1}, {&__pyx_n_s_gray92, __pyx_k_gray92, sizeof(__pyx_k_gray92), 0, 0, 1, 1}, {&__pyx_n_s_gray93, __pyx_k_gray93, sizeof(__pyx_k_gray93), 0, 0, 1, 1}, {&__pyx_n_s_gray94, __pyx_k_gray94, sizeof(__pyx_k_gray94), 0, 0, 1, 1}, {&__pyx_n_s_gray95, __pyx_k_gray95, sizeof(__pyx_k_gray95), 0, 0, 1, 1}, {&__pyx_n_s_gray96, __pyx_k_gray96, sizeof(__pyx_k_gray96), 0, 0, 1, 1}, {&__pyx_n_s_gray97, __pyx_k_gray97, sizeof(__pyx_k_gray97), 0, 0, 1, 1}, {&__pyx_n_s_gray98, __pyx_k_gray98, sizeof(__pyx_k_gray98), 0, 0, 1, 1}, {&__pyx_n_s_gray99, __pyx_k_gray99, sizeof(__pyx_k_gray99), 0, 0, 1, 1}, {&__pyx_n_s_green, __pyx_k_green, sizeof(__pyx_k_green), 0, 0, 1, 1}, {&__pyx_n_s_green1, __pyx_k_green1, sizeof(__pyx_k_green1), 0, 0, 1, 1}, {&__pyx_n_s_green2, __pyx_k_green2, sizeof(__pyx_k_green2), 0, 0, 1, 1}, {&__pyx_n_s_green3, __pyx_k_green3, sizeof(__pyx_k_green3), 0, 0, 1, 1}, {&__pyx_n_s_green4, __pyx_k_green4, sizeof(__pyx_k_green4), 0, 0, 1, 1}, {&__pyx_n_s_greenyellow, __pyx_k_greenyellow, sizeof(__pyx_k_greenyellow), 0, 0, 1, 1}, {&__pyx_n_s_grey, __pyx_k_grey, sizeof(__pyx_k_grey), 0, 0, 1, 1}, {&__pyx_n_s_grey0, __pyx_k_grey0, sizeof(__pyx_k_grey0), 0, 0, 1, 1}, {&__pyx_n_s_grey1, __pyx_k_grey1, sizeof(__pyx_k_grey1), 0, 0, 1, 1}, {&__pyx_n_s_grey10, __pyx_k_grey10, sizeof(__pyx_k_grey10), 0, 0, 1, 1}, {&__pyx_n_s_grey100, __pyx_k_grey100, sizeof(__pyx_k_grey100), 0, 0, 1, 1}, {&__pyx_n_s_grey11, __pyx_k_grey11, sizeof(__pyx_k_grey11), 0, 0, 1, 1}, {&__pyx_n_s_grey12, __pyx_k_grey12, sizeof(__pyx_k_grey12), 0, 0, 1, 1}, {&__pyx_n_s_grey13, __pyx_k_grey13, sizeof(__pyx_k_grey13), 0, 0, 1, 1}, {&__pyx_n_s_grey14, __pyx_k_grey14, sizeof(__pyx_k_grey14), 0, 0, 1, 1}, {&__pyx_n_s_grey15, __pyx_k_grey15, sizeof(__pyx_k_grey15), 0, 0, 1, 1}, {&__pyx_n_s_grey16, __pyx_k_grey16, sizeof(__pyx_k_grey16), 0, 0, 1, 1}, {&__pyx_n_s_grey17, __pyx_k_grey17, sizeof(__pyx_k_grey17), 0, 0, 1, 1}, {&__pyx_n_s_grey18, __pyx_k_grey18, sizeof(__pyx_k_grey18), 0, 0, 1, 1}, {&__pyx_n_s_grey19, __pyx_k_grey19, sizeof(__pyx_k_grey19), 0, 0, 1, 1}, {&__pyx_n_s_grey2, __pyx_k_grey2, sizeof(__pyx_k_grey2), 0, 0, 1, 1}, {&__pyx_n_s_grey20, __pyx_k_grey20, sizeof(__pyx_k_grey20), 0, 0, 1, 1}, {&__pyx_n_s_grey21, __pyx_k_grey21, sizeof(__pyx_k_grey21), 0, 0, 1, 1}, {&__pyx_n_s_grey22, __pyx_k_grey22, sizeof(__pyx_k_grey22), 0, 0, 1, 1}, {&__pyx_n_s_grey23, __pyx_k_grey23, sizeof(__pyx_k_grey23), 0, 0, 1, 1}, {&__pyx_n_s_grey24, __pyx_k_grey24, sizeof(__pyx_k_grey24), 0, 0, 1, 1}, {&__pyx_n_s_grey25, __pyx_k_grey25, sizeof(__pyx_k_grey25), 0, 0, 1, 1}, {&__pyx_n_s_grey26, __pyx_k_grey26, sizeof(__pyx_k_grey26), 0, 0, 1, 1}, {&__pyx_n_s_grey27, __pyx_k_grey27, sizeof(__pyx_k_grey27), 0, 0, 1, 1}, {&__pyx_n_s_grey28, __pyx_k_grey28, sizeof(__pyx_k_grey28), 0, 0, 1, 1}, {&__pyx_n_s_grey29, __pyx_k_grey29, sizeof(__pyx_k_grey29), 0, 0, 1, 1}, {&__pyx_n_s_grey3, __pyx_k_grey3, sizeof(__pyx_k_grey3), 0, 0, 1, 1}, {&__pyx_n_s_grey30, __pyx_k_grey30, sizeof(__pyx_k_grey30), 0, 0, 1, 1}, {&__pyx_n_s_grey31, __pyx_k_grey31, sizeof(__pyx_k_grey31), 0, 0, 1, 1}, {&__pyx_n_s_grey32, __pyx_k_grey32, sizeof(__pyx_k_grey32), 0, 0, 1, 1}, {&__pyx_n_s_grey33, __pyx_k_grey33, sizeof(__pyx_k_grey33), 0, 0, 1, 1}, {&__pyx_n_s_grey34, __pyx_k_grey34, sizeof(__pyx_k_grey34), 0, 0, 1, 1}, {&__pyx_n_s_grey35, __pyx_k_grey35, sizeof(__pyx_k_grey35), 0, 0, 1, 1}, {&__pyx_n_s_grey36, __pyx_k_grey36, sizeof(__pyx_k_grey36), 0, 0, 1, 1}, {&__pyx_n_s_grey37, __pyx_k_grey37, sizeof(__pyx_k_grey37), 0, 0, 1, 1}, {&__pyx_n_s_grey38, __pyx_k_grey38, sizeof(__pyx_k_grey38), 0, 0, 1, 1}, {&__pyx_n_s_grey39, __pyx_k_grey39, sizeof(__pyx_k_grey39), 0, 0, 1, 1}, {&__pyx_n_s_grey4, __pyx_k_grey4, sizeof(__pyx_k_grey4), 0, 0, 1, 1}, {&__pyx_n_s_grey40, __pyx_k_grey40, sizeof(__pyx_k_grey40), 0, 0, 1, 1}, {&__pyx_n_s_grey41, __pyx_k_grey41, sizeof(__pyx_k_grey41), 0, 0, 1, 1}, {&__pyx_n_s_grey42, __pyx_k_grey42, sizeof(__pyx_k_grey42), 0, 0, 1, 1}, {&__pyx_n_s_grey43, __pyx_k_grey43, sizeof(__pyx_k_grey43), 0, 0, 1, 1}, {&__pyx_n_s_grey44, __pyx_k_grey44, sizeof(__pyx_k_grey44), 0, 0, 1, 1}, {&__pyx_n_s_grey45, __pyx_k_grey45, sizeof(__pyx_k_grey45), 0, 0, 1, 1}, {&__pyx_n_s_grey46, __pyx_k_grey46, sizeof(__pyx_k_grey46), 0, 0, 1, 1}, {&__pyx_n_s_grey47, __pyx_k_grey47, sizeof(__pyx_k_grey47), 0, 0, 1, 1}, {&__pyx_n_s_grey48, __pyx_k_grey48, sizeof(__pyx_k_grey48), 0, 0, 1, 1}, {&__pyx_n_s_grey49, __pyx_k_grey49, sizeof(__pyx_k_grey49), 0, 0, 1, 1}, {&__pyx_n_s_grey5, __pyx_k_grey5, sizeof(__pyx_k_grey5), 0, 0, 1, 1}, {&__pyx_n_s_grey50, __pyx_k_grey50, sizeof(__pyx_k_grey50), 0, 0, 1, 1}, {&__pyx_n_s_grey51, __pyx_k_grey51, sizeof(__pyx_k_grey51), 0, 0, 1, 1}, {&__pyx_n_s_grey52, __pyx_k_grey52, sizeof(__pyx_k_grey52), 0, 0, 1, 1}, {&__pyx_n_s_grey53, __pyx_k_grey53, sizeof(__pyx_k_grey53), 0, 0, 1, 1}, {&__pyx_n_s_grey54, __pyx_k_grey54, sizeof(__pyx_k_grey54), 0, 0, 1, 1}, {&__pyx_n_s_grey55, __pyx_k_grey55, sizeof(__pyx_k_grey55), 0, 0, 1, 1}, {&__pyx_n_s_grey56, __pyx_k_grey56, sizeof(__pyx_k_grey56), 0, 0, 1, 1}, {&__pyx_n_s_grey57, __pyx_k_grey57, sizeof(__pyx_k_grey57), 0, 0, 1, 1}, {&__pyx_n_s_grey58, __pyx_k_grey58, sizeof(__pyx_k_grey58), 0, 0, 1, 1}, {&__pyx_n_s_grey59, __pyx_k_grey59, sizeof(__pyx_k_grey59), 0, 0, 1, 1}, {&__pyx_n_s_grey6, __pyx_k_grey6, sizeof(__pyx_k_grey6), 0, 0, 1, 1}, {&__pyx_n_s_grey60, __pyx_k_grey60, sizeof(__pyx_k_grey60), 0, 0, 1, 1}, {&__pyx_n_s_grey61, __pyx_k_grey61, sizeof(__pyx_k_grey61), 0, 0, 1, 1}, {&__pyx_n_s_grey62, __pyx_k_grey62, sizeof(__pyx_k_grey62), 0, 0, 1, 1}, {&__pyx_n_s_grey63, __pyx_k_grey63, sizeof(__pyx_k_grey63), 0, 0, 1, 1}, {&__pyx_n_s_grey64, __pyx_k_grey64, sizeof(__pyx_k_grey64), 0, 0, 1, 1}, {&__pyx_n_s_grey65, __pyx_k_grey65, sizeof(__pyx_k_grey65), 0, 0, 1, 1}, {&__pyx_n_s_grey66, __pyx_k_grey66, sizeof(__pyx_k_grey66), 0, 0, 1, 1}, {&__pyx_n_s_grey67, __pyx_k_grey67, sizeof(__pyx_k_grey67), 0, 0, 1, 1}, {&__pyx_n_s_grey68, __pyx_k_grey68, sizeof(__pyx_k_grey68), 0, 0, 1, 1}, {&__pyx_n_s_grey69, __pyx_k_grey69, sizeof(__pyx_k_grey69), 0, 0, 1, 1}, {&__pyx_n_s_grey7, __pyx_k_grey7, sizeof(__pyx_k_grey7), 0, 0, 1, 1}, {&__pyx_n_s_grey70, __pyx_k_grey70, sizeof(__pyx_k_grey70), 0, 0, 1, 1}, {&__pyx_n_s_grey71, __pyx_k_grey71, sizeof(__pyx_k_grey71), 0, 0, 1, 1}, {&__pyx_n_s_grey72, __pyx_k_grey72, sizeof(__pyx_k_grey72), 0, 0, 1, 1}, {&__pyx_n_s_grey73, __pyx_k_grey73, sizeof(__pyx_k_grey73), 0, 0, 1, 1}, {&__pyx_n_s_grey74, __pyx_k_grey74, sizeof(__pyx_k_grey74), 0, 0, 1, 1}, {&__pyx_n_s_grey75, __pyx_k_grey75, sizeof(__pyx_k_grey75), 0, 0, 1, 1}, {&__pyx_n_s_grey76, __pyx_k_grey76, sizeof(__pyx_k_grey76), 0, 0, 1, 1}, {&__pyx_n_s_grey77, __pyx_k_grey77, sizeof(__pyx_k_grey77), 0, 0, 1, 1}, {&__pyx_n_s_grey78, __pyx_k_grey78, sizeof(__pyx_k_grey78), 0, 0, 1, 1}, {&__pyx_n_s_grey79, __pyx_k_grey79, sizeof(__pyx_k_grey79), 0, 0, 1, 1}, {&__pyx_n_s_grey8, __pyx_k_grey8, sizeof(__pyx_k_grey8), 0, 0, 1, 1}, {&__pyx_n_s_grey80, __pyx_k_grey80, sizeof(__pyx_k_grey80), 0, 0, 1, 1}, {&__pyx_n_s_grey81, __pyx_k_grey81, sizeof(__pyx_k_grey81), 0, 0, 1, 1}, {&__pyx_n_s_grey82, __pyx_k_grey82, sizeof(__pyx_k_grey82), 0, 0, 1, 1}, {&__pyx_n_s_grey83, __pyx_k_grey83, sizeof(__pyx_k_grey83), 0, 0, 1, 1}, {&__pyx_n_s_grey84, __pyx_k_grey84, sizeof(__pyx_k_grey84), 0, 0, 1, 1}, {&__pyx_n_s_grey85, __pyx_k_grey85, sizeof(__pyx_k_grey85), 0, 0, 1, 1}, {&__pyx_n_s_grey86, __pyx_k_grey86, sizeof(__pyx_k_grey86), 0, 0, 1, 1}, {&__pyx_n_s_grey87, __pyx_k_grey87, sizeof(__pyx_k_grey87), 0, 0, 1, 1}, {&__pyx_n_s_grey88, __pyx_k_grey88, sizeof(__pyx_k_grey88), 0, 0, 1, 1}, {&__pyx_n_s_grey89, __pyx_k_grey89, sizeof(__pyx_k_grey89), 0, 0, 1, 1}, {&__pyx_n_s_grey9, __pyx_k_grey9, sizeof(__pyx_k_grey9), 0, 0, 1, 1}, {&__pyx_n_s_grey90, __pyx_k_grey90, sizeof(__pyx_k_grey90), 0, 0, 1, 1}, {&__pyx_n_s_grey91, __pyx_k_grey91, sizeof(__pyx_k_grey91), 0, 0, 1, 1}, {&__pyx_n_s_grey92, __pyx_k_grey92, sizeof(__pyx_k_grey92), 0, 0, 1, 1}, {&__pyx_n_s_grey93, __pyx_k_grey93, sizeof(__pyx_k_grey93), 0, 0, 1, 1}, {&__pyx_n_s_grey94, __pyx_k_grey94, sizeof(__pyx_k_grey94), 0, 0, 1, 1}, {&__pyx_n_s_grey95, __pyx_k_grey95, sizeof(__pyx_k_grey95), 0, 0, 1, 1}, {&__pyx_n_s_grey96, __pyx_k_grey96, sizeof(__pyx_k_grey96), 0, 0, 1, 1}, {&__pyx_n_s_grey97, __pyx_k_grey97, sizeof(__pyx_k_grey97), 0, 0, 1, 1}, {&__pyx_n_s_grey98, __pyx_k_grey98, sizeof(__pyx_k_grey98), 0, 0, 1, 1}, {&__pyx_n_s_grey99, __pyx_k_grey99, sizeof(__pyx_k_grey99), 0, 0, 1, 1}, {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, {&__pyx_n_s_honeydew, __pyx_k_honeydew, sizeof(__pyx_k_honeydew), 0, 0, 1, 1}, {&__pyx_n_s_honeydew1, __pyx_k_honeydew1, sizeof(__pyx_k_honeydew1), 0, 0, 1, 1}, {&__pyx_n_s_honeydew2, __pyx_k_honeydew2, sizeof(__pyx_k_honeydew2), 0, 0, 1, 1}, {&__pyx_n_s_honeydew3, __pyx_k_honeydew3, sizeof(__pyx_k_honeydew3), 0, 0, 1, 1}, {&__pyx_n_s_honeydew4, __pyx_k_honeydew4, sizeof(__pyx_k_honeydew4), 0, 0, 1, 1}, {&__pyx_n_s_hotpink, __pyx_k_hotpink, sizeof(__pyx_k_hotpink), 0, 0, 1, 1}, {&__pyx_n_s_hotpink1, __pyx_k_hotpink1, sizeof(__pyx_k_hotpink1), 0, 0, 1, 1}, {&__pyx_n_s_hotpink2, __pyx_k_hotpink2, sizeof(__pyx_k_hotpink2), 0, 0, 1, 1}, {&__pyx_n_s_hotpink3, __pyx_k_hotpink3, sizeof(__pyx_k_hotpink3), 0, 0, 1, 1}, {&__pyx_n_s_hotpink4, __pyx_k_hotpink4, sizeof(__pyx_k_hotpink4), 0, 0, 1, 1}, {&__pyx_n_s_hsva, __pyx_k_hsva, sizeof(__pyx_k_hsva), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_indianred, __pyx_k_indianred, sizeof(__pyx_k_indianred), 0, 0, 1, 1}, {&__pyx_n_s_indianred1, __pyx_k_indianred1, sizeof(__pyx_k_indianred1), 0, 0, 1, 1}, {&__pyx_n_s_indianred2, __pyx_k_indianred2, sizeof(__pyx_k_indianred2), 0, 0, 1, 1}, {&__pyx_n_s_indianred3, __pyx_k_indianred3, sizeof(__pyx_k_indianred3), 0, 0, 1, 1}, {&__pyx_n_s_indianred4, __pyx_k_indianred4, sizeof(__pyx_k_indianred4), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_ivory, __pyx_k_ivory, sizeof(__pyx_k_ivory), 0, 0, 1, 1}, {&__pyx_n_s_ivory1, __pyx_k_ivory1, sizeof(__pyx_k_ivory1), 0, 0, 1, 1}, {&__pyx_n_s_ivory2, __pyx_k_ivory2, sizeof(__pyx_k_ivory2), 0, 0, 1, 1}, {&__pyx_n_s_ivory3, __pyx_k_ivory3, sizeof(__pyx_k_ivory3), 0, 0, 1, 1}, {&__pyx_n_s_ivory4, __pyx_k_ivory4, sizeof(__pyx_k_ivory4), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_khaki, __pyx_k_khaki, sizeof(__pyx_k_khaki), 0, 0, 1, 1}, {&__pyx_n_s_khaki1, __pyx_k_khaki1, sizeof(__pyx_k_khaki1), 0, 0, 1, 1}, {&__pyx_n_s_khaki2, __pyx_k_khaki2, sizeof(__pyx_k_khaki2), 0, 0, 1, 1}, {&__pyx_n_s_khaki3, __pyx_k_khaki3, sizeof(__pyx_k_khaki3), 0, 0, 1, 1}, {&__pyx_n_s_khaki4, __pyx_k_khaki4, sizeof(__pyx_k_khaki4), 0, 0, 1, 1}, {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1}, {&__pyx_n_s_lavender, __pyx_k_lavender, sizeof(__pyx_k_lavender), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush, __pyx_k_lavenderblush, sizeof(__pyx_k_lavenderblush), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush1, __pyx_k_lavenderblush1, sizeof(__pyx_k_lavenderblush1), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush2, __pyx_k_lavenderblush2, sizeof(__pyx_k_lavenderblush2), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush3, __pyx_k_lavenderblush3, sizeof(__pyx_k_lavenderblush3), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush4, __pyx_k_lavenderblush4, sizeof(__pyx_k_lavenderblush4), 0, 0, 1, 1}, {&__pyx_n_s_lawngreen, __pyx_k_lawngreen, sizeof(__pyx_k_lawngreen), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon, __pyx_k_lemonchiffon, sizeof(__pyx_k_lemonchiffon), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon1, __pyx_k_lemonchiffon1, sizeof(__pyx_k_lemonchiffon1), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon2, __pyx_k_lemonchiffon2, sizeof(__pyx_k_lemonchiffon2), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon3, __pyx_k_lemonchiffon3, sizeof(__pyx_k_lemonchiffon3), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon4, __pyx_k_lemonchiffon4, sizeof(__pyx_k_lemonchiffon4), 0, 0, 1, 1}, {&__pyx_n_s_lightblue, __pyx_k_lightblue, sizeof(__pyx_k_lightblue), 0, 0, 1, 1}, {&__pyx_n_s_lightblue1, __pyx_k_lightblue1, sizeof(__pyx_k_lightblue1), 0, 0, 1, 1}, {&__pyx_n_s_lightblue2, __pyx_k_lightblue2, sizeof(__pyx_k_lightblue2), 0, 0, 1, 1}, {&__pyx_n_s_lightblue3, __pyx_k_lightblue3, sizeof(__pyx_k_lightblue3), 0, 0, 1, 1}, {&__pyx_n_s_lightblue4, __pyx_k_lightblue4, sizeof(__pyx_k_lightblue4), 0, 0, 1, 1}, {&__pyx_n_s_lightcoral, __pyx_k_lightcoral, sizeof(__pyx_k_lightcoral), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan, __pyx_k_lightcyan, sizeof(__pyx_k_lightcyan), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan1, __pyx_k_lightcyan1, sizeof(__pyx_k_lightcyan1), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan2, __pyx_k_lightcyan2, sizeof(__pyx_k_lightcyan2), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan3, __pyx_k_lightcyan3, sizeof(__pyx_k_lightcyan3), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan4, __pyx_k_lightcyan4, sizeof(__pyx_k_lightcyan4), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod, __pyx_k_lightgoldenrod, sizeof(__pyx_k_lightgoldenrod), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod1, __pyx_k_lightgoldenrod1, sizeof(__pyx_k_lightgoldenrod1), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod2, __pyx_k_lightgoldenrod2, sizeof(__pyx_k_lightgoldenrod2), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod3, __pyx_k_lightgoldenrod3, sizeof(__pyx_k_lightgoldenrod3), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod4, __pyx_k_lightgoldenrod4, sizeof(__pyx_k_lightgoldenrod4), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrodyellow, __pyx_k_lightgoldenrodyellow, sizeof(__pyx_k_lightgoldenrodyellow), 0, 0, 1, 1}, {&__pyx_n_s_lightgray, __pyx_k_lightgray, sizeof(__pyx_k_lightgray), 0, 0, 1, 1}, {&__pyx_n_s_lightgreen, __pyx_k_lightgreen, sizeof(__pyx_k_lightgreen), 0, 0, 1, 1}, {&__pyx_n_s_lightgrey, __pyx_k_lightgrey, sizeof(__pyx_k_lightgrey), 0, 0, 1, 1}, {&__pyx_n_s_lightpink, __pyx_k_lightpink, sizeof(__pyx_k_lightpink), 0, 0, 1, 1}, {&__pyx_n_s_lightpink1, __pyx_k_lightpink1, sizeof(__pyx_k_lightpink1), 0, 0, 1, 1}, {&__pyx_n_s_lightpink2, __pyx_k_lightpink2, sizeof(__pyx_k_lightpink2), 0, 0, 1, 1}, {&__pyx_n_s_lightpink3, __pyx_k_lightpink3, sizeof(__pyx_k_lightpink3), 0, 0, 1, 1}, {&__pyx_n_s_lightpink4, __pyx_k_lightpink4, sizeof(__pyx_k_lightpink4), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon, __pyx_k_lightsalmon, sizeof(__pyx_k_lightsalmon), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon1, __pyx_k_lightsalmon1, sizeof(__pyx_k_lightsalmon1), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon2, __pyx_k_lightsalmon2, sizeof(__pyx_k_lightsalmon2), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon3, __pyx_k_lightsalmon3, sizeof(__pyx_k_lightsalmon3), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon4, __pyx_k_lightsalmon4, sizeof(__pyx_k_lightsalmon4), 0, 0, 1, 1}, {&__pyx_n_s_lightseagreen, __pyx_k_lightseagreen, sizeof(__pyx_k_lightseagreen), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue, __pyx_k_lightskyblue, sizeof(__pyx_k_lightskyblue), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue1, __pyx_k_lightskyblue1, sizeof(__pyx_k_lightskyblue1), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue2, __pyx_k_lightskyblue2, sizeof(__pyx_k_lightskyblue2), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue3, __pyx_k_lightskyblue3, sizeof(__pyx_k_lightskyblue3), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue4, __pyx_k_lightskyblue4, sizeof(__pyx_k_lightskyblue4), 0, 0, 1, 1}, {&__pyx_n_s_lightslateblue, __pyx_k_lightslateblue, sizeof(__pyx_k_lightslateblue), 0, 0, 1, 1}, {&__pyx_n_s_lightslategray, __pyx_k_lightslategray, sizeof(__pyx_k_lightslategray), 0, 0, 1, 1}, {&__pyx_n_s_lightslategrey, __pyx_k_lightslategrey, sizeof(__pyx_k_lightslategrey), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue, __pyx_k_lightsteelblue, sizeof(__pyx_k_lightsteelblue), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue1, __pyx_k_lightsteelblue1, sizeof(__pyx_k_lightsteelblue1), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue2, __pyx_k_lightsteelblue2, sizeof(__pyx_k_lightsteelblue2), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue3, __pyx_k_lightsteelblue3, sizeof(__pyx_k_lightsteelblue3), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue4, __pyx_k_lightsteelblue4, sizeof(__pyx_k_lightsteelblue4), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow, __pyx_k_lightyellow, sizeof(__pyx_k_lightyellow), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow1, __pyx_k_lightyellow1, sizeof(__pyx_k_lightyellow1), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow2, __pyx_k_lightyellow2, sizeof(__pyx_k_lightyellow2), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow3, __pyx_k_lightyellow3, sizeof(__pyx_k_lightyellow3), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow4, __pyx_k_lightyellow4, sizeof(__pyx_k_lightyellow4), 0, 0, 1, 1}, {&__pyx_n_s_limegreen, __pyx_k_limegreen, sizeof(__pyx_k_limegreen), 0, 0, 1, 1}, {&__pyx_n_s_linen, __pyx_k_linen, sizeof(__pyx_k_linen), 0, 0, 1, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1}, {&__pyx_n_s_magenta, __pyx_k_magenta, sizeof(__pyx_k_magenta), 0, 0, 1, 1}, {&__pyx_n_s_magenta1, __pyx_k_magenta1, sizeof(__pyx_k_magenta1), 0, 0, 1, 1}, {&__pyx_n_s_magenta2, __pyx_k_magenta2, sizeof(__pyx_k_magenta2), 0, 0, 1, 1}, {&__pyx_n_s_magenta3, __pyx_k_magenta3, sizeof(__pyx_k_magenta3), 0, 0, 1, 1}, {&__pyx_n_s_magenta4, __pyx_k_magenta4, sizeof(__pyx_k_magenta4), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, {&__pyx_n_s_maroon, __pyx_k_maroon, sizeof(__pyx_k_maroon), 0, 0, 1, 1}, {&__pyx_n_s_maroon1, __pyx_k_maroon1, sizeof(__pyx_k_maroon1), 0, 0, 1, 1}, {&__pyx_n_s_maroon2, __pyx_k_maroon2, sizeof(__pyx_k_maroon2), 0, 0, 1, 1}, {&__pyx_n_s_maroon3, __pyx_k_maroon3, sizeof(__pyx_k_maroon3), 0, 0, 1, 1}, {&__pyx_n_s_maroon4, __pyx_k_maroon4, sizeof(__pyx_k_maroon4), 0, 0, 1, 1}, {&__pyx_n_s_mediumaquamarine, __pyx_k_mediumaquamarine, sizeof(__pyx_k_mediumaquamarine), 0, 0, 1, 1}, {&__pyx_n_s_mediumblue, __pyx_k_mediumblue, sizeof(__pyx_k_mediumblue), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid, __pyx_k_mediumorchid, sizeof(__pyx_k_mediumorchid), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid1, __pyx_k_mediumorchid1, sizeof(__pyx_k_mediumorchid1), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid2, __pyx_k_mediumorchid2, sizeof(__pyx_k_mediumorchid2), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid3, __pyx_k_mediumorchid3, sizeof(__pyx_k_mediumorchid3), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid4, __pyx_k_mediumorchid4, sizeof(__pyx_k_mediumorchid4), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple, __pyx_k_mediumpurple, sizeof(__pyx_k_mediumpurple), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple1, __pyx_k_mediumpurple1, sizeof(__pyx_k_mediumpurple1), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple2, __pyx_k_mediumpurple2, sizeof(__pyx_k_mediumpurple2), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple3, __pyx_k_mediumpurple3, sizeof(__pyx_k_mediumpurple3), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple4, __pyx_k_mediumpurple4, sizeof(__pyx_k_mediumpurple4), 0, 0, 1, 1}, {&__pyx_n_s_mediumseagreen, __pyx_k_mediumseagreen, sizeof(__pyx_k_mediumseagreen), 0, 0, 1, 1}, {&__pyx_n_s_mediumslateblue, __pyx_k_mediumslateblue, sizeof(__pyx_k_mediumslateblue), 0, 0, 1, 1}, {&__pyx_n_s_mediumspringgreen, __pyx_k_mediumspringgreen, sizeof(__pyx_k_mediumspringgreen), 0, 0, 1, 1}, {&__pyx_n_s_mediumturquoise, __pyx_k_mediumturquoise, sizeof(__pyx_k_mediumturquoise), 0, 0, 1, 1}, {&__pyx_n_s_mediumvioletred, __pyx_k_mediumvioletred, sizeof(__pyx_k_mediumvioletred), 0, 0, 1, 1}, {&__pyx_n_s_midnightblue, __pyx_k_midnightblue, sizeof(__pyx_k_midnightblue), 0, 0, 1, 1}, {&__pyx_n_s_mintcream, __pyx_k_mintcream, sizeof(__pyx_k_mintcream), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose, __pyx_k_mistyrose, sizeof(__pyx_k_mistyrose), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose1, __pyx_k_mistyrose1, sizeof(__pyx_k_mistyrose1), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose2, __pyx_k_mistyrose2, sizeof(__pyx_k_mistyrose2), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose3, __pyx_k_mistyrose3, sizeof(__pyx_k_mistyrose3), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose4, __pyx_k_mistyrose4, sizeof(__pyx_k_mistyrose4), 0, 0, 1, 1}, {&__pyx_n_s_moccasin, __pyx_k_moccasin, sizeof(__pyx_k_moccasin), 0, 0, 1, 1}, {&__pyx_n_s_mod, __pyx_k_mod, sizeof(__pyx_k_mod), 0, 0, 1, 1}, {&__pyx_n_s_mod___locals_mod, __pyx_k_mod___locals_mod, sizeof(__pyx_k_mod___locals_mod), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite, __pyx_k_navajowhite, sizeof(__pyx_k_navajowhite), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite1, __pyx_k_navajowhite1, sizeof(__pyx_k_navajowhite1), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite2, __pyx_k_navajowhite2, sizeof(__pyx_k_navajowhite2), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite3, __pyx_k_navajowhite3, sizeof(__pyx_k_navajowhite3), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite4, __pyx_k_navajowhite4, sizeof(__pyx_k_navajowhite4), 0, 0, 1, 1}, {&__pyx_n_s_navy, __pyx_k_navy, sizeof(__pyx_k_navy), 0, 0, 1, 1}, {&__pyx_n_s_navyblue, __pyx_k_navyblue, sizeof(__pyx_k_navyblue), 0, 0, 1, 1}, {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1}, {&__pyx_n_s_oct, __pyx_k_oct, sizeof(__pyx_k_oct), 0, 0, 1, 1}, {&__pyx_n_s_oldlace, __pyx_k_oldlace, sizeof(__pyx_k_oldlace), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab, __pyx_k_olivedrab, sizeof(__pyx_k_olivedrab), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab1, __pyx_k_olivedrab1, sizeof(__pyx_k_olivedrab1), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab2, __pyx_k_olivedrab2, sizeof(__pyx_k_olivedrab2), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab3, __pyx_k_olivedrab3, sizeof(__pyx_k_olivedrab3), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab4, __pyx_k_olivedrab4, sizeof(__pyx_k_olivedrab4), 0, 0, 1, 1}, {&__pyx_n_s_orange, __pyx_k_orange, sizeof(__pyx_k_orange), 0, 0, 1, 1}, {&__pyx_n_s_orange1, __pyx_k_orange1, sizeof(__pyx_k_orange1), 0, 0, 1, 1}, {&__pyx_n_s_orange2, __pyx_k_orange2, sizeof(__pyx_k_orange2), 0, 0, 1, 1}, {&__pyx_n_s_orange3, __pyx_k_orange3, sizeof(__pyx_k_orange3), 0, 0, 1, 1}, {&__pyx_n_s_orange4, __pyx_k_orange4, sizeof(__pyx_k_orange4), 0, 0, 1, 1}, {&__pyx_n_s_orangered, __pyx_k_orangered, sizeof(__pyx_k_orangered), 0, 0, 1, 1}, {&__pyx_n_s_orangered1, __pyx_k_orangered1, sizeof(__pyx_k_orangered1), 0, 0, 1, 1}, {&__pyx_n_s_orangered2, __pyx_k_orangered2, sizeof(__pyx_k_orangered2), 0, 0, 1, 1}, {&__pyx_n_s_orangered3, __pyx_k_orangered3, sizeof(__pyx_k_orangered3), 0, 0, 1, 1}, {&__pyx_n_s_orangered4, __pyx_k_orangered4, sizeof(__pyx_k_orangered4), 0, 0, 1, 1}, {&__pyx_n_s_orchid, __pyx_k_orchid, sizeof(__pyx_k_orchid), 0, 0, 1, 1}, {&__pyx_n_s_orchid1, __pyx_k_orchid1, sizeof(__pyx_k_orchid1), 0, 0, 1, 1}, {&__pyx_n_s_orchid2, __pyx_k_orchid2, sizeof(__pyx_k_orchid2), 0, 0, 1, 1}, {&__pyx_n_s_orchid3, __pyx_k_orchid3, sizeof(__pyx_k_orchid3), 0, 0, 1, 1}, {&__pyx_n_s_orchid4, __pyx_k_orchid4, sizeof(__pyx_k_orchid4), 0, 0, 1, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_palegoldenrod, __pyx_k_palegoldenrod, sizeof(__pyx_k_palegoldenrod), 0, 0, 1, 1}, {&__pyx_n_s_palegreen, __pyx_k_palegreen, sizeof(__pyx_k_palegreen), 0, 0, 1, 1}, {&__pyx_n_s_palegreen1, __pyx_k_palegreen1, sizeof(__pyx_k_palegreen1), 0, 0, 1, 1}, {&__pyx_n_s_palegreen2, __pyx_k_palegreen2, sizeof(__pyx_k_palegreen2), 0, 0, 1, 1}, {&__pyx_n_s_palegreen3, __pyx_k_palegreen3, sizeof(__pyx_k_palegreen3), 0, 0, 1, 1}, {&__pyx_n_s_palegreen4, __pyx_k_palegreen4, sizeof(__pyx_k_palegreen4), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise, __pyx_k_paleturquoise, sizeof(__pyx_k_paleturquoise), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise1, __pyx_k_paleturquoise1, sizeof(__pyx_k_paleturquoise1), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise2, __pyx_k_paleturquoise2, sizeof(__pyx_k_paleturquoise2), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise3, __pyx_k_paleturquoise3, sizeof(__pyx_k_paleturquoise3), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise4, __pyx_k_paleturquoise4, sizeof(__pyx_k_paleturquoise4), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred, __pyx_k_palevioletred, sizeof(__pyx_k_palevioletred), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred1, __pyx_k_palevioletred1, sizeof(__pyx_k_palevioletred1), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred2, __pyx_k_palevioletred2, sizeof(__pyx_k_palevioletred2), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred3, __pyx_k_palevioletred3, sizeof(__pyx_k_palevioletred3), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred4, __pyx_k_palevioletred4, sizeof(__pyx_k_palevioletred4), 0, 0, 1, 1}, {&__pyx_n_s_papayawhip, __pyx_k_papayawhip, sizeof(__pyx_k_papayawhip), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff, __pyx_k_peachpuff, sizeof(__pyx_k_peachpuff), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff1, __pyx_k_peachpuff1, sizeof(__pyx_k_peachpuff1), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff2, __pyx_k_peachpuff2, sizeof(__pyx_k_peachpuff2), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff3, __pyx_k_peachpuff3, sizeof(__pyx_k_peachpuff3), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff4, __pyx_k_peachpuff4, sizeof(__pyx_k_peachpuff4), 0, 0, 1, 1}, {&__pyx_n_s_peru, __pyx_k_peru, sizeof(__pyx_k_peru), 0, 0, 1, 1}, {&__pyx_n_s_pink, __pyx_k_pink, sizeof(__pyx_k_pink), 0, 0, 1, 1}, {&__pyx_n_s_pink1, __pyx_k_pink1, sizeof(__pyx_k_pink1), 0, 0, 1, 1}, {&__pyx_n_s_pink2, __pyx_k_pink2, sizeof(__pyx_k_pink2), 0, 0, 1, 1}, {&__pyx_n_s_pink3, __pyx_k_pink3, sizeof(__pyx_k_pink3), 0, 0, 1, 1}, {&__pyx_n_s_pink4, __pyx_k_pink4, sizeof(__pyx_k_pink4), 0, 0, 1, 1}, {&__pyx_n_s_plum, __pyx_k_plum, sizeof(__pyx_k_plum), 0, 0, 1, 1}, {&__pyx_n_s_plum1, __pyx_k_plum1, sizeof(__pyx_k_plum1), 0, 0, 1, 1}, {&__pyx_n_s_plum2, __pyx_k_plum2, sizeof(__pyx_k_plum2), 0, 0, 1, 1}, {&__pyx_n_s_plum3, __pyx_k_plum3, sizeof(__pyx_k_plum3), 0, 0, 1, 1}, {&__pyx_n_s_plum4, __pyx_k_plum4, sizeof(__pyx_k_plum4), 0, 0, 1, 1}, {&__pyx_n_s_powderblue, __pyx_k_powderblue, sizeof(__pyx_k_powderblue), 0, 0, 1, 1}, {&__pyx_n_s_purple, __pyx_k_purple, sizeof(__pyx_k_purple), 0, 0, 1, 1}, {&__pyx_n_s_purple1, __pyx_k_purple1, sizeof(__pyx_k_purple1), 0, 0, 1, 1}, {&__pyx_n_s_purple2, __pyx_k_purple2, sizeof(__pyx_k_purple2), 0, 0, 1, 1}, {&__pyx_n_s_purple3, __pyx_k_purple3, sizeof(__pyx_k_purple3), 0, 0, 1, 1}, {&__pyx_n_s_purple4, __pyx_k_purple4, sizeof(__pyx_k_purple4), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_red, __pyx_k_red, sizeof(__pyx_k_red), 0, 0, 1, 1}, {&__pyx_n_s_red1, __pyx_k_red1, sizeof(__pyx_k_red1), 0, 0, 1, 1}, {&__pyx_n_s_red2, __pyx_k_red2, sizeof(__pyx_k_red2), 0, 0, 1, 1}, {&__pyx_n_s_red3, __pyx_k_red3, sizeof(__pyx_k_red3), 0, 0, 1, 1}, {&__pyx_n_s_red4, __pyx_k_red4, sizeof(__pyx_k_red4), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_rgba, __pyx_k_rgba, sizeof(__pyx_k_rgba), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown, __pyx_k_rosybrown, sizeof(__pyx_k_rosybrown), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown1, __pyx_k_rosybrown1, sizeof(__pyx_k_rosybrown1), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown2, __pyx_k_rosybrown2, sizeof(__pyx_k_rosybrown2), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown3, __pyx_k_rosybrown3, sizeof(__pyx_k_rosybrown3), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown4, __pyx_k_rosybrown4, sizeof(__pyx_k_rosybrown4), 0, 0, 1, 1}, {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1}, {&__pyx_n_s_royalblue, __pyx_k_royalblue, sizeof(__pyx_k_royalblue), 0, 0, 1, 1}, {&__pyx_n_s_royalblue1, __pyx_k_royalblue1, sizeof(__pyx_k_royalblue1), 0, 0, 1, 1}, {&__pyx_n_s_royalblue2, __pyx_k_royalblue2, sizeof(__pyx_k_royalblue2), 0, 0, 1, 1}, {&__pyx_n_s_royalblue3, __pyx_k_royalblue3, sizeof(__pyx_k_royalblue3), 0, 0, 1, 1}, {&__pyx_n_s_royalblue4, __pyx_k_royalblue4, sizeof(__pyx_k_royalblue4), 0, 0, 1, 1}, {&__pyx_n_s_saddlebrown, __pyx_k_saddlebrown, sizeof(__pyx_k_saddlebrown), 0, 0, 1, 1}, {&__pyx_n_s_salmon, __pyx_k_salmon, sizeof(__pyx_k_salmon), 0, 0, 1, 1}, {&__pyx_n_s_salmon1, __pyx_k_salmon1, sizeof(__pyx_k_salmon1), 0, 0, 1, 1}, {&__pyx_n_s_salmon2, __pyx_k_salmon2, sizeof(__pyx_k_salmon2), 0, 0, 1, 1}, {&__pyx_n_s_salmon3, __pyx_k_salmon3, sizeof(__pyx_k_salmon3), 0, 0, 1, 1}, {&__pyx_n_s_salmon4, __pyx_k_salmon4, sizeof(__pyx_k_salmon4), 0, 0, 1, 1}, {&__pyx_n_s_sandybrown, __pyx_k_sandybrown, sizeof(__pyx_k_sandybrown), 0, 0, 1, 1}, {&__pyx_n_s_seagreen, __pyx_k_seagreen, sizeof(__pyx_k_seagreen), 0, 0, 1, 1}, {&__pyx_n_s_seagreen1, __pyx_k_seagreen1, sizeof(__pyx_k_seagreen1), 0, 0, 1, 1}, {&__pyx_n_s_seagreen2, __pyx_k_seagreen2, sizeof(__pyx_k_seagreen2), 0, 0, 1, 1}, {&__pyx_n_s_seagreen3, __pyx_k_seagreen3, sizeof(__pyx_k_seagreen3), 0, 0, 1, 1}, {&__pyx_n_s_seagreen4, __pyx_k_seagreen4, sizeof(__pyx_k_seagreen4), 0, 0, 1, 1}, {&__pyx_n_s_seashell, __pyx_k_seashell, sizeof(__pyx_k_seashell), 0, 0, 1, 1}, {&__pyx_n_s_seashell1, __pyx_k_seashell1, sizeof(__pyx_k_seashell1), 0, 0, 1, 1}, {&__pyx_n_s_seashell2, __pyx_k_seashell2, sizeof(__pyx_k_seashell2), 0, 0, 1, 1}, {&__pyx_n_s_seashell3, __pyx_k_seashell3, sizeof(__pyx_k_seashell3), 0, 0, 1, 1}, {&__pyx_n_s_seashell4, __pyx_k_seashell4, sizeof(__pyx_k_seashell4), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_length, __pyx_k_set_length, sizeof(__pyx_k_set_length), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_sienna, __pyx_k_sienna, sizeof(__pyx_k_sienna), 0, 0, 1, 1}, {&__pyx_n_s_sienna1, __pyx_k_sienna1, sizeof(__pyx_k_sienna1), 0, 0, 1, 1}, {&__pyx_n_s_sienna2, __pyx_k_sienna2, sizeof(__pyx_k_sienna2), 0, 0, 1, 1}, {&__pyx_n_s_sienna3, __pyx_k_sienna3, sizeof(__pyx_k_sienna3), 0, 0, 1, 1}, {&__pyx_n_s_sienna4, __pyx_k_sienna4, sizeof(__pyx_k_sienna4), 0, 0, 1, 1}, {&__pyx_n_s_skyblue, __pyx_k_skyblue, sizeof(__pyx_k_skyblue), 0, 0, 1, 1}, {&__pyx_n_s_skyblue1, __pyx_k_skyblue1, sizeof(__pyx_k_skyblue1), 0, 0, 1, 1}, {&__pyx_n_s_skyblue2, __pyx_k_skyblue2, sizeof(__pyx_k_skyblue2), 0, 0, 1, 1}, {&__pyx_n_s_skyblue3, __pyx_k_skyblue3, sizeof(__pyx_k_skyblue3), 0, 0, 1, 1}, {&__pyx_n_s_skyblue4, __pyx_k_skyblue4, sizeof(__pyx_k_skyblue4), 0, 0, 1, 1}, {&__pyx_n_s_slateblue, __pyx_k_slateblue, sizeof(__pyx_k_slateblue), 0, 0, 1, 1}, {&__pyx_n_s_slateblue1, __pyx_k_slateblue1, sizeof(__pyx_k_slateblue1), 0, 0, 1, 1}, {&__pyx_n_s_slateblue2, __pyx_k_slateblue2, sizeof(__pyx_k_slateblue2), 0, 0, 1, 1}, {&__pyx_n_s_slateblue3, __pyx_k_slateblue3, sizeof(__pyx_k_slateblue3), 0, 0, 1, 1}, {&__pyx_n_s_slateblue4, __pyx_k_slateblue4, sizeof(__pyx_k_slateblue4), 0, 0, 1, 1}, {&__pyx_n_s_slategray, __pyx_k_slategray, sizeof(__pyx_k_slategray), 0, 0, 1, 1}, {&__pyx_n_s_slategray1, __pyx_k_slategray1, sizeof(__pyx_k_slategray1), 0, 0, 1, 1}, {&__pyx_n_s_slategray2, __pyx_k_slategray2, sizeof(__pyx_k_slategray2), 0, 0, 1, 1}, {&__pyx_n_s_slategray3, __pyx_k_slategray3, sizeof(__pyx_k_slategray3), 0, 0, 1, 1}, {&__pyx_n_s_slategray4, __pyx_k_slategray4, sizeof(__pyx_k_slategray4), 0, 0, 1, 1}, {&__pyx_n_s_slategrey, __pyx_k_slategrey, sizeof(__pyx_k_slategrey), 0, 0, 1, 1}, {&__pyx_n_s_snow, __pyx_k_snow, sizeof(__pyx_k_snow), 0, 0, 1, 1}, {&__pyx_n_s_snow1, __pyx_k_snow1, sizeof(__pyx_k_snow1), 0, 0, 1, 1}, {&__pyx_n_s_snow2, __pyx_k_snow2, sizeof(__pyx_k_snow2), 0, 0, 1, 1}, {&__pyx_n_s_snow3, __pyx_k_snow3, sizeof(__pyx_k_snow3), 0, 0, 1, 1}, {&__pyx_n_s_snow4, __pyx_k_snow4, sizeof(__pyx_k_snow4), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_n_s_springgreen, __pyx_k_springgreen, sizeof(__pyx_k_springgreen), 0, 0, 1, 1}, {&__pyx_n_s_springgreen1, __pyx_k_springgreen1, sizeof(__pyx_k_springgreen1), 0, 0, 1, 1}, {&__pyx_n_s_springgreen2, __pyx_k_springgreen2, sizeof(__pyx_k_springgreen2), 0, 0, 1, 1}, {&__pyx_n_s_springgreen3, __pyx_k_springgreen3, sizeof(__pyx_k_springgreen3), 0, 0, 1, 1}, {&__pyx_n_s_springgreen4, __pyx_k_springgreen4, sizeof(__pyx_k_springgreen4), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_k_src_pygame_sdl2_color_pyx, sizeof(__pyx_k_src_pygame_sdl2_color_pyx), 0, 0, 1, 0}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_steelblue, __pyx_k_steelblue, sizeof(__pyx_k_steelblue), 0, 0, 1, 1}, {&__pyx_n_s_steelblue1, __pyx_k_steelblue1, sizeof(__pyx_k_steelblue1), 0, 0, 1, 1}, {&__pyx_n_s_steelblue2, __pyx_k_steelblue2, sizeof(__pyx_k_steelblue2), 0, 0, 1, 1}, {&__pyx_n_s_steelblue3, __pyx_k_steelblue3, sizeof(__pyx_k_steelblue3), 0, 0, 1, 1}, {&__pyx_n_s_steelblue4, __pyx_k_steelblue4, sizeof(__pyx_k_steelblue4), 0, 0, 1, 1}, {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, {&__pyx_n_s_tan, __pyx_k_tan, sizeof(__pyx_k_tan), 0, 0, 1, 1}, {&__pyx_n_s_tan1, __pyx_k_tan1, sizeof(__pyx_k_tan1), 0, 0, 1, 1}, {&__pyx_n_s_tan2, __pyx_k_tan2, sizeof(__pyx_k_tan2), 0, 0, 1, 1}, {&__pyx_n_s_tan3, __pyx_k_tan3, sizeof(__pyx_k_tan3), 0, 0, 1, 1}, {&__pyx_n_s_tan4, __pyx_k_tan4, sizeof(__pyx_k_tan4), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_thistle, __pyx_k_thistle, sizeof(__pyx_k_thistle), 0, 0, 1, 1}, {&__pyx_n_s_thistle1, __pyx_k_thistle1, sizeof(__pyx_k_thistle1), 0, 0, 1, 1}, {&__pyx_n_s_thistle2, __pyx_k_thistle2, sizeof(__pyx_k_thistle2), 0, 0, 1, 1}, {&__pyx_n_s_thistle3, __pyx_k_thistle3, sizeof(__pyx_k_thistle3), 0, 0, 1, 1}, {&__pyx_n_s_thistle4, __pyx_k_thistle4, sizeof(__pyx_k_thistle4), 0, 0, 1, 1}, {&__pyx_n_s_tomato, __pyx_k_tomato, sizeof(__pyx_k_tomato), 0, 0, 1, 1}, {&__pyx_n_s_tomato1, __pyx_k_tomato1, sizeof(__pyx_k_tomato1), 0, 0, 1, 1}, {&__pyx_n_s_tomato2, __pyx_k_tomato2, sizeof(__pyx_k_tomato2), 0, 0, 1, 1}, {&__pyx_n_s_tomato3, __pyx_k_tomato3, sizeof(__pyx_k_tomato3), 0, 0, 1, 1}, {&__pyx_n_s_tomato4, __pyx_k_tomato4, sizeof(__pyx_k_tomato4), 0, 0, 1, 1}, {&__pyx_n_s_turquoise, __pyx_k_turquoise, sizeof(__pyx_k_turquoise), 0, 0, 1, 1}, {&__pyx_n_s_turquoise1, __pyx_k_turquoise1, sizeof(__pyx_k_turquoise1), 0, 0, 1, 1}, {&__pyx_n_s_turquoise2, __pyx_k_turquoise2, sizeof(__pyx_k_turquoise2), 0, 0, 1, 1}, {&__pyx_n_s_turquoise3, __pyx_k_turquoise3, sizeof(__pyx_k_turquoise3), 0, 0, 1, 1}, {&__pyx_n_s_turquoise4, __pyx_k_turquoise4, sizeof(__pyx_k_turquoise4), 0, 0, 1, 1}, {&__pyx_n_s_unhexlify, __pyx_k_unhexlify, sizeof(__pyx_k_unhexlify), 0, 0, 1, 1}, {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, {&__pyx_n_s_violet, __pyx_k_violet, sizeof(__pyx_k_violet), 0, 0, 1, 1}, {&__pyx_n_s_violetred, __pyx_k_violetred, sizeof(__pyx_k_violetred), 0, 0, 1, 1}, {&__pyx_n_s_violetred1, __pyx_k_violetred1, sizeof(__pyx_k_violetred1), 0, 0, 1, 1}, {&__pyx_n_s_violetred2, __pyx_k_violetred2, sizeof(__pyx_k_violetred2), 0, 0, 1, 1}, {&__pyx_n_s_violetred3, __pyx_k_violetred3, sizeof(__pyx_k_violetred3), 0, 0, 1, 1}, {&__pyx_n_s_violetred4, __pyx_k_violetred4, sizeof(__pyx_k_violetred4), 0, 0, 1, 1}, {&__pyx_n_s_wheat, __pyx_k_wheat, sizeof(__pyx_k_wheat), 0, 0, 1, 1}, {&__pyx_n_s_wheat1, __pyx_k_wheat1, sizeof(__pyx_k_wheat1), 0, 0, 1, 1}, {&__pyx_n_s_wheat2, __pyx_k_wheat2, sizeof(__pyx_k_wheat2), 0, 0, 1, 1}, {&__pyx_n_s_wheat3, __pyx_k_wheat3, sizeof(__pyx_k_wheat3), 0, 0, 1, 1}, {&__pyx_n_s_wheat4, __pyx_k_wheat4, sizeof(__pyx_k_wheat4), 0, 0, 1, 1}, {&__pyx_n_s_white, __pyx_k_white, sizeof(__pyx_k_white), 0, 0, 1, 1}, {&__pyx_n_s_whitesmoke, __pyx_k_whitesmoke, sizeof(__pyx_k_whitesmoke), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_yellow, __pyx_k_yellow, sizeof(__pyx_k_yellow), 0, 0, 1, 1}, {&__pyx_n_s_yellow1, __pyx_k_yellow1, sizeof(__pyx_k_yellow1), 0, 0, 1, 1}, {&__pyx_n_s_yellow2, __pyx_k_yellow2, sizeof(__pyx_k_yellow2), 0, 0, 1, 1}, {&__pyx_n_s_yellow3, __pyx_k_yellow3, sizeof(__pyx_k_yellow3), 0, 0, 1, 1}, {&__pyx_n_s_yellow4, __pyx_k_yellow4, sizeof(__pyx_k_yellow4), 0, 0, 1, 1}, {&__pyx_n_s_yellowgreen, __pyx_k_yellowgreen, sizeof(__pyx_k_yellowgreen), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 41, __pyx_L1_error) __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 94, __pyx_L1_error) __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_builtin_oct = __Pyx_GetBuiltinName(__pyx_n_s_oct); if (!__pyx_builtin_oct) __PYX_ERR(0, 156, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 173, __pyx_L1_error) __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 453, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/color.pyx":41 * return color * else: * raise TypeError("Expected a color.") # <<<<<<<<<<<<<< * * return SDL_MapRGBA(surface.format, r, g, b, a) */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Expected_a_color); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/color.pyx":123 * if isinstance(c, basestring): * if c.startswith('#'): * self.from_hex(c[1:]) # <<<<<<<<<<<<<< * elif c.startswith('0x'): * self.from_hex(c[2:]) */ __pyx_slice__4 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__4); __Pyx_GIVEREF(__pyx_slice__4); /* "pygame_sdl2/color.pyx":125 * self.from_hex(c[1:]) * elif c.startswith('0x'): * self.from_hex(c[2:]) # <<<<<<<<<<<<<< * else: * self.from_name(c) */ __pyx_slice__5 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__5); __Pyx_GIVEREF(__pyx_slice__5); /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_l, __pyx_n_s_r); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_mod, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 228, __pyx_L1_error) /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_div, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 251, __pyx_L1_error) /* "include/color_dict.pxi":5 * * cdef object colors = { * 'aliceblue' : (240, 248, 255), # <<<<<<<<<<<<<< * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), */ __pyx_tuple__11 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_248, __pyx_int_255); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "include/color_dict.pxi":6 * cdef object colors = { * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), # <<<<<<<<<<<<<< * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), */ __pyx_tuple__12 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_235, __pyx_int_215); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "include/color_dict.pxi":7 * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), # <<<<<<<<<<<<<< * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), */ __pyx_tuple__13 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_239, __pyx_int_219); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "include/color_dict.pxi":8 * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), # <<<<<<<<<<<<<< * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), */ __pyx_tuple__14 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_223, __pyx_int_204); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "include/color_dict.pxi":9 * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), # <<<<<<<<<<<<<< * 'antiquewhite4' : (139, 131, 120), * 'aquamarine' : (127, 255, 212), */ __pyx_tuple__15 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_192, __pyx_int_176); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "include/color_dict.pxi":10 * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), # <<<<<<<<<<<<<< * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), */ __pyx_tuple__16 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_131, __pyx_int_120); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "include/color_dict.pxi":11 * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), * 'aquamarine' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), */ __pyx_tuple__17 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_255, __pyx_int_212); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "include/color_dict.pxi":13 * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), # <<<<<<<<<<<<<< * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), */ __pyx_tuple__18 = PyTuple_Pack(3, __pyx_int_118, __pyx_int_238, __pyx_int_198); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "include/color_dict.pxi":14 * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), # <<<<<<<<<<<<<< * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), */ __pyx_tuple__19 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_205, __pyx_int_170); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "include/color_dict.pxi":15 * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), # <<<<<<<<<<<<<< * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), */ __pyx_tuple__20 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_139, __pyx_int_116); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); /* "include/color_dict.pxi":16 * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), */ __pyx_tuple__21 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "include/color_dict.pxi":18 * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), # <<<<<<<<<<<<<< * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), */ __pyx_tuple__22 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "include/color_dict.pxi":19 * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), # <<<<<<<<<<<<<< * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), */ __pyx_tuple__23 = PyTuple_Pack(3, __pyx_int_193, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); /* "include/color_dict.pxi":20 * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), # <<<<<<<<<<<<<< * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), */ __pyx_tuple__24 = PyTuple_Pack(3, __pyx_int_131, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "include/color_dict.pxi":21 * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), # <<<<<<<<<<<<<< * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), */ __pyx_tuple__25 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_245, __pyx_int_220); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "include/color_dict.pxi":22 * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), */ __pyx_tuple__26 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_196); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); /* "include/color_dict.pxi":24 * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), # <<<<<<<<<<<<<< * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), */ __pyx_tuple__27 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_213, __pyx_int_183); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "include/color_dict.pxi":25 * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), # <<<<<<<<<<<<<< * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), */ __pyx_tuple__28 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_183, __pyx_int_158); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); /* "include/color_dict.pxi":26 * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), # <<<<<<<<<<<<<< * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), */ __pyx_tuple__29 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_125, __pyx_int_107); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "include/color_dict.pxi":27 * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), # <<<<<<<<<<<<<< * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), */ __pyx_tuple__30 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "include/color_dict.pxi":28 * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), # <<<<<<<<<<<<<< * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), */ __pyx_tuple__31 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_235, __pyx_int_205); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "include/color_dict.pxi":29 * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), */ __pyx_tuple__32 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); /* "include/color_dict.pxi":31 * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), # <<<<<<<<<<<<<< * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), */ __pyx_tuple__33 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_238); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); /* "include/color_dict.pxi":32 * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), # <<<<<<<<<<<<<< * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), */ __pyx_tuple__34 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_205); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); /* "include/color_dict.pxi":33 * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), # <<<<<<<<<<<<<< * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), */ __pyx_tuple__35 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_139); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); /* "include/color_dict.pxi":34 * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), # <<<<<<<<<<<<<< * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), */ __pyx_tuple__36 = PyTuple_Pack(3, __pyx_int_138, __pyx_int_43, __pyx_int_226); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "include/color_dict.pxi":35 * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), # <<<<<<<<<<<<<< * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), */ __pyx_tuple__37 = PyTuple_Pack(3, __pyx_int_165, __pyx_int_42, __pyx_int_42); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); /* "include/color_dict.pxi":36 * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), # <<<<<<<<<<<<<< * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), */ __pyx_tuple__38 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_64, __pyx_int_64); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(2, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); /* "include/color_dict.pxi":37 * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), # <<<<<<<<<<<<<< * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), */ __pyx_tuple__39 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_59, __pyx_int_59); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(2, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); /* "include/color_dict.pxi":38 * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), # <<<<<<<<<<<<<< * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), */ __pyx_tuple__40 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_51, __pyx_int_51); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); /* "include/color_dict.pxi":39 * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), # <<<<<<<<<<<<<< * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), */ __pyx_tuple__41 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_35, __pyx_int_35); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); /* "include/color_dict.pxi":40 * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), # <<<<<<<<<<<<<< * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), */ __pyx_tuple__42 = PyTuple_Pack(3, __pyx_int_222, __pyx_int_184, __pyx_int_135); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); /* "include/color_dict.pxi":41 * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), # <<<<<<<<<<<<<< * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), */ __pyx_tuple__43 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_211, __pyx_int_155); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); /* "include/color_dict.pxi":42 * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), # <<<<<<<<<<<<<< * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), */ __pyx_tuple__44 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_197, __pyx_int_145); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); /* "include/color_dict.pxi":43 * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), # <<<<<<<<<<<<<< * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), */ __pyx_tuple__45 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_170, __pyx_int_125); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); /* "include/color_dict.pxi":44 * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), # <<<<<<<<<<<<<< * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), */ __pyx_tuple__46 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_115, __pyx_int_85); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); /* "include/color_dict.pxi":45 * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), # <<<<<<<<<<<<<< * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), */ __pyx_tuple__47 = PyTuple_Pack(3, __pyx_int_95, __pyx_int_158, __pyx_int_160); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); /* "include/color_dict.pxi":46 * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), # <<<<<<<<<<<<<< * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), */ __pyx_tuple__48 = PyTuple_Pack(3, __pyx_int_152, __pyx_int_245, __pyx_int_255); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(2, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); /* "include/color_dict.pxi":47 * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), # <<<<<<<<<<<<<< * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), */ __pyx_tuple__49 = PyTuple_Pack(3, __pyx_int_142, __pyx_int_229, __pyx_int_238); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); /* "include/color_dict.pxi":48 * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), # <<<<<<<<<<<<<< * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), */ __pyx_tuple__50 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_197, __pyx_int_205); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(2, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); /* "include/color_dict.pxi":49 * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), # <<<<<<<<<<<<<< * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), */ __pyx_tuple__51 = PyTuple_Pack(3, __pyx_int_83, __pyx_int_134, __pyx_int_139); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(2, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); /* "include/color_dict.pxi":50 * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), */ __pyx_tuple__52 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(2, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); /* "include/color_dict.pxi":52 * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), # <<<<<<<<<<<<<< * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), */ __pyx_tuple__53 = PyTuple_Pack(3, __pyx_int_118, __pyx_int_238, __pyx_int_0); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(2, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); /* "include/color_dict.pxi":53 * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), # <<<<<<<<<<<<<< * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), */ __pyx_tuple__54 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_205, __pyx_int_0); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(2, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); /* "include/color_dict.pxi":54 * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), # <<<<<<<<<<<<<< * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), */ __pyx_tuple__55 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_139, __pyx_int_0); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(2, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); /* "include/color_dict.pxi":55 * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), # <<<<<<<<<<<<<< * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), */ __pyx_tuple__56 = PyTuple_Pack(3, __pyx_int_210, __pyx_int_105, __pyx_int_30); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(2, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); /* "include/color_dict.pxi":56 * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), # <<<<<<<<<<<<<< * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), */ __pyx_tuple__57 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_127, __pyx_int_36); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(2, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); /* "include/color_dict.pxi":57 * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), # <<<<<<<<<<<<<< * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), */ __pyx_tuple__58 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_118, __pyx_int_33); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(2, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); /* "include/color_dict.pxi":58 * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), # <<<<<<<<<<<<<< * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), */ __pyx_tuple__59 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_102, __pyx_int_29); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(2, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); /* "include/color_dict.pxi":59 * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), # <<<<<<<<<<<<<< * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), */ __pyx_tuple__60 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_69, __pyx_int_19); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(2, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); /* "include/color_dict.pxi":60 * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), # <<<<<<<<<<<<<< * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), */ __pyx_tuple__61 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_127, __pyx_int_80); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(2, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); /* "include/color_dict.pxi":61 * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), # <<<<<<<<<<<<<< * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), */ __pyx_tuple__62 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_114, __pyx_int_86); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(2, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); /* "include/color_dict.pxi":62 * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), # <<<<<<<<<<<<<< * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), */ __pyx_tuple__63 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_106, __pyx_int_80); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(2, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); /* "include/color_dict.pxi":63 * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), # <<<<<<<<<<<<<< * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), */ __pyx_tuple__64 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_91, __pyx_int_69); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(2, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); /* "include/color_dict.pxi":64 * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), # <<<<<<<<<<<<<< * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), */ __pyx_tuple__65 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_62, __pyx_int_47); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(2, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); /* "include/color_dict.pxi":65 * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), # <<<<<<<<<<<<<< * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), */ __pyx_tuple__66 = PyTuple_Pack(3, __pyx_int_100, __pyx_int_149, __pyx_int_237); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); /* "include/color_dict.pxi":66 * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), */ __pyx_tuple__67 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_248, __pyx_int_220); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(2, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); /* "include/color_dict.pxi":68 * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), # <<<<<<<<<<<<<< * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), */ __pyx_tuple__68 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_232, __pyx_int_205); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(2, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); /* "include/color_dict.pxi":69 * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), # <<<<<<<<<<<<<< * 'cornsilk4' : (139, 136, 120), * 'cyan' : (0, 255, 255), */ __pyx_tuple__69 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_200, __pyx_int_177); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(2, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); /* "include/color_dict.pxi":70 * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), # <<<<<<<<<<<<<< * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), */ __pyx_tuple__70 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_136, __pyx_int_120); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(2, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70); /* "include/color_dict.pxi":71 * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), * 'cyan' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), */ __pyx_tuple__71 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(2, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); /* "include/color_dict.pxi":73 * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), # <<<<<<<<<<<<<< * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), */ __pyx_tuple__72 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(2, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); /* "include/color_dict.pxi":74 * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), # <<<<<<<<<<<<<< * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), */ __pyx_tuple__73 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(2, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73); /* "include/color_dict.pxi":75 * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), */ __pyx_tuple__74 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(2, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); /* "include/color_dict.pxi":78 * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), # <<<<<<<<<<<<<< * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), */ __pyx_tuple__75 = PyTuple_Pack(3, __pyx_int_184, __pyx_int_134, __pyx_int_11); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(2, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); /* "include/color_dict.pxi":79 * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), # <<<<<<<<<<<<<< * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), */ __pyx_tuple__76 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_185, __pyx_int_15); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(2, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); /* "include/color_dict.pxi":80 * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), # <<<<<<<<<<<<<< * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), */ __pyx_tuple__77 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_173, __pyx_int_14); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(2, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__77); __Pyx_GIVEREF(__pyx_tuple__77); /* "include/color_dict.pxi":81 * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), # <<<<<<<<<<<<<< * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), */ __pyx_tuple__78 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_149, __pyx_int_12); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(2, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); /* "include/color_dict.pxi":82 * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), # <<<<<<<<<<<<<< * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), */ __pyx_tuple__79 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_101, __pyx_int_8); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(2, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); /* "include/color_dict.pxi":83 * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), */ __pyx_tuple__80 = PyTuple_Pack(3, __pyx_int_169, __pyx_int_169, __pyx_int_169); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(2, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__80); __Pyx_GIVEREF(__pyx_tuple__80); /* "include/color_dict.pxi":84 * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), # <<<<<<<<<<<<<< * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), */ __pyx_tuple__81 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_100, __pyx_int_0); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(2, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); /* "include/color_dict.pxi":86 * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), # <<<<<<<<<<<<<< * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), */ __pyx_tuple__82 = PyTuple_Pack(3, __pyx_int_189, __pyx_int_183, __pyx_int_107); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(2, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__82); __Pyx_GIVEREF(__pyx_tuple__82); /* "include/color_dict.pxi":87 * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), # <<<<<<<<<<<<<< * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), */ __pyx_tuple__83 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_0, __pyx_int_139); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(2, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); /* "include/color_dict.pxi":88 * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), # <<<<<<<<<<<<<< * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), */ __pyx_tuple__84 = PyTuple_Pack(3, __pyx_int_85, __pyx_int_107, __pyx_int_47); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(2, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84); /* "include/color_dict.pxi":89 * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), # <<<<<<<<<<<<<< * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), */ __pyx_tuple__85 = PyTuple_Pack(3, __pyx_int_202, __pyx_int_255, __pyx_int_112); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(2, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__85); __Pyx_GIVEREF(__pyx_tuple__85); /* "include/color_dict.pxi":90 * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), # <<<<<<<<<<<<<< * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), */ __pyx_tuple__86 = PyTuple_Pack(3, __pyx_int_188, __pyx_int_238, __pyx_int_104); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(2, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__86); __Pyx_GIVEREF(__pyx_tuple__86); /* "include/color_dict.pxi":91 * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), # <<<<<<<<<<<<<< * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), */ __pyx_tuple__87 = PyTuple_Pack(3, __pyx_int_162, __pyx_int_205, __pyx_int_90); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(2, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87); /* "include/color_dict.pxi":92 * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), # <<<<<<<<<<<<<< * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), */ __pyx_tuple__88 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_139, __pyx_int_61); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(2, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__88); __Pyx_GIVEREF(__pyx_tuple__88); /* "include/color_dict.pxi":93 * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), # <<<<<<<<<<<<<< * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), */ __pyx_tuple__89 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_140, __pyx_int_0); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(2, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89); /* "include/color_dict.pxi":94 * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), # <<<<<<<<<<<<<< * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), */ __pyx_tuple__90 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_127, __pyx_int_0); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(2, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__90); __Pyx_GIVEREF(__pyx_tuple__90); /* "include/color_dict.pxi":95 * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), # <<<<<<<<<<<<<< * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), */ __pyx_tuple__91 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_118, __pyx_int_0); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(2, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__91); __Pyx_GIVEREF(__pyx_tuple__91); /* "include/color_dict.pxi":96 * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), # <<<<<<<<<<<<<< * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), */ __pyx_tuple__92 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_102, __pyx_int_0); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(2, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__92); __Pyx_GIVEREF(__pyx_tuple__92); /* "include/color_dict.pxi":97 * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), # <<<<<<<<<<<<<< * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), */ __pyx_tuple__93 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_69, __pyx_int_0); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(2, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__93); __Pyx_GIVEREF(__pyx_tuple__93); /* "include/color_dict.pxi":98 * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), # <<<<<<<<<<<<<< * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), */ __pyx_tuple__94 = PyTuple_Pack(3, __pyx_int_153, __pyx_int_50, __pyx_int_204); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(2, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__94); __Pyx_GIVEREF(__pyx_tuple__94); /* "include/color_dict.pxi":99 * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), # <<<<<<<<<<<<<< * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), */ __pyx_tuple__95 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_62, __pyx_int_255); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(2, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__95); __Pyx_GIVEREF(__pyx_tuple__95); /* "include/color_dict.pxi":100 * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), # <<<<<<<<<<<<<< * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), */ __pyx_tuple__96 = PyTuple_Pack(3, __pyx_int_178, __pyx_int_58, __pyx_int_238); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(2, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__96); __Pyx_GIVEREF(__pyx_tuple__96); /* "include/color_dict.pxi":101 * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), # <<<<<<<<<<<<<< * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), */ __pyx_tuple__97 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_50, __pyx_int_205); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(2, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__97); __Pyx_GIVEREF(__pyx_tuple__97); /* "include/color_dict.pxi":102 * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), # <<<<<<<<<<<<<< * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), */ __pyx_tuple__98 = PyTuple_Pack(3, __pyx_int_104, __pyx_int_34, __pyx_int_139); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(2, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__98); __Pyx_GIVEREF(__pyx_tuple__98); /* "include/color_dict.pxi":103 * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), # <<<<<<<<<<<<<< * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), */ __pyx_tuple__99 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(2, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__99); __Pyx_GIVEREF(__pyx_tuple__99); /* "include/color_dict.pxi":104 * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), # <<<<<<<<<<<<<< * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), */ __pyx_tuple__100 = PyTuple_Pack(3, __pyx_int_233, __pyx_int_150, __pyx_int_122); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(2, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__100); __Pyx_GIVEREF(__pyx_tuple__100); /* "include/color_dict.pxi":105 * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), # <<<<<<<<<<<<<< * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), */ __pyx_tuple__101 = PyTuple_Pack(3, __pyx_int_143, __pyx_int_188, __pyx_int_143); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(2, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__101); __Pyx_GIVEREF(__pyx_tuple__101); /* "include/color_dict.pxi":106 * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), # <<<<<<<<<<<<<< * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), */ __pyx_tuple__102 = PyTuple_Pack(3, __pyx_int_193, __pyx_int_255, __pyx_int_193); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(2, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__102); __Pyx_GIVEREF(__pyx_tuple__102); /* "include/color_dict.pxi":107 * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), # <<<<<<<<<<<<<< * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), */ __pyx_tuple__103 = PyTuple_Pack(3, __pyx_int_180, __pyx_int_238, __pyx_int_180); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(2, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__103); __Pyx_GIVEREF(__pyx_tuple__103); /* "include/color_dict.pxi":108 * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), # <<<<<<<<<<<<<< * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), */ __pyx_tuple__104 = PyTuple_Pack(3, __pyx_int_155, __pyx_int_205, __pyx_int_155); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(2, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__104); __Pyx_GIVEREF(__pyx_tuple__104); /* "include/color_dict.pxi":109 * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), # <<<<<<<<<<<<<< * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), */ __pyx_tuple__105 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_139, __pyx_int_105); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(2, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__105); __Pyx_GIVEREF(__pyx_tuple__105); /* "include/color_dict.pxi":110 * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), # <<<<<<<<<<<<<< * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), */ __pyx_tuple__106 = PyTuple_Pack(3, __pyx_int_72, __pyx_int_61, __pyx_int_139); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(2, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__106); __Pyx_GIVEREF(__pyx_tuple__106); /* "include/color_dict.pxi":111 * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), */ __pyx_tuple__107 = PyTuple_Pack(3, __pyx_int_47, __pyx_int_79, __pyx_int_79); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(2, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__107); __Pyx_GIVEREF(__pyx_tuple__107); /* "include/color_dict.pxi":112 * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), # <<<<<<<<<<<<<< * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), */ __pyx_tuple__108 = PyTuple_Pack(3, __pyx_int_151, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(2, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__108); __Pyx_GIVEREF(__pyx_tuple__108); /* "include/color_dict.pxi":113 * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), # <<<<<<<<<<<<<< * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), */ __pyx_tuple__109 = PyTuple_Pack(3, __pyx_int_141, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(2, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__109); __Pyx_GIVEREF(__pyx_tuple__109); /* "include/color_dict.pxi":114 * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), # <<<<<<<<<<<<<< * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), */ __pyx_tuple__110 = PyTuple_Pack(3, __pyx_int_121, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(2, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__110); __Pyx_GIVEREF(__pyx_tuple__110); /* "include/color_dict.pxi":115 * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), # <<<<<<<<<<<<<< * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), */ __pyx_tuple__111 = PyTuple_Pack(3, __pyx_int_82, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(2, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__111); __Pyx_GIVEREF(__pyx_tuple__111); /* "include/color_dict.pxi":117 * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), # <<<<<<<<<<<<<< * 'darkviolet' : (148, 0, 211), * 'debianred' : (215, 7, 81), */ __pyx_tuple__112 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_206, __pyx_int_209); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(2, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__112); __Pyx_GIVEREF(__pyx_tuple__112); /* "include/color_dict.pxi":118 * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), # <<<<<<<<<<<<<< * 'debianred' : (215, 7, 81), * 'deeppink' : (255, 20, 147), */ __pyx_tuple__113 = PyTuple_Pack(3, __pyx_int_148, __pyx_int_0, __pyx_int_211); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(2, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__113); __Pyx_GIVEREF(__pyx_tuple__113); /* "include/color_dict.pxi":119 * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), * 'debianred' : (215, 7, 81), # <<<<<<<<<<<<<< * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), */ __pyx_tuple__114 = PyTuple_Pack(3, __pyx_int_215, __pyx_int_7, __pyx_int_81); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(2, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__114); __Pyx_GIVEREF(__pyx_tuple__114); /* "include/color_dict.pxi":120 * 'darkviolet' : (148, 0, 211), * 'debianred' : (215, 7, 81), * 'deeppink' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), */ __pyx_tuple__115 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_20, __pyx_int_147); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(2, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__115); __Pyx_GIVEREF(__pyx_tuple__115); /* "include/color_dict.pxi":122 * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), # <<<<<<<<<<<<<< * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), */ __pyx_tuple__116 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_18, __pyx_int_137); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(2, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__116); __Pyx_GIVEREF(__pyx_tuple__116); /* "include/color_dict.pxi":123 * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), # <<<<<<<<<<<<<< * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), */ __pyx_tuple__117 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_16, __pyx_int_118); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(2, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__117); __Pyx_GIVEREF(__pyx_tuple__117); /* "include/color_dict.pxi":124 * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), # <<<<<<<<<<<<<< * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), */ __pyx_tuple__118 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_10, __pyx_int_80); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(2, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__118); __Pyx_GIVEREF(__pyx_tuple__118); /* "include/color_dict.pxi":125 * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), */ __pyx_tuple__119 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_191, __pyx_int_255); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(2, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__119); __Pyx_GIVEREF(__pyx_tuple__119); /* "include/color_dict.pxi":127 * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), # <<<<<<<<<<<<<< * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), */ __pyx_tuple__120 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_178, __pyx_int_238); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(2, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__120); __Pyx_GIVEREF(__pyx_tuple__120); /* "include/color_dict.pxi":128 * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), # <<<<<<<<<<<<<< * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), */ __pyx_tuple__121 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_154, __pyx_int_205); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(2, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__121); __Pyx_GIVEREF(__pyx_tuple__121); /* "include/color_dict.pxi":129 * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), # <<<<<<<<<<<<<< * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), */ __pyx_tuple__122 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_104, __pyx_int_139); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(2, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__122); __Pyx_GIVEREF(__pyx_tuple__122); /* "include/color_dict.pxi":130 * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), */ __pyx_tuple__123 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(2, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__123); __Pyx_GIVEREF(__pyx_tuple__123); /* "include/color_dict.pxi":132 * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), */ __pyx_tuple__124 = PyTuple_Pack(3, __pyx_int_30, __pyx_int_144, __pyx_int_255); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(2, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__124); __Pyx_GIVEREF(__pyx_tuple__124); /* "include/color_dict.pxi":134 * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), # <<<<<<<<<<<<<< * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), */ __pyx_tuple__125 = PyTuple_Pack(3, __pyx_int_28, __pyx_int_134, __pyx_int_238); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__125); __Pyx_GIVEREF(__pyx_tuple__125); /* "include/color_dict.pxi":135 * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), # <<<<<<<<<<<<<< * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), */ __pyx_tuple__126 = PyTuple_Pack(3, __pyx_int_24, __pyx_int_116, __pyx_int_205); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(2, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__126); __Pyx_GIVEREF(__pyx_tuple__126); /* "include/color_dict.pxi":136 * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), # <<<<<<<<<<<<<< * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), */ __pyx_tuple__127 = PyTuple_Pack(3, __pyx_int_16, __pyx_int_78, __pyx_int_139); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(2, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__127); __Pyx_GIVEREF(__pyx_tuple__127); /* "include/color_dict.pxi":137 * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), # <<<<<<<<<<<<<< * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), */ __pyx_tuple__128 = PyTuple_Pack(3, __pyx_int_178, __pyx_int_34, __pyx_int_34); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__128); __Pyx_GIVEREF(__pyx_tuple__128); /* "include/color_dict.pxi":138 * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), # <<<<<<<<<<<<<< * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), */ __pyx_tuple__129 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_48, __pyx_int_48); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__129); __Pyx_GIVEREF(__pyx_tuple__129); /* "include/color_dict.pxi":139 * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), # <<<<<<<<<<<<<< * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), */ __pyx_tuple__130 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_44, __pyx_int_44); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(2, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__130); __Pyx_GIVEREF(__pyx_tuple__130); /* "include/color_dict.pxi":140 * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), # <<<<<<<<<<<<<< * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), */ __pyx_tuple__131 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_38, __pyx_int_38); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__131); __Pyx_GIVEREF(__pyx_tuple__131); /* "include/color_dict.pxi":141 * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), # <<<<<<<<<<<<<< * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), */ __pyx_tuple__132 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_26, __pyx_int_26); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(2, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__132); __Pyx_GIVEREF(__pyx_tuple__132); /* "include/color_dict.pxi":142 * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), # <<<<<<<<<<<<<< * 'forestgreen' : (34, 139, 34), * 'gainsboro' : (220, 220, 220), */ __pyx_tuple__133 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_240); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(2, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__133); __Pyx_GIVEREF(__pyx_tuple__133); /* "include/color_dict.pxi":143 * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), # <<<<<<<<<<<<<< * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), */ __pyx_tuple__134 = PyTuple_Pack(3, __pyx_int_34, __pyx_int_139, __pyx_int_34); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(2, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__134); __Pyx_GIVEREF(__pyx_tuple__134); /* "include/color_dict.pxi":144 * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), * 'gainsboro' : (220, 220, 220), # <<<<<<<<<<<<<< * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), */ __pyx_tuple__135 = PyTuple_Pack(3, __pyx_int_220, __pyx_int_220, __pyx_int_220); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__135); __Pyx_GIVEREF(__pyx_tuple__135); /* "include/color_dict.pxi":145 * 'forestgreen' : (34, 139, 34), * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), # <<<<<<<<<<<<<< * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), */ __pyx_tuple__136 = PyTuple_Pack(3, __pyx_int_248, __pyx_int_248, __pyx_int_255); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(2, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__136); __Pyx_GIVEREF(__pyx_tuple__136); /* "include/color_dict.pxi":146 * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), */ __pyx_tuple__137 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_215, __pyx_int_0); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(2, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__137); __Pyx_GIVEREF(__pyx_tuple__137); /* "include/color_dict.pxi":148 * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), # <<<<<<<<<<<<<< * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), */ __pyx_tuple__138 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_201, __pyx_int_0); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__138); __Pyx_GIVEREF(__pyx_tuple__138); /* "include/color_dict.pxi":149 * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), # <<<<<<<<<<<<<< * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), */ __pyx_tuple__139 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_173, __pyx_int_0); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__139); __Pyx_GIVEREF(__pyx_tuple__139); /* "include/color_dict.pxi":150 * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), # <<<<<<<<<<<<<< * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), */ __pyx_tuple__140 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_117, __pyx_int_0); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(2, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__140); __Pyx_GIVEREF(__pyx_tuple__140); /* "include/color_dict.pxi":151 * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), # <<<<<<<<<<<<<< * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), */ __pyx_tuple__141 = PyTuple_Pack(3, __pyx_int_218, __pyx_int_165, __pyx_int_32); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__141); __Pyx_GIVEREF(__pyx_tuple__141); /* "include/color_dict.pxi":152 * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), # <<<<<<<<<<<<<< * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), */ __pyx_tuple__142 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_193, __pyx_int_37); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__142); __Pyx_GIVEREF(__pyx_tuple__142); /* "include/color_dict.pxi":153 * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), # <<<<<<<<<<<<<< * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), */ __pyx_tuple__143 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_180, __pyx_int_34); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(2, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__143); __Pyx_GIVEREF(__pyx_tuple__143); /* "include/color_dict.pxi":154 * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), # <<<<<<<<<<<<<< * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), */ __pyx_tuple__144 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_155, __pyx_int_29); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__144); __Pyx_GIVEREF(__pyx_tuple__144); /* "include/color_dict.pxi":155 * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), # <<<<<<<<<<<<<< * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), */ __pyx_tuple__145 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_105, __pyx_int_20); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(2, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__145); __Pyx_GIVEREF(__pyx_tuple__145); /* "include/color_dict.pxi":156 * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), # <<<<<<<<<<<<<< * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), */ __pyx_tuple__146 = PyTuple_Pack(3, __pyx_int_190, __pyx_int_190, __pyx_int_190); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(2, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__146); __Pyx_GIVEREF(__pyx_tuple__146); /* "include/color_dict.pxi":158 * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), */ __pyx_tuple__147 = PyTuple_Pack(3, __pyx_int_3, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(2, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__147); __Pyx_GIVEREF(__pyx_tuple__147); /* "include/color_dict.pxi":159 * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), */ __pyx_tuple__148 = PyTuple_Pack(3, __pyx_int_26, __pyx_int_26, __pyx_int_26); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(2, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__148); __Pyx_GIVEREF(__pyx_tuple__148); /* "include/color_dict.pxi":160 * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), */ __pyx_tuple__149 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(2, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__149); __Pyx_GIVEREF(__pyx_tuple__149); /* "include/color_dict.pxi":161 * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), */ __pyx_tuple__150 = PyTuple_Pack(3, __pyx_int_28, __pyx_int_28, __pyx_int_28); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(2, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__150); __Pyx_GIVEREF(__pyx_tuple__150); /* "include/color_dict.pxi":162 * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), */ __pyx_tuple__151 = PyTuple_Pack(3, __pyx_int_31, __pyx_int_31, __pyx_int_31); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(2, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__151); __Pyx_GIVEREF(__pyx_tuple__151); /* "include/color_dict.pxi":163 * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), */ __pyx_tuple__152 = PyTuple_Pack(3, __pyx_int_33, __pyx_int_33, __pyx_int_33); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(2, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__152); __Pyx_GIVEREF(__pyx_tuple__152); /* "include/color_dict.pxi":164 * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), */ __pyx_tuple__153 = PyTuple_Pack(3, __pyx_int_36, __pyx_int_36, __pyx_int_36); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(2, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__153); __Pyx_GIVEREF(__pyx_tuple__153); /* "include/color_dict.pxi":165 * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), */ __pyx_tuple__154 = PyTuple_Pack(3, __pyx_int_38, __pyx_int_38, __pyx_int_38); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__154); __Pyx_GIVEREF(__pyx_tuple__154); /* "include/color_dict.pxi":166 * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), */ __pyx_tuple__155 = PyTuple_Pack(3, __pyx_int_41, __pyx_int_41, __pyx_int_41); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(2, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__155); __Pyx_GIVEREF(__pyx_tuple__155); /* "include/color_dict.pxi":167 * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), */ __pyx_tuple__156 = PyTuple_Pack(3, __pyx_int_43, __pyx_int_43, __pyx_int_43); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(2, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__156); __Pyx_GIVEREF(__pyx_tuple__156); /* "include/color_dict.pxi":168 * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), */ __pyx_tuple__157 = PyTuple_Pack(3, __pyx_int_46, __pyx_int_46, __pyx_int_46); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(2, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__157); __Pyx_GIVEREF(__pyx_tuple__157); /* "include/color_dict.pxi":169 * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), */ __pyx_tuple__158 = PyTuple_Pack(3, __pyx_int_48, __pyx_int_48, __pyx_int_48); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(2, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__158); __Pyx_GIVEREF(__pyx_tuple__158); /* "include/color_dict.pxi":170 * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), */ __pyx_tuple__159 = PyTuple_Pack(3, __pyx_int_5, __pyx_int_5, __pyx_int_5); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(2, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__159); __Pyx_GIVEREF(__pyx_tuple__159); /* "include/color_dict.pxi":171 * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), */ __pyx_tuple__160 = PyTuple_Pack(3, __pyx_int_51, __pyx_int_51, __pyx_int_51); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(2, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__160); __Pyx_GIVEREF(__pyx_tuple__160); /* "include/color_dict.pxi":172 * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), */ __pyx_tuple__161 = PyTuple_Pack(3, __pyx_int_54, __pyx_int_54, __pyx_int_54); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(2, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__161); __Pyx_GIVEREF(__pyx_tuple__161); /* "include/color_dict.pxi":173 * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), */ __pyx_tuple__162 = PyTuple_Pack(3, __pyx_int_56, __pyx_int_56, __pyx_int_56); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__162); __Pyx_GIVEREF(__pyx_tuple__162); /* "include/color_dict.pxi":174 * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), */ __pyx_tuple__163 = PyTuple_Pack(3, __pyx_int_59, __pyx_int_59, __pyx_int_59); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(2, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__163); __Pyx_GIVEREF(__pyx_tuple__163); /* "include/color_dict.pxi":175 * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), */ __pyx_tuple__164 = PyTuple_Pack(3, __pyx_int_61, __pyx_int_61, __pyx_int_61); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(2, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__164); __Pyx_GIVEREF(__pyx_tuple__164); /* "include/color_dict.pxi":176 * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), */ __pyx_tuple__165 = PyTuple_Pack(3, __pyx_int_64, __pyx_int_64, __pyx_int_64); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__165); __Pyx_GIVEREF(__pyx_tuple__165); /* "include/color_dict.pxi":177 * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), */ __pyx_tuple__166 = PyTuple_Pack(3, __pyx_int_66, __pyx_int_66, __pyx_int_66); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__166); __Pyx_GIVEREF(__pyx_tuple__166); /* "include/color_dict.pxi":178 * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), */ __pyx_tuple__167 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_69, __pyx_int_69); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(2, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__167); __Pyx_GIVEREF(__pyx_tuple__167); /* "include/color_dict.pxi":179 * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), */ __pyx_tuple__168 = PyTuple_Pack(3, __pyx_int_71, __pyx_int_71, __pyx_int_71); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(2, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__168); __Pyx_GIVEREF(__pyx_tuple__168); /* "include/color_dict.pxi":180 * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), */ __pyx_tuple__169 = PyTuple_Pack(3, __pyx_int_74, __pyx_int_74, __pyx_int_74); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(2, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__169); __Pyx_GIVEREF(__pyx_tuple__169); /* "include/color_dict.pxi":181 * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), */ __pyx_tuple__170 = PyTuple_Pack(3, __pyx_int_8, __pyx_int_8, __pyx_int_8); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(2, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__170); __Pyx_GIVEREF(__pyx_tuple__170); /* "include/color_dict.pxi":182 * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), */ __pyx_tuple__171 = PyTuple_Pack(3, __pyx_int_77, __pyx_int_77, __pyx_int_77); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(2, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__171); __Pyx_GIVEREF(__pyx_tuple__171); /* "include/color_dict.pxi":183 * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), */ __pyx_tuple__172 = PyTuple_Pack(3, __pyx_int_79, __pyx_int_79, __pyx_int_79); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(2, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__172); __Pyx_GIVEREF(__pyx_tuple__172); /* "include/color_dict.pxi":184 * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), */ __pyx_tuple__173 = PyTuple_Pack(3, __pyx_int_82, __pyx_int_82, __pyx_int_82); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(2, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__173); __Pyx_GIVEREF(__pyx_tuple__173); /* "include/color_dict.pxi":185 * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), */ __pyx_tuple__174 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_84, __pyx_int_84); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(2, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__174); __Pyx_GIVEREF(__pyx_tuple__174); /* "include/color_dict.pxi":186 * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), */ __pyx_tuple__175 = PyTuple_Pack(3, __pyx_int_87, __pyx_int_87, __pyx_int_87); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(2, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__175); __Pyx_GIVEREF(__pyx_tuple__175); /* "include/color_dict.pxi":187 * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), */ __pyx_tuple__176 = PyTuple_Pack(3, __pyx_int_89, __pyx_int_89, __pyx_int_89); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(2, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__176); __Pyx_GIVEREF(__pyx_tuple__176); /* "include/color_dict.pxi":188 * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), */ __pyx_tuple__177 = PyTuple_Pack(3, __pyx_int_92, __pyx_int_92, __pyx_int_92); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(2, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__177); __Pyx_GIVEREF(__pyx_tuple__177); /* "include/color_dict.pxi":189 * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), */ __pyx_tuple__178 = PyTuple_Pack(3, __pyx_int_94, __pyx_int_94, __pyx_int_94); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(2, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__178); __Pyx_GIVEREF(__pyx_tuple__178); /* "include/color_dict.pxi":190 * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), */ __pyx_tuple__179 = PyTuple_Pack(3, __pyx_int_97, __pyx_int_97, __pyx_int_97); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(2, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__179); __Pyx_GIVEREF(__pyx_tuple__179); /* "include/color_dict.pxi":191 * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), */ __pyx_tuple__180 = PyTuple_Pack(3, __pyx_int_99, __pyx_int_99, __pyx_int_99); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__180); __Pyx_GIVEREF(__pyx_tuple__180); /* "include/color_dict.pxi":192 * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), */ __pyx_tuple__181 = PyTuple_Pack(3, __pyx_int_10, __pyx_int_10, __pyx_int_10); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(2, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__181); __Pyx_GIVEREF(__pyx_tuple__181); /* "include/color_dict.pxi":193 * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), */ __pyx_tuple__182 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_102, __pyx_int_102); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__182); __Pyx_GIVEREF(__pyx_tuple__182); /* "include/color_dict.pxi":195 * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), */ __pyx_tuple__183 = PyTuple_Pack(3, __pyx_int_107, __pyx_int_107, __pyx_int_107); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(2, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__183); __Pyx_GIVEREF(__pyx_tuple__183); /* "include/color_dict.pxi":196 * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), */ __pyx_tuple__184 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_110, __pyx_int_110); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(2, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__184); __Pyx_GIVEREF(__pyx_tuple__184); /* "include/color_dict.pxi":197 * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), */ __pyx_tuple__185 = PyTuple_Pack(3, __pyx_int_112, __pyx_int_112, __pyx_int_112); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(2, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__185); __Pyx_GIVEREF(__pyx_tuple__185); /* "include/color_dict.pxi":198 * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), */ __pyx_tuple__186 = PyTuple_Pack(3, __pyx_int_115, __pyx_int_115, __pyx_int_115); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(2, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__186); __Pyx_GIVEREF(__pyx_tuple__186); /* "include/color_dict.pxi":199 * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), */ __pyx_tuple__187 = PyTuple_Pack(3, __pyx_int_117, __pyx_int_117, __pyx_int_117); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(2, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__187); __Pyx_GIVEREF(__pyx_tuple__187); /* "include/color_dict.pxi":200 * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), */ __pyx_tuple__188 = PyTuple_Pack(3, __pyx_int_120, __pyx_int_120, __pyx_int_120); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(2, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__188); __Pyx_GIVEREF(__pyx_tuple__188); /* "include/color_dict.pxi":201 * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), */ __pyx_tuple__189 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_122, __pyx_int_122); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(2, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__189); __Pyx_GIVEREF(__pyx_tuple__189); /* "include/color_dict.pxi":202 * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), */ __pyx_tuple__190 = PyTuple_Pack(3, __pyx_int_125, __pyx_int_125, __pyx_int_125); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__190); __Pyx_GIVEREF(__pyx_tuple__190); /* "include/color_dict.pxi":203 * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), */ __pyx_tuple__191 = PyTuple_Pack(3, __pyx_int_13, __pyx_int_13, __pyx_int_13); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(2, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__191); __Pyx_GIVEREF(__pyx_tuple__191); /* "include/color_dict.pxi":204 * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), */ __pyx_tuple__192 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_127, __pyx_int_127); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(2, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__192); __Pyx_GIVEREF(__pyx_tuple__192); /* "include/color_dict.pxi":205 * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), */ __pyx_tuple__193 = PyTuple_Pack(3, __pyx_int_130, __pyx_int_130, __pyx_int_130); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(2, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__193); __Pyx_GIVEREF(__pyx_tuple__193); /* "include/color_dict.pxi":206 * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), */ __pyx_tuple__194 = PyTuple_Pack(3, __pyx_int_133, __pyx_int_133, __pyx_int_133); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(2, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__194); __Pyx_GIVEREF(__pyx_tuple__194); /* "include/color_dict.pxi":207 * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), */ __pyx_tuple__195 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_135, __pyx_int_135); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__195); __Pyx_GIVEREF(__pyx_tuple__195); /* "include/color_dict.pxi":208 * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), */ __pyx_tuple__196 = PyTuple_Pack(3, __pyx_int_138, __pyx_int_138, __pyx_int_138); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(2, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__196); __Pyx_GIVEREF(__pyx_tuple__196); /* "include/color_dict.pxi":209 * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), */ __pyx_tuple__197 = PyTuple_Pack(3, __pyx_int_140, __pyx_int_140, __pyx_int_140); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(2, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__197); __Pyx_GIVEREF(__pyx_tuple__197); /* "include/color_dict.pxi":210 * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), */ __pyx_tuple__198 = PyTuple_Pack(3, __pyx_int_143, __pyx_int_143, __pyx_int_143); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__198); __Pyx_GIVEREF(__pyx_tuple__198); /* "include/color_dict.pxi":211 * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), */ __pyx_tuple__199 = PyTuple_Pack(3, __pyx_int_145, __pyx_int_145, __pyx_int_145); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(2, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__199); __Pyx_GIVEREF(__pyx_tuple__199); /* "include/color_dict.pxi":212 * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), */ __pyx_tuple__200 = PyTuple_Pack(3, __pyx_int_148, __pyx_int_148, __pyx_int_148); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(2, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__200); __Pyx_GIVEREF(__pyx_tuple__200); /* "include/color_dict.pxi":213 * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), */ __pyx_tuple__201 = PyTuple_Pack(3, __pyx_int_150, __pyx_int_150, __pyx_int_150); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(2, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__201); __Pyx_GIVEREF(__pyx_tuple__201); /* "include/color_dict.pxi":214 * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), */ __pyx_tuple__202 = PyTuple_Pack(3, __pyx_int_15, __pyx_int_15, __pyx_int_15); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(2, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__202); __Pyx_GIVEREF(__pyx_tuple__202); /* "include/color_dict.pxi":215 * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), */ __pyx_tuple__203 = PyTuple_Pack(3, __pyx_int_153, __pyx_int_153, __pyx_int_153); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(2, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__203); __Pyx_GIVEREF(__pyx_tuple__203); /* "include/color_dict.pxi":216 * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), */ __pyx_tuple__204 = PyTuple_Pack(3, __pyx_int_156, __pyx_int_156, __pyx_int_156); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(2, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__204); __Pyx_GIVEREF(__pyx_tuple__204); /* "include/color_dict.pxi":217 * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), */ __pyx_tuple__205 = PyTuple_Pack(3, __pyx_int_158, __pyx_int_158, __pyx_int_158); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(2, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__205); __Pyx_GIVEREF(__pyx_tuple__205); /* "include/color_dict.pxi":218 * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), */ __pyx_tuple__206 = PyTuple_Pack(3, __pyx_int_161, __pyx_int_161, __pyx_int_161); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__206); __Pyx_GIVEREF(__pyx_tuple__206); /* "include/color_dict.pxi":219 * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), */ __pyx_tuple__207 = PyTuple_Pack(3, __pyx_int_163, __pyx_int_163, __pyx_int_163); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(2, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__207); __Pyx_GIVEREF(__pyx_tuple__207); /* "include/color_dict.pxi":220 * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), */ __pyx_tuple__208 = PyTuple_Pack(3, __pyx_int_166, __pyx_int_166, __pyx_int_166); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(2, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__208); __Pyx_GIVEREF(__pyx_tuple__208); /* "include/color_dict.pxi":221 * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), */ __pyx_tuple__209 = PyTuple_Pack(3, __pyx_int_168, __pyx_int_168, __pyx_int_168); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(2, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__209); __Pyx_GIVEREF(__pyx_tuple__209); /* "include/color_dict.pxi":222 * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), */ __pyx_tuple__210 = PyTuple_Pack(3, __pyx_int_171, __pyx_int_171, __pyx_int_171); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__210); __Pyx_GIVEREF(__pyx_tuple__210); /* "include/color_dict.pxi":223 * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), */ __pyx_tuple__211 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_173, __pyx_int_173); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(2, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__211); __Pyx_GIVEREF(__pyx_tuple__211); /* "include/color_dict.pxi":224 * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), */ __pyx_tuple__212 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_176, __pyx_int_176); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(2, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__212); __Pyx_GIVEREF(__pyx_tuple__212); /* "include/color_dict.pxi":225 * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), */ __pyx_tuple__213 = PyTuple_Pack(3, __pyx_int_18, __pyx_int_18, __pyx_int_18); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(2, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__213); __Pyx_GIVEREF(__pyx_tuple__213); /* "include/color_dict.pxi":226 * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), */ __pyx_tuple__214 = PyTuple_Pack(3, __pyx_int_179, __pyx_int_179, __pyx_int_179); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__214); __Pyx_GIVEREF(__pyx_tuple__214); /* "include/color_dict.pxi":227 * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), */ __pyx_tuple__215 = PyTuple_Pack(3, __pyx_int_181, __pyx_int_181, __pyx_int_181); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(2, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__215); __Pyx_GIVEREF(__pyx_tuple__215); /* "include/color_dict.pxi":228 * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), */ __pyx_tuple__216 = PyTuple_Pack(3, __pyx_int_184, __pyx_int_184, __pyx_int_184); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(2, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__216); __Pyx_GIVEREF(__pyx_tuple__216); /* "include/color_dict.pxi":229 * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), */ __pyx_tuple__217 = PyTuple_Pack(3, __pyx_int_186, __pyx_int_186, __pyx_int_186); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__217); __Pyx_GIVEREF(__pyx_tuple__217); /* "include/color_dict.pxi":230 * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), */ __pyx_tuple__218 = PyTuple_Pack(3, __pyx_int_189, __pyx_int_189, __pyx_int_189); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__218); __Pyx_GIVEREF(__pyx_tuple__218); /* "include/color_dict.pxi":231 * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), */ __pyx_tuple__219 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_191, __pyx_int_191); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(2, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__219); __Pyx_GIVEREF(__pyx_tuple__219); /* "include/color_dict.pxi":232 * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), */ __pyx_tuple__220 = PyTuple_Pack(3, __pyx_int_194, __pyx_int_194, __pyx_int_194); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(2, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__220); __Pyx_GIVEREF(__pyx_tuple__220); /* "include/color_dict.pxi":233 * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), */ __pyx_tuple__221 = PyTuple_Pack(3, __pyx_int_196, __pyx_int_196, __pyx_int_196); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(2, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__221); __Pyx_GIVEREF(__pyx_tuple__221); /* "include/color_dict.pxi":234 * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), */ __pyx_tuple__222 = PyTuple_Pack(3, __pyx_int_199, __pyx_int_199, __pyx_int_199); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(2, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__222); __Pyx_GIVEREF(__pyx_tuple__222); /* "include/color_dict.pxi":235 * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), */ __pyx_tuple__223 = PyTuple_Pack(3, __pyx_int_201, __pyx_int_201, __pyx_int_201); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__223); __Pyx_GIVEREF(__pyx_tuple__223); /* "include/color_dict.pxi":236 * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), */ __pyx_tuple__224 = PyTuple_Pack(3, __pyx_int_20, __pyx_int_20, __pyx_int_20); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(2, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__224); __Pyx_GIVEREF(__pyx_tuple__224); /* "include/color_dict.pxi":237 * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), */ __pyx_tuple__225 = PyTuple_Pack(3, __pyx_int_204, __pyx_int_204, __pyx_int_204); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__225); __Pyx_GIVEREF(__pyx_tuple__225); /* "include/color_dict.pxi":238 * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), */ __pyx_tuple__226 = PyTuple_Pack(3, __pyx_int_207, __pyx_int_207, __pyx_int_207); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__226); __Pyx_GIVEREF(__pyx_tuple__226); /* "include/color_dict.pxi":239 * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), */ __pyx_tuple__227 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_209, __pyx_int_209); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(2, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__227); __Pyx_GIVEREF(__pyx_tuple__227); /* "include/color_dict.pxi":240 * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), */ __pyx_tuple__228 = PyTuple_Pack(3, __pyx_int_212, __pyx_int_212, __pyx_int_212); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(2, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__228); __Pyx_GIVEREF(__pyx_tuple__228); /* "include/color_dict.pxi":241 * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), */ __pyx_tuple__229 = PyTuple_Pack(3, __pyx_int_214, __pyx_int_214, __pyx_int_214); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(2, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__229); __Pyx_GIVEREF(__pyx_tuple__229); /* "include/color_dict.pxi":242 * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), */ __pyx_tuple__230 = PyTuple_Pack(3, __pyx_int_217, __pyx_int_217, __pyx_int_217); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(2, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__230); __Pyx_GIVEREF(__pyx_tuple__230); /* "include/color_dict.pxi":243 * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), */ __pyx_tuple__231 = PyTuple_Pack(3, __pyx_int_219, __pyx_int_219, __pyx_int_219); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(2, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__231); __Pyx_GIVEREF(__pyx_tuple__231); /* "include/color_dict.pxi":244 * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), */ __pyx_tuple__232 = PyTuple_Pack(3, __pyx_int_222, __pyx_int_222, __pyx_int_222); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(2, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__232); __Pyx_GIVEREF(__pyx_tuple__232); /* "include/color_dict.pxi":245 * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), */ __pyx_tuple__233 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_224, __pyx_int_224); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(2, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__233); __Pyx_GIVEREF(__pyx_tuple__233); /* "include/color_dict.pxi":246 * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), */ __pyx_tuple__234 = PyTuple_Pack(3, __pyx_int_227, __pyx_int_227, __pyx_int_227); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(2, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__234); __Pyx_GIVEREF(__pyx_tuple__234); /* "include/color_dict.pxi":247 * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), */ __pyx_tuple__235 = PyTuple_Pack(3, __pyx_int_23, __pyx_int_23, __pyx_int_23); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__235); __Pyx_GIVEREF(__pyx_tuple__235); /* "include/color_dict.pxi":248 * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), */ __pyx_tuple__236 = PyTuple_Pack(3, __pyx_int_229, __pyx_int_229, __pyx_int_229); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(2, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__236); __Pyx_GIVEREF(__pyx_tuple__236); /* "include/color_dict.pxi":249 * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), */ __pyx_tuple__237 = PyTuple_Pack(3, __pyx_int_232, __pyx_int_232, __pyx_int_232); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(2, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__237); __Pyx_GIVEREF(__pyx_tuple__237); /* "include/color_dict.pxi":250 * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), */ __pyx_tuple__238 = PyTuple_Pack(3, __pyx_int_235, __pyx_int_235, __pyx_int_235); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__238); __Pyx_GIVEREF(__pyx_tuple__238); /* "include/color_dict.pxi":251 * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), */ __pyx_tuple__239 = PyTuple_Pack(3, __pyx_int_237, __pyx_int_237, __pyx_int_237); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(2, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__239); __Pyx_GIVEREF(__pyx_tuple__239); /* "include/color_dict.pxi":252 * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), */ __pyx_tuple__240 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_240, __pyx_int_240); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__240); __Pyx_GIVEREF(__pyx_tuple__240); /* "include/color_dict.pxi":253 * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), */ __pyx_tuple__241 = PyTuple_Pack(3, __pyx_int_242, __pyx_int_242, __pyx_int_242); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(2, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__241); __Pyx_GIVEREF(__pyx_tuple__241); /* "include/color_dict.pxi":254 * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), */ __pyx_tuple__242 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_245, __pyx_int_245); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(2, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__242); __Pyx_GIVEREF(__pyx_tuple__242); /* "include/color_dict.pxi":255 * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), */ __pyx_tuple__243 = PyTuple_Pack(3, __pyx_int_247, __pyx_int_247, __pyx_int_247); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(2, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__243); __Pyx_GIVEREF(__pyx_tuple__243); /* "include/color_dict.pxi":256 * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), */ __pyx_tuple__244 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_250, __pyx_int_250); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(2, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__244); __Pyx_GIVEREF(__pyx_tuple__244); /* "include/color_dict.pxi":257 * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), */ __pyx_tuple__245 = PyTuple_Pack(3, __pyx_int_252, __pyx_int_252, __pyx_int_252); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(2, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__245); __Pyx_GIVEREF(__pyx_tuple__245); /* "include/color_dict.pxi":258 * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), */ __pyx_tuple__246 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(2, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__246); __Pyx_GIVEREF(__pyx_tuple__246); /* "include/color_dict.pxi":260 * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), # <<<<<<<<<<<<<< * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), */ __pyx_tuple__247 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_238, __pyx_int_0); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(2, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__247); __Pyx_GIVEREF(__pyx_tuple__247); /* "include/color_dict.pxi":261 * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), # <<<<<<<<<<<<<< * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), */ __pyx_tuple__248 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_205, __pyx_int_0); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(2, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__248); __Pyx_GIVEREF(__pyx_tuple__248); /* "include/color_dict.pxi":262 * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), # <<<<<<<<<<<<<< * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), */ __pyx_tuple__249 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_0); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(2, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__249); __Pyx_GIVEREF(__pyx_tuple__249); /* "include/color_dict.pxi":263 * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), # <<<<<<<<<<<<<< * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), */ __pyx_tuple__250 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_255, __pyx_int_47); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(2, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__250); __Pyx_GIVEREF(__pyx_tuple__250); /* "include/color_dict.pxi":366 * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), */ __pyx_tuple__251 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_255, __pyx_int_240); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(2, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__251); __Pyx_GIVEREF(__pyx_tuple__251); /* "include/color_dict.pxi":368 * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), # <<<<<<<<<<<<<< * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), */ __pyx_tuple__252 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_238, __pyx_int_224); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(2, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__252); __Pyx_GIVEREF(__pyx_tuple__252); /* "include/color_dict.pxi":369 * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), # <<<<<<<<<<<<<< * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), */ __pyx_tuple__253 = PyTuple_Pack(3, __pyx_int_193, __pyx_int_205, __pyx_int_193); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(2, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__253); __Pyx_GIVEREF(__pyx_tuple__253); /* "include/color_dict.pxi":370 * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), # <<<<<<<<<<<<<< * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), */ __pyx_tuple__254 = PyTuple_Pack(3, __pyx_int_131, __pyx_int_139, __pyx_int_131); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(2, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__254); __Pyx_GIVEREF(__pyx_tuple__254); /* "include/color_dict.pxi":371 * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), # <<<<<<<<<<<<<< * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), */ __pyx_tuple__255 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_105, __pyx_int_180); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(2, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__255); __Pyx_GIVEREF(__pyx_tuple__255); /* "include/color_dict.pxi":372 * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), # <<<<<<<<<<<<<< * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), */ __pyx_tuple__256 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_110, __pyx_int_180); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(2, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__256); __Pyx_GIVEREF(__pyx_tuple__256); /* "include/color_dict.pxi":373 * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), # <<<<<<<<<<<<<< * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), */ __pyx_tuple__257 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_106, __pyx_int_167); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(2, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__257); __Pyx_GIVEREF(__pyx_tuple__257); /* "include/color_dict.pxi":374 * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), # <<<<<<<<<<<<<< * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), */ __pyx_tuple__258 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_96, __pyx_int_144); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(2, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__258); __Pyx_GIVEREF(__pyx_tuple__258); /* "include/color_dict.pxi":375 * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), # <<<<<<<<<<<<<< * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), */ __pyx_tuple__259 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_58, __pyx_int_98); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(2, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__259); __Pyx_GIVEREF(__pyx_tuple__259); /* "include/color_dict.pxi":376 * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), # <<<<<<<<<<<<<< * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), */ __pyx_tuple__260 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_92, __pyx_int_92); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(2, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__260); __Pyx_GIVEREF(__pyx_tuple__260); /* "include/color_dict.pxi":377 * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), # <<<<<<<<<<<<<< * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), */ __pyx_tuple__261 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_106, __pyx_int_106); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(2, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__261); __Pyx_GIVEREF(__pyx_tuple__261); /* "include/color_dict.pxi":378 * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), # <<<<<<<<<<<<<< * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), */ __pyx_tuple__262 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_99, __pyx_int_99); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(2, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__262); __Pyx_GIVEREF(__pyx_tuple__262); /* "include/color_dict.pxi":379 * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), # <<<<<<<<<<<<<< * 'indianred4' : (139, 58, 58), * 'ivory' : (255, 255, 240), */ __pyx_tuple__263 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_85, __pyx_int_85); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(2, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__263); __Pyx_GIVEREF(__pyx_tuple__263); /* "include/color_dict.pxi":380 * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), # <<<<<<<<<<<<<< * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), */ __pyx_tuple__264 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_58, __pyx_int_58); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(2, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__264); __Pyx_GIVEREF(__pyx_tuple__264); /* "include/color_dict.pxi":381 * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), * 'ivory' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), */ __pyx_tuple__265 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_240); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(2, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__265); __Pyx_GIVEREF(__pyx_tuple__265); /* "include/color_dict.pxi":383 * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), # <<<<<<<<<<<<<< * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), */ __pyx_tuple__266 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_238, __pyx_int_224); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(2, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__266); __Pyx_GIVEREF(__pyx_tuple__266); /* "include/color_dict.pxi":384 * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), # <<<<<<<<<<<<<< * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), */ __pyx_tuple__267 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_205, __pyx_int_193); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(2, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__267); __Pyx_GIVEREF(__pyx_tuple__267); /* "include/color_dict.pxi":385 * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), # <<<<<<<<<<<<<< * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), */ __pyx_tuple__268 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_139, __pyx_int_131); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(2, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__268); __Pyx_GIVEREF(__pyx_tuple__268); /* "include/color_dict.pxi":386 * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), # <<<<<<<<<<<<<< * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), */ __pyx_tuple__269 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_230, __pyx_int_140); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(2, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__269); __Pyx_GIVEREF(__pyx_tuple__269); /* "include/color_dict.pxi":387 * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), # <<<<<<<<<<<<<< * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), */ __pyx_tuple__270 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_246, __pyx_int_143); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(2, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__270); __Pyx_GIVEREF(__pyx_tuple__270); /* "include/color_dict.pxi":388 * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), # <<<<<<<<<<<<<< * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), */ __pyx_tuple__271 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_230, __pyx_int_133); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(2, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__271); __Pyx_GIVEREF(__pyx_tuple__271); /* "include/color_dict.pxi":389 * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), # <<<<<<<<<<<<<< * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), */ __pyx_tuple__272 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_198, __pyx_int_115); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(2, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__272); __Pyx_GIVEREF(__pyx_tuple__272); /* "include/color_dict.pxi":390 * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), # <<<<<<<<<<<<<< * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), */ __pyx_tuple__273 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_134, __pyx_int_78); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(2, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__273); __Pyx_GIVEREF(__pyx_tuple__273); /* "include/color_dict.pxi":391 * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), # <<<<<<<<<<<<<< * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), */ __pyx_tuple__274 = PyTuple_Pack(3, __pyx_int_230, __pyx_int_230, __pyx_int_250); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(2, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__274); __Pyx_GIVEREF(__pyx_tuple__274); /* "include/color_dict.pxi":392 * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), */ __pyx_tuple__275 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_240, __pyx_int_245); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(2, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__275); __Pyx_GIVEREF(__pyx_tuple__275); /* "include/color_dict.pxi":394 * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), # <<<<<<<<<<<<<< * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), */ __pyx_tuple__276 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_224, __pyx_int_229); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(2, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__276); __Pyx_GIVEREF(__pyx_tuple__276); /* "include/color_dict.pxi":395 * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), # <<<<<<<<<<<<<< * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), */ __pyx_tuple__277 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_193, __pyx_int_197); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(2, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__277); __Pyx_GIVEREF(__pyx_tuple__277); /* "include/color_dict.pxi":396 * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), # <<<<<<<<<<<<<< * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), */ __pyx_tuple__278 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_131, __pyx_int_134); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(2, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__278); __Pyx_GIVEREF(__pyx_tuple__278); /* "include/color_dict.pxi":397 * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), # <<<<<<<<<<<<<< * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), */ __pyx_tuple__279 = PyTuple_Pack(3, __pyx_int_124, __pyx_int_252, __pyx_int_0); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(2, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__279); __Pyx_GIVEREF(__pyx_tuple__279); /* "include/color_dict.pxi":398 * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), */ __pyx_tuple__280 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_205); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(2, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__280); __Pyx_GIVEREF(__pyx_tuple__280); /* "include/color_dict.pxi":400 * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), # <<<<<<<<<<<<<< * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), */ __pyx_tuple__281 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_233, __pyx_int_191); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(2, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__281); __Pyx_GIVEREF(__pyx_tuple__281); /* "include/color_dict.pxi":401 * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), # <<<<<<<<<<<<<< * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), */ __pyx_tuple__282 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_201, __pyx_int_165); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(2, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__282); __Pyx_GIVEREF(__pyx_tuple__282); /* "include/color_dict.pxi":402 * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), # <<<<<<<<<<<<<< * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), */ __pyx_tuple__283 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_137, __pyx_int_112); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(2, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__283); __Pyx_GIVEREF(__pyx_tuple__283); /* "include/color_dict.pxi":403 * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), # <<<<<<<<<<<<<< * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), */ __pyx_tuple__284 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_216, __pyx_int_230); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(2, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__284); __Pyx_GIVEREF(__pyx_tuple__284); /* "include/color_dict.pxi":404 * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), # <<<<<<<<<<<<<< * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), */ __pyx_tuple__285 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_239, __pyx_int_255); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(2, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__285); __Pyx_GIVEREF(__pyx_tuple__285); /* "include/color_dict.pxi":405 * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), # <<<<<<<<<<<<<< * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), */ __pyx_tuple__286 = PyTuple_Pack(3, __pyx_int_178, __pyx_int_223, __pyx_int_238); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(2, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__286); __Pyx_GIVEREF(__pyx_tuple__286); /* "include/color_dict.pxi":406 * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), # <<<<<<<<<<<<<< * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), */ __pyx_tuple__287 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_192, __pyx_int_205); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(2, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__287); __Pyx_GIVEREF(__pyx_tuple__287); /* "include/color_dict.pxi":407 * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), # <<<<<<<<<<<<<< * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), */ __pyx_tuple__288 = PyTuple_Pack(3, __pyx_int_104, __pyx_int_131, __pyx_int_139); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(2, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__288); __Pyx_GIVEREF(__pyx_tuple__288); /* "include/color_dict.pxi":408 * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), # <<<<<<<<<<<<<< * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), */ __pyx_tuple__289 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_128, __pyx_int_128); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(2, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__289); __Pyx_GIVEREF(__pyx_tuple__289); /* "include/color_dict.pxi":409 * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), */ __pyx_tuple__290 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__290); __Pyx_GIVEREF(__pyx_tuple__290); /* "include/color_dict.pxi":411 * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), # <<<<<<<<<<<<<< * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), */ __pyx_tuple__291 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(2, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__291); __Pyx_GIVEREF(__pyx_tuple__291); /* "include/color_dict.pxi":412 * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), # <<<<<<<<<<<<<< * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), */ __pyx_tuple__292 = PyTuple_Pack(3, __pyx_int_180, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(2, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__292); __Pyx_GIVEREF(__pyx_tuple__292); /* "include/color_dict.pxi":413 * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), */ __pyx_tuple__293 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(2, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__293); __Pyx_GIVEREF(__pyx_tuple__293); /* "include/color_dict.pxi":414 * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), */ __pyx_tuple__294 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_221, __pyx_int_130); if (unlikely(!__pyx_tuple__294)) __PYX_ERR(2, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__294); __Pyx_GIVEREF(__pyx_tuple__294); /* "include/color_dict.pxi":415 * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), */ __pyx_tuple__295 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_236, __pyx_int_139); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(2, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__295); __Pyx_GIVEREF(__pyx_tuple__295); /* "include/color_dict.pxi":416 * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), */ __pyx_tuple__296 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_220, __pyx_int_130); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(2, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__296); __Pyx_GIVEREF(__pyx_tuple__296); /* "include/color_dict.pxi":417 * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), # <<<<<<<<<<<<<< * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), */ __pyx_tuple__297 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_190, __pyx_int_112); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(2, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__297); __Pyx_GIVEREF(__pyx_tuple__297); /* "include/color_dict.pxi":418 * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), # <<<<<<<<<<<<<< * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), */ __pyx_tuple__298 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_129, __pyx_int_76); if (unlikely(!__pyx_tuple__298)) __PYX_ERR(2, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__298); __Pyx_GIVEREF(__pyx_tuple__298); /* "include/color_dict.pxi":419 * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), # <<<<<<<<<<<<<< * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), */ __pyx_tuple__299 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_250, __pyx_int_210); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(2, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__299); __Pyx_GIVEREF(__pyx_tuple__299); /* "include/color_dict.pxi":420 * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), */ __pyx_tuple__300 = PyTuple_Pack(3, __pyx_int_211, __pyx_int_211, __pyx_int_211); if (unlikely(!__pyx_tuple__300)) __PYX_ERR(2, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__300); __Pyx_GIVEREF(__pyx_tuple__300); /* "include/color_dict.pxi":421 * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), # <<<<<<<<<<<<<< * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), */ __pyx_tuple__301 = PyTuple_Pack(3, __pyx_int_144, __pyx_int_238, __pyx_int_144); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(2, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__301); __Pyx_GIVEREF(__pyx_tuple__301); /* "include/color_dict.pxi":423 * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), # <<<<<<<<<<<<<< * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), */ __pyx_tuple__302 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_182, __pyx_int_193); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(2, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__302); __Pyx_GIVEREF(__pyx_tuple__302); /* "include/color_dict.pxi":424 * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), # <<<<<<<<<<<<<< * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), */ __pyx_tuple__303 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_174, __pyx_int_185); if (unlikely(!__pyx_tuple__303)) __PYX_ERR(2, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__303); __Pyx_GIVEREF(__pyx_tuple__303); /* "include/color_dict.pxi":425 * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), # <<<<<<<<<<<<<< * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), */ __pyx_tuple__304 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_162, __pyx_int_173); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(2, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__304); __Pyx_GIVEREF(__pyx_tuple__304); /* "include/color_dict.pxi":426 * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), # <<<<<<<<<<<<<< * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), */ __pyx_tuple__305 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_140, __pyx_int_149); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(2, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__305); __Pyx_GIVEREF(__pyx_tuple__305); /* "include/color_dict.pxi":427 * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), # <<<<<<<<<<<<<< * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), */ __pyx_tuple__306 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_95, __pyx_int_101); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(2, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__306); __Pyx_GIVEREF(__pyx_tuple__306); /* "include/color_dict.pxi":428 * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), */ __pyx_tuple__307 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_160, __pyx_int_122); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(2, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__307); __Pyx_GIVEREF(__pyx_tuple__307); /* "include/color_dict.pxi":430 * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), # <<<<<<<<<<<<<< * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), */ __pyx_tuple__308 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_149, __pyx_int_114); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(2, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__308); __Pyx_GIVEREF(__pyx_tuple__308); /* "include/color_dict.pxi":431 * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), # <<<<<<<<<<<<<< * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), */ __pyx_tuple__309 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_129, __pyx_int_98); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(2, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__309); __Pyx_GIVEREF(__pyx_tuple__309); /* "include/color_dict.pxi":432 * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), # <<<<<<<<<<<<<< * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), */ __pyx_tuple__310 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_87, __pyx_int_66); if (unlikely(!__pyx_tuple__310)) __PYX_ERR(2, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__310); __Pyx_GIVEREF(__pyx_tuple__310); /* "include/color_dict.pxi":433 * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), # <<<<<<<<<<<<<< * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), */ __pyx_tuple__311 = PyTuple_Pack(3, __pyx_int_32, __pyx_int_178, __pyx_int_170); if (unlikely(!__pyx_tuple__311)) __PYX_ERR(2, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__311); __Pyx_GIVEREF(__pyx_tuple__311); /* "include/color_dict.pxi":434 * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), # <<<<<<<<<<<<<< * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), */ __pyx_tuple__312 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_206, __pyx_int_250); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(2, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__312); __Pyx_GIVEREF(__pyx_tuple__312); /* "include/color_dict.pxi":435 * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), # <<<<<<<<<<<<<< * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), */ __pyx_tuple__313 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_226, __pyx_int_255); if (unlikely(!__pyx_tuple__313)) __PYX_ERR(2, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__313); __Pyx_GIVEREF(__pyx_tuple__313); /* "include/color_dict.pxi":436 * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), # <<<<<<<<<<<<<< * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), */ __pyx_tuple__314 = PyTuple_Pack(3, __pyx_int_164, __pyx_int_211, __pyx_int_238); if (unlikely(!__pyx_tuple__314)) __PYX_ERR(2, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__314); __Pyx_GIVEREF(__pyx_tuple__314); /* "include/color_dict.pxi":437 * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), # <<<<<<<<<<<<<< * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), */ __pyx_tuple__315 = PyTuple_Pack(3, __pyx_int_141, __pyx_int_182, __pyx_int_205); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(2, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__315); __Pyx_GIVEREF(__pyx_tuple__315); /* "include/color_dict.pxi":438 * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), # <<<<<<<<<<<<<< * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), */ __pyx_tuple__316 = PyTuple_Pack(3, __pyx_int_96, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__316)) __PYX_ERR(2, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__316); __Pyx_GIVEREF(__pyx_tuple__316); /* "include/color_dict.pxi":439 * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), # <<<<<<<<<<<<<< * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), */ __pyx_tuple__317 = PyTuple_Pack(3, __pyx_int_132, __pyx_int_112, __pyx_int_255); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(2, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__317); __Pyx_GIVEREF(__pyx_tuple__317); /* "include/color_dict.pxi":440 * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), */ __pyx_tuple__318 = PyTuple_Pack(3, __pyx_int_119, __pyx_int_136, __pyx_int_153); if (unlikely(!__pyx_tuple__318)) __PYX_ERR(2, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__318); __Pyx_GIVEREF(__pyx_tuple__318); /* "include/color_dict.pxi":442 * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), # <<<<<<<<<<<<<< * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), */ __pyx_tuple__319 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_196, __pyx_int_222); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(2, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__319); __Pyx_GIVEREF(__pyx_tuple__319); /* "include/color_dict.pxi":443 * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), # <<<<<<<<<<<<<< * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), */ __pyx_tuple__320 = PyTuple_Pack(3, __pyx_int_202, __pyx_int_225, __pyx_int_255); if (unlikely(!__pyx_tuple__320)) __PYX_ERR(2, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__320); __Pyx_GIVEREF(__pyx_tuple__320); /* "include/color_dict.pxi":444 * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), # <<<<<<<<<<<<<< * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), */ __pyx_tuple__321 = PyTuple_Pack(3, __pyx_int_188, __pyx_int_210, __pyx_int_238); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(2, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__321); __Pyx_GIVEREF(__pyx_tuple__321); /* "include/color_dict.pxi":445 * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), # <<<<<<<<<<<<<< * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), */ __pyx_tuple__322 = PyTuple_Pack(3, __pyx_int_162, __pyx_int_181, __pyx_int_205); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(2, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__322); __Pyx_GIVEREF(__pyx_tuple__322); /* "include/color_dict.pxi":446 * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), # <<<<<<<<<<<<<< * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), */ __pyx_tuple__323 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(2, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__323); __Pyx_GIVEREF(__pyx_tuple__323); /* "include/color_dict.pxi":447 * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), */ __pyx_tuple__324 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_224); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(2, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__324); __Pyx_GIVEREF(__pyx_tuple__324); /* "include/color_dict.pxi":449 * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), # <<<<<<<<<<<<<< * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), */ __pyx_tuple__325 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_238, __pyx_int_209); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__325); __Pyx_GIVEREF(__pyx_tuple__325); /* "include/color_dict.pxi":450 * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), # <<<<<<<<<<<<<< * 'lightyellow4' : (139, 139, 122), * 'limegreen' : (50, 205, 50), */ __pyx_tuple__326 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_205, __pyx_int_180); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(2, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__326); __Pyx_GIVEREF(__pyx_tuple__326); /* "include/color_dict.pxi":451 * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), # <<<<<<<<<<<<<< * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), */ __pyx_tuple__327 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_139, __pyx_int_122); if (unlikely(!__pyx_tuple__327)) __PYX_ERR(2, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__327); __Pyx_GIVEREF(__pyx_tuple__327); /* "include/color_dict.pxi":452 * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), * 'limegreen' : (50, 205, 50), # <<<<<<<<<<<<<< * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), */ __pyx_tuple__328 = PyTuple_Pack(3, __pyx_int_50, __pyx_int_205, __pyx_int_50); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(2, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__328); __Pyx_GIVEREF(__pyx_tuple__328); /* "include/color_dict.pxi":453 * 'lightyellow4' : (139, 139, 122), * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), # <<<<<<<<<<<<<< * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), */ __pyx_tuple__329 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_240, __pyx_int_230); if (unlikely(!__pyx_tuple__329)) __PYX_ERR(2, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__329); __Pyx_GIVEREF(__pyx_tuple__329); /* "include/color_dict.pxi":454 * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), */ __pyx_tuple__330 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(2, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__330); __Pyx_GIVEREF(__pyx_tuple__330); /* "include/color_dict.pxi":456 * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), # <<<<<<<<<<<<<< * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), */ __pyx_tuple__331 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_0, __pyx_int_238); if (unlikely(!__pyx_tuple__331)) __PYX_ERR(2, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__331); __Pyx_GIVEREF(__pyx_tuple__331); /* "include/color_dict.pxi":457 * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), # <<<<<<<<<<<<<< * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), */ __pyx_tuple__332 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_0, __pyx_int_205); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(2, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__332); __Pyx_GIVEREF(__pyx_tuple__332); /* "include/color_dict.pxi":459 * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), # <<<<<<<<<<<<<< * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), */ __pyx_tuple__333 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_48, __pyx_int_96); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(2, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__333); __Pyx_GIVEREF(__pyx_tuple__333); /* "include/color_dict.pxi":460 * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), # <<<<<<<<<<<<<< * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), */ __pyx_tuple__334 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_52, __pyx_int_179); if (unlikely(!__pyx_tuple__334)) __PYX_ERR(2, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__334); __Pyx_GIVEREF(__pyx_tuple__334); /* "include/color_dict.pxi":461 * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), # <<<<<<<<<<<<<< * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), */ __pyx_tuple__335 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_48, __pyx_int_167); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(2, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__335); __Pyx_GIVEREF(__pyx_tuple__335); /* "include/color_dict.pxi":462 * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), # <<<<<<<<<<<<<< * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), */ __pyx_tuple__336 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_41, __pyx_int_144); if (unlikely(!__pyx_tuple__336)) __PYX_ERR(2, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__336); __Pyx_GIVEREF(__pyx_tuple__336); /* "include/color_dict.pxi":463 * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), # <<<<<<<<<<<<<< * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), */ __pyx_tuple__337 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_28, __pyx_int_98); if (unlikely(!__pyx_tuple__337)) __PYX_ERR(2, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__337); __Pyx_GIVEREF(__pyx_tuple__337); /* "include/color_dict.pxi":466 * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), # <<<<<<<<<<<<<< * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), */ __pyx_tuple__338 = PyTuple_Pack(3, __pyx_int_186, __pyx_int_85, __pyx_int_211); if (unlikely(!__pyx_tuple__338)) __PYX_ERR(2, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__338); __Pyx_GIVEREF(__pyx_tuple__338); /* "include/color_dict.pxi":467 * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), # <<<<<<<<<<<<<< * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), */ __pyx_tuple__339 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_102, __pyx_int_255); if (unlikely(!__pyx_tuple__339)) __PYX_ERR(2, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__339); __Pyx_GIVEREF(__pyx_tuple__339); /* "include/color_dict.pxi":468 * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), # <<<<<<<<<<<<<< * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), */ __pyx_tuple__340 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_95, __pyx_int_238); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(2, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__340); __Pyx_GIVEREF(__pyx_tuple__340); /* "include/color_dict.pxi":469 * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), # <<<<<<<<<<<<<< * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), */ __pyx_tuple__341 = PyTuple_Pack(3, __pyx_int_180, __pyx_int_82, __pyx_int_205); if (unlikely(!__pyx_tuple__341)) __PYX_ERR(2, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__341); __Pyx_GIVEREF(__pyx_tuple__341); /* "include/color_dict.pxi":470 * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), # <<<<<<<<<<<<<< * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), */ __pyx_tuple__342 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_55, __pyx_int_139); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(2, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__342); __Pyx_GIVEREF(__pyx_tuple__342); /* "include/color_dict.pxi":471 * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), # <<<<<<<<<<<<<< * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), */ __pyx_tuple__343 = PyTuple_Pack(3, __pyx_int_147, __pyx_int_112, __pyx_int_219); if (unlikely(!__pyx_tuple__343)) __PYX_ERR(2, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__343); __Pyx_GIVEREF(__pyx_tuple__343); /* "include/color_dict.pxi":472 * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), # <<<<<<<<<<<<<< * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), */ __pyx_tuple__344 = PyTuple_Pack(3, __pyx_int_171, __pyx_int_130, __pyx_int_255); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(2, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__344); __Pyx_GIVEREF(__pyx_tuple__344); /* "include/color_dict.pxi":473 * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), # <<<<<<<<<<<<<< * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), */ __pyx_tuple__345 = PyTuple_Pack(3, __pyx_int_159, __pyx_int_121, __pyx_int_238); if (unlikely(!__pyx_tuple__345)) __PYX_ERR(2, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__345); __Pyx_GIVEREF(__pyx_tuple__345); /* "include/color_dict.pxi":474 * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), # <<<<<<<<<<<<<< * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), */ __pyx_tuple__346 = PyTuple_Pack(3, __pyx_int_137, __pyx_int_104, __pyx_int_205); if (unlikely(!__pyx_tuple__346)) __PYX_ERR(2, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__346); __Pyx_GIVEREF(__pyx_tuple__346); /* "include/color_dict.pxi":475 * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), # <<<<<<<<<<<<<< * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), */ __pyx_tuple__347 = PyTuple_Pack(3, __pyx_int_93, __pyx_int_71, __pyx_int_139); if (unlikely(!__pyx_tuple__347)) __PYX_ERR(2, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__347); __Pyx_GIVEREF(__pyx_tuple__347); /* "include/color_dict.pxi":476 * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), # <<<<<<<<<<<<<< * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), */ __pyx_tuple__348 = PyTuple_Pack(3, __pyx_int_60, __pyx_int_179, __pyx_int_113); if (unlikely(!__pyx_tuple__348)) __PYX_ERR(2, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__348); __Pyx_GIVEREF(__pyx_tuple__348); /* "include/color_dict.pxi":477 * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), # <<<<<<<<<<<<<< * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), */ __pyx_tuple__349 = PyTuple_Pack(3, __pyx_int_123, __pyx_int_104, __pyx_int_238); if (unlikely(!__pyx_tuple__349)) __PYX_ERR(2, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__349); __Pyx_GIVEREF(__pyx_tuple__349); /* "include/color_dict.pxi":478 * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), # <<<<<<<<<<<<<< * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), */ __pyx_tuple__350 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_250, __pyx_int_154); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(2, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__350); __Pyx_GIVEREF(__pyx_tuple__350); /* "include/color_dict.pxi":479 * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), # <<<<<<<<<<<<<< * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), */ __pyx_tuple__351 = PyTuple_Pack(3, __pyx_int_72, __pyx_int_209, __pyx_int_204); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(2, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__351); __Pyx_GIVEREF(__pyx_tuple__351); /* "include/color_dict.pxi":480 * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), # <<<<<<<<<<<<<< * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), */ __pyx_tuple__352 = PyTuple_Pack(3, __pyx_int_199, __pyx_int_21, __pyx_int_133); if (unlikely(!__pyx_tuple__352)) __PYX_ERR(2, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__352); __Pyx_GIVEREF(__pyx_tuple__352); /* "include/color_dict.pxi":481 * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), # <<<<<<<<<<<<<< * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), */ __pyx_tuple__353 = PyTuple_Pack(3, __pyx_int_25, __pyx_int_25, __pyx_int_112); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(2, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__353); __Pyx_GIVEREF(__pyx_tuple__353); /* "include/color_dict.pxi":482 * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), # <<<<<<<<<<<<<< * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), */ __pyx_tuple__354 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_255, __pyx_int_250); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(2, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__354); __Pyx_GIVEREF(__pyx_tuple__354); /* "include/color_dict.pxi":483 * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), */ __pyx_tuple__355 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_225); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(2, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__355); __Pyx_GIVEREF(__pyx_tuple__355); /* "include/color_dict.pxi":485 * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), # <<<<<<<<<<<<<< * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), */ __pyx_tuple__356 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_213, __pyx_int_210); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(2, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__356); __Pyx_GIVEREF(__pyx_tuple__356); /* "include/color_dict.pxi":486 * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), # <<<<<<<<<<<<<< * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), */ __pyx_tuple__357 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_183, __pyx_int_181); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(2, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__357); __Pyx_GIVEREF(__pyx_tuple__357); /* "include/color_dict.pxi":487 * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), # <<<<<<<<<<<<<< * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), */ __pyx_tuple__358 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_125, __pyx_int_123); if (unlikely(!__pyx_tuple__358)) __PYX_ERR(2, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__358); __Pyx_GIVEREF(__pyx_tuple__358); /* "include/color_dict.pxi":488 * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), # <<<<<<<<<<<<<< * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), */ __pyx_tuple__359 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_181); if (unlikely(!__pyx_tuple__359)) __PYX_ERR(2, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__359); __Pyx_GIVEREF(__pyx_tuple__359); /* "include/color_dict.pxi":489 * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), */ __pyx_tuple__360 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_222, __pyx_int_173); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(2, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__360); __Pyx_GIVEREF(__pyx_tuple__360); /* "include/color_dict.pxi":491 * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), # <<<<<<<<<<<<<< * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), */ __pyx_tuple__361 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_207, __pyx_int_161); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(2, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__361); __Pyx_GIVEREF(__pyx_tuple__361); /* "include/color_dict.pxi":492 * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), # <<<<<<<<<<<<<< * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), */ __pyx_tuple__362 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_179, __pyx_int_139); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(2, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__362); __Pyx_GIVEREF(__pyx_tuple__362); /* "include/color_dict.pxi":493 * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), # <<<<<<<<<<<<<< * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), */ __pyx_tuple__363 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_121, __pyx_int_94); if (unlikely(!__pyx_tuple__363)) __PYX_ERR(2, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__363); __Pyx_GIVEREF(__pyx_tuple__363); /* "include/color_dict.pxi":494 * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), # <<<<<<<<<<<<<< * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), */ __pyx_tuple__364 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_128); if (unlikely(!__pyx_tuple__364)) __PYX_ERR(2, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__364); __Pyx_GIVEREF(__pyx_tuple__364); /* "include/color_dict.pxi":496 * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), # <<<<<<<<<<<<<< * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), */ __pyx_tuple__365 = PyTuple_Pack(3, __pyx_int_253, __pyx_int_245, __pyx_int_230); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(2, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__365); __Pyx_GIVEREF(__pyx_tuple__365); /* "include/color_dict.pxi":497 * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), * 'olivedrab' : (107, 142, 35), # <<<<<<<<<<<<<< * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), */ __pyx_tuple__366 = PyTuple_Pack(3, __pyx_int_107, __pyx_int_142, __pyx_int_35); if (unlikely(!__pyx_tuple__366)) __PYX_ERR(2, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__366); __Pyx_GIVEREF(__pyx_tuple__366); /* "include/color_dict.pxi":498 * 'oldlace' : (253, 245, 230), * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), # <<<<<<<<<<<<<< * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), */ __pyx_tuple__367 = PyTuple_Pack(3, __pyx_int_192, __pyx_int_255, __pyx_int_62); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(2, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__367); __Pyx_GIVEREF(__pyx_tuple__367); /* "include/color_dict.pxi":499 * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), # <<<<<<<<<<<<<< * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), */ __pyx_tuple__368 = PyTuple_Pack(3, __pyx_int_179, __pyx_int_238, __pyx_int_58); if (unlikely(!__pyx_tuple__368)) __PYX_ERR(2, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__368); __Pyx_GIVEREF(__pyx_tuple__368); /* "include/color_dict.pxi":500 * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), # <<<<<<<<<<<<<< * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), */ __pyx_tuple__369 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_205, __pyx_int_50); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(2, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__369); __Pyx_GIVEREF(__pyx_tuple__369); /* "include/color_dict.pxi":501 * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), # <<<<<<<<<<<<<< * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), */ __pyx_tuple__370 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_139, __pyx_int_34); if (unlikely(!__pyx_tuple__370)) __PYX_ERR(2, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__370); __Pyx_GIVEREF(__pyx_tuple__370); /* "include/color_dict.pxi":502 * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), */ __pyx_tuple__371 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_165, __pyx_int_0); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(2, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__371); __Pyx_GIVEREF(__pyx_tuple__371); /* "include/color_dict.pxi":504 * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), # <<<<<<<<<<<<<< * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), */ __pyx_tuple__372 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_154, __pyx_int_0); if (unlikely(!__pyx_tuple__372)) __PYX_ERR(2, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__372); __Pyx_GIVEREF(__pyx_tuple__372); /* "include/color_dict.pxi":505 * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), # <<<<<<<<<<<<<< * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), */ __pyx_tuple__373 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_133, __pyx_int_0); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(2, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__373); __Pyx_GIVEREF(__pyx_tuple__373); /* "include/color_dict.pxi":506 * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), # <<<<<<<<<<<<<< * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), */ __pyx_tuple__374 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_90, __pyx_int_0); if (unlikely(!__pyx_tuple__374)) __PYX_ERR(2, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__374); __Pyx_GIVEREF(__pyx_tuple__374); /* "include/color_dict.pxi":507 * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), */ __pyx_tuple__375 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_69, __pyx_int_0); if (unlikely(!__pyx_tuple__375)) __PYX_ERR(2, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__375); __Pyx_GIVEREF(__pyx_tuple__375); /* "include/color_dict.pxi":509 * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), # <<<<<<<<<<<<<< * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), */ __pyx_tuple__376 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_64, __pyx_int_0); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(2, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__376); __Pyx_GIVEREF(__pyx_tuple__376); /* "include/color_dict.pxi":510 * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), # <<<<<<<<<<<<<< * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), */ __pyx_tuple__377 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_55, __pyx_int_0); if (unlikely(!__pyx_tuple__377)) __PYX_ERR(2, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__377); __Pyx_GIVEREF(__pyx_tuple__377); /* "include/color_dict.pxi":511 * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), # <<<<<<<<<<<<<< * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), */ __pyx_tuple__378 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_37, __pyx_int_0); if (unlikely(!__pyx_tuple__378)) __PYX_ERR(2, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__378); __Pyx_GIVEREF(__pyx_tuple__378); /* "include/color_dict.pxi":512 * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), # <<<<<<<<<<<<<< * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), */ __pyx_tuple__379 = PyTuple_Pack(3, __pyx_int_218, __pyx_int_112, __pyx_int_214); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__379); __Pyx_GIVEREF(__pyx_tuple__379); /* "include/color_dict.pxi":513 * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), # <<<<<<<<<<<<<< * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), */ __pyx_tuple__380 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_131, __pyx_int_250); if (unlikely(!__pyx_tuple__380)) __PYX_ERR(2, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__380); __Pyx_GIVEREF(__pyx_tuple__380); /* "include/color_dict.pxi":514 * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), # <<<<<<<<<<<<<< * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), */ __pyx_tuple__381 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_122, __pyx_int_233); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__381); __Pyx_GIVEREF(__pyx_tuple__381); /* "include/color_dict.pxi":515 * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), # <<<<<<<<<<<<<< * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), */ __pyx_tuple__382 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_105, __pyx_int_201); if (unlikely(!__pyx_tuple__382)) __PYX_ERR(2, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__382); __Pyx_GIVEREF(__pyx_tuple__382); /* "include/color_dict.pxi":516 * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), # <<<<<<<<<<<<<< * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), */ __pyx_tuple__383 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_71, __pyx_int_137); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(2, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__383); __Pyx_GIVEREF(__pyx_tuple__383); /* "include/color_dict.pxi":517 * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), # <<<<<<<<<<<<<< * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), */ __pyx_tuple__384 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_232, __pyx_int_170); if (unlikely(!__pyx_tuple__384)) __PYX_ERR(2, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__384); __Pyx_GIVEREF(__pyx_tuple__384); /* "include/color_dict.pxi":518 * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), # <<<<<<<<<<<<<< * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), */ __pyx_tuple__385 = PyTuple_Pack(3, __pyx_int_152, __pyx_int_251, __pyx_int_152); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(2, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__385); __Pyx_GIVEREF(__pyx_tuple__385); /* "include/color_dict.pxi":519 * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), # <<<<<<<<<<<<<< * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), */ __pyx_tuple__386 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_255, __pyx_int_154); if (unlikely(!__pyx_tuple__386)) __PYX_ERR(2, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__386); __Pyx_GIVEREF(__pyx_tuple__386); /* "include/color_dict.pxi":521 * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), # <<<<<<<<<<<<<< * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), */ __pyx_tuple__387 = PyTuple_Pack(3, __pyx_int_124, __pyx_int_205, __pyx_int_124); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(2, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__387); __Pyx_GIVEREF(__pyx_tuple__387); /* "include/color_dict.pxi":522 * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), # <<<<<<<<<<<<<< * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), */ __pyx_tuple__388 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_139, __pyx_int_84); if (unlikely(!__pyx_tuple__388)) __PYX_ERR(2, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__388); __Pyx_GIVEREF(__pyx_tuple__388); /* "include/color_dict.pxi":523 * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), */ __pyx_tuple__389 = PyTuple_Pack(3, __pyx_int_175, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(2, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__389); __Pyx_GIVEREF(__pyx_tuple__389); /* "include/color_dict.pxi":524 * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), # <<<<<<<<<<<<<< * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), */ __pyx_tuple__390 = PyTuple_Pack(3, __pyx_int_187, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__390)) __PYX_ERR(2, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__390); __Pyx_GIVEREF(__pyx_tuple__390); /* "include/color_dict.pxi":525 * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), */ __pyx_tuple__391 = PyTuple_Pack(3, __pyx_int_174, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(2, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__391); __Pyx_GIVEREF(__pyx_tuple__391); /* "include/color_dict.pxi":526 * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), # <<<<<<<<<<<<<< * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), */ __pyx_tuple__392 = PyTuple_Pack(3, __pyx_int_150, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__392)) __PYX_ERR(2, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__392); __Pyx_GIVEREF(__pyx_tuple__392); /* "include/color_dict.pxi":527 * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), # <<<<<<<<<<<<<< * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), */ __pyx_tuple__393 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(2, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__393); __Pyx_GIVEREF(__pyx_tuple__393); /* "include/color_dict.pxi":528 * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), # <<<<<<<<<<<<<< * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), */ __pyx_tuple__394 = PyTuple_Pack(3, __pyx_int_219, __pyx_int_112, __pyx_int_147); if (unlikely(!__pyx_tuple__394)) __PYX_ERR(2, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__394); __Pyx_GIVEREF(__pyx_tuple__394); /* "include/color_dict.pxi":529 * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), # <<<<<<<<<<<<<< * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), */ __pyx_tuple__395 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_130, __pyx_int_171); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(2, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__395); __Pyx_GIVEREF(__pyx_tuple__395); /* "include/color_dict.pxi":530 * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), # <<<<<<<<<<<<<< * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), */ __pyx_tuple__396 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_121, __pyx_int_159); if (unlikely(!__pyx_tuple__396)) __PYX_ERR(2, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__396); __Pyx_GIVEREF(__pyx_tuple__396); /* "include/color_dict.pxi":531 * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), # <<<<<<<<<<<<<< * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), */ __pyx_tuple__397 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_104, __pyx_int_137); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(2, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__397); __Pyx_GIVEREF(__pyx_tuple__397); /* "include/color_dict.pxi":532 * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), # <<<<<<<<<<<<<< * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), */ __pyx_tuple__398 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_71, __pyx_int_93); if (unlikely(!__pyx_tuple__398)) __PYX_ERR(2, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__398); __Pyx_GIVEREF(__pyx_tuple__398); /* "include/color_dict.pxi":533 * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), # <<<<<<<<<<<<<< * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), */ __pyx_tuple__399 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_239, __pyx_int_213); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(2, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__399); __Pyx_GIVEREF(__pyx_tuple__399); /* "include/color_dict.pxi":534 * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), */ __pyx_tuple__400 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_218, __pyx_int_185); if (unlikely(!__pyx_tuple__400)) __PYX_ERR(2, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__400); __Pyx_GIVEREF(__pyx_tuple__400); /* "include/color_dict.pxi":536 * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), # <<<<<<<<<<<<<< * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), */ __pyx_tuple__401 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_203, __pyx_int_173); if (unlikely(!__pyx_tuple__401)) __PYX_ERR(2, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__401); __Pyx_GIVEREF(__pyx_tuple__401); /* "include/color_dict.pxi":537 * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), # <<<<<<<<<<<<<< * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), */ __pyx_tuple__402 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_175, __pyx_int_149); if (unlikely(!__pyx_tuple__402)) __PYX_ERR(2, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__402); __Pyx_GIVEREF(__pyx_tuple__402); /* "include/color_dict.pxi":538 * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), # <<<<<<<<<<<<<< * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), */ __pyx_tuple__403 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_119, __pyx_int_101); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(2, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__403); __Pyx_GIVEREF(__pyx_tuple__403); /* "include/color_dict.pxi":539 * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), # <<<<<<<<<<<<<< * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), */ __pyx_tuple__404 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_133, __pyx_int_63); if (unlikely(!__pyx_tuple__404)) __PYX_ERR(2, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__404); __Pyx_GIVEREF(__pyx_tuple__404); /* "include/color_dict.pxi":540 * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), # <<<<<<<<<<<<<< * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), */ __pyx_tuple__405 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_192, __pyx_int_203); if (unlikely(!__pyx_tuple__405)) __PYX_ERR(2, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__405); __Pyx_GIVEREF(__pyx_tuple__405); /* "include/color_dict.pxi":541 * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), # <<<<<<<<<<<<<< * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), */ __pyx_tuple__406 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_181, __pyx_int_197); if (unlikely(!__pyx_tuple__406)) __PYX_ERR(2, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__406); __Pyx_GIVEREF(__pyx_tuple__406); /* "include/color_dict.pxi":542 * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), # <<<<<<<<<<<<<< * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), */ __pyx_tuple__407 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_169, __pyx_int_184); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(2, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__407); __Pyx_GIVEREF(__pyx_tuple__407); /* "include/color_dict.pxi":543 * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), # <<<<<<<<<<<<<< * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), */ __pyx_tuple__408 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_145, __pyx_int_158); if (unlikely(!__pyx_tuple__408)) __PYX_ERR(2, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__408); __Pyx_GIVEREF(__pyx_tuple__408); /* "include/color_dict.pxi":544 * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), # <<<<<<<<<<<<<< * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), */ __pyx_tuple__409 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_99, __pyx_int_108); if (unlikely(!__pyx_tuple__409)) __PYX_ERR(2, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__409); __Pyx_GIVEREF(__pyx_tuple__409); /* "include/color_dict.pxi":545 * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), # <<<<<<<<<<<<<< * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), */ __pyx_tuple__410 = PyTuple_Pack(3, __pyx_int_221, __pyx_int_160, __pyx_int_221); if (unlikely(!__pyx_tuple__410)) __PYX_ERR(2, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__410); __Pyx_GIVEREF(__pyx_tuple__410); /* "include/color_dict.pxi":546 * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), # <<<<<<<<<<<<<< * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), */ __pyx_tuple__411 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_187, __pyx_int_255); if (unlikely(!__pyx_tuple__411)) __PYX_ERR(2, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__411); __Pyx_GIVEREF(__pyx_tuple__411); /* "include/color_dict.pxi":547 * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), # <<<<<<<<<<<<<< * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), */ __pyx_tuple__412 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_174, __pyx_int_238); if (unlikely(!__pyx_tuple__412)) __PYX_ERR(2, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__412); __Pyx_GIVEREF(__pyx_tuple__412); /* "include/color_dict.pxi":548 * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), # <<<<<<<<<<<<<< * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), */ __pyx_tuple__413 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_150, __pyx_int_205); if (unlikely(!__pyx_tuple__413)) __PYX_ERR(2, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__413); __Pyx_GIVEREF(__pyx_tuple__413); /* "include/color_dict.pxi":549 * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), # <<<<<<<<<<<<<< * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), */ __pyx_tuple__414 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_102, __pyx_int_139); if (unlikely(!__pyx_tuple__414)) __PYX_ERR(2, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__414); __Pyx_GIVEREF(__pyx_tuple__414); /* "include/color_dict.pxi":550 * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), # <<<<<<<<<<<<<< * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), */ __pyx_tuple__415 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_224, __pyx_int_230); if (unlikely(!__pyx_tuple__415)) __PYX_ERR(2, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__415); __Pyx_GIVEREF(__pyx_tuple__415); /* "include/color_dict.pxi":551 * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), # <<<<<<<<<<<<<< * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), */ __pyx_tuple__416 = PyTuple_Pack(3, __pyx_int_160, __pyx_int_32, __pyx_int_240); if (unlikely(!__pyx_tuple__416)) __PYX_ERR(2, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__416); __Pyx_GIVEREF(__pyx_tuple__416); /* "include/color_dict.pxi":552 * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), # <<<<<<<<<<<<<< * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), */ __pyx_tuple__417 = PyTuple_Pack(3, __pyx_int_155, __pyx_int_48, __pyx_int_255); if (unlikely(!__pyx_tuple__417)) __PYX_ERR(2, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__417); __Pyx_GIVEREF(__pyx_tuple__417); /* "include/color_dict.pxi":553 * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), # <<<<<<<<<<<<<< * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), */ __pyx_tuple__418 = PyTuple_Pack(3, __pyx_int_145, __pyx_int_44, __pyx_int_238); if (unlikely(!__pyx_tuple__418)) __PYX_ERR(2, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__418); __Pyx_GIVEREF(__pyx_tuple__418); /* "include/color_dict.pxi":554 * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), # <<<<<<<<<<<<<< * 'purple4' : (85, 26, 139), * 'red' : (255, 0, 0), */ __pyx_tuple__419 = PyTuple_Pack(3, __pyx_int_125, __pyx_int_38, __pyx_int_205); if (unlikely(!__pyx_tuple__419)) __PYX_ERR(2, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__419); __Pyx_GIVEREF(__pyx_tuple__419); /* "include/color_dict.pxi":555 * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), # <<<<<<<<<<<<<< * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), */ __pyx_tuple__420 = PyTuple_Pack(3, __pyx_int_85, __pyx_int_26, __pyx_int_139); if (unlikely(!__pyx_tuple__420)) __PYX_ERR(2, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__420); __Pyx_GIVEREF(__pyx_tuple__420); /* "include/color_dict.pxi":556 * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), * 'red' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), */ __pyx_tuple__421 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__421)) __PYX_ERR(2, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__421); __Pyx_GIVEREF(__pyx_tuple__421); /* "include/color_dict.pxi":558 * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), # <<<<<<<<<<<<<< * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), */ __pyx_tuple__422 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__422)) __PYX_ERR(2, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__422); __Pyx_GIVEREF(__pyx_tuple__422); /* "include/color_dict.pxi":559 * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), # <<<<<<<<<<<<<< * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), */ __pyx_tuple__423 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__423)) __PYX_ERR(2, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__423); __Pyx_GIVEREF(__pyx_tuple__423); /* "include/color_dict.pxi":561 * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), # <<<<<<<<<<<<<< * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), */ __pyx_tuple__424 = PyTuple_Pack(3, __pyx_int_188, __pyx_int_143, __pyx_int_143); if (unlikely(!__pyx_tuple__424)) __PYX_ERR(2, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__424); __Pyx_GIVEREF(__pyx_tuple__424); /* "include/color_dict.pxi":562 * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), # <<<<<<<<<<<<<< * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), */ __pyx_tuple__425 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_193, __pyx_int_193); if (unlikely(!__pyx_tuple__425)) __PYX_ERR(2, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__425); __Pyx_GIVEREF(__pyx_tuple__425); /* "include/color_dict.pxi":563 * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), # <<<<<<<<<<<<<< * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), */ __pyx_tuple__426 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_180, __pyx_int_180); if (unlikely(!__pyx_tuple__426)) __PYX_ERR(2, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__426); __Pyx_GIVEREF(__pyx_tuple__426); /* "include/color_dict.pxi":564 * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), # <<<<<<<<<<<<<< * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), */ __pyx_tuple__427 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_155, __pyx_int_155); if (unlikely(!__pyx_tuple__427)) __PYX_ERR(2, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__427); __Pyx_GIVEREF(__pyx_tuple__427); /* "include/color_dict.pxi":565 * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), # <<<<<<<<<<<<<< * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), */ __pyx_tuple__428 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__428)) __PYX_ERR(2, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__428); __Pyx_GIVEREF(__pyx_tuple__428); /* "include/color_dict.pxi":566 * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), # <<<<<<<<<<<<<< * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), */ __pyx_tuple__429 = PyTuple_Pack(3, __pyx_int_65, __pyx_int_105, __pyx_int_225); if (unlikely(!__pyx_tuple__429)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__429); __Pyx_GIVEREF(__pyx_tuple__429); /* "include/color_dict.pxi":567 * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), # <<<<<<<<<<<<<< * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), */ __pyx_tuple__430 = PyTuple_Pack(3, __pyx_int_72, __pyx_int_118, __pyx_int_255); if (unlikely(!__pyx_tuple__430)) __PYX_ERR(2, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__430); __Pyx_GIVEREF(__pyx_tuple__430); /* "include/color_dict.pxi":568 * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), # <<<<<<<<<<<<<< * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), */ __pyx_tuple__431 = PyTuple_Pack(3, __pyx_int_67, __pyx_int_110, __pyx_int_238); if (unlikely(!__pyx_tuple__431)) __PYX_ERR(2, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__431); __Pyx_GIVEREF(__pyx_tuple__431); /* "include/color_dict.pxi":569 * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), # <<<<<<<<<<<<<< * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), */ __pyx_tuple__432 = PyTuple_Pack(3, __pyx_int_58, __pyx_int_95, __pyx_int_205); if (unlikely(!__pyx_tuple__432)) __PYX_ERR(2, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__432); __Pyx_GIVEREF(__pyx_tuple__432); /* "include/color_dict.pxi":570 * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), # <<<<<<<<<<<<<< * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), */ __pyx_tuple__433 = PyTuple_Pack(3, __pyx_int_39, __pyx_int_64, __pyx_int_139); if (unlikely(!__pyx_tuple__433)) __PYX_ERR(2, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__433); __Pyx_GIVEREF(__pyx_tuple__433); /* "include/color_dict.pxi":572 * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), # <<<<<<<<<<<<<< * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), */ __pyx_tuple__434 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_128, __pyx_int_114); if (unlikely(!__pyx_tuple__434)) __PYX_ERR(2, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__434); __Pyx_GIVEREF(__pyx_tuple__434); /* "include/color_dict.pxi":573 * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), # <<<<<<<<<<<<<< * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), */ __pyx_tuple__435 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_140, __pyx_int_105); if (unlikely(!__pyx_tuple__435)) __PYX_ERR(2, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__435); __Pyx_GIVEREF(__pyx_tuple__435); /* "include/color_dict.pxi":574 * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), # <<<<<<<<<<<<<< * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), */ __pyx_tuple__436 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_130, __pyx_int_98); if (unlikely(!__pyx_tuple__436)) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__436); __Pyx_GIVEREF(__pyx_tuple__436); /* "include/color_dict.pxi":575 * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), # <<<<<<<<<<<<<< * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), */ __pyx_tuple__437 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_112, __pyx_int_84); if (unlikely(!__pyx_tuple__437)) __PYX_ERR(2, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__437); __Pyx_GIVEREF(__pyx_tuple__437); /* "include/color_dict.pxi":576 * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), # <<<<<<<<<<<<<< * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), */ __pyx_tuple__438 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_76, __pyx_int_57); if (unlikely(!__pyx_tuple__438)) __PYX_ERR(2, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__438); __Pyx_GIVEREF(__pyx_tuple__438); /* "include/color_dict.pxi":577 * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), # <<<<<<<<<<<<<< * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), */ __pyx_tuple__439 = PyTuple_Pack(3, __pyx_int_244, __pyx_int_164, __pyx_int_96); if (unlikely(!__pyx_tuple__439)) __PYX_ERR(2, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__439); __Pyx_GIVEREF(__pyx_tuple__439); /* "include/color_dict.pxi":578 * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), */ __pyx_tuple__440 = PyTuple_Pack(3, __pyx_int_46, __pyx_int_139, __pyx_int_87); if (unlikely(!__pyx_tuple__440)) __PYX_ERR(2, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__440); __Pyx_GIVEREF(__pyx_tuple__440); /* "include/color_dict.pxi":579 * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), # <<<<<<<<<<<<<< * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), */ __pyx_tuple__441 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_255, __pyx_int_159); if (unlikely(!__pyx_tuple__441)) __PYX_ERR(2, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__441); __Pyx_GIVEREF(__pyx_tuple__441); /* "include/color_dict.pxi":580 * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), # <<<<<<<<<<<<<< * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), */ __pyx_tuple__442 = PyTuple_Pack(3, __pyx_int_78, __pyx_int_238, __pyx_int_148); if (unlikely(!__pyx_tuple__442)) __PYX_ERR(2, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__442); __Pyx_GIVEREF(__pyx_tuple__442); /* "include/color_dict.pxi":581 * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), # <<<<<<<<<<<<<< * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), */ __pyx_tuple__443 = PyTuple_Pack(3, __pyx_int_67, __pyx_int_205, __pyx_int_128); if (unlikely(!__pyx_tuple__443)) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__443); __Pyx_GIVEREF(__pyx_tuple__443); /* "include/color_dict.pxi":583 * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), */ __pyx_tuple__444 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_245, __pyx_int_238); if (unlikely(!__pyx_tuple__444)) __PYX_ERR(2, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__444); __Pyx_GIVEREF(__pyx_tuple__444); /* "include/color_dict.pxi":585 * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), # <<<<<<<<<<<<<< * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), */ __pyx_tuple__445 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_229, __pyx_int_222); if (unlikely(!__pyx_tuple__445)) __PYX_ERR(2, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__445); __Pyx_GIVEREF(__pyx_tuple__445); /* "include/color_dict.pxi":586 * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), # <<<<<<<<<<<<<< * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), */ __pyx_tuple__446 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_197, __pyx_int_191); if (unlikely(!__pyx_tuple__446)) __PYX_ERR(2, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__446); __Pyx_GIVEREF(__pyx_tuple__446); /* "include/color_dict.pxi":587 * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), # <<<<<<<<<<<<<< * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), */ __pyx_tuple__447 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_134, __pyx_int_130); if (unlikely(!__pyx_tuple__447)) __PYX_ERR(2, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__447); __Pyx_GIVEREF(__pyx_tuple__447); /* "include/color_dict.pxi":588 * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), # <<<<<<<<<<<<<< * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), */ __pyx_tuple__448 = PyTuple_Pack(3, __pyx_int_160, __pyx_int_82, __pyx_int_45); if (unlikely(!__pyx_tuple__448)) __PYX_ERR(2, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__448); __Pyx_GIVEREF(__pyx_tuple__448); /* "include/color_dict.pxi":589 * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), # <<<<<<<<<<<<<< * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), */ __pyx_tuple__449 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_130, __pyx_int_71); if (unlikely(!__pyx_tuple__449)) __PYX_ERR(2, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__449); __Pyx_GIVEREF(__pyx_tuple__449); /* "include/color_dict.pxi":590 * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), # <<<<<<<<<<<<<< * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), */ __pyx_tuple__450 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_121, __pyx_int_66); if (unlikely(!__pyx_tuple__450)) __PYX_ERR(2, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__450); __Pyx_GIVEREF(__pyx_tuple__450); /* "include/color_dict.pxi":591 * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), # <<<<<<<<<<<<<< * 'sienna4' : (139, 71, 38), * 'skyblue' : (135, 206, 235), */ __pyx_tuple__451 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_104, __pyx_int_57); if (unlikely(!__pyx_tuple__451)) __PYX_ERR(2, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__451); __Pyx_GIVEREF(__pyx_tuple__451); /* "include/color_dict.pxi":592 * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), # <<<<<<<<<<<<<< * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), */ __pyx_tuple__452 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_71, __pyx_int_38); if (unlikely(!__pyx_tuple__452)) __PYX_ERR(2, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__452); __Pyx_GIVEREF(__pyx_tuple__452); /* "include/color_dict.pxi":593 * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), * 'skyblue' : (135, 206, 235), # <<<<<<<<<<<<<< * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), */ __pyx_tuple__453 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_206, __pyx_int_235); if (unlikely(!__pyx_tuple__453)) __PYX_ERR(2, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__453); __Pyx_GIVEREF(__pyx_tuple__453); /* "include/color_dict.pxi":594 * 'sienna4' : (139, 71, 38), * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), # <<<<<<<<<<<<<< * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), */ __pyx_tuple__454 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_206, __pyx_int_255); if (unlikely(!__pyx_tuple__454)) __PYX_ERR(2, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__454); __Pyx_GIVEREF(__pyx_tuple__454); /* "include/color_dict.pxi":595 * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), # <<<<<<<<<<<<<< * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), */ __pyx_tuple__455 = PyTuple_Pack(3, __pyx_int_126, __pyx_int_192, __pyx_int_238); if (unlikely(!__pyx_tuple__455)) __PYX_ERR(2, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__455); __Pyx_GIVEREF(__pyx_tuple__455); /* "include/color_dict.pxi":596 * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), # <<<<<<<<<<<<<< * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), */ __pyx_tuple__456 = PyTuple_Pack(3, __pyx_int_108, __pyx_int_166, __pyx_int_205); if (unlikely(!__pyx_tuple__456)) __PYX_ERR(2, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__456); __Pyx_GIVEREF(__pyx_tuple__456); /* "include/color_dict.pxi":597 * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), # <<<<<<<<<<<<<< * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), */ __pyx_tuple__457 = PyTuple_Pack(3, __pyx_int_74, __pyx_int_112, __pyx_int_139); if (unlikely(!__pyx_tuple__457)) __PYX_ERR(2, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__457); __Pyx_GIVEREF(__pyx_tuple__457); /* "include/color_dict.pxi":598 * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), # <<<<<<<<<<<<<< * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), */ __pyx_tuple__458 = PyTuple_Pack(3, __pyx_int_106, __pyx_int_90, __pyx_int_205); if (unlikely(!__pyx_tuple__458)) __PYX_ERR(2, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__458); __Pyx_GIVEREF(__pyx_tuple__458); /* "include/color_dict.pxi":599 * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), # <<<<<<<<<<<<<< * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), */ __pyx_tuple__459 = PyTuple_Pack(3, __pyx_int_131, __pyx_int_111, __pyx_int_255); if (unlikely(!__pyx_tuple__459)) __PYX_ERR(2, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__459); __Pyx_GIVEREF(__pyx_tuple__459); /* "include/color_dict.pxi":600 * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), # <<<<<<<<<<<<<< * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), */ __pyx_tuple__460 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_103, __pyx_int_238); if (unlikely(!__pyx_tuple__460)) __PYX_ERR(2, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__460); __Pyx_GIVEREF(__pyx_tuple__460); /* "include/color_dict.pxi":601 * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), # <<<<<<<<<<<<<< * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), */ __pyx_tuple__461 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_89, __pyx_int_205); if (unlikely(!__pyx_tuple__461)) __PYX_ERR(2, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__461); __Pyx_GIVEREF(__pyx_tuple__461); /* "include/color_dict.pxi":602 * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), # <<<<<<<<<<<<<< * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), */ __pyx_tuple__462 = PyTuple_Pack(3, __pyx_int_71, __pyx_int_60, __pyx_int_139); if (unlikely(!__pyx_tuple__462)) __PYX_ERR(2, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__462); __Pyx_GIVEREF(__pyx_tuple__462); /* "include/color_dict.pxi":603 * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), # <<<<<<<<<<<<<< * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), */ __pyx_tuple__463 = PyTuple_Pack(3, __pyx_int_112, __pyx_int_128, __pyx_int_144); if (unlikely(!__pyx_tuple__463)) __PYX_ERR(2, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__463); __Pyx_GIVEREF(__pyx_tuple__463); /* "include/color_dict.pxi":604 * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), # <<<<<<<<<<<<<< * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), */ __pyx_tuple__464 = PyTuple_Pack(3, __pyx_int_198, __pyx_int_226, __pyx_int_255); if (unlikely(!__pyx_tuple__464)) __PYX_ERR(2, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__464); __Pyx_GIVEREF(__pyx_tuple__464); /* "include/color_dict.pxi":605 * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), # <<<<<<<<<<<<<< * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), */ __pyx_tuple__465 = PyTuple_Pack(3, __pyx_int_185, __pyx_int_211, __pyx_int_238); if (unlikely(!__pyx_tuple__465)) __PYX_ERR(2, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__465); __Pyx_GIVEREF(__pyx_tuple__465); /* "include/color_dict.pxi":606 * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), # <<<<<<<<<<<<<< * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), */ __pyx_tuple__466 = PyTuple_Pack(3, __pyx_int_159, __pyx_int_182, __pyx_int_205); if (unlikely(!__pyx_tuple__466)) __PYX_ERR(2, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__466); __Pyx_GIVEREF(__pyx_tuple__466); /* "include/color_dict.pxi":607 * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), # <<<<<<<<<<<<<< * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), */ __pyx_tuple__467 = PyTuple_Pack(3, __pyx_int_108, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__467)) __PYX_ERR(2, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__467); __Pyx_GIVEREF(__pyx_tuple__467); /* "include/color_dict.pxi":609 * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), */ __pyx_tuple__468 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_250); if (unlikely(!__pyx_tuple__468)) __PYX_ERR(2, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__468); __Pyx_GIVEREF(__pyx_tuple__468); /* "include/color_dict.pxi":611 * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), # <<<<<<<<<<<<<< * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), */ __pyx_tuple__469 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_233, __pyx_int_233); if (unlikely(!__pyx_tuple__469)) __PYX_ERR(2, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__469); __Pyx_GIVEREF(__pyx_tuple__469); /* "include/color_dict.pxi":612 * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), # <<<<<<<<<<<<<< * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), */ __pyx_tuple__470 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_201, __pyx_int_201); if (unlikely(!__pyx_tuple__470)) __PYX_ERR(2, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__470); __Pyx_GIVEREF(__pyx_tuple__470); /* "include/color_dict.pxi":613 * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), # <<<<<<<<<<<<<< * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), */ __pyx_tuple__471 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_137, __pyx_int_137); if (unlikely(!__pyx_tuple__471)) __PYX_ERR(2, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__471); __Pyx_GIVEREF(__pyx_tuple__471); /* "include/color_dict.pxi":614 * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), */ __pyx_tuple__472 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_127); if (unlikely(!__pyx_tuple__472)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__472); __Pyx_GIVEREF(__pyx_tuple__472); /* "include/color_dict.pxi":616 * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), # <<<<<<<<<<<<<< * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), */ __pyx_tuple__473 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_238, __pyx_int_118); if (unlikely(!__pyx_tuple__473)) __PYX_ERR(2, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__473); __Pyx_GIVEREF(__pyx_tuple__473); /* "include/color_dict.pxi":617 * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), # <<<<<<<<<<<<<< * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), */ __pyx_tuple__474 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_205, __pyx_int_102); if (unlikely(!__pyx_tuple__474)) __PYX_ERR(2, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__474); __Pyx_GIVEREF(__pyx_tuple__474); /* "include/color_dict.pxi":618 * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), # <<<<<<<<<<<<<< * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), */ __pyx_tuple__475 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_69); if (unlikely(!__pyx_tuple__475)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__475); __Pyx_GIVEREF(__pyx_tuple__475); /* "include/color_dict.pxi":619 * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), # <<<<<<<<<<<<<< * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), */ __pyx_tuple__476 = PyTuple_Pack(3, __pyx_int_70, __pyx_int_130, __pyx_int_180); if (unlikely(!__pyx_tuple__476)) __PYX_ERR(2, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__476); __Pyx_GIVEREF(__pyx_tuple__476); /* "include/color_dict.pxi":620 * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), # <<<<<<<<<<<<<< * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), */ __pyx_tuple__477 = PyTuple_Pack(3, __pyx_int_99, __pyx_int_184, __pyx_int_255); if (unlikely(!__pyx_tuple__477)) __PYX_ERR(2, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__477); __Pyx_GIVEREF(__pyx_tuple__477); /* "include/color_dict.pxi":621 * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), # <<<<<<<<<<<<<< * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), */ __pyx_tuple__478 = PyTuple_Pack(3, __pyx_int_92, __pyx_int_172, __pyx_int_238); if (unlikely(!__pyx_tuple__478)) __PYX_ERR(2, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__478); __Pyx_GIVEREF(__pyx_tuple__478); /* "include/color_dict.pxi":622 * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), # <<<<<<<<<<<<<< * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), */ __pyx_tuple__479 = PyTuple_Pack(3, __pyx_int_79, __pyx_int_148, __pyx_int_205); if (unlikely(!__pyx_tuple__479)) __PYX_ERR(2, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__479); __Pyx_GIVEREF(__pyx_tuple__479); /* "include/color_dict.pxi":623 * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), # <<<<<<<<<<<<<< * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), */ __pyx_tuple__480 = PyTuple_Pack(3, __pyx_int_54, __pyx_int_100, __pyx_int_139); if (unlikely(!__pyx_tuple__480)) __PYX_ERR(2, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__480); __Pyx_GIVEREF(__pyx_tuple__480); /* "include/color_dict.pxi":624 * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), # <<<<<<<<<<<<<< * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), */ __pyx_tuple__481 = PyTuple_Pack(3, __pyx_int_210, __pyx_int_180, __pyx_int_140); if (unlikely(!__pyx_tuple__481)) __PYX_ERR(2, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__481); __Pyx_GIVEREF(__pyx_tuple__481); /* "include/color_dict.pxi":625 * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), # <<<<<<<<<<<<<< * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), */ __pyx_tuple__482 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_165, __pyx_int_79); if (unlikely(!__pyx_tuple__482)) __PYX_ERR(2, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__482); __Pyx_GIVEREF(__pyx_tuple__482); /* "include/color_dict.pxi":626 * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), # <<<<<<<<<<<<<< * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), */ __pyx_tuple__483 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_154, __pyx_int_73); if (unlikely(!__pyx_tuple__483)) __PYX_ERR(2, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__483); __Pyx_GIVEREF(__pyx_tuple__483); /* "include/color_dict.pxi":628 * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), # <<<<<<<<<<<<<< * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), */ __pyx_tuple__484 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_90, __pyx_int_43); if (unlikely(!__pyx_tuple__484)) __PYX_ERR(2, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__484); __Pyx_GIVEREF(__pyx_tuple__484); /* "include/color_dict.pxi":629 * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), * 'thistle' : (216, 191, 216), # <<<<<<<<<<<<<< * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), */ __pyx_tuple__485 = PyTuple_Pack(3, __pyx_int_216, __pyx_int_191, __pyx_int_216); if (unlikely(!__pyx_tuple__485)) __PYX_ERR(2, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__485); __Pyx_GIVEREF(__pyx_tuple__485); /* "include/color_dict.pxi":630 * 'tan4' : (139, 90, 43), * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), # <<<<<<<<<<<<<< * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), */ __pyx_tuple__486 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_225, __pyx_int_255); if (unlikely(!__pyx_tuple__486)) __PYX_ERR(2, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__486); __Pyx_GIVEREF(__pyx_tuple__486); /* "include/color_dict.pxi":631 * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), # <<<<<<<<<<<<<< * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), */ __pyx_tuple__487 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_210, __pyx_int_238); if (unlikely(!__pyx_tuple__487)) __PYX_ERR(2, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__487); __Pyx_GIVEREF(__pyx_tuple__487); /* "include/color_dict.pxi":632 * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), # <<<<<<<<<<<<<< * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), */ __pyx_tuple__488 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_181, __pyx_int_205); if (unlikely(!__pyx_tuple__488)) __PYX_ERR(2, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__488); __Pyx_GIVEREF(__pyx_tuple__488); /* "include/color_dict.pxi":633 * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), # <<<<<<<<<<<<<< * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), */ __pyx_tuple__489 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__489)) __PYX_ERR(2, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__489); __Pyx_GIVEREF(__pyx_tuple__489); /* "include/color_dict.pxi":634 * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), */ __pyx_tuple__490 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_99, __pyx_int_71); if (unlikely(!__pyx_tuple__490)) __PYX_ERR(2, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__490); __Pyx_GIVEREF(__pyx_tuple__490); /* "include/color_dict.pxi":636 * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), # <<<<<<<<<<<<<< * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), */ __pyx_tuple__491 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_92, __pyx_int_66); if (unlikely(!__pyx_tuple__491)) __PYX_ERR(2, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__491); __Pyx_GIVEREF(__pyx_tuple__491); /* "include/color_dict.pxi":637 * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), # <<<<<<<<<<<<<< * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), */ __pyx_tuple__492 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_79, __pyx_int_57); if (unlikely(!__pyx_tuple__492)) __PYX_ERR(2, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__492); __Pyx_GIVEREF(__pyx_tuple__492); /* "include/color_dict.pxi":638 * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), # <<<<<<<<<<<<<< * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), */ __pyx_tuple__493 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_54, __pyx_int_38); if (unlikely(!__pyx_tuple__493)) __PYX_ERR(2, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__493); __Pyx_GIVEREF(__pyx_tuple__493); /* "include/color_dict.pxi":639 * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), # <<<<<<<<<<<<<< * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), */ __pyx_tuple__494 = PyTuple_Pack(3, __pyx_int_64, __pyx_int_224, __pyx_int_208); if (unlikely(!__pyx_tuple__494)) __PYX_ERR(2, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__494); __Pyx_GIVEREF(__pyx_tuple__494); /* "include/color_dict.pxi":640 * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), # <<<<<<<<<<<<<< * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), */ __pyx_tuple__495 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_245, __pyx_int_255); if (unlikely(!__pyx_tuple__495)) __PYX_ERR(2, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__495); __Pyx_GIVEREF(__pyx_tuple__495); /* "include/color_dict.pxi":641 * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), # <<<<<<<<<<<<<< * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), */ __pyx_tuple__496 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_229, __pyx_int_238); if (unlikely(!__pyx_tuple__496)) __PYX_ERR(2, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__496); __Pyx_GIVEREF(__pyx_tuple__496); /* "include/color_dict.pxi":642 * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), # <<<<<<<<<<<<<< * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), */ __pyx_tuple__497 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_197, __pyx_int_205); if (unlikely(!__pyx_tuple__497)) __PYX_ERR(2, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__497); __Pyx_GIVEREF(__pyx_tuple__497); /* "include/color_dict.pxi":643 * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), # <<<<<<<<<<<<<< * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), */ __pyx_tuple__498 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_134, __pyx_int_139); if (unlikely(!__pyx_tuple__498)) __PYX_ERR(2, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__498); __Pyx_GIVEREF(__pyx_tuple__498); /* "include/color_dict.pxi":644 * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), # <<<<<<<<<<<<<< * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), */ __pyx_tuple__499 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_130, __pyx_int_238); if (unlikely(!__pyx_tuple__499)) __PYX_ERR(2, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__499); __Pyx_GIVEREF(__pyx_tuple__499); /* "include/color_dict.pxi":645 * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), # <<<<<<<<<<<<<< * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), */ __pyx_tuple__500 = PyTuple_Pack(3, __pyx_int_208, __pyx_int_32, __pyx_int_144); if (unlikely(!__pyx_tuple__500)) __PYX_ERR(2, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__500); __Pyx_GIVEREF(__pyx_tuple__500); /* "include/color_dict.pxi":646 * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), # <<<<<<<<<<<<<< * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), */ __pyx_tuple__501 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_62, __pyx_int_150); if (unlikely(!__pyx_tuple__501)) __PYX_ERR(2, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__501); __Pyx_GIVEREF(__pyx_tuple__501); /* "include/color_dict.pxi":647 * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), # <<<<<<<<<<<<<< * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), */ __pyx_tuple__502 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_58, __pyx_int_140); if (unlikely(!__pyx_tuple__502)) __PYX_ERR(2, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__502); __Pyx_GIVEREF(__pyx_tuple__502); /* "include/color_dict.pxi":648 * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), # <<<<<<<<<<<<<< * 'violetred4' : (139, 34, 82), * 'wheat' : (245, 222, 179), */ __pyx_tuple__503 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_50, __pyx_int_120); if (unlikely(!__pyx_tuple__503)) __PYX_ERR(2, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__503); __Pyx_GIVEREF(__pyx_tuple__503); /* "include/color_dict.pxi":649 * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), # <<<<<<<<<<<<<< * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), */ __pyx_tuple__504 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_34, __pyx_int_82); if (unlikely(!__pyx_tuple__504)) __PYX_ERR(2, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__504); __Pyx_GIVEREF(__pyx_tuple__504); /* "include/color_dict.pxi":650 * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), * 'wheat' : (245, 222, 179), # <<<<<<<<<<<<<< * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), */ __pyx_tuple__505 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_222, __pyx_int_179); if (unlikely(!__pyx_tuple__505)) __PYX_ERR(2, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__505); __Pyx_GIVEREF(__pyx_tuple__505); /* "include/color_dict.pxi":651 * 'violetred4' : (139, 34, 82), * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), # <<<<<<<<<<<<<< * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), */ __pyx_tuple__506 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_231, __pyx_int_186); if (unlikely(!__pyx_tuple__506)) __PYX_ERR(2, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__506); __Pyx_GIVEREF(__pyx_tuple__506); /* "include/color_dict.pxi":652 * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), # <<<<<<<<<<<<<< * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), */ __pyx_tuple__507 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_216, __pyx_int_174); if (unlikely(!__pyx_tuple__507)) __PYX_ERR(2, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__507); __Pyx_GIVEREF(__pyx_tuple__507); /* "include/color_dict.pxi":653 * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), # <<<<<<<<<<<<<< * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), */ __pyx_tuple__508 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_186, __pyx_int_150); if (unlikely(!__pyx_tuple__508)) __PYX_ERR(2, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__508); __Pyx_GIVEREF(__pyx_tuple__508); /* "include/color_dict.pxi":654 * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), # <<<<<<<<<<<<<< * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), */ __pyx_tuple__509 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_126, __pyx_int_102); if (unlikely(!__pyx_tuple__509)) __PYX_ERR(2, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__509); __Pyx_GIVEREF(__pyx_tuple__509); /* "include/color_dict.pxi":657 * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), * 'yellow' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), */ __pyx_tuple__510 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__510)) __PYX_ERR(2, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__510); __Pyx_GIVEREF(__pyx_tuple__510); /* "include/color_dict.pxi":659 * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), # <<<<<<<<<<<<<< * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), */ __pyx_tuple__511 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_238, __pyx_int_0); if (unlikely(!__pyx_tuple__511)) __PYX_ERR(2, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__511); __Pyx_GIVEREF(__pyx_tuple__511); /* "include/color_dict.pxi":660 * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), # <<<<<<<<<<<<<< * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), */ __pyx_tuple__512 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_205, __pyx_int_0); if (unlikely(!__pyx_tuple__512)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__512); __Pyx_GIVEREF(__pyx_tuple__512); /* "include/color_dict.pxi":661 * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), # <<<<<<<<<<<<<< * 'yellowgreen' : (154, 205, 50), * } */ __pyx_tuple__513 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_139, __pyx_int_0); if (unlikely(!__pyx_tuple__513)) __PYX_ERR(2, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__513); __Pyx_GIVEREF(__pyx_tuple__513); /* "pygame_sdl2/color.pyx":161 * return float(int(self)) * * def __reduce__(self): # <<<<<<<<<<<<<< * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) */ __pyx_tuple__514 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_d); if (unlikely(!__pyx_tuple__514)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__514); __Pyx_GIVEREF(__pyx_tuple__514); __pyx_codeobj__515 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__514, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_reduce, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__515)) __PYX_ERR(0, 161, __pyx_L1_error) /* "pygame_sdl2/color.pyx":166 * return (Color, (), d) * * def __setstate__(self, d): # <<<<<<<<<<<<<< * self.r, self.g, self.b, self.a = d['rgba'] * */ __pyx_codeobj__516 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__514, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_setstate, 166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__516)) __PYX_ERR(0, 166, __pyx_L1_error) /* "pygame_sdl2/color.pyx":449 * self.b = int(b * 255) * * def normalize(self): # <<<<<<<<<<<<<< * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * */ __pyx_tuple__517 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__517)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__517); __Pyx_GIVEREF(__pyx_tuple__517); __pyx_codeobj__518 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__517, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_normalize, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__518)) __PYX_ERR(0, 449, __pyx_L1_error) /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ __pyx_tuple__519 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_gamma, __pyx_n_s_m, __pyx_n_s_c); if (unlikely(!__pyx_tuple__519)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__519); __Pyx_GIVEREF(__pyx_tuple__519); __pyx_codeobj__520 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__519, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_correct_gamma, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__520)) __PYX_ERR(0, 452, __pyx_L1_error) /* "pygame_sdl2/color.pyx":457 * return c * * def set_length(self, n): # <<<<<<<<<<<<<< * if n > 4 or n < 1: * raise ValueError(n) */ __pyx_tuple__521 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_n); if (unlikely(!__pyx_tuple__521)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__521); __Pyx_GIVEREF(__pyx_tuple__521); __pyx_codeobj__522 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__521, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_set_length, 457, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__522)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_float_255_0 = PyFloat_FromDouble(255.0); if (unlikely(!__pyx_float_255_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_360_0 = PyFloat_FromDouble(360.0); if (unlikely(!__pyx_float_360_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_28 = PyInt_FromLong(28); if (unlikely(!__pyx_int_28)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_29 = PyInt_FromLong(29); if (unlikely(!__pyx_int_29)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_33 = PyInt_FromLong(33); if (unlikely(!__pyx_int_33)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_34 = PyInt_FromLong(34); if (unlikely(!__pyx_int_34)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_35 = PyInt_FromLong(35); if (unlikely(!__pyx_int_35)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_36 = PyInt_FromLong(36); if (unlikely(!__pyx_int_36)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_37 = PyInt_FromLong(37); if (unlikely(!__pyx_int_37)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_38 = PyInt_FromLong(38); if (unlikely(!__pyx_int_38)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_39 = PyInt_FromLong(39); if (unlikely(!__pyx_int_39)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_41 = PyInt_FromLong(41); if (unlikely(!__pyx_int_41)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_42 = PyInt_FromLong(42); if (unlikely(!__pyx_int_42)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_43 = PyInt_FromLong(43); if (unlikely(!__pyx_int_43)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_44 = PyInt_FromLong(44); if (unlikely(!__pyx_int_44)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_45 = PyInt_FromLong(45); if (unlikely(!__pyx_int_45)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_46 = PyInt_FromLong(46); if (unlikely(!__pyx_int_46)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_47 = PyInt_FromLong(47); if (unlikely(!__pyx_int_47)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_48 = PyInt_FromLong(48); if (unlikely(!__pyx_int_48)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_51 = PyInt_FromLong(51); if (unlikely(!__pyx_int_51)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_52 = PyInt_FromLong(52); if (unlikely(!__pyx_int_52)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_54 = PyInt_FromLong(54); if (unlikely(!__pyx_int_54)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_55 = PyInt_FromLong(55); if (unlikely(!__pyx_int_55)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_56 = PyInt_FromLong(56); if (unlikely(!__pyx_int_56)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_57 = PyInt_FromLong(57); if (unlikely(!__pyx_int_57)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_58 = PyInt_FromLong(58); if (unlikely(!__pyx_int_58)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_61 = PyInt_FromLong(61); if (unlikely(!__pyx_int_61)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_62 = PyInt_FromLong(62); if (unlikely(!__pyx_int_62)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_63 = PyInt_FromLong(63); if (unlikely(!__pyx_int_63)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_65 = PyInt_FromLong(65); if (unlikely(!__pyx_int_65)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_66 = PyInt_FromLong(66); if (unlikely(!__pyx_int_66)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_67 = PyInt_FromLong(67); if (unlikely(!__pyx_int_67)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_69 = PyInt_FromLong(69); if (unlikely(!__pyx_int_69)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_70 = PyInt_FromLong(70); if (unlikely(!__pyx_int_70)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_71 = PyInt_FromLong(71); if (unlikely(!__pyx_int_71)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_72 = PyInt_FromLong(72); if (unlikely(!__pyx_int_72)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_73 = PyInt_FromLong(73); if (unlikely(!__pyx_int_73)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_74 = PyInt_FromLong(74); if (unlikely(!__pyx_int_74)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_76 = PyInt_FromLong(76); if (unlikely(!__pyx_int_76)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_77 = PyInt_FromLong(77); if (unlikely(!__pyx_int_77)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_78 = PyInt_FromLong(78); if (unlikely(!__pyx_int_78)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_79 = PyInt_FromLong(79); if (unlikely(!__pyx_int_79)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_80 = PyInt_FromLong(80); if (unlikely(!__pyx_int_80)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_81 = PyInt_FromLong(81); if (unlikely(!__pyx_int_81)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_82 = PyInt_FromLong(82); if (unlikely(!__pyx_int_82)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_83 = PyInt_FromLong(83); if (unlikely(!__pyx_int_83)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_84 = PyInt_FromLong(84); if (unlikely(!__pyx_int_84)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_85 = PyInt_FromLong(85); if (unlikely(!__pyx_int_85)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_86 = PyInt_FromLong(86); if (unlikely(!__pyx_int_86)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_87 = PyInt_FromLong(87); if (unlikely(!__pyx_int_87)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_89 = PyInt_FromLong(89); if (unlikely(!__pyx_int_89)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_91 = PyInt_FromLong(91); if (unlikely(!__pyx_int_91)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_92 = PyInt_FromLong(92); if (unlikely(!__pyx_int_92)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_93 = PyInt_FromLong(93); if (unlikely(!__pyx_int_93)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_94 = PyInt_FromLong(94); if (unlikely(!__pyx_int_94)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_95 = PyInt_FromLong(95); if (unlikely(!__pyx_int_95)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_96 = PyInt_FromLong(96); if (unlikely(!__pyx_int_96)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_97 = PyInt_FromLong(97); if (unlikely(!__pyx_int_97)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_98 = PyInt_FromLong(98); if (unlikely(!__pyx_int_98)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_99 = PyInt_FromLong(99); if (unlikely(!__pyx_int_99)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_101 = PyInt_FromLong(101); if (unlikely(!__pyx_int_101)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_102 = PyInt_FromLong(102); if (unlikely(!__pyx_int_102)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_103 = PyInt_FromLong(103); if (unlikely(!__pyx_int_103)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_104 = PyInt_FromLong(104); if (unlikely(!__pyx_int_104)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_105 = PyInt_FromLong(105); if (unlikely(!__pyx_int_105)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_106 = PyInt_FromLong(106); if (unlikely(!__pyx_int_106)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_107 = PyInt_FromLong(107); if (unlikely(!__pyx_int_107)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_108 = PyInt_FromLong(108); if (unlikely(!__pyx_int_108)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_110 = PyInt_FromLong(110); if (unlikely(!__pyx_int_110)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_111 = PyInt_FromLong(111); if (unlikely(!__pyx_int_111)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_112 = PyInt_FromLong(112); if (unlikely(!__pyx_int_112)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_113 = PyInt_FromLong(113); if (unlikely(!__pyx_int_113)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_114 = PyInt_FromLong(114); if (unlikely(!__pyx_int_114)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_115 = PyInt_FromLong(115); if (unlikely(!__pyx_int_115)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_116 = PyInt_FromLong(116); if (unlikely(!__pyx_int_116)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_117 = PyInt_FromLong(117); if (unlikely(!__pyx_int_117)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_118 = PyInt_FromLong(118); if (unlikely(!__pyx_int_118)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_119 = PyInt_FromLong(119); if (unlikely(!__pyx_int_119)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_120 = PyInt_FromLong(120); if (unlikely(!__pyx_int_120)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_121 = PyInt_FromLong(121); if (unlikely(!__pyx_int_121)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_122 = PyInt_FromLong(122); if (unlikely(!__pyx_int_122)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_123 = PyInt_FromLong(123); if (unlikely(!__pyx_int_123)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_124 = PyInt_FromLong(124); if (unlikely(!__pyx_int_124)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_125 = PyInt_FromLong(125); if (unlikely(!__pyx_int_125)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_126 = PyInt_FromLong(126); if (unlikely(!__pyx_int_126)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_127 = PyInt_FromLong(127); if (unlikely(!__pyx_int_127)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_129 = PyInt_FromLong(129); if (unlikely(!__pyx_int_129)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_130 = PyInt_FromLong(130); if (unlikely(!__pyx_int_130)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_131 = PyInt_FromLong(131); if (unlikely(!__pyx_int_131)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_132 = PyInt_FromLong(132); if (unlikely(!__pyx_int_132)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_133 = PyInt_FromLong(133); if (unlikely(!__pyx_int_133)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_134 = PyInt_FromLong(134); if (unlikely(!__pyx_int_134)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_135 = PyInt_FromLong(135); if (unlikely(!__pyx_int_135)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_136 = PyInt_FromLong(136); if (unlikely(!__pyx_int_136)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_137 = PyInt_FromLong(137); if (unlikely(!__pyx_int_137)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_138 = PyInt_FromLong(138); if (unlikely(!__pyx_int_138)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_139 = PyInt_FromLong(139); if (unlikely(!__pyx_int_139)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_140 = PyInt_FromLong(140); if (unlikely(!__pyx_int_140)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_141 = PyInt_FromLong(141); if (unlikely(!__pyx_int_141)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_142 = PyInt_FromLong(142); if (unlikely(!__pyx_int_142)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_143 = PyInt_FromLong(143); if (unlikely(!__pyx_int_143)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_144 = PyInt_FromLong(144); if (unlikely(!__pyx_int_144)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_145 = PyInt_FromLong(145); if (unlikely(!__pyx_int_145)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_147 = PyInt_FromLong(147); if (unlikely(!__pyx_int_147)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_148 = PyInt_FromLong(148); if (unlikely(!__pyx_int_148)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_149 = PyInt_FromLong(149); if (unlikely(!__pyx_int_149)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_150 = PyInt_FromLong(150); if (unlikely(!__pyx_int_150)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_151 = PyInt_FromLong(151); if (unlikely(!__pyx_int_151)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_152 = PyInt_FromLong(152); if (unlikely(!__pyx_int_152)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_153 = PyInt_FromLong(153); if (unlikely(!__pyx_int_153)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_154 = PyInt_FromLong(154); if (unlikely(!__pyx_int_154)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_155 = PyInt_FromLong(155); if (unlikely(!__pyx_int_155)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_156 = PyInt_FromLong(156); if (unlikely(!__pyx_int_156)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_158 = PyInt_FromLong(158); if (unlikely(!__pyx_int_158)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_159 = PyInt_FromLong(159); if (unlikely(!__pyx_int_159)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_160 = PyInt_FromLong(160); if (unlikely(!__pyx_int_160)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_161 = PyInt_FromLong(161); if (unlikely(!__pyx_int_161)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_162 = PyInt_FromLong(162); if (unlikely(!__pyx_int_162)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_163 = PyInt_FromLong(163); if (unlikely(!__pyx_int_163)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_164 = PyInt_FromLong(164); if (unlikely(!__pyx_int_164)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_165 = PyInt_FromLong(165); if (unlikely(!__pyx_int_165)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_166 = PyInt_FromLong(166); if (unlikely(!__pyx_int_166)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_167 = PyInt_FromLong(167); if (unlikely(!__pyx_int_167)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_168 = PyInt_FromLong(168); if (unlikely(!__pyx_int_168)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_169 = PyInt_FromLong(169); if (unlikely(!__pyx_int_169)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_170 = PyInt_FromLong(170); if (unlikely(!__pyx_int_170)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_171 = PyInt_FromLong(171); if (unlikely(!__pyx_int_171)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_172 = PyInt_FromLong(172); if (unlikely(!__pyx_int_172)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_173 = PyInt_FromLong(173); if (unlikely(!__pyx_int_173)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_174 = PyInt_FromLong(174); if (unlikely(!__pyx_int_174)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_175 = PyInt_FromLong(175); if (unlikely(!__pyx_int_175)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_176 = PyInt_FromLong(176); if (unlikely(!__pyx_int_176)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_177 = PyInt_FromLong(177); if (unlikely(!__pyx_int_177)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_178 = PyInt_FromLong(178); if (unlikely(!__pyx_int_178)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_179 = PyInt_FromLong(179); if (unlikely(!__pyx_int_179)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_180 = PyInt_FromLong(180); if (unlikely(!__pyx_int_180)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_181 = PyInt_FromLong(181); if (unlikely(!__pyx_int_181)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_182 = PyInt_FromLong(182); if (unlikely(!__pyx_int_182)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_183 = PyInt_FromLong(183); if (unlikely(!__pyx_int_183)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_184 = PyInt_FromLong(184); if (unlikely(!__pyx_int_184)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_185 = PyInt_FromLong(185); if (unlikely(!__pyx_int_185)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_186 = PyInt_FromLong(186); if (unlikely(!__pyx_int_186)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_187 = PyInt_FromLong(187); if (unlikely(!__pyx_int_187)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_188 = PyInt_FromLong(188); if (unlikely(!__pyx_int_188)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_189 = PyInt_FromLong(189); if (unlikely(!__pyx_int_189)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_190 = PyInt_FromLong(190); if (unlikely(!__pyx_int_190)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_191 = PyInt_FromLong(191); if (unlikely(!__pyx_int_191)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_192 = PyInt_FromLong(192); if (unlikely(!__pyx_int_192)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_193 = PyInt_FromLong(193); if (unlikely(!__pyx_int_193)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_194 = PyInt_FromLong(194); if (unlikely(!__pyx_int_194)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_196 = PyInt_FromLong(196); if (unlikely(!__pyx_int_196)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_197 = PyInt_FromLong(197); if (unlikely(!__pyx_int_197)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_198 = PyInt_FromLong(198); if (unlikely(!__pyx_int_198)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_199 = PyInt_FromLong(199); if (unlikely(!__pyx_int_199)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_200 = PyInt_FromLong(200); if (unlikely(!__pyx_int_200)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_201 = PyInt_FromLong(201); if (unlikely(!__pyx_int_201)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_202 = PyInt_FromLong(202); if (unlikely(!__pyx_int_202)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_203 = PyInt_FromLong(203); if (unlikely(!__pyx_int_203)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_204 = PyInt_FromLong(204); if (unlikely(!__pyx_int_204)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_205 = PyInt_FromLong(205); if (unlikely(!__pyx_int_205)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_206 = PyInt_FromLong(206); if (unlikely(!__pyx_int_206)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_207 = PyInt_FromLong(207); if (unlikely(!__pyx_int_207)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_208 = PyInt_FromLong(208); if (unlikely(!__pyx_int_208)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_209 = PyInt_FromLong(209); if (unlikely(!__pyx_int_209)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_210 = PyInt_FromLong(210); if (unlikely(!__pyx_int_210)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_211 = PyInt_FromLong(211); if (unlikely(!__pyx_int_211)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_212 = PyInt_FromLong(212); if (unlikely(!__pyx_int_212)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_213 = PyInt_FromLong(213); if (unlikely(!__pyx_int_213)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_214 = PyInt_FromLong(214); if (unlikely(!__pyx_int_214)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_215 = PyInt_FromLong(215); if (unlikely(!__pyx_int_215)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_216 = PyInt_FromLong(216); if (unlikely(!__pyx_int_216)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_217 = PyInt_FromLong(217); if (unlikely(!__pyx_int_217)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_218 = PyInt_FromLong(218); if (unlikely(!__pyx_int_218)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_219 = PyInt_FromLong(219); if (unlikely(!__pyx_int_219)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_220 = PyInt_FromLong(220); if (unlikely(!__pyx_int_220)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_221 = PyInt_FromLong(221); if (unlikely(!__pyx_int_221)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_222 = PyInt_FromLong(222); if (unlikely(!__pyx_int_222)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_223 = PyInt_FromLong(223); if (unlikely(!__pyx_int_223)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_224 = PyInt_FromLong(224); if (unlikely(!__pyx_int_224)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_225 = PyInt_FromLong(225); if (unlikely(!__pyx_int_225)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_226 = PyInt_FromLong(226); if (unlikely(!__pyx_int_226)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_227 = PyInt_FromLong(227); if (unlikely(!__pyx_int_227)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_228 = PyInt_FromLong(228); if (unlikely(!__pyx_int_228)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_229 = PyInt_FromLong(229); if (unlikely(!__pyx_int_229)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_230 = PyInt_FromLong(230); if (unlikely(!__pyx_int_230)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_231 = PyInt_FromLong(231); if (unlikely(!__pyx_int_231)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_232 = PyInt_FromLong(232); if (unlikely(!__pyx_int_232)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_233 = PyInt_FromLong(233); if (unlikely(!__pyx_int_233)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_235 = PyInt_FromLong(235); if (unlikely(!__pyx_int_235)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_236 = PyInt_FromLong(236); if (unlikely(!__pyx_int_236)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_237 = PyInt_FromLong(237); if (unlikely(!__pyx_int_237)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_238 = PyInt_FromLong(238); if (unlikely(!__pyx_int_238)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_239 = PyInt_FromLong(239); if (unlikely(!__pyx_int_239)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_240 = PyInt_FromLong(240); if (unlikely(!__pyx_int_240)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_242 = PyInt_FromLong(242); if (unlikely(!__pyx_int_242)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_244 = PyInt_FromLong(244); if (unlikely(!__pyx_int_244)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_245 = PyInt_FromLong(245); if (unlikely(!__pyx_int_245)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_246 = PyInt_FromLong(246); if (unlikely(!__pyx_int_246)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_247 = PyInt_FromLong(247); if (unlikely(!__pyx_int_247)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_248 = PyInt_FromLong(248); if (unlikely(!__pyx_int_248)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_250 = PyInt_FromLong(250); if (unlikely(!__pyx_int_250)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_251 = PyInt_FromLong(251); if (unlikely(!__pyx_int_251)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_252 = PyInt_FromLong(252); if (unlikely(!__pyx_int_252)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_253 = PyInt_FromLong(253); if (unlikely(!__pyx_int_253)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_5color_colors = Py_None; Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("map_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_map_color, "Uint32 (SDL_Surface *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("get_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_get_color, "PyObject *(Uint32, SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("to_sdl_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_to_sdl_color, "PyObject *(PyObject *, SDL_Color *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_5color_Color = &__pyx_vtable_11pygame_sdl2_5color_Color; __pyx_vtable_11pygame_sdl2_5color_Color.from_rgba = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8))__pyx_f_11pygame_sdl2_5color_5Color_from_rgba; __pyx_vtable_11pygame_sdl2_5color_Color.from_name = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *))__pyx_f_11pygame_sdl2_5color_5Color_from_name; __pyx_vtable_11pygame_sdl2_5color_Color.from_hex = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *))__pyx_f_11pygame_sdl2_5color_5Color_from_hex; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_5color_Color = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_5color_Color_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) __PYX_ERR(0, 63, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_5color_Color_spec, __pyx_ptype_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_5color_Color = &__pyx_type_11pygame_sdl2_5color_Color; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_5color_Color->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_5color_Color->tp_dictoffset && __pyx_ptype_11pygame_sdl2_5color_Color->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_5color_Color->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_11pygame_sdl2_5color_Color, __pyx_vtabptr_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Color, (PyObject *) __pyx_ptype_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_5color_Color->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_5color_Color->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_5color_Color, __weakref__); #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)) __PYX_ERR(0, 452, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma_spec, __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma) < 0) __PYX_ERR(0, 452, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = &__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma) < 0) __PYX_ERR(0, 452, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma->tp_dictoffset && __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_color(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_color}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "color", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initcolor(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initcolor(void) #else __Pyx_PyMODINIT_FUNC PyInit_color(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_color(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_color(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'color' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("color", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "color" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_color(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__color) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.color")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.color", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/color.pyx":21 * * from sdl2 cimport * * import binascii # <<<<<<<<<<<<<< * import struct * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_binascii, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_binascii, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":22 * from sdl2 cimport * * import binascii * import struct # <<<<<<<<<<<<<< * * include "color_dict.pxi" */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/color_dict.pxi":5 * * cdef object colors = { * 'aliceblue' : (240, 248, 255), # <<<<<<<<<<<<<< * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), */ __pyx_t_2 = __Pyx_PyDict_NewPresized(658); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_aliceblue, __pyx_tuple__11) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":6 * cdef object colors = { * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), # <<<<<<<<<<<<<< * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_antiquewhite, __pyx_tuple__12) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":7 * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), # <<<<<<<<<<<<<< * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_antiquewhite1, __pyx_tuple__13) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":8 * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), # <<<<<<<<<<<<<< * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_antiquewhite2, __pyx_tuple__14) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":9 * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), # <<<<<<<<<<<<<< * 'antiquewhite4' : (139, 131, 120), * 'aquamarine' : (127, 255, 212), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_antiquewhite3, __pyx_tuple__15) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":10 * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), # <<<<<<<<<<<<<< * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_antiquewhite4, __pyx_tuple__16) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":11 * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), * 'aquamarine' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_aquamarine, __pyx_tuple__17) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":12 * 'antiquewhite4' : (139, 131, 120), * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_aquamarine1, __pyx_tuple__17) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":13 * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), # <<<<<<<<<<<<<< * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_aquamarine2, __pyx_tuple__18) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":14 * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), # <<<<<<<<<<<<<< * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_aquamarine3, __pyx_tuple__19) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":15 * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), # <<<<<<<<<<<<<< * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_aquamarine4, __pyx_tuple__20) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":16 * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_azure, __pyx_tuple__21) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":17 * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_azure1, __pyx_tuple__21) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":18 * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), # <<<<<<<<<<<<<< * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_azure2, __pyx_tuple__22) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":19 * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), # <<<<<<<<<<<<<< * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_azure3, __pyx_tuple__23) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":20 * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), # <<<<<<<<<<<<<< * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_azure4, __pyx_tuple__24) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":21 * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), # <<<<<<<<<<<<<< * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_beige, __pyx_tuple__25) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":22 * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bisque, __pyx_tuple__26) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":23 * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bisque1, __pyx_tuple__26) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":24 * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), # <<<<<<<<<<<<<< * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bisque2, __pyx_tuple__27) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":25 * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), # <<<<<<<<<<<<<< * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bisque3, __pyx_tuple__28) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":26 * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), # <<<<<<<<<<<<<< * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bisque4, __pyx_tuple__29) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":27 * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), # <<<<<<<<<<<<<< * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_black, __pyx_tuple__30) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":28 * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), # <<<<<<<<<<<<<< * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blanchedalmond, __pyx_tuple__31) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":29 * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blue, __pyx_tuple__32) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":30 * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blue1, __pyx_tuple__32) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":31 * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), # <<<<<<<<<<<<<< * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blue2, __pyx_tuple__33) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":32 * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), # <<<<<<<<<<<<<< * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blue3, __pyx_tuple__34) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":33 * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), # <<<<<<<<<<<<<< * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blue4, __pyx_tuple__35) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":34 * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), # <<<<<<<<<<<<<< * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_blueviolet, __pyx_tuple__36) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":35 * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), # <<<<<<<<<<<<<< * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_brown, __pyx_tuple__37) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":36 * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), # <<<<<<<<<<<<<< * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_brown1, __pyx_tuple__38) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":37 * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), # <<<<<<<<<<<<<< * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_brown2, __pyx_tuple__39) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":38 * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), # <<<<<<<<<<<<<< * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_brown3, __pyx_tuple__40) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":39 * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), # <<<<<<<<<<<<<< * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_brown4, __pyx_tuple__41) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":40 * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), # <<<<<<<<<<<<<< * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_burlywood, __pyx_tuple__42) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":41 * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), # <<<<<<<<<<<<<< * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_burlywood1, __pyx_tuple__43) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":42 * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), # <<<<<<<<<<<<<< * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_burlywood2, __pyx_tuple__44) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":43 * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), # <<<<<<<<<<<<<< * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_burlywood3, __pyx_tuple__45) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":44 * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), # <<<<<<<<<<<<<< * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_burlywood4, __pyx_tuple__46) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":45 * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), # <<<<<<<<<<<<<< * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cadetblue, __pyx_tuple__47) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":46 * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), # <<<<<<<<<<<<<< * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cadetblue1, __pyx_tuple__48) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":47 * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), # <<<<<<<<<<<<<< * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cadetblue2, __pyx_tuple__49) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":48 * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), # <<<<<<<<<<<<<< * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cadetblue3, __pyx_tuple__50) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":49 * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), # <<<<<<<<<<<<<< * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cadetblue4, __pyx_tuple__51) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":50 * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chartreuse, __pyx_tuple__52) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":51 * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chartreuse1, __pyx_tuple__52) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":52 * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), # <<<<<<<<<<<<<< * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chartreuse2, __pyx_tuple__53) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":53 * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), # <<<<<<<<<<<<<< * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chartreuse3, __pyx_tuple__54) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":54 * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), # <<<<<<<<<<<<<< * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chartreuse4, __pyx_tuple__55) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":55 * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), # <<<<<<<<<<<<<< * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chocolate, __pyx_tuple__56) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":56 * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), # <<<<<<<<<<<<<< * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chocolate1, __pyx_tuple__57) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":57 * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), # <<<<<<<<<<<<<< * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chocolate2, __pyx_tuple__58) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":58 * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), # <<<<<<<<<<<<<< * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chocolate3, __pyx_tuple__59) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":59 * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), # <<<<<<<<<<<<<< * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chocolate4, __pyx_tuple__60) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":60 * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), # <<<<<<<<<<<<<< * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_coral, __pyx_tuple__61) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":61 * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), # <<<<<<<<<<<<<< * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_coral1, __pyx_tuple__62) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":62 * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), # <<<<<<<<<<<<<< * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_coral2, __pyx_tuple__63) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":63 * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), # <<<<<<<<<<<<<< * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_coral3, __pyx_tuple__64) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":64 * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), # <<<<<<<<<<<<<< * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_coral4, __pyx_tuple__65) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":65 * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), # <<<<<<<<<<<<<< * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cornflowerblue, __pyx_tuple__66) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":66 * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cornsilk, __pyx_tuple__67) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":67 * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cornsilk1, __pyx_tuple__67) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":68 * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), # <<<<<<<<<<<<<< * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cornsilk2, __pyx_tuple__68) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":69 * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), # <<<<<<<<<<<<<< * 'cornsilk4' : (139, 136, 120), * 'cyan' : (0, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cornsilk3, __pyx_tuple__69) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":70 * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), # <<<<<<<<<<<<<< * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cornsilk4, __pyx_tuple__70) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":71 * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), * 'cyan' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cyan, __pyx_tuple__71) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":72 * 'cornsilk4' : (139, 136, 120), * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cyan1, __pyx_tuple__71) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":73 * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), # <<<<<<<<<<<<<< * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cyan2, __pyx_tuple__72) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":74 * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), # <<<<<<<<<<<<<< * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cyan3, __pyx_tuple__73) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":75 * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cyan4, __pyx_tuple__74) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":76 * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), # <<<<<<<<<<<<<< * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkblue, __pyx_tuple__35) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":77 * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkcyan, __pyx_tuple__74) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":78 * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), # <<<<<<<<<<<<<< * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgoldenrod, __pyx_tuple__75) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":79 * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), # <<<<<<<<<<<<<< * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgoldenrod1, __pyx_tuple__76) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":80 * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), # <<<<<<<<<<<<<< * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgoldenrod2, __pyx_tuple__77) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":81 * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), # <<<<<<<<<<<<<< * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgoldenrod3, __pyx_tuple__78) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":82 * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), # <<<<<<<<<<<<<< * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgoldenrod4, __pyx_tuple__79) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":83 * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgray, __pyx_tuple__80) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":84 * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), # <<<<<<<<<<<<<< * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgreen, __pyx_tuple__81) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":85 * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkgrey, __pyx_tuple__80) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":86 * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), # <<<<<<<<<<<<<< * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkkhaki, __pyx_tuple__82) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":87 * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), # <<<<<<<<<<<<<< * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkmagenta, __pyx_tuple__83) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":88 * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), # <<<<<<<<<<<<<< * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkolivegreen, __pyx_tuple__84) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":89 * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), # <<<<<<<<<<<<<< * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkolivegreen1, __pyx_tuple__85) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":90 * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), # <<<<<<<<<<<<<< * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkolivegreen2, __pyx_tuple__86) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":91 * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), # <<<<<<<<<<<<<< * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkolivegreen3, __pyx_tuple__87) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":92 * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), # <<<<<<<<<<<<<< * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkolivegreen4, __pyx_tuple__88) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":93 * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), # <<<<<<<<<<<<<< * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorange, __pyx_tuple__89) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":94 * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), # <<<<<<<<<<<<<< * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorange1, __pyx_tuple__90) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":95 * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), # <<<<<<<<<<<<<< * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorange2, __pyx_tuple__91) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":96 * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), # <<<<<<<<<<<<<< * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorange3, __pyx_tuple__92) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":97 * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), # <<<<<<<<<<<<<< * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorange4, __pyx_tuple__93) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":98 * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), # <<<<<<<<<<<<<< * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorchid, __pyx_tuple__94) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":99 * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), # <<<<<<<<<<<<<< * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorchid1, __pyx_tuple__95) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":100 * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), # <<<<<<<<<<<<<< * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorchid2, __pyx_tuple__96) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":101 * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), # <<<<<<<<<<<<<< * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorchid3, __pyx_tuple__97) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":102 * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), # <<<<<<<<<<<<<< * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkorchid4, __pyx_tuple__98) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":103 * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), # <<<<<<<<<<<<<< * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkred, __pyx_tuple__99) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":104 * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), # <<<<<<<<<<<<<< * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darksalmon, __pyx_tuple__100) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":105 * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), # <<<<<<<<<<<<<< * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkseagreen, __pyx_tuple__101) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":106 * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), # <<<<<<<<<<<<<< * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkseagreen1, __pyx_tuple__102) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":107 * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), # <<<<<<<<<<<<<< * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkseagreen2, __pyx_tuple__103) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":108 * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), # <<<<<<<<<<<<<< * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkseagreen3, __pyx_tuple__104) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":109 * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), # <<<<<<<<<<<<<< * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkseagreen4, __pyx_tuple__105) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":110 * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), # <<<<<<<<<<<<<< * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslateblue, __pyx_tuple__106) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":111 * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslategray, __pyx_tuple__107) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":112 * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), # <<<<<<<<<<<<<< * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslategray1, __pyx_tuple__108) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":113 * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), # <<<<<<<<<<<<<< * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslategray2, __pyx_tuple__109) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":114 * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), # <<<<<<<<<<<<<< * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslategray3, __pyx_tuple__110) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":115 * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), # <<<<<<<<<<<<<< * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslategray4, __pyx_tuple__111) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":116 * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkslategrey, __pyx_tuple__107) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":117 * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), # <<<<<<<<<<<<<< * 'darkviolet' : (148, 0, 211), * 'debianred' : (215, 7, 81), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkturquoise, __pyx_tuple__112) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":118 * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), # <<<<<<<<<<<<<< * 'debianred' : (215, 7, 81), * 'deeppink' : (255, 20, 147), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_darkviolet, __pyx_tuple__113) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":119 * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), * 'debianred' : (215, 7, 81), # <<<<<<<<<<<<<< * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_debianred, __pyx_tuple__114) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":120 * 'darkviolet' : (148, 0, 211), * 'debianred' : (215, 7, 81), * 'deeppink' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deeppink, __pyx_tuple__115) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":121 * 'debianred' : (215, 7, 81), * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deeppink1, __pyx_tuple__115) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":122 * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), # <<<<<<<<<<<<<< * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deeppink2, __pyx_tuple__116) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":123 * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), # <<<<<<<<<<<<<< * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deeppink3, __pyx_tuple__117) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":124 * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), # <<<<<<<<<<<<<< * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deeppink4, __pyx_tuple__118) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":125 * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deepskyblue, __pyx_tuple__119) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":126 * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deepskyblue1, __pyx_tuple__119) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":127 * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), # <<<<<<<<<<<<<< * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deepskyblue2, __pyx_tuple__120) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":128 * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), # <<<<<<<<<<<<<< * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deepskyblue3, __pyx_tuple__121) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":129 * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), # <<<<<<<<<<<<<< * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deepskyblue4, __pyx_tuple__122) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":130 * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dimgray, __pyx_tuple__123) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":131 * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dimgrey, __pyx_tuple__123) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":132 * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dodgerblue, __pyx_tuple__124) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":133 * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dodgerblue1, __pyx_tuple__124) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":134 * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), # <<<<<<<<<<<<<< * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dodgerblue2, __pyx_tuple__125) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":135 * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), # <<<<<<<<<<<<<< * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dodgerblue3, __pyx_tuple__126) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":136 * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), # <<<<<<<<<<<<<< * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dodgerblue4, __pyx_tuple__127) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":137 * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), # <<<<<<<<<<<<<< * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_firebrick, __pyx_tuple__128) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":138 * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), # <<<<<<<<<<<<<< * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_firebrick1, __pyx_tuple__129) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":139 * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), # <<<<<<<<<<<<<< * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_firebrick2, __pyx_tuple__130) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":140 * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), # <<<<<<<<<<<<<< * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_firebrick3, __pyx_tuple__131) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":141 * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), # <<<<<<<<<<<<<< * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_firebrick4, __pyx_tuple__132) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":142 * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), # <<<<<<<<<<<<<< * 'forestgreen' : (34, 139, 34), * 'gainsboro' : (220, 220, 220), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_floralwhite, __pyx_tuple__133) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":143 * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), # <<<<<<<<<<<<<< * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_forestgreen, __pyx_tuple__134) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":144 * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), * 'gainsboro' : (220, 220, 220), # <<<<<<<<<<<<<< * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gainsboro, __pyx_tuple__135) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":145 * 'forestgreen' : (34, 139, 34), * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), # <<<<<<<<<<<<<< * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ghostwhite, __pyx_tuple__136) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":146 * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gold, __pyx_tuple__137) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":147 * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gold1, __pyx_tuple__137) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":148 * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), # <<<<<<<<<<<<<< * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gold2, __pyx_tuple__138) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":149 * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), # <<<<<<<<<<<<<< * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gold3, __pyx_tuple__139) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":150 * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), # <<<<<<<<<<<<<< * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gold4, __pyx_tuple__140) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":151 * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), # <<<<<<<<<<<<<< * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_goldenrod, __pyx_tuple__141) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":152 * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), # <<<<<<<<<<<<<< * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_goldenrod1, __pyx_tuple__142) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":153 * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), # <<<<<<<<<<<<<< * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_goldenrod2, __pyx_tuple__143) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":154 * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), # <<<<<<<<<<<<<< * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_goldenrod3, __pyx_tuple__144) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":155 * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), # <<<<<<<<<<<<<< * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_goldenrod4, __pyx_tuple__145) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":156 * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), # <<<<<<<<<<<<<< * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray, __pyx_tuple__146) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":157 * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), # <<<<<<<<<<<<<< * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray0, __pyx_tuple__30) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":158 * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray1, __pyx_tuple__147) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":159 * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray10, __pyx_tuple__148) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":160 * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray100, __pyx_tuple__149) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":161 * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray11, __pyx_tuple__150) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":162 * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray12, __pyx_tuple__151) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":163 * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray13, __pyx_tuple__152) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":164 * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray14, __pyx_tuple__153) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":165 * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray15, __pyx_tuple__154) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":166 * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray16, __pyx_tuple__155) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":167 * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray17, __pyx_tuple__156) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":168 * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray18, __pyx_tuple__157) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":169 * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray19, __pyx_tuple__158) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":170 * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray2, __pyx_tuple__159) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":171 * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray20, __pyx_tuple__160) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":172 * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray21, __pyx_tuple__161) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":173 * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray22, __pyx_tuple__162) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":174 * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray23, __pyx_tuple__163) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":175 * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray24, __pyx_tuple__164) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":176 * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray25, __pyx_tuple__165) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":177 * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray26, __pyx_tuple__166) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":178 * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray27, __pyx_tuple__167) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":179 * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray28, __pyx_tuple__168) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":180 * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray29, __pyx_tuple__169) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":181 * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray3, __pyx_tuple__170) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":182 * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray30, __pyx_tuple__171) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":183 * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray31, __pyx_tuple__172) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":184 * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray32, __pyx_tuple__173) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":185 * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray33, __pyx_tuple__174) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":186 * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray34, __pyx_tuple__175) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":187 * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray35, __pyx_tuple__176) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":188 * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray36, __pyx_tuple__177) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":189 * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray37, __pyx_tuple__178) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":190 * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray38, __pyx_tuple__179) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":191 * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray39, __pyx_tuple__180) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":192 * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray4, __pyx_tuple__181) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":193 * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray40, __pyx_tuple__182) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":194 * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), # <<<<<<<<<<<<<< * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray41, __pyx_tuple__123) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":195 * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray42, __pyx_tuple__183) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":196 * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray43, __pyx_tuple__184) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":197 * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray44, __pyx_tuple__185) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":198 * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray45, __pyx_tuple__186) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":199 * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray46, __pyx_tuple__187) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":200 * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray47, __pyx_tuple__188) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":201 * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray48, __pyx_tuple__189) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":202 * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray49, __pyx_tuple__190) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":203 * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray5, __pyx_tuple__191) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":204 * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray50, __pyx_tuple__192) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":205 * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray51, __pyx_tuple__193) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":206 * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray52, __pyx_tuple__194) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":207 * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray53, __pyx_tuple__195) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":208 * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray54, __pyx_tuple__196) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":209 * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray55, __pyx_tuple__197) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":210 * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray56, __pyx_tuple__198) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":211 * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray57, __pyx_tuple__199) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":212 * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray58, __pyx_tuple__200) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":213 * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray59, __pyx_tuple__201) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":214 * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray6, __pyx_tuple__202) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":215 * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray60, __pyx_tuple__203) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":216 * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray61, __pyx_tuple__204) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":217 * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray62, __pyx_tuple__205) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":218 * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray63, __pyx_tuple__206) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":219 * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray64, __pyx_tuple__207) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":220 * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray65, __pyx_tuple__208) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":221 * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray66, __pyx_tuple__209) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":222 * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray67, __pyx_tuple__210) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":223 * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray68, __pyx_tuple__211) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":224 * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray69, __pyx_tuple__212) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":225 * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray7, __pyx_tuple__213) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":226 * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray70, __pyx_tuple__214) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":227 * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray71, __pyx_tuple__215) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":228 * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray72, __pyx_tuple__216) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":229 * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray73, __pyx_tuple__217) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":230 * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray74, __pyx_tuple__218) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":231 * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray75, __pyx_tuple__219) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":232 * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray76, __pyx_tuple__220) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":233 * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray77, __pyx_tuple__221) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":234 * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray78, __pyx_tuple__222) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":235 * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray79, __pyx_tuple__223) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":236 * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray8, __pyx_tuple__224) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":237 * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray80, __pyx_tuple__225) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":238 * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray81, __pyx_tuple__226) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":239 * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray82, __pyx_tuple__227) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":240 * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray83, __pyx_tuple__228) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":241 * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray84, __pyx_tuple__229) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":242 * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray85, __pyx_tuple__230) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":243 * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray86, __pyx_tuple__231) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":244 * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray87, __pyx_tuple__232) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":245 * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray88, __pyx_tuple__233) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":246 * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray89, __pyx_tuple__234) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":247 * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray9, __pyx_tuple__235) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":248 * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray90, __pyx_tuple__236) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":249 * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray91, __pyx_tuple__237) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":250 * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray92, __pyx_tuple__238) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":251 * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray93, __pyx_tuple__239) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":252 * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray94, __pyx_tuple__240) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":253 * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray95, __pyx_tuple__241) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":254 * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray96, __pyx_tuple__242) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":255 * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray97, __pyx_tuple__243) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":256 * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray98, __pyx_tuple__244) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":257 * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gray99, __pyx_tuple__245) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":258 * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_green, __pyx_tuple__246) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":259 * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_green1, __pyx_tuple__246) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":260 * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), # <<<<<<<<<<<<<< * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_green2, __pyx_tuple__247) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":261 * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), # <<<<<<<<<<<<<< * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_green3, __pyx_tuple__248) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":262 * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), # <<<<<<<<<<<<<< * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_green4, __pyx_tuple__249) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":263 * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), # <<<<<<<<<<<<<< * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_greenyellow, __pyx_tuple__250) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":264 * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), # <<<<<<<<<<<<<< * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey, __pyx_tuple__146) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":265 * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), # <<<<<<<<<<<<<< * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey0, __pyx_tuple__30) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":266 * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey1, __pyx_tuple__147) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":267 * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey10, __pyx_tuple__148) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":268 * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey100, __pyx_tuple__149) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":269 * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey11, __pyx_tuple__150) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":270 * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey12, __pyx_tuple__151) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":271 * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey13, __pyx_tuple__152) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":272 * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey14, __pyx_tuple__153) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":273 * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey15, __pyx_tuple__154) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":274 * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey16, __pyx_tuple__155) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":275 * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey17, __pyx_tuple__156) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":276 * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey18, __pyx_tuple__157) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":277 * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey19, __pyx_tuple__158) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":278 * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey2, __pyx_tuple__159) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":279 * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey20, __pyx_tuple__160) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":280 * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey21, __pyx_tuple__161) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":281 * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey22, __pyx_tuple__162) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":282 * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey23, __pyx_tuple__163) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":283 * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey24, __pyx_tuple__164) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":284 * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey25, __pyx_tuple__165) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":285 * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey26, __pyx_tuple__166) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":286 * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey27, __pyx_tuple__167) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":287 * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey28, __pyx_tuple__168) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":288 * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey29, __pyx_tuple__169) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":289 * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey3, __pyx_tuple__170) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":290 * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey30, __pyx_tuple__171) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":291 * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey31, __pyx_tuple__172) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":292 * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey32, __pyx_tuple__173) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":293 * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey33, __pyx_tuple__174) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":294 * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey34, __pyx_tuple__175) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":295 * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey35, __pyx_tuple__176) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":296 * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey36, __pyx_tuple__177) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":297 * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey37, __pyx_tuple__178) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":298 * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey38, __pyx_tuple__179) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":299 * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey39, __pyx_tuple__180) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":300 * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey4, __pyx_tuple__181) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":301 * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey40, __pyx_tuple__182) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":302 * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), # <<<<<<<<<<<<<< * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey41, __pyx_tuple__123) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":303 * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey42, __pyx_tuple__183) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":304 * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey43, __pyx_tuple__184) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":305 * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey44, __pyx_tuple__185) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":306 * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey45, __pyx_tuple__186) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":307 * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey46, __pyx_tuple__187) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":308 * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey47, __pyx_tuple__188) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":309 * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey48, __pyx_tuple__189) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":310 * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey49, __pyx_tuple__190) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":311 * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey5, __pyx_tuple__191) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":312 * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey50, __pyx_tuple__192) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":313 * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey51, __pyx_tuple__193) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":314 * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey52, __pyx_tuple__194) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":315 * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey53, __pyx_tuple__195) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":316 * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey54, __pyx_tuple__196) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":317 * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey55, __pyx_tuple__197) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":318 * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey56, __pyx_tuple__198) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":319 * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey57, __pyx_tuple__199) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":320 * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey58, __pyx_tuple__200) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":321 * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey59, __pyx_tuple__201) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":322 * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey6, __pyx_tuple__202) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":323 * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey60, __pyx_tuple__203) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":324 * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey61, __pyx_tuple__204) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":325 * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey62, __pyx_tuple__205) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":326 * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey63, __pyx_tuple__206) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":327 * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey64, __pyx_tuple__207) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":328 * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey65, __pyx_tuple__208) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":329 * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey66, __pyx_tuple__209) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":330 * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey67, __pyx_tuple__210) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":331 * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey68, __pyx_tuple__211) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":332 * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey69, __pyx_tuple__212) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":333 * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey7, __pyx_tuple__213) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":334 * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey70, __pyx_tuple__214) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":335 * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey71, __pyx_tuple__215) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":336 * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey72, __pyx_tuple__216) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":337 * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey73, __pyx_tuple__217) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":338 * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey74, __pyx_tuple__218) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":339 * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey75, __pyx_tuple__219) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":340 * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey76, __pyx_tuple__220) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":341 * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey77, __pyx_tuple__221) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":342 * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey78, __pyx_tuple__222) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":343 * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey79, __pyx_tuple__223) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":344 * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey8, __pyx_tuple__224) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":345 * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey80, __pyx_tuple__225) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":346 * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey81, __pyx_tuple__226) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":347 * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey82, __pyx_tuple__227) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":348 * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey83, __pyx_tuple__228) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":349 * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey84, __pyx_tuple__229) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":350 * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey85, __pyx_tuple__230) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":351 * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey86, __pyx_tuple__231) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":352 * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey87, __pyx_tuple__232) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":353 * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey88, __pyx_tuple__233) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":354 * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey89, __pyx_tuple__234) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":355 * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey9, __pyx_tuple__235) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":356 * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey90, __pyx_tuple__236) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":357 * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey91, __pyx_tuple__237) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":358 * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey92, __pyx_tuple__238) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":359 * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey93, __pyx_tuple__239) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":360 * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey94, __pyx_tuple__240) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":361 * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey95, __pyx_tuple__241) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":362 * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey96, __pyx_tuple__242) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":363 * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey97, __pyx_tuple__243) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":364 * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey98, __pyx_tuple__244) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":365 * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_grey99, __pyx_tuple__245) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":366 * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_honeydew, __pyx_tuple__251) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":367 * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_honeydew1, __pyx_tuple__251) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":368 * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), # <<<<<<<<<<<<<< * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_honeydew2, __pyx_tuple__252) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":369 * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), # <<<<<<<<<<<<<< * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_honeydew3, __pyx_tuple__253) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":370 * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), # <<<<<<<<<<<<<< * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_honeydew4, __pyx_tuple__254) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":371 * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), # <<<<<<<<<<<<<< * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hotpink, __pyx_tuple__255) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":372 * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), # <<<<<<<<<<<<<< * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hotpink1, __pyx_tuple__256) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":373 * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), # <<<<<<<<<<<<<< * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hotpink2, __pyx_tuple__257) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":374 * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), # <<<<<<<<<<<<<< * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hotpink3, __pyx_tuple__258) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":375 * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), # <<<<<<<<<<<<<< * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hotpink4, __pyx_tuple__259) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":376 * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), # <<<<<<<<<<<<<< * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_indianred, __pyx_tuple__260) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":377 * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), # <<<<<<<<<<<<<< * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_indianred1, __pyx_tuple__261) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":378 * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), # <<<<<<<<<<<<<< * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_indianred2, __pyx_tuple__262) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":379 * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), # <<<<<<<<<<<<<< * 'indianred4' : (139, 58, 58), * 'ivory' : (255, 255, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_indianred3, __pyx_tuple__263) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":380 * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), # <<<<<<<<<<<<<< * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_indianred4, __pyx_tuple__264) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":381 * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), * 'ivory' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ivory, __pyx_tuple__265) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":382 * 'indianred4' : (139, 58, 58), * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ivory1, __pyx_tuple__265) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":383 * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), # <<<<<<<<<<<<<< * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ivory2, __pyx_tuple__266) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":384 * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), # <<<<<<<<<<<<<< * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ivory3, __pyx_tuple__267) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":385 * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), # <<<<<<<<<<<<<< * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ivory4, __pyx_tuple__268) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":386 * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), # <<<<<<<<<<<<<< * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_khaki, __pyx_tuple__269) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":387 * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), # <<<<<<<<<<<<<< * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_khaki1, __pyx_tuple__270) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":388 * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), # <<<<<<<<<<<<<< * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_khaki2, __pyx_tuple__271) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":389 * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), # <<<<<<<<<<<<<< * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_khaki3, __pyx_tuple__272) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":390 * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), # <<<<<<<<<<<<<< * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_khaki4, __pyx_tuple__273) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":391 * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), # <<<<<<<<<<<<<< * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lavender, __pyx_tuple__274) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":392 * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lavenderblush, __pyx_tuple__275) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":393 * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lavenderblush1, __pyx_tuple__275) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":394 * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), # <<<<<<<<<<<<<< * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lavenderblush2, __pyx_tuple__276) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":395 * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), # <<<<<<<<<<<<<< * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lavenderblush3, __pyx_tuple__277) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":396 * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), # <<<<<<<<<<<<<< * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lavenderblush4, __pyx_tuple__278) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":397 * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), # <<<<<<<<<<<<<< * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lawngreen, __pyx_tuple__279) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":398 * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lemonchiffon, __pyx_tuple__280) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":399 * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lemonchiffon1, __pyx_tuple__280) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":400 * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), # <<<<<<<<<<<<<< * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lemonchiffon2, __pyx_tuple__281) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":401 * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), # <<<<<<<<<<<<<< * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lemonchiffon3, __pyx_tuple__282) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":402 * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), # <<<<<<<<<<<<<< * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lemonchiffon4, __pyx_tuple__283) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":403 * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), # <<<<<<<<<<<<<< * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightblue, __pyx_tuple__284) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":404 * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), # <<<<<<<<<<<<<< * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightblue1, __pyx_tuple__285) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":405 * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), # <<<<<<<<<<<<<< * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightblue2, __pyx_tuple__286) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":406 * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), # <<<<<<<<<<<<<< * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightblue3, __pyx_tuple__287) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":407 * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), # <<<<<<<<<<<<<< * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightblue4, __pyx_tuple__288) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":408 * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), # <<<<<<<<<<<<<< * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightcoral, __pyx_tuple__289) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":409 * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightcyan, __pyx_tuple__290) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":410 * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightcyan1, __pyx_tuple__290) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":411 * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), # <<<<<<<<<<<<<< * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightcyan2, __pyx_tuple__291) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":412 * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), # <<<<<<<<<<<<<< * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightcyan3, __pyx_tuple__292) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":413 * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightcyan4, __pyx_tuple__293) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":414 * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgoldenrod, __pyx_tuple__294) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":415 * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgoldenrod1, __pyx_tuple__295) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":416 * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgoldenrod2, __pyx_tuple__296) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":417 * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), # <<<<<<<<<<<<<< * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgoldenrod3, __pyx_tuple__297) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":418 * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), # <<<<<<<<<<<<<< * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgoldenrod4, __pyx_tuple__298) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":419 * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), # <<<<<<<<<<<<<< * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgoldenrodyellow, __pyx_tuple__299) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":420 * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgray, __pyx_tuple__300) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":421 * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), # <<<<<<<<<<<<<< * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgreen, __pyx_tuple__301) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":422 * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightgrey, __pyx_tuple__300) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":423 * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), # <<<<<<<<<<<<<< * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightpink, __pyx_tuple__302) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":424 * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), # <<<<<<<<<<<<<< * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightpink1, __pyx_tuple__303) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":425 * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), # <<<<<<<<<<<<<< * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightpink2, __pyx_tuple__304) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":426 * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), # <<<<<<<<<<<<<< * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightpink3, __pyx_tuple__305) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":427 * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), # <<<<<<<<<<<<<< * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightpink4, __pyx_tuple__306) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":428 * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsalmon, __pyx_tuple__307) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":429 * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsalmon1, __pyx_tuple__307) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":430 * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), # <<<<<<<<<<<<<< * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsalmon2, __pyx_tuple__308) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":431 * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), # <<<<<<<<<<<<<< * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsalmon3, __pyx_tuple__309) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":432 * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), # <<<<<<<<<<<<<< * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsalmon4, __pyx_tuple__310) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":433 * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), # <<<<<<<<<<<<<< * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightseagreen, __pyx_tuple__311) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":434 * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), # <<<<<<<<<<<<<< * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightskyblue, __pyx_tuple__312) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":435 * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), # <<<<<<<<<<<<<< * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightskyblue1, __pyx_tuple__313) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":436 * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), # <<<<<<<<<<<<<< * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightskyblue2, __pyx_tuple__314) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":437 * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), # <<<<<<<<<<<<<< * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightskyblue3, __pyx_tuple__315) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":438 * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), # <<<<<<<<<<<<<< * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightskyblue4, __pyx_tuple__316) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":439 * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), # <<<<<<<<<<<<<< * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightslateblue, __pyx_tuple__317) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":440 * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightslategray, __pyx_tuple__318) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":441 * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightslategrey, __pyx_tuple__318) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":442 * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), # <<<<<<<<<<<<<< * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsteelblue, __pyx_tuple__319) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":443 * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), # <<<<<<<<<<<<<< * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsteelblue1, __pyx_tuple__320) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":444 * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), # <<<<<<<<<<<<<< * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsteelblue2, __pyx_tuple__321) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":445 * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), # <<<<<<<<<<<<<< * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsteelblue3, __pyx_tuple__322) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":446 * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), # <<<<<<<<<<<<<< * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightsteelblue4, __pyx_tuple__323) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":447 * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightyellow, __pyx_tuple__324) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":448 * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightyellow1, __pyx_tuple__324) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":449 * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), # <<<<<<<<<<<<<< * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightyellow2, __pyx_tuple__325) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":450 * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), # <<<<<<<<<<<<<< * 'lightyellow4' : (139, 139, 122), * 'limegreen' : (50, 205, 50), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightyellow3, __pyx_tuple__326) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":451 * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), # <<<<<<<<<<<<<< * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lightyellow4, __pyx_tuple__327) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":452 * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), * 'limegreen' : (50, 205, 50), # <<<<<<<<<<<<<< * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_limegreen, __pyx_tuple__328) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":453 * 'lightyellow4' : (139, 139, 122), * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), # <<<<<<<<<<<<<< * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_linen, __pyx_tuple__329) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":454 * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_magenta, __pyx_tuple__330) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":455 * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_magenta1, __pyx_tuple__330) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":456 * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), # <<<<<<<<<<<<<< * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_magenta2, __pyx_tuple__331) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":457 * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), # <<<<<<<<<<<<<< * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_magenta3, __pyx_tuple__332) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":458 * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), # <<<<<<<<<<<<<< * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_magenta4, __pyx_tuple__83) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":459 * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), # <<<<<<<<<<<<<< * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maroon, __pyx_tuple__333) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":460 * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), # <<<<<<<<<<<<<< * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maroon1, __pyx_tuple__334) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":461 * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), # <<<<<<<<<<<<<< * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maroon2, __pyx_tuple__335) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":462 * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), # <<<<<<<<<<<<<< * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maroon3, __pyx_tuple__336) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":463 * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), # <<<<<<<<<<<<<< * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maroon4, __pyx_tuple__337) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":464 * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), # <<<<<<<<<<<<<< * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumaquamarine, __pyx_tuple__19) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":465 * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), # <<<<<<<<<<<<<< * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumblue, __pyx_tuple__34) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":466 * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), # <<<<<<<<<<<<<< * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumorchid, __pyx_tuple__338) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":467 * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), # <<<<<<<<<<<<<< * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumorchid1, __pyx_tuple__339) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":468 * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), # <<<<<<<<<<<<<< * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumorchid2, __pyx_tuple__340) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":469 * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), # <<<<<<<<<<<<<< * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumorchid3, __pyx_tuple__341) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":470 * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), # <<<<<<<<<<<<<< * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumorchid4, __pyx_tuple__342) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":471 * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), # <<<<<<<<<<<<<< * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumpurple, __pyx_tuple__343) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":472 * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), # <<<<<<<<<<<<<< * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumpurple1, __pyx_tuple__344) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":473 * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), # <<<<<<<<<<<<<< * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumpurple2, __pyx_tuple__345) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":474 * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), # <<<<<<<<<<<<<< * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumpurple3, __pyx_tuple__346) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":475 * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), # <<<<<<<<<<<<<< * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumpurple4, __pyx_tuple__347) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":476 * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), # <<<<<<<<<<<<<< * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumseagreen, __pyx_tuple__348) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":477 * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), # <<<<<<<<<<<<<< * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumslateblue, __pyx_tuple__349) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":478 * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), # <<<<<<<<<<<<<< * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumspringgreen, __pyx_tuple__350) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":479 * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), # <<<<<<<<<<<<<< * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumturquoise, __pyx_tuple__351) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":480 * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), # <<<<<<<<<<<<<< * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mediumvioletred, __pyx_tuple__352) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":481 * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), # <<<<<<<<<<<<<< * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_midnightblue, __pyx_tuple__353) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":482 * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), # <<<<<<<<<<<<<< * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mintcream, __pyx_tuple__354) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":483 * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mistyrose, __pyx_tuple__355) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":484 * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mistyrose1, __pyx_tuple__355) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":485 * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), # <<<<<<<<<<<<<< * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mistyrose2, __pyx_tuple__356) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":486 * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), # <<<<<<<<<<<<<< * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mistyrose3, __pyx_tuple__357) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":487 * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), # <<<<<<<<<<<<<< * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mistyrose4, __pyx_tuple__358) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":488 * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), # <<<<<<<<<<<<<< * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_moccasin, __pyx_tuple__359) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":489 * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navajowhite, __pyx_tuple__360) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":490 * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navajowhite1, __pyx_tuple__360) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":491 * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), # <<<<<<<<<<<<<< * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navajowhite2, __pyx_tuple__361) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":492 * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), # <<<<<<<<<<<<<< * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navajowhite3, __pyx_tuple__362) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":493 * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), # <<<<<<<<<<<<<< * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navajowhite4, __pyx_tuple__363) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":494 * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), # <<<<<<<<<<<<<< * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navy, __pyx_tuple__364) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":495 * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), # <<<<<<<<<<<<<< * 'oldlace' : (253, 245, 230), * 'olivedrab' : (107, 142, 35), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_navyblue, __pyx_tuple__364) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":496 * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), # <<<<<<<<<<<<<< * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_oldlace, __pyx_tuple__365) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":497 * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), * 'olivedrab' : (107, 142, 35), # <<<<<<<<<<<<<< * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_olivedrab, __pyx_tuple__366) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":498 * 'oldlace' : (253, 245, 230), * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), # <<<<<<<<<<<<<< * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_olivedrab1, __pyx_tuple__367) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":499 * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), # <<<<<<<<<<<<<< * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_olivedrab2, __pyx_tuple__368) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":500 * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), # <<<<<<<<<<<<<< * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_olivedrab3, __pyx_tuple__369) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":501 * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), # <<<<<<<<<<<<<< * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_olivedrab4, __pyx_tuple__370) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":502 * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orange, __pyx_tuple__371) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":503 * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orange1, __pyx_tuple__371) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":504 * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), # <<<<<<<<<<<<<< * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orange2, __pyx_tuple__372) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":505 * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), # <<<<<<<<<<<<<< * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orange3, __pyx_tuple__373) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":506 * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), # <<<<<<<<<<<<<< * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orange4, __pyx_tuple__374) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":507 * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orangered, __pyx_tuple__375) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":508 * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orangered1, __pyx_tuple__375) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":509 * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), # <<<<<<<<<<<<<< * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orangered2, __pyx_tuple__376) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":510 * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), # <<<<<<<<<<<<<< * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orangered3, __pyx_tuple__377) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":511 * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), # <<<<<<<<<<<<<< * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orangered4, __pyx_tuple__378) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":512 * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), # <<<<<<<<<<<<<< * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orchid, __pyx_tuple__379) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":513 * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), # <<<<<<<<<<<<<< * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orchid1, __pyx_tuple__380) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":514 * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), # <<<<<<<<<<<<<< * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orchid2, __pyx_tuple__381) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":515 * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), # <<<<<<<<<<<<<< * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orchid3, __pyx_tuple__382) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":516 * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), # <<<<<<<<<<<<<< * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_orchid4, __pyx_tuple__383) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":517 * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), # <<<<<<<<<<<<<< * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palegoldenrod, __pyx_tuple__384) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":518 * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), # <<<<<<<<<<<<<< * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palegreen, __pyx_tuple__385) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":519 * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), # <<<<<<<<<<<<<< * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palegreen1, __pyx_tuple__386) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":520 * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), # <<<<<<<<<<<<<< * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palegreen2, __pyx_tuple__301) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":521 * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), # <<<<<<<<<<<<<< * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palegreen3, __pyx_tuple__387) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":522 * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), # <<<<<<<<<<<<<< * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palegreen4, __pyx_tuple__388) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":523 * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_paleturquoise, __pyx_tuple__389) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":524 * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), # <<<<<<<<<<<<<< * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_paleturquoise1, __pyx_tuple__390) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":525 * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_paleturquoise2, __pyx_tuple__391) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":526 * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), # <<<<<<<<<<<<<< * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_paleturquoise3, __pyx_tuple__392) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":527 * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), # <<<<<<<<<<<<<< * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_paleturquoise4, __pyx_tuple__393) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":528 * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), # <<<<<<<<<<<<<< * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palevioletred, __pyx_tuple__394) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":529 * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), # <<<<<<<<<<<<<< * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palevioletred1, __pyx_tuple__395) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":530 * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), # <<<<<<<<<<<<<< * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palevioletred2, __pyx_tuple__396) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":531 * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), # <<<<<<<<<<<<<< * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palevioletred3, __pyx_tuple__397) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":532 * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), # <<<<<<<<<<<<<< * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_palevioletred4, __pyx_tuple__398) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":533 * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), # <<<<<<<<<<<<<< * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_papayawhip, __pyx_tuple__399) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":534 * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_peachpuff, __pyx_tuple__400) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":535 * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_peachpuff1, __pyx_tuple__400) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":536 * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), # <<<<<<<<<<<<<< * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_peachpuff2, __pyx_tuple__401) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":537 * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), # <<<<<<<<<<<<<< * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_peachpuff3, __pyx_tuple__402) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":538 * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), # <<<<<<<<<<<<<< * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_peachpuff4, __pyx_tuple__403) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":539 * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), # <<<<<<<<<<<<<< * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_peru, __pyx_tuple__404) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":540 * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), # <<<<<<<<<<<<<< * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pink, __pyx_tuple__405) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":541 * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), # <<<<<<<<<<<<<< * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pink1, __pyx_tuple__406) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":542 * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), # <<<<<<<<<<<<<< * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pink2, __pyx_tuple__407) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":543 * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), # <<<<<<<<<<<<<< * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pink3, __pyx_tuple__408) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":544 * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), # <<<<<<<<<<<<<< * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pink4, __pyx_tuple__409) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":545 * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), # <<<<<<<<<<<<<< * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_plum, __pyx_tuple__410) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":546 * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), # <<<<<<<<<<<<<< * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_plum1, __pyx_tuple__411) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":547 * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), # <<<<<<<<<<<<<< * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_plum2, __pyx_tuple__412) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":548 * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), # <<<<<<<<<<<<<< * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_plum3, __pyx_tuple__413) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":549 * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), # <<<<<<<<<<<<<< * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_plum4, __pyx_tuple__414) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":550 * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), # <<<<<<<<<<<<<< * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_powderblue, __pyx_tuple__415) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":551 * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), # <<<<<<<<<<<<<< * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_purple, __pyx_tuple__416) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":552 * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), # <<<<<<<<<<<<<< * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_purple1, __pyx_tuple__417) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":553 * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), # <<<<<<<<<<<<<< * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_purple2, __pyx_tuple__418) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":554 * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), # <<<<<<<<<<<<<< * 'purple4' : (85, 26, 139), * 'red' : (255, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_purple3, __pyx_tuple__419) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":555 * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), # <<<<<<<<<<<<<< * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_purple4, __pyx_tuple__420) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":556 * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), * 'red' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_red, __pyx_tuple__421) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":557 * 'purple4' : (85, 26, 139), * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_red1, __pyx_tuple__421) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":558 * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), # <<<<<<<<<<<<<< * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_red2, __pyx_tuple__422) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":559 * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), # <<<<<<<<<<<<<< * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_red3, __pyx_tuple__423) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":560 * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), # <<<<<<<<<<<<<< * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_red4, __pyx_tuple__99) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":561 * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), # <<<<<<<<<<<<<< * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rosybrown, __pyx_tuple__424) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":562 * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), # <<<<<<<<<<<<<< * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rosybrown1, __pyx_tuple__425) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":563 * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), # <<<<<<<<<<<<<< * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rosybrown2, __pyx_tuple__426) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":564 * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), # <<<<<<<<<<<<<< * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rosybrown3, __pyx_tuple__427) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":565 * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), # <<<<<<<<<<<<<< * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rosybrown4, __pyx_tuple__428) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":566 * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), # <<<<<<<<<<<<<< * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_royalblue, __pyx_tuple__429) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":567 * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), # <<<<<<<<<<<<<< * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_royalblue1, __pyx_tuple__430) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":568 * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), # <<<<<<<<<<<<<< * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_royalblue2, __pyx_tuple__431) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":569 * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), # <<<<<<<<<<<<<< * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_royalblue3, __pyx_tuple__432) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":570 * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), # <<<<<<<<<<<<<< * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_royalblue4, __pyx_tuple__433) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":571 * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), # <<<<<<<<<<<<<< * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_saddlebrown, __pyx_tuple__60) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":572 * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), # <<<<<<<<<<<<<< * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_salmon, __pyx_tuple__434) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":573 * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), # <<<<<<<<<<<<<< * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_salmon1, __pyx_tuple__435) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":574 * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), # <<<<<<<<<<<<<< * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_salmon2, __pyx_tuple__436) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":575 * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), # <<<<<<<<<<<<<< * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_salmon3, __pyx_tuple__437) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":576 * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), # <<<<<<<<<<<<<< * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_salmon4, __pyx_tuple__438) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":577 * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), # <<<<<<<<<<<<<< * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sandybrown, __pyx_tuple__439) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":578 * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seagreen, __pyx_tuple__440) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":579 * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), # <<<<<<<<<<<<<< * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seagreen1, __pyx_tuple__441) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":580 * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), # <<<<<<<<<<<<<< * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seagreen2, __pyx_tuple__442) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":581 * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), # <<<<<<<<<<<<<< * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seagreen3, __pyx_tuple__443) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":582 * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seagreen4, __pyx_tuple__440) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":583 * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seashell, __pyx_tuple__444) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":584 * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seashell1, __pyx_tuple__444) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":585 * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), # <<<<<<<<<<<<<< * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seashell2, __pyx_tuple__445) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":586 * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), # <<<<<<<<<<<<<< * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seashell3, __pyx_tuple__446) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":587 * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), # <<<<<<<<<<<<<< * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seashell4, __pyx_tuple__447) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":588 * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), # <<<<<<<<<<<<<< * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sienna, __pyx_tuple__448) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":589 * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), # <<<<<<<<<<<<<< * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sienna1, __pyx_tuple__449) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":590 * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), # <<<<<<<<<<<<<< * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sienna2, __pyx_tuple__450) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":591 * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), # <<<<<<<<<<<<<< * 'sienna4' : (139, 71, 38), * 'skyblue' : (135, 206, 235), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sienna3, __pyx_tuple__451) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":592 * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), # <<<<<<<<<<<<<< * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sienna4, __pyx_tuple__452) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":593 * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), * 'skyblue' : (135, 206, 235), # <<<<<<<<<<<<<< * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_skyblue, __pyx_tuple__453) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":594 * 'sienna4' : (139, 71, 38), * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), # <<<<<<<<<<<<<< * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_skyblue1, __pyx_tuple__454) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":595 * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), # <<<<<<<<<<<<<< * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_skyblue2, __pyx_tuple__455) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":596 * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), # <<<<<<<<<<<<<< * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_skyblue3, __pyx_tuple__456) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":597 * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), # <<<<<<<<<<<<<< * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_skyblue4, __pyx_tuple__457) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":598 * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), # <<<<<<<<<<<<<< * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slateblue, __pyx_tuple__458) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":599 * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), # <<<<<<<<<<<<<< * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slateblue1, __pyx_tuple__459) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":600 * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), # <<<<<<<<<<<<<< * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slateblue2, __pyx_tuple__460) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":601 * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), # <<<<<<<<<<<<<< * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slateblue3, __pyx_tuple__461) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":602 * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), # <<<<<<<<<<<<<< * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slateblue4, __pyx_tuple__462) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":603 * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), # <<<<<<<<<<<<<< * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slategray, __pyx_tuple__463) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":604 * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), # <<<<<<<<<<<<<< * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slategray1, __pyx_tuple__464) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":605 * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), # <<<<<<<<<<<<<< * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slategray2, __pyx_tuple__465) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":606 * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), # <<<<<<<<<<<<<< * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slategray3, __pyx_tuple__466) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":607 * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), # <<<<<<<<<<<<<< * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slategray4, __pyx_tuple__467) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":608 * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), # <<<<<<<<<<<<<< * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_slategrey, __pyx_tuple__463) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":609 * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_snow, __pyx_tuple__468) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":610 * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_snow1, __pyx_tuple__468) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":611 * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), # <<<<<<<<<<<<<< * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_snow2, __pyx_tuple__469) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":612 * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), # <<<<<<<<<<<<<< * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_snow3, __pyx_tuple__470) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":613 * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), # <<<<<<<<<<<<<< * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_snow4, __pyx_tuple__471) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":614 * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_springgreen, __pyx_tuple__472) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":615 * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_springgreen1, __pyx_tuple__472) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":616 * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), # <<<<<<<<<<<<<< * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_springgreen2, __pyx_tuple__473) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":617 * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), # <<<<<<<<<<<<<< * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_springgreen3, __pyx_tuple__474) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":618 * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), # <<<<<<<<<<<<<< * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_springgreen4, __pyx_tuple__475) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":619 * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), # <<<<<<<<<<<<<< * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_steelblue, __pyx_tuple__476) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":620 * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), # <<<<<<<<<<<<<< * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_steelblue1, __pyx_tuple__477) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":621 * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), # <<<<<<<<<<<<<< * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_steelblue2, __pyx_tuple__478) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":622 * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), # <<<<<<<<<<<<<< * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_steelblue3, __pyx_tuple__479) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":623 * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), # <<<<<<<<<<<<<< * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_steelblue4, __pyx_tuple__480) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":624 * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), # <<<<<<<<<<<<<< * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tan, __pyx_tuple__481) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":625 * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), # <<<<<<<<<<<<<< * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tan1, __pyx_tuple__482) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":626 * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), # <<<<<<<<<<<<<< * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tan2, __pyx_tuple__483) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":627 * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), # <<<<<<<<<<<<<< * 'tan4' : (139, 90, 43), * 'thistle' : (216, 191, 216), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tan3, __pyx_tuple__404) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":628 * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), # <<<<<<<<<<<<<< * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tan4, __pyx_tuple__484) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":629 * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), * 'thistle' : (216, 191, 216), # <<<<<<<<<<<<<< * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_thistle, __pyx_tuple__485) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":630 * 'tan4' : (139, 90, 43), * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), # <<<<<<<<<<<<<< * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_thistle1, __pyx_tuple__486) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":631 * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), # <<<<<<<<<<<<<< * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_thistle2, __pyx_tuple__487) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":632 * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), # <<<<<<<<<<<<<< * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_thistle3, __pyx_tuple__488) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":633 * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), # <<<<<<<<<<<<<< * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_thistle4, __pyx_tuple__489) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":634 * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tomato, __pyx_tuple__490) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":635 * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tomato1, __pyx_tuple__490) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":636 * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), # <<<<<<<<<<<<<< * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tomato2, __pyx_tuple__491) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":637 * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), # <<<<<<<<<<<<<< * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tomato3, __pyx_tuple__492) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":638 * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), # <<<<<<<<<<<<<< * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tomato4, __pyx_tuple__493) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":639 * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), # <<<<<<<<<<<<<< * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_turquoise, __pyx_tuple__494) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":640 * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), # <<<<<<<<<<<<<< * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_turquoise1, __pyx_tuple__495) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":641 * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), # <<<<<<<<<<<<<< * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_turquoise2, __pyx_tuple__496) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":642 * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), # <<<<<<<<<<<<<< * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_turquoise3, __pyx_tuple__497) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":643 * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), # <<<<<<<<<<<<<< * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_turquoise4, __pyx_tuple__498) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":644 * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), # <<<<<<<<<<<<<< * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_violet, __pyx_tuple__499) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":645 * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), # <<<<<<<<<<<<<< * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_violetred, __pyx_tuple__500) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":646 * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), # <<<<<<<<<<<<<< * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_violetred1, __pyx_tuple__501) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":647 * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), # <<<<<<<<<<<<<< * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_violetred2, __pyx_tuple__502) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":648 * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), # <<<<<<<<<<<<<< * 'violetred4' : (139, 34, 82), * 'wheat' : (245, 222, 179), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_violetred3, __pyx_tuple__503) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":649 * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), # <<<<<<<<<<<<<< * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_violetred4, __pyx_tuple__504) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":650 * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), * 'wheat' : (245, 222, 179), # <<<<<<<<<<<<<< * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_wheat, __pyx_tuple__505) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":651 * 'violetred4' : (139, 34, 82), * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), # <<<<<<<<<<<<<< * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_wheat1, __pyx_tuple__506) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":652 * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), # <<<<<<<<<<<<<< * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_wheat2, __pyx_tuple__507) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":653 * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), # <<<<<<<<<<<<<< * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_wheat3, __pyx_tuple__508) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":654 * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), # <<<<<<<<<<<<<< * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_wheat4, __pyx_tuple__509) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":655 * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), # <<<<<<<<<<<<<< * 'whitesmoke' : (245, 245, 245), * 'yellow' : (255, 255, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_white, __pyx_tuple__149) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":656 * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), # <<<<<<<<<<<<<< * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_whitesmoke, __pyx_tuple__242) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":657 * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), * 'yellow' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_yellow, __pyx_tuple__510) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":658 * 'whitesmoke' : (245, 245, 245), * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_yellow1, __pyx_tuple__510) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":659 * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), # <<<<<<<<<<<<<< * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_yellow2, __pyx_tuple__511) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":660 * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), # <<<<<<<<<<<<<< * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_yellow3, __pyx_tuple__512) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":661 * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), # <<<<<<<<<<<<<< * 'yellowgreen' : (154, 205, 50), * } */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_yellow4, __pyx_tuple__513) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":662 * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), # <<<<<<<<<<<<<< * } */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_yellowgreen, __pyx_tuple__369) < 0) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5color_colors); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5color_colors, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":161 * return float(int(self)) * * def __reduce__(self): # <<<<<<<<<<<<<< * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_17__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Color___reduce, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__515)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color, __pyx_n_s_reduce, __pyx_t_2) < 0) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5color_Color); /* "pygame_sdl2/color.pyx":166 * return (Color, (), d) * * def __setstate__(self, d): # <<<<<<<<<<<<<< * self.r, self.g, self.b, self.a = d['rgba'] * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_19__setstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Color___setstate, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__516)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color, __pyx_n_s_setstate, __pyx_t_2) < 0) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5color_Color); /* "pygame_sdl2/color.pyx":449 * self.b = int(b * 255) * * def normalize(self): # <<<<<<<<<<<<<< * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_39normalize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Color_normalize, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__518)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color, __pyx_n_s_normalize, __pyx_t_2) < 0) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5color_Color); /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_41correct_gamma, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Color_correct_gamma, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__520)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color, __pyx_n_s_correct_gamma, __pyx_t_2) < 0) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5color_Color); /* "pygame_sdl2/color.pyx":457 * return c * * def set_length(self, n): # <<<<<<<<<<<<<< * if n > 4 or n < 1: * raise ValueError(n) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5color_5Color_43set_length, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Color_set_length, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__522)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color, __pyx_n_s_set_length, __pyx_t_2) < 0) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5color_Color); /* "pygame_sdl2/color.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # Copyright 2014 Patrick Dawson * # */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.color", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.color"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); #ifdef HAVE_LONG_LONG if (sizeof(PY_LONG_LONG) > sizeof(long)) { PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; return (result >= LONG_MIN && result <= LONG_MAX) ? PyInt_FromLong((long)result) : PyLong_FromLongLong(result); } #endif #if CYTHON_USE_TYPE_SLOTS return PyInt_Type.tp_as_number->nb_multiply(op1, op2); #else return PyNumber_Multiply(op1, op2); #endif } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } } CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); #ifdef HAVE_LONG_LONG lla = a; goto long_long; #else return PyLong_Type.tp_as_number->nb_multiply(op1, op2); #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla * llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("multiply", return NULL) result = ((double)a) * (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #endif /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* StringJoin */ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { (void) __Pyx_PyObject_CallMethod1; #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION < 3 return _PyString_Join(sep, values); #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 return _PyBytes_Join(sep, values); #else return __Pyx_PyObject_CallMethod1(sep, __pyx_n_s_join, values); #endif } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* pybytes_as_double */ static double __Pyx_SlowPyString_AsDouble(PyObject *obj) { PyObject *float_value; #if PY_MAJOR_VERSION >= 3 float_value = PyFloat_FromString(obj); #else float_value = PyFloat_FromString(obj, 0); #endif if (likely(float_value)) { #if CYTHON_ASSUME_SAFE_MACROS double value = PyFloat_AS_DOUBLE(float_value); #else double value = PyFloat_AsDouble(float_value); #endif Py_DECREF(float_value); return value; } return (double)-1; } static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) { int last_was_punctuation = 1; Py_ssize_t i; for (i=0; i < length; i++) { char chr = start[i]; int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E'); *buffer = chr; buffer += (chr != '_'); if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure; last_was_punctuation = is_punctuation; } if (unlikely(last_was_punctuation)) goto parse_failure; *buffer = '\0'; return buffer; parse_failure: return NULL; } static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) { int matches = 1; char sign = start[0]; int is_signed = (sign == '+') | (sign == '-'); start += is_signed; length -= is_signed; switch (start[0]) { #ifdef Py_NAN case 'n': case 'N': if (unlikely(length != 3)) goto parse_failure; matches &= (start[1] == 'a' || start[1] == 'A'); matches &= (start[2] == 'n' || start[2] == 'N'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_NAN : Py_NAN; #endif case 'i': case 'I': if (unlikely(length < 3)) goto parse_failure; matches &= (start[1] == 'n' || start[1] == 'N'); matches &= (start[2] == 'f' || start[2] == 'F'); if (likely(length == 3 && matches)) return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; if (unlikely(length != 8)) goto parse_failure; matches &= (start[3] == 'i' || start[3] == 'I'); matches &= (start[4] == 'n' || start[4] == 'N'); matches &= (start[5] == 'i' || start[5] == 'I'); matches &= (start[6] == 't' || start[6] == 'T'); matches &= (start[7] == 'y' || start[7] == 'Y'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: goto parse_failure; } return 0.0; parse_failure: return -1.0; } static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) { return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd)); } CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) { double value; Py_ssize_t i, digits; const char *last = start + length; char *end; while (__Pyx__PyBytes_AsDouble_IsSpace(*start)) start++; while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1])) last--; length = last - start; if (unlikely(length <= 0)) goto fallback; value = __Pyx__PyBytes_AsDouble_inf_nan(start, length); if (unlikely(value == -1.0)) goto fallback; if (value != 0.0) return value; digits = 0; for (i=0; i < length; digits += start[i++] != '_'); if (likely(digits == length)) { value = PyOS_string_to_double(start, &end, NULL); } else if (digits < 40) { char number[40]; last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); if (unlikely(!last)) goto fallback; value = PyOS_string_to_double(number, &end, NULL); } else { char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char)); if (unlikely(!number)) goto fallback; last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); if (unlikely(!last)) { PyMem_Free(number); goto fallback; } value = PyOS_string_to_double(number, &end, NULL); PyMem_Free(number); } if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { return value; } fallback: return __Pyx_SlowPyString_AsDouble(obj); } /* pynumber_float */ static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) { double val; if (PyLong_CheckExact(obj)) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(obj))) { val = (double) __Pyx_PyLong_CompactValue(obj); goto no_error; } #endif val = PyLong_AsDouble(obj); } else if (PyUnicode_CheckExact(obj)) { val = __Pyx_PyUnicode_AsDouble(obj); } else if (PyBytes_CheckExact(obj)) { val = __Pyx_PyBytes_AsDouble(obj); } else if (PyByteArray_CheckExact(obj)) { val = __Pyx_PyByteArray_AsDouble(obj); } else { return PyNumber_Float(obj); } if (unlikely(val == -1 && PyErr_Occurred())) { return NULL; } #if CYTHON_USE_PYLONG_INTERNALS no_error: #endif return PyFloat_FromDouble(val); } /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 1; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a == b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) == 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 0; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 0; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal == 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a == (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_EQ)); } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { const long a = intval; long x; long b = PyInt_AS_LONG(op2); x = (long)((unsigned long)a - (unsigned long)b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op2))) { const long a = intval; long b, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG lla = intval; PY_LONG_LONG llb, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op2))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op2))) { b = __Pyx_PyLong_CompactValue(op2); } else { const digit* digits = __Pyx_PyLong_Digits(op2); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla - llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op2)) { const long a = intval; #if CYTHON_COMPILING_IN_LIMITED_API double b = __pyx_PyFloat_AsDouble(op2); #else double b = PyFloat_AS_DOUBLE(op2); #endif double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif /* ModFloat[double] */ static CYTHON_INLINE double __Pyx_mod_double(double a, double b) { double r = fmod(a, b); r += ((r != 0) & ((r < 0) ^ (b < 0))) * b; return r; } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyFloatBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_RemainderObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) { const double b = floatval; double a, result; CYTHON_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); if (likely(PyFloat_CheckExact(op1))) { #if CYTHON_COMPILING_IN_LIMITED_API a = __pyx_PyFloat_AsDouble(op1); #else a = PyFloat_AS_DOUBLE(op1); #endif } else #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { a = (double) PyInt_AS_LONG(op1); } else #endif if (likely(PyLong_CheckExact(op1))) { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsZero(op1)) { a = 0.0; } else if (__Pyx_PyLong_IsCompact(op1)) { a = (double) __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -2) a = -a; break; } } CYTHON_FALLTHROUGH; case -3: case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -3) a = -a; break; } } CYTHON_FALLTHROUGH; case -4: case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -4) a = -a; break; } } CYTHON_FALLTHROUGH; default: #endif a = PyLong_AsDouble(op1); if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL; #if CYTHON_USE_PYLONG_INTERNALS } } #endif } else { return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2); } PyFPE_START_PROTECT("remainder", return NULL) result = fmod(a, b); if (result) result += ((result < 0) ^ (b < 0)) * b; else result = copysign(0.0, b); PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } #endif /* PyFloatBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) { const double b = floatval; double a, result; CYTHON_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); if (likely(PyFloat_CheckExact(op1))) { #if CYTHON_COMPILING_IN_LIMITED_API a = __pyx_PyFloat_AsDouble(op1); #else a = PyFloat_AS_DOUBLE(op1); #endif } else #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { a = (double) PyInt_AS_LONG(op1); } else #endif if (likely(PyLong_CheckExact(op1))) { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsZero(op1)) { a = 0.0; } else if (__Pyx_PyLong_IsCompact(op1)) { a = (double) __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -2) a = -a; break; } } CYTHON_FALLTHROUGH; case -3: case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -3) a = -a; break; } } CYTHON_FALLTHROUGH; case -4: case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -4) a = -a; break; } } CYTHON_FALLTHROUGH; default: #endif a = PyLong_AsDouble(op1); if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL; #if CYTHON_USE_PYLONG_INTERNALS } } #endif } else { return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); } PyFPE_START_PROTECT("divide", return NULL) result = a / b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } #endif /* RaiseClosureNameError */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetVTable */ static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { PyObject *ob = PyCapsule_New(vtable, 0, 0); if (unlikely(!ob)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* MergeVTables */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type) { int i; void** base_vtables; __Pyx_TypeName tp_base_name; __Pyx_TypeName base_name; void* unknown = (void*)-1; PyObject* bases = type->tp_bases; int base_depth = 0; { PyTypeObject* base = type->tp_base; while (base) { base_depth += 1; base = base->tp_base; } } base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); if (base_vtable != NULL) { int j; PyTypeObject* base = type->tp_base; for (j = 0; j < base_depth; j++) { if (base_vtables[j] == unknown) { base_vtables[j] = __Pyx_GetVtable(base); base_vtables[j + 1] = unknown; } if (base_vtables[j] == base_vtable) { break; } else if (base_vtables[j] == NULL) { goto bad; } base = base->tp_base; } } } PyErr_Clear(); free(base_vtables); return 0; bad: tp_base_name = __Pyx_PyType_GetName(type->tp_base); base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); free(base_vtables); return -1; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__10; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint8_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT)) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT)) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT)) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint8_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } } #endif if ((sizeof(uint8_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint8_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint8_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint8_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint8_t) -1; } else { stepval = v; } v = NULL; val = (uint8_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint8_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint8_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint8_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint8_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint8_t) 1) << (sizeof(uint8_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint8_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint32_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint32_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = v; } v = NULL; val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint32_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint32_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__523); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; cobj = PyCapsule_New(tmp.p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635908.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.controller.c0000664000175000017500000176122015026112604021262 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__controller #define __PYX_HAVE_API__pygame_sdl2__controller /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "", "src/pygame_sdl2/controller.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_10controller_Controller; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; /* "pygame_sdl2/controller.pyx":140 * * * cdef class Controller: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_10controller_Controller { PyObject_HEAD PyObject *__weakref__; SDL_GameController *controller; int index; int instance_id; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_GameControllerAxis __Pyx_PyInt_As_SDL_GameControllerAxis(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_GameControllerButton __Pyx_PyInt_As_SDL_GameControllerButton(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.controller" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.controller" extern int __pyx_module_is_main_pygame_sdl2__controller; int __pyx_module_is_main_pygame_sdl2__controller = 0; /* Implementation of "pygame_sdl2.controller" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; static const char __pyx_k_s[] = "s"; static const char __pyx_k__2[] = "*"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__34[] = "?"; static const char __pyx_k_axis[] = "axis"; static const char __pyx_k_guid[] = "guid"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_index[] = "index"; static const char __pyx_k_rwops[] = "rwops"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_button[] = "button"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_mapping[] = "mapping"; static const char __pyx_k_get_axis[] = "get_axis"; static const char __pyx_k_get_init[] = "get_init"; static const char __pyx_k_get_name[] = "get_name"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_get_count[] = "get_count"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_Controller[] = "Controller"; static const char __pyx_k_get_button[] = "get_button"; static const char __pyx_k_add_mapping[] = "add_mapping"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_add_mappings[] = "add_mappings"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_mapping_file[] = "mapping_file"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_is_controller[] = "is_controller"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_sdl_main_init[] = "sdl_main_init"; static const char __pyx_k_Controller_init[] = "Controller.init"; static const char __pyx_k_Controller_quit[] = "Controller.quit"; static const char __pyx_k_get_guid_string[] = "get_guid_string"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Controller_get_axis[] = "Controller.get_axis"; static const char __pyx_k_Controller_get_init[] = "Controller.get_init"; static const char __pyx_k_Controller_get_name[] = "Controller.get_name"; static const char __pyx_k_get_string_for_axis[] = "get_string_for_axis"; static const char __pyx_k_get_axis_from_string[] = "get_axis_from_string"; static const char __pyx_k_Controller_get_button[] = "Controller.get_button"; static const char __pyx_k_get_string_for_button[] = "get_string_for_button"; static const char __pyx_k_get_button_from_string[] = "get_button_from_string"; static const char __pyx_k_pygame_sdl2_controller[] = "pygame_sdl2.controller"; static const char __pyx_k_Controller_is_controller[] = "Controller.is_controller"; static const char __pyx_k_Controller___reduce_cython[] = "Controller.__reduce_cython__"; static const char __pyx_k_Controller_get_guid_string[] = "Controller.get_guid_string"; static const char __pyx_k_controller_not_initialized[] = "controller not initialized."; static const char __pyx_k_Controller___setstate_cython[] = "Controller.__setstate_cython__"; static const char __pyx_k_src_pygame_sdl2_controller_pyx[] = "src/pygame_sdl2/controller.pyx"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_4get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_6get_count(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_8add_mapping(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10add_mappings(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping_file); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_12get_axis_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_14get_button_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_16get_string_for_axis(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_axis); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_18get_string_for_button(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_button); /* proto */ static int __pyx_pf_11pygame_sdl2_10controller_10Controller___cinit__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_10controller_10Controller_2__init__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_4init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_6quit(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_8get_init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_10get_axis(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_axis); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_12get_button(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_button); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_14get_name(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_16is_controller(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_18get_guid_string(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_11instance_id___get__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_10controller_10Controller_11instance_id_2__set__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_10controller_Controller(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_10controller_Controller; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_10controller_Controller; PyObject *__pyx_kp_u_; PyObject *__pyx_n_s_Controller; PyObject *__pyx_n_s_Controller___reduce_cython; PyObject *__pyx_n_s_Controller___setstate_cython; PyObject *__pyx_n_s_Controller_get_axis; PyObject *__pyx_n_s_Controller_get_button; PyObject *__pyx_n_s_Controller_get_guid_string; PyObject *__pyx_n_s_Controller_get_init; PyObject *__pyx_n_s_Controller_get_name; PyObject *__pyx_n_s_Controller_init; PyObject *__pyx_n_s_Controller_is_controller; PyObject *__pyx_n_s_Controller_quit; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s__2; PyObject *__pyx_n_s__34; PyObject *__pyx_n_s_add_mapping; PyObject *__pyx_n_s_add_mappings; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_axis; PyObject *__pyx_n_s_button; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_kp_s_controller_not_initialized; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_display; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_error; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_axis; PyObject *__pyx_n_s_get_axis_from_string; PyObject *__pyx_n_s_get_button; PyObject *__pyx_n_s_get_button_from_string; PyObject *__pyx_n_s_get_count; PyObject *__pyx_n_s_get_guid_string; PyObject *__pyx_n_s_get_init; PyObject *__pyx_n_s_get_name; PyObject *__pyx_n_s_get_string_for_axis; PyObject *__pyx_n_s_get_string_for_button; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_guid; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_index; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_controller; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_mapping; PyObject *__pyx_n_s_mapping_file; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_controller; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_register_init; PyObject *__pyx_n_s_register_quit; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_rwops; PyObject *__pyx_n_s_s; PyObject *__pyx_n_s_sdl_main_init; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_controller_pyx; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_test; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__26; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__32; PyObject *__pyx_codeobj__3; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__31; PyObject *__pyx_codeobj__33; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_10controller_Controller); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_10controller_Controller); Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_n_s_Controller); Py_CLEAR(clear_module_state->__pyx_n_s_Controller___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Controller___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_get_axis); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_get_button); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_get_guid_string); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_get_name); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_init); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_is_controller); Py_CLEAR(clear_module_state->__pyx_n_s_Controller_quit); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s__2); Py_CLEAR(clear_module_state->__pyx_n_s__34); Py_CLEAR(clear_module_state->__pyx_n_s_add_mapping); Py_CLEAR(clear_module_state->__pyx_n_s_add_mappings); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_axis); Py_CLEAR(clear_module_state->__pyx_n_s_button); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_kp_s_controller_not_initialized); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_display); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_axis); Py_CLEAR(clear_module_state->__pyx_n_s_get_axis_from_string); Py_CLEAR(clear_module_state->__pyx_n_s_get_button); Py_CLEAR(clear_module_state->__pyx_n_s_get_button_from_string); Py_CLEAR(clear_module_state->__pyx_n_s_get_count); Py_CLEAR(clear_module_state->__pyx_n_s_get_guid_string); Py_CLEAR(clear_module_state->__pyx_n_s_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_get_name); Py_CLEAR(clear_module_state->__pyx_n_s_get_string_for_axis); Py_CLEAR(clear_module_state->__pyx_n_s_get_string_for_button); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_guid); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_index); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_controller); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_mapping); Py_CLEAR(clear_module_state->__pyx_n_s_mapping_file); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_controller); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_register_init); Py_CLEAR(clear_module_state->__pyx_n_s_register_quit); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_rwops); Py_CLEAR(clear_module_state->__pyx_n_s_s); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_main_init); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_controller_pyx); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__26); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__32); Py_CLEAR(clear_module_state->__pyx_codeobj__3); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__31); Py_CLEAR(clear_module_state->__pyx_codeobj__33); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_10controller_Controller); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_10controller_Controller); Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_n_s_Controller); Py_VISIT(traverse_module_state->__pyx_n_s_Controller___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Controller___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_get_axis); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_get_button); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_get_guid_string); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_get_name); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_init); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_is_controller); Py_VISIT(traverse_module_state->__pyx_n_s_Controller_quit); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s__2); Py_VISIT(traverse_module_state->__pyx_n_s__34); Py_VISIT(traverse_module_state->__pyx_n_s_add_mapping); Py_VISIT(traverse_module_state->__pyx_n_s_add_mappings); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_axis); Py_VISIT(traverse_module_state->__pyx_n_s_button); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_kp_s_controller_not_initialized); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_display); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_axis); Py_VISIT(traverse_module_state->__pyx_n_s_get_axis_from_string); Py_VISIT(traverse_module_state->__pyx_n_s_get_button); Py_VISIT(traverse_module_state->__pyx_n_s_get_button_from_string); Py_VISIT(traverse_module_state->__pyx_n_s_get_count); Py_VISIT(traverse_module_state->__pyx_n_s_get_guid_string); Py_VISIT(traverse_module_state->__pyx_n_s_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_get_name); Py_VISIT(traverse_module_state->__pyx_n_s_get_string_for_axis); Py_VISIT(traverse_module_state->__pyx_n_s_get_string_for_button); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_guid); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_index); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_controller); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_mapping); Py_VISIT(traverse_module_state->__pyx_n_s_mapping_file); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_controller); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_register_init); Py_VISIT(traverse_module_state->__pyx_n_s_register_quit); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_rwops); Py_VISIT(traverse_module_state->__pyx_n_s_s); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_main_init); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_controller_pyx); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__26); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__32); Py_VISIT(traverse_module_state->__pyx_codeobj__3); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__31); Py_VISIT(traverse_module_state->__pyx_codeobj__33); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_10controller_Controller __pyx_mstate_global->__pyx_type_11pygame_sdl2_10controller_Controller #endif #define __pyx_ptype_11pygame_sdl2_10controller_Controller __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_10controller_Controller #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_n_s_Controller __pyx_mstate_global->__pyx_n_s_Controller #define __pyx_n_s_Controller___reduce_cython __pyx_mstate_global->__pyx_n_s_Controller___reduce_cython #define __pyx_n_s_Controller___setstate_cython __pyx_mstate_global->__pyx_n_s_Controller___setstate_cython #define __pyx_n_s_Controller_get_axis __pyx_mstate_global->__pyx_n_s_Controller_get_axis #define __pyx_n_s_Controller_get_button __pyx_mstate_global->__pyx_n_s_Controller_get_button #define __pyx_n_s_Controller_get_guid_string __pyx_mstate_global->__pyx_n_s_Controller_get_guid_string #define __pyx_n_s_Controller_get_init __pyx_mstate_global->__pyx_n_s_Controller_get_init #define __pyx_n_s_Controller_get_name __pyx_mstate_global->__pyx_n_s_Controller_get_name #define __pyx_n_s_Controller_init __pyx_mstate_global->__pyx_n_s_Controller_init #define __pyx_n_s_Controller_is_controller __pyx_mstate_global->__pyx_n_s_Controller_is_controller #define __pyx_n_s_Controller_quit __pyx_mstate_global->__pyx_n_s_Controller_quit #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s__2 __pyx_mstate_global->__pyx_n_s__2 #define __pyx_n_s__34 __pyx_mstate_global->__pyx_n_s__34 #define __pyx_n_s_add_mapping __pyx_mstate_global->__pyx_n_s_add_mapping #define __pyx_n_s_add_mappings __pyx_mstate_global->__pyx_n_s_add_mappings #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_axis __pyx_mstate_global->__pyx_n_s_axis #define __pyx_n_s_button __pyx_mstate_global->__pyx_n_s_button #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_kp_s_controller_not_initialized __pyx_mstate_global->__pyx_kp_s_controller_not_initialized #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_axis __pyx_mstate_global->__pyx_n_s_get_axis #define __pyx_n_s_get_axis_from_string __pyx_mstate_global->__pyx_n_s_get_axis_from_string #define __pyx_n_s_get_button __pyx_mstate_global->__pyx_n_s_get_button #define __pyx_n_s_get_button_from_string __pyx_mstate_global->__pyx_n_s_get_button_from_string #define __pyx_n_s_get_count __pyx_mstate_global->__pyx_n_s_get_count #define __pyx_n_s_get_guid_string __pyx_mstate_global->__pyx_n_s_get_guid_string #define __pyx_n_s_get_init __pyx_mstate_global->__pyx_n_s_get_init #define __pyx_n_s_get_name __pyx_mstate_global->__pyx_n_s_get_name #define __pyx_n_s_get_string_for_axis __pyx_mstate_global->__pyx_n_s_get_string_for_axis #define __pyx_n_s_get_string_for_button __pyx_mstate_global->__pyx_n_s_get_string_for_button #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_guid __pyx_mstate_global->__pyx_n_s_guid #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_controller __pyx_mstate_global->__pyx_n_s_is_controller #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_mapping __pyx_mstate_global->__pyx_n_s_mapping #define __pyx_n_s_mapping_file __pyx_mstate_global->__pyx_n_s_mapping_file #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_controller __pyx_mstate_global->__pyx_n_s_pygame_sdl2_controller #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_register_init __pyx_mstate_global->__pyx_n_s_register_init #define __pyx_n_s_register_quit __pyx_mstate_global->__pyx_n_s_register_quit #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_rwops __pyx_mstate_global->__pyx_n_s_rwops #define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s #define __pyx_n_s_sdl_main_init __pyx_mstate_global->__pyx_n_s_sdl_main_init #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_controller_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_controller_pyx #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 /* #### Code section: module_code ### */ /* "pygame_sdl2/controller.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_init, "init()\n\n Initializes game controller support.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_init}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/controller.pyx":31 * """ * * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/controller.pyx":33 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = (SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) != 0); if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/controller.pyx":34 * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): * raise error() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 34, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":33 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":36 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_2quit, "quit()\n\n Shuts down game controller support.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_3quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_2quit}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/controller.pyx":42 * """ * * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) # <<<<<<<<<<<<<< * * def get_init(): */ SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); /* "pygame_sdl2/controller.pyx":36 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_4get_init, "get_init()\n\n Returns true if game controller support has been initialized.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_5get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_5get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_4get_init}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_4get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_4get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/controller.pyx":49 * """ * * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 # <<<<<<<<<<<<<< * * def get_count(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_6get_count, "get_count()\n\n Returns the number of joysticks and game controllers connected to the\n system. This is one more than the maximum index that can be passed to\n Controller. While every game controller is a joystick, not every joystick\n is a game controller. To check that index `i` corresponds to a game\n controller, use code such as::\n\n if pygame_sdl2.controller.Controller(i).is_controller():\n ...\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_7get_count = {"get_count", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_7get_count, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_6get_count}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_count (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_6get_count(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_6get_count(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_count", 1); /* "pygame_sdl2/controller.pyx":63 * """ * * return SDL_NumJoysticks() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(SDL_NumJoysticks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_9add_mapping(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_8add_mapping, "add_mapping(mapping)\n\n Adds a game controller mapping from the string in `mapping`.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_9add_mapping = {"add_mapping", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_9add_mapping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_8add_mapping}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_9add_mapping(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mapping = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_mapping (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mapping,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mapping)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 66, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_mapping") < 0)) __PYX_ERR(1, 66, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mapping = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_mapping", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 66, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.add_mapping", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_8add_mapping(__pyx_self, __pyx_v_mapping); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_8add_mapping(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_mapping", 1); /* "pygame_sdl2/controller.pyx":71 * """ * * if SDL_GameControllerAddMapping(mapping) == -1: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_mapping); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(1, 71, __pyx_L1_error) __pyx_t_2 = (SDL_GameControllerAddMapping(__pyx_t_1) == -1L); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/controller.pyx":72 * * if SDL_GameControllerAddMapping(mapping) == -1: * raise error() # <<<<<<<<<<<<<< * * def add_mappings(mapping_file): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 72, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":71 * """ * * if SDL_GameControllerAddMapping(mapping) == -1: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.controller.add_mapping", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_11add_mappings(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10add_mappings, "add_mappings(mapping_file)\n\n Adds game controller mappings from `mapping_file`, which can be a string\n filename or a file-like object. This file should be gamecontrollerdb.txt,\n downloaded from:\n\n https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt\n\n This should be called before creating a Controller object. It can be called\n multiple times to add multiple database files.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_11add_mappings = {"add_mappings", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_11add_mappings, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10add_mappings}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_11add_mappings(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mapping_file = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_mappings (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mapping_file,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mapping_file)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 74, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_mappings") < 0)) __PYX_ERR(1, 74, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mapping_file = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_mappings", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 74, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.add_mappings", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10add_mappings(__pyx_self, __pyx_v_mapping_file); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10add_mappings(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping_file) { SDL_RWops *__pyx_v_rwops; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_RWops *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_mappings", 1); /* "pygame_sdl2/controller.pyx":86 * """ * * cdef SDL_RWops *rwops = to_rwops(mapping_file) # <<<<<<<<<<<<<< * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: */ __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_mapping_file, NULL); if (unlikely(__pyx_t_1 == ((SDL_RWops *)NULL))) __PYX_ERR(1, 86, __pyx_L1_error) __pyx_v_rwops = __pyx_t_1; /* "pygame_sdl2/controller.pyx":88 * cdef SDL_RWops *rwops = to_rwops(mapping_file) * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (SDL_GameControllerAddMappingsFromRW(__pyx_v_rwops, 1) == -1L); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/controller.pyx":89 * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: * raise error() # <<<<<<<<<<<<<< * * def get_axis_from_string(name): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 89, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":88 * cdef SDL_RWops *rwops = to_rwops(mapping_file) * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.controller.add_mappings", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_13get_axis_from_string(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_12get_axis_from_string, "get_axis_from_string(name)\n\n Returns the axis number of the controller axis with `name`, or\n pygame.CONTROLLER_AXIS_INVALID if `name` is not known.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_13get_axis_from_string = {"get_axis_from_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_13get_axis_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_12get_axis_from_string}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_13get_axis_from_string(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_axis_from_string (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 91, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_axis_from_string") < 0)) __PYX_ERR(1, 91, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_axis_from_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 91, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.get_axis_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_12get_axis_from_string(__pyx_self, __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_12get_axis_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; char const *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_axis_from_string", 0); __Pyx_INCREF(__pyx_v_name); /* "pygame_sdl2/controller.pyx":97 * """ * * if not isinstance(name, bytes): # <<<<<<<<<<<<<< * name = name.encode("utf-8") * */ __pyx_t_1 = PyBytes_Check(__pyx_v_name); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":98 * * if not isinstance(name, bytes): * name = name.encode("utf-8") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetAxisFromString(name) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_utf_8}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":97 * """ * * if not isinstance(name, bytes): # <<<<<<<<<<<<<< * name = name.encode("utf-8") * */ } /* "pygame_sdl2/controller.pyx":100 * name = name.encode("utf-8") * * return SDL_GameControllerGetAxisFromString(name) # <<<<<<<<<<<<<< * * def get_button_from_string(name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 100, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerGetAxisFromString(__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.controller.get_axis_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":102 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_15get_button_from_string(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_14get_button_from_string, "get_button_from_string(name)\n\n Returns the button number of the controller button with `name`, or\n pygame.CONTROLLER_BUTTON_INVALID if `name` is not known.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_15get_button_from_string = {"get_button_from_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_15get_button_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_14get_button_from_string}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_15get_button_from_string(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_button_from_string (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 102, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_button_from_string") < 0)) __PYX_ERR(1, 102, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_button_from_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 102, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.get_button_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_14get_button_from_string(__pyx_self, __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_14get_button_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; char const *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_button_from_string", 0); __Pyx_INCREF(__pyx_v_name); /* "pygame_sdl2/controller.pyx":108 * """ * * if not isinstance(name, bytes): # <<<<<<<<<<<<<< * name = name.encode("utf-8") * */ __pyx_t_1 = PyBytes_Check(__pyx_v_name); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":109 * * if not isinstance(name, bytes): * name = name.encode("utf-8") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetButtonFromString(name) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_utf_8}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":108 * """ * * if not isinstance(name, bytes): # <<<<<<<<<<<<<< * name = name.encode("utf-8") * */ } /* "pygame_sdl2/controller.pyx":111 * name = name.encode("utf-8") * * return SDL_GameControllerGetButtonFromString(name) # <<<<<<<<<<<<<< * * def get_string_for_axis(axis): */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 111, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerGetButtonFromString(__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":102 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.controller.get_button_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":113 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_17get_string_for_axis(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_16get_string_for_axis, "get_string_for_axis(axis)\n\n Returns a string describing the controller axis `axis`, which must be\n an integer. Returns None if the axis is not known.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_17get_string_for_axis = {"get_string_for_axis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_17get_string_for_axis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_16get_string_for_axis}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_17get_string_for_axis(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_axis = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_string_for_axis (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_axis,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_axis)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 113, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_string_for_axis") < 0)) __PYX_ERR(1, 113, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_axis = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_string_for_axis", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 113, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.get_string_for_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_16get_string_for_axis(__pyx_self, __pyx_v_axis); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_16get_string_for_axis(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_axis) { char const *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_GameControllerAxis __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_string_for_axis", 1); /* "pygame_sdl2/controller.pyx":119 * """ * * cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) # <<<<<<<<<<<<<< * * if rv != NULL: */ __pyx_t_1 = ((SDL_GameControllerAxis)__Pyx_PyInt_As_SDL_GameControllerAxis(__pyx_v_axis)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 119, __pyx_L1_error) __pyx_v_rv = SDL_GameControllerGetStringForAxis(__pyx_t_1); /* "pygame_sdl2/controller.pyx":121 * cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv.decode("utf-8") * else: */ __pyx_t_2 = (__pyx_v_rv != NULL); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":122 * * if rv != NULL: * return rv.decode("utf-8") # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_rv); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 122, __pyx_L1_error) __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_rv, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":121 * cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv.decode("utf-8") * else: */ } /* "pygame_sdl2/controller.pyx":124 * return rv.decode("utf-8") * else: * return None # <<<<<<<<<<<<<< * * def get_string_for_button(button): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "pygame_sdl2/controller.pyx":113 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.controller.get_string_for_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":126 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_19get_string_for_button(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_18get_string_for_button, "get_string_for_button(button)\n\n Returns a string describing the controller button `button`, which must be\n an integer. Returns None if the button is not known.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_19get_string_for_button = {"get_string_for_button", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_19get_string_for_button, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_18get_string_for_button}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_19get_string_for_button(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_button = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_string_for_button (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_button,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_button)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 126, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_string_for_button") < 0)) __PYX_ERR(1, 126, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_button = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_string_for_button", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 126, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.get_string_for_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_18get_string_for_button(__pyx_self, __pyx_v_button); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_18get_string_for_button(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_button) { char const *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_GameControllerButton __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_string_for_button", 1); /* "pygame_sdl2/controller.pyx":132 * """ * * cdef const char *rv = SDL_GameControllerGetStringForButton(button) # <<<<<<<<<<<<<< * * if rv != NULL: */ __pyx_t_1 = ((SDL_GameControllerButton)__Pyx_PyInt_As_SDL_GameControllerButton(__pyx_v_button)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L1_error) __pyx_v_rv = SDL_GameControllerGetStringForButton(__pyx_t_1); /* "pygame_sdl2/controller.pyx":134 * cdef const char *rv = SDL_GameControllerGetStringForButton(button) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv.decode("utf-8") * else: */ __pyx_t_2 = (__pyx_v_rv != NULL); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":135 * * if rv != NULL: * return rv.decode("utf-8") # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_rv); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 135, __pyx_L1_error) __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_rv, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":134 * cdef const char *rv = SDL_GameControllerGetStringForButton(button) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv.decode("utf-8") * else: */ } /* "pygame_sdl2/controller.pyx":137 * return rv.decode("utf-8") * else: * return None # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "pygame_sdl2/controller.pyx":126 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.controller.get_string_for_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":148 * cdef public int instance_id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.controller = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller___cinit__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_10controller_10Controller___cinit__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/controller.pyx":149 * * def __cinit__(self): * self.controller = NULL # <<<<<<<<<<<<<< * * def __init__(self, index): */ __pyx_v_self->controller = NULL; /* "pygame_sdl2/controller.pyx":148 * cdef public int instance_id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.controller = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/controller.pyx":151 * self.controller = NULL * * def __init__(self, index): # <<<<<<<<<<<<<< * """ * Represents a game controller object corresponding to the joystick */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_2__init__, "\n Represents a game controller object corresponding to the joystick\n with `index`.\n "); #if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__; #endif static int __pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_index = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 151, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 151, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_2__init__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), __pyx_v_index); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_10controller_10Controller_2__init__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_index) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/controller.pyx":157 * """ * * self.index = index # <<<<<<<<<<<<<< * * def init(self): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 157, __pyx_L1_error) __pyx_v_self->index = __pyx_t_1; /* "pygame_sdl2/controller.pyx":151 * self.controller = NULL * * def __init__(self, index): # <<<<<<<<<<<<<< * """ * Represents a game controller object corresponding to the joystick */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/controller.pyx":159 * self.index = index * * def init(self): # <<<<<<<<<<<<<< * """ * Opens the game controller, causing it to begin sending events. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_5init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_4init, "Controller.init(self)\n\n Opens the game controller, causing it to begin sending events.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_5init = {"init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_5init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_4init}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_5init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("init", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "init", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_4init(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_4init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/controller.pyx":164 * """ * * self.instance_id = SDL_JoystickGetDeviceInstanceID(self.index) # <<<<<<<<<<<<<< * * if self.controller == NULL: */ __pyx_v_self->instance_id = SDL_JoystickGetDeviceInstanceID(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":166 * self.instance_id = SDL_JoystickGetDeviceInstanceID(self.index) * * if self.controller == NULL: # <<<<<<<<<<<<<< * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: */ __pyx_t_1 = (__pyx_v_self->controller == NULL); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":167 * * if self.controller == NULL: * self.controller = SDL_GameControllerOpen(self.index) # <<<<<<<<<<<<<< * if self.controller == NULL: * raise error() */ __pyx_v_self->controller = SDL_GameControllerOpen(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":168 * if self.controller == NULL: * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_self->controller == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/controller.pyx":169 * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: * raise error() # <<<<<<<<<<<<<< * * def quit(self): # @ReservedAssignment */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 169, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":168 * if self.controller == NULL: * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":166 * self.instance_id = SDL_JoystickGetDeviceInstanceID(self.index) * * if self.controller == NULL: # <<<<<<<<<<<<<< * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: */ } /* "pygame_sdl2/controller.pyx":159 * self.index = index * * def init(self): # <<<<<<<<<<<<<< * """ * Opens the game controller, causing it to begin sending events. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":171 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Closes the game controller, preventing it from sending events. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_6quit, "Controller.quit(self)\n\n Closes the game controller, preventing it from sending events.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_7quit = {"quit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_6quit}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("quit", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "quit", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_6quit(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_6quit(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; SDL_bool __pyx_t_3; __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/controller.pyx":176 * """ * * if self.controller and SDL_GameControllerGetAttached(self.controller): # <<<<<<<<<<<<<< * SDL_GameControllerClose(self.controller) * self.controller = NULL */ __pyx_t_2 = (__pyx_v_self->controller != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = SDL_GameControllerGetAttached(__pyx_v_self->controller); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":177 * * if self.controller and SDL_GameControllerGetAttached(self.controller): * SDL_GameControllerClose(self.controller) # <<<<<<<<<<<<<< * self.controller = NULL * */ SDL_GameControllerClose(__pyx_v_self->controller); /* "pygame_sdl2/controller.pyx":178 * if self.controller and SDL_GameControllerGetAttached(self.controller): * SDL_GameControllerClose(self.controller) * self.controller = NULL # <<<<<<<<<<<<<< * * def get_init(self): */ __pyx_v_self->controller = NULL; /* "pygame_sdl2/controller.pyx":176 * """ * * if self.controller and SDL_GameControllerGetAttached(self.controller): # <<<<<<<<<<<<<< * SDL_GameControllerClose(self.controller) * self.controller = NULL */ } /* "pygame_sdl2/controller.pyx":171 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Closes the game controller, preventing it from sending events. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":180 * self.controller = NULL * * def get_init(self): # <<<<<<<<<<<<<< * """ * Returns true if the controller has been initialized, false otherwise. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_8get_init, "Controller.get_init(self)\n\n Returns true if the controller has been initialized, false otherwise.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_9get_init = {"get_init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_8get_init}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_init", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_init", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_8get_init(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_8get_init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/controller.pyx":185 * """ * * if self.controller: # <<<<<<<<<<<<<< * return True * else: */ __pyx_t_1 = (__pyx_v_self->controller != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":186 * * if self.controller: * return True # <<<<<<<<<<<<<< * else: * return False */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":185 * """ * * if self.controller: # <<<<<<<<<<<<<< * return True * else: */ } /* "pygame_sdl2/controller.pyx":188 * return True * else: * return False # <<<<<<<<<<<<<< * * def get_axis(self, axis): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "pygame_sdl2/controller.pyx":180 * self.controller = NULL * * def get_init(self): # <<<<<<<<<<<<<< * """ * Returns true if the controller has been initialized, false otherwise. */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":190 * return False * * def get_axis(self, axis): # <<<<<<<<<<<<<< * """ * Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_10get_axis, "Controller.get_axis(self, axis)\n\n Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS\n constants.\n\n Axes return values from -32768 to 32678, triggers return 0 to 32768. 0 is\n returned on failure.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_11get_axis = {"get_axis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_10get_axis}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_axis = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_axis (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_axis,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_axis)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 190, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_axis") < 0)) __PYX_ERR(1, 190, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_axis = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_axis", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 190, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_10get_axis(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), __pyx_v_axis); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_10get_axis(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_axis) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; SDL_GameControllerAxis __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_axis", 1); /* "pygame_sdl2/controller.pyx":199 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ __pyx_t_1 = (__pyx_v_self->controller == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/controller.pyx":200 * * if self.controller == NULL: * raise error("controller not initialized.") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetAxis(self.controller, axis) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_controller_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 200, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":199 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ } /* "pygame_sdl2/controller.pyx":202 * raise error("controller not initialized.") * * return SDL_GameControllerGetAxis(self.controller, axis) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = ((SDL_GameControllerAxis)__Pyx_PyInt_As_SDL_GameControllerAxis(__pyx_v_axis)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 202, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_From_int16_t(SDL_GameControllerGetAxis(__pyx_v_self->controller, __pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":190 * return False * * def get_axis(self, axis): # <<<<<<<<<<<<<< * """ * Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":205 * * * def get_button(self, button): # <<<<<<<<<<<<<< * """ * Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_12get_button, "Controller.get_button(self, button)\n\n Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON\n constants.\n\n Returns 1 if the button is pressed, 0 if not or the button does not exist.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_13get_button = {"get_button", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_12get_button}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_button = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_button (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_button,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_button)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 205, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_button") < 0)) __PYX_ERR(1, 205, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_button = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_button", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 205, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_12get_button(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), __pyx_v_button); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_12get_button(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; SDL_GameControllerButton __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_button", 1); /* "pygame_sdl2/controller.pyx":213 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ __pyx_t_1 = (__pyx_v_self->controller == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/controller.pyx":214 * * if self.controller == NULL: * raise error("controller not initialized.") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetButton(self.controller, button) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_controller_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 214, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":213 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ } /* "pygame_sdl2/controller.pyx":216 * raise error("controller not initialized.") * * return SDL_GameControllerGetButton(self.controller, button) # <<<<<<<<<<<<<< * * def get_name(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = ((SDL_GameControllerButton)__Pyx_PyInt_As_SDL_GameControllerButton(__pyx_v_button)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 216, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_From_uint8_t(SDL_GameControllerGetButton(__pyx_v_self->controller, __pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":205 * * * def get_button(self, button): # <<<<<<<<<<<<<< * """ * Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":218 * return SDL_GameControllerGetButton(self.controller, button) * * def get_name(self): # <<<<<<<<<<<<<< * """ * Returns an implementation-dependent name for this game controller, */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_14get_name, "Controller.get_name(self)\n\n Returns an implementation-dependent name for this game controller,\n or None if no name could be found.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_15get_name = {"get_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_14get_name}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_name (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_name", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_name", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_14get_name(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_14get_name(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { char const *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_name", 1); /* "pygame_sdl2/controller.pyx":224 * """ * * cdef const char *rv = SDL_GameControllerNameForIndex(self.index) # <<<<<<<<<<<<<< * * if rv == NULL: */ __pyx_v_rv = SDL_GameControllerNameForIndex(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":226 * cdef const char *rv = SDL_GameControllerNameForIndex(self.index) * * if rv == NULL: # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = (__pyx_v_rv == NULL); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":227 * * if rv == NULL: * return None # <<<<<<<<<<<<<< * * return rv.decode("utf-8") */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/controller.pyx":226 * cdef const char *rv = SDL_GameControllerNameForIndex(self.index) * * if rv == NULL: # <<<<<<<<<<<<<< * return None * */ } /* "pygame_sdl2/controller.pyx":229 * return None * * return rv.decode("utf-8") # <<<<<<<<<<<<<< * * def is_controller(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_ssize_strlen(__pyx_v_rv); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 229, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_rv, 0, __pyx_t_2, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":218 * return SDL_GameControllerGetButton(self.controller, button) * * def get_name(self): # <<<<<<<<<<<<<< * """ * Returns an implementation-dependent name for this game controller, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":231 * return rv.decode("utf-8") * * def is_controller(self): # <<<<<<<<<<<<<< * """ * Returns true if this Controller object corresponds to a supported */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_16is_controller, "Controller.is_controller(self)\n\n Returns true if this Controller object corresponds to a supported\n game controller, or False otherwise.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_17is_controller = {"is_controller", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_16is_controller}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_controller (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_controller", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_controller", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_16is_controller(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_16is_controller(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_controller", 1); /* "pygame_sdl2/controller.pyx":237 * """ * * return SDL_IsGameController(self.index) # <<<<<<<<<<<<<< * * def get_guid_string(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_IsGameController(__pyx_v_self->index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":231 * return rv.decode("utf-8") * * def is_controller(self): # <<<<<<<<<<<<<< * """ * Returns true if this Controller object corresponds to a supported */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.is_controller", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":239 * return SDL_IsGameController(self.index) * * def get_guid_string(self): # <<<<<<<<<<<<<< * """ * Returns the guid string corresponding to this controller. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_18get_guid_string, "Controller.get_guid_string(self)\n\n Returns the guid string corresponding to this controller.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_19get_guid_string = {"get_guid_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_18get_guid_string}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_guid_string (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_guid_string", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_guid_string", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_18get_guid_string(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_18get_guid_string(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { SDL_JoystickGUID __pyx_v_guid; char __pyx_v_s[33]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_guid_string", 1); /* "pygame_sdl2/controller.pyx":247 * cdef char s[33] * * guid = SDL_JoystickGetDeviceGUID(self.index) # <<<<<<<<<<<<<< * SDL_JoystickGetGUIDString(guid, s, 33) * */ __pyx_v_guid = SDL_JoystickGetDeviceGUID(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":248 * * guid = SDL_JoystickGetDeviceGUID(self.index) * SDL_JoystickGetGUIDString(guid, s, 33) # <<<<<<<<<<<<<< * * return s.decode("utf-8") */ SDL_JoystickGetGUIDString(__pyx_v_guid, __pyx_v_s, 33); /* "pygame_sdl2/controller.pyx":250 * SDL_JoystickGetGUIDString(guid, s, 33) * * return s.decode("utf-8") # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_ssize_strlen(__pyx_v_s); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 250, __pyx_L1_error) __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_s, 0, __pyx_t_1, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":239 * return SDL_IsGameController(self.index) * * def get_guid_string(self): # <<<<<<<<<<<<<< * """ * Returns the guid string corresponding to this controller. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_guid_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":146 * cdef SDL_GameController *controller * cdef int index * cdef public int instance_id # <<<<<<<<<<<<<< * * def __cinit__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_11instance_id_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_11instance_id_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_11instance_id___get__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_11instance_id___get__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->instance_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.instance_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_11instance_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_11instance_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_11instance_id_2__set__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_10controller_10Controller_11instance_id_2__set__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 146, __pyx_L1_error) __pyx_v_self->instance_id = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.controller.Controller.instance_id.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_21__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_20__reduce_cython__, "Controller.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_21__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_20__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_21__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_20__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_23__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_10controller_10Controller_22__setstate_cython__, "Controller.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_10Controller_23__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_22__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_23__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_22__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_10controller_Controller(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_11pygame_sdl2_10controller_10Controller_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_10controller_Controller(PyObject *o) { struct __pyx_obj_11pygame_sdl2_10controller_Controller *p = (struct __pyx_obj_11pygame_sdl2_10controller_Controller *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_10controller_Controller) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_getprop_11pygame_sdl2_10controller_10Controller_instance_id(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_10controller_10Controller_11instance_id_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_10controller_10Controller_instance_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_10controller_10Controller_11instance_id_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_10controller_Controller[] = { {"init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_5init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_4init}, {"quit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_6quit}, {"get_init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_8get_init}, {"get_axis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_10get_axis}, {"get_button", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_12get_button}, {"get_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_14get_name}, {"is_controller", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_16is_controller}, {"get_guid_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_18get_guid_string}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_20__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_10controller_10Controller_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_10controller_10Controller_22__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_10controller_Controller[] = { {(char *)"instance_id", __pyx_getprop_11pygame_sdl2_10controller_10Controller_instance_id, __pyx_setprop_11pygame_sdl2_10controller_10Controller_instance_id, (char *)PyDoc_STR("instance_id: 'int'"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_10controller_Controller_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_10controller_Controller}, {Py_tp_doc, (void *)PyDoc_STR("Controller(index)")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_10controller_Controller}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_10controller_Controller}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_10controller_Controller}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_10controller_Controller_spec = { "pygame_sdl2.controller.Controller", sizeof(struct __pyx_obj_11pygame_sdl2_10controller_Controller), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_10controller_Controller_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_10controller_Controller = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.controller.""Controller", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_10controller_Controller), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_10controller_Controller, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Controller(index)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_10controller_Controller, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_10controller_Controller, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_10controller_Controller, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_Controller, __pyx_k_Controller, sizeof(__pyx_k_Controller), 0, 0, 1, 1}, {&__pyx_n_s_Controller___reduce_cython, __pyx_k_Controller___reduce_cython, sizeof(__pyx_k_Controller___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Controller___setstate_cython, __pyx_k_Controller___setstate_cython, sizeof(__pyx_k_Controller___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Controller_get_axis, __pyx_k_Controller_get_axis, sizeof(__pyx_k_Controller_get_axis), 0, 0, 1, 1}, {&__pyx_n_s_Controller_get_button, __pyx_k_Controller_get_button, sizeof(__pyx_k_Controller_get_button), 0, 0, 1, 1}, {&__pyx_n_s_Controller_get_guid_string, __pyx_k_Controller_get_guid_string, sizeof(__pyx_k_Controller_get_guid_string), 0, 0, 1, 1}, {&__pyx_n_s_Controller_get_init, __pyx_k_Controller_get_init, sizeof(__pyx_k_Controller_get_init), 0, 0, 1, 1}, {&__pyx_n_s_Controller_get_name, __pyx_k_Controller_get_name, sizeof(__pyx_k_Controller_get_name), 0, 0, 1, 1}, {&__pyx_n_s_Controller_init, __pyx_k_Controller_init, sizeof(__pyx_k_Controller_init), 0, 0, 1, 1}, {&__pyx_n_s_Controller_is_controller, __pyx_k_Controller_is_controller, sizeof(__pyx_k_Controller_is_controller), 0, 0, 1, 1}, {&__pyx_n_s_Controller_quit, __pyx_k_Controller_quit, sizeof(__pyx_k_Controller_quit), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, {&__pyx_n_s__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 1, 1}, {&__pyx_n_s_add_mapping, __pyx_k_add_mapping, sizeof(__pyx_k_add_mapping), 0, 0, 1, 1}, {&__pyx_n_s_add_mappings, __pyx_k_add_mappings, sizeof(__pyx_k_add_mappings), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, {&__pyx_n_s_button, __pyx_k_button, sizeof(__pyx_k_button), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_kp_s_controller_not_initialized, __pyx_k_controller_not_initialized, sizeof(__pyx_k_controller_not_initialized), 0, 0, 1, 0}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_axis, __pyx_k_get_axis, sizeof(__pyx_k_get_axis), 0, 0, 1, 1}, {&__pyx_n_s_get_axis_from_string, __pyx_k_get_axis_from_string, sizeof(__pyx_k_get_axis_from_string), 0, 0, 1, 1}, {&__pyx_n_s_get_button, __pyx_k_get_button, sizeof(__pyx_k_get_button), 0, 0, 1, 1}, {&__pyx_n_s_get_button_from_string, __pyx_k_get_button_from_string, sizeof(__pyx_k_get_button_from_string), 0, 0, 1, 1}, {&__pyx_n_s_get_count, __pyx_k_get_count, sizeof(__pyx_k_get_count), 0, 0, 1, 1}, {&__pyx_n_s_get_guid_string, __pyx_k_get_guid_string, sizeof(__pyx_k_get_guid_string), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_name, __pyx_k_get_name, sizeof(__pyx_k_get_name), 0, 0, 1, 1}, {&__pyx_n_s_get_string_for_axis, __pyx_k_get_string_for_axis, sizeof(__pyx_k_get_string_for_axis), 0, 0, 1, 1}, {&__pyx_n_s_get_string_for_button, __pyx_k_get_string_for_button, sizeof(__pyx_k_get_string_for_button), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_guid, __pyx_k_guid, sizeof(__pyx_k_guid), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_controller, __pyx_k_is_controller, sizeof(__pyx_k_is_controller), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_mapping, __pyx_k_mapping, sizeof(__pyx_k_mapping), 0, 0, 1, 1}, {&__pyx_n_s_mapping_file, __pyx_k_mapping_file, sizeof(__pyx_k_mapping_file), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_controller, __pyx_k_pygame_sdl2_controller, sizeof(__pyx_k_pygame_sdl2_controller), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_rwops, __pyx_k_rwops, sizeof(__pyx_k_rwops), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_k_src_pygame_sdl2_controller_pyx, sizeof(__pyx_k_src_pygame_sdl2_controller_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/controller.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * """ */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_init, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 25, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":36 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * """ */ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_quit, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(1, 36, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_init, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 44, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_count, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 51, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_mapping); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_add_mapping, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 66, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_mapping_file, __pyx_n_s_rwops); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_add_mappings, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 74, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_name); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_axis_from_string, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 91, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":102 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_button_from_string, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(1, 102, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":113 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_axis, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_string_for_axis, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 113, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":126 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_button, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_string_for_button, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 126, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":159 * self.index = index * * def init(self): # <<<<<<<<<<<<<< * """ * Opens the game controller, causing it to begin sending events. */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_init, 159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(1, 159, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":171 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Closes the game controller, preventing it from sending events. */ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_quit, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 171, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":180 * self.controller = NULL * * def get_init(self): # <<<<<<<<<<<<<< * """ * Returns true if the controller has been initialized, false otherwise. */ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_init, 180, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 180, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":190 * return False * * def get_axis(self, axis): # <<<<<<<<<<<<<< * """ * Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS */ __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_axis); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_axis, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 190, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":205 * * * def get_button(self, button): # <<<<<<<<<<<<<< * """ * Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON */ __pyx_tuple__24 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_button); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_button, 205, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 205, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":218 * return SDL_GameControllerGetButton(self.controller, button) * * def get_name(self): # <<<<<<<<<<<<<< * """ * Returns an implementation-dependent name for this game controller, */ __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_name, 218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(1, 218, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":231 * return rv.decode("utf-8") * * def is_controller(self): # <<<<<<<<<<<<<< * """ * Returns true if this Controller object corresponds to a supported */ __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_is_controller, 231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(1, 231, __pyx_L1_error) /* "pygame_sdl2/controller.pyx":239 * return SDL_IsGameController(self.index) * * def get_guid_string(self): # <<<<<<<<<<<<<< * """ * Returns the guid string corresponding to this controller. */ __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_guid, __pyx_n_s_s); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_guid_string, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(1, 239, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_10controller_Controller = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_10controller_Controller_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_10controller_Controller)) __PYX_ERR(1, 140, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_10controller_Controller_spec, __pyx_ptype_11pygame_sdl2_10controller_Controller) < 0) __PYX_ERR(1, 140, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_10controller_Controller = &__pyx_type_11pygame_sdl2_10controller_Controller; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_10controller_Controller) < 0) __PYX_ERR(1, 140, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_10controller_Controller->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_10controller_Controller->tp_dictoffset && __pyx_ptype_11pygame_sdl2_10controller_Controller->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_10controller_Controller->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 140, __pyx_L1_error) if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__.doc = __pyx_doc_11pygame_sdl2_10controller_10Controller_2__init__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__; } } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Controller, (PyObject *) __pyx_ptype_11pygame_sdl2_10controller_Controller) < 0) __PYX_ERR(1, 140, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_10controller_Controller->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_10controller_Controller->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_10controller_Controller, __weakref__); #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_10controller_Controller) < 0) __PYX_ERR(1, 140, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_controller(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_controller}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "controller", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initcontroller(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initcontroller(void) #else __Pyx_PyMODINIT_FUNC PyInit_controller(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_controller(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_controller(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'controller' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("controller", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "controller" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_controller(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__controller) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.controller")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.controller", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "pygame_sdl2/controller.pyx":20 * * from sdl2 cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(1, 20, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":21 * from sdl2 cimport * * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * from pygame_sdl2.rwobject cimport to_rwops */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * """ */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/controller.pyx":36 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * """ */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_3quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_5get_init, 0, __pyx_n_s_get_init, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(1, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_7get_count, 0, __pyx_n_s_get_count, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_count, __pyx_t_2) < 0) __PYX_ERR(1, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_9add_mapping, 0, __pyx_n_s_add_mapping, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_mapping, __pyx_t_2) < 0) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_11add_mappings, 0, __pyx_n_s_add_mappings, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_mappings, __pyx_t_2) < 0) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_13get_axis_from_string, 0, __pyx_n_s_get_axis_from_string, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_axis_from_string, __pyx_t_2) < 0) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":102 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_15get_button_from_string, 0, __pyx_n_s_get_button_from_string, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_button_from_string, __pyx_t_2) < 0) __PYX_ERR(1, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":113 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_17get_string_for_axis, 0, __pyx_n_s_get_string_for_axis, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_string_for_axis, __pyx_t_2) < 0) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":126 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_19get_string_for_button, 0, __pyx_n_s_get_string_for_button, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_string_for_button, __pyx_t_2) < 0) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":159 * self.index = index * * def init(self): # <<<<<<<<<<<<<< * """ * Opens the game controller, causing it to begin sending events. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_5init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_init, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(1, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":171 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Closes the game controller, preventing it from sending events. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_7quit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_quit, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":180 * self.controller = NULL * * def get_init(self): # <<<<<<<<<<<<<< * """ * Returns true if the controller has been initialized, false otherwise. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_9get_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_get_init, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(1, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":190 * return False * * def get_axis(self, axis): # <<<<<<<<<<<<<< * """ * Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_11get_axis, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_get_axis, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_get_axis, __pyx_t_2) < 0) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":205 * * * def get_button(self, button): # <<<<<<<<<<<<<< * """ * Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_13get_button, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_get_button, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_get_button, __pyx_t_2) < 0) __PYX_ERR(1, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":218 * return SDL_GameControllerGetButton(self.controller, button) * * def get_name(self): # <<<<<<<<<<<<<< * """ * Returns an implementation-dependent name for this game controller, */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_15get_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_get_name, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_get_name, __pyx_t_2) < 0) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":231 * return rv.decode("utf-8") * * def is_controller(self): # <<<<<<<<<<<<<< * """ * Returns true if this Controller object corresponds to a supported */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_17is_controller, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_is_controller, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_is_controller, __pyx_t_2) < 0) __PYX_ERR(1, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "pygame_sdl2/controller.pyx":239 * return SDL_IsGameController(self.index) * * def get_guid_string(self): # <<<<<<<<<<<<<< * """ * Returns the guid string corresponding to this controller. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_19get_guid_string, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller_get_guid_string, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_10controller_Controller, __pyx_n_s_get_guid_string, __pyx_t_2) < 0) __PYX_ERR(1, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_10controller_Controller); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_10controller_10Controller_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Controller___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_controller, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":1 * # Copyright 2015 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.controller", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.controller"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__2; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerAxis) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_GameControllerAxis) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerAxis) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerAxis), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_GameControllerAxis)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerButton) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_GameControllerButton) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerButton) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerButton), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_GameControllerButton)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE SDL_GameControllerAxis __Pyx_PyInt_As_SDL_GameControllerAxis(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SDL_GameControllerAxis) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_GameControllerAxis) val; } } #endif if (unlikely(!PyLong_Check(x))) { SDL_GameControllerAxis val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_GameControllerAxis) -1; val = __Pyx_PyInt_As_SDL_GameControllerAxis(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SDL_GameControllerAxis) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) >= 2 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) (((((SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0])); } } break; case 3: if ((8 * sizeof(SDL_GameControllerAxis) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) >= 3 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) (((((((SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0])); } } break; case 4: if ((8 * sizeof(SDL_GameControllerAxis) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) >= 4 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) (((((((((SDL_GameControllerAxis)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_GameControllerAxis) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SDL_GameControllerAxis) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_GameControllerAxis) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 2 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) (((SDL_GameControllerAxis)-1)*(((((SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case 2: if ((8 * sizeof(SDL_GameControllerAxis) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 2 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) ((((((SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case -3: if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 3 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) (((SDL_GameControllerAxis)-1)*(((((((SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case 3: if ((8 * sizeof(SDL_GameControllerAxis) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 3 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) ((((((((SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case -4: if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 4 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) (((SDL_GameControllerAxis)-1)*(((((((((SDL_GameControllerAxis)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case 4: if ((8 * sizeof(SDL_GameControllerAxis) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerAxis) - 1 > 4 * PyLong_SHIFT)) { return (SDL_GameControllerAxis) ((((((((((SDL_GameControllerAxis)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; } } #endif if ((sizeof(SDL_GameControllerAxis) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_GameControllerAxis) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { SDL_GameControllerAxis val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums"); val = (SDL_GameControllerAxis) -1; #endif if (unlikely(ret)) return (SDL_GameControllerAxis) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_GameControllerAxis"); return (SDL_GameControllerAxis) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_GameControllerAxis"); return (SDL_GameControllerAxis) -1; } /* CIntFromPy */ static CYTHON_INLINE SDL_GameControllerButton __Pyx_PyInt_As_SDL_GameControllerButton(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SDL_GameControllerButton) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_GameControllerButton) val; } } #endif if (unlikely(!PyLong_Check(x))) { SDL_GameControllerButton val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_GameControllerButton) -1; val = __Pyx_PyInt_As_SDL_GameControllerButton(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SDL_GameControllerButton) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) >= 2 * PyLong_SHIFT)) { return (SDL_GameControllerButton) (((((SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0])); } } break; case 3: if ((8 * sizeof(SDL_GameControllerButton) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) >= 3 * PyLong_SHIFT)) { return (SDL_GameControllerButton) (((((((SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0])); } } break; case 4: if ((8 * sizeof(SDL_GameControllerButton) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) >= 4 * PyLong_SHIFT)) { return (SDL_GameControllerButton) (((((((((SDL_GameControllerButton)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_GameControllerButton) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SDL_GameControllerButton) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_GameControllerButton) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SDL_GameControllerButton) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) - 1 > 2 * PyLong_SHIFT)) { return (SDL_GameControllerButton) (((SDL_GameControllerButton)-1)*(((((SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case 2: if ((8 * sizeof(SDL_GameControllerButton) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) - 1 > 2 * PyLong_SHIFT)) { return (SDL_GameControllerButton) ((((((SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case -3: if ((8 * sizeof(SDL_GameControllerButton) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) - 1 > 3 * PyLong_SHIFT)) { return (SDL_GameControllerButton) (((SDL_GameControllerButton)-1)*(((((((SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case 3: if ((8 * sizeof(SDL_GameControllerButton) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) - 1 > 3 * PyLong_SHIFT)) { return (SDL_GameControllerButton) ((((((((SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case -4: if ((8 * sizeof(SDL_GameControllerButton) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) - 1 > 4 * PyLong_SHIFT)) { return (SDL_GameControllerButton) (((SDL_GameControllerButton)-1)*(((((((((SDL_GameControllerButton)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case 4: if ((8 * sizeof(SDL_GameControllerButton) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GameControllerButton) - 1 > 4 * PyLong_SHIFT)) { return (SDL_GameControllerButton) ((((((((((SDL_GameControllerButton)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; } } #endif if ((sizeof(SDL_GameControllerButton) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_GameControllerButton) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { SDL_GameControllerButton val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums"); val = (SDL_GameControllerButton) -1; #endif if (unlikely(ret)) return (SDL_GameControllerButton) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_GameControllerButton"); return (SDL_GameControllerButton) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_GameControllerButton"); return (SDL_GameControllerButton) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int16_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int16_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_bool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_bool) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_bool), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_bool)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__34); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12 #define __PYX_HAVE_RT_ImportFunction_3_0_12 static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635909.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.display.c0000664000175000017500000431766615026112605020563 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__display #define __PYX_HAVE_API__pygame_sdl2__display /* Early includes */ #include #include #include #include #include "SDL.h" #include #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/display.pyx", "", "src/pygame_sdl2/display.pxd", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/rect.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; struct __pyx_defaults; typedef struct __pyx_defaults __pyx_defaults; struct __pyx_defaults { PyObject *__pyx_arg_pos; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* PyObject_Str.proto */ #define __Pyx_PyObject_Str(obj)\ (likely(PyString_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 #define __PYX_HAVE_RT_ImportType_proto_3_0_12 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_12 { __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_HintPriority __Pyx_PyInt_As_SDL_HintPriority(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_GLattr __Pyx_PyInt_As_SDL_GLattr(PyObject *); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* VoidPtrExport.proto */ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.rect" */ static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from "libc.stdlib" */ /* Module declarations from "pygame_sdl2.display" */ static struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_11pygame_sdl2_7display_main_window = 0; static SDL_Window *__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow(PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.display" extern int __pyx_module_is_main_pygame_sdl2__display; int __pyx_module_is_main_pygame_sdl2__display = 0; /* Implementation of "pygame_sdl2.display" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_0[] = "0"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_t[] = "t"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__6[] = "*"; static const char __pyx_k__7[] = "."; static const char __pyx_k_dm[] = "dm"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_hw[] = "hw"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k_wm[] = "wm"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_err[] = "err"; static const char __pyx_k_ios[] = "ios"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_red[] = "red"; static const char __pyx_k_Info[] = "Info"; static const char __pyx_k__116[] = "?"; static const char __pyx_k_blue[] = "blue"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_flag[] = "flag"; static const char __pyx_k_flip[] = "flip"; static const char __pyx_k_hint[] = "hint"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_count[] = "count"; static const char __pyx_k_depth[] = "depth"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_event[] = "event"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_green[] = "green"; static const char __pyx_k_index[] = "index"; static const char __pyx_k_masks[] = "masks"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_rects[] = "rects"; static const char __pyx_k_shape[] = "shape"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_title[] = "title"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_Info_r[] = ""; static const char __pyx_k_Window[] = "Window"; static const char __pyx_k_always[] = "always"; static const char __pyx_k_ctypes[] = "ctypes"; static const char __pyx_k_driver[] = "driver"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_height[] = "height"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_init_2[] = "__init__"; static const char __pyx_k_losses[] = "losses"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_opengl[] = "opengl"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_resize[] = "resize"; static const char __pyx_k_shifts[] = "shifts"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_bitsize[] = "bitsize"; static const char __pyx_k_blit_hw[] = "blit_hw"; static const char __pyx_k_blit_sw[] = "blit_sw"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_destroy[] = "destroy"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_environ[] = "environ"; static const char __pyx_k_iconify[] = "iconify"; static const char __pyx_k_mode_ok[] = "mode_ok"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_restore[] = "restore"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_SRCALPHA[] = "SRCALPHA"; static const char __pyx_k_bytesize[] = "bytesize"; static const char __pyx_k_c_void_p[] = "c_void_p"; static const char __pyx_k_get_hint[] = "_get_hint"; static const char __pyx_k_get_init[] = "get_init"; static const char __pyx_k_get_size[] = "get_size"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_maximize[] = "maximize"; static const char __pyx_k_minimize[] = "minimize"; static const char __pyx_k_priority[] = "priority"; static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_icon[] = "set_icon"; static const char __pyx_k_set_mode[] = "set_mode"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_warnings[] = "warnings"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_blit_hw_A[] = "blit_hw_A"; static const char __pyx_k_blit_sw_A[] = "blit_sw_A"; static const char __pyx_k_cur_width[] = "cur_width"; static const char __pyx_k_current_h[] = "current_h"; static const char __pyx_k_current_w[] = "current_w"; static const char __pyx_k_icontitle[] = "icontitle"; static const char __pyx_k_init_done[] = "init_done"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_main_done[] = "main_done"; static const char __pyx_k_maximized[] = "maximized"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_num_modes[] = "num_modes"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_red_gamma[] = "red_gamma"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_set_gamma[] = "set_gamma"; static const char __pyx_k_video_mem[] = "video_mem"; static const char __pyx_k_PYGAME_IOS[] = "PYGAME_IOS"; static const char __pyx_k_blit_hw_CC[] = "blit_hw_CC"; static const char __pyx_k_blit_sw_CC[] = "blit_sw_CC"; static const char __pyx_k_blue_gamma[] = "blue_gamma"; static const char __pyx_k_cur_height[] = "cur_height"; static const char __pyx_k_fullscreen[] = "fullscreen"; static const char __pyx_k_get_active[] = "get_active"; static const char __pyx_k_get_driver[] = "get_driver"; static const char __pyx_k_get_window[] = "get_window"; static const char __pyx_k_list_modes[] = "list_modes"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_rectangles[] = "rectangles"; static const char __pyx_k_resolution[] = "resolution"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_Info___init[] = "Info.__init__"; static const char __pyx_k_Info___repr[] = "Info.__repr__"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_PYGAME_SDL2[] = "PYGAME_SDL2"; static const char __pyx_k_Window_flip[] = "Window.flip"; static const char __pyx_k_get_caption[] = "get_caption"; static const char __pyx_k_get_surface[] = "get_surface"; static const char __pyx_k_get_wm_info[] = "get_wm_info"; static const char __pyx_k_green_gamma[] = "green_gamma"; static const char __pyx_k_main_window[] = "main_window"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_set_caption[] = "set_caption"; static const char __pyx_k_RESIZE_FLAGS[] = "RESIZE_FLAGS"; static const char __pyx_k_androidembed[] = "androidembed"; static const char __pyx_k_default_icon[] = "default_icon"; static const char __pyx_k_get_platform[] = "get_platform"; static const char __pyx_k_get_position[] = "get_position"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_pygame_hints[] = "_pygame_hints"; static const char __pyx_k_refresh_rate[] = "refresh_rate"; static const char __pyx_k_set_position[] = "set_position"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_Window_resize[] = "Window.resize"; static const char __pyx_k_Window_update[] = "Window.update"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_default_title[] = "default_title"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_pygame_window[] = "pygame window"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_sdl_main_init[] = "sdl_main_init"; static const char __pyx_k_Window_destroy[] = "Window.destroy"; static const char __pyx_k_Window_iconify[] = "Window.iconify"; static const char __pyx_k_Window_restore[] = "Window.restore"; static const char __pyx_k_create_surface[] = "create_surface"; static const char __pyx_k_set_gamma_ramp[] = "set_gamma_ramp"; static const char __pyx_k_GL_SWAP_CONTROL[] = "GL_SWAP_CONTROL"; static const char __pyx_k_Window_get_size[] = "Window.get_size"; static const char __pyx_k_Window_maximize[] = "Window.maximize"; static const char __pyx_k_Window_minimize[] = "Window.minimize"; static const char __pyx_k_Window_set_icon[] = "Window.set_icon"; static const char __pyx_k_gl_load_library[] = "gl_load_library"; static const char __pyx_k_set_screensaver[] = "set_screensaver"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Window_set_gamma[] = "Window.set_gamma"; static const char __pyx_k_get_window_flags[] = "get_window_flags"; static const char __pyx_k_gl_get_attribute[] = "gl_get_attribute"; static const char __pyx_k_gl_set_attribute[] = "gl_set_attribute"; static const char __pyx_k_Window_get_active[] = "Window.get_active"; static const char __pyx_k_get_drawable_size[] = "get_drawable_size"; static const char __pyx_k_gl_unload_library[] = "gl_unload_library"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_toggle_fullscreen[] = "toggle_fullscreen"; static const char __pyx_k_Window_get_surface[] = "Window.get_surface"; static const char __pyx_k_Window_get_wm_info[] = "Window.get_wm_info"; static const char __pyx_k_Window_set_caption[] = "Window.set_caption"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_get_display_bounds[] = "get_display_bounds"; static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static const char __pyx_k_Window_get_position[] = "Window.get_position"; static const char __pyx_k_Window_set_position[] = "Window.set_position"; static const char __pyx_k_gl_reset_attributes[] = "gl_reset_attributes"; static const char __pyx_k_pygame_sdl2_display[] = "pygame_sdl2.display"; static const char __pyx_k_recreate_gl_context[] = "recreate_gl_context"; static const char __pyx_k_PYGAME_SDL2_AVOID_GL[] = "PYGAME_SDL2_AVOID_GL"; static const char __pyx_k_default_swap_control[] = "default_swap_control"; static const char __pyx_k_proxy_window_surface[] = "proxy_window_surface"; static const char __pyx_k_Window_create_surface[] = "Window.create_surface"; static const char __pyx_k_Window_set_gamma_ramp[] = "Window.set_gamma_ramp"; static const char __pyx_k_Window___reduce_cython[] = "Window.__reduce_cython__"; static const char __pyx_k_get_num_video_displays[] = "get_num_video_displays"; static const char __pyx_k_get_sdl_window_pointer[] = "get_sdl_window_pointer"; static const char __pyx_k_Window_get_window_flags[] = "Window.get_window_flags"; static const char __pyx_k_Window___setstate_cython[] = "Window.__setstate_cython__"; static const char __pyx_k_Window_get_drawable_size[] = "Window.get_drawable_size"; static const char __pyx_k_Window_toggle_fullscreen[] = "Window.toggle_fullscreen"; static const char __pyx_k_Window_recreate_gl_context[] = "Window.recreate_gl_context"; static const char __pyx_k_Window_proxy_window_surface[] = "Window.proxy_window_surface"; static const char __pyx_k_src_pygame_sdl2_display_pyx[] = "src/pygame_sdl2/display.pyx"; static const char __pyx_k_Couldn_t_allocate_rectangles[] = "Couldn't allocate rectangles."; static const char __pyx_k_Window_get_sdl_window_pointer[] = "Window.get_sdl_window_pointer"; static const char __pyx_k_self_gl_context_self_window_self[] = "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_7display_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_value, PyObject *__pyx_v_priority); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_2_get_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_4sdl_main_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_8quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_10get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_7display_6Window___init__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth, PyObject *__pyx_v_pos, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_shape); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_4destroy(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_6resize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_opengl, PyObject *__pyx_v_fullscreen, PyObject *__pyx_v_maximized); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_8recreate_gl_context(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_always); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_10get_window_flags(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_12proxy_window_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_14flip(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_16get_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_18update(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_rectangles); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_20get_wm_info(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_22get_active(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_24iconify(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_26toggle_fullscreen(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_28set_gamma(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_30set_gamma_ramp(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_32set_icon(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_34set_caption(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_36get_drawable_size(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_38get_size(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_40restore(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_42maximize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_44minimize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48get_position(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_50set_position(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_52__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_54__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_76__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_14destroy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_16get_surface(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_18get_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_20flip(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_22update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rectangles); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_24get_driver(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_26get_wm_info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_28get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_30list_modes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_depth, CYTHON_UNUSED PyObject *__pyx_v_flags, PyObject *__pyx_v_display); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_32mode_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_34gl_reset_attributes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_36gl_set_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_38gl_get_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_40gl_load_library(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_42gl_unload_library(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_44get_active(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_46iconify(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_48toggle_fullscreen(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_50set_gamma(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_52set_gamma_ramp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_54set_icon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_56set_caption(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_title, CYTHON_UNUSED PyObject *__pyx_v_icontitle); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_58get_caption(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_60get_drawable_size(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_62get_size(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_64get_position(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_66set_position(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_68get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_70get_display_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_72set_screensaver(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_74get_platform(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_7display_Window(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_7display_Window; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window; PyObject *__pyx_kp_s_0; PyObject *__pyx_kp_s_Couldn_t_allocate_rectangles; PyObject *__pyx_n_s_GL_SWAP_CONTROL; PyObject *__pyx_n_s_ImportError; PyObject *__pyx_n_s_Info; PyObject *__pyx_n_s_Info___init; PyObject *__pyx_n_s_Info___repr; PyObject *__pyx_kp_s_Info_r; PyObject *__pyx_n_s_MemoryError; PyObject *__pyx_n_s_PYGAME_IOS; PyObject *__pyx_n_s_PYGAME_SDL2; PyObject *__pyx_n_s_PYGAME_SDL2_AVOID_GL; PyObject *__pyx_n_s_RESIZE_FLAGS; PyObject *__pyx_n_s_SRCALPHA; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_Window; PyObject *__pyx_n_s_Window___reduce_cython; PyObject *__pyx_n_s_Window___setstate_cython; PyObject *__pyx_n_s_Window_create_surface; PyObject *__pyx_n_s_Window_destroy; PyObject *__pyx_n_s_Window_flip; PyObject *__pyx_n_s_Window_get_active; PyObject *__pyx_n_s_Window_get_drawable_size; PyObject *__pyx_n_s_Window_get_position; PyObject *__pyx_n_s_Window_get_sdl_window_pointer; PyObject *__pyx_n_s_Window_get_size; PyObject *__pyx_n_s_Window_get_surface; PyObject *__pyx_n_s_Window_get_window_flags; PyObject *__pyx_n_s_Window_get_wm_info; PyObject *__pyx_n_s_Window_iconify; PyObject *__pyx_n_s_Window_maximize; PyObject *__pyx_n_s_Window_minimize; PyObject *__pyx_n_s_Window_proxy_window_surface; PyObject *__pyx_n_s_Window_recreate_gl_context; PyObject *__pyx_n_s_Window_resize; PyObject *__pyx_n_s_Window_restore; PyObject *__pyx_n_s_Window_set_caption; PyObject *__pyx_n_s_Window_set_gamma; PyObject *__pyx_n_s_Window_set_gamma_ramp; PyObject *__pyx_n_s_Window_set_icon; PyObject *__pyx_n_s_Window_set_position; PyObject *__pyx_n_s_Window_toggle_fullscreen; PyObject *__pyx_n_s_Window_update; PyObject *__pyx_n_s__116; PyObject *__pyx_n_s__6; PyObject *__pyx_kp_u__7; PyObject *__pyx_n_s_always; PyObject *__pyx_n_s_androidembed; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_bitsize; PyObject *__pyx_n_s_blit_hw; PyObject *__pyx_n_s_blit_hw_A; PyObject *__pyx_n_s_blit_hw_CC; PyObject *__pyx_n_s_blit_sw; PyObject *__pyx_n_s_blit_sw_A; PyObject *__pyx_n_s_blit_sw_CC; PyObject *__pyx_n_s_blue; PyObject *__pyx_n_s_blue_gamma; PyObject *__pyx_n_s_bytesize; PyObject *__pyx_n_s_c_void_p; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_copy; PyObject *__pyx_n_s_count; PyObject *__pyx_n_s_create_surface; PyObject *__pyx_n_s_ctypes; PyObject *__pyx_n_s_cur_height; PyObject *__pyx_n_s_cur_width; PyObject *__pyx_n_s_current_h; PyObject *__pyx_n_s_current_w; PyObject *__pyx_n_s_default; PyObject *__pyx_n_s_default_icon; PyObject *__pyx_n_s_default_swap_control; PyObject *__pyx_n_s_default_title; PyObject *__pyx_n_s_depth; PyObject *__pyx_n_s_destroy; PyObject *__pyx_n_s_dict; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_display; PyObject *__pyx_n_s_dm; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_driver; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_environ; PyObject *__pyx_n_s_err; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_event; PyObject *__pyx_n_s_flag; PyObject *__pyx_n_s_flags; PyObject *__pyx_n_s_flip; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_fullscreen; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_active; PyObject *__pyx_n_s_get_caption; PyObject *__pyx_n_s_get_display_bounds; PyObject *__pyx_n_s_get_drawable_size; PyObject *__pyx_n_s_get_driver; PyObject *__pyx_n_s_get_hint; PyObject *__pyx_n_s_get_init; PyObject *__pyx_n_s_get_num_video_displays; PyObject *__pyx_n_s_get_platform; PyObject *__pyx_n_s_get_position; PyObject *__pyx_n_s_get_sdl_window_pointer; PyObject *__pyx_n_s_get_size; PyObject *__pyx_n_s_get_surface; PyObject *__pyx_n_s_get_window; PyObject *__pyx_n_s_get_window_flags; PyObject *__pyx_n_s_get_wm_info; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_gl_get_attribute; PyObject *__pyx_n_s_gl_load_library; PyObject *__pyx_n_s_gl_reset_attributes; PyObject *__pyx_n_s_gl_set_attribute; PyObject *__pyx_n_s_gl_unload_library; PyObject *__pyx_n_s_green; PyObject *__pyx_n_s_green_gamma; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_height; PyObject *__pyx_n_s_hint; PyObject *__pyx_n_s_hw; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_iconify; PyObject *__pyx_n_s_icontitle; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_index; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_2; PyObject *__pyx_n_s_init_done; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_ios; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_list_modes; PyObject *__pyx_n_s_losses; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_main_done; PyObject *__pyx_n_s_main_window; PyObject *__pyx_n_s_masks; PyObject *__pyx_n_s_maximize; PyObject *__pyx_n_s_maximized; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_minimize; PyObject *__pyx_n_s_mode; PyObject *__pyx_n_s_mode_ok; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_num_modes; PyObject *__pyx_n_s_object; PyObject *__pyx_n_s_opengl; PyObject *__pyx_n_s_os; PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_priority; PyObject *__pyx_n_s_proxy_window_surface; PyObject *__pyx_n_s_pygame_hints; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_display; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_locals; PyObject *__pyx_kp_s_pygame_window; PyObject *__pyx_n_s_pyx_capi; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_range; PyObject *__pyx_n_s_recreate_gl_context; PyObject *__pyx_n_s_rect; PyObject *__pyx_n_s_rectangles; PyObject *__pyx_n_s_rects; PyObject *__pyx_n_s_red; PyObject *__pyx_n_s_red_gamma; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_refresh_rate; PyObject *__pyx_n_s_register_init; PyObject *__pyx_n_s_register_quit; PyObject *__pyx_n_s_repr; PyObject *__pyx_n_s_resize; PyObject *__pyx_n_s_resolution; PyObject *__pyx_n_s_restore; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_sdl_main_init; PyObject *__pyx_n_s_self; PyObject *__pyx_kp_s_self_gl_context_self_window_self; PyObject *__pyx_n_s_set_caption; PyObject *__pyx_n_s_set_gamma; PyObject *__pyx_n_s_set_gamma_ramp; PyObject *__pyx_n_s_set_icon; PyObject *__pyx_n_s_set_mode; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_set_position; PyObject *__pyx_n_s_set_screensaver; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_shape; PyObject *__pyx_n_s_shifts; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_display_pyx; PyObject *__pyx_n_s_startswith; PyObject *__pyx_n_s_state; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_t; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_title; PyObject *__pyx_n_s_toggle_fullscreen; PyObject *__pyx_n_s_update; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_video_mem; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_warnings; PyObject *__pyx_n_s_width; PyObject *__pyx_n_s_wm; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_y; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_32; PyObject *__pyx_int_268435456; PyObject *__pyx_k__2; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__26; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__33; PyObject *__pyx_tuple__35; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__42; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__45; PyObject *__pyx_tuple__47; PyObject *__pyx_tuple__54; PyObject *__pyx_tuple__56; PyObject *__pyx_tuple__58; PyObject *__pyx_tuple__61; PyObject *__pyx_tuple__63; PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__71; PyObject *__pyx_tuple__73; PyObject *__pyx_tuple__74; PyObject *__pyx_tuple__75; PyObject *__pyx_tuple__79; PyObject *__pyx_tuple__81; PyObject *__pyx_tuple__83; PyObject *__pyx_tuple__84; PyObject *__pyx_tuple__87; PyObject *__pyx_tuple__89; PyObject *__pyx_tuple__91; PyObject *__pyx_tuple__97; PyObject *__pyx_codeobj__9; PyObject *__pyx_tuple__100; PyObject *__pyx_tuple__102; PyObject *__pyx_tuple__108; PyObject *__pyx_tuple__111; PyObject *__pyx_tuple__113; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__31; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__37; PyObject *__pyx_codeobj__38; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__48; PyObject *__pyx_codeobj__49; PyObject *__pyx_codeobj__50; PyObject *__pyx_codeobj__51; PyObject *__pyx_codeobj__52; PyObject *__pyx_codeobj__53; PyObject *__pyx_codeobj__55; PyObject *__pyx_codeobj__57; PyObject *__pyx_codeobj__59; PyObject *__pyx_codeobj__60; PyObject *__pyx_codeobj__62; PyObject *__pyx_codeobj__64; PyObject *__pyx_codeobj__65; PyObject *__pyx_codeobj__66; PyObject *__pyx_codeobj__67; PyObject *__pyx_codeobj__68; PyObject *__pyx_codeobj__70; PyObject *__pyx_codeobj__72; PyObject *__pyx_codeobj__76; PyObject *__pyx_codeobj__77; PyObject *__pyx_codeobj__78; PyObject *__pyx_codeobj__80; PyObject *__pyx_codeobj__82; PyObject *__pyx_codeobj__85; PyObject *__pyx_codeobj__86; PyObject *__pyx_codeobj__88; PyObject *__pyx_codeobj__90; PyObject *__pyx_codeobj__92; PyObject *__pyx_codeobj__93; PyObject *__pyx_codeobj__94; PyObject *__pyx_codeobj__95; PyObject *__pyx_codeobj__96; PyObject *__pyx_codeobj__98; PyObject *__pyx_codeobj__99; PyObject *__pyx_codeobj__101; PyObject *__pyx_codeobj__103; PyObject *__pyx_codeobj__104; PyObject *__pyx_codeobj__105; PyObject *__pyx_codeobj__106; PyObject *__pyx_codeobj__107; PyObject *__pyx_codeobj__109; PyObject *__pyx_codeobj__110; PyObject *__pyx_codeobj__112; PyObject *__pyx_codeobj__114; PyObject *__pyx_codeobj__115; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_7display_Window); Py_CLEAR(clear_module_state->__pyx_kp_s_0); Py_CLEAR(clear_module_state->__pyx_kp_s_Couldn_t_allocate_rectangles); Py_CLEAR(clear_module_state->__pyx_n_s_GL_SWAP_CONTROL); Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); Py_CLEAR(clear_module_state->__pyx_n_s_Info); Py_CLEAR(clear_module_state->__pyx_n_s_Info___init); Py_CLEAR(clear_module_state->__pyx_n_s_Info___repr); Py_CLEAR(clear_module_state->__pyx_kp_s_Info_r); Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); Py_CLEAR(clear_module_state->__pyx_n_s_PYGAME_IOS); Py_CLEAR(clear_module_state->__pyx_n_s_PYGAME_SDL2); Py_CLEAR(clear_module_state->__pyx_n_s_PYGAME_SDL2_AVOID_GL); Py_CLEAR(clear_module_state->__pyx_n_s_RESIZE_FLAGS); Py_CLEAR(clear_module_state->__pyx_n_s_SRCALPHA); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_Window); Py_CLEAR(clear_module_state->__pyx_n_s_Window___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Window___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Window_create_surface); Py_CLEAR(clear_module_state->__pyx_n_s_Window_destroy); Py_CLEAR(clear_module_state->__pyx_n_s_Window_flip); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_active); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_drawable_size); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_position); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_sdl_window_pointer); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_size); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_surface); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_window_flags); Py_CLEAR(clear_module_state->__pyx_n_s_Window_get_wm_info); Py_CLEAR(clear_module_state->__pyx_n_s_Window_iconify); Py_CLEAR(clear_module_state->__pyx_n_s_Window_maximize); Py_CLEAR(clear_module_state->__pyx_n_s_Window_minimize); Py_CLEAR(clear_module_state->__pyx_n_s_Window_proxy_window_surface); Py_CLEAR(clear_module_state->__pyx_n_s_Window_recreate_gl_context); Py_CLEAR(clear_module_state->__pyx_n_s_Window_resize); Py_CLEAR(clear_module_state->__pyx_n_s_Window_restore); Py_CLEAR(clear_module_state->__pyx_n_s_Window_set_caption); Py_CLEAR(clear_module_state->__pyx_n_s_Window_set_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_Window_set_gamma_ramp); Py_CLEAR(clear_module_state->__pyx_n_s_Window_set_icon); Py_CLEAR(clear_module_state->__pyx_n_s_Window_set_position); Py_CLEAR(clear_module_state->__pyx_n_s_Window_toggle_fullscreen); Py_CLEAR(clear_module_state->__pyx_n_s_Window_update); Py_CLEAR(clear_module_state->__pyx_n_s__116); Py_CLEAR(clear_module_state->__pyx_n_s__6); Py_CLEAR(clear_module_state->__pyx_kp_u__7); Py_CLEAR(clear_module_state->__pyx_n_s_always); Py_CLEAR(clear_module_state->__pyx_n_s_androidembed); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_bitsize); Py_CLEAR(clear_module_state->__pyx_n_s_blit_hw); Py_CLEAR(clear_module_state->__pyx_n_s_blit_hw_A); Py_CLEAR(clear_module_state->__pyx_n_s_blit_hw_CC); Py_CLEAR(clear_module_state->__pyx_n_s_blit_sw); Py_CLEAR(clear_module_state->__pyx_n_s_blit_sw_A); Py_CLEAR(clear_module_state->__pyx_n_s_blit_sw_CC); Py_CLEAR(clear_module_state->__pyx_n_s_blue); Py_CLEAR(clear_module_state->__pyx_n_s_blue_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_bytesize); Py_CLEAR(clear_module_state->__pyx_n_s_c_void_p); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_copy); Py_CLEAR(clear_module_state->__pyx_n_s_count); Py_CLEAR(clear_module_state->__pyx_n_s_create_surface); Py_CLEAR(clear_module_state->__pyx_n_s_ctypes); Py_CLEAR(clear_module_state->__pyx_n_s_cur_height); Py_CLEAR(clear_module_state->__pyx_n_s_cur_width); Py_CLEAR(clear_module_state->__pyx_n_s_current_h); Py_CLEAR(clear_module_state->__pyx_n_s_current_w); Py_CLEAR(clear_module_state->__pyx_n_s_default); Py_CLEAR(clear_module_state->__pyx_n_s_default_icon); Py_CLEAR(clear_module_state->__pyx_n_s_default_swap_control); Py_CLEAR(clear_module_state->__pyx_n_s_default_title); Py_CLEAR(clear_module_state->__pyx_n_s_depth); Py_CLEAR(clear_module_state->__pyx_n_s_destroy); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_display); Py_CLEAR(clear_module_state->__pyx_n_s_dm); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_driver); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_environ); Py_CLEAR(clear_module_state->__pyx_n_s_err); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_event); Py_CLEAR(clear_module_state->__pyx_n_s_flag); Py_CLEAR(clear_module_state->__pyx_n_s_flags); Py_CLEAR(clear_module_state->__pyx_n_s_flip); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_fullscreen); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_active); Py_CLEAR(clear_module_state->__pyx_n_s_get_caption); Py_CLEAR(clear_module_state->__pyx_n_s_get_display_bounds); Py_CLEAR(clear_module_state->__pyx_n_s_get_drawable_size); Py_CLEAR(clear_module_state->__pyx_n_s_get_driver); Py_CLEAR(clear_module_state->__pyx_n_s_get_hint); Py_CLEAR(clear_module_state->__pyx_n_s_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_get_num_video_displays); Py_CLEAR(clear_module_state->__pyx_n_s_get_platform); Py_CLEAR(clear_module_state->__pyx_n_s_get_position); Py_CLEAR(clear_module_state->__pyx_n_s_get_sdl_window_pointer); Py_CLEAR(clear_module_state->__pyx_n_s_get_size); Py_CLEAR(clear_module_state->__pyx_n_s_get_surface); Py_CLEAR(clear_module_state->__pyx_n_s_get_window); Py_CLEAR(clear_module_state->__pyx_n_s_get_window_flags); Py_CLEAR(clear_module_state->__pyx_n_s_get_wm_info); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_gl_get_attribute); Py_CLEAR(clear_module_state->__pyx_n_s_gl_load_library); Py_CLEAR(clear_module_state->__pyx_n_s_gl_reset_attributes); Py_CLEAR(clear_module_state->__pyx_n_s_gl_set_attribute); Py_CLEAR(clear_module_state->__pyx_n_s_gl_unload_library); Py_CLEAR(clear_module_state->__pyx_n_s_green); Py_CLEAR(clear_module_state->__pyx_n_s_green_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_height); Py_CLEAR(clear_module_state->__pyx_n_s_hint); Py_CLEAR(clear_module_state->__pyx_n_s_hw); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_iconify); Py_CLEAR(clear_module_state->__pyx_n_s_icontitle); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_index); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_2); Py_CLEAR(clear_module_state->__pyx_n_s_init_done); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_ios); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_list_modes); Py_CLEAR(clear_module_state->__pyx_n_s_losses); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_main_done); Py_CLEAR(clear_module_state->__pyx_n_s_main_window); Py_CLEAR(clear_module_state->__pyx_n_s_masks); Py_CLEAR(clear_module_state->__pyx_n_s_maximize); Py_CLEAR(clear_module_state->__pyx_n_s_maximized); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_minimize); Py_CLEAR(clear_module_state->__pyx_n_s_mode); Py_CLEAR(clear_module_state->__pyx_n_s_mode_ok); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_num_modes); Py_CLEAR(clear_module_state->__pyx_n_s_object); Py_CLEAR(clear_module_state->__pyx_n_s_opengl); Py_CLEAR(clear_module_state->__pyx_n_s_os); Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_priority); Py_CLEAR(clear_module_state->__pyx_n_s_proxy_window_surface); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_hints); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_display); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_locals); Py_CLEAR(clear_module_state->__pyx_kp_s_pygame_window); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_capi); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_s_recreate_gl_context); Py_CLEAR(clear_module_state->__pyx_n_s_rect); Py_CLEAR(clear_module_state->__pyx_n_s_rectangles); Py_CLEAR(clear_module_state->__pyx_n_s_rects); Py_CLEAR(clear_module_state->__pyx_n_s_red); Py_CLEAR(clear_module_state->__pyx_n_s_red_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_refresh_rate); Py_CLEAR(clear_module_state->__pyx_n_s_register_init); Py_CLEAR(clear_module_state->__pyx_n_s_register_quit); Py_CLEAR(clear_module_state->__pyx_n_s_repr); Py_CLEAR(clear_module_state->__pyx_n_s_resize); Py_CLEAR(clear_module_state->__pyx_n_s_resolution); Py_CLEAR(clear_module_state->__pyx_n_s_restore); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_main_init); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_kp_s_self_gl_context_self_window_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_caption); Py_CLEAR(clear_module_state->__pyx_n_s_set_gamma); Py_CLEAR(clear_module_state->__pyx_n_s_set_gamma_ramp); Py_CLEAR(clear_module_state->__pyx_n_s_set_icon); Py_CLEAR(clear_module_state->__pyx_n_s_set_mode); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_set_position); Py_CLEAR(clear_module_state->__pyx_n_s_set_screensaver); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_shape); Py_CLEAR(clear_module_state->__pyx_n_s_shifts); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_display_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_startswith); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_t); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_title); Py_CLEAR(clear_module_state->__pyx_n_s_toggle_fullscreen); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_video_mem); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_warnings); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_n_s_wm); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_32); Py_CLEAR(clear_module_state->__pyx_int_268435456); Py_CLEAR(clear_module_state->__pyx_k__2); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__26); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__33); Py_CLEAR(clear_module_state->__pyx_tuple__35); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__42); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_tuple__47); Py_CLEAR(clear_module_state->__pyx_tuple__54); Py_CLEAR(clear_module_state->__pyx_tuple__56); Py_CLEAR(clear_module_state->__pyx_tuple__58); Py_CLEAR(clear_module_state->__pyx_tuple__61); Py_CLEAR(clear_module_state->__pyx_tuple__63); Py_CLEAR(clear_module_state->__pyx_tuple__69); Py_CLEAR(clear_module_state->__pyx_tuple__71); Py_CLEAR(clear_module_state->__pyx_tuple__73); Py_CLEAR(clear_module_state->__pyx_tuple__74); Py_CLEAR(clear_module_state->__pyx_tuple__75); Py_CLEAR(clear_module_state->__pyx_tuple__79); Py_CLEAR(clear_module_state->__pyx_tuple__81); Py_CLEAR(clear_module_state->__pyx_tuple__83); Py_CLEAR(clear_module_state->__pyx_tuple__84); Py_CLEAR(clear_module_state->__pyx_tuple__87); Py_CLEAR(clear_module_state->__pyx_tuple__89); Py_CLEAR(clear_module_state->__pyx_tuple__91); Py_CLEAR(clear_module_state->__pyx_tuple__97); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_tuple__100); Py_CLEAR(clear_module_state->__pyx_tuple__102); Py_CLEAR(clear_module_state->__pyx_tuple__108); Py_CLEAR(clear_module_state->__pyx_tuple__111); Py_CLEAR(clear_module_state->__pyx_tuple__113); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__31); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__37); Py_CLEAR(clear_module_state->__pyx_codeobj__38); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__48); Py_CLEAR(clear_module_state->__pyx_codeobj__49); Py_CLEAR(clear_module_state->__pyx_codeobj__50); Py_CLEAR(clear_module_state->__pyx_codeobj__51); Py_CLEAR(clear_module_state->__pyx_codeobj__52); Py_CLEAR(clear_module_state->__pyx_codeobj__53); Py_CLEAR(clear_module_state->__pyx_codeobj__55); Py_CLEAR(clear_module_state->__pyx_codeobj__57); Py_CLEAR(clear_module_state->__pyx_codeobj__59); Py_CLEAR(clear_module_state->__pyx_codeobj__60); Py_CLEAR(clear_module_state->__pyx_codeobj__62); Py_CLEAR(clear_module_state->__pyx_codeobj__64); Py_CLEAR(clear_module_state->__pyx_codeobj__65); Py_CLEAR(clear_module_state->__pyx_codeobj__66); Py_CLEAR(clear_module_state->__pyx_codeobj__67); Py_CLEAR(clear_module_state->__pyx_codeobj__68); Py_CLEAR(clear_module_state->__pyx_codeobj__70); Py_CLEAR(clear_module_state->__pyx_codeobj__72); Py_CLEAR(clear_module_state->__pyx_codeobj__76); Py_CLEAR(clear_module_state->__pyx_codeobj__77); Py_CLEAR(clear_module_state->__pyx_codeobj__78); Py_CLEAR(clear_module_state->__pyx_codeobj__80); Py_CLEAR(clear_module_state->__pyx_codeobj__82); Py_CLEAR(clear_module_state->__pyx_codeobj__85); Py_CLEAR(clear_module_state->__pyx_codeobj__86); Py_CLEAR(clear_module_state->__pyx_codeobj__88); Py_CLEAR(clear_module_state->__pyx_codeobj__90); Py_CLEAR(clear_module_state->__pyx_codeobj__92); Py_CLEAR(clear_module_state->__pyx_codeobj__93); Py_CLEAR(clear_module_state->__pyx_codeobj__94); Py_CLEAR(clear_module_state->__pyx_codeobj__95); Py_CLEAR(clear_module_state->__pyx_codeobj__96); Py_CLEAR(clear_module_state->__pyx_codeobj__98); Py_CLEAR(clear_module_state->__pyx_codeobj__99); Py_CLEAR(clear_module_state->__pyx_codeobj__101); Py_CLEAR(clear_module_state->__pyx_codeobj__103); Py_CLEAR(clear_module_state->__pyx_codeobj__104); Py_CLEAR(clear_module_state->__pyx_codeobj__105); Py_CLEAR(clear_module_state->__pyx_codeobj__106); Py_CLEAR(clear_module_state->__pyx_codeobj__107); Py_CLEAR(clear_module_state->__pyx_codeobj__109); Py_CLEAR(clear_module_state->__pyx_codeobj__110); Py_CLEAR(clear_module_state->__pyx_codeobj__112); Py_CLEAR(clear_module_state->__pyx_codeobj__114); Py_CLEAR(clear_module_state->__pyx_codeobj__115); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_7display_Window); Py_VISIT(traverse_module_state->__pyx_kp_s_0); Py_VISIT(traverse_module_state->__pyx_kp_s_Couldn_t_allocate_rectangles); Py_VISIT(traverse_module_state->__pyx_n_s_GL_SWAP_CONTROL); Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); Py_VISIT(traverse_module_state->__pyx_n_s_Info); Py_VISIT(traverse_module_state->__pyx_n_s_Info___init); Py_VISIT(traverse_module_state->__pyx_n_s_Info___repr); Py_VISIT(traverse_module_state->__pyx_kp_s_Info_r); Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); Py_VISIT(traverse_module_state->__pyx_n_s_PYGAME_IOS); Py_VISIT(traverse_module_state->__pyx_n_s_PYGAME_SDL2); Py_VISIT(traverse_module_state->__pyx_n_s_PYGAME_SDL2_AVOID_GL); Py_VISIT(traverse_module_state->__pyx_n_s_RESIZE_FLAGS); Py_VISIT(traverse_module_state->__pyx_n_s_SRCALPHA); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_Window); Py_VISIT(traverse_module_state->__pyx_n_s_Window___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Window___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Window_create_surface); Py_VISIT(traverse_module_state->__pyx_n_s_Window_destroy); Py_VISIT(traverse_module_state->__pyx_n_s_Window_flip); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_active); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_drawable_size); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_position); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_sdl_window_pointer); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_size); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_surface); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_window_flags); Py_VISIT(traverse_module_state->__pyx_n_s_Window_get_wm_info); Py_VISIT(traverse_module_state->__pyx_n_s_Window_iconify); Py_VISIT(traverse_module_state->__pyx_n_s_Window_maximize); Py_VISIT(traverse_module_state->__pyx_n_s_Window_minimize); Py_VISIT(traverse_module_state->__pyx_n_s_Window_proxy_window_surface); Py_VISIT(traverse_module_state->__pyx_n_s_Window_recreate_gl_context); Py_VISIT(traverse_module_state->__pyx_n_s_Window_resize); Py_VISIT(traverse_module_state->__pyx_n_s_Window_restore); Py_VISIT(traverse_module_state->__pyx_n_s_Window_set_caption); Py_VISIT(traverse_module_state->__pyx_n_s_Window_set_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_Window_set_gamma_ramp); Py_VISIT(traverse_module_state->__pyx_n_s_Window_set_icon); Py_VISIT(traverse_module_state->__pyx_n_s_Window_set_position); Py_VISIT(traverse_module_state->__pyx_n_s_Window_toggle_fullscreen); Py_VISIT(traverse_module_state->__pyx_n_s_Window_update); Py_VISIT(traverse_module_state->__pyx_n_s__116); Py_VISIT(traverse_module_state->__pyx_n_s__6); Py_VISIT(traverse_module_state->__pyx_kp_u__7); Py_VISIT(traverse_module_state->__pyx_n_s_always); Py_VISIT(traverse_module_state->__pyx_n_s_androidembed); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_bitsize); Py_VISIT(traverse_module_state->__pyx_n_s_blit_hw); Py_VISIT(traverse_module_state->__pyx_n_s_blit_hw_A); Py_VISIT(traverse_module_state->__pyx_n_s_blit_hw_CC); Py_VISIT(traverse_module_state->__pyx_n_s_blit_sw); Py_VISIT(traverse_module_state->__pyx_n_s_blit_sw_A); Py_VISIT(traverse_module_state->__pyx_n_s_blit_sw_CC); Py_VISIT(traverse_module_state->__pyx_n_s_blue); Py_VISIT(traverse_module_state->__pyx_n_s_blue_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_bytesize); Py_VISIT(traverse_module_state->__pyx_n_s_c_void_p); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_copy); Py_VISIT(traverse_module_state->__pyx_n_s_count); Py_VISIT(traverse_module_state->__pyx_n_s_create_surface); Py_VISIT(traverse_module_state->__pyx_n_s_ctypes); Py_VISIT(traverse_module_state->__pyx_n_s_cur_height); Py_VISIT(traverse_module_state->__pyx_n_s_cur_width); Py_VISIT(traverse_module_state->__pyx_n_s_current_h); Py_VISIT(traverse_module_state->__pyx_n_s_current_w); Py_VISIT(traverse_module_state->__pyx_n_s_default); Py_VISIT(traverse_module_state->__pyx_n_s_default_icon); Py_VISIT(traverse_module_state->__pyx_n_s_default_swap_control); Py_VISIT(traverse_module_state->__pyx_n_s_default_title); Py_VISIT(traverse_module_state->__pyx_n_s_depth); Py_VISIT(traverse_module_state->__pyx_n_s_destroy); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_display); Py_VISIT(traverse_module_state->__pyx_n_s_dm); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_driver); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_environ); Py_VISIT(traverse_module_state->__pyx_n_s_err); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_event); Py_VISIT(traverse_module_state->__pyx_n_s_flag); Py_VISIT(traverse_module_state->__pyx_n_s_flags); Py_VISIT(traverse_module_state->__pyx_n_s_flip); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_fullscreen); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_active); Py_VISIT(traverse_module_state->__pyx_n_s_get_caption); Py_VISIT(traverse_module_state->__pyx_n_s_get_display_bounds); Py_VISIT(traverse_module_state->__pyx_n_s_get_drawable_size); Py_VISIT(traverse_module_state->__pyx_n_s_get_driver); Py_VISIT(traverse_module_state->__pyx_n_s_get_hint); Py_VISIT(traverse_module_state->__pyx_n_s_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_get_num_video_displays); Py_VISIT(traverse_module_state->__pyx_n_s_get_platform); Py_VISIT(traverse_module_state->__pyx_n_s_get_position); Py_VISIT(traverse_module_state->__pyx_n_s_get_sdl_window_pointer); Py_VISIT(traverse_module_state->__pyx_n_s_get_size); Py_VISIT(traverse_module_state->__pyx_n_s_get_surface); Py_VISIT(traverse_module_state->__pyx_n_s_get_window); Py_VISIT(traverse_module_state->__pyx_n_s_get_window_flags); Py_VISIT(traverse_module_state->__pyx_n_s_get_wm_info); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_gl_get_attribute); Py_VISIT(traverse_module_state->__pyx_n_s_gl_load_library); Py_VISIT(traverse_module_state->__pyx_n_s_gl_reset_attributes); Py_VISIT(traverse_module_state->__pyx_n_s_gl_set_attribute); Py_VISIT(traverse_module_state->__pyx_n_s_gl_unload_library); Py_VISIT(traverse_module_state->__pyx_n_s_green); Py_VISIT(traverse_module_state->__pyx_n_s_green_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_height); Py_VISIT(traverse_module_state->__pyx_n_s_hint); Py_VISIT(traverse_module_state->__pyx_n_s_hw); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_iconify); Py_VISIT(traverse_module_state->__pyx_n_s_icontitle); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_index); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_2); Py_VISIT(traverse_module_state->__pyx_n_s_init_done); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_ios); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_list_modes); Py_VISIT(traverse_module_state->__pyx_n_s_losses); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_main_done); Py_VISIT(traverse_module_state->__pyx_n_s_main_window); Py_VISIT(traverse_module_state->__pyx_n_s_masks); Py_VISIT(traverse_module_state->__pyx_n_s_maximize); Py_VISIT(traverse_module_state->__pyx_n_s_maximized); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_minimize); Py_VISIT(traverse_module_state->__pyx_n_s_mode); Py_VISIT(traverse_module_state->__pyx_n_s_mode_ok); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_num_modes); Py_VISIT(traverse_module_state->__pyx_n_s_object); Py_VISIT(traverse_module_state->__pyx_n_s_opengl); Py_VISIT(traverse_module_state->__pyx_n_s_os); Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_priority); Py_VISIT(traverse_module_state->__pyx_n_s_proxy_window_surface); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_hints); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_display); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_locals); Py_VISIT(traverse_module_state->__pyx_kp_s_pygame_window); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_capi); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_s_recreate_gl_context); Py_VISIT(traverse_module_state->__pyx_n_s_rect); Py_VISIT(traverse_module_state->__pyx_n_s_rectangles); Py_VISIT(traverse_module_state->__pyx_n_s_rects); Py_VISIT(traverse_module_state->__pyx_n_s_red); Py_VISIT(traverse_module_state->__pyx_n_s_red_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_refresh_rate); Py_VISIT(traverse_module_state->__pyx_n_s_register_init); Py_VISIT(traverse_module_state->__pyx_n_s_register_quit); Py_VISIT(traverse_module_state->__pyx_n_s_repr); Py_VISIT(traverse_module_state->__pyx_n_s_resize); Py_VISIT(traverse_module_state->__pyx_n_s_resolution); Py_VISIT(traverse_module_state->__pyx_n_s_restore); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_main_init); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_kp_s_self_gl_context_self_window_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_caption); Py_VISIT(traverse_module_state->__pyx_n_s_set_gamma); Py_VISIT(traverse_module_state->__pyx_n_s_set_gamma_ramp); Py_VISIT(traverse_module_state->__pyx_n_s_set_icon); Py_VISIT(traverse_module_state->__pyx_n_s_set_mode); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_set_position); Py_VISIT(traverse_module_state->__pyx_n_s_set_screensaver); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_shape); Py_VISIT(traverse_module_state->__pyx_n_s_shifts); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_display_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_startswith); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_t); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_title); Py_VISIT(traverse_module_state->__pyx_n_s_toggle_fullscreen); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_video_mem); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_warnings); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_n_s_wm); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_32); Py_VISIT(traverse_module_state->__pyx_int_268435456); Py_VISIT(traverse_module_state->__pyx_k__2); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__26); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__33); Py_VISIT(traverse_module_state->__pyx_tuple__35); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__42); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_tuple__47); Py_VISIT(traverse_module_state->__pyx_tuple__54); Py_VISIT(traverse_module_state->__pyx_tuple__56); Py_VISIT(traverse_module_state->__pyx_tuple__58); Py_VISIT(traverse_module_state->__pyx_tuple__61); Py_VISIT(traverse_module_state->__pyx_tuple__63); Py_VISIT(traverse_module_state->__pyx_tuple__69); Py_VISIT(traverse_module_state->__pyx_tuple__71); Py_VISIT(traverse_module_state->__pyx_tuple__73); Py_VISIT(traverse_module_state->__pyx_tuple__74); Py_VISIT(traverse_module_state->__pyx_tuple__75); Py_VISIT(traverse_module_state->__pyx_tuple__79); Py_VISIT(traverse_module_state->__pyx_tuple__81); Py_VISIT(traverse_module_state->__pyx_tuple__83); Py_VISIT(traverse_module_state->__pyx_tuple__84); Py_VISIT(traverse_module_state->__pyx_tuple__87); Py_VISIT(traverse_module_state->__pyx_tuple__89); Py_VISIT(traverse_module_state->__pyx_tuple__91); Py_VISIT(traverse_module_state->__pyx_tuple__97); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_tuple__100); Py_VISIT(traverse_module_state->__pyx_tuple__102); Py_VISIT(traverse_module_state->__pyx_tuple__108); Py_VISIT(traverse_module_state->__pyx_tuple__111); Py_VISIT(traverse_module_state->__pyx_tuple__113); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__31); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__37); Py_VISIT(traverse_module_state->__pyx_codeobj__38); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__48); Py_VISIT(traverse_module_state->__pyx_codeobj__49); Py_VISIT(traverse_module_state->__pyx_codeobj__50); Py_VISIT(traverse_module_state->__pyx_codeobj__51); Py_VISIT(traverse_module_state->__pyx_codeobj__52); Py_VISIT(traverse_module_state->__pyx_codeobj__53); Py_VISIT(traverse_module_state->__pyx_codeobj__55); Py_VISIT(traverse_module_state->__pyx_codeobj__57); Py_VISIT(traverse_module_state->__pyx_codeobj__59); Py_VISIT(traverse_module_state->__pyx_codeobj__60); Py_VISIT(traverse_module_state->__pyx_codeobj__62); Py_VISIT(traverse_module_state->__pyx_codeobj__64); Py_VISIT(traverse_module_state->__pyx_codeobj__65); Py_VISIT(traverse_module_state->__pyx_codeobj__66); Py_VISIT(traverse_module_state->__pyx_codeobj__67); Py_VISIT(traverse_module_state->__pyx_codeobj__68); Py_VISIT(traverse_module_state->__pyx_codeobj__70); Py_VISIT(traverse_module_state->__pyx_codeobj__72); Py_VISIT(traverse_module_state->__pyx_codeobj__76); Py_VISIT(traverse_module_state->__pyx_codeobj__77); Py_VISIT(traverse_module_state->__pyx_codeobj__78); Py_VISIT(traverse_module_state->__pyx_codeobj__80); Py_VISIT(traverse_module_state->__pyx_codeobj__82); Py_VISIT(traverse_module_state->__pyx_codeobj__85); Py_VISIT(traverse_module_state->__pyx_codeobj__86); Py_VISIT(traverse_module_state->__pyx_codeobj__88); Py_VISIT(traverse_module_state->__pyx_codeobj__90); Py_VISIT(traverse_module_state->__pyx_codeobj__92); Py_VISIT(traverse_module_state->__pyx_codeobj__93); Py_VISIT(traverse_module_state->__pyx_codeobj__94); Py_VISIT(traverse_module_state->__pyx_codeobj__95); Py_VISIT(traverse_module_state->__pyx_codeobj__96); Py_VISIT(traverse_module_state->__pyx_codeobj__98); Py_VISIT(traverse_module_state->__pyx_codeobj__99); Py_VISIT(traverse_module_state->__pyx_codeobj__101); Py_VISIT(traverse_module_state->__pyx_codeobj__103); Py_VISIT(traverse_module_state->__pyx_codeobj__104); Py_VISIT(traverse_module_state->__pyx_codeobj__105); Py_VISIT(traverse_module_state->__pyx_codeobj__106); Py_VISIT(traverse_module_state->__pyx_codeobj__107); Py_VISIT(traverse_module_state->__pyx_codeobj__109); Py_VISIT(traverse_module_state->__pyx_codeobj__110); Py_VISIT(traverse_module_state->__pyx_codeobj__112); Py_VISIT(traverse_module_state->__pyx_codeobj__114); Py_VISIT(traverse_module_state->__pyx_codeobj__115); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_4rect_Rect __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_4rect_Rect #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_7display_Window __pyx_mstate_global->__pyx_type_11pygame_sdl2_7display_Window #endif #define __pyx_ptype_11pygame_sdl2_7display_Window __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7display_Window #define __pyx_kp_s_0 __pyx_mstate_global->__pyx_kp_s_0 #define __pyx_kp_s_Couldn_t_allocate_rectangles __pyx_mstate_global->__pyx_kp_s_Couldn_t_allocate_rectangles #define __pyx_n_s_GL_SWAP_CONTROL __pyx_mstate_global->__pyx_n_s_GL_SWAP_CONTROL #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError #define __pyx_n_s_Info __pyx_mstate_global->__pyx_n_s_Info #define __pyx_n_s_Info___init __pyx_mstate_global->__pyx_n_s_Info___init #define __pyx_n_s_Info___repr __pyx_mstate_global->__pyx_n_s_Info___repr #define __pyx_kp_s_Info_r __pyx_mstate_global->__pyx_kp_s_Info_r #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError #define __pyx_n_s_PYGAME_IOS __pyx_mstate_global->__pyx_n_s_PYGAME_IOS #define __pyx_n_s_PYGAME_SDL2 __pyx_mstate_global->__pyx_n_s_PYGAME_SDL2 #define __pyx_n_s_PYGAME_SDL2_AVOID_GL __pyx_mstate_global->__pyx_n_s_PYGAME_SDL2_AVOID_GL #define __pyx_n_s_RESIZE_FLAGS __pyx_mstate_global->__pyx_n_s_RESIZE_FLAGS #define __pyx_n_s_SRCALPHA __pyx_mstate_global->__pyx_n_s_SRCALPHA #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_Window __pyx_mstate_global->__pyx_n_s_Window #define __pyx_n_s_Window___reduce_cython __pyx_mstate_global->__pyx_n_s_Window___reduce_cython #define __pyx_n_s_Window___setstate_cython __pyx_mstate_global->__pyx_n_s_Window___setstate_cython #define __pyx_n_s_Window_create_surface __pyx_mstate_global->__pyx_n_s_Window_create_surface #define __pyx_n_s_Window_destroy __pyx_mstate_global->__pyx_n_s_Window_destroy #define __pyx_n_s_Window_flip __pyx_mstate_global->__pyx_n_s_Window_flip #define __pyx_n_s_Window_get_active __pyx_mstate_global->__pyx_n_s_Window_get_active #define __pyx_n_s_Window_get_drawable_size __pyx_mstate_global->__pyx_n_s_Window_get_drawable_size #define __pyx_n_s_Window_get_position __pyx_mstate_global->__pyx_n_s_Window_get_position #define __pyx_n_s_Window_get_sdl_window_pointer __pyx_mstate_global->__pyx_n_s_Window_get_sdl_window_pointer #define __pyx_n_s_Window_get_size __pyx_mstate_global->__pyx_n_s_Window_get_size #define __pyx_n_s_Window_get_surface __pyx_mstate_global->__pyx_n_s_Window_get_surface #define __pyx_n_s_Window_get_window_flags __pyx_mstate_global->__pyx_n_s_Window_get_window_flags #define __pyx_n_s_Window_get_wm_info __pyx_mstate_global->__pyx_n_s_Window_get_wm_info #define __pyx_n_s_Window_iconify __pyx_mstate_global->__pyx_n_s_Window_iconify #define __pyx_n_s_Window_maximize __pyx_mstate_global->__pyx_n_s_Window_maximize #define __pyx_n_s_Window_minimize __pyx_mstate_global->__pyx_n_s_Window_minimize #define __pyx_n_s_Window_proxy_window_surface __pyx_mstate_global->__pyx_n_s_Window_proxy_window_surface #define __pyx_n_s_Window_recreate_gl_context __pyx_mstate_global->__pyx_n_s_Window_recreate_gl_context #define __pyx_n_s_Window_resize __pyx_mstate_global->__pyx_n_s_Window_resize #define __pyx_n_s_Window_restore __pyx_mstate_global->__pyx_n_s_Window_restore #define __pyx_n_s_Window_set_caption __pyx_mstate_global->__pyx_n_s_Window_set_caption #define __pyx_n_s_Window_set_gamma __pyx_mstate_global->__pyx_n_s_Window_set_gamma #define __pyx_n_s_Window_set_gamma_ramp __pyx_mstate_global->__pyx_n_s_Window_set_gamma_ramp #define __pyx_n_s_Window_set_icon __pyx_mstate_global->__pyx_n_s_Window_set_icon #define __pyx_n_s_Window_set_position __pyx_mstate_global->__pyx_n_s_Window_set_position #define __pyx_n_s_Window_toggle_fullscreen __pyx_mstate_global->__pyx_n_s_Window_toggle_fullscreen #define __pyx_n_s_Window_update __pyx_mstate_global->__pyx_n_s_Window_update #define __pyx_n_s__116 __pyx_mstate_global->__pyx_n_s__116 #define __pyx_n_s__6 __pyx_mstate_global->__pyx_n_s__6 #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 #define __pyx_n_s_always __pyx_mstate_global->__pyx_n_s_always #define __pyx_n_s_androidembed __pyx_mstate_global->__pyx_n_s_androidembed #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_bitsize __pyx_mstate_global->__pyx_n_s_bitsize #define __pyx_n_s_blit_hw __pyx_mstate_global->__pyx_n_s_blit_hw #define __pyx_n_s_blit_hw_A __pyx_mstate_global->__pyx_n_s_blit_hw_A #define __pyx_n_s_blit_hw_CC __pyx_mstate_global->__pyx_n_s_blit_hw_CC #define __pyx_n_s_blit_sw __pyx_mstate_global->__pyx_n_s_blit_sw #define __pyx_n_s_blit_sw_A __pyx_mstate_global->__pyx_n_s_blit_sw_A #define __pyx_n_s_blit_sw_CC __pyx_mstate_global->__pyx_n_s_blit_sw_CC #define __pyx_n_s_blue __pyx_mstate_global->__pyx_n_s_blue #define __pyx_n_s_blue_gamma __pyx_mstate_global->__pyx_n_s_blue_gamma #define __pyx_n_s_bytesize __pyx_mstate_global->__pyx_n_s_bytesize #define __pyx_n_s_c_void_p __pyx_mstate_global->__pyx_n_s_c_void_p #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy #define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count #define __pyx_n_s_create_surface __pyx_mstate_global->__pyx_n_s_create_surface #define __pyx_n_s_ctypes __pyx_mstate_global->__pyx_n_s_ctypes #define __pyx_n_s_cur_height __pyx_mstate_global->__pyx_n_s_cur_height #define __pyx_n_s_cur_width __pyx_mstate_global->__pyx_n_s_cur_width #define __pyx_n_s_current_h __pyx_mstate_global->__pyx_n_s_current_h #define __pyx_n_s_current_w __pyx_mstate_global->__pyx_n_s_current_w #define __pyx_n_s_default __pyx_mstate_global->__pyx_n_s_default #define __pyx_n_s_default_icon __pyx_mstate_global->__pyx_n_s_default_icon #define __pyx_n_s_default_swap_control __pyx_mstate_global->__pyx_n_s_default_swap_control #define __pyx_n_s_default_title __pyx_mstate_global->__pyx_n_s_default_title #define __pyx_n_s_depth __pyx_mstate_global->__pyx_n_s_depth #define __pyx_n_s_destroy __pyx_mstate_global->__pyx_n_s_destroy #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display #define __pyx_n_s_dm __pyx_mstate_global->__pyx_n_s_dm #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_driver __pyx_mstate_global->__pyx_n_s_driver #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_environ __pyx_mstate_global->__pyx_n_s_environ #define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_event __pyx_mstate_global->__pyx_n_s_event #define __pyx_n_s_flag __pyx_mstate_global->__pyx_n_s_flag #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags #define __pyx_n_s_flip __pyx_mstate_global->__pyx_n_s_flip #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_fullscreen __pyx_mstate_global->__pyx_n_s_fullscreen #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_active __pyx_mstate_global->__pyx_n_s_get_active #define __pyx_n_s_get_caption __pyx_mstate_global->__pyx_n_s_get_caption #define __pyx_n_s_get_display_bounds __pyx_mstate_global->__pyx_n_s_get_display_bounds #define __pyx_n_s_get_drawable_size __pyx_mstate_global->__pyx_n_s_get_drawable_size #define __pyx_n_s_get_driver __pyx_mstate_global->__pyx_n_s_get_driver #define __pyx_n_s_get_hint __pyx_mstate_global->__pyx_n_s_get_hint #define __pyx_n_s_get_init __pyx_mstate_global->__pyx_n_s_get_init #define __pyx_n_s_get_num_video_displays __pyx_mstate_global->__pyx_n_s_get_num_video_displays #define __pyx_n_s_get_platform __pyx_mstate_global->__pyx_n_s_get_platform #define __pyx_n_s_get_position __pyx_mstate_global->__pyx_n_s_get_position #define __pyx_n_s_get_sdl_window_pointer __pyx_mstate_global->__pyx_n_s_get_sdl_window_pointer #define __pyx_n_s_get_size __pyx_mstate_global->__pyx_n_s_get_size #define __pyx_n_s_get_surface __pyx_mstate_global->__pyx_n_s_get_surface #define __pyx_n_s_get_window __pyx_mstate_global->__pyx_n_s_get_window #define __pyx_n_s_get_window_flags __pyx_mstate_global->__pyx_n_s_get_window_flags #define __pyx_n_s_get_wm_info __pyx_mstate_global->__pyx_n_s_get_wm_info #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_gl_get_attribute __pyx_mstate_global->__pyx_n_s_gl_get_attribute #define __pyx_n_s_gl_load_library __pyx_mstate_global->__pyx_n_s_gl_load_library #define __pyx_n_s_gl_reset_attributes __pyx_mstate_global->__pyx_n_s_gl_reset_attributes #define __pyx_n_s_gl_set_attribute __pyx_mstate_global->__pyx_n_s_gl_set_attribute #define __pyx_n_s_gl_unload_library __pyx_mstate_global->__pyx_n_s_gl_unload_library #define __pyx_n_s_green __pyx_mstate_global->__pyx_n_s_green #define __pyx_n_s_green_gamma __pyx_mstate_global->__pyx_n_s_green_gamma #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_height __pyx_mstate_global->__pyx_n_s_height #define __pyx_n_s_hint __pyx_mstate_global->__pyx_n_s_hint #define __pyx_n_s_hw __pyx_mstate_global->__pyx_n_s_hw #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_iconify __pyx_mstate_global->__pyx_n_s_iconify #define __pyx_n_s_icontitle __pyx_mstate_global->__pyx_n_s_icontitle #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_2 __pyx_mstate_global->__pyx_n_s_init_2 #define __pyx_n_s_init_done __pyx_mstate_global->__pyx_n_s_init_done #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_ios __pyx_mstate_global->__pyx_n_s_ios #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_list_modes __pyx_mstate_global->__pyx_n_s_list_modes #define __pyx_n_s_losses __pyx_mstate_global->__pyx_n_s_losses #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_main_done __pyx_mstate_global->__pyx_n_s_main_done #define __pyx_n_s_main_window __pyx_mstate_global->__pyx_n_s_main_window #define __pyx_n_s_masks __pyx_mstate_global->__pyx_n_s_masks #define __pyx_n_s_maximize __pyx_mstate_global->__pyx_n_s_maximize #define __pyx_n_s_maximized __pyx_mstate_global->__pyx_n_s_maximized #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_minimize __pyx_mstate_global->__pyx_n_s_minimize #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode #define __pyx_n_s_mode_ok __pyx_mstate_global->__pyx_n_s_mode_ok #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_num_modes __pyx_mstate_global->__pyx_n_s_num_modes #define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object #define __pyx_n_s_opengl __pyx_mstate_global->__pyx_n_s_opengl #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_priority __pyx_mstate_global->__pyx_n_s_priority #define __pyx_n_s_proxy_window_surface __pyx_mstate_global->__pyx_n_s_proxy_window_surface #define __pyx_n_s_pygame_hints __pyx_mstate_global->__pyx_n_s_pygame_hints #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_display __pyx_mstate_global->__pyx_n_s_pygame_sdl2_display #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_locals __pyx_mstate_global->__pyx_n_s_pygame_sdl2_locals #define __pyx_kp_s_pygame_window __pyx_mstate_global->__pyx_kp_s_pygame_window #define __pyx_n_s_pyx_capi __pyx_mstate_global->__pyx_n_s_pyx_capi #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_n_s_recreate_gl_context __pyx_mstate_global->__pyx_n_s_recreate_gl_context #define __pyx_n_s_rect __pyx_mstate_global->__pyx_n_s_rect #define __pyx_n_s_rectangles __pyx_mstate_global->__pyx_n_s_rectangles #define __pyx_n_s_rects __pyx_mstate_global->__pyx_n_s_rects #define __pyx_n_s_red __pyx_mstate_global->__pyx_n_s_red #define __pyx_n_s_red_gamma __pyx_mstate_global->__pyx_n_s_red_gamma #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_refresh_rate __pyx_mstate_global->__pyx_n_s_refresh_rate #define __pyx_n_s_register_init __pyx_mstate_global->__pyx_n_s_register_init #define __pyx_n_s_register_quit __pyx_mstate_global->__pyx_n_s_register_quit #define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr #define __pyx_n_s_resize __pyx_mstate_global->__pyx_n_s_resize #define __pyx_n_s_resolution __pyx_mstate_global->__pyx_n_s_resolution #define __pyx_n_s_restore __pyx_mstate_global->__pyx_n_s_restore #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_sdl_main_init __pyx_mstate_global->__pyx_n_s_sdl_main_init #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_kp_s_self_gl_context_self_window_self __pyx_mstate_global->__pyx_kp_s_self_gl_context_self_window_self #define __pyx_n_s_set_caption __pyx_mstate_global->__pyx_n_s_set_caption #define __pyx_n_s_set_gamma __pyx_mstate_global->__pyx_n_s_set_gamma #define __pyx_n_s_set_gamma_ramp __pyx_mstate_global->__pyx_n_s_set_gamma_ramp #define __pyx_n_s_set_icon __pyx_mstate_global->__pyx_n_s_set_icon #define __pyx_n_s_set_mode __pyx_mstate_global->__pyx_n_s_set_mode #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_set_position __pyx_mstate_global->__pyx_n_s_set_position #define __pyx_n_s_set_screensaver __pyx_mstate_global->__pyx_n_s_set_screensaver #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape #define __pyx_n_s_shifts __pyx_mstate_global->__pyx_n_s_shifts #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_display_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_display_pyx #define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_title __pyx_mstate_global->__pyx_n_s_title #define __pyx_n_s_toggle_fullscreen __pyx_mstate_global->__pyx_n_s_toggle_fullscreen #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_video_mem __pyx_mstate_global->__pyx_n_s_video_mem #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_n_s_wm __pyx_mstate_global->__pyx_n_s_wm #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 #define __pyx_int_268435456 __pyx_mstate_global->__pyx_int_268435456 #define __pyx_k__2 __pyx_mstate_global->__pyx_k__2 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 #define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 #define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58 #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 #define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 #define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 #define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 #define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 #define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 #define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81 #define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83 #define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 #define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 #define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 #define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 #define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100 #define __pyx_tuple__102 __pyx_mstate_global->__pyx_tuple__102 #define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108 #define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111 #define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 #define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 #define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 #define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 #define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 #define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 #define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62 #define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64 #define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 #define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 #define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 #define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68 #define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 #define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72 #define __pyx_codeobj__76 __pyx_mstate_global->__pyx_codeobj__76 #define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 #define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78 #define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 #define __pyx_codeobj__82 __pyx_mstate_global->__pyx_codeobj__82 #define __pyx_codeobj__85 __pyx_mstate_global->__pyx_codeobj__85 #define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86 #define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88 #define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90 #define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92 #define __pyx_codeobj__93 __pyx_mstate_global->__pyx_codeobj__93 #define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94 #define __pyx_codeobj__95 __pyx_mstate_global->__pyx_codeobj__95 #define __pyx_codeobj__96 __pyx_mstate_global->__pyx_codeobj__96 #define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98 #define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99 #define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101 #define __pyx_codeobj__103 __pyx_mstate_global->__pyx_codeobj__103 #define __pyx_codeobj__104 __pyx_mstate_global->__pyx_codeobj__104 #define __pyx_codeobj__105 __pyx_mstate_global->__pyx_codeobj__105 #define __pyx_codeobj__106 __pyx_mstate_global->__pyx_codeobj__106 #define __pyx_codeobj__107 __pyx_mstate_global->__pyx_codeobj__107 #define __pyx_codeobj__109 __pyx_mstate_global->__pyx_codeobj__109 #define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110 #define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112 #define __pyx_codeobj__114 __pyx_mstate_global->__pyx_codeobj__114 #define __pyx_codeobj__115 __pyx_mstate_global->__pyx_codeobj__115 /* #### Code section: module_code ### */ /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value, priority=1): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_1hint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_hint, "hint(hint, value, priority=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_1hint = {"hint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_1hint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_hint}; static PyObject *__pyx_pw_11pygame_sdl2_7display_1hint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_hint = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_priority = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hint,&__pyx_n_s_value,&__pyx_n_s_priority,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hint)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 40, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 40, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hint", 0, 2, 3, 1); __PYX_ERR(0, 40, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_priority); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 40, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hint") < 0)) __PYX_ERR(0, 40, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_hint = values[0]; __pyx_v_value = values[1]; __pyx_v_priority = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hint", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 40, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_hint(__pyx_self, __pyx_v_hint, __pyx_v_value, __pyx_v_priority); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_value, PyObject *__pyx_v_priority) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; char const *__pyx_t_8; SDL_HintPriority __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hint", 0); __Pyx_INCREF(__pyx_v_hint); __Pyx_INCREF(__pyx_v_value); /* "pygame_sdl2/display.pyx":42 * def hint(hint, value, priority=1): * * if str(hint).startswith("PYGAME_SDL2"): # <<<<<<<<<<<<<< * _pygame_hints[str(hint)] = str(value) * return */ __pyx_t_2 = __Pyx_PyObject_Str(__pyx_v_hint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_n_s_PYGAME_SDL2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/display.pyx":43 * * if str(hint).startswith("PYGAME_SDL2"): * _pygame_hints[str(hint)] = str(value) # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = __Pyx_PyObject_Str(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Str(__pyx_v_hint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_t_1) < 0))) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":44 * if str(hint).startswith("PYGAME_SDL2"): * _pygame_hints[str(hint)] = str(value) * return # <<<<<<<<<<<<<< * * if not isinstance(hint, bytes): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":42 * def hint(hint, value, priority=1): * * if str(hint).startswith("PYGAME_SDL2"): # <<<<<<<<<<<<<< * _pygame_hints[str(hint)] = str(value) * return */ } /* "pygame_sdl2/display.pyx":46 * return * * if not isinstance(hint, bytes): # <<<<<<<<<<<<<< * hint = hint.encode("utf-8") * */ __pyx_t_5 = PyBytes_Check(__pyx_v_hint); __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { /* "pygame_sdl2/display.pyx":47 * * if not isinstance(hint, bytes): * hint = hint.encode("utf-8") # <<<<<<<<<<<<<< * * if not isinstance(value, bytes): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hint, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_hint, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":46 * return * * if not isinstance(hint, bytes): # <<<<<<<<<<<<<< * hint = hint.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":49 * hint = hint.encode("utf-8") * * if not isinstance(value, bytes): # <<<<<<<<<<<<<< * value = value.encode("utf-8") * */ __pyx_t_6 = PyBytes_Check(__pyx_v_value); __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { /* "pygame_sdl2/display.pyx":50 * * if not isinstance(value, bytes): * value = value.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetHintWithPriority(hint, value, priority) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":49 * hint = hint.encode("utf-8") * * if not isinstance(value, bytes): # <<<<<<<<<<<<<< * value = value.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":52 * value = value.encode("utf-8") * * SDL_SetHintWithPriority(hint, value, priority) # <<<<<<<<<<<<<< * * def _get_hint(hint, default): */ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_hint); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) __pyx_t_9 = ((SDL_HintPriority)__Pyx_PyInt_As_SDL_HintPriority(__pyx_v_priority)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) (void)(SDL_SetHintWithPriority(__pyx_t_7, __pyx_t_8, __pyx_t_9)); /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value, priority=1): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_hint); __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":54 * SDL_SetHintWithPriority(hint, value, priority) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_3_get_hint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_2_get_hint, "_get_hint(hint, default)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_3_get_hint = {"_get_hint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_3_get_hint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_2_get_hint}; static PyObject *__pyx_pw_11pygame_sdl2_7display_3_get_hint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_hint = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_hint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hint,&__pyx_n_s_default,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hint)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_get_hint", 1, 2, 2, 1); __PYX_ERR(0, 54, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_hint") < 0)) __PYX_ERR(0, 54, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_hint = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_get_hint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 54, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display._get_hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_2_get_hint(__pyx_self, __pyx_v_hint, __pyx_v_default); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_2_get_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_hint", 0); __Pyx_INCREF(__pyx_v_hint); /* "pygame_sdl2/display.pyx":55 * * def _get_hint(hint, default): * hint = str(hint) # <<<<<<<<<<<<<< * * if hint in _pygame_hints: */ __pyx_t_1 = __Pyx_PyObject_Str(__pyx_v_hint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_hint, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":57 * hint = str(hint) * * if hint in _pygame_hints: # <<<<<<<<<<<<<< * return _pygame_hints[hint] * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_hint, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":58 * * if hint in _pygame_hints: * return _pygame_hints[hint] # <<<<<<<<<<<<<< * * if hint in os.environ: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_hint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":57 * hint = str(hint) * * if hint in _pygame_hints: # <<<<<<<<<<<<<< * return _pygame_hints[hint] * */ } /* "pygame_sdl2/display.pyx":60 * return _pygame_hints[hint] * * if hint in os.environ: # <<<<<<<<<<<<<< * return os.environ[hint] * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_hint, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":61 * * if hint in os.environ: * return os.environ[hint] # <<<<<<<<<<<<<< * * return default */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_hint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":60 * return _pygame_hints[hint] * * if hint in os.environ: # <<<<<<<<<<<<<< * return os.environ[hint] * */ } /* "pygame_sdl2/display.pyx":63 * return os.environ[hint] * * return default # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; /* "pygame_sdl2/display.pyx":54 * SDL_SetHintWithPriority(hint, value, priority) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display._get_hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_hint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":68 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_5sdl_main_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_4sdl_main_init, "sdl_main_init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_5sdl_main_init = {"sdl_main_init", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_5sdl_main_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_4sdl_main_init}; static PyObject *__pyx_pw_11pygame_sdl2_7display_5sdl_main_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sdl_main_init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_4sdl_main_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_4sdl_main_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sdl_main_init", 1); /* "pygame_sdl2/display.pyx":71 * global main_done * * if main_done: # <<<<<<<<<<<<<< * return * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_main_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":72 * * if main_done: * return # <<<<<<<<<<<<<< * * SDL_SetMainReady() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":71 * global main_done * * if main_done: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":74 * return * * SDL_SetMainReady() # <<<<<<<<<<<<<< * * if SDL_Init(0): */ SDL_SetMainReady(); /* "pygame_sdl2/display.pyx":76 * SDL_SetMainReady() * * if SDL_Init(0): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (SDL_Init(0) != 0); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/display.pyx":77 * * if SDL_Init(0): * raise error() # <<<<<<<<<<<<<< * * main_done = True */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 77, __pyx_L1_error) /* "pygame_sdl2/display.pyx":76 * SDL_SetMainReady() * * if SDL_Init(0): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":79 * raise error() * * main_done = True # <<<<<<<<<<<<<< * * # True if init has been called without quit being called. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_main_done, Py_True) < 0) __PYX_ERR(0, 79, __pyx_L1_error) /* "pygame_sdl2/display.pyx":68 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.sdl_main_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":84 * init_done = False * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_7init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_7init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_7init, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_6init}; static PyObject *__pyx_pw_11pygame_sdl2_7display_7init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/display.pyx":87 * def init(): * * if init_done: # <<<<<<<<<<<<<< * return * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_init_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":88 * * if init_done: * return # <<<<<<<<<<<<<< * * sdl_main_init() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":87 * def init(): * * if init_done: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":90 * return * * sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_VIDEO): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":92 * sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_VIDEO): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (SDL_InitSubSystem(SDL_INIT_VIDEO) != 0); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/display.pyx":93 * * if SDL_InitSubSystem(SDL_INIT_VIDEO): * raise error() # <<<<<<<<<<<<<< * * pygame_sdl2.event.init() */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 93, __pyx_L1_error) /* "pygame_sdl2/display.pyx":92 * sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_VIDEO): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":95 * raise error() * * pygame_sdl2.event.init() # <<<<<<<<<<<<<< * * global init_done */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_event); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":98 * * global init_done * init_done = True # <<<<<<<<<<<<<< * * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_done, Py_True) < 0) __PYX_ERR(0, 98, __pyx_L1_error) /* "pygame_sdl2/display.pyx":84 * init_done = False * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":102 * * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_9quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_8quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_9quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_9quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_8quit}; static PyObject *__pyx_pw_11pygame_sdl2_7display_9quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_8quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_8quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/display.pyx":108 * global main_window * * if main_window: # <<<<<<<<<<<<<< * main_window.destroy() * main_window = None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 108, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":109 * * if main_window: * main_window.destroy() # <<<<<<<<<<<<<< * main_window = None * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":110 * if main_window: * main_window.destroy() * main_window = None # <<<<<<<<<<<<<< * * */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/display.pyx":108 * global main_window * * if main_window: # <<<<<<<<<<<<<< * main_window.destroy() * main_window = None */ } /* "pygame_sdl2/display.pyx":113 * * * SDL_QuitSubSystem(SDL_INIT_VIDEO) # <<<<<<<<<<<<<< * * init_done = False */ SDL_QuitSubSystem(SDL_INIT_VIDEO); /* "pygame_sdl2/display.pyx":115 * SDL_QuitSubSystem(SDL_INIT_VIDEO) * * init_done = False # <<<<<<<<<<<<<< * * def get_init(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_done, Py_False) < 0) __PYX_ERR(0, 115, __pyx_L1_error) /* "pygame_sdl2/display.pyx":102 * * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.quit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_11get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_10get_init, "get_init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_11get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_11get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_10get_init}; static PyObject *__pyx_pw_11pygame_sdl2_7display_11get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_10get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_10get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/display.pyx":118 * * def get_init(): * return init_done # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_init_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":131 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED), Surface shape=None): # <<<<<<<<<<<<<< * cdef SDL_WindowShapeMode shape_mode * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7display_6Window_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_7display_6Window_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_title = 0; PyObject *__pyx_v_resolution = 0; PyObject *__pyx_v_flags = 0; CYTHON_UNUSED PyObject *__pyx_v_depth = 0; PyObject *__pyx_v_pos = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_shape = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_title,&__pyx_n_s_resolution,&__pyx_n_s_flags,&__pyx_n_s_depth,&__pyx_n_s_pos,&__pyx_n_s_shape,0}; values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_tuple_)); values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_0)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_0)); values[4] = __Pyx_Arg_NewRef_VARARGS(__pyx_k__2); values[5] = __Pyx_Arg_NewRef_VARARGS((PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_title)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_resolution); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depth); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos); if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shape); if (value) { values[5] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 131, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_title = values[0]; __pyx_v_resolution = values[1]; __pyx_v_flags = values[2]; __pyx_v_depth = values[3]; __pyx_v_pos = values[4]; __pyx_v_shape = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[5]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 131, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "shape", 0))) __PYX_ERR(0, 131, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window___init__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_title, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos, __pyx_v_shape); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7display_6Window___init__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth, PyObject *__pyx_v_pos, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_shape) { SDL_WindowShapeMode __pyx_v_shape_mode; long __pyx_v_gl_flag; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Uint32 __pyx_t_7; char const *__pyx_t_8; char const *__pyx_t_9; unsigned int __pyx_t_10; unsigned int __pyx_t_11; unsigned int __pyx_t_12; char const *__pyx_t_13; int __pyx_t_14; int __pyx_t_15; int __pyx_t_16; int __pyx_t_17; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_title); __Pyx_INCREF(__pyx_v_flags); /* "pygame_sdl2/display.pyx":134 * cdef SDL_WindowShapeMode shape_mode * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ __pyx_t_1 = PyBytes_Check(__pyx_v_title); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":135 * * if not isinstance(title, bytes): * title = title.encode("utf-8") # <<<<<<<<<<<<<< * * self.create_flags = flags */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_utf_8}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":134 * cdef SDL_WindowShapeMode shape_mode * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":137 * title = title.encode("utf-8") * * self.create_flags = flags # <<<<<<<<<<<<<< * * # If we do not get the AVOID_GL hint, we always create a GL-compatible */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_flags); if (unlikely((__pyx_t_7 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error) __pyx_v_self->create_flags = __pyx_t_7; /* "pygame_sdl2/display.pyx":141 * # If we do not get the AVOID_GL hint, we always create a GL-compatible * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<< * gl_flag = 0 * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_hint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":142 * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): * gl_flag = 0 # <<<<<<<<<<<<<< * else: * gl_flag = SDL_WINDOW_OPENGL */ __pyx_v_gl_flag = 0; /* "pygame_sdl2/display.pyx":141 * # If we do not get the AVOID_GL hint, we always create a GL-compatible * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<< * gl_flag = 0 * else: */ goto __pyx_L4; } /* "pygame_sdl2/display.pyx":144 * gl_flag = 0 * else: * gl_flag = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * * self.window = NULL */ /*else*/ { __pyx_v_gl_flag = SDL_WINDOW_OPENGL; } __pyx_L4:; /* "pygame_sdl2/display.pyx":146 * gl_flag = SDL_WINDOW_OPENGL * * self.window = NULL # <<<<<<<<<<<<<< * * if androidembed is not None: */ __pyx_v_self->window = NULL; /* "pygame_sdl2/display.pyx":148 * self.window = NULL * * if androidembed is not None: # <<<<<<<<<<<<<< * self.window = SDL_GL_GetCurrentWindow() * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_androidembed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__pyx_t_3 != Py_None); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":149 * * if androidembed is not None: * self.window = SDL_GL_GetCurrentWindow() # <<<<<<<<<<<<<< * * if self.window: */ __pyx_v_self->window = SDL_GL_GetCurrentWindow(); /* "pygame_sdl2/display.pyx":151 * self.window = SDL_GL_GetCurrentWindow() * * if self.window: # <<<<<<<<<<<<<< * * # Android bug - a RGB_565 format is likely to mean the window */ __pyx_t_2 = (__pyx_v_self->window != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":155 * # Android bug - a RGB_565 format is likely to mean the window * # wasn't created properly, so re-make it. * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: # <<<<<<<<<<<<<< * SDL_DestroyWindow(self.window) * self.window = NULL */ __pyx_t_2 = (SDL_GetWindowPixelFormat(__pyx_v_self->window) == SDL_PIXELFORMAT_RGB565); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":156 * # wasn't created properly, so re-make it. * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: * SDL_DestroyWindow(self.window) # <<<<<<<<<<<<<< * self.window = NULL * else: */ SDL_DestroyWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":157 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: * SDL_DestroyWindow(self.window) * self.window = NULL # <<<<<<<<<<<<<< * else: * SDL_SetWindowTitle(self.window, title) */ __pyx_v_self->window = NULL; /* "pygame_sdl2/display.pyx":155 * # Android bug - a RGB_565 format is likely to mean the window * # wasn't created properly, so re-make it. * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: # <<<<<<<<<<<<<< * SDL_DestroyWindow(self.window) * self.window = NULL */ goto __pyx_L7; } /* "pygame_sdl2/display.pyx":159 * self.window = NULL * else: * SDL_SetWindowTitle(self.window, title) # <<<<<<<<<<<<<< * * if not self.window: */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) SDL_SetWindowTitle(__pyx_v_self->window, __pyx_t_8); } __pyx_L7:; /* "pygame_sdl2/display.pyx":151 * self.window = SDL_GL_GetCurrentWindow() * * if self.window: # <<<<<<<<<<<<<< * * # Android bug - a RGB_565 format is likely to mean the window */ } /* "pygame_sdl2/display.pyx":148 * self.window = NULL * * if androidembed is not None: # <<<<<<<<<<<<<< * self.window = SDL_GL_GetCurrentWindow() * */ } /* "pygame_sdl2/display.pyx":161 * SDL_SetWindowTitle(self.window, title) * * if not self.window: # <<<<<<<<<<<<<< * * flags |= SDL_WINDOW_HIDDEN */ __pyx_t_2 = (!(__pyx_v_self->window != 0)); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":163 * if not self.window: * * flags |= SDL_WINDOW_HIDDEN # <<<<<<<<<<<<<< * * if shape is not None: */ __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_HIDDEN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_InPlaceOr(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":165 * flags |= SDL_WINDOW_HIDDEN * * if shape is not None: # <<<<<<<<<<<<<< * * shape_mode.mode = ShapeModeDefault */ __pyx_t_2 = (((PyObject *)__pyx_v_shape) != Py_None); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":167 * if shape is not None: * * shape_mode.mode = ShapeModeDefault # <<<<<<<<<<<<<< * * self.window = SDL_CreateShapedWindow( */ __pyx_v_shape_mode.mode = ShapeModeDefault; /* "pygame_sdl2/display.pyx":170 * * self.window = SDL_CreateShapedWindow( * title, # <<<<<<<<<<<<<< * pos[0], pos[1], * resolution[0], resolution[1], flags | gl_flag) */ __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L1_error) /* "pygame_sdl2/display.pyx":171 * self.window = SDL_CreateShapedWindow( * title, * pos[0], pos[1], # <<<<<<<<<<<<<< * resolution[0], resolution[1], flags | gl_flag) * */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":172 * title, * pos[0], pos[1], * resolution[0], resolution[1], flags | gl_flag) # <<<<<<<<<<<<<< * * SDL_SetWindowShape(self.window, shape.surface, &shape_mode) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_resolution, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_11 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_resolution, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_12 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_gl_flag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Or(__pyx_v_flags, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_7 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":169 * shape_mode.mode = ShapeModeDefault * * self.window = SDL_CreateShapedWindow( # <<<<<<<<<<<<<< * title, * pos[0], pos[1], */ __pyx_v_self->window = SDL_CreateShapedWindow(__pyx_t_9, __pyx_t_6, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_7); /* "pygame_sdl2/display.pyx":174 * resolution[0], resolution[1], flags | gl_flag) * * SDL_SetWindowShape(self.window, shape.surface, &shape_mode) # <<<<<<<<<<<<<< * * else: */ (void)(SDL_SetWindowShape(__pyx_v_self->window, __pyx_v_shape->surface, (&__pyx_v_shape_mode))); /* "pygame_sdl2/display.pyx":165 * flags |= SDL_WINDOW_HIDDEN * * if shape is not None: # <<<<<<<<<<<<<< * * shape_mode.mode = ShapeModeDefault */ goto __pyx_L9; } /* "pygame_sdl2/display.pyx":178 * else: * * self.window = SDL_CreateWindow( # <<<<<<<<<<<<<< * title, * pos[0], pos[1], */ /*else*/ { /* "pygame_sdl2/display.pyx":179 * * self.window = SDL_CreateWindow( * title, # <<<<<<<<<<<<<< * pos[0], pos[1], * resolution[0], resolution[1], flags | gl_flag) */ __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error) /* "pygame_sdl2/display.pyx":180 * self.window = SDL_CreateWindow( * title, * pos[0], pos[1], # <<<<<<<<<<<<<< * resolution[0], resolution[1], flags | gl_flag) * */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":181 * title, * pos[0], pos[1], * resolution[0], resolution[1], flags | gl_flag) # <<<<<<<<<<<<<< * * if pos != (SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED): */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_gl_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Or(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_7 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":178 * else: * * self.window = SDL_CreateWindow( # <<<<<<<<<<<<<< * title, * pos[0], pos[1], */ __pyx_v_self->window = SDL_CreateWindow(__pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_7); } __pyx_L9:; /* "pygame_sdl2/display.pyx":183 * resolution[0], resolution[1], flags | gl_flag) * * if pos != (SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED): # <<<<<<<<<<<<<< * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * */ __pyx_t_4 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_v_pos, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":184 * * if pos != (SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED): * SDL_SetWindowPosition(self.window, pos[0], pos[1]) # <<<<<<<<<<<<<< * * SDL_ShowWindow(self.window) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; SDL_SetWindowPosition(__pyx_v_self->window, __pyx_t_17, __pyx_t_16); /* "pygame_sdl2/display.pyx":183 * resolution[0], resolution[1], flags | gl_flag) * * if pos != (SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED): # <<<<<<<<<<<<<< * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * */ } /* "pygame_sdl2/display.pyx":186 * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * * SDL_ShowWindow(self.window) # <<<<<<<<<<<<<< * * if not self.window: */ SDL_ShowWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":161 * SDL_SetWindowTitle(self.window, title) * * if not self.window: # <<<<<<<<<<<<<< * * flags |= SDL_WINDOW_HIDDEN */ } /* "pygame_sdl2/display.pyx":188 * SDL_ShowWindow(self.window) * * if not self.window: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (!(__pyx_v_self->window != 0)); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/display.pyx":189 * * if not self.window: * raise error() # <<<<<<<<<<<<<< * * # From here on, the window exists. So we have to call self.destroy if */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_12, 0+__pyx_t_12); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 189, __pyx_L1_error) /* "pygame_sdl2/display.pyx":188 * SDL_ShowWindow(self.window) * * if not self.window: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":194 * # an exception occurs. * * try: # <<<<<<<<<<<<<< * * if flags & SDL_WINDOW_OPENGL: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); /*try:*/ { /* "pygame_sdl2/display.pyx":196 * try: * * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<< * * self.gl_context = SDL_GL_CreateContext(self.window) */ __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 196, __pyx_L12_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":198 * if flags & SDL_WINDOW_OPENGL: * * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<< * * if self.gl_context == NULL: */ __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":200 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_self->gl_context == NULL); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/display.pyx":201 * * if self.gl_context == NULL: * raise error() # <<<<<<<<<<<<<< * * SDL_GL_MakeCurrent(self.window, self.gl_context) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_12, 0+__pyx_t_12); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 201, __pyx_L12_error) /* "pygame_sdl2/display.pyx":200 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":203 * raise error() * * SDL_GL_MakeCurrent(self.window, self.gl_context) # <<<<<<<<<<<<<< * * if not ios: */ (void)(SDL_GL_MakeCurrent(__pyx_v_self->window, __pyx_v_self->gl_context)); /* "pygame_sdl2/display.pyx":205 * SDL_GL_MakeCurrent(self.window, self.gl_context) * * if not ios: # <<<<<<<<<<<<<< * # Try setting the swap interval - first positive, then negated * # to deal with the case where the negative interval isn't */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ios); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 205, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 205, __pyx_L12_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = (!__pyx_t_2); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":209 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<< * if default_swap_control < 0: * SDL_GL_SetSwapInterval(-default_swap_control) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L12_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = (SDL_GL_SetSwapInterval(__pyx_t_16) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":210 * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): * if default_swap_control < 0: # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-default_swap_control) * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L12_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 210, __pyx_L12_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":211 * if SDL_GL_SetSwapInterval(default_swap_control): * if default_swap_control < 0: * SDL_GL_SetSwapInterval(-default_swap_control) # <<<<<<<<<<<<<< * * self.create_surface() */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 211, __pyx_L12_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (void)(SDL_GL_SetSwapInterval(__pyx_t_16)); /* "pygame_sdl2/display.pyx":210 * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): * if default_swap_control < 0: # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-default_swap_control) * */ } /* "pygame_sdl2/display.pyx":209 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<< * if default_swap_control < 0: * SDL_GL_SetSwapInterval(-default_swap_control) */ } /* "pygame_sdl2/display.pyx":205 * SDL_GL_MakeCurrent(self.window, self.gl_context) * * if not ios: # <<<<<<<<<<<<<< * # Try setting the swap interval - first positive, then negated * # to deal with the case where the negative interval isn't */ } /* "pygame_sdl2/display.pyx":196 * try: * * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<< * * self.gl_context = SDL_GL_CreateContext(self.window) */ } /* "pygame_sdl2/display.pyx":213 * SDL_GL_SetSwapInterval(-default_swap_control) * * self.create_surface() # <<<<<<<<<<<<<< * * except: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_12, 0+__pyx_t_12); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":194 * # an exception occurs. * * try: # <<<<<<<<<<<<<< * * if flags & SDL_WINDOW_OPENGL: */ } __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; goto __pyx_L17_try_end; __pyx_L12_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":215 * self.create_surface() * * except: # <<<<<<<<<<<<<< * self.destroy() * raise */ /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 215, __pyx_L14_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":216 * * except: * self.destroy() # <<<<<<<<<<<<<< * raise * */ __pyx_t_22 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 216, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_23 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_22))) { __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_22); if (likely(__pyx_t_23)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22); __Pyx_INCREF(__pyx_t_23); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_22, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_23, NULL}; __pyx_t_21 = __Pyx_PyObject_FastCall(__pyx_t_22, __pyx_callargs+1-__pyx_t_12, 0+__pyx_t_12); __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 216, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; } __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; /* "pygame_sdl2/display.pyx":217 * except: * self.destroy() * raise # <<<<<<<<<<<<<< * * def create_surface(self): */ __Pyx_GIVEREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_3, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 217, __pyx_L14_except_error) } /* "pygame_sdl2/display.pyx":194 * # an exception occurs. * * try: # <<<<<<<<<<<<<< * * if flags & SDL_WINDOW_OPENGL: */ __pyx_L14_except_error:; __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); goto __pyx_L1_error; __pyx_L17_try_end:; } /* "pygame_sdl2/display.pyx":131 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED), Surface shape=None): # <<<<<<<<<<<<<< * cdef SDL_WindowShapeMode shape_mode * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_21); __Pyx_XDECREF(__pyx_t_22); __Pyx_XDECREF(__pyx_t_23); __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_title); __Pyx_XDECREF(__pyx_v_flags); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":219 * raise * * def create_surface(self): # <<<<<<<<<<<<<< * """ * Creates the surface associated with this window. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_2create_surface, "Window.create_surface(self)\n\n Creates the surface associated with this window.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_3create_surface = {"create_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_2create_surface}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create_surface (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("create_surface", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "create_surface", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; SDL_Surface *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_surface", 1); /* "pygame_sdl2/display.pyx":225 * * cdef int w, h * SDL_GetWindowSize(self.window, &w, &h) # <<<<<<<<<<<<<< * * if self.gl_context: */ SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h)); /* "pygame_sdl2/display.pyx":227 * SDL_GetWindowSize(self.window, &w, &h) * * if self.gl_context: # <<<<<<<<<<<<<< * * # For now, make this the size of the window so get_size() works. */ __pyx_t_1 = (__pyx_v_self->gl_context != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":232 * # TODO: Make this a bit less wasteful of memory, even if it means * # we lie about the actual size of the pixel array. * self.surface = Surface((w, h), SRCALPHA, 32) # <<<<<<<<<<<<<< * * else: */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error); __Pyx_INCREF(__pyx_int_32); __Pyx_GIVEREF(__pyx_int_32); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32)) __PYX_ERR(0, 232, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF((PyObject *)__pyx_v_self->surface); __Pyx_DECREF((PyObject *)__pyx_v_self->surface); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":227 * SDL_GetWindowSize(self.window, &w, &h) * * if self.gl_context: # <<<<<<<<<<<<<< * * # For now, make this the size of the window so get_size() works. */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":236 * else: * * self.window_surface = SDL_GetWindowSurface(self.window) # <<<<<<<<<<<<<< * * # If the surface is 32-bit, we can use it directly. Otherwise, */ /*else*/ { __pyx_v_self->window_surface = SDL_GetWindowSurface(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":240 * # If the surface is 32-bit, we can use it directly. Otherwise, * # we need to create a 32-bit proxy surface. * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * * self.surface = Surface(()) */ __pyx_t_1 = (__pyx_v_self->window_surface->format->BitsPerPixel == 32); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":242 * if self.window_surface.format.BitsPerPixel == 32: * * self.surface = Surface(()) # <<<<<<<<<<<<<< * self.surface.surface = self.window_surface * self.surface.owns_surface = False */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF((PyObject *)__pyx_v_self->surface); __Pyx_DECREF((PyObject *)__pyx_v_self->surface); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":243 * * self.surface = Surface(()) * self.surface.surface = self.window_surface # <<<<<<<<<<<<<< * self.surface.owns_surface = False * self.surface.window_surface = True */ __pyx_t_5 = __pyx_v_self->window_surface; __pyx_v_self->surface->surface = __pyx_t_5; /* "pygame_sdl2/display.pyx":244 * self.surface = Surface(()) * self.surface.surface = self.window_surface * self.surface.owns_surface = False # <<<<<<<<<<<<<< * self.surface.window_surface = True * */ __pyx_v_self->surface->owns_surface = 0; /* "pygame_sdl2/display.pyx":245 * self.surface.surface = self.window_surface * self.surface.owns_surface = False * self.surface.window_surface = True # <<<<<<<<<<<<<< * * else: */ __pyx_v_self->surface->window_surface = 1; /* "pygame_sdl2/display.pyx":240 * # If the surface is 32-bit, we can use it directly. Otherwise, * # we need to create a 32-bit proxy surface. * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * * self.surface = Surface(()) */ goto __pyx_L4; } /* "pygame_sdl2/display.pyx":248 * * else: * self.surface = Surface((w, h), 0, 32) # <<<<<<<<<<<<<< * * self.surface.get_window_flags = self.get_window_flags */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0)) __PYX_ERR(0, 248, __pyx_L1_error); __Pyx_INCREF(__pyx_int_32); __Pyx_GIVEREF(__pyx_int_32); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32)) __PYX_ERR(0, 248, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF((PyObject *)__pyx_v_self->surface); __Pyx_DECREF((PyObject *)__pyx_v_self->surface); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L4:; } __pyx_L3:; /* "pygame_sdl2/display.pyx":250 * self.surface = Surface((w, h), 0, 32) * * self.surface.get_window_flags = self.get_window_flags # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_window_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags); __Pyx_DECREF(__pyx_v_self->surface->get_window_flags); __pyx_v_self->surface->get_window_flags = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":219 * raise * * def create_surface(self): # <<<<<<<<<<<<<< * """ * Creates the surface associated with this window. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.create_surface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":253 * * * def destroy(self): # <<<<<<<<<<<<<< * """ * This should be called before the window is deleted. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_4destroy, "Window.destroy(self)\n\n This should be called before the window is deleted.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_5destroy = {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_4destroy}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_5destroy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_4destroy(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_4destroy(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "pygame_sdl2/display.pyx":258 * """ * * if self.gl_context != NULL: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * */ __pyx_t_1 = (__pyx_v_self->gl_context != NULL); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":259 * * if self.gl_context != NULL: * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<< * * if self.surface: */ SDL_GL_DeleteContext(__pyx_v_self->gl_context); /* "pygame_sdl2/display.pyx":258 * """ * * if self.gl_context != NULL: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * */ } /* "pygame_sdl2/display.pyx":261 * SDL_GL_DeleteContext(self.gl_context) * * if self.surface: # <<<<<<<<<<<<<< * * # Break the cycle that prevents refcounting from collecting this */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->surface)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 261, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":265 * # Break the cycle that prevents refcounting from collecting this * # object. * self.surface.get_window_flags = None # <<<<<<<<<<<<<< * * # Necessary to collect the GL surface, doesn't hurt the window surface. */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags); __Pyx_DECREF(__pyx_v_self->surface->get_window_flags); __pyx_v_self->surface->get_window_flags = Py_None; /* "pygame_sdl2/display.pyx":268 * * # Necessary to collect the GL surface, doesn't hurt the window surface. * self.surface = None # <<<<<<<<<<<<<< * * SDL_DestroyWindow(self.window) */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF((PyObject *)__pyx_v_self->surface); __Pyx_DECREF((PyObject *)__pyx_v_self->surface); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); /* "pygame_sdl2/display.pyx":261 * SDL_GL_DeleteContext(self.gl_context) * * if self.surface: # <<<<<<<<<<<<<< * * # Break the cycle that prevents refcounting from collecting this */ } /* "pygame_sdl2/display.pyx":270 * self.surface = None * * SDL_DestroyWindow(self.window) # <<<<<<<<<<<<<< * * def resize(self, size, opengl=False, fullscreen=None, maximized=None): */ SDL_DestroyWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":253 * * * def destroy(self): # <<<<<<<<<<<<<< * """ * This should be called before the window is deleted. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":272 * SDL_DestroyWindow(self.window) * * def resize(self, size, opengl=False, fullscreen=None, maximized=None): # <<<<<<<<<<<<<< * """ * Resizes the window to `size`, which must be a width, height tuple. If opengl */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7resize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_6resize, "Window.resize(self, size, opengl=False, fullscreen=None, maximized=None)\n\n Resizes the window to `size`, which must be a width, height tuple. If opengl\n is true, adds an OpenGL context, if it's missing. Otherwise, removes the\n opengl context if present.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_7resize = {"resize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_7resize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_6resize}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7resize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_opengl = 0; PyObject *__pyx_v_fullscreen = 0; PyObject *__pyx_v_maximized = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("resize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_opengl,&__pyx_n_s_fullscreen,&__pyx_n_s_maximized,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_opengl); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fullscreen); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maximized); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "resize") < 0)) __PYX_ERR(0, 272, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_opengl = values[1]; __pyx_v_fullscreen = values[2]; __pyx_v_maximized = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("resize", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 272, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.resize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_6resize(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_size, __pyx_v_opengl, __pyx_v_fullscreen, __pyx_v_maximized); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_6resize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_opengl, PyObject *__pyx_v_fullscreen, PyObject *__pyx_v_maximized) { Uint32 __pyx_v_flags; int __pyx_v_cur_width; int __pyx_v_cur_height; PyObject *__pyx_v_width = NULL; PyObject *__pyx_v_height = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; unsigned int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("resize", 0); __Pyx_INCREF(__pyx_v_fullscreen); __Pyx_INCREF(__pyx_v_maximized); /* "pygame_sdl2/display.pyx":279 * """ * * flags = SDL_GetWindowFlags(self.window) # <<<<<<<<<<<<<< * * if fullscreen is None: */ __pyx_v_flags = SDL_GetWindowFlags(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":281 * flags = SDL_GetWindowFlags(self.window) * * if fullscreen is None: # <<<<<<<<<<<<<< * fullscreen = flags & SDL_WINDOW_FULLSCREEN_DESKTOP * */ __pyx_t_1 = (__pyx_v_fullscreen == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":282 * * if fullscreen is None: * fullscreen = flags & SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<< * * if maximized is None: */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_flags & SDL_WINDOW_FULLSCREEN_DESKTOP)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_fullscreen, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":281 * flags = SDL_GetWindowFlags(self.window) * * if fullscreen is None: # <<<<<<<<<<<<<< * fullscreen = flags & SDL_WINDOW_FULLSCREEN_DESKTOP * */ } /* "pygame_sdl2/display.pyx":284 * fullscreen = flags & SDL_WINDOW_FULLSCREEN_DESKTOP * * if maximized is None: # <<<<<<<<<<<<<< * maximized = flags & SDL_WINDOW_MAXIMIZED * */ __pyx_t_1 = (__pyx_v_maximized == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":285 * * if maximized is None: * maximized = flags & SDL_WINDOW_MAXIMIZED # <<<<<<<<<<<<<< * * if fullscreen: */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_flags & SDL_WINDOW_MAXIMIZED)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_maximized, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":284 * fullscreen = flags & SDL_WINDOW_FULLSCREEN_DESKTOP * * if maximized is None: # <<<<<<<<<<<<<< * maximized = flags & SDL_WINDOW_MAXIMIZED * */ } /* "pygame_sdl2/display.pyx":287 * maximized = flags & SDL_WINDOW_MAXIMIZED * * if fullscreen: # <<<<<<<<<<<<<< * maximized = False * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 287, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":288 * * if fullscreen: * maximized = False # <<<<<<<<<<<<<< * * # Prevents a loop between the surface and this object. */ __Pyx_INCREF(Py_False); __Pyx_DECREF_SET(__pyx_v_maximized, Py_False); /* "pygame_sdl2/display.pyx":287 * maximized = flags & SDL_WINDOW_MAXIMIZED * * if fullscreen: # <<<<<<<<<<<<<< * maximized = False * */ } /* "pygame_sdl2/display.pyx":291 * * # Prevents a loop between the surface and this object. * self.surface.get_window_flags = None # <<<<<<<<<<<<<< * * if self.gl_context and not opengl: */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags); __Pyx_DECREF(__pyx_v_self->surface->get_window_flags); __pyx_v_self->surface->get_window_flags = Py_None; /* "pygame_sdl2/display.pyx":293 * self.surface.get_window_flags = None * * if self.gl_context and not opengl: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * self.gl_context = NULL */ __pyx_t_3 = (__pyx_v_self->gl_context != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L7_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 293, __pyx_L1_error) __pyx_t_4 = (!__pyx_t_3); __pyx_t_1 = __pyx_t_4; __pyx_L7_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":294 * * if self.gl_context and not opengl: * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<< * self.gl_context = NULL * */ SDL_GL_DeleteContext(__pyx_v_self->gl_context); /* "pygame_sdl2/display.pyx":295 * if self.gl_context and not opengl: * SDL_GL_DeleteContext(self.gl_context) * self.gl_context = NULL # <<<<<<<<<<<<<< * * cdef int cur_width = 0 */ __pyx_v_self->gl_context = NULL; /* "pygame_sdl2/display.pyx":293 * self.surface.get_window_flags = None * * if self.gl_context and not opengl: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * self.gl_context = NULL */ } /* "pygame_sdl2/display.pyx":297 * self.gl_context = NULL * * cdef int cur_width = 0 # <<<<<<<<<<<<<< * cdef int cur_height = 0 * */ __pyx_v_cur_width = 0; /* "pygame_sdl2/display.pyx":298 * * cdef int cur_width = 0 * cdef int cur_height = 0 # <<<<<<<<<<<<<< * * if (not fullscreen) and (not maximized) and (flags & SDL_WINDOW_MAXIMIZED): */ __pyx_v_cur_height = 0; /* "pygame_sdl2/display.pyx":300 * cdef int cur_height = 0 * * if (not fullscreen) and (not maximized) and (flags & SDL_WINDOW_MAXIMIZED): # <<<<<<<<<<<<<< * SDL_RestoreWindow(self.window) * */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 300, __pyx_L1_error) __pyx_t_3 = (!__pyx_t_4); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L10_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_maximized); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 300, __pyx_L1_error) __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L10_bool_binop_done; } __pyx_t_4 = ((__pyx_v_flags & SDL_WINDOW_MAXIMIZED) != 0); __pyx_t_1 = __pyx_t_4; __pyx_L10_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":301 * * if (not fullscreen) and (not maximized) and (flags & SDL_WINDOW_MAXIMIZED): * SDL_RestoreWindow(self.window) # <<<<<<<<<<<<<< * * if fullscreen: */ SDL_RestoreWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":300 * cdef int cur_height = 0 * * if (not fullscreen) and (not maximized) and (flags & SDL_WINDOW_MAXIMIZED): # <<<<<<<<<<<<<< * SDL_RestoreWindow(self.window) * */ } /* "pygame_sdl2/display.pyx":303 * SDL_RestoreWindow(self.window) * * if fullscreen: # <<<<<<<<<<<<<< * * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 303, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":305 * if fullscreen: * * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * fullscreen = False * */ __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":306 * * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): * fullscreen = False # <<<<<<<<<<<<<< * * if not fullscreen: */ __Pyx_INCREF(Py_False); __Pyx_DECREF_SET(__pyx_v_fullscreen, Py_False); /* "pygame_sdl2/display.pyx":305 * if fullscreen: * * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * fullscreen = False * */ } /* "pygame_sdl2/display.pyx":303 * SDL_RestoreWindow(self.window) * * if fullscreen: # <<<<<<<<<<<<<< * * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): */ } /* "pygame_sdl2/display.pyx":308 * fullscreen = False * * if not fullscreen: # <<<<<<<<<<<<<< * SDL_SetWindowFullscreen(self.window, 0) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) __pyx_t_4 = (!__pyx_t_1); if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":309 * * if not fullscreen: * SDL_SetWindowFullscreen(self.window, 0) # <<<<<<<<<<<<<< * * if (not fullscreen) and (not maximized): */ (void)(SDL_SetWindowFullscreen(__pyx_v_self->window, 0)); /* "pygame_sdl2/display.pyx":308 * fullscreen = False * * if not fullscreen: # <<<<<<<<<<<<<< * SDL_SetWindowFullscreen(self.window, 0) * */ } /* "pygame_sdl2/display.pyx":311 * SDL_SetWindowFullscreen(self.window, 0) * * if (not fullscreen) and (not maximized): # <<<<<<<<<<<<<< * * width, height = size */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 311, __pyx_L1_error) __pyx_t_3 = (!__pyx_t_1); if (__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L17_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_maximized); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 311, __pyx_L1_error) __pyx_t_1 = (!__pyx_t_3); __pyx_t_4 = __pyx_t_1; __pyx_L17_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":313 * if (not fullscreen) and (not maximized): * * width, height = size # <<<<<<<<<<<<<< * * SDL_GetWindowSize(self.window, &cur_width, &cur_height) */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 313, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 313, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L20_unpacking_done; __pyx_L19_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 313, __pyx_L1_error) __pyx_L20_unpacking_done:; } __pyx_v_width = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_height = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":315 * width, height = size * * SDL_GetWindowSize(self.window, &cur_width, &cur_height) # <<<<<<<<<<<<<< * * if (cur_width != width) or (cur_height != height): */ SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_cur_width), (&__pyx_v_cur_height)); /* "pygame_sdl2/display.pyx":317 * SDL_GetWindowSize(self.window, &cur_width, &cur_height) * * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<< * SDL_SetWindowSize(self.window, width, height) * */ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_cur_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_v_width, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_1) { } else { __pyx_t_4 = __pyx_t_1; goto __pyx_L22_bool_binop_done; } __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_cur_height); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_v_height, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __pyx_t_1; __pyx_L22_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":318 * * if (cur_width != width) or (cur_height != height): * SDL_SetWindowSize(self.window, width, height) # <<<<<<<<<<<<<< * * if maximized: */ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L1_error) __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_height); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L1_error) SDL_SetWindowSize(__pyx_v_self->window, __pyx_t_8, __pyx_t_9); /* "pygame_sdl2/display.pyx":317 * SDL_GetWindowSize(self.window, &cur_width, &cur_height) * * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<< * SDL_SetWindowSize(self.window, width, height) * */ } /* "pygame_sdl2/display.pyx":311 * SDL_SetWindowFullscreen(self.window, 0) * * if (not fullscreen) and (not maximized): # <<<<<<<<<<<<<< * * width, height = size */ } /* "pygame_sdl2/display.pyx":320 * SDL_SetWindowSize(self.window, width, height) * * if maximized: # <<<<<<<<<<<<<< * SDL_MaximizeWindow(self.window) * */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_maximized); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 320, __pyx_L1_error) if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":321 * * if maximized: * SDL_MaximizeWindow(self.window) # <<<<<<<<<<<<<< * * # Create a missing GL context. */ SDL_MaximizeWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":320 * SDL_SetWindowSize(self.window, width, height) * * if maximized: # <<<<<<<<<<<<<< * SDL_MaximizeWindow(self.window) * */ } /* "pygame_sdl2/display.pyx":324 * * # Create a missing GL context. * if opengl and not self.gl_context: # <<<<<<<<<<<<<< * self.gl_context = SDL_GL_CreateContext(self.window) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 324, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_4 = __pyx_t_1; goto __pyx_L26_bool_binop_done; } __pyx_t_1 = (!(__pyx_v_self->gl_context != 0)); __pyx_t_4 = __pyx_t_1; __pyx_L26_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":325 * # Create a missing GL context. * if opengl and not self.gl_context: * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<< * * if self.gl_context == NULL: */ __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":327 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = (__pyx_v_self->gl_context == NULL); if (unlikely(__pyx_t_4)) { /* "pygame_sdl2/display.pyx":328 * * if self.gl_context == NULL: * raise error() # <<<<<<<<<<<<<< * * self.create_surface() */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 328, __pyx_L1_error) /* "pygame_sdl2/display.pyx":327 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":324 * * # Create a missing GL context. * if opengl and not self.gl_context: # <<<<<<<<<<<<<< * self.gl_context = SDL_GL_CreateContext(self.window) * */ } /* "pygame_sdl2/display.pyx":330 * raise error() * * self.create_surface() # <<<<<<<<<<<<<< * * def recreate_gl_context(self, always=False): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":272 * SDL_DestroyWindow(self.window) * * def resize(self, size, opengl=False, fullscreen=None, maximized=None): # <<<<<<<<<<<<<< * """ * Resizes the window to `size`, which must be a width, height tuple. If opengl */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.Window.resize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_width); __Pyx_XDECREF(__pyx_v_height); __Pyx_XDECREF(__pyx_v_fullscreen); __Pyx_XDECREF(__pyx_v_maximized); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":332 * self.create_surface() * * def recreate_gl_context(self, always=False): # <<<<<<<<<<<<<< * """ * Check to see if the GL context was lost, and re-create it if it was. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_9recreate_gl_context(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_8recreate_gl_context, "Window.recreate_gl_context(self, always=False)\n\n Check to see if the GL context was lost, and re-create it if it was.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_9recreate_gl_context = {"recreate_gl_context", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_9recreate_gl_context, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_8recreate_gl_context}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_9recreate_gl_context(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_always = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("recreate_gl_context (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_always,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_always); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "recreate_gl_context") < 0)) __PYX_ERR(0, 332, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_always = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("recreate_gl_context", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 332, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.recreate_gl_context", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_8recreate_gl_context(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_always); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_8recreate_gl_context(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_always) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("recreate_gl_context", 1); /* "pygame_sdl2/display.pyx":337 * """ * * if not always: # <<<<<<<<<<<<<< * if SDL_GL_GetCurrentContext(): * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_always); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 337, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":338 * * if not always: * if SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<< * return False * */ __pyx_t_2 = (((unsigned long)SDL_GL_GetCurrentContext()) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":339 * if not always: * if SDL_GL_GetCurrentContext(): * return False # <<<<<<<<<<<<<< * * self.gl_context = SDL_GL_CreateContext(self.window) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":338 * * if not always: * if SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/display.pyx":337 * """ * * if not always: # <<<<<<<<<<<<<< * if SDL_GL_GetCurrentContext(): * return False */ } /* "pygame_sdl2/display.pyx":341 * return False * * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<< * * if self.gl_context == NULL: */ __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":343 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_self->gl_context == NULL); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/display.pyx":344 * * if self.gl_context == NULL: * raise error() # <<<<<<<<<<<<<< * * SDL_GL_MakeCurrent(self.window, self.gl_context) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 344, __pyx_L1_error) /* "pygame_sdl2/display.pyx":343 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":346 * raise error() * * SDL_GL_MakeCurrent(self.window, self.gl_context) # <<<<<<<<<<<<<< * * return True */ (void)(SDL_GL_MakeCurrent(__pyx_v_self->window, __pyx_v_self->gl_context)); /* "pygame_sdl2/display.pyx":348 * SDL_GL_MakeCurrent(self.window, self.gl_context) * * return True # <<<<<<<<<<<<<< * * def get_window_flags(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":332 * self.create_surface() * * def recreate_gl_context(self, always=False): # <<<<<<<<<<<<<< * """ * Check to see if the GL context was lost, and re-create it if it was. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.Window.recreate_gl_context", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":350 * return True * * def get_window_flags(self): # <<<<<<<<<<<<<< * rv = SDL_GetWindowFlags(self.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_11get_window_flags(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_10get_window_flags, "Window.get_window_flags(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_11get_window_flags = {"get_window_flags", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_11get_window_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_10get_window_flags}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_11get_window_flags(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_window_flags (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_window_flags", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_window_flags", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_10get_window_flags(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_10get_window_flags(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_window_flags", 1); /* "pygame_sdl2/display.pyx":351 * * def get_window_flags(self): * rv = SDL_GetWindowFlags(self.window) # <<<<<<<<<<<<<< * * if self.gl_context: */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetWindowFlags(__pyx_v_self->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":353 * rv = SDL_GetWindowFlags(self.window) * * if self.gl_context: # <<<<<<<<<<<<<< * rv |= SDL_WINDOW_OPENGL * else: */ __pyx_t_2 = (__pyx_v_self->gl_context != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":354 * * if self.gl_context: * rv |= SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * else: * rv &= ~SDL_WINDOW_OPENGL */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_rv, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":353 * rv = SDL_GetWindowFlags(self.window) * * if self.gl_context: # <<<<<<<<<<<<<< * rv |= SDL_WINDOW_OPENGL * else: */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":356 * rv |= SDL_WINDOW_OPENGL * else: * rv &= ~SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * * return rv */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int((~SDL_WINDOW_OPENGL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceAnd(__pyx_v_rv, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/display.pyx":358 * rv &= ~SDL_WINDOW_OPENGL * * return rv # <<<<<<<<<<<<<< * * def proxy_window_surface(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/display.pyx":350 * return True * * def get_window_flags(self): # <<<<<<<<<<<<<< * rv = SDL_GetWindowFlags(self.window) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_window_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":360 * return rv * * def proxy_window_surface(self): # <<<<<<<<<<<<<< * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_13proxy_window_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_12proxy_window_surface, "Window.proxy_window_surface(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_13proxy_window_surface = {"proxy_window_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_13proxy_window_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_12proxy_window_surface}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_13proxy_window_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("proxy_window_surface (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("proxy_window_surface", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "proxy_window_surface", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_12proxy_window_surface(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_12proxy_window_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("proxy_window_surface", 1); /* "pygame_sdl2/display.pyx":361 * * def proxy_window_surface(self): * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) # <<<<<<<<<<<<<< * * def flip(self): */ (void)(SDL_UpperBlit(__pyx_v_self->surface->surface, NULL, __pyx_v_self->window_surface, NULL)); /* "pygame_sdl2/display.pyx":360 * return rv * * def proxy_window_surface(self): # <<<<<<<<<<<<<< * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":363 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * * def flip(self): # <<<<<<<<<<<<<< * cdef const char *err * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_15flip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_14flip, "Window.flip(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_15flip = {"flip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_15flip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_14flip}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_15flip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("flip", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "flip", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_14flip(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_14flip(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { char const *__pyx_v_err; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flip", 1); /* "pygame_sdl2/display.pyx":366 * cdef const char *err * * if self.gl_context != NULL: # <<<<<<<<<<<<<< * with nogil: * SDL_ClearError(); */ __pyx_t_1 = (__pyx_v_self->gl_context != NULL); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":367 * * if self.gl_context != NULL: * with nogil: # <<<<<<<<<<<<<< * SDL_ClearError(); * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/display.pyx":368 * if self.gl_context != NULL: * with nogil: * SDL_ClearError(); # <<<<<<<<<<<<<< * * SDL_GL_SwapWindow(self.window) */ SDL_ClearError(); /* "pygame_sdl2/display.pyx":370 * SDL_ClearError(); * * SDL_GL_SwapWindow(self.window) # <<<<<<<<<<<<<< * * err = SDL_GetError() */ SDL_GL_SwapWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":372 * SDL_GL_SwapWindow(self.window) * * err = SDL_GetError() # <<<<<<<<<<<<<< * * if err[0]: */ __pyx_v_err = SDL_GetError(); } /* "pygame_sdl2/display.pyx":367 * * if self.gl_context != NULL: * with nogil: # <<<<<<<<<<<<<< * SDL_ClearError(); * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/display.pyx":374 * err = SDL_GetError() * * if err[0]: # <<<<<<<<<<<<<< * raise error(err) * */ __pyx_t_1 = ((__pyx_v_err[0]) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":375 * * if err[0]: * raise error(err) # <<<<<<<<<<<<<< * * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 375, __pyx_L1_error) /* "pygame_sdl2/display.pyx":374 * err = SDL_GetError() * * if err[0]: # <<<<<<<<<<<<<< * raise error(err) * */ } /* "pygame_sdl2/display.pyx":366 * cdef const char *err * * if self.gl_context != NULL: # <<<<<<<<<<<<<< * with nogil: * SDL_ClearError(); */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":379 * else: * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ /*else*/ { __pyx_t_1 = (__pyx_v_self->surface->surface != __pyx_v_self->window_surface); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":380 * * if self.surface.surface != self.window_surface: * self.proxy_window_surface() # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":379 * else: * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ } /* "pygame_sdl2/display.pyx":382 * self.proxy_window_surface() * * with nogil: # <<<<<<<<<<<<<< * SDL_UpdateWindowSurface(self.window) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/display.pyx":383 * * with nogil: * SDL_UpdateWindowSurface(self.window) # <<<<<<<<<<<<<< * * def get_surface(self): */ (void)(SDL_UpdateWindowSurface(__pyx_v_self->window)); } /* "pygame_sdl2/display.pyx":382 * self.proxy_window_surface() * * with nogil: # <<<<<<<<<<<<<< * SDL_UpdateWindowSurface(self.window) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } } __pyx_L3:; /* "pygame_sdl2/display.pyx":363 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * * def flip(self): # <<<<<<<<<<<<<< * cdef const char *err * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.Window.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":385 * SDL_UpdateWindowSurface(self.window) * * def get_surface(self): # <<<<<<<<<<<<<< * return self.surface * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_17get_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_16get_surface, "Window.get_surface(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_17get_surface = {"get_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_17get_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_16get_surface}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_17get_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_surface (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_surface", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_surface", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_16get_surface(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_16get_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_surface", 1); /* "pygame_sdl2/display.pyx":386 * * def get_surface(self): * return self.surface # <<<<<<<<<<<<<< * * def update(self, rectangles=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->surface); __pyx_r = ((PyObject *)__pyx_v_self->surface); goto __pyx_L0; /* "pygame_sdl2/display.pyx":385 * SDL_UpdateWindowSurface(self.window) * * def get_surface(self): # <<<<<<<<<<<<<< * return self.surface * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":388 * return self.surface * * def update(self, rectangles=None): # <<<<<<<<<<<<<< * * cdef SDL_Rect *rects */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_19update(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_18update, "Window.update(self, rectangles=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_19update = {"update", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_19update, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_18update}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_19update(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rectangles = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rectangles,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rectangles); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "update") < 0)) __PYX_ERR(0, 388, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rectangles = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 388, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_18update(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_rectangles); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_18update(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_rectangles) { SDL_Rect *__pyx_v_rects; int __pyx_v_count; PyObject *__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; int __pyx_t_10; char const *__pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update", 0); __Pyx_INCREF(__pyx_v_rectangles); /* "pygame_sdl2/display.pyx":391 * * cdef SDL_Rect *rects * cdef int count = 0 # <<<<<<<<<<<<<< * * if rectangles is None: */ __pyx_v_count = 0; /* "pygame_sdl2/display.pyx":393 * cdef int count = 0 * * if rectangles is None: # <<<<<<<<<<<<<< * self.flip() * return */ __pyx_t_1 = (__pyx_v_rectangles == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":394 * * if rectangles is None: * self.flip() # <<<<<<<<<<<<<< * return * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":395 * if rectangles is None: * self.flip() * return # <<<<<<<<<<<<<< * * if self.surface.surface != self.window_surface: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":393 * cdef int count = 0 * * if rectangles is None: # <<<<<<<<<<<<<< * self.flip() * return */ } /* "pygame_sdl2/display.pyx":397 * return * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ __pyx_t_1 = (__pyx_v_self->surface->surface != __pyx_v_self->window_surface); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":398 * * if self.surface.surface != self.window_surface: * self.proxy_window_surface() # <<<<<<<<<<<<<< * * if not isinstance(rectangles, list): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":397 * return * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ } /* "pygame_sdl2/display.pyx":400 * self.proxy_window_surface() * * if not isinstance(rectangles, list): # <<<<<<<<<<<<<< * rectangles = [ rectangles ] * */ __pyx_t_1 = PyList_Check(__pyx_v_rectangles); __pyx_t_6 = (!__pyx_t_1); if (__pyx_t_6) { /* "pygame_sdl2/display.pyx":401 * * if not isinstance(rectangles, list): * rectangles = [ rectangles ] # <<<<<<<<<<<<<< * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_rectangles); __Pyx_GIVEREF(__pyx_v_rectangles); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_rectangles)) __PYX_ERR(0, 401, __pyx_L1_error); __Pyx_DECREF_SET(__pyx_v_rectangles, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":400 * self.proxy_window_surface() * * if not isinstance(rectangles, list): # <<<<<<<<<<<<<< * rectangles = [ rectangles ] * */ } /* "pygame_sdl2/display.pyx":403 * rectangles = [ rectangles ] * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * if rects == NULL: * raise MemoryError("Couldn't allocate rectangles.") */ __pyx_t_7 = PyObject_Length(__pyx_v_rectangles); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 403, __pyx_L1_error) __pyx_v_rects = ((SDL_Rect *)calloc(__pyx_t_7, (sizeof(SDL_Rect)))); /* "pygame_sdl2/display.pyx":404 * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: # <<<<<<<<<<<<<< * raise MemoryError("Couldn't allocate rectangles.") * */ __pyx_t_6 = (__pyx_v_rects == NULL); if (unlikely(__pyx_t_6)) { /* "pygame_sdl2/display.pyx":405 * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 405, __pyx_L1_error) /* "pygame_sdl2/display.pyx":404 * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: # <<<<<<<<<<<<<< * raise MemoryError("Couldn't allocate rectangles.") * */ } /* "pygame_sdl2/display.pyx":407 * raise MemoryError("Couldn't allocate rectangles.") * * try: # <<<<<<<<<<<<<< * * for i in rectangles: */ /*try:*/ { /* "pygame_sdl2/display.pyx":409 * try: * * for i in rectangles: # <<<<<<<<<<<<<< * if i is None: * continue */ if (likely(PyList_CheckExact(__pyx_v_rectangles)) || PyTuple_CheckExact(__pyx_v_rectangles)) { __pyx_t_2 = __pyx_v_rectangles; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_rectangles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 409, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 409, __pyx_L8_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 409, __pyx_L8_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 409, __pyx_L8_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 409, __pyx_L8_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_8(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 409, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":410 * * for i in rectangles: * if i is None: # <<<<<<<<<<<<<< * continue * */ __pyx_t_6 = (__pyx_v_i == Py_None); if (__pyx_t_6) { /* "pygame_sdl2/display.pyx":411 * for i in rectangles: * if i is None: * continue # <<<<<<<<<<<<<< * * to_sdl_rect(i, &rects[count]) */ goto __pyx_L10_continue; /* "pygame_sdl2/display.pyx":410 * * for i in rectangles: * if i is None: # <<<<<<<<<<<<<< * continue * */ } /* "pygame_sdl2/display.pyx":413 * continue * * to_sdl_rect(i, &rects[count]) # <<<<<<<<<<<<<< * count += 1 * */ __pyx_t_9 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_i, (&(__pyx_v_rects[__pyx_v_count])), NULL); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 413, __pyx_L8_error) /* "pygame_sdl2/display.pyx":414 * * to_sdl_rect(i, &rects[count]) * count += 1 # <<<<<<<<<<<<<< * * SDL_UpdateWindowSurfaceRects(self.window, rects, count) */ __pyx_v_count = (__pyx_v_count + 1); /* "pygame_sdl2/display.pyx":409 * try: * * for i in rectangles: # <<<<<<<<<<<<<< * if i is None: * continue */ __pyx_L10_continue:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":416 * count += 1 * * SDL_UpdateWindowSurfaceRects(self.window, rects, count) # <<<<<<<<<<<<<< * * finally: */ (void)(SDL_UpdateWindowSurfaceRects(__pyx_v_self->window, __pyx_v_rects, __pyx_v_count)); } /* "pygame_sdl2/display.pyx":419 * * finally: * free(rects) # <<<<<<<<<<<<<< * * def get_wm_info(self): */ /*finally:*/ { /*normal exit:*/{ free(__pyx_v_rects); goto __pyx_L9; } __pyx_L8_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { free(__pyx_v_rects); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L1_error; } __pyx_L9:; } /* "pygame_sdl2/display.pyx":388 * return self.surface * * def update(self, rectangles=None): # <<<<<<<<<<<<<< * * cdef SDL_Rect *rects */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_rectangles); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":421 * free(rects) * * def get_wm_info(self): # <<<<<<<<<<<<<< * return { } * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_21get_wm_info(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_20get_wm_info, "Window.get_wm_info(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_21get_wm_info = {"get_wm_info", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_21get_wm_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_20get_wm_info}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_21get_wm_info(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_wm_info (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_wm_info", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_wm_info", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_20get_wm_info(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_20get_wm_info(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_wm_info", 1); /* "pygame_sdl2/display.pyx":422 * * def get_wm_info(self): * return { } # <<<<<<<<<<<<<< * * def get_active(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":421 * free(rects) * * def get_wm_info(self): # <<<<<<<<<<<<<< * return { } * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_wm_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":424 * return { } * * def get_active(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_23get_active(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_22get_active, "Window.get_active(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_23get_active = {"get_active", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_23get_active, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_22get_active}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_23get_active(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_active (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_active", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_active", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_22get_active(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_22get_active(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_active", 1); /* "pygame_sdl2/display.pyx":425 * * def get_active(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<< * return False * else: */ __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":426 * def get_active(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False # <<<<<<<<<<<<<< * else: * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":425 * * def get_active(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<< * return False * else: */ } /* "pygame_sdl2/display.pyx":428 * return False * else: * return True # <<<<<<<<<<<<<< * * def iconify(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; } /* "pygame_sdl2/display.pyx":424 * return { } * * def get_active(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":430 * return True * * def iconify(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_25iconify(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_24iconify, "Window.iconify(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_25iconify = {"iconify", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_25iconify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_24iconify}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_25iconify(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iconify (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("iconify", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "iconify", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_24iconify(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_24iconify(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iconify", 1); /* "pygame_sdl2/display.pyx":431 * * def iconify(self): * SDL_MinimizeWindow(self.window) # <<<<<<<<<<<<<< * return True * */ SDL_MinimizeWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":432 * def iconify(self): * SDL_MinimizeWindow(self.window) * return True # <<<<<<<<<<<<<< * * def toggle_fullscreen(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":430 * return True * * def iconify(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * return True */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":434 * return True * * def toggle_fullscreen(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_27toggle_fullscreen(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_26toggle_fullscreen, "Window.toggle_fullscreen(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_27toggle_fullscreen = {"toggle_fullscreen", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_27toggle_fullscreen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_26toggle_fullscreen}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_27toggle_fullscreen(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toggle_fullscreen (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("toggle_fullscreen", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "toggle_fullscreen", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_26toggle_fullscreen(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_26toggle_fullscreen(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toggle_fullscreen", 1); /* "pygame_sdl2/display.pyx":435 * * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * if SDL_SetWindowFullscreen(self.window, 0): * raise error() */ __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":436 * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<< * raise error() * else: */ __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, 0) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":437 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): * raise error() # <<<<<<<<<<<<<< * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 437, __pyx_L1_error) /* "pygame_sdl2/display.pyx":436 * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<< * raise error() * else: */ } /* "pygame_sdl2/display.pyx":435 * * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * if SDL_SetWindowFullscreen(self.window, 0): * raise error() */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":439 * raise error() * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":440 * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): * raise error() # <<<<<<<<<<<<<< * * return True */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 440, __pyx_L1_error) /* "pygame_sdl2/display.pyx":439 * raise error() * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L3:; /* "pygame_sdl2/display.pyx":442 * raise error() * * return True # <<<<<<<<<<<<<< * * def set_gamma(self, red, green=None, blue=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":434 * return True * * def toggle_fullscreen(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.toggle_fullscreen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":444 * return True * * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<< * if green is None: * green = red */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_28set_gamma, "Window.set_gamma(self, red, green=None, blue=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_29set_gamma = {"set_gamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_28set_gamma}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_red)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_green); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blue); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_gamma") < 0)) __PYX_ERR(0, 444, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 444, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_28set_gamma(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_28set_gamma(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { Uint16 __pyx_v_red_gamma[0x100]; Uint16 __pyx_v_green_gamma[0x100]; Uint16 __pyx_v_blue_gamma[0x100]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; float __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_gamma", 0); __Pyx_INCREF(__pyx_v_green); __Pyx_INCREF(__pyx_v_blue); /* "pygame_sdl2/display.pyx":445 * * def set_gamma(self, red, green=None, blue=None): * if green is None: # <<<<<<<<<<<<<< * green = red * if blue is None: */ __pyx_t_1 = (__pyx_v_green == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":446 * def set_gamma(self, red, green=None, blue=None): * if green is None: * green = red # <<<<<<<<<<<<<< * if blue is None: * blue = red */ __Pyx_INCREF(__pyx_v_red); __Pyx_DECREF_SET(__pyx_v_green, __pyx_v_red); /* "pygame_sdl2/display.pyx":445 * * def set_gamma(self, red, green=None, blue=None): * if green is None: # <<<<<<<<<<<<<< * green = red * if blue is None: */ } /* "pygame_sdl2/display.pyx":447 * if green is None: * green = red * if blue is None: # <<<<<<<<<<<<<< * blue = red * */ __pyx_t_1 = (__pyx_v_blue == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":448 * green = red * if blue is None: * blue = red # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ __Pyx_INCREF(__pyx_v_red); __Pyx_DECREF_SET(__pyx_v_blue, __pyx_v_red); /* "pygame_sdl2/display.pyx":447 * if green is None: * green = red * if blue is None: # <<<<<<<<<<<<<< * blue = red * */ } /* "pygame_sdl2/display.pyx":454 * cdef Uint16 blue_gamma[256] * * SDL_CalculateGammaRamp(red, red_gamma) # <<<<<<<<<<<<<< * SDL_CalculateGammaRamp(green, green_gamma) * SDL_CalculateGammaRamp(blue, blue_gamma) */ __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_red); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L1_error) SDL_CalculateGammaRamp(__pyx_t_2, __pyx_v_red_gamma); /* "pygame_sdl2/display.pyx":455 * * SDL_CalculateGammaRamp(red, red_gamma) * SDL_CalculateGammaRamp(green, green_gamma) # <<<<<<<<<<<<<< * SDL_CalculateGammaRamp(blue, blue_gamma) * */ __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_green); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L1_error) SDL_CalculateGammaRamp(__pyx_t_2, __pyx_v_green_gamma); /* "pygame_sdl2/display.pyx":456 * SDL_CalculateGammaRamp(red, red_gamma) * SDL_CalculateGammaRamp(green, green_gamma) * SDL_CalculateGammaRamp(blue, blue_gamma) # <<<<<<<<<<<<<< * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): */ __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_blue); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) SDL_CalculateGammaRamp(__pyx_t_2, __pyx_v_blue_gamma); /* "pygame_sdl2/display.pyx":458 * SDL_CalculateGammaRamp(blue, blue_gamma) * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ __pyx_t_1 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":459 * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): * return False # <<<<<<<<<<<<<< * * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":458 * SDL_CalculateGammaRamp(blue, blue_gamma) * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/display.pyx":461 * return False * * return True # <<<<<<<<<<<<<< * * def set_gamma_ramp(self, red, green, blue): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":444 * return True * * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<< * if green is None: * green = red */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_green); __Pyx_XDECREF(__pyx_v_blue); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":463 * return True * * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_31set_gamma_ramp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_30set_gamma_ramp, "Window.set_gamma_ramp(self, red, green, blue)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_31set_gamma_ramp = {"set_gamma_ramp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_31set_gamma_ramp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_30set_gamma_ramp}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_31set_gamma_ramp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma_ramp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_red)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_green)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 463, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blue)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 463, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 463, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 463, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_30set_gamma_ramp(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_30set_gamma_ramp(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { Uint16 __pyx_v_red_gamma[0x100]; Uint16 __pyx_v_green_gamma[0x100]; Uint16 __pyx_v_blue_gamma[0x100]; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations long __pyx_t_1; PyObject *__pyx_t_2 = NULL; Uint16 __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_gamma_ramp", 1); /* "pygame_sdl2/display.pyx":469 * cdef Uint16 blue_gamma[256] * * for i in range(256): # <<<<<<<<<<<<<< * red_gamma[i] = red[i] * green_gamma[i] = green[i] */ for (__pyx_t_1 = 0; __pyx_t_1 < 0x100; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; /* "pygame_sdl2/display.pyx":470 * * for i in range(256): * red_gamma[i] = red[i] # <<<<<<<<<<<<<< * green_gamma[i] = green[i] * blue_gamma[i] = blue[i] */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_red, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_red_gamma[__pyx_v_i]) = __pyx_t_3; /* "pygame_sdl2/display.pyx":471 * for i in range(256): * red_gamma[i] = red[i] * green_gamma[i] = green[i] # <<<<<<<<<<<<<< * blue_gamma[i] = blue[i] * */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_green, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_green_gamma[__pyx_v_i]) = __pyx_t_3; /* "pygame_sdl2/display.pyx":472 * red_gamma[i] = red[i] * green_gamma[i] = green[i] * blue_gamma[i] = blue[i] # <<<<<<<<<<<<<< * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_blue, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_blue_gamma[__pyx_v_i]) = __pyx_t_3; } /* "pygame_sdl2/display.pyx":474 * blue_gamma[i] = blue[i] * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ __pyx_t_4 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0); if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":475 * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): * return False # <<<<<<<<<<<<<< * * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":474 * blue_gamma[i] = blue[i] * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/display.pyx":477 * return False * * return True # <<<<<<<<<<<<<< * * def set_icon(self, Surface surface): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":463 * return True * * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":479 * return True * * def set_icon(self, Surface surface): # <<<<<<<<<<<<<< * SDL_SetWindowIcon(self.window, surface.surface) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_33set_icon(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_32set_icon, "Window.set_icon(self, Surface surface)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_33set_icon = {"set_icon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_33set_icon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_32set_icon}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_33set_icon(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_icon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_icon") < 0)) __PYX_ERR(0, 479, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_icon", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 479, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.set_icon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 479, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_32set_icon(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_surface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_32set_icon(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_icon", 1); /* "pygame_sdl2/display.pyx":480 * * def set_icon(self, Surface surface): * SDL_SetWindowIcon(self.window, surface.surface) # <<<<<<<<<<<<<< * * def set_caption(self, title): */ SDL_SetWindowIcon(__pyx_v_self->window, __pyx_v_surface->surface); /* "pygame_sdl2/display.pyx":479 * return True * * def set_icon(self, Surface surface): # <<<<<<<<<<<<<< * SDL_SetWindowIcon(self.window, surface.surface) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":482 * SDL_SetWindowIcon(self.window, surface.surface) * * def set_caption(self, title): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_35set_caption(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_34set_caption, "Window.set_caption(self, title)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_35set_caption = {"set_caption", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_35set_caption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_34set_caption}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_35set_caption(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_title = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_caption (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_title,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_title)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 482, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_caption") < 0)) __PYX_ERR(0, 482, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_title = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_caption", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 482, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_34set_caption(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_title); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_34set_caption(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; char const *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_caption", 0); __Pyx_INCREF(__pyx_v_title); /* "pygame_sdl2/display.pyx":484 * def set_caption(self, title): * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ __pyx_t_1 = PyBytes_Check(__pyx_v_title); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":485 * * if not isinstance(title, bytes): * title = title.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetWindowTitle(self.window, title) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_utf_8}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":484 * def set_caption(self, title): * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":487 * title = title.encode("utf-8") * * SDL_SetWindowTitle(self.window, title) # <<<<<<<<<<<<<< * * def get_drawable_size(self): */ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L1_error) SDL_SetWindowTitle(__pyx_v_self->window, __pyx_t_7); /* "pygame_sdl2/display.pyx":482 * SDL_SetWindowIcon(self.window, surface.surface) * * def set_caption(self, title): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.Window.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_title); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":489 * SDL_SetWindowTitle(self.window, title) * * def get_drawable_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_37get_drawable_size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_36get_drawable_size, "Window.get_drawable_size(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_37get_drawable_size = {"get_drawable_size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_37get_drawable_size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_36get_drawable_size}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_37get_drawable_size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_drawable_size (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_drawable_size", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_drawable_size", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_36get_drawable_size(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_36get_drawable_size(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_drawable_size", 1); /* "pygame_sdl2/display.pyx":492 * cdef int w, h * * SDL_GL_GetDrawableSize(self.window, &w, &h) # <<<<<<<<<<<<<< * return w, h * */ SDL_GL_GetDrawableSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h)); /* "pygame_sdl2/display.pyx":493 * * SDL_GL_GetDrawableSize(self.window, &w, &h) * return w, h # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":489 * SDL_SetWindowTitle(self.window, title) * * def get_drawable_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_drawable_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":496 * * * def get_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_39get_size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_38get_size, "Window.get_size(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_39get_size = {"get_size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_39get_size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_38get_size}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_39get_size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_size (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_size", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_size", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_38get_size(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_38get_size(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_size", 1); /* "pygame_sdl2/display.pyx":499 * cdef int w, h * * SDL_GetWindowSize(self.window, &w, &h) # <<<<<<<<<<<<<< * return w, h * */ SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h)); /* "pygame_sdl2/display.pyx":500 * * SDL_GetWindowSize(self.window, &w, &h) * return w, h # <<<<<<<<<<<<<< * * def restore(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":496 * * * def get_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":502 * return w, h * * def restore(self): # <<<<<<<<<<<<<< * SDL_RestoreWindow(self.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_41restore(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_40restore, "Window.restore(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_41restore = {"restore", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_41restore, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_40restore}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_41restore(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restore (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("restore", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "restore", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_40restore(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_40restore(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restore", 1); /* "pygame_sdl2/display.pyx":503 * * def restore(self): * SDL_RestoreWindow(self.window) # <<<<<<<<<<<<<< * * def maximize(self): */ SDL_RestoreWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":502 * return w, h * * def restore(self): # <<<<<<<<<<<<<< * SDL_RestoreWindow(self.window) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":505 * SDL_RestoreWindow(self.window) * * def maximize(self): # <<<<<<<<<<<<<< * SDL_MaximizeWindow(self.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_43maximize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_42maximize, "Window.maximize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_43maximize = {"maximize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_43maximize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_42maximize}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_43maximize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("maximize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("maximize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "maximize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_42maximize(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_42maximize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("maximize", 1); /* "pygame_sdl2/display.pyx":506 * * def maximize(self): * SDL_MaximizeWindow(self.window) # <<<<<<<<<<<<<< * * def minimize(self): */ SDL_MaximizeWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":505 * SDL_RestoreWindow(self.window) * * def maximize(self): # <<<<<<<<<<<<<< * SDL_MaximizeWindow(self.window) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":508 * SDL_MaximizeWindow(self.window) * * def minimize(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_45minimize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_44minimize, "Window.minimize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_45minimize = {"minimize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_45minimize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_44minimize}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_45minimize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("minimize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("minimize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "minimize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_44minimize(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_44minimize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("minimize", 1); /* "pygame_sdl2/display.pyx":509 * * def minimize(self): * SDL_MinimizeWindow(self.window) # <<<<<<<<<<<<<< * * def get_sdl_window_pointer(self): */ SDL_MinimizeWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":508 * SDL_MaximizeWindow(self.window) * * def minimize(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":511 * SDL_MinimizeWindow(self.window) * * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<< * """ * Returns the pointer to the SDL_Window corresponding to this window. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer, "Window.get_sdl_window_pointer(self)\n\n Returns the pointer to the SDL_Window corresponding to this window.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer = {"get_sdl_window_pointer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_sdl_window_pointer (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_sdl_window_pointer", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_sdl_window_pointer", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_v_ctypes = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sdl_window_pointer", 1); /* "pygame_sdl2/display.pyx":516 * """ * * import ctypes # <<<<<<<<<<<<<< * return ctypes.c_void_p( self.window) * */ __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_ctypes, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ctypes = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":517 * * import ctypes * return ctypes.c_void_p( self.window) # <<<<<<<<<<<<<< * * def get_position(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ctypes, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_unsigned_long(((unsigned long)__pyx_v_self->window)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":511 * SDL_MinimizeWindow(self.window) * * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<< * """ * Returns the pointer to the SDL_Window corresponding to this window. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_sdl_window_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctypes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":519 * return ctypes.c_void_p( self.window) * * def get_position(self): # <<<<<<<<<<<<<< * cdef int x, y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49get_position(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_48get_position, "Window.get_position(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_49get_position = {"get_position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_49get_position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_48get_position}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49get_position(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_position (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_position", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_position", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_48get_position(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48get_position(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_v_x; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_position", 1); /* "pygame_sdl2/display.pyx":522 * cdef int x, y * * SDL_GetWindowPosition(self.window, &x, &y) # <<<<<<<<<<<<<< * return x, y * */ SDL_GetWindowPosition(__pyx_v_self->window, (&__pyx_v_x), (&__pyx_v_y)); /* "pygame_sdl2/display.pyx":523 * * SDL_GetWindowPosition(self.window, &x, &y) * return x, y # <<<<<<<<<<<<<< * * def set_position(self, pos): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":519 * return ctypes.c_void_p( self.window) * * def get_position(self): # <<<<<<<<<<<<<< * cdef int x, y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_position", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":525 * return x, y * * def set_position(self, pos): # <<<<<<<<<<<<<< * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_51set_position(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_50set_position, "Window.set_position(self, pos)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_51set_position = {"set_position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_51set_position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_50set_position}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_51set_position(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pos = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_position (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 525, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_position") < 0)) __PYX_ERR(0, 525, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pos = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_position", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 525, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.set_position", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_50set_position(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_50set_position(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_pos) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_position", 1); /* "pygame_sdl2/display.pyx":526 * * def set_position(self, pos): * SDL_SetWindowPosition(self.window, pos[0], pos[1]) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; SDL_SetWindowPosition(__pyx_v_self->window, __pyx_t_2, __pyx_t_3); /* "pygame_sdl2/display.pyx":525 * return x, y * * def set_position(self, pos): # <<<<<<<<<<<<<< * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.Window.set_position", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pxd":29 * cdef SDL_Window *window * cdef SDL_Surface *window_surface * cdef public Surface surface # <<<<<<<<<<<<<< * * # The OpenGL context corresponding to this window. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7surface_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7surface_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->surface); __pyx_r = ((PyObject *)__pyx_v_self->surface); goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(2, 29, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->surface); __Pyx_DECREF((PyObject *)__pyx_v_self->surface); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.Window.surface.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_5__del__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF((PyObject *)__pyx_v_self->surface); __Pyx_DECREF((PyObject *)__pyx_v_self->surface); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_53__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_52__reduce_cython__, "Window.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_53__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_53__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_52__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_53__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_52__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_52__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_gl_context_self_window_self, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_55__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_6Window_54__setstate_cython__, "Window.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_6Window_55__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_55__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_54__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_55__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Window.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_54__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_54__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_gl_context_self_window_self, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":539 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ static PyObject *__pyx_pf_11pygame_sdl2_7display_76__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject*)__pyx_tuple_)); __Pyx_GIVEREF(((PyObject*)__pyx_tuple_)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)__pyx_tuple_))) __PYX_ERR(0, 539, __pyx_L1_error); __Pyx_INCREF(((PyObject *)__pyx_int_0)); __Pyx_GIVEREF(((PyObject *)__pyx_int_0)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_int_0))) __PYX_ERR(0, 539, __pyx_L1_error); __Pyx_INCREF(((PyObject *)__pyx_int_0)); __Pyx_GIVEREF(((PyObject *)__pyx_int_0)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_0))) __PYX_ERR(0, 539, __pyx_L1_error); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_pos); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_pos); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_pos)) __PYX_ERR(0, 539, __pyx_L1_error); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 539, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.display.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_13set_mode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_12set_mode, "set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED))"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_13set_mode = {"set_mode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_13set_mode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_12set_mode}; static PyObject *__pyx_pw_11pygame_sdl2_7display_13set_mode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_resolution = 0; PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_depth = 0; PyObject *__pyx_v_pos = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mode (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_resolution,&__pyx_n_s_flags,&__pyx_n_s_depth,&__pyx_n_s_pos,0}; __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_tuple_))); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); values[3] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_pos); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_resolution); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depth); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_mode") < 0)) __PYX_ERR(0, 539, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_resolution = values[0]; __pyx_v_flags = values[1]; __pyx_v_depth = values[2]; __pyx_v_pos = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_mode", 0, 0, 4, __pyx_nargs); __PYX_ERR(0, 539, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_12set_mode(__pyx_self, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos) { int __pyx_v_RESIZE_FLAGS; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_mode", 1); /* "pygame_sdl2/display.pyx":542 * global main_window * * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<< * * if main_window: */ __pyx_v_RESIZE_FLAGS = (SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP); /* "pygame_sdl2/display.pyx":544 * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP * * if main_window: # <<<<<<<<<<<<<< * * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":546 * if main_window: * * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): # <<<<<<<<<<<<<< * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP) * return main_window.surface */ __pyx_t_2 = __Pyx_PyInt_From_int((~__pyx_v_RESIZE_FLAGS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_11pygame_sdl2_7display_main_window->create_flags & (~__pyx_v_RESIZE_FLAGS))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":547 * * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP) # <<<<<<<<<<<<<< * return main_window.surface * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN_DESKTOP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_resolution, __pyx_t_5, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":548 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP) * return main_window.surface # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface); __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface); goto __pyx_L0; /* "pygame_sdl2/display.pyx":546 * if main_window: * * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): # <<<<<<<<<<<<<< * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP) * return main_window.surface */ } /* "pygame_sdl2/display.pyx":551 * * else: * main_window.destroy() # <<<<<<<<<<<<<< * * main_window = Window(default_title, resolution, flags, depth, pos=pos) */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "pygame_sdl2/display.pyx":544 * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP * * if main_window: # <<<<<<<<<<<<<< * * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): */ } /* "pygame_sdl2/display.pyx":553 * main_window.destroy() * * main_window = Window(default_title, resolution, flags, depth, pos=pos) # <<<<<<<<<<<<<< * * if default_icon is not None: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error); __Pyx_INCREF(__pyx_v_resolution); __Pyx_GIVEREF(__pyx_v_resolution); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_resolution)) __PYX_ERR(0, 553, __pyx_L1_error); __Pyx_INCREF(__pyx_v_flags); __Pyx_GIVEREF(__pyx_v_flags); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_flags)) __PYX_ERR(0, 553, __pyx_L1_error); __Pyx_INCREF(__pyx_v_depth); __Pyx_GIVEREF(__pyx_v_depth); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_depth)) __PYX_ERR(0, 553, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 553, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window), __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_t_6)); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":555 * main_window = Window(default_title, resolution, flags, depth, pos=pos) * * if default_icon is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = (__pyx_t_6 != Py_None); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":556 * * if default_icon is not None: * main_window.set_icon(default_icon) # <<<<<<<<<<<<<< * * return main_window.surface */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":555 * main_window = Window(default_title, resolution, flags, depth, pos=pos) * * if default_icon is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ } /* "pygame_sdl2/display.pyx":558 * main_window.set_icon(default_icon) * * return main_window.surface # <<<<<<<<<<<<<< * * def destroy(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface); __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface); goto __pyx_L0; /* "pygame_sdl2/display.pyx":539 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":560 * return main_window.surface * * def destroy(): # <<<<<<<<<<<<<< * global main_window * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_15destroy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_14destroy, "destroy()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_15destroy = {"destroy", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_15destroy, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_14destroy}; static PyObject *__pyx_pw_11pygame_sdl2_7display_15destroy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_14destroy(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_14destroy(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 1); /* "pygame_sdl2/display.pyx":563 * global main_window * * if main_window is not None: # <<<<<<<<<<<<<< * main_window.destroy() * main_window = None */ __pyx_t_1 = (((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window) != Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":564 * * if main_window is not None: * main_window.destroy() # <<<<<<<<<<<<<< * main_window = None * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":565 * if main_window is not None: * main_window.destroy() * main_window = None # <<<<<<<<<<<<<< * * def get_surface(): */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/display.pyx":563 * global main_window * * if main_window is not None: # <<<<<<<<<<<<<< * main_window.destroy() * main_window = None */ } /* "pygame_sdl2/display.pyx":560 * return main_window.surface * * def destroy(): # <<<<<<<<<<<<<< * global main_window * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":567 * main_window = None * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_17get_surface(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_16get_surface, "get_surface()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_17get_surface = {"get_surface", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_17get_surface, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_16get_surface}; static PyObject *__pyx_pw_11pygame_sdl2_7display_17get_surface(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_surface (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_16get_surface(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_16get_surface(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_surface", 1); /* "pygame_sdl2/display.pyx":568 * * def get_surface(): * if main_window is None: # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = (((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window) == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":569 * def get_surface(): * if main_window is None: * return None # <<<<<<<<<<<<<< * * return main_window.get_surface() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":568 * * def get_surface(): * if main_window is None: # <<<<<<<<<<<<<< * return None * */ } /* "pygame_sdl2/display.pyx":571 * return None * * return main_window.get_surface() # <<<<<<<<<<<<<< * * def get_window(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":567 * main_window = None * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_surface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":573 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_19get_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_18get_window, "get_window()\n\n Returns the Window created by set_mode, or None if no such window\n exists.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_19get_window = {"get_window", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_19get_window, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_18get_window}; static PyObject *__pyx_pw_11pygame_sdl2_7display_19get_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_window (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_18get_window(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_18get_window(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_window", 1); /* "pygame_sdl2/display.pyx":579 * """ * * return main_window # <<<<<<<<<<<<<< * * def flip(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); goto __pyx_L0; /* "pygame_sdl2/display.pyx":573 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":581 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_21flip(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_20flip, "flip()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_21flip = {"flip", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_21flip, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_20flip}; static PyObject *__pyx_pw_11pygame_sdl2_7display_21flip(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flip (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_20flip(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_20flip(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flip", 1); /* "pygame_sdl2/display.pyx":582 * * def flip(): * if main_window: # <<<<<<<<<<<<<< * main_window.flip() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 582, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":583 * def flip(): * if main_window: * main_window.flip() # <<<<<<<<<<<<<< * * def update(rectangles=None): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_flip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":582 * * def flip(): * if main_window: # <<<<<<<<<<<<<< * main_window.flip() * */ } /* "pygame_sdl2/display.pyx":581 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":585 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_23update(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_22update, "update(rectangles=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_23update = {"update", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_23update, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_22update}; static PyObject *__pyx_pw_11pygame_sdl2_7display_23update(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rectangles = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rectangles,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rectangles); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "update") < 0)) __PYX_ERR(0, 585, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rectangles = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 585, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_22update(__pyx_self, __pyx_v_rectangles); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_22update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rectangles) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update", 1); /* "pygame_sdl2/display.pyx":586 * * def update(rectangles=None): * if main_window: # <<<<<<<<<<<<<< * main_window.update(rectangles) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 586, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":587 * def update(rectangles=None): * if main_window: * main_window.update(rectangles) # <<<<<<<<<<<<<< * * def get_driver(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_rectangles}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":586 * * def update(rectangles=None): * if main_window: # <<<<<<<<<<<<<< * main_window.update(rectangles) * */ } /* "pygame_sdl2/display.pyx":585 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":589 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_25get_driver(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_24get_driver, "get_driver()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_25get_driver = {"get_driver", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_25get_driver, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_24get_driver}; static PyObject *__pyx_pw_11pygame_sdl2_7display_25get_driver(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_driver (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_24get_driver(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_24get_driver(CYTHON_UNUSED PyObject *__pyx_self) { char const *__pyx_v_driver; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_driver", 1); /* "pygame_sdl2/display.pyx":590 * * def get_driver(): * cdef const char *driver = SDL_GetCurrentVideoDriver() # <<<<<<<<<<<<<< * * if driver == NULL: */ __pyx_v_driver = SDL_GetCurrentVideoDriver(); /* "pygame_sdl2/display.pyx":592 * cdef const char *driver = SDL_GetCurrentVideoDriver() * * if driver == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_driver == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":593 * * if driver == NULL: * raise error() # <<<<<<<<<<<<<< * * return driver */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 593, __pyx_L1_error) /* "pygame_sdl2/display.pyx":592 * cdef const char *driver = SDL_GetCurrentVideoDriver() * * if driver == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":595 * raise error() * * return driver # <<<<<<<<<<<<<< * * class Info(object): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":589 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_driver", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":599 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_4Info___init__, "Info.__init__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_4Info_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_4Info_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_4Info___init__}; static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 599, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 599, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Info.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_4Info___init__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { SDL_DisplayMode __pyx_v_dm; SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/display.pyx":603 * cdef SDL_PixelFormat *format * * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetCurrentDisplayMode(0, (&__pyx_v_dm)) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":604 * * if SDL_GetCurrentDisplayMode(0, &dm): * raise error() # <<<<<<<<<<<<<< * * format = SDL_AllocFormat(dm.format) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 604, __pyx_L1_error) /* "pygame_sdl2/display.pyx":603 * cdef SDL_PixelFormat *format * * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":606 * raise error() * * format = SDL_AllocFormat(dm.format) # <<<<<<<<<<<<<< * if format == NULL: * raise error() */ __pyx_v_format = SDL_AllocFormat(__pyx_v_dm.format); /* "pygame_sdl2/display.pyx":607 * * format = SDL_AllocFormat(dm.format) * if format == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_format == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":608 * format = SDL_AllocFormat(dm.format) * if format == NULL: * raise error() # <<<<<<<<<<<<<< * * self.bitsize = format.BitsPerPixel */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 608, __pyx_L1_error) /* "pygame_sdl2/display.pyx":607 * * format = SDL_AllocFormat(dm.format) * if format == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":610 * raise error() * * self.bitsize = format.BitsPerPixel # <<<<<<<<<<<<<< * self.bytesize = format.BytesPerPixel * */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BitsPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bitsize, __pyx_t_2) < 0) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":611 * * self.bitsize = format.BitsPerPixel * self.bytesize = format.BytesPerPixel # <<<<<<<<<<<<<< * * self.masks = ( */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BytesPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bytesize, __pyx_t_2) < 0) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":614 * * self.masks = ( * format.Rmask, # <<<<<<<<<<<<<< * format.Gmask, * format.Bmask, */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/display.pyx":615 * self.masks = ( * format.Rmask, * format.Gmask, # <<<<<<<<<<<<<< * format.Bmask, * format.Amask, */ __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":616 * format.Rmask, * format.Gmask, * format.Bmask, # <<<<<<<<<<<<<< * format.Amask, * ) */ __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":617 * format.Gmask, * format.Bmask, * format.Amask, # <<<<<<<<<<<<<< * ) * */ __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "pygame_sdl2/display.pyx":614 * * self.masks = ( * format.Rmask, # <<<<<<<<<<<<<< * format.Gmask, * format.Bmask, */ __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 614, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6)) __PYX_ERR(0, 614, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":613 * self.bytesize = format.BytesPerPixel * * self.masks = ( # <<<<<<<<<<<<<< * format.Rmask, * format.Gmask, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_masks, __pyx_t_7) < 0) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/display.pyx":621 * * self.shifts = ( * format.Rshift, # <<<<<<<<<<<<<< * format.Gshift, * format.Bshift, */ __pyx_t_7 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "pygame_sdl2/display.pyx":622 * self.shifts = ( * format.Rshift, * format.Gshift, # <<<<<<<<<<<<<< * format.Bshift, * format.Ashift, */ __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "pygame_sdl2/display.pyx":623 * format.Rshift, * format.Gshift, * format.Bshift, # <<<<<<<<<<<<<< * format.Ashift, * ) */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":624 * format.Gshift, * format.Bshift, * format.Ashift, # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":621 * * self.shifts = ( * format.Rshift, # <<<<<<<<<<<<<< * format.Gshift, * format.Bshift, */ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7)) __PYX_ERR(0, 621, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6)) __PYX_ERR(0, 621, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3)) __PYX_ERR(0, 621, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":620 * ) * * self.shifts = ( # <<<<<<<<<<<<<< * format.Rshift, * format.Gshift, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shifts, __pyx_t_2) < 0) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":628 * * self.losses = ( * format.Rloss, # <<<<<<<<<<<<<< * format.Gloss, * format.Bloss, */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/display.pyx":629 * self.losses = ( * format.Rloss, * format.Gloss, # <<<<<<<<<<<<<< * format.Bloss, * format.Aloss, */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":630 * format.Rloss, * format.Gloss, * format.Bloss, # <<<<<<<<<<<<<< * format.Aloss, * ) */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":631 * format.Gloss, * format.Bloss, * format.Aloss, # <<<<<<<<<<<<<< * ) * */ __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "pygame_sdl2/display.pyx":628 * * self.losses = ( * format.Rloss, # <<<<<<<<<<<<<< * format.Gloss, * format.Bloss, */ __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6)) __PYX_ERR(0, 628, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":627 * ) * * self.losses = ( # <<<<<<<<<<<<<< * format.Rloss, * format.Gloss, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_losses, __pyx_t_7) < 0) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/display.pyx":634 * ) * * SDL_FreeFormat(format) # <<<<<<<<<<<<<< * * if main_window: */ SDL_FreeFormat(__pyx_v_format); /* "pygame_sdl2/display.pyx":636 * SDL_FreeFormat(format) * * if main_window: # <<<<<<<<<<<<<< * self.current_w, self.current_h = main_window.surface.get_size() * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 636, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":637 * * if main_window: * self.current_w, self.current_h = main_window.surface.get_size() # <<<<<<<<<<<<<< * else: * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { PyObject* sequence = __pyx_t_7; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 637, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) __PYX_ERR(0, 637, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 637, __pyx_L1_error) __pyx_L7_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_6) < 0) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_4) < 0) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":636 * SDL_FreeFormat(format) * * if main_window: # <<<<<<<<<<<<<< * self.current_w, self.current_h = main_window.surface.get_size() * else: */ goto __pyx_L5; } /* "pygame_sdl2/display.pyx":640 * else: * * self.current_w = dm.w # <<<<<<<<<<<<<< * self.current_h = dm.h * */ /*else*/ { __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_dm.w); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_7) < 0) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/display.pyx":641 * * self.current_w = dm.w * self.current_h = dm.h # <<<<<<<<<<<<<< * * self.refresh_rate = dm.refresh_rate */ __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_dm.h); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_7) < 0) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_L5:; /* "pygame_sdl2/display.pyx":643 * self.current_h = dm.h * * self.refresh_rate = dm.refresh_rate # <<<<<<<<<<<<<< * * # The rest of these are just guesses. */ __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_dm.refresh_rate); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_refresh_rate, __pyx_t_7) < 0) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/display.pyx":646 * * # The rest of these are just guesses. * self.hw = False # <<<<<<<<<<<<<< * self.wm = True * self.video_mem = 256 * 1024 * 1024 */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hw, Py_False) < 0) __PYX_ERR(0, 646, __pyx_L1_error) /* "pygame_sdl2/display.pyx":647 * # The rest of these are just guesses. * self.hw = False * self.wm = True # <<<<<<<<<<<<<< * self.video_mem = 256 * 1024 * 1024 * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wm, Py_True) < 0) __PYX_ERR(0, 647, __pyx_L1_error) /* "pygame_sdl2/display.pyx":648 * self.hw = False * self.wm = True * self.video_mem = 256 * 1024 * 1024 # <<<<<<<<<<<<<< * * self.blit_hw = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_video_mem, __pyx_int_268435456) < 0) __PYX_ERR(0, 648, __pyx_L1_error) /* "pygame_sdl2/display.pyx":650 * self.video_mem = 256 * 1024 * 1024 * * self.blit_hw = False # <<<<<<<<<<<<<< * self.blit_hw_CC = False * self.blit_hw_A = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw, Py_False) < 0) __PYX_ERR(0, 650, __pyx_L1_error) /* "pygame_sdl2/display.pyx":651 * * self.blit_hw = False * self.blit_hw_CC = False # <<<<<<<<<<<<<< * self.blit_hw_A = False * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_CC, Py_False) < 0) __PYX_ERR(0, 651, __pyx_L1_error) /* "pygame_sdl2/display.pyx":652 * self.blit_hw = False * self.blit_hw_CC = False * self.blit_hw_A = False # <<<<<<<<<<<<<< * * self.blit_sw = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_A, Py_False) < 0) __PYX_ERR(0, 652, __pyx_L1_error) /* "pygame_sdl2/display.pyx":654 * self.blit_hw_A = False * * self.blit_sw = False # <<<<<<<<<<<<<< * self.blit_sw_CC = False * self.blit_sw_A = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw, Py_False) < 0) __PYX_ERR(0, 654, __pyx_L1_error) /* "pygame_sdl2/display.pyx":655 * * self.blit_sw = False * self.blit_sw_CC = False # <<<<<<<<<<<<<< * self.blit_sw_A = False * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_CC, Py_False) < 0) __PYX_ERR(0, 655, __pyx_L1_error) /* "pygame_sdl2/display.pyx":656 * self.blit_sw = False * self.blit_sw_CC = False * self.blit_sw_A = False # <<<<<<<<<<<<<< * * def __repr__(self): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_A, Py_False) < 0) __PYX_ERR(0, 656, __pyx_L1_error) /* "pygame_sdl2/display.pyx":599 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.display.Info.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":658 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_3__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_4Info_2__repr__, "Info.__repr__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_4Info_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_4Info_2__repr__}; static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_3__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 658, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 658, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.Info.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_4Info_2__repr__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/display.pyx":659 * * def __repr__(self): * return "".format(self.__dict__) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Info_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":658 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Info.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":662 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_27get_wm_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_26get_wm_info, "get_wm_info()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_27get_wm_info = {"get_wm_info", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_27get_wm_info, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_26get_wm_info}; static PyObject *__pyx_pw_11pygame_sdl2_7display_27get_wm_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_wm_info (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_26get_wm_info(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_26get_wm_info(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_wm_info", 1); /* "pygame_sdl2/display.pyx":663 * * def get_wm_info(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_wm_info() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 663, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":664 * def get_wm_info(): * if main_window: * return main_window.get_wm_info() # <<<<<<<<<<<<<< * * return {} */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_wm_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":663 * * def get_wm_info(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_wm_info() * */ } /* "pygame_sdl2/display.pyx":666 * return main_window.get_wm_info() * * return {} # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":662 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_wm_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":669 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_29get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_28get_num_video_displays, "get_num_video_displays()\n\n Returns the number of video displays connected to the system.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays = {"get_num_video_displays", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_29get_num_video_displays, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_28get_num_video_displays}; static PyObject *__pyx_pw_11pygame_sdl2_7display_29get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_video_displays (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_28get_num_video_displays(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_28get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_num_video_displays", 1); /* "pygame_sdl2/display.pyx":674 * """ * * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<< * * if rv < 0: */ __pyx_v_rv = SDL_GetNumVideoDisplays(); /* "pygame_sdl2/display.pyx":676 * rv = SDL_GetNumVideoDisplays() * * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_rv < 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":677 * * if rv < 0: * raise error() # <<<<<<<<<<<<<< * * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 677, __pyx_L1_error) /* "pygame_sdl2/display.pyx":676 * rv = SDL_GetNumVideoDisplays() * * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":679 * raise error() * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":669 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_num_video_displays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":682 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_31list_modes(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_30list_modes, "list_modes(depth=0, flags=0, display=0)\n\n Returns a list of possible display modes for the display `display`.\n\n `depth` and `flags` are ignored.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_31list_modes = {"list_modes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_31list_modes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_30list_modes}; static PyObject *__pyx_pw_11pygame_sdl2_7display_31list_modes(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_depth = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_display = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("list_modes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depth,&__pyx_n_s_flags,&__pyx_n_s_display,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depth); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_display); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "list_modes") < 0)) __PYX_ERR(0, 682, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_depth = values[0]; __pyx_v_flags = values[1]; __pyx_v_display = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("list_modes", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 682, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.list_modes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_30list_modes(__pyx_self, __pyx_v_depth, __pyx_v_flags, __pyx_v_display); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_30list_modes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_depth, CYTHON_UNUSED PyObject *__pyx_v_flags, PyObject *__pyx_v_display) { int __pyx_v_num_modes; int __pyx_v_i; SDL_DisplayMode __pyx_v_mode; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_t = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("list_modes", 1); /* "pygame_sdl2/display.pyx":692 * cdef SDL_DisplayMode mode * * rv = [ ] # <<<<<<<<<<<<<< * * num_modes = SDL_GetNumDisplayModes(display) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":694 * rv = [ ] * * num_modes = SDL_GetNumDisplayModes(display) # <<<<<<<<<<<<<< * if num_modes < 0: * raise error() */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 694, __pyx_L1_error) __pyx_v_num_modes = SDL_GetNumDisplayModes(__pyx_t_2); /* "pygame_sdl2/display.pyx":695 * * num_modes = SDL_GetNumDisplayModes(display) * if num_modes < 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = (__pyx_v_num_modes < 0); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/display.pyx":696 * num_modes = SDL_GetNumDisplayModes(display) * if num_modes < 0: * raise error() # <<<<<<<<<<<<<< * * for 0 <= i < num_modes: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 696, __pyx_L1_error) /* "pygame_sdl2/display.pyx":695 * * num_modes = SDL_GetNumDisplayModes(display) * if num_modes < 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":698 * raise error() * * for 0 <= i < num_modes: # <<<<<<<<<<<<<< * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) */ __pyx_t_2 = __pyx_v_num_modes; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { /* "pygame_sdl2/display.pyx":699 * * for 0 <= i < num_modes: * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<< * t = (mode.w, mode.h) * if t not in rv: */ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L1_error) __pyx_t_3 = (SDL_GetDisplayMode(__pyx_t_7, __pyx_v_i, (&__pyx_v_mode)) == 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":700 * for 0 <= i < num_modes: * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) # <<<<<<<<<<<<<< * if t not in rv: * rv.append(t) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mode.w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_mode.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":701 * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) * if t not in rv: # <<<<<<<<<<<<<< * rv.append(t) * */ __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_t, __pyx_v_rv, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 701, __pyx_L1_error) if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":702 * t = (mode.w, mode.h) * if t not in rv: * rv.append(t) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_t); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 702, __pyx_L1_error) /* "pygame_sdl2/display.pyx":701 * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) * if t not in rv: # <<<<<<<<<<<<<< * rv.append(t) * */ } /* "pygame_sdl2/display.pyx":699 * * for 0 <= i < num_modes: * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<< * t = (mode.w, mode.h) * if t not in rv: */ } } /* "pygame_sdl2/display.pyx":704 * rv.append(t) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/display.pyx":682 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.list_modes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_t); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":707 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_33mode_ok(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_32mode_ok, "mode_ok(size, flags=0, depth=0)\n\n Returns true if size is in the result of list_modes().\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_33mode_ok = {"mode_ok", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_33mode_ok, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_32mode_ok}; static PyObject *__pyx_pw_11pygame_sdl2_7display_33mode_ok(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_size = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; CYTHON_UNUSED PyObject *__pyx_v_depth = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mode_ok (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_flags,&__pyx_n_s_depth,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depth); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mode_ok") < 0)) __PYX_ERR(0, 707, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_flags = values[1]; __pyx_v_depth = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mode_ok", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 707, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.mode_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_32mode_ok(__pyx_self, __pyx_v_size, __pyx_v_flags, __pyx_v_depth); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_32mode_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mode_ok", 1); /* "pygame_sdl2/display.pyx":712 * """ * * return tuple(size) in list_modes() # <<<<<<<<<<<<<< * * def gl_reset_attributes(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_list_modes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":707 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.mode_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":714 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_35gl_reset_attributes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_34gl_reset_attributes, "gl_reset_attributes()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes = {"gl_reset_attributes", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_35gl_reset_attributes, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_34gl_reset_attributes}; static PyObject *__pyx_pw_11pygame_sdl2_7display_35gl_reset_attributes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_reset_attributes (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_34gl_reset_attributes(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_34gl_reset_attributes(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_reset_attributes", 1); /* "pygame_sdl2/display.pyx":715 * * def gl_reset_attributes(): * SDL_GL_ResetAttributes() # <<<<<<<<<<<<<< * * def gl_set_attribute(flag, value): */ SDL_GL_ResetAttributes(); /* "pygame_sdl2/display.pyx":714 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":717 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_37gl_set_attribute(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_36gl_set_attribute, "gl_set_attribute(flag, value)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute = {"gl_set_attribute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_37gl_set_attribute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_36gl_set_attribute}; static PyObject *__pyx_pw_11pygame_sdl2_7display_37gl_set_attribute(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_set_attribute (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, 1); __PYX_ERR(0, 717, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gl_set_attribute") < 0)) __PYX_ERR(0, 717, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_flag = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 717, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.gl_set_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_36gl_set_attribute(__pyx_self, __pyx_v_flag, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_36gl_set_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; SDL_GLattr __pyx_t_5; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gl_set_attribute", 1); /* "pygame_sdl2/display.pyx":719 * def gl_set_attribute(flag, value): * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * if ios: * return */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":720 * * if flag == GL_SWAP_CONTROL: * if ios: # <<<<<<<<<<<<<< * return * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ios); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":721 * if flag == GL_SWAP_CONTROL: * if ios: * return # <<<<<<<<<<<<<< * * global default_swap_control */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":720 * * if flag == GL_SWAP_CONTROL: * if ios: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":728 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-value) * */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L1_error) __pyx_t_3 = (SDL_GL_SetSwapInterval(__pyx_t_4) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":729 * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(value): * SDL_GL_SetSwapInterval(-value) # <<<<<<<<<<<<<< * * default_swap_control = value */ __pyx_t_2 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (void)(SDL_GL_SetSwapInterval(__pyx_t_4)); /* "pygame_sdl2/display.pyx":728 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-value) * */ } /* "pygame_sdl2/display.pyx":731 * SDL_GL_SetSwapInterval(-value) * * default_swap_control = value # <<<<<<<<<<<<<< * return * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_v_value) < 0) __PYX_ERR(0, 731, __pyx_L1_error) /* "pygame_sdl2/display.pyx":732 * * default_swap_control = value * return # <<<<<<<<<<<<<< * * if SDL_GL_SetAttribute(flag, value): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":719 * def gl_set_attribute(flag, value): * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * if ios: * return */ } /* "pygame_sdl2/display.pyx":734 * return * * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L1_error) __pyx_t_3 = (SDL_GL_SetAttribute(__pyx_t_5, __pyx_t_4) != 0); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/display.pyx":735 * * if SDL_GL_SetAttribute(flag, value): * raise error() # <<<<<<<<<<<<<< * * def gl_get_attribute(flag): */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 735, __pyx_L1_error) /* "pygame_sdl2/display.pyx":734 * return * * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":717 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.gl_set_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":737 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_39gl_get_attribute(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_38gl_get_attribute, "gl_get_attribute(flag)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute = {"gl_get_attribute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_39gl_get_attribute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_38gl_get_attribute}; static PyObject *__pyx_pw_11pygame_sdl2_7display_39gl_get_attribute(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_get_attribute (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gl_get_attribute") < 0)) __PYX_ERR(0, 737, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gl_get_attribute", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 737, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.gl_get_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_38gl_get_attribute(__pyx_self, __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_38gl_get_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag) { int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; SDL_GLattr __pyx_t_4; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gl_get_attribute", 1); /* "pygame_sdl2/display.pyx":740 * cdef int rv * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * return SDL_GL_GetSwapInterval() * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":741 * * if flag == GL_SWAP_CONTROL: * return SDL_GL_GetSwapInterval() # <<<<<<<<<<<<<< * * if SDL_GL_GetAttribute(flag, &rv): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_GL_GetSwapInterval()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":740 * cdef int rv * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * return SDL_GL_GetSwapInterval() * */ } /* "pygame_sdl2/display.pyx":743 * return SDL_GL_GetSwapInterval() * * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 743, __pyx_L1_error) __pyx_t_3 = (SDL_GL_GetAttribute(__pyx_t_4, (&__pyx_v_rv)) != 0); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/display.pyx":744 * * if SDL_GL_GetAttribute(flag, &rv): * raise error() # <<<<<<<<<<<<<< * * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 744, __pyx_L1_error) /* "pygame_sdl2/display.pyx":743 * return SDL_GL_GetSwapInterval() * * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":746 * raise error() * * return rv # <<<<<<<<<<<<<< * * def gl_load_library(path): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":737 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.gl_get_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":748 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_41gl_load_library(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_40gl_load_library, "gl_load_library(path)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_41gl_load_library = {"gl_load_library", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_41gl_load_library, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_40gl_load_library}; static PyObject *__pyx_pw_11pygame_sdl2_7display_41gl_load_library(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_load_library (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gl_load_library") < 0)) __PYX_ERR(0, 748, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_path = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gl_load_library", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 748, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.gl_load_library", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_40gl_load_library(__pyx_self, __pyx_v_path); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_40gl_load_library(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; char const *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gl_load_library", 1); /* "pygame_sdl2/display.pyx":749 * * def gl_load_library(path): * if path is None: # <<<<<<<<<<<<<< * if SDL_GL_LoadLibrary(NULL): * raise error() */ __pyx_t_1 = (__pyx_v_path == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":750 * def gl_load_library(path): * if path is None: * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<< * raise error() * else: */ __pyx_t_1 = (SDL_GL_LoadLibrary(NULL) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":751 * if path is None: * if SDL_GL_LoadLibrary(NULL): * raise error() # <<<<<<<<<<<<<< * else: * if SDL_GL_LoadLibrary(path): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 751, __pyx_L1_error) /* "pygame_sdl2/display.pyx":750 * def gl_load_library(path): * if path is None: * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<< * raise error() * else: */ } /* "pygame_sdl2/display.pyx":749 * * def gl_load_library(path): * if path is None: # <<<<<<<<<<<<<< * if SDL_GL_LoadLibrary(NULL): * raise error() */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":753 * raise error() * else: * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L1_error) __pyx_t_1 = (SDL_GL_LoadLibrary(__pyx_t_6) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":754 * else: * if SDL_GL_LoadLibrary(path): * raise error() # <<<<<<<<<<<<<< * * def gl_unload_library(): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 754, __pyx_L1_error) /* "pygame_sdl2/display.pyx":753 * raise error() * else: * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L3:; /* "pygame_sdl2/display.pyx":748 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.gl_load_library", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":756 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_43gl_unload_library(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_42gl_unload_library, "gl_unload_library()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_43gl_unload_library = {"gl_unload_library", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_43gl_unload_library, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_42gl_unload_library}; static PyObject *__pyx_pw_11pygame_sdl2_7display_43gl_unload_library(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_unload_library (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_42gl_unload_library(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_42gl_unload_library(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_unload_library", 1); /* "pygame_sdl2/display.pyx":757 * * def gl_unload_library(): * SDL_GL_UnloadLibrary() # <<<<<<<<<<<<<< * * def get_active(): */ SDL_GL_UnloadLibrary(); /* "pygame_sdl2/display.pyx":756 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":759 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_45get_active(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_44get_active, "get_active()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_45get_active = {"get_active", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_45get_active, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_44get_active}; static PyObject *__pyx_pw_11pygame_sdl2_7display_45get_active(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_active (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_44get_active(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_44get_active(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_active", 1); /* "pygame_sdl2/display.pyx":760 * * def get_active(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_active() * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 760, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":761 * def get_active(): * if main_window: * return main_window.get_active() # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_active); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":760 * * def get_active(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_active() * return False */ } /* "pygame_sdl2/display.pyx":762 * if main_window: * return main_window.get_active() * return False # <<<<<<<<<<<<<< * * def iconify(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":759 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_active", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":764 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_47iconify(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_46iconify, "iconify()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_47iconify = {"iconify", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_47iconify, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_46iconify}; static PyObject *__pyx_pw_11pygame_sdl2_7display_47iconify(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iconify (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_46iconify(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_46iconify(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iconify", 1); /* "pygame_sdl2/display.pyx":765 * * def iconify(): * if main_window: # <<<<<<<<<<<<<< * return main_window.iconify() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 765, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":766 * def iconify(): * if main_window: * return main_window.iconify() # <<<<<<<<<<<<<< * * return False */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_iconify); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":765 * * def iconify(): * if main_window: # <<<<<<<<<<<<<< * return main_window.iconify() * */ } /* "pygame_sdl2/display.pyx":768 * return main_window.iconify() * * return False # <<<<<<<<<<<<<< * * def toggle_fullscreen(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":764 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.iconify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":770 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_49toggle_fullscreen(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_48toggle_fullscreen, "toggle_fullscreen()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen = {"toggle_fullscreen", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_49toggle_fullscreen, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_48toggle_fullscreen}; static PyObject *__pyx_pw_11pygame_sdl2_7display_49toggle_fullscreen(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toggle_fullscreen (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_48toggle_fullscreen(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_48toggle_fullscreen(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toggle_fullscreen", 1); /* "pygame_sdl2/display.pyx":771 * * def toggle_fullscreen(): * if main_window: # <<<<<<<<<<<<<< * return main_window.toggle_fullscreen() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 771, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":772 * def toggle_fullscreen(): * if main_window: * return main_window.toggle_fullscreen() # <<<<<<<<<<<<<< * * return True */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_toggle_fullscreen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":771 * * def toggle_fullscreen(): * if main_window: # <<<<<<<<<<<<<< * return main_window.toggle_fullscreen() * */ } /* "pygame_sdl2/display.pyx":774 * return main_window.toggle_fullscreen() * * return True # <<<<<<<<<<<<<< * * def set_gamma(red, green=None, blue=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":770 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.toggle_fullscreen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":776 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_51set_gamma(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_50set_gamma, "set_gamma(red, green=None, blue=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_51set_gamma = {"set_gamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_51set_gamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_50set_gamma}; static PyObject *__pyx_pw_11pygame_sdl2_7display_51set_gamma(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_red)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_green); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blue); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_gamma") < 0)) __PYX_ERR(0, 776, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 776, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_50set_gamma(__pyx_self, __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_50set_gamma(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_gamma", 1); /* "pygame_sdl2/display.pyx":777 * * def set_gamma(red, green=None, blue=None): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma(red, green, blue) * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":778 * def set_gamma(red, green=None, blue=None): * if main_window: * return main_window.set_gamma(red, green, blue) # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":777 * * def set_gamma(red, green=None, blue=None): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma(red, green, blue) * return False */ } /* "pygame_sdl2/display.pyx":779 * if main_window: * return main_window.set_gamma(red, green, blue) * return False # <<<<<<<<<<<<<< * * def set_gamma_ramp(red, green, blue): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":776 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":781 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_53set_gamma_ramp(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_52set_gamma_ramp, "set_gamma_ramp(red, green, blue)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp = {"set_gamma_ramp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_53set_gamma_ramp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_52set_gamma_ramp}; static PyObject *__pyx_pw_11pygame_sdl2_7display_53set_gamma_ramp(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma_ramp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_red)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_green)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 781, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blue)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 781, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 781, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 781, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_52set_gamma_ramp(__pyx_self, __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_52set_gamma_ramp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_gamma_ramp", 1); /* "pygame_sdl2/display.pyx":782 * * def set_gamma_ramp(red, green, blue): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma_ramp(red, green, blue) * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 782, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":783 * def set_gamma_ramp(red, green, blue): * if main_window: * return main_window.set_gamma_ramp(red, green, blue) # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma_ramp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":782 * * def set_gamma_ramp(red, green, blue): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma_ramp(red, green, blue) * return False */ } /* "pygame_sdl2/display.pyx":784 * if main_window: * return main_window.set_gamma_ramp(red, green, blue) * return False # <<<<<<<<<<<<<< * * def set_icon(surface): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":781 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":786 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_55set_icon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_54set_icon, "set_icon(surface)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_55set_icon = {"set_icon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_55set_icon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_54set_icon}; static PyObject *__pyx_pw_11pygame_sdl2_7display_55set_icon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_surface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_icon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 786, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_icon") < 0)) __PYX_ERR(0, 786, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_surface = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_icon", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 786, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_icon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_54set_icon(__pyx_self, __pyx_v_surface); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_54set_icon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_surface) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_icon", 1); /* "pygame_sdl2/display.pyx":789 * global default_icon * * default_icon = surface.copy() # <<<<<<<<<<<<<< * * if main_window is not None: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_surface, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, __pyx_t_1) < 0) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":791 * default_icon = surface.copy() * * if main_window is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ __pyx_t_5 = (((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window) != Py_None); if (__pyx_t_5) { /* "pygame_sdl2/display.pyx":792 * * if main_window is not None: * main_window.set_icon(default_icon) # <<<<<<<<<<<<<< * * def set_caption(title, icontitle = None): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":791 * default_icon = surface.copy() * * if main_window is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ } /* "pygame_sdl2/display.pyx":786 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.set_icon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":794 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_57set_caption(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_56set_caption, "set_caption(title, icontitle=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_57set_caption = {"set_caption", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_57set_caption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_56set_caption}; static PyObject *__pyx_pw_11pygame_sdl2_7display_57set_caption(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_title = 0; CYTHON_UNUSED PyObject *__pyx_v_icontitle = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_caption (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_title,&__pyx_n_s_icontitle,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_title)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 794, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_icontitle); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 794, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_caption") < 0)) __PYX_ERR(0, 794, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_title = values[0]; __pyx_v_icontitle = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_caption", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 794, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_56set_caption(__pyx_self, __pyx_v_title, __pyx_v_icontitle); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_56set_caption(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_title, CYTHON_UNUSED PyObject *__pyx_v_icontitle) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_caption", 1); /* "pygame_sdl2/display.pyx":797 * global default_title * * default_title = title # <<<<<<<<<<<<<< * * if main_window: */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_v_title) < 0) __PYX_ERR(0, 797, __pyx_L1_error) /* "pygame_sdl2/display.pyx":799 * default_title = title * * if main_window: # <<<<<<<<<<<<<< * main_window.set_caption(default_title) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 799, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":800 * * if main_window: * main_window.set_caption(default_title) # <<<<<<<<<<<<<< * * def get_caption(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_caption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":799 * default_title = title * * if main_window: # <<<<<<<<<<<<<< * main_window.set_caption(default_title) * */ } /* "pygame_sdl2/display.pyx":794 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":802 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_59get_caption(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_58get_caption, "get_caption()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_59get_caption = {"get_caption", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_59get_caption, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_58get_caption}; static PyObject *__pyx_pw_11pygame_sdl2_7display_59get_caption(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_caption (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_58get_caption(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_58get_caption(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_caption", 1); /* "pygame_sdl2/display.pyx":803 * * def get_caption(): * return default_title # <<<<<<<<<<<<<< * * def get_drawable_size(): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_title); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":802 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.get_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":805 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_61get_drawable_size(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_60get_drawable_size, "get_drawable_size()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_61get_drawable_size = {"get_drawable_size", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_61get_drawable_size, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_60get_drawable_size}; static PyObject *__pyx_pw_11pygame_sdl2_7display_61get_drawable_size(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_drawable_size (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_60get_drawable_size(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_60get_drawable_size(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_drawable_size", 1); /* "pygame_sdl2/display.pyx":806 * * def get_drawable_size(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_drawable_size() * return None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 806, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":807 * def get_drawable_size(): * if main_window: * return main_window.get_drawable_size() # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_drawable_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":806 * * def get_drawable_size(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_drawable_size() * return None */ } /* "pygame_sdl2/display.pyx":808 * if main_window: * return main_window.get_drawable_size() * return None # <<<<<<<<<<<<<< * * def get_size(): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":805 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_drawable_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":810 * return None * * def get_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_size() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_63get_size(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_62get_size, "get_size()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_63get_size = {"get_size", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_63get_size, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_62get_size}; static PyObject *__pyx_pw_11pygame_sdl2_7display_63get_size(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_size (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_62get_size(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_62get_size(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_size", 1); /* "pygame_sdl2/display.pyx":811 * * def get_size(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_size() * return None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 811, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":812 * def get_size(): * if main_window: * return main_window.get_size() # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":811 * * def get_size(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_size() * return None */ } /* "pygame_sdl2/display.pyx":813 * if main_window: * return main_window.get_size() * return None # <<<<<<<<<<<<<< * * def get_position(): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":810 * return None * * def get_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_size() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":815 * return None * * def get_position(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_position() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_65get_position(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_64get_position, "get_position()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_65get_position = {"get_position", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_65get_position, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_64get_position}; static PyObject *__pyx_pw_11pygame_sdl2_7display_65get_position(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_position (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_64get_position(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_64get_position(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_position", 1); /* "pygame_sdl2/display.pyx":816 * * def get_position(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_position() * return None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":817 * def get_position(): * if main_window: * return main_window.get_position() # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_position); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":816 * * def get_position(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_position() * return None */ } /* "pygame_sdl2/display.pyx":818 * if main_window: * return main_window.get_position() * return None # <<<<<<<<<<<<<< * * def set_position(pos): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":815 * return None * * def get_position(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_position() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_position", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":820 * return None * * def set_position(pos): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_position(pos) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_67set_position(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_66set_position, "set_position(pos)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_67set_position = {"set_position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_67set_position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_66set_position}; static PyObject *__pyx_pw_11pygame_sdl2_7display_67set_position(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pos = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_position (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_position") < 0)) __PYX_ERR(0, 820, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pos = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_position", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 820, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_position", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_66set_position(__pyx_self, __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_66set_position(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_position", 1); /* "pygame_sdl2/display.pyx":821 * * def set_position(pos): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_position(pos) * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 821, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":822 * def set_position(pos): * if main_window: * return main_window.set_position(pos) # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_position); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_pos}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":821 * * def set_position(pos): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_position(pos) * return False */ } /* "pygame_sdl2/display.pyx":823 * if main_window: * return main_window.set_position(pos) * return False # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":820 * return None * * def set_position(pos): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_position(pos) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.set_position", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":826 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_69get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_68get_num_video_displays, "get_num_video_displays()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_69get_num_video_displays = {"get_num_video_displays", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_69get_num_video_displays, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_68get_num_video_displays}; static PyObject *__pyx_pw_11pygame_sdl2_7display_69get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_video_displays (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_68get_num_video_displays(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_68get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_num_video_displays", 1); /* "pygame_sdl2/display.pyx":827 * * def get_num_video_displays(): * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<< * if rv < 0: * raise error() */ __pyx_v_rv = SDL_GetNumVideoDisplays(); /* "pygame_sdl2/display.pyx":828 * def get_num_video_displays(): * rv = SDL_GetNumVideoDisplays() * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_rv < 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/display.pyx":829 * rv = SDL_GetNumVideoDisplays() * if rv < 0: * raise error() # <<<<<<<<<<<<<< * * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 829, __pyx_L1_error) /* "pygame_sdl2/display.pyx":828 * def get_num_video_displays(): * rv = SDL_GetNumVideoDisplays() * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":831 * raise error() * * return rv # <<<<<<<<<<<<<< * * def get_display_bounds(index): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":826 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_num_video_displays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":833 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_71get_display_bounds(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_70get_display_bounds, "get_display_bounds(index)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_71get_display_bounds = {"get_display_bounds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_71get_display_bounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_70get_display_bounds}; static PyObject *__pyx_pw_11pygame_sdl2_7display_71get_display_bounds(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_index = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_display_bounds (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 833, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_display_bounds") < 0)) __PYX_ERR(0, 833, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_display_bounds", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 833, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.get_display_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_70get_display_bounds(__pyx_self, __pyx_v_index); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_70get_display_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index) { SDL_Rect __pyx_v_rect; CYTHON_UNUSED int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_display_bounds", 1); /* "pygame_sdl2/display.pyx":835 * def get_display_bounds(index): * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) # <<<<<<<<<<<<<< * * return (rect.x, rect.y, rect.w, rect.h) */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 835, __pyx_L1_error) __pyx_v_rv = SDL_GetDisplayBounds(__pyx_t_1, (&__pyx_v_rect)); /* "pygame_sdl2/display.pyx":837 * rv = SDL_GetDisplayBounds(index, &rect) * * return (rect.x, rect.y, rect.w, rect.h) # <<<<<<<<<<<<<< * * def set_screensaver(state): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rect.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rect.y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rect.w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rect.h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":833 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.get_display_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":839 * return (rect.x, rect.y, rect.w, rect.h) * * def set_screensaver(state): # <<<<<<<<<<<<<< * """ * Sets the screenslaver to `state`. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_73set_screensaver(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_72set_screensaver, "set_screensaver(state)\n\n Sets the screenslaver to `state`.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_73set_screensaver = {"set_screensaver", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_73set_screensaver, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_72set_screensaver}; static PyObject *__pyx_pw_11pygame_sdl2_7display_73set_screensaver(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_screensaver (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 839, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_screensaver") < 0)) __PYX_ERR(0, 839, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_screensaver", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 839, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.display.set_screensaver", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_72set_screensaver(__pyx_self, __pyx_v_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_72set_screensaver(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_screensaver", 1); /* "pygame_sdl2/display.pyx":844 * """ * * if state: # <<<<<<<<<<<<<< * SDL_EnableScreenSaver() * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_state); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 844, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":845 * * if state: * SDL_EnableScreenSaver() # <<<<<<<<<<<<<< * else: * SDL_DisableScreenSaver() */ SDL_EnableScreenSaver(); /* "pygame_sdl2/display.pyx":844 * """ * * if state: # <<<<<<<<<<<<<< * SDL_EnableScreenSaver() * else: */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":847 * SDL_EnableScreenSaver() * else: * SDL_DisableScreenSaver() # <<<<<<<<<<<<<< * * def get_platform(): */ /*else*/ { SDL_DisableScreenSaver(); } __pyx_L3:; /* "pygame_sdl2/display.pyx":839 * return (rect.x, rect.y, rect.w, rect.h) * * def set_screensaver(state): # <<<<<<<<<<<<<< * """ * Sets the screenslaver to `state`. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.set_screensaver", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":849 * SDL_DisableScreenSaver() * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform().decode("utf-8") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_75get_platform(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7display_74get_platform, "get_platform()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_75get_platform = {"get_platform", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_75get_platform, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_74get_platform}; static PyObject *__pyx_pw_11pygame_sdl2_7display_75get_platform(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_platform (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7display_74get_platform(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_74get_platform(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_platform", 1); /* "pygame_sdl2/display.pyx":850 * * def get_platform(): * return SDL_GetPlatform().decode("utf-8") # <<<<<<<<<<<<<< * * cdef api SDL_Window *PyWindow_AsWindow(window): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = SDL_GetPlatform(); __pyx_t_2 = __Pyx_ssize_strlen(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 850, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_1, 0, __pyx_t_2, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_r = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":849 * SDL_DisableScreenSaver() * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform().decode("utf-8") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.get_platform", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":852 * return SDL_GetPlatform().decode("utf-8") * * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<< * """ * Returns a pointer to the SDL_Window corresponding to `window`. If `window` */ static SDL_Window *__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow(PyObject *__pyx_v_window) { SDL_Window *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("PyWindow_AsWindow", 0); __Pyx_INCREF(__pyx_v_window); /* "pygame_sdl2/display.pyx":859 * """ * * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ __pyx_t_1 = (__pyx_v_window == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":860 * * if window is None: * window = main_window # <<<<<<<<<<<<<< * * if window is None: */ __Pyx_INCREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_window, ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); /* "pygame_sdl2/display.pyx":859 * """ * * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ } /* "pygame_sdl2/display.pyx":862 * window = main_window * * if window is None: # <<<<<<<<<<<<<< * return NULL * */ __pyx_t_1 = (__pyx_v_window == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":863 * * if window is None: * return NULL # <<<<<<<<<<<<<< * * return ( window).window */ __pyx_r = NULL; goto __pyx_L0; /* "pygame_sdl2/display.pyx":862 * window = main_window * * if window is None: # <<<<<<<<<<<<<< * return NULL * */ } /* "pygame_sdl2/display.pyx":865 * return NULL * * return ( window).window # <<<<<<<<<<<<<< */ __pyx_r = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_window)->window; goto __pyx_L0; /* "pygame_sdl2/display.pyx":852 * return SDL_GetPlatform().decode("utf-8") * * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<< * """ * Returns a pointer to the SDL_Window corresponding to `window`. If `window` */ /* function exit code */ __pyx_L0:; __Pyx_XDECREF(__pyx_v_window); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_7display_Window(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_7display_Window *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)o); p->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_7display_Window(PyObject *o) { struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_7display_Window) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); if (p->__weakref__) PyObject_ClearWeakRefs(o); Py_CLEAR(p->surface); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_7display_Window(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o; if (p->surface) { e = (*v)(((PyObject *)p->surface), a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_7display_Window(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o; tmp = ((PyObject*)p->surface); p->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_7display_6Window_surface(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_7display_6Window_7surface_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_7display_6Window_surface(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_7display_6Window_7surface_3__set__(o, v); } else { return __pyx_pw_11pygame_sdl2_7display_6Window_7surface_5__del__(o); } } static PyMethodDef __pyx_methods_11pygame_sdl2_7display_Window[] = { {"create_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_2create_surface}, {"destroy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_4destroy}, {"resize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_7resize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_6resize}, {"recreate_gl_context", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_9recreate_gl_context, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_8recreate_gl_context}, {"get_window_flags", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_11get_window_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_10get_window_flags}, {"proxy_window_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_13proxy_window_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_12proxy_window_surface}, {"flip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_15flip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_14flip}, {"get_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_17get_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_16get_surface}, {"update", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_19update, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_18update}, {"get_wm_info", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_21get_wm_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_20get_wm_info}, {"get_active", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_23get_active, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_22get_active}, {"iconify", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_25iconify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_24iconify}, {"toggle_fullscreen", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_27toggle_fullscreen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_26toggle_fullscreen}, {"set_gamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_28set_gamma}, {"set_gamma_ramp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_31set_gamma_ramp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_30set_gamma_ramp}, {"set_icon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_33set_icon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_32set_icon}, {"set_caption", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_35set_caption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_34set_caption}, {"get_drawable_size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_37get_drawable_size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_36get_drawable_size}, {"get_size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_39get_size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_38get_size}, {"restore", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_41restore, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_40restore}, {"maximize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_43maximize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_42maximize}, {"minimize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_45minimize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_44minimize}, {"get_sdl_window_pointer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer}, {"get_position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_49get_position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_48get_position}, {"set_position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_51set_position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_50set_position}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_53__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_52__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7display_6Window_55__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_54__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_7display_Window[] = { {(char *)"surface", __pyx_getprop_11pygame_sdl2_7display_6Window_surface, __pyx_setprop_11pygame_sdl2_7display_6Window_surface, (char *)PyDoc_STR("surface: pygame_sdl2.surface.Surface"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_7display_Window_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_7display_Window}, {Py_tp_doc, (void *)PyDoc_STR("Window(title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED), Surface shape=None)")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_7display_Window}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_7display_Window}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_7display_Window}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_7display_Window}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_7display_6Window_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_7display_Window}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_7display_Window_spec = { "pygame_sdl2.display.Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_7display_Window_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_7display_Window = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.display.""Window", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_7display_Window, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Window(title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED), Surface shape=None)"), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_7display_Window, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_7display_Window, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_7display_Window, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_7display_Window, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_7display_6Window_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_7display_Window, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 1, 0}, {&__pyx_kp_s_Couldn_t_allocate_rectangles, __pyx_k_Couldn_t_allocate_rectangles, sizeof(__pyx_k_Couldn_t_allocate_rectangles), 0, 0, 1, 0}, {&__pyx_n_s_GL_SWAP_CONTROL, __pyx_k_GL_SWAP_CONTROL, sizeof(__pyx_k_GL_SWAP_CONTROL), 0, 0, 1, 1}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_n_s_Info, __pyx_k_Info, sizeof(__pyx_k_Info), 0, 0, 1, 1}, {&__pyx_n_s_Info___init, __pyx_k_Info___init, sizeof(__pyx_k_Info___init), 0, 0, 1, 1}, {&__pyx_n_s_Info___repr, __pyx_k_Info___repr, sizeof(__pyx_k_Info___repr), 0, 0, 1, 1}, {&__pyx_kp_s_Info_r, __pyx_k_Info_r, sizeof(__pyx_k_Info_r), 0, 0, 1, 0}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_n_s_PYGAME_IOS, __pyx_k_PYGAME_IOS, sizeof(__pyx_k_PYGAME_IOS), 0, 0, 1, 1}, {&__pyx_n_s_PYGAME_SDL2, __pyx_k_PYGAME_SDL2, sizeof(__pyx_k_PYGAME_SDL2), 0, 0, 1, 1}, {&__pyx_n_s_PYGAME_SDL2_AVOID_GL, __pyx_k_PYGAME_SDL2_AVOID_GL, sizeof(__pyx_k_PYGAME_SDL2_AVOID_GL), 0, 0, 1, 1}, {&__pyx_n_s_RESIZE_FLAGS, __pyx_k_RESIZE_FLAGS, sizeof(__pyx_k_RESIZE_FLAGS), 0, 0, 1, 1}, {&__pyx_n_s_SRCALPHA, __pyx_k_SRCALPHA, sizeof(__pyx_k_SRCALPHA), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_Window, __pyx_k_Window, sizeof(__pyx_k_Window), 0, 0, 1, 1}, {&__pyx_n_s_Window___reduce_cython, __pyx_k_Window___reduce_cython, sizeof(__pyx_k_Window___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Window___setstate_cython, __pyx_k_Window___setstate_cython, sizeof(__pyx_k_Window___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Window_create_surface, __pyx_k_Window_create_surface, sizeof(__pyx_k_Window_create_surface), 0, 0, 1, 1}, {&__pyx_n_s_Window_destroy, __pyx_k_Window_destroy, sizeof(__pyx_k_Window_destroy), 0, 0, 1, 1}, {&__pyx_n_s_Window_flip, __pyx_k_Window_flip, sizeof(__pyx_k_Window_flip), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_active, __pyx_k_Window_get_active, sizeof(__pyx_k_Window_get_active), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_drawable_size, __pyx_k_Window_get_drawable_size, sizeof(__pyx_k_Window_get_drawable_size), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_position, __pyx_k_Window_get_position, sizeof(__pyx_k_Window_get_position), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_sdl_window_pointer, __pyx_k_Window_get_sdl_window_pointer, sizeof(__pyx_k_Window_get_sdl_window_pointer), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_size, __pyx_k_Window_get_size, sizeof(__pyx_k_Window_get_size), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_surface, __pyx_k_Window_get_surface, sizeof(__pyx_k_Window_get_surface), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_window_flags, __pyx_k_Window_get_window_flags, sizeof(__pyx_k_Window_get_window_flags), 0, 0, 1, 1}, {&__pyx_n_s_Window_get_wm_info, __pyx_k_Window_get_wm_info, sizeof(__pyx_k_Window_get_wm_info), 0, 0, 1, 1}, {&__pyx_n_s_Window_iconify, __pyx_k_Window_iconify, sizeof(__pyx_k_Window_iconify), 0, 0, 1, 1}, {&__pyx_n_s_Window_maximize, __pyx_k_Window_maximize, sizeof(__pyx_k_Window_maximize), 0, 0, 1, 1}, {&__pyx_n_s_Window_minimize, __pyx_k_Window_minimize, sizeof(__pyx_k_Window_minimize), 0, 0, 1, 1}, {&__pyx_n_s_Window_proxy_window_surface, __pyx_k_Window_proxy_window_surface, sizeof(__pyx_k_Window_proxy_window_surface), 0, 0, 1, 1}, {&__pyx_n_s_Window_recreate_gl_context, __pyx_k_Window_recreate_gl_context, sizeof(__pyx_k_Window_recreate_gl_context), 0, 0, 1, 1}, {&__pyx_n_s_Window_resize, __pyx_k_Window_resize, sizeof(__pyx_k_Window_resize), 0, 0, 1, 1}, {&__pyx_n_s_Window_restore, __pyx_k_Window_restore, sizeof(__pyx_k_Window_restore), 0, 0, 1, 1}, {&__pyx_n_s_Window_set_caption, __pyx_k_Window_set_caption, sizeof(__pyx_k_Window_set_caption), 0, 0, 1, 1}, {&__pyx_n_s_Window_set_gamma, __pyx_k_Window_set_gamma, sizeof(__pyx_k_Window_set_gamma), 0, 0, 1, 1}, {&__pyx_n_s_Window_set_gamma_ramp, __pyx_k_Window_set_gamma_ramp, sizeof(__pyx_k_Window_set_gamma_ramp), 0, 0, 1, 1}, {&__pyx_n_s_Window_set_icon, __pyx_k_Window_set_icon, sizeof(__pyx_k_Window_set_icon), 0, 0, 1, 1}, {&__pyx_n_s_Window_set_position, __pyx_k_Window_set_position, sizeof(__pyx_k_Window_set_position), 0, 0, 1, 1}, {&__pyx_n_s_Window_toggle_fullscreen, __pyx_k_Window_toggle_fullscreen, sizeof(__pyx_k_Window_toggle_fullscreen), 0, 0, 1, 1}, {&__pyx_n_s_Window_update, __pyx_k_Window_update, sizeof(__pyx_k_Window_update), 0, 0, 1, 1}, {&__pyx_n_s__116, __pyx_k__116, sizeof(__pyx_k__116), 0, 0, 1, 1}, {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, {&__pyx_n_s_always, __pyx_k_always, sizeof(__pyx_k_always), 0, 0, 1, 1}, {&__pyx_n_s_androidembed, __pyx_k_androidembed, sizeof(__pyx_k_androidembed), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_bitsize, __pyx_k_bitsize, sizeof(__pyx_k_bitsize), 0, 0, 1, 1}, {&__pyx_n_s_blit_hw, __pyx_k_blit_hw, sizeof(__pyx_k_blit_hw), 0, 0, 1, 1}, {&__pyx_n_s_blit_hw_A, __pyx_k_blit_hw_A, sizeof(__pyx_k_blit_hw_A), 0, 0, 1, 1}, {&__pyx_n_s_blit_hw_CC, __pyx_k_blit_hw_CC, sizeof(__pyx_k_blit_hw_CC), 0, 0, 1, 1}, {&__pyx_n_s_blit_sw, __pyx_k_blit_sw, sizeof(__pyx_k_blit_sw), 0, 0, 1, 1}, {&__pyx_n_s_blit_sw_A, __pyx_k_blit_sw_A, sizeof(__pyx_k_blit_sw_A), 0, 0, 1, 1}, {&__pyx_n_s_blit_sw_CC, __pyx_k_blit_sw_CC, sizeof(__pyx_k_blit_sw_CC), 0, 0, 1, 1}, {&__pyx_n_s_blue, __pyx_k_blue, sizeof(__pyx_k_blue), 0, 0, 1, 1}, {&__pyx_n_s_blue_gamma, __pyx_k_blue_gamma, sizeof(__pyx_k_blue_gamma), 0, 0, 1, 1}, {&__pyx_n_s_bytesize, __pyx_k_bytesize, sizeof(__pyx_k_bytesize), 0, 0, 1, 1}, {&__pyx_n_s_c_void_p, __pyx_k_c_void_p, sizeof(__pyx_k_c_void_p), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, {&__pyx_n_s_create_surface, __pyx_k_create_surface, sizeof(__pyx_k_create_surface), 0, 0, 1, 1}, {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1}, {&__pyx_n_s_cur_height, __pyx_k_cur_height, sizeof(__pyx_k_cur_height), 0, 0, 1, 1}, {&__pyx_n_s_cur_width, __pyx_k_cur_width, sizeof(__pyx_k_cur_width), 0, 0, 1, 1}, {&__pyx_n_s_current_h, __pyx_k_current_h, sizeof(__pyx_k_current_h), 0, 0, 1, 1}, {&__pyx_n_s_current_w, __pyx_k_current_w, sizeof(__pyx_k_current_w), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_default_icon, __pyx_k_default_icon, sizeof(__pyx_k_default_icon), 0, 0, 1, 1}, {&__pyx_n_s_default_swap_control, __pyx_k_default_swap_control, sizeof(__pyx_k_default_swap_control), 0, 0, 1, 1}, {&__pyx_n_s_default_title, __pyx_k_default_title, sizeof(__pyx_k_default_title), 0, 0, 1, 1}, {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1}, {&__pyx_n_s_destroy, __pyx_k_destroy, sizeof(__pyx_k_destroy), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_dm, __pyx_k_dm, sizeof(__pyx_k_dm), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 0, 0, 1, 1}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_flip, __pyx_k_flip, sizeof(__pyx_k_flip), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_fullscreen, __pyx_k_fullscreen, sizeof(__pyx_k_fullscreen), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_active, __pyx_k_get_active, sizeof(__pyx_k_get_active), 0, 0, 1, 1}, {&__pyx_n_s_get_caption, __pyx_k_get_caption, sizeof(__pyx_k_get_caption), 0, 0, 1, 1}, {&__pyx_n_s_get_display_bounds, __pyx_k_get_display_bounds, sizeof(__pyx_k_get_display_bounds), 0, 0, 1, 1}, {&__pyx_n_s_get_drawable_size, __pyx_k_get_drawable_size, sizeof(__pyx_k_get_drawable_size), 0, 0, 1, 1}, {&__pyx_n_s_get_driver, __pyx_k_get_driver, sizeof(__pyx_k_get_driver), 0, 0, 1, 1}, {&__pyx_n_s_get_hint, __pyx_k_get_hint, sizeof(__pyx_k_get_hint), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_num_video_displays, __pyx_k_get_num_video_displays, sizeof(__pyx_k_get_num_video_displays), 0, 0, 1, 1}, {&__pyx_n_s_get_platform, __pyx_k_get_platform, sizeof(__pyx_k_get_platform), 0, 0, 1, 1}, {&__pyx_n_s_get_position, __pyx_k_get_position, sizeof(__pyx_k_get_position), 0, 0, 1, 1}, {&__pyx_n_s_get_sdl_window_pointer, __pyx_k_get_sdl_window_pointer, sizeof(__pyx_k_get_sdl_window_pointer), 0, 0, 1, 1}, {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1}, {&__pyx_n_s_get_surface, __pyx_k_get_surface, sizeof(__pyx_k_get_surface), 0, 0, 1, 1}, {&__pyx_n_s_get_window, __pyx_k_get_window, sizeof(__pyx_k_get_window), 0, 0, 1, 1}, {&__pyx_n_s_get_window_flags, __pyx_k_get_window_flags, sizeof(__pyx_k_get_window_flags), 0, 0, 1, 1}, {&__pyx_n_s_get_wm_info, __pyx_k_get_wm_info, sizeof(__pyx_k_get_wm_info), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_gl_get_attribute, __pyx_k_gl_get_attribute, sizeof(__pyx_k_gl_get_attribute), 0, 0, 1, 1}, {&__pyx_n_s_gl_load_library, __pyx_k_gl_load_library, sizeof(__pyx_k_gl_load_library), 0, 0, 1, 1}, {&__pyx_n_s_gl_reset_attributes, __pyx_k_gl_reset_attributes, sizeof(__pyx_k_gl_reset_attributes), 0, 0, 1, 1}, {&__pyx_n_s_gl_set_attribute, __pyx_k_gl_set_attribute, sizeof(__pyx_k_gl_set_attribute), 0, 0, 1, 1}, {&__pyx_n_s_gl_unload_library, __pyx_k_gl_unload_library, sizeof(__pyx_k_gl_unload_library), 0, 0, 1, 1}, {&__pyx_n_s_green, __pyx_k_green, sizeof(__pyx_k_green), 0, 0, 1, 1}, {&__pyx_n_s_green_gamma, __pyx_k_green_gamma, sizeof(__pyx_k_green_gamma), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_n_s_hint, __pyx_k_hint, sizeof(__pyx_k_hint), 0, 0, 1, 1}, {&__pyx_n_s_hw, __pyx_k_hw, sizeof(__pyx_k_hw), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_iconify, __pyx_k_iconify, sizeof(__pyx_k_iconify), 0, 0, 1, 1}, {&__pyx_n_s_icontitle, __pyx_k_icontitle, sizeof(__pyx_k_icontitle), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_init_done, __pyx_k_init_done, sizeof(__pyx_k_init_done), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_ios, __pyx_k_ios, sizeof(__pyx_k_ios), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_list_modes, __pyx_k_list_modes, sizeof(__pyx_k_list_modes), 0, 0, 1, 1}, {&__pyx_n_s_losses, __pyx_k_losses, sizeof(__pyx_k_losses), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_main_done, __pyx_k_main_done, sizeof(__pyx_k_main_done), 0, 0, 1, 1}, {&__pyx_n_s_main_window, __pyx_k_main_window, sizeof(__pyx_k_main_window), 0, 0, 1, 1}, {&__pyx_n_s_masks, __pyx_k_masks, sizeof(__pyx_k_masks), 0, 0, 1, 1}, {&__pyx_n_s_maximize, __pyx_k_maximize, sizeof(__pyx_k_maximize), 0, 0, 1, 1}, {&__pyx_n_s_maximized, __pyx_k_maximized, sizeof(__pyx_k_maximized), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_minimize, __pyx_k_minimize, sizeof(__pyx_k_minimize), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_mode_ok, __pyx_k_mode_ok, sizeof(__pyx_k_mode_ok), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_num_modes, __pyx_k_num_modes, sizeof(__pyx_k_num_modes), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_opengl, __pyx_k_opengl, sizeof(__pyx_k_opengl), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1}, {&__pyx_n_s_proxy_window_surface, __pyx_k_proxy_window_surface, sizeof(__pyx_k_proxy_window_surface), 0, 0, 1, 1}, {&__pyx_n_s_pygame_hints, __pyx_k_pygame_hints, sizeof(__pyx_k_pygame_hints), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_display, __pyx_k_pygame_sdl2_display, sizeof(__pyx_k_pygame_sdl2_display), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_kp_s_pygame_window, __pyx_k_pygame_window, sizeof(__pyx_k_pygame_window), 0, 0, 1, 0}, {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_recreate_gl_context, __pyx_k_recreate_gl_context, sizeof(__pyx_k_recreate_gl_context), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_rectangles, __pyx_k_rectangles, sizeof(__pyx_k_rectangles), 0, 0, 1, 1}, {&__pyx_n_s_rects, __pyx_k_rects, sizeof(__pyx_k_rects), 0, 0, 1, 1}, {&__pyx_n_s_red, __pyx_k_red, sizeof(__pyx_k_red), 0, 0, 1, 1}, {&__pyx_n_s_red_gamma, __pyx_k_red_gamma, sizeof(__pyx_k_red_gamma), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_refresh_rate, __pyx_k_refresh_rate, sizeof(__pyx_k_refresh_rate), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1}, {&__pyx_n_s_resolution, __pyx_k_resolution, sizeof(__pyx_k_resolution), 0, 0, 1, 1}, {&__pyx_n_s_restore, __pyx_k_restore, sizeof(__pyx_k_restore), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_kp_s_self_gl_context_self_window_self, __pyx_k_self_gl_context_self_window_self, sizeof(__pyx_k_self_gl_context_self_window_self), 0, 0, 1, 0}, {&__pyx_n_s_set_caption, __pyx_k_set_caption, sizeof(__pyx_k_set_caption), 0, 0, 1, 1}, {&__pyx_n_s_set_gamma, __pyx_k_set_gamma, sizeof(__pyx_k_set_gamma), 0, 0, 1, 1}, {&__pyx_n_s_set_gamma_ramp, __pyx_k_set_gamma_ramp, sizeof(__pyx_k_set_gamma_ramp), 0, 0, 1, 1}, {&__pyx_n_s_set_icon, __pyx_k_set_icon, sizeof(__pyx_k_set_icon), 0, 0, 1, 1}, {&__pyx_n_s_set_mode, __pyx_k_set_mode, sizeof(__pyx_k_set_mode), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_set_position, __pyx_k_set_position, sizeof(__pyx_k_set_position), 0, 0, 1, 1}, {&__pyx_n_s_set_screensaver, __pyx_k_set_screensaver, sizeof(__pyx_k_set_screensaver), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, {&__pyx_n_s_shifts, __pyx_k_shifts, sizeof(__pyx_k_shifts), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_k_src_pygame_sdl2_display_pyx, sizeof(__pyx_k_src_pygame_sdl2_display_pyx), 0, 0, 1, 0}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_title, __pyx_k_title, sizeof(__pyx_k_title), 0, 0, 1, 1}, {&__pyx_n_s_toggle_fullscreen, __pyx_k_toggle_fullscreen, sizeof(__pyx_k_toggle_fullscreen), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_video_mem, __pyx_k_video_mem, sizeof(__pyx_k_video_mem), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_wm, __pyx_k_wm, sizeof(__pyx_k_wm), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 126, __pyx_L1_error) __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 597, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 405, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 469, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/display.pyx":131 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED), Surface shape=None): # <<<<<<<<<<<<<< * cdef SDL_WindowShapeMode shape_mode * */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/display.pyx":141 * # If we do not get the AVOID_GL hint, we always create a GL-compatible * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<< * gl_flag = 0 * else: */ __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_PYGAME_SDL2_AVOID_GL, __pyx_kp_s_0); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/display.pyx":242 * if self.window_surface.format.BitsPerPixel == 32: * * self.surface = Surface(()) # <<<<<<<<<<<<<< * self.surface.surface = self.window_surface * self.surface.owns_surface = False */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/display.pyx":405 * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<< * * try: */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Couldn_t_allocate_rectangles); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value, priority=1): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ __pyx_tuple__8 = PyTuple_Pack(3, __pyx_n_s_hint, __pyx_n_s_value, __pyx_n_s_priority); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_hint, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 40, __pyx_L1_error) __pyx_tuple__10 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "pygame_sdl2/display.pyx":54 * SDL_SetHintWithPriority(hint, value, priority) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_hint, __pyx_n_s_default); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_hint, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 54, __pyx_L1_error) /* "pygame_sdl2/display.pyx":68 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_sdl_main_init, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 68, __pyx_L1_error) /* "pygame_sdl2/display.pyx":84 * init_done = False * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * */ __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 84, __pyx_L1_error) /* "pygame_sdl2/display.pyx":102 * * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_quit, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 102, __pyx_L1_error) /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_init, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 117, __pyx_L1_error) /* "pygame_sdl2/display.pyx":219 * raise * * def create_surface(self): # <<<<<<<<<<<<<< * """ * Creates the surface associated with this window. */ __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_w, __pyx_n_s_h); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_create_surface, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 219, __pyx_L1_error) /* "pygame_sdl2/display.pyx":253 * * * def destroy(self): # <<<<<<<<<<<<<< * """ * This should be called before the window is deleted. */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_destroy, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 253, __pyx_L1_error) /* "pygame_sdl2/display.pyx":272 * SDL_DestroyWindow(self.window) * * def resize(self, size, opengl=False, fullscreen=None, maximized=None): # <<<<<<<<<<<<<< * """ * Resizes the window to `size`, which must be a width, height tuple. If opengl */ __pyx_tuple__21 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_size, __pyx_n_s_opengl, __pyx_n_s_fullscreen, __pyx_n_s_maximized, __pyx_n_s_flags, __pyx_n_s_cur_width, __pyx_n_s_cur_height, __pyx_n_s_width, __pyx_n_s_height); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_resize, 272, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 272, __pyx_L1_error) __pyx_tuple__23 = PyTuple_Pack(3, Py_False, Py_None, Py_None); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); /* "pygame_sdl2/display.pyx":332 * self.create_surface() * * def recreate_gl_context(self, always=False): # <<<<<<<<<<<<<< * """ * Check to see if the GL context was lost, and re-create it if it was. */ __pyx_tuple__24 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_always); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_recreate_gl_context, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 332, __pyx_L1_error) __pyx_tuple__26 = PyTuple_Pack(1, Py_False); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); /* "pygame_sdl2/display.pyx":350 * return True * * def get_window_flags(self): # <<<<<<<<<<<<<< * rv = SDL_GetWindowFlags(self.window) * */ __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_window_flags, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 350, __pyx_L1_error) /* "pygame_sdl2/display.pyx":360 * return rv * * def proxy_window_surface(self): # <<<<<<<<<<<<<< * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * */ __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_proxy_window_surface, 360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 360, __pyx_L1_error) /* "pygame_sdl2/display.pyx":363 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * * def flip(self): # <<<<<<<<<<<<<< * cdef const char *err * */ __pyx_tuple__30 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_err); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_flip, 363, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 363, __pyx_L1_error) /* "pygame_sdl2/display.pyx":385 * SDL_UpdateWindowSurface(self.window) * * def get_surface(self): # <<<<<<<<<<<<<< * return self.surface * */ __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_surface, 385, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 385, __pyx_L1_error) /* "pygame_sdl2/display.pyx":388 * return self.surface * * def update(self, rectangles=None): # <<<<<<<<<<<<<< * * cdef SDL_Rect *rects */ __pyx_tuple__33 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_rectangles, __pyx_n_s_rects, __pyx_n_s_count, __pyx_n_s_i); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_update, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 388, __pyx_L1_error) __pyx_tuple__35 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); /* "pygame_sdl2/display.pyx":421 * free(rects) * * def get_wm_info(self): # <<<<<<<<<<<<<< * return { } * */ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_wm_info, 421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 421, __pyx_L1_error) /* "pygame_sdl2/display.pyx":424 * return { } * * def get_active(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False */ __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_active, 424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 424, __pyx_L1_error) /* "pygame_sdl2/display.pyx":430 * return True * * def iconify(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * return True */ __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_iconify, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 430, __pyx_L1_error) /* "pygame_sdl2/display.pyx":434 * return True * * def toggle_fullscreen(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): */ __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_toggle_fullscreen, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 434, __pyx_L1_error) /* "pygame_sdl2/display.pyx":444 * return True * * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<< * if green is None: * green = red */ __pyx_tuple__40 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue, __pyx_n_s_red_gamma, __pyx_n_s_green_gamma, __pyx_n_s_blue_gamma); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma, 444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 444, __pyx_L1_error) __pyx_tuple__42 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); /* "pygame_sdl2/display.pyx":463 * return True * * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ __pyx_tuple__43 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue, __pyx_n_s_red_gamma, __pyx_n_s_green_gamma, __pyx_n_s_blue_gamma, __pyx_n_s_i); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma_ramp, 463, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 463, __pyx_L1_error) /* "pygame_sdl2/display.pyx":479 * return True * * def set_icon(self, Surface surface): # <<<<<<<<<<<<<< * SDL_SetWindowIcon(self.window, surface.surface) * */ __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_icon, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 479, __pyx_L1_error) /* "pygame_sdl2/display.pyx":482 * SDL_SetWindowIcon(self.window, surface.surface) * * def set_caption(self, title): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_title); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_caption, 482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 482, __pyx_L1_error) /* "pygame_sdl2/display.pyx":489 * SDL_SetWindowTitle(self.window, title) * * def get_drawable_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_drawable_size, 489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 489, __pyx_L1_error) /* "pygame_sdl2/display.pyx":496 * * * def get_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_size, 496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 496, __pyx_L1_error) /* "pygame_sdl2/display.pyx":502 * return w, h * * def restore(self): # <<<<<<<<<<<<<< * SDL_RestoreWindow(self.window) * */ __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_restore, 502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 502, __pyx_L1_error) /* "pygame_sdl2/display.pyx":505 * SDL_RestoreWindow(self.window) * * def maximize(self): # <<<<<<<<<<<<<< * SDL_MaximizeWindow(self.window) * */ __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_maximize, 505, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 505, __pyx_L1_error) /* "pygame_sdl2/display.pyx":508 * SDL_MaximizeWindow(self.window) * * def minimize(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * */ __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_minimize, 508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 508, __pyx_L1_error) /* "pygame_sdl2/display.pyx":511 * SDL_MinimizeWindow(self.window) * * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<< * """ * Returns the pointer to the SDL_Window corresponding to this window. */ __pyx_tuple__54 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctypes); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_sdl_window_pointer, 511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 511, __pyx_L1_error) /* "pygame_sdl2/display.pyx":519 * return ctypes.c_void_p( self.window) * * def get_position(self): # <<<<<<<<<<<<<< * cdef int x, y * */ __pyx_tuple__56 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_position, 519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 519, __pyx_L1_error) /* "pygame_sdl2/display.pyx":525 * return x, y * * def set_position(self, pos): # <<<<<<<<<<<<<< * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * */ __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_position, 525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 525, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" */ __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(1, 3, __pyx_L1_error) /* "pygame_sdl2/display.pyx":539 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ __pyx_tuple__63 = PyTuple_Pack(5, __pyx_n_s_resolution, __pyx_n_s_flags, __pyx_n_s_depth, __pyx_n_s_pos, __pyx_n_s_RESIZE_FLAGS); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_mode, 539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 539, __pyx_L1_error) /* "pygame_sdl2/display.pyx":560 * return main_window.surface * * def destroy(): # <<<<<<<<<<<<<< * global main_window * */ __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_destroy, 560, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 560, __pyx_L1_error) /* "pygame_sdl2/display.pyx":567 * main_window = None * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_surface, 567, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 567, __pyx_L1_error) /* "pygame_sdl2/display.pyx":573 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_window, 573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 573, __pyx_L1_error) /* "pygame_sdl2/display.pyx":581 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_flip, 581, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 581, __pyx_L1_error) /* "pygame_sdl2/display.pyx":585 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_rectangles); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_update, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 585, __pyx_L1_error) /* "pygame_sdl2/display.pyx":589 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_driver); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_driver, 589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 589, __pyx_L1_error) /* "pygame_sdl2/display.pyx":597 * return driver * * class Info(object): # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_tuple__73 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73); __pyx_tuple__74 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); /* "pygame_sdl2/display.pyx":599 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ __pyx_tuple__75 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dm, __pyx_n_s_format); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init_2, 599, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 599, __pyx_L1_error) /* "pygame_sdl2/display.pyx":658 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_repr, 658, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 658, __pyx_L1_error) /* "pygame_sdl2/display.pyx":662 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_wm_info, 662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 662, __pyx_L1_error) /* "pygame_sdl2/display.pyx":669 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ __pyx_tuple__79 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 669, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 669, __pyx_L1_error) /* "pygame_sdl2/display.pyx":682 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ __pyx_tuple__81 = PyTuple_Pack(8, __pyx_n_s_depth, __pyx_n_s_flags, __pyx_n_s_display, __pyx_n_s_num_modes, __pyx_n_s_i, __pyx_n_s_mode, __pyx_n_s_rv, __pyx_n_s_t); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_list_modes, 682, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 682, __pyx_L1_error) __pyx_tuple__83 = PyTuple_Pack(3, ((PyObject *)__pyx_int_0), ((PyObject *)__pyx_int_0), ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); /* "pygame_sdl2/display.pyx":707 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ __pyx_tuple__84 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_flags, __pyx_n_s_depth); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84); __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_mode_ok, 707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 707, __pyx_L1_error) /* "pygame_sdl2/display.pyx":714 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_reset_attributes, 714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 714, __pyx_L1_error) /* "pygame_sdl2/display.pyx":717 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ __pyx_tuple__87 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87); __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_set_attribute, 717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 717, __pyx_L1_error) /* "pygame_sdl2/display.pyx":737 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ __pyx_tuple__89 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89); __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_get_attribute, 737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 737, __pyx_L1_error) /* "pygame_sdl2/display.pyx":748 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ __pyx_tuple__91 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__91); __Pyx_GIVEREF(__pyx_tuple__91); __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_load_library, 748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 748, __pyx_L1_error) /* "pygame_sdl2/display.pyx":756 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_unload_library, 756, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 756, __pyx_L1_error) /* "pygame_sdl2/display.pyx":759 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_active, 759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 759, __pyx_L1_error) /* "pygame_sdl2/display.pyx":764 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_iconify, 764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 764, __pyx_L1_error) /* "pygame_sdl2/display.pyx":770 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_toggle_fullscreen, 770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 770, __pyx_L1_error) /* "pygame_sdl2/display.pyx":776 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ __pyx_tuple__97 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__97); __Pyx_GIVEREF(__pyx_tuple__97); __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma, 776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 776, __pyx_L1_error) /* "pygame_sdl2/display.pyx":781 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma_ramp, 781, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 781, __pyx_L1_error) /* "pygame_sdl2/display.pyx":786 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ __pyx_tuple__100 = PyTuple_Pack(1, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__100); __Pyx_GIVEREF(__pyx_tuple__100); __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_icon, 786, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 786, __pyx_L1_error) /* "pygame_sdl2/display.pyx":794 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ __pyx_tuple__102 = PyTuple_Pack(2, __pyx_n_s_title, __pyx_n_s_icontitle); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__102); __Pyx_GIVEREF(__pyx_tuple__102); __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_caption, 794, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 794, __pyx_L1_error) /* "pygame_sdl2/display.pyx":802 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_caption, 802, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 802, __pyx_L1_error) /* "pygame_sdl2/display.pyx":805 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_drawable_size, 805, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 805, __pyx_L1_error) /* "pygame_sdl2/display.pyx":810 * return None * * def get_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_size() */ __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_size, 810, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 810, __pyx_L1_error) /* "pygame_sdl2/display.pyx":815 * return None * * def get_position(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_position() */ __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_position, 815, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 815, __pyx_L1_error) /* "pygame_sdl2/display.pyx":820 * return None * * def set_position(pos): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_position(pos) */ __pyx_tuple__108 = PyTuple_Pack(1, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__108); __Pyx_GIVEREF(__pyx_tuple__108); __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_position, 820, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 820, __pyx_L1_error) /* "pygame_sdl2/display.pyx":826 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 826, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 826, __pyx_L1_error) /* "pygame_sdl2/display.pyx":833 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ __pyx_tuple__111 = PyTuple_Pack(3, __pyx_n_s_index, __pyx_n_s_rect, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__111); __Pyx_GIVEREF(__pyx_tuple__111); __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_display_bounds, 833, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 833, __pyx_L1_error) /* "pygame_sdl2/display.pyx":839 * return (rect.x, rect.y, rect.w, rect.h) * * def set_screensaver(state): # <<<<<<<<<<<<<< * """ * Sets the screenslaver to `state`. */ __pyx_tuple__113 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__113); __Pyx_GIVEREF(__pyx_tuple__113); __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_screensaver, 839, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 839, __pyx_L1_error) /* "pygame_sdl2/display.pyx":849 * SDL_DisableScreenSaver() * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform().decode("utf-8") * */ __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_platform, 849, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_268435456 = PyInt_FromLong(268435456L); if (unlikely(!__pyx_int_268435456)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_7display_main_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None); Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ if (__Pyx_ExportVoidPtr(__pyx_n_s_main_window, (void *)&__pyx_v_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("PyWindow_AsWindow", (void (*)(void))__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow, "SDL_Window *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_7display_Window = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_7display_Window_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) __PYX_ERR(0, 130, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_7display_Window_spec, __pyx_ptype_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 130, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_7display_Window = &__pyx_type_11pygame_sdl2_7display_Window; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 130, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_7display_Window->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_7display_Window->tp_dictoffset && __pyx_ptype_11pygame_sdl2_7display_Window->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_7display_Window->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Window, (PyObject *) __pyx_ptype_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 130, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_7display_Window->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_7display_Window->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7display_Window, __weakref__); #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 130, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(3, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_4rect_Rect),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_4rect_Rect) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_display(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_display}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "display", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initdisplay(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initdisplay(void) #else __Pyx_PyMODINIT_FUNC PyInit_display(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_display(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_display(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'display' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("display", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "display" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_display(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__display) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.display")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.display", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); if (unlikely((__Pyx_modinit_variable_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/display.pyx":25 * * from libc.stdlib cimport calloc, free * from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * import pygame_sdl2 */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_SRCALPHA); __Pyx_GIVEREF(__pyx_n_s_SRCALPHA); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SRCALPHA)) __PYX_ERR(0, 25, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_GL_SWAP_CONTROL); __Pyx_GIVEREF(__pyx_n_s_GL_SWAP_CONTROL); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_GL_SWAP_CONTROL)) __PYX_ERR(0, 25, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SWAP_CONTROL, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":26 * from libc.stdlib cimport calloc, free * from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error)) __PYX_ERR(0, 26, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":27 * from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * import warnings */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":29 * import pygame_sdl2 * * import warnings # <<<<<<<<<<<<<< * import os * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":30 * * import warnings * import os # <<<<<<<<<<<<<< * * # True if we are on ios. */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":33 * * # True if we are on ios. * ios = ("PYGAME_IOS" in os.environ) # <<<<<<<<<<<<<< * * # This inits SDL proper, and should be called by the other init methods. */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_PYGAME_IOS, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ios, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":38 * * # A map from a PYGAME_SDL2 hint to what it was set to. * _pygame_hints = { } # <<<<<<<<<<<<<< * * def hint(hint, value, priority=1): */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_hints, __pyx_t_3) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value, priority=1): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_1hint, 0, __pyx_n_s_hint, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hint, __pyx_t_3) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":54 * SDL_SetHintWithPriority(hint, value, priority) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_3_get_hint, 0, __pyx_n_s_get_hint, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hint, __pyx_t_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":66 * * * main_done = False # <<<<<<<<<<<<<< * * def sdl_main_init(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_main_done, Py_False) < 0) __PYX_ERR(0, 66, __pyx_L1_error) /* "pygame_sdl2/display.pyx":68 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_5sdl_main_init, 0, __pyx_n_s_sdl_main_init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sdl_main_init, __pyx_t_3) < 0) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":82 * * # True if init has been called without quit being called. * init_done = False # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_done, Py_False) < 0) __PYX_ERR(0, 82, __pyx_L1_error) /* "pygame_sdl2/display.pyx":84 * init_done = False * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_7init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":102 * * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_9quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_11get_init, 0, __pyx_n_s_get_init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":122 * * # The window that is used by the various module globals. * main_window = None # <<<<<<<<<<<<<< * * try: */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/display.pyx":124 * main_window = None * * try: # <<<<<<<<<<<<<< * import androidembed * except ImportError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { /* "pygame_sdl2/display.pyx":125 * * try: * import androidembed # <<<<<<<<<<<<<< * except ImportError: * androidembed = None */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_androidembed, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_androidembed, __pyx_t_2) < 0) __PYX_ERR(0, 125, __pyx_L2_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":124 * main_window = None * * try: # <<<<<<<<<<<<<< * import androidembed * except ImportError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_try_end; __pyx_L2_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":126 * try: * import androidembed * except ImportError: # <<<<<<<<<<<<<< * androidembed = None * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); if (__pyx_t_8) { __Pyx_AddTraceback("pygame_sdl2.display", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_3) < 0) __PYX_ERR(0, 126, __pyx_L4_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":127 * import androidembed * except ImportError: * androidembed = None # <<<<<<<<<<<<<< * * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_androidembed, Py_None) < 0) __PYX_ERR(0, 127, __pyx_L4_except_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L3_exception_handled; } goto __pyx_L4_except_error; /* "pygame_sdl2/display.pyx":124 * main_window = None * * try: # <<<<<<<<<<<<<< * import androidembed * except ImportError: */ __pyx_L4_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_6, __pyx_t_7); goto __pyx_L1_error; __pyx_L3_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_6, __pyx_t_7); __pyx_L7_try_end:; } /* "pygame_sdl2/display.pyx":131 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED), Surface shape=None): # <<<<<<<<<<<<<< * cdef SDL_WindowShapeMode shape_mode * */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_k__2 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":219 * raise * * def create_surface(self): # <<<<<<<<<<<<<< * """ * Creates the surface associated with this window. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_3create_surface, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_create_surface, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_create_surface, __pyx_t_2) < 0) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":253 * * * def destroy(self): # <<<<<<<<<<<<<< * """ * This should be called before the window is deleted. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_destroy, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_destroy, __pyx_t_2) < 0) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":272 * SDL_DestroyWindow(self.window) * * def resize(self, size, opengl=False, fullscreen=None, maximized=None): # <<<<<<<<<<<<<< * """ * Resizes the window to `size`, which must be a width, height tuple. If opengl */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_7resize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_resize, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__23); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_resize, __pyx_t_2) < 0) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":332 * self.create_surface() * * def recreate_gl_context(self, always=False): # <<<<<<<<<<<<<< * """ * Check to see if the GL context was lost, and re-create it if it was. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_9recreate_gl_context, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_recreate_gl_context, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__26); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_recreate_gl_context, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":350 * return True * * def get_window_flags(self): # <<<<<<<<<<<<<< * rv = SDL_GetWindowFlags(self.window) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_11get_window_flags, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_window_flags, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_window_flags, __pyx_t_2) < 0) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":360 * return rv * * def proxy_window_surface(self): # <<<<<<<<<<<<<< * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_13proxy_window_surface, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_proxy_window_surface, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_proxy_window_surface, __pyx_t_2) < 0) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":363 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * * def flip(self): # <<<<<<<<<<<<<< * cdef const char *err * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_15flip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_flip, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_flip, __pyx_t_2) < 0) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":385 * SDL_UpdateWindowSurface(self.window) * * def get_surface(self): # <<<<<<<<<<<<<< * return self.surface * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_17get_surface, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_surface, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_surface, __pyx_t_2) < 0) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":388 * return self.surface * * def update(self, rectangles=None): # <<<<<<<<<<<<<< * * cdef SDL_Rect *rects */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_19update, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_update, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__35); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_update, __pyx_t_2) < 0) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":421 * free(rects) * * def get_wm_info(self): # <<<<<<<<<<<<<< * return { } * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_21get_wm_info, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_wm_info, __pyx_t_2) < 0) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":424 * return { } * * def get_active(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_23get_active, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_active, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_active, __pyx_t_2) < 0) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":430 * return True * * def iconify(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * return True */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_25iconify, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_iconify, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_iconify, __pyx_t_2) < 0) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":434 * return True * * def toggle_fullscreen(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_27toggle_fullscreen, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_toggle_fullscreen, __pyx_t_2) < 0) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":444 * return True * * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<< * if green is None: * green = red */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_29set_gamma, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_set_gamma, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__42); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_set_gamma, __pyx_t_2) < 0) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":463 * return True * * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_31set_gamma_ramp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_set_gamma_ramp, __pyx_t_2) < 0) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":479 * return True * * def set_icon(self, Surface surface): # <<<<<<<<<<<<<< * SDL_SetWindowIcon(self.window, surface.surface) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_33set_icon, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_set_icon, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_set_icon, __pyx_t_2) < 0) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":482 * SDL_SetWindowIcon(self.window, surface.surface) * * def set_caption(self, title): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_35set_caption, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_set_caption, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_set_caption, __pyx_t_2) < 0) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":489 * SDL_SetWindowTitle(self.window, title) * * def get_drawable_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_37get_drawable_size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_drawable_size, __pyx_t_2) < 0) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":496 * * * def get_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_39get_size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_size, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_size, __pyx_t_2) < 0) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":502 * return w, h * * def restore(self): # <<<<<<<<<<<<<< * SDL_RestoreWindow(self.window) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_41restore, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_restore, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_restore, __pyx_t_2) < 0) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":505 * SDL_RestoreWindow(self.window) * * def maximize(self): # <<<<<<<<<<<<<< * SDL_MaximizeWindow(self.window) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_43maximize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_maximize, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_maximize, __pyx_t_2) < 0) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":508 * SDL_MaximizeWindow(self.window) * * def minimize(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_45minimize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_minimize, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_minimize, __pyx_t_2) < 0) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":511 * SDL_MinimizeWindow(self.window) * * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<< * """ * Returns the pointer to the SDL_Window corresponding to this window. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_sdl_window_pointer, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_sdl_window_pointer, __pyx_t_2) < 0) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":519 * return ctypes.c_void_p( self.window) * * def get_position(self): # <<<<<<<<<<<<<< * cdef int x, y * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_49get_position, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_get_position, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_get_position, __pyx_t_2) < 0) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "pygame_sdl2/display.pyx":525 * return x, y * * def set_position(self, pos): # <<<<<<<<<<<<<< * SDL_SetWindowPosition(self.window, pos[0], pos[1]) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_51set_position, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window_set_position, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window, __pyx_n_s_set_position, __pyx_t_2) < 0) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7display_Window); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_53__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_6Window_55__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Window___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":531 * * # The icon that's used for new windows. * default_icon = None # <<<<<<<<<<<<<< * * # The title that's used for new windows. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, Py_None) < 0) __PYX_ERR(0, 531, __pyx_L1_error) /* "pygame_sdl2/display.pyx":534 * * # The title that's used for new windows. * default_title = "pygame window" # <<<<<<<<<<<<<< * * # The default gl_swap_control */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_kp_s_pygame_window) < 0) __PYX_ERR(0, 534, __pyx_L1_error) /* "pygame_sdl2/display.pyx":537 * * # The default gl_swap_control * default_swap_control = 1 # <<<<<<<<<<<<<< * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_int_1) < 0) __PYX_ERR(0, 537, __pyx_L1_error) /* "pygame_sdl2/display.pyx":539 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_13set_mode, 0, __pyx_n_s_set_mode, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 539, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_3 = 0; __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_2)->__pyx_arg_pos = __pyx_t_9; __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_11pygame_sdl2_7display_76__defaults__); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_2) < 0) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":560 * return main_window.surface * * def destroy(): # <<<<<<<<<<<<<< * global main_window * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_15destroy, 0, __pyx_n_s_destroy, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_destroy, __pyx_t_2) < 0) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":567 * main_window = None * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_17get_surface, 0, __pyx_n_s_get_surface, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_surface, __pyx_t_2) < 0) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":573 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_19get_window, 0, __pyx_n_s_get_window, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_window, __pyx_t_2) < 0) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":581 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_21flip, 0, __pyx_n_s_flip, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_2) < 0) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":585 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_23update, 0, __pyx_n_s_update, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__35); if (PyDict_SetItem(__pyx_d, __pyx_n_s_update, __pyx_t_2) < 0) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":589 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_25get_driver, 0, __pyx_n_s_get_driver, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver, __pyx_t_2) < 0) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":597 * return driver * * class Info(object): # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_tuple__74); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_9, __pyx_t_2, __pyx_n_s_Info, __pyx_n_s_Info, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_display, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_2 != __pyx_tuple__74) { if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_tuple__74) < 0))) __PYX_ERR(0, 597, __pyx_L1_error) } /* "pygame_sdl2/display.pyx":599 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_1__init__, 0, __pyx_n_s_Info___init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init_2, __pyx_t_5) < 0) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":658 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__, 0, __pyx_n_s_Info___repr, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_5) < 0) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":597 * return driver * * class Info(object): # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_9, __pyx_n_s_Info, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Info, __pyx_t_5) < 0) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":662 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_27get_wm_info, 0, __pyx_n_s_get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_wm_info, __pyx_t_2) < 0) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":669 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays, 0, __pyx_n_s_get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_2) < 0) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":682 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_31list_modes, 0, __pyx_n_s_list_modes, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__83); if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_modes, __pyx_t_2) < 0) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":707 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_33mode_ok, 0, __pyx_n_s_mode_ok, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple_); if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_ok, __pyx_t_2) < 0) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":714 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes, 0, __pyx_n_s_gl_reset_attributes, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_reset_attributes, __pyx_t_2) < 0) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":717 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute, 0, __pyx_n_s_gl_set_attribute, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_set_attribute, __pyx_t_2) < 0) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":737 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute, 0, __pyx_n_s_gl_get_attribute, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_get_attribute, __pyx_t_2) < 0) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":748 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_41gl_load_library, 0, __pyx_n_s_gl_load_library, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_load_library, __pyx_t_2) < 0) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":756 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_43gl_unload_library, 0, __pyx_n_s_gl_unload_library, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_unload_library, __pyx_t_2) < 0) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":759 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_45get_active, 0, __pyx_n_s_get_active, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_active, __pyx_t_2) < 0) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":764 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_47iconify, 0, __pyx_n_s_iconify, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_iconify, __pyx_t_2) < 0) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":770 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen, 0, __pyx_n_s_toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_toggle_fullscreen, __pyx_t_2) < 0) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":776 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_51set_gamma, 0, __pyx_n_s_set_gamma, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__42); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma, __pyx_t_2) < 0) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":781 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp, 0, __pyx_n_s_set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma_ramp, __pyx_t_2) < 0) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":786 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_55set_icon, 0, __pyx_n_s_set_icon, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_icon, __pyx_t_2) < 0) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":794 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_57set_caption, 0, __pyx_n_s_set_caption, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__35); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_caption, __pyx_t_2) < 0) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":802 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_59get_caption, 0, __pyx_n_s_get_caption, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_caption, __pyx_t_2) < 0) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":805 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_61get_drawable_size, 0, __pyx_n_s_get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drawable_size, __pyx_t_2) < 0) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":810 * return None * * def get_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_size() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_63get_size, 0, __pyx_n_s_get_size, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_size, __pyx_t_2) < 0) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":815 * return None * * def get_position(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_position() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_65get_position, 0, __pyx_n_s_get_position, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_position, __pyx_t_2) < 0) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":820 * return None * * def set_position(pos): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_position(pos) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_67set_position, 0, __pyx_n_s_set_position, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_position, __pyx_t_2) < 0) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":826 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_69get_num_video_displays, 0, __pyx_n_s_get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_2) < 0) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":833 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_71get_display_bounds, 0, __pyx_n_s_get_display_bounds, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_display_bounds, __pyx_t_2) < 0) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":839 * return (rect.x, rect.y, rect.w, rect.h) * * def set_screensaver(state): # <<<<<<<<<<<<<< * """ * Sets the screenslaver to `state`. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_73set_screensaver, 0, __pyx_n_s_set_screensaver, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_screensaver, __pyx_t_2) < 0) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":849 * SDL_DisableScreenSaver() * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform().decode("utf-8") * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_75get_platform, 0, __pyx_n_s_get_platform, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_platform, __pyx_t_2) < 0) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Copyright 2014 Tom Rothamel * # */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.display", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.display"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__6; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_12 #define __PYX_HAVE_RT_ImportType_3_0_12 static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__7); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE SDL_HintPriority __Pyx_PyInt_As_SDL_HintPriority(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_HintPriority neg_one = (SDL_HintPriority) -1, const_zero = (SDL_HintPriority) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SDL_HintPriority) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_HintPriority) val; } } #endif if (unlikely(!PyLong_Check(x))) { SDL_HintPriority val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_HintPriority) -1; val = __Pyx_PyInt_As_SDL_HintPriority(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SDL_HintPriority) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) >= 2 * PyLong_SHIFT)) { return (SDL_HintPriority) (((((SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0])); } } break; case 3: if ((8 * sizeof(SDL_HintPriority) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) >= 3 * PyLong_SHIFT)) { return (SDL_HintPriority) (((((((SDL_HintPriority)digits[2]) << PyLong_SHIFT) | (SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0])); } } break; case 4: if ((8 * sizeof(SDL_HintPriority) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) >= 4 * PyLong_SHIFT)) { return (SDL_HintPriority) (((((((((SDL_HintPriority)digits[3]) << PyLong_SHIFT) | (SDL_HintPriority)digits[2]) << PyLong_SHIFT) | (SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_HintPriority) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SDL_HintPriority) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_HintPriority, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_HintPriority) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_HintPriority, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SDL_HintPriority) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) - 1 > 2 * PyLong_SHIFT)) { return (SDL_HintPriority) (((SDL_HintPriority)-1)*(((((SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0]))); } } break; case 2: if ((8 * sizeof(SDL_HintPriority) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) - 1 > 2 * PyLong_SHIFT)) { return (SDL_HintPriority) ((((((SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0]))); } } break; case -3: if ((8 * sizeof(SDL_HintPriority) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) - 1 > 3 * PyLong_SHIFT)) { return (SDL_HintPriority) (((SDL_HintPriority)-1)*(((((((SDL_HintPriority)digits[2]) << PyLong_SHIFT) | (SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0]))); } } break; case 3: if ((8 * sizeof(SDL_HintPriority) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) - 1 > 3 * PyLong_SHIFT)) { return (SDL_HintPriority) ((((((((SDL_HintPriority)digits[2]) << PyLong_SHIFT) | (SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0]))); } } break; case -4: if ((8 * sizeof(SDL_HintPriority) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) - 1 > 4 * PyLong_SHIFT)) { return (SDL_HintPriority) (((SDL_HintPriority)-1)*(((((((((SDL_HintPriority)digits[3]) << PyLong_SHIFT) | (SDL_HintPriority)digits[2]) << PyLong_SHIFT) | (SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0]))); } } break; case 4: if ((8 * sizeof(SDL_HintPriority) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_HintPriority, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_HintPriority) - 1 > 4 * PyLong_SHIFT)) { return (SDL_HintPriority) ((((((((((SDL_HintPriority)digits[3]) << PyLong_SHIFT) | (SDL_HintPriority)digits[2]) << PyLong_SHIFT) | (SDL_HintPriority)digits[1]) << PyLong_SHIFT) | (SDL_HintPriority)digits[0]))); } } break; } } #endif if ((sizeof(SDL_HintPriority) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_HintPriority, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_HintPriority) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_HintPriority, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { SDL_HintPriority val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums"); val = (SDL_HintPriority) -1; #endif if (unlikely(ret)) return (SDL_HintPriority) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_HintPriority"); return (SDL_HintPriority) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_HintPriority"); return (SDL_HintPriority) -1; } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint32_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint32_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = v; } v = NULL; val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint32_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint32_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(unsigned int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (unsigned int) val; } } #endif if (unlikely(!PyLong_Check(x))) { unsigned int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (unsigned int) -1; val = __Pyx_PyInt_As_unsigned_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT)) { return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); } } break; case 3: if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT)) { return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); } } break; case 4: if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT)) { return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(unsigned int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) { return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case 2: if ((8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) { return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case -3: if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) { return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case 3: if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) { return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case -4: if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT)) { return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case 4: if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT)) { return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; } } #endif if ((sizeof(unsigned int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { unsigned int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (unsigned int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (unsigned int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (unsigned int) -1; } else { stepval = v; } v = NULL; val = (unsigned int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(unsigned int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((unsigned int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(unsigned int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((unsigned int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((unsigned int) 1) << (sizeof(unsigned int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (unsigned int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned int"); return (unsigned int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned int"); return (unsigned int) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_WindowFlags neg_one = (SDL_WindowFlags) -1, const_zero = (SDL_WindowFlags) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_WindowFlags) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_WindowFlags) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_WindowFlags) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_WindowFlags), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_WindowFlags)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint16_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint16_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint16_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint16_t) -1; val = __Pyx_PyInt_As_uint16_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) >= 2 * PyLong_SHIFT)) { return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) >= 3 * PyLong_SHIFT)) { return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) >= 4 * PyLong_SHIFT)) { return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint16_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint16_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint16_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { return (uint16_t) (((uint16_t)-1)*(((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { return (uint16_t) ((((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { return (uint16_t) (((uint16_t)-1)*(((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { return (uint16_t) ((((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) { return (uint16_t) (((uint16_t)-1)*(((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) { return (uint16_t) ((((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; } } #endif if ((sizeof(uint16_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint16_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint16_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint16_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint16_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint16_t) -1; } else { stepval = v; } v = NULL; val = (uint16_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint16_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint16_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint16_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint16_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint16_t) 1) << (sizeof(uint16_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint16_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint16_t"); return (uint16_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint16_t"); return (uint16_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(unsigned long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(unsigned long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(unsigned long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(unsigned long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE SDL_GLattr __Pyx_PyInt_As_SDL_GLattr(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GLattr neg_one = (SDL_GLattr) -1, const_zero = (SDL_GLattr) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SDL_GLattr) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_GLattr) val; } } #endif if (unlikely(!PyLong_Check(x))) { SDL_GLattr val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_GLattr) -1; val = __Pyx_PyInt_As_SDL_GLattr(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SDL_GLattr) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) >= 2 * PyLong_SHIFT)) { return (SDL_GLattr) (((((SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0])); } } break; case 3: if ((8 * sizeof(SDL_GLattr) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) >= 3 * PyLong_SHIFT)) { return (SDL_GLattr) (((((((SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0])); } } break; case 4: if ((8 * sizeof(SDL_GLattr) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) >= 4 * PyLong_SHIFT)) { return (SDL_GLattr) (((((((((SDL_GLattr)digits[3]) << PyLong_SHIFT) | (SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_GLattr) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SDL_GLattr) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_GLattr) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SDL_GLattr) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) - 1 > 2 * PyLong_SHIFT)) { return (SDL_GLattr) (((SDL_GLattr)-1)*(((((SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case 2: if ((8 * sizeof(SDL_GLattr) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) - 1 > 2 * PyLong_SHIFT)) { return (SDL_GLattr) ((((((SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case -3: if ((8 * sizeof(SDL_GLattr) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) - 1 > 3 * PyLong_SHIFT)) { return (SDL_GLattr) (((SDL_GLattr)-1)*(((((((SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case 3: if ((8 * sizeof(SDL_GLattr) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) - 1 > 3 * PyLong_SHIFT)) { return (SDL_GLattr) ((((((((SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case -4: if ((8 * sizeof(SDL_GLattr) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) - 1 > 4 * PyLong_SHIFT)) { return (SDL_GLattr) (((SDL_GLattr)-1)*(((((((((SDL_GLattr)digits[3]) << PyLong_SHIFT) | (SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case 4: if ((8 * sizeof(SDL_GLattr) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_GLattr) - 1 > 4 * PyLong_SHIFT)) { return (SDL_GLattr) ((((((((((SDL_GLattr)digits[3]) << PyLong_SHIFT) | (SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; } } #endif if ((sizeof(SDL_GLattr) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_GLattr) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { SDL_GLattr val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums"); val = (SDL_GLattr) -1; #endif if (unlikely(ret)) return (SDL_GLattr) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_GLattr"); return (SDL_GLattr) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_GLattr"); return (SDL_GLattr) -1; } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__116); } return name; } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* VoidPtrExport */ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { PyObject *d; PyObject *cobj = 0; d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); Py_XINCREF(d); if (!d) { d = PyDict_New(); if (!d) goto bad; if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) goto bad; } cobj = PyCapsule_New(p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItem(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; cobj = PyCapsule_New(tmp.p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12 #define __PYX_HAVE_RT_ImportFunction_3_0_12 static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635909.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.display_api.h0000664000175000017500000000361715026112605021401 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef __PYX_HAVE_API__pygame_sdl2__display #define __PYX_HAVE_API__pygame_sdl2__display #ifdef __MINGW64__ #define MS_WIN64 #endif #include "Python.h" static SDL_Window *(*__pyx_api_f_11pygame_sdl2_7display_PyWindow_AsWindow)(PyObject *) = 0; #define PyWindow_AsWindow __pyx_api_f_11pygame_sdl2_7display_PyWindow_AsWindow #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12 #define __PYX_HAVE_RT_ImportFunction_3_0_12 static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int import_pygame_sdl2__display(void) { PyObject *module = 0; module = PyImport_ImportModule("pygame_sdl2.display"); if (!module) goto bad; if (__Pyx_ImportFunction_3_0_12(module, "PyWindow_AsWindow", (void (**)(void))&__pyx_api_f_11pygame_sdl2_7display_PyWindow_AsWindow, "SDL_Window *(PyObject *)") < 0) goto bad; Py_DECREF(module); module = 0; return 0; bad: Py_XDECREF(module); return -1; } #endif /* !__PYX_HAVE_API__pygame_sdl2__display */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635913.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.draw.c0000664000175000017500000203565015026112611020034 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__draw #define __PYX_HAVE_API__pygame_sdl2__draw /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/draw.pyx", "src/pygame_sdl2/surface.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 #define __PYX_HAVE_RT_ImportType_proto_3_0_12 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_12 { __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.draw" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.draw" extern int __pyx_module_is_main_pygame_sdl2__draw; int __pyx_module_is_main_pygame_sdl2__draw = 0; /* Implementation of "pygame_sdl2.draw" */ /* #### Code section: global_var ### */ /* #### Code section: string_decls ### */ static const char __pyx_k_h[] = "h"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__3[] = "*"; static const char __pyx_k__4[] = "."; static const char __pyx_k_rx[] = "rx"; static const char __pyx_k_ry[] = "ry"; static const char __pyx_k_x1[] = "x1"; static const char __pyx_k_x2[] = "x2"; static const char __pyx_k_y1[] = "y1"; static const char __pyx_k_y2[] = "y2"; static const char __pyx_k__25[] = "?"; static const char __pyx_k_arc[] = "arc"; static const char __pyx_k_box[] = "box"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_clip[] = "clip"; static const char __pyx_k_line[] = "line"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_blend[] = "blend"; static const char __pyx_k_color[] = "color"; static const char __pyx_k_dirty[] = "dirty"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_lines[] = "lines"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_aaline[] = "aaline"; static const char __pyx_k_circle[] = "circle"; static const char __pyx_k_closed[] = "closed"; static const char __pyx_k_endpos[] = "endpos"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_radius[] = "radius"; static const char __pyx_k_aalines[] = "aalines"; static const char __pyx_k_ellipse[] = "ellipse"; static const char __pyx_k_end_pos[] = "end_pos"; static const char __pyx_k_gfxdraw[] = "gfxdraw"; static const char __pyx_k_polygon[] = "polygon"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_get_rect[] = "get_rect"; static const char __pyx_k_startpos[] = "startpos"; static const char __pyx_k_union_ip[] = "union_ip"; static const char __pyx_k_pointlist[] = "pointlist"; static const char __pyx_k_rectangle[] = "rectangle"; static const char __pyx_k_start_pos[] = "start_pos"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_stop_angle[] = "stop_angle"; static const char __pyx_k_thick_line[] = "thick_line"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_start_angle[] = "start_angle"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_filled_circle[] = "filled_circle"; static const char __pyx_k_filled_ellipse[] = "filled_ellipse"; static const char __pyx_k_filled_polygon[] = "filled_polygon"; static const char __pyx_k_Not_implemented[] = "Not implemented."; static const char __pyx_k_pygame_sdl2_draw[] = "pygame_sdl2.draw"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_gfxdraw[] = "pygame_sdl2.gfxdraw"; static const char __pyx_k_src_pygame_sdl2_draw_pyx[] = "src/pygame_sdl2/draw.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_rect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_2polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_4circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pos, PyObject *__pyx_v_radius, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_6ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_8arc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, CYTHON_UNUSED PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_start_angle, CYTHON_UNUSED PyObject *__pyx_v_stop_angle, CYTHON_UNUSED PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_10line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_start_pos, PyObject *__pyx_v_end_pos, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_12lines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_14aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_startpos, PyObject *__pyx_v_endpos, CYTHON_UNUSED PyObject *__pyx_v_blend); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_16aalines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, CYTHON_UNUSED PyObject *__pyx_v_blend); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_s_Not_implemented; PyObject *__pyx_n_s_Rect; PyObject *__pyx_n_s__25; PyObject *__pyx_n_s__3; PyObject *__pyx_kp_u__4; PyObject *__pyx_n_s_aaline; PyObject *__pyx_n_s_aalines; PyObject *__pyx_n_s_arc; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_blend; PyObject *__pyx_n_s_box; PyObject *__pyx_n_s_circle; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_clip; PyObject *__pyx_n_s_closed; PyObject *__pyx_n_s_color; PyObject *__pyx_n_s_dirty; PyObject *__pyx_n_s_ellipse; PyObject *__pyx_n_s_end_pos; PyObject *__pyx_n_s_endpos; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_filled_circle; PyObject *__pyx_n_s_filled_ellipse; PyObject *__pyx_n_s_filled_polygon; PyObject *__pyx_n_s_get_rect; PyObject *__pyx_n_s_gfxdraw; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_line; PyObject *__pyx_n_s_lines; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_pointlist; PyObject *__pyx_n_s_polygon; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_draw; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_gfxdraw; PyObject *__pyx_n_s_pygame_sdl2_rect; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_radius; PyObject *__pyx_n_s_rect; PyObject *__pyx_n_s_rectangle; PyObject *__pyx_n_s_rx; PyObject *__pyx_n_s_ry; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_draw_pyx; PyObject *__pyx_n_s_start_angle; PyObject *__pyx_n_s_start_pos; PyObject *__pyx_n_s_startpos; PyObject *__pyx_n_s_stop_angle; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_thick_line; PyObject *__pyx_n_s_union_ip; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_width; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_x1; PyObject *__pyx_n_s_x2; PyObject *__pyx_n_s_y; PyObject *__pyx_n_s_y1; PyObject *__pyx_n_s_y2; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_2; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__23; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__24; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_kp_s_Not_implemented); Py_CLEAR(clear_module_state->__pyx_n_s_Rect); Py_CLEAR(clear_module_state->__pyx_n_s__25); Py_CLEAR(clear_module_state->__pyx_n_s__3); Py_CLEAR(clear_module_state->__pyx_kp_u__4); Py_CLEAR(clear_module_state->__pyx_n_s_aaline); Py_CLEAR(clear_module_state->__pyx_n_s_aalines); Py_CLEAR(clear_module_state->__pyx_n_s_arc); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_blend); Py_CLEAR(clear_module_state->__pyx_n_s_box); Py_CLEAR(clear_module_state->__pyx_n_s_circle); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_clip); Py_CLEAR(clear_module_state->__pyx_n_s_closed); Py_CLEAR(clear_module_state->__pyx_n_s_color); Py_CLEAR(clear_module_state->__pyx_n_s_dirty); Py_CLEAR(clear_module_state->__pyx_n_s_ellipse); Py_CLEAR(clear_module_state->__pyx_n_s_end_pos); Py_CLEAR(clear_module_state->__pyx_n_s_endpos); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_filled_circle); Py_CLEAR(clear_module_state->__pyx_n_s_filled_ellipse); Py_CLEAR(clear_module_state->__pyx_n_s_filled_polygon); Py_CLEAR(clear_module_state->__pyx_n_s_get_rect); Py_CLEAR(clear_module_state->__pyx_n_s_gfxdraw); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_line); Py_CLEAR(clear_module_state->__pyx_n_s_lines); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_pointlist); Py_CLEAR(clear_module_state->__pyx_n_s_polygon); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_draw); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_gfxdraw); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rect); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_radius); Py_CLEAR(clear_module_state->__pyx_n_s_rect); Py_CLEAR(clear_module_state->__pyx_n_s_rectangle); Py_CLEAR(clear_module_state->__pyx_n_s_rx); Py_CLEAR(clear_module_state->__pyx_n_s_ry); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_draw_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start_angle); Py_CLEAR(clear_module_state->__pyx_n_s_start_pos); Py_CLEAR(clear_module_state->__pyx_n_s_startpos); Py_CLEAR(clear_module_state->__pyx_n_s_stop_angle); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_thick_line); Py_CLEAR(clear_module_state->__pyx_n_s_union_ip); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_x1); Py_CLEAR(clear_module_state->__pyx_n_s_x2); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_n_s_y1); Py_CLEAR(clear_module_state->__pyx_n_s_y2); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__24); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_kp_s_Not_implemented); Py_VISIT(traverse_module_state->__pyx_n_s_Rect); Py_VISIT(traverse_module_state->__pyx_n_s__25); Py_VISIT(traverse_module_state->__pyx_n_s__3); Py_VISIT(traverse_module_state->__pyx_kp_u__4); Py_VISIT(traverse_module_state->__pyx_n_s_aaline); Py_VISIT(traverse_module_state->__pyx_n_s_aalines); Py_VISIT(traverse_module_state->__pyx_n_s_arc); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_blend); Py_VISIT(traverse_module_state->__pyx_n_s_box); Py_VISIT(traverse_module_state->__pyx_n_s_circle); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_clip); Py_VISIT(traverse_module_state->__pyx_n_s_closed); Py_VISIT(traverse_module_state->__pyx_n_s_color); Py_VISIT(traverse_module_state->__pyx_n_s_dirty); Py_VISIT(traverse_module_state->__pyx_n_s_ellipse); Py_VISIT(traverse_module_state->__pyx_n_s_end_pos); Py_VISIT(traverse_module_state->__pyx_n_s_endpos); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_filled_circle); Py_VISIT(traverse_module_state->__pyx_n_s_filled_ellipse); Py_VISIT(traverse_module_state->__pyx_n_s_filled_polygon); Py_VISIT(traverse_module_state->__pyx_n_s_get_rect); Py_VISIT(traverse_module_state->__pyx_n_s_gfxdraw); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_line); Py_VISIT(traverse_module_state->__pyx_n_s_lines); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_pointlist); Py_VISIT(traverse_module_state->__pyx_n_s_polygon); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_draw); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_gfxdraw); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rect); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_radius); Py_VISIT(traverse_module_state->__pyx_n_s_rect); Py_VISIT(traverse_module_state->__pyx_n_s_rectangle); Py_VISIT(traverse_module_state->__pyx_n_s_rx); Py_VISIT(traverse_module_state->__pyx_n_s_ry); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_draw_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start_angle); Py_VISIT(traverse_module_state->__pyx_n_s_start_pos); Py_VISIT(traverse_module_state->__pyx_n_s_startpos); Py_VISIT(traverse_module_state->__pyx_n_s_stop_angle); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_thick_line); Py_VISIT(traverse_module_state->__pyx_n_s_union_ip); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_x1); Py_VISIT(traverse_module_state->__pyx_n_s_x2); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_n_s_y1); Py_VISIT(traverse_module_state->__pyx_n_s_y2); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__24); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_s_Not_implemented __pyx_mstate_global->__pyx_kp_s_Not_implemented #define __pyx_n_s_Rect __pyx_mstate_global->__pyx_n_s_Rect #define __pyx_n_s__25 __pyx_mstate_global->__pyx_n_s__25 #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3 #define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 #define __pyx_n_s_aaline __pyx_mstate_global->__pyx_n_s_aaline #define __pyx_n_s_aalines __pyx_mstate_global->__pyx_n_s_aalines #define __pyx_n_s_arc __pyx_mstate_global->__pyx_n_s_arc #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_blend __pyx_mstate_global->__pyx_n_s_blend #define __pyx_n_s_box __pyx_mstate_global->__pyx_n_s_box #define __pyx_n_s_circle __pyx_mstate_global->__pyx_n_s_circle #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_clip __pyx_mstate_global->__pyx_n_s_clip #define __pyx_n_s_closed __pyx_mstate_global->__pyx_n_s_closed #define __pyx_n_s_color __pyx_mstate_global->__pyx_n_s_color #define __pyx_n_s_dirty __pyx_mstate_global->__pyx_n_s_dirty #define __pyx_n_s_ellipse __pyx_mstate_global->__pyx_n_s_ellipse #define __pyx_n_s_end_pos __pyx_mstate_global->__pyx_n_s_end_pos #define __pyx_n_s_endpos __pyx_mstate_global->__pyx_n_s_endpos #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_filled_circle __pyx_mstate_global->__pyx_n_s_filled_circle #define __pyx_n_s_filled_ellipse __pyx_mstate_global->__pyx_n_s_filled_ellipse #define __pyx_n_s_filled_polygon __pyx_mstate_global->__pyx_n_s_filled_polygon #define __pyx_n_s_get_rect __pyx_mstate_global->__pyx_n_s_get_rect #define __pyx_n_s_gfxdraw __pyx_mstate_global->__pyx_n_s_gfxdraw #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_line __pyx_mstate_global->__pyx_n_s_line #define __pyx_n_s_lines __pyx_mstate_global->__pyx_n_s_lines #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_pointlist __pyx_mstate_global->__pyx_n_s_pointlist #define __pyx_n_s_polygon __pyx_mstate_global->__pyx_n_s_polygon #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_draw __pyx_mstate_global->__pyx_n_s_pygame_sdl2_draw #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_gfxdraw __pyx_mstate_global->__pyx_n_s_pygame_sdl2_gfxdraw #define __pyx_n_s_pygame_sdl2_rect __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rect #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_radius __pyx_mstate_global->__pyx_n_s_radius #define __pyx_n_s_rect __pyx_mstate_global->__pyx_n_s_rect #define __pyx_n_s_rectangle __pyx_mstate_global->__pyx_n_s_rectangle #define __pyx_n_s_rx __pyx_mstate_global->__pyx_n_s_rx #define __pyx_n_s_ry __pyx_mstate_global->__pyx_n_s_ry #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_draw_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_draw_pyx #define __pyx_n_s_start_angle __pyx_mstate_global->__pyx_n_s_start_angle #define __pyx_n_s_start_pos __pyx_mstate_global->__pyx_n_s_start_pos #define __pyx_n_s_startpos __pyx_mstate_global->__pyx_n_s_startpos #define __pyx_n_s_stop_angle __pyx_mstate_global->__pyx_n_s_stop_angle #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_thick_line __pyx_mstate_global->__pyx_n_s_thick_line #define __pyx_n_s_union_ip __pyx_mstate_global->__pyx_n_s_union_ip #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_x1 __pyx_mstate_global->__pyx_n_s_x1 #define __pyx_n_s_x2 __pyx_mstate_global->__pyx_n_s_x2 #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_n_s_y1 __pyx_mstate_global->__pyx_n_s_y1 #define __pyx_n_s_y2 __pyx_mstate_global->__pyx_n_s_y2 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 /* #### Code section: module_code ### */ /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_1rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_rect, "rect(Surface surface, color, rect, width=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_1rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_1rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_rect}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_1rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_width,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, 1); __PYX_ERR(0, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, 2); __PYX_ERR(0, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 26, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_rect = values[2]; __pyx_v_width = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 26, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 26, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_rect(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_rect, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_rect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/draw.pyx":27 * * def rect(Surface surface, color, rect, width=0): * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/draw.pyx":28 * def rect(Surface surface, color, rect, width=0): * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * * if width == 0: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_rect}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":27 * * def rect(Surface surface, color, rect, width=0): * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * */ } /* "pygame_sdl2/draw.pyx":30 * rect = Rect(rect) * * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.box(surface, rect, color) * else: */ __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_width, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 30, __pyx_L1_error) if (__pyx_t_3) { /* "pygame_sdl2/draw.pyx":31 * * if width == 0: * gfxdraw.box(surface, rect, color) # <<<<<<<<<<<<<< * else: * gfxdraw.rectangle(surface, rect, color) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_box); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, ((PyObject *)__pyx_v_surface), __pyx_v_rect, __pyx_v_color}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":30 * rect = Rect(rect) * * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.box(surface, rect, color) * else: */ goto __pyx_L4; } /* "pygame_sdl2/draw.pyx":33 * gfxdraw.box(surface, rect, color) * else: * gfxdraw.rectangle(surface, rect, color) # <<<<<<<<<<<<<< * n = 1 * while n < width: */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_rectangle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, ((PyObject *)__pyx_v_surface), __pyx_v_rect, __pyx_v_color}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":34 * else: * gfxdraw.rectangle(surface, rect, color) * n = 1 # <<<<<<<<<<<<<< * while n < width: * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":35 * gfxdraw.rectangle(surface, rect, color) * n = 1 * while n < width: # <<<<<<<<<<<<<< * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) * gfxdraw.rectangle(surface, r, color) */ while (1) { __pyx_t_1 = PyObject_RichCompare(__pyx_v_n, __pyx_v_width, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_3) break; /* "pygame_sdl2/draw.pyx":36 * n = 1 * while n < width: * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) # <<<<<<<<<<<<<< * gfxdraw.rectangle(surface, r, color) * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyNumber_Subtract(__pyx_t_5, __pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PyNumber_Subtract(__pyx_t_5, __pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_v_n, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyNumber_Add(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = __Pyx_PyInt_MultiplyObjC(__pyx_v_n, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = PyNumber_Add(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_t_7, __pyx_t_8, __pyx_t_10, __pyx_t_11}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":37 * while n < width: * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) * gfxdraw.rectangle(surface, r, color) # <<<<<<<<<<<<<< * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) * gfxdraw.rectangle(surface, r, color) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_rectangle); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, ((PyObject *)__pyx_v_surface), __pyx_v_r, __pyx_v_color}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":38 * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) * gfxdraw.rectangle(surface, r, color) * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) # <<<<<<<<<<<<<< * gfxdraw.rectangle(surface, r, color) * n += 1 */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Rect); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = PyNumber_Add(__pyx_t_4, __pyx_v_n); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_n, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyInt_MultiplyObjC(__pyx_v_n, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyNumber_Subtract(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_t_10, __pyx_t_8, __pyx_t_5, __pyx_t_9}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF_SET(__pyx_v_r, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":39 * gfxdraw.rectangle(surface, r, color) * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) * gfxdraw.rectangle(surface, r, color) # <<<<<<<<<<<<<< * n += 1 * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_rectangle); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_11, ((PyObject *)__pyx_v_surface), __pyx_v_r, __pyx_v_color}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":40 * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) * gfxdraw.rectangle(surface, r, color) * n += 1 # <<<<<<<<<<<<<< * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) * return dirty.clip(surface.get_rect()) */ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_1); __pyx_t_1 = 0; } } __pyx_L4:; /* "pygame_sdl2/draw.pyx":41 * gfxdraw.rectangle(surface, r, color) * n += 1 * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Rect); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = PyNumber_Subtract(__pyx_t_11, __pyx_v_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = PyNumber_Subtract(__pyx_t_11, __pyx_v_width); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyInt_MultiplyObjC(__pyx_v_width, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = PyNumber_Add(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyInt_MultiplyObjC(__pyx_v_width, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_t_5, __pyx_t_8, __pyx_t_4, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":42 * n += 1 * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def polygon(Surface surface, color, pointlist, width=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.draw.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_3polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_2polygon, "polygon(Surface surface, color, pointlist, width=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_3polygon = {"polygon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_3polygon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_2polygon}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_3polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_pointlist = 0; PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("polygon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_pointlist,&__pyx_n_s_width,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, 1); __PYX_ERR(0, 44, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointlist)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, 2); __PYX_ERR(0, 44, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "polygon") < 0)) __PYX_ERR(0, 44, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_pointlist = values[2]; __pyx_v_width = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 44, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 44, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_2polygon(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_pointlist, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_2polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width) { PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("polygon", 1); /* "pygame_sdl2/draw.pyx":45 * * def polygon(Surface surface, color, pointlist, width=0): * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_width, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 45, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/draw.pyx":46 * def polygon(Surface surface, color, pointlist, width=0): * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) # <<<<<<<<<<<<<< * dirty = Rect(pointlist[0], (1, 1)) * n = 1 */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filled_polygon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_pointlist, __pyx_v_color}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":47 * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) # <<<<<<<<<<<<<< * n = 1 * while n < len(pointlist): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_3, __pyx_tuple_}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_dirty = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":48 * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) * n = 1 # <<<<<<<<<<<<<< * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":49 * dirty = Rect(pointlist[0], (1, 1)) * n = 1 * while n < len(pointlist): # <<<<<<<<<<<<<< * dirty.union_ip(Rect(pointlist[n], (1,1))) * n += 1 */ while (1) { __pyx_t_7 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 49, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_RichCompare(__pyx_v_n, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_1) break; /* "pygame_sdl2/draw.pyx":50 * n = 1 * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) # <<<<<<<<<<<<<< * n += 1 * return dirty.clip(surface.get_rect()) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Rect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_8, __pyx_tuple_}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":51 * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) * n += 1 # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * else: */ __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_4); __pyx_t_4 = 0; } /* "pygame_sdl2/draw.pyx":52 * dirty.union_ip(Rect(pointlist[n], (1,1))) * n += 1 * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * else: * return lines(surface, color, True, pointlist, width) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":45 * * def polygon(Surface surface, color, pointlist, width=0): * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) */ } /* "pygame_sdl2/draw.pyx":54 * return dirty.clip(surface.get_rect()) * else: * return lines(surface, color, True, pointlist, width) # <<<<<<<<<<<<<< * * def circle(Surface surface, color, pos, radius, width=0): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_lines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_color, Py_True, __pyx_v_pointlist, __pyx_v_width}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 5+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.draw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_5circle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_4circle, "circle(Surface surface, color, pos, radius, width=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_5circle = {"circle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_5circle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_4circle}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_5circle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_pos = 0; PyObject *__pyx_v_radius = 0; PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("circle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_pos,&__pyx_n_s_radius,&__pyx_n_s_width,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 1); __PYX_ERR(0, 56, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 2); __PYX_ERR(0, 56, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radius)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 3); __PYX_ERR(0, 56, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "circle") < 0)) __PYX_ERR(0, 56, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_pos = values[2]; __pyx_v_radius = values[3]; __pyx_v_width = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 56, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 56, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_4circle(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_pos, __pyx_v_radius, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_4circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pos, PyObject *__pyx_v_radius, PyObject *__pyx_v_width) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("circle", 1); /* "pygame_sdl2/draw.pyx":57 * * def circle(Surface surface, color, pos, radius, width=0): * x, y = pos # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_circle(surface, x, y, radius, color) */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 57, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 57, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":58 * def circle(Surface surface, color, pos, radius, width=0): * x, y = pos * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) */ __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_width, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 58, __pyx_L1_error) if (__pyx_t_5) { /* "pygame_sdl2/draw.pyx":59 * x, y = pos * if width == 0: * gfxdraw.filled_circle(surface, x, y, radius, color) # <<<<<<<<<<<<<< * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) * return dirty.clip(surface.get_rect()) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_filled_circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_1, ((PyObject *)__pyx_v_surface), __pyx_v_x, __pyx_v_y, __pyx_v_radius, __pyx_v_color}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":60 * if width == 0: * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_v_x, __pyx_v_radius); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyNumber_Subtract(__pyx_v_y, __pyx_v_radius); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_v_radius, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_v_radius, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_8, __pyx_t_9}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_dirty = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":61 * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * else: * gfxdraw.circle(surface, x, y, radius, color) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":58 * def circle(Surface surface, color, pos, radius, width=0): * x, y = pos * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) */ } /* "pygame_sdl2/draw.pyx":63 * return dirty.clip(surface.get_rect()) * else: * gfxdraw.circle(surface, x, y, radius, color) # <<<<<<<<<<<<<< * n = 1 * while n < width: */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_circle); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_x, __pyx_v_y, __pyx_v_radius, __pyx_v_color}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":64 * else: * gfxdraw.circle(surface, x, y, radius, color) * n = 1 # <<<<<<<<<<<<<< * while n < width: * gfxdraw.circle(surface, x, y, radius - n, color) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":65 * gfxdraw.circle(surface, x, y, radius, color) * n = 1 * while n < width: # <<<<<<<<<<<<<< * gfxdraw.circle(surface, x, y, radius - n, color) * gfxdraw.circle(surface, x + 1, y, radius - n, color) */ while (1) { __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_v_width, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_5) break; /* "pygame_sdl2/draw.pyx":66 * n = 1 * while n < width: * gfxdraw.circle(surface, x, y, radius - n, color) # <<<<<<<<<<<<<< * gfxdraw.circle(surface, x + 1, y, radius - n, color) * gfxdraw.circle(surface, x - 1, y, radius - n, color) */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyNumber_Subtract(__pyx_v_radius, __pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_8, ((PyObject *)__pyx_v_surface), __pyx_v_x, __pyx_v_y, __pyx_t_9, __pyx_v_color}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":67 * while n < width: * gfxdraw.circle(surface, x, y, radius - n, color) * gfxdraw.circle(surface, x + 1, y, radius - n, color) # <<<<<<<<<<<<<< * gfxdraw.circle(surface, x - 1, y, radius - n, color) * n += 1 */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_circle); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_x, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PyNumber_Subtract(__pyx_v_radius, __pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_1, ((PyObject *)__pyx_v_surface), __pyx_t_3, __pyx_v_y, __pyx_t_8, __pyx_v_color}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":68 * gfxdraw.circle(surface, x, y, radius - n, color) * gfxdraw.circle(surface, x + 1, y, radius - n, color) * gfxdraw.circle(surface, x - 1, y, radius - n, color) # <<<<<<<<<<<<<< * n += 1 * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_v_x, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = PyNumber_Subtract(__pyx_v_radius, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_1, ((PyObject *)__pyx_v_surface), __pyx_t_9, __pyx_v_y, __pyx_t_3, __pyx_v_color}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":69 * gfxdraw.circle(surface, x + 1, y, radius - n, color) * gfxdraw.circle(surface, x - 1, y, radius - n, color) * n += 1 # <<<<<<<<<<<<<< * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) * return dirty.clip(surface.get_rect()) */ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/draw.pyx":70 * gfxdraw.circle(surface, x - 1, y, radius - n, color) * n += 1 * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = PyNumber_Subtract(__pyx_v_x, __pyx_v_radius); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyNumber_Subtract(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Subtract(__pyx_v_y, __pyx_v_radius); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_radius, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_radius, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = PyNumber_Add(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_t_9, __pyx_t_1, __pyx_t_7, __pyx_t_10}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_v_dirty = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":71 * n += 1 * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def ellipse(Surface surface, color, rect, width=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_10}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.draw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":73 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * x, y, rx, ry = rect * if width == 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_7ellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_6ellipse, "ellipse(Surface surface, color, rect, width=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_7ellipse = {"ellipse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_7ellipse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_6ellipse}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_7ellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ellipse (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_width,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, 1); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, 2); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ellipse") < 0)) __PYX_ERR(0, 73, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_rect = values[2]; __pyx_v_width = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 73, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_6ellipse(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_rect, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_6ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_rx = NULL; PyObject *__pyx_v_ry = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; unsigned int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ellipse", 1); /* "pygame_sdl2/draw.pyx":74 * * def ellipse(Surface surface, color, rect, width=0): * x, y, rx, ry = rect # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_ellipse(surface, x, y, rx, ry, color) */ if ((likely(PyTuple_CheckExact(__pyx_v_rect))) || (PyList_CheckExact(__pyx_v_rect))) { PyObject* sequence = __pyx_v_rect; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 74, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_4 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4}; __pyx_t_5 = PyObject_GetIter(__pyx_v_rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_6(__pyx_t_5); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 4) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 74, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_rx = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_ry = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":75 * def ellipse(Surface surface, color, rect, width=0): * x, y, rx, ry = rect * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_ellipse(surface, x, y, rx, ry, color) * dirty = Rect((x - rx, y - ry), (rx*2, ry*2)) */ __pyx_t_7 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_width, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 75, __pyx_L1_error) if (__pyx_t_7) { /* "pygame_sdl2/draw.pyx":76 * x, y, rx, ry = rect * if width == 0: * gfxdraw.filled_ellipse(surface, x, y, rx, ry, color) # <<<<<<<<<<<<<< * dirty = Rect((x - rx, y - ry), (rx*2, ry*2)) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filled_ellipse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 6+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":77 * if width == 0: * gfxdraw.filled_ellipse(surface, x, y, rx, ry, color) * dirty = Rect((x - rx, y - ry), (rx*2, ry*2)) # <<<<<<<<<<<<<< * else: * gfxdraw.ellipse(surface, x, y, rx, ry, color) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_x, __pyx_v_rx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_v_y, __pyx_v_ry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_v_rx, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ry, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_5, __pyx_t_9}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_dirty = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":75 * def ellipse(Surface surface, color, rect, width=0): * x, y, rx, ry = rect * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_ellipse(surface, x, y, rx, ry, color) * dirty = Rect((x - rx, y - ry), (rx*2, ry*2)) */ goto __pyx_L5; } /* "pygame_sdl2/draw.pyx":79 * dirty = Rect((x - rx, y - ry), (rx*2, ry*2)) * else: * gfxdraw.ellipse(surface, x, y, rx, ry, color) # <<<<<<<<<<<<<< * n = 1 * while n < width: */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ellipse); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_2, ((PyObject *)__pyx_v_surface), __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_8, 6+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":80 * else: * gfxdraw.ellipse(surface, x, y, rx, ry, color) * n = 1 # <<<<<<<<<<<<<< * while n < width: * gfxdraw.ellipse(surface, x, y, rx - n, ry - n, color) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":81 * gfxdraw.ellipse(surface, x, y, rx, ry, color) * n = 1 * while n < width: # <<<<<<<<<<<<<< * gfxdraw.ellipse(surface, x, y, rx - n, ry - n, color) * gfxdraw.ellipse(surface, x + 1, y, rx - n, ry - n, color) */ while (1) { __pyx_t_4 = PyObject_RichCompare(__pyx_v_n, __pyx_v_width, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error) __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_7) break; /* "pygame_sdl2/draw.pyx":82 * n = 1 * while n < width: * gfxdraw.ellipse(surface, x, y, rx - n, ry - n, color) # <<<<<<<<<<<<<< * gfxdraw.ellipse(surface, x + 1, y, rx - n, ry - n, color) * gfxdraw.ellipse(surface, x - 1, y, rx - n, ry - n, color) */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ellipse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyNumber_Subtract(__pyx_v_rx, __pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = PyNumber_Subtract(__pyx_v_ry, __pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_x, __pyx_v_y, __pyx_t_9, __pyx_t_5, __pyx_v_color}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 6+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":83 * while n < width: * gfxdraw.ellipse(surface, x, y, rx - n, ry - n, color) * gfxdraw.ellipse(surface, x + 1, y, rx - n, ry - n, color) # <<<<<<<<<<<<<< * gfxdraw.ellipse(surface, x - 1, y, rx - n, ry - n, color) * n += 1 */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ellipse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_x, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = PyNumber_Subtract(__pyx_v_rx, __pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = PyNumber_Subtract(__pyx_v_ry, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_1, ((PyObject *)__pyx_v_surface), __pyx_t_2, __pyx_v_y, __pyx_t_9, __pyx_t_3, __pyx_v_color}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 6+__pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":84 * gfxdraw.ellipse(surface, x, y, rx - n, ry - n, color) * gfxdraw.ellipse(surface, x + 1, y, rx - n, ry - n, color) * gfxdraw.ellipse(surface, x - 1, y, rx - n, ry - n, color) # <<<<<<<<<<<<<< * n += 1 * dirty = Rect(x - rx - width, y - ry - width, (rx*2) + width, (ry*2) + width) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ellipse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_x, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = PyNumber_Subtract(__pyx_v_rx, __pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = PyNumber_Subtract(__pyx_v_ry, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_1, ((PyObject *)__pyx_v_surface), __pyx_t_5, __pyx_v_y, __pyx_t_9, __pyx_t_2, __pyx_v_color}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 6+__pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":85 * gfxdraw.ellipse(surface, x + 1, y, rx - n, ry - n, color) * gfxdraw.ellipse(surface, x - 1, y, rx - n, ry - n, color) * n += 1 # <<<<<<<<<<<<<< * dirty = Rect(x - rx - width, y - ry - width, (rx*2) + width, (ry*2) + width) * return dirty.clip(surface.get_rect()) */ __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_4); __pyx_t_4 = 0; } /* "pygame_sdl2/draw.pyx":86 * gfxdraw.ellipse(surface, x - 1, y, rx - n, ry - n, color) * n += 1 * dirty = Rect(x - rx - width, y - ry - width, (rx*2) + width, (ry*2) + width) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Subtract(__pyx_v_x, __pyx_v_rx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = PyNumber_Subtract(__pyx_t_2, __pyx_v_width); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Subtract(__pyx_v_y, __pyx_v_ry); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_v_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_v_rx, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_v_ry, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_v_width); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_t_9, __pyx_t_5, __pyx_t_1, __pyx_t_10}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_dirty = __pyx_t_4; __pyx_t_4 = 0; } __pyx_L5:; /* "pygame_sdl2/draw.pyx":87 * n += 1 * dirty = Rect(x - rx - width, y - ry - width, (rx*2) + width, (ry*2) + width) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_10}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":73 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * x, y, rx, ry = rect * if width == 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.draw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_rx); __Pyx_XDECREF(__pyx_v_ry); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":89 * return dirty.clip(surface.get_rect()) * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_9arc(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_8arc, "arc(Surface surface, color, rect, start_angle, stop_angle, width=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_9arc = {"arc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_9arc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_8arc}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_9arc(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; CYTHON_UNUSED PyObject *__pyx_v_color = 0; CYTHON_UNUSED PyObject *__pyx_v_rect = 0; CYTHON_UNUSED PyObject *__pyx_v_start_angle = 0; CYTHON_UNUSED PyObject *__pyx_v_stop_angle = 0; CYTHON_UNUSED PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("arc (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_start_angle,&__pyx_n_s_stop_angle,&__pyx_n_s_width,0}; values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 1); __PYX_ERR(0, 89, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 2); __PYX_ERR(0, 89, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start_angle)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 3); __PYX_ERR(0, 89, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stop_angle)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 4); __PYX_ERR(0, 89, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "arc") < 0)) __PYX_ERR(0, 89, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_rect = values[2]; __pyx_v_start_angle = values[3]; __pyx_v_stop_angle = values[4]; __pyx_v_width = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, __pyx_nargs); __PYX_ERR(0, 89, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 89, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_8arc(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_rect, __pyx_v_start_angle, __pyx_v_stop_angle, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_8arc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, CYTHON_UNUSED PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_start_angle, CYTHON_UNUSED PyObject *__pyx_v_stop_angle, CYTHON_UNUSED PyObject *__pyx_v_width) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arc", 1); /* "pygame_sdl2/draw.pyx":90 * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def line(Surface surface, color, start_pos, end_pos, width=1): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Not_implemented}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 90, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":89 * return dirty.clip(surface.get_rect()) * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.draw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":92 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_11line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_10line, "line(Surface surface, color, start_pos, end_pos, width=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_11line = {"line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_11line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_10line}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_11line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_start_pos = 0; PyObject *__pyx_v_end_pos = 0; PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("line (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_start_pos,&__pyx_n_s_end_pos,&__pyx_n_s_width,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 1); __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 2); __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 3); __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "line") < 0)) __PYX_ERR(0, 92, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_start_pos = values[2]; __pyx_v_end_pos = values[3]; __pyx_v_width = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 92, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 92, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_10line(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_start_pos, __pyx_v_end_pos, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_10line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_start_pos, PyObject *__pyx_v_end_pos, PyObject *__pyx_v_width) { PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("line", 1); /* "pygame_sdl2/draw.pyx":93 * * def line(Surface surface, color, start_pos, end_pos, width=1): * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], # <<<<<<<<<<<<<< * end_pos[0], end_pos[1], width, color) * dirty = Rect(start_pos, (width, width)) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_thick_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_start_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_start_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/draw.pyx":94 * def line(Surface surface, color, start_pos, end_pos, width=1): * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) # <<<<<<<<<<<<<< * dirty = Rect(start_pos, (width, width)) * dirty.union_ip(Rect(end_pos, (width, width))) */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_end_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_end_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_7, ((PyObject *)__pyx_v_surface), __pyx_t_2, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_width, __pyx_v_color}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 7+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":95 * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) * dirty = Rect(start_pos, (width, width)) # <<<<<<<<<<<<<< * dirty.union_ip(Rect(end_pos, (width, width))) * return dirty.clip(surface.get_rect()) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_width)) __PYX_ERR(0, 95, __pyx_L1_error); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_width)) __PYX_ERR(0, 95, __pyx_L1_error); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_start_pos, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":96 * end_pos[0], end_pos[1], width, color) * dirty = Rect(start_pos, (width, width)) * dirty.union_ip(Rect(end_pos, (width, width))) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_width)) __PYX_ERR(0, 96, __pyx_L1_error); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_width)) __PYX_ERR(0, 96, __pyx_L1_error); __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_end_pos, __pyx_t_4}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":97 * dirty = Rect(start_pos, (width, width)) * dirty.union_ip(Rect(end_pos, (width, width))) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def lines(Surface surface, color, closed, pointlist, width=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":92 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.draw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":99 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_13lines(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_12lines, "lines(Surface surface, color, closed, pointlist, width=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_13lines = {"lines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_13lines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_12lines}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_13lines(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_closed = 0; PyObject *__pyx_v_pointlist = 0; PyObject *__pyx_v_width = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lines (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_closed,&__pyx_n_s_pointlist,&__pyx_n_s_width,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 1); __PYX_ERR(0, 99, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_closed)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 2); __PYX_ERR(0, 99, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointlist)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 3); __PYX_ERR(0, 99, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lines") < 0)) __PYX_ERR(0, 99, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_closed = values[2]; __pyx_v_pointlist = values[3]; __pyx_v_width = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 99, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.lines", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 99, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_12lines(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_closed, __pyx_v_pointlist, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_12lines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lines", 1); /* "pygame_sdl2/draw.pyx":100 * * def lines(Surface surface, color, closed, pointlist, width=1): * n = 0 # <<<<<<<<<<<<<< * dirty = Rect(pointlist[0], (width, width)) * while n < len(pointlist) - 1: */ __Pyx_INCREF(__pyx_int_0); __pyx_v_n = __pyx_int_0; /* "pygame_sdl2/draw.pyx":101 * def lines(Surface surface, color, closed, pointlist, width=1): * n = 0 * dirty = Rect(pointlist[0], (width, width)) # <<<<<<<<<<<<<< * while n < len(pointlist) - 1: * line(surface, color, pointlist[n], pointlist[n+1], width) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_width)) __PYX_ERR(0, 101, __pyx_L1_error); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_width)) __PYX_ERR(0, 101, __pyx_L1_error); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":102 * n = 0 * dirty = Rect(pointlist[0], (width, width)) * while n < len(pointlist) - 1: # <<<<<<<<<<<<<< * line(surface, color, pointlist[n], pointlist[n+1], width) * dirty.union_ip(Rect(pointlist[n+1], (width, width))) */ while (1) { __pyx_t_7 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_7 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_8) break; /* "pygame_sdl2/draw.pyx":103 * dirty = Rect(pointlist[0], (width, width)) * while n < len(pointlist) - 1: * line(surface, color, pointlist[n], pointlist[n+1], width) # <<<<<<<<<<<<<< * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_color, __pyx_t_4, __pyx_t_5, __pyx_v_width}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":104 * while n < len(pointlist) - 1: * line(surface, color, pointlist[n], pointlist[n+1], width) * dirty.union_ip(Rect(pointlist[n+1], (width, width))) # <<<<<<<<<<<<<< * n += 1 * if closed: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_width)) __PYX_ERR(0, 104, __pyx_L1_error); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_width)) __PYX_ERR(0, 104, __pyx_L1_error); __pyx_t_10 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_9, __pyx_t_3}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":105 * line(surface, color, pointlist[n], pointlist[n+1], width) * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 # <<<<<<<<<<<<<< * if closed: * line(surface, color, pointlist[n], pointlist[0], width) */ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/draw.pyx":106 * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 * if closed: # <<<<<<<<<<<<<< * line(surface, color, pointlist[n], pointlist[0], width) * return dirty.clip(surface.get_rect()) */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_closed); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 106, __pyx_L1_error) if (__pyx_t_8) { /* "pygame_sdl2/draw.pyx":107 * n += 1 * if closed: * line(surface, color, pointlist[n], pointlist[0], width) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, ((PyObject *)__pyx_v_surface), __pyx_v_color, __pyx_t_5, __pyx_t_4, __pyx_v_width}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":106 * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 * if closed: # <<<<<<<<<<<<<< * line(surface, color, pointlist[n], pointlist[0], width) * return dirty.clip(surface.get_rect()) */ } /* "pygame_sdl2/draw.pyx":108 * if closed: * line(surface, color, pointlist[n], pointlist[0], width) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def aaline(Surface surface, color, startpos, endpos, blend=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":99 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.draw.lines", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":110 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_15aaline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_14aaline, "aaline(Surface surface, color, startpos, endpos, blend=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_15aaline = {"aaline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_15aaline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_14aaline}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_15aaline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_startpos = 0; PyObject *__pyx_v_endpos = 0; CYTHON_UNUSED PyObject *__pyx_v_blend = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aaline (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_startpos,&__pyx_n_s_endpos,&__pyx_n_s_blend,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 1); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_startpos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 2); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_endpos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 3); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blend); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aaline") < 0)) __PYX_ERR(0, 110, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_startpos = values[2]; __pyx_v_endpos = values[3]; __pyx_v_blend = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 110, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 110, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_14aaline(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_startpos, __pyx_v_endpos, __pyx_v_blend); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_14aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_startpos, PyObject *__pyx_v_endpos, CYTHON_UNUSED PyObject *__pyx_v_blend) { PyObject *__pyx_v_x1 = NULL; PyObject *__pyx_v_y1 = NULL; PyObject *__pyx_v_x2 = NULL; PyObject *__pyx_v_y2 = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aaline", 1); /* "pygame_sdl2/draw.pyx":111 * * def aaline(Surface surface, color, startpos, endpos, blend=1): * x1, y1 = startpos # <<<<<<<<<<<<<< * x2, y2 = endpos * gfxdraw.aaline(surface, x1, y1, x2, y2, color) */ if ((likely(PyTuple_CheckExact(__pyx_v_startpos))) || (PyList_CheckExact(__pyx_v_startpos))) { PyObject* sequence = __pyx_v_startpos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 111, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_startpos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 111, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x1 = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y1 = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":112 * def aaline(Surface surface, color, startpos, endpos, blend=1): * x1, y1 = startpos * x2, y2 = endpos # <<<<<<<<<<<<<< * gfxdraw.aaline(surface, x1, y1, x2, y2, color) * dirty = Rect(x1, y1, x2 - x1, y2 - y1) */ if ((likely(PyTuple_CheckExact(__pyx_v_endpos))) || (PyList_CheckExact(__pyx_v_endpos))) { PyObject* sequence = __pyx_v_endpos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 112, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_endpos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 112, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_x2 = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y2 = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":113 * x1, y1 = startpos * x2, y2 = endpos * gfxdraw.aaline(surface, x1, y1, x2, y2, color) # <<<<<<<<<<<<<< * dirty = Rect(x1, y1, x2 - x1, y2 - y1) * return dirty.clip(surface.get_rect()) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_aaline); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_2, ((PyObject *)__pyx_v_surface), __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_color}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":114 * x2, y2 = endpos * gfxdraw.aaline(surface, x1, y1, x2, y2, color) * dirty = Rect(x1, y1, x2 - x1, y2 - y1) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Subtract(__pyx_v_x2, __pyx_v_x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyNumber_Subtract(__pyx_v_y2, __pyx_v_y1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_x1, __pyx_v_y1, __pyx_t_2, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":115 * gfxdraw.aaline(surface, x1, y1, x2, y2, color) * dirty = Rect(x1, y1, x2 - x1, y2 - y1) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def aalines(Surface surface, color, closed, pointlist, blend=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":110 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.draw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x1); __Pyx_XDECREF(__pyx_v_y1); __Pyx_XDECREF(__pyx_v_x2); __Pyx_XDECREF(__pyx_v_y2); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":117 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_17aalines(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4draw_16aalines, "aalines(Surface surface, color, closed, pointlist, blend=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_17aalines = {"aalines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4draw_17aalines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4draw_16aalines}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_17aalines(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_closed = 0; PyObject *__pyx_v_pointlist = 0; CYTHON_UNUSED PyObject *__pyx_v_blend = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aalines (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_closed,&__pyx_n_s_pointlist,&__pyx_n_s_blend,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 1); __PYX_ERR(0, 117, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_closed)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 2); __PYX_ERR(0, 117, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pointlist)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 3); __PYX_ERR(0, 117, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blend); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aalines") < 0)) __PYX_ERR(0, 117, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_closed = values[2]; __pyx_v_pointlist = values[3]; __pyx_v_blend = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 117, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.draw.aalines", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 117, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_4draw_16aalines(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_closed, __pyx_v_pointlist, __pyx_v_blend); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_16aalines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, CYTHON_UNUSED PyObject *__pyx_v_blend) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aalines", 1); /* "pygame_sdl2/draw.pyx":118 * * def aalines(Surface surface, color, closed, pointlist, blend=1): * n = 0 # <<<<<<<<<<<<<< * dirty = Rect(pointlist[0], (1,1)) * while n < len(pointlist) - 1: */ __Pyx_INCREF(__pyx_int_0); __pyx_v_n = __pyx_int_0; /* "pygame_sdl2/draw.pyx":119 * def aalines(Surface surface, color, closed, pointlist, blend=1): * n = 0 * dirty = Rect(pointlist[0], (1,1)) # <<<<<<<<<<<<<< * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_tuple_}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":120 * n = 0 * dirty = Rect(pointlist[0], (1,1)) * while n < len(pointlist) - 1: # <<<<<<<<<<<<<< * r = aaline(surface, color, pointlist[n], pointlist[n+1]) * dirty.union_ip(r) */ while (1) { __pyx_t_6 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_7) break; /* "pygame_sdl2/draw.pyx":121 * dirty = Rect(pointlist[0], (1,1)) * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) # <<<<<<<<<<<<<< * dirty.union_ip(r) * n += 1 */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_aaline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, ((PyObject *)__pyx_v_surface), __pyx_v_color, __pyx_t_3, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":122 * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) * dirty.union_ip(r) # <<<<<<<<<<<<<< * n += 1 * if closed: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_r}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":123 * r = aaline(surface, color, pointlist[n], pointlist[n+1]) * dirty.union_ip(r) * n += 1 # <<<<<<<<<<<<<< * if closed: * aaline(surface, color, pointlist[n], pointlist[0]) */ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/draw.pyx":124 * dirty.union_ip(r) * n += 1 * if closed: # <<<<<<<<<<<<<< * aaline(surface, color, pointlist[n], pointlist[0]) * return dirty.clip(surface.get_rect()) */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_closed); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 124, __pyx_L1_error) if (__pyx_t_7) { /* "pygame_sdl2/draw.pyx":125 * n += 1 * if closed: * aaline(surface, color, pointlist[n], pointlist[0]) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_aaline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, ((PyObject *)__pyx_v_surface), __pyx_v_color, __pyx_t_8, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":124 * dirty.union_ip(r) * n += 1 * if closed: # <<<<<<<<<<<<<< * aaline(surface, color, pointlist[n], pointlist[0]) * return dirty.clip(surface.get_rect()) */ } /* "pygame_sdl2/draw.pyx":126 * if closed: * aaline(surface, color, pointlist[n], pointlist[0]) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":117 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.draw.aalines", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 0, 1, 1}, {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1}, {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, {&__pyx_n_s_aaline, __pyx_k_aaline, sizeof(__pyx_k_aaline), 0, 0, 1, 1}, {&__pyx_n_s_aalines, __pyx_k_aalines, sizeof(__pyx_k_aalines), 0, 0, 1, 1}, {&__pyx_n_s_arc, __pyx_k_arc, sizeof(__pyx_k_arc), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_blend, __pyx_k_blend, sizeof(__pyx_k_blend), 0, 0, 1, 1}, {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1}, {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_dirty, __pyx_k_dirty, sizeof(__pyx_k_dirty), 0, 0, 1, 1}, {&__pyx_n_s_ellipse, __pyx_k_ellipse, sizeof(__pyx_k_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_end_pos, __pyx_k_end_pos, sizeof(__pyx_k_end_pos), 0, 0, 1, 1}, {&__pyx_n_s_endpos, __pyx_k_endpos, sizeof(__pyx_k_endpos), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_filled_circle, __pyx_k_filled_circle, sizeof(__pyx_k_filled_circle), 0, 0, 1, 1}, {&__pyx_n_s_filled_ellipse, __pyx_k_filled_ellipse, sizeof(__pyx_k_filled_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_filled_polygon, __pyx_k_filled_polygon, sizeof(__pyx_k_filled_polygon), 0, 0, 1, 1}, {&__pyx_n_s_get_rect, __pyx_k_get_rect, sizeof(__pyx_k_get_rect), 0, 0, 1, 1}, {&__pyx_n_s_gfxdraw, __pyx_k_gfxdraw, sizeof(__pyx_k_gfxdraw), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, {&__pyx_n_s_lines, __pyx_k_lines, sizeof(__pyx_k_lines), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pointlist, __pyx_k_pointlist, sizeof(__pyx_k_pointlist), 0, 0, 1, 1}, {&__pyx_n_s_polygon, __pyx_k_polygon, sizeof(__pyx_k_polygon), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_draw, __pyx_k_pygame_sdl2_draw, sizeof(__pyx_k_pygame_sdl2_draw), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_gfxdraw, __pyx_k_pygame_sdl2_gfxdraw, sizeof(__pyx_k_pygame_sdl2_gfxdraw), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_radius, __pyx_k_radius, sizeof(__pyx_k_radius), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_rectangle, __pyx_k_rectangle, sizeof(__pyx_k_rectangle), 0, 0, 1, 1}, {&__pyx_n_s_rx, __pyx_k_rx, sizeof(__pyx_k_rx), 0, 0, 1, 1}, {&__pyx_n_s_ry, __pyx_k_ry, sizeof(__pyx_k_ry), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_k_src_pygame_sdl2_draw_pyx, sizeof(__pyx_k_src_pygame_sdl2_draw_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start_angle, __pyx_k_start_angle, sizeof(__pyx_k_start_angle), 0, 0, 1, 1}, {&__pyx_n_s_start_pos, __pyx_k_start_pos, sizeof(__pyx_k_start_pos), 0, 0, 1, 1}, {&__pyx_n_s_startpos, __pyx_k_startpos, sizeof(__pyx_k_startpos), 0, 0, 1, 1}, {&__pyx_n_s_stop_angle, __pyx_k_stop_angle, sizeof(__pyx_k_stop_angle), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_thick_line, __pyx_k_thick_line, sizeof(__pyx_k_thick_line), 0, 0, 1, 1}, {&__pyx_n_s_union_ip, __pyx_k_union_ip, sizeof(__pyx_k_union_ip), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { return 0; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/draw.pyx":47 * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) # <<<<<<<<<<<<<< * n = 1 * while n < len(pointlist): */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/draw.pyx":22 * from pygame_sdl2.surface cimport Surface * * import pygame_sdl2.gfxdraw as gfxdraw # <<<<<<<<<<<<<< * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error */ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_pygame_sdl2, __pyx_n_s_gfxdraw); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_tuple__5 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_width, __pyx_n_s_n, __pyx_n_s_r, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_rect, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 26, __pyx_L1_error) __pyx_tuple__7 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ __pyx_tuple__8 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_pointlist, __pyx_n_s_width, __pyx_n_s_dirty, __pyx_n_s_n); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_polygon, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 44, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ __pyx_tuple__10 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_pos, __pyx_n_s_radius, __pyx_n_s_width, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_dirty, __pyx_n_s_n); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_circle, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 56, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":73 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * x, y, rx, ry = rect * if width == 0: */ __pyx_tuple__12 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_width, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_dirty, __pyx_n_s_n); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_ellipse, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 73, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":89 * return dirty.clip(surface.get_rect()) * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_tuple__14 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_start_angle, __pyx_n_s_stop_angle, __pyx_n_s_width); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_arc, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 89, __pyx_L1_error) __pyx_tuple__16 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "pygame_sdl2/draw.pyx":92 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ __pyx_tuple__17 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_start_pos, __pyx_n_s_end_pos, __pyx_n_s_width, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_line, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 92, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":99 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ __pyx_tuple__19 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_closed, __pyx_n_s_pointlist, __pyx_n_s_width, __pyx_n_s_n, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_lines, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 99, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":110 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ __pyx_tuple__21 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_startpos, __pyx_n_s_endpos, __pyx_n_s_blend, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_aaline, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 110, __pyx_L1_error) /* "pygame_sdl2/draw.pyx":117 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ __pyx_tuple__23 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_closed, __pyx_n_s_pointlist, __pyx_n_s_blend, __pyx_n_s_n, __pyx_n_s_dirty, __pyx_n_s_r); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_aalines, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(1, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_draw(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_draw}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "draw", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initdraw(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initdraw(void) #else __Pyx_PyMODINIT_FUNC PyInit_draw(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_draw(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_draw(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'draw' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("draw", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "draw" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_draw(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__draw) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.draw")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.draw", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/draw.pyx":22 * from pygame_sdl2.surface cimport Surface * * import pygame_sdl2.gfxdraw as gfxdraw # <<<<<<<<<<<<<< * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2_gfxdraw, __pyx_tuple__2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gfxdraw, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":23 * * import pygame_sdl2.gfxdraw as gfxdraw * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Rect)) __PYX_ERR(0, 23, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/draw.pyx":24 * import pygame_sdl2.gfxdraw as gfxdraw * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * def rect(Surface surface, color, rect, width=0): */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error)) __PYX_ERR(0, 24, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_1rect, 0, __pyx_n_s_rect, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rect, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_3polygon, 0, __pyx_n_s_polygon, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_polygon, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_5circle, 0, __pyx_n_s_circle, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_circle, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":73 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * x, y, rx, ry = rect * if width == 0: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_7ellipse, 0, __pyx_n_s_ellipse, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ellipse, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":89 * return dirty.clip(surface.get_rect()) * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_9arc, 0, __pyx_n_s_arc, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_arc, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":92 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_11line, 0, __pyx_n_s_line, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_line, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":99 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_13lines, 0, __pyx_n_s_lines, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_lines, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":110 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_15aaline, 0, __pyx_n_s_aaline, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaline, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":117 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4draw_17aalines, 0, __pyx_n_s_aalines, NULL, __pyx_n_s_pygame_sdl2_draw, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aalines, __pyx_t_2) < 0) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.draw", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.draw"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 1; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a == b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) == 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 0; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 0; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal == 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a == (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_EQ)); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); #ifdef HAVE_LONG_LONG if (sizeof(PY_LONG_LONG) > sizeof(long)) { PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; return (result >= LONG_MIN && result <= LONG_MAX) ? PyInt_FromLong((long)result) : PyLong_FromLongLong(result); } #endif #if CYTHON_USE_TYPE_SLOTS return PyInt_Type.tp_as_number->nb_multiply(op1, op2); #else return PyNumber_Multiply(op1, op2); #endif } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } } CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); #ifdef HAVE_LONG_LONG lla = a; goto long_long; #else return PyLong_Type.tp_as_number->nb_multiply(op1, op2); #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla * llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("multiply", return NULL) result = ((double)a) * (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + (unsigned long)b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a - (unsigned long)b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return PyLong_FromLong(-intval); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla - llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_12 #define __PYX_HAVE_RT_ImportType_3_0_12 static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__3; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__4); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__25); } return name; } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635907.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.error.c0000664000175000017500000106020015026112603020215 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__error #define __PYX_HAVE_API__pygame_sdl2__error /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/error.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.error" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.error" extern int __pyx_module_is_main_pygame_sdl2__error; int __pyx_module_is_main_pygame_sdl2__error = 0; /* Implementation of "pygame_sdl2.error" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_RuntimeError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = ""; static const char __pyx_k__10[] = "?"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_message[] = "message"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_get_error[] = "get_error"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_set_error[] = "set_error"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_error___init[] = "error.__init__"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_src_pygame_sdl2_error_pyx[] = "src/pygame_sdl2/error.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5error_5error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5error_get_error(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5error_2set_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_message); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_s_; PyObject *__pyx_n_s_RuntimeError; PyObject *__pyx_n_s__10; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_decode; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_error___init; PyObject *__pyx_n_s_get_error; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_message; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_error; PyObject *__pyx_n_s_set_name; PyObject *__pyx_kp_s_src_pygame_sdl2_error_pyx; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_test; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__7; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__9; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_kp_s_); Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError); Py_CLEAR(clear_module_state->__pyx_n_s__10); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_decode); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_error___init); Py_CLEAR(clear_module_state->__pyx_n_s_get_error); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_message); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_error); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_error_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__9); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_kp_s_); Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError); Py_VISIT(traverse_module_state->__pyx_n_s__10); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_decode); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_error___init); Py_VISIT(traverse_module_state->__pyx_n_s_get_error); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_message); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_error); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_error_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__9); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_s_ __pyx_mstate_global->__pyx_kp_s_ #define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError #define __pyx_n_s__10 __pyx_mstate_global->__pyx_n_s__10 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_error___init __pyx_mstate_global->__pyx_n_s_error___init #define __pyx_n_s_get_error __pyx_mstate_global->__pyx_n_s_get_error #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_message __pyx_mstate_global->__pyx_n_s_message #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_error __pyx_mstate_global->__pyx_n_s_set_error #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_kp_s_src_pygame_sdl2_error_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_error_pyx #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 /* #### Code section: module_code ### */ /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = bytes(SDL_GetError()) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5error_5error_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5error_5error___init__, "error.__init__(self, message=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5error_5error_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5error_5error_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5error_5error___init__}; static PyObject *__pyx_pw_11pygame_sdl2_5error_5error_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_message = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_message); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 23, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_message = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 23, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.error.error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5error_5error___init__(__pyx_self, __pyx_v_self, __pyx_v_message); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5error_5error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_message); /* "pygame_sdl2/error.pyx":24 * * def __init__(self, message=None): * if message is None: # <<<<<<<<<<<<<< * message = bytes(SDL_GetError()) * message = message.decode("utf-8") */ __pyx_t_1 = (__pyx_v_message == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/error.pyx":25 * def __init__(self, message=None): * if message is None: * message = bytes(SDL_GetError()) # <<<<<<<<<<<<<< * message = message.decode("utf-8") * */ __pyx_t_2 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/error.pyx":26 * if message is None: * message = bytes(SDL_GetError()) * message = message.decode("utf-8") # <<<<<<<<<<<<<< * * RuntimeError.__init__(self, message) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_utf_8}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/error.pyx":24 * * def __init__(self, message=None): * if message is None: # <<<<<<<<<<<<<< * message = bytes(SDL_GetError()) * message = message.decode("utf-8") */ } /* "pygame_sdl2/error.pyx":28 * message = message.decode("utf-8") * * RuntimeError.__init__(self, message) # <<<<<<<<<<<<<< * * def get_error(): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_RuntimeError, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_self, __pyx_v_message}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = bytes(SDL_GetError()) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.error.error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/error.pyx":30 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5error_1get_error(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5error_get_error, "get_error()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5error_1get_error = {"get_error", (PyCFunction)__pyx_pw_11pygame_sdl2_5error_1get_error, METH_NOARGS, __pyx_doc_11pygame_sdl2_5error_get_error}; static PyObject *__pyx_pw_11pygame_sdl2_5error_1get_error(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_error (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5error_get_error(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5error_get_error(CYTHON_UNUSED PyObject *__pyx_self) { char const *__pyx_v_message; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_error", 1); /* "pygame_sdl2/error.pyx":31 * * def get_error(): * cdef const char *message = SDL_GetError() # <<<<<<<<<<<<<< * * if message: */ __pyx_v_message = SDL_GetError(); /* "pygame_sdl2/error.pyx":33 * cdef const char *message = SDL_GetError() * * if message: # <<<<<<<<<<<<<< * return message.decode("utf-8") * else: */ __pyx_t_1 = (__pyx_v_message != 0); if (__pyx_t_1) { /* "pygame_sdl2/error.pyx":34 * * if message: * return message.decode("utf-8") # <<<<<<<<<<<<<< * else: * return '' */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_2, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/error.pyx":33 * cdef const char *message = SDL_GetError() * * if message: # <<<<<<<<<<<<<< * return message.decode("utf-8") * else: */ } /* "pygame_sdl2/error.pyx":36 * return message.decode("utf-8") * else: * return '' # <<<<<<<<<<<<<< * * def set_error(message): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_s_); __pyx_r = __pyx_kp_s_; goto __pyx_L0; } /* "pygame_sdl2/error.pyx":30 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.error.get_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/error.pyx":38 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * if isinstance(message, unicode): * message = message.encode("utf-8") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5error_3set_error(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5error_2set_error, "set_error(message)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5error_3set_error = {"set_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5error_3set_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5error_2set_error}; static PyObject *__pyx_pw_11pygame_sdl2_5error_3set_error(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_message = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_error (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_message,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_message)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_error") < 0)) __PYX_ERR(0, 38, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_message = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_error", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 38, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.error.set_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5error_2set_error(__pyx_self, __pyx_v_message); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5error_2set_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_message) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; char *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_error", 0); __Pyx_INCREF(__pyx_v_message); /* "pygame_sdl2/error.pyx":39 * * def set_error(message): * if isinstance(message, unicode): # <<<<<<<<<<<<<< * message = message.encode("utf-8") * */ __pyx_t_1 = PyUnicode_Check(__pyx_v_message); if (__pyx_t_1) { /* "pygame_sdl2/error.pyx":40 * def set_error(message): * if isinstance(message, unicode): * message = message.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetError("%s", message) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_utf_8}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/error.pyx":39 * * def set_error(message): * if isinstance(message, unicode): # <<<<<<<<<<<<<< * message = message.encode("utf-8") * */ } /* "pygame_sdl2/error.pyx":42 * message = message.encode("utf-8") * * SDL_SetError("%s", message) # <<<<<<<<<<<<<< */ __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_message); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L1_error) (void)(SDL_SetError(((char const *)"%s"), ((char *)__pyx_t_6))); /* "pygame_sdl2/error.pyx":38 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * if isinstance(message, unicode): * message = message.encode("utf-8") */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.error.set_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_error___init, __pyx_k_error___init, sizeof(__pyx_k_error___init), 0, 0, 1, 1}, {&__pyx_n_s_get_error, __pyx_k_get_error, sizeof(__pyx_k_get_error), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_error, __pyx_k_set_error, sizeof(__pyx_k_set_error), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_k_src_pygame_sdl2_error_pyx, sizeof(__pyx_k_src_pygame_sdl2_error_pyx), 0, 0, 1, 0}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 21, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/error.pyx":21 * from sdl2 cimport * * * class error(RuntimeError): # <<<<<<<<<<<<<< * * def __init__(self, message=None): */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); __pyx_tuple__3 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = bytes(SDL_GetError()) */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_n_s_init, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 23, __pyx_L1_error) __pyx_tuple__6 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/error.pyx":30 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_message); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_n_s_get_error, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 30, __pyx_L1_error) /* "pygame_sdl2/error.pyx":38 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * if isinstance(message, unicode): * message = message.encode("utf-8") */ __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_n_s_set_error, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_error(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_error}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "error", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initerror(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initerror(void) #else __Pyx_PyMODINIT_FUNC PyInit_error(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_error(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_error(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'error' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("error", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "error" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_error(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__error) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.error")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.error", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/error.pyx":21 * from sdl2 cimport * * * class error(RuntimeError): # <<<<<<<<<<<<<< * * def __init__(self, message=None): */ __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_tuple__3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_error, __pyx_n_s_error, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_error, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_2 != __pyx_tuple__3) { if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_tuple__3) < 0))) __PYX_ERR(0, 21, __pyx_L1_error) } /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = bytes(SDL_GetError()) */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5error_5error_1__init__, 0, __pyx_n_s_error___init, NULL, __pyx_n_s_pygame_sdl2_error, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__6); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/error.pyx":21 * from sdl2 cimport * * * class error(RuntimeError): # <<<<<<<<<<<<<< * * def __init__(self, message=None): */ __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_error, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_5) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/error.pyx":30 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5error_1get_error, 0, __pyx_n_s_get_error, NULL, __pyx_n_s_pygame_sdl2_error, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_error, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/error.pyx":38 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * if isinstance(message, unicode): * message = message.encode("utf-8") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5error_3set_error, 0, __pyx_n_s_set_error, NULL, __pyx_n_s_pygame_sdl2_error, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_error, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/error.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.error", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.error"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__10); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752385208.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.event.c0000664000175000017500000344026515034643270020234 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__event #define __PYX_HAVE_API__pygame_sdl2__event /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/event.pyx", "type.pxd", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", "include/event_names.pxi", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /* PyIntCompare.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* RaiseUnboundLocalError.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); /* pop_index.proto */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #else #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix)) #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ (likely(is_tuple || PyTuple_Check(tuple)) ?\ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* SetItemInt.proto */ #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 #define __PYX_HAVE_RT_ImportType_proto_3_0_12 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_12 { __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Scancode(SDL_Scancode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_bool __Pyx_PyInt_As_SDL_bool(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* VoidPtrImport.proto */ static int __Pyx_ImportVoidPtr_3_0_12(PyObject *module, const char *name, void **p, const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.type" */ /* Module declarations from "cpython" */ /* Module declarations from "cpython.object" */ /* Module declarations from "cpython.ref" */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.display" */ static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from "pygame_sdl2.event" */ static unsigned int __pyx_v_11pygame_sdl2_5event_POSTEDEVENT; static int __pyx_v_11pygame_sdl2_5event_mousewheel_buttons; static unsigned int __pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID; __PYX_EXTERN_C DL_EXPORT(PyObject) *event_queue; static PyObject *__pyx_f_11pygame_sdl2_5event_get_textinput(void); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_keyboard_event(SDL_KeyboardEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousemotion_event(SDL_MouseMotionEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousebtn_event(SDL_MouseButtonEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousewheel_event(SDL_MouseWheelEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyaxis_event(SDL_JoyAxisEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyball_event(SDL_JoyBallEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyhat_event(SDL_JoyHatEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joybtn_event(SDL_JoyButtonEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textinput_event(SDL_TextInputEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textediting_event(SDL_TextEditingEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_drop_event(SDL_DropEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_window_event(SDL_WindowEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_event(SDL_Event *); /*proto*/ static int __pyx_f_11pygame_sdl2_5event_has_event(PyObject *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_get_events(PyObject *); /*proto*/ static int __pyx_f_11pygame_sdl2_5event_poll_sdl(void); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.event" extern int __pyx_module_is_main_pygame_sdl2__event; int __pyx_module_is_main_pygame_sdl2__event = 0; /* Implementation of "pygame_sdl2.event" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_chr; static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_UnicodeDecodeError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = ", "; static const char __pyx_k_e[] = "e"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_k[] = "k"; static const char __pyx_k_t[] = "t"; static const char __pyx_k_v[] = "v"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__2[] = ""; static const char __pyx_k__5[] = "*"; static const char __pyx_k_dx[] = "dx"; static const char __pyx_k_dy[] = "dy"; static const char __pyx_k_eq[] = "__eq__"; static const char __pyx_k_et[] = "et"; static const char __pyx_k_ne[] = "__ne__"; static const char __pyx_k_on[] = "on"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__49[] = "?"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_evt[] = "evt"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_hat[] = "hat"; static const char __pyx_k_joy[] = "joy"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_mod[] = "mod"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_rel[] = "rel"; static const char __pyx_k_s_r[] = "%s=%r"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_QUIT[] = "QUIT"; static const char __pyx_k_axis[] = "axis"; static const char __pyx_k_ball[] = "ball"; static const char __pyx_k_code[] = "code"; static const char __pyx_k_dict[] = "dict"; static const char __pyx_k_exit[] = "__exit__"; static const char __pyx_k_file[] = "file"; static const char __pyx_k_flag[] = "flag"; static const char __pyx_k_gain[] = "gain"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_lock[] = "lock"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_peek[] = "peek"; static const char __pyx_k_poll[] = "poll"; static const char __pyx_k_post[] = "post"; static const char __pyx_k_pump[] = "pump"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_rest[] = "rest"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_text[] = "text"; static const char __pyx_k_type[] = "type"; static const char __pyx_k_wait[] = "wait"; static const char __pyx_k_Event[] = "Event"; static const char __pyx_k_KEYUP[] = "KEYUP"; static const char __pyx_k_RLock[] = "RLock"; static const char __pyx_k_clear[] = "clear"; static const char __pyx_k_dDist[] = "dDist"; static const char __pyx_k_data1[] = "data1"; static const char __pyx_k_data2[] = "data2"; static const char __pyx_k_ename[] = "ename"; static const char __pyx_k_enter[] = "__enter__"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_event[] = "event"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_other[] = "other"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_touch[] = "touch"; static const char __pyx_k_types[] = "_types"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_which[] = "which"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_button[] = "button"; static const char __pyx_k_dTheta[] = "dTheta"; static const char __pyx_k_dict_2[] = "__dict__"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_init_2[] = "init"; static const char __pyx_k_insert[] = "insert"; static const char __pyx_k_kwargs[] = "kwargs"; static const char __pyx_k_length[] = "length"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_repeat[] = "repeat"; static const char __pyx_k_result[] = "result"; static const char __pyx_k_type_2[] = "_type"; static const char __pyx_k_unichr[] = "unichr"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_KEYDOWN[] = "KEYDOWN"; static const char __pyx_k_NOEVENT[] = "NOEVENT"; static const char __pyx_k_UNKNOWN[] = "UNKNOWN"; static const char __pyx_k_buttons[] = "buttons"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_nonzero[] = "__nonzero__"; static const char __pyx_k_pinched[] = "pinched"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_rotated[] = "rotated"; static const char __pyx_k_touchId[] = "touchId"; static const char __pyx_k_unicode[] = "unicode"; static const char __pyx_k_DROPFILE[] = "DROPFILE"; static const char __pyx_k_DROPTEXT[] = "DROPTEXT"; static const char __pyx_k_FINGERUP[] = "FINGERUP"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_fingerId[] = "fingerId"; static const char __pyx_k_get_grab[] = "get_grab"; static const char __pyx_k_pressure[] = "pressure"; static const char __pyx_k_property[] = "property"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_register[] = "register"; static const char __pyx_k_scancode[] = "scancode"; static const char __pyx_k_set_grab[] = "set_grab"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_touch_id[] = "touch_id"; static const char __pyx_k_DROPBEGIN[] = "DROPBEGIN"; static const char __pyx_k_EventType[] = "EventType"; static const char __pyx_k_LASTEVENT[] = "LASTEVENT"; static const char __pyx_k_TEXTINPUT[] = "TEXTINPUT"; static const char __pyx_k_USEREVENT[] = "USEREVENT"; static const char __pyx_k_finger_id[] = "finger_id"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_threading[] = "threading"; static const char __pyx_k_timestamp[] = "timestamp"; static const char __pyx_k_window_id[] = "window_id"; static const char __pyx_k_FINGERDOWN[] = "FINGERDOWN"; static const char __pyx_k_MOUSEWHEEL[] = "MOUSEWHEEL"; static const char __pyx_k_SYSWMEVENT[] = "SYSWMEVENT"; static const char __pyx_k_event_name[] = "event_name"; static const char __pyx_k_numFingers[] = "numFingers"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_text_input[] = "text_input"; static const char __pyx_k_ACTIVEEVENT[] = "ACTIVEEVENT"; static const char __pyx_k_Event_d_s_s[] = ""; static const char __pyx_k_JOYBUTTONUP[] = "JOYBUTTONUP"; static const char __pyx_k_MOUSEMOTION[] = "MOUSEMOTION"; static const char __pyx_k_TEXTEDITING[] = "TEXTEDITING"; static const char __pyx_k_UserEvent_d[] = "UserEvent%d"; static const char __pyx_k_VIDEOEXPOSE[] = "VIDEOEXPOSE"; static const char __pyx_k_VIDEORESIZE[] = "VIDEORESIZE"; static const char __pyx_k_WINDOWEVENT[] = "WINDOWEVENT"; static const char __pyx_k_WINDOWMOVED[] = "WINDOWMOVED"; static const char __pyx_k_event_names[] = "event_names"; static const char __pyx_k_get_blocked[] = "get_blocked"; static const char __pyx_k_instance_id[] = "instance_id"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_num_fingers[] = "num_fingers"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_set_allowed[] = "set_allowed"; static const char __pyx_k_set_blocked[] = "set_blocked"; static const char __pyx_k_DISPLAYEVENT[] = "DISPLAYEVENT"; static const char __pyx_k_DOLLARRECORD[] = "DOLLARRECORD"; static const char __pyx_k_DROPCOMPLETE[] = "DROPCOMPLETE"; static const char __pyx_k_FINGERMOTION[] = "FINGERMOTION"; static const char __pyx_k_JOYHATMOTION[] = "JOYHATMOTION"; static const char __pyx_k_MULTIGESTURE[] = "MULTIGESTURE"; static const char __pyx_k_SENSORUPDATE[] = "SENSORUPDATE"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_version_info[] = "version_info"; static const char __pyx_k_APP_LOWMEMORY[] = "APP_LOWMEMORY"; static const char __pyx_k_DOLLARGESTURE[] = "DOLLARGESTURE"; static const char __pyx_k_JOYAXISMOTION[] = "JOYAXISMOTION"; static const char __pyx_k_JOYBALLMOTION[] = "JOYBALLMOTION"; static const char __pyx_k_JOYBUTTONDOWN[] = "JOYBUTTONDOWN"; static const char __pyx_k_KEYMAPCHANGED[] = "KEYMAPCHANGED"; static const char __pyx_k_MOUSEBUTTONUP[] = "MOUSEBUTTONUP"; static const char __pyx_k_NOEVENT_EVENT[] = "NOEVENT_EVENT"; static const char __pyx_k_USEREVENT_MAX[] = "USEREVENT_MAX"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_sdl_main_init[] = "sdl_main_init"; static const char __pyx_k_EventType___eq[] = "EventType.__eq__"; static const char __pyx_k_EventType___ne[] = "EventType.__ne__"; static const char __pyx_k_EventType_dict[] = "EventType.dict"; static const char __pyx_k_EventType_type[] = "EventType.type"; static const char __pyx_k_JOYDEVICEADDED[] = "JOYDEVICEADDED"; static const char __pyx_k_APP_TERMINATING[] = "APP_TERMINATING"; static const char __pyx_k_CLIPBOARDUPDATE[] = "CLIPBOARDUPDATE"; static const char __pyx_k_Event_EventType[] = "\nEvent = EventType\n"; static const char __pyx_k_MOUSEBUTTONDOWN[] = "MOUSEBUTTONDOWN"; static const char __pyx_k_AUDIODEVICEADDED[] = "AUDIODEVICEADDED"; static const char __pyx_k_EventType___init[] = "EventType.__init__"; static const char __pyx_k_EventType___repr[] = "EventType.__repr__"; static const char __pyx_k_JOYDEVICEREMOVED[] = "JOYDEVICEREMOVED"; static const char __pyx_k_copy_event_queue[] = "copy_event_queue"; static const char __pyx_k_pygame_sdl2_event[] = "pygame_sdl2.event"; static const char __pyx_k_AUDIODEVICEREMOVED[] = "AUDIODEVICEREMOVED"; static const char __pyx_k_CONTROLLERBUTTONUP[] = "CONTROLLERBUTTONUP"; static const char __pyx_k_UnicodeDecodeError[] = "UnicodeDecodeError"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_EventType___nonzero[] = "EventType.__nonzero__"; static const char __pyx_k_RENDER_DEVICE_RESET[] = "RENDER_DEVICE_RESET"; static const char __pyx_k_get_standard_events[] = "get_standard_events"; static const char __pyx_k_CONTROLLERAXISMOTION[] = "CONTROLLERAXISMOTION"; static const char __pyx_k_CONTROLLERBUTTONDOWN[] = "CONTROLLERBUTTONDOWN"; static const char __pyx_k_RENDER_TARGETS_RESET[] = "RENDER_TARGETS_RESET"; static const char __pyx_k_CONTROLLERDEVICEADDED[] = "CONTROLLERDEVICEADDED"; static const char __pyx_k_APP_DIDENTERBACKGROUND[] = "APP_DIDENTERBACKGROUND"; static const char __pyx_k_APP_DIDENTERFOREGROUND[] = "APP_DIDENTERFOREGROUND"; static const char __pyx_k_get_mousewheel_buttons[] = "get_mousewheel_buttons"; static const char __pyx_k_set_mousewheel_buttons[] = "set_mousewheel_buttons"; static const char __pyx_k_APP_WILLENTERBACKGROUND[] = "APP_WILLENTERBACKGROUND"; static const char __pyx_k_APP_WILLENTERFOREGROUND[] = "APP_WILLENTERFOREGROUND"; static const char __pyx_k_CONTROLLERDEVICEREMOVED[] = "CONTROLLERDEVICEREMOVED"; static const char __pyx_k_CONTROLLERDEVICEREMAPPED[] = "CONTROLLERDEVICEREMAPPED"; static const char __pyx_k_src_pygame_sdl2_event_pyx[] = "src/pygame_sdl2/event.pyx"; static const char __pyx_k_event_post_must_be_called_with_a[] = "event.post must be called with an Event."; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_dict, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_4dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_6type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_12__nonzero__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_pump(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_4poll(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_6wait(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_8peek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_10clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_12get_standard_events(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_14event_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_16set_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_18set_allowed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_20get_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_22set_grab(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_24get_grab(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_26set_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_28get_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_30post(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_32register(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_34copy_event_queue(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_36init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window; #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_s_; PyObject *__pyx_n_s_ACTIVEEVENT; PyObject *__pyx_n_s_APP_DIDENTERBACKGROUND; PyObject *__pyx_n_s_APP_DIDENTERFOREGROUND; PyObject *__pyx_n_s_APP_LOWMEMORY; PyObject *__pyx_n_s_APP_TERMINATING; PyObject *__pyx_n_s_APP_WILLENTERBACKGROUND; PyObject *__pyx_n_s_APP_WILLENTERFOREGROUND; PyObject *__pyx_n_s_AUDIODEVICEADDED; PyObject *__pyx_n_s_AUDIODEVICEREMOVED; PyObject *__pyx_n_s_CLIPBOARDUPDATE; PyObject *__pyx_n_s_CONTROLLERAXISMOTION; PyObject *__pyx_n_s_CONTROLLERBUTTONDOWN; PyObject *__pyx_n_s_CONTROLLERBUTTONUP; PyObject *__pyx_n_s_CONTROLLERDEVICEADDED; PyObject *__pyx_n_s_CONTROLLERDEVICEREMAPPED; PyObject *__pyx_n_s_CONTROLLERDEVICEREMOVED; PyObject *__pyx_n_s_DISPLAYEVENT; PyObject *__pyx_n_s_DOLLARGESTURE; PyObject *__pyx_n_s_DOLLARRECORD; PyObject *__pyx_n_s_DROPBEGIN; PyObject *__pyx_n_s_DROPCOMPLETE; PyObject *__pyx_n_s_DROPFILE; PyObject *__pyx_n_s_DROPTEXT; PyObject *__pyx_n_s_Event; PyObject *__pyx_n_s_EventType; PyObject *__pyx_n_s_EventType___eq; PyObject *__pyx_n_s_EventType___init; PyObject *__pyx_n_s_EventType___ne; PyObject *__pyx_n_s_EventType___nonzero; PyObject *__pyx_n_s_EventType___repr; PyObject *__pyx_n_s_EventType_dict; PyObject *__pyx_n_s_EventType_type; PyObject *__pyx_kp_s_Event_EventType; PyObject *__pyx_kp_s_Event_d_s_s; PyObject *__pyx_n_s_FINGERDOWN; PyObject *__pyx_n_s_FINGERMOTION; PyObject *__pyx_n_s_FINGERUP; PyObject *__pyx_n_s_JOYAXISMOTION; PyObject *__pyx_n_s_JOYBALLMOTION; PyObject *__pyx_n_s_JOYBUTTONDOWN; PyObject *__pyx_n_s_JOYBUTTONUP; PyObject *__pyx_n_s_JOYDEVICEADDED; PyObject *__pyx_n_s_JOYDEVICEREMOVED; PyObject *__pyx_n_s_JOYHATMOTION; PyObject *__pyx_n_s_KEYDOWN; PyObject *__pyx_n_s_KEYMAPCHANGED; PyObject *__pyx_n_s_KEYUP; PyObject *__pyx_n_s_KeyError; PyObject *__pyx_n_s_LASTEVENT; PyObject *__pyx_n_s_MOUSEBUTTONDOWN; PyObject *__pyx_n_s_MOUSEBUTTONUP; PyObject *__pyx_n_s_MOUSEMOTION; PyObject *__pyx_n_s_MOUSEWHEEL; PyObject *__pyx_n_s_MULTIGESTURE; PyObject *__pyx_n_u_NOEVENT; PyObject *__pyx_n_s_NOEVENT_EVENT; PyObject *__pyx_n_s_QUIT; PyObject *__pyx_n_s_RENDER_DEVICE_RESET; PyObject *__pyx_n_s_RENDER_TARGETS_RESET; PyObject *__pyx_n_s_RLock; PyObject *__pyx_n_s_SENSORUPDATE; PyObject *__pyx_n_s_SYSWMEVENT; PyObject *__pyx_n_s_TEXTEDITING; PyObject *__pyx_n_s_TEXTINPUT; PyObject *__pyx_n_s_UNKNOWN; PyObject *__pyx_n_s_USEREVENT; PyObject *__pyx_n_s_USEREVENT_MAX; PyObject *__pyx_n_s_UnicodeDecodeError; PyObject *__pyx_kp_s_UserEvent_d; PyObject *__pyx_n_s_VIDEOEXPOSE; PyObject *__pyx_n_s_VIDEORESIZE; PyObject *__pyx_n_s_WINDOWEVENT; PyObject *__pyx_n_s_WINDOWMOVED; PyObject *__pyx_kp_s__2; PyObject *__pyx_kp_u__2; PyObject *__pyx_n_s__49; PyObject *__pyx_n_s__5; PyObject *__pyx_n_s_append; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_axis; PyObject *__pyx_n_s_ball; PyObject *__pyx_n_s_button; PyObject *__pyx_n_s_buttons; PyObject *__pyx_n_s_chr; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_clear; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_code; PyObject *__pyx_n_s_copy_event_queue; PyObject *__pyx_n_s_dDist; PyObject *__pyx_n_s_dTheta; PyObject *__pyx_n_s_data1; PyObject *__pyx_n_s_data2; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_dict_2; PyObject *__pyx_n_s_display; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_dx; PyObject *__pyx_n_s_dy; PyObject *__pyx_n_s_e; PyObject *__pyx_n_s_ename; PyObject *__pyx_n_s_enter; PyObject *__pyx_n_s_eq; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_et; PyObject *__pyx_n_s_event; PyObject *__pyx_n_s_event_name; PyObject *__pyx_n_s_event_names; PyObject *__pyx_kp_s_event_post_must_be_called_with_a; PyObject *__pyx_n_s_evt; PyObject *__pyx_n_s_exit; PyObject *__pyx_n_s_file; PyObject *__pyx_n_s_fingerId; PyObject *__pyx_n_s_finger_id; PyObject *__pyx_n_s_flag; PyObject *__pyx_n_s_gain; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_blocked; PyObject *__pyx_n_s_get_grab; PyObject *__pyx_n_s_get_mousewheel_buttons; PyObject *__pyx_n_s_get_standard_events; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_hat; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_2; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_insert; PyObject *__pyx_n_s_instance_id; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_items; PyObject *__pyx_n_s_join; PyObject *__pyx_n_s_joy; PyObject *__pyx_n_s_k; PyObject *__pyx_n_s_key; PyObject *__pyx_n_s_keys; PyObject *__pyx_n_s_kwargs; PyObject *__pyx_n_s_length; PyObject *__pyx_n_s_lock; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_mod; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_n_s_ne; PyObject *__pyx_n_s_nonzero; PyObject *__pyx_n_s_numFingers; PyObject *__pyx_n_s_num_fingers; PyObject *__pyx_n_s_object; PyObject *__pyx_n_s_on; PyObject *__pyx_n_s_other; PyObject *__pyx_n_s_peek; PyObject *__pyx_n_s_pinched; PyObject *__pyx_n_s_poll; PyObject *__pyx_n_s_pop; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_post; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_pressure; PyObject *__pyx_n_s_property; PyObject *__pyx_n_s_pump; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_event; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_register; PyObject *__pyx_n_s_rel; PyObject *__pyx_n_s_repeat; PyObject *__pyx_n_s_repr; PyObject *__pyx_n_s_rest; PyObject *__pyx_n_s_result; PyObject *__pyx_n_s_rotated; PyObject *__pyx_n_s_rv; PyObject *__pyx_kp_s_s_r; PyObject *__pyx_n_s_scancode; PyObject *__pyx_n_s_sdl_main_init; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_allowed; PyObject *__pyx_n_s_set_blocked; PyObject *__pyx_n_s_set_grab; PyObject *__pyx_n_s_set_mousewheel_buttons; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_event_pyx; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_sys; PyObject *__pyx_n_s_t; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_text; PyObject *__pyx_n_s_text_input; PyObject *__pyx_n_s_threading; PyObject *__pyx_n_s_timestamp; PyObject *__pyx_n_s_touch; PyObject *__pyx_n_s_touchId; PyObject *__pyx_n_s_touch_id; PyObject *__pyx_n_s_type; PyObject *__pyx_n_s_type_2; PyObject *__pyx_n_s_types; PyObject *__pyx_n_s_unichr; PyObject *__pyx_n_s_unicode; PyObject *__pyx_n_s_update; PyObject *__pyx_n_s_v; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_version_info; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_wait; PyObject *__pyx_n_s_which; PyObject *__pyx_n_s_window_id; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_y; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_2; PyObject *__pyx_int_3; PyObject *__pyx_int_4; PyObject *__pyx_slice__4; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__33; PyObject *__pyx_tuple__37; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__45; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__24; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__31; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__38; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__42; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__47; PyObject *__pyx_codeobj__48; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_CLEAR(clear_module_state->__pyx_kp_s_); Py_CLEAR(clear_module_state->__pyx_n_s_ACTIVEEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_APP_DIDENTERBACKGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_APP_DIDENTERFOREGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_APP_LOWMEMORY); Py_CLEAR(clear_module_state->__pyx_n_s_APP_TERMINATING); Py_CLEAR(clear_module_state->__pyx_n_s_APP_WILLENTERBACKGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_APP_WILLENTERFOREGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_AUDIODEVICEADDED); Py_CLEAR(clear_module_state->__pyx_n_s_AUDIODEVICEREMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_CLIPBOARDUPDATE); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERAXISMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERBUTTONDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERBUTTONUP); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERDEVICEADDED); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERDEVICEREMAPPED); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERDEVICEREMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_DISPLAYEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_DOLLARGESTURE); Py_CLEAR(clear_module_state->__pyx_n_s_DOLLARRECORD); Py_CLEAR(clear_module_state->__pyx_n_s_DROPBEGIN); Py_CLEAR(clear_module_state->__pyx_n_s_DROPCOMPLETE); Py_CLEAR(clear_module_state->__pyx_n_s_DROPFILE); Py_CLEAR(clear_module_state->__pyx_n_s_DROPTEXT); Py_CLEAR(clear_module_state->__pyx_n_s_Event); Py_CLEAR(clear_module_state->__pyx_n_s_EventType); Py_CLEAR(clear_module_state->__pyx_n_s_EventType___eq); Py_CLEAR(clear_module_state->__pyx_n_s_EventType___init); Py_CLEAR(clear_module_state->__pyx_n_s_EventType___ne); Py_CLEAR(clear_module_state->__pyx_n_s_EventType___nonzero); Py_CLEAR(clear_module_state->__pyx_n_s_EventType___repr); Py_CLEAR(clear_module_state->__pyx_n_s_EventType_dict); Py_CLEAR(clear_module_state->__pyx_n_s_EventType_type); Py_CLEAR(clear_module_state->__pyx_kp_s_Event_EventType); Py_CLEAR(clear_module_state->__pyx_kp_s_Event_d_s_s); Py_CLEAR(clear_module_state->__pyx_n_s_FINGERDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_FINGERMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_FINGERUP); Py_CLEAR(clear_module_state->__pyx_n_s_JOYAXISMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_JOYBALLMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_JOYBUTTONDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_JOYBUTTONUP); Py_CLEAR(clear_module_state->__pyx_n_s_JOYDEVICEADDED); Py_CLEAR(clear_module_state->__pyx_n_s_JOYDEVICEREMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_JOYHATMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_KEYDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_KEYMAPCHANGED); Py_CLEAR(clear_module_state->__pyx_n_s_KEYUP); Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); Py_CLEAR(clear_module_state->__pyx_n_s_LASTEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEBUTTONDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEBUTTONUP); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEWHEEL); Py_CLEAR(clear_module_state->__pyx_n_s_MULTIGESTURE); Py_CLEAR(clear_module_state->__pyx_n_u_NOEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_NOEVENT_EVENT); Py_CLEAR(clear_module_state->__pyx_n_s_QUIT); Py_CLEAR(clear_module_state->__pyx_n_s_RENDER_DEVICE_RESET); Py_CLEAR(clear_module_state->__pyx_n_s_RENDER_TARGETS_RESET); Py_CLEAR(clear_module_state->__pyx_n_s_RLock); Py_CLEAR(clear_module_state->__pyx_n_s_SENSORUPDATE); Py_CLEAR(clear_module_state->__pyx_n_s_SYSWMEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_TEXTEDITING); Py_CLEAR(clear_module_state->__pyx_n_s_TEXTINPUT); Py_CLEAR(clear_module_state->__pyx_n_s_UNKNOWN); Py_CLEAR(clear_module_state->__pyx_n_s_USEREVENT); Py_CLEAR(clear_module_state->__pyx_n_s_USEREVENT_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_UnicodeDecodeError); Py_CLEAR(clear_module_state->__pyx_kp_s_UserEvent_d); Py_CLEAR(clear_module_state->__pyx_n_s_VIDEOEXPOSE); Py_CLEAR(clear_module_state->__pyx_n_s_VIDEORESIZE); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOWEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOWMOVED); Py_CLEAR(clear_module_state->__pyx_kp_s__2); Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_n_s__49); Py_CLEAR(clear_module_state->__pyx_n_s__5); Py_CLEAR(clear_module_state->__pyx_n_s_append); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_axis); Py_CLEAR(clear_module_state->__pyx_n_s_ball); Py_CLEAR(clear_module_state->__pyx_n_s_button); Py_CLEAR(clear_module_state->__pyx_n_s_buttons); Py_CLEAR(clear_module_state->__pyx_n_s_chr); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_clear); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_code); Py_CLEAR(clear_module_state->__pyx_n_s_copy_event_queue); Py_CLEAR(clear_module_state->__pyx_n_s_dDist); Py_CLEAR(clear_module_state->__pyx_n_s_dTheta); Py_CLEAR(clear_module_state->__pyx_n_s_data1); Py_CLEAR(clear_module_state->__pyx_n_s_data2); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); Py_CLEAR(clear_module_state->__pyx_n_s_display); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_dx); Py_CLEAR(clear_module_state->__pyx_n_s_dy); Py_CLEAR(clear_module_state->__pyx_n_s_e); Py_CLEAR(clear_module_state->__pyx_n_s_ename); Py_CLEAR(clear_module_state->__pyx_n_s_enter); Py_CLEAR(clear_module_state->__pyx_n_s_eq); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_et); Py_CLEAR(clear_module_state->__pyx_n_s_event); Py_CLEAR(clear_module_state->__pyx_n_s_event_name); Py_CLEAR(clear_module_state->__pyx_n_s_event_names); Py_CLEAR(clear_module_state->__pyx_kp_s_event_post_must_be_called_with_a); Py_CLEAR(clear_module_state->__pyx_n_s_evt); Py_CLEAR(clear_module_state->__pyx_n_s_exit); Py_CLEAR(clear_module_state->__pyx_n_s_file); Py_CLEAR(clear_module_state->__pyx_n_s_fingerId); Py_CLEAR(clear_module_state->__pyx_n_s_finger_id); Py_CLEAR(clear_module_state->__pyx_n_s_flag); Py_CLEAR(clear_module_state->__pyx_n_s_gain); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_blocked); Py_CLEAR(clear_module_state->__pyx_n_s_get_grab); Py_CLEAR(clear_module_state->__pyx_n_s_get_mousewheel_buttons); Py_CLEAR(clear_module_state->__pyx_n_s_get_standard_events); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_hat); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_2); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_insert); Py_CLEAR(clear_module_state->__pyx_n_s_instance_id); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_items); Py_CLEAR(clear_module_state->__pyx_n_s_join); Py_CLEAR(clear_module_state->__pyx_n_s_joy); Py_CLEAR(clear_module_state->__pyx_n_s_k); Py_CLEAR(clear_module_state->__pyx_n_s_key); Py_CLEAR(clear_module_state->__pyx_n_s_keys); Py_CLEAR(clear_module_state->__pyx_n_s_kwargs); Py_CLEAR(clear_module_state->__pyx_n_s_length); Py_CLEAR(clear_module_state->__pyx_n_s_lock); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_mod); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_n_s_ne); Py_CLEAR(clear_module_state->__pyx_n_s_nonzero); Py_CLEAR(clear_module_state->__pyx_n_s_numFingers); Py_CLEAR(clear_module_state->__pyx_n_s_num_fingers); Py_CLEAR(clear_module_state->__pyx_n_s_object); Py_CLEAR(clear_module_state->__pyx_n_s_on); Py_CLEAR(clear_module_state->__pyx_n_s_other); Py_CLEAR(clear_module_state->__pyx_n_s_peek); Py_CLEAR(clear_module_state->__pyx_n_s_pinched); Py_CLEAR(clear_module_state->__pyx_n_s_poll); Py_CLEAR(clear_module_state->__pyx_n_s_pop); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_post); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_pressure); Py_CLEAR(clear_module_state->__pyx_n_s_property); Py_CLEAR(clear_module_state->__pyx_n_s_pump); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_event); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_register); Py_CLEAR(clear_module_state->__pyx_n_s_rel); Py_CLEAR(clear_module_state->__pyx_n_s_repeat); Py_CLEAR(clear_module_state->__pyx_n_s_repr); Py_CLEAR(clear_module_state->__pyx_n_s_rest); Py_CLEAR(clear_module_state->__pyx_n_s_result); Py_CLEAR(clear_module_state->__pyx_n_s_rotated); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_kp_s_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_scancode); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_main_init); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_allowed); Py_CLEAR(clear_module_state->__pyx_n_s_set_blocked); Py_CLEAR(clear_module_state->__pyx_n_s_set_grab); Py_CLEAR(clear_module_state->__pyx_n_s_set_mousewheel_buttons); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_event_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_sys); Py_CLEAR(clear_module_state->__pyx_n_s_t); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_text); Py_CLEAR(clear_module_state->__pyx_n_s_text_input); Py_CLEAR(clear_module_state->__pyx_n_s_threading); Py_CLEAR(clear_module_state->__pyx_n_s_timestamp); Py_CLEAR(clear_module_state->__pyx_n_s_touch); Py_CLEAR(clear_module_state->__pyx_n_s_touchId); Py_CLEAR(clear_module_state->__pyx_n_s_touch_id); Py_CLEAR(clear_module_state->__pyx_n_s_type); Py_CLEAR(clear_module_state->__pyx_n_s_type_2); Py_CLEAR(clear_module_state->__pyx_n_s_types); Py_CLEAR(clear_module_state->__pyx_n_s_unichr); Py_CLEAR(clear_module_state->__pyx_n_s_unicode); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_n_s_v); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_version_info); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_wait); Py_CLEAR(clear_module_state->__pyx_n_s_which); Py_CLEAR(clear_module_state->__pyx_n_s_window_id); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_3); Py_CLEAR(clear_module_state->__pyx_int_4); Py_CLEAR(clear_module_state->__pyx_slice__4); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__33); Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__24); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__31); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__38); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__42); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__47); Py_CLEAR(clear_module_state->__pyx_codeobj__48); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_VISIT(traverse_module_state->__pyx_kp_s_); Py_VISIT(traverse_module_state->__pyx_n_s_ACTIVEEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_APP_DIDENTERBACKGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_APP_DIDENTERFOREGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_APP_LOWMEMORY); Py_VISIT(traverse_module_state->__pyx_n_s_APP_TERMINATING); Py_VISIT(traverse_module_state->__pyx_n_s_APP_WILLENTERBACKGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_APP_WILLENTERFOREGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_AUDIODEVICEADDED); Py_VISIT(traverse_module_state->__pyx_n_s_AUDIODEVICEREMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_CLIPBOARDUPDATE); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERAXISMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERBUTTONDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERBUTTONUP); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERDEVICEADDED); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERDEVICEREMAPPED); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERDEVICEREMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_DISPLAYEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_DOLLARGESTURE); Py_VISIT(traverse_module_state->__pyx_n_s_DOLLARRECORD); Py_VISIT(traverse_module_state->__pyx_n_s_DROPBEGIN); Py_VISIT(traverse_module_state->__pyx_n_s_DROPCOMPLETE); Py_VISIT(traverse_module_state->__pyx_n_s_DROPFILE); Py_VISIT(traverse_module_state->__pyx_n_s_DROPTEXT); Py_VISIT(traverse_module_state->__pyx_n_s_Event); Py_VISIT(traverse_module_state->__pyx_n_s_EventType); Py_VISIT(traverse_module_state->__pyx_n_s_EventType___eq); Py_VISIT(traverse_module_state->__pyx_n_s_EventType___init); Py_VISIT(traverse_module_state->__pyx_n_s_EventType___ne); Py_VISIT(traverse_module_state->__pyx_n_s_EventType___nonzero); Py_VISIT(traverse_module_state->__pyx_n_s_EventType___repr); Py_VISIT(traverse_module_state->__pyx_n_s_EventType_dict); Py_VISIT(traverse_module_state->__pyx_n_s_EventType_type); Py_VISIT(traverse_module_state->__pyx_kp_s_Event_EventType); Py_VISIT(traverse_module_state->__pyx_kp_s_Event_d_s_s); Py_VISIT(traverse_module_state->__pyx_n_s_FINGERDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_FINGERMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_FINGERUP); Py_VISIT(traverse_module_state->__pyx_n_s_JOYAXISMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_JOYBALLMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_JOYBUTTONDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_JOYBUTTONUP); Py_VISIT(traverse_module_state->__pyx_n_s_JOYDEVICEADDED); Py_VISIT(traverse_module_state->__pyx_n_s_JOYDEVICEREMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_JOYHATMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_KEYDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_KEYMAPCHANGED); Py_VISIT(traverse_module_state->__pyx_n_s_KEYUP); Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); Py_VISIT(traverse_module_state->__pyx_n_s_LASTEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEBUTTONDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEBUTTONUP); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEWHEEL); Py_VISIT(traverse_module_state->__pyx_n_s_MULTIGESTURE); Py_VISIT(traverse_module_state->__pyx_n_u_NOEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_NOEVENT_EVENT); Py_VISIT(traverse_module_state->__pyx_n_s_QUIT); Py_VISIT(traverse_module_state->__pyx_n_s_RENDER_DEVICE_RESET); Py_VISIT(traverse_module_state->__pyx_n_s_RENDER_TARGETS_RESET); Py_VISIT(traverse_module_state->__pyx_n_s_RLock); Py_VISIT(traverse_module_state->__pyx_n_s_SENSORUPDATE); Py_VISIT(traverse_module_state->__pyx_n_s_SYSWMEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_TEXTEDITING); Py_VISIT(traverse_module_state->__pyx_n_s_TEXTINPUT); Py_VISIT(traverse_module_state->__pyx_n_s_UNKNOWN); Py_VISIT(traverse_module_state->__pyx_n_s_USEREVENT); Py_VISIT(traverse_module_state->__pyx_n_s_USEREVENT_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_UnicodeDecodeError); Py_VISIT(traverse_module_state->__pyx_kp_s_UserEvent_d); Py_VISIT(traverse_module_state->__pyx_n_s_VIDEOEXPOSE); Py_VISIT(traverse_module_state->__pyx_n_s_VIDEORESIZE); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOWEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOWMOVED); Py_VISIT(traverse_module_state->__pyx_kp_s__2); Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_n_s__49); Py_VISIT(traverse_module_state->__pyx_n_s__5); Py_VISIT(traverse_module_state->__pyx_n_s_append); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_axis); Py_VISIT(traverse_module_state->__pyx_n_s_ball); Py_VISIT(traverse_module_state->__pyx_n_s_button); Py_VISIT(traverse_module_state->__pyx_n_s_buttons); Py_VISIT(traverse_module_state->__pyx_n_s_chr); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_clear); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_code); Py_VISIT(traverse_module_state->__pyx_n_s_copy_event_queue); Py_VISIT(traverse_module_state->__pyx_n_s_dDist); Py_VISIT(traverse_module_state->__pyx_n_s_dTheta); Py_VISIT(traverse_module_state->__pyx_n_s_data1); Py_VISIT(traverse_module_state->__pyx_n_s_data2); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); Py_VISIT(traverse_module_state->__pyx_n_s_display); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_dx); Py_VISIT(traverse_module_state->__pyx_n_s_dy); Py_VISIT(traverse_module_state->__pyx_n_s_e); Py_VISIT(traverse_module_state->__pyx_n_s_ename); Py_VISIT(traverse_module_state->__pyx_n_s_enter); Py_VISIT(traverse_module_state->__pyx_n_s_eq); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_et); Py_VISIT(traverse_module_state->__pyx_n_s_event); Py_VISIT(traverse_module_state->__pyx_n_s_event_name); Py_VISIT(traverse_module_state->__pyx_n_s_event_names); Py_VISIT(traverse_module_state->__pyx_kp_s_event_post_must_be_called_with_a); Py_VISIT(traverse_module_state->__pyx_n_s_evt); Py_VISIT(traverse_module_state->__pyx_n_s_exit); Py_VISIT(traverse_module_state->__pyx_n_s_file); Py_VISIT(traverse_module_state->__pyx_n_s_fingerId); Py_VISIT(traverse_module_state->__pyx_n_s_finger_id); Py_VISIT(traverse_module_state->__pyx_n_s_flag); Py_VISIT(traverse_module_state->__pyx_n_s_gain); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_blocked); Py_VISIT(traverse_module_state->__pyx_n_s_get_grab); Py_VISIT(traverse_module_state->__pyx_n_s_get_mousewheel_buttons); Py_VISIT(traverse_module_state->__pyx_n_s_get_standard_events); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_hat); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_2); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_insert); Py_VISIT(traverse_module_state->__pyx_n_s_instance_id); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_items); Py_VISIT(traverse_module_state->__pyx_n_s_join); Py_VISIT(traverse_module_state->__pyx_n_s_joy); Py_VISIT(traverse_module_state->__pyx_n_s_k); Py_VISIT(traverse_module_state->__pyx_n_s_key); Py_VISIT(traverse_module_state->__pyx_n_s_keys); Py_VISIT(traverse_module_state->__pyx_n_s_kwargs); Py_VISIT(traverse_module_state->__pyx_n_s_length); Py_VISIT(traverse_module_state->__pyx_n_s_lock); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_mod); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_n_s_ne); Py_VISIT(traverse_module_state->__pyx_n_s_nonzero); Py_VISIT(traverse_module_state->__pyx_n_s_numFingers); Py_VISIT(traverse_module_state->__pyx_n_s_num_fingers); Py_VISIT(traverse_module_state->__pyx_n_s_object); Py_VISIT(traverse_module_state->__pyx_n_s_on); Py_VISIT(traverse_module_state->__pyx_n_s_other); Py_VISIT(traverse_module_state->__pyx_n_s_peek); Py_VISIT(traverse_module_state->__pyx_n_s_pinched); Py_VISIT(traverse_module_state->__pyx_n_s_poll); Py_VISIT(traverse_module_state->__pyx_n_s_pop); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_post); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_pressure); Py_VISIT(traverse_module_state->__pyx_n_s_property); Py_VISIT(traverse_module_state->__pyx_n_s_pump); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_event); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_register); Py_VISIT(traverse_module_state->__pyx_n_s_rel); Py_VISIT(traverse_module_state->__pyx_n_s_repeat); Py_VISIT(traverse_module_state->__pyx_n_s_repr); Py_VISIT(traverse_module_state->__pyx_n_s_rest); Py_VISIT(traverse_module_state->__pyx_n_s_result); Py_VISIT(traverse_module_state->__pyx_n_s_rotated); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_kp_s_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_scancode); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_main_init); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_allowed); Py_VISIT(traverse_module_state->__pyx_n_s_set_blocked); Py_VISIT(traverse_module_state->__pyx_n_s_set_grab); Py_VISIT(traverse_module_state->__pyx_n_s_set_mousewheel_buttons); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_event_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_sys); Py_VISIT(traverse_module_state->__pyx_n_s_t); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_text); Py_VISIT(traverse_module_state->__pyx_n_s_text_input); Py_VISIT(traverse_module_state->__pyx_n_s_threading); Py_VISIT(traverse_module_state->__pyx_n_s_timestamp); Py_VISIT(traverse_module_state->__pyx_n_s_touch); Py_VISIT(traverse_module_state->__pyx_n_s_touchId); Py_VISIT(traverse_module_state->__pyx_n_s_touch_id); Py_VISIT(traverse_module_state->__pyx_n_s_type); Py_VISIT(traverse_module_state->__pyx_n_s_type_2); Py_VISIT(traverse_module_state->__pyx_n_s_types); Py_VISIT(traverse_module_state->__pyx_n_s_unichr); Py_VISIT(traverse_module_state->__pyx_n_s_unicode); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_n_s_v); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_version_info); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_wait); Py_VISIT(traverse_module_state->__pyx_n_s_which); Py_VISIT(traverse_module_state->__pyx_n_s_window_id); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_3); Py_VISIT(traverse_module_state->__pyx_int_4); Py_VISIT(traverse_module_state->__pyx_slice__4); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__33); Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__24); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__31); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__38); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__42); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__47); Py_VISIT(traverse_module_state->__pyx_codeobj__48); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7display_Window __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7display_Window #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_s_ __pyx_mstate_global->__pyx_kp_s_ #define __pyx_n_s_ACTIVEEVENT __pyx_mstate_global->__pyx_n_s_ACTIVEEVENT #define __pyx_n_s_APP_DIDENTERBACKGROUND __pyx_mstate_global->__pyx_n_s_APP_DIDENTERBACKGROUND #define __pyx_n_s_APP_DIDENTERFOREGROUND __pyx_mstate_global->__pyx_n_s_APP_DIDENTERFOREGROUND #define __pyx_n_s_APP_LOWMEMORY __pyx_mstate_global->__pyx_n_s_APP_LOWMEMORY #define __pyx_n_s_APP_TERMINATING __pyx_mstate_global->__pyx_n_s_APP_TERMINATING #define __pyx_n_s_APP_WILLENTERBACKGROUND __pyx_mstate_global->__pyx_n_s_APP_WILLENTERBACKGROUND #define __pyx_n_s_APP_WILLENTERFOREGROUND __pyx_mstate_global->__pyx_n_s_APP_WILLENTERFOREGROUND #define __pyx_n_s_AUDIODEVICEADDED __pyx_mstate_global->__pyx_n_s_AUDIODEVICEADDED #define __pyx_n_s_AUDIODEVICEREMOVED __pyx_mstate_global->__pyx_n_s_AUDIODEVICEREMOVED #define __pyx_n_s_CLIPBOARDUPDATE __pyx_mstate_global->__pyx_n_s_CLIPBOARDUPDATE #define __pyx_n_s_CONTROLLERAXISMOTION __pyx_mstate_global->__pyx_n_s_CONTROLLERAXISMOTION #define __pyx_n_s_CONTROLLERBUTTONDOWN __pyx_mstate_global->__pyx_n_s_CONTROLLERBUTTONDOWN #define __pyx_n_s_CONTROLLERBUTTONUP __pyx_mstate_global->__pyx_n_s_CONTROLLERBUTTONUP #define __pyx_n_s_CONTROLLERDEVICEADDED __pyx_mstate_global->__pyx_n_s_CONTROLLERDEVICEADDED #define __pyx_n_s_CONTROLLERDEVICEREMAPPED __pyx_mstate_global->__pyx_n_s_CONTROLLERDEVICEREMAPPED #define __pyx_n_s_CONTROLLERDEVICEREMOVED __pyx_mstate_global->__pyx_n_s_CONTROLLERDEVICEREMOVED #define __pyx_n_s_DISPLAYEVENT __pyx_mstate_global->__pyx_n_s_DISPLAYEVENT #define __pyx_n_s_DOLLARGESTURE __pyx_mstate_global->__pyx_n_s_DOLLARGESTURE #define __pyx_n_s_DOLLARRECORD __pyx_mstate_global->__pyx_n_s_DOLLARRECORD #define __pyx_n_s_DROPBEGIN __pyx_mstate_global->__pyx_n_s_DROPBEGIN #define __pyx_n_s_DROPCOMPLETE __pyx_mstate_global->__pyx_n_s_DROPCOMPLETE #define __pyx_n_s_DROPFILE __pyx_mstate_global->__pyx_n_s_DROPFILE #define __pyx_n_s_DROPTEXT __pyx_mstate_global->__pyx_n_s_DROPTEXT #define __pyx_n_s_Event __pyx_mstate_global->__pyx_n_s_Event #define __pyx_n_s_EventType __pyx_mstate_global->__pyx_n_s_EventType #define __pyx_n_s_EventType___eq __pyx_mstate_global->__pyx_n_s_EventType___eq #define __pyx_n_s_EventType___init __pyx_mstate_global->__pyx_n_s_EventType___init #define __pyx_n_s_EventType___ne __pyx_mstate_global->__pyx_n_s_EventType___ne #define __pyx_n_s_EventType___nonzero __pyx_mstate_global->__pyx_n_s_EventType___nonzero #define __pyx_n_s_EventType___repr __pyx_mstate_global->__pyx_n_s_EventType___repr #define __pyx_n_s_EventType_dict __pyx_mstate_global->__pyx_n_s_EventType_dict #define __pyx_n_s_EventType_type __pyx_mstate_global->__pyx_n_s_EventType_type #define __pyx_kp_s_Event_EventType __pyx_mstate_global->__pyx_kp_s_Event_EventType #define __pyx_kp_s_Event_d_s_s __pyx_mstate_global->__pyx_kp_s_Event_d_s_s #define __pyx_n_s_FINGERDOWN __pyx_mstate_global->__pyx_n_s_FINGERDOWN #define __pyx_n_s_FINGERMOTION __pyx_mstate_global->__pyx_n_s_FINGERMOTION #define __pyx_n_s_FINGERUP __pyx_mstate_global->__pyx_n_s_FINGERUP #define __pyx_n_s_JOYAXISMOTION __pyx_mstate_global->__pyx_n_s_JOYAXISMOTION #define __pyx_n_s_JOYBALLMOTION __pyx_mstate_global->__pyx_n_s_JOYBALLMOTION #define __pyx_n_s_JOYBUTTONDOWN __pyx_mstate_global->__pyx_n_s_JOYBUTTONDOWN #define __pyx_n_s_JOYBUTTONUP __pyx_mstate_global->__pyx_n_s_JOYBUTTONUP #define __pyx_n_s_JOYDEVICEADDED __pyx_mstate_global->__pyx_n_s_JOYDEVICEADDED #define __pyx_n_s_JOYDEVICEREMOVED __pyx_mstate_global->__pyx_n_s_JOYDEVICEREMOVED #define __pyx_n_s_JOYHATMOTION __pyx_mstate_global->__pyx_n_s_JOYHATMOTION #define __pyx_n_s_KEYDOWN __pyx_mstate_global->__pyx_n_s_KEYDOWN #define __pyx_n_s_KEYMAPCHANGED __pyx_mstate_global->__pyx_n_s_KEYMAPCHANGED #define __pyx_n_s_KEYUP __pyx_mstate_global->__pyx_n_s_KEYUP #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError #define __pyx_n_s_LASTEVENT __pyx_mstate_global->__pyx_n_s_LASTEVENT #define __pyx_n_s_MOUSEBUTTONDOWN __pyx_mstate_global->__pyx_n_s_MOUSEBUTTONDOWN #define __pyx_n_s_MOUSEBUTTONUP __pyx_mstate_global->__pyx_n_s_MOUSEBUTTONUP #define __pyx_n_s_MOUSEMOTION __pyx_mstate_global->__pyx_n_s_MOUSEMOTION #define __pyx_n_s_MOUSEWHEEL __pyx_mstate_global->__pyx_n_s_MOUSEWHEEL #define __pyx_n_s_MULTIGESTURE __pyx_mstate_global->__pyx_n_s_MULTIGESTURE #define __pyx_n_u_NOEVENT __pyx_mstate_global->__pyx_n_u_NOEVENT #define __pyx_n_s_NOEVENT_EVENT __pyx_mstate_global->__pyx_n_s_NOEVENT_EVENT #define __pyx_n_s_QUIT __pyx_mstate_global->__pyx_n_s_QUIT #define __pyx_n_s_RENDER_DEVICE_RESET __pyx_mstate_global->__pyx_n_s_RENDER_DEVICE_RESET #define __pyx_n_s_RENDER_TARGETS_RESET __pyx_mstate_global->__pyx_n_s_RENDER_TARGETS_RESET #define __pyx_n_s_RLock __pyx_mstate_global->__pyx_n_s_RLock #define __pyx_n_s_SENSORUPDATE __pyx_mstate_global->__pyx_n_s_SENSORUPDATE #define __pyx_n_s_SYSWMEVENT __pyx_mstate_global->__pyx_n_s_SYSWMEVENT #define __pyx_n_s_TEXTEDITING __pyx_mstate_global->__pyx_n_s_TEXTEDITING #define __pyx_n_s_TEXTINPUT __pyx_mstate_global->__pyx_n_s_TEXTINPUT #define __pyx_n_s_UNKNOWN __pyx_mstate_global->__pyx_n_s_UNKNOWN #define __pyx_n_s_USEREVENT __pyx_mstate_global->__pyx_n_s_USEREVENT #define __pyx_n_s_USEREVENT_MAX __pyx_mstate_global->__pyx_n_s_USEREVENT_MAX #define __pyx_n_s_UnicodeDecodeError __pyx_mstate_global->__pyx_n_s_UnicodeDecodeError #define __pyx_kp_s_UserEvent_d __pyx_mstate_global->__pyx_kp_s_UserEvent_d #define __pyx_n_s_VIDEOEXPOSE __pyx_mstate_global->__pyx_n_s_VIDEOEXPOSE #define __pyx_n_s_VIDEORESIZE __pyx_mstate_global->__pyx_n_s_VIDEORESIZE #define __pyx_n_s_WINDOWEVENT __pyx_mstate_global->__pyx_n_s_WINDOWEVENT #define __pyx_n_s_WINDOWMOVED __pyx_mstate_global->__pyx_n_s_WINDOWMOVED #define __pyx_kp_s__2 __pyx_mstate_global->__pyx_kp_s__2 #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_n_s__49 __pyx_mstate_global->__pyx_n_s__49 #define __pyx_n_s__5 __pyx_mstate_global->__pyx_n_s__5 #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_axis __pyx_mstate_global->__pyx_n_s_axis #define __pyx_n_s_ball __pyx_mstate_global->__pyx_n_s_ball #define __pyx_n_s_button __pyx_mstate_global->__pyx_n_s_button #define __pyx_n_s_buttons __pyx_mstate_global->__pyx_n_s_buttons #define __pyx_n_s_chr __pyx_mstate_global->__pyx_n_s_chr #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_clear __pyx_mstate_global->__pyx_n_s_clear #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_code __pyx_mstate_global->__pyx_n_s_code #define __pyx_n_s_copy_event_queue __pyx_mstate_global->__pyx_n_s_copy_event_queue #define __pyx_n_s_dDist __pyx_mstate_global->__pyx_n_s_dDist #define __pyx_n_s_dTheta __pyx_mstate_global->__pyx_n_s_dTheta #define __pyx_n_s_data1 __pyx_mstate_global->__pyx_n_s_data1 #define __pyx_n_s_data2 __pyx_mstate_global->__pyx_n_s_data2 #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 #define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_dx __pyx_mstate_global->__pyx_n_s_dx #define __pyx_n_s_dy __pyx_mstate_global->__pyx_n_s_dy #define __pyx_n_s_e __pyx_mstate_global->__pyx_n_s_e #define __pyx_n_s_ename __pyx_mstate_global->__pyx_n_s_ename #define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter #define __pyx_n_s_eq __pyx_mstate_global->__pyx_n_s_eq #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_et __pyx_mstate_global->__pyx_n_s_et #define __pyx_n_s_event __pyx_mstate_global->__pyx_n_s_event #define __pyx_n_s_event_name __pyx_mstate_global->__pyx_n_s_event_name #define __pyx_n_s_event_names __pyx_mstate_global->__pyx_n_s_event_names #define __pyx_kp_s_event_post_must_be_called_with_a __pyx_mstate_global->__pyx_kp_s_event_post_must_be_called_with_a #define __pyx_n_s_evt __pyx_mstate_global->__pyx_n_s_evt #define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit #define __pyx_n_s_file __pyx_mstate_global->__pyx_n_s_file #define __pyx_n_s_fingerId __pyx_mstate_global->__pyx_n_s_fingerId #define __pyx_n_s_finger_id __pyx_mstate_global->__pyx_n_s_finger_id #define __pyx_n_s_flag __pyx_mstate_global->__pyx_n_s_flag #define __pyx_n_s_gain __pyx_mstate_global->__pyx_n_s_gain #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_blocked __pyx_mstate_global->__pyx_n_s_get_blocked #define __pyx_n_s_get_grab __pyx_mstate_global->__pyx_n_s_get_grab #define __pyx_n_s_get_mousewheel_buttons __pyx_mstate_global->__pyx_n_s_get_mousewheel_buttons #define __pyx_n_s_get_standard_events __pyx_mstate_global->__pyx_n_s_get_standard_events #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_hat __pyx_mstate_global->__pyx_n_s_hat #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_2 __pyx_mstate_global->__pyx_n_s_init_2 #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_insert __pyx_mstate_global->__pyx_n_s_insert #define __pyx_n_s_instance_id __pyx_mstate_global->__pyx_n_s_instance_id #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join #define __pyx_n_s_joy __pyx_mstate_global->__pyx_n_s_joy #define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k #define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key #define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys #define __pyx_n_s_kwargs __pyx_mstate_global->__pyx_n_s_kwargs #define __pyx_n_s_length __pyx_mstate_global->__pyx_n_s_length #define __pyx_n_s_lock __pyx_mstate_global->__pyx_n_s_lock #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_mod __pyx_mstate_global->__pyx_n_s_mod #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_n_s_ne __pyx_mstate_global->__pyx_n_s_ne #define __pyx_n_s_nonzero __pyx_mstate_global->__pyx_n_s_nonzero #define __pyx_n_s_numFingers __pyx_mstate_global->__pyx_n_s_numFingers #define __pyx_n_s_num_fingers __pyx_mstate_global->__pyx_n_s_num_fingers #define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object #define __pyx_n_s_on __pyx_mstate_global->__pyx_n_s_on #define __pyx_n_s_other __pyx_mstate_global->__pyx_n_s_other #define __pyx_n_s_peek __pyx_mstate_global->__pyx_n_s_peek #define __pyx_n_s_pinched __pyx_mstate_global->__pyx_n_s_pinched #define __pyx_n_s_poll __pyx_mstate_global->__pyx_n_s_poll #define __pyx_n_s_pop __pyx_mstate_global->__pyx_n_s_pop #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_post __pyx_mstate_global->__pyx_n_s_post #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_pressure __pyx_mstate_global->__pyx_n_s_pressure #define __pyx_n_s_property __pyx_mstate_global->__pyx_n_s_property #define __pyx_n_s_pump __pyx_mstate_global->__pyx_n_s_pump #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_event __pyx_mstate_global->__pyx_n_s_pygame_sdl2_event #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_register __pyx_mstate_global->__pyx_n_s_register #define __pyx_n_s_rel __pyx_mstate_global->__pyx_n_s_rel #define __pyx_n_s_repeat __pyx_mstate_global->__pyx_n_s_repeat #define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr #define __pyx_n_s_rest __pyx_mstate_global->__pyx_n_s_rest #define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result #define __pyx_n_s_rotated __pyx_mstate_global->__pyx_n_s_rotated #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_kp_s_s_r __pyx_mstate_global->__pyx_kp_s_s_r #define __pyx_n_s_scancode __pyx_mstate_global->__pyx_n_s_scancode #define __pyx_n_s_sdl_main_init __pyx_mstate_global->__pyx_n_s_sdl_main_init #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_allowed __pyx_mstate_global->__pyx_n_s_set_allowed #define __pyx_n_s_set_blocked __pyx_mstate_global->__pyx_n_s_set_blocked #define __pyx_n_s_set_grab __pyx_mstate_global->__pyx_n_s_set_grab #define __pyx_n_s_set_mousewheel_buttons __pyx_mstate_global->__pyx_n_s_set_mousewheel_buttons #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_event_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_event_pyx #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys #define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_text __pyx_mstate_global->__pyx_n_s_text #define __pyx_n_s_text_input __pyx_mstate_global->__pyx_n_s_text_input #define __pyx_n_s_threading __pyx_mstate_global->__pyx_n_s_threading #define __pyx_n_s_timestamp __pyx_mstate_global->__pyx_n_s_timestamp #define __pyx_n_s_touch __pyx_mstate_global->__pyx_n_s_touch #define __pyx_n_s_touchId __pyx_mstate_global->__pyx_n_s_touchId #define __pyx_n_s_touch_id __pyx_mstate_global->__pyx_n_s_touch_id #define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type #define __pyx_n_s_type_2 __pyx_mstate_global->__pyx_n_s_type_2 #define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types #define __pyx_n_s_unichr __pyx_mstate_global->__pyx_n_s_unichr #define __pyx_n_s_unicode __pyx_mstate_global->__pyx_n_s_unicode #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_version_info __pyx_mstate_global->__pyx_n_s_version_info #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_wait __pyx_mstate_global->__pyx_n_s_wait #define __pyx_n_s_which __pyx_mstate_global->__pyx_n_s_which #define __pyx_n_s_window_id __pyx_mstate_global->__pyx_n_s_window_id #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 #define __pyx_slice__4 __pyx_mstate_global->__pyx_slice__4 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 /* #### Code section: module_code ### */ PyObject *event_queue = 0; /* "pygame_sdl2/event.pyx":63 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType___init__, "EventType.__init__(self, type, dict=None, **kwargs)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType___init__}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_type = 0; PyObject *__pyx_v_dict = 0; PyObject *__pyx_v_kwargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_type,&__pyx_n_s_dict,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 63, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dict); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 63, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_type = values[1]; __pyx_v_dict = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 63, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("pygame_sdl2.event.EventType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType___init__(__pyx_self, __pyx_v_self, __pyx_v_type, __pyx_v_dict, __pyx_v_kwargs); /* function exit code */ __Pyx_DECREF(__pyx_v_kwargs); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_dict, PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/event.pyx":64 * * def __init__(self, type, dict=None, **kwargs): * self._type = type # <<<<<<<<<<<<<< * * if dict: */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_type_2, __pyx_v_type) < 0) __PYX_ERR(0, 64, __pyx_L1_error) /* "pygame_sdl2/event.pyx":66 * self._type = type * * if dict: # <<<<<<<<<<<<<< * self.__dict__.update(dict) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dict); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 66, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":67 * * if dict: * self.__dict__.update(dict) # <<<<<<<<<<<<<< * * self.__dict__.update(kwargs) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_dict}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":66 * self._type = type * * if dict: # <<<<<<<<<<<<<< * self.__dict__.update(dict) * */ } /* "pygame_sdl2/event.pyx":69 * self.__dict__.update(dict) * * self.__dict__.update(kwargs) # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_kwargs}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":63 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":71 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < WINDOWMOVED: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_3__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType_2__repr__, "EventType.__repr__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_3__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType_2__repr__}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_3__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 71, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 71, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.EventType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_2__repr__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_ename = NULL; PyObject *__pyx_v_rest = NULL; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; unsigned int __pyx_t_10; int __pyx_t_11; Py_ssize_t __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *(*__pyx_t_14)(PyObject *); int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/event.pyx":72 * * def __repr__(self): * if SDL_USEREVENT <= self.type < WINDOWMOVED: # <<<<<<<<<<<<<< * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_3)) { __Pyx_DECREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_WINDOWMOVED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { /* "pygame_sdl2/event.pyx":73 * def __repr__(self): * if SDL_USEREVENT <= self.type < WINDOWMOVED: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) # <<<<<<<<<<<<<< * else: * try: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_UserEvent_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ename = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":72 * * def __repr__(self): * if SDL_USEREVENT <= self.type < WINDOWMOVED: # <<<<<<<<<<<<<< * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":75 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: * try: # <<<<<<<<<<<<<< * ename = event_names[self.type] * except KeyError: */ /*else*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":76 * else: * try: * ename = event_names[self.type] # <<<<<<<<<<<<<< * except KeyError: * ename = "UNKNOWN" */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_event_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ename = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":75 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: * try: # <<<<<<<<<<<<<< * ename = event_names[self.type] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":77 * try: * ename = event_names[self.type] * except KeyError: # <<<<<<<<<<<<<< * ename = "UNKNOWN" * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_9) { __Pyx_AddTraceback("pygame_sdl2.event.EventType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); /* "pygame_sdl2/event.pyx":78 * ename = event_names[self.type] * except KeyError: * ename = "UNKNOWN" # <<<<<<<<<<<<<< * * rest = [ ] */ __Pyx_INCREF(__pyx_n_s_UNKNOWN); __Pyx_XDECREF_SET(__pyx_v_ename, __pyx_n_s_UNKNOWN); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; /* "pygame_sdl2/event.pyx":75 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: * try: # <<<<<<<<<<<<<< * ename = event_names[self.type] * except KeyError: */ __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L5_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L9_try_end:; } } __pyx_L3:; /* "pygame_sdl2/event.pyx":80 * ename = "UNKNOWN" * * rest = [ ] # <<<<<<<<<<<<<< * * for k, v in sorted(self.__dict__.items()): */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_rest = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":82 * rest = [ ] * * for k, v in sorted(self.__dict__.items()): # <<<<<<<<<<<<<< * if k == "_type" or k == "timestamp": * continue */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = PyList_Sort(__pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 82, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 82, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 82, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 82, __pyx_L1_error) __pyx_L15_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":83 * * for k, v in sorted(self.__dict__.items()): * if k == "_type" or k == "timestamp": # <<<<<<<<<<<<<< * continue * */ __pyx_t_15 = (__Pyx_PyString_Equals(__pyx_v_k, __pyx_n_s_type_2, Py_EQ)); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 83, __pyx_L1_error) if (!__pyx_t_15) { } else { __pyx_t_5 = __pyx_t_15; goto __pyx_L17_bool_binop_done; } __pyx_t_15 = (__Pyx_PyString_Equals(__pyx_v_k, __pyx_n_s_timestamp, Py_EQ)); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 83, __pyx_L1_error) __pyx_t_5 = __pyx_t_15; __pyx_L17_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/event.pyx":84 * for k, v in sorted(self.__dict__.items()): * if k == "_type" or k == "timestamp": * continue # <<<<<<<<<<<<<< * * rest.append("%s=%r" % (k, v)) */ goto __pyx_L12_continue; /* "pygame_sdl2/event.pyx":83 * * for k, v in sorted(self.__dict__.items()): * if k == "_type" or k == "timestamp": # <<<<<<<<<<<<<< * continue * */ } /* "pygame_sdl2/event.pyx":86 * continue * * rest.append("%s=%r" % (k, v)) # <<<<<<<<<<<<<< * * return '' % (self.type, ename, ", ".join(rest)) */ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_k)) __PYX_ERR(0, 86, __pyx_L1_error); __Pyx_INCREF(__pyx_v_v); __Pyx_GIVEREF(__pyx_v_v); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_v)) __PYX_ERR(0, 86, __pyx_L1_error); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_rest, __pyx_t_3); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":82 * rest = [ ] * * for k, v in sorted(self.__dict__.items()): # <<<<<<<<<<<<<< * if k == "_type" or k == "timestamp": * continue */ __pyx_L12_continue:; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":88 * rest.append("%s=%r" % (k, v)) * * return '' % (self.type, ename, ", ".join(rest)) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s_, __pyx_v_rest); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ename); __Pyx_GIVEREF(__pyx_v_ename); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ename)) __PYX_ERR(0, 88, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Event_d_s_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":71 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < WINDOWMOVED: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ename); __Pyx_XDECREF(__pyx_v_rest); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":90 * return '' % (self.type, ename, ", ".join(rest)) * * @property # <<<<<<<<<<<<<< * def dict(self): * return self.__dict__ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_5dict(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType_4dict, "EventType.dict(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_5dict = {"dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_5dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType_4dict}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_5dict(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dict (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dict") < 0)) __PYX_ERR(0, 90, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dict", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 90, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.EventType.dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_4dict(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_4dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dict", 1); /* "pygame_sdl2/event.pyx":92 * @property * def dict(self): * return self.__dict__ # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":90 * return '' % (self.type, ename, ", ".join(rest)) * * @property # <<<<<<<<<<<<<< * def dict(self): * return self.__dict__ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.EventType.dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":94 * return self.__dict__ * * @property # <<<<<<<<<<<<<< * def type(self): * return self._type */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_7type(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType_6type, "EventType.type(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_7type = {"type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_7type, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType_6type}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_7type(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("type (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "type") < 0)) __PYX_ERR(0, 94, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("type", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 94, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.EventType.type", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_6type(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_6type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("type", 1); /* "pygame_sdl2/event.pyx":96 * @property * def type(self): * return self._type # <<<<<<<<<<<<<< * * def __eq__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":94 * return self.__dict__ * * @property # <<<<<<<<<<<<<< * def type(self): * return self._type */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.EventType.type", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":98 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_9__eq__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType_8__eq__, "EventType.__eq__(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_9__eq__ = {"__eq__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_9__eq__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType_8__eq__}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_9__eq__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 98, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__eq__") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_other = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.EventType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_8__eq__(__pyx_self, __pyx_v_self, __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__eq__", 1); /* "pygame_sdl2/event.pyx":99 * * def __eq__(self, other): * return self.__dict__ == other.__dict__ # <<<<<<<<<<<<<< * * def __ne__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":98 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":101 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_11__ne__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType_10__ne__, "EventType.__ne__(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_11__ne__ = {"__ne__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_11__ne__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType_10__ne__}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_11__ne__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); __PYX_ERR(0, 101, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__ne__") < 0)) __PYX_ERR(0, 101, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_other = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 101, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.EventType.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_10__ne__(__pyx_self, __pyx_v_self, __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__ne__", 1); /* "pygame_sdl2/event.pyx":102 * * def __ne__(self, other): * return not (self == other) # <<<<<<<<<<<<<< * * def __nonzero__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_RichCompare(__pyx_v_self, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":101 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":104 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_13__nonzero__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_9EventType_12__nonzero__, "EventType.__nonzero__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_13__nonzero__ = {"__nonzero__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9EventType_13__nonzero__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_9EventType_12__nonzero__}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_13__nonzero__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__nonzero__") < 0)) __PYX_ERR(0, 104, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__nonzero__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 104, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.EventType.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_12__nonzero__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_12__nonzero__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__nonzero__", 1); /* "pygame_sdl2/event.pyx":105 * * def __nonzero__(self): * return self.type != 0 # <<<<<<<<<<<<<< * * Event = EventType */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":104 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":109 * Event = EventType * * cdef get_textinput(): # <<<<<<<<<<<<<< * cdef SDL_Event evt * */ static PyObject *__pyx_f_11pygame_sdl2_5event_get_textinput(void) { SDL_Event __pyx_v_evt; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_textinput", 1); /* "pygame_sdl2/event.pyx":112 * cdef SDL_Event evt * * SDL_PumpEvents() # <<<<<<<<<<<<<< * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: */ SDL_PumpEvents(); /* "pygame_sdl2/event.pyx":114 * SDL_PumpEvents() * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: # <<<<<<<<<<<<<< * return evt.text.text.decode('utf-8') * return u'' */ __pyx_t_1 = (SDL_PeepEvents((&__pyx_v_evt), 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":115 * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: * return evt.text.text.decode('utf-8') # <<<<<<<<<<<<<< * return u'' * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_v_evt.text.text; __pyx_t_3 = __Pyx_ssize_strlen(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 115, __pyx_L1_error) __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_2, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_4); __pyx_r = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":114 * SDL_PumpEvents() * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: # <<<<<<<<<<<<<< * return evt.text.text.decode('utf-8') * return u'' */ } /* "pygame_sdl2/event.pyx":116 * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: * return evt.text.text.decode('utf-8') * return u'' # <<<<<<<<<<<<<< * * cdef make_keyboard_event(SDL_KeyboardEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_u__2); __pyx_r = __pyx_kp_u__2; goto __pyx_L0; /* "pygame_sdl2/event.pyx":109 * Event = EventType * * cdef get_textinput(): # <<<<<<<<<<<<<< * cdef SDL_Event evt * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.get_textinput", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":118 * return u'' * * cdef make_keyboard_event(SDL_KeyboardEvent *e): # <<<<<<<<<<<<<< * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_keyboard_event(SDL_KeyboardEvent *__pyx_v_e) { PyObject *__pyx_v_dargs = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_keyboard_event", 1); /* "pygame_sdl2/event.pyx":119 * * cdef make_keyboard_event(SDL_KeyboardEvent *e): * dargs = { 'scancode' : e.keysym.scancode, # <<<<<<<<<<<<<< * 'key' : e.keysym.sym, * 'mod' : e.keysym.mod, */ __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_SDL_Scancode(__pyx_v_e->keysym.scancode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_scancode, __pyx_t_2) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":120 * cdef make_keyboard_event(SDL_KeyboardEvent *e): * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, # <<<<<<<<<<<<<< * 'mod' : e.keysym.mod, * 'unicode' : '', */ __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->keysym.sym); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":121 * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, * 'mod' : e.keysym.mod, # <<<<<<<<<<<<<< * 'unicode' : '', * 'repeat' : e.repeat, */ __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_e->keysym.mod); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mod, __pyx_t_2) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_unicode, __pyx_kp_s__2) < 0) __PYX_ERR(0, 119, __pyx_L1_error) /* "pygame_sdl2/event.pyx":123 * 'mod' : e.keysym.mod, * 'unicode' : '', * 'repeat' : e.repeat, # <<<<<<<<<<<<<< * } * */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_repeat, __pyx_t_2) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dargs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":126 * } * * if not pygame_sdl2.key.text_input: # <<<<<<<<<<<<<< * * if e.type == SDL_KEYDOWN: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_text_input); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":128 * if not pygame_sdl2.key.text_input: * * if e.type == SDL_KEYDOWN: # <<<<<<<<<<<<<< * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. */ __pyx_t_4 = (__pyx_v_e->type == SDL_KEYDOWN); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":131 * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. * if e.keysym.sym < 0x20: # <<<<<<<<<<<<<< * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: */ __pyx_t_4 = (__pyx_v_e->keysym.sym < 0x20); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":132 * # there will be one associated with this KEYDOWN event. * if e.keysym.sym < 0x20: * dargs['unicode'] = unichr(e.keysym.sym) # <<<<<<<<<<<<<< * elif e.keysym.sym <= 0xFFFF: * dargs['unicode'] = get_textinput() */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_unichr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->keysym.sym); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (unlikely((PyDict_SetItem(__pyx_v_dargs, __pyx_n_s_unicode, __pyx_t_1) < 0))) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":131 * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. * if e.keysym.sym < 0x20: # <<<<<<<<<<<<<< * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: */ goto __pyx_L5; } /* "pygame_sdl2/event.pyx":133 * if e.keysym.sym < 0x20: * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: # <<<<<<<<<<<<<< * dargs['unicode'] = get_textinput() * */ __pyx_t_4 = (__pyx_v_e->keysym.sym <= 0xFFFF); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":134 * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: * dargs['unicode'] = get_textinput() # <<<<<<<<<<<<<< * * else: */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5event_get_textinput(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((PyDict_SetItem(__pyx_v_dargs, __pyx_n_s_unicode, __pyx_t_1) < 0))) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":133 * if e.keysym.sym < 0x20: * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: # <<<<<<<<<<<<<< * dargs['unicode'] = get_textinput() * */ } __pyx_L5:; /* "pygame_sdl2/event.pyx":128 * if not pygame_sdl2.key.text_input: * * if e.type == SDL_KEYDOWN: # <<<<<<<<<<<<<< * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. */ } /* "pygame_sdl2/event.pyx":126 * } * * if not pygame_sdl2.key.text_input: # <<<<<<<<<<<<<< * * if e.type == SDL_KEYDOWN: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":137 * * else: * if e.type == SDL_KEYDOWN and not(e.keysym.mod & KMOD_NUM): # <<<<<<<<<<<<<< * if SDLK_KP_1 <= e.keysym.sym <= SDLK_KP_0: * get_textinput() */ /*else*/ { __pyx_t_3 = (__pyx_v_e->type == SDL_KEYDOWN); if (__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L7_bool_binop_done; } __pyx_t_3 = (!((__pyx_v_e->keysym.mod & KMOD_NUM) != 0)); __pyx_t_4 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":138 * else: * if e.type == SDL_KEYDOWN and not(e.keysym.mod & KMOD_NUM): * if SDLK_KP_1 <= e.keysym.sym <= SDLK_KP_0: # <<<<<<<<<<<<<< * get_textinput() * dargs['unicode'] = '' */ __pyx_t_4 = (SDLK_KP_1 <= __pyx_v_e->keysym.sym); if (__pyx_t_4) { __pyx_t_4 = (__pyx_v_e->keysym.sym <= SDLK_KP_0); } if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":139 * if e.type == SDL_KEYDOWN and not(e.keysym.mod & KMOD_NUM): * if SDLK_KP_1 <= e.keysym.sym <= SDLK_KP_0: * get_textinput() # <<<<<<<<<<<<<< * dargs['unicode'] = '' * */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5event_get_textinput(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":140 * if SDLK_KP_1 <= e.keysym.sym <= SDLK_KP_0: * get_textinput() * dargs['unicode'] = '' # <<<<<<<<<<<<<< * * return EventType(e.type, dict=dargs, repeat=e.repeat) */ if (unlikely((PyDict_SetItem(__pyx_v_dargs, __pyx_n_s_unicode, __pyx_kp_s__2) < 0))) __PYX_ERR(0, 140, __pyx_L1_error) /* "pygame_sdl2/event.pyx":138 * else: * if e.type == SDL_KEYDOWN and not(e.keysym.mod & KMOD_NUM): * if SDLK_KP_1 <= e.keysym.sym <= SDLK_KP_0: # <<<<<<<<<<<<<< * get_textinput() * dargs['unicode'] = '' */ } /* "pygame_sdl2/event.pyx":137 * * else: * if e.type == SDL_KEYDOWN and not(e.keysym.mod & KMOD_NUM): # <<<<<<<<<<<<<< * if SDLK_KP_1 <= e.keysym.sym <= SDLK_KP_0: * get_textinput() */ } } __pyx_L3:; /* "pygame_sdl2/event.pyx":142 * dargs['unicode'] = '' * * return EventType(e.type, dict=dargs, repeat=e.repeat) # <<<<<<<<<<<<<< * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dict, __pyx_v_dargs) < 0) __PYX_ERR(0, 142, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->repeat); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_repeat, __pyx_t_6) < 0) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":118 * return u'' * * cdef make_keyboard_event(SDL_KeyboardEvent *e): # <<<<<<<<<<<<<< * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_keyboard_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":144 * return EventType(e.type, dict=dargs, repeat=e.repeat) * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): # <<<<<<<<<<<<<< * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousemotion_event(SDL_MouseMotionEvent *__pyx_v_e) { PyObject *__pyx_v_buttons = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_mousemotion_event", 1); /* "pygame_sdl2/event.pyx":145 * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) */ __pyx_t_2 = ((__pyx_v_e->state & SDL_BUTTON_LMASK) != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_int_1); __pyx_t_1 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; } /* "pygame_sdl2/event.pyx":146 * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, # <<<<<<<<<<<<<< * 1 if e.state & SDL_BUTTON_RMASK else 0) * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons, touch=(SDL_TOUCH_MOUSEID == e.which)) */ __pyx_t_2 = ((__pyx_v_e->state & SDL_BUTTON_MMASK) != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_int_1); __pyx_t_3 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_3 = __pyx_int_0; } /* "pygame_sdl2/event.pyx":147 * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) # <<<<<<<<<<<<<< * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons, touch=(SDL_TOUCH_MOUSEID == e.which)) * */ __pyx_t_2 = ((__pyx_v_e->state & SDL_BUTTON_RMASK) != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_int_1); __pyx_t_4 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_4 = __pyx_int_0; } /* "pygame_sdl2/event.pyx":145 * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_v_buttons = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":148 * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons, touch=(SDL_TOUCH_MOUSEID == e.which)) # <<<<<<<<<<<<<< * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_EventType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_t_7) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_int32_t(__pyx_v_e->xrel); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->yrel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_rel, __pyx_t_1) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_1) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_buttons, __pyx_v_buttons) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID == __pyx_v_e->which)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touch, __pyx_t_1) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":144 * return EventType(e.type, dict=dargs, repeat=e.repeat) * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): # <<<<<<<<<<<<<< * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.make_mousemotion_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buttons); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":150 * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons, touch=(SDL_TOUCH_MOUSEID == e.which)) * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): # <<<<<<<<<<<<<< * btn = e.button * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousebtn_event(SDL_MouseButtonEvent *__pyx_v_e) { PyObject *__pyx_v_btn = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_mousebtn_event", 1); /* "pygame_sdl2/event.pyx":151 * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): * btn = e.button # <<<<<<<<<<<<<< * * # SDL 1.x maps wheel to buttons 4/5 */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->button); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_btn = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":154 * * # SDL 1.x maps wheel to buttons 4/5 * if mousewheel_buttons and btn >= 4: # <<<<<<<<<<<<<< * btn += 2 * */ if (__pyx_v_11pygame_sdl2_5event_mousewheel_buttons) { } else { __pyx_t_2 = __pyx_v_11pygame_sdl2_5event_mousewheel_buttons; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = PyObject_RichCompare(__pyx_v_btn, __pyx_int_4, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":155 * # SDL 1.x maps wheel to buttons 4/5 * if mousewheel_buttons and btn >= 4: * btn += 2 # <<<<<<<<<<<<<< * * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which, touch=(SDL_TOUCH_MOUSEID == e.which)) */ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_btn, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_btn, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":154 * * # SDL 1.x maps wheel to buttons 4/5 * if mousewheel_buttons and btn >= 4: # <<<<<<<<<<<<<< * btn += 2 * */ } /* "pygame_sdl2/event.pyx":157 * btn += 2 * * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which, touch=(SDL_TOUCH_MOUSEID == e.which)) # <<<<<<<<<<<<<< * * cdef make_mousewheel_event(SDL_MouseWheelEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_button, __pyx_v_btn) < 0) __PYX_ERR(0, 157, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(0, 157, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_t_8) < 0) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_8) < 0) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyBool_FromLong((__pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID == __pyx_v_e->which)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touch, __pyx_t_8) < 0) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":150 * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons, touch=(SDL_TOUCH_MOUSEID == e.which)) * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): # <<<<<<<<<<<<<< * btn = e.button * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.event.make_mousebtn_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_btn); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":159 * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which, touch=(SDL_TOUCH_MOUSEID == e.which)) * * cdef make_mousewheel_event(SDL_MouseWheelEvent *e): # <<<<<<<<<<<<<< * * cdef int x, y */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousewheel_event(SDL_MouseWheelEvent *__pyx_v_e) { int __pyx_v_x; int __pyx_v_y; long __pyx_v_btn; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Sint32 __pyx_t_6; unsigned int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_mousewheel_event", 1); /* "pygame_sdl2/event.pyx":164 * * # SDL2-style, if the user has opted-in. * if not mousewheel_buttons: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.which, x=e.x, y=e.y, touch=(SDL_TOUCH_MOUSEID == e.which)) * */ __pyx_t_1 = (!__pyx_v_11pygame_sdl2_5event_mousewheel_buttons); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":165 * # SDL2-style, if the user has opted-in. * if not mousewheel_buttons: * return EventType(e.type, which=e.which, x=e.x, y=e.y, touch=(SDL_TOUCH_MOUSEID == e.which)) # <<<<<<<<<<<<<< * * # Otherwise, follow the SDL1 approach. */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_which, __pyx_t_5) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_x, __pyx_t_5) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_y, __pyx_t_5) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID == __pyx_v_e->which)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_touch, __pyx_t_5) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":164 * * # SDL2-style, if the user has opted-in. * if not mousewheel_buttons: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.which, x=e.x, y=e.y, touch=(SDL_TOUCH_MOUSEID == e.which)) * */ } /* "pygame_sdl2/event.pyx":169 * # Otherwise, follow the SDL1 approach. * * y = e.y # <<<<<<<<<<<<<< * * # TODO: Implement when 2.0.4 becomes widespread. */ __pyx_t_6 = __pyx_v_e->y; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/event.pyx":175 * # y = -y * * if y > 0: # <<<<<<<<<<<<<< * btn = 4 * elif y < 0: */ __pyx_t_1 = (__pyx_v_y > 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":176 * * if y > 0: * btn = 4 # <<<<<<<<<<<<<< * elif y < 0: * btn = 5 */ __pyx_v_btn = 4; /* "pygame_sdl2/event.pyx":175 * # y = -y * * if y > 0: # <<<<<<<<<<<<<< * btn = 4 * elif y < 0: */ goto __pyx_L4; } /* "pygame_sdl2/event.pyx":177 * if y > 0: * btn = 4 * elif y < 0: # <<<<<<<<<<<<<< * btn = 5 * else: */ __pyx_t_1 = (__pyx_v_y < 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":178 * btn = 4 * elif y < 0: * btn = 5 # <<<<<<<<<<<<<< * else: * return EventType(0) # x axis scrolling produces no event in pygame */ __pyx_v_btn = 5; /* "pygame_sdl2/event.pyx":177 * if y > 0: * btn = 4 * elif y < 0: # <<<<<<<<<<<<<< * btn = 5 * else: */ goto __pyx_L4; } /* "pygame_sdl2/event.pyx":180 * btn = 5 * else: * return EventType(0) # x axis scrolling produces no event in pygame # <<<<<<<<<<<<<< * * # This is not the mouse position at the time of the event */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_EventType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_int_0}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } __pyx_L4:; /* "pygame_sdl2/event.pyx":183 * * # This is not the mouse position at the time of the event * SDL_GetMouseState(&x, &y) # <<<<<<<<<<<<<< * * # MOUSEBUTTONUP event should follow immediately after */ (void)(SDL_GetMouseState((&__pyx_v_x), (&__pyx_v_y))); /* "pygame_sdl2/event.pyx":186 * * # MOUSEBUTTONUP event should follow immediately after * event_queue.insert(0, EventType(SDL_MOUSEBUTTONUP, which=e.which, button=btn, pos=(x,y), touch=(SDL_TOUCH_MOUSEID == e.which))) # <<<<<<<<<<<<<< * return EventType(SDL_MOUSEBUTTONDOWN, which=e.which, button=btn, pos=(x,y), touch=(SDL_TOUCH_MOUSEID == e.which)) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(event_queue, __pyx_n_s_insert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_which, __pyx_t_9) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_btn); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_button, __pyx_t_9) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9)) __PYX_ERR(0, 186, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10)) __PYX_ERR(0, 186, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_10 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pos, __pyx_t_11) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyBool_FromLong((__pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID == __pyx_v_e->which)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_touch, __pyx_t_11) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_int_0, __pyx_t_11}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":187 * # MOUSEBUTTONUP event should follow immediately after * event_queue.insert(0, EventType(SDL_MOUSEBUTTONUP, which=e.which, button=btn, pos=(x,y), touch=(SDL_TOUCH_MOUSEID == e.which))) * return EventType(SDL_MOUSEBUTTONDOWN, which=e.which, button=btn, pos=(x,y), touch=(SDL_TOUCH_MOUSEID == e.which)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_EventType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_which, __pyx_t_2) < 0) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_btn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_button, __pyx_t_2) < 0) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8)) __PYX_ERR(0, 187, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_8 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_pos, __pyx_t_4) < 0) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID == __pyx_v_e->which)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_touch, __pyx_t_4) < 0) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":159 * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which, touch=(SDL_TOUCH_MOUSEID == e.which)) * * cdef make_mousewheel_event(SDL_MouseWheelEvent *e): # <<<<<<<<<<<<<< * * cdef int x, y */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.event.make_mousewheel_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":190 * * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, axis=e.axis, value=e.value/32768.0) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyaxis_event(SDL_JoyAxisEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_joyaxis_event", 1); /* "pygame_sdl2/event.pyx":191 * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): * return EventType(e.type, joy=e.which, instance_id=e.which, axis=e.axis, value=e.value/32768.0) # <<<<<<<<<<<<<< * * cdef make_joyball_event(SDL_JoyBallEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_instance_id, __pyx_t_4) < 0) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->axis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_axis, __pyx_t_4) < 0) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyFloat_FromDouble((((double)__pyx_v_e->value) / 32768.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_t_4) < 0) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":190 * * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, axis=e.axis, value=e.value/32768.0) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_joyaxis_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":193 * return EventType(e.type, joy=e.which, instance_id=e.which, axis=e.axis, value=e.value/32768.0) * * cdef make_joyball_event(SDL_JoyBallEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyball_event(SDL_JoyBallEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_joyball_event", 1); /* "pygame_sdl2/event.pyx":194 * * cdef make_joyball_event(SDL_JoyBallEvent *e): * return EventType(e.type, joy=e.which, instance_id=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) # <<<<<<<<<<<<<< * * cdef make_joyhat_event(SDL_JoyHatEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_instance_id, __pyx_t_4) < 0) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->ball); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ball, __pyx_t_4) < 0) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int16_t(__pyx_v_e->xrel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int16_t(__pyx_v_e->yrel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rel, __pyx_t_6) < 0) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":193 * return EventType(e.type, joy=e.which, instance_id=e.which, axis=e.axis, value=e.value/32768.0) * * cdef make_joyball_event(SDL_JoyBallEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_joyball_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":196 * return EventType(e.type, joy=e.which, instance_id=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * * cdef make_joyhat_event(SDL_JoyHatEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, hat=e.hat, value=e.value) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyhat_event(SDL_JoyHatEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_joyhat_event", 1); /* "pygame_sdl2/event.pyx":197 * * cdef make_joyhat_event(SDL_JoyHatEvent *e): * return EventType(e.type, joy=e.which, instance_id=e.which, hat=e.hat, value=e.value) # <<<<<<<<<<<<<< * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_instance_id, __pyx_t_4) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->hat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hat, __pyx_t_4) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_t_4) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":196 * return EventType(e.type, joy=e.which, instance_id=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * * cdef make_joyhat_event(SDL_JoyHatEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, hat=e.hat, value=e.value) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_joyhat_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":199 * return EventType(e.type, joy=e.which, instance_id=e.which, hat=e.hat, value=e.value) * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, button=e.button) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joybtn_event(SDL_JoyButtonEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_joybtn_event", 1); /* "pygame_sdl2/event.pyx":200 * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): * return EventType(e.type, joy=e.which, instance_id=e.which, button=e.button) # <<<<<<<<<<<<<< * * cdef make_textinput_event(SDL_TextInputEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_instance_id, __pyx_t_4) < 0) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->button); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_button, __pyx_t_4) < 0) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":199 * return EventType(e.type, joy=e.which, instance_id=e.which, hat=e.hat, value=e.value) * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, instance_id=e.which, button=e.button) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_joybtn_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":202 * return EventType(e.type, joy=e.which, instance_id=e.which, button=e.button) * * cdef make_textinput_event(SDL_TextInputEvent *e): # <<<<<<<<<<<<<< * try: * return EventType(e.type, text=e.text.decode("utf-8")) */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textinput_event(SDL_TextInputEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; char *__pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_textinput_event", 1); /* "pygame_sdl2/event.pyx":203 * * cdef make_textinput_event(SDL_TextInputEvent *e): * try: # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8")) * except UnicodeDecodeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "pygame_sdl2/event.pyx":204 * cdef make_textinput_event(SDL_TextInputEvent *e): * try: * return EventType(e.type, text=e.text.decode("utf-8")) # <<<<<<<<<<<<<< * except UnicodeDecodeError: * return EventType(e.type, text='') */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 204, __pyx_L3_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __pyx_v_e->text; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 204, __pyx_L3_error) __pyx_t_9 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_text, __pyx_t_9) < 0) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/event.pyx":203 * * cdef make_textinput_event(SDL_TextInputEvent *e): * try: # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8")) * except UnicodeDecodeError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/event.pyx":205 * try: * return EventType(e.type, text=e.text.decode("utf-8")) * except UnicodeDecodeError: # <<<<<<<<<<<<<< * return EventType(e.type, text='') * */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError); if (__pyx_t_10) { __Pyx_AddTraceback("pygame_sdl2.event.make_textinput_event", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 205, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /* "pygame_sdl2/event.pyx":206 * return EventType(e.type, text=e.text.decode("utf-8")) * except UnicodeDecodeError: * return EventType(e.type, text='') # <<<<<<<<<<<<<< * * cdef make_textediting_event(SDL_TextEditingEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 206, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 206, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11)) __PYX_ERR(0, 206, __pyx_L5_except_error); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 206, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_text, __pyx_kp_s__2) < 0) __PYX_ERR(0, 206, __pyx_L5_except_error) __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 206, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_r = __pyx_t_13; __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; /* "pygame_sdl2/event.pyx":203 * * cdef make_textinput_event(SDL_TextInputEvent *e): * try: # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8")) * except UnicodeDecodeError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "pygame_sdl2/event.pyx":202 * return EventType(e.type, joy=e.which, instance_id=e.which, button=e.button) * * cdef make_textinput_event(SDL_TextInputEvent *e): # <<<<<<<<<<<<<< * try: * return EventType(e.type, text=e.text.decode("utf-8")) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("pygame_sdl2.event.make_textinput_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":208 * return EventType(e.type, text='') * * cdef make_textediting_event(SDL_TextEditingEvent *e): # <<<<<<<<<<<<<< * try: * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textediting_event(SDL_TextEditingEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; char *__pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_textediting_event", 1); /* "pygame_sdl2/event.pyx":209 * * cdef make_textediting_event(SDL_TextEditingEvent *e): * try: # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * except UnicodeDecodeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "pygame_sdl2/event.pyx":210 * cdef make_textediting_event(SDL_TextEditingEvent *e): * try: * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) # <<<<<<<<<<<<<< * except UnicodeDecodeError: * return EventType(e.type, text='', start=e.start, length=e.length) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 210, __pyx_L3_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __pyx_v_e->text; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 210, __pyx_L3_error) __pyx_t_9 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_text, __pyx_t_9) < 0) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyInt_From_int32_t(__pyx_v_e->start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_start, __pyx_t_9) < 0) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyInt_From_int32_t(__pyx_v_e->length); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_length, __pyx_t_9) < 0) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/event.pyx":209 * * cdef make_textediting_event(SDL_TextEditingEvent *e): * try: # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * except UnicodeDecodeError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/event.pyx":211 * try: * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * except UnicodeDecodeError: # <<<<<<<<<<<<<< * return EventType(e.type, text='', start=e.start, length=e.length) * */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError); if (__pyx_t_10) { __Pyx_AddTraceback("pygame_sdl2.event.make_textediting_event", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 211, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /* "pygame_sdl2/event.pyx":212 * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * except UnicodeDecodeError: * return EventType(e.type, text='', start=e.start, length=e.length) # <<<<<<<<<<<<<< * * cdef make_drop_event(SDL_DropEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11)) __PYX_ERR(0, 212, __pyx_L5_except_error); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_text, __pyx_kp_s__2) < 0) __PYX_ERR(0, 212, __pyx_L5_except_error) __pyx_t_13 = __Pyx_PyInt_From_int32_t(__pyx_v_e->start); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_start, __pyx_t_13) < 0) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = __Pyx_PyInt_From_int32_t(__pyx_v_e->length); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_length, __pyx_t_13) < 0) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 212, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_r = __pyx_t_13; __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; /* "pygame_sdl2/event.pyx":209 * * cdef make_textediting_event(SDL_TextEditingEvent *e): * try: # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * except UnicodeDecodeError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "pygame_sdl2/event.pyx":208 * return EventType(e.type, text='') * * cdef make_textediting_event(SDL_TextEditingEvent *e): # <<<<<<<<<<<<<< * try: * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("pygame_sdl2.event.make_textediting_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":214 * return EventType(e.type, text='', start=e.start, length=e.length) * * cdef make_drop_event(SDL_DropEvent *e): # <<<<<<<<<<<<<< * if e.file: * file = e.file.decode("utf-8") */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_drop_event(SDL_DropEvent *__pyx_v_e) { PyObject *__pyx_v_file = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_drop_event", 1); /* "pygame_sdl2/event.pyx":215 * * cdef make_drop_event(SDL_DropEvent *e): * if e.file: # <<<<<<<<<<<<<< * file = e.file.decode("utf-8") * SDL_free(e.file) */ __pyx_t_1 = (__pyx_v_e->file != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":216 * cdef make_drop_event(SDL_DropEvent *e): * if e.file: * file = e.file.decode("utf-8") # <<<<<<<<<<<<<< * SDL_free(e.file) * else: */ __pyx_t_2 = __pyx_v_e->file; __pyx_t_3 = __Pyx_ssize_strlen(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 216, __pyx_L1_error) __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_2, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_4); __pyx_v_file = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":217 * if e.file: * file = e.file.decode("utf-8") * SDL_free(e.file) # <<<<<<<<<<<<<< * else: * file = None */ SDL_free(__pyx_v_e->file); /* "pygame_sdl2/event.pyx":215 * * cdef make_drop_event(SDL_DropEvent *e): * if e.file: # <<<<<<<<<<<<<< * file = e.file.decode("utf-8") * SDL_free(e.file) */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":219 * SDL_free(e.file) * else: * file = None # <<<<<<<<<<<<<< * * return EventType(e.type, file=file, window_id=e.windowID) */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_file = Py_None; } __pyx_L3:; /* "pygame_sdl2/event.pyx":221 * file = None * * return EventType(e.type, file=file, window_id=e.windowID) # <<<<<<<<<<<<<< * * cdef make_window_event(SDL_WindowEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_file, __pyx_v_file) < 0) __PYX_ERR(0, 221, __pyx_L1_error) __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->windowID); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_window_id, __pyx_t_7) < 0) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":214 * return EventType(e.type, text='', start=e.start, length=e.length) * * cdef make_drop_event(SDL_DropEvent *e): # <<<<<<<<<<<<<< * if e.file: * file = e.file.decode("utf-8") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.make_drop_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_file); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":223 * return EventType(e.type, file=file, window_id=e.windowID) * * cdef make_window_event(SDL_WindowEvent *e): # <<<<<<<<<<<<<< * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_window_event(SDL_WindowEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_window_event", 1); /* "pygame_sdl2/event.pyx":225 * cdef make_window_event(SDL_WindowEvent *e): * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: */ switch (__pyx_v_e->event) { case SDL_WINDOWEVENT_ENTER: /* "pygame_sdl2/event.pyx":226 * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: * return EventType(ACTIVEEVENT, state=1, gain=1) # <<<<<<<<<<<<<< * elif e.event == SDL_WINDOWEVENT_LEAVE: * return EventType(ACTIVEEVENT, state=1, gain=0) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_1) < 0) __PYX_ERR(0, 226, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) __PYX_ERR(0, 226, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":225 * cdef make_window_event(SDL_WindowEvent *e): * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: */ break; case SDL_WINDOWEVENT_LEAVE: /* "pygame_sdl2/event.pyx":228 * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: * return EventType(ACTIVEEVENT, state=1, gain=0) # <<<<<<<<<<<<<< * * # SDL_APPINPUTFOCUS */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_1) < 0) __PYX_ERR(0, 228, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) __PYX_ERR(0, 228, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":227 * if e.event == SDL_WINDOWEVENT_ENTER: * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=0) * */ break; case SDL_WINDOWEVENT_FOCUS_GAINED: /* "pygame_sdl2/event.pyx":232 * # SDL_APPINPUTFOCUS * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: * return EventType(ACTIVEEVENT, state=2, gain=1) # <<<<<<<<<<<<<< * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: * return EventType(ACTIVEEVENT, state=2, gain=0) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_2) < 0) __PYX_ERR(0, 232, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) __PYX_ERR(0, 232, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":231 * * # SDL_APPINPUTFOCUS * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: */ break; case SDL_WINDOWEVENT_FOCUS_LOST: /* "pygame_sdl2/event.pyx":234 * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: * return EventType(ACTIVEEVENT, state=2, gain=0) # <<<<<<<<<<<<<< * * # SDL_APPACTIVE */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_2) < 0) __PYX_ERR(0, 234, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) __PYX_ERR(0, 234, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":233 * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=2, gain=0) * */ break; case SDL_WINDOWEVENT_RESTORED: /* "pygame_sdl2/event.pyx":238 * # SDL_APPACTIVE * elif e.event == SDL_WINDOWEVENT_RESTORED: * return EventType(ACTIVEEVENT, state=4, gain=1) # <<<<<<<<<<<<<< * elif e.event == SDL_WINDOWEVENT_MINIMIZED: * return EventType(ACTIVEEVENT, state=4, gain=0) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_4) < 0) __PYX_ERR(0, 238, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) __PYX_ERR(0, 238, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":237 * * # SDL_APPACTIVE * elif e.event == SDL_WINDOWEVENT_RESTORED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: */ break; case SDL_WINDOWEVENT_MINIMIZED: /* "pygame_sdl2/event.pyx":240 * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: * return EventType(ACTIVEEVENT, state=4, gain=0) # <<<<<<<<<<<<<< * * elif e.event == SDL_WINDOWEVENT_RESIZED: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_4) < 0) __PYX_ERR(0, 240, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) __PYX_ERR(0, 240, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":239 * elif e.event == SDL_WINDOWEVENT_RESTORED: * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=4, gain=0) * */ break; case SDL_WINDOWEVENT_RESIZED: /* "pygame_sdl2/event.pyx":243 * * elif e.event == SDL_WINDOWEVENT_RESIZED: * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) # <<<<<<<<<<<<<< * * elif e.event == SDL_WINDOWEVENT_EXPOSED: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_VIDEORESIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_t_6) < 0) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_w, __pyx_t_6) < 0) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_h, __pyx_t_6) < 0) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":242 * return EventType(ACTIVEEVENT, state=4, gain=0) * * elif e.event == SDL_WINDOWEVENT_RESIZED: # <<<<<<<<<<<<<< * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) * */ break; case SDL_WINDOWEVENT_EXPOSED: /* "pygame_sdl2/event.pyx":246 * * elif e.event == SDL_WINDOWEVENT_EXPOSED: * return EventType(VIDEOEXPOSE) # <<<<<<<<<<<<<< * * elif e.event == SDL_WINDOWEVENT_MOVED: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_VIDEOEXPOSE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":245 * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) * * elif e.event == SDL_WINDOWEVENT_EXPOSED: # <<<<<<<<<<<<<< * return EventType(VIDEOEXPOSE) * */ break; case SDL_WINDOWEVENT_MOVED: /* "pygame_sdl2/event.pyx":249 * * elif e.event == SDL_WINDOWEVENT_MOVED: * return EventType(WINDOWMOVED, pos=(e.data1, e.data2), x=e.data1, y=e.data2) # <<<<<<<<<<<<<< * * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_WINDOWMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pos, __pyx_t_4) < 0) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_x, __pyx_t_4) < 0) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_y, __pyx_t_4) < 0) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":248 * return EventType(VIDEOEXPOSE) * * elif e.event == SDL_WINDOWEVENT_MOVED: # <<<<<<<<<<<<<< * return EventType(WINDOWMOVED, pos=(e.data1, e.data2), x=e.data1, y=e.data2) * */ break; default: break; } /* "pygame_sdl2/event.pyx":251 * return EventType(WINDOWMOVED, pos=(e.data1, e.data2), x=e.data1, y=e.data2) * * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) # <<<<<<<<<<<<<< * * cdef make_event(SDL_Event *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->event); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_event, __pyx_t_6) < 0) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data1, __pyx_t_6) < 0) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data2, __pyx_t_6) < 0) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":223 * return EventType(e.type, file=file, window_id=e.windowID) * * cdef make_window_event(SDL_WindowEvent *e): # <<<<<<<<<<<<<< * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_window_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":253 * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) * * cdef make_event(SDL_Event *e): # <<<<<<<<<<<<<< * cdef object o * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_event(SDL_Event *__pyx_v_e) { PyObject *__pyx_v_o = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_event", 1); /* "pygame_sdl2/event.pyx":256 * cdef object o * * if e.type == SDL_MOUSEMOTION: # <<<<<<<<<<<<<< * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): */ __pyx_t_1 = (__pyx_v_e->type == SDL_MOUSEMOTION); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":257 * * if e.type == SDL_MOUSEMOTION: * return make_mousemotion_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): * return make_mousebtn_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_mousemotion_event(((SDL_MouseMotionEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":256 * cdef object o * * if e.type == SDL_MOUSEMOTION: # <<<<<<<<<<<<<< * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): */ } /* "pygame_sdl2/event.pyx":258 * if e.type == SDL_MOUSEMOTION: * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): # <<<<<<<<<<<<<< * return make_mousebtn_event(e) * */ switch (__pyx_v_e->type) { case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = __pyx_t_1; if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":259 * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): * return make_mousebtn_event(e) # <<<<<<<<<<<<<< * * elif e.type == SDL_MOUSEWHEEL: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_mousebtn_event(((SDL_MouseButtonEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":258 * if e.type == SDL_MOUSEMOTION: * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): # <<<<<<<<<<<<<< * return make_mousebtn_event(e) * */ } /* "pygame_sdl2/event.pyx":261 * return make_mousebtn_event(e) * * elif e.type == SDL_MOUSEWHEEL: # <<<<<<<<<<<<<< * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): */ __pyx_t_3 = (__pyx_v_e->type == SDL_MOUSEWHEEL); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":262 * * elif e.type == SDL_MOUSEWHEEL: * return make_mousewheel_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_mousewheel_event(((SDL_MouseWheelEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":261 * return make_mousebtn_event(e) * * elif e.type == SDL_MOUSEWHEEL: # <<<<<<<<<<<<<< * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): */ } /* "pygame_sdl2/event.pyx":263 * elif e.type == SDL_MOUSEWHEEL: * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): # <<<<<<<<<<<<<< * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: */ switch (__pyx_v_e->type) { case SDL_KEYDOWN: case SDL_KEYUP: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = __pyx_t_3; if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":264 * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_keyboard_event(((SDL_KeyboardEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":263 * elif e.type == SDL_MOUSEWHEEL: * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): # <<<<<<<<<<<<<< * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: */ } /* "pygame_sdl2/event.pyx":265 * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: # <<<<<<<<<<<<<< * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: */ __pyx_t_1 = (__pyx_v_e->type == SDL_JOYAXISMOTION); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":266 * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joyaxis_event(((SDL_JoyAxisEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":265 * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: # <<<<<<<<<<<<<< * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: */ } /* "pygame_sdl2/event.pyx":267 * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: # <<<<<<<<<<<<<< * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: */ __pyx_t_1 = (__pyx_v_e->type == SDL_JOYBALLMOTION); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":268 * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joyball_event(((SDL_JoyBallEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":267 * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: # <<<<<<<<<<<<<< * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: */ } /* "pygame_sdl2/event.pyx":269 * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: # <<<<<<<<<<<<<< * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): */ __pyx_t_1 = (__pyx_v_e->type == SDL_JOYHATMOTION); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":270 * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joyhat_event(((SDL_JoyHatEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":269 * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: # <<<<<<<<<<<<<< * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): */ } /* "pygame_sdl2/event.pyx":271 * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): # <<<<<<<<<<<<<< * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): */ switch (__pyx_v_e->type) { case SDL_JOYBUTTONDOWN: case SDL_JOYBUTTONUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = __pyx_t_1; if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":272 * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joybtn_event(((SDL_JoyButtonEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":271 * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): # <<<<<<<<<<<<<< * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): */ } /* "pygame_sdl2/event.pyx":273 * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: */ switch (__pyx_v_e->type) { case SDL_JOYDEVICEADDED: case SDL_JOYDEVICEREMOVED: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = __pyx_t_3; if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":274 * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) # <<<<<<<<<<<<<< * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->jdevice.which); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_6) < 0) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":273 * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: */ } /* "pygame_sdl2/event.pyx":275 * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: # <<<<<<<<<<<<<< * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: */ __pyx_t_1 = (__pyx_v_e->type == SDL_WINDOWEVENT); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":276 * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_make_window_event(((SDL_WindowEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":275 * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: # <<<<<<<<<<<<<< * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: */ } /* "pygame_sdl2/event.pyx":277 * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: # <<<<<<<<<<<<<< * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: */ __pyx_t_1 = (__pyx_v_e->type == SDL_TEXTINPUT); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":278 * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) # <<<<<<<<<<<<<< * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_make_textinput_event(((SDL_TextInputEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":277 * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: # <<<<<<<<<<<<<< * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: */ } /* "pygame_sdl2/event.pyx":279 * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: # <<<<<<<<<<<<<< * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: */ __pyx_t_1 = (__pyx_v_e->type == SDL_TEXTEDITING); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":280 * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) # <<<<<<<<<<<<<< * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_make_textediting_event(((SDL_TextEditingEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":279 * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: # <<<<<<<<<<<<<< * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: */ } /* "pygame_sdl2/event.pyx":281 * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): */ __pyx_t_1 = (__pyx_v_e->type == SDL_CONTROLLERAXISMOTION); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":282 * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) # <<<<<<<<<<<<<< * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->caxis.which); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_2) < 0) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->caxis.axis); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_t_2) < 0) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_e->caxis.value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_value, __pyx_t_2) < 0) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":281 * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): */ } /* "pygame_sdl2/event.pyx":283 * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): */ switch (__pyx_v_e->type) { case SDL_CONTROLLERBUTTONDOWN: case SDL_CONTROLLERBUTTONUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = __pyx_t_1; if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":284 * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) # <<<<<<<<<<<<<< * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->cbutton.which); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_6) < 0) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->cbutton.button); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_button, __pyx_t_6) < 0) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->cbutton.state); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_state, __pyx_t_6) < 0) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":283 * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): */ } /* "pygame_sdl2/event.pyx":285 * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): */ switch (__pyx_v_e->type) { case SDL_CONTROLLERDEVICEADDED: case SDL_CONTROLLERDEVICEREMOVED: case SDL_CONTROLLERDEVICEREMAPPED: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = __pyx_t_3; if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":286 * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) # <<<<<<<<<<<<<< * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->cdevice.which); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_2) < 0) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":285 * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): */ } /* "pygame_sdl2/event.pyx":287 * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: */ switch (__pyx_v_e->type) { case SDL_FINGERMOTION: case SDL_FINGERDOWN: case SDL_FINGERUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = __pyx_t_1; if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":288 * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) # <<<<<<<<<<<<<< * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_e->tfinger.touchId); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touchId, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_e->tfinger.fingerId); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fingerId, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_e->tfinger.touchId); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touch_id, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_e->tfinger.fingerId); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_finger_id, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_x, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_y, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.dx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dx, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.dy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dy, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.pressure); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pressure, __pyx_t_6) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":287 * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: */ } /* "pygame_sdl2/event.pyx":289 * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): */ __pyx_t_3 = (__pyx_v_e->type == SDL_MULTIGESTURE); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":290 * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) # <<<<<<<<<<<<<< * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): * return make_drop_event( e) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_e->mgesture.touchId); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touchId, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.dTheta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dTheta, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.dDist); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dDist, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_y, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_e->mgesture.numFingers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_numFingers, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_e->mgesture.touchId); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touch_id, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.dTheta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_rotated, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.dDist); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pinched, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_e->mgesture.numFingers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_num_fingers, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":289 * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): */ } /* "pygame_sdl2/event.pyx":291 * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): # <<<<<<<<<<<<<< * return make_drop_event( e) * elif e.type == POSTEDEVENT: */ switch (__pyx_v_e->type) { case SDL_DROPFILE: case SDL_DROPTEXT: case SDL_DROPBEGIN: case SDL_DROPCOMPLETE: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = __pyx_t_3; if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":292 * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): * return make_drop_event( e) # <<<<<<<<<<<<<< * elif e.type == POSTEDEVENT: * o = e.user.data1 */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_drop_event(((SDL_DropEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":291 * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): # <<<<<<<<<<<<<< * return make_drop_event( e) * elif e.type == POSTEDEVENT: */ } /* "pygame_sdl2/event.pyx":293 * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): * return make_drop_event( e) * elif e.type == POSTEDEVENT: # <<<<<<<<<<<<<< * o = e.user.data1 * Py_DECREF(o) */ __pyx_t_1 = (__pyx_v_e->type == __pyx_v_11pygame_sdl2_5event_POSTEDEVENT); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":294 * return make_drop_event( e) * elif e.type == POSTEDEVENT: * o = e.user.data1 # <<<<<<<<<<<<<< * Py_DECREF(o) * return o */ __pyx_t_2 = ((PyObject *)__pyx_v_e->user.data1); __Pyx_INCREF(__pyx_t_2); __pyx_v_o = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":295 * elif e.type == POSTEDEVENT: * o = e.user.data1 * Py_DECREF(o) # <<<<<<<<<<<<<< * return o * elif e.type >= SDL_USEREVENT: */ Py_DECREF(__pyx_v_o); /* "pygame_sdl2/event.pyx":296 * o = e.user.data1 * Py_DECREF(o) * return o # <<<<<<<<<<<<<< * elif e.type >= SDL_USEREVENT: * # Can't do anything useful with data1 and data2 here. */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_o); __pyx_r = __pyx_v_o; goto __pyx_L0; /* "pygame_sdl2/event.pyx":293 * elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): * return make_drop_event( e) * elif e.type == POSTEDEVENT: # <<<<<<<<<<<<<< * o = e.user.data1 * Py_DECREF(o) */ } /* "pygame_sdl2/event.pyx":297 * Py_DECREF(o) * return o * elif e.type >= SDL_USEREVENT: # <<<<<<<<<<<<<< * # Can't do anything useful with data1 and data2 here. * return EventType(e.type, code=e.user.code) */ __pyx_t_1 = (__pyx_v_e->type >= SDL_USEREVENT); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":299 * elif e.type >= SDL_USEREVENT: * # Can't do anything useful with data1 and data2 here. * return EventType(e.type, code=e.user.code) # <<<<<<<<<<<<<< * * return EventType(e.type) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->user.code); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code, __pyx_t_6) < 0) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":297 * Py_DECREF(o) * return o * elif e.type >= SDL_USEREVENT: # <<<<<<<<<<<<<< * # Can't do anything useful with data1 and data2 here. * return EventType(e.type, code=e.user.code) */ } /* "pygame_sdl2/event.pyx":301 * return EventType(e.type, code=e.user.code) * * return EventType(e.type) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":253 * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) * * cdef make_event(SDL_Event *e): # <<<<<<<<<<<<<< * cdef object o * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":314 * * * cdef bint has_event(kinds): # <<<<<<<<<<<<<< * """ * Returns true if at least one event in the queue has a type in `kinds`, */ static int __pyx_f_11pygame_sdl2_5event_has_event(PyObject *__pyx_v_kinds) { PyObject *__pyx_v_i = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_event", 1); /* "pygame_sdl2/event.pyx":322 * """ * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * return True */ if (likely(PyList_CheckExact(event_queue)) || PyTuple_CheckExact(event_queue)) { __pyx_t_1 = event_queue; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(event_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 322, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 322, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 322, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 322, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 322, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":323 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * return True * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_type_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_kinds, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { /* "pygame_sdl2/event.pyx":324 * for i in event_queue: * if i._type in kinds: * return True # <<<<<<<<<<<<<< * * */ __pyx_r = 1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":323 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * return True * */ } /* "pygame_sdl2/event.pyx":322 * """ * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * return True */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":314 * * * cdef bint has_event(kinds): # <<<<<<<<<<<<<< * """ * Returns true if at least one event in the queue has a type in `kinds`, */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.has_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":327 * * * cdef object get_events(kinds): # <<<<<<<<<<<<<< * """ * Returns a list containing all events in the event queue with type `kinds`. */ static PyObject *__pyx_f_11pygame_sdl2_5event_get_events(PyObject *__pyx_v_kinds) { PyObject *__pyx_v_rv = 0; PyObject *__pyx_v_new_queue = 0; PyObject *__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_events", 0); __Pyx_INCREF(__pyx_v_kinds); /* "pygame_sdl2/event.pyx":335 * """ * * if isinstance(kinds, int): # <<<<<<<<<<<<<< * kinds = [ kinds ] * */ __pyx_t_1 = PyInt_Check(__pyx_v_kinds); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":336 * * if isinstance(kinds, int): * kinds = [ kinds ] # <<<<<<<<<<<<<< * * global event_queue */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_kinds); __Pyx_GIVEREF(__pyx_v_kinds); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_kinds)) __PYX_ERR(0, 336, __pyx_L1_error); __Pyx_DECREF_SET(__pyx_v_kinds, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":335 * """ * * if isinstance(kinds, int): # <<<<<<<<<<<<<< * kinds = [ kinds ] * */ } /* "pygame_sdl2/event.pyx":340 * global event_queue * * cdef list rv = [ ] # <<<<<<<<<<<<<< * cdef list new_queue = [ ] * */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_rv = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":341 * * cdef list rv = [ ] * cdef list new_queue = [ ] # <<<<<<<<<<<<<< * * for i in event_queue: */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_new_queue = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":343 * cdef list new_queue = [ ] * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * rv.append(i) */ if (likely(PyList_CheckExact(event_queue)) || PyTuple_CheckExact(event_queue)) { __pyx_t_2 = event_queue; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(event_queue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 343, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":344 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * rv.append(i) * else: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_type_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_v_kinds, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":345 * for i in event_queue: * if i._type in kinds: * rv.append(i) # <<<<<<<<<<<<<< * else: * new_queue.append(i) */ __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 345, __pyx_L1_error) /* "pygame_sdl2/event.pyx":344 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * rv.append(i) * else: */ goto __pyx_L6; } /* "pygame_sdl2/event.pyx":347 * rv.append(i) * else: * new_queue.append(i) # <<<<<<<<<<<<<< * * event_queue = new_queue */ /*else*/ { __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_new_queue, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 347, __pyx_L1_error) } __pyx_L6:; /* "pygame_sdl2/event.pyx":343 * cdef list new_queue = [ ] * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * rv.append(i) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":349 * new_queue.append(i) * * event_queue = new_queue # <<<<<<<<<<<<<< * * return rv */ __Pyx_INCREF(__pyx_v_new_queue); __Pyx_XGOTREF(event_queue); __Pyx_DECREF_SET(event_queue, __pyx_v_new_queue); __Pyx_GIVEREF(__pyx_v_new_queue); /* "pygame_sdl2/event.pyx":351 * event_queue = new_queue * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/event.pyx":327 * * * cdef object get_events(kinds): # <<<<<<<<<<<<<< * """ * Returns a list containing all events in the event queue with type `kinds`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.get_events", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_new_queue); __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_kinds); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":354 * * * cdef int poll_sdl() except 1: # <<<<<<<<<<<<<< * """ * Polls SDL for pending events, and places those events onto the event q */ static int __pyx_f_11pygame_sdl2_5event_poll_sdl(void) { SDL_Event __pyx_v_evt; PyObject *__pyx_v_e = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("poll_sdl", 1); /* "pygame_sdl2/event.pyx":362 * cdef SDL_Event evt * * with lock: # <<<<<<<<<<<<<< * while SDL_PollEvent(&evt): * e = make_event(&evt) */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/event.pyx":363 * * with lock: * while SDL_PollEvent(&evt): # <<<<<<<<<<<<<< * e = make_event(&evt) * e.timestamp = evt.common.timestamp */ while (1) { __pyx_t_10 = (SDL_PollEvent((&__pyx_v_evt)) != 0); if (!__pyx_t_10) break; /* "pygame_sdl2/event.pyx":364 * with lock: * while SDL_PollEvent(&evt): * e = make_event(&evt) # <<<<<<<<<<<<<< * e.timestamp = evt.common.timestamp * event_queue.append(e) */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5event_make_event((&__pyx_v_evt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":365 * while SDL_PollEvent(&evt): * e = make_event(&evt) * e.timestamp = evt.common.timestamp # <<<<<<<<<<<<<< * event_queue.append(e) * */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_evt.common.timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_e, __pyx_n_s_timestamp, __pyx_t_1) < 0) __PYX_ERR(0, 365, __pyx_L7_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":366 * e = make_event(&evt) * e.timestamp = evt.common.timestamp * event_queue.append(e) # <<<<<<<<<<<<<< * * return 0 */ __pyx_t_11 = __Pyx_PyObject_Append(event_queue, __pyx_v_e); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 366, __pyx_L7_error) } /* "pygame_sdl2/event.pyx":362 * cdef SDL_Event evt * * with lock: # <<<<<<<<<<<<<< * while SDL_PollEvent(&evt): * e = make_event(&evt) */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.poll_sdl", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 362, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 362, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_10 < 0) __PYX_ERR(0, 362, __pyx_L9_except_error) __pyx_t_13 = (!__pyx_t_10); if (unlikely(__pyx_t_13)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 362, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L12_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L18; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L18:; } /* "pygame_sdl2/event.pyx":368 * event_queue.append(e) * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":354 * * * cdef int poll_sdl() except 1: # <<<<<<<<<<<<<< * """ * Polls SDL for pending events, and places those events onto the event q */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.poll_sdl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":371 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_1pump(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_pump, "pump()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_1pump = {"pump", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_1pump, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_pump}; static PyObject *__pyx_pw_11pygame_sdl2_5event_1pump(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pump (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_pump(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_pump(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pump", 1); /* "pygame_sdl2/event.pyx":372 * * def pump(): * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/event.pyx":373 * def pump(): * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * */ __pyx_t_10 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_10 == ((int)1))) __PYX_ERR(0, 373, __pyx_L7_error) /* "pygame_sdl2/event.pyx":372 * * def pump(): * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.pump", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 372, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 372, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 372, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_12 < 0) __PYX_ERR(0, 372, __pyx_L9_except_error) __pyx_t_13 = (!__pyx_t_12); if (unlikely(__pyx_t_13)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 372, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L12_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L16; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L16:; } /* "pygame_sdl2/event.pyx":371 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.pump", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":376 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_3get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_2get, "get(t=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_3get = {"get", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_3get, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_2get}; static PyObject *__pyx_pw_11pygame_sdl2_5event_3get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 376, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get") < 0)) __PYX_ERR(0, 376, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 376, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_2get(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get", 1); /* "pygame_sdl2/event.pyx":380 * global event_queue * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/event.pyx":381 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if t is None: */ __pyx_t_10 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_10 == ((int)1))) __PYX_ERR(0, 381, __pyx_L7_error) /* "pygame_sdl2/event.pyx":383 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * rv = event_queue * event_queue = [ ] */ __pyx_t_11 = (__pyx_v_t == Py_None); if (__pyx_t_11) { /* "pygame_sdl2/event.pyx":384 * * if t is None: * rv = event_queue # <<<<<<<<<<<<<< * event_queue = [ ] * */ __Pyx_INCREF(event_queue); __pyx_v_rv = event_queue; /* "pygame_sdl2/event.pyx":385 * if t is None: * rv = event_queue * event_queue = [ ] # <<<<<<<<<<<<<< * * elif isinstance(t, int): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(event_queue); __Pyx_DECREF_SET(event_queue, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":383 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * rv = event_queue * event_queue = [ ] */ goto __pyx_L13; } /* "pygame_sdl2/event.pyx":387 * event_queue = [ ] * * elif isinstance(t, int): # <<<<<<<<<<<<<< * rv = get_events(( t, )) * */ __pyx_t_11 = PyInt_Check(__pyx_v_t); if (__pyx_t_11) { /* "pygame_sdl2/event.pyx":388 * * elif isinstance(t, int): * rv = get_events(( t, )) # <<<<<<<<<<<<<< * * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_t)) __PYX_ERR(0, 388, __pyx_L7_error); __pyx_t_3 = __pyx_f_11pygame_sdl2_5event_get_events(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_rv = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":387 * event_queue = [ ] * * elif isinstance(t, int): # <<<<<<<<<<<<<< * rv = get_events(( t, )) * */ goto __pyx_L13; } /* "pygame_sdl2/event.pyx":391 * * else: * rv = get_events(t) # <<<<<<<<<<<<<< * * return rv */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_5event_get_events(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L13:; /* "pygame_sdl2/event.pyx":380 * global event_queue * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.get", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 380, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 380, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_11 < 0) __PYX_ERR(0, 380, __pyx_L9_except_error) __pyx_t_13 = (!__pyx_t_11); if (unlikely(__pyx_t_13)) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 380, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L12_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L17; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L17:; } /* "pygame_sdl2/event.pyx":393 * rv = get_events(t) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_v_rv)) { __Pyx_RaiseUnboundLocalError("rv"); __PYX_ERR(0, 393, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/event.pyx":376 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":396 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_5poll(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_4poll, "poll()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_5poll = {"poll", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_5poll, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_4poll}; static PyObject *__pyx_pw_11pygame_sdl2_5event_5poll(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("poll (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_4poll(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_4poll(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("poll", 1); /* "pygame_sdl2/event.pyx":398 * def poll(): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/event.pyx":399 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if event_queue: */ __pyx_t_10 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_10 == ((int)1))) __PYX_ERR(0, 399, __pyx_L7_error) /* "pygame_sdl2/event.pyx":401 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ __pyx_t_11 = __Pyx_PyObject_IsTrue(event_queue); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 401, __pyx_L7_error) if (__pyx_t_11) { /* "pygame_sdl2/event.pyx":402 * * if event_queue: * return event_queue.pop(0) # <<<<<<<<<<<<<< * * return NOEVENT_EVENT */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_PopIndex(event_queue, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":401 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ } /* "pygame_sdl2/event.pyx":404 * return event_queue.pop(0) * * return NOEVENT_EVENT # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NOEVENT_EVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":398 * def poll(): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.poll", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 398, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 398, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_11 < 0) __PYX_ERR(0, 398, __pyx_L9_except_error) __pyx_t_13 = (!__pyx_t_11); if (unlikely(__pyx_t_13)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 398, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_9 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L17; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L17:; } /* "pygame_sdl2/event.pyx":396 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.poll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":407 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_7wait(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_6wait, "wait()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_7wait = {"wait", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_7wait, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_6wait}; static PyObject *__pyx_pw_11pygame_sdl2_5event_7wait(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wait (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_6wait(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_6wait(CYTHON_UNUSED PyObject *__pyx_self) { SDL_Event __pyx_v_evt; int __pyx_v_result; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("wait", 1); /* "pygame_sdl2/event.pyx":412 * cdef int result * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/event.pyx":413 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if event_queue: */ __pyx_t_10 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_10 == ((int)1))) __PYX_ERR(0, 413, __pyx_L7_error) /* "pygame_sdl2/event.pyx":415 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ __pyx_t_11 = __Pyx_PyObject_IsTrue(event_queue); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 415, __pyx_L7_error) if (__pyx_t_11) { /* "pygame_sdl2/event.pyx":416 * * if event_queue: * return event_queue.pop(0) # <<<<<<<<<<<<<< * * with nogil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_PopIndex(event_queue, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":415 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ } /* "pygame_sdl2/event.pyx":412 * cdef int result * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 412, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 412, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_11 < 0) __PYX_ERR(0, 412, __pyx_L9_except_error) __pyx_t_13 = (!__pyx_t_11); if (unlikely(__pyx_t_13)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 412, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L12_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_9 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L17; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L17:; } /* "pygame_sdl2/event.pyx":418 * return event_queue.pop(0) * * with nogil: # <<<<<<<<<<<<<< * result = SDL_WaitEvent(&evt) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/event.pyx":419 * * with nogil: * result = SDL_WaitEvent(&evt) # <<<<<<<<<<<<<< * * if result: */ __pyx_v_result = SDL_WaitEvent((&__pyx_v_evt)); } /* "pygame_sdl2/event.pyx":418 * return event_queue.pop(0) * * with nogil: # <<<<<<<<<<<<<< * result = SDL_WaitEvent(&evt) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L20; } __pyx_L20:; } } /* "pygame_sdl2/event.pyx":421 * result = SDL_WaitEvent(&evt) * * if result: # <<<<<<<<<<<<<< * return make_event(&evt) * else: */ __pyx_t_13 = (__pyx_v_result != 0); if (__pyx_t_13) { /* "pygame_sdl2/event.pyx":422 * * if result: * return make_event(&evt) # <<<<<<<<<<<<<< * else: * return NOEVENT_EVENT */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_11pygame_sdl2_5event_make_event((&__pyx_v_evt)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":421 * result = SDL_WaitEvent(&evt) * * if result: # <<<<<<<<<<<<<< * return make_event(&evt) * else: */ } /* "pygame_sdl2/event.pyx":424 * return make_event(&evt) * else: * return NOEVENT_EVENT # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NOEVENT_EVENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/event.pyx":407 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":427 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9peek(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_8peek, "peek(t=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9peek = {"peek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_9peek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_8peek}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9peek(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("peek (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "peek") < 0)) __PYX_ERR(0, 427, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("peek", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 427, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_8peek(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_8peek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; Py_ssize_t __pyx_t_12; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("peek", 1); /* "pygame_sdl2/event.pyx":429 * def peek(t=None): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/event.pyx":430 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if t is None: */ __pyx_t_10 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_10 == ((int)1))) __PYX_ERR(0, 430, __pyx_L7_error) /* "pygame_sdl2/event.pyx":432 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * return len(event_queue) != 0 * elif isinstance(t, int): */ __pyx_t_11 = (__pyx_v_t == Py_None); if (__pyx_t_11) { /* "pygame_sdl2/event.pyx":433 * * if t is None: * return len(event_queue) != 0 # <<<<<<<<<<<<<< * elif isinstance(t, int): * return has_event(( t, )) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = event_queue; __Pyx_INCREF(__pyx_t_1); __pyx_t_12 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 433, __pyx_L7_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_t_12 != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":432 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * return len(event_queue) != 0 * elif isinstance(t, int): */ } /* "pygame_sdl2/event.pyx":434 * if t is None: * return len(event_queue) != 0 * elif isinstance(t, int): # <<<<<<<<<<<<<< * return has_event(( t, )) * else: */ __pyx_t_11 = PyInt_Check(__pyx_v_t); if (__pyx_t_11) { /* "pygame_sdl2/event.pyx":435 * return len(event_queue) != 0 * elif isinstance(t, int): * return has_event(( t, )) # <<<<<<<<<<<<<< * else: * return has_event(t) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_t)) __PYX_ERR(0, 435, __pyx_L7_error); __pyx_t_11 = __pyx_f_11pygame_sdl2_5event_has_event(__pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L7_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":434 * if t is None: * return len(event_queue) != 0 * elif isinstance(t, int): # <<<<<<<<<<<<<< * return has_event(( t, )) * else: */ } /* "pygame_sdl2/event.pyx":437 * return has_event(( t, )) * else: * return has_event(t) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_11 = __pyx_f_11pygame_sdl2_5event_has_event(__pyx_v_t); if (unlikely(__pyx_t_11 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L7_error) __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; } /* "pygame_sdl2/event.pyx":429 * def peek(t=None): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 429, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 429, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_11 < 0) __PYX_ERR(0, 429, __pyx_L9_except_error) __pyx_t_14 = (!__pyx_t_11); if (unlikely(__pyx_t_14)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 429, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_9 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L17; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L17:; } /* "pygame_sdl2/event.pyx":427 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":440 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_11clear(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_10clear, "clear(t=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_11clear = {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_11clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_10clear}; static PyObject *__pyx_pw_11pygame_sdl2_5event_11clear(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clear") < 0)) __PYX_ERR(0, 440, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clear", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 440, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_10clear(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_10clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear", 1); /* "pygame_sdl2/event.pyx":443 * * # Clear is implemented in terms of get. * get(t) # <<<<<<<<<<<<<< * * def get_standard_events(): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_t}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":440 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.event.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":445 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_13get_standard_events(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_12get_standard_events, "get_standard_events()\n\n Returns a list of standard events that pygame_sdl2 knows about.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_13get_standard_events = {"get_standard_events", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_13get_standard_events, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_12get_standard_events}; static PyObject *__pyx_pw_11pygame_sdl2_5event_13get_standard_events(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_standard_events (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_12get_standard_events(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_12get_standard_events(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_7genexpr__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_standard_events", 1); /* "pygame_sdl2/event.pyx":450 * """ * * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] # <<<<<<<<<<<<<< * * def event_name(t): */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_event_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_t_6 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); __PYX_ERR(0, 450, __pyx_L5_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_7, NULL, NULL, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_i, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyObject_RichCompare(__pyx_7genexpr__pyx_v_i, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L9_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_USEREVENT_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_RichCompare(__pyx_7genexpr__pyx_v_i, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 450, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L9_bool_binop_done:; if (__pyx_t_9) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_i))) __PYX_ERR(0, 450, __pyx_L5_error) } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __pyx_7genexpr__pyx_v_i = 0; goto __pyx_L11_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __pyx_7genexpr__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L11_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":445 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.get_standard_events", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":452 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_15event_name(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_14event_name, "event_name(t)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_15event_name = {"event_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_15event_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_14event_name}; static PyObject *__pyx_pw_11pygame_sdl2_5event_15event_name(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("event_name (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "event_name") < 0)) __PYX_ERR(0, 452, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("event_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 452, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.event_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_14event_name(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_14event_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("event_name", 1); /* "pygame_sdl2/event.pyx":453 * * def event_name(t): * try: # <<<<<<<<<<<<<< * return event_names[t] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "pygame_sdl2/event.pyx":454 * def event_name(t): * try: * return event_names[t] # <<<<<<<<<<<<<< * except KeyError: * return "UNKNOWN" */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_event_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 454, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/event.pyx":453 * * def event_name(t): * try: # <<<<<<<<<<<<<< * return event_names[t] * except KeyError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":455 * try: * return event_names[t] * except KeyError: # <<<<<<<<<<<<<< * return "UNKNOWN" * */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("pygame_sdl2.event.event_name", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 455, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_7); /* "pygame_sdl2/event.pyx":456 * return event_names[t] * except KeyError: * return "UNKNOWN" # <<<<<<<<<<<<<< * * def set_blocked(t=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_UNKNOWN); __pyx_r = __pyx_n_s_UNKNOWN; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; /* "pygame_sdl2/event.pyx":453 * * def event_name(t): * try: # <<<<<<<<<<<<<< * return event_names[t] * except KeyError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "pygame_sdl2/event.pyx":452 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.event_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":458 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_17set_blocked(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_16set_blocked, "set_blocked(t=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_17set_blocked = {"set_blocked", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_17set_blocked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_16set_blocked}; static PyObject *__pyx_pw_11pygame_sdl2_5event_17set_blocked(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_blocked (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_blocked") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_blocked", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.set_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_16set_blocked(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_16set_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_v_et = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; Uint32 __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_blocked", 1); /* "pygame_sdl2/event.pyx":459 * * def set_blocked(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_t, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":460 * def set_blocked(t=None): * if t == None: * for et in event_names.keys(): # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, int): */ __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_event_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_t_6 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); __PYX_ERR(0, 460, __pyx_L1_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_7, NULL, NULL, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":461 * if t == None: * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) # <<<<<<<<<<<<<< * elif isinstance(t, int): * SDL_EventState(t, SDL_IGNORE) */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L1_error) (void)(SDL_EventState(__pyx_t_9, SDL_ENABLE)); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":459 * * def set_blocked(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":462 * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, int): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_IGNORE) * else: */ __pyx_t_2 = PyInt_Check(__pyx_v_t); if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":463 * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, int): * SDL_EventState(t, SDL_IGNORE) # <<<<<<<<<<<<<< * else: * for et in t: */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error) (void)(SDL_EventState(__pyx_t_9, SDL_IGNORE)); /* "pygame_sdl2/event.pyx":462 * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, int): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_IGNORE) * else: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":465 * SDL_EventState(t, SDL_IGNORE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_IGNORE) * */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_t)) || PyTuple_CheckExact(__pyx_v_t)) { __pyx_t_1 = __pyx_v_t; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_10 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 465, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 465, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 465, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 465, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 465, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_10(__pyx_t_1); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 465, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":466 * else: * for et in t: * SDL_EventState(et, SDL_IGNORE) # <<<<<<<<<<<<<< * * def set_allowed(t=None): */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L1_error) (void)(SDL_EventState(__pyx_t_9, SDL_IGNORE)); /* "pygame_sdl2/event.pyx":465 * SDL_EventState(t, SDL_IGNORE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_IGNORE) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/event.pyx":458 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.set_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_et); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":468 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_19set_allowed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_18set_allowed, "set_allowed(t=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_19set_allowed = {"set_allowed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_19set_allowed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_18set_allowed}; static PyObject *__pyx_pw_11pygame_sdl2_5event_19set_allowed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_allowed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_allowed") < 0)) __PYX_ERR(0, 468, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_allowed", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 468, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.set_allowed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_18set_allowed(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_18set_allowed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_v_et = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; Uint32 __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_allowed", 1); /* "pygame_sdl2/event.pyx":469 * * def set_allowed(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_t, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":470 * def set_allowed(t=None): * if t == None: * for et in event_names.keys(): # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, int): */ __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_event_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_t_6 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); __PYX_ERR(0, 470, __pyx_L1_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_7, NULL, NULL, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":471 * if t == None: * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) # <<<<<<<<<<<<<< * elif isinstance(t, int): * SDL_EventState(t, SDL_ENABLE) */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L1_error) (void)(SDL_EventState(__pyx_t_9, SDL_IGNORE)); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":469 * * def set_allowed(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":472 * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, int): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_ENABLE) * else: */ __pyx_t_2 = PyInt_Check(__pyx_v_t); if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":473 * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, int): * SDL_EventState(t, SDL_ENABLE) # <<<<<<<<<<<<<< * else: * for et in t: */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) (void)(SDL_EventState(__pyx_t_9, SDL_ENABLE)); /* "pygame_sdl2/event.pyx":472 * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, int): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_ENABLE) * else: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":475 * SDL_EventState(t, SDL_ENABLE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_ENABLE) * */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_t)) || PyTuple_CheckExact(__pyx_v_t)) { __pyx_t_1 = __pyx_v_t; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_10 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 475, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 475, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 475, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 475, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 475, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_10(__pyx_t_1); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 475, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":476 * else: * for et in t: * SDL_EventState(et, SDL_ENABLE) # <<<<<<<<<<<<<< * * def get_blocked(t): */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L1_error) (void)(SDL_EventState(__pyx_t_9, SDL_ENABLE)); /* "pygame_sdl2/event.pyx":475 * SDL_EventState(t, SDL_ENABLE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_ENABLE) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/event.pyx":468 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.set_allowed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_et); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":478 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_21get_blocked(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_20get_blocked, "get_blocked(t)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_21get_blocked = {"get_blocked", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_21get_blocked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_20get_blocked}; static PyObject *__pyx_pw_11pygame_sdl2_5event_21get_blocked(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_blocked (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_blocked") < 0)) __PYX_ERR(0, 478, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_blocked", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 478, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.get_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_20get_blocked(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_20get_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_blocked", 1); /* "pygame_sdl2/event.pyx":479 * * def get_blocked(t): * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE # <<<<<<<<<<<<<< * * def set_grab(on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_1 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) __pyx_t_2 = __Pyx_PyBool_FromLong((SDL_EventState(__pyx_t_1, SDL_QUERY) == SDL_IGNORE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":478 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.event.get_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":481 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_23set_grab(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_22set_grab, "set_grab(on)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_23set_grab = {"set_grab", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_23set_grab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_22set_grab}; static PyObject *__pyx_pw_11pygame_sdl2_5event_23set_grab(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_on = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_grab (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_on,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_on)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_grab") < 0)) __PYX_ERR(0, 481, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_on = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_grab", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 481, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.set_grab", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_22set_grab(__pyx_self, __pyx_v_on); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_22set_grab(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_bool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_grab", 1); /* "pygame_sdl2/event.pyx":482 * * def set_grab(on): * SDL_SetWindowGrab(main_window.window, on) # <<<<<<<<<<<<<< * * if SDL_ShowCursor(SDL_QUERY) == SDL_DISABLE: */ __pyx_t_1 = ((SDL_bool)__Pyx_PyInt_As_SDL_bool(__pyx_v_on)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 482, __pyx_L1_error) SDL_SetWindowGrab(__pyx_v_11pygame_sdl2_7display_main_window->window, __pyx_t_1); /* "pygame_sdl2/event.pyx":484 * SDL_SetWindowGrab(main_window.window, on) * * if SDL_ShowCursor(SDL_QUERY) == SDL_DISABLE: # <<<<<<<<<<<<<< * SDL_SetRelativeMouseMode(on) * */ __pyx_t_2 = (SDL_ShowCursor(SDL_QUERY) == SDL_DISABLE); if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":485 * * if SDL_ShowCursor(SDL_QUERY) == SDL_DISABLE: * SDL_SetRelativeMouseMode(on) # <<<<<<<<<<<<<< * * def get_grab(): */ __pyx_t_1 = ((SDL_bool)__Pyx_PyInt_As_SDL_bool(__pyx_v_on)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 485, __pyx_L1_error) (void)(SDL_SetRelativeMouseMode(__pyx_t_1)); /* "pygame_sdl2/event.pyx":484 * SDL_SetWindowGrab(main_window.window, on) * * if SDL_ShowCursor(SDL_QUERY) == SDL_DISABLE: # <<<<<<<<<<<<<< * SDL_SetRelativeMouseMode(on) * */ } /* "pygame_sdl2/event.pyx":481 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.event.set_grab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":487 * SDL_SetRelativeMouseMode(on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_25get_grab(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_24get_grab, "get_grab()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_25get_grab = {"get_grab", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_25get_grab, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_24get_grab}; static PyObject *__pyx_pw_11pygame_sdl2_5event_25get_grab(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_grab (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_24get_grab(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_24get_grab(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_grab", 1); /* "pygame_sdl2/event.pyx":488 * * def get_grab(): * return SDL_GetWindowGrab(main_window.window) # <<<<<<<<<<<<<< * * def set_mousewheel_buttons(flag): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_GetWindowGrab(__pyx_v_11pygame_sdl2_7display_main_window->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":487 * SDL_SetRelativeMouseMode(on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.get_grab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":490 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_27set_mousewheel_buttons(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_26set_mousewheel_buttons, "set_mousewheel_buttons(flag)\n\n If true (the default), the mousewheel will generate events involving\n mouse buttons 4 and 5, and mousebuttons 4 and higher will be mapped to 6 and higher.\n\n If false, MOUSEWHEEL events are generated, and the mousebuttons are\n not remapped.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_27set_mousewheel_buttons = {"set_mousewheel_buttons", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_27set_mousewheel_buttons, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_26set_mousewheel_buttons}; static PyObject *__pyx_pw_11pygame_sdl2_5event_27set_mousewheel_buttons(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_flag = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mousewheel_buttons (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flag)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_mousewheel_buttons") < 0)) __PYX_ERR(0, 490, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_mousewheel_buttons", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 490, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.set_mousewheel_buttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_26set_mousewheel_buttons(__pyx_self, __pyx_v_flag); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_26set_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_mousewheel_buttons", 1); /* "pygame_sdl2/event.pyx":500 * * global mousewheel_buttons * mousewheel_buttons = flag # <<<<<<<<<<<<<< * * def get_mousewheel_buttons(): */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error) __pyx_v_11pygame_sdl2_5event_mousewheel_buttons = __pyx_t_1; /* "pygame_sdl2/event.pyx":490 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.event.set_mousewheel_buttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":502 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_29get_mousewheel_buttons(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_28get_mousewheel_buttons, "get_mousewheel_buttons()\n\n Returns the value set by mousehweel buttons,.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_29get_mousewheel_buttons = {"get_mousewheel_buttons", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_29get_mousewheel_buttons, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_28get_mousewheel_buttons}; static PyObject *__pyx_pw_11pygame_sdl2_5event_29get_mousewheel_buttons(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_mousewheel_buttons (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_28get_mousewheel_buttons(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_28get_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_mousewheel_buttons", 1); /* "pygame_sdl2/event.pyx":507 * """ * * return mousewheel_buttons # <<<<<<<<<<<<<< * * def post(e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_11pygame_sdl2_5event_mousewheel_buttons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":502 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.get_mousewheel_buttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":509 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_31post(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_30post, "post(e)\n\n Posts event object `e` to the event queue.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_31post = {"post", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_31post, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_30post}; static PyObject *__pyx_pw_11pygame_sdl2_5event_31post(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_e = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("post (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_e,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_e)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "post") < 0)) __PYX_ERR(0, 509, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_e = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("post", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 509, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.post", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_30post(__pyx_self, __pyx_v_e); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_30post(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e) { SDL_Event __pyx_v_event; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("post", 1); /* "pygame_sdl2/event.pyx":516 * cdef SDL_Event event; * * if not isinstance(e, EventType): # <<<<<<<<<<<<<< * raise pygame_sdl2.error("event.post must be called with an Event.") * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_e, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/event.pyx":517 * * if not isinstance(e, EventType): * raise pygame_sdl2.error("event.post must be called with an Event.") # <<<<<<<<<<<<<< * * if get_blocked(e.type): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_event_post_must_be_called_with_a}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 517, __pyx_L1_error) /* "pygame_sdl2/event.pyx":516 * cdef SDL_Event event; * * if not isinstance(e, EventType): # <<<<<<<<<<<<<< * raise pygame_sdl2.error("event.post must be called with an Event.") * */ } /* "pygame_sdl2/event.pyx":519 * raise pygame_sdl2.error("event.post must be called with an Event.") * * if get_blocked(e.type): # <<<<<<<<<<<<<< * return * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_blocked); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":520 * * if get_blocked(e.type): * return # <<<<<<<<<<<<<< * * Py_INCREF(e) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/event.pyx":519 * raise pygame_sdl2.error("event.post must be called with an Event.") * * if get_blocked(e.type): # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/event.pyx":522 * return * * Py_INCREF(e) # <<<<<<<<<<<<<< * * event.type = POSTEDEVENT */ Py_INCREF(__pyx_v_e); /* "pygame_sdl2/event.pyx":524 * Py_INCREF(e) * * event.type = POSTEDEVENT # <<<<<<<<<<<<<< * event.user.data1 = e * */ __pyx_v_event.type = __pyx_v_11pygame_sdl2_5event_POSTEDEVENT; /* "pygame_sdl2/event.pyx":525 * * event.type = POSTEDEVENT * event.user.data1 = e # <<<<<<<<<<<<<< * * SDL_PushEvent(&event) */ __pyx_v_event.user.data1 = ((void *)__pyx_v_e); /* "pygame_sdl2/event.pyx":527 * event.user.data1 = e * * SDL_PushEvent(&event) # <<<<<<<<<<<<<< * * def register(name): */ (void)(SDL_PushEvent((&__pyx_v_event))); /* "pygame_sdl2/event.pyx":509 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.post", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":529 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_33register(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_32register, "register(name)\n\n Registers a unique event number and returns that number.\n\n `name`\n A string name for the event. This is used when calling `repr` on\n the event.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_33register = {"register", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5event_33register, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5event_32register}; static PyObject *__pyx_pw_11pygame_sdl2_5event_33register(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("register (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 529, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "register") < 0)) __PYX_ERR(0, 529, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("register", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 529, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.event.register", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_32register(__pyx_self, __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_32register(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { Uint32 __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("register", 1); /* "pygame_sdl2/event.pyx":538 * """ * * rv = SDL_RegisterEvents(1) # <<<<<<<<<<<<<< * * event_names[rv] = name */ __pyx_v_rv = SDL_RegisterEvents(1); /* "pygame_sdl2/event.pyx":540 * rv = SDL_RegisterEvents(1) * * event_names[rv] = name # <<<<<<<<<<<<<< * return rv * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_event_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((__Pyx_SetItemInt(__pyx_t_1, __pyx_v_rv, __pyx_v_name, Uint32, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 1) < 0))) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":541 * * event_names[rv] = name * return rv # <<<<<<<<<<<<<< * * def copy_event_queue(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":529 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.register", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":543 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_35copy_event_queue(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_34copy_event_queue, "copy_event_queue()\n\n Returns a copy of the event queue. The copy cannot be used for modifying\n the event queue.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_35copy_event_queue = {"copy_event_queue", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_35copy_event_queue, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_34copy_event_queue}; static PyObject *__pyx_pw_11pygame_sdl2_5event_35copy_event_queue(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_event_queue (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_34copy_event_queue(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_34copy_event_queue(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy_event_queue", 1); /* "pygame_sdl2/event.pyx":549 * """ * * return event_queue[:] # <<<<<<<<<<<<<< * * # Usually called by display.init. */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetSlice(event_queue, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":543 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.copy_event_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":552 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_37init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5event_36init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_37init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_37init, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_36init}; static PyObject *__pyx_pw_11pygame_sdl2_5event_37init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5event_36init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_36init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/event.pyx":553 * # Usually called by display.init. * def init(): * if not SDL_WasInit(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * * pygame_sdl2.display.sdl_main_init() */ __pyx_t_1 = (!(SDL_WasInit(SDL_INIT_EVENTS) != 0)); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":555 * if not SDL_WasInit(SDL_INIT_EVENTS): * * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_EVENTS): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":557 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * raise pygame_sdl2.error.error() * */ __pyx_t_1 = (SDL_InitSubSystem(SDL_INIT_EVENTS) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/event.pyx":558 * * if SDL_InitSubSystem(SDL_INIT_EVENTS): * raise pygame_sdl2.error.error() # <<<<<<<<<<<<<< * * _types = """ */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 558, __pyx_L1_error) /* "pygame_sdl2/event.pyx":557 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * raise pygame_sdl2.error.error() * */ } /* "pygame_sdl2/event.pyx":553 * # Usually called by display.init. * def init(): * if not SDL_WasInit(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * * pygame_sdl2.display.sdl_main_init() */ } /* "pygame_sdl2/event.pyx":552 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, {&__pyx_n_s_ACTIVEEVENT, __pyx_k_ACTIVEEVENT, sizeof(__pyx_k_ACTIVEEVENT), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERBACKGROUND, __pyx_k_APP_DIDENTERBACKGROUND, sizeof(__pyx_k_APP_DIDENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERFOREGROUND, __pyx_k_APP_DIDENTERFOREGROUND, sizeof(__pyx_k_APP_DIDENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_LOWMEMORY, __pyx_k_APP_LOWMEMORY, sizeof(__pyx_k_APP_LOWMEMORY), 0, 0, 1, 1}, {&__pyx_n_s_APP_TERMINATING, __pyx_k_APP_TERMINATING, sizeof(__pyx_k_APP_TERMINATING), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERBACKGROUND, __pyx_k_APP_WILLENTERBACKGROUND, sizeof(__pyx_k_APP_WILLENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERFOREGROUND, __pyx_k_APP_WILLENTERFOREGROUND, sizeof(__pyx_k_APP_WILLENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_AUDIODEVICEADDED, __pyx_k_AUDIODEVICEADDED, sizeof(__pyx_k_AUDIODEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_AUDIODEVICEREMOVED, __pyx_k_AUDIODEVICEREMOVED, sizeof(__pyx_k_AUDIODEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_CLIPBOARDUPDATE, __pyx_k_CLIPBOARDUPDATE, sizeof(__pyx_k_CLIPBOARDUPDATE), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERAXISMOTION, __pyx_k_CONTROLLERAXISMOTION, sizeof(__pyx_k_CONTROLLERAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONDOWN, __pyx_k_CONTROLLERBUTTONDOWN, sizeof(__pyx_k_CONTROLLERBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONUP, __pyx_k_CONTROLLERBUTTONUP, sizeof(__pyx_k_CONTROLLERBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEADDED, __pyx_k_CONTROLLERDEVICEADDED, sizeof(__pyx_k_CONTROLLERDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMAPPED, __pyx_k_CONTROLLERDEVICEREMAPPED, sizeof(__pyx_k_CONTROLLERDEVICEREMAPPED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMOVED, __pyx_k_CONTROLLERDEVICEREMOVED, sizeof(__pyx_k_CONTROLLERDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_DISPLAYEVENT, __pyx_k_DISPLAYEVENT, sizeof(__pyx_k_DISPLAYEVENT), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARGESTURE, __pyx_k_DOLLARGESTURE, sizeof(__pyx_k_DOLLARGESTURE), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARRECORD, __pyx_k_DOLLARRECORD, sizeof(__pyx_k_DOLLARRECORD), 0, 0, 1, 1}, {&__pyx_n_s_DROPBEGIN, __pyx_k_DROPBEGIN, sizeof(__pyx_k_DROPBEGIN), 0, 0, 1, 1}, {&__pyx_n_s_DROPCOMPLETE, __pyx_k_DROPCOMPLETE, sizeof(__pyx_k_DROPCOMPLETE), 0, 0, 1, 1}, {&__pyx_n_s_DROPFILE, __pyx_k_DROPFILE, sizeof(__pyx_k_DROPFILE), 0, 0, 1, 1}, {&__pyx_n_s_DROPTEXT, __pyx_k_DROPTEXT, sizeof(__pyx_k_DROPTEXT), 0, 0, 1, 1}, {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1}, {&__pyx_n_s_EventType, __pyx_k_EventType, sizeof(__pyx_k_EventType), 0, 0, 1, 1}, {&__pyx_n_s_EventType___eq, __pyx_k_EventType___eq, sizeof(__pyx_k_EventType___eq), 0, 0, 1, 1}, {&__pyx_n_s_EventType___init, __pyx_k_EventType___init, sizeof(__pyx_k_EventType___init), 0, 0, 1, 1}, {&__pyx_n_s_EventType___ne, __pyx_k_EventType___ne, sizeof(__pyx_k_EventType___ne), 0, 0, 1, 1}, {&__pyx_n_s_EventType___nonzero, __pyx_k_EventType___nonzero, sizeof(__pyx_k_EventType___nonzero), 0, 0, 1, 1}, {&__pyx_n_s_EventType___repr, __pyx_k_EventType___repr, sizeof(__pyx_k_EventType___repr), 0, 0, 1, 1}, {&__pyx_n_s_EventType_dict, __pyx_k_EventType_dict, sizeof(__pyx_k_EventType_dict), 0, 0, 1, 1}, {&__pyx_n_s_EventType_type, __pyx_k_EventType_type, sizeof(__pyx_k_EventType_type), 0, 0, 1, 1}, {&__pyx_kp_s_Event_EventType, __pyx_k_Event_EventType, sizeof(__pyx_k_Event_EventType), 0, 0, 1, 0}, {&__pyx_kp_s_Event_d_s_s, __pyx_k_Event_d_s_s, sizeof(__pyx_k_Event_d_s_s), 0, 0, 1, 0}, {&__pyx_n_s_FINGERDOWN, __pyx_k_FINGERDOWN, sizeof(__pyx_k_FINGERDOWN), 0, 0, 1, 1}, {&__pyx_n_s_FINGERMOTION, __pyx_k_FINGERMOTION, sizeof(__pyx_k_FINGERMOTION), 0, 0, 1, 1}, {&__pyx_n_s_FINGERUP, __pyx_k_FINGERUP, sizeof(__pyx_k_FINGERUP), 0, 0, 1, 1}, {&__pyx_n_s_JOYAXISMOTION, __pyx_k_JOYAXISMOTION, sizeof(__pyx_k_JOYAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBALLMOTION, __pyx_k_JOYBALLMOTION, sizeof(__pyx_k_JOYBALLMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONDOWN, __pyx_k_JOYBUTTONDOWN, sizeof(__pyx_k_JOYBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONUP, __pyx_k_JOYBUTTONUP, sizeof(__pyx_k_JOYBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEADDED, __pyx_k_JOYDEVICEADDED, sizeof(__pyx_k_JOYDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEREMOVED, __pyx_k_JOYDEVICEREMOVED, sizeof(__pyx_k_JOYDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_JOYHATMOTION, __pyx_k_JOYHATMOTION, sizeof(__pyx_k_JOYHATMOTION), 0, 0, 1, 1}, {&__pyx_n_s_KEYDOWN, __pyx_k_KEYDOWN, sizeof(__pyx_k_KEYDOWN), 0, 0, 1, 1}, {&__pyx_n_s_KEYMAPCHANGED, __pyx_k_KEYMAPCHANGED, sizeof(__pyx_k_KEYMAPCHANGED), 0, 0, 1, 1}, {&__pyx_n_s_KEYUP, __pyx_k_KEYUP, sizeof(__pyx_k_KEYUP), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_s_LASTEVENT, __pyx_k_LASTEVENT, sizeof(__pyx_k_LASTEVENT), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONDOWN, __pyx_k_MOUSEBUTTONDOWN, sizeof(__pyx_k_MOUSEBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONUP, __pyx_k_MOUSEBUTTONUP, sizeof(__pyx_k_MOUSEBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEMOTION, __pyx_k_MOUSEMOTION, sizeof(__pyx_k_MOUSEMOTION), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEWHEEL, __pyx_k_MOUSEWHEEL, sizeof(__pyx_k_MOUSEWHEEL), 0, 0, 1, 1}, {&__pyx_n_s_MULTIGESTURE, __pyx_k_MULTIGESTURE, sizeof(__pyx_k_MULTIGESTURE), 0, 0, 1, 1}, {&__pyx_n_u_NOEVENT, __pyx_k_NOEVENT, sizeof(__pyx_k_NOEVENT), 0, 1, 0, 1}, {&__pyx_n_s_NOEVENT_EVENT, __pyx_k_NOEVENT_EVENT, sizeof(__pyx_k_NOEVENT_EVENT), 0, 0, 1, 1}, {&__pyx_n_s_QUIT, __pyx_k_QUIT, sizeof(__pyx_k_QUIT), 0, 0, 1, 1}, {&__pyx_n_s_RENDER_DEVICE_RESET, __pyx_k_RENDER_DEVICE_RESET, sizeof(__pyx_k_RENDER_DEVICE_RESET), 0, 0, 1, 1}, {&__pyx_n_s_RENDER_TARGETS_RESET, __pyx_k_RENDER_TARGETS_RESET, sizeof(__pyx_k_RENDER_TARGETS_RESET), 0, 0, 1, 1}, {&__pyx_n_s_RLock, __pyx_k_RLock, sizeof(__pyx_k_RLock), 0, 0, 1, 1}, {&__pyx_n_s_SENSORUPDATE, __pyx_k_SENSORUPDATE, sizeof(__pyx_k_SENSORUPDATE), 0, 0, 1, 1}, {&__pyx_n_s_SYSWMEVENT, __pyx_k_SYSWMEVENT, sizeof(__pyx_k_SYSWMEVENT), 0, 0, 1, 1}, {&__pyx_n_s_TEXTEDITING, __pyx_k_TEXTEDITING, sizeof(__pyx_k_TEXTEDITING), 0, 0, 1, 1}, {&__pyx_n_s_TEXTINPUT, __pyx_k_TEXTINPUT, sizeof(__pyx_k_TEXTINPUT), 0, 0, 1, 1}, {&__pyx_n_s_UNKNOWN, __pyx_k_UNKNOWN, sizeof(__pyx_k_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_USEREVENT, __pyx_k_USEREVENT, sizeof(__pyx_k_USEREVENT), 0, 0, 1, 1}, {&__pyx_n_s_USEREVENT_MAX, __pyx_k_USEREVENT_MAX, sizeof(__pyx_k_USEREVENT_MAX), 0, 0, 1, 1}, {&__pyx_n_s_UnicodeDecodeError, __pyx_k_UnicodeDecodeError, sizeof(__pyx_k_UnicodeDecodeError), 0, 0, 1, 1}, {&__pyx_kp_s_UserEvent_d, __pyx_k_UserEvent_d, sizeof(__pyx_k_UserEvent_d), 0, 0, 1, 0}, {&__pyx_n_s_VIDEOEXPOSE, __pyx_k_VIDEOEXPOSE, sizeof(__pyx_k_VIDEOEXPOSE), 0, 0, 1, 1}, {&__pyx_n_s_VIDEORESIZE, __pyx_k_VIDEORESIZE, sizeof(__pyx_k_VIDEORESIZE), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWEVENT, __pyx_k_WINDOWEVENT, sizeof(__pyx_k_WINDOWEVENT), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWMOVED, __pyx_k_WINDOWMOVED, sizeof(__pyx_k_WINDOWMOVED), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s__49, __pyx_k__49, sizeof(__pyx_k__49), 0, 0, 1, 1}, {&__pyx_n_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, {&__pyx_n_s_ball, __pyx_k_ball, sizeof(__pyx_k_ball), 0, 0, 1, 1}, {&__pyx_n_s_button, __pyx_k_button, sizeof(__pyx_k_button), 0, 0, 1, 1}, {&__pyx_n_s_buttons, __pyx_k_buttons, sizeof(__pyx_k_buttons), 0, 0, 1, 1}, {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1}, {&__pyx_n_s_copy_event_queue, __pyx_k_copy_event_queue, sizeof(__pyx_k_copy_event_queue), 0, 0, 1, 1}, {&__pyx_n_s_dDist, __pyx_k_dDist, sizeof(__pyx_k_dDist), 0, 0, 1, 1}, {&__pyx_n_s_dTheta, __pyx_k_dTheta, sizeof(__pyx_k_dTheta), 0, 0, 1, 1}, {&__pyx_n_s_data1, __pyx_k_data1, sizeof(__pyx_k_data1), 0, 0, 1, 1}, {&__pyx_n_s_data2, __pyx_k_data2, sizeof(__pyx_k_data2), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1}, {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_ename, __pyx_k_ename, sizeof(__pyx_k_ename), 0, 0, 1, 1}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_et, __pyx_k_et, sizeof(__pyx_k_et), 0, 0, 1, 1}, {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, {&__pyx_n_s_event_name, __pyx_k_event_name, sizeof(__pyx_k_event_name), 0, 0, 1, 1}, {&__pyx_n_s_event_names, __pyx_k_event_names, sizeof(__pyx_k_event_names), 0, 0, 1, 1}, {&__pyx_kp_s_event_post_must_be_called_with_a, __pyx_k_event_post_must_be_called_with_a, sizeof(__pyx_k_event_post_must_be_called_with_a), 0, 0, 1, 0}, {&__pyx_n_s_evt, __pyx_k_evt, sizeof(__pyx_k_evt), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_fingerId, __pyx_k_fingerId, sizeof(__pyx_k_fingerId), 0, 0, 1, 1}, {&__pyx_n_s_finger_id, __pyx_k_finger_id, sizeof(__pyx_k_finger_id), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_gain, __pyx_k_gain, sizeof(__pyx_k_gain), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_blocked, __pyx_k_get_blocked, sizeof(__pyx_k_get_blocked), 0, 0, 1, 1}, {&__pyx_n_s_get_grab, __pyx_k_get_grab, sizeof(__pyx_k_get_grab), 0, 0, 1, 1}, {&__pyx_n_s_get_mousewheel_buttons, __pyx_k_get_mousewheel_buttons, sizeof(__pyx_k_get_mousewheel_buttons), 0, 0, 1, 1}, {&__pyx_n_s_get_standard_events, __pyx_k_get_standard_events, sizeof(__pyx_k_get_standard_events), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_hat, __pyx_k_hat, sizeof(__pyx_k_hat), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, {&__pyx_n_s_instance_id, __pyx_k_instance_id, sizeof(__pyx_k_instance_id), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_joy, __pyx_k_joy, sizeof(__pyx_k_joy), 0, 0, 1, 1}, {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_mod, __pyx_k_mod, sizeof(__pyx_k_mod), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1}, {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1}, {&__pyx_n_s_numFingers, __pyx_k_numFingers, sizeof(__pyx_k_numFingers), 0, 0, 1, 1}, {&__pyx_n_s_num_fingers, __pyx_k_num_fingers, sizeof(__pyx_k_num_fingers), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_on, __pyx_k_on, sizeof(__pyx_k_on), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_peek, __pyx_k_peek, sizeof(__pyx_k_peek), 0, 0, 1, 1}, {&__pyx_n_s_pinched, __pyx_k_pinched, sizeof(__pyx_k_pinched), 0, 0, 1, 1}, {&__pyx_n_s_poll, __pyx_k_poll, sizeof(__pyx_k_poll), 0, 0, 1, 1}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_post, __pyx_k_post, sizeof(__pyx_k_post), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pressure, __pyx_k_pressure, sizeof(__pyx_k_pressure), 0, 0, 1, 1}, {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_pump, __pyx_k_pump, sizeof(__pyx_k_pump), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_event, __pyx_k_pygame_sdl2_event, sizeof(__pyx_k_pygame_sdl2_event), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1}, {&__pyx_n_s_rel, __pyx_k_rel, sizeof(__pyx_k_rel), 0, 0, 1, 1}, {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_rest, __pyx_k_rest, sizeof(__pyx_k_rest), 0, 0, 1, 1}, {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_rotated, __pyx_k_rotated, sizeof(__pyx_k_rotated), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_kp_s_s_r, __pyx_k_s_r, sizeof(__pyx_k_s_r), 0, 0, 1, 0}, {&__pyx_n_s_scancode, __pyx_k_scancode, sizeof(__pyx_k_scancode), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_allowed, __pyx_k_set_allowed, sizeof(__pyx_k_set_allowed), 0, 0, 1, 1}, {&__pyx_n_s_set_blocked, __pyx_k_set_blocked, sizeof(__pyx_k_set_blocked), 0, 0, 1, 1}, {&__pyx_n_s_set_grab, __pyx_k_set_grab, sizeof(__pyx_k_set_grab), 0, 0, 1, 1}, {&__pyx_n_s_set_mousewheel_buttons, __pyx_k_set_mousewheel_buttons, sizeof(__pyx_k_set_mousewheel_buttons), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_k_src_pygame_sdl2_event_pyx, sizeof(__pyx_k_src_pygame_sdl2_event_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_n_s_text_input, __pyx_k_text_input, sizeof(__pyx_k_text_input), 0, 0, 1, 1}, {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1}, {&__pyx_n_s_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 0, 1, 1}, {&__pyx_n_s_touch, __pyx_k_touch, sizeof(__pyx_k_touch), 0, 0, 1, 1}, {&__pyx_n_s_touchId, __pyx_k_touchId, sizeof(__pyx_k_touchId), 0, 0, 1, 1}, {&__pyx_n_s_touch_id, __pyx_k_touch_id, sizeof(__pyx_k_touch_id), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 0, 1, 1}, {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, {&__pyx_n_s_unichr, __pyx_k_unichr, sizeof(__pyx_k_unichr), 0, 0, 1, 1}, {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, {&__pyx_n_s_which, __pyx_k_which, sizeof(__pyx_k_which), 0, 0, 1, 1}, {&__pyx_n_s_window_id, __pyx_k_window_id, sizeof(__pyx_k_window_id), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 29, __pyx_L1_error) __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 61, __pyx_L1_error) __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 90, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(0, 205, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/event.pyx":362 * cdef SDL_Event evt * * with lock: # <<<<<<<<<<<<<< * while SDL_PollEvent(&evt): * e = make_event(&evt) */ __pyx_tuple__3 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/event.pyx":549 * """ * * return event_queue[:] # <<<<<<<<<<<<<< * * # Usually called by display.init. */ __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__4); __Pyx_GIVEREF(__pyx_slice__4); /* "pygame_sdl2/event.pyx":61 * SDL_TOUCH_MOUSEID = -1 * * class EventType(object): # <<<<<<<<<<<<<< * * def __init__(self, type, dict=None, **kwargs): */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_tuple__7 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/event.pyx":63 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ __pyx_tuple__8 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_type, __pyx_n_s_dict, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_init, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_tuple__10 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "pygame_sdl2/event.pyx":71 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < WINDOWMOVED: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ __pyx_tuple__11 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_ename, __pyx_n_s_rest, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_repr, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 71, __pyx_L1_error) /* "pygame_sdl2/event.pyx":90 * return '' % (self.type, ename, ", ".join(rest)) * * @property # <<<<<<<<<<<<<< * def dict(self): * return self.__dict__ */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_dict, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 90, __pyx_L1_error) /* "pygame_sdl2/event.pyx":94 * return self.__dict__ * * @property # <<<<<<<<<<<<<< * def type(self): * return self._type */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_type, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 94, __pyx_L1_error) /* "pygame_sdl2/event.pyx":98 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_eq, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 98, __pyx_L1_error) /* "pygame_sdl2/event.pyx":101 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_ne, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 101, __pyx_L1_error) /* "pygame_sdl2/event.pyx":104 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_nonzero, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 104, __pyx_L1_error) /* "pygame_sdl2/event.pyx":311 * * # This is the object that is returned when no event exists. * NOEVENT_EVENT = EventType(0) # <<<<<<<<<<<<<< * * */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); /* "pygame_sdl2/event.pyx":371 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_pump, 371, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 371, __pyx_L1_error) /* "pygame_sdl2/event.pyx":376 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get, 376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 376, __pyx_L1_error) /* "pygame_sdl2/event.pyx":396 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_poll, 396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 396, __pyx_L1_error) /* "pygame_sdl2/event.pyx":407 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_evt, __pyx_n_s_result); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_wait, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 407, __pyx_L1_error) /* "pygame_sdl2/event.pyx":427 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_peek, 427, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 427, __pyx_L1_error) /* "pygame_sdl2/event.pyx":440 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_clear, 440, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 440, __pyx_L1_error) /* "pygame_sdl2/event.pyx":445 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_i); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_standard_events, 445, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 445, __pyx_L1_error) /* "pygame_sdl2/event.pyx":452 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_event_name, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 452, __pyx_L1_error) /* "pygame_sdl2/event.pyx":458 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_et); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_blocked, 458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 458, __pyx_L1_error) /* "pygame_sdl2/event.pyx":468 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_allowed, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 468, __pyx_L1_error) /* "pygame_sdl2/event.pyx":478 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_blocked, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 478, __pyx_L1_error) /* "pygame_sdl2/event.pyx":481 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_on); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_grab, 481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 481, __pyx_L1_error) /* "pygame_sdl2/event.pyx":487 * SDL_SetRelativeMouseMode(on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_grab, 487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 487, __pyx_L1_error) /* "pygame_sdl2/event.pyx":490 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_mousewheel_buttons, 490, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 490, __pyx_L1_error) /* "pygame_sdl2/event.pyx":502 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_mousewheel_buttons, 502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 502, __pyx_L1_error) /* "pygame_sdl2/event.pyx":509 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_e, __pyx_n_s_event); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_post, 509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 509, __pyx_L1_error) /* "pygame_sdl2/event.pyx":529 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_name, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_register, 529, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 529, __pyx_L1_error) /* "pygame_sdl2/event.pyx":543 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_copy_event_queue, 543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 543, __pyx_L1_error) /* "pygame_sdl2/event.pyx":552 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_init_2, 552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ event_queue = Py_None; Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject), #else sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7display_Window),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7display_Window) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_event(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_event}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "event", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initevent(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initevent(void) #else __Pyx_PyMODINIT_FUNC PyInit_event(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_event(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_event(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'event' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("event", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "event" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_event(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__event) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.event")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.event", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_variable_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/event.pyx":24 * from sdl2 cimport * * from pygame_sdl2.display cimport Window, main_window * import threading # <<<<<<<<<<<<<< * import pygame_sdl2 * import sys */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_threading, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":25 * from pygame_sdl2.display cimport Window, main_window * import threading * import pygame_sdl2 # <<<<<<<<<<<<<< * import sys * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":26 * import threading * import pygame_sdl2 * import sys # <<<<<<<<<<<<<< * * if sys.version_info[0] >= 3: */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":28 * import sys * * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<< * unichr = chr * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":29 * * if sys.version_info[0] >= 3: * unichr = chr # <<<<<<<<<<<<<< * * include "event_names.pxi" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_unichr, __pyx_builtin_chr) < 0) __PYX_ERR(0, 29, __pyx_L1_error) /* "pygame_sdl2/event.pyx":28 * import sys * * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<< * unichr = chr * */ } /* "include/event_names.pxi":5 * * event_names = { * SDL_FIRSTEVENT : u'NOEVENT', # <<<<<<<<<<<<<< * SDL_QUIT : 'QUIT', * SDL_APP_TERMINATING : 'APP_TERMINATING', */ __pyx_t_3 = __Pyx_PyDict_NewPresized(51); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FIRSTEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_NOEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":6 * event_names = { * SDL_FIRSTEVENT : u'NOEVENT', * SDL_QUIT : 'QUIT', # <<<<<<<<<<<<<< * SDL_APP_TERMINATING : 'APP_TERMINATING', * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_QUIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_QUIT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":7 * SDL_FIRSTEVENT : u'NOEVENT', * SDL_QUIT : 'QUIT', * SDL_APP_TERMINATING : 'APP_TERMINATING', # <<<<<<<<<<<<<< * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_TERMINATING); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_TERMINATING) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":8 * SDL_QUIT : 'QUIT', * SDL_APP_TERMINATING : 'APP_TERMINATING', * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', # <<<<<<<<<<<<<< * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_LOWMEMORY); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_LOWMEMORY) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":9 * SDL_APP_TERMINATING : 'APP_TERMINATING', * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', # <<<<<<<<<<<<<< * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERBACKGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_WILLENTERBACKGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":10 * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', # <<<<<<<<<<<<<< * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERBACKGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_DIDENTERBACKGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":11 * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', # <<<<<<<<<<<<<< * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', * SDL_DISPLAYEVENT : 'DISPLAYEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERFOREGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_WILLENTERFOREGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":12 * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', # <<<<<<<<<<<<<< * SDL_DISPLAYEVENT : 'DISPLAYEVENT', * SDL_WINDOWEVENT : 'WINDOWEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERFOREGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_DIDENTERFOREGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":13 * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', * SDL_DISPLAYEVENT : 'DISPLAYEVENT', # <<<<<<<<<<<<<< * SDL_WINDOWEVENT : 'WINDOWEVENT', * SDL_SYSWMEVENT : 'SYSWMEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DISPLAYEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DISPLAYEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":14 * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', * SDL_DISPLAYEVENT : 'DISPLAYEVENT', * SDL_WINDOWEVENT : 'WINDOWEVENT', # <<<<<<<<<<<<<< * SDL_SYSWMEVENT : 'SYSWMEVENT', * SDL_KEYDOWN : 'KEYDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_WINDOWEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":15 * SDL_DISPLAYEVENT : 'DISPLAYEVENT', * SDL_WINDOWEVENT : 'WINDOWEVENT', * SDL_SYSWMEVENT : 'SYSWMEVENT', # <<<<<<<<<<<<<< * SDL_KEYDOWN : 'KEYDOWN', * SDL_KEYUP : 'KEYUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_SYSWMEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_SYSWMEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":16 * SDL_WINDOWEVENT : 'WINDOWEVENT', * SDL_SYSWMEVENT : 'SYSWMEVENT', * SDL_KEYDOWN : 'KEYDOWN', # <<<<<<<<<<<<<< * SDL_KEYUP : 'KEYUP', * SDL_TEXTEDITING : 'TEXTEDITING', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_KEYDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":17 * SDL_SYSWMEVENT : 'SYSWMEVENT', * SDL_KEYDOWN : 'KEYDOWN', * SDL_KEYUP : 'KEYUP', # <<<<<<<<<<<<<< * SDL_TEXTEDITING : 'TEXTEDITING', * SDL_TEXTINPUT : 'TEXTINPUT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_KEYUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":18 * SDL_KEYDOWN : 'KEYDOWN', * SDL_KEYUP : 'KEYUP', * SDL_TEXTEDITING : 'TEXTEDITING', # <<<<<<<<<<<<<< * SDL_TEXTINPUT : 'TEXTINPUT', * SDL_KEYMAPCHANGED : 'KEYMAPCHANGED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTEDITING); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_TEXTEDITING) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":19 * SDL_KEYUP : 'KEYUP', * SDL_TEXTEDITING : 'TEXTEDITING', * SDL_TEXTINPUT : 'TEXTINPUT', # <<<<<<<<<<<<<< * SDL_KEYMAPCHANGED : 'KEYMAPCHANGED', * SDL_MOUSEMOTION : 'MOUSEMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTINPUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_TEXTINPUT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":20 * SDL_TEXTEDITING : 'TEXTEDITING', * SDL_TEXTINPUT : 'TEXTINPUT', * SDL_KEYMAPCHANGED : 'KEYMAPCHANGED', # <<<<<<<<<<<<<< * SDL_MOUSEMOTION : 'MOUSEMOTION', * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYMAPCHANGED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_KEYMAPCHANGED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":21 * SDL_TEXTINPUT : 'TEXTINPUT', * SDL_KEYMAPCHANGED : 'KEYMAPCHANGED', * SDL_MOUSEMOTION : 'MOUSEMOTION', # <<<<<<<<<<<<<< * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MOUSEMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":22 * SDL_KEYMAPCHANGED : 'KEYMAPCHANGED', * SDL_MOUSEMOTION : 'MOUSEMOTION', * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', # <<<<<<<<<<<<<< * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', * SDL_MOUSEWHEEL : 'MOUSEWHEEL', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MOUSEBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":23 * SDL_MOUSEMOTION : 'MOUSEMOTION', * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', # <<<<<<<<<<<<<< * SDL_MOUSEWHEEL : 'MOUSEWHEEL', * SDL_JOYAXISMOTION : 'JOYAXISMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MOUSEBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":24 * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', * SDL_MOUSEWHEEL : 'MOUSEWHEEL', # <<<<<<<<<<<<<< * SDL_JOYAXISMOTION : 'JOYAXISMOTION', * SDL_JOYBALLMOTION : 'JOYBALLMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEWHEEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MOUSEWHEEL) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":25 * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', * SDL_MOUSEWHEEL : 'MOUSEWHEEL', * SDL_JOYAXISMOTION : 'JOYAXISMOTION', # <<<<<<<<<<<<<< * SDL_JOYBALLMOTION : 'JOYBALLMOTION', * SDL_JOYHATMOTION : 'JOYHATMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYAXISMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYAXISMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":26 * SDL_MOUSEWHEEL : 'MOUSEWHEEL', * SDL_JOYAXISMOTION : 'JOYAXISMOTION', * SDL_JOYBALLMOTION : 'JOYBALLMOTION', # <<<<<<<<<<<<<< * SDL_JOYHATMOTION : 'JOYHATMOTION', * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBALLMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYBALLMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":27 * SDL_JOYAXISMOTION : 'JOYAXISMOTION', * SDL_JOYBALLMOTION : 'JOYBALLMOTION', * SDL_JOYHATMOTION : 'JOYHATMOTION', # <<<<<<<<<<<<<< * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', * SDL_JOYBUTTONUP : 'JOYBUTTONUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYHATMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYHATMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":28 * SDL_JOYBALLMOTION : 'JOYBALLMOTION', * SDL_JOYHATMOTION : 'JOYHATMOTION', * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', # <<<<<<<<<<<<<< * SDL_JOYBUTTONUP : 'JOYBUTTONUP', * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":29 * SDL_JOYHATMOTION : 'JOYHATMOTION', * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', * SDL_JOYBUTTONUP : 'JOYBUTTONUP', # <<<<<<<<<<<<<< * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":30 * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', * SDL_JOYBUTTONUP : 'JOYBUTTONUP', * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', # <<<<<<<<<<<<<< * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYDEVICEADDED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":31 * SDL_JOYBUTTONUP : 'JOYBUTTONUP', * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', # <<<<<<<<<<<<<< * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYDEVICEREMOVED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":32 * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', # <<<<<<<<<<<<<< * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERAXISMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERAXISMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":33 * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', # <<<<<<<<<<<<<< * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":34 * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', # <<<<<<<<<<<<<< * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":35 * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', # <<<<<<<<<<<<<< * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERDEVICEADDED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":36 * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', # <<<<<<<<<<<<<< * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', * SDL_FINGERDOWN : 'FINGERDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERDEVICEREMOVED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":37 * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', # <<<<<<<<<<<<<< * SDL_FINGERDOWN : 'FINGERDOWN', * SDL_FINGERUP : 'FINGERUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMAPPED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERDEVICEREMAPPED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":38 * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', * SDL_FINGERDOWN : 'FINGERDOWN', # <<<<<<<<<<<<<< * SDL_FINGERUP : 'FINGERUP', * SDL_FINGERMOTION : 'FINGERMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_FINGERDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":39 * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', * SDL_FINGERDOWN : 'FINGERDOWN', * SDL_FINGERUP : 'FINGERUP', # <<<<<<<<<<<<<< * SDL_FINGERMOTION : 'FINGERMOTION', * SDL_DOLLARGESTURE : 'DOLLARGESTURE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_FINGERUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":40 * SDL_FINGERDOWN : 'FINGERDOWN', * SDL_FINGERUP : 'FINGERUP', * SDL_FINGERMOTION : 'FINGERMOTION', # <<<<<<<<<<<<<< * SDL_DOLLARGESTURE : 'DOLLARGESTURE', * SDL_DOLLARRECORD : 'DOLLARRECORD', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_FINGERMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":41 * SDL_FINGERUP : 'FINGERUP', * SDL_FINGERMOTION : 'FINGERMOTION', * SDL_DOLLARGESTURE : 'DOLLARGESTURE', # <<<<<<<<<<<<<< * SDL_DOLLARRECORD : 'DOLLARRECORD', * SDL_MULTIGESTURE : 'MULTIGESTURE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARGESTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DOLLARGESTURE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":42 * SDL_FINGERMOTION : 'FINGERMOTION', * SDL_DOLLARGESTURE : 'DOLLARGESTURE', * SDL_DOLLARRECORD : 'DOLLARRECORD', # <<<<<<<<<<<<<< * SDL_MULTIGESTURE : 'MULTIGESTURE', * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARRECORD); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DOLLARRECORD) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":43 * SDL_DOLLARGESTURE : 'DOLLARGESTURE', * SDL_DOLLARRECORD : 'DOLLARRECORD', * SDL_MULTIGESTURE : 'MULTIGESTURE', # <<<<<<<<<<<<<< * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', * SDL_DROPFILE : 'DROPFILE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MULTIGESTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MULTIGESTURE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":44 * SDL_DOLLARRECORD : 'DOLLARRECORD', * SDL_MULTIGESTURE : 'MULTIGESTURE', * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', # <<<<<<<<<<<<<< * SDL_DROPFILE : 'DROPFILE', * SDL_DROPTEXT : 'DROPTEXT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CLIPBOARDUPDATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CLIPBOARDUPDATE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":45 * SDL_MULTIGESTURE : 'MULTIGESTURE', * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', * SDL_DROPFILE : 'DROPFILE', # <<<<<<<<<<<<<< * SDL_DROPTEXT : 'DROPTEXT', * SDL_DROPBEGIN : 'DROPBEGIN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DROPFILE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":46 * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', * SDL_DROPFILE : 'DROPFILE', * SDL_DROPTEXT : 'DROPTEXT', # <<<<<<<<<<<<<< * SDL_DROPBEGIN : 'DROPBEGIN', * SDL_DROPCOMPLETE : 'DROPCOMPLETE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPTEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DROPTEXT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":47 * SDL_DROPFILE : 'DROPFILE', * SDL_DROPTEXT : 'DROPTEXT', * SDL_DROPBEGIN : 'DROPBEGIN', # <<<<<<<<<<<<<< * SDL_DROPCOMPLETE : 'DROPCOMPLETE', * SDL_AUDIODEVICEADDED : 'AUDIODEVICEADDED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPBEGIN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DROPBEGIN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":48 * SDL_DROPTEXT : 'DROPTEXT', * SDL_DROPBEGIN : 'DROPBEGIN', * SDL_DROPCOMPLETE : 'DROPCOMPLETE', # <<<<<<<<<<<<<< * SDL_AUDIODEVICEADDED : 'AUDIODEVICEADDED', * SDL_AUDIODEVICEREMOVED : 'AUDIODEVICEREMOVED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPCOMPLETE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DROPCOMPLETE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":49 * SDL_DROPBEGIN : 'DROPBEGIN', * SDL_DROPCOMPLETE : 'DROPCOMPLETE', * SDL_AUDIODEVICEADDED : 'AUDIODEVICEADDED', # <<<<<<<<<<<<<< * SDL_AUDIODEVICEREMOVED : 'AUDIODEVICEREMOVED', * SDL_SENSORUPDATE : 'SENSORUPDATE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_AUDIODEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_AUDIODEVICEADDED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":50 * SDL_DROPCOMPLETE : 'DROPCOMPLETE', * SDL_AUDIODEVICEADDED : 'AUDIODEVICEADDED', * SDL_AUDIODEVICEREMOVED : 'AUDIODEVICEREMOVED', # <<<<<<<<<<<<<< * SDL_SENSORUPDATE : 'SENSORUPDATE', * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_AUDIODEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_AUDIODEVICEREMOVED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":51 * SDL_AUDIODEVICEADDED : 'AUDIODEVICEADDED', * SDL_AUDIODEVICEREMOVED : 'AUDIODEVICEREMOVED', * SDL_SENSORUPDATE : 'SENSORUPDATE', # <<<<<<<<<<<<<< * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', * SDL_RENDER_DEVICE_RESET : 'RENDER_DEVICE_RESET', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_SENSORUPDATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_SENSORUPDATE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":52 * SDL_AUDIODEVICEREMOVED : 'AUDIODEVICEREMOVED', * SDL_SENSORUPDATE : 'SENSORUPDATE', * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', # <<<<<<<<<<<<<< * SDL_RENDER_DEVICE_RESET : 'RENDER_DEVICE_RESET', * SDL_USEREVENT : 'USEREVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_TARGETS_RESET); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_RENDER_TARGETS_RESET) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":53 * SDL_SENSORUPDATE : 'SENSORUPDATE', * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', * SDL_RENDER_DEVICE_RESET : 'RENDER_DEVICE_RESET', # <<<<<<<<<<<<<< * SDL_USEREVENT : 'USEREVENT', * SDL_LASTEVENT : 'LASTEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_DEVICE_RESET); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_RENDER_DEVICE_RESET) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":54 * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', * SDL_RENDER_DEVICE_RESET : 'RENDER_DEVICE_RESET', * SDL_USEREVENT : 'USEREVENT', # <<<<<<<<<<<<<< * SDL_LASTEVENT : 'LASTEVENT', * } */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_USEREVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":55 * SDL_RENDER_DEVICE_RESET : 'RENDER_DEVICE_RESET', * SDL_USEREVENT : 'USEREVENT', * SDL_LASTEVENT : 'LASTEVENT', # <<<<<<<<<<<<<< * } */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_LASTEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_LASTEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_event_names, __pyx_t_3) < 0) __PYX_ERR(4, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":34 * * # Add events to emulate SDL 1.2. These also need to be added in locals. * ACTIVEEVENT = SDL_LASTEVENT - 1 # <<<<<<<<<<<<<< * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACTIVEEVENT, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":35 * # Add events to emulate SDL 1.2. These also need to be added in locals. * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 # <<<<<<<<<<<<<< * VIDEOEXPOSE = SDL_LASTEVENT - 3 * WINDOWMOVED = SDL_LASTEVENT - 4 */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEORESIZE, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":36 * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 # <<<<<<<<<<<<<< * WINDOWMOVED = SDL_LASTEVENT - 4 * # (Do not add events here.) */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEOEXPOSE, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":37 * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 * WINDOWMOVED = SDL_LASTEVENT - 4 # <<<<<<<<<<<<<< * # (Do not add events here.) * */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWMOVED, __pyx_t_3) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":40 * # (Do not add events here.) * * event_names[ACTIVEEVENT] = "ACTIVEEVENT" # <<<<<<<<<<<<<< * event_names[VIDEORESIZE] = "VIDEORESIZE" * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_event_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_ACTIVEEVENT) < 0))) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":41 * * event_names[ACTIVEEVENT] = "ACTIVEEVENT" * event_names[VIDEORESIZE] = "VIDEORESIZE" # <<<<<<<<<<<<<< * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" * event_names[WINDOWMOVED] = "WINDOWMOVED" */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_event_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_VIDEORESIZE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_VIDEORESIZE) < 0))) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":42 * event_names[ACTIVEEVENT] = "ACTIVEEVENT" * event_names[VIDEORESIZE] = "VIDEORESIZE" * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" # <<<<<<<<<<<<<< * event_names[WINDOWMOVED] = "WINDOWMOVED" * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_event_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_VIDEOEXPOSE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_VIDEOEXPOSE) < 0))) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":43 * event_names[VIDEORESIZE] = "VIDEORESIZE" * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" * event_names[WINDOWMOVED] = "WINDOWMOVED" # <<<<<<<<<<<<<< * * # This is used for events posted to the event queue. This won't be returned */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_event_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_WINDOWMOVED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_WINDOWMOVED) < 0))) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":49 * # giving the type. * cdef unsigned int POSTEDEVENT * POSTEDEVENT = SDL_LASTEVENT - 5 # <<<<<<<<<<<<<< * * # The maximum number of a user-defined event. */ __pyx_v_11pygame_sdl2_5event_POSTEDEVENT = (SDL_LASTEVENT - 5); /* "pygame_sdl2/event.pyx":52 * * # The maximum number of a user-defined event. * USEREVENT_MAX = SDL_LASTEVENT - 6 # <<<<<<<<<<<<<< * * # If true, the mousewheel is mapped to buttons 4 and 5. Otherwise, a */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_USEREVENT_MAX, __pyx_t_3) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":56 * # If true, the mousewheel is mapped to buttons 4 and 5. Otherwise, a * # MOUSEWHEEL event is created. * cdef bint mousewheel_buttons = 1 # <<<<<<<<<<<<<< * * cdef unsigned int SDL_TOUCH_MOUSEID */ __pyx_v_11pygame_sdl2_5event_mousewheel_buttons = 1; /* "pygame_sdl2/event.pyx":59 * * cdef unsigned int SDL_TOUCH_MOUSEID * SDL_TOUCH_MOUSEID = -1 # <<<<<<<<<<<<<< * * class EventType(object): */ __pyx_v_11pygame_sdl2_5event_SDL_TOUCH_MOUSEID = ((unsigned int)-1L); /* "pygame_sdl2/event.pyx":61 * SDL_TOUCH_MOUSEID = -1 * * class EventType(object): # <<<<<<<<<<<<<< * * def __init__(self, type, dict=None, **kwargs): */ __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_tuple__7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_EventType, __pyx_n_s_EventType, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_event, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3 != __pyx_tuple__7) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__7) < 0))) __PYX_ERR(0, 61, __pyx_L1_error) } /* "pygame_sdl2/event.pyx":63 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_1__init__, 0, __pyx_n_s_EventType___init, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__10); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":71 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < WINDOWMOVED: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_3__repr__, 0, __pyx_n_s_EventType___repr, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_repr, __pyx_t_6) < 0) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":90 * return '' % (self.type, ename, ", ".join(rest)) * * @property # <<<<<<<<<<<<<< * def dict(self): * return self.__dict__ */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_5dict, 0, __pyx_n_s_EventType_dict, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_dict, __pyx_t_7) < 0) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":94 * return self.__dict__ * * @property # <<<<<<<<<<<<<< * def type(self): * return self._type */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_7type, 0, __pyx_n_s_EventType_type, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_type, __pyx_t_6) < 0) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":98 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_9__eq__, 0, __pyx_n_s_EventType___eq, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_eq, __pyx_t_6) < 0) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":101 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_11__ne__, 0, __pyx_n_s_EventType___ne, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ne, __pyx_t_6) < 0) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":104 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9EventType_13__nonzero__, 0, __pyx_n_s_EventType___nonzero, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_nonzero, __pyx_t_6) < 0) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":61 * SDL_TOUCH_MOUSEID = -1 * * class EventType(object): # <<<<<<<<<<<<<< * * def __init__(self, type, dict=None, **kwargs): */ __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_EventType, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EventType, __pyx_t_6) < 0) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":107 * return self.type != 0 * * Event = EventType # <<<<<<<<<<<<<< * * cdef get_textinput(): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_EventType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Event, __pyx_t_3) < 0) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":305 * * # The event queue - a list of pending events from oldest to newest. * cdef public event_queue = list() # <<<<<<<<<<<<<< * * # The lock that protects the event queue. */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(event_queue); __Pyx_DECREF_SET(event_queue, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":308 * * # The lock that protects the event queue. * lock = threading.RLock() # <<<<<<<<<<<<<< * * # This is the object that is returned when no event exists. */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RLock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_lock, __pyx_t_3) < 0) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":311 * * # This is the object that is returned when no event exists. * NOEVENT_EVENT = EventType(0) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_EventType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOEVENT_EVENT, __pyx_t_2) < 0) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":371 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_1pump, 0, __pyx_n_s_pump, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pump, __pyx_t_2) < 0) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":376 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_3get, 0, __pyx_n_s_get, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":396 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_5poll, 0, __pyx_n_s_poll, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_poll, __pyx_t_2) < 0) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":407 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_7wait, 0, __pyx_n_s_wait, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":427 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_9peek, 0, __pyx_n_s_peek, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_peek, __pyx_t_2) < 0) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":440 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_11clear, 0, __pyx_n_s_clear, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_clear, __pyx_t_2) < 0) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":445 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_13get_standard_events, 0, __pyx_n_s_get_standard_events, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_standard_events, __pyx_t_2) < 0) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":452 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_15event_name, 0, __pyx_n_s_event_name, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_event_name, __pyx_t_2) < 0) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":458 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_17set_blocked, 0, __pyx_n_s_set_blocked, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_blocked, __pyx_t_2) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":468 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_19set_allowed, 0, __pyx_n_s_set_allowed, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_allowed, __pyx_t_2) < 0) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":478 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_21get_blocked, 0, __pyx_n_s_get_blocked, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_blocked, __pyx_t_2) < 0) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":481 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_23set_grab, 0, __pyx_n_s_set_grab, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_grab, __pyx_t_2) < 0) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":487 * SDL_SetRelativeMouseMode(on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_25get_grab, 0, __pyx_n_s_get_grab, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_grab, __pyx_t_2) < 0) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":490 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_27set_mousewheel_buttons, 0, __pyx_n_s_set_mousewheel_buttons, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mousewheel_buttons, __pyx_t_2) < 0) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":502 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_29get_mousewheel_buttons, 0, __pyx_n_s_get_mousewheel_buttons, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_mousewheel_buttons, __pyx_t_2) < 0) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":509 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_31post, 0, __pyx_n_s_post, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_post, __pyx_t_2) < 0) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":529 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_33register, 0, __pyx_n_s_register, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_register, __pyx_t_2) < 0) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":543 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_35copy_event_queue, 0, __pyx_n_s_copy_event_queue, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy_event_queue, __pyx_t_2) < 0) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":552 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5event_37init, 0, __pyx_n_s_init_2, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":560 * raise pygame_sdl2.error.error() * * _types = """ # <<<<<<<<<<<<<< * Event = EventType * """ */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_kp_s_Event_EventType) < 0) __PYX_ERR(0, 560, __pyx_L1_error) /* "pygame_sdl2/event.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Copyright 2014 Tom Rothamel * # */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.event", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.event"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* StringJoin */ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { (void) __Pyx_PyObject_CallMethod1; #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION < 3 return _PyString_Join(sep, values); #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 return _PyBytes_Join(sep, values); #else return __Pyx_PyObject_CallMethod1(sep, __pyx_n_s_join, values); #endif } /* PyIntCompare */ static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { Py_RETURN_FALSE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { if (__Pyx_PyLong_IsZero(op1) != 1) Py_RETURN_TRUE; else Py_RETURN_FALSE; } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) Py_RETURN_TRUE; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) Py_RETURN_TRUE; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } return ( PyObject_RichCompare(op1, op2, Py_NE)); } /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + (unsigned long)b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* RaiseUnboundLocalError */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* pop_index */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { PyObject *r; if (unlikely(!py_ix)) return NULL; r = __Pyx__PyObject_PopIndex(L, py_ix); Py_DECREF(py_ix); return r; } static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); } #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { Py_ssize_t size = PyList_GET_SIZE(L); if (likely(size > (((PyListObject*)L)->allocated >> 1))) { Py_ssize_t cix = ix; if (cix < 0) { cix += size; } if (likely(__Pyx_is_valid_index(cix, size))) { PyObject* v = PyList_GET_ITEM(L, cix); __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); size -= 1; memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); return v; } } if (py_ix == Py_None) { return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); } else { return __Pyx__PyObject_PopIndex(L, py_ix); } } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } *pvalue1 = value1; *pvalue2 = value2; return 0; #if CYTHON_COMPILING_IN_PYPY bad: Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; #endif } static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = __Pyx_PyObject_GetIterNextFunc(iter); value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { #if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; #elif PY_MAJOR_VERSION >= 3 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { const char *name = PyUnicode_AsUTF8(method_name); if (strcmp(name, "iteritems") == 0) pp = &py_items; else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; else if (strcmp(name, "itervalues") == 0) pp = &py_values; if (pp) { if (!*pp) { *pp = PyUnicode_FromString(name + 4); if (!*pp) return NULL; } method_name = *pp; } } #endif } *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* SetItemInt */ static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (unlikely(!j)) return -1; r = PyObject_SetItem(o, j, v); Py_DECREF(j); return r; } static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { PyObject* old = PyList_GET_ITEM(o, n); Py_INCREF(v); PyList_SET_ITEM(o, n, v); Py_DECREF(old); return 1; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_ass_subscript) { int r; PyObject *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return -1; r = mm->mp_ass_subscript(o, key, v); Py_DECREF(key); return r; } if (likely(sm && sm->sq_ass_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return -1; PyErr_Clear(); } } return sm->sq_ass_item(o, i, v); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_SetItem(o, i, v); } #endif return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_12 #define __PYX_HAVE_RT_ImportType_3_0_12 static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__5; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict_2); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_EventType neg_one = (SDL_EventType) -1, const_zero = (SDL_EventType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_EventType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_EventType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_EventType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_EventType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_EventType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_EventType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_EventType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Scancode(SDL_Scancode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_Scancode neg_one = (SDL_Scancode) -1, const_zero = (SDL_Scancode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_Scancode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Scancode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_Scancode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_Scancode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_Scancode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_Scancode), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_Scancode)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint16_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint16_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int16_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int16_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint32_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint32_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = v; } v = NULL; val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint32_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint32_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntFromPy */ static CYTHON_INLINE SDL_bool __Pyx_PyInt_As_SDL_bool(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SDL_bool) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_bool) val; } } #endif if (unlikely(!PyLong_Check(x))) { SDL_bool val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_bool) -1; val = __Pyx_PyInt_As_SDL_bool(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_bool, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SDL_bool) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) >= 2 * PyLong_SHIFT)) { return (SDL_bool) (((((SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0])); } } break; case 3: if ((8 * sizeof(SDL_bool) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) >= 3 * PyLong_SHIFT)) { return (SDL_bool) (((((((SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0])); } } break; case 4: if ((8 * sizeof(SDL_bool) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) >= 4 * PyLong_SHIFT)) { return (SDL_bool) (((((((((SDL_bool)digits[3]) << PyLong_SHIFT) | (SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_bool) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SDL_bool) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_bool, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SDL_bool) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) - 1 > 2 * PyLong_SHIFT)) { return (SDL_bool) (((SDL_bool)-1)*(((((SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case 2: if ((8 * sizeof(SDL_bool) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) - 1 > 2 * PyLong_SHIFT)) { return (SDL_bool) ((((((SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case -3: if ((8 * sizeof(SDL_bool) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) - 1 > 3 * PyLong_SHIFT)) { return (SDL_bool) (((SDL_bool)-1)*(((((((SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case 3: if ((8 * sizeof(SDL_bool) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) - 1 > 3 * PyLong_SHIFT)) { return (SDL_bool) ((((((((SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case -4: if ((8 * sizeof(SDL_bool) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) - 1 > 4 * PyLong_SHIFT)) { return (SDL_bool) (((SDL_bool)-1)*(((((((((SDL_bool)digits[3]) << PyLong_SHIFT) | (SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case 4: if ((8 * sizeof(SDL_bool) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_bool) - 1 > 4 * PyLong_SHIFT)) { return (SDL_bool) ((((((((((SDL_bool)digits[3]) << PyLong_SHIFT) | (SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; } } #endif if ((sizeof(SDL_bool) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_bool) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { SDL_bool val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums"); val = (SDL_bool) -1; #endif if (unlikely(ret)) return (SDL_bool) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_bool"); return (SDL_bool) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_bool"); return (SDL_bool) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_bool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_bool) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_bool), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_bool)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__49); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* VoidPtrImport */ #ifndef __PYX_HAVE_RT_ImportVoidPtr_3_0_12 #define __PYX_HAVE_RT_ImportVoidPtr_3_0_12 static int __Pyx_ImportVoidPtr_3_0_12(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752385208.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.event.h0000664000175000017500000000410015034643270020216 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef __PYX_HAVE__pygame_sdl2__event #define __PYX_HAVE__pygame_sdl2__event #include "Python.h" #ifndef __PYX_HAVE_API__pygame_sdl2__event #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(_T) _T #endif __PYX_EXTERN_C PyObject *event_queue; #endif /* !__PYX_HAVE_API__pygame_sdl2__event */ /* WARNING: the interface of the module init function changed in CPython 3.5. */ /* It now returns a PyModuleDef instance instead of a PyModule instance. */ #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initevent(void); #else /* WARNING: Use PyImport_AppendInittab("event", PyInit_event) instead of calling PyInit_event directly from Python 3.5 */ PyMODINIT_FUNC PyInit_event(void); #if PY_VERSION_HEX >= 0x03050000 && (defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER) || (defined(__cplusplus) && __cplusplus >= 201402L)) #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("Use PyImport_AppendInittab(\"event\", PyInit_event) instead of calling PyInit_event directly.")]] inline #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("Use PyImport_AppendInittab(\"event\", PyInit_event) instead of calling PyInit_event directly."), __unused__)) __inline__ #elif defined(_MSC_VER) __declspec(deprecated("Use PyImport_AppendInittab(\"event\", PyInit_event) instead of calling PyInit_event directly.")) __inline #endif static PyObject* __PYX_WARN_IF_PyInit_event_INIT_CALLED(PyObject* res) { return res; } #define PyInit_event() __PYX_WARN_IF_PyInit_event_INIT_CALLED(PyInit_event()) #endif #endif #endif /* !__PYX_HAVE__pygame_sdl2__event */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635913.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.font.c0000664000175000017500000175017015026112611020045 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__font #define __PYX_HAVE_API__pygame_sdl2__font /* Early includes */ #include #include #include #include #include "SDL.h" #include "SDL_ttf.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "", "src/pygame_sdl2/font.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/color.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_5color_Color; struct __pyx_obj_11pygame_sdl2_4font_Font; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/font.pyx":50 * return match_font("sans") * * cdef class Font: # <<<<<<<<<<<<<< * cdef TTF_Font *font * cdef int style */ struct __pyx_obj_11pygame_sdl2_4font_Font { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *__pyx_vtab; TTF_Font *font; int style; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* "pygame_sdl2/font.pyx":50 * return match_font("sans") * * cdef class Font: # <<<<<<<<<<<<<< * cdef TTF_Font *font * cdef int style */ struct __pyx_vtabstruct_11pygame_sdl2_4font_Font { PyObject *(*set_style)(struct __pyx_obj_11pygame_sdl2_4font_Font *, PyObject *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *__pyx_vtabptr_11pygame_sdl2_4font_Font; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* UnicodeAsUCS4.proto */ static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*); /* object_ord.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyObject_Ord(c)\ (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c)) #else #define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c) #endif static long __Pyx__PyObject_Ord(PyObject* c); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 #define __PYX_HAVE_RT_ImportType_proto_3_0_12 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_12 { __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ static PyObject *__pyx_f_11pygame_sdl2_4font_4Font_set_style(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_on); /* proto*/ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_ttf" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.color" */ static PyObject *(*__pyx_f_11pygame_sdl2_5color_to_sdl_color)(PyObject *, SDL_Color *); /*proto*/ /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.font" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.font" extern int __pyx_module_is_main_pygame_sdl2__font; int __pyx_module_is_main_pygame_sdl2__font = 0; /* Implementation of "pygame_sdl2.font" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "*"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_w[] = "w"; static const char __pyx_k__2[] = " "; static const char __pyx_k__5[] = "."; static const char __pyx_k_ch[] = "ch"; static const char __pyx_k_fg[] = "fg"; static const char __pyx_k_fi[] = "fi"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_on[] = "on"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__33[] = "?"; static const char __pyx_k_Font[] = "Font"; static const char __pyx_k_blit[] = "blit"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_file[] = "__file__"; static const char __pyx_k_fill[] = "fill"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_maxx[] = "maxx"; static const char __pyx_k_maxy[] = "maxy"; static const char __pyx_k_minx[] = "minx"; static const char __pyx_k_miny[] = "miny"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_sans[] = "sans"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_surf[] = "surf"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_text[] = "text"; static const char __pyx_k_chnum[] = "chnum"; static const char __pyx_k_color[] = "color"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_bgsurf[] = "bgsurf"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_exists[] = "exists"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_render[] = "render"; static const char __pyx_k_SysFont[] = "SysFont"; static const char __pyx_k_advance[] = "advance"; static const char __pyx_k_convert[] = "convert"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_dirname[] = "dirname"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_metrics[] = "metrics"; static const char __pyx_k_get_bold[] = "get_bold"; static const char __pyx_k_get_init[] = "get_init"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_set_bold[] = "set_bold"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_Font_size[] = "Font.size"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_antialias[] = "antialias"; static const char __pyx_k_get_fonts[] = "get_fonts"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_background[] = "background"; static const char __pyx_k_get_ascent[] = "get_ascent"; static const char __pyx_k_get_height[] = "get_height"; static const char __pyx_k_get_italic[] = "get_italic"; static const char __pyx_k_match_font[] = "match_font"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_set_italic[] = "set_italic"; static const char __pyx_k_Font_render[] = "Font.render"; static const char __pyx_k_get_descent[] = "get_descent"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_Font_metrics[] = "Font.metrics"; static const char __pyx_k_get_linesize[] = "get_linesize"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_Font_get_bold[] = "Font.get_bold"; static const char __pyx_k_Font_set_bold[] = "Font.set_bold"; static const char __pyx_k_get_underline[] = "get_underline"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_set_underline[] = "set_underline"; static const char __pyx_k_DejaVuSans_ttf[] = "DejaVuSans.ttf"; static const char __pyx_k_Font_get_ascent[] = "Font.get_ascent"; static const char __pyx_k_Font_get_height[] = "Font.get_height"; static const char __pyx_k_Font_get_italic[] = "Font.get_italic"; static const char __pyx_k_Font_set_italic[] = "Font.set_italic"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Font_get_descent[] = "Font.get_descent"; static const char __pyx_k_get_default_font[] = "get_default_font"; static const char __pyx_k_pygame_sdl2_font[] = "pygame_sdl2.font"; static const char __pyx_k_Font_get_linesize[] = "Font.get_linesize"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_Font_get_underline[] = "Font.get_underline"; static const char __pyx_k_Font_set_underline[] = "Font.set_underline"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_sysfont[] = "pygame_sdl2.sysfont"; static const char __pyx_k_Font___reduce_cython[] = "Font.__reduce_cython__"; static const char __pyx_k_Font___setstate_cython[] = "Font.__setstate_cython__"; static const char __pyx_k_src_pygame_sdl2_font_pyx[] = "src/pygame_sdl2/font.pyx"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_4font_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_6get_default_font(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4font_4Font___cinit__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_4font_4Font_2__dealloc__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4font_4Font_4__init__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_6render(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_antialias, PyObject *__pyx_v_color, PyObject *__pyx_v_background); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_8size(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_10set_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_12get_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_14set_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_16get_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_18set_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_20get_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_22get_linesize(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_24get_height(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_26get_ascent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_28get_descent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_30metrics(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_4font_Font(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_4font_Font; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_4font_Font; PyObject *__pyx_n_s_; PyObject *__pyx_kp_s_DejaVuSans_ttf; PyObject *__pyx_n_s_Font; PyObject *__pyx_n_s_Font___reduce_cython; PyObject *__pyx_n_s_Font___setstate_cython; PyObject *__pyx_n_s_Font_get_ascent; PyObject *__pyx_n_s_Font_get_bold; PyObject *__pyx_n_s_Font_get_descent; PyObject *__pyx_n_s_Font_get_height; PyObject *__pyx_n_s_Font_get_italic; PyObject *__pyx_n_s_Font_get_linesize; PyObject *__pyx_n_s_Font_get_underline; PyObject *__pyx_n_s_Font_metrics; PyObject *__pyx_n_s_Font_render; PyObject *__pyx_n_s_Font_set_bold; PyObject *__pyx_n_s_Font_set_italic; PyObject *__pyx_n_s_Font_set_underline; PyObject *__pyx_n_s_Font_size; PyObject *__pyx_n_s_SysFont; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_kp_s__2; PyObject *__pyx_n_s__33; PyObject *__pyx_kp_u__5; PyObject *__pyx_n_s_advance; PyObject *__pyx_n_s_antialias; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_background; PyObject *__pyx_n_s_bgsurf; PyObject *__pyx_n_s_blit; PyObject *__pyx_n_s_ch; PyObject *__pyx_n_s_chnum; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_color; PyObject *__pyx_n_s_convert; PyObject *__pyx_n_s_copy; PyObject *__pyx_n_s_default; PyObject *__pyx_n_s_dirname; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_exists; PyObject *__pyx_n_s_fg; PyObject *__pyx_n_s_fi; PyObject *__pyx_n_s_file; PyObject *__pyx_n_s_fill; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_ascent; PyObject *__pyx_n_s_get_bold; PyObject *__pyx_n_s_get_default_font; PyObject *__pyx_n_s_get_descent; PyObject *__pyx_n_s_get_fonts; PyObject *__pyx_n_s_get_height; PyObject *__pyx_n_s_get_init; PyObject *__pyx_n_s_get_italic; PyObject *__pyx_n_s_get_linesize; PyObject *__pyx_n_s_get_underline; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_join; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_match_font; PyObject *__pyx_n_s_maxx; PyObject *__pyx_n_s_maxy; PyObject *__pyx_n_s_metrics; PyObject *__pyx_n_s_minx; PyObject *__pyx_n_s_miny; PyObject *__pyx_n_s_name; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_on; PyObject *__pyx_n_s_os; PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_font; PyObject *__pyx_n_s_pygame_sdl2_sysfont; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_register_init; PyObject *__pyx_n_s_register_quit; PyObject *__pyx_n_s_render; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_sans; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_bold; PyObject *__pyx_n_s_set_italic; PyObject *__pyx_n_s_set_underline; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_font_pyx; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_surf; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_text; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_n_s_w; PyObject *__pyx_int_0; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__31; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__24; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__32; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_4font_Font); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_4font_Font); Py_CLEAR(clear_module_state->__pyx_n_s_); Py_CLEAR(clear_module_state->__pyx_kp_s_DejaVuSans_ttf); Py_CLEAR(clear_module_state->__pyx_n_s_Font); Py_CLEAR(clear_module_state->__pyx_n_s_Font___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Font___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_ascent); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_bold); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_descent); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_height); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_italic); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_linesize); Py_CLEAR(clear_module_state->__pyx_n_s_Font_get_underline); Py_CLEAR(clear_module_state->__pyx_n_s_Font_metrics); Py_CLEAR(clear_module_state->__pyx_n_s_Font_render); Py_CLEAR(clear_module_state->__pyx_n_s_Font_set_bold); Py_CLEAR(clear_module_state->__pyx_n_s_Font_set_italic); Py_CLEAR(clear_module_state->__pyx_n_s_Font_set_underline); Py_CLEAR(clear_module_state->__pyx_n_s_Font_size); Py_CLEAR(clear_module_state->__pyx_n_s_SysFont); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_kp_s__2); Py_CLEAR(clear_module_state->__pyx_n_s__33); Py_CLEAR(clear_module_state->__pyx_kp_u__5); Py_CLEAR(clear_module_state->__pyx_n_s_advance); Py_CLEAR(clear_module_state->__pyx_n_s_antialias); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_background); Py_CLEAR(clear_module_state->__pyx_n_s_bgsurf); Py_CLEAR(clear_module_state->__pyx_n_s_blit); Py_CLEAR(clear_module_state->__pyx_n_s_ch); Py_CLEAR(clear_module_state->__pyx_n_s_chnum); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_color); Py_CLEAR(clear_module_state->__pyx_n_s_convert); Py_CLEAR(clear_module_state->__pyx_n_s_copy); Py_CLEAR(clear_module_state->__pyx_n_s_default); Py_CLEAR(clear_module_state->__pyx_n_s_dirname); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_exists); Py_CLEAR(clear_module_state->__pyx_n_s_fg); Py_CLEAR(clear_module_state->__pyx_n_s_fi); Py_CLEAR(clear_module_state->__pyx_n_s_file); Py_CLEAR(clear_module_state->__pyx_n_s_fill); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_ascent); Py_CLEAR(clear_module_state->__pyx_n_s_get_bold); Py_CLEAR(clear_module_state->__pyx_n_s_get_default_font); Py_CLEAR(clear_module_state->__pyx_n_s_get_descent); Py_CLEAR(clear_module_state->__pyx_n_s_get_fonts); Py_CLEAR(clear_module_state->__pyx_n_s_get_height); Py_CLEAR(clear_module_state->__pyx_n_s_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_get_italic); Py_CLEAR(clear_module_state->__pyx_n_s_get_linesize); Py_CLEAR(clear_module_state->__pyx_n_s_get_underline); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_join); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_match_font); Py_CLEAR(clear_module_state->__pyx_n_s_maxx); Py_CLEAR(clear_module_state->__pyx_n_s_maxy); Py_CLEAR(clear_module_state->__pyx_n_s_metrics); Py_CLEAR(clear_module_state->__pyx_n_s_minx); Py_CLEAR(clear_module_state->__pyx_n_s_miny); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_on); Py_CLEAR(clear_module_state->__pyx_n_s_os); Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_font); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_sysfont); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_register_init); Py_CLEAR(clear_module_state->__pyx_n_s_register_quit); Py_CLEAR(clear_module_state->__pyx_n_s_render); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_sans); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_bold); Py_CLEAR(clear_module_state->__pyx_n_s_set_italic); Py_CLEAR(clear_module_state->__pyx_n_s_set_underline); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_font_pyx); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_surf); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_text); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__24); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__32); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_4font_Font); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_4font_Font); Py_VISIT(traverse_module_state->__pyx_n_s_); Py_VISIT(traverse_module_state->__pyx_kp_s_DejaVuSans_ttf); Py_VISIT(traverse_module_state->__pyx_n_s_Font); Py_VISIT(traverse_module_state->__pyx_n_s_Font___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Font___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_ascent); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_bold); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_descent); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_height); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_italic); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_linesize); Py_VISIT(traverse_module_state->__pyx_n_s_Font_get_underline); Py_VISIT(traverse_module_state->__pyx_n_s_Font_metrics); Py_VISIT(traverse_module_state->__pyx_n_s_Font_render); Py_VISIT(traverse_module_state->__pyx_n_s_Font_set_bold); Py_VISIT(traverse_module_state->__pyx_n_s_Font_set_italic); Py_VISIT(traverse_module_state->__pyx_n_s_Font_set_underline); Py_VISIT(traverse_module_state->__pyx_n_s_Font_size); Py_VISIT(traverse_module_state->__pyx_n_s_SysFont); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_kp_s__2); Py_VISIT(traverse_module_state->__pyx_n_s__33); Py_VISIT(traverse_module_state->__pyx_kp_u__5); Py_VISIT(traverse_module_state->__pyx_n_s_advance); Py_VISIT(traverse_module_state->__pyx_n_s_antialias); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_background); Py_VISIT(traverse_module_state->__pyx_n_s_bgsurf); Py_VISIT(traverse_module_state->__pyx_n_s_blit); Py_VISIT(traverse_module_state->__pyx_n_s_ch); Py_VISIT(traverse_module_state->__pyx_n_s_chnum); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_color); Py_VISIT(traverse_module_state->__pyx_n_s_convert); Py_VISIT(traverse_module_state->__pyx_n_s_copy); Py_VISIT(traverse_module_state->__pyx_n_s_default); Py_VISIT(traverse_module_state->__pyx_n_s_dirname); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_exists); Py_VISIT(traverse_module_state->__pyx_n_s_fg); Py_VISIT(traverse_module_state->__pyx_n_s_fi); Py_VISIT(traverse_module_state->__pyx_n_s_file); Py_VISIT(traverse_module_state->__pyx_n_s_fill); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_ascent); Py_VISIT(traverse_module_state->__pyx_n_s_get_bold); Py_VISIT(traverse_module_state->__pyx_n_s_get_default_font); Py_VISIT(traverse_module_state->__pyx_n_s_get_descent); Py_VISIT(traverse_module_state->__pyx_n_s_get_fonts); Py_VISIT(traverse_module_state->__pyx_n_s_get_height); Py_VISIT(traverse_module_state->__pyx_n_s_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_get_italic); Py_VISIT(traverse_module_state->__pyx_n_s_get_linesize); Py_VISIT(traverse_module_state->__pyx_n_s_get_underline); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_join); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_match_font); Py_VISIT(traverse_module_state->__pyx_n_s_maxx); Py_VISIT(traverse_module_state->__pyx_n_s_maxy); Py_VISIT(traverse_module_state->__pyx_n_s_metrics); Py_VISIT(traverse_module_state->__pyx_n_s_minx); Py_VISIT(traverse_module_state->__pyx_n_s_miny); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_on); Py_VISIT(traverse_module_state->__pyx_n_s_os); Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_font); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_sysfont); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_register_init); Py_VISIT(traverse_module_state->__pyx_n_s_register_quit); Py_VISIT(traverse_module_state->__pyx_n_s_render); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_sans); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_bold); Py_VISIT(traverse_module_state->__pyx_n_s_set_italic); Py_VISIT(traverse_module_state->__pyx_n_s_set_underline); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_font_pyx); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_surf); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_text); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__24); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__32); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_5color_Color __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5color_Color #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_4font_Font __pyx_mstate_global->__pyx_type_11pygame_sdl2_4font_Font #endif #define __pyx_ptype_11pygame_sdl2_4font_Font __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_4font_Font #define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ #define __pyx_kp_s_DejaVuSans_ttf __pyx_mstate_global->__pyx_kp_s_DejaVuSans_ttf #define __pyx_n_s_Font __pyx_mstate_global->__pyx_n_s_Font #define __pyx_n_s_Font___reduce_cython __pyx_mstate_global->__pyx_n_s_Font___reduce_cython #define __pyx_n_s_Font___setstate_cython __pyx_mstate_global->__pyx_n_s_Font___setstate_cython #define __pyx_n_s_Font_get_ascent __pyx_mstate_global->__pyx_n_s_Font_get_ascent #define __pyx_n_s_Font_get_bold __pyx_mstate_global->__pyx_n_s_Font_get_bold #define __pyx_n_s_Font_get_descent __pyx_mstate_global->__pyx_n_s_Font_get_descent #define __pyx_n_s_Font_get_height __pyx_mstate_global->__pyx_n_s_Font_get_height #define __pyx_n_s_Font_get_italic __pyx_mstate_global->__pyx_n_s_Font_get_italic #define __pyx_n_s_Font_get_linesize __pyx_mstate_global->__pyx_n_s_Font_get_linesize #define __pyx_n_s_Font_get_underline __pyx_mstate_global->__pyx_n_s_Font_get_underline #define __pyx_n_s_Font_metrics __pyx_mstate_global->__pyx_n_s_Font_metrics #define __pyx_n_s_Font_render __pyx_mstate_global->__pyx_n_s_Font_render #define __pyx_n_s_Font_set_bold __pyx_mstate_global->__pyx_n_s_Font_set_bold #define __pyx_n_s_Font_set_italic __pyx_mstate_global->__pyx_n_s_Font_set_italic #define __pyx_n_s_Font_set_underline __pyx_mstate_global->__pyx_n_s_Font_set_underline #define __pyx_n_s_Font_size __pyx_mstate_global->__pyx_n_s_Font_size #define __pyx_n_s_SysFont __pyx_mstate_global->__pyx_n_s_SysFont #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_kp_s__2 __pyx_mstate_global->__pyx_kp_s__2 #define __pyx_n_s__33 __pyx_mstate_global->__pyx_n_s__33 #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 #define __pyx_n_s_advance __pyx_mstate_global->__pyx_n_s_advance #define __pyx_n_s_antialias __pyx_mstate_global->__pyx_n_s_antialias #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_background __pyx_mstate_global->__pyx_n_s_background #define __pyx_n_s_bgsurf __pyx_mstate_global->__pyx_n_s_bgsurf #define __pyx_n_s_blit __pyx_mstate_global->__pyx_n_s_blit #define __pyx_n_s_ch __pyx_mstate_global->__pyx_n_s_ch #define __pyx_n_s_chnum __pyx_mstate_global->__pyx_n_s_chnum #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_color __pyx_mstate_global->__pyx_n_s_color #define __pyx_n_s_convert __pyx_mstate_global->__pyx_n_s_convert #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy #define __pyx_n_s_default __pyx_mstate_global->__pyx_n_s_default #define __pyx_n_s_dirname __pyx_mstate_global->__pyx_n_s_dirname #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_exists __pyx_mstate_global->__pyx_n_s_exists #define __pyx_n_s_fg __pyx_mstate_global->__pyx_n_s_fg #define __pyx_n_s_fi __pyx_mstate_global->__pyx_n_s_fi #define __pyx_n_s_file __pyx_mstate_global->__pyx_n_s_file #define __pyx_n_s_fill __pyx_mstate_global->__pyx_n_s_fill #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_ascent __pyx_mstate_global->__pyx_n_s_get_ascent #define __pyx_n_s_get_bold __pyx_mstate_global->__pyx_n_s_get_bold #define __pyx_n_s_get_default_font __pyx_mstate_global->__pyx_n_s_get_default_font #define __pyx_n_s_get_descent __pyx_mstate_global->__pyx_n_s_get_descent #define __pyx_n_s_get_fonts __pyx_mstate_global->__pyx_n_s_get_fonts #define __pyx_n_s_get_height __pyx_mstate_global->__pyx_n_s_get_height #define __pyx_n_s_get_init __pyx_mstate_global->__pyx_n_s_get_init #define __pyx_n_s_get_italic __pyx_mstate_global->__pyx_n_s_get_italic #define __pyx_n_s_get_linesize __pyx_mstate_global->__pyx_n_s_get_linesize #define __pyx_n_s_get_underline __pyx_mstate_global->__pyx_n_s_get_underline #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_match_font __pyx_mstate_global->__pyx_n_s_match_font #define __pyx_n_s_maxx __pyx_mstate_global->__pyx_n_s_maxx #define __pyx_n_s_maxy __pyx_mstate_global->__pyx_n_s_maxy #define __pyx_n_s_metrics __pyx_mstate_global->__pyx_n_s_metrics #define __pyx_n_s_minx __pyx_mstate_global->__pyx_n_s_minx #define __pyx_n_s_miny __pyx_mstate_global->__pyx_n_s_miny #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_on __pyx_mstate_global->__pyx_n_s_on #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_font __pyx_mstate_global->__pyx_n_s_pygame_sdl2_font #define __pyx_n_s_pygame_sdl2_sysfont __pyx_mstate_global->__pyx_n_s_pygame_sdl2_sysfont #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_register_init __pyx_mstate_global->__pyx_n_s_register_init #define __pyx_n_s_register_quit __pyx_mstate_global->__pyx_n_s_register_quit #define __pyx_n_s_render __pyx_mstate_global->__pyx_n_s_render #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_sans __pyx_mstate_global->__pyx_n_s_sans #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_bold __pyx_mstate_global->__pyx_n_s_set_bold #define __pyx_n_s_set_italic __pyx_mstate_global->__pyx_n_s_set_italic #define __pyx_n_s_set_underline __pyx_mstate_global->__pyx_n_s_set_underline #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_font_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_font_pyx #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_surf __pyx_mstate_global->__pyx_n_s_surf #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_text __pyx_mstate_global->__pyx_n_s_text #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 /* #### Code section: module_code ### */ /* "pygame_sdl2/font.pyx":29 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * TTF_Init() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_4font_init}; static PyObject *__pyx_pw_11pygame_sdl2_4font_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4font_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/font.pyx":31 * @pygame_sdl2.register_init * def init(): * TTF_Init() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ (void)(TTF_Init()); /* "pygame_sdl2/font.pyx":29 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * TTF_Init() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":33 * TTF_Init() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * TTF_Quit() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_2quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_3quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_4font_2quit}; static PyObject *__pyx_pw_11pygame_sdl2_4font_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4font_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/font.pyx":35 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * TTF_Quit() # <<<<<<<<<<<<<< * * def get_init(): */ TTF_Quit(); /* "pygame_sdl2/font.pyx":33 * TTF_Init() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * TTF_Quit() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4get_init, "get_init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_5get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_5get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_4font_4get_init}; static PyObject *__pyx_pw_11pygame_sdl2_4font_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/font.pyx":38 * * def get_init(): * return TTF_WasInit() != 0 # <<<<<<<<<<<<<< * * def get_default_font(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((TTF_WasInit() != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_7get_default_font(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_6get_default_font, "get_default_font()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_7get_default_font = {"get_default_font", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_7get_default_font, METH_NOARGS, __pyx_doc_11pygame_sdl2_4font_6get_default_font}; static PyObject *__pyx_pw_11pygame_sdl2_4font_7get_default_font(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_default_font (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4font_6get_default_font(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_6get_default_font(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_v_os = NULL; PyObject *__pyx_v_default = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_default_font", 1); /* "pygame_sdl2/font.pyx":41 * * def get_default_font(): * import os # <<<<<<<<<<<<<< * * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") */ __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_os = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":43 * import os * * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") # <<<<<<<<<<<<<< * * if os.path.exists(default): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dirname); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_2, __pyx_kp_s_DejaVuSans_ttf}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_default = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":45 * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") * * if os.path.exists(default): # <<<<<<<<<<<<<< * return default * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_default}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { /* "pygame_sdl2/font.pyx":46 * * if os.path.exists(default): * return default # <<<<<<<<<<<<<< * * return match_font("sans") */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; /* "pygame_sdl2/font.pyx":45 * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") * * if os.path.exists(default): # <<<<<<<<<<<<<< * return default * */ } /* "pygame_sdl2/font.pyx":48 * return default * * return match_font("sans") # <<<<<<<<<<<<<< * * cdef class Font: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_match_font); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_sans}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.font.get_default_font", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_os); __Pyx_XDECREF(__pyx_v_default); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":54 * cdef int style * * def __cinit__(self): # <<<<<<<<<<<<<< * self.font = NULL * self.style = TTF_STYLE_NORMAL */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4font_4Font_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_4font_4Font_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font___cinit__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4font_4Font___cinit__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/font.pyx":55 * * def __cinit__(self): * self.font = NULL # <<<<<<<<<<<<<< * self.style = TTF_STYLE_NORMAL * */ __pyx_v_self->font = NULL; /* "pygame_sdl2/font.pyx":56 * def __cinit__(self): * self.font = NULL * self.style = TTF_STYLE_NORMAL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->style = TTF_STYLE_NORMAL; /* "pygame_sdl2/font.pyx":54 * cdef int style * * def __cinit__(self): # <<<<<<<<<<<<<< * self.font = NULL * self.style = TTF_STYLE_NORMAL */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/font.pyx":58 * self.style = TTF_STYLE_NORMAL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.font: * TTF_CloseFont(self.font) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_4font_4Font_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_4font_4Font_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_4font_4Font_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_4font_4Font_2__dealloc__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { int __pyx_t_1; /* "pygame_sdl2/font.pyx":59 * * def __dealloc__(self): * if self.font: # <<<<<<<<<<<<<< * TTF_CloseFont(self.font) * */ __pyx_t_1 = (__pyx_v_self->font != 0); if (__pyx_t_1) { /* "pygame_sdl2/font.pyx":60 * def __dealloc__(self): * if self.font: * TTF_CloseFont(self.font) # <<<<<<<<<<<<<< * * def __init__(self, fi, size): */ TTF_CloseFont(__pyx_v_self->font); /* "pygame_sdl2/font.pyx":59 * * def __dealloc__(self): * if self.font: # <<<<<<<<<<<<<< * TTF_CloseFont(self.font) * */ } /* "pygame_sdl2/font.pyx":58 * self.style = TTF_STYLE_NORMAL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.font: * TTF_CloseFont(self.font) */ /* function exit code */ } /* "pygame_sdl2/font.pyx":62 * TTF_CloseFont(self.font) * * def __init__(self, fi, size): # <<<<<<<<<<<<<< * if fi is None: * fi = get_default_font() */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4font_4Font_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_4font_4Font_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fi = 0; PyObject *__pyx_v_size = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 62, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 62, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(1, 62, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 62, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); } __pyx_v_fi = values[0]; __pyx_v_size = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 62, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_4__init__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_fi, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4font_4Font_4__init__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_size) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; SDL_RWops *__pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_fi); /* "pygame_sdl2/font.pyx":63 * * def __init__(self, fi, size): * if fi is None: # <<<<<<<<<<<<<< * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) */ __pyx_t_1 = (__pyx_v_fi == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/font.pyx":64 * def __init__(self, fi, size): * if fi is None: * fi = get_default_font() # <<<<<<<<<<<<<< * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_default_font); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_fi, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":63 * * def __init__(self, fi, size): * if fi is None: # <<<<<<<<<<<<<< * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) */ } /* "pygame_sdl2/font.pyx":65 * if fi is None: * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) # <<<<<<<<<<<<<< * if self.font == NULL: * raise error() */ __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_6 == ((SDL_RWops *)NULL))) __PYX_ERR(1, 65, __pyx_L1_error) __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L1_error) __pyx_v_self->font = TTF_OpenFontRW(__pyx_t_6, 1, __pyx_t_7); /* "pygame_sdl2/font.pyx":66 * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_self->font == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/font.pyx":67 * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: * raise error() # <<<<<<<<<<<<<< * * def render(self, text, antialias, color, background=None): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 67, __pyx_L1_error) /* "pygame_sdl2/font.pyx":66 * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/font.pyx":62 * TTF_CloseFont(self.font) * * def __init__(self, fi, size): # <<<<<<<<<<<<<< * if fi is None: * fi = get_default_font() */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.font.Font.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fi); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":69 * raise error() * * def render(self, text, antialias, color, background=None): # <<<<<<<<<<<<<< * cdef SDL_Surface *surf * cdef SDL_Color fg */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_7render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_6render, "Font.render(self, text, antialias, color, background=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_7render = {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_7render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_6render}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_7render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_text = 0; PyObject *__pyx_v_antialias = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_background = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,&__pyx_n_s_antialias,&__pyx_n_s_color,&__pyx_n_s_background,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_text)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 69, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_antialias)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, 1); __PYX_ERR(1, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, 2); __PYX_ERR(1, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_background); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 69, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "render") < 0)) __PYX_ERR(1, 69, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_text = values[0]; __pyx_v_antialias = values[1]; __pyx_v_color = values[2]; __pyx_v_background = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, __pyx_nargs); __PYX_ERR(1, 69, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_6render(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_text, __pyx_v_antialias, __pyx_v_color, __pyx_v_background); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_6render(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_antialias, PyObject *__pyx_v_color, PyObject *__pyx_v_background) { SDL_Surface *__pyx_v_surf; SDL_Color __pyx_v_fg; CYTHON_UNUSED PyObject *__pyx_v_w = NULL; PyObject *__pyx_v_h = NULL; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_v_bgsurf = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); char const *__pyx_t_9; char const *__pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 1); /* "pygame_sdl2/font.pyx":73 * cdef SDL_Color fg * * if not text: # <<<<<<<<<<<<<< * w, h = self.size(" ") * return Surface((0, h)) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 73, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":74 * * if not text: * w, h = self.size(" ") # <<<<<<<<<<<<<< * return Surface((0, h)) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s__2}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(1, 74, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(1, 74, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(1, 74, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_w = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_h = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":75 * if not text: * w, h = self.size(" ") * return Surface((0, h)) # <<<<<<<<<<<<<< * * to_sdl_color(color, &fg) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0)) __PYX_ERR(1, 75, __pyx_L1_error); __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_h)) __PYX_ERR(1, 75, __pyx_L1_error); __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":73 * cdef SDL_Color fg * * if not text: # <<<<<<<<<<<<<< * w, h = self.size(" ") * return Surface((0, h)) */ } /* "pygame_sdl2/font.pyx":77 * return Surface((0, h)) * * to_sdl_color(color, &fg) # <<<<<<<<<<<<<< * * TTF_SetFontStyle(self.font, self.style) */ __pyx_t_5 = __pyx_f_11pygame_sdl2_5color_to_sdl_color(__pyx_v_color, (&__pyx_v_fg)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":79 * to_sdl_color(color, &fg) * * TTF_SetFontStyle(self.font, self.style) # <<<<<<<<<<<<<< * if antialias: * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) */ TTF_SetFontStyle(__pyx_v_self->font, __pyx_v_self->style); /* "pygame_sdl2/font.pyx":80 * * TTF_SetFontStyle(self.font, self.style) * if antialias: # <<<<<<<<<<<<<< * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_antialias); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 80, __pyx_L1_error) if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":81 * TTF_SetFontStyle(self.font, self.style) * if antialias: * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) # <<<<<<<<<<<<<< * else: * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_utf_8}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_t_5); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(1, 81, __pyx_L1_error) __pyx_v_surf = TTF_RenderUTF8_Blended(__pyx_v_self->font, __pyx_t_9, __pyx_v_fg); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":80 * * TTF_SetFontStyle(self.font, self.style) * if antialias: # <<<<<<<<<<<<<< * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: */ goto __pyx_L6; } /* "pygame_sdl2/font.pyx":83 * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) # <<<<<<<<<<<<<< * * if surf == NULL: */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_utf_8}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_t_5); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(1, 83, __pyx_L1_error) __pyx_v_surf = TTF_RenderUTF8_Solid(__pyx_v_self->font, __pyx_t_10, __pyx_v_fg); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L6:; /* "pygame_sdl2/font.pyx":85 * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) * * if surf == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_surf == NULL); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/font.pyx":86 * * if surf == NULL: * raise error() # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(1, 86, __pyx_L1_error) /* "pygame_sdl2/font.pyx":85 * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) * * if surf == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/font.pyx":88 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":89 * * cdef Surface rv = Surface(()) * rv.take_surface(surf) # <<<<<<<<<<<<<< * * if rv.surface.format.BitsPerPixel != 32: */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_surf); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error) /* "pygame_sdl2/font.pyx":91 * rv.take_surface(surf) * * if rv.surface.format.BitsPerPixel != 32: # <<<<<<<<<<<<<< * rv = rv.convert() * */ __pyx_t_2 = (__pyx_v_rv->surface->format->BitsPerPixel != 32); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":92 * * if rv.surface.format.BitsPerPixel != 32: * rv = rv.convert() # <<<<<<<<<<<<<< * * if background is not None: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_convert); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(1, 92, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_rv, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_5)); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":91 * rv.take_surface(surf) * * if rv.surface.format.BitsPerPixel != 32: # <<<<<<<<<<<<<< * rv = rv.convert() * */ } /* "pygame_sdl2/font.pyx":94 * rv = rv.convert() * * if background is not None: # <<<<<<<<<<<<<< * bgsurf = rv.copy() * bgsurf.fill(background) */ __pyx_t_2 = (__pyx_v_background != Py_None); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":95 * * if background is not None: * bgsurf = rv.copy() # <<<<<<<<<<<<<< * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_bgsurf = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":96 * if background is not None: * bgsurf = rv.copy() * bgsurf.fill(background) # <<<<<<<<<<<<<< * bgsurf.blit(rv, (0,0)) * return bgsurf */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_bgsurf, __pyx_n_s_fill); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_background}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":97 * bgsurf = rv.copy() * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) # <<<<<<<<<<<<<< * return bgsurf * return rv */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_bgsurf, __pyx_n_s_blit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_rv), __pyx_tuple__4}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":98 * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) * return bgsurf # <<<<<<<<<<<<<< * return rv * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_bgsurf); __pyx_r = __pyx_v_bgsurf; goto __pyx_L0; /* "pygame_sdl2/font.pyx":94 * rv = rv.convert() * * if background is not None: # <<<<<<<<<<<<<< * bgsurf = rv.copy() * bgsurf.fill(background) */ } /* "pygame_sdl2/font.pyx":99 * bgsurf.blit(rv, (0,0)) * return bgsurf * return rv # <<<<<<<<<<<<<< * * def size(self, text): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/font.pyx":69 * raise error() * * def render(self, text, antialias, color, background=None): # <<<<<<<<<<<<<< * cdef SDL_Surface *surf * cdef SDL_Color fg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.font.Font.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_w); __Pyx_XDECREF(__pyx_v_h); __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XDECREF(__pyx_v_bgsurf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":101 * return rv * * def size(self, text): # <<<<<<<<<<<<<< * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_9size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_8size, "Font.size(self, text)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_9size = {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_9size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_8size}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_9size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_text = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("size (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_text)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 101, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "size") < 0)) __PYX_ERR(1, 101, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_text = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("size", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 101, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.size", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_8size(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_text); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_8size(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; char const *__pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("size", 1); /* "pygame_sdl2/font.pyx":103 * def size(self, text): * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * return w, h */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(1, 103, __pyx_L1_error) __pyx_t_6 = (TTF_SizeUTF8(__pyx_v_self->font, __pyx_t_5, (&__pyx_v_w), (&__pyx_v_h)) != 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_6)) { /* "pygame_sdl2/font.pyx":104 * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: * raise error() # <<<<<<<<<<<<<< * return w, h * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 104, __pyx_L1_error) /* "pygame_sdl2/font.pyx":103 * def size(self, text): * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * return w, h */ } /* "pygame_sdl2/font.pyx":105 * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: * raise error() * return w, h # <<<<<<<<<<<<<< * * cdef set_style(self, flag, on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 105, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":101 * return rv * * def size(self, text): # <<<<<<<<<<<<<< * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.font.Font.size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":107 * return w, h * * cdef set_style(self, flag, on): # <<<<<<<<<<<<<< * if on: * self.style |= flag */ static PyObject *__pyx_f_11pygame_sdl2_4font_4Font_set_style(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_style", 1); /* "pygame_sdl2/font.pyx":108 * * cdef set_style(self, flag, on): * if on: # <<<<<<<<<<<<<< * self.style |= flag * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_on); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 108, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/font.pyx":109 * cdef set_style(self, flag, on): * if on: * self.style |= flag # <<<<<<<<<<<<<< * else: * self.style &= ~flag */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->style); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_InPlaceOr(__pyx_t_2, __pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->style = __pyx_t_4; /* "pygame_sdl2/font.pyx":108 * * cdef set_style(self, flag, on): * if on: # <<<<<<<<<<<<<< * self.style |= flag * else: */ goto __pyx_L3; } /* "pygame_sdl2/font.pyx":111 * self.style |= flag * else: * self.style &= ~flag # <<<<<<<<<<<<<< * * def set_underline(self, on): */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->style); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Invert(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->style = __pyx_t_4; } __pyx_L3:; /* "pygame_sdl2/font.pyx":107 * return w, h * * cdef set_style(self, flag, on): # <<<<<<<<<<<<<< * if on: * self.style |= flag */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_style", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":113 * self.style &= ~flag * * def set_underline(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_UNDERLINE, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_10set_underline, "Font.set_underline(self, on)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_11set_underline = {"set_underline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_10set_underline}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_on = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_underline (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_on,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_on)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 113, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_underline") < 0)) __PYX_ERR(1, 113, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_on = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_underline", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 113, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.set_underline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_10set_underline(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_on); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_10set_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_underline", 1); /* "pygame_sdl2/font.pyx":114 * * def set_underline(self, on): * self.set_style(TTF_STYLE_UNDERLINE, on) # <<<<<<<<<<<<<< * * def get_underline(self): */ __pyx_t_1 = __Pyx_PyInt_From___pyx_anon_enum(TTF_STYLE_UNDERLINE); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":113 * self.style &= ~flag * * def set_underline(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_UNDERLINE, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_underline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":116 * self.set_style(TTF_STYLE_UNDERLINE, on) * * def get_underline(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_UNDERLINE * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_12get_underline, "Font.get_underline(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_13get_underline = {"get_underline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_12get_underline}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_underline (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_underline", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_underline", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_12get_underline(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_12get_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_underline", 1); /* "pygame_sdl2/font.pyx":117 * * def get_underline(self): * return self.style & TTF_STYLE_UNDERLINE # <<<<<<<<<<<<<< * * def set_bold(self, on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_UNDERLINE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":116 * self.set_style(TTF_STYLE_UNDERLINE, on) * * def get_underline(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_UNDERLINE * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_underline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":119 * return self.style & TTF_STYLE_UNDERLINE * * def set_bold(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_BOLD, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_14set_bold, "Font.set_bold(self, on)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_15set_bold = {"set_bold", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_14set_bold}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_on = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_bold (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_on,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_on)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 119, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_bold") < 0)) __PYX_ERR(1, 119, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_on = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_bold", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 119, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.set_bold", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_14set_bold(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_on); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_14set_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_bold", 1); /* "pygame_sdl2/font.pyx":120 * * def set_bold(self, on): * self.set_style(TTF_STYLE_BOLD, on) # <<<<<<<<<<<<<< * * def get_bold(self): */ __pyx_t_1 = __Pyx_PyInt_From___pyx_anon_enum(TTF_STYLE_BOLD); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":119 * return self.style & TTF_STYLE_UNDERLINE * * def set_bold(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_BOLD, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_bold", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":122 * self.set_style(TTF_STYLE_BOLD, on) * * def get_bold(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_BOLD * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_16get_bold, "Font.get_bold(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_17get_bold = {"get_bold", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_16get_bold}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bold (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_bold", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_bold", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_16get_bold(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_16get_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_bold", 1); /* "pygame_sdl2/font.pyx":123 * * def get_bold(self): * return self.style & TTF_STYLE_BOLD # <<<<<<<<<<<<<< * * def set_italic(self, on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_BOLD)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":122 * self.set_style(TTF_STYLE_BOLD, on) * * def get_bold(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_BOLD * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_bold", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":125 * return self.style & TTF_STYLE_BOLD * * def set_italic(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_ITALIC, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_18set_italic, "Font.set_italic(self, on)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_19set_italic = {"set_italic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_18set_italic}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_on = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_italic (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_on,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_on)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 125, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_italic") < 0)) __PYX_ERR(1, 125, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_on = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_italic", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 125, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.set_italic", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_18set_italic(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_on); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_18set_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_italic", 1); /* "pygame_sdl2/font.pyx":126 * * def set_italic(self, on): * self.set_style(TTF_STYLE_ITALIC, on) # <<<<<<<<<<<<<< * * def get_italic(self): */ __pyx_t_1 = __Pyx_PyInt_From___pyx_anon_enum(TTF_STYLE_ITALIC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":125 * return self.style & TTF_STYLE_BOLD * * def set_italic(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_ITALIC, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_italic", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":128 * self.set_style(TTF_STYLE_ITALIC, on) * * def get_italic(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_ITALIC * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_20get_italic, "Font.get_italic(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_21get_italic = {"get_italic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_20get_italic}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_italic (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_italic", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_italic", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_20get_italic(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_20get_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_italic", 1); /* "pygame_sdl2/font.pyx":129 * * def get_italic(self): * return self.style & TTF_STYLE_ITALIC # <<<<<<<<<<<<<< * * def get_linesize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_ITALIC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":128 * self.set_style(TTF_STYLE_ITALIC, on) * * def get_italic(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_ITALIC * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_italic", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":131 * return self.style & TTF_STYLE_ITALIC * * def get_linesize(self): # <<<<<<<<<<<<<< * return TTF_FontLineSkip(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_22get_linesize, "Font.get_linesize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_23get_linesize = {"get_linesize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_22get_linesize}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_linesize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_linesize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_linesize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_22get_linesize(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_22get_linesize(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_linesize", 1); /* "pygame_sdl2/font.pyx":132 * * def get_linesize(self): * return TTF_FontLineSkip(self.font) # <<<<<<<<<<<<<< * * def get_height(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontLineSkip(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":131 * return self.style & TTF_STYLE_ITALIC * * def get_linesize(self): # <<<<<<<<<<<<<< * return TTF_FontLineSkip(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_linesize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":134 * return TTF_FontLineSkip(self.font) * * def get_height(self): # <<<<<<<<<<<<<< * return TTF_FontHeight(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_25get_height(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_24get_height, "Font.get_height(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_25get_height = {"get_height", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_25get_height, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_24get_height}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_25get_height(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_height (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_height", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_height", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_24get_height(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_24get_height(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_height", 1); /* "pygame_sdl2/font.pyx":135 * * def get_height(self): * return TTF_FontHeight(self.font) # <<<<<<<<<<<<<< * * def get_ascent(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontHeight(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":134 * return TTF_FontLineSkip(self.font) * * def get_height(self): # <<<<<<<<<<<<<< * return TTF_FontHeight(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_height", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":137 * return TTF_FontHeight(self.font) * * def get_ascent(self): # <<<<<<<<<<<<<< * return TTF_FontAscent(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_26get_ascent, "Font.get_ascent(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_27get_ascent = {"get_ascent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_26get_ascent}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_ascent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_ascent", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_ascent", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_26get_ascent(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_26get_ascent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_ascent", 1); /* "pygame_sdl2/font.pyx":138 * * def get_ascent(self): * return TTF_FontAscent(self.font) # <<<<<<<<<<<<<< * * def get_descent(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontAscent(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":137 * return TTF_FontHeight(self.font) * * def get_ascent(self): # <<<<<<<<<<<<<< * return TTF_FontAscent(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_ascent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":140 * return TTF_FontAscent(self.font) * * def get_descent(self): # <<<<<<<<<<<<<< * return TTF_FontDescent(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_28get_descent, "Font.get_descent(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_29get_descent = {"get_descent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_28get_descent}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_descent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_descent", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_descent", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_28get_descent(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_28get_descent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_descent", 1); /* "pygame_sdl2/font.pyx":141 * * def get_descent(self): * return TTF_FontDescent(self.font) # <<<<<<<<<<<<<< * * def metrics(self, text not None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontDescent(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":140 * return TTF_FontAscent(self.font) * * def get_descent(self): # <<<<<<<<<<<<<< * return TTF_FontDescent(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_descent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":143 * return TTF_FontDescent(self.font) * * def metrics(self, text not None): # <<<<<<<<<<<<<< * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_31metrics(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_30metrics, "Font.metrics(self, text)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_31metrics = {"metrics", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_31metrics, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_30metrics}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_31metrics(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_text = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metrics (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_text)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 143, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "metrics") < 0)) __PYX_ERR(1, 143, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_text = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("metrics", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 143, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.metrics", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_text) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "text"); __PYX_ERR(1, 143, __pyx_L1_error) } __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_30metrics(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_text); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_30metrics(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text) { int __pyx_v_minx; int __pyx_v_maxx; int __pyx_v_miny; int __pyx_v_maxy; int __pyx_v_advance; uint16_t __pyx_v_chnum; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_ch = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; long __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metrics", 1); /* "pygame_sdl2/font.pyx":146 * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum * rv = [] # <<<<<<<<<<<<<< * * for ch in text: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":148 * rv = [] * * for ch in text: # <<<<<<<<<<<<<< * chnum = ord(ch) * */ if (likely(PyList_CheckExact(__pyx_v_text)) || PyTuple_CheckExact(__pyx_v_text)) { __pyx_t_1 = __pyx_v_text; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 148, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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(1, 148, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 148, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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(1, 148, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(1, 148, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_ch, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":149 * * for ch in text: * chnum = ord(ch) # <<<<<<<<<<<<<< * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: */ __pyx_t_5 = __Pyx_PyObject_Ord(__pyx_v_ch); if (unlikely(__pyx_t_5 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(1, 149, __pyx_L1_error) __pyx_v_chnum = __pyx_t_5; /* "pygame_sdl2/font.pyx":151 * chnum = ord(ch) * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: # <<<<<<<<<<<<<< * rv.append((minx, maxx, miny, maxy, advance)) * else: */ __pyx_t_6 = (TTF_GlyphMetrics(__pyx_v_self->font, __pyx_v_chnum, (&__pyx_v_minx), (&__pyx_v_maxx), (&__pyx_v_miny), (&__pyx_v_maxy), (&__pyx_v_advance)) == 0); if (__pyx_t_6) { /* "pygame_sdl2/font.pyx":152 * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: * rv.append((minx, maxx, miny, maxy, advance)) # <<<<<<<<<<<<<< * else: * rv.append(None) */ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minx); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_maxx); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_miny); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_maxy); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_advance); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(5); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4)) __PYX_ERR(1, 152, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7)) __PYX_ERR(1, 152, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_8)) __PYX_ERR(1, 152, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_11); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(1, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/font.pyx":151 * chnum = ord(ch) * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: # <<<<<<<<<<<<<< * rv.append((minx, maxx, miny, maxy, advance)) * else: */ goto __pyx_L5; } /* "pygame_sdl2/font.pyx":154 * rv.append((minx, maxx, miny, maxy, advance)) * else: * rv.append(None) # <<<<<<<<<<<<<< * * return rv */ /*else*/ { __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_rv, Py_None); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(1, 154, __pyx_L1_error) } __pyx_L5:; /* "pygame_sdl2/font.pyx":148 * rv = [] * * for ch in text: # <<<<<<<<<<<<<< * chnum = ord(ch) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":156 * rv.append(None) * * return rv # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/font.pyx":143 * return TTF_FontDescent(self.font) * * def metrics(self, text not None): # <<<<<<<<<<<<<< * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.font.Font.metrics", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_ch); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_33__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_32__reduce_cython__, "Font.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_33__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_32__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_33__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_32__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.font.Font.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_35__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4font_4Font_34__setstate_cython__, "Font.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_4Font_35__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_34__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_35__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.font.Font.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_34__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.font.Font.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_4font_Font __pyx_vtable_11pygame_sdl2_4font_Font; static PyObject *__pyx_tp_new_11pygame_sdl2_4font_Font(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_4font_Font *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_4font_Font *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_4font_Font; if (unlikely(__pyx_pw_11pygame_sdl2_4font_4Font_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_4font_Font(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_4font_Font) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_4font_4Font_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_11pygame_sdl2_4font_Font[] = { {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_7render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_6render}, {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_9size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_8size}, {"set_underline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_10set_underline}, {"get_underline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_12get_underline}, {"set_bold", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_14set_bold}, {"get_bold", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_16get_bold}, {"set_italic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_18set_italic}, {"get_italic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_20get_italic}, {"get_linesize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_22get_linesize}, {"get_height", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_25get_height, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_24get_height}, {"get_ascent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_26get_ascent}, {"get_descent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_28get_descent}, {"metrics", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_31metrics, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_30metrics}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_32__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4font_4Font_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4font_4Font_34__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_4font_Font_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_4font_Font}, {Py_tp_doc, (void *)PyDoc_STR("Font(fi, size)")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_4font_Font}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_4font_4Font_5__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_4font_Font}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_4font_Font_spec = { "pygame_sdl2.font.Font", sizeof(struct __pyx_obj_11pygame_sdl2_4font_Font), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_4font_Font_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_4font_Font = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.font.""Font", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_4font_Font), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_4font_Font, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Font(fi, size)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_4font_Font, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_4font_4Font_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_4font_Font, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, {&__pyx_kp_s_DejaVuSans_ttf, __pyx_k_DejaVuSans_ttf, sizeof(__pyx_k_DejaVuSans_ttf), 0, 0, 1, 0}, {&__pyx_n_s_Font, __pyx_k_Font, sizeof(__pyx_k_Font), 0, 0, 1, 1}, {&__pyx_n_s_Font___reduce_cython, __pyx_k_Font___reduce_cython, sizeof(__pyx_k_Font___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Font___setstate_cython, __pyx_k_Font___setstate_cython, sizeof(__pyx_k_Font___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_ascent, __pyx_k_Font_get_ascent, sizeof(__pyx_k_Font_get_ascent), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_bold, __pyx_k_Font_get_bold, sizeof(__pyx_k_Font_get_bold), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_descent, __pyx_k_Font_get_descent, sizeof(__pyx_k_Font_get_descent), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_height, __pyx_k_Font_get_height, sizeof(__pyx_k_Font_get_height), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_italic, __pyx_k_Font_get_italic, sizeof(__pyx_k_Font_get_italic), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_linesize, __pyx_k_Font_get_linesize, sizeof(__pyx_k_Font_get_linesize), 0, 0, 1, 1}, {&__pyx_n_s_Font_get_underline, __pyx_k_Font_get_underline, sizeof(__pyx_k_Font_get_underline), 0, 0, 1, 1}, {&__pyx_n_s_Font_metrics, __pyx_k_Font_metrics, sizeof(__pyx_k_Font_metrics), 0, 0, 1, 1}, {&__pyx_n_s_Font_render, __pyx_k_Font_render, sizeof(__pyx_k_Font_render), 0, 0, 1, 1}, {&__pyx_n_s_Font_set_bold, __pyx_k_Font_set_bold, sizeof(__pyx_k_Font_set_bold), 0, 0, 1, 1}, {&__pyx_n_s_Font_set_italic, __pyx_k_Font_set_italic, sizeof(__pyx_k_Font_set_italic), 0, 0, 1, 1}, {&__pyx_n_s_Font_set_underline, __pyx_k_Font_set_underline, sizeof(__pyx_k_Font_set_underline), 0, 0, 1, 1}, {&__pyx_n_s_Font_size, __pyx_k_Font_size, sizeof(__pyx_k_Font_size), 0, 0, 1, 1}, {&__pyx_n_s_SysFont, __pyx_k_SysFont, sizeof(__pyx_k_SysFont), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_n_s__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 1, 1}, {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, {&__pyx_n_s_advance, __pyx_k_advance, sizeof(__pyx_k_advance), 0, 0, 1, 1}, {&__pyx_n_s_antialias, __pyx_k_antialias, sizeof(__pyx_k_antialias), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_background, __pyx_k_background, sizeof(__pyx_k_background), 0, 0, 1, 1}, {&__pyx_n_s_bgsurf, __pyx_k_bgsurf, sizeof(__pyx_k_bgsurf), 0, 0, 1, 1}, {&__pyx_n_s_blit, __pyx_k_blit, sizeof(__pyx_k_blit), 0, 0, 1, 1}, {&__pyx_n_s_ch, __pyx_k_ch, sizeof(__pyx_k_ch), 0, 0, 1, 1}, {&__pyx_n_s_chnum, __pyx_k_chnum, sizeof(__pyx_k_chnum), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, {&__pyx_n_s_fg, __pyx_k_fg, sizeof(__pyx_k_fg), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_ascent, __pyx_k_get_ascent, sizeof(__pyx_k_get_ascent), 0, 0, 1, 1}, {&__pyx_n_s_get_bold, __pyx_k_get_bold, sizeof(__pyx_k_get_bold), 0, 0, 1, 1}, {&__pyx_n_s_get_default_font, __pyx_k_get_default_font, sizeof(__pyx_k_get_default_font), 0, 0, 1, 1}, {&__pyx_n_s_get_descent, __pyx_k_get_descent, sizeof(__pyx_k_get_descent), 0, 0, 1, 1}, {&__pyx_n_s_get_fonts, __pyx_k_get_fonts, sizeof(__pyx_k_get_fonts), 0, 0, 1, 1}, {&__pyx_n_s_get_height, __pyx_k_get_height, sizeof(__pyx_k_get_height), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_italic, __pyx_k_get_italic, sizeof(__pyx_k_get_italic), 0, 0, 1, 1}, {&__pyx_n_s_get_linesize, __pyx_k_get_linesize, sizeof(__pyx_k_get_linesize), 0, 0, 1, 1}, {&__pyx_n_s_get_underline, __pyx_k_get_underline, sizeof(__pyx_k_get_underline), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_match_font, __pyx_k_match_font, sizeof(__pyx_k_match_font), 0, 0, 1, 1}, {&__pyx_n_s_maxx, __pyx_k_maxx, sizeof(__pyx_k_maxx), 0, 0, 1, 1}, {&__pyx_n_s_maxy, __pyx_k_maxy, sizeof(__pyx_k_maxy), 0, 0, 1, 1}, {&__pyx_n_s_metrics, __pyx_k_metrics, sizeof(__pyx_k_metrics), 0, 0, 1, 1}, {&__pyx_n_s_minx, __pyx_k_minx, sizeof(__pyx_k_minx), 0, 0, 1, 1}, {&__pyx_n_s_miny, __pyx_k_miny, sizeof(__pyx_k_miny), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_on, __pyx_k_on, sizeof(__pyx_k_on), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_font, __pyx_k_pygame_sdl2_font, sizeof(__pyx_k_pygame_sdl2_font), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_sysfont, __pyx_k_pygame_sdl2_sysfont, sizeof(__pyx_k_pygame_sdl2_sysfont), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_render, __pyx_k_render, sizeof(__pyx_k_render), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_sans, __pyx_k_sans, sizeof(__pyx_k_sans), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_bold, __pyx_k_set_bold, sizeof(__pyx_k_set_bold), 0, 0, 1, 1}, {&__pyx_n_s_set_italic, __pyx_k_set_italic, sizeof(__pyx_k_set_italic), 0, 0, 1, 1}, {&__pyx_n_s_set_underline, __pyx_k_set_underline, sizeof(__pyx_k_set_underline), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_k_src_pygame_sdl2_font_pyx, sizeof(__pyx_k_src_pygame_sdl2_font_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_surf, __pyx_k_surf, sizeof(__pyx_k_surf), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/font.pyx":88 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/font.pyx":97 * bgsurf = rv.copy() * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) # <<<<<<<<<<<<<< * return bgsurf * return rv */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/font.pyx":29 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * TTF_Init() */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_init, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 29, __pyx_L1_error) /* "pygame_sdl2/font.pyx":33 * TTF_Init() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * TTF_Quit() */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_quit, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(1, 33, __pyx_L1_error) /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_init, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 37, __pyx_L1_error) /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_os, __pyx_n_s_default); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_default_font, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 40, __pyx_L1_error) /* "pygame_sdl2/font.pyx":69 * raise error() * * def render(self, text, antialias, color, background=None): # <<<<<<<<<<<<<< * cdef SDL_Surface *surf * cdef SDL_Color fg */ __pyx_tuple__11 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_antialias, __pyx_n_s_color, __pyx_n_s_background, __pyx_n_s_surf, __pyx_n_s_fg, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_rv, __pyx_n_s_bgsurf); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_render, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 69, __pyx_L1_error) __pyx_tuple__13 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "pygame_sdl2/font.pyx":101 * return rv * * def size(self, text): # <<<<<<<<<<<<<< * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: */ __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_w, __pyx_n_s_h); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_size, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 101, __pyx_L1_error) /* "pygame_sdl2/font.pyx":113 * self.style &= ~flag * * def set_underline(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_UNDERLINE, on) * */ __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_on); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_set_underline, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 113, __pyx_L1_error) /* "pygame_sdl2/font.pyx":116 * self.set_style(TTF_STYLE_UNDERLINE, on) * * def get_underline(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_UNDERLINE * */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_underline, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(1, 116, __pyx_L1_error) /* "pygame_sdl2/font.pyx":119 * return self.style & TTF_STYLE_UNDERLINE * * def set_bold(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_BOLD, on) * */ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_set_bold, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 119, __pyx_L1_error) /* "pygame_sdl2/font.pyx":122 * self.set_style(TTF_STYLE_BOLD, on) * * def get_bold(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_BOLD * */ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_bold, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 122, __pyx_L1_error) /* "pygame_sdl2/font.pyx":125 * return self.style & TTF_STYLE_BOLD * * def set_italic(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_ITALIC, on) * */ __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_set_italic, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 125, __pyx_L1_error) /* "pygame_sdl2/font.pyx":128 * self.set_style(TTF_STYLE_ITALIC, on) * * def get_italic(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_ITALIC * */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_italic, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 128, __pyx_L1_error) /* "pygame_sdl2/font.pyx":131 * return self.style & TTF_STYLE_ITALIC * * def get_linesize(self): # <<<<<<<<<<<<<< * return TTF_FontLineSkip(self.font) * */ __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_linesize, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 131, __pyx_L1_error) /* "pygame_sdl2/font.pyx":134 * return TTF_FontLineSkip(self.font) * * def get_height(self): # <<<<<<<<<<<<<< * return TTF_FontHeight(self.font) * */ __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_height, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 134, __pyx_L1_error) /* "pygame_sdl2/font.pyx":137 * return TTF_FontHeight(self.font) * * def get_ascent(self): # <<<<<<<<<<<<<< * return TTF_FontAscent(self.font) * */ __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_ascent, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(1, 137, __pyx_L1_error) /* "pygame_sdl2/font.pyx":140 * return TTF_FontAscent(self.font) * * def get_descent(self): # <<<<<<<<<<<<<< * return TTF_FontDescent(self.font) * */ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_descent, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(1, 140, __pyx_L1_error) /* "pygame_sdl2/font.pyx":143 * return TTF_FontDescent(self.font) * * def metrics(self, text not None): # <<<<<<<<<<<<<< * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum */ __pyx_tuple__28 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_minx, __pyx_n_s_maxx, __pyx_n_s_miny, __pyx_n_s_maxy, __pyx_n_s_advance, __pyx_n_s_chnum, __pyx_n_s_rv, __pyx_n_s_ch); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_metrics, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(1, 143, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_4font_Font = &__pyx_vtable_11pygame_sdl2_4font_Font; __pyx_vtable_11pygame_sdl2_4font_Font.set_style = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_4font_Font *, PyObject *, PyObject *))__pyx_f_11pygame_sdl2_4font_4Font_set_style; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_4font_Font = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_4font_Font_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_4font_Font)) __PYX_ERR(1, 50, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_4font_Font_spec, __pyx_ptype_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_4font_Font = &__pyx_type_11pygame_sdl2_4font_Font; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_4font_Font->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_4font_Font->tp_dictoffset && __pyx_ptype_11pygame_sdl2_4font_Font->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_4font_Font->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_vtabptr_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Font, (PyObject *) __pyx_ptype_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.color"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_5color_Color),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_5color_Color) __PYX_ERR(3, 26, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.color"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "to_sdl_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_to_sdl_color, "PyObject *(PyObject *, SDL_Color *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_font(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_font}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "font", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initfont(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initfont(void) #else __Pyx_PyMODINIT_FUNC PyInit_font(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_font(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_font(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'font' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("font", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "font" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_font(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__font) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.font")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.font", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "pygame_sdl2/font.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * from pygame_sdl2.sysfont import SysFont, match_font, get_fonts # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * import pygame_sdl2 */ __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_SysFont); __Pyx_GIVEREF(__pyx_n_s_SysFont); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SysFont)) __PYX_ERR(1, 25, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_match_font); __Pyx_GIVEREF(__pyx_n_s_match_font); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_match_font)) __PYX_ERR(1, 25, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_get_fonts); __Pyx_GIVEREF(__pyx_n_s_get_fonts); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_get_fonts)) __PYX_ERR(1, 25, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_sysfont, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_SysFont); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SysFont, __pyx_t_2) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_match_font); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_match_font, __pyx_t_2) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_get_fonts); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_fonts, __pyx_t_2) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":26 * * from pygame_sdl2.sysfont import SysFont, match_font, get_fonts * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error)) __PYX_ERR(1, 26, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":27 * from pygame_sdl2.sysfont import SysFont, match_font, get_fonts * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":29 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * TTF_Init() */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":33 * TTF_Init() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * TTF_Quit() */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_3quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_3) < 0) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_5get_init, 0, __pyx_n_s_get_init, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_3) < 0) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_7get_default_font, 0, __pyx_n_s_get_default_font, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_default_font, __pyx_t_3) < 0) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":69 * raise error() * * def render(self, text, antialias, color, background=None): # <<<<<<<<<<<<<< * cdef SDL_Surface *surf * cdef SDL_Color fg */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_7render, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_render, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_render, __pyx_t_3) < 0) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":101 * return rv * * def size(self, text): # <<<<<<<<<<<<<< * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_9size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_size, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_size, __pyx_t_3) < 0) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":113 * self.style &= ~flag * * def set_underline(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_UNDERLINE, on) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_11set_underline, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_set_underline, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_set_underline, __pyx_t_3) < 0) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":116 * self.set_style(TTF_STYLE_UNDERLINE, on) * * def get_underline(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_UNDERLINE * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_13get_underline, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_underline, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_underline, __pyx_t_3) < 0) __PYX_ERR(1, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":119 * return self.style & TTF_STYLE_UNDERLINE * * def set_bold(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_BOLD, on) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_15set_bold, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_set_bold, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_set_bold, __pyx_t_3) < 0) __PYX_ERR(1, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":122 * self.set_style(TTF_STYLE_BOLD, on) * * def get_bold(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_BOLD * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_17get_bold, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_bold, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_bold, __pyx_t_3) < 0) __PYX_ERR(1, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":125 * return self.style & TTF_STYLE_BOLD * * def set_italic(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_ITALIC, on) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_19set_italic, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_set_italic, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_set_italic, __pyx_t_3) < 0) __PYX_ERR(1, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":128 * self.set_style(TTF_STYLE_ITALIC, on) * * def get_italic(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_ITALIC * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_21get_italic, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_italic, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_italic, __pyx_t_3) < 0) __PYX_ERR(1, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":131 * return self.style & TTF_STYLE_ITALIC * * def get_linesize(self): # <<<<<<<<<<<<<< * return TTF_FontLineSkip(self.font) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_23get_linesize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_linesize, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_linesize, __pyx_t_3) < 0) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":134 * return TTF_FontLineSkip(self.font) * * def get_height(self): # <<<<<<<<<<<<<< * return TTF_FontHeight(self.font) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_25get_height, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_height, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_height, __pyx_t_3) < 0) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":137 * return TTF_FontHeight(self.font) * * def get_ascent(self): # <<<<<<<<<<<<<< * return TTF_FontAscent(self.font) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_27get_ascent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_ascent, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_ascent, __pyx_t_3) < 0) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":140 * return TTF_FontAscent(self.font) * * def get_descent(self): # <<<<<<<<<<<<<< * return TTF_FontDescent(self.font) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_29get_descent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_get_descent, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_get_descent, __pyx_t_3) < 0) __PYX_ERR(1, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "pygame_sdl2/font.pyx":143 * return TTF_FontDescent(self.font) * * def metrics(self, text not None): # <<<<<<<<<<<<<< * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_31metrics, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font_metrics, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4font_Font, __pyx_n_s_metrics, __pyx_t_3) < 0) __PYX_ERR(1, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4font_Font); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_33__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4font_4Font_35__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Font___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_font, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.font", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.font"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s_; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* UnicodeAsUCS4 */ static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { Py_ssize_t length; #if CYTHON_PEP393_ENABLED length = PyUnicode_GET_LENGTH(x); if (likely(length == 1)) { return PyUnicode_READ_CHAR(x, 0); } #else length = PyUnicode_GET_SIZE(x); if (likely(length == 1)) { return PyUnicode_AS_UNICODE(x)[0]; } #if Py_UNICODE_SIZE == 2 else if (PyUnicode_GET_SIZE(x) == 2) { Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0]; if (high_val >= 0xD800 && high_val <= 0xDBFF) { Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; if (low_val >= 0xDC00 && low_val <= 0xDFFF) { return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); } } } #endif #endif PyErr_Format(PyExc_ValueError, "only single character unicode strings can be converted to Py_UCS4, " "got length %" CYTHON_FORMAT_SSIZE_T "d", length); return (Py_UCS4)-1; } /* object_ord */ static long __Pyx__PyObject_Ord(PyObject* c) { Py_ssize_t size; if (PyBytes_Check(c)) { size = PyBytes_GET_SIZE(c); if (likely(size == 1)) { return (unsigned char) PyBytes_AS_STRING(c)[0]; } #if PY_MAJOR_VERSION < 3 } else if (PyUnicode_Check(c)) { return (long)__Pyx_PyUnicode_AsPy_UCS4(c); #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) } else if (PyByteArray_Check(c)) { size = PyByteArray_GET_SIZE(c); if (likely(size == 1)) { return (unsigned char) PyByteArray_AS_STRING(c)[0]; } #endif } else { __Pyx_TypeName c_type_name = __Pyx_PyType_GetName(Py_TYPE(c)); PyErr_Format(PyExc_TypeError, "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found", c_type_name); __Pyx_DECREF_TypeName(c_type_name); return (long)(Py_UCS4)-1; } PyErr_Format(PyExc_TypeError, "ord() expected a character, but string of length %zd found", size); return (long)(Py_UCS4)-1; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetVTable */ static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { PyObject *ob = PyCapsule_New(vtable, 0, 0); if (unlikely(!ob)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* MergeVTables */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type) { int i; void** base_vtables; __Pyx_TypeName tp_base_name; __Pyx_TypeName base_name; void* unknown = (void*)-1; PyObject* bases = type->tp_bases; int base_depth = 0; { PyTypeObject* base = type->tp_base; while (base) { base_depth += 1; base = base->tp_base; } } base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); if (base_vtable != NULL) { int j; PyTypeObject* base = type->tp_base; for (j = 0; j < base_depth; j++) { if (base_vtables[j] == unknown) { base_vtables[j] = __Pyx_GetVtable(base); base_vtables[j + 1] = unknown; } if (base_vtables[j] == base_vtable) { break; } else if (base_vtables[j] == NULL) { goto bad; } base = base->tp_base; } } } PyErr_Clear(); free(base_vtables); return 0; bad: tp_base_name = __Pyx_PyType_GetName(type->tp_base); base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); free(base_vtables); return -1; } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_12 #define __PYX_HAVE_RT_ImportType_3_0_12 static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__5); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__33); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12 #define __PYX_HAVE_RT_ImportFunction_3_0_12 static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635913.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.gfxdraw.c0000664000175000017500000257003415026112611020541 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__gfxdraw #define __PYX_HAVE_API__pygame_sdl2__gfxdraw /* Early includes */ #include #include #include #include #include "SDL.h" #include "SDL2_rotozoom.h" #include "SDL_gfxPrimitives.h" #include #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/gfxdraw.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/color.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_5color_Color; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 #define __PYX_HAVE_RT_ImportType_proto_3_0_12 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_12 { __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_gfx" */ /* Module declarations from "libc.stdlib" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.color" */ /* Module declarations from "pygame_sdl2.gfxdraw" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.gfxdraw" extern int __pyx_module_is_main_pygame_sdl2__gfxdraw; int __pyx_module_is_main_pygame_sdl2__gfxdraw = 0; /* Implementation of "pygame_sdl2.gfxdraw" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_range; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; static const char __pyx_k_c[] = "c"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k_pt[] = "pt"; static const char __pyx_k_rx[] = "rx"; static const char __pyx_k_ry[] = "ry"; static const char __pyx_k_tx[] = "tx"; static const char __pyx_k_ty[] = "ty"; static const char __pyx_k_vx[] = "vx"; static const char __pyx_k_vy[] = "vy"; static const char __pyx_k_x1[] = "x1"; static const char __pyx_k_x2[] = "x2"; static const char __pyx_k_x3[] = "x3"; static const char __pyx_k_y1[] = "y1"; static const char __pyx_k_y2[] = "y2"; static const char __pyx_k_y3[] = "y3"; static const char __pyx_k__43[] = "?"; static const char __pyx_k_arc[] = "arc"; static const char __pyx_k_box[] = "box"; static const char __pyx_k_end[] = "end"; static const char __pyx_k_pie[] = "pie"; static const char __pyx_k_rad[] = "rad"; static const char __pyx_k_zip[] = "zip"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_line[] = "line"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_color[] = "color"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_hline[] = "hline"; static const char __pyx_k_pixel[] = "pixel"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_steps[] = "steps"; static const char __pyx_k_vline[] = "vline"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_x1int[] = "x1int"; static const char __pyx_k_x2int[] = "x2int"; static const char __pyx_k_y1int[] = "y1int"; static const char __pyx_k_y2int[] = "y2int"; static const char __pyx_k_aaline[] = "aaline"; static const char __pyx_k_bezier[] = "bezier"; static const char __pyx_k_circle[] = "circle"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_points[] = "points"; static const char __pyx_k_trigon[] = "trigon"; static const char __pyx_k_ellipse[] = "ellipse"; static const char __pyx_k_polygon[] = "polygon"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_texture[] = "texture"; static const char __pyx_k_aacircle[] = "aacircle"; static const char __pyx_k_aatrigon[] = "aatrigon"; static const char __pyx_k_aaellipse[] = "aaellipse"; static const char __pyx_k_aapolygon[] = "aapolygon"; static const char __pyx_k_rectangle[] = "rectangle"; static const char __pyx_k_filled_pie[] = "filled_pie"; static const char __pyx_k_num_points[] = "num_points"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_thick_line[] = "thick_line"; static const char __pyx_k_rounded_box[] = "rounded_box"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_filled_circle[] = "filled_circle"; static const char __pyx_k_filled_trigon[] = "filled_trigon"; static const char __pyx_k_filled_ellipse[] = "filled_ellipse"; static const char __pyx_k_filled_polygon[] = "filled_polygon"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_textured_polygon[] = "textured_polygon"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_rounded_rectangle[] = "rounded_rectangle"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_gfxdraw[] = "pygame_sdl2.gfxdraw"; static const char __pyx_k_src_pygame_sdl2_gfxdraw_pyx[] = "src/pygame_sdl2/gfxdraw.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_pixel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_2hline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_4vline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y1, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_10box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_14line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_width, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_20circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_22arc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_34pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture, PyObject *__pyx_v_tx, PyObject *__pyx_v_ty); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_steps, PyObject *__pyx_v_color); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color; #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_u_; PyObject *__pyx_n_s_Rect; PyObject *__pyx_n_s__43; PyObject *__pyx_n_s_aacircle; PyObject *__pyx_n_s_aaellipse; PyObject *__pyx_n_s_aaline; PyObject *__pyx_n_s_aapolygon; PyObject *__pyx_n_s_aatrigon; PyObject *__pyx_n_s_arc; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_bezier; PyObject *__pyx_n_s_box; PyObject *__pyx_n_s_c; PyObject *__pyx_n_s_circle; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_color; PyObject *__pyx_n_s_ellipse; PyObject *__pyx_n_s_end; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_filled_circle; PyObject *__pyx_n_s_filled_ellipse; PyObject *__pyx_n_s_filled_pie; PyObject *__pyx_n_s_filled_polygon; PyObject *__pyx_n_s_filled_trigon; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_hline; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_line; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_num_points; PyObject *__pyx_n_s_pie; PyObject *__pyx_n_s_pixel; PyObject *__pyx_n_s_points; PyObject *__pyx_n_s_polygon; PyObject *__pyx_n_s_pt; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_gfxdraw; PyObject *__pyx_n_s_pygame_sdl2_rect; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_rad; PyObject *__pyx_n_s_range; PyObject *__pyx_n_s_rect; PyObject *__pyx_n_s_rectangle; PyObject *__pyx_n_s_rounded_box; PyObject *__pyx_n_s_rounded_rectangle; PyObject *__pyx_n_s_rx; PyObject *__pyx_n_s_ry; PyObject *__pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_steps; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_texture; PyObject *__pyx_n_s_textured_polygon; PyObject *__pyx_n_s_thick_line; PyObject *__pyx_n_s_trigon; PyObject *__pyx_n_s_tx; PyObject *__pyx_n_s_ty; PyObject *__pyx_n_s_vline; PyObject *__pyx_n_s_vx; PyObject *__pyx_n_s_vy; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_width; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_x1; PyObject *__pyx_n_s_x1int; PyObject *__pyx_n_s_x2; PyObject *__pyx_n_s_x2int; PyObject *__pyx_n_s_x3; PyObject *__pyx_n_s_y; PyObject *__pyx_n_s_y1; PyObject *__pyx_n_s_y1int; PyObject *__pyx_n_s_y2; PyObject *__pyx_n_s_y2int; PyObject *__pyx_n_s_y3; PyObject *__pyx_n_s_zip; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__35; PyObject *__pyx_tuple__39; PyObject *__pyx_tuple__41; PyObject *__pyx_codeobj__3; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__24; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__37; PyObject *__pyx_codeobj__38; PyObject *__pyx_codeobj__40; PyObject *__pyx_codeobj__42; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_n_s_Rect); Py_CLEAR(clear_module_state->__pyx_n_s__43); Py_CLEAR(clear_module_state->__pyx_n_s_aacircle); Py_CLEAR(clear_module_state->__pyx_n_s_aaellipse); Py_CLEAR(clear_module_state->__pyx_n_s_aaline); Py_CLEAR(clear_module_state->__pyx_n_s_aapolygon); Py_CLEAR(clear_module_state->__pyx_n_s_aatrigon); Py_CLEAR(clear_module_state->__pyx_n_s_arc); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_bezier); Py_CLEAR(clear_module_state->__pyx_n_s_box); Py_CLEAR(clear_module_state->__pyx_n_s_c); Py_CLEAR(clear_module_state->__pyx_n_s_circle); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_color); Py_CLEAR(clear_module_state->__pyx_n_s_ellipse); Py_CLEAR(clear_module_state->__pyx_n_s_end); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_filled_circle); Py_CLEAR(clear_module_state->__pyx_n_s_filled_ellipse); Py_CLEAR(clear_module_state->__pyx_n_s_filled_pie); Py_CLEAR(clear_module_state->__pyx_n_s_filled_polygon); Py_CLEAR(clear_module_state->__pyx_n_s_filled_trigon); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_hline); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_line); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_num_points); Py_CLEAR(clear_module_state->__pyx_n_s_pie); Py_CLEAR(clear_module_state->__pyx_n_s_pixel); Py_CLEAR(clear_module_state->__pyx_n_s_points); Py_CLEAR(clear_module_state->__pyx_n_s_polygon); Py_CLEAR(clear_module_state->__pyx_n_s_pt); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_gfxdraw); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rect); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_rad); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_s_rect); Py_CLEAR(clear_module_state->__pyx_n_s_rectangle); Py_CLEAR(clear_module_state->__pyx_n_s_rounded_box); Py_CLEAR(clear_module_state->__pyx_n_s_rounded_rectangle); Py_CLEAR(clear_module_state->__pyx_n_s_rx); Py_CLEAR(clear_module_state->__pyx_n_s_ry); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_steps); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_texture); Py_CLEAR(clear_module_state->__pyx_n_s_textured_polygon); Py_CLEAR(clear_module_state->__pyx_n_s_thick_line); Py_CLEAR(clear_module_state->__pyx_n_s_trigon); Py_CLEAR(clear_module_state->__pyx_n_s_tx); Py_CLEAR(clear_module_state->__pyx_n_s_ty); Py_CLEAR(clear_module_state->__pyx_n_s_vline); Py_CLEAR(clear_module_state->__pyx_n_s_vx); Py_CLEAR(clear_module_state->__pyx_n_s_vy); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_x1); Py_CLEAR(clear_module_state->__pyx_n_s_x1int); Py_CLEAR(clear_module_state->__pyx_n_s_x2); Py_CLEAR(clear_module_state->__pyx_n_s_x2int); Py_CLEAR(clear_module_state->__pyx_n_s_x3); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_n_s_y1); Py_CLEAR(clear_module_state->__pyx_n_s_y1int); Py_CLEAR(clear_module_state->__pyx_n_s_y2); Py_CLEAR(clear_module_state->__pyx_n_s_y2int); Py_CLEAR(clear_module_state->__pyx_n_s_y3); Py_CLEAR(clear_module_state->__pyx_n_s_zip); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__35); Py_CLEAR(clear_module_state->__pyx_tuple__39); Py_CLEAR(clear_module_state->__pyx_tuple__41); Py_CLEAR(clear_module_state->__pyx_codeobj__3); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__24); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__37); Py_CLEAR(clear_module_state->__pyx_codeobj__38); Py_CLEAR(clear_module_state->__pyx_codeobj__40); Py_CLEAR(clear_module_state->__pyx_codeobj__42); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_n_s_Rect); Py_VISIT(traverse_module_state->__pyx_n_s__43); Py_VISIT(traverse_module_state->__pyx_n_s_aacircle); Py_VISIT(traverse_module_state->__pyx_n_s_aaellipse); Py_VISIT(traverse_module_state->__pyx_n_s_aaline); Py_VISIT(traverse_module_state->__pyx_n_s_aapolygon); Py_VISIT(traverse_module_state->__pyx_n_s_aatrigon); Py_VISIT(traverse_module_state->__pyx_n_s_arc); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_bezier); Py_VISIT(traverse_module_state->__pyx_n_s_box); Py_VISIT(traverse_module_state->__pyx_n_s_c); Py_VISIT(traverse_module_state->__pyx_n_s_circle); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_color); Py_VISIT(traverse_module_state->__pyx_n_s_ellipse); Py_VISIT(traverse_module_state->__pyx_n_s_end); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_filled_circle); Py_VISIT(traverse_module_state->__pyx_n_s_filled_ellipse); Py_VISIT(traverse_module_state->__pyx_n_s_filled_pie); Py_VISIT(traverse_module_state->__pyx_n_s_filled_polygon); Py_VISIT(traverse_module_state->__pyx_n_s_filled_trigon); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_hline); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_line); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_num_points); Py_VISIT(traverse_module_state->__pyx_n_s_pie); Py_VISIT(traverse_module_state->__pyx_n_s_pixel); Py_VISIT(traverse_module_state->__pyx_n_s_points); Py_VISIT(traverse_module_state->__pyx_n_s_polygon); Py_VISIT(traverse_module_state->__pyx_n_s_pt); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_gfxdraw); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rect); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_rad); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_s_rect); Py_VISIT(traverse_module_state->__pyx_n_s_rectangle); Py_VISIT(traverse_module_state->__pyx_n_s_rounded_box); Py_VISIT(traverse_module_state->__pyx_n_s_rounded_rectangle); Py_VISIT(traverse_module_state->__pyx_n_s_rx); Py_VISIT(traverse_module_state->__pyx_n_s_ry); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_steps); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_texture); Py_VISIT(traverse_module_state->__pyx_n_s_textured_polygon); Py_VISIT(traverse_module_state->__pyx_n_s_thick_line); Py_VISIT(traverse_module_state->__pyx_n_s_trigon); Py_VISIT(traverse_module_state->__pyx_n_s_tx); Py_VISIT(traverse_module_state->__pyx_n_s_ty); Py_VISIT(traverse_module_state->__pyx_n_s_vline); Py_VISIT(traverse_module_state->__pyx_n_s_vx); Py_VISIT(traverse_module_state->__pyx_n_s_vy); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_x1); Py_VISIT(traverse_module_state->__pyx_n_s_x1int); Py_VISIT(traverse_module_state->__pyx_n_s_x2); Py_VISIT(traverse_module_state->__pyx_n_s_x2int); Py_VISIT(traverse_module_state->__pyx_n_s_x3); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_n_s_y1); Py_VISIT(traverse_module_state->__pyx_n_s_y1int); Py_VISIT(traverse_module_state->__pyx_n_s_y2); Py_VISIT(traverse_module_state->__pyx_n_s_y2int); Py_VISIT(traverse_module_state->__pyx_n_s_y3); Py_VISIT(traverse_module_state->__pyx_n_s_zip); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__35); Py_VISIT(traverse_module_state->__pyx_tuple__39); Py_VISIT(traverse_module_state->__pyx_tuple__41); Py_VISIT(traverse_module_state->__pyx_codeobj__3); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__24); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__37); Py_VISIT(traverse_module_state->__pyx_codeobj__38); Py_VISIT(traverse_module_state->__pyx_codeobj__40); Py_VISIT(traverse_module_state->__pyx_codeobj__42); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_5color_Color __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5color_Color #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_n_s_Rect __pyx_mstate_global->__pyx_n_s_Rect #define __pyx_n_s__43 __pyx_mstate_global->__pyx_n_s__43 #define __pyx_n_s_aacircle __pyx_mstate_global->__pyx_n_s_aacircle #define __pyx_n_s_aaellipse __pyx_mstate_global->__pyx_n_s_aaellipse #define __pyx_n_s_aaline __pyx_mstate_global->__pyx_n_s_aaline #define __pyx_n_s_aapolygon __pyx_mstate_global->__pyx_n_s_aapolygon #define __pyx_n_s_aatrigon __pyx_mstate_global->__pyx_n_s_aatrigon #define __pyx_n_s_arc __pyx_mstate_global->__pyx_n_s_arc #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_bezier __pyx_mstate_global->__pyx_n_s_bezier #define __pyx_n_s_box __pyx_mstate_global->__pyx_n_s_box #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c #define __pyx_n_s_circle __pyx_mstate_global->__pyx_n_s_circle #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_color __pyx_mstate_global->__pyx_n_s_color #define __pyx_n_s_ellipse __pyx_mstate_global->__pyx_n_s_ellipse #define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_filled_circle __pyx_mstate_global->__pyx_n_s_filled_circle #define __pyx_n_s_filled_ellipse __pyx_mstate_global->__pyx_n_s_filled_ellipse #define __pyx_n_s_filled_pie __pyx_mstate_global->__pyx_n_s_filled_pie #define __pyx_n_s_filled_polygon __pyx_mstate_global->__pyx_n_s_filled_polygon #define __pyx_n_s_filled_trigon __pyx_mstate_global->__pyx_n_s_filled_trigon #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_hline __pyx_mstate_global->__pyx_n_s_hline #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_line __pyx_mstate_global->__pyx_n_s_line #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_num_points __pyx_mstate_global->__pyx_n_s_num_points #define __pyx_n_s_pie __pyx_mstate_global->__pyx_n_s_pie #define __pyx_n_s_pixel __pyx_mstate_global->__pyx_n_s_pixel #define __pyx_n_s_points __pyx_mstate_global->__pyx_n_s_points #define __pyx_n_s_polygon __pyx_mstate_global->__pyx_n_s_polygon #define __pyx_n_s_pt __pyx_mstate_global->__pyx_n_s_pt #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_gfxdraw __pyx_mstate_global->__pyx_n_s_pygame_sdl2_gfxdraw #define __pyx_n_s_pygame_sdl2_rect __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rect #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_rad __pyx_mstate_global->__pyx_n_s_rad #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_n_s_rect __pyx_mstate_global->__pyx_n_s_rect #define __pyx_n_s_rectangle __pyx_mstate_global->__pyx_n_s_rectangle #define __pyx_n_s_rounded_box __pyx_mstate_global->__pyx_n_s_rounded_box #define __pyx_n_s_rounded_rectangle __pyx_mstate_global->__pyx_n_s_rounded_rectangle #define __pyx_n_s_rx __pyx_mstate_global->__pyx_n_s_rx #define __pyx_n_s_ry __pyx_mstate_global->__pyx_n_s_ry #define __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_steps __pyx_mstate_global->__pyx_n_s_steps #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_texture __pyx_mstate_global->__pyx_n_s_texture #define __pyx_n_s_textured_polygon __pyx_mstate_global->__pyx_n_s_textured_polygon #define __pyx_n_s_thick_line __pyx_mstate_global->__pyx_n_s_thick_line #define __pyx_n_s_trigon __pyx_mstate_global->__pyx_n_s_trigon #define __pyx_n_s_tx __pyx_mstate_global->__pyx_n_s_tx #define __pyx_n_s_ty __pyx_mstate_global->__pyx_n_s_ty #define __pyx_n_s_vline __pyx_mstate_global->__pyx_n_s_vline #define __pyx_n_s_vx __pyx_mstate_global->__pyx_n_s_vx #define __pyx_n_s_vy __pyx_mstate_global->__pyx_n_s_vy #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_x1 __pyx_mstate_global->__pyx_n_s_x1 #define __pyx_n_s_x1int __pyx_mstate_global->__pyx_n_s_x1int #define __pyx_n_s_x2 __pyx_mstate_global->__pyx_n_s_x2 #define __pyx_n_s_x2int __pyx_mstate_global->__pyx_n_s_x2int #define __pyx_n_s_x3 __pyx_mstate_global->__pyx_n_s_x3 #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_n_s_y1 __pyx_mstate_global->__pyx_n_s_y1 #define __pyx_n_s_y1int __pyx_mstate_global->__pyx_n_s_y1int #define __pyx_n_s_y2 __pyx_mstate_global->__pyx_n_s_y2 #define __pyx_n_s_y2int __pyx_mstate_global->__pyx_n_s_y2int #define __pyx_n_s_y3 __pyx_mstate_global->__pyx_n_s_y3 #define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 #define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 #define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 #define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 #define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 /* #### Code section: module_code ### */ /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_pixel, "pixel(Surface surface, x, y, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_1pixel = {"pixel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_pixel}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pixel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 1); __PYX_ERR(0, 29, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 2); __PYX_ERR(0, 29, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 3); __PYX_ERR(0, 29, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pixel") < 0)) __PYX_ERR(0, 29, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_color = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 29, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pixel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 29, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_pixel(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_pixel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pixel", 1); /* "pygame_sdl2/gfxdraw.pyx":30 * * def pixel(Surface surface, x, y, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":31 * def pixel(Surface surface, x, y, color): * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def hline(Surface surface, x1, x2, y, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error) (void)(pixelRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pixel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_3hline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_2hline, "hline(Surface surface, x1, x2, y, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_3hline = {"hline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_3hline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_2hline}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_3hline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hline (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_x2,&__pyx_n_s_y,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 1); __PYX_ERR(0, 33, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 2); __PYX_ERR(0, 33, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 3); __PYX_ERR(0, 33, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 4); __PYX_ERR(0, 33, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hline") < 0)) __PYX_ERR(0, 33, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_x2 = values[2]; __pyx_v_y = values[3]; __pyx_v_color = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 33, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.hline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 33, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_2hline(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_x2, __pyx_v_y, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_2hline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hline", 1); /* "pygame_sdl2/gfxdraw.pyx":34 * * def hline(Surface surface, x1, x2, y, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":35 * def hline(Surface surface, x1, x2, y, color): * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def vline(Surface surface, x, y1, y2, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error) (void)(hlineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.hline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_5vline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_4vline, "vline(Surface surface, x, y1, y2, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_5vline = {"vline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_5vline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_4vline}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_5vline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("vline (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y1,&__pyx_n_s_y2,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 1); __PYX_ERR(0, 37, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 2); __PYX_ERR(0, 37, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 3); __PYX_ERR(0, 37, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 4); __PYX_ERR(0, 37, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "vline") < 0)) __PYX_ERR(0, 37, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y1 = values[2]; __pyx_v_y2 = values[3]; __pyx_v_color = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 37, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.vline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 37, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_4vline(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y1, __pyx_v_y2, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_4vline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y1, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vline", 1); /* "pygame_sdl2/gfxdraw.pyx":38 * * def vline(Surface surface, x, y1, y2, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":39 * def vline(Surface surface, x, y1, y2, color): * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def rectangle(Surface surface, rect, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error) (void)(vlineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.vline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_6rectangle, "rectangle(Surface surface, rect, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_7rectangle = {"rectangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_6rectangle}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rectangle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, 1); __PYX_ERR(0, 41, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, 2); __PYX_ERR(0, 41, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rectangle") < 0)) __PYX_ERR(0, 41, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_color = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 41, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 41, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rectangle", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":42 * * def rectangle(Surface surface, rect, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":43 * def rectangle(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/gfxdraw.pyx":44 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_rect}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":43 * def rectangle(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":45 * if not isinstance(rect, Rect): * rect = Rect(rect) * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def rounded_rectangle(Surface surface, rect, rad, color): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (void)(rectangleRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_8rounded_rectangle, "rounded_rectangle(Surface surface, rect, rad, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_9rounded_rectangle = {"rounded_rectangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_8rounded_rectangle}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_rad = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rounded_rectangle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_rad,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 1); __PYX_ERR(0, 47, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rad)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 2); __PYX_ERR(0, 47, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 3); __PYX_ERR(0, 47, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rounded_rectangle") < 0)) __PYX_ERR(0, 47, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_rad = values[2]; __pyx_v_color = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 47, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_rad, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; Sint16 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rounded_rectangle", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":48 * * def rounded_rectangle(Surface surface, rect, rad, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":49 * def rounded_rectangle(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/gfxdraw.pyx":50 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_rect}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":49 * def rounded_rectangle(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":51 * if not isinstance(rect, Rect): * rect = Rect(rect) * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def box(Surface surface, rect, color): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyInt_As_int16_t(__pyx_v_rad); if (unlikely((__pyx_t_11 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) (void)(roundedRectangleRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_11box(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_10box, "box(Surface surface, rect, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_11box = {"box", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_11box, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_10box}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_11box(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("box (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, 1); __PYX_ERR(0, 53, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, 2); __PYX_ERR(0, 53, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "box") < 0)) __PYX_ERR(0, 53, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_color = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 53, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.box", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 53, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_10box(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_10box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("box", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":54 * * def box(Surface surface, rect, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":55 * def box(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/gfxdraw.pyx":56 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_rect}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":55 * def box(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":57 * if not isinstance(rect, Rect): * rect = Rect(rect) * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def rounded_box(Surface surface, rect, rad, color): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (void)(boxRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.box", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_12rounded_box, "rounded_box(Surface surface, rect, rad, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_13rounded_box = {"rounded_box", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_12rounded_box}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_rad = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rounded_box (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_rad,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 1); __PYX_ERR(0, 59, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rad)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 2); __PYX_ERR(0, 59, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 3); __PYX_ERR(0, 59, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rounded_box") < 0)) __PYX_ERR(0, 59, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_rad = values[2]; __pyx_v_color = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 59, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_box", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 59, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_rad, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; Sint16 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rounded_box", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":60 * * def rounded_box(Surface surface, rect, rad, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":61 * def rounded_box(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/gfxdraw.pyx":62 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_rect}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":61 * def rounded_box(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":63 * if not isinstance(rect, Rect): * rect = Rect(rect) * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def line(Surface surface, x1, y1, x2, y2, color): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyInt_As_int16_t(__pyx_v_rad); if (unlikely((__pyx_t_11 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) (void)(roundedBoxRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_box", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_15line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_14line, "line(Surface surface, x1, y1, x2, y2, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_15line = {"line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_15line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_14line}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_15line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("line (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 1); __PYX_ERR(0, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 2); __PYX_ERR(0, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 3); __PYX_ERR(0, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 4); __PYX_ERR(0, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 5); __PYX_ERR(0, 65, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "line") < 0)) __PYX_ERR(0, 65, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_color = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 65, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_14line(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_14line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("line", 1); /* "pygame_sdl2/gfxdraw.pyx":66 * * def line(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":67 * def line(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aaline(Surface surface, x1, y1, x2, y2, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) (void)(lineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_16aaline, "aaline(Surface surface, x1, y1, x2, y2, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_17aaline = {"aaline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_16aaline}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aaline (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 1); __PYX_ERR(0, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 2); __PYX_ERR(0, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 3); __PYX_ERR(0, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 4); __PYX_ERR(0, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 5); __PYX_ERR(0, 69, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aaline") < 0)) __PYX_ERR(0, 69, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_color = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 69, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 69, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aaline", 1); /* "pygame_sdl2/gfxdraw.pyx":70 * * def aaline(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":71 * def aaline(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) (void)(aalineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_18thick_line, "thick_line(Surface surface, x1, y1, x2, y2, width, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_19thick_line = {"thick_line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_18thick_line}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_width = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[7] = {0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("thick_line (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_width,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 1); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 2); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 3); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 4); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 5); __PYX_ERR(0, 73, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 6); __PYX_ERR(0, 73, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "thick_line") < 0)) __PYX_ERR(0, 73, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 7)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_width = values[5]; __pyx_v_color = values[6]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 73, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.thick_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_width, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_width, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; int __pyx_v_x1int; int __pyx_v_y1int; int __pyx_v_x2int; int __pyx_v_y2int; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; Uint8 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("thick_line", 1); /* "pygame_sdl2/gfxdraw.pyx":74 * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * * # This locks up in c code when trying to draw a zero-length line. So make */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":79 * # sure that doesn't happen. * cdef int x1int, y1int, x2int, y2int * x1int = x1 # <<<<<<<<<<<<<< * y1int = y1 * x2int = x2 */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error) __pyx_v_x1int = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":80 * cdef int x1int, y1int, x2int, y2int * x1int = x1 * y1int = y1 # <<<<<<<<<<<<<< * x2int = x2 * y2int = y2 */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_y1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error) __pyx_v_y1int = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":81 * x1int = x1 * y1int = y1 * x2int = x2 # <<<<<<<<<<<<<< * y2int = y2 * */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x2); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error) __pyx_v_x2int = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":82 * y1int = y1 * x2int = x2 * y2int = y2 # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_y2); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_v_y2int = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":85 * * * if x1int == x2int and y1int == y2int: # <<<<<<<<<<<<<< * return * */ __pyx_t_4 = (__pyx_v_x1int == __pyx_v_x2int); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__pyx_v_y1int == __pyx_v_y2int); __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/gfxdraw.pyx":86 * * if x1int == x2int and y1int == y2int: * return # <<<<<<<<<<<<<< * * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/gfxdraw.pyx":85 * * * if x1int == x2int and y1int == y2int: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/gfxdraw.pyx":88 * return * * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def circle(Surface surface, x, y, r, color): */ __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_width); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) (void)(thickLineRGBA(__pyx_v_surface->surface, __pyx_v_x1int, __pyx_v_y1int, __pyx_v_x2int, __pyx_v_y2int, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.thick_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_21circle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_20circle, "circle(Surface surface, x, y, r, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_21circle = {"circle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_21circle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_20circle}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_21circle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("circle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 1); __PYX_ERR(0, 90, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 2); __PYX_ERR(0, 90, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 3); __PYX_ERR(0, 90, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 4); __PYX_ERR(0, 90, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "circle") < 0)) __PYX_ERR(0, 90, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_color = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 90, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 90, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_20circle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_20circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("circle", 1); /* "pygame_sdl2/gfxdraw.pyx":91 * * def circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":92 * def circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def arc(Surface surface, x, y, r, start, end, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) (void)(circleRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_23arc(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_22arc, "arc(Surface surface, x, y, r, start, end, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_23arc = {"arc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_23arc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_22arc}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_23arc(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[7] = {0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("arc (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 1); __PYX_ERR(0, 94, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 2); __PYX_ERR(0, 94, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 3); __PYX_ERR(0, 94, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 4); __PYX_ERR(0, 94, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 5); __PYX_ERR(0, 94, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 6); __PYX_ERR(0, 94, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "arc") < 0)) __PYX_ERR(0, 94, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 7)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_start = values[4]; __pyx_v_end = values[5]; __pyx_v_color = values[6]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 94, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 94, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_22arc(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_22arc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arc", 1); /* "pygame_sdl2/gfxdraw.pyx":95 * * def arc(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":96 * def arc(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aacircle(Surface surface, x, y, r, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) (void)(arcRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_24aacircle, "aacircle(Surface surface, x, y, r, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_25aacircle = {"aacircle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_24aacircle}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aacircle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 1); __PYX_ERR(0, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 2); __PYX_ERR(0, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 3); __PYX_ERR(0, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 4); __PYX_ERR(0, 98, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aacircle") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_color = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aacircle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aacircle", 1); /* "pygame_sdl2/gfxdraw.pyx":99 * * def aacircle(Surface surface, x, y, r, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":100 * def aacircle(Surface surface, x, y, r, color): * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_circle(Surface surface, x, y, r, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) (void)(aacircleRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aacircle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_26filled_circle, "filled_circle(Surface surface, x, y, r, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_27filled_circle = {"filled_circle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_26filled_circle}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_circle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 1); __PYX_ERR(0, 102, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 2); __PYX_ERR(0, 102, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 3); __PYX_ERR(0, 102, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 4); __PYX_ERR(0, 102, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filled_circle") < 0)) __PYX_ERR(0, 102, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_color = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 102, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_circle", 1); /* "pygame_sdl2/gfxdraw.pyx":103 * * def filled_circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":104 * def filled_circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def ellipse(Surface surface, x, y, rx, ry, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) (void)(filledCircleRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_28ellipse, "ellipse(Surface surface, x, y, rx, ry, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_29ellipse = {"ellipse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_28ellipse}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_rx = 0; PyObject *__pyx_v_ry = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ellipse (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 1); __PYX_ERR(0, 106, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 2); __PYX_ERR(0, 106, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 3); __PYX_ERR(0, 106, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ry)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 4); __PYX_ERR(0, 106, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 5); __PYX_ERR(0, 106, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ellipse") < 0)) __PYX_ERR(0, 106, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_rx = values[3]; __pyx_v_ry = values[4]; __pyx_v_color = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 106, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 106, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ellipse", 1); /* "pygame_sdl2/gfxdraw.pyx":107 * * def ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":108 * def ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aaellipse(Surface surface, x, y, rx, ry, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error) (void)(ellipseRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_30aaellipse, "aaellipse(Surface surface, x, y, rx, ry, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_31aaellipse = {"aaellipse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_30aaellipse}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_rx = 0; PyObject *__pyx_v_ry = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aaellipse (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 1); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 2); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 3); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ry)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 4); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 5); __PYX_ERR(0, 110, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aaellipse") < 0)) __PYX_ERR(0, 110, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_rx = values[3]; __pyx_v_ry = values[4]; __pyx_v_color = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 110, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 110, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aaellipse", 1); /* "pygame_sdl2/gfxdraw.pyx":111 * * def aaellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":112 * def aaellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_ellipse(Surface surface, x, y, rx, ry, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) (void)(aaellipseRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_32filled_ellipse, "filled_ellipse(Surface surface, x, y, rx, ry, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_33filled_ellipse = {"filled_ellipse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_32filled_ellipse}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_rx = 0; PyObject *__pyx_v_ry = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_ellipse (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 1); __PYX_ERR(0, 114, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 2); __PYX_ERR(0, 114, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 3); __PYX_ERR(0, 114, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ry)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 4); __PYX_ERR(0, 114, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 5); __PYX_ERR(0, 114, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filled_ellipse") < 0)) __PYX_ERR(0, 114, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_rx = values[3]; __pyx_v_ry = values[4]; __pyx_v_color = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 114, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 114, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_ellipse", 1); /* "pygame_sdl2/gfxdraw.pyx":115 * * def filled_ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":116 * def filled_ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def pie(Surface surface, x, y, r, start, end, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) (void)(filledEllipseRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_35pie(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_34pie, "pie(Surface surface, x, y, r, start, end, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_35pie = {"pie", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_35pie, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_34pie}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_35pie(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[7] = {0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pie (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 1); __PYX_ERR(0, 118, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 2); __PYX_ERR(0, 118, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 3); __PYX_ERR(0, 118, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 4); __PYX_ERR(0, 118, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 5); __PYX_ERR(0, 118, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 6); __PYX_ERR(0, 118, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pie") < 0)) __PYX_ERR(0, 118, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 7)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_start = values[4]; __pyx_v_end = values[5]; __pyx_v_color = values[6]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 118, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 118, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_34pie(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_34pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pie", 1); /* "pygame_sdl2/gfxdraw.pyx":119 * * def pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":120 * def pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_pie(Surface surface, x, y, r, start, end, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) (void)(pieRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_36filled_pie, "filled_pie(Surface surface, x, y, r, start, end, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_37filled_pie = {"filled_pie", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_36filled_pie}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[7] = {0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_pie (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 1); __PYX_ERR(0, 122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 2); __PYX_ERR(0, 122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 3); __PYX_ERR(0, 122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 4); __PYX_ERR(0, 122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 5); __PYX_ERR(0, 122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 6); __PYX_ERR(0, 122, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filled_pie") < 0)) __PYX_ERR(0, 122, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 7)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_start = values[4]; __pyx_v_end = values[5]; __pyx_v_color = values[6]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 122, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 122, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_pie", 1); /* "pygame_sdl2/gfxdraw.pyx":123 * * def filled_pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":124 * def filled_pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error) (void)(filledPieRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_38trigon, "trigon(Surface surface, x1, y1, x2, y2, x3, y3, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_39trigon = {"trigon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_38trigon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_x3 = 0; PyObject *__pyx_v_y3 = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[8] = {0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trigon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 1); __PYX_ERR(0, 126, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 2); __PYX_ERR(0, 126, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 3); __PYX_ERR(0, 126, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 4); __PYX_ERR(0, 126, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 5); __PYX_ERR(0, 126, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 6); __PYX_ERR(0, 126, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 7); __PYX_ERR(0, 126, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "trigon") < 0)) __PYX_ERR(0, 126, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 8)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_x3 = values[5]; __pyx_v_y3 = values[6]; __pyx_v_color = values[7]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 126, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 126, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("trigon", 1); /* "pygame_sdl2/gfxdraw.pyx":127 * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":128 * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) (void)(trigonRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_40aatrigon, "aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_41aatrigon = {"aatrigon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_40aatrigon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_x3 = 0; PyObject *__pyx_v_y3 = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[8] = {0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aatrigon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 1); __PYX_ERR(0, 130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 2); __PYX_ERR(0, 130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 3); __PYX_ERR(0, 130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 4); __PYX_ERR(0, 130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 5); __PYX_ERR(0, 130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 6); __PYX_ERR(0, 130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 7); __PYX_ERR(0, 130, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aatrigon") < 0)) __PYX_ERR(0, 130, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 8)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_x3 = values[5]; __pyx_v_y3 = values[6]; __pyx_v_color = values[7]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 130, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aatrigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 130, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aatrigon", 1); /* "pygame_sdl2/gfxdraw.pyx":131 * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":132 * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) (void)(aatrigonRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aatrigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_42filled_trigon, "filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_43filled_trigon = {"filled_trigon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_42filled_trigon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_x3 = 0; PyObject *__pyx_v_y3 = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[8] = {0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_trigon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 1); __PYX_ERR(0, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 2); __PYX_ERR(0, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 3); __PYX_ERR(0, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 4); __PYX_ERR(0, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 5); __PYX_ERR(0, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y3)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 6); __PYX_ERR(0, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 7); __PYX_ERR(0, 134, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filled_trigon") < 0)) __PYX_ERR(0, 134, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 8)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_x3 = values[5]; __pyx_v_y3 = values[6]; __pyx_v_color = values[7]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 134, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 134, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Sint16 __pyx_t_2; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_trigon", 1); /* "pygame_sdl2/gfxdraw.pyx":135 * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":136 * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def polygon(Surface surface, points, color): */ __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) (void)(filledTrigonRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_44polygon, "polygon(Surface surface, points, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_45polygon = {"polygon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_44polygon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("polygon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, 1); __PYX_ERR(0, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, 2); __PYX_ERR(0, 138, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "polygon") < 0)) __PYX_ERR(0, 138, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_color = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 138, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 138, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("polygon", 1); /* "pygame_sdl2/gfxdraw.pyx":139 * * def polygon(Surface surface, points, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":142 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 142, __pyx_L1_error) __pyx_v_num_points = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":143 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":144 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":145 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points)) __PYX_ERR(0, 145, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_4 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 145, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 145, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 145, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 145, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 145, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 145, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 145, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 145, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":146 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 146, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 146, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 146, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":145 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":147 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ (void)(polygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":148 * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":149 * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def aapolygon(Surface surface, points, color): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_46aapolygon, "aapolygon(Surface surface, points, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_47aapolygon = {"aapolygon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_46aapolygon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aapolygon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, 1); __PYX_ERR(0, 151, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, 2); __PYX_ERR(0, 151, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "aapolygon") < 0)) __PYX_ERR(0, 151, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_color = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 151, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aapolygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 151, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aapolygon", 1); /* "pygame_sdl2/gfxdraw.pyx":152 * * def aapolygon(Surface surface, points, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":155 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 155, __pyx_L1_error) __pyx_v_num_points = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":156 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":157 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":158 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points)) __PYX_ERR(0, 158, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_4 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 158, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 158, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 158, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 158, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 158, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 158, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 158, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 158, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":159 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 159, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 159, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":158 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":160 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ (void)(aapolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":161 * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":162 * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def filled_polygon(Surface surface, points, color): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aapolygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_48filled_polygon, "filled_polygon(Surface surface, points, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_49filled_polygon = {"filled_polygon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_48filled_polygon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_polygon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, 1); __PYX_ERR(0, 164, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, 2); __PYX_ERR(0, 164, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filled_polygon") < 0)) __PYX_ERR(0, 164, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_color = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 164, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 164, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_polygon", 1); /* "pygame_sdl2/gfxdraw.pyx":165 * * def filled_polygon(Surface surface, points, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":168 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 168, __pyx_L1_error) __pyx_v_num_points = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":169 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":170 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":171 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points)) __PYX_ERR(0, 171, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_4 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 171, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 171, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 171, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 171, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 171, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 171, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 171, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 171, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":172 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 172, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 172, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 172, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":171 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":173 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ (void)(filledPolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":174 * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":175 * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_50textured_polygon, "textured_polygon(Surface surface, points, Surface texture, tx, ty)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_51textured_polygon = {"textured_polygon", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_50textured_polygon}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture = 0; PyObject *__pyx_v_tx = 0; PyObject *__pyx_v_ty = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("textured_polygon (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_texture,&__pyx_n_s_tx,&__pyx_n_s_ty,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 1); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_texture)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 2); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 3); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ty)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 4); __PYX_ERR(0, 177, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "textured_polygon") < 0)) __PYX_ERR(0, 177, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_texture = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[2]); __pyx_v_tx = values[3]; __pyx_v_ty = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 177, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.textured_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 177, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_texture), __pyx_ptype_11pygame_sdl2_7surface_Surface, 0, "texture", 0))) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_texture, __pyx_v_tx, __pyx_v_ty); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture, PyObject *__pyx_v_tx, PyObject *__pyx_v_ty) { Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("textured_polygon", 1); /* "pygame_sdl2/gfxdraw.pyx":180 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_1 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 180, __pyx_L1_error) __pyx_v_num_points = __pyx_t_1; /* "pygame_sdl2/gfxdraw.pyx":181 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":182 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":183 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) */ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_points)) __PYX_ERR(0, 183, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_4 = NULL; } else { __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 183, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 183, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 183, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 183, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 183, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 183, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 183, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 183, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":184 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) * free(vx) */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 184, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 184, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 184, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":183 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":185 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_tx); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error) __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_ty); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error) (void)(texturedPolygon(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_texture->surface, __pyx_t_12, __pyx_t_13)); /* "pygame_sdl2/gfxdraw.pyx":186 * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":187 * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def bezier(Surface surface, points, steps, color): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.textured_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7gfxdraw_52bezier, "bezier(Surface surface, points, steps, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_53bezier = {"bezier", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7gfxdraw_52bezier}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_steps = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bezier (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_steps,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_points)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 1); __PYX_ERR(0, 189, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_steps)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 2); __PYX_ERR(0, 189, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 3); __PYX_ERR(0, 189, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "bezier") < 0)) __PYX_ERR(0, 189, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_steps = values[2]; __pyx_v_color = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 189, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.gfxdraw.bezier", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 189, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_steps, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_steps, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bezier", 1); /* "pygame_sdl2/gfxdraw.pyx":190 * * def bezier(Surface surface, points, steps, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":193 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 193, __pyx_L1_error) __pyx_v_num_points = __pyx_t_2; /* "pygame_sdl2/gfxdraw.pyx":194 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":195 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":196 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) */ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points)) __PYX_ERR(0, 196, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_4 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 196, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 196, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 196, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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, 196, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 196, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 196, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 196, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 196, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":197 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 197, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 197, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error) (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error) (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":196 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":198 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_steps); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L1_error) (void)(bezierRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_t_12, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a)); /* "pygame_sdl2/gfxdraw.pyx":199 * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":200 * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.bezier", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 0, 1, 1}, {&__pyx_n_s_aacircle, __pyx_k_aacircle, sizeof(__pyx_k_aacircle), 0, 0, 1, 1}, {&__pyx_n_s_aaellipse, __pyx_k_aaellipse, sizeof(__pyx_k_aaellipse), 0, 0, 1, 1}, {&__pyx_n_s_aaline, __pyx_k_aaline, sizeof(__pyx_k_aaline), 0, 0, 1, 1}, {&__pyx_n_s_aapolygon, __pyx_k_aapolygon, sizeof(__pyx_k_aapolygon), 0, 0, 1, 1}, {&__pyx_n_s_aatrigon, __pyx_k_aatrigon, sizeof(__pyx_k_aatrigon), 0, 0, 1, 1}, {&__pyx_n_s_arc, __pyx_k_arc, sizeof(__pyx_k_arc), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_bezier, __pyx_k_bezier, sizeof(__pyx_k_bezier), 0, 0, 1, 1}, {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_ellipse, __pyx_k_ellipse, sizeof(__pyx_k_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_filled_circle, __pyx_k_filled_circle, sizeof(__pyx_k_filled_circle), 0, 0, 1, 1}, {&__pyx_n_s_filled_ellipse, __pyx_k_filled_ellipse, sizeof(__pyx_k_filled_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_filled_pie, __pyx_k_filled_pie, sizeof(__pyx_k_filled_pie), 0, 0, 1, 1}, {&__pyx_n_s_filled_polygon, __pyx_k_filled_polygon, sizeof(__pyx_k_filled_polygon), 0, 0, 1, 1}, {&__pyx_n_s_filled_trigon, __pyx_k_filled_trigon, sizeof(__pyx_k_filled_trigon), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_hline, __pyx_k_hline, sizeof(__pyx_k_hline), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_num_points, __pyx_k_num_points, sizeof(__pyx_k_num_points), 0, 0, 1, 1}, {&__pyx_n_s_pie, __pyx_k_pie, sizeof(__pyx_k_pie), 0, 0, 1, 1}, {&__pyx_n_s_pixel, __pyx_k_pixel, sizeof(__pyx_k_pixel), 0, 0, 1, 1}, {&__pyx_n_s_points, __pyx_k_points, sizeof(__pyx_k_points), 0, 0, 1, 1}, {&__pyx_n_s_polygon, __pyx_k_polygon, sizeof(__pyx_k_polygon), 0, 0, 1, 1}, {&__pyx_n_s_pt, __pyx_k_pt, sizeof(__pyx_k_pt), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_gfxdraw, __pyx_k_pygame_sdl2_gfxdraw, sizeof(__pyx_k_pygame_sdl2_gfxdraw), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_rad, __pyx_k_rad, sizeof(__pyx_k_rad), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_rectangle, __pyx_k_rectangle, sizeof(__pyx_k_rectangle), 0, 0, 1, 1}, {&__pyx_n_s_rounded_box, __pyx_k_rounded_box, sizeof(__pyx_k_rounded_box), 0, 0, 1, 1}, {&__pyx_n_s_rounded_rectangle, __pyx_k_rounded_rectangle, sizeof(__pyx_k_rounded_rectangle), 0, 0, 1, 1}, {&__pyx_n_s_rx, __pyx_k_rx, sizeof(__pyx_k_rx), 0, 0, 1, 1}, {&__pyx_n_s_ry, __pyx_k_ry, sizeof(__pyx_k_ry), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_k_src_pygame_sdl2_gfxdraw_pyx, sizeof(__pyx_k_src_pygame_sdl2_gfxdraw_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_steps, __pyx_k_steps, sizeof(__pyx_k_steps), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_texture, __pyx_k_texture, sizeof(__pyx_k_texture), 0, 0, 1, 1}, {&__pyx_n_s_textured_polygon, __pyx_k_textured_polygon, sizeof(__pyx_k_textured_polygon), 0, 0, 1, 1}, {&__pyx_n_s_thick_line, __pyx_k_thick_line, sizeof(__pyx_k_thick_line), 0, 0, 1, 1}, {&__pyx_n_s_trigon, __pyx_k_trigon, sizeof(__pyx_k_trigon), 0, 0, 1, 1}, {&__pyx_n_s_tx, __pyx_k_tx, sizeof(__pyx_k_tx), 0, 0, 1, 1}, {&__pyx_n_s_ty, __pyx_k_ty, sizeof(__pyx_k_ty), 0, 0, 1, 1}, {&__pyx_n_s_vline, __pyx_k_vline, sizeof(__pyx_k_vline), 0, 0, 1, 1}, {&__pyx_n_s_vx, __pyx_k_vx, sizeof(__pyx_k_vx), 0, 0, 1, 1}, {&__pyx_n_s_vy, __pyx_k_vy, sizeof(__pyx_k_vy), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, {&__pyx_n_s_x1int, __pyx_k_x1int, sizeof(__pyx_k_x1int), 0, 0, 1, 1}, {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, {&__pyx_n_s_x2int, __pyx_k_x2int, sizeof(__pyx_k_x2int), 0, 0, 1, 1}, {&__pyx_n_s_x3, __pyx_k_x3, sizeof(__pyx_k_x3), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, {&__pyx_n_s_y1int, __pyx_k_y1int, sizeof(__pyx_k_y1int), 0, 0, 1, 1}, {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, {&__pyx_n_s_y2int, __pyx_k_y2int, sizeof(__pyx_k_y2int), 0, 0, 1, 1}, {&__pyx_n_s_y3, __pyx_k_y3, sizeof(__pyx_k_y3), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 145, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 145, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ __pyx_tuple__2 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_pixel, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 29, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ __pyx_tuple__4 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_x2, __pyx_n_s_y, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_hline, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 33, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ __pyx_tuple__6 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y1, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_vline, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 37, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_tuple__8 = PyTuple_Pack(4, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rectangle, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 41, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_tuple__10 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_rad, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rounded_rectangle, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 47, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_box, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 53, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rounded_box, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 59, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_tuple__14 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_line, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 65, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aaline, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 69, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ __pyx_tuple__17 = PyTuple_Pack(12, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_width, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_x1int, __pyx_n_s_y1int, __pyx_n_s_x2int, __pyx_n_s_y2int); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_thick_line, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 73, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_tuple__19 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_circle, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 90, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_tuple__21 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_arc, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 94, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aacircle, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 98, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_circle, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 102, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_tuple__25 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_ellipse, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 106, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aaellipse, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 110, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_ellipse, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 114, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_pie, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 118, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_pie, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 122, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_tuple__31 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_trigon, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 126, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aatrigon, 130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 130, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_trigon, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 134, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_tuple__35 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_polygon, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 138, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aapolygon, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 151, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_polygon, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 164, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_tuple__39 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_texture, __pyx_n_s_tx, __pyx_n_s_ty, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_textured_polygon, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 177, __pyx_L1_error) /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_tuple__41 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_steps, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_bezier, 189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(1, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.color"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_5color_Color),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_5color_Color) __PYX_ERR(2, 26, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_gfxdraw(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_gfxdraw}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "gfxdraw", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initgfxdraw(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initgfxdraw(void) #else __Pyx_PyMODINIT_FUNC PyInit_gfxdraw(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_gfxdraw(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_gfxdraw(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'gfxdraw' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("gfxdraw", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "gfxdraw" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_gfxdraw(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__gfxdraw) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.gfxdraw")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.gfxdraw", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/gfxdraw.pyx":25 * from pygame_sdl2.color cimport Color * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.rect import Rect * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 25, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/gfxdraw.pyx":26 * * from pygame_sdl2.error import error * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Rect)) __PYX_ERR(0, 26, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_1pixel, 0, __pyx_n_s_pixel, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixel, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_3hline, 0, __pyx_n_s_hline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hline, __pyx_t_2) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_5vline, 0, __pyx_n_s_vline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_vline, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_7rectangle, 0, __pyx_n_s_rectangle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rectangle, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_9rounded_rectangle, 0, __pyx_n_s_rounded_rectangle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rounded_rectangle, __pyx_t_2) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_11box, 0, __pyx_n_s_box, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_box, __pyx_t_2) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_13rounded_box, 0, __pyx_n_s_rounded_box, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rounded_box, __pyx_t_2) < 0) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_15line, 0, __pyx_n_s_line, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_line, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_17aaline, 0, __pyx_n_s_aaline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaline, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_19thick_line, 0, __pyx_n_s_thick_line, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_thick_line, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_21circle, 0, __pyx_n_s_circle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_circle, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_23arc, 0, __pyx_n_s_arc, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_arc, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_25aacircle, 0, __pyx_n_s_aacircle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aacircle, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_27filled_circle, 0, __pyx_n_s_filled_circle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_circle, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_29ellipse, 0, __pyx_n_s_ellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ellipse, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_31aaellipse, 0, __pyx_n_s_aaellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaellipse, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_33filled_ellipse, 0, __pyx_n_s_filled_ellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_ellipse, __pyx_t_2) < 0) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_35pie, 0, __pyx_n_s_pie, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pie, __pyx_t_2) < 0) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_37filled_pie, 0, __pyx_n_s_filled_pie, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_pie, __pyx_t_2) < 0) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_39trigon, 0, __pyx_n_s_trigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_trigon, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_41aatrigon, 0, __pyx_n_s_aatrigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aatrigon, __pyx_t_2) < 0) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_43filled_trigon, 0, __pyx_n_s_filled_trigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_trigon, __pyx_t_2) < 0) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_45polygon, 0, __pyx_n_s_polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_polygon, __pyx_t_2) < 0) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_47aapolygon, 0, __pyx_n_s_aapolygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aapolygon, __pyx_t_2) < 0) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_49filled_polygon, 0, __pyx_n_s_filled_polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_polygon, __pyx_t_2) < 0) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_51textured_polygon, 0, __pyx_n_s_textured_polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_textured_polygon, __pyx_t_2) < 0) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7gfxdraw_53bezier, 0, __pyx_n_s_bezier, NULL, __pyx_n_s_pygame_sdl2_gfxdraw, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bezier, __pyx_t_2) < 0) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.gfxdraw", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.gfxdraw"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_12 #define __PYX_HAVE_RT_ImportType_3_0_12 static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int16_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int16_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { int16_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int16_t) -1; val = __Pyx_PyInt_As_int16_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int16_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) >= 2 * PyLong_SHIFT)) { return (int16_t) (((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; case 3: if ((8 * sizeof(int16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) >= 3 * PyLong_SHIFT)) { return (int16_t) (((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; case 4: if ((8 * sizeof(int16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) >= 4 * PyLong_SHIFT)) { return (int16_t) (((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int16_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int16_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int16_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int16_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT)) { return (int16_t) (((int16_t)-1)*(((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 2: if ((8 * sizeof(int16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT)) { return (int16_t) ((((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case -3: if ((8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT)) { return (int16_t) (((int16_t)-1)*(((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 3: if ((8 * sizeof(int16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT)) { return (int16_t) ((((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case -4: if ((8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT)) { return (int16_t) (((int16_t)-1)*(((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 4: if ((8 * sizeof(int16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT)) { return (int16_t) ((((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; } } #endif if ((sizeof(int16_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int16_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int16_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int16_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int16_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int16_t) -1; } else { stepval = v; } v = NULL; val = (int16_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int16_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int16_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int16_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int16_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int16_t) 1) << (sizeof(int16_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int16_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int16_t"); return (int16_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int16_t"); return (int16_t) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint8_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT)) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT)) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT)) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint8_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } } #endif if ((sizeof(uint8_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint8_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint8_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint8_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint8_t) -1; } else { stepval = v; } v = NULL; val = (uint8_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint8_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint8_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint8_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint8_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint8_t) 1) << (sizeof(uint8_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint8_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__43); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635912.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.image.c0000664000175000017500000144151115026112610020154 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__image #define __PYX_HAVE_API__pygame_sdl2__image /* Early includes */ #include #include #include #include #include "SDL.h" #include "sdl_image_compat.h" #include "write_jpeg.h" #include "write_png.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/image.pyx", "src/pygame_sdl2/surface.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 #define __PYX_HAVE_RT_ImportType_proto_3_0_12 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_12 { __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_IMG_InitFlags(IMG_InitFlags value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_image" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.image" */ static int __pyx_v_11pygame_sdl2_5image_image_formats; static PyObject *__pyx_f_11pygame_sdl2_5image_process_namehint(PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.image" extern int __pyx_module_is_main_pygame_sdl2__image; int __pyx_module_is_main_pygame_sdl2__image = 0; /* Implementation of "pygame_sdl2.image" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_ValueError; /* #### Code section: string_decls ### */ static const char __pyx_k_n[] = "n"; static const char __pyx_k__2[] = ""; static const char __pyx_k__3[] = "."; static const char __pyx_k__6[] = "*"; static const char __pyx_k_fi[] = "fi"; static const char __pyx_k_fn[] = "fn"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_wb[] = "wb"; static const char __pyx_k_BMP[] = ".BMP"; static const char __pyx_k_JPG[] = ".JPG"; static const char __pyx_k_PNG[] = ".PNG"; static const char __pyx_k_SVG[] = ".SVG"; static const char __pyx_k_TGA[] = "TGA"; static const char __pyx_k__18[] = "?"; static const char __pyx_k_err[] = "err"; static const char __pyx_k_ext[] = "ext"; static const char __pyx_k_img[] = "img"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_tga[] = ".tga"; static const char __pyx_k_JPEG[] = ".JPEG"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_load[] = "load"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_save[] = "save"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_surf[] = "surf"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_ascii[] = "ascii"; static const char __pyx_k_bytes[] = "bytes_"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_ftype[] = "ftype"; static const char __pyx_k_lower[] = "lower"; static const char __pyx_k_rwops[] = "rwops"; static const char __pyx_k_upper[] = "upper"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_height[] = "height"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_convert[] = "convert"; static const char __pyx_k_replace[] = "replace"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_unicode[] = "unicode_"; static const char __pyx_k_INIT_JPG[] = "INIT_JPG"; static const char __pyx_k_INIT_JXL[] = "INIT_JXL"; static const char __pyx_k_INIT_PNG[] = "INIT_PNG"; static const char __pyx_k_INIT_TIF[] = "INIT_TIF"; static const char __pyx_k_endswith[] = "endswith"; static const char __pyx_k_filename[] = "filename"; static const char __pyx_k_has_init[] = "has_init"; static const char __pyx_k_namehint[] = "namehint"; static const char __pyx_k_splitext[] = "splitext"; static const char __pyx_k_INIT_AVIF[] = "INIT_AVIF"; static const char __pyx_k_INIT_WEBP[] = "INIT_WEBP"; static const char __pyx_k_has_alpha[] = "has_alpha"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_compression[] = "compression"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_get_extended[] = "get_extended"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_convert_alpha[] = "convert_alpha"; static const char __pyx_k_utf8_filename[] = "utf8_filename"; static const char __pyx_k_compression_level[] = "compression_level"; static const char __pyx_k_filesystem_encode[] = "filesystem_encode"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_pygame_sdl2_image[] = "pygame_sdl2.image"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat"; static const char __pyx_k_Unsupported_format_s[] = "Unsupported format: %s"; static const char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; static const char __pyx_k_src_pygame_sdl2_image_pyx[] = "src/pygame_sdl2/image.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5image_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_2has_init(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_4quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_6load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_namehint, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_8save(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_filename, PyObject *__pyx_v_compression); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_10get_extended(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_b_BMP; PyObject *__pyx_n_s_INIT_AVIF; PyObject *__pyx_n_s_INIT_JPG; PyObject *__pyx_n_s_INIT_JXL; PyObject *__pyx_n_s_INIT_PNG; PyObject *__pyx_n_s_INIT_TIF; PyObject *__pyx_n_s_INIT_WEBP; PyObject *__pyx_kp_b_JPEG; PyObject *__pyx_kp_b_JPG; PyObject *__pyx_kp_b_PNG; PyObject *__pyx_kp_b_SVG; PyObject *__pyx_n_s_TGA; PyObject *__pyx_kp_s_Unsupported_format_s; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s__18; PyObject *__pyx_kp_b__2; PyObject *__pyx_kp_s__2; PyObject *__pyx_kp_b__3; PyObject *__pyx_kp_u__3; PyObject *__pyx_n_s__6; PyObject *__pyx_n_s_ascii; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_bytes; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_compression; PyObject *__pyx_n_s_compression_level; PyObject *__pyx_n_s_convert; PyObject *__pyx_n_s_convert_alpha; PyObject *__pyx_n_s_decode; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_endswith; PyObject *__pyx_n_s_err; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_ext; PyObject *__pyx_n_s_fi; PyObject *__pyx_n_s_filename; PyObject *__pyx_n_s_filesystem_encode; PyObject *__pyx_n_s_flags; PyObject *__pyx_n_s_fn; PyObject *__pyx_n_s_ftype; PyObject *__pyx_n_s_get_extended; PyObject *__pyx_n_s_getfilesystemencoding; PyObject *__pyx_n_s_has_alpha; PyObject *__pyx_n_s_has_init; PyObject *__pyx_n_s_height; PyObject *__pyx_n_s_img; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_load; PyObject *__pyx_n_s_lower; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_namehint; PyObject *__pyx_n_s_os; PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_compat; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_image; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_replace; PyObject *__pyx_n_s_rwops; PyObject *__pyx_n_s_save; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_splitext; PyObject *__pyx_kp_s_src_pygame_sdl2_image_pyx; PyObject *__pyx_n_s_surf; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_sys; PyObject *__pyx_n_s_test; PyObject *__pyx_kp_s_tga; PyObject *__pyx_n_s_unicode; PyObject *__pyx_n_s_upper; PyObject *__pyx_n_s_utf8_filename; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_n_s_wb; PyObject *__pyx_n_s_width; PyObject *__pyx_int_1; PyObject *__pyx_int_neg_1; PyObject *__pyx_tuple_; PyObject *__pyx_slice__4; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_kp_b_BMP); Py_CLEAR(clear_module_state->__pyx_n_s_INIT_AVIF); Py_CLEAR(clear_module_state->__pyx_n_s_INIT_JPG); Py_CLEAR(clear_module_state->__pyx_n_s_INIT_JXL); Py_CLEAR(clear_module_state->__pyx_n_s_INIT_PNG); Py_CLEAR(clear_module_state->__pyx_n_s_INIT_TIF); Py_CLEAR(clear_module_state->__pyx_n_s_INIT_WEBP); Py_CLEAR(clear_module_state->__pyx_kp_b_JPEG); Py_CLEAR(clear_module_state->__pyx_kp_b_JPG); Py_CLEAR(clear_module_state->__pyx_kp_b_PNG); Py_CLEAR(clear_module_state->__pyx_kp_b_SVG); Py_CLEAR(clear_module_state->__pyx_n_s_TGA); Py_CLEAR(clear_module_state->__pyx_kp_s_Unsupported_format_s); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_n_s__18); Py_CLEAR(clear_module_state->__pyx_kp_b__2); Py_CLEAR(clear_module_state->__pyx_kp_s__2); Py_CLEAR(clear_module_state->__pyx_kp_b__3); Py_CLEAR(clear_module_state->__pyx_kp_u__3); Py_CLEAR(clear_module_state->__pyx_n_s__6); Py_CLEAR(clear_module_state->__pyx_n_s_ascii); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_bytes); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_compression); Py_CLEAR(clear_module_state->__pyx_n_s_compression_level); Py_CLEAR(clear_module_state->__pyx_n_s_convert); Py_CLEAR(clear_module_state->__pyx_n_s_convert_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_decode); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_endswith); Py_CLEAR(clear_module_state->__pyx_n_s_err); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_ext); Py_CLEAR(clear_module_state->__pyx_n_s_fi); Py_CLEAR(clear_module_state->__pyx_n_s_filename); Py_CLEAR(clear_module_state->__pyx_n_s_filesystem_encode); Py_CLEAR(clear_module_state->__pyx_n_s_flags); Py_CLEAR(clear_module_state->__pyx_n_s_fn); Py_CLEAR(clear_module_state->__pyx_n_s_ftype); Py_CLEAR(clear_module_state->__pyx_n_s_get_extended); Py_CLEAR(clear_module_state->__pyx_n_s_getfilesystemencoding); Py_CLEAR(clear_module_state->__pyx_n_s_has_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_has_init); Py_CLEAR(clear_module_state->__pyx_n_s_height); Py_CLEAR(clear_module_state->__pyx_n_s_img); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_load); Py_CLEAR(clear_module_state->__pyx_n_s_lower); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_namehint); Py_CLEAR(clear_module_state->__pyx_n_s_os); Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_compat); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_image); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_replace); Py_CLEAR(clear_module_state->__pyx_n_s_rwops); Py_CLEAR(clear_module_state->__pyx_n_s_save); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_splitext); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_image_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_surf); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_sys); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_kp_s_tga); Py_CLEAR(clear_module_state->__pyx_n_s_unicode); Py_CLEAR(clear_module_state->__pyx_n_s_upper); Py_CLEAR(clear_module_state->__pyx_n_s_utf8_filename); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_n_s_wb); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_slice__4); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_kp_b_BMP); Py_VISIT(traverse_module_state->__pyx_n_s_INIT_AVIF); Py_VISIT(traverse_module_state->__pyx_n_s_INIT_JPG); Py_VISIT(traverse_module_state->__pyx_n_s_INIT_JXL); Py_VISIT(traverse_module_state->__pyx_n_s_INIT_PNG); Py_VISIT(traverse_module_state->__pyx_n_s_INIT_TIF); Py_VISIT(traverse_module_state->__pyx_n_s_INIT_WEBP); Py_VISIT(traverse_module_state->__pyx_kp_b_JPEG); Py_VISIT(traverse_module_state->__pyx_kp_b_JPG); Py_VISIT(traverse_module_state->__pyx_kp_b_PNG); Py_VISIT(traverse_module_state->__pyx_kp_b_SVG); Py_VISIT(traverse_module_state->__pyx_n_s_TGA); Py_VISIT(traverse_module_state->__pyx_kp_s_Unsupported_format_s); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_n_s__18); Py_VISIT(traverse_module_state->__pyx_kp_b__2); Py_VISIT(traverse_module_state->__pyx_kp_s__2); Py_VISIT(traverse_module_state->__pyx_kp_b__3); Py_VISIT(traverse_module_state->__pyx_kp_u__3); Py_VISIT(traverse_module_state->__pyx_n_s__6); Py_VISIT(traverse_module_state->__pyx_n_s_ascii); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_bytes); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_compression); Py_VISIT(traverse_module_state->__pyx_n_s_compression_level); Py_VISIT(traverse_module_state->__pyx_n_s_convert); Py_VISIT(traverse_module_state->__pyx_n_s_convert_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_decode); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_endswith); Py_VISIT(traverse_module_state->__pyx_n_s_err); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_ext); Py_VISIT(traverse_module_state->__pyx_n_s_fi); Py_VISIT(traverse_module_state->__pyx_n_s_filename); Py_VISIT(traverse_module_state->__pyx_n_s_filesystem_encode); Py_VISIT(traverse_module_state->__pyx_n_s_flags); Py_VISIT(traverse_module_state->__pyx_n_s_fn); Py_VISIT(traverse_module_state->__pyx_n_s_ftype); Py_VISIT(traverse_module_state->__pyx_n_s_get_extended); Py_VISIT(traverse_module_state->__pyx_n_s_getfilesystemencoding); Py_VISIT(traverse_module_state->__pyx_n_s_has_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_has_init); Py_VISIT(traverse_module_state->__pyx_n_s_height); Py_VISIT(traverse_module_state->__pyx_n_s_img); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_load); Py_VISIT(traverse_module_state->__pyx_n_s_lower); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_namehint); Py_VISIT(traverse_module_state->__pyx_n_s_os); Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_compat); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_image); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_replace); Py_VISIT(traverse_module_state->__pyx_n_s_rwops); Py_VISIT(traverse_module_state->__pyx_n_s_save); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_splitext); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_image_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_surf); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_sys); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_kp_s_tga); Py_VISIT(traverse_module_state->__pyx_n_s_unicode); Py_VISIT(traverse_module_state->__pyx_n_s_upper); Py_VISIT(traverse_module_state->__pyx_n_s_utf8_filename); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_n_s_wb); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_slice__4); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_b_BMP __pyx_mstate_global->__pyx_kp_b_BMP #define __pyx_n_s_INIT_AVIF __pyx_mstate_global->__pyx_n_s_INIT_AVIF #define __pyx_n_s_INIT_JPG __pyx_mstate_global->__pyx_n_s_INIT_JPG #define __pyx_n_s_INIT_JXL __pyx_mstate_global->__pyx_n_s_INIT_JXL #define __pyx_n_s_INIT_PNG __pyx_mstate_global->__pyx_n_s_INIT_PNG #define __pyx_n_s_INIT_TIF __pyx_mstate_global->__pyx_n_s_INIT_TIF #define __pyx_n_s_INIT_WEBP __pyx_mstate_global->__pyx_n_s_INIT_WEBP #define __pyx_kp_b_JPEG __pyx_mstate_global->__pyx_kp_b_JPEG #define __pyx_kp_b_JPG __pyx_mstate_global->__pyx_kp_b_JPG #define __pyx_kp_b_PNG __pyx_mstate_global->__pyx_kp_b_PNG #define __pyx_kp_b_SVG __pyx_mstate_global->__pyx_kp_b_SVG #define __pyx_n_s_TGA __pyx_mstate_global->__pyx_n_s_TGA #define __pyx_kp_s_Unsupported_format_s __pyx_mstate_global->__pyx_kp_s_Unsupported_format_s #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_n_s__18 __pyx_mstate_global->__pyx_n_s__18 #define __pyx_kp_b__2 __pyx_mstate_global->__pyx_kp_b__2 #define __pyx_kp_s__2 __pyx_mstate_global->__pyx_kp_s__2 #define __pyx_kp_b__3 __pyx_mstate_global->__pyx_kp_b__3 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 #define __pyx_n_s__6 __pyx_mstate_global->__pyx_n_s__6 #define __pyx_n_s_ascii __pyx_mstate_global->__pyx_n_s_ascii #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_compression __pyx_mstate_global->__pyx_n_s_compression #define __pyx_n_s_compression_level __pyx_mstate_global->__pyx_n_s_compression_level #define __pyx_n_s_convert __pyx_mstate_global->__pyx_n_s_convert #define __pyx_n_s_convert_alpha __pyx_mstate_global->__pyx_n_s_convert_alpha #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_endswith __pyx_mstate_global->__pyx_n_s_endswith #define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_ext __pyx_mstate_global->__pyx_n_s_ext #define __pyx_n_s_fi __pyx_mstate_global->__pyx_n_s_fi #define __pyx_n_s_filename __pyx_mstate_global->__pyx_n_s_filename #define __pyx_n_s_filesystem_encode __pyx_mstate_global->__pyx_n_s_filesystem_encode #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags #define __pyx_n_s_fn __pyx_mstate_global->__pyx_n_s_fn #define __pyx_n_s_ftype __pyx_mstate_global->__pyx_n_s_ftype #define __pyx_n_s_get_extended __pyx_mstate_global->__pyx_n_s_get_extended #define __pyx_n_s_getfilesystemencoding __pyx_mstate_global->__pyx_n_s_getfilesystemencoding #define __pyx_n_s_has_alpha __pyx_mstate_global->__pyx_n_s_has_alpha #define __pyx_n_s_has_init __pyx_mstate_global->__pyx_n_s_has_init #define __pyx_n_s_height __pyx_mstate_global->__pyx_n_s_height #define __pyx_n_s_img __pyx_mstate_global->__pyx_n_s_img #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_load __pyx_mstate_global->__pyx_n_s_load #define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_namehint __pyx_mstate_global->__pyx_n_s_namehint #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_compat __pyx_mstate_global->__pyx_n_s_pygame_sdl2_compat #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_image __pyx_mstate_global->__pyx_n_s_pygame_sdl2_image #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace #define __pyx_n_s_rwops __pyx_mstate_global->__pyx_n_s_rwops #define __pyx_n_s_save __pyx_mstate_global->__pyx_n_s_save #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_splitext __pyx_mstate_global->__pyx_n_s_splitext #define __pyx_kp_s_src_pygame_sdl2_image_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_image_pyx #define __pyx_n_s_surf __pyx_mstate_global->__pyx_n_s_surf #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_kp_s_tga __pyx_mstate_global->__pyx_kp_s_tga #define __pyx_n_s_unicode __pyx_mstate_global->__pyx_n_s_unicode #define __pyx_n_s_upper __pyx_mstate_global->__pyx_n_s_upper #define __pyx_n_s_utf8_filename __pyx_mstate_global->__pyx_n_s_utf8_filename #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_n_s_wb __pyx_mstate_global->__pyx_n_s_wb #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_slice__4 __pyx_mstate_global->__pyx_slice__4 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 /* #### Code section: module_code ### */ /* "pygame_sdl2/image.pyx":34 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * # Attempt to initialize everything. Only fail loudly if all formats fail * global image_formats */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5image_init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_5image_init}; static PyObject *__pyx_pw_11pygame_sdl2_5image_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5image_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/image.pyx":37 * # Attempt to initialize everything. Only fail loudly if all formats fail * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP | IMG_INIT_JXL | IMG_INIT_AVIF) # <<<<<<<<<<<<<< * if image_formats == 0: * raise error() */ __pyx_v_11pygame_sdl2_5image_image_formats = IMG_Init((((((IMG_INIT_JPG | IMG_INIT_PNG) | IMG_INIT_TIF) | IMG_INIT_WEBP) | IMG_INIT_JXL) | IMG_INIT_AVIF)); /* "pygame_sdl2/image.pyx":38 * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP | IMG_INIT_JXL | IMG_INIT_AVIF) * if image_formats == 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_11pygame_sdl2_5image_image_formats == 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/image.pyx":39 * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP | IMG_INIT_JXL | IMG_INIT_AVIF) * if image_formats == 0: * raise error() # <<<<<<<<<<<<<< * * init() */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 39, __pyx_L1_error) /* "pygame_sdl2/image.pyx":38 * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP | IMG_INIT_JXL | IMG_INIT_AVIF) * if image_formats == 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/image.pyx":34 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * # Attempt to initialize everything. Only fail loudly if all formats fail * global image_formats */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.image.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":51 * INIT_AVIF = IMG_INIT_AVIF * * def has_init(int flags): # <<<<<<<<<<<<<< * return (flags & image_formats) == flags * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_3has_init(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5image_2has_init, "has_init(int flags)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_3has_init = {"has_init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5image_3has_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5image_2has_init}; static PyObject *__pyx_pw_11pygame_sdl2_5image_3has_init(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { int __pyx_v_flags; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("has_init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "has_init") < 0)) __PYX_ERR(0, 51, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_flags = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("has_init", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 51, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.image.has_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5image_2has_init(__pyx_self, __pyx_v_flags); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_2has_init(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_init", 1); /* "pygame_sdl2/image.pyx":52 * * def has_init(int flags): * return (flags & image_formats) == flags # <<<<<<<<<<<<<< * * def quit(): # @ReservedAssignment */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(((__pyx_v_flags & __pyx_v_11pygame_sdl2_5image_image_formats) == __pyx_v_flags)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/image.pyx":51 * INIT_AVIF = IMG_INIT_AVIF * * def has_init(int flags): # <<<<<<<<<<<<<< * return (flags & image_formats) == flags * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.image.has_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":54 * return (flags & image_formats) == flags * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_5quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5image_4quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_5quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_5quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_5image_4quit}; static PyObject *__pyx_pw_11pygame_sdl2_5image_5quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5image_4quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_4quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/image.pyx":55 * * def quit(): # @ReservedAssignment * IMG_Quit() # <<<<<<<<<<<<<< * * cdef process_namehint(namehint): */ IMG_Quit(); /* "pygame_sdl2/image.pyx":54 * return (flags & image_formats) == flags * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":57 * IMG_Quit() * * cdef process_namehint(namehint): # <<<<<<<<<<<<<< * # Accepts "foo.png", ".png", or "png" * */ static PyObject *__pyx_f_11pygame_sdl2_5image_process_namehint(PyObject *__pyx_v_namehint) { PyObject *__pyx_v_ext = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("process_namehint", 0); __Pyx_INCREF(__pyx_v_namehint); /* "pygame_sdl2/image.pyx":60 * # Accepts "foo.png", ".png", or "png" * * if not isinstance(namehint, bytes_): # <<<<<<<<<<<<<< * namehint = namehint.encode("ascii", "replace") * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_namehint, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":61 * * if not isinstance(namehint, bytes_): * namehint = namehint.encode("ascii", "replace") # <<<<<<<<<<<<<< * * if not namehint: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_namehint, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_namehint, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":60 * # Accepts "foo.png", ".png", or "png" * * if not isinstance(namehint, bytes_): # <<<<<<<<<<<<<< * namehint = namehint.encode("ascii", "replace") * */ } /* "pygame_sdl2/image.pyx":63 * namehint = namehint.encode("ascii", "replace") * * if not namehint: # <<<<<<<<<<<<<< * return b'' * */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_namehint); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_3); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":64 * * if not namehint: * return b'' # <<<<<<<<<<<<<< * * ext = os.path.splitext(namehint)[1] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_b__2); __pyx_r = __pyx_kp_b__2; goto __pyx_L0; /* "pygame_sdl2/image.pyx":63 * namehint = namehint.encode("ascii", "replace") * * if not namehint: # <<<<<<<<<<<<<< * return b'' * */ } /* "pygame_sdl2/image.pyx":66 * return b'' * * ext = os.path.splitext(namehint)[1] # <<<<<<<<<<<<<< * if not ext: * ext = namehint */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_splitext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_namehint}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_ext = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/image.pyx":67 * * ext = os.path.splitext(namehint)[1] * if not ext: # <<<<<<<<<<<<<< * ext = namehint * if ext[0] == b'.': */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ext); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":68 * ext = os.path.splitext(namehint)[1] * if not ext: * ext = namehint # <<<<<<<<<<<<<< * if ext[0] == b'.': * ext = ext[1:] */ __Pyx_INCREF(__pyx_v_namehint); __Pyx_DECREF_SET(__pyx_v_ext, __pyx_v_namehint); /* "pygame_sdl2/image.pyx":67 * * ext = os.path.splitext(namehint)[1] * if not ext: # <<<<<<<<<<<<<< * ext = namehint * if ext[0] == b'.': */ } /* "pygame_sdl2/image.pyx":69 * if not ext: * ext = namehint * if ext[0] == b'.': # <<<<<<<<<<<<<< * ext = ext[1:] * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ext, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b__3, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":70 * ext = namehint * if ext[0] == b'.': * ext = ext[1:] # <<<<<<<<<<<<<< * * return ext.upper() */ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_ext, 1, 0, NULL, NULL, &__pyx_slice__4, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ext, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/image.pyx":69 * if not ext: * ext = namehint * if ext[0] == b'.': # <<<<<<<<<<<<<< * ext = ext[1:] * */ } /* "pygame_sdl2/image.pyx":72 * ext = ext[1:] * * return ext.upper() # <<<<<<<<<<<<<< * * def load(fi, namehint="", size=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ext, __pyx_n_s_upper); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/image.pyx":57 * IMG_Quit() * * cdef process_namehint(namehint): # <<<<<<<<<<<<<< * # Accepts "foo.png", ".png", or "png" * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.image.process_namehint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ext); __Pyx_XDECREF(__pyx_v_namehint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":74 * return ext.upper() * * def load(fi, namehint="", size=None): # <<<<<<<<<<<<<< * """ * `size` */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_7load(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5image_6load, "load(fi, namehint='', size=None)\n\n `size`\n A width, height tuple that specifies the size the image is loaded\n at. This is only supported for SVG images.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_7load = {"load", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5image_7load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5image_6load}; static PyObject *__pyx_pw_11pygame_sdl2_5image_7load(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fi = 0; PyObject *__pyx_v_namehint = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,&__pyx_n_s_namehint,&__pyx_n_s_size,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_kp_s__2))); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_namehint); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load") < 0)) __PYX_ERR(0, 74, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fi = values[0]; __pyx_v_namehint = values[1]; __pyx_v_size = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 74, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5image_6load(__pyx_self, __pyx_v_fi, __pyx_v_namehint, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_6load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_namehint, PyObject *__pyx_v_size) { SDL_Surface *__pyx_v_img; SDL_RWops *__pyx_v_rwops; char *__pyx_v_ftype; int __pyx_v_width; int __pyx_v_height; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf = 0; int __pyx_v_n; int __pyx_v_has_alpha; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; SDL_RWops *__pyx_t_7; char *__pyx_t_8; int __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_t_11; int __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 0); __Pyx_INCREF(__pyx_v_namehint); /* "pygame_sdl2/image.pyx":90 * * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): # <<<<<<<<<<<<<< * if fi.lower().endswith('.tga'): * namehint = "TGA" */ __pyx_t_1 = PyString_Check(__pyx_v_fi); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":91 * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): * if fi.lower().endswith('.tga'): # <<<<<<<<<<<<<< * namehint = "TGA" * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fi, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_endswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_tga}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":92 * if isinstance(fi, str): * if fi.lower().endswith('.tga'): * namehint = "TGA" # <<<<<<<<<<<<<< * * rwops = to_rwops(fi) */ __Pyx_INCREF(__pyx_n_s_TGA); __Pyx_DECREF_SET(__pyx_v_namehint, __pyx_n_s_TGA); /* "pygame_sdl2/image.pyx":91 * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): * if fi.lower().endswith('.tga'): # <<<<<<<<<<<<<< * namehint = "TGA" * */ } /* "pygame_sdl2/image.pyx":90 * * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): # <<<<<<<<<<<<<< * if fi.lower().endswith('.tga'): * namehint = "TGA" */ } /* "pygame_sdl2/image.pyx":94 * namehint = "TGA" * * rwops = to_rwops(fi) # <<<<<<<<<<<<<< * * if namehint == "": */ __pyx_t_7 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_7 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 94, __pyx_L1_error) __pyx_v_rwops = __pyx_t_7; /* "pygame_sdl2/image.pyx":96 * rwops = to_rwops(fi) * * if namehint == "": # <<<<<<<<<<<<<< * with nogil: * img = IMG_Load_RW(rwops, 1) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_namehint, __pyx_kp_s__2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 96, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":97 * * if namehint == "": * with nogil: # <<<<<<<<<<<<<< * img = IMG_Load_RW(rwops, 1) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/image.pyx":98 * if namehint == "": * with nogil: * img = IMG_Load_RW(rwops, 1) # <<<<<<<<<<<<<< * * else: */ __pyx_v_img = IMG_Load_RW(__pyx_v_rwops, 1); } /* "pygame_sdl2/image.pyx":97 * * if namehint == "": * with nogil: # <<<<<<<<<<<<<< * img = IMG_Load_RW(rwops, 1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "pygame_sdl2/image.pyx":96 * rwops = to_rwops(fi) * * if namehint == "": # <<<<<<<<<<<<<< * with nogil: * img = IMG_Load_RW(rwops, 1) */ goto __pyx_L5; } /* "pygame_sdl2/image.pyx":101 * * else: * namehint = process_namehint(namehint) # <<<<<<<<<<<<<< * ftype = namehint * */ /*else*/ { __pyx_t_2 = __pyx_f_11pygame_sdl2_5image_process_namehint(__pyx_v_namehint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_namehint, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":102 * else: * namehint = process_namehint(namehint) * ftype = namehint # <<<<<<<<<<<<<< * * if namehint == b".SVG" and size is not None: */ __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_namehint); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_v_ftype = __pyx_t_8; /* "pygame_sdl2/image.pyx":104 * ftype = namehint * * if namehint == b".SVG" and size is not None: # <<<<<<<<<<<<<< * width, height = size * */ __pyx_t_9 = (__Pyx_PyBytes_Equals(__pyx_v_namehint, __pyx_kp_b_SVG, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 104, __pyx_L1_error) if (__pyx_t_9) { } else { __pyx_t_1 = __pyx_t_9; goto __pyx_L10_bool_binop_done; } __pyx_t_9 = (__pyx_v_size != Py_None); __pyx_t_1 = __pyx_t_9; __pyx_L10_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":105 * * if namehint == b".SVG" and size is not None: * width, height = size # <<<<<<<<<<<<<< * * with nogil: */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 105, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_4 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_3), 2) < 0) __PYX_ERR(0, 105, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 105, __pyx_L1_error) __pyx_L13_unpacking_done:; } __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_width = __pyx_t_11; __pyx_v_height = __pyx_t_12; /* "pygame_sdl2/image.pyx":107 * width, height = size * * with nogil: # <<<<<<<<<<<<<< * img = IMG_LoadSizedSVG_RW(rwops, width, height) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/image.pyx":108 * * with nogil: * img = IMG_LoadSizedSVG_RW(rwops, width, height) # <<<<<<<<<<<<<< * * SDL_RWclose(rwops) */ __pyx_v_img = IMG_LoadSizedSVG_RW(__pyx_v_rwops, __pyx_v_width, __pyx_v_height); } /* "pygame_sdl2/image.pyx":107 * width, height = size * * with nogil: # <<<<<<<<<<<<<< * img = IMG_LoadSizedSVG_RW(rwops, width, height) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L16; } __pyx_L16:; } } /* "pygame_sdl2/image.pyx":110 * img = IMG_LoadSizedSVG_RW(rwops, width, height) * * SDL_RWclose(rwops) # <<<<<<<<<<<<<< * * else: */ (void)(SDL_RWclose(__pyx_v_rwops)); /* "pygame_sdl2/image.pyx":104 * ftype = namehint * * if namehint == b".SVG" and size is not None: # <<<<<<<<<<<<<< * width, height = size * */ goto __pyx_L9; } /* "pygame_sdl2/image.pyx":114 * else: * * with nogil: # <<<<<<<<<<<<<< * img = IMG_LoadTyped_RW(rwops, 1, ftype) * */ /*else*/ { { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/image.pyx":115 * * with nogil: * img = IMG_LoadTyped_RW(rwops, 1, ftype) # <<<<<<<<<<<<<< * * if img == NULL: */ __pyx_v_img = IMG_LoadTyped_RW(__pyx_v_rwops, 1, __pyx_v_ftype); } /* "pygame_sdl2/image.pyx":114 * else: * * with nogil: # <<<<<<<<<<<<<< * img = IMG_LoadTyped_RW(rwops, 1, ftype) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L19; } __pyx_L19:; } } } __pyx_L9:; } __pyx_L5:; /* "pygame_sdl2/image.pyx":117 * img = IMG_LoadTyped_RW(rwops, 1, ftype) * * if img == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_img == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/image.pyx":118 * * if img == NULL: * raise error() # <<<<<<<<<<<<<< * * cdef Surface surf = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 118, __pyx_L1_error) /* "pygame_sdl2/image.pyx":117 * img = IMG_LoadTyped_RW(rwops, 1, ftype) * * if img == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/image.pyx":120 * raise error() * * cdef Surface surf = Surface(()) # <<<<<<<<<<<<<< * surf.take_surface(img) * */ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_surf = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":121 * * cdef Surface surf = Surface(()) * surf.take_surface(img) # <<<<<<<<<<<<<< * * if img.format.BitsPerPixel == 32: */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_surf->__pyx_vtab)->take_surface(__pyx_v_surf, __pyx_v_img); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error) /* "pygame_sdl2/image.pyx":123 * surf.take_surface(img) * * if img.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * return surf * */ __pyx_t_1 = (__pyx_v_img->format->BitsPerPixel == 32); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":124 * * if img.format.BitsPerPixel == 32: * return surf # <<<<<<<<<<<<<< * * cdef int n = 0 */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_surf); __pyx_r = ((PyObject *)__pyx_v_surf); goto __pyx_L0; /* "pygame_sdl2/image.pyx":123 * surf.take_surface(img) * * if img.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * return surf * */ } /* "pygame_sdl2/image.pyx":126 * return surf * * cdef int n = 0 # <<<<<<<<<<<<<< * has_alpha = False * */ __pyx_v_n = 0; /* "pygame_sdl2/image.pyx":127 * * cdef int n = 0 * has_alpha = False # <<<<<<<<<<<<<< * * if img.format.Amask: */ __pyx_v_has_alpha = 0; /* "pygame_sdl2/image.pyx":129 * has_alpha = False * * if img.format.Amask: # <<<<<<<<<<<<<< * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: */ __pyx_t_1 = (__pyx_v_img->format->Amask != 0); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":130 * * if img.format.Amask: * has_alpha = True # <<<<<<<<<<<<<< * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True */ __pyx_v_has_alpha = 1; /* "pygame_sdl2/image.pyx":129 * has_alpha = False * * if img.format.Amask: # <<<<<<<<<<<<<< * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: */ goto __pyx_L22; } /* "pygame_sdl2/image.pyx":131 * if img.format.Amask: * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: # <<<<<<<<<<<<<< * has_alpha = True * elif img.format.palette != NULL: */ __pyx_t_1 = (((__pyx_v_img->format->format >> 24) & SDL_PIXELTYPE_INDEX1) != 0); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":132 * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True # <<<<<<<<<<<<<< * elif img.format.palette != NULL: * # Check for non-opaque palette colors. */ __pyx_v_has_alpha = 1; /* "pygame_sdl2/image.pyx":131 * if img.format.Amask: * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: # <<<<<<<<<<<<<< * has_alpha = True * elif img.format.palette != NULL: */ goto __pyx_L22; } /* "pygame_sdl2/image.pyx":133 * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True * elif img.format.palette != NULL: # <<<<<<<<<<<<<< * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: */ __pyx_t_1 = (__pyx_v_img->format->palette != NULL); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":135 * elif img.format.palette != NULL: * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: # <<<<<<<<<<<<<< * if img.format.palette.colors[n].a != 255: * has_alpha = True */ while (1) { __pyx_t_1 = (__pyx_v_n < __pyx_v_img->format->palette->ncolors); if (!__pyx_t_1) break; /* "pygame_sdl2/image.pyx":136 * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: * if img.format.palette.colors[n].a != 255: # <<<<<<<<<<<<<< * has_alpha = True * break */ __pyx_t_1 = ((__pyx_v_img->format->palette->colors[__pyx_v_n]).a != 0xFF); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":137 * while n < img.format.palette.ncolors: * if img.format.palette.colors[n].a != 255: * has_alpha = True # <<<<<<<<<<<<<< * break * n += 1 */ __pyx_v_has_alpha = 1; /* "pygame_sdl2/image.pyx":138 * if img.format.palette.colors[n].a != 255: * has_alpha = True * break # <<<<<<<<<<<<<< * n += 1 * */ goto __pyx_L24_break; /* "pygame_sdl2/image.pyx":136 * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: * if img.format.palette.colors[n].a != 255: # <<<<<<<<<<<<<< * has_alpha = True * break */ } /* "pygame_sdl2/image.pyx":139 * has_alpha = True * break * n += 1 # <<<<<<<<<<<<<< * * try: */ __pyx_v_n = (__pyx_v_n + 1); } __pyx_L24_break:; /* "pygame_sdl2/image.pyx":133 * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True * elif img.format.palette != NULL: # <<<<<<<<<<<<<< * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: */ } __pyx_L22:; /* "pygame_sdl2/image.pyx":141 * n += 1 * * try: # <<<<<<<<<<<<<< * if has_alpha: * return surf.convert_alpha() */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); /*try:*/ { /* "pygame_sdl2/image.pyx":142 * * try: * if has_alpha: # <<<<<<<<<<<<<< * return surf.convert_alpha() * else: */ if (__pyx_v_has_alpha) { /* "pygame_sdl2/image.pyx":143 * try: * if has_alpha: * return surf.convert_alpha() # <<<<<<<<<<<<<< * else: * return surf.convert() */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf), __pyx_n_s_convert_alpha); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L30_try_return; /* "pygame_sdl2/image.pyx":142 * * try: * if has_alpha: # <<<<<<<<<<<<<< * return surf.convert_alpha() * else: */ } /* "pygame_sdl2/image.pyx":145 * return surf.convert_alpha() * else: * return surf.convert() # <<<<<<<<<<<<<< * except error: * return surf */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf), __pyx_n_s_convert); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L30_try_return; } /* "pygame_sdl2/image.pyx":141 * n += 1 * * try: # <<<<<<<<<<<<<< * if has_alpha: * return surf.convert_alpha() */ } __pyx_L26_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/image.pyx":146 * else: * return surf.convert() * except error: # <<<<<<<<<<<<<< * return surf * */ __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_2, &__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_ErrRestore(__pyx_t_4, __pyx_t_2, __pyx_t_3); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; if (__pyx_t_12) { __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_4) < 0) __PYX_ERR(0, 146, __pyx_L28_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_4); /* "pygame_sdl2/image.pyx":147 * return surf.convert() * except error: * return surf # <<<<<<<<<<<<<< * * cdef extern from "write_jpeg.h": */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_surf); __pyx_r = ((PyObject *)__pyx_v_surf); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L29_except_return; } goto __pyx_L28_except_error; /* "pygame_sdl2/image.pyx":141 * n += 1 * * try: # <<<<<<<<<<<<<< * if has_alpha: * return surf.convert_alpha() */ __pyx_L28_except_error:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); goto __pyx_L1_error; __pyx_L30_try_return:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); goto __pyx_L0; __pyx_L29_except_return:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); goto __pyx_L0; } /* "pygame_sdl2/image.pyx":74 * return ext.upper() * * def load(fi, namehint="", size=None): # <<<<<<<<<<<<<< * """ * `size` */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf); __Pyx_XDECREF(__pyx_v_namehint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":155 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if not isinstance(filename, unicode_): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_9save(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5image_8save, "save(Surface surface, filename, compression=-1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_9save = {"save", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5image_9save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5image_8save}; static PyObject *__pyx_pw_11pygame_sdl2_5image_9save(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_compression = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("save (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_filename,&__pyx_n_s_compression,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_neg_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("save", 0, 2, 3, 1); __PYX_ERR(0, 155, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compression); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "save") < 0)) __PYX_ERR(0, 155, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_filename = values[1]; __pyx_v_compression = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("save", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 155, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.image.save", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 0, "surface", 0))) __PYX_ERR(0, 155, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5image_8save(__pyx_self, __pyx_v_surface, __pyx_v_filename, __pyx_v_compression); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_8save(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_filename, PyObject *__pyx_v_compression) { PyObject *__pyx_v_ext = NULL; long __pyx_v_err; PyObject *__pyx_v_utf8_filename = NULL; char *__pyx_v_fn; SDL_RWops *__pyx_v_rwops; int __pyx_v_compression_level; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; char *__pyx_t_9; int __pyx_t_10; SDL_RWops *__pyx_t_11; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("save", 0); __Pyx_INCREF(__pyx_v_filename); /* "pygame_sdl2/image.pyx":157 * def save(Surface surface not None, filename, compression=-1): * * if not isinstance(filename, unicode_): # <<<<<<<<<<<<<< * filename = filename.decode(sys.getfilesystemencoding()) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_filename, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":158 * * if not isinstance(filename, unicode_): * filename = filename.decode(sys.getfilesystemencoding()) # <<<<<<<<<<<<<< * * ext = os.path.splitext(filename)[1] */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/image.pyx":157 * def save(Surface surface not None, filename, compression=-1): * * if not isinstance(filename, unicode_): # <<<<<<<<<<<<<< * filename = filename.decode(sys.getfilesystemencoding()) * */ } /* "pygame_sdl2/image.pyx":160 * filename = filename.decode(sys.getfilesystemencoding()) * * ext = os.path.splitext(filename)[1] # <<<<<<<<<<<<<< * ext = ext.upper() * ext = ext.encode("utf-8") */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_splitext); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_filename}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ext = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":161 * * ext = os.path.splitext(filename)[1] * ext = ext.upper() # <<<<<<<<<<<<<< * ext = ext.encode("utf-8") * err = 0 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ext, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF_SET(__pyx_v_ext, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":162 * ext = os.path.splitext(filename)[1] * ext = ext.upper() * ext = ext.encode("utf-8") # <<<<<<<<<<<<<< * err = 0 * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ext, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_utf_8}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF_SET(__pyx_v_ext, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":163 * ext = ext.upper() * ext = ext.encode("utf-8") * err = 0 # <<<<<<<<<<<<<< * * utf8_filename = filename.encode("utf-8") */ __pyx_v_err = 0; /* "pygame_sdl2/image.pyx":165 * err = 0 * * utf8_filename = filename.encode("utf-8") # <<<<<<<<<<<<<< * * cdef char *fn = utf8_filename */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_utf_8}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_utf8_filename = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":167 * utf8_filename = filename.encode("utf-8") * * cdef char *fn = utf8_filename # <<<<<<<<<<<<<< * cdef SDL_RWops *rwops * cdef int compression_level = compression */ __pyx_t_9 = __Pyx_PyObject_AsWritableString(__pyx_v_utf8_filename); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __pyx_v_fn = __pyx_t_9; /* "pygame_sdl2/image.pyx":169 * cdef char *fn = utf8_filename * cdef SDL_RWops *rwops * cdef int compression_level = compression # <<<<<<<<<<<<<< * * if ext == b'.PNG': */ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 169, __pyx_L1_error) __pyx_v_compression_level = __pyx_t_10; /* "pygame_sdl2/image.pyx":171 * cdef int compression_level = compression * * if ext == b'.PNG': # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) */ __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_PNG, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 171, __pyx_L1_error) if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":172 * * if ext == b'.PNG': * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/image.pyx":173 * if ext == b'.PNG': * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) # <<<<<<<<<<<<<< * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") */ __pyx_v_err = Pygame_SDL2_SavePNG(__pyx_v_fn, __pyx_v_surface->surface, __pyx_v_compression_level); } /* "pygame_sdl2/image.pyx":172 * * if ext == b'.PNG': * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L7; } __pyx_L7:; } } /* "pygame_sdl2/image.pyx":171 * cdef int compression_level = compression * * if ext == b'.PNG': # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) */ goto __pyx_L4; } /* "pygame_sdl2/image.pyx":174 * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': # <<<<<<<<<<<<<< * rwops = to_rwops(filename, "wb") * with nogil: */ __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_BMP, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":175 * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") # <<<<<<<<<<<<<< * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) */ __pyx_t_12.__pyx_n = 1; __pyx_t_12.mode = __pyx_n_s_wb; __pyx_t_11 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filename, &__pyx_t_12); if (unlikely(__pyx_t_11 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 175, __pyx_L1_error) __pyx_v_rwops = __pyx_t_11; /* "pygame_sdl2/image.pyx":176 * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") * with nogil: # <<<<<<<<<<<<<< * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/image.pyx":177 * rwops = to_rwops(filename, "wb") * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) # <<<<<<<<<<<<<< * elif ext == b".JPG" or ext == b".JPEG": * with nogil: */ __pyx_v_err = SDL_SaveBMP_RW(__pyx_v_surface->surface, __pyx_v_rwops, 1); } /* "pygame_sdl2/image.pyx":176 * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") * with nogil: # <<<<<<<<<<<<<< * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/image.pyx":174 * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': # <<<<<<<<<<<<<< * rwops = to_rwops(filename, "wb") * with nogil: */ goto __pyx_L4; } /* "pygame_sdl2/image.pyx":178 * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) */ __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_JPG, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L11_bool_binop_done; } __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_JPEG, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) __pyx_t_3 = __pyx_t_2; __pyx_L11_bool_binop_done:; if (likely(__pyx_t_3)) { /* "pygame_sdl2/image.pyx":179 * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) * else: */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/image.pyx":180 * elif ext == b".JPG" or ext == b".JPEG": * with nogil: * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) # <<<<<<<<<<<<<< * else: * raise ValueError("Unsupported format: %s" % ext) */ __pyx_v_err = Pygame_SDL2_SaveJPEG(__pyx_v_surface->surface, __pyx_v_fn, __pyx_v_compression_level); } /* "pygame_sdl2/image.pyx":179 * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) * else: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L15; } __pyx_L15:; } } /* "pygame_sdl2/image.pyx":178 * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) */ goto __pyx_L4; } /* "pygame_sdl2/image.pyx":182 * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) * else: * raise ValueError("Unsupported format: %s" % ext) # <<<<<<<<<<<<<< * * if err != 0: */ /*else*/ { __pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Unsupported_format_s, __pyx_v_ext); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 182, __pyx_L1_error) } __pyx_L4:; /* "pygame_sdl2/image.pyx":184 * raise ValueError("Unsupported format: %s" % ext) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = (__pyx_v_err != 0); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/image.pyx":185 * * if err != 0: * raise error() # <<<<<<<<<<<<<< * * def get_extended(): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 185, __pyx_L1_error) /* "pygame_sdl2/image.pyx":184 * raise ValueError("Unsupported format: %s" % ext) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/image.pyx":155 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if not isinstance(filename, unicode_): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.image.save", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ext); __Pyx_XDECREF(__pyx_v_utf8_filename); __Pyx_XDECREF(__pyx_v_filename); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":187 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_11get_extended(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5image_10get_extended, "get_extended()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_11get_extended = {"get_extended", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_11get_extended, METH_NOARGS, __pyx_doc_11pygame_sdl2_5image_10get_extended}; static PyObject *__pyx_pw_11pygame_sdl2_5image_11get_extended(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_extended (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5image_10get_extended(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_10get_extended(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_extended", 1); /* "pygame_sdl2/image.pyx":189 * def get_extended(): * # This may be called before init. * return True # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/image.pyx":187 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_b_BMP, __pyx_k_BMP, sizeof(__pyx_k_BMP), 0, 0, 0, 0}, {&__pyx_n_s_INIT_AVIF, __pyx_k_INIT_AVIF, sizeof(__pyx_k_INIT_AVIF), 0, 0, 1, 1}, {&__pyx_n_s_INIT_JPG, __pyx_k_INIT_JPG, sizeof(__pyx_k_INIT_JPG), 0, 0, 1, 1}, {&__pyx_n_s_INIT_JXL, __pyx_k_INIT_JXL, sizeof(__pyx_k_INIT_JXL), 0, 0, 1, 1}, {&__pyx_n_s_INIT_PNG, __pyx_k_INIT_PNG, sizeof(__pyx_k_INIT_PNG), 0, 0, 1, 1}, {&__pyx_n_s_INIT_TIF, __pyx_k_INIT_TIF, sizeof(__pyx_k_INIT_TIF), 0, 0, 1, 1}, {&__pyx_n_s_INIT_WEBP, __pyx_k_INIT_WEBP, sizeof(__pyx_k_INIT_WEBP), 0, 0, 1, 1}, {&__pyx_kp_b_JPEG, __pyx_k_JPEG, sizeof(__pyx_k_JPEG), 0, 0, 0, 0}, {&__pyx_kp_b_JPG, __pyx_k_JPG, sizeof(__pyx_k_JPG), 0, 0, 0, 0}, {&__pyx_kp_b_PNG, __pyx_k_PNG, sizeof(__pyx_k_PNG), 0, 0, 0, 0}, {&__pyx_kp_b_SVG, __pyx_k_SVG, sizeof(__pyx_k_SVG), 0, 0, 0, 0}, {&__pyx_n_s_TGA, __pyx_k_TGA, sizeof(__pyx_k_TGA), 0, 0, 1, 1}, {&__pyx_kp_s_Unsupported_format_s, __pyx_k_Unsupported_format_s, sizeof(__pyx_k_Unsupported_format_s), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 1}, {&__pyx_kp_b__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 0, 0}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_b__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 0, 0}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 0, 1, 1}, {&__pyx_n_s_compression_level, __pyx_k_compression_level, sizeof(__pyx_k_compression_level), 0, 0, 1, 1}, {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, {&__pyx_n_s_convert_alpha, __pyx_k_convert_alpha, sizeof(__pyx_k_convert_alpha), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_ext, __pyx_k_ext, sizeof(__pyx_k_ext), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, {&__pyx_n_s_filesystem_encode, __pyx_k_filesystem_encode, sizeof(__pyx_k_filesystem_encode), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_fn, __pyx_k_fn, sizeof(__pyx_k_fn), 0, 0, 1, 1}, {&__pyx_n_s_ftype, __pyx_k_ftype, sizeof(__pyx_k_ftype), 0, 0, 1, 1}, {&__pyx_n_s_get_extended, __pyx_k_get_extended, sizeof(__pyx_k_get_extended), 0, 0, 1, 1}, {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, {&__pyx_n_s_has_alpha, __pyx_k_has_alpha, sizeof(__pyx_k_has_alpha), 0, 0, 1, 1}, {&__pyx_n_s_has_init, __pyx_k_has_init, sizeof(__pyx_k_has_init), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_n_s_img, __pyx_k_img, sizeof(__pyx_k_img), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_namehint, __pyx_k_namehint, sizeof(__pyx_k_namehint), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_compat, __pyx_k_pygame_sdl2_compat, sizeof(__pyx_k_pygame_sdl2_compat), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_image, __pyx_k_pygame_sdl2_image, sizeof(__pyx_k_pygame_sdl2_image), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, {&__pyx_n_s_rwops, __pyx_k_rwops, sizeof(__pyx_k_rwops), 0, 0, 1, 1}, {&__pyx_n_s_save, __pyx_k_save, sizeof(__pyx_k_save), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_splitext, __pyx_k_splitext, sizeof(__pyx_k_splitext), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_k_src_pygame_sdl2_image_pyx, sizeof(__pyx_k_src_pygame_sdl2_image_pyx), 0, 0, 1, 0}, {&__pyx_n_s_surf, __pyx_k_surf, sizeof(__pyx_k_surf), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_s_tga, __pyx_k_tga, sizeof(__pyx_k_tga), 0, 0, 1, 0}, {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1}, {&__pyx_n_s_utf8_filename, __pyx_k_utf8_filename, sizeof(__pyx_k_utf8_filename), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {&__pyx_n_s_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 182, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/image.pyx":61 * * if not isinstance(namehint, bytes_): * namehint = namehint.encode("ascii", "replace") # <<<<<<<<<<<<<< * * if not namehint: */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_ascii, __pyx_n_s_replace); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/image.pyx":70 * ext = namehint * if ext[0] == b'.': * ext = ext[1:] # <<<<<<<<<<<<<< * * return ext.upper() */ __pyx_slice__4 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__4); __Pyx_GIVEREF(__pyx_slice__4); /* "pygame_sdl2/image.pyx":120 * raise error() * * cdef Surface surf = Surface(()) # <<<<<<<<<<<<<< * surf.take_surface(img) * */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/image.pyx":34 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * # Attempt to initialize everything. Only fail loudly if all formats fail * global image_formats */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_init, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 34, __pyx_L1_error) /* "pygame_sdl2/image.pyx":51 * INIT_AVIF = IMG_INIT_AVIF * * def has_init(int flags): # <<<<<<<<<<<<<< * return (flags & image_formats) == flags * */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_flags); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_has_init, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 51, __pyx_L1_error) /* "pygame_sdl2/image.pyx":54 * return (flags & image_formats) == flags * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_quit, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 54, __pyx_L1_error) /* "pygame_sdl2/image.pyx":74 * return ext.upper() * * def load(fi, namehint="", size=None): # <<<<<<<<<<<<<< * """ * `size` */ __pyx_tuple__11 = PyTuple_Pack(11, __pyx_n_s_fi, __pyx_n_s_namehint, __pyx_n_s_size, __pyx_n_s_img, __pyx_n_s_rwops, __pyx_n_s_ftype, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_surf, __pyx_n_s_n, __pyx_n_s_has_alpha); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_load, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 74, __pyx_L1_error) __pyx_tuple__13 = PyTuple_Pack(2, ((PyObject*)__pyx_kp_s__2), Py_None); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "pygame_sdl2/image.pyx":155 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if not isinstance(filename, unicode_): */ __pyx_tuple__14 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_filename, __pyx_n_s_compression, __pyx_n_s_ext, __pyx_n_s_err, __pyx_n_s_utf8_filename, __pyx_n_s_fn, __pyx_n_s_rwops, __pyx_n_s_compression_level); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_save, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 155, __pyx_L1_error) __pyx_tuple__16 = PyTuple_Pack(1, ((PyObject *)__pyx_int_neg_1)); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "pygame_sdl2/image.pyx":187 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_get_extended, 187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(1, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_image(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_image}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "image", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initimage(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initimage(void) #else __Pyx_PyMODINIT_FUNC PyInit_image(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_image(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_image(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'image' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("image", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "image" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_image(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__image) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.image")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.image", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/image.pyx":24 * from pygame_sdl2.rwobject cimport to_rwops * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 24, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":25 * * from pygame_sdl2.error import error * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode # <<<<<<<<<<<<<< * * import sys */ __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_bytes); __Pyx_GIVEREF(__pyx_n_s_bytes); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_bytes)) __PYX_ERR(0, 25, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_unicode); __Pyx_GIVEREF(__pyx_n_s_unicode); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_unicode)) __PYX_ERR(0, 25, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_filesystem_encode); __Pyx_GIVEREF(__pyx_n_s_filesystem_encode); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_filesystem_encode)) __PYX_ERR(0, 25, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_filesystem_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filesystem_encode, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":27 * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode * * import sys # <<<<<<<<<<<<<< * import os * import pygame_sdl2 */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":28 * * import sys * import os # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":29 * import sys * import os * import pygame_sdl2 # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":32 * * * cdef int image_formats = 0 # <<<<<<<<<<<<<< * * def init(): */ __pyx_v_11pygame_sdl2_5image_image_formats = 0; /* "pygame_sdl2/image.pyx":34 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * # Attempt to initialize everything. Only fail loudly if all formats fail * global image_formats */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5image_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_image, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":41 * raise error() * * init() # <<<<<<<<<<<<<< * * # Make it possible for python to check individual formats */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":44 * * # Make it possible for python to check individual formats * INIT_JPG = IMG_INIT_JPG # <<<<<<<<<<<<<< * INIT_PNG = IMG_INIT_PNG * INIT_TIF = IMG_INIT_TIF */ __pyx_t_3 = __Pyx_PyInt_From_IMG_InitFlags(IMG_INIT_JPG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INIT_JPG, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":45 * # Make it possible for python to check individual formats * INIT_JPG = IMG_INIT_JPG * INIT_PNG = IMG_INIT_PNG # <<<<<<<<<<<<<< * INIT_TIF = IMG_INIT_TIF * INIT_WEBP = IMG_INIT_WEBP */ __pyx_t_3 = __Pyx_PyInt_From_IMG_InitFlags(IMG_INIT_PNG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INIT_PNG, __pyx_t_3) < 0) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":46 * INIT_JPG = IMG_INIT_JPG * INIT_PNG = IMG_INIT_PNG * INIT_TIF = IMG_INIT_TIF # <<<<<<<<<<<<<< * INIT_WEBP = IMG_INIT_WEBP * INIT_JXL = IMG_INIT_JXL */ __pyx_t_3 = __Pyx_PyInt_From_IMG_InitFlags(IMG_INIT_TIF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INIT_TIF, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":47 * INIT_PNG = IMG_INIT_PNG * INIT_TIF = IMG_INIT_TIF * INIT_WEBP = IMG_INIT_WEBP # <<<<<<<<<<<<<< * INIT_JXL = IMG_INIT_JXL * INIT_AVIF = IMG_INIT_AVIF */ __pyx_t_3 = __Pyx_PyInt_From_IMG_InitFlags(IMG_INIT_WEBP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INIT_WEBP, __pyx_t_3) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":48 * INIT_TIF = IMG_INIT_TIF * INIT_WEBP = IMG_INIT_WEBP * INIT_JXL = IMG_INIT_JXL # <<<<<<<<<<<<<< * INIT_AVIF = IMG_INIT_AVIF * */ __pyx_t_3 = __Pyx_PyInt_From_IMG_InitFlags(IMG_INIT_JXL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INIT_JXL, __pyx_t_3) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":49 * INIT_WEBP = IMG_INIT_WEBP * INIT_JXL = IMG_INIT_JXL * INIT_AVIF = IMG_INIT_AVIF # <<<<<<<<<<<<<< * * def has_init(int flags): */ __pyx_t_3 = __Pyx_PyInt_From_IMG_InitFlags(IMG_INIT_AVIF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INIT_AVIF, __pyx_t_3) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":51 * INIT_AVIF = IMG_INIT_AVIF * * def has_init(int flags): # <<<<<<<<<<<<<< * return (flags & image_formats) == flags * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5image_3has_init, 0, __pyx_n_s_has_init, NULL, __pyx_n_s_pygame_sdl2_image, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_init, __pyx_t_3) < 0) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":54 * return (flags & image_formats) == flags * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5image_5quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_image, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_3) < 0) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":74 * return ext.upper() * * def load(fi, namehint="", size=None): # <<<<<<<<<<<<<< * """ * `size` */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5image_7load, 0, __pyx_n_s_load, NULL, __pyx_n_s_pygame_sdl2_image, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__13); if (PyDict_SetItem(__pyx_d, __pyx_n_s_load, __pyx_t_3) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":155 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if not isinstance(filename, unicode_): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5image_9save, 0, __pyx_n_s_save, NULL, __pyx_n_s_pygame_sdl2_image, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__16); if (PyDict_SetItem(__pyx_d, __pyx_n_s_save, __pyx_t_3) < 0) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":187 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5image_11get_extended, 0, __pyx_n_s_get_extended, NULL, __pyx_n_s_pygame_sdl2_image, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_extended, __pyx_t_3) < 0) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.image", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.image"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_12 #define __PYX_HAVE_RT_ImportType_3_0_12 static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__3); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__6; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_IMG_InitFlags(IMG_InitFlags value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const IMG_InitFlags neg_one = (IMG_InitFlags) -1, const_zero = (IMG_InitFlags) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(IMG_InitFlags) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(IMG_InitFlags) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(IMG_InitFlags) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(IMG_InitFlags) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(IMG_InitFlags) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(IMG_InitFlags), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(IMG_InitFlags)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__18); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CheckBinaryVersion */ static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12 #define __PYX_HAVE_RT_ImportFunction_3_0_12 static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635911.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.joystick.c0000664000175000017500000161505015026112607020740 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__joystick #define __PYX_HAVE_API__pygame_sdl2__joystick /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "", "src/pygame_sdl2/joystick.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_8joystick_Joystick; /* "pygame_sdl2/joystick.pyx":41 * * * cdef class Joystick: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_8joystick_Joystick { PyObject_HEAD PyObject *__weakref__; SDL_Joystick *joystick; int joyid; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.joystick" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.joystick" extern int __pyx_module_is_main_pygame_sdl2__joystick; int __pyx_module_is_main_pygame_sdl2__joystick = 0; /* Implementation of "pygame_sdl2.joystick" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; static const char __pyx_k__2[] = "*"; static const char __pyx_k_dx[] = "dx"; static const char __pyx_k_dy[] = "dy"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_hx[] = "hx"; static const char __pyx_k_hy[] = "hy"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__29[] = "?"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_button[] = "button"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_get_id[] = "get_id"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_get_hat[] = "get_hat"; static const char __pyx_k_Joystick[] = "Joystick"; static const char __pyx_k_get_axis[] = "get_axis"; static const char __pyx_k_get_ball[] = "get_ball"; static const char __pyx_k_get_init[] = "get_init"; static const char __pyx_k_get_name[] = "get_name"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_get_count[] = "get_count"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_get_button[] = "get_button"; static const char __pyx_k_hat_number[] = "hat_number"; static const char __pyx_k_axis_number[] = "axis_number"; static const char __pyx_k_ball_number[] = "ball_number"; static const char __pyx_k_get_numaxes[] = "get_numaxes"; static const char __pyx_k_get_numhats[] = "get_numhats"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_get_numballs[] = "get_numballs"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_Joystick_init[] = "Joystick.init"; static const char __pyx_k_Joystick_quit[] = "Joystick.quit"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_sdl_main_init[] = "sdl_main_init"; static const char __pyx_k_get_numbuttons[] = "get_numbuttons"; static const char __pyx_k_Joystick_get_id[] = "Joystick.get_id"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Joystick_get_hat[] = "Joystick.get_hat"; static const char __pyx_k_Joystick_get_axis[] = "Joystick.get_axis"; static const char __pyx_k_Joystick_get_ball[] = "Joystick.get_ball"; static const char __pyx_k_Joystick_get_init[] = "Joystick.get_init"; static const char __pyx_k_Joystick_get_name[] = "Joystick.get_name"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Joystick_get_button[] = "Joystick.get_button"; static const char __pyx_k_Joystick_get_numaxes[] = "Joystick.get_numaxes"; static const char __pyx_k_Joystick_get_numhats[] = "Joystick.get_numhats"; static const char __pyx_k_pygame_sdl2_joystick[] = "pygame_sdl2.joystick"; static const char __pyx_k_Joystick_get_numballs[] = "Joystick.get_numballs"; static const char __pyx_k_Joystick_get_numbuttons[] = "Joystick.get_numbuttons"; static const char __pyx_k_Joystick___reduce_cython[] = "Joystick.__reduce_cython__"; static const char __pyx_k_joystick_not_initialized[] = "joystick not initialized"; static const char __pyx_k_Joystick___setstate_cython[] = "Joystick.__setstate_cython__"; static const char __pyx_k_src_pygame_sdl2_joystick_pyx[] = "src/pygame_sdl2/joystick.pyx"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_4get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_6get_count(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick___cinit__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick_2__init__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_id); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_4init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_6quit(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_8get_init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_10get_id(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_12get_name(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_14get_numaxes(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_16get_numballs(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_20get_numhats(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_22get_axis(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_axis_number); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_24get_ball(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_ball_number); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_26get_button(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_button); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_28get_hat(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_hat_number); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_8joystick_Joystick(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_8joystick_Joystick; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_8joystick_Joystick; PyObject *__pyx_kp_u_; PyObject *__pyx_n_s_Joystick; PyObject *__pyx_n_s_Joystick___reduce_cython; PyObject *__pyx_n_s_Joystick___setstate_cython; PyObject *__pyx_n_s_Joystick_get_axis; PyObject *__pyx_n_s_Joystick_get_ball; PyObject *__pyx_n_s_Joystick_get_button; PyObject *__pyx_n_s_Joystick_get_hat; PyObject *__pyx_n_s_Joystick_get_id; PyObject *__pyx_n_s_Joystick_get_init; PyObject *__pyx_n_s_Joystick_get_name; PyObject *__pyx_n_s_Joystick_get_numaxes; PyObject *__pyx_n_s_Joystick_get_numballs; PyObject *__pyx_n_s_Joystick_get_numbuttons; PyObject *__pyx_n_s_Joystick_get_numhats; PyObject *__pyx_n_s_Joystick_init; PyObject *__pyx_n_s_Joystick_quit; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s__2; PyObject *__pyx_n_s__29; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_axis_number; PyObject *__pyx_n_s_ball_number; PyObject *__pyx_n_s_button; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_display; PyObject *__pyx_n_s_dx; PyObject *__pyx_n_s_dy; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_error; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_axis; PyObject *__pyx_n_s_get_ball; PyObject *__pyx_n_s_get_button; PyObject *__pyx_n_s_get_count; PyObject *__pyx_n_s_get_hat; PyObject *__pyx_n_s_get_id; PyObject *__pyx_n_s_get_init; PyObject *__pyx_n_s_get_name; PyObject *__pyx_n_s_get_numaxes; PyObject *__pyx_n_s_get_numballs; PyObject *__pyx_n_s_get_numbuttons; PyObject *__pyx_n_s_get_numhats; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_hat_number; PyObject *__pyx_n_s_hx; PyObject *__pyx_n_s_hy; PyObject *__pyx_n_s_id; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_kp_s_joystick_not_initialized; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_joystick; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_register_init; PyObject *__pyx_n_s_register_quit; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_sdl_main_init; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_joystick_pyx; PyObject *__pyx_n_s_state; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_test; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__27; PyObject *__pyx_codeobj__3; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__28; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_8joystick_Joystick); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_8joystick_Joystick); Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_axis); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_ball); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_button); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_hat); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_id); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_name); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_numaxes); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_numballs); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_numbuttons); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_get_numhats); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_init); Py_CLEAR(clear_module_state->__pyx_n_s_Joystick_quit); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s__2); Py_CLEAR(clear_module_state->__pyx_n_s__29); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_axis_number); Py_CLEAR(clear_module_state->__pyx_n_s_ball_number); Py_CLEAR(clear_module_state->__pyx_n_s_button); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_display); Py_CLEAR(clear_module_state->__pyx_n_s_dx); Py_CLEAR(clear_module_state->__pyx_n_s_dy); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_axis); Py_CLEAR(clear_module_state->__pyx_n_s_get_ball); Py_CLEAR(clear_module_state->__pyx_n_s_get_button); Py_CLEAR(clear_module_state->__pyx_n_s_get_count); Py_CLEAR(clear_module_state->__pyx_n_s_get_hat); Py_CLEAR(clear_module_state->__pyx_n_s_get_id); Py_CLEAR(clear_module_state->__pyx_n_s_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_get_name); Py_CLEAR(clear_module_state->__pyx_n_s_get_numaxes); Py_CLEAR(clear_module_state->__pyx_n_s_get_numballs); Py_CLEAR(clear_module_state->__pyx_n_s_get_numbuttons); Py_CLEAR(clear_module_state->__pyx_n_s_get_numhats); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_hat_number); Py_CLEAR(clear_module_state->__pyx_n_s_hx); Py_CLEAR(clear_module_state->__pyx_n_s_hy); Py_CLEAR(clear_module_state->__pyx_n_s_id); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_kp_s_joystick_not_initialized); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_joystick); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_register_init); Py_CLEAR(clear_module_state->__pyx_n_s_register_quit); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_main_init); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_joystick_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_codeobj__3); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__28); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_8joystick_Joystick); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_8joystick_Joystick); Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_axis); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_ball); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_button); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_hat); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_id); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_name); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_numaxes); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_numballs); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_numbuttons); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_get_numhats); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_init); Py_VISIT(traverse_module_state->__pyx_n_s_Joystick_quit); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s__2); Py_VISIT(traverse_module_state->__pyx_n_s__29); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_axis_number); Py_VISIT(traverse_module_state->__pyx_n_s_ball_number); Py_VISIT(traverse_module_state->__pyx_n_s_button); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_display); Py_VISIT(traverse_module_state->__pyx_n_s_dx); Py_VISIT(traverse_module_state->__pyx_n_s_dy); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_axis); Py_VISIT(traverse_module_state->__pyx_n_s_get_ball); Py_VISIT(traverse_module_state->__pyx_n_s_get_button); Py_VISIT(traverse_module_state->__pyx_n_s_get_count); Py_VISIT(traverse_module_state->__pyx_n_s_get_hat); Py_VISIT(traverse_module_state->__pyx_n_s_get_id); Py_VISIT(traverse_module_state->__pyx_n_s_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_get_name); Py_VISIT(traverse_module_state->__pyx_n_s_get_numaxes); Py_VISIT(traverse_module_state->__pyx_n_s_get_numballs); Py_VISIT(traverse_module_state->__pyx_n_s_get_numbuttons); Py_VISIT(traverse_module_state->__pyx_n_s_get_numhats); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_hat_number); Py_VISIT(traverse_module_state->__pyx_n_s_hx); Py_VISIT(traverse_module_state->__pyx_n_s_hy); Py_VISIT(traverse_module_state->__pyx_n_s_id); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_kp_s_joystick_not_initialized); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_joystick); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_register_init); Py_VISIT(traverse_module_state->__pyx_n_s_register_quit); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_main_init); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_joystick_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_codeobj__3); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__28); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_8joystick_Joystick __pyx_mstate_global->__pyx_type_11pygame_sdl2_8joystick_Joystick #endif #define __pyx_ptype_11pygame_sdl2_8joystick_Joystick __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_8joystick_Joystick #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_n_s_Joystick __pyx_mstate_global->__pyx_n_s_Joystick #define __pyx_n_s_Joystick___reduce_cython __pyx_mstate_global->__pyx_n_s_Joystick___reduce_cython #define __pyx_n_s_Joystick___setstate_cython __pyx_mstate_global->__pyx_n_s_Joystick___setstate_cython #define __pyx_n_s_Joystick_get_axis __pyx_mstate_global->__pyx_n_s_Joystick_get_axis #define __pyx_n_s_Joystick_get_ball __pyx_mstate_global->__pyx_n_s_Joystick_get_ball #define __pyx_n_s_Joystick_get_button __pyx_mstate_global->__pyx_n_s_Joystick_get_button #define __pyx_n_s_Joystick_get_hat __pyx_mstate_global->__pyx_n_s_Joystick_get_hat #define __pyx_n_s_Joystick_get_id __pyx_mstate_global->__pyx_n_s_Joystick_get_id #define __pyx_n_s_Joystick_get_init __pyx_mstate_global->__pyx_n_s_Joystick_get_init #define __pyx_n_s_Joystick_get_name __pyx_mstate_global->__pyx_n_s_Joystick_get_name #define __pyx_n_s_Joystick_get_numaxes __pyx_mstate_global->__pyx_n_s_Joystick_get_numaxes #define __pyx_n_s_Joystick_get_numballs __pyx_mstate_global->__pyx_n_s_Joystick_get_numballs #define __pyx_n_s_Joystick_get_numbuttons __pyx_mstate_global->__pyx_n_s_Joystick_get_numbuttons #define __pyx_n_s_Joystick_get_numhats __pyx_mstate_global->__pyx_n_s_Joystick_get_numhats #define __pyx_n_s_Joystick_init __pyx_mstate_global->__pyx_n_s_Joystick_init #define __pyx_n_s_Joystick_quit __pyx_mstate_global->__pyx_n_s_Joystick_quit #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s__2 __pyx_mstate_global->__pyx_n_s__2 #define __pyx_n_s__29 __pyx_mstate_global->__pyx_n_s__29 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_axis_number __pyx_mstate_global->__pyx_n_s_axis_number #define __pyx_n_s_ball_number __pyx_mstate_global->__pyx_n_s_ball_number #define __pyx_n_s_button __pyx_mstate_global->__pyx_n_s_button #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display #define __pyx_n_s_dx __pyx_mstate_global->__pyx_n_s_dx #define __pyx_n_s_dy __pyx_mstate_global->__pyx_n_s_dy #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_axis __pyx_mstate_global->__pyx_n_s_get_axis #define __pyx_n_s_get_ball __pyx_mstate_global->__pyx_n_s_get_ball #define __pyx_n_s_get_button __pyx_mstate_global->__pyx_n_s_get_button #define __pyx_n_s_get_count __pyx_mstate_global->__pyx_n_s_get_count #define __pyx_n_s_get_hat __pyx_mstate_global->__pyx_n_s_get_hat #define __pyx_n_s_get_id __pyx_mstate_global->__pyx_n_s_get_id #define __pyx_n_s_get_init __pyx_mstate_global->__pyx_n_s_get_init #define __pyx_n_s_get_name __pyx_mstate_global->__pyx_n_s_get_name #define __pyx_n_s_get_numaxes __pyx_mstate_global->__pyx_n_s_get_numaxes #define __pyx_n_s_get_numballs __pyx_mstate_global->__pyx_n_s_get_numballs #define __pyx_n_s_get_numbuttons __pyx_mstate_global->__pyx_n_s_get_numbuttons #define __pyx_n_s_get_numhats __pyx_mstate_global->__pyx_n_s_get_numhats #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_hat_number __pyx_mstate_global->__pyx_n_s_hat_number #define __pyx_n_s_hx __pyx_mstate_global->__pyx_n_s_hx #define __pyx_n_s_hy __pyx_mstate_global->__pyx_n_s_hy #define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_kp_s_joystick_not_initialized __pyx_mstate_global->__pyx_kp_s_joystick_not_initialized #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_joystick __pyx_mstate_global->__pyx_n_s_pygame_sdl2_joystick #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_register_init __pyx_mstate_global->__pyx_n_s_register_init #define __pyx_n_s_register_quit __pyx_mstate_global->__pyx_n_s_register_quit #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_sdl_main_init __pyx_mstate_global->__pyx_n_s_sdl_main_init #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_joystick_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_joystick_pyx #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 /* #### Code section: module_code ### */ /* "pygame_sdl2/joystick.pyx":23 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_8joystick_init}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/joystick.pyx":25 * @pygame_sdl2.register_init * def init(): * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/joystick.pyx":27 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = (SDL_InitSubSystem(SDL_INIT_JOYSTICK) != 0); if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/joystick.pyx":28 * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): * raise error() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 28, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":27 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/joystick.pyx":23 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":30 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_2quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_3quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_8joystick_2quit}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/joystick.pyx":32 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) # <<<<<<<<<<<<<< * * def get_init(): */ SDL_QuitSubSystem(SDL_INIT_JOYSTICK); /* "pygame_sdl2/joystick.pyx":30 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_4get_init, "get_init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_5get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_5get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_8joystick_4get_init}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_4get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_4get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/joystick.pyx":35 * * def get_init(): * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 # <<<<<<<<<<<<<< * * def get_count(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_WasInit(SDL_INIT_JOYSTICK) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.joystick.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_6get_count, "get_count()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_7get_count = {"get_count", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_7get_count, METH_NOARGS, __pyx_doc_11pygame_sdl2_8joystick_6get_count}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_count (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_6get_count(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_6get_count(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_count", 1); /* "pygame_sdl2/joystick.pyx":38 * * def get_count(): * return SDL_NumJoysticks() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(SDL_NumJoysticks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.joystick.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":48 * cdef int joyid * * def __cinit__(self): # <<<<<<<<<<<<<< * self.joystick = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick___cinit__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick___cinit__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/joystick.pyx":49 * * def __cinit__(self): * self.joystick = NULL # <<<<<<<<<<<<<< * * def __init__(self, id): */ __pyx_v_self->joystick = NULL; /* "pygame_sdl2/joystick.pyx":48 * cdef int joyid * * def __cinit__(self): # <<<<<<<<<<<<<< * self.joystick = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/joystick.pyx":51 * self.joystick = NULL * * def __init__(self, id): # <<<<<<<<<<<<<< * self.joyid = id * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_id = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_id,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_id)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 51, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_id = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 51, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_2__init__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v_id); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick_2__init__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_id) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/joystick.pyx":52 * * def __init__(self, id): * self.joyid = id # <<<<<<<<<<<<<< * * def init(self): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_id); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 52, __pyx_L1_error) __pyx_v_self->joyid = __pyx_t_1; /* "pygame_sdl2/joystick.pyx":51 * self.joystick = NULL * * def __init__(self, id): # <<<<<<<<<<<<<< * self.joyid = id * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/joystick.pyx":54 * self.joyid = id * * def init(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_4init, "Joystick.init(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_5init = {"init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_4init}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("init", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "init", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_4init(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_4init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/joystick.pyx":55 * * def init(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":56 * def init(self): * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error() */ __pyx_v_self->joystick = SDL_JoystickOpen(__pyx_v_self->joyid); /* "pygame_sdl2/joystick.pyx":57 * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":58 * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: * raise error() # <<<<<<<<<<<<<< * * def quit(self): # @ReservedAssignment */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 58, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":57 * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/joystick.pyx":55 * * def init(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: */ } /* "pygame_sdl2/joystick.pyx":54 * self.joyid = id * * def init(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":60 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_6quit, "Joystick.quit(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_7quit = {"quit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_6quit}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("quit", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "quit", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_6quit(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_6quit(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/joystick.pyx":61 * * def quit(self): # @ReservedAssignment * if self.joystick != NULL: # <<<<<<<<<<<<<< * SDL_JoystickClose(self.joystick) * self.joystick = NULL */ __pyx_t_1 = (__pyx_v_self->joystick != NULL); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":62 * def quit(self): # @ReservedAssignment * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) # <<<<<<<<<<<<<< * self.joystick = NULL * */ SDL_JoystickClose(__pyx_v_self->joystick); /* "pygame_sdl2/joystick.pyx":63 * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) * self.joystick = NULL # <<<<<<<<<<<<<< * * def get_init(self): */ __pyx_v_self->joystick = NULL; /* "pygame_sdl2/joystick.pyx":61 * * def quit(self): # @ReservedAssignment * if self.joystick != NULL: # <<<<<<<<<<<<<< * SDL_JoystickClose(self.joystick) * self.joystick = NULL */ } /* "pygame_sdl2/joystick.pyx":60 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":65 * self.joystick = NULL * * def get_init(self): # <<<<<<<<<<<<<< * if self.joystick: * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_8get_init, "Joystick.get_init(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_9get_init = {"get_init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_8get_init}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_init", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_init", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_8get_init(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_8get_init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/joystick.pyx":66 * * def get_init(self): * if self.joystick: # <<<<<<<<<<<<<< * return True * else: */ __pyx_t_1 = (__pyx_v_self->joystick != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":67 * def get_init(self): * if self.joystick: * return True # <<<<<<<<<<<<<< * else: * return False */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":66 * * def get_init(self): * if self.joystick: # <<<<<<<<<<<<<< * return True * else: */ } /* "pygame_sdl2/joystick.pyx":69 * return True * else: * return False # <<<<<<<<<<<<<< * * def get_id(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "pygame_sdl2/joystick.pyx":65 * self.joystick = NULL * * def get_init(self): # <<<<<<<<<<<<<< * if self.joystick: * return True */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":71 * return False * * def get_id(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_10get_id, "Joystick.get_id(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_11get_id = {"get_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_10get_id}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_id (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_id", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_id", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_10get_id(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_10get_id(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_id", 1); /* "pygame_sdl2/joystick.pyx":72 * * def get_id(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":73 * def get_id(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickInstanceID(self.joystick) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 73, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":72 * * def get_id(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":75 * raise error("joystick not initialized") * * return SDL_JoystickInstanceID(self.joystick) # <<<<<<<<<<<<<< * * def get_name(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int32_t(SDL_JoystickInstanceID(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":71 * return False * * def get_id(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_id", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":77 * return SDL_JoystickInstanceID(self.joystick) * * def get_name(self): # <<<<<<<<<<<<<< * cdef char *rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_12get_name, "Joystick.get_name(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_13get_name = {"get_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_12get_name}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_name (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_name", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_name", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_12get_name(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_12get_name(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { char *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_name", 1); /* "pygame_sdl2/joystick.pyx":80 * cdef char *rv * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":81 * * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * rv = SDL_JoystickName(self.joystick) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 81, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":80 * cdef char *rv * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":83 * raise error("joystick not initialized") * * rv = SDL_JoystickName(self.joystick) # <<<<<<<<<<<<<< * * if rv: */ __pyx_v_rv = SDL_JoystickName(__pyx_v_self->joystick); /* "pygame_sdl2/joystick.pyx":85 * rv = SDL_JoystickName(self.joystick) * * if rv: # <<<<<<<<<<<<<< * return rv.decode("utf-8") * else: */ __pyx_t_1 = (__pyx_v_rv != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":86 * * if rv: * return rv.decode("utf-8") # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_ssize_strlen(__pyx_v_rv); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(1, 86, __pyx_L1_error) __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_rv, 0, __pyx_t_6, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":85 * rv = SDL_JoystickName(self.joystick) * * if rv: # <<<<<<<<<<<<<< * return rv.decode("utf-8") * else: */ } /* "pygame_sdl2/joystick.pyx":88 * return rv.decode("utf-8") * else: * return None # <<<<<<<<<<<<<< * * def get_numaxes(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "pygame_sdl2/joystick.pyx":77 * return SDL_JoystickInstanceID(self.joystick) * * def get_name(self): # <<<<<<<<<<<<<< * cdef char *rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":90 * return None * * def get_numaxes(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_14get_numaxes, "Joystick.get_numaxes(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_15get_numaxes = {"get_numaxes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_14get_numaxes}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numaxes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_numaxes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_numaxes", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_14get_numaxes(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_14get_numaxes(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numaxes", 1); /* "pygame_sdl2/joystick.pyx":91 * * def get_numaxes(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":92 * def get_numaxes(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumAxes(self.joystick) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 92, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":91 * * def get_numaxes(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":94 * raise error("joystick not initialized") * * return SDL_JoystickNumAxes(self.joystick) # <<<<<<<<<<<<<< * * def get_numballs(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_JoystickNumAxes(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":90 * return None * * def get_numaxes(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numaxes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":96 * return SDL_JoystickNumAxes(self.joystick) * * def get_numballs(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_16get_numballs, "Joystick.get_numballs(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_17get_numballs = {"get_numballs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_16get_numballs}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numballs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_numballs", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_numballs", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_16get_numballs(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_16get_numballs(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numballs", 1); /* "pygame_sdl2/joystick.pyx":97 * * def get_numballs(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":98 * def get_numballs(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumBalls(self.joystick) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 98, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":97 * * def get_numballs(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":100 * raise error("joystick not initialized") * * return SDL_JoystickNumBalls(self.joystick) # <<<<<<<<<<<<<< * * def get_numbuttons(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_JoystickNumBalls(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":96 * return SDL_JoystickNumAxes(self.joystick) * * def get_numballs(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numballs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":102 * return SDL_JoystickNumBalls(self.joystick) * * def get_numbuttons(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons, "Joystick.get_numbuttons(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons = {"get_numbuttons", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numbuttons (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_numbuttons", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_numbuttons", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numbuttons", 1); /* "pygame_sdl2/joystick.pyx":103 * * def get_numbuttons(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":104 * def get_numbuttons(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumButtons(self.joystick) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 104, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":103 * * def get_numbuttons(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":106 * raise error("joystick not initialized") * * return SDL_JoystickNumButtons(self.joystick) # <<<<<<<<<<<<<< * * def get_numhats(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_JoystickNumButtons(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":102 * return SDL_JoystickNumBalls(self.joystick) * * def get_numbuttons(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numbuttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":108 * return SDL_JoystickNumButtons(self.joystick) * * def get_numhats(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_20get_numhats, "Joystick.get_numhats(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_21get_numhats = {"get_numhats", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_20get_numhats}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numhats (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_numhats", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_numhats", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_20get_numhats(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_20get_numhats(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numhats", 1); /* "pygame_sdl2/joystick.pyx":109 * * def get_numhats(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":110 * def get_numhats(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumHats(self.joystick) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 110, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":109 * * def get_numhats(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":112 * raise error("joystick not initialized") * * return SDL_JoystickNumHats(self.joystick) # <<<<<<<<<<<<<< * * def get_axis(self, axis_number): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_JoystickNumHats(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":108 * return SDL_JoystickNumButtons(self.joystick) * * def get_numhats(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numhats", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":114 * return SDL_JoystickNumHats(self.joystick) * * def get_axis(self, axis_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_22get_axis, "Joystick.get_axis(self, axis_number)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_23get_axis = {"get_axis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_22get_axis}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_axis_number = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_axis (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_axis_number,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_axis_number)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 114, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_axis") < 0)) __PYX_ERR(1, 114, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_axis_number = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_axis", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 114, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_22get_axis(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v_axis_number); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_22get_axis(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_axis_number) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_axis", 1); /* "pygame_sdl2/joystick.pyx":115 * * def get_axis(self, axis_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":116 * def get_axis(self, axis_number): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 116, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":115 * * def get_axis(self, axis_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":118 * raise error("joystick not initialized") * * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 # <<<<<<<<<<<<<< * * def get_ball(self, ball_number): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_axis_number); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 118, __pyx_L1_error) __pyx_t_2 = PyFloat_FromDouble((((double)SDL_JoystickGetAxis(__pyx_v_self->joystick, __pyx_t_6)) / 32768.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":114 * return SDL_JoystickNumHats(self.joystick) * * def get_axis(self, axis_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":120 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 * * def get_ball(self, ball_number): # <<<<<<<<<<<<<< * cdef int dx, dy * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_24get_ball, "Joystick.get_ball(self, ball_number)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_25get_ball = {"get_ball", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_24get_ball}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ball_number = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_ball (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ball_number,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ball_number)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 120, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_ball") < 0)) __PYX_ERR(1, 120, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_ball_number = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_ball", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 120, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_ball", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_24get_ball(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v_ball_number); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_24get_ball(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_ball_number) { int __pyx_v_dx; int __pyx_v_dy; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_ball", 1); /* "pygame_sdl2/joystick.pyx":123 * cdef int dx, dy * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":124 * * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 124, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":123 * cdef int dx, dy * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":126 * raise error("joystick not initialized") * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: # <<<<<<<<<<<<<< * return (dx, dy) * else: */ __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_ball_number); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 126, __pyx_L1_error) __pyx_t_1 = (SDL_JoystickGetBall(__pyx_v_self->joystick, __pyx_t_6, (&__pyx_v_dx), (&__pyx_v_dy)) == 0); if (likely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":127 * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: * return (dx, dy) # <<<<<<<<<<<<<< * else: * raise error() */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dy); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(1, 127, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(1, 127, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":126 * raise error("joystick not initialized") * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: # <<<<<<<<<<<<<< * return (dx, dy) * else: */ } /* "pygame_sdl2/joystick.pyx":129 * return (dx, dy) * else: * raise error() # <<<<<<<<<<<<<< * * def get_button(self, button): */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 129, __pyx_L1_error) } /* "pygame_sdl2/joystick.pyx":120 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 * * def get_ball(self, ball_number): # <<<<<<<<<<<<<< * cdef int dx, dy * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_ball", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":131 * raise error() * * def get_button(self, button): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_26get_button, "Joystick.get_button(self, button)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_27get_button = {"get_button", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_26get_button}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_button = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_button (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_button,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_button)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_button") < 0)) __PYX_ERR(1, 131, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_button = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_button", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 131, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_26get_button(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v_button); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_26get_button(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_button", 1); /* "pygame_sdl2/joystick.pyx":132 * * def get_button(self, button): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":133 * def get_button(self, button): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickGetButton(self.joystick, button) == 1 */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 133, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":132 * * def get_button(self, button): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":135 * raise error("joystick not initialized") * * return SDL_JoystickGetButton(self.joystick, button) == 1 # <<<<<<<<<<<<<< * * def get_hat(self, hat_number): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_button); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 135, __pyx_L1_error) __pyx_t_2 = __Pyx_PyBool_FromLong((SDL_JoystickGetButton(__pyx_v_self->joystick, __pyx_t_6) == 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":131 * raise error() * * def get_button(self, button): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":137 * return SDL_JoystickGetButton(self.joystick, button) == 1 * * def get_hat(self, hat_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_28get_hat, "Joystick.get_hat(self, hat_number)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_29get_hat = {"get_hat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_28get_hat}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_hat_number = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_hat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hat_number,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hat_number)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 137, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_hat") < 0)) __PYX_ERR(1, 137, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_hat_number = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_hat", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 137, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_hat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_28get_hat(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v_hat_number); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_28get_hat(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_hat_number) { Uint8 __pyx_v_state; long __pyx_v_hx; long __pyx_v_hy; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_hat", 1); /* "pygame_sdl2/joystick.pyx":138 * * def get_hat(self, hat_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = (__pyx_v_self->joystick == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/joystick.pyx":139 * def get_hat(self, hat_number): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * state = SDL_JoystickGetHat(self.joystick, hat_number) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_joystick_not_initialized}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 139, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":138 * * def get_hat(self, hat_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":141 * raise error("joystick not initialized") * * state = SDL_JoystickGetHat(self.joystick, hat_number) # <<<<<<<<<<<<<< * hx = hy = 0 * if state & SDL_HAT_LEFT: */ __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_hat_number); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error) __pyx_v_state = SDL_JoystickGetHat(__pyx_v_self->joystick, __pyx_t_6); /* "pygame_sdl2/joystick.pyx":142 * * state = SDL_JoystickGetHat(self.joystick, hat_number) * hx = hy = 0 # <<<<<<<<<<<<<< * if state & SDL_HAT_LEFT: * hx = -1 */ __pyx_v_hx = 0; __pyx_v_hy = 0; /* "pygame_sdl2/joystick.pyx":143 * state = SDL_JoystickGetHat(self.joystick, hat_number) * hx = hy = 0 * if state & SDL_HAT_LEFT: # <<<<<<<<<<<<<< * hx = -1 * elif state & SDL_HAT_RIGHT: */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_LEFT) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":144 * hx = hy = 0 * if state & SDL_HAT_LEFT: * hx = -1 # <<<<<<<<<<<<<< * elif state & SDL_HAT_RIGHT: * hx = 1 */ __pyx_v_hx = -1L; /* "pygame_sdl2/joystick.pyx":143 * state = SDL_JoystickGetHat(self.joystick, hat_number) * hx = hy = 0 * if state & SDL_HAT_LEFT: # <<<<<<<<<<<<<< * hx = -1 * elif state & SDL_HAT_RIGHT: */ goto __pyx_L4; } /* "pygame_sdl2/joystick.pyx":145 * if state & SDL_HAT_LEFT: * hx = -1 * elif state & SDL_HAT_RIGHT: # <<<<<<<<<<<<<< * hx = 1 * */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_RIGHT) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":146 * hx = -1 * elif state & SDL_HAT_RIGHT: * hx = 1 # <<<<<<<<<<<<<< * * if state & SDL_HAT_UP: */ __pyx_v_hx = 1; /* "pygame_sdl2/joystick.pyx":145 * if state & SDL_HAT_LEFT: * hx = -1 * elif state & SDL_HAT_RIGHT: # <<<<<<<<<<<<<< * hx = 1 * */ } __pyx_L4:; /* "pygame_sdl2/joystick.pyx":148 * hx = 1 * * if state & SDL_HAT_UP: # <<<<<<<<<<<<<< * hy = 1 * elif state & SDL_HAT_DOWN: */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_UP) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":149 * * if state & SDL_HAT_UP: * hy = 1 # <<<<<<<<<<<<<< * elif state & SDL_HAT_DOWN: * hy = -1 */ __pyx_v_hy = 1; /* "pygame_sdl2/joystick.pyx":148 * hx = 1 * * if state & SDL_HAT_UP: # <<<<<<<<<<<<<< * hy = 1 * elif state & SDL_HAT_DOWN: */ goto __pyx_L5; } /* "pygame_sdl2/joystick.pyx":150 * if state & SDL_HAT_UP: * hy = 1 * elif state & SDL_HAT_DOWN: # <<<<<<<<<<<<<< * hy = -1 * */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_DOWN) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":151 * hy = 1 * elif state & SDL_HAT_DOWN: * hy = -1 # <<<<<<<<<<<<<< * * return (hx, hy) */ __pyx_v_hy = -1L; /* "pygame_sdl2/joystick.pyx":150 * if state & SDL_HAT_UP: * hy = 1 * elif state & SDL_HAT_DOWN: # <<<<<<<<<<<<<< * hy = -1 * */ } __pyx_L5:; /* "pygame_sdl2/joystick.pyx":153 * hy = -1 * * return (hx, hy) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_hx); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_hy); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(1, 153, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":137 * return SDL_JoystickGetButton(self.joystick, button) == 1 * * def get_hat(self, hat_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_hat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__, "Joystick.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__, "Joystick.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_8joystick_Joystick(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_11pygame_sdl2_8joystick_8Joystick_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_8joystick_Joystick(PyObject *o) { struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *p = (struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_8joystick_Joystick) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_11pygame_sdl2_8joystick_Joystick[] = { {"init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_4init}, {"quit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_6quit}, {"get_init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_8get_init}, {"get_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_10get_id}, {"get_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_12get_name}, {"get_numaxes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_14get_numaxes}, {"get_numballs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_16get_numballs}, {"get_numbuttons", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons}, {"get_numhats", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_20get_numhats}, {"get_axis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_22get_axis}, {"get_ball", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_24get_ball}, {"get_button", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_26get_button}, {"get_hat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_28get_hat}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_8joystick_Joystick_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_8joystick_Joystick}, {Py_tp_doc, (void *)PyDoc_STR("Joystick(id)")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_8joystick_Joystick}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_8joystick_Joystick}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_8joystick_Joystick_spec = { "pygame_sdl2.joystick.Joystick", sizeof(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_8joystick_Joystick_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_8joystick_Joystick = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.joystick.""Joystick", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_8joystick_Joystick, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Joystick(id)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_8joystick_Joystick, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_8joystick_Joystick, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_Joystick, __pyx_k_Joystick, sizeof(__pyx_k_Joystick), 0, 0, 1, 1}, {&__pyx_n_s_Joystick___reduce_cython, __pyx_k_Joystick___reduce_cython, sizeof(__pyx_k_Joystick___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Joystick___setstate_cython, __pyx_k_Joystick___setstate_cython, sizeof(__pyx_k_Joystick___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_axis, __pyx_k_Joystick_get_axis, sizeof(__pyx_k_Joystick_get_axis), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_ball, __pyx_k_Joystick_get_ball, sizeof(__pyx_k_Joystick_get_ball), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_button, __pyx_k_Joystick_get_button, sizeof(__pyx_k_Joystick_get_button), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_hat, __pyx_k_Joystick_get_hat, sizeof(__pyx_k_Joystick_get_hat), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_id, __pyx_k_Joystick_get_id, sizeof(__pyx_k_Joystick_get_id), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_init, __pyx_k_Joystick_get_init, sizeof(__pyx_k_Joystick_get_init), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_name, __pyx_k_Joystick_get_name, sizeof(__pyx_k_Joystick_get_name), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_numaxes, __pyx_k_Joystick_get_numaxes, sizeof(__pyx_k_Joystick_get_numaxes), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_numballs, __pyx_k_Joystick_get_numballs, sizeof(__pyx_k_Joystick_get_numballs), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_numbuttons, __pyx_k_Joystick_get_numbuttons, sizeof(__pyx_k_Joystick_get_numbuttons), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_get_numhats, __pyx_k_Joystick_get_numhats, sizeof(__pyx_k_Joystick_get_numhats), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_init, __pyx_k_Joystick_init, sizeof(__pyx_k_Joystick_init), 0, 0, 1, 1}, {&__pyx_n_s_Joystick_quit, __pyx_k_Joystick_quit, sizeof(__pyx_k_Joystick_quit), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, {&__pyx_n_s__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_axis_number, __pyx_k_axis_number, sizeof(__pyx_k_axis_number), 0, 0, 1, 1}, {&__pyx_n_s_ball_number, __pyx_k_ball_number, sizeof(__pyx_k_ball_number), 0, 0, 1, 1}, {&__pyx_n_s_button, __pyx_k_button, sizeof(__pyx_k_button), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1}, {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_axis, __pyx_k_get_axis, sizeof(__pyx_k_get_axis), 0, 0, 1, 1}, {&__pyx_n_s_get_ball, __pyx_k_get_ball, sizeof(__pyx_k_get_ball), 0, 0, 1, 1}, {&__pyx_n_s_get_button, __pyx_k_get_button, sizeof(__pyx_k_get_button), 0, 0, 1, 1}, {&__pyx_n_s_get_count, __pyx_k_get_count, sizeof(__pyx_k_get_count), 0, 0, 1, 1}, {&__pyx_n_s_get_hat, __pyx_k_get_hat, sizeof(__pyx_k_get_hat), 0, 0, 1, 1}, {&__pyx_n_s_get_id, __pyx_k_get_id, sizeof(__pyx_k_get_id), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_name, __pyx_k_get_name, sizeof(__pyx_k_get_name), 0, 0, 1, 1}, {&__pyx_n_s_get_numaxes, __pyx_k_get_numaxes, sizeof(__pyx_k_get_numaxes), 0, 0, 1, 1}, {&__pyx_n_s_get_numballs, __pyx_k_get_numballs, sizeof(__pyx_k_get_numballs), 0, 0, 1, 1}, {&__pyx_n_s_get_numbuttons, __pyx_k_get_numbuttons, sizeof(__pyx_k_get_numbuttons), 0, 0, 1, 1}, {&__pyx_n_s_get_numhats, __pyx_k_get_numhats, sizeof(__pyx_k_get_numhats), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_hat_number, __pyx_k_hat_number, sizeof(__pyx_k_hat_number), 0, 0, 1, 1}, {&__pyx_n_s_hx, __pyx_k_hx, sizeof(__pyx_k_hx), 0, 0, 1, 1}, {&__pyx_n_s_hy, __pyx_k_hy, sizeof(__pyx_k_hy), 0, 0, 1, 1}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_kp_s_joystick_not_initialized, __pyx_k_joystick_not_initialized, sizeof(__pyx_k_joystick_not_initialized), 0, 0, 1, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_joystick, __pyx_k_pygame_sdl2_joystick, sizeof(__pyx_k_pygame_sdl2_joystick), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_k_src_pygame_sdl2_joystick_pyx, sizeof(__pyx_k_src_pygame_sdl2_joystick_pyx), 0, 0, 1, 0}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/joystick.pyx":23 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_init, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 23, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":30 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) */ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_quit, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(1, 30, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_init, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 34, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_count, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 37, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":54 * self.joyid = id * * def init(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_init, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 54, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":60 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) */ __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_quit, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(1, 60, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":65 * self.joystick = NULL * * def get_init(self): # <<<<<<<<<<<<<< * if self.joystick: * return True */ __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_init, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 65, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":71 * return False * * def get_id(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_id, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(1, 71, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":77 * return SDL_JoystickInstanceID(self.joystick) * * def get_name(self): # <<<<<<<<<<<<<< * cdef char *rv * */ __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_name, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(1, 77, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":90 * return None * * def get_numaxes(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_numaxes, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 90, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":96 * return SDL_JoystickNumAxes(self.joystick) * * def get_numballs(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_numballs, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 96, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":102 * return SDL_JoystickNumBalls(self.joystick) * * def get_numbuttons(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_numbuttons, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 102, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":108 * return SDL_JoystickNumButtons(self.joystick) * * def get_numhats(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_numhats, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 108, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":114 * return SDL_JoystickNumHats(self.joystick) * * def get_axis(self, axis_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_axis_number); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_axis, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(1, 114, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":120 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 * * def get_ball(self, ball_number): # <<<<<<<<<<<<<< * cdef int dx, dy * */ __pyx_tuple__20 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ball_number, __pyx_n_s_dx, __pyx_n_s_dy); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_ball, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 120, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":131 * raise error() * * def get_button(self, button): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_button); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_button, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 131, __pyx_L1_error) /* "pygame_sdl2/joystick.pyx":137 * return SDL_JoystickGetButton(self.joystick, button) == 1 * * def get_hat(self, hat_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_tuple__24 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_hat_number, __pyx_n_s_state, __pyx_n_s_hx, __pyx_n_s_hy); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_hat, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 137, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_8joystick_Joystick = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_8joystick_Joystick_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_8joystick_Joystick)) __PYX_ERR(1, 41, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_8joystick_Joystick_spec, __pyx_ptype_11pygame_sdl2_8joystick_Joystick) < 0) __PYX_ERR(1, 41, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_8joystick_Joystick = &__pyx_type_11pygame_sdl2_8joystick_Joystick; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_8joystick_Joystick) < 0) __PYX_ERR(1, 41, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_8joystick_Joystick->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_8joystick_Joystick->tp_dictoffset && __pyx_ptype_11pygame_sdl2_8joystick_Joystick->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_8joystick_Joystick->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Joystick, (PyObject *) __pyx_ptype_11pygame_sdl2_8joystick_Joystick) < 0) __PYX_ERR(1, 41, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_8joystick_Joystick->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_8joystick_Joystick->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick, __weakref__); #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_8joystick_Joystick) < 0) __PYX_ERR(1, 41, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_joystick(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_joystick}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "joystick", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initjoystick(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initjoystick(void) #else __Pyx_PyMODINIT_FUNC PyInit_joystick(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_joystick(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_joystick(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'joystick' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("joystick", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "joystick" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_joystick(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__joystick) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.joystick")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.joystick", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "pygame_sdl2/joystick.pyx":20 * * from sdl2 cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(1, 20, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/joystick.pyx":21 * from sdl2 cimport * * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/joystick.pyx":23 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/joystick.pyx":30 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_3quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_5get_init, 0, __pyx_n_s_get_init, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_7get_count, 0, __pyx_n_s_get_count, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_count, __pyx_t_2) < 0) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":54 * self.joyid = id * * def init(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_5init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_init, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(1, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":60 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_7quit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_quit, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":65 * self.joystick = NULL * * def get_init(self): # <<<<<<<<<<<<<< * if self.joystick: * return True */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_9get_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_init, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":71 * return False * * def get_id(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_11get_id, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_id, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_id, __pyx_t_2) < 0) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":77 * return SDL_JoystickInstanceID(self.joystick) * * def get_name(self): # <<<<<<<<<<<<<< * cdef char *rv * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_13get_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_name, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_name, __pyx_t_2) < 0) __PYX_ERR(1, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":90 * return None * * def get_numaxes(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_15get_numaxes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_numaxes, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_numaxes, __pyx_t_2) < 0) __PYX_ERR(1, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":96 * return SDL_JoystickNumAxes(self.joystick) * * def get_numballs(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_17get_numballs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_numballs, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_numballs, __pyx_t_2) < 0) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":102 * return SDL_JoystickNumBalls(self.joystick) * * def get_numbuttons(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_numbuttons, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_numbuttons, __pyx_t_2) < 0) __PYX_ERR(1, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":108 * return SDL_JoystickNumButtons(self.joystick) * * def get_numhats(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_21get_numhats, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_numhats, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_numhats, __pyx_t_2) < 0) __PYX_ERR(1, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":114 * return SDL_JoystickNumHats(self.joystick) * * def get_axis(self, axis_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_23get_axis, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_axis, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_axis, __pyx_t_2) < 0) __PYX_ERR(1, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":120 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 * * def get_ball(self, ball_number): # <<<<<<<<<<<<<< * cdef int dx, dy * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_25get_ball, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_ball, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_ball, __pyx_t_2) < 0) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":131 * raise error() * * def get_button(self, button): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_27get_button, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_button, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_button, __pyx_t_2) < 0) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "pygame_sdl2/joystick.pyx":137 * return SDL_JoystickGetButton(self.joystick, button) == 1 * * def get_hat(self, hat_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_29get_hat, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick_get_hat, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8joystick_Joystick, __pyx_n_s_get_hat, __pyx_t_2) < 0) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8joystick_Joystick); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Joystick___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_joystick, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.joystick", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.joystick"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__2; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__29); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635911.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.key.c0000664000175000017500000152741015026112607017673 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__key #define __PYX_HAVE_API__pygame_sdl2__key /* Early includes */ #include #include #include #include #include "SDL.h" #include #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/key.pyx", "", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", "src/pygame_sdl2/rect.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_3key_KeyboardState; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/key.pyx":28 * * * cdef class KeyboardState: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_3key_KeyboardState { PyObject_HEAD PyObject *__weakref__; uint8_t *data; int numkeys; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 #define __PYX_HAVE_RT_ImportType_proto_3_0_12 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_12 { __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_Keymod __Pyx_PyInt_As_SDL_Keymod(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* VoidPtrImport.proto */ static int __Pyx_ImportVoidPtr_3_0_12(PyObject *module, const char *name, void **p, const char *sig); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "libc.stdlib" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.display" */ static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from "pygame_sdl2.rect" */ static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.key" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.key" extern int __pyx_module_is_main_pygame_sdl2__key; int __pyx_module_is_main_pygame_sdl2__key = 0; /* Implementation of "pygame_sdl2.key" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k__3[] = "."; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k__26[] = "?"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_delay[] = "delay"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_name_2[] = "name"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_window[] = "window"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_get_mods[] = "get_mods"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_interval[] = "interval"; static const char __pyx_k_sdl_rect[] = "sdl_rect"; static const char __pyx_k_set_mods[] = "set_mods"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_get_repeat[] = "get_repeat"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_set_repeat[] = "set_repeat"; static const char __pyx_k_text_input[] = "text_input"; static const char __pyx_k_get_focused[] = "get_focused"; static const char __pyx_k_get_pressed[] = "get_pressed"; static const char __pyx_k_Out_of_range[] = "Out of range."; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_KeyboardState[] = "KeyboardState"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_pygame_sdl2_key[] = "pygame_sdl2.key"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_stop_text_input[] = "stop_text_input"; static const char __pyx_k_start_text_input[] = "start_text_input"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_set_text_input_rect[] = "set_text_input_rect"; static const char __pyx_k_src_pygame_sdl2_key_pyx[] = "src/pygame_sdl2/key.pyx"; static const char __pyx_k_is_screen_keyboard_shown[] = "is_screen_keyboard_shown"; static const char __pyx_k_has_screen_keyboard_support[] = "has_screen_keyboard_support"; static const char __pyx_k_KeyboardState___reduce_cython[] = "KeyboardState.__reduce_cython__"; static const char __pyx_k_KeyboardState___setstate_cython[] = "KeyboardState.__setstate_cython__"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; /* #### Code section: decls ### */ static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState___cinit__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_3key_13KeyboardState_2__dealloc__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState_4__init__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_6__getitem__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, int __pyx_v_key); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_get_focused(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_2get_pressed(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_4get_mods(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_6set_mods(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_8set_repeat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_delay, CYTHON_UNUSED PyObject *__pyx_v_interval); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_10get_repeat(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_12name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_14start_text_input(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_16stop_text_input(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_18set_text_input_rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_20has_screen_keyboard_support(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_22is_screen_keyboard_shown(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_3key_KeyboardState(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect; #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_3key_KeyboardState; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_3key_KeyboardState; PyObject *__pyx_n_s_IndexError; PyObject *__pyx_n_s_KeyboardState; PyObject *__pyx_n_s_KeyboardState___reduce_cython; PyObject *__pyx_n_s_KeyboardState___setstate_cython; PyObject *__pyx_kp_s_Out_of_range; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s__26; PyObject *__pyx_kp_u__3; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_delay; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_error; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_focused; PyObject *__pyx_n_s_get_mods; PyObject *__pyx_n_s_get_pressed; PyObject *__pyx_n_s_get_repeat; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_has_screen_keyboard_support; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_interval; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_is_screen_keyboard_shown; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_key; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_key; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_rect; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_sdl_rect; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_mods; PyObject *__pyx_n_s_set_repeat; PyObject *__pyx_n_s_set_text_input_rect; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_kp_s_src_pygame_sdl2_key_pyx; PyObject *__pyx_n_s_start_text_input; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_stop_text_input; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_text_input; PyObject *__pyx_n_s_window; PyObject *__pyx_int_0; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__25; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__24; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_3key_KeyboardState); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_3key_KeyboardState); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); Py_CLEAR(clear_module_state->__pyx_n_s_KeyboardState); Py_CLEAR(clear_module_state->__pyx_n_s_KeyboardState___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_KeyboardState___setstate_cython); Py_CLEAR(clear_module_state->__pyx_kp_s_Out_of_range); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s__26); Py_CLEAR(clear_module_state->__pyx_kp_u__3); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_delay); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_focused); Py_CLEAR(clear_module_state->__pyx_n_s_get_mods); Py_CLEAR(clear_module_state->__pyx_n_s_get_pressed); Py_CLEAR(clear_module_state->__pyx_n_s_get_repeat); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_has_screen_keyboard_support); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_interval); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_is_screen_keyboard_shown); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_key); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_key); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_rect); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_rect); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_mods); Py_CLEAR(clear_module_state->__pyx_n_s_set_repeat); Py_CLEAR(clear_module_state->__pyx_n_s_set_text_input_rect); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_key_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start_text_input); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_stop_text_input); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_text_input); Py_CLEAR(clear_module_state->__pyx_n_s_window); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__24); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_3key_KeyboardState); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_3key_KeyboardState); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); Py_VISIT(traverse_module_state->__pyx_n_s_KeyboardState); Py_VISIT(traverse_module_state->__pyx_n_s_KeyboardState___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_KeyboardState___setstate_cython); Py_VISIT(traverse_module_state->__pyx_kp_s_Out_of_range); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s__26); Py_VISIT(traverse_module_state->__pyx_kp_u__3); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_delay); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_focused); Py_VISIT(traverse_module_state->__pyx_n_s_get_mods); Py_VISIT(traverse_module_state->__pyx_n_s_get_pressed); Py_VISIT(traverse_module_state->__pyx_n_s_get_repeat); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_has_screen_keyboard_support); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_interval); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_is_screen_keyboard_shown); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_key); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_key); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_rect); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_rect); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_mods); Py_VISIT(traverse_module_state->__pyx_n_s_set_repeat); Py_VISIT(traverse_module_state->__pyx_n_s_set_text_input_rect); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_key_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start_text_input); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_stop_text_input); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_text_input); Py_VISIT(traverse_module_state->__pyx_n_s_window); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__24); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7display_Window __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7display_Window #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_4rect_Rect __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_4rect_Rect #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_3key_KeyboardState __pyx_mstate_global->__pyx_type_11pygame_sdl2_3key_KeyboardState #endif #define __pyx_ptype_11pygame_sdl2_3key_KeyboardState __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_3key_KeyboardState #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError #define __pyx_n_s_KeyboardState __pyx_mstate_global->__pyx_n_s_KeyboardState #define __pyx_n_s_KeyboardState___reduce_cython __pyx_mstate_global->__pyx_n_s_KeyboardState___reduce_cython #define __pyx_n_s_KeyboardState___setstate_cython __pyx_mstate_global->__pyx_n_s_KeyboardState___setstate_cython #define __pyx_kp_s_Out_of_range __pyx_mstate_global->__pyx_kp_s_Out_of_range #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s__26 __pyx_mstate_global->__pyx_n_s__26 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_delay __pyx_mstate_global->__pyx_n_s_delay #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_focused __pyx_mstate_global->__pyx_n_s_get_focused #define __pyx_n_s_get_mods __pyx_mstate_global->__pyx_n_s_get_mods #define __pyx_n_s_get_pressed __pyx_mstate_global->__pyx_n_s_get_pressed #define __pyx_n_s_get_repeat __pyx_mstate_global->__pyx_n_s_get_repeat #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_has_screen_keyboard_support __pyx_mstate_global->__pyx_n_s_has_screen_keyboard_support #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_interval __pyx_mstate_global->__pyx_n_s_interval #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_is_screen_keyboard_shown __pyx_mstate_global->__pyx_n_s_is_screen_keyboard_shown #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_key __pyx_mstate_global->__pyx_n_s_pygame_sdl2_key #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_rect __pyx_mstate_global->__pyx_n_s_rect #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_sdl_rect __pyx_mstate_global->__pyx_n_s_sdl_rect #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_mods __pyx_mstate_global->__pyx_n_s_set_mods #define __pyx_n_s_set_repeat __pyx_mstate_global->__pyx_n_s_set_repeat #define __pyx_n_s_set_text_input_rect __pyx_mstate_global->__pyx_n_s_set_text_input_rect #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_kp_s_src_pygame_sdl2_key_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_key_pyx #define __pyx_n_s_start_text_input __pyx_mstate_global->__pyx_n_s_start_text_input #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_stop_text_input __pyx_mstate_global->__pyx_n_s_stop_text_input #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_text_input __pyx_mstate_global->__pyx_n_s_text_input #define __pyx_n_s_window __pyx_mstate_global->__pyx_n_s_window #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 /* #### Code section: module_code ### */ /* "pygame_sdl2/key.pyx":35 * cdef int numkeys * * def __cinit__(self): # <<<<<<<<<<<<<< * self.data = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState___cinit__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState___cinit__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/key.pyx":36 * * def __cinit__(self): * self.data = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->data = NULL; /* "pygame_sdl2/key.pyx":35 * cdef int numkeys * * def __cinit__(self): # <<<<<<<<<<<<<< * self.data = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/key.pyx":38 * self.data = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.data != NULL: * free(self.data) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_3key_13KeyboardState_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_3key_13KeyboardState_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_3key_13KeyboardState_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_3key_13KeyboardState_2__dealloc__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { int __pyx_t_1; /* "pygame_sdl2/key.pyx":39 * * def __dealloc__(self): * if self.data != NULL: # <<<<<<<<<<<<<< * free(self.data) * */ __pyx_t_1 = (__pyx_v_self->data != NULL); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":40 * def __dealloc__(self): * if self.data != NULL: * free(self.data) # <<<<<<<<<<<<<< * * def __init__(self): */ free(__pyx_v_self->data); /* "pygame_sdl2/key.pyx":39 * * def __dealloc__(self): * if self.data != NULL: # <<<<<<<<<<<<<< * free(self.data) * */ } /* "pygame_sdl2/key.pyx":38 * self.data = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.data != NULL: * free(self.data) */ /* function exit code */ } /* "pygame_sdl2/key.pyx":42 * free(self.data) * * def __init__(self): # <<<<<<<<<<<<<< * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_4__init__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState_4__init__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { uint8_t *__pyx_v_state; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/key.pyx":43 * * def __init__(self): * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) # <<<<<<<<<<<<<< * if state == NULL: * raise error() */ __pyx_v_state = SDL_GetKeyboardState((&__pyx_v_self->numkeys)); /* "pygame_sdl2/key.pyx":44 * def __init__(self): * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_state == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/key.pyx":45 * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: * raise error() # <<<<<<<<<<<<<< * * # Take a snapshot of the current state, rather than saving the pointer. */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 45, __pyx_L1_error) /* "pygame_sdl2/key.pyx":44 * def __init__(self): * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/key.pyx":48 * * # Take a snapshot of the current state, rather than saving the pointer. * self.data = malloc(self.numkeys) # <<<<<<<<<<<<<< * memcpy(self.data, state, self.numkeys) * */ __pyx_v_self->data = ((uint8_t *)malloc(__pyx_v_self->numkeys)); /* "pygame_sdl2/key.pyx":49 * # Take a snapshot of the current state, rather than saving the pointer. * self.data = malloc(self.numkeys) * memcpy(self.data, state, self.numkeys) # <<<<<<<<<<<<<< * * def __getitem__(self, int key): */ (void)(memcpy(__pyx_v_self->data, __pyx_v_state, __pyx_v_self->numkeys)); /* "pygame_sdl2/key.pyx":42 * free(self.data) * * def __init__(self): # <<<<<<<<<<<<<< * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":51 * memcpy(self.data, state, self.numkeys) * * def __getitem__(self, int key): # <<<<<<<<<<<<<< * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_key) { int __pyx_v_key; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); assert(__pyx_arg_key); { __pyx_v_key = __Pyx_PyInt_As_int(__pyx_arg_key); if (unlikely((__pyx_v_key == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_6__getitem__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self), ((int)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_6__getitem__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, int __pyx_v_key) { int __pyx_v_sc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "pygame_sdl2/key.pyx":52 * * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ __pyx_t_1 = (SDLK_DELETE < __pyx_v_key); if (__pyx_t_1) { __pyx_t_1 = (__pyx_v_key < SDLK_CAPSLOCK); } if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/key.pyx":53 * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * cdef int sc = SDL_GetScancodeFromKey(key) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 53, __pyx_L1_error) /* "pygame_sdl2/key.pyx":52 * * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ } /* "pygame_sdl2/key.pyx":55 * raise IndexError("Out of range.") * * cdef int sc = SDL_GetScancodeFromKey(key) # <<<<<<<<<<<<<< * if sc > self.numkeys: * raise IndexError("Out of range.") */ __pyx_v_sc = ((int)SDL_GetScancodeFromKey(__pyx_v_key)); /* "pygame_sdl2/key.pyx":56 * * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ __pyx_t_1 = (__pyx_v_sc > __pyx_v_self->numkeys); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/key.pyx":57 * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * return self.data[sc] */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 57, __pyx_L1_error) /* "pygame_sdl2/key.pyx":56 * * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ } /* "pygame_sdl2/key.pyx":59 * raise IndexError("Out of range.") * * return self.data[sc] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t((__pyx_v_self->data[__pyx_v_sc])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":51 * memcpy(self.data, state, self.numkeys) * * def __getitem__(self, int key): # <<<<<<<<<<<<<< * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__, "KeyboardState.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__, "KeyboardState.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_1get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_get_focused, "get_focused()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_1get_focused = {"get_focused", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_1get_focused, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_get_focused}; static PyObject *__pyx_pw_11pygame_sdl2_3key_1get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_focused (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_get_focused(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_get_focused(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_focused", 1); /* "pygame_sdl2/key.pyx":63 * * def get_focused(): * return SDL_GetKeyboardFocus() != NULL # <<<<<<<<<<<<<< * * def get_pressed(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_GetKeyboardFocus() != NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.get_focused", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_3get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_2get_pressed, "get_pressed()\n No longer returns a tuple. Use the returned object to check for\n individual keys, but don't loop through it. "); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_3get_pressed = {"get_pressed", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_3get_pressed, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_2get_pressed}; static PyObject *__pyx_pw_11pygame_sdl2_3key_3get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pressed (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_2get_pressed(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_2get_pressed(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pressed", 1); /* "pygame_sdl2/key.pyx":69 * individual keys, but don't loop through it. """ * * return KeyboardState() # <<<<<<<<<<<<<< * * def get_mods(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_11pygame_sdl2_3key_KeyboardState)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.get_pressed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_5get_mods(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_4get_mods, "get_mods()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_5get_mods = {"get_mods", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_5get_mods, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_4get_mods}; static PyObject *__pyx_pw_11pygame_sdl2_3key_5get_mods(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_mods (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_4get_mods(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_4get_mods(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_mods", 1); /* "pygame_sdl2/key.pyx":72 * * def get_mods(): * return SDL_GetModState() # <<<<<<<<<<<<<< * * def set_mods(state): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(SDL_GetModState()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.get_mods", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_7set_mods(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_6set_mods, "set_mods(state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_7set_mods = {"set_mods", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_7set_mods, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_6set_mods}; static PyObject *__pyx_pw_11pygame_sdl2_3key_7set_mods(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mods (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_mods") < 0)) __PYX_ERR(0, 74, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_mods", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 74, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.key.set_mods", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_6set_mods(__pyx_self, __pyx_v_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_6set_mods(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_Keymod __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_mods", 1); /* "pygame_sdl2/key.pyx":75 * * def set_mods(state): * SDL_SetModState(state) # <<<<<<<<<<<<<< * * def set_repeat(delay=0, interval=0): */ __pyx_t_1 = ((SDL_Keymod)__Pyx_PyInt_As_SDL_Keymod(__pyx_v_state)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error) SDL_SetModState(__pyx_t_1); /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.set_mods", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":77 * SDL_SetModState(state) * * def set_repeat(delay=0, interval=0): # <<<<<<<<<<<<<< * # Not possible with SDL2. * pass */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_9set_repeat(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_8set_repeat, "set_repeat(delay=0, interval=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_9set_repeat = {"set_repeat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_9set_repeat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_8set_repeat}; static PyObject *__pyx_pw_11pygame_sdl2_3key_9set_repeat(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_delay = 0; CYTHON_UNUSED PyObject *__pyx_v_interval = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_repeat (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_delay,&__pyx_n_s_interval,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_delay); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interval); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_repeat") < 0)) __PYX_ERR(0, 77, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_delay = values[0]; __pyx_v_interval = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_repeat", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 77, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.key.set_repeat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_8set_repeat(__pyx_self, __pyx_v_delay, __pyx_v_interval); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_8set_repeat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_delay, CYTHON_UNUSED PyObject *__pyx_v_interval) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_repeat", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_11get_repeat(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_10get_repeat, "get_repeat()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_11get_repeat = {"get_repeat", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_11get_repeat, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_10get_repeat}; static PyObject *__pyx_pw_11pygame_sdl2_3key_11get_repeat(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_repeat (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_10get_repeat(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_10get_repeat(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_repeat", 1); /* "pygame_sdl2/key.pyx":83 * def get_repeat(): * # Not possible with SDL2. * return (0,0) # <<<<<<<<<<<<<< * * def name(key): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_tuple__2); __pyx_r = __pyx_tuple__2; goto __pyx_L0; /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_13name(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_12name, "name(key)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_13name = {"name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_13name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_12name}; static PyObject *__pyx_pw_11pygame_sdl2_3key_13name(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_key = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("name (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "name") < 0)) __PYX_ERR(0, 85, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_key = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 85, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.key.name", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_12name(__pyx_self, __pyx_v_key); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_12name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_Keycode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("name", 1); /* "pygame_sdl2/key.pyx":86 * * def name(key): * return SDL_GetKeyName(key) # <<<<<<<<<<<<<< * * text_input = False */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_As_int32_t(__pyx_v_key); if (unlikely((__pyx_t_1 == ((SDL_Keycode)-1)) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_2 = __Pyx_PyBytes_FromString(SDL_GetKeyName(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.key.name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_15start_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_14start_text_input, "start_text_input()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_15start_text_input = {"start_text_input", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_15start_text_input, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_14start_text_input}; static PyObject *__pyx_pw_11pygame_sdl2_3key_15start_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("start_text_input (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_14start_text_input(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_14start_text_input(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_bool __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("start_text_input", 1); /* "pygame_sdl2/key.pyx":92 * def start_text_input(): * global text_input * text_input = True # <<<<<<<<<<<<<< * * if SDL_HasScreenKeyboardSupport(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_input, Py_True) < 0) __PYX_ERR(0, 92, __pyx_L1_error) /* "pygame_sdl2/key.pyx":94 * text_input = True * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StartTextInput() * */ __pyx_t_1 = SDL_HasScreenKeyboardSupport(); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":95 * * if SDL_HasScreenKeyboardSupport(): * SDL_StartTextInput() # <<<<<<<<<<<<<< * * def stop_text_input(): */ SDL_StartTextInput(); /* "pygame_sdl2/key.pyx":94 * text_input = True * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StartTextInput() * */ } /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.start_text_input", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_17stop_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_16stop_text_input, "stop_text_input()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_17stop_text_input = {"stop_text_input", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_17stop_text_input, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_16stop_text_input}; static PyObject *__pyx_pw_11pygame_sdl2_3key_17stop_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop_text_input (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_16stop_text_input(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_16stop_text_input(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_bool __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stop_text_input", 1); /* "pygame_sdl2/key.pyx":99 * def stop_text_input(): * global text_input * text_input = False # <<<<<<<<<<<<<< * * if SDL_HasScreenKeyboardSupport(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_input, Py_False) < 0) __PYX_ERR(0, 99, __pyx_L1_error) /* "pygame_sdl2/key.pyx":101 * text_input = False * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StopTextInput() * */ __pyx_t_1 = SDL_HasScreenKeyboardSupport(); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":102 * * if SDL_HasScreenKeyboardSupport(): * SDL_StopTextInput() # <<<<<<<<<<<<<< * * def set_text_input_rect(rect): */ SDL_StopTextInput(); /* "pygame_sdl2/key.pyx":101 * text_input = False * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StopTextInput() * */ } /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.stop_text_input", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_19set_text_input_rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_18set_text_input_rect, "set_text_input_rect(rect)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_19set_text_input_rect = {"set_text_input_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_19set_text_input_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_18set_text_input_rect}; static PyObject *__pyx_pw_11pygame_sdl2_3key_19set_text_input_rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rect = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_text_input_rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rect,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_text_input_rect") < 0)) __PYX_ERR(0, 104, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_rect = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_text_input_rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 104, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.key.set_text_input_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_18set_text_input_rect(__pyx_self, __pyx_v_rect); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_18set_text_input_rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_sdl_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_text_input_rect", 1); /* "pygame_sdl2/key.pyx":107 * cdef SDL_Rect sdl_rect; * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * SDL_SetTextInputRect(&sdl_rect) */ __pyx_t_1 = (__pyx_v_rect != Py_None); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":108 * * if rect is not None: * to_sdl_rect(rect, &sdl_rect) # <<<<<<<<<<<<<< * SDL_SetTextInputRect(&sdl_rect) * else: */ __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 108, __pyx_L1_error) /* "pygame_sdl2/key.pyx":109 * if rect is not None: * to_sdl_rect(rect, &sdl_rect) * SDL_SetTextInputRect(&sdl_rect) # <<<<<<<<<<<<<< * else: * SDL_SetTextInputRect(NULL) */ SDL_SetTextInputRect((&__pyx_v_sdl_rect)); /* "pygame_sdl2/key.pyx":107 * cdef SDL_Rect sdl_rect; * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * SDL_SetTextInputRect(&sdl_rect) */ goto __pyx_L3; } /* "pygame_sdl2/key.pyx":111 * SDL_SetTextInputRect(&sdl_rect) * else: * SDL_SetTextInputRect(NULL) # <<<<<<<<<<<<<< * * def has_screen_keyboard_support(): */ /*else*/ { SDL_SetTextInputRect(NULL); } __pyx_L3:; /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.set_text_input_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_21has_screen_keyboard_support(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_20has_screen_keyboard_support, "has_screen_keyboard_support()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_21has_screen_keyboard_support = {"has_screen_keyboard_support", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_21has_screen_keyboard_support, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_20has_screen_keyboard_support}; static PyObject *__pyx_pw_11pygame_sdl2_3key_21has_screen_keyboard_support(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("has_screen_keyboard_support (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_3key_20has_screen_keyboard_support(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_20has_screen_keyboard_support(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_screen_keyboard_support", 1); /* "pygame_sdl2/key.pyx":114 * * def has_screen_keyboard_support(): * return SDL_HasScreenKeyboardSupport() # <<<<<<<<<<<<<< * * def is_screen_keyboard_shown(Window window=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_HasScreenKeyboardSupport()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.has_screen_keyboard_support", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_23is_screen_keyboard_shown(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_3key_22is_screen_keyboard_shown, "is_screen_keyboard_shown(Window window=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_23is_screen_keyboard_shown = {"is_screen_keyboard_shown", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_23is_screen_keyboard_shown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_22is_screen_keyboard_shown}; static PyObject *__pyx_pw_11pygame_sdl2_3key_23is_screen_keyboard_shown(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_screen_keyboard_shown (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_window,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_window); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_screen_keyboard_shown") < 0)) __PYX_ERR(0, 116, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("is_screen_keyboard_shown", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 116, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.key.is_screen_keyboard_shown", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_window), __pyx_ptype_11pygame_sdl2_7display_Window, 1, "window", 0))) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_3key_22is_screen_keyboard_shown(__pyx_self, __pyx_v_window); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_22is_screen_keyboard_shown(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_screen_keyboard_shown", 0); __Pyx_INCREF((PyObject *)__pyx_v_window); /* "pygame_sdl2/key.pyx":117 * * def is_screen_keyboard_shown(Window window=None): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ __pyx_t_1 = (((PyObject *)__pyx_v_window) == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":118 * def is_screen_keyboard_shown(Window window=None): * if window is None: * window = main_window # <<<<<<<<<<<<<< * * return SDL_IsScreenKeyboardShown(window.window) */ __Pyx_INCREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_window, __pyx_v_11pygame_sdl2_7display_main_window); /* "pygame_sdl2/key.pyx":117 * * def is_screen_keyboard_shown(Window window=None): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ } /* "pygame_sdl2/key.pyx":120 * window = main_window * * return SDL_IsScreenKeyboardShown(window.window) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_SDL_bool(SDL_IsScreenKeyboardShown(__pyx_v_window->window)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.key.is_screen_keyboard_shown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_window); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_3key_KeyboardState(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_11pygame_sdl2_3key_13KeyboardState_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_3key_KeyboardState(PyObject *o) { struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *p = (struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_3key_KeyboardState) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_3key_13KeyboardState_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_sq_item_11pygame_sdl2_3key_KeyboardState(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static PyMethodDef __pyx_methods_11pygame_sdl2_3key_KeyboardState[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_3key_KeyboardState_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_3key_KeyboardState}, {Py_sq_item, (void *)__pyx_sq_item_11pygame_sdl2_3key_KeyboardState}, {Py_mp_subscript, (void *)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__}, {Py_tp_doc, (void *)PyDoc_STR("KeyboardState()")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_3key_KeyboardState}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_3key_KeyboardState}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_3key_KeyboardState_spec = { "pygame_sdl2.key.KeyboardState", sizeof(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_3key_KeyboardState_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence_KeyboardState = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_3key_KeyboardState, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_KeyboardState = { 0, /*mp_length*/ __pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_3key_KeyboardState = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.key.""KeyboardState", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_3key_KeyboardState, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_KeyboardState, /*tp_as_sequence*/ &__pyx_tp_as_mapping_KeyboardState, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("KeyboardState()"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_3key_KeyboardState, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_3key_KeyboardState, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_KeyboardState, __pyx_k_KeyboardState, sizeof(__pyx_k_KeyboardState), 0, 0, 1, 1}, {&__pyx_n_s_KeyboardState___reduce_cython, __pyx_k_KeyboardState___reduce_cython, sizeof(__pyx_k_KeyboardState___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_KeyboardState___setstate_cython, __pyx_k_KeyboardState___setstate_cython, sizeof(__pyx_k_KeyboardState___setstate_cython), 0, 0, 1, 1}, {&__pyx_kp_s_Out_of_range, __pyx_k_Out_of_range, sizeof(__pyx_k_Out_of_range), 0, 0, 1, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 1}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_delay, __pyx_k_delay, sizeof(__pyx_k_delay), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_focused, __pyx_k_get_focused, sizeof(__pyx_k_get_focused), 0, 0, 1, 1}, {&__pyx_n_s_get_mods, __pyx_k_get_mods, sizeof(__pyx_k_get_mods), 0, 0, 1, 1}, {&__pyx_n_s_get_pressed, __pyx_k_get_pressed, sizeof(__pyx_k_get_pressed), 0, 0, 1, 1}, {&__pyx_n_s_get_repeat, __pyx_k_get_repeat, sizeof(__pyx_k_get_repeat), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_has_screen_keyboard_support, __pyx_k_has_screen_keyboard_support, sizeof(__pyx_k_has_screen_keyboard_support), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_is_screen_keyboard_shown, __pyx_k_is_screen_keyboard_shown, sizeof(__pyx_k_is_screen_keyboard_shown), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_key, __pyx_k_pygame_sdl2_key, sizeof(__pyx_k_pygame_sdl2_key), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_sdl_rect, __pyx_k_sdl_rect, sizeof(__pyx_k_sdl_rect), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_mods, __pyx_k_set_mods, sizeof(__pyx_k_set_mods), 0, 0, 1, 1}, {&__pyx_n_s_set_repeat, __pyx_k_set_repeat, sizeof(__pyx_k_set_repeat), 0, 0, 1, 1}, {&__pyx_n_s_set_text_input_rect, __pyx_k_set_text_input_rect, sizeof(__pyx_k_set_text_input_rect), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_k_src_pygame_sdl2_key_pyx, sizeof(__pyx_k_src_pygame_sdl2_key_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start_text_input, __pyx_k_start_text_input, sizeof(__pyx_k_start_text_input), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_stop_text_input, __pyx_k_stop_text_input, sizeof(__pyx_k_stop_text_input), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text_input, __pyx_k_text_input, sizeof(__pyx_k_text_input), 0, 0, 1, 1}, {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 53, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/key.pyx":53 * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * cdef int sc = SDL_GetScancodeFromKey(key) */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Out_of_range); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/key.pyx":83 * def get_repeat(): * # Not possible with SDL2. * return (0,0) # <<<<<<<<<<<<<< * * def name(key): */ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(1, 3, __pyx_L1_error) /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_focused, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 62, __pyx_L1_error) /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_pressed, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 65, __pyx_L1_error) /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_mods, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 71, __pyx_L1_error) /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_set_mods, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 74, __pyx_L1_error) /* "pygame_sdl2/key.pyx":77 * SDL_SetModState(state) * * def set_repeat(delay=0, interval=0): # <<<<<<<<<<<<<< * # Not possible with SDL2. * pass */ __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_delay, __pyx_n_s_interval); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_set_repeat, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 77, __pyx_L1_error) /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_repeat, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 81, __pyx_L1_error) /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_key); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_name_2, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 85, __pyx_L1_error) /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_start_text_input, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 90, __pyx_L1_error) /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_stop_text_input, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 97, __pyx_L1_error) /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ __pyx_tuple__20 = PyTuple_Pack(2, __pyx_n_s_rect, __pyx_n_s_sdl_rect); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_set_text_input_rect, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 104, __pyx_L1_error) /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_has_screen_keyboard_support, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 113, __pyx_L1_error) /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_window); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_is_screen_keyboard_shown, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_tuple__25 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_3key_KeyboardState = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_3key_KeyboardState_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_3key_KeyboardState)) __PYX_ERR(0, 28, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_3key_KeyboardState_spec, __pyx_ptype_11pygame_sdl2_3key_KeyboardState) < 0) __PYX_ERR(0, 28, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_3key_KeyboardState = &__pyx_type_11pygame_sdl2_3key_KeyboardState; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_3key_KeyboardState) < 0) __PYX_ERR(0, 28, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_3key_KeyboardState->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_3key_KeyboardState->tp_dictoffset && __pyx_ptype_11pygame_sdl2_3key_KeyboardState->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_3key_KeyboardState->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KeyboardState, (PyObject *) __pyx_ptype_11pygame_sdl2_3key_KeyboardState) < 0) __PYX_ERR(0, 28, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_3key_KeyboardState->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_3key_KeyboardState->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState, __weakref__); #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_3key_KeyboardState) < 0) __PYX_ERR(0, 28, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7display_Window),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7display_Window) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_4rect_Rect),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_4rect_Rect) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_key(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_key}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "key", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initkey(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initkey(void) #else __Pyx_PyMODINIT_FUNC PyInit_key(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_key(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_key(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'key' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("key", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "key" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_key(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__key) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.key")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.key", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_variable_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/key.pyx":25 * from pygame_sdl2.rect cimport to_sdl_rect * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 25, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_KeyboardState___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_KeyboardState___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_1get_focused, 0, __pyx_n_s_get_focused, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_focused, __pyx_t_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_3get_pressed, 0, __pyx_n_s_get_pressed, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pressed, __pyx_t_3) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_5get_mods, 0, __pyx_n_s_get_mods, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_mods, __pyx_t_3) < 0) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_7set_mods, 0, __pyx_n_s_set_mods, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mods, __pyx_t_3) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":77 * SDL_SetModState(state) * * def set_repeat(delay=0, interval=0): # <<<<<<<<<<<<<< * # Not possible with SDL2. * pass */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_9set_repeat, 0, __pyx_n_s_set_repeat, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_repeat, __pyx_t_3) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_11get_repeat, 0, __pyx_n_s_get_repeat, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_repeat, __pyx_t_3) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_13name, 0, __pyx_n_s_name_2, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_name_2, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":88 * return SDL_GetKeyName(key) * * text_input = False # <<<<<<<<<<<<<< * * def start_text_input(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_input, Py_False) < 0) __PYX_ERR(0, 88, __pyx_L1_error) /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_15start_text_input, 0, __pyx_n_s_start_text_input, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_start_text_input, __pyx_t_3) < 0) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_17stop_text_input, 0, __pyx_n_s_stop_text_input, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop_text_input, __pyx_t_3) < 0) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_19set_text_input_rect, 0, __pyx_n_s_set_text_input_rect, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_text_input_rect, __pyx_t_3) < 0) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_21has_screen_keyboard_support, 0, __pyx_n_s_has_screen_keyboard_support, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_screen_keyboard_support, __pyx_t_3) < 0) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_3key_23is_screen_keyboard_shown, 0, __pyx_n_s_is_screen_keyboard_shown, NULL, __pyx_n_s_pygame_sdl2_key, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__25); if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_screen_keyboard_shown, __pyx_t_3) < 0) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/key.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.key", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.key"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_12 #define __PYX_HAVE_RT_ImportType_3_0_12 static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__3); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_Keymod) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Keymod) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_Keymod) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_Keymod) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_Keymod) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_Keymod), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_Keymod)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE SDL_Keymod __Pyx_PyInt_As_SDL_Keymod(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(SDL_Keymod) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_Keymod) val; } } #endif if (unlikely(!PyLong_Check(x))) { SDL_Keymod val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_Keymod) -1; val = __Pyx_PyInt_As_SDL_Keymod(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(SDL_Keymod) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) >= 2 * PyLong_SHIFT)) { return (SDL_Keymod) (((((SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0])); } } break; case 3: if ((8 * sizeof(SDL_Keymod) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) >= 3 * PyLong_SHIFT)) { return (SDL_Keymod) (((((((SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0])); } } break; case 4: if ((8 * sizeof(SDL_Keymod) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) >= 4 * PyLong_SHIFT)) { return (SDL_Keymod) (((((((((SDL_Keymod)digits[3]) << PyLong_SHIFT) | (SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_Keymod) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(SDL_Keymod) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_Keymod) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(SDL_Keymod) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) - 1 > 2 * PyLong_SHIFT)) { return (SDL_Keymod) (((SDL_Keymod)-1)*(((((SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case 2: if ((8 * sizeof(SDL_Keymod) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) - 1 > 2 * PyLong_SHIFT)) { return (SDL_Keymod) ((((((SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case -3: if ((8 * sizeof(SDL_Keymod) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) - 1 > 3 * PyLong_SHIFT)) { return (SDL_Keymod) (((SDL_Keymod)-1)*(((((((SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case 3: if ((8 * sizeof(SDL_Keymod) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) - 1 > 3 * PyLong_SHIFT)) { return (SDL_Keymod) ((((((((SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case -4: if ((8 * sizeof(SDL_Keymod) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) - 1 > 4 * PyLong_SHIFT)) { return (SDL_Keymod) (((SDL_Keymod)-1)*(((((((((SDL_Keymod)digits[3]) << PyLong_SHIFT) | (SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case 4: if ((8 * sizeof(SDL_Keymod) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(SDL_Keymod) - 1 > 4 * PyLong_SHIFT)) { return (SDL_Keymod) ((((((((((SDL_Keymod)digits[3]) << PyLong_SHIFT) | (SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; } } #endif if ((sizeof(SDL_Keymod) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(SDL_Keymod) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { SDL_Keymod val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums"); val = (SDL_Keymod) -1; #endif if (unlikely(ret)) return (SDL_Keymod) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_Keymod"); return (SDL_Keymod) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_Keymod"); return (SDL_Keymod) -1; } /* CIntFromPy */ static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int32_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { int32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int32_t) -1; val = __Pyx_PyInt_As_int32_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) >= 2 * PyLong_SHIFT)) { return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; case 3: if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) >= 3 * PyLong_SHIFT)) { return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; case 4: if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) >= 4 * PyLong_SHIFT)) { return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; } } #endif if ((sizeof(int32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int32_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int32_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int32_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int32_t) -1; } else { stepval = v; } v = NULL; val = (int32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int32_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int32_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int32_t) 1) << (sizeof(int32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int32_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int32_t"); return (int32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int32_t"); return (int32_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_bool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_bool) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_bool), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_bool)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__26); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* VoidPtrImport */ #ifndef __PYX_HAVE_RT_ImportVoidPtr_3_0_12 #define __PYX_HAVE_RT_ImportVoidPtr_3_0_12 static int __Pyx_ImportVoidPtr_3_0_12(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12 #define __PYX_HAVE_RT_ImportFunction_3_0_12 static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635910.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.locals.c0000664000175000017500000221667115026112606020364 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__locals #define __PYX_HAVE_API__pygame_sdl2__locals /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/locals.pyx", "include/event_list.pxi", "include/keycode_list.pxi", "include/glattr.pxi", "include/controller.pxi", }; /* #### Code section: utility_code_proto_before_types ### */ /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* IncludeStringH.proto */ #include /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* Globals.proto */ static PyObject* __Pyx_Globals(void); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLattr(SDL_GLattr value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLprofile(SDL_GLprofile value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.locals" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.locals" extern int __pyx_module_is_main_pygame_sdl2__locals; int __pyx_module_is_main_pygame_sdl2__locals = 0; /* Implementation of "pygame_sdl2.locals" */ /* #### Code section: global_var ### */ /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; static const char __pyx_k__2[] = "?"; static const char __pyx_k_K_0[] = "K_0"; static const char __pyx_k_K_1[] = "K_1"; static const char __pyx_k_K_2[] = "K_2"; static const char __pyx_k_K_3[] = "K_3"; static const char __pyx_k_K_4[] = "K_4"; static const char __pyx_k_K_5[] = "K_5"; static const char __pyx_k_K_6[] = "K_6"; static const char __pyx_k_K_7[] = "K_7"; static const char __pyx_k_K_8[] = "K_8"; static const char __pyx_k_K_9[] = "K_9"; static const char __pyx_k_K_a[] = "K_a"; static const char __pyx_k_K_b[] = "K_b"; static const char __pyx_k_K_c[] = "K_c"; static const char __pyx_k_K_d[] = "K_d"; static const char __pyx_k_K_e[] = "K_e"; static const char __pyx_k_K_f[] = "K_f"; static const char __pyx_k_K_g[] = "K_g"; static const char __pyx_k_K_h[] = "K_h"; static const char __pyx_k_K_i[] = "K_i"; static const char __pyx_k_K_j[] = "K_j"; static const char __pyx_k_K_k[] = "K_k"; static const char __pyx_k_K_l[] = "K_l"; static const char __pyx_k_K_m[] = "K_m"; static const char __pyx_k_K_n[] = "K_n"; static const char __pyx_k_K_o[] = "K_o"; static const char __pyx_k_K_p[] = "K_p"; static const char __pyx_k_K_q[] = "K_q"; static const char __pyx_k_K_r[] = "K_r"; static const char __pyx_k_K_s[] = "K_s"; static const char __pyx_k_K_t[] = "K_t"; static const char __pyx_k_K_u[] = "K_u"; static const char __pyx_k_K_v[] = "K_v"; static const char __pyx_k_K_w[] = "K_w"; static const char __pyx_k_K_x[] = "K_x"; static const char __pyx_k_K_y[] = "K_y"; static const char __pyx_k_K_z[] = "K_z"; static const char __pyx_k_K_AT[] = "K_AT"; static const char __pyx_k_K_F1[] = "K_F1"; static const char __pyx_k_K_F2[] = "K_F2"; static const char __pyx_k_K_F3[] = "K_F3"; static const char __pyx_k_K_F4[] = "K_F4"; static const char __pyx_k_K_F5[] = "K_F5"; static const char __pyx_k_K_F6[] = "K_F6"; static const char __pyx_k_K_F7[] = "K_F7"; static const char __pyx_k_K_F8[] = "K_F8"; static const char __pyx_k_K_F9[] = "K_F9"; static const char __pyx_k_K_UP[] = "K_UP"; static const char __pyx_k_QUIT[] = "QUIT"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_Color[] = "Color"; static const char __pyx_k_KEYUP[] = "KEYUP"; static const char __pyx_k_K_CUT[] = "K_CUT"; static const char __pyx_k_K_END[] = "K_END"; static const char __pyx_k_K_F10[] = "K_F10"; static const char __pyx_k_K_F11[] = "K_F11"; static const char __pyx_k_K_F12[] = "K_F12"; static const char __pyx_k_K_F13[] = "K_F13"; static const char __pyx_k_K_F14[] = "K_F14"; static const char __pyx_k_K_F15[] = "K_F15"; static const char __pyx_k_K_F16[] = "K_F16"; static const char __pyx_k_K_F17[] = "K_F17"; static const char __pyx_k_K_F18[] = "K_F18"; static const char __pyx_k_K_F19[] = "K_F19"; static const char __pyx_k_K_F20[] = "K_F20"; static const char __pyx_k_K_F21[] = "K_F21"; static const char __pyx_k_K_F22[] = "K_F22"; static const char __pyx_k_K_F23[] = "K_F23"; static const char __pyx_k_K_F24[] = "K_F24"; static const char __pyx_k_K_KP0[] = "K_KP0"; static const char __pyx_k_K_KP1[] = "K_KP1"; static const char __pyx_k_K_KP2[] = "K_KP2"; static const char __pyx_k_K_KP3[] = "K_KP3"; static const char __pyx_k_K_KP4[] = "K_KP4"; static const char __pyx_k_K_KP5[] = "K_KP5"; static const char __pyx_k_K_KP6[] = "K_KP6"; static const char __pyx_k_K_KP7[] = "K_KP7"; static const char __pyx_k_K_KP8[] = "K_KP8"; static const char __pyx_k_K_KP9[] = "K_KP9"; static const char __pyx_k_K_OUT[] = "K_OUT"; static const char __pyx_k_K_TAB[] = "K_TAB"; static const char __pyx_k_K_WWW[] = "K_WWW"; static const char __pyx_k_K_APP1[] = "K_APP1"; static const char __pyx_k_K_APP2[] = "K_APP2"; static const char __pyx_k_K_COPY[] = "K_COPY"; static const char __pyx_k_K_DOWN[] = "K_DOWN"; static const char __pyx_k_K_EURO[] = "K_EURO"; static const char __pyx_k_K_FIND[] = "K_FIND"; static const char __pyx_k_K_HASH[] = "K_HASH"; static const char __pyx_k_K_HELP[] = "K_HELP"; static const char __pyx_k_K_HOME[] = "K_HOME"; static const char __pyx_k_K_KP_0[] = "K_KP_0"; static const char __pyx_k_K_KP_1[] = "K_KP_1"; static const char __pyx_k_K_KP_2[] = "K_KP_2"; static const char __pyx_k_K_KP_3[] = "K_KP_3"; static const char __pyx_k_K_KP_4[] = "K_KP_4"; static const char __pyx_k_K_KP_5[] = "K_KP_5"; static const char __pyx_k_K_KP_6[] = "K_KP_6"; static const char __pyx_k_K_KP_7[] = "K_KP_7"; static const char __pyx_k_K_KP_8[] = "K_KP_8"; static const char __pyx_k_K_KP_9[] = "K_KP_9"; static const char __pyx_k_K_KP_A[] = "K_KP_A"; static const char __pyx_k_K_KP_B[] = "K_KP_B"; static const char __pyx_k_K_KP_C[] = "K_KP_C"; static const char __pyx_k_K_KP_D[] = "K_KP_D"; static const char __pyx_k_K_KP_E[] = "K_KP_E"; static const char __pyx_k_K_KP_F[] = "K_KP_F"; static const char __pyx_k_K_LALT[] = "K_LALT"; static const char __pyx_k_K_LAST[] = "K_LAST"; static const char __pyx_k_K_LEFT[] = "K_LEFT"; static const char __pyx_k_K_LESS[] = "K_LESS"; static const char __pyx_k_K_LGUI[] = "K_LGUI"; static const char __pyx_k_K_MAIL[] = "K_MAIL"; static const char __pyx_k_K_MENU[] = "K_MENU"; static const char __pyx_k_K_MODE[] = "K_MODE"; static const char __pyx_k_K_MUTE[] = "K_MUTE"; static const char __pyx_k_K_OPER[] = "K_OPER"; static const char __pyx_k_K_PLUS[] = "K_PLUS"; static const char __pyx_k_K_RALT[] = "K_RALT"; static const char __pyx_k_K_RGUI[] = "K_RGUI"; static const char __pyx_k_K_STOP[] = "K_STOP"; static const char __pyx_k_K_UNDO[] = "K_UNDO"; static const char __pyx_k_OPENGL[] = "OPENGL"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_KEYDOWN[] = "KEYDOWN"; static const char __pyx_k_K_AGAIN[] = "K_AGAIN"; static const char __pyx_k_K_BREAK[] = "K_BREAK"; static const char __pyx_k_K_CARET[] = "K_CARET"; static const char __pyx_k_K_CLEAR[] = "K_CLEAR"; static const char __pyx_k_K_COLON[] = "K_COLON"; static const char __pyx_k_K_COMMA[] = "K_COMMA"; static const char __pyx_k_K_CRSEL[] = "K_CRSEL"; static const char __pyx_k_K_EJECT[] = "K_EJECT"; static const char __pyx_k_K_EXSEL[] = "K_EXSEL"; static const char __pyx_k_K_FIRST[] = "K_FIRST"; static const char __pyx_k_K_KP_00[] = "K_KP_00"; static const char __pyx_k_K_KP_AT[] = "K_KP_AT"; static const char __pyx_k_K_LCTRL[] = "K_LCTRL"; static const char __pyx_k_K_LMETA[] = "K_LMETA"; static const char __pyx_k_K_MINUS[] = "K_MINUS"; static const char __pyx_k_K_PASTE[] = "K_PASTE"; static const char __pyx_k_K_PAUSE[] = "K_PAUSE"; static const char __pyx_k_K_POWER[] = "K_POWER"; static const char __pyx_k_K_PRINT[] = "K_PRINT"; static const char __pyx_k_K_PRIOR[] = "K_PRIOR"; static const char __pyx_k_K_QUOTE[] = "K_QUOTE"; static const char __pyx_k_K_RCTRL[] = "K_RCTRL"; static const char __pyx_k_K_RIGHT[] = "K_RIGHT"; static const char __pyx_k_K_RMETA[] = "K_RMETA"; static const char __pyx_k_K_SLASH[] = "K_SLASH"; static const char __pyx_k_K_SLEEP[] = "K_SLEEP"; static const char __pyx_k_K_SPACE[] = "K_SPACE"; static const char __pyx_k_NOEVENT[] = "NOEVENT"; static const char __pyx_k_NOFRAME[] = "NOFRAME"; static const char __pyx_k_DROPFILE[] = "DROPFILE"; static const char __pyx_k_DROPTEXT[] = "DROPTEXT"; static const char __pyx_k_FINGERUP[] = "FINGERUP"; static const char __pyx_k_KMOD_ALT[] = "KMOD_ALT"; static const char __pyx_k_KMOD_GUI[] = "KMOD_GUI"; static const char __pyx_k_KMOD_NUM[] = "KMOD_NUM"; static const char __pyx_k_K_CANCEL[] = "K_CANCEL"; static const char __pyx_k_K_DELETE[] = "K_DELETE"; static const char __pyx_k_K_DOLLAR[] = "K_DOLLAR"; static const char __pyx_k_K_EQUALS[] = "K_EQUALS"; static const char __pyx_k_K_ESCAPE[] = "K_ESCAPE"; static const char __pyx_k_K_INSERT[] = "K_INSERT"; static const char __pyx_k_K_KP_000[] = "K_KP_000"; static const char __pyx_k_K_KP_TAB[] = "K_KP_TAB"; static const char __pyx_k_K_KP_XOR[] = "K_KP_XOR"; static const char __pyx_k_K_LSHIFT[] = "K_LSHIFT"; static const char __pyx_k_K_LSUPER[] = "K_LSUPER"; static const char __pyx_k_K_PAGEUP[] = "K_PAGEUP"; static const char __pyx_k_K_PERIOD[] = "K_PERIOD"; static const char __pyx_k_K_RETURN[] = "K_RETURN"; static const char __pyx_k_K_RSHIFT[] = "K_RSHIFT"; static const char __pyx_k_K_RSUPER[] = "K_RSUPER"; static const char __pyx_k_K_SELECT[] = "K_SELECT"; static const char __pyx_k_K_SYSREQ[] = "K_SYSREQ"; static const char __pyx_k_RLEACCEL[] = "RLEACCEL"; static const char __pyx_k_SRCALPHA[] = "SRCALPHA"; static const char __pyx_k_BLEND_ADD[] = "BLEND_ADD"; static const char __pyx_k_BLEND_MAX[] = "BLEND_MAX"; static const char __pyx_k_BLEND_MIN[] = "BLEND_MIN"; static const char __pyx_k_BLEND_SUB[] = "BLEND_SUB"; static const char __pyx_k_BYTEORDER[] = "BYTEORDER"; static const char __pyx_k_DOUBLEBUF[] = "DOUBLEBUF"; static const char __pyx_k_DROPBEGIN[] = "DROPBEGIN"; static const char __pyx_k_GL_STEREO[] = "GL_STEREO"; static const char __pyx_k_HWSURFACE[] = "HWSURFACE"; static const char __pyx_k_KMOD_CAPS[] = "KMOD_CAPS"; static const char __pyx_k_KMOD_CTRL[] = "KMOD_CTRL"; static const char __pyx_k_KMOD_LALT[] = "KMOD_LALT"; static const char __pyx_k_KMOD_LGUI[] = "KMOD_LGUI"; static const char __pyx_k_KMOD_META[] = "KMOD_META"; static const char __pyx_k_KMOD_MODE[] = "KMOD_MODE"; static const char __pyx_k_KMOD_NONE[] = "KMOD_NONE"; static const char __pyx_k_KMOD_RALT[] = "KMOD_RALT"; static const char __pyx_k_KMOD_RGUI[] = "KMOD_RGUI"; static const char __pyx_k_K_AC_BACK[] = "K_AC_BACK"; static const char __pyx_k_K_AC_HOME[] = "K_AC_HOME"; static const char __pyx_k_K_AC_STOP[] = "K_AC_STOP"; static const char __pyx_k_K_EXCLAIM[] = "K_EXCLAIM"; static const char __pyx_k_K_EXECUTE[] = "K_EXECUTE"; static const char __pyx_k_K_GREATER[] = "K_GREATER"; static const char __pyx_k_K_KP_HASH[] = "K_KP_HASH"; static const char __pyx_k_K_KP_LESS[] = "K_KP_LESS"; static const char __pyx_k_K_KP_PLUS[] = "K_KP_PLUS"; static const char __pyx_k_K_NUMLOCK[] = "K_NUMLOCK"; static const char __pyx_k_K_PERCENT[] = "K_PERCENT"; static const char __pyx_k_K_RETURN2[] = "K_RETURN2"; static const char __pyx_k_K_UNKNOWN[] = "K_UNKNOWN"; static const char __pyx_k_LASTEVENT[] = "LASTEVENT"; static const char __pyx_k_RESIZABLE[] = "RESIZABLE"; static const char __pyx_k_SWSURFACE[] = "SWSURFACE"; static const char __pyx_k_TEXTINPUT[] = "TEXTINPUT"; static const char __pyx_k_USEREVENT[] = "USEREVENT"; static const char __pyx_k_BIG_ENDIAN[] = "BIG_ENDIAN"; static const char __pyx_k_BLEND_MULT[] = "BLEND_MULT"; static const char __pyx_k_FINGERDOWN[] = "FINGERDOWN"; static const char __pyx_k_FULLSCREEN[] = "FULLSCREEN"; static const char __pyx_k_KMOD_LCTRL[] = "KMOD_LCTRL"; static const char __pyx_k_KMOD_LMETA[] = "KMOD_LMETA"; static const char __pyx_k_KMOD_RCTRL[] = "KMOD_RCTRL"; static const char __pyx_k_KMOD_RMETA[] = "KMOD_RMETA"; static const char __pyx_k_KMOD_SHIFT[] = "KMOD_SHIFT"; static const char __pyx_k_K_ALTERASE[] = "K_ALTERASE"; static const char __pyx_k_K_ASTERISK[] = "K_ASTERISK"; static const char __pyx_k_K_CAPSLOCK[] = "K_CAPSLOCK"; static const char __pyx_k_K_COMPUTER[] = "K_COMPUTER"; static const char __pyx_k_K_KP_CLEAR[] = "K_KP_CLEAR"; static const char __pyx_k_K_KP_COLON[] = "K_KP_COLON"; static const char __pyx_k_K_KP_COMMA[] = "K_KP_COMMA"; static const char __pyx_k_K_KP_ENTER[] = "K_KP_ENTER"; static const char __pyx_k_K_KP_MINUS[] = "K_KP_MINUS"; static const char __pyx_k_K_KP_OCTAL[] = "K_KP_OCTAL"; static const char __pyx_k_K_KP_POWER[] = "K_KP_POWER"; static const char __pyx_k_K_KP_SPACE[] = "K_KP_SPACE"; static const char __pyx_k_K_PAGEDOWN[] = "K_PAGEDOWN"; static const char __pyx_k_K_QUESTION[] = "K_QUESTION"; static const char __pyx_k_K_QUOTEDBL[] = "K_QUOTEDBL"; static const char __pyx_k_K_VOLUMEUP[] = "K_VOLUMEUP"; static const char __pyx_k_LIL_ENDIAN[] = "LIL_ENDIAN"; static const char __pyx_k_MOUSEWHEEL[] = "MOUSEWHEEL"; static const char __pyx_k_SCRAP_TEXT[] = "SCRAP_TEXT"; static const char __pyx_k_SYSWMEVENT[] = "SYSWMEVENT"; static const char __pyx_k_text_plain[] = "text/plain"; static const char __pyx_k_ACTIVEEVENT[] = "ACTIVEEVENT"; static const char __pyx_k_GL_RED_SIZE[] = "GL_RED_SIZE"; static const char __pyx_k_JOYBUTTONUP[] = "JOYBUTTONUP"; static const char __pyx_k_KMOD_LSHIFT[] = "KMOD_LSHIFT"; static const char __pyx_k_KMOD_RSHIFT[] = "KMOD_RSHIFT"; static const char __pyx_k_K_AC_SEARCH[] = "K_AC_SEARCH"; static const char __pyx_k_K_AMPERSAND[] = "K_AMPERSAND"; static const char __pyx_k_K_AUDIOMUTE[] = "K_AUDIOMUTE"; static const char __pyx_k_K_AUDIONEXT[] = "K_AUDIONEXT"; static const char __pyx_k_K_AUDIOPLAY[] = "K_AUDIOPLAY"; static const char __pyx_k_K_AUDIOPREV[] = "K_AUDIOPREV"; static const char __pyx_k_K_AUDIOSTOP[] = "K_AUDIOSTOP"; static const char __pyx_k_K_BACKQUOTE[] = "K_BACKQUOTE"; static const char __pyx_k_K_BACKSLASH[] = "K_BACKSLASH"; static const char __pyx_k_K_BACKSPACE[] = "K_BACKSPACE"; static const char __pyx_k_K_KP_BINARY[] = "K_KP_BINARY"; static const char __pyx_k_K_KP_DIVIDE[] = "K_KP_DIVIDE"; static const char __pyx_k_K_KP_EQUALS[] = "K_KP_EQUALS"; static const char __pyx_k_K_KP_EXCLAM[] = "K_KP_EXCLAM"; static const char __pyx_k_K_KP_MEMADD[] = "K_KP_MEMADD"; static const char __pyx_k_K_KP_PERIOD[] = "K_KP_PERIOD"; static const char __pyx_k_K_LEFTPAREN[] = "K_LEFTPAREN"; static const char __pyx_k_K_SCROLLOCK[] = "K_SCROLLOCK"; static const char __pyx_k_K_SEMICOLON[] = "K_SEMICOLON"; static const char __pyx_k_K_SEPARATOR[] = "K_SEPARATOR"; static const char __pyx_k_MOUSEMOTION[] = "MOUSEMOTION"; static const char __pyx_k_SRCCOLORKEY[] = "SRCCOLORKEY"; static const char __pyx_k_TEXTEDITING[] = "TEXTEDITING"; static const char __pyx_k_VIDEOEXPOSE[] = "VIDEOEXPOSE"; static const char __pyx_k_VIDEORESIZE[] = "VIDEORESIZE"; static const char __pyx_k_WINDOWEVENT[] = "WINDOWEVENT"; static const char __pyx_k_WINDOWMOVED[] = "WINDOWMOVED"; static const char __pyx_k_DISPLAYEVENT[] = "DISPLAYEVENT"; static const char __pyx_k_DOLLARRECORD[] = "DOLLARRECORD"; static const char __pyx_k_DROPCOMPLETE[] = "DROPCOMPLETE"; static const char __pyx_k_FINGERMOTION[] = "FINGERMOTION"; static const char __pyx_k_GL_BLUE_SIZE[] = "GL_BLUE_SIZE"; static const char __pyx_k_JOYHATMOTION[] = "JOYHATMOTION"; static const char __pyx_k_K_AC_FORWARD[] = "K_AC_FORWARD"; static const char __pyx_k_K_AC_REFRESH[] = "K_AC_REFRESH"; static const char __pyx_k_K_CALCULATOR[] = "K_CALCULATOR"; static const char __pyx_k_K_CLEARAGAIN[] = "K_CLEARAGAIN"; static const char __pyx_k_K_KBDILLUMUP[] = "K_KBDILLUMUP"; static const char __pyx_k_K_KP_DECIMAL[] = "K_KP_DECIMAL"; static const char __pyx_k_K_KP_GREATER[] = "K_KP_GREATER"; static const char __pyx_k_K_KP_PERCENT[] = "K_KP_PERCENT"; static const char __pyx_k_K_RIGHTPAREN[] = "K_RIGHTPAREN"; static const char __pyx_k_K_SCROLLLOCK[] = "K_SCROLLLOCK"; static const char __pyx_k_K_UNDERSCORE[] = "K_UNDERSCORE"; static const char __pyx_k_K_VOLUMEDOWN[] = "K_VOLUMEDOWN"; static const char __pyx_k_MULTIGESTURE[] = "MULTIGESTURE"; static const char __pyx_k_SENSORUPDATE[] = "SENSORUPDATE"; static const char __pyx_k_WINDOW_SHOWN[] = "WINDOW_SHOWN"; static const char __pyx_k_APP_LOWMEMORY[] = "APP_LOWMEMORY"; static const char __pyx_k_BLEND_RGB_ADD[] = "BLEND_RGB_ADD"; static const char __pyx_k_BLEND_RGB_MAX[] = "BLEND_RGB_MAX"; static const char __pyx_k_BLEND_RGB_MIN[] = "BLEND_RGB_MIN"; static const char __pyx_k_BLEND_RGB_SUB[] = "BLEND_RGB_SUB"; static const char __pyx_k_DOLLARGESTURE[] = "DOLLARGESTURE"; static const char __pyx_k_GL_ALPHA_SIZE[] = "GL_ALPHA_SIZE"; static const char __pyx_k_GL_DEPTH_SIZE[] = "GL_DEPTH_SIZE"; static const char __pyx_k_GL_GREEN_SIZE[] = "GL_GREEN_SIZE"; static const char __pyx_k_JOYAXISMOTION[] = "JOYAXISMOTION"; static const char __pyx_k_JOYBALLMOTION[] = "JOYBALLMOTION"; static const char __pyx_k_JOYBUTTONDOWN[] = "JOYBUTTONDOWN"; static const char __pyx_k_KEYMAPCHANGED[] = "KEYMAPCHANGED"; static const char __pyx_k_K_APPLICATION[] = "K_APPLICATION"; static const char __pyx_k_K_AUDIOREWIND[] = "K_AUDIOREWIND"; static const char __pyx_k_K_KP_MEMCLEAR[] = "K_KP_MEMCLEAR"; static const char __pyx_k_K_KP_MEMSTORE[] = "K_KP_MEMSTORE"; static const char __pyx_k_K_KP_MULTIPLY[] = "K_KP_MULTIPLY"; static const char __pyx_k_K_LEFTBRACKET[] = "K_LEFTBRACKET"; static const char __pyx_k_K_MEDIASELECT[] = "K_MEDIASELECT"; static const char __pyx_k_K_PRINTSCREEN[] = "K_PRINTSCREEN"; static const char __pyx_k_MOUSEBUTTONUP[] = "MOUSEBUTTONUP"; static const char __pyx_k_TOUCH_MOUSEID[] = "TOUCH_MOUSEID"; static const char __pyx_k_WINDOW_HIDDEN[] = "WINDOW_HIDDEN"; static const char __pyx_k_WINDOW_OPENGL[] = "WINDOW_OPENGL"; static const char __pyx_k_BLEND_RGBA_ADD[] = "BLEND_RGBA_ADD"; static const char __pyx_k_BLEND_RGBA_MAX[] = "BLEND_RGBA_MAX"; static const char __pyx_k_BLEND_RGBA_MIN[] = "BLEND_RGBA_MIN"; static const char __pyx_k_BLEND_RGBA_SUB[] = "BLEND_RGBA_SUB"; static const char __pyx_k_BLEND_RGB_MULT[] = "BLEND_RGB_MULT"; static const char __pyx_k_GL_BUFFER_SIZE[] = "GL_BUFFER_SIZE"; static const char __pyx_k_GL_CONTEXT_EGL[] = "GL_CONTEXT_EGL"; static const char __pyx_k_JOYDEVICEADDED[] = "JOYDEVICEADDED"; static const char __pyx_k_K_AC_BOOKMARKS[] = "K_AC_BOOKMARKS"; static const char __pyx_k_K_BRIGHTNESSUP[] = "K_BRIGHTNESSUP"; static const char __pyx_k_K_CURRENCYUNIT[] = "K_CURRENCYUNIT"; static const char __pyx_k_K_KBDILLUMDOWN[] = "K_KBDILLUMDOWN"; static const char __pyx_k_K_KP_AMPERSAND[] = "K_KP_AMPERSAND"; static const char __pyx_k_K_KP_BACKSPACE[] = "K_KP_BACKSPACE"; static const char __pyx_k_K_KP_LEFTBRACE[] = "K_KP_LEFTBRACE"; static const char __pyx_k_K_KP_LEFTPAREN[] = "K_KP_LEFTPAREN"; static const char __pyx_k_K_KP_MEMDIVIDE[] = "K_KP_MEMDIVIDE"; static const char __pyx_k_K_KP_MEMRECALL[] = "K_KP_MEMRECALL"; static const char __pyx_k_K_KP_PLUSMINUS[] = "K_KP_PLUSMINUS"; static const char __pyx_k_K_NUMLOCKCLEAR[] = "K_NUMLOCKCLEAR"; static const char __pyx_k_K_RIGHTBRACKET[] = "K_RIGHTBRACKET"; static const char __pyx_k_WINDOW_FOREIGN[] = "WINDOW_FOREIGN"; static const char __pyx_k_WINDOW_NOFRAME[] = "WINDOW_NOFRAME"; static const char __pyx_k_APP_TERMINATING[] = "APP_TERMINATING"; static const char __pyx_k_BLEND_RGBA_MULT[] = "BLEND_RGBA_MULT"; static const char __pyx_k_CLIPBOARDUPDATE[] = "CLIPBOARDUPDATE"; static const char __pyx_k_GL_DOUBLEBUFFER[] = "GL_DOUBLEBUFFER"; static const char __pyx_k_GL_STENCIL_SIZE[] = "GL_STENCIL_SIZE"; static const char __pyx_k_GL_SWAP_CONTROL[] = "GL_SWAP_CONTROL"; static const char __pyx_k_K_DISPLAYSWITCH[] = "K_DISPLAYSWITCH"; static const char __pyx_k_K_KP_CLEARENTRY[] = "K_KP_CLEARENTRY"; static const char __pyx_k_K_KP_RIGHTBRACE[] = "K_KP_RIGHTBRACE"; static const char __pyx_k_K_KP_RIGHTPAREN[] = "K_KP_RIGHTPAREN"; static const char __pyx_k_MOUSEBUTTONDOWN[] = "MOUSEBUTTONDOWN"; static const char __pyx_k_AUDIODEVICEADDED[] = "AUDIODEVICEADDED"; static const char __pyx_k_GL_CONTEXT_FLAGS[] = "GL_CONTEXT_FLAGS"; static const char __pyx_k_JOYDEVICEREMOVED[] = "JOYDEVICEREMOVED"; static const char __pyx_k_K_BRIGHTNESSDOWN[] = "K_BRIGHTNESSDOWN"; static const char __pyx_k_K_KBDILLUMTOGGLE[] = "K_KBDILLUMTOGGLE"; static const char __pyx_k_K_KP_EQUALSAS400[] = "K_KP_EQUALSAS400"; static const char __pyx_k_K_KP_HEXADECIMAL[] = "K_KP_HEXADECIMAL"; static const char __pyx_k_K_KP_MEMMULTIPLY[] = "K_KP_MEMMULTIPLY"; static const char __pyx_k_K_KP_MEMSUBTRACT[] = "K_KP_MEMSUBTRACT"; static const char __pyx_k_K_KP_VERTICALBAR[] = "K_KP_VERTICALBAR"; static const char __pyx_k_WINDOW_MAXIMIZED[] = "WINDOW_MAXIMIZED"; static const char __pyx_k_WINDOW_MINIMIZED[] = "WINDOW_MINIMIZED"; static const char __pyx_k_WINDOW_RESIZABLE[] = "WINDOW_RESIZABLE"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_GL_ACCUM_RED_SIZE[] = "GL_ACCUM_RED_SIZE"; static const char __pyx_k_K_CURRENCYSUBUNIT[] = "K_CURRENCYSUBUNIT"; static const char __pyx_k_K_KP_DBLAMPERSAND[] = "K_KP_DBLAMPERSAND"; static const char __pyx_k_SDL_VERSION_TUPLE[] = "SDL_VERSION_TUPLE"; static const char __pyx_k_WINDOW_BORDERLESS[] = "WINDOW_BORDERLESS"; static const char __pyx_k_WINDOW_FULLSCREEN[] = "WINDOW_FULLSCREEN"; static const char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color"; static const char __pyx_k_AUDIODEVICEREMOVED[] = "AUDIODEVICEREMOVED"; static const char __pyx_k_CONTROLLERBUTTONUP[] = "CONTROLLERBUTTONUP"; static const char __pyx_k_GL_ACCUM_BLUE_SIZE[] = "GL_ACCUM_BLUE_SIZE"; static const char __pyx_k_K_AUDIOFASTFORWARD[] = "K_AUDIOFASTFORWARD"; static const char __pyx_k_K_DECIMALSEPARATOR[] = "K_DECIMALSEPARATOR"; static const char __pyx_k_POWERSTATE_CHARGED[] = "POWERSTATE_CHARGED"; static const char __pyx_k_POWERSTATE_UNKNOWN[] = "POWERSTATE_UNKNOWN"; static const char __pyx_k_WINDOWPOS_CENTERED[] = "WINDOWPOS_CENTERED"; static const char __pyx_k_WINDOW_INPUT_FOCUS[] = "WINDOW_INPUT_FOCUS"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_BLEND_PREMULTIPLIED[] = "BLEND_PREMULTIPLIED"; static const char __pyx_k_CONTROLLER_AXIS_MAX[] = "CONTROLLER_AXIS_MAX"; static const char __pyx_k_CONTROLLER_BUTTON_A[] = "CONTROLLER_BUTTON_A"; static const char __pyx_k_CONTROLLER_BUTTON_B[] = "CONTROLLER_BUTTON_B"; static const char __pyx_k_CONTROLLER_BUTTON_X[] = "CONTROLLER_BUTTON_X"; static const char __pyx_k_CONTROLLER_BUTTON_Y[] = "CONTROLLER_BUTTON_Y"; static const char __pyx_k_GL_ACCUM_ALPHA_SIZE[] = "GL_ACCUM_ALPHA_SIZE"; static const char __pyx_k_GL_ACCUM_GREEN_SIZE[] = "GL_ACCUM_GREEN_SIZE"; static const char __pyx_k_GL_CONTEXT_NO_ERROR[] = "GL_CONTEXT_NO_ERROR"; static const char __pyx_k_GL_RETAINED_BACKING[] = "GL_RETAINED_BACKING"; static const char __pyx_k_K_KP_DBLVERTICALBAR[] = "K_KP_DBLVERTICALBAR"; static const char __pyx_k_POWERSTATE_CHARGING[] = "POWERSTATE_CHARGING"; static const char __pyx_k_RENDER_DEVICE_RESET[] = "RENDER_DEVICE_RESET"; static const char __pyx_k_WINDOWPOS_UNDEFINED[] = "WINDOWPOS_UNDEFINED"; static const char __pyx_k_CONTROLLERAXISMOTION[] = "CONTROLLERAXISMOTION"; static const char __pyx_k_CONTROLLERBUTTONDOWN[] = "CONTROLLERBUTTONDOWN"; static const char __pyx_k_K_THOUSANDSSEPARATOR[] = "K_THOUSANDSSEPARATOR"; static const char __pyx_k_RENDER_TARGETS_RESET[] = "RENDER_TARGETS_RESET"; static const char __pyx_k_WINDOW_ALLOW_HIGHDPI[] = "WINDOW_ALLOW_HIGHDPI"; static const char __pyx_k_WINDOW_INPUT_GRABBED[] = "WINDOW_INPUT_GRABBED"; static const char __pyx_k_CONTROLLERDEVICEADDED[] = "CONTROLLERDEVICEADDED"; static const char __pyx_k_CONTROLLER_AXIS_LEFTX[] = "CONTROLLER_AXIS_LEFTX"; static const char __pyx_k_CONTROLLER_AXIS_LEFTY[] = "CONTROLLER_AXIS_LEFTY"; static const char __pyx_k_CONTROLLER_BUTTON_MAX[] = "CONTROLLER_BUTTON_MAX"; static const char __pyx_k_GL_ACCELERATED_VISUAL[] = "GL_ACCELERATED_VISUAL"; static const char __pyx_k_GL_CONTEXT_PROFILE_ES[] = "GL_CONTEXT_PROFILE_ES"; static const char __pyx_k_GL_MULTISAMPLEBUFFERS[] = "GL_MULTISAMPLEBUFFERS"; static const char __pyx_k_GL_MULTISAMPLESAMPLES[] = "GL_MULTISAMPLESAMPLES"; static const char __pyx_k_POWERSTATE_NO_BATTERY[] = "POWERSTATE_NO_BATTERY"; static const char __pyx_k_POWERSTATE_ON_BATTERY[] = "POWERSTATE_ON_BATTERY"; static const char __pyx_k_APP_DIDENTERBACKGROUND[] = "APP_DIDENTERBACKGROUND"; static const char __pyx_k_APP_DIDENTERFOREGROUND[] = "APP_DIDENTERFOREGROUND"; static const char __pyx_k_CONTROLLER_AXIS_RIGHTX[] = "CONTROLLER_AXIS_RIGHTX"; static const char __pyx_k_CONTROLLER_AXIS_RIGHTY[] = "CONTROLLER_AXIS_RIGHTY"; static const char __pyx_k_CONTROLLER_BUTTON_BACK[] = "CONTROLLER_BUTTON_BACK"; static const char __pyx_k_APP_WILLENTERBACKGROUND[] = "APP_WILLENTERBACKGROUND"; static const char __pyx_k_APP_WILLENTERFOREGROUND[] = "APP_WILLENTERFOREGROUND"; static const char __pyx_k_CONTROLLERDEVICEREMOVED[] = "CONTROLLERDEVICEREMOVED"; static const char __pyx_k_CONTROLLER_AXIS_INVALID[] = "CONTROLLER_AXIS_INVALID"; static const char __pyx_k_CONTROLLER_BUTTON_GUIDE[] = "CONTROLLER_BUTTON_GUIDE"; static const char __pyx_k_CONTROLLER_BUTTON_START[] = "CONTROLLER_BUTTON_START"; static const char __pyx_k_GL_CONTEXT_PROFILE_CORE[] = "GL_CONTEXT_PROFILE_CORE"; static const char __pyx_k_GL_CONTEXT_PROFILE_MASK[] = "GL_CONTEXT_PROFILE_MASK"; static const char __pyx_k_CONTROLLERDEVICEREMAPPED[] = "CONTROLLERDEVICEREMAPPED"; static const char __pyx_k_GL_CONTEXT_MAJOR_VERSION[] = "GL_CONTEXT_MAJOR_VERSION"; static const char __pyx_k_GL_CONTEXT_MINOR_VERSION[] = "GL_CONTEXT_MINOR_VERSION"; static const char __pyx_k_CONTROLLER_BUTTON_DPAD_UP[] = "CONTROLLER_BUTTON_DPAD_UP"; static const char __pyx_k_CONTROLLER_BUTTON_INVALID[] = "CONTROLLER_BUTTON_INVALID"; static const char __pyx_k_WINDOW_FULLSCREEN_DESKTOP[] = "WINDOW_FULLSCREEN_DESKTOP"; static const char __pyx_k_CONTROLLER_AXIS_TRIGGERLEFT[] = "CONTROLLER_AXIS_TRIGGERLEFT"; static const char __pyx_k_CONTROLLER_BUTTON_DPAD_DOWN[] = "CONTROLLER_BUTTON_DPAD_DOWN"; static const char __pyx_k_CONTROLLER_BUTTON_DPAD_LEFT[] = "CONTROLLER_BUTTON_DPAD_LEFT"; static const char __pyx_k_CONTROLLER_BUTTON_LEFTSTICK[] = "CONTROLLER_BUTTON_LEFTSTICK"; static const char __pyx_k_GL_CONTEXT_RELEASE_BEHAVIOR[] = "GL_CONTEXT_RELEASE_BEHAVIOR"; static const char __pyx_k_GL_FRAMEBUFFER_SRGB_CAPABLE[] = "GL_FRAMEBUFFER_SRGB_CAPABLE"; static const char __pyx_k_CONTROLLER_AXIS_TRIGGERRIGHT[] = "CONTROLLER_AXIS_TRIGGERRIGHT"; static const char __pyx_k_CONTROLLER_BUTTON_DPAD_RIGHT[] = "CONTROLLER_BUTTON_DPAD_RIGHT"; static const char __pyx_k_CONTROLLER_BUTTON_RIGHTSTICK[] = "CONTROLLER_BUTTON_RIGHTSTICK"; static const char __pyx_k_GL_CONTEXT_RESET_NOTIFICATION[] = "GL_CONTEXT_RESET_NOTIFICATION"; static const char __pyx_k_GL_SHARE_WITH_CURRENT_CONTEXT[] = "GL_SHARE_WITH_CURRENT_CONTEXT"; static const char __pyx_k_CONTROLLER_BUTTON_LEFTSHOULDER[] = "CONTROLLER_BUTTON_LEFTSHOULDER"; static const char __pyx_k_CONTROLLER_BUTTON_RIGHTSHOULDER[] = "CONTROLLER_BUTTON_RIGHTSHOULDER"; static const char __pyx_k_GL_CONTEXT_PROFILE_COMPATIBILITY[] = "GL_CONTEXT_PROFILE_COMPATIBILITY"; /* #### Code section: decls ### */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_u_; PyObject *__pyx_n_s_ACTIVEEVENT; PyObject *__pyx_n_s_APP_DIDENTERBACKGROUND; PyObject *__pyx_n_s_APP_DIDENTERFOREGROUND; PyObject *__pyx_n_s_APP_LOWMEMORY; PyObject *__pyx_n_s_APP_TERMINATING; PyObject *__pyx_n_s_APP_WILLENTERBACKGROUND; PyObject *__pyx_n_s_APP_WILLENTERFOREGROUND; PyObject *__pyx_n_s_AUDIODEVICEADDED; PyObject *__pyx_n_s_AUDIODEVICEREMOVED; PyObject *__pyx_n_s_BIG_ENDIAN; PyObject *__pyx_n_s_BLEND_ADD; PyObject *__pyx_n_s_BLEND_MAX; PyObject *__pyx_n_s_BLEND_MIN; PyObject *__pyx_n_s_BLEND_MULT; PyObject *__pyx_n_s_BLEND_PREMULTIPLIED; PyObject *__pyx_n_s_BLEND_RGBA_ADD; PyObject *__pyx_n_s_BLEND_RGBA_MAX; PyObject *__pyx_n_s_BLEND_RGBA_MIN; PyObject *__pyx_n_s_BLEND_RGBA_MULT; PyObject *__pyx_n_s_BLEND_RGBA_SUB; PyObject *__pyx_n_s_BLEND_RGB_ADD; PyObject *__pyx_n_s_BLEND_RGB_MAX; PyObject *__pyx_n_s_BLEND_RGB_MIN; PyObject *__pyx_n_s_BLEND_RGB_MULT; PyObject *__pyx_n_s_BLEND_RGB_SUB; PyObject *__pyx_n_s_BLEND_SUB; PyObject *__pyx_n_s_BYTEORDER; PyObject *__pyx_n_s_CLIPBOARDUPDATE; PyObject *__pyx_n_s_CONTROLLERAXISMOTION; PyObject *__pyx_n_s_CONTROLLERBUTTONDOWN; PyObject *__pyx_n_s_CONTROLLERBUTTONUP; PyObject *__pyx_n_s_CONTROLLERDEVICEADDED; PyObject *__pyx_n_s_CONTROLLERDEVICEREMAPPED; PyObject *__pyx_n_s_CONTROLLERDEVICEREMOVED; PyObject *__pyx_n_s_CONTROLLER_AXIS_INVALID; PyObject *__pyx_n_s_CONTROLLER_AXIS_LEFTX; PyObject *__pyx_n_s_CONTROLLER_AXIS_LEFTY; PyObject *__pyx_n_s_CONTROLLER_AXIS_MAX; PyObject *__pyx_n_s_CONTROLLER_AXIS_RIGHTX; PyObject *__pyx_n_s_CONTROLLER_AXIS_RIGHTY; PyObject *__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT; PyObject *__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT; PyObject *__pyx_n_s_CONTROLLER_BUTTON_A; PyObject *__pyx_n_s_CONTROLLER_BUTTON_B; PyObject *__pyx_n_s_CONTROLLER_BUTTON_BACK; PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN; PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT; PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT; PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP; PyObject *__pyx_n_s_CONTROLLER_BUTTON_GUIDE; PyObject *__pyx_n_s_CONTROLLER_BUTTON_INVALID; PyObject *__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER; PyObject *__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK; PyObject *__pyx_n_s_CONTROLLER_BUTTON_MAX; PyObject *__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER; PyObject *__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK; PyObject *__pyx_n_s_CONTROLLER_BUTTON_START; PyObject *__pyx_n_s_CONTROLLER_BUTTON_X; PyObject *__pyx_n_s_CONTROLLER_BUTTON_Y; PyObject *__pyx_n_s_Color; PyObject *__pyx_n_s_DISPLAYEVENT; PyObject *__pyx_n_s_DOLLARGESTURE; PyObject *__pyx_n_s_DOLLARRECORD; PyObject *__pyx_n_s_DOUBLEBUF; PyObject *__pyx_n_s_DROPBEGIN; PyObject *__pyx_n_s_DROPCOMPLETE; PyObject *__pyx_n_s_DROPFILE; PyObject *__pyx_n_s_DROPTEXT; PyObject *__pyx_n_s_FINGERDOWN; PyObject *__pyx_n_s_FINGERMOTION; PyObject *__pyx_n_s_FINGERUP; PyObject *__pyx_n_s_FULLSCREEN; PyObject *__pyx_n_s_GL_ACCELERATED_VISUAL; PyObject *__pyx_n_s_GL_ACCUM_ALPHA_SIZE; PyObject *__pyx_n_s_GL_ACCUM_BLUE_SIZE; PyObject *__pyx_n_s_GL_ACCUM_GREEN_SIZE; PyObject *__pyx_n_s_GL_ACCUM_RED_SIZE; PyObject *__pyx_n_s_GL_ALPHA_SIZE; PyObject *__pyx_n_s_GL_BLUE_SIZE; PyObject *__pyx_n_s_GL_BUFFER_SIZE; PyObject *__pyx_n_s_GL_CONTEXT_EGL; PyObject *__pyx_n_s_GL_CONTEXT_FLAGS; PyObject *__pyx_n_s_GL_CONTEXT_MAJOR_VERSION; PyObject *__pyx_n_s_GL_CONTEXT_MINOR_VERSION; PyObject *__pyx_n_s_GL_CONTEXT_NO_ERROR; PyObject *__pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY; PyObject *__pyx_n_s_GL_CONTEXT_PROFILE_CORE; PyObject *__pyx_n_s_GL_CONTEXT_PROFILE_ES; PyObject *__pyx_n_s_GL_CONTEXT_PROFILE_MASK; PyObject *__pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR; PyObject *__pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION; PyObject *__pyx_n_s_GL_DEPTH_SIZE; PyObject *__pyx_n_s_GL_DOUBLEBUFFER; PyObject *__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE; PyObject *__pyx_n_s_GL_GREEN_SIZE; PyObject *__pyx_n_s_GL_MULTISAMPLEBUFFERS; PyObject *__pyx_n_s_GL_MULTISAMPLESAMPLES; PyObject *__pyx_n_s_GL_RED_SIZE; PyObject *__pyx_n_s_GL_RETAINED_BACKING; PyObject *__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT; PyObject *__pyx_n_s_GL_STENCIL_SIZE; PyObject *__pyx_n_s_GL_STEREO; PyObject *__pyx_n_s_GL_SWAP_CONTROL; PyObject *__pyx_n_s_HWSURFACE; PyObject *__pyx_n_s_JOYAXISMOTION; PyObject *__pyx_n_s_JOYBALLMOTION; PyObject *__pyx_n_s_JOYBUTTONDOWN; PyObject *__pyx_n_s_JOYBUTTONUP; PyObject *__pyx_n_s_JOYDEVICEADDED; PyObject *__pyx_n_s_JOYDEVICEREMOVED; PyObject *__pyx_n_s_JOYHATMOTION; PyObject *__pyx_n_s_KEYDOWN; PyObject *__pyx_n_s_KEYMAPCHANGED; PyObject *__pyx_n_s_KEYUP; PyObject *__pyx_n_s_KMOD_ALT; PyObject *__pyx_n_s_KMOD_CAPS; PyObject *__pyx_n_s_KMOD_CTRL; PyObject *__pyx_n_s_KMOD_GUI; PyObject *__pyx_n_s_KMOD_LALT; PyObject *__pyx_n_s_KMOD_LCTRL; PyObject *__pyx_n_s_KMOD_LGUI; PyObject *__pyx_n_s_KMOD_LMETA; PyObject *__pyx_n_s_KMOD_LSHIFT; PyObject *__pyx_n_s_KMOD_META; PyObject *__pyx_n_s_KMOD_MODE; PyObject *__pyx_n_s_KMOD_NONE; PyObject *__pyx_n_s_KMOD_NUM; PyObject *__pyx_n_s_KMOD_RALT; PyObject *__pyx_n_s_KMOD_RCTRL; PyObject *__pyx_n_s_KMOD_RGUI; PyObject *__pyx_n_s_KMOD_RMETA; PyObject *__pyx_n_s_KMOD_RSHIFT; PyObject *__pyx_n_s_KMOD_SHIFT; PyObject *__pyx_n_s_K_0; PyObject *__pyx_n_s_K_1; PyObject *__pyx_n_s_K_2; PyObject *__pyx_n_s_K_3; PyObject *__pyx_n_s_K_4; PyObject *__pyx_n_s_K_5; PyObject *__pyx_n_s_K_6; PyObject *__pyx_n_s_K_7; PyObject *__pyx_n_s_K_8; PyObject *__pyx_n_s_K_9; PyObject *__pyx_n_s_K_AC_BACK; PyObject *__pyx_n_s_K_AC_BOOKMARKS; PyObject *__pyx_n_s_K_AC_FORWARD; PyObject *__pyx_n_s_K_AC_HOME; PyObject *__pyx_n_s_K_AC_REFRESH; PyObject *__pyx_n_s_K_AC_SEARCH; PyObject *__pyx_n_s_K_AC_STOP; PyObject *__pyx_n_s_K_AGAIN; PyObject *__pyx_n_s_K_ALTERASE; PyObject *__pyx_n_s_K_AMPERSAND; PyObject *__pyx_n_s_K_APP1; PyObject *__pyx_n_s_K_APP2; PyObject *__pyx_n_s_K_APPLICATION; PyObject *__pyx_n_s_K_ASTERISK; PyObject *__pyx_n_s_K_AT; PyObject *__pyx_n_s_K_AUDIOFASTFORWARD; PyObject *__pyx_n_s_K_AUDIOMUTE; PyObject *__pyx_n_s_K_AUDIONEXT; PyObject *__pyx_n_s_K_AUDIOPLAY; PyObject *__pyx_n_s_K_AUDIOPREV; PyObject *__pyx_n_s_K_AUDIOREWIND; PyObject *__pyx_n_s_K_AUDIOSTOP; PyObject *__pyx_n_s_K_BACKQUOTE; PyObject *__pyx_n_s_K_BACKSLASH; PyObject *__pyx_n_s_K_BACKSPACE; PyObject *__pyx_n_s_K_BREAK; PyObject *__pyx_n_s_K_BRIGHTNESSDOWN; PyObject *__pyx_n_s_K_BRIGHTNESSUP; PyObject *__pyx_n_s_K_CALCULATOR; PyObject *__pyx_n_s_K_CANCEL; PyObject *__pyx_n_s_K_CAPSLOCK; PyObject *__pyx_n_s_K_CARET; PyObject *__pyx_n_s_K_CLEAR; PyObject *__pyx_n_s_K_CLEARAGAIN; PyObject *__pyx_n_s_K_COLON; PyObject *__pyx_n_s_K_COMMA; PyObject *__pyx_n_s_K_COMPUTER; PyObject *__pyx_n_s_K_COPY; PyObject *__pyx_n_s_K_CRSEL; PyObject *__pyx_n_s_K_CURRENCYSUBUNIT; PyObject *__pyx_n_s_K_CURRENCYUNIT; PyObject *__pyx_n_s_K_CUT; PyObject *__pyx_n_s_K_DECIMALSEPARATOR; PyObject *__pyx_n_s_K_DELETE; PyObject *__pyx_n_s_K_DISPLAYSWITCH; PyObject *__pyx_n_s_K_DOLLAR; PyObject *__pyx_n_s_K_DOWN; PyObject *__pyx_n_s_K_EJECT; PyObject *__pyx_n_s_K_END; PyObject *__pyx_n_s_K_EQUALS; PyObject *__pyx_n_s_K_ESCAPE; PyObject *__pyx_n_s_K_EURO; PyObject *__pyx_n_s_K_EXCLAIM; PyObject *__pyx_n_s_K_EXECUTE; PyObject *__pyx_n_s_K_EXSEL; PyObject *__pyx_n_s_K_F1; PyObject *__pyx_n_s_K_F10; PyObject *__pyx_n_s_K_F11; PyObject *__pyx_n_s_K_F12; PyObject *__pyx_n_s_K_F13; PyObject *__pyx_n_s_K_F14; PyObject *__pyx_n_s_K_F15; PyObject *__pyx_n_s_K_F16; PyObject *__pyx_n_s_K_F17; PyObject *__pyx_n_s_K_F18; PyObject *__pyx_n_s_K_F19; PyObject *__pyx_n_s_K_F2; PyObject *__pyx_n_s_K_F20; PyObject *__pyx_n_s_K_F21; PyObject *__pyx_n_s_K_F22; PyObject *__pyx_n_s_K_F23; PyObject *__pyx_n_s_K_F24; PyObject *__pyx_n_s_K_F3; PyObject *__pyx_n_s_K_F4; PyObject *__pyx_n_s_K_F5; PyObject *__pyx_n_s_K_F6; PyObject *__pyx_n_s_K_F7; PyObject *__pyx_n_s_K_F8; PyObject *__pyx_n_s_K_F9; PyObject *__pyx_n_s_K_FIND; PyObject *__pyx_n_s_K_FIRST; PyObject *__pyx_n_s_K_GREATER; PyObject *__pyx_n_s_K_HASH; PyObject *__pyx_n_s_K_HELP; PyObject *__pyx_n_s_K_HOME; PyObject *__pyx_n_s_K_INSERT; PyObject *__pyx_n_s_K_KBDILLUMDOWN; PyObject *__pyx_n_s_K_KBDILLUMTOGGLE; PyObject *__pyx_n_s_K_KBDILLUMUP; PyObject *__pyx_n_s_K_KP0; PyObject *__pyx_n_s_K_KP1; PyObject *__pyx_n_s_K_KP2; PyObject *__pyx_n_s_K_KP3; PyObject *__pyx_n_s_K_KP4; PyObject *__pyx_n_s_K_KP5; PyObject *__pyx_n_s_K_KP6; PyObject *__pyx_n_s_K_KP7; PyObject *__pyx_n_s_K_KP8; PyObject *__pyx_n_s_K_KP9; PyObject *__pyx_n_s_K_KP_0; PyObject *__pyx_n_s_K_KP_00; PyObject *__pyx_n_s_K_KP_000; PyObject *__pyx_n_s_K_KP_1; PyObject *__pyx_n_s_K_KP_2; PyObject *__pyx_n_s_K_KP_3; PyObject *__pyx_n_s_K_KP_4; PyObject *__pyx_n_s_K_KP_5; PyObject *__pyx_n_s_K_KP_6; PyObject *__pyx_n_s_K_KP_7; PyObject *__pyx_n_s_K_KP_8; PyObject *__pyx_n_s_K_KP_9; PyObject *__pyx_n_s_K_KP_A; PyObject *__pyx_n_s_K_KP_AMPERSAND; PyObject *__pyx_n_s_K_KP_AT; PyObject *__pyx_n_s_K_KP_B; PyObject *__pyx_n_s_K_KP_BACKSPACE; PyObject *__pyx_n_s_K_KP_BINARY; PyObject *__pyx_n_s_K_KP_C; PyObject *__pyx_n_s_K_KP_CLEAR; PyObject *__pyx_n_s_K_KP_CLEARENTRY; PyObject *__pyx_n_s_K_KP_COLON; PyObject *__pyx_n_s_K_KP_COMMA; PyObject *__pyx_n_s_K_KP_D; PyObject *__pyx_n_s_K_KP_DBLAMPERSAND; PyObject *__pyx_n_s_K_KP_DBLVERTICALBAR; PyObject *__pyx_n_s_K_KP_DECIMAL; PyObject *__pyx_n_s_K_KP_DIVIDE; PyObject *__pyx_n_s_K_KP_E; PyObject *__pyx_n_s_K_KP_ENTER; PyObject *__pyx_n_s_K_KP_EQUALS; PyObject *__pyx_n_s_K_KP_EQUALSAS400; PyObject *__pyx_n_s_K_KP_EXCLAM; PyObject *__pyx_n_s_K_KP_F; PyObject *__pyx_n_s_K_KP_GREATER; PyObject *__pyx_n_s_K_KP_HASH; PyObject *__pyx_n_s_K_KP_HEXADECIMAL; PyObject *__pyx_n_s_K_KP_LEFTBRACE; PyObject *__pyx_n_s_K_KP_LEFTPAREN; PyObject *__pyx_n_s_K_KP_LESS; PyObject *__pyx_n_s_K_KP_MEMADD; PyObject *__pyx_n_s_K_KP_MEMCLEAR; PyObject *__pyx_n_s_K_KP_MEMDIVIDE; PyObject *__pyx_n_s_K_KP_MEMMULTIPLY; PyObject *__pyx_n_s_K_KP_MEMRECALL; PyObject *__pyx_n_s_K_KP_MEMSTORE; PyObject *__pyx_n_s_K_KP_MEMSUBTRACT; PyObject *__pyx_n_s_K_KP_MINUS; PyObject *__pyx_n_s_K_KP_MULTIPLY; PyObject *__pyx_n_s_K_KP_OCTAL; PyObject *__pyx_n_s_K_KP_PERCENT; PyObject *__pyx_n_s_K_KP_PERIOD; PyObject *__pyx_n_s_K_KP_PLUS; PyObject *__pyx_n_s_K_KP_PLUSMINUS; PyObject *__pyx_n_s_K_KP_POWER; PyObject *__pyx_n_s_K_KP_RIGHTBRACE; PyObject *__pyx_n_s_K_KP_RIGHTPAREN; PyObject *__pyx_n_s_K_KP_SPACE; PyObject *__pyx_n_s_K_KP_TAB; PyObject *__pyx_n_s_K_KP_VERTICALBAR; PyObject *__pyx_n_s_K_KP_XOR; PyObject *__pyx_n_s_K_LALT; PyObject *__pyx_n_s_K_LAST; PyObject *__pyx_n_s_K_LCTRL; PyObject *__pyx_n_s_K_LEFT; PyObject *__pyx_n_s_K_LEFTBRACKET; PyObject *__pyx_n_s_K_LEFTPAREN; PyObject *__pyx_n_s_K_LESS; PyObject *__pyx_n_s_K_LGUI; PyObject *__pyx_n_s_K_LMETA; PyObject *__pyx_n_s_K_LSHIFT; PyObject *__pyx_n_s_K_LSUPER; PyObject *__pyx_n_s_K_MAIL; PyObject *__pyx_n_s_K_MEDIASELECT; PyObject *__pyx_n_s_K_MENU; PyObject *__pyx_n_s_K_MINUS; PyObject *__pyx_n_s_K_MODE; PyObject *__pyx_n_s_K_MUTE; PyObject *__pyx_n_s_K_NUMLOCK; PyObject *__pyx_n_s_K_NUMLOCKCLEAR; PyObject *__pyx_n_s_K_OPER; PyObject *__pyx_n_s_K_OUT; PyObject *__pyx_n_s_K_PAGEDOWN; PyObject *__pyx_n_s_K_PAGEUP; PyObject *__pyx_n_s_K_PASTE; PyObject *__pyx_n_s_K_PAUSE; PyObject *__pyx_n_s_K_PERCENT; PyObject *__pyx_n_s_K_PERIOD; PyObject *__pyx_n_s_K_PLUS; PyObject *__pyx_n_s_K_POWER; PyObject *__pyx_n_s_K_PRINT; PyObject *__pyx_n_s_K_PRINTSCREEN; PyObject *__pyx_n_s_K_PRIOR; PyObject *__pyx_n_s_K_QUESTION; PyObject *__pyx_n_s_K_QUOTE; PyObject *__pyx_n_s_K_QUOTEDBL; PyObject *__pyx_n_s_K_RALT; PyObject *__pyx_n_s_K_RCTRL; PyObject *__pyx_n_s_K_RETURN; PyObject *__pyx_n_s_K_RETURN2; PyObject *__pyx_n_s_K_RGUI; PyObject *__pyx_n_s_K_RIGHT; PyObject *__pyx_n_s_K_RIGHTBRACKET; PyObject *__pyx_n_s_K_RIGHTPAREN; PyObject *__pyx_n_s_K_RMETA; PyObject *__pyx_n_s_K_RSHIFT; PyObject *__pyx_n_s_K_RSUPER; PyObject *__pyx_n_s_K_SCROLLLOCK; PyObject *__pyx_n_s_K_SCROLLOCK; PyObject *__pyx_n_s_K_SELECT; PyObject *__pyx_n_s_K_SEMICOLON; PyObject *__pyx_n_s_K_SEPARATOR; PyObject *__pyx_n_s_K_SLASH; PyObject *__pyx_n_s_K_SLEEP; PyObject *__pyx_n_s_K_SPACE; PyObject *__pyx_n_s_K_STOP; PyObject *__pyx_n_s_K_SYSREQ; PyObject *__pyx_n_s_K_TAB; PyObject *__pyx_n_s_K_THOUSANDSSEPARATOR; PyObject *__pyx_n_s_K_UNDERSCORE; PyObject *__pyx_n_s_K_UNDO; PyObject *__pyx_n_s_K_UNKNOWN; PyObject *__pyx_n_s_K_UP; PyObject *__pyx_n_s_K_VOLUMEDOWN; PyObject *__pyx_n_s_K_VOLUMEUP; PyObject *__pyx_n_s_K_WWW; PyObject *__pyx_n_s_K_a; PyObject *__pyx_n_s_K_b; PyObject *__pyx_n_s_K_c; PyObject *__pyx_n_s_K_d; PyObject *__pyx_n_s_K_e; PyObject *__pyx_n_s_K_f; PyObject *__pyx_n_s_K_g; PyObject *__pyx_n_s_K_h; PyObject *__pyx_n_s_K_i; PyObject *__pyx_n_s_K_j; PyObject *__pyx_n_s_K_k; PyObject *__pyx_n_s_K_l; PyObject *__pyx_n_s_K_m; PyObject *__pyx_n_s_K_n; PyObject *__pyx_n_s_K_o; PyObject *__pyx_n_s_K_p; PyObject *__pyx_n_s_K_q; PyObject *__pyx_n_s_K_r; PyObject *__pyx_n_s_K_s; PyObject *__pyx_n_s_K_t; PyObject *__pyx_n_s_K_u; PyObject *__pyx_n_s_K_v; PyObject *__pyx_n_s_K_w; PyObject *__pyx_n_s_K_x; PyObject *__pyx_n_s_K_y; PyObject *__pyx_n_s_K_z; PyObject *__pyx_n_s_LASTEVENT; PyObject *__pyx_n_s_LIL_ENDIAN; PyObject *__pyx_n_s_MOUSEBUTTONDOWN; PyObject *__pyx_n_s_MOUSEBUTTONUP; PyObject *__pyx_n_s_MOUSEMOTION; PyObject *__pyx_n_s_MOUSEWHEEL; PyObject *__pyx_n_s_MULTIGESTURE; PyObject *__pyx_n_s_NOEVENT; PyObject *__pyx_n_s_NOFRAME; PyObject *__pyx_n_s_OPENGL; PyObject *__pyx_n_s_POWERSTATE_CHARGED; PyObject *__pyx_n_s_POWERSTATE_CHARGING; PyObject *__pyx_n_s_POWERSTATE_NO_BATTERY; PyObject *__pyx_n_s_POWERSTATE_ON_BATTERY; PyObject *__pyx_n_s_POWERSTATE_UNKNOWN; PyObject *__pyx_n_s_QUIT; PyObject *__pyx_n_s_RENDER_DEVICE_RESET; PyObject *__pyx_n_s_RENDER_TARGETS_RESET; PyObject *__pyx_n_s_RESIZABLE; PyObject *__pyx_n_s_RLEACCEL; PyObject *__pyx_n_s_Rect; PyObject *__pyx_n_s_SCRAP_TEXT; PyObject *__pyx_n_s_SDL_VERSION_TUPLE; PyObject *__pyx_n_s_SENSORUPDATE; PyObject *__pyx_n_s_SRCALPHA; PyObject *__pyx_n_s_SRCCOLORKEY; PyObject *__pyx_n_s_SWSURFACE; PyObject *__pyx_n_s_SYSWMEVENT; PyObject *__pyx_n_s_TEXTEDITING; PyObject *__pyx_n_s_TEXTINPUT; PyObject *__pyx_n_s_TOUCH_MOUSEID; PyObject *__pyx_n_s_USEREVENT; PyObject *__pyx_n_s_VIDEOEXPOSE; PyObject *__pyx_n_s_VIDEORESIZE; PyObject *__pyx_n_s_WINDOWEVENT; PyObject *__pyx_n_s_WINDOWMOVED; PyObject *__pyx_n_s_WINDOWPOS_CENTERED; PyObject *__pyx_n_s_WINDOWPOS_UNDEFINED; PyObject *__pyx_n_s_WINDOW_ALLOW_HIGHDPI; PyObject *__pyx_n_s_WINDOW_BORDERLESS; PyObject *__pyx_n_s_WINDOW_FOREIGN; PyObject *__pyx_n_s_WINDOW_FULLSCREEN; PyObject *__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP; PyObject *__pyx_n_s_WINDOW_HIDDEN; PyObject *__pyx_n_s_WINDOW_INPUT_FOCUS; PyObject *__pyx_n_s_WINDOW_INPUT_GRABBED; PyObject *__pyx_n_s_WINDOW_MAXIMIZED; PyObject *__pyx_n_s_WINDOW_MINIMIZED; PyObject *__pyx_n_s_WINDOW_NOFRAME; PyObject *__pyx_n_s_WINDOW_OPENGL; PyObject *__pyx_n_s_WINDOW_RESIZABLE; PyObject *__pyx_n_s_WINDOW_SHOWN; PyObject *__pyx_n_s__2; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_pygame_sdl2_color; PyObject *__pyx_n_s_pygame_sdl2_rect; PyObject *__pyx_n_s_test; PyObject *__pyx_kp_s_text_plain; PyObject *__pyx_n_s_update; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_2; PyObject *__pyx_int_3; PyObject *__pyx_int_4; PyObject *__pyx_int_5; PyObject *__pyx_int_6; PyObject *__pyx_int_7; PyObject *__pyx_int_8; PyObject *__pyx_int_9; PyObject *__pyx_int_16; PyObject *__pyx_int_17; PyObject *__pyx_int_1073741824; PyObject *__pyx_int_2147483648; PyObject *__pyx_int_neg_1; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_n_s_ACTIVEEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_APP_DIDENTERBACKGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_APP_DIDENTERFOREGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_APP_LOWMEMORY); Py_CLEAR(clear_module_state->__pyx_n_s_APP_TERMINATING); Py_CLEAR(clear_module_state->__pyx_n_s_APP_WILLENTERBACKGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_APP_WILLENTERFOREGROUND); Py_CLEAR(clear_module_state->__pyx_n_s_AUDIODEVICEADDED); Py_CLEAR(clear_module_state->__pyx_n_s_AUDIODEVICEREMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_BIG_ENDIAN); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_ADD); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_MIN); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_MULT); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_PREMULTIPLIED); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGBA_ADD); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGBA_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGBA_MIN); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGBA_MULT); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGBA_SUB); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGB_ADD); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGB_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGB_MIN); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGB_MULT); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_RGB_SUB); Py_CLEAR(clear_module_state->__pyx_n_s_BLEND_SUB); Py_CLEAR(clear_module_state->__pyx_n_s_BYTEORDER); Py_CLEAR(clear_module_state->__pyx_n_s_CLIPBOARDUPDATE); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERAXISMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERBUTTONDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERBUTTONUP); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERDEVICEADDED); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERDEVICEREMAPPED); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLERDEVICEREMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_INVALID); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_LEFTX); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_LEFTY); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_RIGHTX); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_RIGHTY); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_A); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_B); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_BACK); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_GUIDE); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_INVALID); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_MAX); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_START); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_X); Py_CLEAR(clear_module_state->__pyx_n_s_CONTROLLER_BUTTON_Y); Py_CLEAR(clear_module_state->__pyx_n_s_Color); Py_CLEAR(clear_module_state->__pyx_n_s_DISPLAYEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_DOLLARGESTURE); Py_CLEAR(clear_module_state->__pyx_n_s_DOLLARRECORD); Py_CLEAR(clear_module_state->__pyx_n_s_DOUBLEBUF); Py_CLEAR(clear_module_state->__pyx_n_s_DROPBEGIN); Py_CLEAR(clear_module_state->__pyx_n_s_DROPCOMPLETE); Py_CLEAR(clear_module_state->__pyx_n_s_DROPFILE); Py_CLEAR(clear_module_state->__pyx_n_s_DROPTEXT); Py_CLEAR(clear_module_state->__pyx_n_s_FINGERDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_FINGERMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_FINGERUP); Py_CLEAR(clear_module_state->__pyx_n_s_FULLSCREEN); Py_CLEAR(clear_module_state->__pyx_n_s_GL_ACCELERATED_VISUAL); Py_CLEAR(clear_module_state->__pyx_n_s_GL_ACCUM_ALPHA_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_ACCUM_BLUE_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_ACCUM_GREEN_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_ACCUM_RED_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_ALPHA_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_BLUE_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_BUFFER_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_EGL); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_FLAGS); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_MAJOR_VERSION); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_MINOR_VERSION); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_NO_ERROR); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_CORE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_ES); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_MASK); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR); Py_CLEAR(clear_module_state->__pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION); Py_CLEAR(clear_module_state->__pyx_n_s_GL_DEPTH_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_DOUBLEBUFFER); Py_CLEAR(clear_module_state->__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_GREEN_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_MULTISAMPLEBUFFERS); Py_CLEAR(clear_module_state->__pyx_n_s_GL_MULTISAMPLESAMPLES); Py_CLEAR(clear_module_state->__pyx_n_s_GL_RED_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_RETAINED_BACKING); Py_CLEAR(clear_module_state->__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT); Py_CLEAR(clear_module_state->__pyx_n_s_GL_STENCIL_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_GL_STEREO); Py_CLEAR(clear_module_state->__pyx_n_s_GL_SWAP_CONTROL); Py_CLEAR(clear_module_state->__pyx_n_s_HWSURFACE); Py_CLEAR(clear_module_state->__pyx_n_s_JOYAXISMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_JOYBALLMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_JOYBUTTONDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_JOYBUTTONUP); Py_CLEAR(clear_module_state->__pyx_n_s_JOYDEVICEADDED); Py_CLEAR(clear_module_state->__pyx_n_s_JOYDEVICEREMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_JOYHATMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_KEYDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_KEYMAPCHANGED); Py_CLEAR(clear_module_state->__pyx_n_s_KEYUP); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_ALT); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_CAPS); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_CTRL); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_GUI); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_LALT); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_LCTRL); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_LGUI); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_LMETA); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_LSHIFT); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_META); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_MODE); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_NONE); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_NUM); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_RALT); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_RCTRL); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_RGUI); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_RMETA); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_RSHIFT); Py_CLEAR(clear_module_state->__pyx_n_s_KMOD_SHIFT); Py_CLEAR(clear_module_state->__pyx_n_s_K_0); Py_CLEAR(clear_module_state->__pyx_n_s_K_1); Py_CLEAR(clear_module_state->__pyx_n_s_K_2); Py_CLEAR(clear_module_state->__pyx_n_s_K_3); Py_CLEAR(clear_module_state->__pyx_n_s_K_4); Py_CLEAR(clear_module_state->__pyx_n_s_K_5); Py_CLEAR(clear_module_state->__pyx_n_s_K_6); Py_CLEAR(clear_module_state->__pyx_n_s_K_7); Py_CLEAR(clear_module_state->__pyx_n_s_K_8); Py_CLEAR(clear_module_state->__pyx_n_s_K_9); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_BACK); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_BOOKMARKS); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_FORWARD); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_HOME); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_REFRESH); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_SEARCH); Py_CLEAR(clear_module_state->__pyx_n_s_K_AC_STOP); Py_CLEAR(clear_module_state->__pyx_n_s_K_AGAIN); Py_CLEAR(clear_module_state->__pyx_n_s_K_ALTERASE); Py_CLEAR(clear_module_state->__pyx_n_s_K_AMPERSAND); Py_CLEAR(clear_module_state->__pyx_n_s_K_APP1); Py_CLEAR(clear_module_state->__pyx_n_s_K_APP2); Py_CLEAR(clear_module_state->__pyx_n_s_K_APPLICATION); Py_CLEAR(clear_module_state->__pyx_n_s_K_ASTERISK); Py_CLEAR(clear_module_state->__pyx_n_s_K_AT); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIOFASTFORWARD); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIOMUTE); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIONEXT); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIOPLAY); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIOPREV); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIOREWIND); Py_CLEAR(clear_module_state->__pyx_n_s_K_AUDIOSTOP); Py_CLEAR(clear_module_state->__pyx_n_s_K_BACKQUOTE); Py_CLEAR(clear_module_state->__pyx_n_s_K_BACKSLASH); Py_CLEAR(clear_module_state->__pyx_n_s_K_BACKSPACE); Py_CLEAR(clear_module_state->__pyx_n_s_K_BREAK); Py_CLEAR(clear_module_state->__pyx_n_s_K_BRIGHTNESSDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_K_BRIGHTNESSUP); Py_CLEAR(clear_module_state->__pyx_n_s_K_CALCULATOR); Py_CLEAR(clear_module_state->__pyx_n_s_K_CANCEL); Py_CLEAR(clear_module_state->__pyx_n_s_K_CAPSLOCK); Py_CLEAR(clear_module_state->__pyx_n_s_K_CARET); Py_CLEAR(clear_module_state->__pyx_n_s_K_CLEAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_CLEARAGAIN); Py_CLEAR(clear_module_state->__pyx_n_s_K_COLON); Py_CLEAR(clear_module_state->__pyx_n_s_K_COMMA); Py_CLEAR(clear_module_state->__pyx_n_s_K_COMPUTER); Py_CLEAR(clear_module_state->__pyx_n_s_K_COPY); Py_CLEAR(clear_module_state->__pyx_n_s_K_CRSEL); Py_CLEAR(clear_module_state->__pyx_n_s_K_CURRENCYSUBUNIT); Py_CLEAR(clear_module_state->__pyx_n_s_K_CURRENCYUNIT); Py_CLEAR(clear_module_state->__pyx_n_s_K_CUT); Py_CLEAR(clear_module_state->__pyx_n_s_K_DECIMALSEPARATOR); Py_CLEAR(clear_module_state->__pyx_n_s_K_DELETE); Py_CLEAR(clear_module_state->__pyx_n_s_K_DISPLAYSWITCH); Py_CLEAR(clear_module_state->__pyx_n_s_K_DOLLAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_DOWN); Py_CLEAR(clear_module_state->__pyx_n_s_K_EJECT); Py_CLEAR(clear_module_state->__pyx_n_s_K_END); Py_CLEAR(clear_module_state->__pyx_n_s_K_EQUALS); Py_CLEAR(clear_module_state->__pyx_n_s_K_ESCAPE); Py_CLEAR(clear_module_state->__pyx_n_s_K_EURO); Py_CLEAR(clear_module_state->__pyx_n_s_K_EXCLAIM); Py_CLEAR(clear_module_state->__pyx_n_s_K_EXECUTE); Py_CLEAR(clear_module_state->__pyx_n_s_K_EXSEL); Py_CLEAR(clear_module_state->__pyx_n_s_K_F1); Py_CLEAR(clear_module_state->__pyx_n_s_K_F10); Py_CLEAR(clear_module_state->__pyx_n_s_K_F11); Py_CLEAR(clear_module_state->__pyx_n_s_K_F12); Py_CLEAR(clear_module_state->__pyx_n_s_K_F13); Py_CLEAR(clear_module_state->__pyx_n_s_K_F14); Py_CLEAR(clear_module_state->__pyx_n_s_K_F15); Py_CLEAR(clear_module_state->__pyx_n_s_K_F16); Py_CLEAR(clear_module_state->__pyx_n_s_K_F17); Py_CLEAR(clear_module_state->__pyx_n_s_K_F18); Py_CLEAR(clear_module_state->__pyx_n_s_K_F19); Py_CLEAR(clear_module_state->__pyx_n_s_K_F2); Py_CLEAR(clear_module_state->__pyx_n_s_K_F20); Py_CLEAR(clear_module_state->__pyx_n_s_K_F21); Py_CLEAR(clear_module_state->__pyx_n_s_K_F22); Py_CLEAR(clear_module_state->__pyx_n_s_K_F23); Py_CLEAR(clear_module_state->__pyx_n_s_K_F24); Py_CLEAR(clear_module_state->__pyx_n_s_K_F3); Py_CLEAR(clear_module_state->__pyx_n_s_K_F4); Py_CLEAR(clear_module_state->__pyx_n_s_K_F5); Py_CLEAR(clear_module_state->__pyx_n_s_K_F6); Py_CLEAR(clear_module_state->__pyx_n_s_K_F7); Py_CLEAR(clear_module_state->__pyx_n_s_K_F8); Py_CLEAR(clear_module_state->__pyx_n_s_K_F9); Py_CLEAR(clear_module_state->__pyx_n_s_K_FIND); Py_CLEAR(clear_module_state->__pyx_n_s_K_FIRST); Py_CLEAR(clear_module_state->__pyx_n_s_K_GREATER); Py_CLEAR(clear_module_state->__pyx_n_s_K_HASH); Py_CLEAR(clear_module_state->__pyx_n_s_K_HELP); Py_CLEAR(clear_module_state->__pyx_n_s_K_HOME); Py_CLEAR(clear_module_state->__pyx_n_s_K_INSERT); Py_CLEAR(clear_module_state->__pyx_n_s_K_KBDILLUMDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_K_KBDILLUMTOGGLE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KBDILLUMUP); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP0); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP1); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP2); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP3); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP4); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP5); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP6); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP7); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP8); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP9); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_0); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_00); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_000); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_1); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_2); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_3); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_4); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_5); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_6); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_7); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_8); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_9); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_A); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_AMPERSAND); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_AT); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_B); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_BACKSPACE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_BINARY); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_C); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_CLEAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_CLEARENTRY); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_COLON); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_COMMA); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_D); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_DBLAMPERSAND); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_DBLVERTICALBAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_DECIMAL); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_DIVIDE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_E); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_ENTER); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_EQUALS); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_EQUALSAS400); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_EXCLAM); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_F); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_GREATER); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_HASH); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_HEXADECIMAL); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_LEFTBRACE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_LEFTPAREN); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_LESS); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMADD); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMCLEAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMDIVIDE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMMULTIPLY); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMRECALL); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMSTORE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MEMSUBTRACT); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MINUS); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_MULTIPLY); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_OCTAL); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_PERCENT); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_PERIOD); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_PLUS); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_PLUSMINUS); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_POWER); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_RIGHTBRACE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_RIGHTPAREN); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_SPACE); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_TAB); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_VERTICALBAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_KP_XOR); Py_CLEAR(clear_module_state->__pyx_n_s_K_LALT); Py_CLEAR(clear_module_state->__pyx_n_s_K_LAST); Py_CLEAR(clear_module_state->__pyx_n_s_K_LCTRL); Py_CLEAR(clear_module_state->__pyx_n_s_K_LEFT); Py_CLEAR(clear_module_state->__pyx_n_s_K_LEFTBRACKET); Py_CLEAR(clear_module_state->__pyx_n_s_K_LEFTPAREN); Py_CLEAR(clear_module_state->__pyx_n_s_K_LESS); Py_CLEAR(clear_module_state->__pyx_n_s_K_LGUI); Py_CLEAR(clear_module_state->__pyx_n_s_K_LMETA); Py_CLEAR(clear_module_state->__pyx_n_s_K_LSHIFT); Py_CLEAR(clear_module_state->__pyx_n_s_K_LSUPER); Py_CLEAR(clear_module_state->__pyx_n_s_K_MAIL); Py_CLEAR(clear_module_state->__pyx_n_s_K_MEDIASELECT); Py_CLEAR(clear_module_state->__pyx_n_s_K_MENU); Py_CLEAR(clear_module_state->__pyx_n_s_K_MINUS); Py_CLEAR(clear_module_state->__pyx_n_s_K_MODE); Py_CLEAR(clear_module_state->__pyx_n_s_K_MUTE); Py_CLEAR(clear_module_state->__pyx_n_s_K_NUMLOCK); Py_CLEAR(clear_module_state->__pyx_n_s_K_NUMLOCKCLEAR); Py_CLEAR(clear_module_state->__pyx_n_s_K_OPER); Py_CLEAR(clear_module_state->__pyx_n_s_K_OUT); Py_CLEAR(clear_module_state->__pyx_n_s_K_PAGEDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_K_PAGEUP); Py_CLEAR(clear_module_state->__pyx_n_s_K_PASTE); Py_CLEAR(clear_module_state->__pyx_n_s_K_PAUSE); Py_CLEAR(clear_module_state->__pyx_n_s_K_PERCENT); Py_CLEAR(clear_module_state->__pyx_n_s_K_PERIOD); Py_CLEAR(clear_module_state->__pyx_n_s_K_PLUS); Py_CLEAR(clear_module_state->__pyx_n_s_K_POWER); Py_CLEAR(clear_module_state->__pyx_n_s_K_PRINT); Py_CLEAR(clear_module_state->__pyx_n_s_K_PRINTSCREEN); Py_CLEAR(clear_module_state->__pyx_n_s_K_PRIOR); Py_CLEAR(clear_module_state->__pyx_n_s_K_QUESTION); Py_CLEAR(clear_module_state->__pyx_n_s_K_QUOTE); Py_CLEAR(clear_module_state->__pyx_n_s_K_QUOTEDBL); Py_CLEAR(clear_module_state->__pyx_n_s_K_RALT); Py_CLEAR(clear_module_state->__pyx_n_s_K_RCTRL); Py_CLEAR(clear_module_state->__pyx_n_s_K_RETURN); Py_CLEAR(clear_module_state->__pyx_n_s_K_RETURN2); Py_CLEAR(clear_module_state->__pyx_n_s_K_RGUI); Py_CLEAR(clear_module_state->__pyx_n_s_K_RIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_K_RIGHTBRACKET); Py_CLEAR(clear_module_state->__pyx_n_s_K_RIGHTPAREN); Py_CLEAR(clear_module_state->__pyx_n_s_K_RMETA); Py_CLEAR(clear_module_state->__pyx_n_s_K_RSHIFT); Py_CLEAR(clear_module_state->__pyx_n_s_K_RSUPER); Py_CLEAR(clear_module_state->__pyx_n_s_K_SCROLLLOCK); Py_CLEAR(clear_module_state->__pyx_n_s_K_SCROLLOCK); Py_CLEAR(clear_module_state->__pyx_n_s_K_SELECT); Py_CLEAR(clear_module_state->__pyx_n_s_K_SEMICOLON); Py_CLEAR(clear_module_state->__pyx_n_s_K_SEPARATOR); Py_CLEAR(clear_module_state->__pyx_n_s_K_SLASH); Py_CLEAR(clear_module_state->__pyx_n_s_K_SLEEP); Py_CLEAR(clear_module_state->__pyx_n_s_K_SPACE); Py_CLEAR(clear_module_state->__pyx_n_s_K_STOP); Py_CLEAR(clear_module_state->__pyx_n_s_K_SYSREQ); Py_CLEAR(clear_module_state->__pyx_n_s_K_TAB); Py_CLEAR(clear_module_state->__pyx_n_s_K_THOUSANDSSEPARATOR); Py_CLEAR(clear_module_state->__pyx_n_s_K_UNDERSCORE); Py_CLEAR(clear_module_state->__pyx_n_s_K_UNDO); Py_CLEAR(clear_module_state->__pyx_n_s_K_UNKNOWN); Py_CLEAR(clear_module_state->__pyx_n_s_K_UP); Py_CLEAR(clear_module_state->__pyx_n_s_K_VOLUMEDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_K_VOLUMEUP); Py_CLEAR(clear_module_state->__pyx_n_s_K_WWW); Py_CLEAR(clear_module_state->__pyx_n_s_K_a); Py_CLEAR(clear_module_state->__pyx_n_s_K_b); Py_CLEAR(clear_module_state->__pyx_n_s_K_c); Py_CLEAR(clear_module_state->__pyx_n_s_K_d); Py_CLEAR(clear_module_state->__pyx_n_s_K_e); Py_CLEAR(clear_module_state->__pyx_n_s_K_f); Py_CLEAR(clear_module_state->__pyx_n_s_K_g); Py_CLEAR(clear_module_state->__pyx_n_s_K_h); Py_CLEAR(clear_module_state->__pyx_n_s_K_i); Py_CLEAR(clear_module_state->__pyx_n_s_K_j); Py_CLEAR(clear_module_state->__pyx_n_s_K_k); Py_CLEAR(clear_module_state->__pyx_n_s_K_l); Py_CLEAR(clear_module_state->__pyx_n_s_K_m); Py_CLEAR(clear_module_state->__pyx_n_s_K_n); Py_CLEAR(clear_module_state->__pyx_n_s_K_o); Py_CLEAR(clear_module_state->__pyx_n_s_K_p); Py_CLEAR(clear_module_state->__pyx_n_s_K_q); Py_CLEAR(clear_module_state->__pyx_n_s_K_r); Py_CLEAR(clear_module_state->__pyx_n_s_K_s); Py_CLEAR(clear_module_state->__pyx_n_s_K_t); Py_CLEAR(clear_module_state->__pyx_n_s_K_u); Py_CLEAR(clear_module_state->__pyx_n_s_K_v); Py_CLEAR(clear_module_state->__pyx_n_s_K_w); Py_CLEAR(clear_module_state->__pyx_n_s_K_x); Py_CLEAR(clear_module_state->__pyx_n_s_K_y); Py_CLEAR(clear_module_state->__pyx_n_s_K_z); Py_CLEAR(clear_module_state->__pyx_n_s_LASTEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_LIL_ENDIAN); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEBUTTONDOWN); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEBUTTONUP); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEMOTION); Py_CLEAR(clear_module_state->__pyx_n_s_MOUSEWHEEL); Py_CLEAR(clear_module_state->__pyx_n_s_MULTIGESTURE); Py_CLEAR(clear_module_state->__pyx_n_s_NOEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_NOFRAME); Py_CLEAR(clear_module_state->__pyx_n_s_OPENGL); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_CHARGED); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_CHARGING); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_NO_BATTERY); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_ON_BATTERY); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_UNKNOWN); Py_CLEAR(clear_module_state->__pyx_n_s_QUIT); Py_CLEAR(clear_module_state->__pyx_n_s_RENDER_DEVICE_RESET); Py_CLEAR(clear_module_state->__pyx_n_s_RENDER_TARGETS_RESET); Py_CLEAR(clear_module_state->__pyx_n_s_RESIZABLE); Py_CLEAR(clear_module_state->__pyx_n_s_RLEACCEL); Py_CLEAR(clear_module_state->__pyx_n_s_Rect); Py_CLEAR(clear_module_state->__pyx_n_s_SCRAP_TEXT); Py_CLEAR(clear_module_state->__pyx_n_s_SDL_VERSION_TUPLE); Py_CLEAR(clear_module_state->__pyx_n_s_SENSORUPDATE); Py_CLEAR(clear_module_state->__pyx_n_s_SRCALPHA); Py_CLEAR(clear_module_state->__pyx_n_s_SRCCOLORKEY); Py_CLEAR(clear_module_state->__pyx_n_s_SWSURFACE); Py_CLEAR(clear_module_state->__pyx_n_s_SYSWMEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_TEXTEDITING); Py_CLEAR(clear_module_state->__pyx_n_s_TEXTINPUT); Py_CLEAR(clear_module_state->__pyx_n_s_TOUCH_MOUSEID); Py_CLEAR(clear_module_state->__pyx_n_s_USEREVENT); Py_CLEAR(clear_module_state->__pyx_n_s_VIDEOEXPOSE); Py_CLEAR(clear_module_state->__pyx_n_s_VIDEORESIZE); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOWEVENT); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOWMOVED); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOWPOS_CENTERED); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOWPOS_UNDEFINED); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_ALLOW_HIGHDPI); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_BORDERLESS); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_FOREIGN); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_FULLSCREEN); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_HIDDEN); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_INPUT_FOCUS); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_INPUT_GRABBED); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_MAXIMIZED); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_MINIMIZED); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_NOFRAME); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_OPENGL); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_RESIZABLE); Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_SHOWN); Py_CLEAR(clear_module_state->__pyx_n_s__2); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_color); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rect); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_kp_s_text_plain); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_3); Py_CLEAR(clear_module_state->__pyx_int_4); Py_CLEAR(clear_module_state->__pyx_int_5); Py_CLEAR(clear_module_state->__pyx_int_6); Py_CLEAR(clear_module_state->__pyx_int_7); Py_CLEAR(clear_module_state->__pyx_int_8); Py_CLEAR(clear_module_state->__pyx_int_9); Py_CLEAR(clear_module_state->__pyx_int_16); Py_CLEAR(clear_module_state->__pyx_int_17); Py_CLEAR(clear_module_state->__pyx_int_1073741824); Py_CLEAR(clear_module_state->__pyx_int_2147483648); Py_CLEAR(clear_module_state->__pyx_int_neg_1); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_n_s_ACTIVEEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_APP_DIDENTERBACKGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_APP_DIDENTERFOREGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_APP_LOWMEMORY); Py_VISIT(traverse_module_state->__pyx_n_s_APP_TERMINATING); Py_VISIT(traverse_module_state->__pyx_n_s_APP_WILLENTERBACKGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_APP_WILLENTERFOREGROUND); Py_VISIT(traverse_module_state->__pyx_n_s_AUDIODEVICEADDED); Py_VISIT(traverse_module_state->__pyx_n_s_AUDIODEVICEREMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_BIG_ENDIAN); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_ADD); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_MIN); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_MULT); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_PREMULTIPLIED); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGBA_ADD); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGBA_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGBA_MIN); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGBA_MULT); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGBA_SUB); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGB_ADD); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGB_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGB_MIN); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGB_MULT); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_RGB_SUB); Py_VISIT(traverse_module_state->__pyx_n_s_BLEND_SUB); Py_VISIT(traverse_module_state->__pyx_n_s_BYTEORDER); Py_VISIT(traverse_module_state->__pyx_n_s_CLIPBOARDUPDATE); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERAXISMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERBUTTONDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERBUTTONUP); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERDEVICEADDED); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERDEVICEREMAPPED); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLERDEVICEREMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_INVALID); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_LEFTX); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_LEFTY); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_RIGHTX); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_RIGHTY); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_A); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_B); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_BACK); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_GUIDE); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_INVALID); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_MAX); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_START); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_X); Py_VISIT(traverse_module_state->__pyx_n_s_CONTROLLER_BUTTON_Y); Py_VISIT(traverse_module_state->__pyx_n_s_Color); Py_VISIT(traverse_module_state->__pyx_n_s_DISPLAYEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_DOLLARGESTURE); Py_VISIT(traverse_module_state->__pyx_n_s_DOLLARRECORD); Py_VISIT(traverse_module_state->__pyx_n_s_DOUBLEBUF); Py_VISIT(traverse_module_state->__pyx_n_s_DROPBEGIN); Py_VISIT(traverse_module_state->__pyx_n_s_DROPCOMPLETE); Py_VISIT(traverse_module_state->__pyx_n_s_DROPFILE); Py_VISIT(traverse_module_state->__pyx_n_s_DROPTEXT); Py_VISIT(traverse_module_state->__pyx_n_s_FINGERDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_FINGERMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_FINGERUP); Py_VISIT(traverse_module_state->__pyx_n_s_FULLSCREEN); Py_VISIT(traverse_module_state->__pyx_n_s_GL_ACCELERATED_VISUAL); Py_VISIT(traverse_module_state->__pyx_n_s_GL_ACCUM_ALPHA_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_ACCUM_BLUE_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_ACCUM_GREEN_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_ACCUM_RED_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_ALPHA_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_BLUE_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_BUFFER_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_EGL); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_FLAGS); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_MAJOR_VERSION); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_MINOR_VERSION); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_NO_ERROR); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_CORE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_ES); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_PROFILE_MASK); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR); Py_VISIT(traverse_module_state->__pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION); Py_VISIT(traverse_module_state->__pyx_n_s_GL_DEPTH_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_DOUBLEBUFFER); Py_VISIT(traverse_module_state->__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_GREEN_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_MULTISAMPLEBUFFERS); Py_VISIT(traverse_module_state->__pyx_n_s_GL_MULTISAMPLESAMPLES); Py_VISIT(traverse_module_state->__pyx_n_s_GL_RED_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_RETAINED_BACKING); Py_VISIT(traverse_module_state->__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT); Py_VISIT(traverse_module_state->__pyx_n_s_GL_STENCIL_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_GL_STEREO); Py_VISIT(traverse_module_state->__pyx_n_s_GL_SWAP_CONTROL); Py_VISIT(traverse_module_state->__pyx_n_s_HWSURFACE); Py_VISIT(traverse_module_state->__pyx_n_s_JOYAXISMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_JOYBALLMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_JOYBUTTONDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_JOYBUTTONUP); Py_VISIT(traverse_module_state->__pyx_n_s_JOYDEVICEADDED); Py_VISIT(traverse_module_state->__pyx_n_s_JOYDEVICEREMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_JOYHATMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_KEYDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_KEYMAPCHANGED); Py_VISIT(traverse_module_state->__pyx_n_s_KEYUP); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_ALT); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_CAPS); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_CTRL); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_GUI); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_LALT); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_LCTRL); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_LGUI); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_LMETA); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_LSHIFT); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_META); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_MODE); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_NONE); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_NUM); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_RALT); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_RCTRL); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_RGUI); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_RMETA); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_RSHIFT); Py_VISIT(traverse_module_state->__pyx_n_s_KMOD_SHIFT); Py_VISIT(traverse_module_state->__pyx_n_s_K_0); Py_VISIT(traverse_module_state->__pyx_n_s_K_1); Py_VISIT(traverse_module_state->__pyx_n_s_K_2); Py_VISIT(traverse_module_state->__pyx_n_s_K_3); Py_VISIT(traverse_module_state->__pyx_n_s_K_4); Py_VISIT(traverse_module_state->__pyx_n_s_K_5); Py_VISIT(traverse_module_state->__pyx_n_s_K_6); Py_VISIT(traverse_module_state->__pyx_n_s_K_7); Py_VISIT(traverse_module_state->__pyx_n_s_K_8); Py_VISIT(traverse_module_state->__pyx_n_s_K_9); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_BACK); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_BOOKMARKS); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_FORWARD); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_HOME); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_REFRESH); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_SEARCH); Py_VISIT(traverse_module_state->__pyx_n_s_K_AC_STOP); Py_VISIT(traverse_module_state->__pyx_n_s_K_AGAIN); Py_VISIT(traverse_module_state->__pyx_n_s_K_ALTERASE); Py_VISIT(traverse_module_state->__pyx_n_s_K_AMPERSAND); Py_VISIT(traverse_module_state->__pyx_n_s_K_APP1); Py_VISIT(traverse_module_state->__pyx_n_s_K_APP2); Py_VISIT(traverse_module_state->__pyx_n_s_K_APPLICATION); Py_VISIT(traverse_module_state->__pyx_n_s_K_ASTERISK); Py_VISIT(traverse_module_state->__pyx_n_s_K_AT); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIOFASTFORWARD); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIOMUTE); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIONEXT); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIOPLAY); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIOPREV); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIOREWIND); Py_VISIT(traverse_module_state->__pyx_n_s_K_AUDIOSTOP); Py_VISIT(traverse_module_state->__pyx_n_s_K_BACKQUOTE); Py_VISIT(traverse_module_state->__pyx_n_s_K_BACKSLASH); Py_VISIT(traverse_module_state->__pyx_n_s_K_BACKSPACE); Py_VISIT(traverse_module_state->__pyx_n_s_K_BREAK); Py_VISIT(traverse_module_state->__pyx_n_s_K_BRIGHTNESSDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_K_BRIGHTNESSUP); Py_VISIT(traverse_module_state->__pyx_n_s_K_CALCULATOR); Py_VISIT(traverse_module_state->__pyx_n_s_K_CANCEL); Py_VISIT(traverse_module_state->__pyx_n_s_K_CAPSLOCK); Py_VISIT(traverse_module_state->__pyx_n_s_K_CARET); Py_VISIT(traverse_module_state->__pyx_n_s_K_CLEAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_CLEARAGAIN); Py_VISIT(traverse_module_state->__pyx_n_s_K_COLON); Py_VISIT(traverse_module_state->__pyx_n_s_K_COMMA); Py_VISIT(traverse_module_state->__pyx_n_s_K_COMPUTER); Py_VISIT(traverse_module_state->__pyx_n_s_K_COPY); Py_VISIT(traverse_module_state->__pyx_n_s_K_CRSEL); Py_VISIT(traverse_module_state->__pyx_n_s_K_CURRENCYSUBUNIT); Py_VISIT(traverse_module_state->__pyx_n_s_K_CURRENCYUNIT); Py_VISIT(traverse_module_state->__pyx_n_s_K_CUT); Py_VISIT(traverse_module_state->__pyx_n_s_K_DECIMALSEPARATOR); Py_VISIT(traverse_module_state->__pyx_n_s_K_DELETE); Py_VISIT(traverse_module_state->__pyx_n_s_K_DISPLAYSWITCH); Py_VISIT(traverse_module_state->__pyx_n_s_K_DOLLAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_DOWN); Py_VISIT(traverse_module_state->__pyx_n_s_K_EJECT); Py_VISIT(traverse_module_state->__pyx_n_s_K_END); Py_VISIT(traverse_module_state->__pyx_n_s_K_EQUALS); Py_VISIT(traverse_module_state->__pyx_n_s_K_ESCAPE); Py_VISIT(traverse_module_state->__pyx_n_s_K_EURO); Py_VISIT(traverse_module_state->__pyx_n_s_K_EXCLAIM); Py_VISIT(traverse_module_state->__pyx_n_s_K_EXECUTE); Py_VISIT(traverse_module_state->__pyx_n_s_K_EXSEL); Py_VISIT(traverse_module_state->__pyx_n_s_K_F1); Py_VISIT(traverse_module_state->__pyx_n_s_K_F10); Py_VISIT(traverse_module_state->__pyx_n_s_K_F11); Py_VISIT(traverse_module_state->__pyx_n_s_K_F12); Py_VISIT(traverse_module_state->__pyx_n_s_K_F13); Py_VISIT(traverse_module_state->__pyx_n_s_K_F14); Py_VISIT(traverse_module_state->__pyx_n_s_K_F15); Py_VISIT(traverse_module_state->__pyx_n_s_K_F16); Py_VISIT(traverse_module_state->__pyx_n_s_K_F17); Py_VISIT(traverse_module_state->__pyx_n_s_K_F18); Py_VISIT(traverse_module_state->__pyx_n_s_K_F19); Py_VISIT(traverse_module_state->__pyx_n_s_K_F2); Py_VISIT(traverse_module_state->__pyx_n_s_K_F20); Py_VISIT(traverse_module_state->__pyx_n_s_K_F21); Py_VISIT(traverse_module_state->__pyx_n_s_K_F22); Py_VISIT(traverse_module_state->__pyx_n_s_K_F23); Py_VISIT(traverse_module_state->__pyx_n_s_K_F24); Py_VISIT(traverse_module_state->__pyx_n_s_K_F3); Py_VISIT(traverse_module_state->__pyx_n_s_K_F4); Py_VISIT(traverse_module_state->__pyx_n_s_K_F5); Py_VISIT(traverse_module_state->__pyx_n_s_K_F6); Py_VISIT(traverse_module_state->__pyx_n_s_K_F7); Py_VISIT(traverse_module_state->__pyx_n_s_K_F8); Py_VISIT(traverse_module_state->__pyx_n_s_K_F9); Py_VISIT(traverse_module_state->__pyx_n_s_K_FIND); Py_VISIT(traverse_module_state->__pyx_n_s_K_FIRST); Py_VISIT(traverse_module_state->__pyx_n_s_K_GREATER); Py_VISIT(traverse_module_state->__pyx_n_s_K_HASH); Py_VISIT(traverse_module_state->__pyx_n_s_K_HELP); Py_VISIT(traverse_module_state->__pyx_n_s_K_HOME); Py_VISIT(traverse_module_state->__pyx_n_s_K_INSERT); Py_VISIT(traverse_module_state->__pyx_n_s_K_KBDILLUMDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_K_KBDILLUMTOGGLE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KBDILLUMUP); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP0); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP1); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP2); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP3); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP4); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP5); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP6); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP7); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP8); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP9); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_0); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_00); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_000); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_1); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_2); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_3); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_4); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_5); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_6); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_7); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_8); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_9); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_A); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_AMPERSAND); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_AT); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_B); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_BACKSPACE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_BINARY); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_C); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_CLEAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_CLEARENTRY); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_COLON); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_COMMA); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_D); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_DBLAMPERSAND); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_DBLVERTICALBAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_DECIMAL); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_DIVIDE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_E); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_ENTER); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_EQUALS); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_EQUALSAS400); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_EXCLAM); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_F); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_GREATER); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_HASH); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_HEXADECIMAL); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_LEFTBRACE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_LEFTPAREN); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_LESS); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMADD); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMCLEAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMDIVIDE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMMULTIPLY); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMRECALL); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMSTORE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MEMSUBTRACT); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MINUS); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_MULTIPLY); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_OCTAL); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_PERCENT); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_PERIOD); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_PLUS); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_PLUSMINUS); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_POWER); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_RIGHTBRACE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_RIGHTPAREN); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_SPACE); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_TAB); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_VERTICALBAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_KP_XOR); Py_VISIT(traverse_module_state->__pyx_n_s_K_LALT); Py_VISIT(traverse_module_state->__pyx_n_s_K_LAST); Py_VISIT(traverse_module_state->__pyx_n_s_K_LCTRL); Py_VISIT(traverse_module_state->__pyx_n_s_K_LEFT); Py_VISIT(traverse_module_state->__pyx_n_s_K_LEFTBRACKET); Py_VISIT(traverse_module_state->__pyx_n_s_K_LEFTPAREN); Py_VISIT(traverse_module_state->__pyx_n_s_K_LESS); Py_VISIT(traverse_module_state->__pyx_n_s_K_LGUI); Py_VISIT(traverse_module_state->__pyx_n_s_K_LMETA); Py_VISIT(traverse_module_state->__pyx_n_s_K_LSHIFT); Py_VISIT(traverse_module_state->__pyx_n_s_K_LSUPER); Py_VISIT(traverse_module_state->__pyx_n_s_K_MAIL); Py_VISIT(traverse_module_state->__pyx_n_s_K_MEDIASELECT); Py_VISIT(traverse_module_state->__pyx_n_s_K_MENU); Py_VISIT(traverse_module_state->__pyx_n_s_K_MINUS); Py_VISIT(traverse_module_state->__pyx_n_s_K_MODE); Py_VISIT(traverse_module_state->__pyx_n_s_K_MUTE); Py_VISIT(traverse_module_state->__pyx_n_s_K_NUMLOCK); Py_VISIT(traverse_module_state->__pyx_n_s_K_NUMLOCKCLEAR); Py_VISIT(traverse_module_state->__pyx_n_s_K_OPER); Py_VISIT(traverse_module_state->__pyx_n_s_K_OUT); Py_VISIT(traverse_module_state->__pyx_n_s_K_PAGEDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_K_PAGEUP); Py_VISIT(traverse_module_state->__pyx_n_s_K_PASTE); Py_VISIT(traverse_module_state->__pyx_n_s_K_PAUSE); Py_VISIT(traverse_module_state->__pyx_n_s_K_PERCENT); Py_VISIT(traverse_module_state->__pyx_n_s_K_PERIOD); Py_VISIT(traverse_module_state->__pyx_n_s_K_PLUS); Py_VISIT(traverse_module_state->__pyx_n_s_K_POWER); Py_VISIT(traverse_module_state->__pyx_n_s_K_PRINT); Py_VISIT(traverse_module_state->__pyx_n_s_K_PRINTSCREEN); Py_VISIT(traverse_module_state->__pyx_n_s_K_PRIOR); Py_VISIT(traverse_module_state->__pyx_n_s_K_QUESTION); Py_VISIT(traverse_module_state->__pyx_n_s_K_QUOTE); Py_VISIT(traverse_module_state->__pyx_n_s_K_QUOTEDBL); Py_VISIT(traverse_module_state->__pyx_n_s_K_RALT); Py_VISIT(traverse_module_state->__pyx_n_s_K_RCTRL); Py_VISIT(traverse_module_state->__pyx_n_s_K_RETURN); Py_VISIT(traverse_module_state->__pyx_n_s_K_RETURN2); Py_VISIT(traverse_module_state->__pyx_n_s_K_RGUI); Py_VISIT(traverse_module_state->__pyx_n_s_K_RIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_K_RIGHTBRACKET); Py_VISIT(traverse_module_state->__pyx_n_s_K_RIGHTPAREN); Py_VISIT(traverse_module_state->__pyx_n_s_K_RMETA); Py_VISIT(traverse_module_state->__pyx_n_s_K_RSHIFT); Py_VISIT(traverse_module_state->__pyx_n_s_K_RSUPER); Py_VISIT(traverse_module_state->__pyx_n_s_K_SCROLLLOCK); Py_VISIT(traverse_module_state->__pyx_n_s_K_SCROLLOCK); Py_VISIT(traverse_module_state->__pyx_n_s_K_SELECT); Py_VISIT(traverse_module_state->__pyx_n_s_K_SEMICOLON); Py_VISIT(traverse_module_state->__pyx_n_s_K_SEPARATOR); Py_VISIT(traverse_module_state->__pyx_n_s_K_SLASH); Py_VISIT(traverse_module_state->__pyx_n_s_K_SLEEP); Py_VISIT(traverse_module_state->__pyx_n_s_K_SPACE); Py_VISIT(traverse_module_state->__pyx_n_s_K_STOP); Py_VISIT(traverse_module_state->__pyx_n_s_K_SYSREQ); Py_VISIT(traverse_module_state->__pyx_n_s_K_TAB); Py_VISIT(traverse_module_state->__pyx_n_s_K_THOUSANDSSEPARATOR); Py_VISIT(traverse_module_state->__pyx_n_s_K_UNDERSCORE); Py_VISIT(traverse_module_state->__pyx_n_s_K_UNDO); Py_VISIT(traverse_module_state->__pyx_n_s_K_UNKNOWN); Py_VISIT(traverse_module_state->__pyx_n_s_K_UP); Py_VISIT(traverse_module_state->__pyx_n_s_K_VOLUMEDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_K_VOLUMEUP); Py_VISIT(traverse_module_state->__pyx_n_s_K_WWW); Py_VISIT(traverse_module_state->__pyx_n_s_K_a); Py_VISIT(traverse_module_state->__pyx_n_s_K_b); Py_VISIT(traverse_module_state->__pyx_n_s_K_c); Py_VISIT(traverse_module_state->__pyx_n_s_K_d); Py_VISIT(traverse_module_state->__pyx_n_s_K_e); Py_VISIT(traverse_module_state->__pyx_n_s_K_f); Py_VISIT(traverse_module_state->__pyx_n_s_K_g); Py_VISIT(traverse_module_state->__pyx_n_s_K_h); Py_VISIT(traverse_module_state->__pyx_n_s_K_i); Py_VISIT(traverse_module_state->__pyx_n_s_K_j); Py_VISIT(traverse_module_state->__pyx_n_s_K_k); Py_VISIT(traverse_module_state->__pyx_n_s_K_l); Py_VISIT(traverse_module_state->__pyx_n_s_K_m); Py_VISIT(traverse_module_state->__pyx_n_s_K_n); Py_VISIT(traverse_module_state->__pyx_n_s_K_o); Py_VISIT(traverse_module_state->__pyx_n_s_K_p); Py_VISIT(traverse_module_state->__pyx_n_s_K_q); Py_VISIT(traverse_module_state->__pyx_n_s_K_r); Py_VISIT(traverse_module_state->__pyx_n_s_K_s); Py_VISIT(traverse_module_state->__pyx_n_s_K_t); Py_VISIT(traverse_module_state->__pyx_n_s_K_u); Py_VISIT(traverse_module_state->__pyx_n_s_K_v); Py_VISIT(traverse_module_state->__pyx_n_s_K_w); Py_VISIT(traverse_module_state->__pyx_n_s_K_x); Py_VISIT(traverse_module_state->__pyx_n_s_K_y); Py_VISIT(traverse_module_state->__pyx_n_s_K_z); Py_VISIT(traverse_module_state->__pyx_n_s_LASTEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_LIL_ENDIAN); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEBUTTONDOWN); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEBUTTONUP); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEMOTION); Py_VISIT(traverse_module_state->__pyx_n_s_MOUSEWHEEL); Py_VISIT(traverse_module_state->__pyx_n_s_MULTIGESTURE); Py_VISIT(traverse_module_state->__pyx_n_s_NOEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_NOFRAME); Py_VISIT(traverse_module_state->__pyx_n_s_OPENGL); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_CHARGED); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_CHARGING); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_NO_BATTERY); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_ON_BATTERY); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_UNKNOWN); Py_VISIT(traverse_module_state->__pyx_n_s_QUIT); Py_VISIT(traverse_module_state->__pyx_n_s_RENDER_DEVICE_RESET); Py_VISIT(traverse_module_state->__pyx_n_s_RENDER_TARGETS_RESET); Py_VISIT(traverse_module_state->__pyx_n_s_RESIZABLE); Py_VISIT(traverse_module_state->__pyx_n_s_RLEACCEL); Py_VISIT(traverse_module_state->__pyx_n_s_Rect); Py_VISIT(traverse_module_state->__pyx_n_s_SCRAP_TEXT); Py_VISIT(traverse_module_state->__pyx_n_s_SDL_VERSION_TUPLE); Py_VISIT(traverse_module_state->__pyx_n_s_SENSORUPDATE); Py_VISIT(traverse_module_state->__pyx_n_s_SRCALPHA); Py_VISIT(traverse_module_state->__pyx_n_s_SRCCOLORKEY); Py_VISIT(traverse_module_state->__pyx_n_s_SWSURFACE); Py_VISIT(traverse_module_state->__pyx_n_s_SYSWMEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_TEXTEDITING); Py_VISIT(traverse_module_state->__pyx_n_s_TEXTINPUT); Py_VISIT(traverse_module_state->__pyx_n_s_TOUCH_MOUSEID); Py_VISIT(traverse_module_state->__pyx_n_s_USEREVENT); Py_VISIT(traverse_module_state->__pyx_n_s_VIDEOEXPOSE); Py_VISIT(traverse_module_state->__pyx_n_s_VIDEORESIZE); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOWEVENT); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOWMOVED); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOWPOS_CENTERED); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOWPOS_UNDEFINED); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_ALLOW_HIGHDPI); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_BORDERLESS); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_FOREIGN); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_FULLSCREEN); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_HIDDEN); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_INPUT_FOCUS); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_INPUT_GRABBED); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_MAXIMIZED); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_MINIMIZED); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_NOFRAME); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_OPENGL); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_RESIZABLE); Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_SHOWN); Py_VISIT(traverse_module_state->__pyx_n_s__2); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_color); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rect); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_kp_s_text_plain); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_3); Py_VISIT(traverse_module_state->__pyx_int_4); Py_VISIT(traverse_module_state->__pyx_int_5); Py_VISIT(traverse_module_state->__pyx_int_6); Py_VISIT(traverse_module_state->__pyx_int_7); Py_VISIT(traverse_module_state->__pyx_int_8); Py_VISIT(traverse_module_state->__pyx_int_9); Py_VISIT(traverse_module_state->__pyx_int_16); Py_VISIT(traverse_module_state->__pyx_int_17); Py_VISIT(traverse_module_state->__pyx_int_1073741824); Py_VISIT(traverse_module_state->__pyx_int_2147483648); Py_VISIT(traverse_module_state->__pyx_int_neg_1); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_n_s_ACTIVEEVENT __pyx_mstate_global->__pyx_n_s_ACTIVEEVENT #define __pyx_n_s_APP_DIDENTERBACKGROUND __pyx_mstate_global->__pyx_n_s_APP_DIDENTERBACKGROUND #define __pyx_n_s_APP_DIDENTERFOREGROUND __pyx_mstate_global->__pyx_n_s_APP_DIDENTERFOREGROUND #define __pyx_n_s_APP_LOWMEMORY __pyx_mstate_global->__pyx_n_s_APP_LOWMEMORY #define __pyx_n_s_APP_TERMINATING __pyx_mstate_global->__pyx_n_s_APP_TERMINATING #define __pyx_n_s_APP_WILLENTERBACKGROUND __pyx_mstate_global->__pyx_n_s_APP_WILLENTERBACKGROUND #define __pyx_n_s_APP_WILLENTERFOREGROUND __pyx_mstate_global->__pyx_n_s_APP_WILLENTERFOREGROUND #define __pyx_n_s_AUDIODEVICEADDED __pyx_mstate_global->__pyx_n_s_AUDIODEVICEADDED #define __pyx_n_s_AUDIODEVICEREMOVED __pyx_mstate_global->__pyx_n_s_AUDIODEVICEREMOVED #define __pyx_n_s_BIG_ENDIAN __pyx_mstate_global->__pyx_n_s_BIG_ENDIAN #define __pyx_n_s_BLEND_ADD __pyx_mstate_global->__pyx_n_s_BLEND_ADD #define __pyx_n_s_BLEND_MAX __pyx_mstate_global->__pyx_n_s_BLEND_MAX #define __pyx_n_s_BLEND_MIN __pyx_mstate_global->__pyx_n_s_BLEND_MIN #define __pyx_n_s_BLEND_MULT __pyx_mstate_global->__pyx_n_s_BLEND_MULT #define __pyx_n_s_BLEND_PREMULTIPLIED __pyx_mstate_global->__pyx_n_s_BLEND_PREMULTIPLIED #define __pyx_n_s_BLEND_RGBA_ADD __pyx_mstate_global->__pyx_n_s_BLEND_RGBA_ADD #define __pyx_n_s_BLEND_RGBA_MAX __pyx_mstate_global->__pyx_n_s_BLEND_RGBA_MAX #define __pyx_n_s_BLEND_RGBA_MIN __pyx_mstate_global->__pyx_n_s_BLEND_RGBA_MIN #define __pyx_n_s_BLEND_RGBA_MULT __pyx_mstate_global->__pyx_n_s_BLEND_RGBA_MULT #define __pyx_n_s_BLEND_RGBA_SUB __pyx_mstate_global->__pyx_n_s_BLEND_RGBA_SUB #define __pyx_n_s_BLEND_RGB_ADD __pyx_mstate_global->__pyx_n_s_BLEND_RGB_ADD #define __pyx_n_s_BLEND_RGB_MAX __pyx_mstate_global->__pyx_n_s_BLEND_RGB_MAX #define __pyx_n_s_BLEND_RGB_MIN __pyx_mstate_global->__pyx_n_s_BLEND_RGB_MIN #define __pyx_n_s_BLEND_RGB_MULT __pyx_mstate_global->__pyx_n_s_BLEND_RGB_MULT #define __pyx_n_s_BLEND_RGB_SUB __pyx_mstate_global->__pyx_n_s_BLEND_RGB_SUB #define __pyx_n_s_BLEND_SUB __pyx_mstate_global->__pyx_n_s_BLEND_SUB #define __pyx_n_s_BYTEORDER __pyx_mstate_global->__pyx_n_s_BYTEORDER #define __pyx_n_s_CLIPBOARDUPDATE __pyx_mstate_global->__pyx_n_s_CLIPBOARDUPDATE #define __pyx_n_s_CONTROLLERAXISMOTION __pyx_mstate_global->__pyx_n_s_CONTROLLERAXISMOTION #define __pyx_n_s_CONTROLLERBUTTONDOWN __pyx_mstate_global->__pyx_n_s_CONTROLLERBUTTONDOWN #define __pyx_n_s_CONTROLLERBUTTONUP __pyx_mstate_global->__pyx_n_s_CONTROLLERBUTTONUP #define __pyx_n_s_CONTROLLERDEVICEADDED __pyx_mstate_global->__pyx_n_s_CONTROLLERDEVICEADDED #define __pyx_n_s_CONTROLLERDEVICEREMAPPED __pyx_mstate_global->__pyx_n_s_CONTROLLERDEVICEREMAPPED #define __pyx_n_s_CONTROLLERDEVICEREMOVED __pyx_mstate_global->__pyx_n_s_CONTROLLERDEVICEREMOVED #define __pyx_n_s_CONTROLLER_AXIS_INVALID __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_INVALID #define __pyx_n_s_CONTROLLER_AXIS_LEFTX __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_LEFTX #define __pyx_n_s_CONTROLLER_AXIS_LEFTY __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_LEFTY #define __pyx_n_s_CONTROLLER_AXIS_MAX __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_MAX #define __pyx_n_s_CONTROLLER_AXIS_RIGHTX __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_RIGHTX #define __pyx_n_s_CONTROLLER_AXIS_RIGHTY __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_RIGHTY #define __pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT #define __pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT __pyx_mstate_global->__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT #define __pyx_n_s_CONTROLLER_BUTTON_A __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_A #define __pyx_n_s_CONTROLLER_BUTTON_B __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_B #define __pyx_n_s_CONTROLLER_BUTTON_BACK __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_BACK #define __pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN #define __pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT #define __pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT #define __pyx_n_s_CONTROLLER_BUTTON_DPAD_UP __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP #define __pyx_n_s_CONTROLLER_BUTTON_GUIDE __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_GUIDE #define __pyx_n_s_CONTROLLER_BUTTON_INVALID __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_INVALID #define __pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER #define __pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK #define __pyx_n_s_CONTROLLER_BUTTON_MAX __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_MAX #define __pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER #define __pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK #define __pyx_n_s_CONTROLLER_BUTTON_START __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_START #define __pyx_n_s_CONTROLLER_BUTTON_X __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_X #define __pyx_n_s_CONTROLLER_BUTTON_Y __pyx_mstate_global->__pyx_n_s_CONTROLLER_BUTTON_Y #define __pyx_n_s_Color __pyx_mstate_global->__pyx_n_s_Color #define __pyx_n_s_DISPLAYEVENT __pyx_mstate_global->__pyx_n_s_DISPLAYEVENT #define __pyx_n_s_DOLLARGESTURE __pyx_mstate_global->__pyx_n_s_DOLLARGESTURE #define __pyx_n_s_DOLLARRECORD __pyx_mstate_global->__pyx_n_s_DOLLARRECORD #define __pyx_n_s_DOUBLEBUF __pyx_mstate_global->__pyx_n_s_DOUBLEBUF #define __pyx_n_s_DROPBEGIN __pyx_mstate_global->__pyx_n_s_DROPBEGIN #define __pyx_n_s_DROPCOMPLETE __pyx_mstate_global->__pyx_n_s_DROPCOMPLETE #define __pyx_n_s_DROPFILE __pyx_mstate_global->__pyx_n_s_DROPFILE #define __pyx_n_s_DROPTEXT __pyx_mstate_global->__pyx_n_s_DROPTEXT #define __pyx_n_s_FINGERDOWN __pyx_mstate_global->__pyx_n_s_FINGERDOWN #define __pyx_n_s_FINGERMOTION __pyx_mstate_global->__pyx_n_s_FINGERMOTION #define __pyx_n_s_FINGERUP __pyx_mstate_global->__pyx_n_s_FINGERUP #define __pyx_n_s_FULLSCREEN __pyx_mstate_global->__pyx_n_s_FULLSCREEN #define __pyx_n_s_GL_ACCELERATED_VISUAL __pyx_mstate_global->__pyx_n_s_GL_ACCELERATED_VISUAL #define __pyx_n_s_GL_ACCUM_ALPHA_SIZE __pyx_mstate_global->__pyx_n_s_GL_ACCUM_ALPHA_SIZE #define __pyx_n_s_GL_ACCUM_BLUE_SIZE __pyx_mstate_global->__pyx_n_s_GL_ACCUM_BLUE_SIZE #define __pyx_n_s_GL_ACCUM_GREEN_SIZE __pyx_mstate_global->__pyx_n_s_GL_ACCUM_GREEN_SIZE #define __pyx_n_s_GL_ACCUM_RED_SIZE __pyx_mstate_global->__pyx_n_s_GL_ACCUM_RED_SIZE #define __pyx_n_s_GL_ALPHA_SIZE __pyx_mstate_global->__pyx_n_s_GL_ALPHA_SIZE #define __pyx_n_s_GL_BLUE_SIZE __pyx_mstate_global->__pyx_n_s_GL_BLUE_SIZE #define __pyx_n_s_GL_BUFFER_SIZE __pyx_mstate_global->__pyx_n_s_GL_BUFFER_SIZE #define __pyx_n_s_GL_CONTEXT_EGL __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_EGL #define __pyx_n_s_GL_CONTEXT_FLAGS __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_FLAGS #define __pyx_n_s_GL_CONTEXT_MAJOR_VERSION __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_MAJOR_VERSION #define __pyx_n_s_GL_CONTEXT_MINOR_VERSION __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_MINOR_VERSION #define __pyx_n_s_GL_CONTEXT_NO_ERROR __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_NO_ERROR #define __pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY #define __pyx_n_s_GL_CONTEXT_PROFILE_CORE __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_PROFILE_CORE #define __pyx_n_s_GL_CONTEXT_PROFILE_ES __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_PROFILE_ES #define __pyx_n_s_GL_CONTEXT_PROFILE_MASK __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_PROFILE_MASK #define __pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR #define __pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION __pyx_mstate_global->__pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION #define __pyx_n_s_GL_DEPTH_SIZE __pyx_mstate_global->__pyx_n_s_GL_DEPTH_SIZE #define __pyx_n_s_GL_DOUBLEBUFFER __pyx_mstate_global->__pyx_n_s_GL_DOUBLEBUFFER #define __pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE __pyx_mstate_global->__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE #define __pyx_n_s_GL_GREEN_SIZE __pyx_mstate_global->__pyx_n_s_GL_GREEN_SIZE #define __pyx_n_s_GL_MULTISAMPLEBUFFERS __pyx_mstate_global->__pyx_n_s_GL_MULTISAMPLEBUFFERS #define __pyx_n_s_GL_MULTISAMPLESAMPLES __pyx_mstate_global->__pyx_n_s_GL_MULTISAMPLESAMPLES #define __pyx_n_s_GL_RED_SIZE __pyx_mstate_global->__pyx_n_s_GL_RED_SIZE #define __pyx_n_s_GL_RETAINED_BACKING __pyx_mstate_global->__pyx_n_s_GL_RETAINED_BACKING #define __pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT __pyx_mstate_global->__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT #define __pyx_n_s_GL_STENCIL_SIZE __pyx_mstate_global->__pyx_n_s_GL_STENCIL_SIZE #define __pyx_n_s_GL_STEREO __pyx_mstate_global->__pyx_n_s_GL_STEREO #define __pyx_n_s_GL_SWAP_CONTROL __pyx_mstate_global->__pyx_n_s_GL_SWAP_CONTROL #define __pyx_n_s_HWSURFACE __pyx_mstate_global->__pyx_n_s_HWSURFACE #define __pyx_n_s_JOYAXISMOTION __pyx_mstate_global->__pyx_n_s_JOYAXISMOTION #define __pyx_n_s_JOYBALLMOTION __pyx_mstate_global->__pyx_n_s_JOYBALLMOTION #define __pyx_n_s_JOYBUTTONDOWN __pyx_mstate_global->__pyx_n_s_JOYBUTTONDOWN #define __pyx_n_s_JOYBUTTONUP __pyx_mstate_global->__pyx_n_s_JOYBUTTONUP #define __pyx_n_s_JOYDEVICEADDED __pyx_mstate_global->__pyx_n_s_JOYDEVICEADDED #define __pyx_n_s_JOYDEVICEREMOVED __pyx_mstate_global->__pyx_n_s_JOYDEVICEREMOVED #define __pyx_n_s_JOYHATMOTION __pyx_mstate_global->__pyx_n_s_JOYHATMOTION #define __pyx_n_s_KEYDOWN __pyx_mstate_global->__pyx_n_s_KEYDOWN #define __pyx_n_s_KEYMAPCHANGED __pyx_mstate_global->__pyx_n_s_KEYMAPCHANGED #define __pyx_n_s_KEYUP __pyx_mstate_global->__pyx_n_s_KEYUP #define __pyx_n_s_KMOD_ALT __pyx_mstate_global->__pyx_n_s_KMOD_ALT #define __pyx_n_s_KMOD_CAPS __pyx_mstate_global->__pyx_n_s_KMOD_CAPS #define __pyx_n_s_KMOD_CTRL __pyx_mstate_global->__pyx_n_s_KMOD_CTRL #define __pyx_n_s_KMOD_GUI __pyx_mstate_global->__pyx_n_s_KMOD_GUI #define __pyx_n_s_KMOD_LALT __pyx_mstate_global->__pyx_n_s_KMOD_LALT #define __pyx_n_s_KMOD_LCTRL __pyx_mstate_global->__pyx_n_s_KMOD_LCTRL #define __pyx_n_s_KMOD_LGUI __pyx_mstate_global->__pyx_n_s_KMOD_LGUI #define __pyx_n_s_KMOD_LMETA __pyx_mstate_global->__pyx_n_s_KMOD_LMETA #define __pyx_n_s_KMOD_LSHIFT __pyx_mstate_global->__pyx_n_s_KMOD_LSHIFT #define __pyx_n_s_KMOD_META __pyx_mstate_global->__pyx_n_s_KMOD_META #define __pyx_n_s_KMOD_MODE __pyx_mstate_global->__pyx_n_s_KMOD_MODE #define __pyx_n_s_KMOD_NONE __pyx_mstate_global->__pyx_n_s_KMOD_NONE #define __pyx_n_s_KMOD_NUM __pyx_mstate_global->__pyx_n_s_KMOD_NUM #define __pyx_n_s_KMOD_RALT __pyx_mstate_global->__pyx_n_s_KMOD_RALT #define __pyx_n_s_KMOD_RCTRL __pyx_mstate_global->__pyx_n_s_KMOD_RCTRL #define __pyx_n_s_KMOD_RGUI __pyx_mstate_global->__pyx_n_s_KMOD_RGUI #define __pyx_n_s_KMOD_RMETA __pyx_mstate_global->__pyx_n_s_KMOD_RMETA #define __pyx_n_s_KMOD_RSHIFT __pyx_mstate_global->__pyx_n_s_KMOD_RSHIFT #define __pyx_n_s_KMOD_SHIFT __pyx_mstate_global->__pyx_n_s_KMOD_SHIFT #define __pyx_n_s_K_0 __pyx_mstate_global->__pyx_n_s_K_0 #define __pyx_n_s_K_1 __pyx_mstate_global->__pyx_n_s_K_1 #define __pyx_n_s_K_2 __pyx_mstate_global->__pyx_n_s_K_2 #define __pyx_n_s_K_3 __pyx_mstate_global->__pyx_n_s_K_3 #define __pyx_n_s_K_4 __pyx_mstate_global->__pyx_n_s_K_4 #define __pyx_n_s_K_5 __pyx_mstate_global->__pyx_n_s_K_5 #define __pyx_n_s_K_6 __pyx_mstate_global->__pyx_n_s_K_6 #define __pyx_n_s_K_7 __pyx_mstate_global->__pyx_n_s_K_7 #define __pyx_n_s_K_8 __pyx_mstate_global->__pyx_n_s_K_8 #define __pyx_n_s_K_9 __pyx_mstate_global->__pyx_n_s_K_9 #define __pyx_n_s_K_AC_BACK __pyx_mstate_global->__pyx_n_s_K_AC_BACK #define __pyx_n_s_K_AC_BOOKMARKS __pyx_mstate_global->__pyx_n_s_K_AC_BOOKMARKS #define __pyx_n_s_K_AC_FORWARD __pyx_mstate_global->__pyx_n_s_K_AC_FORWARD #define __pyx_n_s_K_AC_HOME __pyx_mstate_global->__pyx_n_s_K_AC_HOME #define __pyx_n_s_K_AC_REFRESH __pyx_mstate_global->__pyx_n_s_K_AC_REFRESH #define __pyx_n_s_K_AC_SEARCH __pyx_mstate_global->__pyx_n_s_K_AC_SEARCH #define __pyx_n_s_K_AC_STOP __pyx_mstate_global->__pyx_n_s_K_AC_STOP #define __pyx_n_s_K_AGAIN __pyx_mstate_global->__pyx_n_s_K_AGAIN #define __pyx_n_s_K_ALTERASE __pyx_mstate_global->__pyx_n_s_K_ALTERASE #define __pyx_n_s_K_AMPERSAND __pyx_mstate_global->__pyx_n_s_K_AMPERSAND #define __pyx_n_s_K_APP1 __pyx_mstate_global->__pyx_n_s_K_APP1 #define __pyx_n_s_K_APP2 __pyx_mstate_global->__pyx_n_s_K_APP2 #define __pyx_n_s_K_APPLICATION __pyx_mstate_global->__pyx_n_s_K_APPLICATION #define __pyx_n_s_K_ASTERISK __pyx_mstate_global->__pyx_n_s_K_ASTERISK #define __pyx_n_s_K_AT __pyx_mstate_global->__pyx_n_s_K_AT #define __pyx_n_s_K_AUDIOFASTFORWARD __pyx_mstate_global->__pyx_n_s_K_AUDIOFASTFORWARD #define __pyx_n_s_K_AUDIOMUTE __pyx_mstate_global->__pyx_n_s_K_AUDIOMUTE #define __pyx_n_s_K_AUDIONEXT __pyx_mstate_global->__pyx_n_s_K_AUDIONEXT #define __pyx_n_s_K_AUDIOPLAY __pyx_mstate_global->__pyx_n_s_K_AUDIOPLAY #define __pyx_n_s_K_AUDIOPREV __pyx_mstate_global->__pyx_n_s_K_AUDIOPREV #define __pyx_n_s_K_AUDIOREWIND __pyx_mstate_global->__pyx_n_s_K_AUDIOREWIND #define __pyx_n_s_K_AUDIOSTOP __pyx_mstate_global->__pyx_n_s_K_AUDIOSTOP #define __pyx_n_s_K_BACKQUOTE __pyx_mstate_global->__pyx_n_s_K_BACKQUOTE #define __pyx_n_s_K_BACKSLASH __pyx_mstate_global->__pyx_n_s_K_BACKSLASH #define __pyx_n_s_K_BACKSPACE __pyx_mstate_global->__pyx_n_s_K_BACKSPACE #define __pyx_n_s_K_BREAK __pyx_mstate_global->__pyx_n_s_K_BREAK #define __pyx_n_s_K_BRIGHTNESSDOWN __pyx_mstate_global->__pyx_n_s_K_BRIGHTNESSDOWN #define __pyx_n_s_K_BRIGHTNESSUP __pyx_mstate_global->__pyx_n_s_K_BRIGHTNESSUP #define __pyx_n_s_K_CALCULATOR __pyx_mstate_global->__pyx_n_s_K_CALCULATOR #define __pyx_n_s_K_CANCEL __pyx_mstate_global->__pyx_n_s_K_CANCEL #define __pyx_n_s_K_CAPSLOCK __pyx_mstate_global->__pyx_n_s_K_CAPSLOCK #define __pyx_n_s_K_CARET __pyx_mstate_global->__pyx_n_s_K_CARET #define __pyx_n_s_K_CLEAR __pyx_mstate_global->__pyx_n_s_K_CLEAR #define __pyx_n_s_K_CLEARAGAIN __pyx_mstate_global->__pyx_n_s_K_CLEARAGAIN #define __pyx_n_s_K_COLON __pyx_mstate_global->__pyx_n_s_K_COLON #define __pyx_n_s_K_COMMA __pyx_mstate_global->__pyx_n_s_K_COMMA #define __pyx_n_s_K_COMPUTER __pyx_mstate_global->__pyx_n_s_K_COMPUTER #define __pyx_n_s_K_COPY __pyx_mstate_global->__pyx_n_s_K_COPY #define __pyx_n_s_K_CRSEL __pyx_mstate_global->__pyx_n_s_K_CRSEL #define __pyx_n_s_K_CURRENCYSUBUNIT __pyx_mstate_global->__pyx_n_s_K_CURRENCYSUBUNIT #define __pyx_n_s_K_CURRENCYUNIT __pyx_mstate_global->__pyx_n_s_K_CURRENCYUNIT #define __pyx_n_s_K_CUT __pyx_mstate_global->__pyx_n_s_K_CUT #define __pyx_n_s_K_DECIMALSEPARATOR __pyx_mstate_global->__pyx_n_s_K_DECIMALSEPARATOR #define __pyx_n_s_K_DELETE __pyx_mstate_global->__pyx_n_s_K_DELETE #define __pyx_n_s_K_DISPLAYSWITCH __pyx_mstate_global->__pyx_n_s_K_DISPLAYSWITCH #define __pyx_n_s_K_DOLLAR __pyx_mstate_global->__pyx_n_s_K_DOLLAR #define __pyx_n_s_K_DOWN __pyx_mstate_global->__pyx_n_s_K_DOWN #define __pyx_n_s_K_EJECT __pyx_mstate_global->__pyx_n_s_K_EJECT #define __pyx_n_s_K_END __pyx_mstate_global->__pyx_n_s_K_END #define __pyx_n_s_K_EQUALS __pyx_mstate_global->__pyx_n_s_K_EQUALS #define __pyx_n_s_K_ESCAPE __pyx_mstate_global->__pyx_n_s_K_ESCAPE #define __pyx_n_s_K_EURO __pyx_mstate_global->__pyx_n_s_K_EURO #define __pyx_n_s_K_EXCLAIM __pyx_mstate_global->__pyx_n_s_K_EXCLAIM #define __pyx_n_s_K_EXECUTE __pyx_mstate_global->__pyx_n_s_K_EXECUTE #define __pyx_n_s_K_EXSEL __pyx_mstate_global->__pyx_n_s_K_EXSEL #define __pyx_n_s_K_F1 __pyx_mstate_global->__pyx_n_s_K_F1 #define __pyx_n_s_K_F10 __pyx_mstate_global->__pyx_n_s_K_F10 #define __pyx_n_s_K_F11 __pyx_mstate_global->__pyx_n_s_K_F11 #define __pyx_n_s_K_F12 __pyx_mstate_global->__pyx_n_s_K_F12 #define __pyx_n_s_K_F13 __pyx_mstate_global->__pyx_n_s_K_F13 #define __pyx_n_s_K_F14 __pyx_mstate_global->__pyx_n_s_K_F14 #define __pyx_n_s_K_F15 __pyx_mstate_global->__pyx_n_s_K_F15 #define __pyx_n_s_K_F16 __pyx_mstate_global->__pyx_n_s_K_F16 #define __pyx_n_s_K_F17 __pyx_mstate_global->__pyx_n_s_K_F17 #define __pyx_n_s_K_F18 __pyx_mstate_global->__pyx_n_s_K_F18 #define __pyx_n_s_K_F19 __pyx_mstate_global->__pyx_n_s_K_F19 #define __pyx_n_s_K_F2 __pyx_mstate_global->__pyx_n_s_K_F2 #define __pyx_n_s_K_F20 __pyx_mstate_global->__pyx_n_s_K_F20 #define __pyx_n_s_K_F21 __pyx_mstate_global->__pyx_n_s_K_F21 #define __pyx_n_s_K_F22 __pyx_mstate_global->__pyx_n_s_K_F22 #define __pyx_n_s_K_F23 __pyx_mstate_global->__pyx_n_s_K_F23 #define __pyx_n_s_K_F24 __pyx_mstate_global->__pyx_n_s_K_F24 #define __pyx_n_s_K_F3 __pyx_mstate_global->__pyx_n_s_K_F3 #define __pyx_n_s_K_F4 __pyx_mstate_global->__pyx_n_s_K_F4 #define __pyx_n_s_K_F5 __pyx_mstate_global->__pyx_n_s_K_F5 #define __pyx_n_s_K_F6 __pyx_mstate_global->__pyx_n_s_K_F6 #define __pyx_n_s_K_F7 __pyx_mstate_global->__pyx_n_s_K_F7 #define __pyx_n_s_K_F8 __pyx_mstate_global->__pyx_n_s_K_F8 #define __pyx_n_s_K_F9 __pyx_mstate_global->__pyx_n_s_K_F9 #define __pyx_n_s_K_FIND __pyx_mstate_global->__pyx_n_s_K_FIND #define __pyx_n_s_K_FIRST __pyx_mstate_global->__pyx_n_s_K_FIRST #define __pyx_n_s_K_GREATER __pyx_mstate_global->__pyx_n_s_K_GREATER #define __pyx_n_s_K_HASH __pyx_mstate_global->__pyx_n_s_K_HASH #define __pyx_n_s_K_HELP __pyx_mstate_global->__pyx_n_s_K_HELP #define __pyx_n_s_K_HOME __pyx_mstate_global->__pyx_n_s_K_HOME #define __pyx_n_s_K_INSERT __pyx_mstate_global->__pyx_n_s_K_INSERT #define __pyx_n_s_K_KBDILLUMDOWN __pyx_mstate_global->__pyx_n_s_K_KBDILLUMDOWN #define __pyx_n_s_K_KBDILLUMTOGGLE __pyx_mstate_global->__pyx_n_s_K_KBDILLUMTOGGLE #define __pyx_n_s_K_KBDILLUMUP __pyx_mstate_global->__pyx_n_s_K_KBDILLUMUP #define __pyx_n_s_K_KP0 __pyx_mstate_global->__pyx_n_s_K_KP0 #define __pyx_n_s_K_KP1 __pyx_mstate_global->__pyx_n_s_K_KP1 #define __pyx_n_s_K_KP2 __pyx_mstate_global->__pyx_n_s_K_KP2 #define __pyx_n_s_K_KP3 __pyx_mstate_global->__pyx_n_s_K_KP3 #define __pyx_n_s_K_KP4 __pyx_mstate_global->__pyx_n_s_K_KP4 #define __pyx_n_s_K_KP5 __pyx_mstate_global->__pyx_n_s_K_KP5 #define __pyx_n_s_K_KP6 __pyx_mstate_global->__pyx_n_s_K_KP6 #define __pyx_n_s_K_KP7 __pyx_mstate_global->__pyx_n_s_K_KP7 #define __pyx_n_s_K_KP8 __pyx_mstate_global->__pyx_n_s_K_KP8 #define __pyx_n_s_K_KP9 __pyx_mstate_global->__pyx_n_s_K_KP9 #define __pyx_n_s_K_KP_0 __pyx_mstate_global->__pyx_n_s_K_KP_0 #define __pyx_n_s_K_KP_00 __pyx_mstate_global->__pyx_n_s_K_KP_00 #define __pyx_n_s_K_KP_000 __pyx_mstate_global->__pyx_n_s_K_KP_000 #define __pyx_n_s_K_KP_1 __pyx_mstate_global->__pyx_n_s_K_KP_1 #define __pyx_n_s_K_KP_2 __pyx_mstate_global->__pyx_n_s_K_KP_2 #define __pyx_n_s_K_KP_3 __pyx_mstate_global->__pyx_n_s_K_KP_3 #define __pyx_n_s_K_KP_4 __pyx_mstate_global->__pyx_n_s_K_KP_4 #define __pyx_n_s_K_KP_5 __pyx_mstate_global->__pyx_n_s_K_KP_5 #define __pyx_n_s_K_KP_6 __pyx_mstate_global->__pyx_n_s_K_KP_6 #define __pyx_n_s_K_KP_7 __pyx_mstate_global->__pyx_n_s_K_KP_7 #define __pyx_n_s_K_KP_8 __pyx_mstate_global->__pyx_n_s_K_KP_8 #define __pyx_n_s_K_KP_9 __pyx_mstate_global->__pyx_n_s_K_KP_9 #define __pyx_n_s_K_KP_A __pyx_mstate_global->__pyx_n_s_K_KP_A #define __pyx_n_s_K_KP_AMPERSAND __pyx_mstate_global->__pyx_n_s_K_KP_AMPERSAND #define __pyx_n_s_K_KP_AT __pyx_mstate_global->__pyx_n_s_K_KP_AT #define __pyx_n_s_K_KP_B __pyx_mstate_global->__pyx_n_s_K_KP_B #define __pyx_n_s_K_KP_BACKSPACE __pyx_mstate_global->__pyx_n_s_K_KP_BACKSPACE #define __pyx_n_s_K_KP_BINARY __pyx_mstate_global->__pyx_n_s_K_KP_BINARY #define __pyx_n_s_K_KP_C __pyx_mstate_global->__pyx_n_s_K_KP_C #define __pyx_n_s_K_KP_CLEAR __pyx_mstate_global->__pyx_n_s_K_KP_CLEAR #define __pyx_n_s_K_KP_CLEARENTRY __pyx_mstate_global->__pyx_n_s_K_KP_CLEARENTRY #define __pyx_n_s_K_KP_COLON __pyx_mstate_global->__pyx_n_s_K_KP_COLON #define __pyx_n_s_K_KP_COMMA __pyx_mstate_global->__pyx_n_s_K_KP_COMMA #define __pyx_n_s_K_KP_D __pyx_mstate_global->__pyx_n_s_K_KP_D #define __pyx_n_s_K_KP_DBLAMPERSAND __pyx_mstate_global->__pyx_n_s_K_KP_DBLAMPERSAND #define __pyx_n_s_K_KP_DBLVERTICALBAR __pyx_mstate_global->__pyx_n_s_K_KP_DBLVERTICALBAR #define __pyx_n_s_K_KP_DECIMAL __pyx_mstate_global->__pyx_n_s_K_KP_DECIMAL #define __pyx_n_s_K_KP_DIVIDE __pyx_mstate_global->__pyx_n_s_K_KP_DIVIDE #define __pyx_n_s_K_KP_E __pyx_mstate_global->__pyx_n_s_K_KP_E #define __pyx_n_s_K_KP_ENTER __pyx_mstate_global->__pyx_n_s_K_KP_ENTER #define __pyx_n_s_K_KP_EQUALS __pyx_mstate_global->__pyx_n_s_K_KP_EQUALS #define __pyx_n_s_K_KP_EQUALSAS400 __pyx_mstate_global->__pyx_n_s_K_KP_EQUALSAS400 #define __pyx_n_s_K_KP_EXCLAM __pyx_mstate_global->__pyx_n_s_K_KP_EXCLAM #define __pyx_n_s_K_KP_F __pyx_mstate_global->__pyx_n_s_K_KP_F #define __pyx_n_s_K_KP_GREATER __pyx_mstate_global->__pyx_n_s_K_KP_GREATER #define __pyx_n_s_K_KP_HASH __pyx_mstate_global->__pyx_n_s_K_KP_HASH #define __pyx_n_s_K_KP_HEXADECIMAL __pyx_mstate_global->__pyx_n_s_K_KP_HEXADECIMAL #define __pyx_n_s_K_KP_LEFTBRACE __pyx_mstate_global->__pyx_n_s_K_KP_LEFTBRACE #define __pyx_n_s_K_KP_LEFTPAREN __pyx_mstate_global->__pyx_n_s_K_KP_LEFTPAREN #define __pyx_n_s_K_KP_LESS __pyx_mstate_global->__pyx_n_s_K_KP_LESS #define __pyx_n_s_K_KP_MEMADD __pyx_mstate_global->__pyx_n_s_K_KP_MEMADD #define __pyx_n_s_K_KP_MEMCLEAR __pyx_mstate_global->__pyx_n_s_K_KP_MEMCLEAR #define __pyx_n_s_K_KP_MEMDIVIDE __pyx_mstate_global->__pyx_n_s_K_KP_MEMDIVIDE #define __pyx_n_s_K_KP_MEMMULTIPLY __pyx_mstate_global->__pyx_n_s_K_KP_MEMMULTIPLY #define __pyx_n_s_K_KP_MEMRECALL __pyx_mstate_global->__pyx_n_s_K_KP_MEMRECALL #define __pyx_n_s_K_KP_MEMSTORE __pyx_mstate_global->__pyx_n_s_K_KP_MEMSTORE #define __pyx_n_s_K_KP_MEMSUBTRACT __pyx_mstate_global->__pyx_n_s_K_KP_MEMSUBTRACT #define __pyx_n_s_K_KP_MINUS __pyx_mstate_global->__pyx_n_s_K_KP_MINUS #define __pyx_n_s_K_KP_MULTIPLY __pyx_mstate_global->__pyx_n_s_K_KP_MULTIPLY #define __pyx_n_s_K_KP_OCTAL __pyx_mstate_global->__pyx_n_s_K_KP_OCTAL #define __pyx_n_s_K_KP_PERCENT __pyx_mstate_global->__pyx_n_s_K_KP_PERCENT #define __pyx_n_s_K_KP_PERIOD __pyx_mstate_global->__pyx_n_s_K_KP_PERIOD #define __pyx_n_s_K_KP_PLUS __pyx_mstate_global->__pyx_n_s_K_KP_PLUS #define __pyx_n_s_K_KP_PLUSMINUS __pyx_mstate_global->__pyx_n_s_K_KP_PLUSMINUS #define __pyx_n_s_K_KP_POWER __pyx_mstate_global->__pyx_n_s_K_KP_POWER #define __pyx_n_s_K_KP_RIGHTBRACE __pyx_mstate_global->__pyx_n_s_K_KP_RIGHTBRACE #define __pyx_n_s_K_KP_RIGHTPAREN __pyx_mstate_global->__pyx_n_s_K_KP_RIGHTPAREN #define __pyx_n_s_K_KP_SPACE __pyx_mstate_global->__pyx_n_s_K_KP_SPACE #define __pyx_n_s_K_KP_TAB __pyx_mstate_global->__pyx_n_s_K_KP_TAB #define __pyx_n_s_K_KP_VERTICALBAR __pyx_mstate_global->__pyx_n_s_K_KP_VERTICALBAR #define __pyx_n_s_K_KP_XOR __pyx_mstate_global->__pyx_n_s_K_KP_XOR #define __pyx_n_s_K_LALT __pyx_mstate_global->__pyx_n_s_K_LALT #define __pyx_n_s_K_LAST __pyx_mstate_global->__pyx_n_s_K_LAST #define __pyx_n_s_K_LCTRL __pyx_mstate_global->__pyx_n_s_K_LCTRL #define __pyx_n_s_K_LEFT __pyx_mstate_global->__pyx_n_s_K_LEFT #define __pyx_n_s_K_LEFTBRACKET __pyx_mstate_global->__pyx_n_s_K_LEFTBRACKET #define __pyx_n_s_K_LEFTPAREN __pyx_mstate_global->__pyx_n_s_K_LEFTPAREN #define __pyx_n_s_K_LESS __pyx_mstate_global->__pyx_n_s_K_LESS #define __pyx_n_s_K_LGUI __pyx_mstate_global->__pyx_n_s_K_LGUI #define __pyx_n_s_K_LMETA __pyx_mstate_global->__pyx_n_s_K_LMETA #define __pyx_n_s_K_LSHIFT __pyx_mstate_global->__pyx_n_s_K_LSHIFT #define __pyx_n_s_K_LSUPER __pyx_mstate_global->__pyx_n_s_K_LSUPER #define __pyx_n_s_K_MAIL __pyx_mstate_global->__pyx_n_s_K_MAIL #define __pyx_n_s_K_MEDIASELECT __pyx_mstate_global->__pyx_n_s_K_MEDIASELECT #define __pyx_n_s_K_MENU __pyx_mstate_global->__pyx_n_s_K_MENU #define __pyx_n_s_K_MINUS __pyx_mstate_global->__pyx_n_s_K_MINUS #define __pyx_n_s_K_MODE __pyx_mstate_global->__pyx_n_s_K_MODE #define __pyx_n_s_K_MUTE __pyx_mstate_global->__pyx_n_s_K_MUTE #define __pyx_n_s_K_NUMLOCK __pyx_mstate_global->__pyx_n_s_K_NUMLOCK #define __pyx_n_s_K_NUMLOCKCLEAR __pyx_mstate_global->__pyx_n_s_K_NUMLOCKCLEAR #define __pyx_n_s_K_OPER __pyx_mstate_global->__pyx_n_s_K_OPER #define __pyx_n_s_K_OUT __pyx_mstate_global->__pyx_n_s_K_OUT #define __pyx_n_s_K_PAGEDOWN __pyx_mstate_global->__pyx_n_s_K_PAGEDOWN #define __pyx_n_s_K_PAGEUP __pyx_mstate_global->__pyx_n_s_K_PAGEUP #define __pyx_n_s_K_PASTE __pyx_mstate_global->__pyx_n_s_K_PASTE #define __pyx_n_s_K_PAUSE __pyx_mstate_global->__pyx_n_s_K_PAUSE #define __pyx_n_s_K_PERCENT __pyx_mstate_global->__pyx_n_s_K_PERCENT #define __pyx_n_s_K_PERIOD __pyx_mstate_global->__pyx_n_s_K_PERIOD #define __pyx_n_s_K_PLUS __pyx_mstate_global->__pyx_n_s_K_PLUS #define __pyx_n_s_K_POWER __pyx_mstate_global->__pyx_n_s_K_POWER #define __pyx_n_s_K_PRINT __pyx_mstate_global->__pyx_n_s_K_PRINT #define __pyx_n_s_K_PRINTSCREEN __pyx_mstate_global->__pyx_n_s_K_PRINTSCREEN #define __pyx_n_s_K_PRIOR __pyx_mstate_global->__pyx_n_s_K_PRIOR #define __pyx_n_s_K_QUESTION __pyx_mstate_global->__pyx_n_s_K_QUESTION #define __pyx_n_s_K_QUOTE __pyx_mstate_global->__pyx_n_s_K_QUOTE #define __pyx_n_s_K_QUOTEDBL __pyx_mstate_global->__pyx_n_s_K_QUOTEDBL #define __pyx_n_s_K_RALT __pyx_mstate_global->__pyx_n_s_K_RALT #define __pyx_n_s_K_RCTRL __pyx_mstate_global->__pyx_n_s_K_RCTRL #define __pyx_n_s_K_RETURN __pyx_mstate_global->__pyx_n_s_K_RETURN #define __pyx_n_s_K_RETURN2 __pyx_mstate_global->__pyx_n_s_K_RETURN2 #define __pyx_n_s_K_RGUI __pyx_mstate_global->__pyx_n_s_K_RGUI #define __pyx_n_s_K_RIGHT __pyx_mstate_global->__pyx_n_s_K_RIGHT #define __pyx_n_s_K_RIGHTBRACKET __pyx_mstate_global->__pyx_n_s_K_RIGHTBRACKET #define __pyx_n_s_K_RIGHTPAREN __pyx_mstate_global->__pyx_n_s_K_RIGHTPAREN #define __pyx_n_s_K_RMETA __pyx_mstate_global->__pyx_n_s_K_RMETA #define __pyx_n_s_K_RSHIFT __pyx_mstate_global->__pyx_n_s_K_RSHIFT #define __pyx_n_s_K_RSUPER __pyx_mstate_global->__pyx_n_s_K_RSUPER #define __pyx_n_s_K_SCROLLLOCK __pyx_mstate_global->__pyx_n_s_K_SCROLLLOCK #define __pyx_n_s_K_SCROLLOCK __pyx_mstate_global->__pyx_n_s_K_SCROLLOCK #define __pyx_n_s_K_SELECT __pyx_mstate_global->__pyx_n_s_K_SELECT #define __pyx_n_s_K_SEMICOLON __pyx_mstate_global->__pyx_n_s_K_SEMICOLON #define __pyx_n_s_K_SEPARATOR __pyx_mstate_global->__pyx_n_s_K_SEPARATOR #define __pyx_n_s_K_SLASH __pyx_mstate_global->__pyx_n_s_K_SLASH #define __pyx_n_s_K_SLEEP __pyx_mstate_global->__pyx_n_s_K_SLEEP #define __pyx_n_s_K_SPACE __pyx_mstate_global->__pyx_n_s_K_SPACE #define __pyx_n_s_K_STOP __pyx_mstate_global->__pyx_n_s_K_STOP #define __pyx_n_s_K_SYSREQ __pyx_mstate_global->__pyx_n_s_K_SYSREQ #define __pyx_n_s_K_TAB __pyx_mstate_global->__pyx_n_s_K_TAB #define __pyx_n_s_K_THOUSANDSSEPARATOR __pyx_mstate_global->__pyx_n_s_K_THOUSANDSSEPARATOR #define __pyx_n_s_K_UNDERSCORE __pyx_mstate_global->__pyx_n_s_K_UNDERSCORE #define __pyx_n_s_K_UNDO __pyx_mstate_global->__pyx_n_s_K_UNDO #define __pyx_n_s_K_UNKNOWN __pyx_mstate_global->__pyx_n_s_K_UNKNOWN #define __pyx_n_s_K_UP __pyx_mstate_global->__pyx_n_s_K_UP #define __pyx_n_s_K_VOLUMEDOWN __pyx_mstate_global->__pyx_n_s_K_VOLUMEDOWN #define __pyx_n_s_K_VOLUMEUP __pyx_mstate_global->__pyx_n_s_K_VOLUMEUP #define __pyx_n_s_K_WWW __pyx_mstate_global->__pyx_n_s_K_WWW #define __pyx_n_s_K_a __pyx_mstate_global->__pyx_n_s_K_a #define __pyx_n_s_K_b __pyx_mstate_global->__pyx_n_s_K_b #define __pyx_n_s_K_c __pyx_mstate_global->__pyx_n_s_K_c #define __pyx_n_s_K_d __pyx_mstate_global->__pyx_n_s_K_d #define __pyx_n_s_K_e __pyx_mstate_global->__pyx_n_s_K_e #define __pyx_n_s_K_f __pyx_mstate_global->__pyx_n_s_K_f #define __pyx_n_s_K_g __pyx_mstate_global->__pyx_n_s_K_g #define __pyx_n_s_K_h __pyx_mstate_global->__pyx_n_s_K_h #define __pyx_n_s_K_i __pyx_mstate_global->__pyx_n_s_K_i #define __pyx_n_s_K_j __pyx_mstate_global->__pyx_n_s_K_j #define __pyx_n_s_K_k __pyx_mstate_global->__pyx_n_s_K_k #define __pyx_n_s_K_l __pyx_mstate_global->__pyx_n_s_K_l #define __pyx_n_s_K_m __pyx_mstate_global->__pyx_n_s_K_m #define __pyx_n_s_K_n __pyx_mstate_global->__pyx_n_s_K_n #define __pyx_n_s_K_o __pyx_mstate_global->__pyx_n_s_K_o #define __pyx_n_s_K_p __pyx_mstate_global->__pyx_n_s_K_p #define __pyx_n_s_K_q __pyx_mstate_global->__pyx_n_s_K_q #define __pyx_n_s_K_r __pyx_mstate_global->__pyx_n_s_K_r #define __pyx_n_s_K_s __pyx_mstate_global->__pyx_n_s_K_s #define __pyx_n_s_K_t __pyx_mstate_global->__pyx_n_s_K_t #define __pyx_n_s_K_u __pyx_mstate_global->__pyx_n_s_K_u #define __pyx_n_s_K_v __pyx_mstate_global->__pyx_n_s_K_v #define __pyx_n_s_K_w __pyx_mstate_global->__pyx_n_s_K_w #define __pyx_n_s_K_x __pyx_mstate_global->__pyx_n_s_K_x #define __pyx_n_s_K_y __pyx_mstate_global->__pyx_n_s_K_y #define __pyx_n_s_K_z __pyx_mstate_global->__pyx_n_s_K_z #define __pyx_n_s_LASTEVENT __pyx_mstate_global->__pyx_n_s_LASTEVENT #define __pyx_n_s_LIL_ENDIAN __pyx_mstate_global->__pyx_n_s_LIL_ENDIAN #define __pyx_n_s_MOUSEBUTTONDOWN __pyx_mstate_global->__pyx_n_s_MOUSEBUTTONDOWN #define __pyx_n_s_MOUSEBUTTONUP __pyx_mstate_global->__pyx_n_s_MOUSEBUTTONUP #define __pyx_n_s_MOUSEMOTION __pyx_mstate_global->__pyx_n_s_MOUSEMOTION #define __pyx_n_s_MOUSEWHEEL __pyx_mstate_global->__pyx_n_s_MOUSEWHEEL #define __pyx_n_s_MULTIGESTURE __pyx_mstate_global->__pyx_n_s_MULTIGESTURE #define __pyx_n_s_NOEVENT __pyx_mstate_global->__pyx_n_s_NOEVENT #define __pyx_n_s_NOFRAME __pyx_mstate_global->__pyx_n_s_NOFRAME #define __pyx_n_s_OPENGL __pyx_mstate_global->__pyx_n_s_OPENGL #define __pyx_n_s_POWERSTATE_CHARGED __pyx_mstate_global->__pyx_n_s_POWERSTATE_CHARGED #define __pyx_n_s_POWERSTATE_CHARGING __pyx_mstate_global->__pyx_n_s_POWERSTATE_CHARGING #define __pyx_n_s_POWERSTATE_NO_BATTERY __pyx_mstate_global->__pyx_n_s_POWERSTATE_NO_BATTERY #define __pyx_n_s_POWERSTATE_ON_BATTERY __pyx_mstate_global->__pyx_n_s_POWERSTATE_ON_BATTERY #define __pyx_n_s_POWERSTATE_UNKNOWN __pyx_mstate_global->__pyx_n_s_POWERSTATE_UNKNOWN #define __pyx_n_s_QUIT __pyx_mstate_global->__pyx_n_s_QUIT #define __pyx_n_s_RENDER_DEVICE_RESET __pyx_mstate_global->__pyx_n_s_RENDER_DEVICE_RESET #define __pyx_n_s_RENDER_TARGETS_RESET __pyx_mstate_global->__pyx_n_s_RENDER_TARGETS_RESET #define __pyx_n_s_RESIZABLE __pyx_mstate_global->__pyx_n_s_RESIZABLE #define __pyx_n_s_RLEACCEL __pyx_mstate_global->__pyx_n_s_RLEACCEL #define __pyx_n_s_Rect __pyx_mstate_global->__pyx_n_s_Rect #define __pyx_n_s_SCRAP_TEXT __pyx_mstate_global->__pyx_n_s_SCRAP_TEXT #define __pyx_n_s_SDL_VERSION_TUPLE __pyx_mstate_global->__pyx_n_s_SDL_VERSION_TUPLE #define __pyx_n_s_SENSORUPDATE __pyx_mstate_global->__pyx_n_s_SENSORUPDATE #define __pyx_n_s_SRCALPHA __pyx_mstate_global->__pyx_n_s_SRCALPHA #define __pyx_n_s_SRCCOLORKEY __pyx_mstate_global->__pyx_n_s_SRCCOLORKEY #define __pyx_n_s_SWSURFACE __pyx_mstate_global->__pyx_n_s_SWSURFACE #define __pyx_n_s_SYSWMEVENT __pyx_mstate_global->__pyx_n_s_SYSWMEVENT #define __pyx_n_s_TEXTEDITING __pyx_mstate_global->__pyx_n_s_TEXTEDITING #define __pyx_n_s_TEXTINPUT __pyx_mstate_global->__pyx_n_s_TEXTINPUT #define __pyx_n_s_TOUCH_MOUSEID __pyx_mstate_global->__pyx_n_s_TOUCH_MOUSEID #define __pyx_n_s_USEREVENT __pyx_mstate_global->__pyx_n_s_USEREVENT #define __pyx_n_s_VIDEOEXPOSE __pyx_mstate_global->__pyx_n_s_VIDEOEXPOSE #define __pyx_n_s_VIDEORESIZE __pyx_mstate_global->__pyx_n_s_VIDEORESIZE #define __pyx_n_s_WINDOWEVENT __pyx_mstate_global->__pyx_n_s_WINDOWEVENT #define __pyx_n_s_WINDOWMOVED __pyx_mstate_global->__pyx_n_s_WINDOWMOVED #define __pyx_n_s_WINDOWPOS_CENTERED __pyx_mstate_global->__pyx_n_s_WINDOWPOS_CENTERED #define __pyx_n_s_WINDOWPOS_UNDEFINED __pyx_mstate_global->__pyx_n_s_WINDOWPOS_UNDEFINED #define __pyx_n_s_WINDOW_ALLOW_HIGHDPI __pyx_mstate_global->__pyx_n_s_WINDOW_ALLOW_HIGHDPI #define __pyx_n_s_WINDOW_BORDERLESS __pyx_mstate_global->__pyx_n_s_WINDOW_BORDERLESS #define __pyx_n_s_WINDOW_FOREIGN __pyx_mstate_global->__pyx_n_s_WINDOW_FOREIGN #define __pyx_n_s_WINDOW_FULLSCREEN __pyx_mstate_global->__pyx_n_s_WINDOW_FULLSCREEN #define __pyx_n_s_WINDOW_FULLSCREEN_DESKTOP __pyx_mstate_global->__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP #define __pyx_n_s_WINDOW_HIDDEN __pyx_mstate_global->__pyx_n_s_WINDOW_HIDDEN #define __pyx_n_s_WINDOW_INPUT_FOCUS __pyx_mstate_global->__pyx_n_s_WINDOW_INPUT_FOCUS #define __pyx_n_s_WINDOW_INPUT_GRABBED __pyx_mstate_global->__pyx_n_s_WINDOW_INPUT_GRABBED #define __pyx_n_s_WINDOW_MAXIMIZED __pyx_mstate_global->__pyx_n_s_WINDOW_MAXIMIZED #define __pyx_n_s_WINDOW_MINIMIZED __pyx_mstate_global->__pyx_n_s_WINDOW_MINIMIZED #define __pyx_n_s_WINDOW_NOFRAME __pyx_mstate_global->__pyx_n_s_WINDOW_NOFRAME #define __pyx_n_s_WINDOW_OPENGL __pyx_mstate_global->__pyx_n_s_WINDOW_OPENGL #define __pyx_n_s_WINDOW_RESIZABLE __pyx_mstate_global->__pyx_n_s_WINDOW_RESIZABLE #define __pyx_n_s_WINDOW_SHOWN __pyx_mstate_global->__pyx_n_s_WINDOW_SHOWN #define __pyx_n_s__2 __pyx_mstate_global->__pyx_n_s__2 #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_pygame_sdl2_color __pyx_mstate_global->__pyx_n_s_pygame_sdl2_color #define __pyx_n_s_pygame_sdl2_rect __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rect #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_kp_s_text_plain __pyx_mstate_global->__pyx_kp_s_text_plain #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 #define __pyx_int_5 __pyx_mstate_global->__pyx_int_5 #define __pyx_int_6 __pyx_mstate_global->__pyx_int_6 #define __pyx_int_7 __pyx_mstate_global->__pyx_int_7 #define __pyx_int_8 __pyx_mstate_global->__pyx_int_8 #define __pyx_int_9 __pyx_mstate_global->__pyx_int_9 #define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 #define __pyx_int_17 __pyx_mstate_global->__pyx_int_17 #define __pyx_int_1073741824 __pyx_mstate_global->__pyx_int_1073741824 #define __pyx_int_2147483648 __pyx_mstate_global->__pyx_int_2147483648 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 /* #### Code section: module_code ### */ static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_ACTIVEEVENT, __pyx_k_ACTIVEEVENT, sizeof(__pyx_k_ACTIVEEVENT), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERBACKGROUND, __pyx_k_APP_DIDENTERBACKGROUND, sizeof(__pyx_k_APP_DIDENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERFOREGROUND, __pyx_k_APP_DIDENTERFOREGROUND, sizeof(__pyx_k_APP_DIDENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_LOWMEMORY, __pyx_k_APP_LOWMEMORY, sizeof(__pyx_k_APP_LOWMEMORY), 0, 0, 1, 1}, {&__pyx_n_s_APP_TERMINATING, __pyx_k_APP_TERMINATING, sizeof(__pyx_k_APP_TERMINATING), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERBACKGROUND, __pyx_k_APP_WILLENTERBACKGROUND, sizeof(__pyx_k_APP_WILLENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERFOREGROUND, __pyx_k_APP_WILLENTERFOREGROUND, sizeof(__pyx_k_APP_WILLENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_AUDIODEVICEADDED, __pyx_k_AUDIODEVICEADDED, sizeof(__pyx_k_AUDIODEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_AUDIODEVICEREMOVED, __pyx_k_AUDIODEVICEREMOVED, sizeof(__pyx_k_AUDIODEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_BIG_ENDIAN, __pyx_k_BIG_ENDIAN, sizeof(__pyx_k_BIG_ENDIAN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_ADD, __pyx_k_BLEND_ADD, sizeof(__pyx_k_BLEND_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_MAX, __pyx_k_BLEND_MAX, sizeof(__pyx_k_BLEND_MAX), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_MIN, __pyx_k_BLEND_MIN, sizeof(__pyx_k_BLEND_MIN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_MULT, __pyx_k_BLEND_MULT, sizeof(__pyx_k_BLEND_MULT), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_PREMULTIPLIED, __pyx_k_BLEND_PREMULTIPLIED, sizeof(__pyx_k_BLEND_PREMULTIPLIED), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_ADD, __pyx_k_BLEND_RGBA_ADD, sizeof(__pyx_k_BLEND_RGBA_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_MAX, __pyx_k_BLEND_RGBA_MAX, sizeof(__pyx_k_BLEND_RGBA_MAX), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_MIN, __pyx_k_BLEND_RGBA_MIN, sizeof(__pyx_k_BLEND_RGBA_MIN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_MULT, __pyx_k_BLEND_RGBA_MULT, sizeof(__pyx_k_BLEND_RGBA_MULT), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_SUB, __pyx_k_BLEND_RGBA_SUB, sizeof(__pyx_k_BLEND_RGBA_SUB), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_ADD, __pyx_k_BLEND_RGB_ADD, sizeof(__pyx_k_BLEND_RGB_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_MAX, __pyx_k_BLEND_RGB_MAX, sizeof(__pyx_k_BLEND_RGB_MAX), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_MIN, __pyx_k_BLEND_RGB_MIN, sizeof(__pyx_k_BLEND_RGB_MIN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_MULT, __pyx_k_BLEND_RGB_MULT, sizeof(__pyx_k_BLEND_RGB_MULT), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_SUB, __pyx_k_BLEND_RGB_SUB, sizeof(__pyx_k_BLEND_RGB_SUB), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_SUB, __pyx_k_BLEND_SUB, sizeof(__pyx_k_BLEND_SUB), 0, 0, 1, 1}, {&__pyx_n_s_BYTEORDER, __pyx_k_BYTEORDER, sizeof(__pyx_k_BYTEORDER), 0, 0, 1, 1}, {&__pyx_n_s_CLIPBOARDUPDATE, __pyx_k_CLIPBOARDUPDATE, sizeof(__pyx_k_CLIPBOARDUPDATE), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERAXISMOTION, __pyx_k_CONTROLLERAXISMOTION, sizeof(__pyx_k_CONTROLLERAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONDOWN, __pyx_k_CONTROLLERBUTTONDOWN, sizeof(__pyx_k_CONTROLLERBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONUP, __pyx_k_CONTROLLERBUTTONUP, sizeof(__pyx_k_CONTROLLERBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEADDED, __pyx_k_CONTROLLERDEVICEADDED, sizeof(__pyx_k_CONTROLLERDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMAPPED, __pyx_k_CONTROLLERDEVICEREMAPPED, sizeof(__pyx_k_CONTROLLERDEVICEREMAPPED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMOVED, __pyx_k_CONTROLLERDEVICEREMOVED, sizeof(__pyx_k_CONTROLLERDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_INVALID, __pyx_k_CONTROLLER_AXIS_INVALID, sizeof(__pyx_k_CONTROLLER_AXIS_INVALID), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_LEFTX, __pyx_k_CONTROLLER_AXIS_LEFTX, sizeof(__pyx_k_CONTROLLER_AXIS_LEFTX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_LEFTY, __pyx_k_CONTROLLER_AXIS_LEFTY, sizeof(__pyx_k_CONTROLLER_AXIS_LEFTY), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_MAX, __pyx_k_CONTROLLER_AXIS_MAX, sizeof(__pyx_k_CONTROLLER_AXIS_MAX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_RIGHTX, __pyx_k_CONTROLLER_AXIS_RIGHTX, sizeof(__pyx_k_CONTROLLER_AXIS_RIGHTX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_RIGHTY, __pyx_k_CONTROLLER_AXIS_RIGHTY, sizeof(__pyx_k_CONTROLLER_AXIS_RIGHTY), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT, __pyx_k_CONTROLLER_AXIS_TRIGGERLEFT, sizeof(__pyx_k_CONTROLLER_AXIS_TRIGGERLEFT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT, __pyx_k_CONTROLLER_AXIS_TRIGGERRIGHT, sizeof(__pyx_k_CONTROLLER_AXIS_TRIGGERRIGHT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_A, __pyx_k_CONTROLLER_BUTTON_A, sizeof(__pyx_k_CONTROLLER_BUTTON_A), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_B, __pyx_k_CONTROLLER_BUTTON_B, sizeof(__pyx_k_CONTROLLER_BUTTON_B), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_BACK, __pyx_k_CONTROLLER_BUTTON_BACK, sizeof(__pyx_k_CONTROLLER_BUTTON_BACK), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN, __pyx_k_CONTROLLER_BUTTON_DPAD_DOWN, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT, __pyx_k_CONTROLLER_BUTTON_DPAD_LEFT, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT, __pyx_k_CONTROLLER_BUTTON_DPAD_RIGHT, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP, __pyx_k_CONTROLLER_BUTTON_DPAD_UP, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_UP), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_GUIDE, __pyx_k_CONTROLLER_BUTTON_GUIDE, sizeof(__pyx_k_CONTROLLER_BUTTON_GUIDE), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_INVALID, __pyx_k_CONTROLLER_BUTTON_INVALID, sizeof(__pyx_k_CONTROLLER_BUTTON_INVALID), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER, __pyx_k_CONTROLLER_BUTTON_LEFTSHOULDER, sizeof(__pyx_k_CONTROLLER_BUTTON_LEFTSHOULDER), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK, __pyx_k_CONTROLLER_BUTTON_LEFTSTICK, sizeof(__pyx_k_CONTROLLER_BUTTON_LEFTSTICK), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_MAX, __pyx_k_CONTROLLER_BUTTON_MAX, sizeof(__pyx_k_CONTROLLER_BUTTON_MAX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER, __pyx_k_CONTROLLER_BUTTON_RIGHTSHOULDER, sizeof(__pyx_k_CONTROLLER_BUTTON_RIGHTSHOULDER), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK, __pyx_k_CONTROLLER_BUTTON_RIGHTSTICK, sizeof(__pyx_k_CONTROLLER_BUTTON_RIGHTSTICK), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_START, __pyx_k_CONTROLLER_BUTTON_START, sizeof(__pyx_k_CONTROLLER_BUTTON_START), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_X, __pyx_k_CONTROLLER_BUTTON_X, sizeof(__pyx_k_CONTROLLER_BUTTON_X), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_Y, __pyx_k_CONTROLLER_BUTTON_Y, sizeof(__pyx_k_CONTROLLER_BUTTON_Y), 0, 0, 1, 1}, {&__pyx_n_s_Color, __pyx_k_Color, sizeof(__pyx_k_Color), 0, 0, 1, 1}, {&__pyx_n_s_DISPLAYEVENT, __pyx_k_DISPLAYEVENT, sizeof(__pyx_k_DISPLAYEVENT), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARGESTURE, __pyx_k_DOLLARGESTURE, sizeof(__pyx_k_DOLLARGESTURE), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARRECORD, __pyx_k_DOLLARRECORD, sizeof(__pyx_k_DOLLARRECORD), 0, 0, 1, 1}, {&__pyx_n_s_DOUBLEBUF, __pyx_k_DOUBLEBUF, sizeof(__pyx_k_DOUBLEBUF), 0, 0, 1, 1}, {&__pyx_n_s_DROPBEGIN, __pyx_k_DROPBEGIN, sizeof(__pyx_k_DROPBEGIN), 0, 0, 1, 1}, {&__pyx_n_s_DROPCOMPLETE, __pyx_k_DROPCOMPLETE, sizeof(__pyx_k_DROPCOMPLETE), 0, 0, 1, 1}, {&__pyx_n_s_DROPFILE, __pyx_k_DROPFILE, sizeof(__pyx_k_DROPFILE), 0, 0, 1, 1}, {&__pyx_n_s_DROPTEXT, __pyx_k_DROPTEXT, sizeof(__pyx_k_DROPTEXT), 0, 0, 1, 1}, {&__pyx_n_s_FINGERDOWN, __pyx_k_FINGERDOWN, sizeof(__pyx_k_FINGERDOWN), 0, 0, 1, 1}, {&__pyx_n_s_FINGERMOTION, __pyx_k_FINGERMOTION, sizeof(__pyx_k_FINGERMOTION), 0, 0, 1, 1}, {&__pyx_n_s_FINGERUP, __pyx_k_FINGERUP, sizeof(__pyx_k_FINGERUP), 0, 0, 1, 1}, {&__pyx_n_s_FULLSCREEN, __pyx_k_FULLSCREEN, sizeof(__pyx_k_FULLSCREEN), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCELERATED_VISUAL, __pyx_k_GL_ACCELERATED_VISUAL, sizeof(__pyx_k_GL_ACCELERATED_VISUAL), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_ALPHA_SIZE, __pyx_k_GL_ACCUM_ALPHA_SIZE, sizeof(__pyx_k_GL_ACCUM_ALPHA_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_BLUE_SIZE, __pyx_k_GL_ACCUM_BLUE_SIZE, sizeof(__pyx_k_GL_ACCUM_BLUE_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_GREEN_SIZE, __pyx_k_GL_ACCUM_GREEN_SIZE, sizeof(__pyx_k_GL_ACCUM_GREEN_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_RED_SIZE, __pyx_k_GL_ACCUM_RED_SIZE, sizeof(__pyx_k_GL_ACCUM_RED_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ALPHA_SIZE, __pyx_k_GL_ALPHA_SIZE, sizeof(__pyx_k_GL_ALPHA_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_BLUE_SIZE, __pyx_k_GL_BLUE_SIZE, sizeof(__pyx_k_GL_BLUE_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_BUFFER_SIZE, __pyx_k_GL_BUFFER_SIZE, sizeof(__pyx_k_GL_BUFFER_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_EGL, __pyx_k_GL_CONTEXT_EGL, sizeof(__pyx_k_GL_CONTEXT_EGL), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_FLAGS, __pyx_k_GL_CONTEXT_FLAGS, sizeof(__pyx_k_GL_CONTEXT_FLAGS), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_MAJOR_VERSION, __pyx_k_GL_CONTEXT_MAJOR_VERSION, sizeof(__pyx_k_GL_CONTEXT_MAJOR_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_MINOR_VERSION, __pyx_k_GL_CONTEXT_MINOR_VERSION, sizeof(__pyx_k_GL_CONTEXT_MINOR_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_NO_ERROR, __pyx_k_GL_CONTEXT_NO_ERROR, sizeof(__pyx_k_GL_CONTEXT_NO_ERROR), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY, __pyx_k_GL_CONTEXT_PROFILE_COMPATIBILITY, sizeof(__pyx_k_GL_CONTEXT_PROFILE_COMPATIBILITY), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_PROFILE_CORE, __pyx_k_GL_CONTEXT_PROFILE_CORE, sizeof(__pyx_k_GL_CONTEXT_PROFILE_CORE), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_PROFILE_ES, __pyx_k_GL_CONTEXT_PROFILE_ES, sizeof(__pyx_k_GL_CONTEXT_PROFILE_ES), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_PROFILE_MASK, __pyx_k_GL_CONTEXT_PROFILE_MASK, sizeof(__pyx_k_GL_CONTEXT_PROFILE_MASK), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR, __pyx_k_GL_CONTEXT_RELEASE_BEHAVIOR, sizeof(__pyx_k_GL_CONTEXT_RELEASE_BEHAVIOR), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION, __pyx_k_GL_CONTEXT_RESET_NOTIFICATION, sizeof(__pyx_k_GL_CONTEXT_RESET_NOTIFICATION), 0, 0, 1, 1}, {&__pyx_n_s_GL_DEPTH_SIZE, __pyx_k_GL_DEPTH_SIZE, sizeof(__pyx_k_GL_DEPTH_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_DOUBLEBUFFER, __pyx_k_GL_DOUBLEBUFFER, sizeof(__pyx_k_GL_DOUBLEBUFFER), 0, 0, 1, 1}, {&__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE, __pyx_k_GL_FRAMEBUFFER_SRGB_CAPABLE, sizeof(__pyx_k_GL_FRAMEBUFFER_SRGB_CAPABLE), 0, 0, 1, 1}, {&__pyx_n_s_GL_GREEN_SIZE, __pyx_k_GL_GREEN_SIZE, sizeof(__pyx_k_GL_GREEN_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_MULTISAMPLEBUFFERS, __pyx_k_GL_MULTISAMPLEBUFFERS, sizeof(__pyx_k_GL_MULTISAMPLEBUFFERS), 0, 0, 1, 1}, {&__pyx_n_s_GL_MULTISAMPLESAMPLES, __pyx_k_GL_MULTISAMPLESAMPLES, sizeof(__pyx_k_GL_MULTISAMPLESAMPLES), 0, 0, 1, 1}, {&__pyx_n_s_GL_RED_SIZE, __pyx_k_GL_RED_SIZE, sizeof(__pyx_k_GL_RED_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_RETAINED_BACKING, __pyx_k_GL_RETAINED_BACKING, sizeof(__pyx_k_GL_RETAINED_BACKING), 0, 0, 1, 1}, {&__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT, __pyx_k_GL_SHARE_WITH_CURRENT_CONTEXT, sizeof(__pyx_k_GL_SHARE_WITH_CURRENT_CONTEXT), 0, 0, 1, 1}, {&__pyx_n_s_GL_STENCIL_SIZE, __pyx_k_GL_STENCIL_SIZE, sizeof(__pyx_k_GL_STENCIL_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_STEREO, __pyx_k_GL_STEREO, sizeof(__pyx_k_GL_STEREO), 0, 0, 1, 1}, {&__pyx_n_s_GL_SWAP_CONTROL, __pyx_k_GL_SWAP_CONTROL, sizeof(__pyx_k_GL_SWAP_CONTROL), 0, 0, 1, 1}, {&__pyx_n_s_HWSURFACE, __pyx_k_HWSURFACE, sizeof(__pyx_k_HWSURFACE), 0, 0, 1, 1}, {&__pyx_n_s_JOYAXISMOTION, __pyx_k_JOYAXISMOTION, sizeof(__pyx_k_JOYAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBALLMOTION, __pyx_k_JOYBALLMOTION, sizeof(__pyx_k_JOYBALLMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONDOWN, __pyx_k_JOYBUTTONDOWN, sizeof(__pyx_k_JOYBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONUP, __pyx_k_JOYBUTTONUP, sizeof(__pyx_k_JOYBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEADDED, __pyx_k_JOYDEVICEADDED, sizeof(__pyx_k_JOYDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEREMOVED, __pyx_k_JOYDEVICEREMOVED, sizeof(__pyx_k_JOYDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_JOYHATMOTION, __pyx_k_JOYHATMOTION, sizeof(__pyx_k_JOYHATMOTION), 0, 0, 1, 1}, {&__pyx_n_s_KEYDOWN, __pyx_k_KEYDOWN, sizeof(__pyx_k_KEYDOWN), 0, 0, 1, 1}, {&__pyx_n_s_KEYMAPCHANGED, __pyx_k_KEYMAPCHANGED, sizeof(__pyx_k_KEYMAPCHANGED), 0, 0, 1, 1}, {&__pyx_n_s_KEYUP, __pyx_k_KEYUP, sizeof(__pyx_k_KEYUP), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_ALT, __pyx_k_KMOD_ALT, sizeof(__pyx_k_KMOD_ALT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_CAPS, __pyx_k_KMOD_CAPS, sizeof(__pyx_k_KMOD_CAPS), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_CTRL, __pyx_k_KMOD_CTRL, sizeof(__pyx_k_KMOD_CTRL), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_GUI, __pyx_k_KMOD_GUI, sizeof(__pyx_k_KMOD_GUI), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LALT, __pyx_k_KMOD_LALT, sizeof(__pyx_k_KMOD_LALT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LCTRL, __pyx_k_KMOD_LCTRL, sizeof(__pyx_k_KMOD_LCTRL), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LGUI, __pyx_k_KMOD_LGUI, sizeof(__pyx_k_KMOD_LGUI), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LMETA, __pyx_k_KMOD_LMETA, sizeof(__pyx_k_KMOD_LMETA), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LSHIFT, __pyx_k_KMOD_LSHIFT, sizeof(__pyx_k_KMOD_LSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_META, __pyx_k_KMOD_META, sizeof(__pyx_k_KMOD_META), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_MODE, __pyx_k_KMOD_MODE, sizeof(__pyx_k_KMOD_MODE), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_NONE, __pyx_k_KMOD_NONE, sizeof(__pyx_k_KMOD_NONE), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_NUM, __pyx_k_KMOD_NUM, sizeof(__pyx_k_KMOD_NUM), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RALT, __pyx_k_KMOD_RALT, sizeof(__pyx_k_KMOD_RALT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RCTRL, __pyx_k_KMOD_RCTRL, sizeof(__pyx_k_KMOD_RCTRL), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RGUI, __pyx_k_KMOD_RGUI, sizeof(__pyx_k_KMOD_RGUI), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RMETA, __pyx_k_KMOD_RMETA, sizeof(__pyx_k_KMOD_RMETA), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RSHIFT, __pyx_k_KMOD_RSHIFT, sizeof(__pyx_k_KMOD_RSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_SHIFT, __pyx_k_KMOD_SHIFT, sizeof(__pyx_k_KMOD_SHIFT), 0, 0, 1, 1}, {&__pyx_n_s_K_0, __pyx_k_K_0, sizeof(__pyx_k_K_0), 0, 0, 1, 1}, {&__pyx_n_s_K_1, __pyx_k_K_1, sizeof(__pyx_k_K_1), 0, 0, 1, 1}, {&__pyx_n_s_K_2, __pyx_k_K_2, sizeof(__pyx_k_K_2), 0, 0, 1, 1}, {&__pyx_n_s_K_3, __pyx_k_K_3, sizeof(__pyx_k_K_3), 0, 0, 1, 1}, {&__pyx_n_s_K_4, __pyx_k_K_4, sizeof(__pyx_k_K_4), 0, 0, 1, 1}, {&__pyx_n_s_K_5, __pyx_k_K_5, sizeof(__pyx_k_K_5), 0, 0, 1, 1}, {&__pyx_n_s_K_6, __pyx_k_K_6, sizeof(__pyx_k_K_6), 0, 0, 1, 1}, {&__pyx_n_s_K_7, __pyx_k_K_7, sizeof(__pyx_k_K_7), 0, 0, 1, 1}, {&__pyx_n_s_K_8, __pyx_k_K_8, sizeof(__pyx_k_K_8), 0, 0, 1, 1}, {&__pyx_n_s_K_9, __pyx_k_K_9, sizeof(__pyx_k_K_9), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_BACK, __pyx_k_K_AC_BACK, sizeof(__pyx_k_K_AC_BACK), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_BOOKMARKS, __pyx_k_K_AC_BOOKMARKS, sizeof(__pyx_k_K_AC_BOOKMARKS), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_FORWARD, __pyx_k_K_AC_FORWARD, sizeof(__pyx_k_K_AC_FORWARD), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_HOME, __pyx_k_K_AC_HOME, sizeof(__pyx_k_K_AC_HOME), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_REFRESH, __pyx_k_K_AC_REFRESH, sizeof(__pyx_k_K_AC_REFRESH), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_SEARCH, __pyx_k_K_AC_SEARCH, sizeof(__pyx_k_K_AC_SEARCH), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_STOP, __pyx_k_K_AC_STOP, sizeof(__pyx_k_K_AC_STOP), 0, 0, 1, 1}, {&__pyx_n_s_K_AGAIN, __pyx_k_K_AGAIN, sizeof(__pyx_k_K_AGAIN), 0, 0, 1, 1}, {&__pyx_n_s_K_ALTERASE, __pyx_k_K_ALTERASE, sizeof(__pyx_k_K_ALTERASE), 0, 0, 1, 1}, {&__pyx_n_s_K_AMPERSAND, __pyx_k_K_AMPERSAND, sizeof(__pyx_k_K_AMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_K_APP1, __pyx_k_K_APP1, sizeof(__pyx_k_K_APP1), 0, 0, 1, 1}, {&__pyx_n_s_K_APP2, __pyx_k_K_APP2, sizeof(__pyx_k_K_APP2), 0, 0, 1, 1}, {&__pyx_n_s_K_APPLICATION, __pyx_k_K_APPLICATION, sizeof(__pyx_k_K_APPLICATION), 0, 0, 1, 1}, {&__pyx_n_s_K_ASTERISK, __pyx_k_K_ASTERISK, sizeof(__pyx_k_K_ASTERISK), 0, 0, 1, 1}, {&__pyx_n_s_K_AT, __pyx_k_K_AT, sizeof(__pyx_k_K_AT), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOFASTFORWARD, __pyx_k_K_AUDIOFASTFORWARD, sizeof(__pyx_k_K_AUDIOFASTFORWARD), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOMUTE, __pyx_k_K_AUDIOMUTE, sizeof(__pyx_k_K_AUDIOMUTE), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIONEXT, __pyx_k_K_AUDIONEXT, sizeof(__pyx_k_K_AUDIONEXT), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOPLAY, __pyx_k_K_AUDIOPLAY, sizeof(__pyx_k_K_AUDIOPLAY), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOPREV, __pyx_k_K_AUDIOPREV, sizeof(__pyx_k_K_AUDIOPREV), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOREWIND, __pyx_k_K_AUDIOREWIND, sizeof(__pyx_k_K_AUDIOREWIND), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOSTOP, __pyx_k_K_AUDIOSTOP, sizeof(__pyx_k_K_AUDIOSTOP), 0, 0, 1, 1}, {&__pyx_n_s_K_BACKQUOTE, __pyx_k_K_BACKQUOTE, sizeof(__pyx_k_K_BACKQUOTE), 0, 0, 1, 1}, {&__pyx_n_s_K_BACKSLASH, __pyx_k_K_BACKSLASH, sizeof(__pyx_k_K_BACKSLASH), 0, 0, 1, 1}, {&__pyx_n_s_K_BACKSPACE, __pyx_k_K_BACKSPACE, sizeof(__pyx_k_K_BACKSPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_BREAK, __pyx_k_K_BREAK, sizeof(__pyx_k_K_BREAK), 0, 0, 1, 1}, {&__pyx_n_s_K_BRIGHTNESSDOWN, __pyx_k_K_BRIGHTNESSDOWN, sizeof(__pyx_k_K_BRIGHTNESSDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_BRIGHTNESSUP, __pyx_k_K_BRIGHTNESSUP, sizeof(__pyx_k_K_BRIGHTNESSUP), 0, 0, 1, 1}, {&__pyx_n_s_K_CALCULATOR, __pyx_k_K_CALCULATOR, sizeof(__pyx_k_K_CALCULATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_CANCEL, __pyx_k_K_CANCEL, sizeof(__pyx_k_K_CANCEL), 0, 0, 1, 1}, {&__pyx_n_s_K_CAPSLOCK, __pyx_k_K_CAPSLOCK, sizeof(__pyx_k_K_CAPSLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_CARET, __pyx_k_K_CARET, sizeof(__pyx_k_K_CARET), 0, 0, 1, 1}, {&__pyx_n_s_K_CLEAR, __pyx_k_K_CLEAR, sizeof(__pyx_k_K_CLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_CLEARAGAIN, __pyx_k_K_CLEARAGAIN, sizeof(__pyx_k_K_CLEARAGAIN), 0, 0, 1, 1}, {&__pyx_n_s_K_COLON, __pyx_k_K_COLON, sizeof(__pyx_k_K_COLON), 0, 0, 1, 1}, {&__pyx_n_s_K_COMMA, __pyx_k_K_COMMA, sizeof(__pyx_k_K_COMMA), 0, 0, 1, 1}, {&__pyx_n_s_K_COMPUTER, __pyx_k_K_COMPUTER, sizeof(__pyx_k_K_COMPUTER), 0, 0, 1, 1}, {&__pyx_n_s_K_COPY, __pyx_k_K_COPY, sizeof(__pyx_k_K_COPY), 0, 0, 1, 1}, {&__pyx_n_s_K_CRSEL, __pyx_k_K_CRSEL, sizeof(__pyx_k_K_CRSEL), 0, 0, 1, 1}, {&__pyx_n_s_K_CURRENCYSUBUNIT, __pyx_k_K_CURRENCYSUBUNIT, sizeof(__pyx_k_K_CURRENCYSUBUNIT), 0, 0, 1, 1}, {&__pyx_n_s_K_CURRENCYUNIT, __pyx_k_K_CURRENCYUNIT, sizeof(__pyx_k_K_CURRENCYUNIT), 0, 0, 1, 1}, {&__pyx_n_s_K_CUT, __pyx_k_K_CUT, sizeof(__pyx_k_K_CUT), 0, 0, 1, 1}, {&__pyx_n_s_K_DECIMALSEPARATOR, __pyx_k_K_DECIMALSEPARATOR, sizeof(__pyx_k_K_DECIMALSEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_DELETE, __pyx_k_K_DELETE, sizeof(__pyx_k_K_DELETE), 0, 0, 1, 1}, {&__pyx_n_s_K_DISPLAYSWITCH, __pyx_k_K_DISPLAYSWITCH, sizeof(__pyx_k_K_DISPLAYSWITCH), 0, 0, 1, 1}, {&__pyx_n_s_K_DOLLAR, __pyx_k_K_DOLLAR, sizeof(__pyx_k_K_DOLLAR), 0, 0, 1, 1}, {&__pyx_n_s_K_DOWN, __pyx_k_K_DOWN, sizeof(__pyx_k_K_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_EJECT, __pyx_k_K_EJECT, sizeof(__pyx_k_K_EJECT), 0, 0, 1, 1}, {&__pyx_n_s_K_END, __pyx_k_K_END, sizeof(__pyx_k_K_END), 0, 0, 1, 1}, {&__pyx_n_s_K_EQUALS, __pyx_k_K_EQUALS, sizeof(__pyx_k_K_EQUALS), 0, 0, 1, 1}, {&__pyx_n_s_K_ESCAPE, __pyx_k_K_ESCAPE, sizeof(__pyx_k_K_ESCAPE), 0, 0, 1, 1}, {&__pyx_n_s_K_EURO, __pyx_k_K_EURO, sizeof(__pyx_k_K_EURO), 0, 0, 1, 1}, {&__pyx_n_s_K_EXCLAIM, __pyx_k_K_EXCLAIM, sizeof(__pyx_k_K_EXCLAIM), 0, 0, 1, 1}, {&__pyx_n_s_K_EXECUTE, __pyx_k_K_EXECUTE, sizeof(__pyx_k_K_EXECUTE), 0, 0, 1, 1}, {&__pyx_n_s_K_EXSEL, __pyx_k_K_EXSEL, sizeof(__pyx_k_K_EXSEL), 0, 0, 1, 1}, {&__pyx_n_s_K_F1, __pyx_k_K_F1, sizeof(__pyx_k_K_F1), 0, 0, 1, 1}, {&__pyx_n_s_K_F10, __pyx_k_K_F10, sizeof(__pyx_k_K_F10), 0, 0, 1, 1}, {&__pyx_n_s_K_F11, __pyx_k_K_F11, sizeof(__pyx_k_K_F11), 0, 0, 1, 1}, {&__pyx_n_s_K_F12, __pyx_k_K_F12, sizeof(__pyx_k_K_F12), 0, 0, 1, 1}, {&__pyx_n_s_K_F13, __pyx_k_K_F13, sizeof(__pyx_k_K_F13), 0, 0, 1, 1}, {&__pyx_n_s_K_F14, __pyx_k_K_F14, sizeof(__pyx_k_K_F14), 0, 0, 1, 1}, {&__pyx_n_s_K_F15, __pyx_k_K_F15, sizeof(__pyx_k_K_F15), 0, 0, 1, 1}, {&__pyx_n_s_K_F16, __pyx_k_K_F16, sizeof(__pyx_k_K_F16), 0, 0, 1, 1}, {&__pyx_n_s_K_F17, __pyx_k_K_F17, sizeof(__pyx_k_K_F17), 0, 0, 1, 1}, {&__pyx_n_s_K_F18, __pyx_k_K_F18, sizeof(__pyx_k_K_F18), 0, 0, 1, 1}, {&__pyx_n_s_K_F19, __pyx_k_K_F19, sizeof(__pyx_k_K_F19), 0, 0, 1, 1}, {&__pyx_n_s_K_F2, __pyx_k_K_F2, sizeof(__pyx_k_K_F2), 0, 0, 1, 1}, {&__pyx_n_s_K_F20, __pyx_k_K_F20, sizeof(__pyx_k_K_F20), 0, 0, 1, 1}, {&__pyx_n_s_K_F21, __pyx_k_K_F21, sizeof(__pyx_k_K_F21), 0, 0, 1, 1}, {&__pyx_n_s_K_F22, __pyx_k_K_F22, sizeof(__pyx_k_K_F22), 0, 0, 1, 1}, {&__pyx_n_s_K_F23, __pyx_k_K_F23, sizeof(__pyx_k_K_F23), 0, 0, 1, 1}, {&__pyx_n_s_K_F24, __pyx_k_K_F24, sizeof(__pyx_k_K_F24), 0, 0, 1, 1}, {&__pyx_n_s_K_F3, __pyx_k_K_F3, sizeof(__pyx_k_K_F3), 0, 0, 1, 1}, {&__pyx_n_s_K_F4, __pyx_k_K_F4, sizeof(__pyx_k_K_F4), 0, 0, 1, 1}, {&__pyx_n_s_K_F5, __pyx_k_K_F5, sizeof(__pyx_k_K_F5), 0, 0, 1, 1}, {&__pyx_n_s_K_F6, __pyx_k_K_F6, sizeof(__pyx_k_K_F6), 0, 0, 1, 1}, {&__pyx_n_s_K_F7, __pyx_k_K_F7, sizeof(__pyx_k_K_F7), 0, 0, 1, 1}, {&__pyx_n_s_K_F8, __pyx_k_K_F8, sizeof(__pyx_k_K_F8), 0, 0, 1, 1}, {&__pyx_n_s_K_F9, __pyx_k_K_F9, sizeof(__pyx_k_K_F9), 0, 0, 1, 1}, {&__pyx_n_s_K_FIND, __pyx_k_K_FIND, sizeof(__pyx_k_K_FIND), 0, 0, 1, 1}, {&__pyx_n_s_K_FIRST, __pyx_k_K_FIRST, sizeof(__pyx_k_K_FIRST), 0, 0, 1, 1}, {&__pyx_n_s_K_GREATER, __pyx_k_K_GREATER, sizeof(__pyx_k_K_GREATER), 0, 0, 1, 1}, {&__pyx_n_s_K_HASH, __pyx_k_K_HASH, sizeof(__pyx_k_K_HASH), 0, 0, 1, 1}, {&__pyx_n_s_K_HELP, __pyx_k_K_HELP, sizeof(__pyx_k_K_HELP), 0, 0, 1, 1}, {&__pyx_n_s_K_HOME, __pyx_k_K_HOME, sizeof(__pyx_k_K_HOME), 0, 0, 1, 1}, {&__pyx_n_s_K_INSERT, __pyx_k_K_INSERT, sizeof(__pyx_k_K_INSERT), 0, 0, 1, 1}, {&__pyx_n_s_K_KBDILLUMDOWN, __pyx_k_K_KBDILLUMDOWN, sizeof(__pyx_k_K_KBDILLUMDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_KBDILLUMTOGGLE, __pyx_k_K_KBDILLUMTOGGLE, sizeof(__pyx_k_K_KBDILLUMTOGGLE), 0, 0, 1, 1}, {&__pyx_n_s_K_KBDILLUMUP, __pyx_k_K_KBDILLUMUP, sizeof(__pyx_k_K_KBDILLUMUP), 0, 0, 1, 1}, {&__pyx_n_s_K_KP0, __pyx_k_K_KP0, sizeof(__pyx_k_K_KP0), 0, 0, 1, 1}, {&__pyx_n_s_K_KP1, __pyx_k_K_KP1, sizeof(__pyx_k_K_KP1), 0, 0, 1, 1}, {&__pyx_n_s_K_KP2, __pyx_k_K_KP2, sizeof(__pyx_k_K_KP2), 0, 0, 1, 1}, {&__pyx_n_s_K_KP3, __pyx_k_K_KP3, sizeof(__pyx_k_K_KP3), 0, 0, 1, 1}, {&__pyx_n_s_K_KP4, __pyx_k_K_KP4, sizeof(__pyx_k_K_KP4), 0, 0, 1, 1}, {&__pyx_n_s_K_KP5, __pyx_k_K_KP5, sizeof(__pyx_k_K_KP5), 0, 0, 1, 1}, {&__pyx_n_s_K_KP6, __pyx_k_K_KP6, sizeof(__pyx_k_K_KP6), 0, 0, 1, 1}, {&__pyx_n_s_K_KP7, __pyx_k_K_KP7, sizeof(__pyx_k_K_KP7), 0, 0, 1, 1}, {&__pyx_n_s_K_KP8, __pyx_k_K_KP8, sizeof(__pyx_k_K_KP8), 0, 0, 1, 1}, {&__pyx_n_s_K_KP9, __pyx_k_K_KP9, sizeof(__pyx_k_K_KP9), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_0, __pyx_k_K_KP_0, sizeof(__pyx_k_K_KP_0), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_00, __pyx_k_K_KP_00, sizeof(__pyx_k_K_KP_00), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_000, __pyx_k_K_KP_000, sizeof(__pyx_k_K_KP_000), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_1, __pyx_k_K_KP_1, sizeof(__pyx_k_K_KP_1), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_2, __pyx_k_K_KP_2, sizeof(__pyx_k_K_KP_2), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_3, __pyx_k_K_KP_3, sizeof(__pyx_k_K_KP_3), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_4, __pyx_k_K_KP_4, sizeof(__pyx_k_K_KP_4), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_5, __pyx_k_K_KP_5, sizeof(__pyx_k_K_KP_5), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_6, __pyx_k_K_KP_6, sizeof(__pyx_k_K_KP_6), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_7, __pyx_k_K_KP_7, sizeof(__pyx_k_K_KP_7), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_8, __pyx_k_K_KP_8, sizeof(__pyx_k_K_KP_8), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_9, __pyx_k_K_KP_9, sizeof(__pyx_k_K_KP_9), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_A, __pyx_k_K_KP_A, sizeof(__pyx_k_K_KP_A), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_AMPERSAND, __pyx_k_K_KP_AMPERSAND, sizeof(__pyx_k_K_KP_AMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_AT, __pyx_k_K_KP_AT, sizeof(__pyx_k_K_KP_AT), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_B, __pyx_k_K_KP_B, sizeof(__pyx_k_K_KP_B), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_BACKSPACE, __pyx_k_K_KP_BACKSPACE, sizeof(__pyx_k_K_KP_BACKSPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_BINARY, __pyx_k_K_KP_BINARY, sizeof(__pyx_k_K_KP_BINARY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_C, __pyx_k_K_KP_C, sizeof(__pyx_k_K_KP_C), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_CLEAR, __pyx_k_K_KP_CLEAR, sizeof(__pyx_k_K_KP_CLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_CLEARENTRY, __pyx_k_K_KP_CLEARENTRY, sizeof(__pyx_k_K_KP_CLEARENTRY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_COLON, __pyx_k_K_KP_COLON, sizeof(__pyx_k_K_KP_COLON), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_COMMA, __pyx_k_K_KP_COMMA, sizeof(__pyx_k_K_KP_COMMA), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_D, __pyx_k_K_KP_D, sizeof(__pyx_k_K_KP_D), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DBLAMPERSAND, __pyx_k_K_KP_DBLAMPERSAND, sizeof(__pyx_k_K_KP_DBLAMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DBLVERTICALBAR, __pyx_k_K_KP_DBLVERTICALBAR, sizeof(__pyx_k_K_KP_DBLVERTICALBAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DECIMAL, __pyx_k_K_KP_DECIMAL, sizeof(__pyx_k_K_KP_DECIMAL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DIVIDE, __pyx_k_K_KP_DIVIDE, sizeof(__pyx_k_K_KP_DIVIDE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_E, __pyx_k_K_KP_E, sizeof(__pyx_k_K_KP_E), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_ENTER, __pyx_k_K_KP_ENTER, sizeof(__pyx_k_K_KP_ENTER), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_EQUALS, __pyx_k_K_KP_EQUALS, sizeof(__pyx_k_K_KP_EQUALS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_EQUALSAS400, __pyx_k_K_KP_EQUALSAS400, sizeof(__pyx_k_K_KP_EQUALSAS400), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_EXCLAM, __pyx_k_K_KP_EXCLAM, sizeof(__pyx_k_K_KP_EXCLAM), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_F, __pyx_k_K_KP_F, sizeof(__pyx_k_K_KP_F), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_GREATER, __pyx_k_K_KP_GREATER, sizeof(__pyx_k_K_KP_GREATER), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_HASH, __pyx_k_K_KP_HASH, sizeof(__pyx_k_K_KP_HASH), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_HEXADECIMAL, __pyx_k_K_KP_HEXADECIMAL, sizeof(__pyx_k_K_KP_HEXADECIMAL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_LEFTBRACE, __pyx_k_K_KP_LEFTBRACE, sizeof(__pyx_k_K_KP_LEFTBRACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_LEFTPAREN, __pyx_k_K_KP_LEFTPAREN, sizeof(__pyx_k_K_KP_LEFTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_LESS, __pyx_k_K_KP_LESS, sizeof(__pyx_k_K_KP_LESS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMADD, __pyx_k_K_KP_MEMADD, sizeof(__pyx_k_K_KP_MEMADD), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMCLEAR, __pyx_k_K_KP_MEMCLEAR, sizeof(__pyx_k_K_KP_MEMCLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMDIVIDE, __pyx_k_K_KP_MEMDIVIDE, sizeof(__pyx_k_K_KP_MEMDIVIDE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMMULTIPLY, __pyx_k_K_KP_MEMMULTIPLY, sizeof(__pyx_k_K_KP_MEMMULTIPLY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMRECALL, __pyx_k_K_KP_MEMRECALL, sizeof(__pyx_k_K_KP_MEMRECALL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMSTORE, __pyx_k_K_KP_MEMSTORE, sizeof(__pyx_k_K_KP_MEMSTORE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMSUBTRACT, __pyx_k_K_KP_MEMSUBTRACT, sizeof(__pyx_k_K_KP_MEMSUBTRACT), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MINUS, __pyx_k_K_KP_MINUS, sizeof(__pyx_k_K_KP_MINUS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MULTIPLY, __pyx_k_K_KP_MULTIPLY, sizeof(__pyx_k_K_KP_MULTIPLY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_OCTAL, __pyx_k_K_KP_OCTAL, sizeof(__pyx_k_K_KP_OCTAL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PERCENT, __pyx_k_K_KP_PERCENT, sizeof(__pyx_k_K_KP_PERCENT), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PERIOD, __pyx_k_K_KP_PERIOD, sizeof(__pyx_k_K_KP_PERIOD), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PLUS, __pyx_k_K_KP_PLUS, sizeof(__pyx_k_K_KP_PLUS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PLUSMINUS, __pyx_k_K_KP_PLUSMINUS, sizeof(__pyx_k_K_KP_PLUSMINUS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_POWER, __pyx_k_K_KP_POWER, sizeof(__pyx_k_K_KP_POWER), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_RIGHTBRACE, __pyx_k_K_KP_RIGHTBRACE, sizeof(__pyx_k_K_KP_RIGHTBRACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_RIGHTPAREN, __pyx_k_K_KP_RIGHTPAREN, sizeof(__pyx_k_K_KP_RIGHTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_SPACE, __pyx_k_K_KP_SPACE, sizeof(__pyx_k_K_KP_SPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_TAB, __pyx_k_K_KP_TAB, sizeof(__pyx_k_K_KP_TAB), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_VERTICALBAR, __pyx_k_K_KP_VERTICALBAR, sizeof(__pyx_k_K_KP_VERTICALBAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_XOR, __pyx_k_K_KP_XOR, sizeof(__pyx_k_K_KP_XOR), 0, 0, 1, 1}, {&__pyx_n_s_K_LALT, __pyx_k_K_LALT, sizeof(__pyx_k_K_LALT), 0, 0, 1, 1}, {&__pyx_n_s_K_LAST, __pyx_k_K_LAST, sizeof(__pyx_k_K_LAST), 0, 0, 1, 1}, {&__pyx_n_s_K_LCTRL, __pyx_k_K_LCTRL, sizeof(__pyx_k_K_LCTRL), 0, 0, 1, 1}, {&__pyx_n_s_K_LEFT, __pyx_k_K_LEFT, sizeof(__pyx_k_K_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_K_LEFTBRACKET, __pyx_k_K_LEFTBRACKET, sizeof(__pyx_k_K_LEFTBRACKET), 0, 0, 1, 1}, {&__pyx_n_s_K_LEFTPAREN, __pyx_k_K_LEFTPAREN, sizeof(__pyx_k_K_LEFTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_LESS, __pyx_k_K_LESS, sizeof(__pyx_k_K_LESS), 0, 0, 1, 1}, {&__pyx_n_s_K_LGUI, __pyx_k_K_LGUI, sizeof(__pyx_k_K_LGUI), 0, 0, 1, 1}, {&__pyx_n_s_K_LMETA, __pyx_k_K_LMETA, sizeof(__pyx_k_K_LMETA), 0, 0, 1, 1}, {&__pyx_n_s_K_LSHIFT, __pyx_k_K_LSHIFT, sizeof(__pyx_k_K_LSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_K_LSUPER, __pyx_k_K_LSUPER, sizeof(__pyx_k_K_LSUPER), 0, 0, 1, 1}, {&__pyx_n_s_K_MAIL, __pyx_k_K_MAIL, sizeof(__pyx_k_K_MAIL), 0, 0, 1, 1}, {&__pyx_n_s_K_MEDIASELECT, __pyx_k_K_MEDIASELECT, sizeof(__pyx_k_K_MEDIASELECT), 0, 0, 1, 1}, {&__pyx_n_s_K_MENU, __pyx_k_K_MENU, sizeof(__pyx_k_K_MENU), 0, 0, 1, 1}, {&__pyx_n_s_K_MINUS, __pyx_k_K_MINUS, sizeof(__pyx_k_K_MINUS), 0, 0, 1, 1}, {&__pyx_n_s_K_MODE, __pyx_k_K_MODE, sizeof(__pyx_k_K_MODE), 0, 0, 1, 1}, {&__pyx_n_s_K_MUTE, __pyx_k_K_MUTE, sizeof(__pyx_k_K_MUTE), 0, 0, 1, 1}, {&__pyx_n_s_K_NUMLOCK, __pyx_k_K_NUMLOCK, sizeof(__pyx_k_K_NUMLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_NUMLOCKCLEAR, __pyx_k_K_NUMLOCKCLEAR, sizeof(__pyx_k_K_NUMLOCKCLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_OPER, __pyx_k_K_OPER, sizeof(__pyx_k_K_OPER), 0, 0, 1, 1}, {&__pyx_n_s_K_OUT, __pyx_k_K_OUT, sizeof(__pyx_k_K_OUT), 0, 0, 1, 1}, {&__pyx_n_s_K_PAGEDOWN, __pyx_k_K_PAGEDOWN, sizeof(__pyx_k_K_PAGEDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_PAGEUP, __pyx_k_K_PAGEUP, sizeof(__pyx_k_K_PAGEUP), 0, 0, 1, 1}, {&__pyx_n_s_K_PASTE, __pyx_k_K_PASTE, sizeof(__pyx_k_K_PASTE), 0, 0, 1, 1}, {&__pyx_n_s_K_PAUSE, __pyx_k_K_PAUSE, sizeof(__pyx_k_K_PAUSE), 0, 0, 1, 1}, {&__pyx_n_s_K_PERCENT, __pyx_k_K_PERCENT, sizeof(__pyx_k_K_PERCENT), 0, 0, 1, 1}, {&__pyx_n_s_K_PERIOD, __pyx_k_K_PERIOD, sizeof(__pyx_k_K_PERIOD), 0, 0, 1, 1}, {&__pyx_n_s_K_PLUS, __pyx_k_K_PLUS, sizeof(__pyx_k_K_PLUS), 0, 0, 1, 1}, {&__pyx_n_s_K_POWER, __pyx_k_K_POWER, sizeof(__pyx_k_K_POWER), 0, 0, 1, 1}, {&__pyx_n_s_K_PRINT, __pyx_k_K_PRINT, sizeof(__pyx_k_K_PRINT), 0, 0, 1, 1}, {&__pyx_n_s_K_PRINTSCREEN, __pyx_k_K_PRINTSCREEN, sizeof(__pyx_k_K_PRINTSCREEN), 0, 0, 1, 1}, {&__pyx_n_s_K_PRIOR, __pyx_k_K_PRIOR, sizeof(__pyx_k_K_PRIOR), 0, 0, 1, 1}, {&__pyx_n_s_K_QUESTION, __pyx_k_K_QUESTION, sizeof(__pyx_k_K_QUESTION), 0, 0, 1, 1}, {&__pyx_n_s_K_QUOTE, __pyx_k_K_QUOTE, sizeof(__pyx_k_K_QUOTE), 0, 0, 1, 1}, {&__pyx_n_s_K_QUOTEDBL, __pyx_k_K_QUOTEDBL, sizeof(__pyx_k_K_QUOTEDBL), 0, 0, 1, 1}, {&__pyx_n_s_K_RALT, __pyx_k_K_RALT, sizeof(__pyx_k_K_RALT), 0, 0, 1, 1}, {&__pyx_n_s_K_RCTRL, __pyx_k_K_RCTRL, sizeof(__pyx_k_K_RCTRL), 0, 0, 1, 1}, {&__pyx_n_s_K_RETURN, __pyx_k_K_RETURN, sizeof(__pyx_k_K_RETURN), 0, 0, 1, 1}, {&__pyx_n_s_K_RETURN2, __pyx_k_K_RETURN2, sizeof(__pyx_k_K_RETURN2), 0, 0, 1, 1}, {&__pyx_n_s_K_RGUI, __pyx_k_K_RGUI, sizeof(__pyx_k_K_RGUI), 0, 0, 1, 1}, {&__pyx_n_s_K_RIGHT, __pyx_k_K_RIGHT, sizeof(__pyx_k_K_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_K_RIGHTBRACKET, __pyx_k_K_RIGHTBRACKET, sizeof(__pyx_k_K_RIGHTBRACKET), 0, 0, 1, 1}, {&__pyx_n_s_K_RIGHTPAREN, __pyx_k_K_RIGHTPAREN, sizeof(__pyx_k_K_RIGHTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_RMETA, __pyx_k_K_RMETA, sizeof(__pyx_k_K_RMETA), 0, 0, 1, 1}, {&__pyx_n_s_K_RSHIFT, __pyx_k_K_RSHIFT, sizeof(__pyx_k_K_RSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_K_RSUPER, __pyx_k_K_RSUPER, sizeof(__pyx_k_K_RSUPER), 0, 0, 1, 1}, {&__pyx_n_s_K_SCROLLLOCK, __pyx_k_K_SCROLLLOCK, sizeof(__pyx_k_K_SCROLLLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_SCROLLOCK, __pyx_k_K_SCROLLOCK, sizeof(__pyx_k_K_SCROLLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_SELECT, __pyx_k_K_SELECT, sizeof(__pyx_k_K_SELECT), 0, 0, 1, 1}, {&__pyx_n_s_K_SEMICOLON, __pyx_k_K_SEMICOLON, sizeof(__pyx_k_K_SEMICOLON), 0, 0, 1, 1}, {&__pyx_n_s_K_SEPARATOR, __pyx_k_K_SEPARATOR, sizeof(__pyx_k_K_SEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_SLASH, __pyx_k_K_SLASH, sizeof(__pyx_k_K_SLASH), 0, 0, 1, 1}, {&__pyx_n_s_K_SLEEP, __pyx_k_K_SLEEP, sizeof(__pyx_k_K_SLEEP), 0, 0, 1, 1}, {&__pyx_n_s_K_SPACE, __pyx_k_K_SPACE, sizeof(__pyx_k_K_SPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_STOP, __pyx_k_K_STOP, sizeof(__pyx_k_K_STOP), 0, 0, 1, 1}, {&__pyx_n_s_K_SYSREQ, __pyx_k_K_SYSREQ, sizeof(__pyx_k_K_SYSREQ), 0, 0, 1, 1}, {&__pyx_n_s_K_TAB, __pyx_k_K_TAB, sizeof(__pyx_k_K_TAB), 0, 0, 1, 1}, {&__pyx_n_s_K_THOUSANDSSEPARATOR, __pyx_k_K_THOUSANDSSEPARATOR, sizeof(__pyx_k_K_THOUSANDSSEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_UNDERSCORE, __pyx_k_K_UNDERSCORE, sizeof(__pyx_k_K_UNDERSCORE), 0, 0, 1, 1}, {&__pyx_n_s_K_UNDO, __pyx_k_K_UNDO, sizeof(__pyx_k_K_UNDO), 0, 0, 1, 1}, {&__pyx_n_s_K_UNKNOWN, __pyx_k_K_UNKNOWN, sizeof(__pyx_k_K_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_UP, __pyx_k_K_UP, sizeof(__pyx_k_K_UP), 0, 0, 1, 1}, {&__pyx_n_s_K_VOLUMEDOWN, __pyx_k_K_VOLUMEDOWN, sizeof(__pyx_k_K_VOLUMEDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_VOLUMEUP, __pyx_k_K_VOLUMEUP, sizeof(__pyx_k_K_VOLUMEUP), 0, 0, 1, 1}, {&__pyx_n_s_K_WWW, __pyx_k_K_WWW, sizeof(__pyx_k_K_WWW), 0, 0, 1, 1}, {&__pyx_n_s_K_a, __pyx_k_K_a, sizeof(__pyx_k_K_a), 0, 0, 1, 1}, {&__pyx_n_s_K_b, __pyx_k_K_b, sizeof(__pyx_k_K_b), 0, 0, 1, 1}, {&__pyx_n_s_K_c, __pyx_k_K_c, sizeof(__pyx_k_K_c), 0, 0, 1, 1}, {&__pyx_n_s_K_d, __pyx_k_K_d, sizeof(__pyx_k_K_d), 0, 0, 1, 1}, {&__pyx_n_s_K_e, __pyx_k_K_e, sizeof(__pyx_k_K_e), 0, 0, 1, 1}, {&__pyx_n_s_K_f, __pyx_k_K_f, sizeof(__pyx_k_K_f), 0, 0, 1, 1}, {&__pyx_n_s_K_g, __pyx_k_K_g, sizeof(__pyx_k_K_g), 0, 0, 1, 1}, {&__pyx_n_s_K_h, __pyx_k_K_h, sizeof(__pyx_k_K_h), 0, 0, 1, 1}, {&__pyx_n_s_K_i, __pyx_k_K_i, sizeof(__pyx_k_K_i), 0, 0, 1, 1}, {&__pyx_n_s_K_j, __pyx_k_K_j, sizeof(__pyx_k_K_j), 0, 0, 1, 1}, {&__pyx_n_s_K_k, __pyx_k_K_k, sizeof(__pyx_k_K_k), 0, 0, 1, 1}, {&__pyx_n_s_K_l, __pyx_k_K_l, sizeof(__pyx_k_K_l), 0, 0, 1, 1}, {&__pyx_n_s_K_m, __pyx_k_K_m, sizeof(__pyx_k_K_m), 0, 0, 1, 1}, {&__pyx_n_s_K_n, __pyx_k_K_n, sizeof(__pyx_k_K_n), 0, 0, 1, 1}, {&__pyx_n_s_K_o, __pyx_k_K_o, sizeof(__pyx_k_K_o), 0, 0, 1, 1}, {&__pyx_n_s_K_p, __pyx_k_K_p, sizeof(__pyx_k_K_p), 0, 0, 1, 1}, {&__pyx_n_s_K_q, __pyx_k_K_q, sizeof(__pyx_k_K_q), 0, 0, 1, 1}, {&__pyx_n_s_K_r, __pyx_k_K_r, sizeof(__pyx_k_K_r), 0, 0, 1, 1}, {&__pyx_n_s_K_s, __pyx_k_K_s, sizeof(__pyx_k_K_s), 0, 0, 1, 1}, {&__pyx_n_s_K_t, __pyx_k_K_t, sizeof(__pyx_k_K_t), 0, 0, 1, 1}, {&__pyx_n_s_K_u, __pyx_k_K_u, sizeof(__pyx_k_K_u), 0, 0, 1, 1}, {&__pyx_n_s_K_v, __pyx_k_K_v, sizeof(__pyx_k_K_v), 0, 0, 1, 1}, {&__pyx_n_s_K_w, __pyx_k_K_w, sizeof(__pyx_k_K_w), 0, 0, 1, 1}, {&__pyx_n_s_K_x, __pyx_k_K_x, sizeof(__pyx_k_K_x), 0, 0, 1, 1}, {&__pyx_n_s_K_y, __pyx_k_K_y, sizeof(__pyx_k_K_y), 0, 0, 1, 1}, {&__pyx_n_s_K_z, __pyx_k_K_z, sizeof(__pyx_k_K_z), 0, 0, 1, 1}, {&__pyx_n_s_LASTEVENT, __pyx_k_LASTEVENT, sizeof(__pyx_k_LASTEVENT), 0, 0, 1, 1}, {&__pyx_n_s_LIL_ENDIAN, __pyx_k_LIL_ENDIAN, sizeof(__pyx_k_LIL_ENDIAN), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONDOWN, __pyx_k_MOUSEBUTTONDOWN, sizeof(__pyx_k_MOUSEBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONUP, __pyx_k_MOUSEBUTTONUP, sizeof(__pyx_k_MOUSEBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEMOTION, __pyx_k_MOUSEMOTION, sizeof(__pyx_k_MOUSEMOTION), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEWHEEL, __pyx_k_MOUSEWHEEL, sizeof(__pyx_k_MOUSEWHEEL), 0, 0, 1, 1}, {&__pyx_n_s_MULTIGESTURE, __pyx_k_MULTIGESTURE, sizeof(__pyx_k_MULTIGESTURE), 0, 0, 1, 1}, {&__pyx_n_s_NOEVENT, __pyx_k_NOEVENT, sizeof(__pyx_k_NOEVENT), 0, 0, 1, 1}, {&__pyx_n_s_NOFRAME, __pyx_k_NOFRAME, sizeof(__pyx_k_NOFRAME), 0, 0, 1, 1}, {&__pyx_n_s_OPENGL, __pyx_k_OPENGL, sizeof(__pyx_k_OPENGL), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGED, __pyx_k_POWERSTATE_CHARGED, sizeof(__pyx_k_POWERSTATE_CHARGED), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGING, __pyx_k_POWERSTATE_CHARGING, sizeof(__pyx_k_POWERSTATE_CHARGING), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_k_POWERSTATE_NO_BATTERY, sizeof(__pyx_k_POWERSTATE_NO_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_k_POWERSTATE_ON_BATTERY, sizeof(__pyx_k_POWERSTATE_ON_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_UNKNOWN, __pyx_k_POWERSTATE_UNKNOWN, sizeof(__pyx_k_POWERSTATE_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_QUIT, __pyx_k_QUIT, sizeof(__pyx_k_QUIT), 0, 0, 1, 1}, {&__pyx_n_s_RENDER_DEVICE_RESET, __pyx_k_RENDER_DEVICE_RESET, sizeof(__pyx_k_RENDER_DEVICE_RESET), 0, 0, 1, 1}, {&__pyx_n_s_RENDER_TARGETS_RESET, __pyx_k_RENDER_TARGETS_RESET, sizeof(__pyx_k_RENDER_TARGETS_RESET), 0, 0, 1, 1}, {&__pyx_n_s_RESIZABLE, __pyx_k_RESIZABLE, sizeof(__pyx_k_RESIZABLE), 0, 0, 1, 1}, {&__pyx_n_s_RLEACCEL, __pyx_k_RLEACCEL, sizeof(__pyx_k_RLEACCEL), 0, 0, 1, 1}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_SCRAP_TEXT, __pyx_k_SCRAP_TEXT, sizeof(__pyx_k_SCRAP_TEXT), 0, 0, 1, 1}, {&__pyx_n_s_SDL_VERSION_TUPLE, __pyx_k_SDL_VERSION_TUPLE, sizeof(__pyx_k_SDL_VERSION_TUPLE), 0, 0, 1, 1}, {&__pyx_n_s_SENSORUPDATE, __pyx_k_SENSORUPDATE, sizeof(__pyx_k_SENSORUPDATE), 0, 0, 1, 1}, {&__pyx_n_s_SRCALPHA, __pyx_k_SRCALPHA, sizeof(__pyx_k_SRCALPHA), 0, 0, 1, 1}, {&__pyx_n_s_SRCCOLORKEY, __pyx_k_SRCCOLORKEY, sizeof(__pyx_k_SRCCOLORKEY), 0, 0, 1, 1}, {&__pyx_n_s_SWSURFACE, __pyx_k_SWSURFACE, sizeof(__pyx_k_SWSURFACE), 0, 0, 1, 1}, {&__pyx_n_s_SYSWMEVENT, __pyx_k_SYSWMEVENT, sizeof(__pyx_k_SYSWMEVENT), 0, 0, 1, 1}, {&__pyx_n_s_TEXTEDITING, __pyx_k_TEXTEDITING, sizeof(__pyx_k_TEXTEDITING), 0, 0, 1, 1}, {&__pyx_n_s_TEXTINPUT, __pyx_k_TEXTINPUT, sizeof(__pyx_k_TEXTINPUT), 0, 0, 1, 1}, {&__pyx_n_s_TOUCH_MOUSEID, __pyx_k_TOUCH_MOUSEID, sizeof(__pyx_k_TOUCH_MOUSEID), 0, 0, 1, 1}, {&__pyx_n_s_USEREVENT, __pyx_k_USEREVENT, sizeof(__pyx_k_USEREVENT), 0, 0, 1, 1}, {&__pyx_n_s_VIDEOEXPOSE, __pyx_k_VIDEOEXPOSE, sizeof(__pyx_k_VIDEOEXPOSE), 0, 0, 1, 1}, {&__pyx_n_s_VIDEORESIZE, __pyx_k_VIDEORESIZE, sizeof(__pyx_k_VIDEORESIZE), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWEVENT, __pyx_k_WINDOWEVENT, sizeof(__pyx_k_WINDOWEVENT), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWMOVED, __pyx_k_WINDOWMOVED, sizeof(__pyx_k_WINDOWMOVED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWPOS_CENTERED, __pyx_k_WINDOWPOS_CENTERED, sizeof(__pyx_k_WINDOWPOS_CENTERED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWPOS_UNDEFINED, __pyx_k_WINDOWPOS_UNDEFINED, sizeof(__pyx_k_WINDOWPOS_UNDEFINED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_ALLOW_HIGHDPI, __pyx_k_WINDOW_ALLOW_HIGHDPI, sizeof(__pyx_k_WINDOW_ALLOW_HIGHDPI), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_BORDERLESS, __pyx_k_WINDOW_BORDERLESS, sizeof(__pyx_k_WINDOW_BORDERLESS), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_FOREIGN, __pyx_k_WINDOW_FOREIGN, sizeof(__pyx_k_WINDOW_FOREIGN), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_FULLSCREEN, __pyx_k_WINDOW_FULLSCREEN, sizeof(__pyx_k_WINDOW_FULLSCREEN), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP, __pyx_k_WINDOW_FULLSCREEN_DESKTOP, sizeof(__pyx_k_WINDOW_FULLSCREEN_DESKTOP), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_HIDDEN, __pyx_k_WINDOW_HIDDEN, sizeof(__pyx_k_WINDOW_HIDDEN), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_INPUT_FOCUS, __pyx_k_WINDOW_INPUT_FOCUS, sizeof(__pyx_k_WINDOW_INPUT_FOCUS), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_INPUT_GRABBED, __pyx_k_WINDOW_INPUT_GRABBED, sizeof(__pyx_k_WINDOW_INPUT_GRABBED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_MAXIMIZED, __pyx_k_WINDOW_MAXIMIZED, sizeof(__pyx_k_WINDOW_MAXIMIZED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_MINIMIZED, __pyx_k_WINDOW_MINIMIZED, sizeof(__pyx_k_WINDOW_MINIMIZED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_NOFRAME, __pyx_k_WINDOW_NOFRAME, sizeof(__pyx_k_WINDOW_NOFRAME), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_OPENGL, __pyx_k_WINDOW_OPENGL, sizeof(__pyx_k_WINDOW_OPENGL), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_RESIZABLE, __pyx_k_WINDOW_RESIZABLE, sizeof(__pyx_k_WINDOW_RESIZABLE), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_SHOWN, __pyx_k_WINDOW_SHOWN, sizeof(__pyx_k_WINDOW_SHOWN), 0, 0, 1, 1}, {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_s_text_plain, __pyx_k_text_plain, sizeof(__pyx_k_text_plain), 0, 0, 1, 0}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { return 0; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); __Pyx_RefNannyFinishContext(); return 0; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1073741824 = PyInt_FromLong(1073741824L); if (unlikely(!__pyx_int_1073741824)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2147483648 = PyInt_FromString((char *)"2147483648", 0, 0); if (unlikely(!__pyx_int_2147483648)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_locals(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_locals}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "locals", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initlocals(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initlocals(void) #else __Pyx_PyMODINIT_FUNC PyInit_locals(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_locals(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_locals(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'locals' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("locals", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "locals" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_locals(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__locals) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.locals")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.locals", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/locals.pyx":4 * cimport sdl2 * * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * from pygame_sdl2.color import Color * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Rect)) __PYX_ERR(0, 4, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":5 * * from pygame_sdl2.rect import Rect * from pygame_sdl2.color import Color # <<<<<<<<<<<<<< * * include "event_list.pxi" */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_Color); __Pyx_GIVEREF(__pyx_n_s_Color); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Color)) __PYX_ERR(0, 5, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_color, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Color, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":4 * # Do not edit! * * NOEVENT = SDL_FIRSTEVENT # <<<<<<<<<<<<<< * QUIT = SDL_QUIT * APP_TERMINATING = SDL_APP_TERMINATING */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FIRSTEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOEVENT, __pyx_t_2) < 0) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":5 * * NOEVENT = SDL_FIRSTEVENT * QUIT = SDL_QUIT # <<<<<<<<<<<<<< * APP_TERMINATING = SDL_APP_TERMINATING * APP_LOWMEMORY = SDL_APP_LOWMEMORY */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_QUIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUIT, __pyx_t_2) < 0) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":6 * NOEVENT = SDL_FIRSTEVENT * QUIT = SDL_QUIT * APP_TERMINATING = SDL_APP_TERMINATING # <<<<<<<<<<<<<< * APP_LOWMEMORY = SDL_APP_LOWMEMORY * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_TERMINATING); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_TERMINATING, __pyx_t_2) < 0) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":7 * QUIT = SDL_QUIT * APP_TERMINATING = SDL_APP_TERMINATING * APP_LOWMEMORY = SDL_APP_LOWMEMORY # <<<<<<<<<<<<<< * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_LOWMEMORY); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_LOWMEMORY, __pyx_t_2) < 0) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":8 * APP_TERMINATING = SDL_APP_TERMINATING * APP_LOWMEMORY = SDL_APP_LOWMEMORY * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND # <<<<<<<<<<<<<< * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERBACKGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_WILLENTERBACKGROUND, __pyx_t_2) < 0) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":9 * APP_LOWMEMORY = SDL_APP_LOWMEMORY * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND # <<<<<<<<<<<<<< * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERBACKGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_DIDENTERBACKGROUND, __pyx_t_2) < 0) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":10 * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND # <<<<<<<<<<<<<< * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND * DISPLAYEVENT = SDL_DISPLAYEVENT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERFOREGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_WILLENTERFOREGROUND, __pyx_t_2) < 0) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":11 * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND # <<<<<<<<<<<<<< * DISPLAYEVENT = SDL_DISPLAYEVENT * WINDOWEVENT = SDL_WINDOWEVENT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERFOREGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_DIDENTERFOREGROUND, __pyx_t_2) < 0) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":12 * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND * DISPLAYEVENT = SDL_DISPLAYEVENT # <<<<<<<<<<<<<< * WINDOWEVENT = SDL_WINDOWEVENT * SYSWMEVENT = SDL_SYSWMEVENT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DISPLAYEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DISPLAYEVENT, __pyx_t_2) < 0) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":13 * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND * DISPLAYEVENT = SDL_DISPLAYEVENT * WINDOWEVENT = SDL_WINDOWEVENT # <<<<<<<<<<<<<< * SYSWMEVENT = SDL_SYSWMEVENT * KEYDOWN = SDL_KEYDOWN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWEVENT, __pyx_t_2) < 0) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":14 * DISPLAYEVENT = SDL_DISPLAYEVENT * WINDOWEVENT = SDL_WINDOWEVENT * SYSWMEVENT = SDL_SYSWMEVENT # <<<<<<<<<<<<<< * KEYDOWN = SDL_KEYDOWN * KEYUP = SDL_KEYUP */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_SYSWMEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSWMEVENT, __pyx_t_2) < 0) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":15 * WINDOWEVENT = SDL_WINDOWEVENT * SYSWMEVENT = SDL_SYSWMEVENT * KEYDOWN = SDL_KEYDOWN # <<<<<<<<<<<<<< * KEYUP = SDL_KEYUP * TEXTEDITING = SDL_TEXTEDITING */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEYDOWN, __pyx_t_2) < 0) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":16 * SYSWMEVENT = SDL_SYSWMEVENT * KEYDOWN = SDL_KEYDOWN * KEYUP = SDL_KEYUP # <<<<<<<<<<<<<< * TEXTEDITING = SDL_TEXTEDITING * TEXTINPUT = SDL_TEXTINPUT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEYUP, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":17 * KEYDOWN = SDL_KEYDOWN * KEYUP = SDL_KEYUP * TEXTEDITING = SDL_TEXTEDITING # <<<<<<<<<<<<<< * TEXTINPUT = SDL_TEXTINPUT * KEYMAPCHANGED = SDL_KEYMAPCHANGED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTEDITING); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TEXTEDITING, __pyx_t_2) < 0) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":18 * KEYUP = SDL_KEYUP * TEXTEDITING = SDL_TEXTEDITING * TEXTINPUT = SDL_TEXTINPUT # <<<<<<<<<<<<<< * KEYMAPCHANGED = SDL_KEYMAPCHANGED * MOUSEMOTION = SDL_MOUSEMOTION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTINPUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TEXTINPUT, __pyx_t_2) < 0) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":19 * TEXTEDITING = SDL_TEXTEDITING * TEXTINPUT = SDL_TEXTINPUT * KEYMAPCHANGED = SDL_KEYMAPCHANGED # <<<<<<<<<<<<<< * MOUSEMOTION = SDL_MOUSEMOTION * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYMAPCHANGED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEYMAPCHANGED, __pyx_t_2) < 0) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":20 * TEXTINPUT = SDL_TEXTINPUT * KEYMAPCHANGED = SDL_KEYMAPCHANGED * MOUSEMOTION = SDL_MOUSEMOTION # <<<<<<<<<<<<<< * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEMOTION, __pyx_t_2) < 0) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":21 * KEYMAPCHANGED = SDL_KEYMAPCHANGED * MOUSEMOTION = SDL_MOUSEMOTION * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN # <<<<<<<<<<<<<< * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP * MOUSEWHEEL = SDL_MOUSEWHEEL */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEBUTTONDOWN, __pyx_t_2) < 0) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":22 * MOUSEMOTION = SDL_MOUSEMOTION * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP # <<<<<<<<<<<<<< * MOUSEWHEEL = SDL_MOUSEWHEEL * JOYAXISMOTION = SDL_JOYAXISMOTION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEBUTTONUP, __pyx_t_2) < 0) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":23 * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP * MOUSEWHEEL = SDL_MOUSEWHEEL # <<<<<<<<<<<<<< * JOYAXISMOTION = SDL_JOYAXISMOTION * JOYBALLMOTION = SDL_JOYBALLMOTION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEWHEEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEWHEEL, __pyx_t_2) < 0) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":24 * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP * MOUSEWHEEL = SDL_MOUSEWHEEL * JOYAXISMOTION = SDL_JOYAXISMOTION # <<<<<<<<<<<<<< * JOYBALLMOTION = SDL_JOYBALLMOTION * JOYHATMOTION = SDL_JOYHATMOTION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYAXISMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYAXISMOTION, __pyx_t_2) < 0) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":25 * MOUSEWHEEL = SDL_MOUSEWHEEL * JOYAXISMOTION = SDL_JOYAXISMOTION * JOYBALLMOTION = SDL_JOYBALLMOTION # <<<<<<<<<<<<<< * JOYHATMOTION = SDL_JOYHATMOTION * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBALLMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYBALLMOTION, __pyx_t_2) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":26 * JOYAXISMOTION = SDL_JOYAXISMOTION * JOYBALLMOTION = SDL_JOYBALLMOTION * JOYHATMOTION = SDL_JOYHATMOTION # <<<<<<<<<<<<<< * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN * JOYBUTTONUP = SDL_JOYBUTTONUP */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYHATMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYHATMOTION, __pyx_t_2) < 0) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":27 * JOYBALLMOTION = SDL_JOYBALLMOTION * JOYHATMOTION = SDL_JOYHATMOTION * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN # <<<<<<<<<<<<<< * JOYBUTTONUP = SDL_JOYBUTTONUP * JOYDEVICEADDED = SDL_JOYDEVICEADDED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYBUTTONDOWN, __pyx_t_2) < 0) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":28 * JOYHATMOTION = SDL_JOYHATMOTION * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN * JOYBUTTONUP = SDL_JOYBUTTONUP # <<<<<<<<<<<<<< * JOYDEVICEADDED = SDL_JOYDEVICEADDED * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYBUTTONUP, __pyx_t_2) < 0) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":29 * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN * JOYBUTTONUP = SDL_JOYBUTTONUP * JOYDEVICEADDED = SDL_JOYDEVICEADDED # <<<<<<<<<<<<<< * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYDEVICEADDED, __pyx_t_2) < 0) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":30 * JOYBUTTONUP = SDL_JOYBUTTONUP * JOYDEVICEADDED = SDL_JOYDEVICEADDED * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED # <<<<<<<<<<<<<< * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYDEVICEREMOVED, __pyx_t_2) < 0) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":31 * JOYDEVICEADDED = SDL_JOYDEVICEADDED * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION # <<<<<<<<<<<<<< * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERAXISMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERAXISMOTION, __pyx_t_2) < 0) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":32 * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN # <<<<<<<<<<<<<< * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERBUTTONDOWN, __pyx_t_2) < 0) __PYX_ERR(1, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":33 * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP # <<<<<<<<<<<<<< * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERBUTTONUP, __pyx_t_2) < 0) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":34 * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED # <<<<<<<<<<<<<< * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERDEVICEADDED, __pyx_t_2) < 0) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":35 * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED # <<<<<<<<<<<<<< * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED * FINGERDOWN = SDL_FINGERDOWN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERDEVICEREMOVED, __pyx_t_2) < 0) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":36 * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED # <<<<<<<<<<<<<< * FINGERDOWN = SDL_FINGERDOWN * FINGERUP = SDL_FINGERUP */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMAPPED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERDEVICEREMAPPED, __pyx_t_2) < 0) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":37 * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED * FINGERDOWN = SDL_FINGERDOWN # <<<<<<<<<<<<<< * FINGERUP = SDL_FINGERUP * FINGERMOTION = SDL_FINGERMOTION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FINGERDOWN, __pyx_t_2) < 0) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":38 * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED * FINGERDOWN = SDL_FINGERDOWN * FINGERUP = SDL_FINGERUP # <<<<<<<<<<<<<< * FINGERMOTION = SDL_FINGERMOTION * DOLLARGESTURE = SDL_DOLLARGESTURE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FINGERUP, __pyx_t_2) < 0) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":39 * FINGERDOWN = SDL_FINGERDOWN * FINGERUP = SDL_FINGERUP * FINGERMOTION = SDL_FINGERMOTION # <<<<<<<<<<<<<< * DOLLARGESTURE = SDL_DOLLARGESTURE * DOLLARRECORD = SDL_DOLLARRECORD */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FINGERMOTION, __pyx_t_2) < 0) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":40 * FINGERUP = SDL_FINGERUP * FINGERMOTION = SDL_FINGERMOTION * DOLLARGESTURE = SDL_DOLLARGESTURE # <<<<<<<<<<<<<< * DOLLARRECORD = SDL_DOLLARRECORD * MULTIGESTURE = SDL_MULTIGESTURE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARGESTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOLLARGESTURE, __pyx_t_2) < 0) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":41 * FINGERMOTION = SDL_FINGERMOTION * DOLLARGESTURE = SDL_DOLLARGESTURE * DOLLARRECORD = SDL_DOLLARRECORD # <<<<<<<<<<<<<< * MULTIGESTURE = SDL_MULTIGESTURE * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARRECORD); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOLLARRECORD, __pyx_t_2) < 0) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":42 * DOLLARGESTURE = SDL_DOLLARGESTURE * DOLLARRECORD = SDL_DOLLARRECORD * MULTIGESTURE = SDL_MULTIGESTURE # <<<<<<<<<<<<<< * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE * DROPFILE = SDL_DROPFILE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MULTIGESTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MULTIGESTURE, __pyx_t_2) < 0) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":43 * DOLLARRECORD = SDL_DOLLARRECORD * MULTIGESTURE = SDL_MULTIGESTURE * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE # <<<<<<<<<<<<<< * DROPFILE = SDL_DROPFILE * DROPTEXT = SDL_DROPTEXT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CLIPBOARDUPDATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLIPBOARDUPDATE, __pyx_t_2) < 0) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":44 * MULTIGESTURE = SDL_MULTIGESTURE * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE * DROPFILE = SDL_DROPFILE # <<<<<<<<<<<<<< * DROPTEXT = SDL_DROPTEXT * DROPBEGIN = SDL_DROPBEGIN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DROPFILE, __pyx_t_2) < 0) __PYX_ERR(1, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":45 * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE * DROPFILE = SDL_DROPFILE * DROPTEXT = SDL_DROPTEXT # <<<<<<<<<<<<<< * DROPBEGIN = SDL_DROPBEGIN * DROPCOMPLETE = SDL_DROPCOMPLETE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPTEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DROPTEXT, __pyx_t_2) < 0) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":46 * DROPFILE = SDL_DROPFILE * DROPTEXT = SDL_DROPTEXT * DROPBEGIN = SDL_DROPBEGIN # <<<<<<<<<<<<<< * DROPCOMPLETE = SDL_DROPCOMPLETE * AUDIODEVICEADDED = SDL_AUDIODEVICEADDED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPBEGIN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DROPBEGIN, __pyx_t_2) < 0) __PYX_ERR(1, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":47 * DROPTEXT = SDL_DROPTEXT * DROPBEGIN = SDL_DROPBEGIN * DROPCOMPLETE = SDL_DROPCOMPLETE # <<<<<<<<<<<<<< * AUDIODEVICEADDED = SDL_AUDIODEVICEADDED * AUDIODEVICEREMOVED = SDL_AUDIODEVICEREMOVED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPCOMPLETE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DROPCOMPLETE, __pyx_t_2) < 0) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":48 * DROPBEGIN = SDL_DROPBEGIN * DROPCOMPLETE = SDL_DROPCOMPLETE * AUDIODEVICEADDED = SDL_AUDIODEVICEADDED # <<<<<<<<<<<<<< * AUDIODEVICEREMOVED = SDL_AUDIODEVICEREMOVED * SENSORUPDATE = SDL_SENSORUPDATE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_AUDIODEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_AUDIODEVICEADDED, __pyx_t_2) < 0) __PYX_ERR(1, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":49 * DROPCOMPLETE = SDL_DROPCOMPLETE * AUDIODEVICEADDED = SDL_AUDIODEVICEADDED * AUDIODEVICEREMOVED = SDL_AUDIODEVICEREMOVED # <<<<<<<<<<<<<< * SENSORUPDATE = SDL_SENSORUPDATE * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_AUDIODEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_AUDIODEVICEREMOVED, __pyx_t_2) < 0) __PYX_ERR(1, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":50 * AUDIODEVICEADDED = SDL_AUDIODEVICEADDED * AUDIODEVICEREMOVED = SDL_AUDIODEVICEREMOVED * SENSORUPDATE = SDL_SENSORUPDATE # <<<<<<<<<<<<<< * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET * RENDER_DEVICE_RESET = SDL_RENDER_DEVICE_RESET */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_SENSORUPDATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SENSORUPDATE, __pyx_t_2) < 0) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":51 * AUDIODEVICEREMOVED = SDL_AUDIODEVICEREMOVED * SENSORUPDATE = SDL_SENSORUPDATE * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET # <<<<<<<<<<<<<< * RENDER_DEVICE_RESET = SDL_RENDER_DEVICE_RESET * USEREVENT = SDL_USEREVENT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_TARGETS_RESET); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RENDER_TARGETS_RESET, __pyx_t_2) < 0) __PYX_ERR(1, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":52 * SENSORUPDATE = SDL_SENSORUPDATE * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET * RENDER_DEVICE_RESET = SDL_RENDER_DEVICE_RESET # <<<<<<<<<<<<<< * USEREVENT = SDL_USEREVENT * LASTEVENT = SDL_LASTEVENT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_DEVICE_RESET); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RENDER_DEVICE_RESET, __pyx_t_2) < 0) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":53 * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET * RENDER_DEVICE_RESET = SDL_RENDER_DEVICE_RESET * USEREVENT = SDL_USEREVENT # <<<<<<<<<<<<<< * LASTEVENT = SDL_LASTEVENT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_USEREVENT, __pyx_t_2) < 0) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_list.pxi":54 * RENDER_DEVICE_RESET = SDL_RENDER_DEVICE_RESET * USEREVENT = SDL_USEREVENT * LASTEVENT = SDL_LASTEVENT # <<<<<<<<<<<<<< */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_LASTEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LASTEVENT, __pyx_t_2) < 0) __PYX_ERR(1, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":8 * * include "event_list.pxi" * ACTIVEEVENT = SDL_LASTEVENT - 1 # <<<<<<<<<<<<<< * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 */ __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACTIVEEVENT, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":9 * include "event_list.pxi" * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 # <<<<<<<<<<<<<< * VIDEOEXPOSE = SDL_LASTEVENT - 3 * WINDOWMOVED = SDL_LASTEVENT - 4 */ __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEORESIZE, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":10 * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 # <<<<<<<<<<<<<< * WINDOWMOVED = SDL_LASTEVENT - 4 * */ __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEOEXPOSE, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":11 * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 * WINDOWMOVED = SDL_LASTEVENT - 4 # <<<<<<<<<<<<<< * * include "keycode_list.pxi" */ __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWMOVED, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":4 * # Do not edit! * * K_UNKNOWN = SDLK_UNKNOWN # <<<<<<<<<<<<<< * K_RETURN = SDLK_RETURN * K_ESCAPE = SDLK_ESCAPE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_UNKNOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UNKNOWN, __pyx_t_2) < 0) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":5 * * K_UNKNOWN = SDLK_UNKNOWN * K_RETURN = SDLK_RETURN # <<<<<<<<<<<<<< * K_ESCAPE = SDLK_ESCAPE * K_BACKSPACE = SDLK_BACKSPACE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RETURN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RETURN, __pyx_t_2) < 0) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":6 * K_UNKNOWN = SDLK_UNKNOWN * K_RETURN = SDLK_RETURN * K_ESCAPE = SDLK_ESCAPE # <<<<<<<<<<<<<< * K_BACKSPACE = SDLK_BACKSPACE * K_TAB = SDLK_TAB */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_ESCAPE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_ESCAPE, __pyx_t_2) < 0) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":7 * K_RETURN = SDLK_RETURN * K_ESCAPE = SDLK_ESCAPE * K_BACKSPACE = SDLK_BACKSPACE # <<<<<<<<<<<<<< * K_TAB = SDLK_TAB * K_SPACE = SDLK_SPACE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_BACKSPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BACKSPACE, __pyx_t_2) < 0) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":8 * K_ESCAPE = SDLK_ESCAPE * K_BACKSPACE = SDLK_BACKSPACE * K_TAB = SDLK_TAB # <<<<<<<<<<<<<< * K_SPACE = SDLK_SPACE * K_EXCLAIM = SDLK_EXCLAIM */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_TAB); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_TAB, __pyx_t_2) < 0) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":9 * K_BACKSPACE = SDLK_BACKSPACE * K_TAB = SDLK_TAB * K_SPACE = SDLK_SPACE # <<<<<<<<<<<<<< * K_EXCLAIM = SDLK_EXCLAIM * K_QUOTEDBL = SDLK_QUOTEDBL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SPACE, __pyx_t_2) < 0) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":10 * K_TAB = SDLK_TAB * K_SPACE = SDLK_SPACE * K_EXCLAIM = SDLK_EXCLAIM # <<<<<<<<<<<<<< * K_QUOTEDBL = SDLK_QUOTEDBL * K_HASH = SDLK_HASH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_EXCLAIM); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EXCLAIM, __pyx_t_2) < 0) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":11 * K_SPACE = SDLK_SPACE * K_EXCLAIM = SDLK_EXCLAIM * K_QUOTEDBL = SDLK_QUOTEDBL # <<<<<<<<<<<<<< * K_HASH = SDLK_HASH * K_PERCENT = SDLK_PERCENT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_QUOTEDBL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_QUOTEDBL, __pyx_t_2) < 0) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":12 * K_EXCLAIM = SDLK_EXCLAIM * K_QUOTEDBL = SDLK_QUOTEDBL * K_HASH = SDLK_HASH # <<<<<<<<<<<<<< * K_PERCENT = SDLK_PERCENT * K_DOLLAR = SDLK_DOLLAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_HASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_HASH, __pyx_t_2) < 0) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":13 * K_QUOTEDBL = SDLK_QUOTEDBL * K_HASH = SDLK_HASH * K_PERCENT = SDLK_PERCENT # <<<<<<<<<<<<<< * K_DOLLAR = SDLK_DOLLAR * K_AMPERSAND = SDLK_AMPERSAND */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PERCENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PERCENT, __pyx_t_2) < 0) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":14 * K_HASH = SDLK_HASH * K_PERCENT = SDLK_PERCENT * K_DOLLAR = SDLK_DOLLAR # <<<<<<<<<<<<<< * K_AMPERSAND = SDLK_AMPERSAND * K_QUOTE = SDLK_QUOTE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_DOLLAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DOLLAR, __pyx_t_2) < 0) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":15 * K_PERCENT = SDLK_PERCENT * K_DOLLAR = SDLK_DOLLAR * K_AMPERSAND = SDLK_AMPERSAND # <<<<<<<<<<<<<< * K_QUOTE = SDLK_QUOTE * K_LEFTPAREN = SDLK_LEFTPAREN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AMPERSAND); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AMPERSAND, __pyx_t_2) < 0) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":16 * K_DOLLAR = SDLK_DOLLAR * K_AMPERSAND = SDLK_AMPERSAND * K_QUOTE = SDLK_QUOTE # <<<<<<<<<<<<<< * K_LEFTPAREN = SDLK_LEFTPAREN * K_RIGHTPAREN = SDLK_RIGHTPAREN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_QUOTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_QUOTE, __pyx_t_2) < 0) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":17 * K_AMPERSAND = SDLK_AMPERSAND * K_QUOTE = SDLK_QUOTE * K_LEFTPAREN = SDLK_LEFTPAREN # <<<<<<<<<<<<<< * K_RIGHTPAREN = SDLK_RIGHTPAREN * K_ASTERISK = SDLK_ASTERISK */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LEFTPAREN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LEFTPAREN, __pyx_t_2) < 0) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":18 * K_QUOTE = SDLK_QUOTE * K_LEFTPAREN = SDLK_LEFTPAREN * K_RIGHTPAREN = SDLK_RIGHTPAREN # <<<<<<<<<<<<<< * K_ASTERISK = SDLK_ASTERISK * K_PLUS = SDLK_PLUS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RIGHTPAREN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RIGHTPAREN, __pyx_t_2) < 0) __PYX_ERR(2, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":19 * K_LEFTPAREN = SDLK_LEFTPAREN * K_RIGHTPAREN = SDLK_RIGHTPAREN * K_ASTERISK = SDLK_ASTERISK # <<<<<<<<<<<<<< * K_PLUS = SDLK_PLUS * K_COMMA = SDLK_COMMA */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_ASTERISK); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_ASTERISK, __pyx_t_2) < 0) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":20 * K_RIGHTPAREN = SDLK_RIGHTPAREN * K_ASTERISK = SDLK_ASTERISK * K_PLUS = SDLK_PLUS # <<<<<<<<<<<<<< * K_COMMA = SDLK_COMMA * K_MINUS = SDLK_MINUS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PLUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PLUS, __pyx_t_2) < 0) __PYX_ERR(2, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":21 * K_ASTERISK = SDLK_ASTERISK * K_PLUS = SDLK_PLUS * K_COMMA = SDLK_COMMA # <<<<<<<<<<<<<< * K_MINUS = SDLK_MINUS * K_PERIOD = SDLK_PERIOD */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_COMMA); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COMMA, __pyx_t_2) < 0) __PYX_ERR(2, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":22 * K_PLUS = SDLK_PLUS * K_COMMA = SDLK_COMMA * K_MINUS = SDLK_MINUS # <<<<<<<<<<<<<< * K_PERIOD = SDLK_PERIOD * K_SLASH = SDLK_SLASH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_MINUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MINUS, __pyx_t_2) < 0) __PYX_ERR(2, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":23 * K_COMMA = SDLK_COMMA * K_MINUS = SDLK_MINUS * K_PERIOD = SDLK_PERIOD # <<<<<<<<<<<<<< * K_SLASH = SDLK_SLASH * K_0 = SDLK_0 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PERIOD); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PERIOD, __pyx_t_2) < 0) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":24 * K_MINUS = SDLK_MINUS * K_PERIOD = SDLK_PERIOD * K_SLASH = SDLK_SLASH # <<<<<<<<<<<<<< * K_0 = SDLK_0 * K_1 = SDLK_1 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SLASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SLASH, __pyx_t_2) < 0) __PYX_ERR(2, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":25 * K_PERIOD = SDLK_PERIOD * K_SLASH = SDLK_SLASH * K_0 = SDLK_0 # <<<<<<<<<<<<<< * K_1 = SDLK_1 * K_2 = SDLK_2 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_0, __pyx_t_2) < 0) __PYX_ERR(2, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":26 * K_SLASH = SDLK_SLASH * K_0 = SDLK_0 * K_1 = SDLK_1 # <<<<<<<<<<<<<< * K_2 = SDLK_2 * K_3 = SDLK_3 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_1, __pyx_t_2) < 0) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":27 * K_0 = SDLK_0 * K_1 = SDLK_1 * K_2 = SDLK_2 # <<<<<<<<<<<<<< * K_3 = SDLK_3 * K_4 = SDLK_4 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_2, __pyx_t_2) < 0) __PYX_ERR(2, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":28 * K_1 = SDLK_1 * K_2 = SDLK_2 * K_3 = SDLK_3 # <<<<<<<<<<<<<< * K_4 = SDLK_4 * K_5 = SDLK_5 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_3, __pyx_t_2) < 0) __PYX_ERR(2, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":29 * K_2 = SDLK_2 * K_3 = SDLK_3 * K_4 = SDLK_4 # <<<<<<<<<<<<<< * K_5 = SDLK_5 * K_6 = SDLK_6 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_4, __pyx_t_2) < 0) __PYX_ERR(2, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":30 * K_3 = SDLK_3 * K_4 = SDLK_4 * K_5 = SDLK_5 # <<<<<<<<<<<<<< * K_6 = SDLK_6 * K_7 = SDLK_7 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_5, __pyx_t_2) < 0) __PYX_ERR(2, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":31 * K_4 = SDLK_4 * K_5 = SDLK_5 * K_6 = SDLK_6 # <<<<<<<<<<<<<< * K_7 = SDLK_7 * K_8 = SDLK_8 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_6, __pyx_t_2) < 0) __PYX_ERR(2, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":32 * K_5 = SDLK_5 * K_6 = SDLK_6 * K_7 = SDLK_7 # <<<<<<<<<<<<<< * K_8 = SDLK_8 * K_9 = SDLK_9 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_7, __pyx_t_2) < 0) __PYX_ERR(2, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":33 * K_6 = SDLK_6 * K_7 = SDLK_7 * K_8 = SDLK_8 # <<<<<<<<<<<<<< * K_9 = SDLK_9 * K_COLON = SDLK_COLON */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_8, __pyx_t_2) < 0) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":34 * K_7 = SDLK_7 * K_8 = SDLK_8 * K_9 = SDLK_9 # <<<<<<<<<<<<<< * K_COLON = SDLK_COLON * K_SEMICOLON = SDLK_SEMICOLON */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_9, __pyx_t_2) < 0) __PYX_ERR(2, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":35 * K_8 = SDLK_8 * K_9 = SDLK_9 * K_COLON = SDLK_COLON # <<<<<<<<<<<<<< * K_SEMICOLON = SDLK_SEMICOLON * K_LESS = SDLK_LESS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_COLON); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COLON, __pyx_t_2) < 0) __PYX_ERR(2, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":36 * K_9 = SDLK_9 * K_COLON = SDLK_COLON * K_SEMICOLON = SDLK_SEMICOLON # <<<<<<<<<<<<<< * K_LESS = SDLK_LESS * K_EQUALS = SDLK_EQUALS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SEMICOLON); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SEMICOLON, __pyx_t_2) < 0) __PYX_ERR(2, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":37 * K_COLON = SDLK_COLON * K_SEMICOLON = SDLK_SEMICOLON * K_LESS = SDLK_LESS # <<<<<<<<<<<<<< * K_EQUALS = SDLK_EQUALS * K_GREATER = SDLK_GREATER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LESS, __pyx_t_2) < 0) __PYX_ERR(2, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":38 * K_SEMICOLON = SDLK_SEMICOLON * K_LESS = SDLK_LESS * K_EQUALS = SDLK_EQUALS # <<<<<<<<<<<<<< * K_GREATER = SDLK_GREATER * K_QUESTION = SDLK_QUESTION */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_EQUALS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EQUALS, __pyx_t_2) < 0) __PYX_ERR(2, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":39 * K_LESS = SDLK_LESS * K_EQUALS = SDLK_EQUALS * K_GREATER = SDLK_GREATER # <<<<<<<<<<<<<< * K_QUESTION = SDLK_QUESTION * K_AT = SDLK_AT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_GREATER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_GREATER, __pyx_t_2) < 0) __PYX_ERR(2, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":40 * K_EQUALS = SDLK_EQUALS * K_GREATER = SDLK_GREATER * K_QUESTION = SDLK_QUESTION # <<<<<<<<<<<<<< * K_AT = SDLK_AT * K_LEFTBRACKET = SDLK_LEFTBRACKET */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_QUESTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_QUESTION, __pyx_t_2) < 0) __PYX_ERR(2, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":41 * K_GREATER = SDLK_GREATER * K_QUESTION = SDLK_QUESTION * K_AT = SDLK_AT # <<<<<<<<<<<<<< * K_LEFTBRACKET = SDLK_LEFTBRACKET * K_BACKSLASH = SDLK_BACKSLASH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AT, __pyx_t_2) < 0) __PYX_ERR(2, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":42 * K_QUESTION = SDLK_QUESTION * K_AT = SDLK_AT * K_LEFTBRACKET = SDLK_LEFTBRACKET # <<<<<<<<<<<<<< * K_BACKSLASH = SDLK_BACKSLASH * K_RIGHTBRACKET = SDLK_RIGHTBRACKET */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LEFTBRACKET); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LEFTBRACKET, __pyx_t_2) < 0) __PYX_ERR(2, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":43 * K_AT = SDLK_AT * K_LEFTBRACKET = SDLK_LEFTBRACKET * K_BACKSLASH = SDLK_BACKSLASH # <<<<<<<<<<<<<< * K_RIGHTBRACKET = SDLK_RIGHTBRACKET * K_CARET = SDLK_CARET */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_BACKSLASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BACKSLASH, __pyx_t_2) < 0) __PYX_ERR(2, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":44 * K_LEFTBRACKET = SDLK_LEFTBRACKET * K_BACKSLASH = SDLK_BACKSLASH * K_RIGHTBRACKET = SDLK_RIGHTBRACKET # <<<<<<<<<<<<<< * K_CARET = SDLK_CARET * K_UNDERSCORE = SDLK_UNDERSCORE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RIGHTBRACKET); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RIGHTBRACKET, __pyx_t_2) < 0) __PYX_ERR(2, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":45 * K_BACKSLASH = SDLK_BACKSLASH * K_RIGHTBRACKET = SDLK_RIGHTBRACKET * K_CARET = SDLK_CARET # <<<<<<<<<<<<<< * K_UNDERSCORE = SDLK_UNDERSCORE * K_BACKQUOTE = SDLK_BACKQUOTE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CARET); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CARET, __pyx_t_2) < 0) __PYX_ERR(2, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":46 * K_RIGHTBRACKET = SDLK_RIGHTBRACKET * K_CARET = SDLK_CARET * K_UNDERSCORE = SDLK_UNDERSCORE # <<<<<<<<<<<<<< * K_BACKQUOTE = SDLK_BACKQUOTE * K_a = SDLK_a */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_UNDERSCORE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UNDERSCORE, __pyx_t_2) < 0) __PYX_ERR(2, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":47 * K_CARET = SDLK_CARET * K_UNDERSCORE = SDLK_UNDERSCORE * K_BACKQUOTE = SDLK_BACKQUOTE # <<<<<<<<<<<<<< * K_a = SDLK_a * K_b = SDLK_b */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_BACKQUOTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BACKQUOTE, __pyx_t_2) < 0) __PYX_ERR(2, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":48 * K_UNDERSCORE = SDLK_UNDERSCORE * K_BACKQUOTE = SDLK_BACKQUOTE * K_a = SDLK_a # <<<<<<<<<<<<<< * K_b = SDLK_b * K_c = SDLK_c */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_a); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_a, __pyx_t_2) < 0) __PYX_ERR(2, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":49 * K_BACKQUOTE = SDLK_BACKQUOTE * K_a = SDLK_a * K_b = SDLK_b # <<<<<<<<<<<<<< * K_c = SDLK_c * K_d = SDLK_d */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_b, __pyx_t_2) < 0) __PYX_ERR(2, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":50 * K_a = SDLK_a * K_b = SDLK_b * K_c = SDLK_c # <<<<<<<<<<<<<< * K_d = SDLK_d * K_e = SDLK_e */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_c, __pyx_t_2) < 0) __PYX_ERR(2, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":51 * K_b = SDLK_b * K_c = SDLK_c * K_d = SDLK_d # <<<<<<<<<<<<<< * K_e = SDLK_e * K_f = SDLK_f */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_d, __pyx_t_2) < 0) __PYX_ERR(2, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":52 * K_c = SDLK_c * K_d = SDLK_d * K_e = SDLK_e # <<<<<<<<<<<<<< * K_f = SDLK_f * K_g = SDLK_g */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_e, __pyx_t_2) < 0) __PYX_ERR(2, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":53 * K_d = SDLK_d * K_e = SDLK_e * K_f = SDLK_f # <<<<<<<<<<<<<< * K_g = SDLK_g * K_h = SDLK_h */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_f, __pyx_t_2) < 0) __PYX_ERR(2, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":54 * K_e = SDLK_e * K_f = SDLK_f * K_g = SDLK_g # <<<<<<<<<<<<<< * K_h = SDLK_h * K_i = SDLK_i */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_g, __pyx_t_2) < 0) __PYX_ERR(2, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":55 * K_f = SDLK_f * K_g = SDLK_g * K_h = SDLK_h # <<<<<<<<<<<<<< * K_i = SDLK_i * K_j = SDLK_j */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_h, __pyx_t_2) < 0) __PYX_ERR(2, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":56 * K_g = SDLK_g * K_h = SDLK_h * K_i = SDLK_i # <<<<<<<<<<<<<< * K_j = SDLK_j * K_k = SDLK_k */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_i, __pyx_t_2) < 0) __PYX_ERR(2, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":57 * K_h = SDLK_h * K_i = SDLK_i * K_j = SDLK_j # <<<<<<<<<<<<<< * K_k = SDLK_k * K_l = SDLK_l */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_j, __pyx_t_2) < 0) __PYX_ERR(2, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":58 * K_i = SDLK_i * K_j = SDLK_j * K_k = SDLK_k # <<<<<<<<<<<<<< * K_l = SDLK_l * K_m = SDLK_m */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_k, __pyx_t_2) < 0) __PYX_ERR(2, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":59 * K_j = SDLK_j * K_k = SDLK_k * K_l = SDLK_l # <<<<<<<<<<<<<< * K_m = SDLK_m * K_n = SDLK_n */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_l, __pyx_t_2) < 0) __PYX_ERR(2, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":60 * K_k = SDLK_k * K_l = SDLK_l * K_m = SDLK_m # <<<<<<<<<<<<<< * K_n = SDLK_n * K_o = SDLK_o */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_m, __pyx_t_2) < 0) __PYX_ERR(2, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":61 * K_l = SDLK_l * K_m = SDLK_m * K_n = SDLK_n # <<<<<<<<<<<<<< * K_o = SDLK_o * K_p = SDLK_p */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_n, __pyx_t_2) < 0) __PYX_ERR(2, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":62 * K_m = SDLK_m * K_n = SDLK_n * K_o = SDLK_o # <<<<<<<<<<<<<< * K_p = SDLK_p * K_q = SDLK_q */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_o); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_o, __pyx_t_2) < 0) __PYX_ERR(2, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":63 * K_n = SDLK_n * K_o = SDLK_o * K_p = SDLK_p # <<<<<<<<<<<<<< * K_q = SDLK_q * K_r = SDLK_r */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_p, __pyx_t_2) < 0) __PYX_ERR(2, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":64 * K_o = SDLK_o * K_p = SDLK_p * K_q = SDLK_q # <<<<<<<<<<<<<< * K_r = SDLK_r * K_s = SDLK_s */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_q); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_q, __pyx_t_2) < 0) __PYX_ERR(2, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":65 * K_p = SDLK_p * K_q = SDLK_q * K_r = SDLK_r # <<<<<<<<<<<<<< * K_s = SDLK_s * K_t = SDLK_t */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_r, __pyx_t_2) < 0) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":66 * K_q = SDLK_q * K_r = SDLK_r * K_s = SDLK_s # <<<<<<<<<<<<<< * K_t = SDLK_t * K_u = SDLK_u */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_s, __pyx_t_2) < 0) __PYX_ERR(2, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":67 * K_r = SDLK_r * K_s = SDLK_s * K_t = SDLK_t # <<<<<<<<<<<<<< * K_u = SDLK_u * K_v = SDLK_v */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_t, __pyx_t_2) < 0) __PYX_ERR(2, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":68 * K_s = SDLK_s * K_t = SDLK_t * K_u = SDLK_u # <<<<<<<<<<<<<< * K_v = SDLK_v * K_w = SDLK_w */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_u); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_u, __pyx_t_2) < 0) __PYX_ERR(2, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":69 * K_t = SDLK_t * K_u = SDLK_u * K_v = SDLK_v # <<<<<<<<<<<<<< * K_w = SDLK_w * K_x = SDLK_x */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_v); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_v, __pyx_t_2) < 0) __PYX_ERR(2, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":70 * K_u = SDLK_u * K_v = SDLK_v * K_w = SDLK_w # <<<<<<<<<<<<<< * K_x = SDLK_x * K_y = SDLK_y */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_w, __pyx_t_2) < 0) __PYX_ERR(2, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":71 * K_v = SDLK_v * K_w = SDLK_w * K_x = SDLK_x # <<<<<<<<<<<<<< * K_y = SDLK_y * K_z = SDLK_z */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_x, __pyx_t_2) < 0) __PYX_ERR(2, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":72 * K_w = SDLK_w * K_x = SDLK_x * K_y = SDLK_y # <<<<<<<<<<<<<< * K_z = SDLK_z * K_CAPSLOCK = SDLK_CAPSLOCK */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_y, __pyx_t_2) < 0) __PYX_ERR(2, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":73 * K_x = SDLK_x * K_y = SDLK_y * K_z = SDLK_z # <<<<<<<<<<<<<< * K_CAPSLOCK = SDLK_CAPSLOCK * K_F1 = SDLK_F1 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_z, __pyx_t_2) < 0) __PYX_ERR(2, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":74 * K_y = SDLK_y * K_z = SDLK_z * K_CAPSLOCK = SDLK_CAPSLOCK # <<<<<<<<<<<<<< * K_F1 = SDLK_F1 * K_F2 = SDLK_F2 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CAPSLOCK); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CAPSLOCK, __pyx_t_2) < 0) __PYX_ERR(2, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":75 * K_z = SDLK_z * K_CAPSLOCK = SDLK_CAPSLOCK * K_F1 = SDLK_F1 # <<<<<<<<<<<<<< * K_F2 = SDLK_F2 * K_F3 = SDLK_F3 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F1, __pyx_t_2) < 0) __PYX_ERR(2, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":76 * K_CAPSLOCK = SDLK_CAPSLOCK * K_F1 = SDLK_F1 * K_F2 = SDLK_F2 # <<<<<<<<<<<<<< * K_F3 = SDLK_F3 * K_F4 = SDLK_F4 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F2, __pyx_t_2) < 0) __PYX_ERR(2, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":77 * K_F1 = SDLK_F1 * K_F2 = SDLK_F2 * K_F3 = SDLK_F3 # <<<<<<<<<<<<<< * K_F4 = SDLK_F4 * K_F5 = SDLK_F5 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F3, __pyx_t_2) < 0) __PYX_ERR(2, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":78 * K_F2 = SDLK_F2 * K_F3 = SDLK_F3 * K_F4 = SDLK_F4 # <<<<<<<<<<<<<< * K_F5 = SDLK_F5 * K_F6 = SDLK_F6 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F4, __pyx_t_2) < 0) __PYX_ERR(2, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":79 * K_F3 = SDLK_F3 * K_F4 = SDLK_F4 * K_F5 = SDLK_F5 # <<<<<<<<<<<<<< * K_F6 = SDLK_F6 * K_F7 = SDLK_F7 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F5); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F5, __pyx_t_2) < 0) __PYX_ERR(2, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":80 * K_F4 = SDLK_F4 * K_F5 = SDLK_F5 * K_F6 = SDLK_F6 # <<<<<<<<<<<<<< * K_F7 = SDLK_F7 * K_F8 = SDLK_F8 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F6); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F6, __pyx_t_2) < 0) __PYX_ERR(2, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":81 * K_F5 = SDLK_F5 * K_F6 = SDLK_F6 * K_F7 = SDLK_F7 # <<<<<<<<<<<<<< * K_F8 = SDLK_F8 * K_F9 = SDLK_F9 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F7, __pyx_t_2) < 0) __PYX_ERR(2, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":82 * K_F6 = SDLK_F6 * K_F7 = SDLK_F7 * K_F8 = SDLK_F8 # <<<<<<<<<<<<<< * K_F9 = SDLK_F9 * K_F10 = SDLK_F10 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F8); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F8, __pyx_t_2) < 0) __PYX_ERR(2, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":83 * K_F7 = SDLK_F7 * K_F8 = SDLK_F8 * K_F9 = SDLK_F9 # <<<<<<<<<<<<<< * K_F10 = SDLK_F10 * K_F11 = SDLK_F11 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F9); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F9, __pyx_t_2) < 0) __PYX_ERR(2, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":84 * K_F8 = SDLK_F8 * K_F9 = SDLK_F9 * K_F10 = SDLK_F10 # <<<<<<<<<<<<<< * K_F11 = SDLK_F11 * K_F12 = SDLK_F12 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F10); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F10, __pyx_t_2) < 0) __PYX_ERR(2, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":85 * K_F9 = SDLK_F9 * K_F10 = SDLK_F10 * K_F11 = SDLK_F11 # <<<<<<<<<<<<<< * K_F12 = SDLK_F12 * K_PRINTSCREEN = SDLK_PRINTSCREEN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F11); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F11, __pyx_t_2) < 0) __PYX_ERR(2, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":86 * K_F10 = SDLK_F10 * K_F11 = SDLK_F11 * K_F12 = SDLK_F12 # <<<<<<<<<<<<<< * K_PRINTSCREEN = SDLK_PRINTSCREEN * K_SCROLLLOCK = SDLK_SCROLLLOCK */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F12); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F12, __pyx_t_2) < 0) __PYX_ERR(2, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":87 * K_F11 = SDLK_F11 * K_F12 = SDLK_F12 * K_PRINTSCREEN = SDLK_PRINTSCREEN # <<<<<<<<<<<<<< * K_SCROLLLOCK = SDLK_SCROLLLOCK * K_PAUSE = SDLK_PAUSE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PRINTSCREEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PRINTSCREEN, __pyx_t_2) < 0) __PYX_ERR(2, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":88 * K_F12 = SDLK_F12 * K_PRINTSCREEN = SDLK_PRINTSCREEN * K_SCROLLLOCK = SDLK_SCROLLLOCK # <<<<<<<<<<<<<< * K_PAUSE = SDLK_PAUSE * K_INSERT = SDLK_INSERT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SCROLLLOCK); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SCROLLLOCK, __pyx_t_2) < 0) __PYX_ERR(2, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":89 * K_PRINTSCREEN = SDLK_PRINTSCREEN * K_SCROLLLOCK = SDLK_SCROLLLOCK * K_PAUSE = SDLK_PAUSE # <<<<<<<<<<<<<< * K_INSERT = SDLK_INSERT * K_HOME = SDLK_HOME */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PAUSE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PAUSE, __pyx_t_2) < 0) __PYX_ERR(2, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":90 * K_SCROLLLOCK = SDLK_SCROLLLOCK * K_PAUSE = SDLK_PAUSE * K_INSERT = SDLK_INSERT # <<<<<<<<<<<<<< * K_HOME = SDLK_HOME * K_PAGEUP = SDLK_PAGEUP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_INSERT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_INSERT, __pyx_t_2) < 0) __PYX_ERR(2, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":91 * K_PAUSE = SDLK_PAUSE * K_INSERT = SDLK_INSERT * K_HOME = SDLK_HOME # <<<<<<<<<<<<<< * K_PAGEUP = SDLK_PAGEUP * K_DELETE = SDLK_DELETE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_HOME); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_HOME, __pyx_t_2) < 0) __PYX_ERR(2, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":92 * K_INSERT = SDLK_INSERT * K_HOME = SDLK_HOME * K_PAGEUP = SDLK_PAGEUP # <<<<<<<<<<<<<< * K_DELETE = SDLK_DELETE * K_END = SDLK_END */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PAGEUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PAGEUP, __pyx_t_2) < 0) __PYX_ERR(2, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":93 * K_HOME = SDLK_HOME * K_PAGEUP = SDLK_PAGEUP * K_DELETE = SDLK_DELETE # <<<<<<<<<<<<<< * K_END = SDLK_END * K_PAGEDOWN = SDLK_PAGEDOWN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_DELETE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DELETE, __pyx_t_2) < 0) __PYX_ERR(2, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":94 * K_PAGEUP = SDLK_PAGEUP * K_DELETE = SDLK_DELETE * K_END = SDLK_END # <<<<<<<<<<<<<< * K_PAGEDOWN = SDLK_PAGEDOWN * K_RIGHT = SDLK_RIGHT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_END); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_END, __pyx_t_2) < 0) __PYX_ERR(2, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":95 * K_DELETE = SDLK_DELETE * K_END = SDLK_END * K_PAGEDOWN = SDLK_PAGEDOWN # <<<<<<<<<<<<<< * K_RIGHT = SDLK_RIGHT * K_LEFT = SDLK_LEFT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PAGEDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PAGEDOWN, __pyx_t_2) < 0) __PYX_ERR(2, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":96 * K_END = SDLK_END * K_PAGEDOWN = SDLK_PAGEDOWN * K_RIGHT = SDLK_RIGHT # <<<<<<<<<<<<<< * K_LEFT = SDLK_LEFT * K_DOWN = SDLK_DOWN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RIGHT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RIGHT, __pyx_t_2) < 0) __PYX_ERR(2, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":97 * K_PAGEDOWN = SDLK_PAGEDOWN * K_RIGHT = SDLK_RIGHT * K_LEFT = SDLK_LEFT # <<<<<<<<<<<<<< * K_DOWN = SDLK_DOWN * K_UP = SDLK_UP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LEFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LEFT, __pyx_t_2) < 0) __PYX_ERR(2, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":98 * K_RIGHT = SDLK_RIGHT * K_LEFT = SDLK_LEFT * K_DOWN = SDLK_DOWN # <<<<<<<<<<<<<< * K_UP = SDLK_UP * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_DOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DOWN, __pyx_t_2) < 0) __PYX_ERR(2, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":99 * K_LEFT = SDLK_LEFT * K_DOWN = SDLK_DOWN * K_UP = SDLK_UP # <<<<<<<<<<<<<< * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * K_KP_DIVIDE = SDLK_KP_DIVIDE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_UP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UP, __pyx_t_2) < 0) __PYX_ERR(2, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":100 * K_DOWN = SDLK_DOWN * K_UP = SDLK_UP * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR # <<<<<<<<<<<<<< * K_KP_DIVIDE = SDLK_KP_DIVIDE * K_KP_MULTIPLY = SDLK_KP_MULTIPLY */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_NUMLOCKCLEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_NUMLOCKCLEAR, __pyx_t_2) < 0) __PYX_ERR(2, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":101 * K_UP = SDLK_UP * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * K_KP_DIVIDE = SDLK_KP_DIVIDE # <<<<<<<<<<<<<< * K_KP_MULTIPLY = SDLK_KP_MULTIPLY * K_KP_MINUS = SDLK_KP_MINUS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_DIVIDE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DIVIDE, __pyx_t_2) < 0) __PYX_ERR(2, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":102 * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * K_KP_DIVIDE = SDLK_KP_DIVIDE * K_KP_MULTIPLY = SDLK_KP_MULTIPLY # <<<<<<<<<<<<<< * K_KP_MINUS = SDLK_KP_MINUS * K_KP_PLUS = SDLK_KP_PLUS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MULTIPLY); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MULTIPLY, __pyx_t_2) < 0) __PYX_ERR(2, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":103 * K_KP_DIVIDE = SDLK_KP_DIVIDE * K_KP_MULTIPLY = SDLK_KP_MULTIPLY * K_KP_MINUS = SDLK_KP_MINUS # <<<<<<<<<<<<<< * K_KP_PLUS = SDLK_KP_PLUS * K_KP_ENTER = SDLK_KP_ENTER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MINUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MINUS, __pyx_t_2) < 0) __PYX_ERR(2, 103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":104 * K_KP_MULTIPLY = SDLK_KP_MULTIPLY * K_KP_MINUS = SDLK_KP_MINUS * K_KP_PLUS = SDLK_KP_PLUS # <<<<<<<<<<<<<< * K_KP_ENTER = SDLK_KP_ENTER * K_KP_1 = SDLK_KP_1 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_PLUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PLUS, __pyx_t_2) < 0) __PYX_ERR(2, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":105 * K_KP_MINUS = SDLK_KP_MINUS * K_KP_PLUS = SDLK_KP_PLUS * K_KP_ENTER = SDLK_KP_ENTER # <<<<<<<<<<<<<< * K_KP_1 = SDLK_KP_1 * K_KP_2 = SDLK_KP_2 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_ENTER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_ENTER, __pyx_t_2) < 0) __PYX_ERR(2, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":106 * K_KP_PLUS = SDLK_KP_PLUS * K_KP_ENTER = SDLK_KP_ENTER * K_KP_1 = SDLK_KP_1 # <<<<<<<<<<<<<< * K_KP_2 = SDLK_KP_2 * K_KP_3 = SDLK_KP_3 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_1, __pyx_t_2) < 0) __PYX_ERR(2, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":107 * K_KP_ENTER = SDLK_KP_ENTER * K_KP_1 = SDLK_KP_1 * K_KP_2 = SDLK_KP_2 # <<<<<<<<<<<<<< * K_KP_3 = SDLK_KP_3 * K_KP_4 = SDLK_KP_4 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_2, __pyx_t_2) < 0) __PYX_ERR(2, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":108 * K_KP_1 = SDLK_KP_1 * K_KP_2 = SDLK_KP_2 * K_KP_3 = SDLK_KP_3 # <<<<<<<<<<<<<< * K_KP_4 = SDLK_KP_4 * K_KP_5 = SDLK_KP_5 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_3, __pyx_t_2) < 0) __PYX_ERR(2, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":109 * K_KP_2 = SDLK_KP_2 * K_KP_3 = SDLK_KP_3 * K_KP_4 = SDLK_KP_4 # <<<<<<<<<<<<<< * K_KP_5 = SDLK_KP_5 * K_KP_6 = SDLK_KP_6 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_4, __pyx_t_2) < 0) __PYX_ERR(2, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":110 * K_KP_3 = SDLK_KP_3 * K_KP_4 = SDLK_KP_4 * K_KP_5 = SDLK_KP_5 # <<<<<<<<<<<<<< * K_KP_6 = SDLK_KP_6 * K_KP_7 = SDLK_KP_7 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_5, __pyx_t_2) < 0) __PYX_ERR(2, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":111 * K_KP_4 = SDLK_KP_4 * K_KP_5 = SDLK_KP_5 * K_KP_6 = SDLK_KP_6 # <<<<<<<<<<<<<< * K_KP_7 = SDLK_KP_7 * K_KP_8 = SDLK_KP_8 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_6, __pyx_t_2) < 0) __PYX_ERR(2, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":112 * K_KP_5 = SDLK_KP_5 * K_KP_6 = SDLK_KP_6 * K_KP_7 = SDLK_KP_7 # <<<<<<<<<<<<<< * K_KP_8 = SDLK_KP_8 * K_KP_9 = SDLK_KP_9 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_7, __pyx_t_2) < 0) __PYX_ERR(2, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":113 * K_KP_6 = SDLK_KP_6 * K_KP_7 = SDLK_KP_7 * K_KP_8 = SDLK_KP_8 # <<<<<<<<<<<<<< * K_KP_9 = SDLK_KP_9 * K_KP_0 = SDLK_KP_0 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_8, __pyx_t_2) < 0) __PYX_ERR(2, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":114 * K_KP_7 = SDLK_KP_7 * K_KP_8 = SDLK_KP_8 * K_KP_9 = SDLK_KP_9 # <<<<<<<<<<<<<< * K_KP_0 = SDLK_KP_0 * K_KP_PERIOD = SDLK_KP_PERIOD */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_9, __pyx_t_2) < 0) __PYX_ERR(2, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":115 * K_KP_8 = SDLK_KP_8 * K_KP_9 = SDLK_KP_9 * K_KP_0 = SDLK_KP_0 # <<<<<<<<<<<<<< * K_KP_PERIOD = SDLK_KP_PERIOD * K_APPLICATION = SDLK_APPLICATION */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_0, __pyx_t_2) < 0) __PYX_ERR(2, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":116 * K_KP_9 = SDLK_KP_9 * K_KP_0 = SDLK_KP_0 * K_KP_PERIOD = SDLK_KP_PERIOD # <<<<<<<<<<<<<< * K_APPLICATION = SDLK_APPLICATION * K_POWER = SDLK_POWER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_PERIOD); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PERIOD, __pyx_t_2) < 0) __PYX_ERR(2, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":117 * K_KP_0 = SDLK_KP_0 * K_KP_PERIOD = SDLK_KP_PERIOD * K_APPLICATION = SDLK_APPLICATION # <<<<<<<<<<<<<< * K_POWER = SDLK_POWER * K_KP_EQUALS = SDLK_KP_EQUALS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_APPLICATION); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_APPLICATION, __pyx_t_2) < 0) __PYX_ERR(2, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":118 * K_KP_PERIOD = SDLK_KP_PERIOD * K_APPLICATION = SDLK_APPLICATION * K_POWER = SDLK_POWER # <<<<<<<<<<<<<< * K_KP_EQUALS = SDLK_KP_EQUALS * K_F13 = SDLK_F13 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_POWER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_POWER, __pyx_t_2) < 0) __PYX_ERR(2, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":119 * K_APPLICATION = SDLK_APPLICATION * K_POWER = SDLK_POWER * K_KP_EQUALS = SDLK_KP_EQUALS # <<<<<<<<<<<<<< * K_F13 = SDLK_F13 * K_F14 = SDLK_F14 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_EQUALS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_EQUALS, __pyx_t_2) < 0) __PYX_ERR(2, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":120 * K_POWER = SDLK_POWER * K_KP_EQUALS = SDLK_KP_EQUALS * K_F13 = SDLK_F13 # <<<<<<<<<<<<<< * K_F14 = SDLK_F14 * K_F15 = SDLK_F15 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F13); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F13, __pyx_t_2) < 0) __PYX_ERR(2, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":121 * K_KP_EQUALS = SDLK_KP_EQUALS * K_F13 = SDLK_F13 * K_F14 = SDLK_F14 # <<<<<<<<<<<<<< * K_F15 = SDLK_F15 * K_F16 = SDLK_F16 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F14); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F14, __pyx_t_2) < 0) __PYX_ERR(2, 121, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":122 * K_F13 = SDLK_F13 * K_F14 = SDLK_F14 * K_F15 = SDLK_F15 # <<<<<<<<<<<<<< * K_F16 = SDLK_F16 * K_F17 = SDLK_F17 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F15); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F15, __pyx_t_2) < 0) __PYX_ERR(2, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":123 * K_F14 = SDLK_F14 * K_F15 = SDLK_F15 * K_F16 = SDLK_F16 # <<<<<<<<<<<<<< * K_F17 = SDLK_F17 * K_F18 = SDLK_F18 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F16); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F16, __pyx_t_2) < 0) __PYX_ERR(2, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":124 * K_F15 = SDLK_F15 * K_F16 = SDLK_F16 * K_F17 = SDLK_F17 # <<<<<<<<<<<<<< * K_F18 = SDLK_F18 * K_F19 = SDLK_F19 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F17); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F17, __pyx_t_2) < 0) __PYX_ERR(2, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":125 * K_F16 = SDLK_F16 * K_F17 = SDLK_F17 * K_F18 = SDLK_F18 # <<<<<<<<<<<<<< * K_F19 = SDLK_F19 * K_F20 = SDLK_F20 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F18); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F18, __pyx_t_2) < 0) __PYX_ERR(2, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":126 * K_F17 = SDLK_F17 * K_F18 = SDLK_F18 * K_F19 = SDLK_F19 # <<<<<<<<<<<<<< * K_F20 = SDLK_F20 * K_F21 = SDLK_F21 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F19); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F19, __pyx_t_2) < 0) __PYX_ERR(2, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":127 * K_F18 = SDLK_F18 * K_F19 = SDLK_F19 * K_F20 = SDLK_F20 # <<<<<<<<<<<<<< * K_F21 = SDLK_F21 * K_F22 = SDLK_F22 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F20); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F20, __pyx_t_2) < 0) __PYX_ERR(2, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":128 * K_F19 = SDLK_F19 * K_F20 = SDLK_F20 * K_F21 = SDLK_F21 # <<<<<<<<<<<<<< * K_F22 = SDLK_F22 * K_F23 = SDLK_F23 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F21); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F21, __pyx_t_2) < 0) __PYX_ERR(2, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":129 * K_F20 = SDLK_F20 * K_F21 = SDLK_F21 * K_F22 = SDLK_F22 # <<<<<<<<<<<<<< * K_F23 = SDLK_F23 * K_F24 = SDLK_F24 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F22); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F22, __pyx_t_2) < 0) __PYX_ERR(2, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":130 * K_F21 = SDLK_F21 * K_F22 = SDLK_F22 * K_F23 = SDLK_F23 # <<<<<<<<<<<<<< * K_F24 = SDLK_F24 * K_EXECUTE = SDLK_EXECUTE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F23); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F23, __pyx_t_2) < 0) __PYX_ERR(2, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":131 * K_F22 = SDLK_F22 * K_F23 = SDLK_F23 * K_F24 = SDLK_F24 # <<<<<<<<<<<<<< * K_EXECUTE = SDLK_EXECUTE * K_HELP = SDLK_HELP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_F24); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F24, __pyx_t_2) < 0) __PYX_ERR(2, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":132 * K_F23 = SDLK_F23 * K_F24 = SDLK_F24 * K_EXECUTE = SDLK_EXECUTE # <<<<<<<<<<<<<< * K_HELP = SDLK_HELP * K_MENU = SDLK_MENU */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_EXECUTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EXECUTE, __pyx_t_2) < 0) __PYX_ERR(2, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":133 * K_F24 = SDLK_F24 * K_EXECUTE = SDLK_EXECUTE * K_HELP = SDLK_HELP # <<<<<<<<<<<<<< * K_MENU = SDLK_MENU * K_SELECT = SDLK_SELECT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_HELP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_HELP, __pyx_t_2) < 0) __PYX_ERR(2, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":134 * K_EXECUTE = SDLK_EXECUTE * K_HELP = SDLK_HELP * K_MENU = SDLK_MENU # <<<<<<<<<<<<<< * K_SELECT = SDLK_SELECT * K_STOP = SDLK_STOP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_MENU); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MENU, __pyx_t_2) < 0) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":135 * K_HELP = SDLK_HELP * K_MENU = SDLK_MENU * K_SELECT = SDLK_SELECT # <<<<<<<<<<<<<< * K_STOP = SDLK_STOP * K_AGAIN = SDLK_AGAIN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SELECT, __pyx_t_2) < 0) __PYX_ERR(2, 135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":136 * K_MENU = SDLK_MENU * K_SELECT = SDLK_SELECT * K_STOP = SDLK_STOP # <<<<<<<<<<<<<< * K_AGAIN = SDLK_AGAIN * K_UNDO = SDLK_UNDO */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_STOP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_STOP, __pyx_t_2) < 0) __PYX_ERR(2, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":137 * K_SELECT = SDLK_SELECT * K_STOP = SDLK_STOP * K_AGAIN = SDLK_AGAIN # <<<<<<<<<<<<<< * K_UNDO = SDLK_UNDO * K_CUT = SDLK_CUT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AGAIN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AGAIN, __pyx_t_2) < 0) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":138 * K_STOP = SDLK_STOP * K_AGAIN = SDLK_AGAIN * K_UNDO = SDLK_UNDO # <<<<<<<<<<<<<< * K_CUT = SDLK_CUT * K_COPY = SDLK_COPY */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_UNDO); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UNDO, __pyx_t_2) < 0) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":139 * K_AGAIN = SDLK_AGAIN * K_UNDO = SDLK_UNDO * K_CUT = SDLK_CUT # <<<<<<<<<<<<<< * K_COPY = SDLK_COPY * K_PASTE = SDLK_PASTE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CUT, __pyx_t_2) < 0) __PYX_ERR(2, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":140 * K_UNDO = SDLK_UNDO * K_CUT = SDLK_CUT * K_COPY = SDLK_COPY # <<<<<<<<<<<<<< * K_PASTE = SDLK_PASTE * K_FIND = SDLK_FIND */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_COPY); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COPY, __pyx_t_2) < 0) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":141 * K_CUT = SDLK_CUT * K_COPY = SDLK_COPY * K_PASTE = SDLK_PASTE # <<<<<<<<<<<<<< * K_FIND = SDLK_FIND * K_MUTE = SDLK_MUTE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PASTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PASTE, __pyx_t_2) < 0) __PYX_ERR(2, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":142 * K_COPY = SDLK_COPY * K_PASTE = SDLK_PASTE * K_FIND = SDLK_FIND # <<<<<<<<<<<<<< * K_MUTE = SDLK_MUTE * K_VOLUMEUP = SDLK_VOLUMEUP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_FIND); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_FIND, __pyx_t_2) < 0) __PYX_ERR(2, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":143 * K_PASTE = SDLK_PASTE * K_FIND = SDLK_FIND * K_MUTE = SDLK_MUTE # <<<<<<<<<<<<<< * K_VOLUMEUP = SDLK_VOLUMEUP * K_VOLUMEDOWN = SDLK_VOLUMEDOWN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_MUTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MUTE, __pyx_t_2) < 0) __PYX_ERR(2, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":144 * K_FIND = SDLK_FIND * K_MUTE = SDLK_MUTE * K_VOLUMEUP = SDLK_VOLUMEUP # <<<<<<<<<<<<<< * K_VOLUMEDOWN = SDLK_VOLUMEDOWN * K_KP_COMMA = SDLK_KP_COMMA */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_VOLUMEUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_VOLUMEUP, __pyx_t_2) < 0) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":145 * K_MUTE = SDLK_MUTE * K_VOLUMEUP = SDLK_VOLUMEUP * K_VOLUMEDOWN = SDLK_VOLUMEDOWN # <<<<<<<<<<<<<< * K_KP_COMMA = SDLK_KP_COMMA * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_VOLUMEDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_VOLUMEDOWN, __pyx_t_2) < 0) __PYX_ERR(2, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":146 * K_VOLUMEUP = SDLK_VOLUMEUP * K_VOLUMEDOWN = SDLK_VOLUMEDOWN * K_KP_COMMA = SDLK_KP_COMMA # <<<<<<<<<<<<<< * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * K_ALTERASE = SDLK_ALTERASE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_COMMA); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_COMMA, __pyx_t_2) < 0) __PYX_ERR(2, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":147 * K_VOLUMEDOWN = SDLK_VOLUMEDOWN * K_KP_COMMA = SDLK_KP_COMMA * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 # <<<<<<<<<<<<<< * K_ALTERASE = SDLK_ALTERASE * K_SYSREQ = SDLK_SYSREQ */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_EQUALSAS400); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_EQUALSAS400, __pyx_t_2) < 0) __PYX_ERR(2, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":148 * K_KP_COMMA = SDLK_KP_COMMA * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * K_ALTERASE = SDLK_ALTERASE # <<<<<<<<<<<<<< * K_SYSREQ = SDLK_SYSREQ * K_CANCEL = SDLK_CANCEL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_ALTERASE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_ALTERASE, __pyx_t_2) < 0) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":149 * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * K_ALTERASE = SDLK_ALTERASE * K_SYSREQ = SDLK_SYSREQ # <<<<<<<<<<<<<< * K_CANCEL = SDLK_CANCEL * K_CLEAR = SDLK_CLEAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SYSREQ); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SYSREQ, __pyx_t_2) < 0) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":150 * K_ALTERASE = SDLK_ALTERASE * K_SYSREQ = SDLK_SYSREQ * K_CANCEL = SDLK_CANCEL # <<<<<<<<<<<<<< * K_CLEAR = SDLK_CLEAR * K_PRIOR = SDLK_PRIOR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CANCEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CANCEL, __pyx_t_2) < 0) __PYX_ERR(2, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":151 * K_SYSREQ = SDLK_SYSREQ * K_CANCEL = SDLK_CANCEL * K_CLEAR = SDLK_CLEAR # <<<<<<<<<<<<<< * K_PRIOR = SDLK_PRIOR * K_RETURN2 = SDLK_RETURN2 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CLEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CLEAR, __pyx_t_2) < 0) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":152 * K_CANCEL = SDLK_CANCEL * K_CLEAR = SDLK_CLEAR * K_PRIOR = SDLK_PRIOR # <<<<<<<<<<<<<< * K_RETURN2 = SDLK_RETURN2 * K_SEPARATOR = SDLK_SEPARATOR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PRIOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PRIOR, __pyx_t_2) < 0) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":153 * K_CLEAR = SDLK_CLEAR * K_PRIOR = SDLK_PRIOR * K_RETURN2 = SDLK_RETURN2 # <<<<<<<<<<<<<< * K_SEPARATOR = SDLK_SEPARATOR * K_OUT = SDLK_OUT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RETURN2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RETURN2, __pyx_t_2) < 0) __PYX_ERR(2, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":154 * K_PRIOR = SDLK_PRIOR * K_RETURN2 = SDLK_RETURN2 * K_SEPARATOR = SDLK_SEPARATOR # <<<<<<<<<<<<<< * K_OUT = SDLK_OUT * K_OPER = SDLK_OPER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SEPARATOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SEPARATOR, __pyx_t_2) < 0) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":155 * K_RETURN2 = SDLK_RETURN2 * K_SEPARATOR = SDLK_SEPARATOR * K_OUT = SDLK_OUT # <<<<<<<<<<<<<< * K_OPER = SDLK_OPER * K_CLEARAGAIN = SDLK_CLEARAGAIN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_OUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_OUT, __pyx_t_2) < 0) __PYX_ERR(2, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":156 * K_SEPARATOR = SDLK_SEPARATOR * K_OUT = SDLK_OUT * K_OPER = SDLK_OPER # <<<<<<<<<<<<<< * K_CLEARAGAIN = SDLK_CLEARAGAIN * K_CRSEL = SDLK_CRSEL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_OPER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_OPER, __pyx_t_2) < 0) __PYX_ERR(2, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":157 * K_OUT = SDLK_OUT * K_OPER = SDLK_OPER * K_CLEARAGAIN = SDLK_CLEARAGAIN # <<<<<<<<<<<<<< * K_CRSEL = SDLK_CRSEL * K_EXSEL = SDLK_EXSEL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CLEARAGAIN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CLEARAGAIN, __pyx_t_2) < 0) __PYX_ERR(2, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":158 * K_OPER = SDLK_OPER * K_CLEARAGAIN = SDLK_CLEARAGAIN * K_CRSEL = SDLK_CRSEL # <<<<<<<<<<<<<< * K_EXSEL = SDLK_EXSEL * K_KP_00 = SDLK_KP_00 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CRSEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CRSEL, __pyx_t_2) < 0) __PYX_ERR(2, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":159 * K_CLEARAGAIN = SDLK_CLEARAGAIN * K_CRSEL = SDLK_CRSEL * K_EXSEL = SDLK_EXSEL # <<<<<<<<<<<<<< * K_KP_00 = SDLK_KP_00 * K_KP_000 = SDLK_KP_000 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_EXSEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EXSEL, __pyx_t_2) < 0) __PYX_ERR(2, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":160 * K_CRSEL = SDLK_CRSEL * K_EXSEL = SDLK_EXSEL * K_KP_00 = SDLK_KP_00 # <<<<<<<<<<<<<< * K_KP_000 = SDLK_KP_000 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_00); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_00, __pyx_t_2) < 0) __PYX_ERR(2, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":161 * K_EXSEL = SDLK_EXSEL * K_KP_00 = SDLK_KP_00 * K_KP_000 = SDLK_KP_000 # <<<<<<<<<<<<<< * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_000); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_000, __pyx_t_2) < 0) __PYX_ERR(2, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":162 * K_KP_00 = SDLK_KP_00 * K_KP_000 = SDLK_KP_000 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR # <<<<<<<<<<<<<< * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * K_CURRENCYUNIT = SDLK_CURRENCYUNIT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_THOUSANDSSEPARATOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_THOUSANDSSEPARATOR, __pyx_t_2) < 0) __PYX_ERR(2, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":163 * K_KP_000 = SDLK_KP_000 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR # <<<<<<<<<<<<<< * K_CURRENCYUNIT = SDLK_CURRENCYUNIT * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_DECIMALSEPARATOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DECIMALSEPARATOR, __pyx_t_2) < 0) __PYX_ERR(2, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":164 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * K_CURRENCYUNIT = SDLK_CURRENCYUNIT # <<<<<<<<<<<<<< * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CURRENCYUNIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CURRENCYUNIT, __pyx_t_2) < 0) __PYX_ERR(2, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":165 * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * K_CURRENCYUNIT = SDLK_CURRENCYUNIT * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT # <<<<<<<<<<<<<< * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CURRENCYSUBUNIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CURRENCYSUBUNIT, __pyx_t_2) < 0) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":166 * K_CURRENCYUNIT = SDLK_CURRENCYUNIT * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN # <<<<<<<<<<<<<< * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_LEFTPAREN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_LEFTPAREN, __pyx_t_2) < 0) __PYX_ERR(2, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":167 * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN # <<<<<<<<<<<<<< * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_RIGHTPAREN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_RIGHTPAREN, __pyx_t_2) < 0) __PYX_ERR(2, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":168 * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE # <<<<<<<<<<<<<< * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * K_KP_TAB = SDLK_KP_TAB */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_LEFTBRACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_LEFTBRACE, __pyx_t_2) < 0) __PYX_ERR(2, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":169 * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE # <<<<<<<<<<<<<< * K_KP_TAB = SDLK_KP_TAB * K_KP_BACKSPACE = SDLK_KP_BACKSPACE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_RIGHTBRACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_RIGHTBRACE, __pyx_t_2) < 0) __PYX_ERR(2, 169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":170 * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * K_KP_TAB = SDLK_KP_TAB # <<<<<<<<<<<<<< * K_KP_BACKSPACE = SDLK_KP_BACKSPACE * K_KP_A = SDLK_KP_A */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_TAB); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_TAB, __pyx_t_2) < 0) __PYX_ERR(2, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":171 * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * K_KP_TAB = SDLK_KP_TAB * K_KP_BACKSPACE = SDLK_KP_BACKSPACE # <<<<<<<<<<<<<< * K_KP_A = SDLK_KP_A * K_KP_B = SDLK_KP_B */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_BACKSPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_BACKSPACE, __pyx_t_2) < 0) __PYX_ERR(2, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":172 * K_KP_TAB = SDLK_KP_TAB * K_KP_BACKSPACE = SDLK_KP_BACKSPACE * K_KP_A = SDLK_KP_A # <<<<<<<<<<<<<< * K_KP_B = SDLK_KP_B * K_KP_C = SDLK_KP_C */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_A); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_A, __pyx_t_2) < 0) __PYX_ERR(2, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":173 * K_KP_BACKSPACE = SDLK_KP_BACKSPACE * K_KP_A = SDLK_KP_A * K_KP_B = SDLK_KP_B # <<<<<<<<<<<<<< * K_KP_C = SDLK_KP_C * K_KP_D = SDLK_KP_D */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_B); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_B, __pyx_t_2) < 0) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":174 * K_KP_A = SDLK_KP_A * K_KP_B = SDLK_KP_B * K_KP_C = SDLK_KP_C # <<<<<<<<<<<<<< * K_KP_D = SDLK_KP_D * K_KP_E = SDLK_KP_E */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_C); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_C, __pyx_t_2) < 0) __PYX_ERR(2, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":175 * K_KP_B = SDLK_KP_B * K_KP_C = SDLK_KP_C * K_KP_D = SDLK_KP_D # <<<<<<<<<<<<<< * K_KP_E = SDLK_KP_E * K_KP_F = SDLK_KP_F */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_D); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_D, __pyx_t_2) < 0) __PYX_ERR(2, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":176 * K_KP_C = SDLK_KP_C * K_KP_D = SDLK_KP_D * K_KP_E = SDLK_KP_E # <<<<<<<<<<<<<< * K_KP_F = SDLK_KP_F * K_KP_XOR = SDLK_KP_XOR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_E); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_E, __pyx_t_2) < 0) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":177 * K_KP_D = SDLK_KP_D * K_KP_E = SDLK_KP_E * K_KP_F = SDLK_KP_F # <<<<<<<<<<<<<< * K_KP_XOR = SDLK_KP_XOR * K_KP_POWER = SDLK_KP_POWER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_F); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_F, __pyx_t_2) < 0) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":178 * K_KP_E = SDLK_KP_E * K_KP_F = SDLK_KP_F * K_KP_XOR = SDLK_KP_XOR # <<<<<<<<<<<<<< * K_KP_POWER = SDLK_KP_POWER * K_KP_PERCENT = SDLK_KP_PERCENT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_XOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_XOR, __pyx_t_2) < 0) __PYX_ERR(2, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":179 * K_KP_F = SDLK_KP_F * K_KP_XOR = SDLK_KP_XOR * K_KP_POWER = SDLK_KP_POWER # <<<<<<<<<<<<<< * K_KP_PERCENT = SDLK_KP_PERCENT * K_KP_LESS = SDLK_KP_LESS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_POWER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_POWER, __pyx_t_2) < 0) __PYX_ERR(2, 179, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":180 * K_KP_XOR = SDLK_KP_XOR * K_KP_POWER = SDLK_KP_POWER * K_KP_PERCENT = SDLK_KP_PERCENT # <<<<<<<<<<<<<< * K_KP_LESS = SDLK_KP_LESS * K_KP_GREATER = SDLK_KP_GREATER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_PERCENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PERCENT, __pyx_t_2) < 0) __PYX_ERR(2, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":181 * K_KP_POWER = SDLK_KP_POWER * K_KP_PERCENT = SDLK_KP_PERCENT * K_KP_LESS = SDLK_KP_LESS # <<<<<<<<<<<<<< * K_KP_GREATER = SDLK_KP_GREATER * K_KP_AMPERSAND = SDLK_KP_AMPERSAND */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_LESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_LESS, __pyx_t_2) < 0) __PYX_ERR(2, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":182 * K_KP_PERCENT = SDLK_KP_PERCENT * K_KP_LESS = SDLK_KP_LESS * K_KP_GREATER = SDLK_KP_GREATER # <<<<<<<<<<<<<< * K_KP_AMPERSAND = SDLK_KP_AMPERSAND * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_GREATER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_GREATER, __pyx_t_2) < 0) __PYX_ERR(2, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":183 * K_KP_LESS = SDLK_KP_LESS * K_KP_GREATER = SDLK_KP_GREATER * K_KP_AMPERSAND = SDLK_KP_AMPERSAND # <<<<<<<<<<<<<< * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_AMPERSAND); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_AMPERSAND, __pyx_t_2) < 0) __PYX_ERR(2, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":184 * K_KP_GREATER = SDLK_KP_GREATER * K_KP_AMPERSAND = SDLK_KP_AMPERSAND * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND # <<<<<<<<<<<<<< * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_DBLAMPERSAND); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DBLAMPERSAND, __pyx_t_2) < 0) __PYX_ERR(2, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":185 * K_KP_AMPERSAND = SDLK_KP_AMPERSAND * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR # <<<<<<<<<<<<<< * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * K_KP_COLON = SDLK_KP_COLON */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_VERTICALBAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_VERTICALBAR, __pyx_t_2) < 0) __PYX_ERR(2, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":186 * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR # <<<<<<<<<<<<<< * K_KP_COLON = SDLK_KP_COLON * K_KP_HASH = SDLK_KP_HASH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_DBLVERTICALBAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DBLVERTICALBAR, __pyx_t_2) < 0) __PYX_ERR(2, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":187 * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * K_KP_COLON = SDLK_KP_COLON # <<<<<<<<<<<<<< * K_KP_HASH = SDLK_KP_HASH * K_KP_SPACE = SDLK_KP_SPACE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_COLON); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_COLON, __pyx_t_2) < 0) __PYX_ERR(2, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":188 * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * K_KP_COLON = SDLK_KP_COLON * K_KP_HASH = SDLK_KP_HASH # <<<<<<<<<<<<<< * K_KP_SPACE = SDLK_KP_SPACE * K_KP_AT = SDLK_KP_AT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_HASH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_HASH, __pyx_t_2) < 0) __PYX_ERR(2, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":189 * K_KP_COLON = SDLK_KP_COLON * K_KP_HASH = SDLK_KP_HASH * K_KP_SPACE = SDLK_KP_SPACE # <<<<<<<<<<<<<< * K_KP_AT = SDLK_KP_AT * K_KP_EXCLAM = SDLK_KP_EXCLAM */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_SPACE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_SPACE, __pyx_t_2) < 0) __PYX_ERR(2, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":190 * K_KP_HASH = SDLK_KP_HASH * K_KP_SPACE = SDLK_KP_SPACE * K_KP_AT = SDLK_KP_AT # <<<<<<<<<<<<<< * K_KP_EXCLAM = SDLK_KP_EXCLAM * K_KP_MEMSTORE = SDLK_KP_MEMSTORE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_AT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_AT, __pyx_t_2) < 0) __PYX_ERR(2, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":191 * K_KP_SPACE = SDLK_KP_SPACE * K_KP_AT = SDLK_KP_AT * K_KP_EXCLAM = SDLK_KP_EXCLAM # <<<<<<<<<<<<<< * K_KP_MEMSTORE = SDLK_KP_MEMSTORE * K_KP_MEMRECALL = SDLK_KP_MEMRECALL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_EXCLAM); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_EXCLAM, __pyx_t_2) < 0) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":192 * K_KP_AT = SDLK_KP_AT * K_KP_EXCLAM = SDLK_KP_EXCLAM * K_KP_MEMSTORE = SDLK_KP_MEMSTORE # <<<<<<<<<<<<<< * K_KP_MEMRECALL = SDLK_KP_MEMRECALL * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMSTORE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMSTORE, __pyx_t_2) < 0) __PYX_ERR(2, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":193 * K_KP_EXCLAM = SDLK_KP_EXCLAM * K_KP_MEMSTORE = SDLK_KP_MEMSTORE * K_KP_MEMRECALL = SDLK_KP_MEMRECALL # <<<<<<<<<<<<<< * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR * K_KP_MEMADD = SDLK_KP_MEMADD */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMRECALL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMRECALL, __pyx_t_2) < 0) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":194 * K_KP_MEMSTORE = SDLK_KP_MEMSTORE * K_KP_MEMRECALL = SDLK_KP_MEMRECALL * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR # <<<<<<<<<<<<<< * K_KP_MEMADD = SDLK_KP_MEMADD * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMCLEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMCLEAR, __pyx_t_2) < 0) __PYX_ERR(2, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":195 * K_KP_MEMRECALL = SDLK_KP_MEMRECALL * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR * K_KP_MEMADD = SDLK_KP_MEMADD # <<<<<<<<<<<<<< * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMADD); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMADD, __pyx_t_2) < 0) __PYX_ERR(2, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":196 * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR * K_KP_MEMADD = SDLK_KP_MEMADD * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT # <<<<<<<<<<<<<< * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMSUBTRACT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMSUBTRACT, __pyx_t_2) < 0) __PYX_ERR(2, 196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":197 * K_KP_MEMADD = SDLK_KP_MEMADD * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY # <<<<<<<<<<<<<< * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMMULTIPLY); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMMULTIPLY, __pyx_t_2) < 0) __PYX_ERR(2, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":198 * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE # <<<<<<<<<<<<<< * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS * K_KP_CLEAR = SDLK_KP_CLEAR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_MEMDIVIDE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMDIVIDE, __pyx_t_2) < 0) __PYX_ERR(2, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":199 * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS # <<<<<<<<<<<<<< * K_KP_CLEAR = SDLK_KP_CLEAR * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_PLUSMINUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PLUSMINUS, __pyx_t_2) < 0) __PYX_ERR(2, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":200 * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS * K_KP_CLEAR = SDLK_KP_CLEAR # <<<<<<<<<<<<<< * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY * K_KP_BINARY = SDLK_KP_BINARY */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_CLEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_CLEAR, __pyx_t_2) < 0) __PYX_ERR(2, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":201 * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS * K_KP_CLEAR = SDLK_KP_CLEAR * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY # <<<<<<<<<<<<<< * K_KP_BINARY = SDLK_KP_BINARY * K_KP_OCTAL = SDLK_KP_OCTAL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_CLEARENTRY); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_CLEARENTRY, __pyx_t_2) < 0) __PYX_ERR(2, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":202 * K_KP_CLEAR = SDLK_KP_CLEAR * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY * K_KP_BINARY = SDLK_KP_BINARY # <<<<<<<<<<<<<< * K_KP_OCTAL = SDLK_KP_OCTAL * K_KP_DECIMAL = SDLK_KP_DECIMAL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_BINARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_BINARY, __pyx_t_2) < 0) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":203 * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY * K_KP_BINARY = SDLK_KP_BINARY * K_KP_OCTAL = SDLK_KP_OCTAL # <<<<<<<<<<<<<< * K_KP_DECIMAL = SDLK_KP_DECIMAL * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_OCTAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_OCTAL, __pyx_t_2) < 0) __PYX_ERR(2, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":204 * K_KP_BINARY = SDLK_KP_BINARY * K_KP_OCTAL = SDLK_KP_OCTAL * K_KP_DECIMAL = SDLK_KP_DECIMAL # <<<<<<<<<<<<<< * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * K_LCTRL = SDLK_LCTRL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_DECIMAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DECIMAL, __pyx_t_2) < 0) __PYX_ERR(2, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":205 * K_KP_OCTAL = SDLK_KP_OCTAL * K_KP_DECIMAL = SDLK_KP_DECIMAL * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL # <<<<<<<<<<<<<< * K_LCTRL = SDLK_LCTRL * K_LSHIFT = SDLK_LSHIFT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_HEXADECIMAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_HEXADECIMAL, __pyx_t_2) < 0) __PYX_ERR(2, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":206 * K_KP_DECIMAL = SDLK_KP_DECIMAL * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * K_LCTRL = SDLK_LCTRL # <<<<<<<<<<<<<< * K_LSHIFT = SDLK_LSHIFT * K_LALT = SDLK_LALT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LCTRL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LCTRL, __pyx_t_2) < 0) __PYX_ERR(2, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":207 * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * K_LCTRL = SDLK_LCTRL * K_LSHIFT = SDLK_LSHIFT # <<<<<<<<<<<<<< * K_LALT = SDLK_LALT * K_LGUI = SDLK_LGUI */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LSHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LSHIFT, __pyx_t_2) < 0) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":208 * K_LCTRL = SDLK_LCTRL * K_LSHIFT = SDLK_LSHIFT * K_LALT = SDLK_LALT # <<<<<<<<<<<<<< * K_LGUI = SDLK_LGUI * K_RCTRL = SDLK_RCTRL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LALT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LALT, __pyx_t_2) < 0) __PYX_ERR(2, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":209 * K_LSHIFT = SDLK_LSHIFT * K_LALT = SDLK_LALT * K_LGUI = SDLK_LGUI # <<<<<<<<<<<<<< * K_RCTRL = SDLK_RCTRL * K_RSHIFT = SDLK_RSHIFT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LGUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LGUI, __pyx_t_2) < 0) __PYX_ERR(2, 209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":210 * K_LALT = SDLK_LALT * K_LGUI = SDLK_LGUI * K_RCTRL = SDLK_RCTRL # <<<<<<<<<<<<<< * K_RSHIFT = SDLK_RSHIFT * K_RALT = SDLK_RALT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RCTRL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RCTRL, __pyx_t_2) < 0) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":211 * K_LGUI = SDLK_LGUI * K_RCTRL = SDLK_RCTRL * K_RSHIFT = SDLK_RSHIFT # <<<<<<<<<<<<<< * K_RALT = SDLK_RALT * K_RGUI = SDLK_RGUI */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RSHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RSHIFT, __pyx_t_2) < 0) __PYX_ERR(2, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":212 * K_RCTRL = SDLK_RCTRL * K_RSHIFT = SDLK_RSHIFT * K_RALT = SDLK_RALT # <<<<<<<<<<<<<< * K_RGUI = SDLK_RGUI * K_MODE = SDLK_MODE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RALT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RALT, __pyx_t_2) < 0) __PYX_ERR(2, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":213 * K_RSHIFT = SDLK_RSHIFT * K_RALT = SDLK_RALT * K_RGUI = SDLK_RGUI # <<<<<<<<<<<<<< * K_MODE = SDLK_MODE * K_AUDIONEXT = SDLK_AUDIONEXT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RGUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RGUI, __pyx_t_2) < 0) __PYX_ERR(2, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":214 * K_RALT = SDLK_RALT * K_RGUI = SDLK_RGUI * K_MODE = SDLK_MODE # <<<<<<<<<<<<<< * K_AUDIONEXT = SDLK_AUDIONEXT * K_AUDIOPREV = SDLK_AUDIOPREV */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_MODE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MODE, __pyx_t_2) < 0) __PYX_ERR(2, 214, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":215 * K_RGUI = SDLK_RGUI * K_MODE = SDLK_MODE * K_AUDIONEXT = SDLK_AUDIONEXT # <<<<<<<<<<<<<< * K_AUDIOPREV = SDLK_AUDIOPREV * K_AUDIOSTOP = SDLK_AUDIOSTOP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIONEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIONEXT, __pyx_t_2) < 0) __PYX_ERR(2, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":216 * K_MODE = SDLK_MODE * K_AUDIONEXT = SDLK_AUDIONEXT * K_AUDIOPREV = SDLK_AUDIOPREV # <<<<<<<<<<<<<< * K_AUDIOSTOP = SDLK_AUDIOSTOP * K_AUDIOPLAY = SDLK_AUDIOPLAY */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIOPREV); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOPREV, __pyx_t_2) < 0) __PYX_ERR(2, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":217 * K_AUDIONEXT = SDLK_AUDIONEXT * K_AUDIOPREV = SDLK_AUDIOPREV * K_AUDIOSTOP = SDLK_AUDIOSTOP # <<<<<<<<<<<<<< * K_AUDIOPLAY = SDLK_AUDIOPLAY * K_AUDIOMUTE = SDLK_AUDIOMUTE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIOSTOP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOSTOP, __pyx_t_2) < 0) __PYX_ERR(2, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":218 * K_AUDIOPREV = SDLK_AUDIOPREV * K_AUDIOSTOP = SDLK_AUDIOSTOP * K_AUDIOPLAY = SDLK_AUDIOPLAY # <<<<<<<<<<<<<< * K_AUDIOMUTE = SDLK_AUDIOMUTE * K_MEDIASELECT = SDLK_MEDIASELECT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIOPLAY); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOPLAY, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":219 * K_AUDIOSTOP = SDLK_AUDIOSTOP * K_AUDIOPLAY = SDLK_AUDIOPLAY * K_AUDIOMUTE = SDLK_AUDIOMUTE # <<<<<<<<<<<<<< * K_MEDIASELECT = SDLK_MEDIASELECT * K_WWW = SDLK_WWW */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIOMUTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOMUTE, __pyx_t_2) < 0) __PYX_ERR(2, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":220 * K_AUDIOPLAY = SDLK_AUDIOPLAY * K_AUDIOMUTE = SDLK_AUDIOMUTE * K_MEDIASELECT = SDLK_MEDIASELECT # <<<<<<<<<<<<<< * K_WWW = SDLK_WWW * K_MAIL = SDLK_MAIL */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_MEDIASELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MEDIASELECT, __pyx_t_2) < 0) __PYX_ERR(2, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":221 * K_AUDIOMUTE = SDLK_AUDIOMUTE * K_MEDIASELECT = SDLK_MEDIASELECT * K_WWW = SDLK_WWW # <<<<<<<<<<<<<< * K_MAIL = SDLK_MAIL * K_CALCULATOR = SDLK_CALCULATOR */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_WWW); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_WWW, __pyx_t_2) < 0) __PYX_ERR(2, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":222 * K_MEDIASELECT = SDLK_MEDIASELECT * K_WWW = SDLK_WWW * K_MAIL = SDLK_MAIL # <<<<<<<<<<<<<< * K_CALCULATOR = SDLK_CALCULATOR * K_COMPUTER = SDLK_COMPUTER */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_MAIL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MAIL, __pyx_t_2) < 0) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":223 * K_WWW = SDLK_WWW * K_MAIL = SDLK_MAIL * K_CALCULATOR = SDLK_CALCULATOR # <<<<<<<<<<<<<< * K_COMPUTER = SDLK_COMPUTER * K_AC_SEARCH = SDLK_AC_SEARCH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CALCULATOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CALCULATOR, __pyx_t_2) < 0) __PYX_ERR(2, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":224 * K_MAIL = SDLK_MAIL * K_CALCULATOR = SDLK_CALCULATOR * K_COMPUTER = SDLK_COMPUTER # <<<<<<<<<<<<<< * K_AC_SEARCH = SDLK_AC_SEARCH * K_AC_HOME = SDLK_AC_HOME */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_COMPUTER); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COMPUTER, __pyx_t_2) < 0) __PYX_ERR(2, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":225 * K_CALCULATOR = SDLK_CALCULATOR * K_COMPUTER = SDLK_COMPUTER * K_AC_SEARCH = SDLK_AC_SEARCH # <<<<<<<<<<<<<< * K_AC_HOME = SDLK_AC_HOME * K_AC_BACK = SDLK_AC_BACK */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_SEARCH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_SEARCH, __pyx_t_2) < 0) __PYX_ERR(2, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":226 * K_COMPUTER = SDLK_COMPUTER * K_AC_SEARCH = SDLK_AC_SEARCH * K_AC_HOME = SDLK_AC_HOME # <<<<<<<<<<<<<< * K_AC_BACK = SDLK_AC_BACK * K_AC_FORWARD = SDLK_AC_FORWARD */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_HOME); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_HOME, __pyx_t_2) < 0) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":227 * K_AC_SEARCH = SDLK_AC_SEARCH * K_AC_HOME = SDLK_AC_HOME * K_AC_BACK = SDLK_AC_BACK # <<<<<<<<<<<<<< * K_AC_FORWARD = SDLK_AC_FORWARD * K_AC_STOP = SDLK_AC_STOP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_BACK); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_BACK, __pyx_t_2) < 0) __PYX_ERR(2, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":228 * K_AC_HOME = SDLK_AC_HOME * K_AC_BACK = SDLK_AC_BACK * K_AC_FORWARD = SDLK_AC_FORWARD # <<<<<<<<<<<<<< * K_AC_STOP = SDLK_AC_STOP * K_AC_REFRESH = SDLK_AC_REFRESH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_FORWARD); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_FORWARD, __pyx_t_2) < 0) __PYX_ERR(2, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":229 * K_AC_BACK = SDLK_AC_BACK * K_AC_FORWARD = SDLK_AC_FORWARD * K_AC_STOP = SDLK_AC_STOP # <<<<<<<<<<<<<< * K_AC_REFRESH = SDLK_AC_REFRESH * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_STOP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_STOP, __pyx_t_2) < 0) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":230 * K_AC_FORWARD = SDLK_AC_FORWARD * K_AC_STOP = SDLK_AC_STOP * K_AC_REFRESH = SDLK_AC_REFRESH # <<<<<<<<<<<<<< * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_REFRESH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_REFRESH, __pyx_t_2) < 0) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":231 * K_AC_STOP = SDLK_AC_STOP * K_AC_REFRESH = SDLK_AC_REFRESH * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS # <<<<<<<<<<<<<< * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AC_BOOKMARKS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_BOOKMARKS, __pyx_t_2) < 0) __PYX_ERR(2, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":232 * K_AC_REFRESH = SDLK_AC_REFRESH * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN # <<<<<<<<<<<<<< * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_BRIGHTNESSDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BRIGHTNESSDOWN, __pyx_t_2) < 0) __PYX_ERR(2, 232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":233 * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP # <<<<<<<<<<<<<< * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_BRIGHTNESSUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BRIGHTNESSUP, __pyx_t_2) < 0) __PYX_ERR(2, 233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":234 * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH # <<<<<<<<<<<<<< * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_DISPLAYSWITCH); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DISPLAYSWITCH, __pyx_t_2) < 0) __PYX_ERR(2, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":235 * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE # <<<<<<<<<<<<<< * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN * K_KBDILLUMUP = SDLK_KBDILLUMUP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KBDILLUMTOGGLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KBDILLUMTOGGLE, __pyx_t_2) < 0) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":236 * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN # <<<<<<<<<<<<<< * K_KBDILLUMUP = SDLK_KBDILLUMUP * K_EJECT = SDLK_EJECT */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KBDILLUMDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KBDILLUMDOWN, __pyx_t_2) < 0) __PYX_ERR(2, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":237 * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN * K_KBDILLUMUP = SDLK_KBDILLUMUP # <<<<<<<<<<<<<< * K_EJECT = SDLK_EJECT * K_SLEEP = SDLK_SLEEP */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KBDILLUMUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KBDILLUMUP, __pyx_t_2) < 0) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":238 * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN * K_KBDILLUMUP = SDLK_KBDILLUMUP * K_EJECT = SDLK_EJECT # <<<<<<<<<<<<<< * K_SLEEP = SDLK_SLEEP * K_APP1 = SDLK_APP1 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_EJECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EJECT, __pyx_t_2) < 0) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":239 * K_KBDILLUMUP = SDLK_KBDILLUMUP * K_EJECT = SDLK_EJECT * K_SLEEP = SDLK_SLEEP # <<<<<<<<<<<<<< * K_APP1 = SDLK_APP1 * K_APP2 = SDLK_APP2 */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SLEEP); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SLEEP, __pyx_t_2) < 0) __PYX_ERR(2, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":240 * K_EJECT = SDLK_EJECT * K_SLEEP = SDLK_SLEEP * K_APP1 = SDLK_APP1 # <<<<<<<<<<<<<< * K_APP2 = SDLK_APP2 * K_AUDIOREWIND = SDLK_AUDIOREWIND */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_APP1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_APP1, __pyx_t_2) < 0) __PYX_ERR(2, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":241 * K_SLEEP = SDLK_SLEEP * K_APP1 = SDLK_APP1 * K_APP2 = SDLK_APP2 # <<<<<<<<<<<<<< * K_AUDIOREWIND = SDLK_AUDIOREWIND * K_AUDIOFASTFORWARD = SDLK_AUDIOFASTFORWARD */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_APP2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_APP2, __pyx_t_2) < 0) __PYX_ERR(2, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":242 * K_APP1 = SDLK_APP1 * K_APP2 = SDLK_APP2 * K_AUDIOREWIND = SDLK_AUDIOREWIND # <<<<<<<<<<<<<< * K_AUDIOFASTFORWARD = SDLK_AUDIOFASTFORWARD */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIOREWIND); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOREWIND, __pyx_t_2) < 0) __PYX_ERR(2, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/keycode_list.pxi":243 * K_APP2 = SDLK_APP2 * K_AUDIOREWIND = SDLK_AUDIOREWIND * K_AUDIOFASTFORWARD = SDLK_AUDIOFASTFORWARD # <<<<<<<<<<<<<< */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_AUDIOFASTFORWARD); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOFASTFORWARD, __pyx_t_2) < 0) __PYX_ERR(2, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":1 * GL_RED_SIZE = SDL_GL_RED_SIZE # <<<<<<<<<<<<<< * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_RED_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_RED_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":2 * GL_RED_SIZE = SDL_GL_RED_SIZE * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE # <<<<<<<<<<<<<< * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_GREEN_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_GREEN_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":3 * GL_RED_SIZE = SDL_GL_RED_SIZE * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE # <<<<<<<<<<<<<< * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_BLUE_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_BLUE_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":4 * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE # <<<<<<<<<<<<<< * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ALPHA_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ALPHA_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":5 * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE # <<<<<<<<<<<<<< * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_BUFFER_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_BUFFER_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":6 * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER # <<<<<<<<<<<<<< * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_DOUBLEBUFFER); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_DOUBLEBUFFER, __pyx_t_2) < 0) __PYX_ERR(3, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":7 * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE # <<<<<<<<<<<<<< * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_DEPTH_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_DEPTH_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":8 * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_STENCIL_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_STENCIL_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":9 * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_RED_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_RED_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":10 * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_GREEN_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_GREEN_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":11 * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE * GL_STEREO = SDL_GL_STEREO */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_BLUE_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_BLUE_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":12 * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE # <<<<<<<<<<<<<< * GL_STEREO = SDL_GL_STEREO * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_ALPHA_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_ALPHA_SIZE, __pyx_t_2) < 0) __PYX_ERR(3, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":13 * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE * GL_STEREO = SDL_GL_STEREO # <<<<<<<<<<<<<< * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_STEREO); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_STEREO, __pyx_t_2) < 0) __PYX_ERR(3, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":14 * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE * GL_STEREO = SDL_GL_STEREO * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS # <<<<<<<<<<<<<< * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_MULTISAMPLEBUFFERS); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_MULTISAMPLEBUFFERS, __pyx_t_2) < 0) __PYX_ERR(3, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":15 * GL_STEREO = SDL_GL_STEREO * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES # <<<<<<<<<<<<<< * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_MULTISAMPLESAMPLES); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_MULTISAMPLESAMPLES, __pyx_t_2) < 0) __PYX_ERR(3, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":16 * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL # <<<<<<<<<<<<<< * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCELERATED_VISUAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCELERATED_VISUAL, __pyx_t_2) < 0) __PYX_ERR(3, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":17 * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING # <<<<<<<<<<<<<< * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_RETAINED_BACKING); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_RETAINED_BACKING, __pyx_t_2) < 0) __PYX_ERR(3, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":18 * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION # <<<<<<<<<<<<<< * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_MAJOR_VERSION); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_MAJOR_VERSION, __pyx_t_2) < 0) __PYX_ERR(3, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":19 * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION # <<<<<<<<<<<<<< * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_MINOR_VERSION); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_MINOR_VERSION, __pyx_t_2) < 0) __PYX_ERR(3, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":20 * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL # <<<<<<<<<<<<<< * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_EGL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_EGL, __pyx_t_2) < 0) __PYX_ERR(3, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":21 * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS # <<<<<<<<<<<<<< * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_FLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_FLAGS, __pyx_t_2) < 0) __PYX_ERR(3, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":22 * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK # <<<<<<<<<<<<<< * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_PROFILE_MASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_PROFILE_MASK, __pyx_t_2) < 0) __PYX_ERR(3, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":23 * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT # <<<<<<<<<<<<<< * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE * GL_CONTEXT_RELEASE_BEHAVIOR = SDL_GL_CONTEXT_RELEASE_BEHAVIOR */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_SHARE_WITH_CURRENT_CONTEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT, __pyx_t_2) < 0) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":24 * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE # <<<<<<<<<<<<<< * GL_CONTEXT_RELEASE_BEHAVIOR = SDL_GL_CONTEXT_RELEASE_BEHAVIOR * GL_CONTEXT_RESET_NOTIFICATION = SDL_GL_CONTEXT_RESET_NOTIFICATION */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE, __pyx_t_2) < 0) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":25 * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE * GL_CONTEXT_RELEASE_BEHAVIOR = SDL_GL_CONTEXT_RELEASE_BEHAVIOR # <<<<<<<<<<<<<< * GL_CONTEXT_RESET_NOTIFICATION = SDL_GL_CONTEXT_RESET_NOTIFICATION * GL_CONTEXT_NO_ERROR = SDL_GL_CONTEXT_NO_ERROR */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_RELEASE_BEHAVIOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_RELEASE_BEHAVIOR, __pyx_t_2) < 0) __PYX_ERR(3, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":26 * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE * GL_CONTEXT_RELEASE_BEHAVIOR = SDL_GL_CONTEXT_RELEASE_BEHAVIOR * GL_CONTEXT_RESET_NOTIFICATION = SDL_GL_CONTEXT_RESET_NOTIFICATION # <<<<<<<<<<<<<< * GL_CONTEXT_NO_ERROR = SDL_GL_CONTEXT_NO_ERROR */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_RESET_NOTIFICATION); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_RESET_NOTIFICATION, __pyx_t_2) < 0) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/glattr.pxi":27 * GL_CONTEXT_RELEASE_BEHAVIOR = SDL_GL_CONTEXT_RELEASE_BEHAVIOR * GL_CONTEXT_RESET_NOTIFICATION = SDL_GL_CONTEXT_RESET_NOTIFICATION * GL_CONTEXT_NO_ERROR = SDL_GL_CONTEXT_NO_ERROR # <<<<<<<<<<<<<< */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_NO_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_NO_ERROR, __pyx_t_2) < 0) __PYX_ERR(3, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":16 * * include "glattr.pxi" * GL_SWAP_CONTROL = -1 # <<<<<<<<<<<<<< * * GL_CONTEXT_PROFILE_CORE = SDL_GL_CONTEXT_PROFILE_CORE */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SWAP_CONTROL, __pyx_int_neg_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":18 * GL_SWAP_CONTROL = -1 * * GL_CONTEXT_PROFILE_CORE = SDL_GL_CONTEXT_PROFILE_CORE # <<<<<<<<<<<<<< * GL_CONTEXT_PROFILE_COMPATIBILITY = SDL_GL_CONTEXT_PROFILE_COMPATIBILITY * GL_CONTEXT_PROFILE_ES = SDL_GL_CONTEXT_PROFILE_ES */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLprofile(SDL_GL_CONTEXT_PROFILE_CORE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_PROFILE_CORE, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":19 * * GL_CONTEXT_PROFILE_CORE = SDL_GL_CONTEXT_PROFILE_CORE * GL_CONTEXT_PROFILE_COMPATIBILITY = SDL_GL_CONTEXT_PROFILE_COMPATIBILITY # <<<<<<<<<<<<<< * GL_CONTEXT_PROFILE_ES = SDL_GL_CONTEXT_PROFILE_ES * */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLprofile(SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_PROFILE_COMPATIBILITY, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":20 * GL_CONTEXT_PROFILE_CORE = SDL_GL_CONTEXT_PROFILE_CORE * GL_CONTEXT_PROFILE_COMPATIBILITY = SDL_GL_CONTEXT_PROFILE_COMPATIBILITY * GL_CONTEXT_PROFILE_ES = SDL_GL_CONTEXT_PROFILE_ES # <<<<<<<<<<<<<< * * RLEACCEL = SDL_RLEACCEL */ __pyx_t_2 = __Pyx_PyInt_From_SDL_GLprofile(SDL_GL_CONTEXT_PROFILE_ES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_PROFILE_ES, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":22 * GL_CONTEXT_PROFILE_ES = SDL_GL_CONTEXT_PROFILE_ES * * RLEACCEL = SDL_RLEACCEL # <<<<<<<<<<<<<< * SRCCOLORKEY = 0 * */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_RLEACCEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RLEACCEL, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":23 * * RLEACCEL = SDL_RLEACCEL * SRCCOLORKEY = 0 # <<<<<<<<<<<<<< * * # Surface flags. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCCOLORKEY, __pyx_int_0) < 0) __PYX_ERR(0, 23, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":26 * * # Surface flags. * SRCALPHA = 0x80000000 # <<<<<<<<<<<<<< * HWSURFACE = 0x40000000 * SWSURFACE = 0 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_int_2147483648) < 0) __PYX_ERR(0, 26, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":27 * # Surface flags. * SRCALPHA = 0x80000000 * HWSURFACE = 0x40000000 # <<<<<<<<<<<<<< * SWSURFACE = 0 * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_HWSURFACE, __pyx_int_1073741824) < 0) __PYX_ERR(0, 27, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":28 * SRCALPHA = 0x80000000 * HWSURFACE = 0x40000000 * SWSURFACE = 0 # <<<<<<<<<<<<<< * * # Window flags. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SWSURFACE, __pyx_int_0) < 0) __PYX_ERR(0, 28, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":31 * * # Window flags. * FULLSCREEN = SDL_WINDOW_FULLSCREEN # <<<<<<<<<<<<<< * OPENGL = SDL_WINDOW_OPENGL * NOFRAME = SDL_WINDOW_BORDERLESS */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FULLSCREEN, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":32 * # Window flags. * FULLSCREEN = SDL_WINDOW_FULLSCREEN * OPENGL = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * NOFRAME = SDL_WINDOW_BORDERLESS * RESIZABLE = SDL_WINDOW_RESIZABLE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_OPENGL, __pyx_t_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":33 * FULLSCREEN = SDL_WINDOW_FULLSCREEN * OPENGL = SDL_WINDOW_OPENGL * NOFRAME = SDL_WINDOW_BORDERLESS # <<<<<<<<<<<<<< * RESIZABLE = SDL_WINDOW_RESIZABLE * DOUBLEBUF = 0 */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_BORDERLESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOFRAME, __pyx_t_2) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":34 * OPENGL = SDL_WINDOW_OPENGL * NOFRAME = SDL_WINDOW_BORDERLESS * RESIZABLE = SDL_WINDOW_RESIZABLE # <<<<<<<<<<<<<< * DOUBLEBUF = 0 * */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_RESIZABLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RESIZABLE, __pyx_t_2) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":35 * NOFRAME = SDL_WINDOW_BORDERLESS * RESIZABLE = SDL_WINDOW_RESIZABLE * DOUBLEBUF = 0 # <<<<<<<<<<<<<< * * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOUBLEBUF, __pyx_int_0) < 0) __PYX_ERR(0, 35, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":37 * DOUBLEBUF = 0 * * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN # <<<<<<<<<<<<<< * WINDOW_SHOWN = SDL_WINDOW_SHOWN * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_FULLSCREEN, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":38 * * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN * WINDOW_SHOWN = SDL_WINDOW_SHOWN # <<<<<<<<<<<<<< * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN * WINDOW_OPENGL = SDL_WINDOW_OPENGL */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_SHOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_SHOWN, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":39 * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN * WINDOW_SHOWN = SDL_WINDOW_SHOWN * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN # <<<<<<<<<<<<<< * WINDOW_OPENGL = SDL_WINDOW_OPENGL * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_HIDDEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_HIDDEN, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":40 * WINDOW_SHOWN = SDL_WINDOW_SHOWN * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN * WINDOW_OPENGL = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_OPENGL, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":41 * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN * WINDOW_OPENGL = SDL_WINDOW_OPENGL * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS # <<<<<<<<<<<<<< * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_BORDERLESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_NOFRAME, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":42 * WINDOW_OPENGL = SDL_WINDOW_OPENGL * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS # <<<<<<<<<<<<<< * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_BORDERLESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_BORDERLESS, __pyx_t_2) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":43 * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE # <<<<<<<<<<<<<< * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_RESIZABLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_RESIZABLE, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":44 * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED # <<<<<<<<<<<<<< * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_MINIMIZED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_MINIMIZED, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":45 * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED # <<<<<<<<<<<<<< * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_MAXIMIZED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_MAXIMIZED, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":46 * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED # <<<<<<<<<<<<<< * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_INPUT_GRABBED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_INPUT_GRABBED, __pyx_t_2) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":47 * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS # <<<<<<<<<<<<<< * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_MOUSE_FOCUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_INPUT_FOCUS, __pyx_t_2) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":48 * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<< * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN_DESKTOP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_FULLSCREEN_DESKTOP, __pyx_t_2) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":49 * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN # <<<<<<<<<<<<<< * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI * */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FOREIGN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_FOREIGN, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":50 * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI # <<<<<<<<<<<<<< * * WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED */ __pyx_t_2 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_ALLOW_HIGHDPI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_ALLOW_HIGHDPI, __pyx_t_2) < 0) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":52 * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI * * WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED # <<<<<<<<<<<<<< * WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED * */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_CENTERED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWPOS_CENTERED, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":53 * * WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED * WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED # <<<<<<<<<<<<<< * * # Blend modes */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWPOS_UNDEFINED, __pyx_t_2) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":56 * * # Blend modes * BLEND_RGB_ADD = BLEND_ADD = 0x1 # <<<<<<<<<<<<<< * BLEND_RGB_SUB = BLEND_SUB = 0x2 * BLEND_RGB_MULT = BLEND_MULT = 0x3 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_ADD, __pyx_int_1) < 0) __PYX_ERR(0, 56, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_ADD, __pyx_int_1) < 0) __PYX_ERR(0, 56, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":57 * # Blend modes * BLEND_RGB_ADD = BLEND_ADD = 0x1 * BLEND_RGB_SUB = BLEND_SUB = 0x2 # <<<<<<<<<<<<<< * BLEND_RGB_MULT = BLEND_MULT = 0x3 * BLEND_RGB_MIN = BLEND_MIN = 0x4 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_SUB, __pyx_int_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_SUB, __pyx_int_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":58 * BLEND_RGB_ADD = BLEND_ADD = 0x1 * BLEND_RGB_SUB = BLEND_SUB = 0x2 * BLEND_RGB_MULT = BLEND_MULT = 0x3 # <<<<<<<<<<<<<< * BLEND_RGB_MIN = BLEND_MIN = 0x4 * BLEND_RGB_MAX = BLEND_MAX = 0x5 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_MULT, __pyx_int_3) < 0) __PYX_ERR(0, 58, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_MULT, __pyx_int_3) < 0) __PYX_ERR(0, 58, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":59 * BLEND_RGB_SUB = BLEND_SUB = 0x2 * BLEND_RGB_MULT = BLEND_MULT = 0x3 * BLEND_RGB_MIN = BLEND_MIN = 0x4 # <<<<<<<<<<<<<< * BLEND_RGB_MAX = BLEND_MAX = 0x5 * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_MIN, __pyx_int_4) < 0) __PYX_ERR(0, 59, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_MIN, __pyx_int_4) < 0) __PYX_ERR(0, 59, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":60 * BLEND_RGB_MULT = BLEND_MULT = 0x3 * BLEND_RGB_MIN = BLEND_MIN = 0x4 * BLEND_RGB_MAX = BLEND_MAX = 0x5 # <<<<<<<<<<<<<< * * BLEND_RGBA_ADD = 0x6 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_MAX, __pyx_int_5) < 0) __PYX_ERR(0, 60, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_MAX, __pyx_int_5) < 0) __PYX_ERR(0, 60, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":62 * BLEND_RGB_MAX = BLEND_MAX = 0x5 * * BLEND_RGBA_ADD = 0x6 # <<<<<<<<<<<<<< * BLEND_RGBA_SUB = 0x7 * BLEND_RGBA_MULT = 0x8 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_ADD, __pyx_int_6) < 0) __PYX_ERR(0, 62, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":63 * * BLEND_RGBA_ADD = 0x6 * BLEND_RGBA_SUB = 0x7 # <<<<<<<<<<<<<< * BLEND_RGBA_MULT = 0x8 * BLEND_RGBA_MIN = 0x9 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_SUB, __pyx_int_7) < 0) __PYX_ERR(0, 63, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":64 * BLEND_RGBA_ADD = 0x6 * BLEND_RGBA_SUB = 0x7 * BLEND_RGBA_MULT = 0x8 # <<<<<<<<<<<<<< * BLEND_RGBA_MIN = 0x9 * BLEND_RGBA_MAX = 0x10 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_MULT, __pyx_int_8) < 0) __PYX_ERR(0, 64, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":65 * BLEND_RGBA_SUB = 0x7 * BLEND_RGBA_MULT = 0x8 * BLEND_RGBA_MIN = 0x9 # <<<<<<<<<<<<<< * BLEND_RGBA_MAX = 0x10 * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_MIN, __pyx_int_9) < 0) __PYX_ERR(0, 65, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":66 * BLEND_RGBA_MULT = 0x8 * BLEND_RGBA_MIN = 0x9 * BLEND_RGBA_MAX = 0x10 # <<<<<<<<<<<<<< * * BLEND_PREMULTIPLIED = 0x11 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_MAX, __pyx_int_16) < 0) __PYX_ERR(0, 66, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":68 * BLEND_RGBA_MAX = 0x10 * * BLEND_PREMULTIPLIED = 0x11 # <<<<<<<<<<<<<< * * # Scrap types. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_PREMULTIPLIED, __pyx_int_17) < 0) __PYX_ERR(0, 68, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":71 * * # Scrap types. * SCRAP_TEXT = "text/plain" # <<<<<<<<<<<<<< * * BYTEORDER = SDL_BYTEORDER */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCRAP_TEXT, __pyx_kp_s_text_plain) < 0) __PYX_ERR(0, 71, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":73 * SCRAP_TEXT = "text/plain" * * BYTEORDER = SDL_BYTEORDER # <<<<<<<<<<<<<< * LIL_ENDIAN = SDL_LIL_ENDIAN * BIG_ENDIAN = SDL_BIG_ENDIAN */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_BYTEORDER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BYTEORDER, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":74 * * BYTEORDER = SDL_BYTEORDER * LIL_ENDIAN = SDL_LIL_ENDIAN # <<<<<<<<<<<<<< * BIG_ENDIAN = SDL_BIG_ENDIAN * */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_LIL_ENDIAN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIL_ENDIAN, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":75 * BYTEORDER = SDL_BYTEORDER * LIL_ENDIAN = SDL_LIL_ENDIAN * BIG_ENDIAN = SDL_BIG_ENDIAN # <<<<<<<<<<<<<< * * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_BIG_ENDIAN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BIG_ENDIAN, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":77 * BIG_ENDIAN = SDL_BIG_ENDIAN * * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) # <<<<<<<<<<<<<< * * globals().update(dict( */ __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(SDL_MAJOR_VERSION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDL_MINOR_VERSION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From___pyx_anon_enum(SDL_PATCHLEVEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_SDL_VERSION_TUPLE, __pyx_t_5) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/locals.pyx":79 * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) * * globals().update(dict( # <<<<<<<<<<<<<< * KMOD_NONE = sdl2.KMOD_NONE, * */ __pyx_t_5 = __Pyx_Globals(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/locals.pyx":80 * * globals().update(dict( * KMOD_NONE = sdl2.KMOD_NONE, # <<<<<<<<<<<<<< * * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, */ __pyx_t_5 = __Pyx_PyDict_NewPresized(40); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_NONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_NONE, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":82 * KMOD_NONE = sdl2.KMOD_NONE, * * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, # <<<<<<<<<<<<<< * KMOD_RSHIFT = sdl2.KMOD_RSHIFT, * KMOD_SHIFT = sdl2.KMOD_SHIFT, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LSHIFT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_LSHIFT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":83 * * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, * KMOD_RSHIFT = sdl2.KMOD_RSHIFT, # <<<<<<<<<<<<<< * KMOD_SHIFT = sdl2.KMOD_SHIFT, * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RSHIFT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_RSHIFT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":84 * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, * KMOD_RSHIFT = sdl2.KMOD_RSHIFT, * KMOD_SHIFT = sdl2.KMOD_SHIFT, # <<<<<<<<<<<<<< * * KMOD_LCTRL = sdl2.KMOD_LCTRL, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(KMOD_SHIFT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_SHIFT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":86 * KMOD_SHIFT = sdl2.KMOD_SHIFT, * * KMOD_LCTRL = sdl2.KMOD_LCTRL, # <<<<<<<<<<<<<< * KMOD_RCTRL = sdl2.KMOD_RCTRL, * KMOD_CTRL = sdl2.KMOD_CTRL, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LCTRL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_LCTRL, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":87 * * KMOD_LCTRL = sdl2.KMOD_LCTRL, * KMOD_RCTRL = sdl2.KMOD_RCTRL, # <<<<<<<<<<<<<< * KMOD_CTRL = sdl2.KMOD_CTRL, * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RCTRL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_RCTRL, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":88 * KMOD_LCTRL = sdl2.KMOD_LCTRL, * KMOD_RCTRL = sdl2.KMOD_RCTRL, * KMOD_CTRL = sdl2.KMOD_CTRL, # <<<<<<<<<<<<<< * * KMOD_LALT = sdl2.KMOD_LALT, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(KMOD_CTRL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_CTRL, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":90 * KMOD_CTRL = sdl2.KMOD_CTRL, * * KMOD_LALT = sdl2.KMOD_LALT, # <<<<<<<<<<<<<< * KMOD_RALT = sdl2.KMOD_RALT, * KMOD_ALT = sdl2.KMOD_ALT, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LALT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_LALT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":91 * * KMOD_LALT = sdl2.KMOD_LALT, * KMOD_RALT = sdl2.KMOD_RALT, # <<<<<<<<<<<<<< * KMOD_ALT = sdl2.KMOD_ALT, * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RALT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_RALT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":92 * KMOD_LALT = sdl2.KMOD_LALT, * KMOD_RALT = sdl2.KMOD_RALT, * KMOD_ALT = sdl2.KMOD_ALT, # <<<<<<<<<<<<<< * * KMOD_LGUI = sdl2.KMOD_LGUI, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(KMOD_ALT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_ALT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":94 * KMOD_ALT = sdl2.KMOD_ALT, * * KMOD_LGUI = sdl2.KMOD_LGUI, # <<<<<<<<<<<<<< * KMOD_RGUI = sdl2.KMOD_RGUI, * KMOD_GUI = sdl2.KMOD_GUI, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_LGUI, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":95 * * KMOD_LGUI = sdl2.KMOD_LGUI, * KMOD_RGUI = sdl2.KMOD_RGUI, # <<<<<<<<<<<<<< * KMOD_GUI = sdl2.KMOD_GUI, * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_RGUI, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":96 * KMOD_LGUI = sdl2.KMOD_LGUI, * KMOD_RGUI = sdl2.KMOD_RGUI, * KMOD_GUI = sdl2.KMOD_GUI, # <<<<<<<<<<<<<< * * KMOD_LMETA = sdl2.KMOD_LGUI, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(KMOD_GUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_GUI, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":98 * KMOD_GUI = sdl2.KMOD_GUI, * * KMOD_LMETA = sdl2.KMOD_LGUI, # <<<<<<<<<<<<<< * KMOD_RMETA = sdl2.KMOD_RGUI, * KMOD_META = sdl2.KMOD_GUI, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_LMETA, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":99 * * KMOD_LMETA = sdl2.KMOD_LGUI, * KMOD_RMETA = sdl2.KMOD_RGUI, # <<<<<<<<<<<<<< * KMOD_META = sdl2.KMOD_GUI, * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_RMETA, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":100 * KMOD_LMETA = sdl2.KMOD_LGUI, * KMOD_RMETA = sdl2.KMOD_RGUI, * KMOD_META = sdl2.KMOD_GUI, # <<<<<<<<<<<<<< * * KMOD_NUM = sdl2.KMOD_NUM, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(KMOD_GUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_META, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":102 * KMOD_META = sdl2.KMOD_GUI, * * KMOD_NUM = sdl2.KMOD_NUM, # <<<<<<<<<<<<<< * KMOD_CAPS = sdl2.KMOD_CAPS, * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_NUM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_NUM, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":103 * * KMOD_NUM = sdl2.KMOD_NUM, * KMOD_CAPS = sdl2.KMOD_CAPS, # <<<<<<<<<<<<<< * * KMOD_MODE = sdl2.KMOD_MODE, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_CAPS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_CAPS, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":105 * KMOD_CAPS = sdl2.KMOD_CAPS, * * KMOD_MODE = sdl2.KMOD_MODE, # <<<<<<<<<<<<<< * * K_FIRST = 0, */ __pyx_t_3 = __Pyx_PyInt_From_SDL_Keymod(KMOD_MODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_KMOD_MODE, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_FIRST, __pyx_int_0) < 0) __PYX_ERR(0, 80, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":108 * * K_FIRST = 0, * K_LAST = sdl2.SDLK_SLEEP, # <<<<<<<<<<<<<< * * K_BREAK = sdl2.SDLK_PAUSE, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SLEEP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_LAST, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":110 * K_LAST = sdl2.SDLK_SLEEP, * * K_BREAK = sdl2.SDLK_PAUSE, # <<<<<<<<<<<<<< * K_EURO = sdl2.SDLK_CURRENCYUNIT, * */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PAUSE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_BREAK, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":111 * * K_BREAK = sdl2.SDLK_PAUSE, * K_EURO = sdl2.SDLK_CURRENCYUNIT, # <<<<<<<<<<<<<< * * K_KP0 = sdl2.SDLK_KP_0, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_CURRENCYUNIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_EURO, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":113 * K_EURO = sdl2.SDLK_CURRENCYUNIT, * * K_KP0 = sdl2.SDLK_KP_0, # <<<<<<<<<<<<<< * K_KP1 = sdl2.SDLK_KP_1, * K_KP2 = sdl2.SDLK_KP_2, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP0, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":114 * * K_KP0 = sdl2.SDLK_KP_0, * K_KP1 = sdl2.SDLK_KP_1, # <<<<<<<<<<<<<< * K_KP2 = sdl2.SDLK_KP_2, * K_KP3 = sdl2.SDLK_KP_3, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP1, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":115 * K_KP0 = sdl2.SDLK_KP_0, * K_KP1 = sdl2.SDLK_KP_1, * K_KP2 = sdl2.SDLK_KP_2, # <<<<<<<<<<<<<< * K_KP3 = sdl2.SDLK_KP_3, * K_KP4 = sdl2.SDLK_KP_4, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP2, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":116 * K_KP1 = sdl2.SDLK_KP_1, * K_KP2 = sdl2.SDLK_KP_2, * K_KP3 = sdl2.SDLK_KP_3, # <<<<<<<<<<<<<< * K_KP4 = sdl2.SDLK_KP_4, * K_KP5 = sdl2.SDLK_KP_5, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP3, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":117 * K_KP2 = sdl2.SDLK_KP_2, * K_KP3 = sdl2.SDLK_KP_3, * K_KP4 = sdl2.SDLK_KP_4, # <<<<<<<<<<<<<< * K_KP5 = sdl2.SDLK_KP_5, * K_KP6 = sdl2.SDLK_KP_6, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP4, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":118 * K_KP3 = sdl2.SDLK_KP_3, * K_KP4 = sdl2.SDLK_KP_4, * K_KP5 = sdl2.SDLK_KP_5, # <<<<<<<<<<<<<< * K_KP6 = sdl2.SDLK_KP_6, * K_KP7 = sdl2.SDLK_KP_7, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP5, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":119 * K_KP4 = sdl2.SDLK_KP_4, * K_KP5 = sdl2.SDLK_KP_5, * K_KP6 = sdl2.SDLK_KP_6, # <<<<<<<<<<<<<< * K_KP7 = sdl2.SDLK_KP_7, * K_KP8 = sdl2.SDLK_KP_8, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP6, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":120 * K_KP5 = sdl2.SDLK_KP_5, * K_KP6 = sdl2.SDLK_KP_6, * K_KP7 = sdl2.SDLK_KP_7, # <<<<<<<<<<<<<< * K_KP8 = sdl2.SDLK_KP_8, * K_KP9 = sdl2.SDLK_KP_9, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP7, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":121 * K_KP6 = sdl2.SDLK_KP_6, * K_KP7 = sdl2.SDLK_KP_7, * K_KP8 = sdl2.SDLK_KP_8, # <<<<<<<<<<<<<< * K_KP9 = sdl2.SDLK_KP_9, * */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP8, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":122 * K_KP7 = sdl2.SDLK_KP_7, * K_KP8 = sdl2.SDLK_KP_8, * K_KP9 = sdl2.SDLK_KP_9, # <<<<<<<<<<<<<< * * K_LMETA = sdl2.SDLK_LGUI, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_KP_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_KP9, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":124 * K_KP9 = sdl2.SDLK_KP_9, * * K_LMETA = sdl2.SDLK_LGUI, # <<<<<<<<<<<<<< * K_LSUPER = sdl2.SDLK_LGUI, * K_RMETA = sdl2.SDLK_RGUI, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_LMETA, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":125 * * K_LMETA = sdl2.SDLK_LGUI, * K_LSUPER = sdl2.SDLK_LGUI, # <<<<<<<<<<<<<< * K_RMETA = sdl2.SDLK_RGUI, * K_RSUPER = sdl2.SDLK_RGUI, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_LGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_LSUPER, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":126 * K_LMETA = sdl2.SDLK_LGUI, * K_LSUPER = sdl2.SDLK_LGUI, * K_RMETA = sdl2.SDLK_RGUI, # <<<<<<<<<<<<<< * K_RSUPER = sdl2.SDLK_RGUI, * */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_RMETA, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":127 * K_LSUPER = sdl2.SDLK_LGUI, * K_RMETA = sdl2.SDLK_RGUI, * K_RSUPER = sdl2.SDLK_RGUI, # <<<<<<<<<<<<<< * * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_RGUI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_RSUPER, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":129 * K_RSUPER = sdl2.SDLK_RGUI, * * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, # <<<<<<<<<<<<<< * K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, * K_PRINT = sdl2.SDLK_PRINTSCREEN, */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_NUMLOCKCLEAR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_NUMLOCK, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":130 * * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, * K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, # <<<<<<<<<<<<<< * K_PRINT = sdl2.SDLK_PRINTSCREEN, * )) */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_SCROLLLOCK); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_SCROLLOCK, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":131 * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, * K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, * K_PRINT = sdl2.SDLK_PRINTSCREEN, # <<<<<<<<<<<<<< * )) * */ __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SDLK_PRINTSCREEN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_K_PRINT, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":79 * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) * * globals().update(dict( # <<<<<<<<<<<<<< * KMOD_NONE = sdl2.KMOD_NONE, * */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":134 * )) * * TOUCH_MOUSEID = -1 # <<<<<<<<<<<<<< * * include "controller.pxi" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOUCH_MOUSEID, __pyx_int_neg_1) < 0) __PYX_ERR(0, 134, __pyx_L1_error) /* "include/controller.pxi":1 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_INVALID); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_INVALID, __pyx_t_3) < 0) __PYX_ERR(4, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":2 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_A); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_A, __pyx_t_3) < 0) __PYX_ERR(4, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":3 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_B); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_B, __pyx_t_3) < 0) __PYX_ERR(4, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":4 * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_X); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_X, __pyx_t_3) < 0) __PYX_ERR(4, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":5 * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_Y); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_Y, __pyx_t_3) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":6 * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_BACK); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_BACK, __pyx_t_3) < 0) __PYX_ERR(4, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":7 * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_GUIDE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_GUIDE, __pyx_t_3) < 0) __PYX_ERR(4, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":8 * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_START); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_START, __pyx_t_3) < 0) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":9 * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_LEFTSTICK); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK, __pyx_t_3) < 0) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":10 * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_RIGHTSTICK); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK, __pyx_t_3) < 0) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":11 * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_LEFTSHOULDER); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER, __pyx_t_3) < 0) __PYX_ERR(4, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":12 * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER, __pyx_t_3) < 0) __PYX_ERR(4, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":13 * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_UP); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_UP, __pyx_t_3) < 0) __PYX_ERR(4, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":14 * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_DOWN); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN, __pyx_t_3) < 0) __PYX_ERR(4, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":15 * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_LEFT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT, __pyx_t_3) < 0) __PYX_ERR(4, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":16 * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_RIGHT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT, __pyx_t_3) < 0) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":17 * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX # <<<<<<<<<<<<<< * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_MAX, __pyx_t_3) < 0) __PYX_ERR(4, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":18 * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID # <<<<<<<<<<<<<< * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_INVALID); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_INVALID, __pyx_t_3) < 0) __PYX_ERR(4, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":19 * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX # <<<<<<<<<<<<<< * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_LEFTX); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_LEFTX, __pyx_t_3) < 0) __PYX_ERR(4, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":20 * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY # <<<<<<<<<<<<<< * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_LEFTY); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_LEFTY, __pyx_t_3) < 0) __PYX_ERR(4, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":21 * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX # <<<<<<<<<<<<<< * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_RIGHTX); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_RIGHTX, __pyx_t_3) < 0) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":22 * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY # <<<<<<<<<<<<<< * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_RIGHTY); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_RIGHTY, __pyx_t_3) < 0) __PYX_ERR(4, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":23 * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT # <<<<<<<<<<<<<< * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_TRIGGERLEFT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT, __pyx_t_3) < 0) __PYX_ERR(4, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":24 * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT # <<<<<<<<<<<<<< * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_TRIGGERRIGHT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT, __pyx_t_3) < 0) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "include/controller.pxi":25 * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX # <<<<<<<<<<<<<< */ __pyx_t_3 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_MAX, __pyx_t_3) < 0) __PYX_ERR(4, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":138 * include "controller.pxi" * * POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN # <<<<<<<<<<<<<< * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY */ __pyx_t_3 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_UNKNOWN, __pyx_t_3) < 0) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":139 * * POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY # <<<<<<<<<<<<<< * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING */ __pyx_t_3 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_t_3) < 0) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":140 * POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY # <<<<<<<<<<<<<< * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED */ __pyx_t_3 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_t_3) < 0) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":141 * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING # <<<<<<<<<<<<<< * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED */ __pyx_t_3 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGING, __pyx_t_3) < 0) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":142 * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED # <<<<<<<<<<<<<< */ __pyx_t_3 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGED, __pyx_t_3) < 0) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":1 * from sdl2 cimport * # <<<<<<<<<<<<<< * cimport sdl2 * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.locals", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.locals"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* Globals */ static PyObject* __Pyx_Globals(void) { return __Pyx_NewRef(__pyx_d); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_EventType neg_one = (SDL_EventType) -1, const_zero = (SDL_EventType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_EventType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_EventType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_EventType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_EventType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_EventType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_EventType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_EventType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLattr(SDL_GLattr value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GLattr neg_one = (SDL_GLattr) -1, const_zero = (SDL_GLattr) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GLattr) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GLattr) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GLattr) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_GLattr) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GLattr) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_GLattr), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_GLattr)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLprofile(SDL_GLprofile value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GLprofile neg_one = (SDL_GLprofile) -1, const_zero = (SDL_GLprofile) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GLprofile) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GLprofile) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GLprofile) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_GLprofile) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GLprofile) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_GLprofile), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_GLprofile)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_WindowFlags neg_one = (SDL_WindowFlags) -1, const_zero = (SDL_WindowFlags) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_WindowFlags) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_WindowFlags) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_WindowFlags) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_WindowFlags), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_WindowFlags)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_Keymod) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Keymod) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_Keymod) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_Keymod) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_Keymod) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_Keymod), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_Keymod)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerButton) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_GameControllerButton) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerButton) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerButton), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_GameControllerButton)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerAxis) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_GameControllerAxis) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GameControllerAxis) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerAxis), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_GameControllerAxis)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_PowerState neg_one = (SDL_PowerState) -1, const_zero = (SDL_PowerState) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_PowerState) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_PowerState) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_PowerState) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_PowerState) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_PowerState) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_PowerState), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_PowerState)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__2); } return name; } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635914.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.mixer.c0000664000175000017500000311315315026112612020220 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__mixer #define __PYX_HAVE_API__pygame_sdl2__mixer /* Early includes */ #include #include #include #include #include "SDL.h" #include "SDL_mixer.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "", "src/pygame_sdl2/mixer.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_5mixer_Sound; struct __pyx_obj_11pygame_sdl2_5mixer_Channel; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; struct __pyx_defaults; typedef struct __pyx_defaults __pyx_defaults; struct __pyx_defaults1; typedef struct __pyx_defaults1 __pyx_defaults1; struct __pyx_defaults { PyObject *__pyx_arg_size; }; struct __pyx_defaults1 { PyObject *__pyx_arg_size; }; /* "pygame_sdl2/mixer.pyx":160 * * * cdef class Sound: # <<<<<<<<<<<<<< * cdef Mix_Chunk *chunk * */ struct __pyx_obj_11pygame_sdl2_5mixer_Sound { PyObject_HEAD Mix_Chunk *chunk; }; /* "pygame_sdl2/mixer.pyx":248 * * * cdef class Channel(object): # <<<<<<<<<<<<<< * cdef int cid * */ struct __pyx_obj_11pygame_sdl2_5mixer_Channel { PyObject_HEAD int cid; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* RaiseUnboundLocalError.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); /* dict_getitem_default.proto */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod1.proto */ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #else #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) #endif /* CallUnboundCMethod2.proto */ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); #else #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MIX_InitFlags(MIX_InitFlags value); /* CIntFromPy.proto */ static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_mixer" */ /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.mixer" */ static PyObject *__pyx_v_11pygame_sdl2_5mixer_preinit_args = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_output_spec = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_channel_events = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_channel_queued = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_current_sounds = 0; static void __pyx_f_11pygame_sdl2_5mixer_channel_callback(int); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5mixer___pyx_unpickle_Channel__set_state(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *, PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.mixer" extern int __pyx_module_is_main_pygame_sdl2__mixer; int __pyx_module_is_main_pygame_sdl2__mixer = 0; /* Implementation of "pygame_sdl2.mixer" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_i[] = "i"; static const char __pyx_k_n[] = "n"; static const char __pyx_k__2[] = "{}\n"; static const char __pyx_k__4[] = "."; static const char __pyx_k__5[] = "*"; static const char __pyx_k_fi[] = "fi"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_ms[] = "ms"; static const char __pyx_k__74[] = "?"; static const char __pyx_k_cid[] = "cid"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_vol[] = "vol"; static const char __pyx_k_Lock[] = "Lock"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_chan[] = "chan"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_exit[] = "__exit__"; static const char __pyx_k_flag[] = "flag"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_lock[] = "_lock"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_play[] = "play"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_stop[] = "stop"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_time[] = "time"; static const char __pyx_k_type[] = "type"; static const char __pyx_k_Sound[] = "Sound"; static const char __pyx_k_count[] = "count"; static const char __pyx_k_enter[] = "__enter__"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_force[] = "force"; static const char __pyx_k_loops[] = "loops"; static const char __pyx_k_music[] = "music"; static const char __pyx_k_pause[] = "pause"; static const char __pyx_k_queue[] = "queue"; static const char __pyx_k_sound[] = "sound"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_Thread[] = "Thread"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_buffer[] = "buffer"; static const char __pyx_k_dict_2[] = "_dict"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_errors[] = "errors"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_target[] = "target"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_volume[] = "volume"; static const char __pyx_k_Channel[] = "Channel"; static const char __pyx_k_channel[] = "channel"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_fade_ms[] = "fade_ms"; static const char __pyx_k_fadeout[] = "fadeout"; static const char __pyx_k_get_raw[] = "get_raw"; static const char __pyx_k_loops_2[] = "_loops"; static const char __pyx_k_maxtime[] = "maxtime"; static const char __pyx_k_unpause[] = "unpause"; static const char __pyx_k_channels[] = "channels"; static const char __pyx_k_get_busy[] = "get_busy"; static const char __pyx_k_get_init[] = "get_init"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_pre_init[] = "pre_init"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_fade_ms_2[] = "_fade_ms"; static const char __pyx_k_frequency[] = "frequency"; static const char __pyx_k_get_queue[] = "get_queue"; static const char __pyx_k_get_sound[] = "get_sound"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_maxtime_2[] = "_maxtime"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_threading[] = "threading"; static const char __pyx_k_Sound_play[] = "Sound.play"; static const char __pyx_k_Sound_stop[] = "Sound.stop"; static const char __pyx_k_buffersize[] = "buffersize"; static const char __pyx_k_get_length[] = "get_length"; static const char __pyx_k_get_volume[] = "get_volume"; static const char __pyx_k_next_sound[] = "next_sound"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_set_volume[] = "set_volume"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_Sound_pause[] = "Sound.pause"; static const char __pyx_k_mixer_music[] = "mixer_music"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_Channel_play[] = "Channel.play"; static const char __pyx_k_Channel_stop[] = "Channel.stop"; static const char __pyx_k_find_channel[] = "find_channel"; static const char __pyx_k_get_endevent[] = "get_endevent"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_play_current[] = "_play_current"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_set_endevent[] = "set_endevent"; static const char __pyx_k_set_reserved[] = "set_reserved"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_use_setstate[] = "use_setstate"; static const char __pyx_k_Channel_pause[] = "Channel.pause"; static const char __pyx_k_Channel_queue[] = "Channel.queue"; static const char __pyx_k_Sound_fadeout[] = "Sound.fadeout"; static const char __pyx_k_Sound_get_raw[] = "Sound.get_raw"; static const char __pyx_k_Sound_unpause[] = "Sound.unpause"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_Channel_fadeout[] = "Channel.fadeout"; static const char __pyx_k_Channel_unpause[] = "Channel.unpause"; static const char __pyx_k_Not_implemented[] = "Not implemented."; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Channel_get_busy[] = "Channel.get_busy"; static const char __pyx_k_Sound_get_length[] = "Sound.get_length"; static const char __pyx_k_Sound_get_volume[] = "Sound.get_volume"; static const char __pyx_k_Sound_set_volume[] = "Sound.set_volume"; static const char __pyx_k_get_num_channels[] = "get_num_channels"; static const char __pyx_k_set_num_channels[] = "set_num_channels"; static const char __pyx_k_Channel_get_queue[] = "Channel.get_queue"; static const char __pyx_k_Channel_get_sound[] = "Channel.get_sound"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_pygame_sdl2_mixer[] = "pygame_sdl2.mixer"; static const char __pyx_k_Channel_get_volume[] = "Channel.get_volume"; static const char __pyx_k_Channel_set_volume[] = "Channel.set_volume"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Channel_get_endevent[] = "Channel.get_endevent"; static const char __pyx_k_Channel_set_endevent[] = "Channel.set_endevent"; static const char __pyx_k_pyx_unpickle_Channel[] = "__pyx_unpickle_Channel"; static const char __pyx_k_Sound___reduce_cython[] = "Sound.__reduce_cython__"; static const char __pyx_k_Sound_get_num_channels[] = "Sound.get_num_channels"; static const char __pyx_k_Channel___reduce_cython[] = "Channel.__reduce_cython__"; static const char __pyx_k_Sound___setstate_cython[] = "Sound.__setstate_cython__"; static const char __pyx_k_pygame_sdl2_mixer_music[] = "pygame_sdl2.mixer_music"; static const char __pyx_k_Channel___setstate_cython[] = "Channel.__setstate_cython__"; static const char __pyx_k_src_pygame_sdl2_mixer_pyx[] = "src/pygame_sdl2/mixer.pyx"; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer__play_current(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_channel); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_30__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_2init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffer); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_32__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_4pre_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffersize); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_6quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_8get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_10stop(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_12pause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_14unpause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_16fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_18set_num_channels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_20get_num_channels(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_22set_reserved(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_24find_channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_force); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_26get_busy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5mixer_5Sound___cinit__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_5mixer_5Sound_2__dealloc__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5mixer_5Sound_4__init__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_6play(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_8stop(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_10pause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_12unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_14fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_16set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_18get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_20get_num_channels(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_22get_length(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_24get_raw(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11pygame_sdl2_5mixer_7Channel___init__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_cid); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_4stop(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_6pause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_8unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_10fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_12set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_volume); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_14get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_16get_busy(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_18get_sound(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_20queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_22get_queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_24set_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_26get_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_28__pyx_unpickle_Channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Sound(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Channel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_5mixer_Sound; PyObject *__pyx_type_11pygame_sdl2_5mixer_Channel; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_5mixer_Sound; PyTypeObject *__pyx_ptype_11pygame_sdl2_5mixer_Channel; PyObject *__pyx_n_s_Channel; PyObject *__pyx_n_s_Channel___reduce_cython; PyObject *__pyx_n_s_Channel___setstate_cython; PyObject *__pyx_n_s_Channel_fadeout; PyObject *__pyx_n_s_Channel_get_busy; PyObject *__pyx_n_s_Channel_get_endevent; PyObject *__pyx_n_s_Channel_get_queue; PyObject *__pyx_n_s_Channel_get_sound; PyObject *__pyx_n_s_Channel_get_volume; PyObject *__pyx_n_s_Channel_pause; PyObject *__pyx_n_s_Channel_play; PyObject *__pyx_n_s_Channel_queue; PyObject *__pyx_n_s_Channel_set_endevent; PyObject *__pyx_n_s_Channel_set_volume; PyObject *__pyx_n_s_Channel_stop; PyObject *__pyx_n_s_Channel_unpause; PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; PyObject *__pyx_n_s_Lock; PyObject *__pyx_kp_s_Not_implemented; PyObject *__pyx_n_s_PickleError; PyObject *__pyx_n_s_Sound; PyObject *__pyx_n_s_Sound___reduce_cython; PyObject *__pyx_n_s_Sound___setstate_cython; PyObject *__pyx_n_s_Sound_fadeout; PyObject *__pyx_n_s_Sound_get_length; PyObject *__pyx_n_s_Sound_get_num_channels; PyObject *__pyx_n_s_Sound_get_raw; PyObject *__pyx_n_s_Sound_get_volume; PyObject *__pyx_n_s_Sound_pause; PyObject *__pyx_n_s_Sound_play; PyObject *__pyx_n_s_Sound_set_volume; PyObject *__pyx_n_s_Sound_stop; PyObject *__pyx_n_s_Sound_unpause; PyObject *__pyx_n_s_Thread; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_kp_s__2; PyObject *__pyx_kp_u__4; PyObject *__pyx_n_s__5; PyObject *__pyx_n_s__74; PyObject *__pyx_n_s_append; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_buffer; PyObject *__pyx_n_s_buffersize; PyObject *__pyx_n_s_chan; PyObject *__pyx_n_s_channel; PyObject *__pyx_n_s_channels; PyObject *__pyx_n_s_cid; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_count; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_dict_2; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_enter; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_errors; PyObject *__pyx_n_s_exit; PyObject *__pyx_n_s_fade_ms; PyObject *__pyx_n_s_fade_ms_2; PyObject *__pyx_n_s_fadeout; PyObject *__pyx_n_s_fi; PyObject *__pyx_n_s_find_channel; PyObject *__pyx_n_s_flag; PyObject *__pyx_n_s_force; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_frequency; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_busy; PyObject *__pyx_n_s_get_endevent; PyObject *__pyx_n_s_get_init; PyObject *__pyx_n_s_get_length; PyObject *__pyx_n_s_get_num_channels; PyObject *__pyx_n_s_get_queue; PyObject *__pyx_n_s_get_raw; PyObject *__pyx_n_s_get_sound; PyObject *__pyx_n_s_get_volume; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_lock; PyObject *__pyx_n_s_loops; PyObject *__pyx_n_s_loops_2; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_maxtime; PyObject *__pyx_n_s_maxtime_2; PyObject *__pyx_n_s_mixer_music; PyObject *__pyx_n_s_ms; PyObject *__pyx_n_s_music; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_new; PyObject *__pyx_n_s_next_sound; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_pause; PyObject *__pyx_n_s_pickle; PyObject *__pyx_n_s_play; PyObject *__pyx_n_s_play_current; PyObject *__pyx_n_s_pre_init; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_mixer; PyObject *__pyx_n_s_pygame_sdl2_mixer_music; PyObject *__pyx_n_s_pyx_PickleError; PyObject *__pyx_n_s_pyx_checksum; PyObject *__pyx_n_s_pyx_result; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_type; PyObject *__pyx_n_s_pyx_unpickle_Channel; PyObject *__pyx_n_s_queue; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_register_init; PyObject *__pyx_n_s_register_quit; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_endevent; PyObject *__pyx_n_s_set_num_channels; PyObject *__pyx_n_s_set_reserved; PyObject *__pyx_n_s_set_volume; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_sound; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_mixer_pyx; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_stop; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_sys; PyObject *__pyx_n_s_target; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_threading; PyObject *__pyx_n_s_time; PyObject *__pyx_n_s_type; PyObject *__pyx_n_s_unpause; PyObject *__pyx_n_s_update; PyObject *__pyx_n_s_use_setstate; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_vol; PyObject *__pyx_n_s_volume; PyObject *__pyx_int_0; PyObject *__pyx_int_2; PyObject *__pyx_int_4096; PyObject *__pyx_int_22050; PyObject *__pyx_int_63693568; PyObject *__pyx_int_79154262; PyObject *__pyx_int_88229414; PyObject *__pyx_int_neg_1; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__32; PyObject *__pyx_tuple__36; PyObject *__pyx_tuple__38; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__42; PyObject *__pyx_tuple__47; PyObject *__pyx_tuple__49; PyObject *__pyx_tuple__54; PyObject *__pyx_tuple__56; PyObject *__pyx_tuple__58; PyObject *__pyx_tuple__62; PyObject *__pyx_tuple__65; PyObject *__pyx_tuple__67; PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__72; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__24; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__37; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__43; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__45; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__48; PyObject *__pyx_codeobj__50; PyObject *__pyx_codeobj__51; PyObject *__pyx_codeobj__52; PyObject *__pyx_codeobj__53; PyObject *__pyx_codeobj__55; PyObject *__pyx_codeobj__57; PyObject *__pyx_codeobj__59; PyObject *__pyx_codeobj__60; PyObject *__pyx_codeobj__61; PyObject *__pyx_codeobj__63; PyObject *__pyx_codeobj__64; PyObject *__pyx_codeobj__66; PyObject *__pyx_codeobj__68; PyObject *__pyx_codeobj__70; PyObject *__pyx_codeobj__71; PyObject *__pyx_codeobj__73; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5mixer_Sound); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_5mixer_Sound); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5mixer_Channel); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_5mixer_Channel); Py_CLEAR(clear_module_state->__pyx_n_s_Channel); Py_CLEAR(clear_module_state->__pyx_n_s_Channel___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Channel___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_fadeout); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_get_busy); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_get_endevent); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_get_queue); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_get_sound); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_get_volume); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_pause); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_play); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_queue); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_set_endevent); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_set_volume); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_stop); Py_CLEAR(clear_module_state->__pyx_n_s_Channel_unpause); Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_CLEAR(clear_module_state->__pyx_n_s_Lock); Py_CLEAR(clear_module_state->__pyx_kp_s_Not_implemented); Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_Sound); Py_CLEAR(clear_module_state->__pyx_n_s_Sound___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Sound___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_fadeout); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_get_length); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_get_num_channels); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_get_raw); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_get_volume); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_pause); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_play); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_set_volume); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_stop); Py_CLEAR(clear_module_state->__pyx_n_s_Sound_unpause); Py_CLEAR(clear_module_state->__pyx_n_s_Thread); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_kp_s__2); Py_CLEAR(clear_module_state->__pyx_kp_u__4); Py_CLEAR(clear_module_state->__pyx_n_s__5); Py_CLEAR(clear_module_state->__pyx_n_s__74); Py_CLEAR(clear_module_state->__pyx_n_s_append); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_buffersize); Py_CLEAR(clear_module_state->__pyx_n_s_chan); Py_CLEAR(clear_module_state->__pyx_n_s_channel); Py_CLEAR(clear_module_state->__pyx_n_s_channels); Py_CLEAR(clear_module_state->__pyx_n_s_cid); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_count); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_enter); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_errors); Py_CLEAR(clear_module_state->__pyx_n_s_exit); Py_CLEAR(clear_module_state->__pyx_n_s_fade_ms); Py_CLEAR(clear_module_state->__pyx_n_s_fade_ms_2); Py_CLEAR(clear_module_state->__pyx_n_s_fadeout); Py_CLEAR(clear_module_state->__pyx_n_s_fi); Py_CLEAR(clear_module_state->__pyx_n_s_find_channel); Py_CLEAR(clear_module_state->__pyx_n_s_flag); Py_CLEAR(clear_module_state->__pyx_n_s_force); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_frequency); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_busy); Py_CLEAR(clear_module_state->__pyx_n_s_get_endevent); Py_CLEAR(clear_module_state->__pyx_n_s_get_init); Py_CLEAR(clear_module_state->__pyx_n_s_get_length); Py_CLEAR(clear_module_state->__pyx_n_s_get_num_channels); Py_CLEAR(clear_module_state->__pyx_n_s_get_queue); Py_CLEAR(clear_module_state->__pyx_n_s_get_raw); Py_CLEAR(clear_module_state->__pyx_n_s_get_sound); Py_CLEAR(clear_module_state->__pyx_n_s_get_volume); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_lock); Py_CLEAR(clear_module_state->__pyx_n_s_loops); Py_CLEAR(clear_module_state->__pyx_n_s_loops_2); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_maxtime); Py_CLEAR(clear_module_state->__pyx_n_s_maxtime_2); Py_CLEAR(clear_module_state->__pyx_n_s_mixer_music); Py_CLEAR(clear_module_state->__pyx_n_s_ms); Py_CLEAR(clear_module_state->__pyx_n_s_music); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_new); Py_CLEAR(clear_module_state->__pyx_n_s_next_sound); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_pause); Py_CLEAR(clear_module_state->__pyx_n_s_pickle); Py_CLEAR(clear_module_state->__pyx_n_s_play); Py_CLEAR(clear_module_state->__pyx_n_s_play_current); Py_CLEAR(clear_module_state->__pyx_n_s_pre_init); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_mixer); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_mixer_music); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Channel); Py_CLEAR(clear_module_state->__pyx_n_s_queue); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_register_init); Py_CLEAR(clear_module_state->__pyx_n_s_register_quit); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_endevent); Py_CLEAR(clear_module_state->__pyx_n_s_set_num_channels); Py_CLEAR(clear_module_state->__pyx_n_s_set_reserved); Py_CLEAR(clear_module_state->__pyx_n_s_set_volume); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_sound); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_mixer_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_stop); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_sys); Py_CLEAR(clear_module_state->__pyx_n_s_target); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_threading); Py_CLEAR(clear_module_state->__pyx_n_s_time); Py_CLEAR(clear_module_state->__pyx_n_s_type); Py_CLEAR(clear_module_state->__pyx_n_s_unpause); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_vol); Py_CLEAR(clear_module_state->__pyx_n_s_volume); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_4096); Py_CLEAR(clear_module_state->__pyx_int_22050); Py_CLEAR(clear_module_state->__pyx_int_63693568); Py_CLEAR(clear_module_state->__pyx_int_79154262); Py_CLEAR(clear_module_state->__pyx_int_88229414); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__32); Py_CLEAR(clear_module_state->__pyx_tuple__36); Py_CLEAR(clear_module_state->__pyx_tuple__38); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__42); Py_CLEAR(clear_module_state->__pyx_tuple__47); Py_CLEAR(clear_module_state->__pyx_tuple__49); Py_CLEAR(clear_module_state->__pyx_tuple__54); Py_CLEAR(clear_module_state->__pyx_tuple__56); Py_CLEAR(clear_module_state->__pyx_tuple__58); Py_CLEAR(clear_module_state->__pyx_tuple__62); Py_CLEAR(clear_module_state->__pyx_tuple__65); Py_CLEAR(clear_module_state->__pyx_tuple__67); Py_CLEAR(clear_module_state->__pyx_tuple__69); Py_CLEAR(clear_module_state->__pyx_tuple__72); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__24); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__37); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__43); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__45); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__48); Py_CLEAR(clear_module_state->__pyx_codeobj__50); Py_CLEAR(clear_module_state->__pyx_codeobj__51); Py_CLEAR(clear_module_state->__pyx_codeobj__52); Py_CLEAR(clear_module_state->__pyx_codeobj__53); Py_CLEAR(clear_module_state->__pyx_codeobj__55); Py_CLEAR(clear_module_state->__pyx_codeobj__57); Py_CLEAR(clear_module_state->__pyx_codeobj__59); Py_CLEAR(clear_module_state->__pyx_codeobj__60); Py_CLEAR(clear_module_state->__pyx_codeobj__61); Py_CLEAR(clear_module_state->__pyx_codeobj__63); Py_CLEAR(clear_module_state->__pyx_codeobj__64); Py_CLEAR(clear_module_state->__pyx_codeobj__66); Py_CLEAR(clear_module_state->__pyx_codeobj__68); Py_CLEAR(clear_module_state->__pyx_codeobj__70); Py_CLEAR(clear_module_state->__pyx_codeobj__71); Py_CLEAR(clear_module_state->__pyx_codeobj__73); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5mixer_Sound); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_5mixer_Sound); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5mixer_Channel); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_5mixer_Channel); Py_VISIT(traverse_module_state->__pyx_n_s_Channel); Py_VISIT(traverse_module_state->__pyx_n_s_Channel___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Channel___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_fadeout); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_get_busy); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_get_endevent); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_get_queue); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_get_sound); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_get_volume); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_pause); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_play); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_queue); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_set_endevent); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_set_volume); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_stop); Py_VISIT(traverse_module_state->__pyx_n_s_Channel_unpause); Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_VISIT(traverse_module_state->__pyx_n_s_Lock); Py_VISIT(traverse_module_state->__pyx_kp_s_Not_implemented); Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_Sound); Py_VISIT(traverse_module_state->__pyx_n_s_Sound___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Sound___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_fadeout); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_get_length); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_get_num_channels); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_get_raw); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_get_volume); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_pause); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_play); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_set_volume); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_stop); Py_VISIT(traverse_module_state->__pyx_n_s_Sound_unpause); Py_VISIT(traverse_module_state->__pyx_n_s_Thread); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_kp_s__2); Py_VISIT(traverse_module_state->__pyx_kp_u__4); Py_VISIT(traverse_module_state->__pyx_n_s__5); Py_VISIT(traverse_module_state->__pyx_n_s__74); Py_VISIT(traverse_module_state->__pyx_n_s_append); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_buffersize); Py_VISIT(traverse_module_state->__pyx_n_s_chan); Py_VISIT(traverse_module_state->__pyx_n_s_channel); Py_VISIT(traverse_module_state->__pyx_n_s_channels); Py_VISIT(traverse_module_state->__pyx_n_s_cid); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_count); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_enter); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_errors); Py_VISIT(traverse_module_state->__pyx_n_s_exit); Py_VISIT(traverse_module_state->__pyx_n_s_fade_ms); Py_VISIT(traverse_module_state->__pyx_n_s_fade_ms_2); Py_VISIT(traverse_module_state->__pyx_n_s_fadeout); Py_VISIT(traverse_module_state->__pyx_n_s_fi); Py_VISIT(traverse_module_state->__pyx_n_s_find_channel); Py_VISIT(traverse_module_state->__pyx_n_s_flag); Py_VISIT(traverse_module_state->__pyx_n_s_force); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_frequency); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_busy); Py_VISIT(traverse_module_state->__pyx_n_s_get_endevent); Py_VISIT(traverse_module_state->__pyx_n_s_get_init); Py_VISIT(traverse_module_state->__pyx_n_s_get_length); Py_VISIT(traverse_module_state->__pyx_n_s_get_num_channels); Py_VISIT(traverse_module_state->__pyx_n_s_get_queue); Py_VISIT(traverse_module_state->__pyx_n_s_get_raw); Py_VISIT(traverse_module_state->__pyx_n_s_get_sound); Py_VISIT(traverse_module_state->__pyx_n_s_get_volume); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_lock); Py_VISIT(traverse_module_state->__pyx_n_s_loops); Py_VISIT(traverse_module_state->__pyx_n_s_loops_2); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_maxtime); Py_VISIT(traverse_module_state->__pyx_n_s_maxtime_2); Py_VISIT(traverse_module_state->__pyx_n_s_mixer_music); Py_VISIT(traverse_module_state->__pyx_n_s_ms); Py_VISIT(traverse_module_state->__pyx_n_s_music); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_new); Py_VISIT(traverse_module_state->__pyx_n_s_next_sound); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_pause); Py_VISIT(traverse_module_state->__pyx_n_s_pickle); Py_VISIT(traverse_module_state->__pyx_n_s_play); Py_VISIT(traverse_module_state->__pyx_n_s_play_current); Py_VISIT(traverse_module_state->__pyx_n_s_pre_init); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_mixer); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_mixer_music); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Channel); Py_VISIT(traverse_module_state->__pyx_n_s_queue); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_register_init); Py_VISIT(traverse_module_state->__pyx_n_s_register_quit); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_endevent); Py_VISIT(traverse_module_state->__pyx_n_s_set_num_channels); Py_VISIT(traverse_module_state->__pyx_n_s_set_reserved); Py_VISIT(traverse_module_state->__pyx_n_s_set_volume); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_sound); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_mixer_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_stop); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_sys); Py_VISIT(traverse_module_state->__pyx_n_s_target); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_threading); Py_VISIT(traverse_module_state->__pyx_n_s_time); Py_VISIT(traverse_module_state->__pyx_n_s_type); Py_VISIT(traverse_module_state->__pyx_n_s_unpause); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_vol); Py_VISIT(traverse_module_state->__pyx_n_s_volume); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_4096); Py_VISIT(traverse_module_state->__pyx_int_22050); Py_VISIT(traverse_module_state->__pyx_int_63693568); Py_VISIT(traverse_module_state->__pyx_int_79154262); Py_VISIT(traverse_module_state->__pyx_int_88229414); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__32); Py_VISIT(traverse_module_state->__pyx_tuple__36); Py_VISIT(traverse_module_state->__pyx_tuple__38); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__42); Py_VISIT(traverse_module_state->__pyx_tuple__47); Py_VISIT(traverse_module_state->__pyx_tuple__49); Py_VISIT(traverse_module_state->__pyx_tuple__54); Py_VISIT(traverse_module_state->__pyx_tuple__56); Py_VISIT(traverse_module_state->__pyx_tuple__58); Py_VISIT(traverse_module_state->__pyx_tuple__62); Py_VISIT(traverse_module_state->__pyx_tuple__65); Py_VISIT(traverse_module_state->__pyx_tuple__67); Py_VISIT(traverse_module_state->__pyx_tuple__69); Py_VISIT(traverse_module_state->__pyx_tuple__72); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__24); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__37); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__43); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__45); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__48); Py_VISIT(traverse_module_state->__pyx_codeobj__50); Py_VISIT(traverse_module_state->__pyx_codeobj__51); Py_VISIT(traverse_module_state->__pyx_codeobj__52); Py_VISIT(traverse_module_state->__pyx_codeobj__53); Py_VISIT(traverse_module_state->__pyx_codeobj__55); Py_VISIT(traverse_module_state->__pyx_codeobj__57); Py_VISIT(traverse_module_state->__pyx_codeobj__59); Py_VISIT(traverse_module_state->__pyx_codeobj__60); Py_VISIT(traverse_module_state->__pyx_codeobj__61); Py_VISIT(traverse_module_state->__pyx_codeobj__63); Py_VISIT(traverse_module_state->__pyx_codeobj__64); Py_VISIT(traverse_module_state->__pyx_codeobj__66); Py_VISIT(traverse_module_state->__pyx_codeobj__68); Py_VISIT(traverse_module_state->__pyx_codeobj__70); Py_VISIT(traverse_module_state->__pyx_codeobj__71); Py_VISIT(traverse_module_state->__pyx_codeobj__73); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_5mixer_Sound __pyx_mstate_global->__pyx_type_11pygame_sdl2_5mixer_Sound #define __pyx_type_11pygame_sdl2_5mixer_Channel __pyx_mstate_global->__pyx_type_11pygame_sdl2_5mixer_Channel #endif #define __pyx_ptype_11pygame_sdl2_5mixer_Sound __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5mixer_Sound #define __pyx_ptype_11pygame_sdl2_5mixer_Channel __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5mixer_Channel #define __pyx_n_s_Channel __pyx_mstate_global->__pyx_n_s_Channel #define __pyx_n_s_Channel___reduce_cython __pyx_mstate_global->__pyx_n_s_Channel___reduce_cython #define __pyx_n_s_Channel___setstate_cython __pyx_mstate_global->__pyx_n_s_Channel___setstate_cython #define __pyx_n_s_Channel_fadeout __pyx_mstate_global->__pyx_n_s_Channel_fadeout #define __pyx_n_s_Channel_get_busy __pyx_mstate_global->__pyx_n_s_Channel_get_busy #define __pyx_n_s_Channel_get_endevent __pyx_mstate_global->__pyx_n_s_Channel_get_endevent #define __pyx_n_s_Channel_get_queue __pyx_mstate_global->__pyx_n_s_Channel_get_queue #define __pyx_n_s_Channel_get_sound __pyx_mstate_global->__pyx_n_s_Channel_get_sound #define __pyx_n_s_Channel_get_volume __pyx_mstate_global->__pyx_n_s_Channel_get_volume #define __pyx_n_s_Channel_pause __pyx_mstate_global->__pyx_n_s_Channel_pause #define __pyx_n_s_Channel_play __pyx_mstate_global->__pyx_n_s_Channel_play #define __pyx_n_s_Channel_queue __pyx_mstate_global->__pyx_n_s_Channel_queue #define __pyx_n_s_Channel_set_endevent __pyx_mstate_global->__pyx_n_s_Channel_set_endevent #define __pyx_n_s_Channel_set_volume __pyx_mstate_global->__pyx_n_s_Channel_set_volume #define __pyx_n_s_Channel_stop __pyx_mstate_global->__pyx_n_s_Channel_stop #define __pyx_n_s_Channel_unpause __pyx_mstate_global->__pyx_n_s_Channel_unpause #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 #define __pyx_n_s_Lock __pyx_mstate_global->__pyx_n_s_Lock #define __pyx_kp_s_Not_implemented __pyx_mstate_global->__pyx_kp_s_Not_implemented #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError #define __pyx_n_s_Sound __pyx_mstate_global->__pyx_n_s_Sound #define __pyx_n_s_Sound___reduce_cython __pyx_mstate_global->__pyx_n_s_Sound___reduce_cython #define __pyx_n_s_Sound___setstate_cython __pyx_mstate_global->__pyx_n_s_Sound___setstate_cython #define __pyx_n_s_Sound_fadeout __pyx_mstate_global->__pyx_n_s_Sound_fadeout #define __pyx_n_s_Sound_get_length __pyx_mstate_global->__pyx_n_s_Sound_get_length #define __pyx_n_s_Sound_get_num_channels __pyx_mstate_global->__pyx_n_s_Sound_get_num_channels #define __pyx_n_s_Sound_get_raw __pyx_mstate_global->__pyx_n_s_Sound_get_raw #define __pyx_n_s_Sound_get_volume __pyx_mstate_global->__pyx_n_s_Sound_get_volume #define __pyx_n_s_Sound_pause __pyx_mstate_global->__pyx_n_s_Sound_pause #define __pyx_n_s_Sound_play __pyx_mstate_global->__pyx_n_s_Sound_play #define __pyx_n_s_Sound_set_volume __pyx_mstate_global->__pyx_n_s_Sound_set_volume #define __pyx_n_s_Sound_stop __pyx_mstate_global->__pyx_n_s_Sound_stop #define __pyx_n_s_Sound_unpause __pyx_mstate_global->__pyx_n_s_Sound_unpause #define __pyx_n_s_Thread __pyx_mstate_global->__pyx_n_s_Thread #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_kp_s__2 __pyx_mstate_global->__pyx_kp_s__2 #define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 #define __pyx_n_s__5 __pyx_mstate_global->__pyx_n_s__5 #define __pyx_n_s__74 __pyx_mstate_global->__pyx_n_s__74 #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer #define __pyx_n_s_buffersize __pyx_mstate_global->__pyx_n_s_buffersize #define __pyx_n_s_chan __pyx_mstate_global->__pyx_n_s_chan #define __pyx_n_s_channel __pyx_mstate_global->__pyx_n_s_channel #define __pyx_n_s_channels __pyx_mstate_global->__pyx_n_s_channels #define __pyx_n_s_cid __pyx_mstate_global->__pyx_n_s_cid #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_errors __pyx_mstate_global->__pyx_n_s_errors #define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit #define __pyx_n_s_fade_ms __pyx_mstate_global->__pyx_n_s_fade_ms #define __pyx_n_s_fade_ms_2 __pyx_mstate_global->__pyx_n_s_fade_ms_2 #define __pyx_n_s_fadeout __pyx_mstate_global->__pyx_n_s_fadeout #define __pyx_n_s_fi __pyx_mstate_global->__pyx_n_s_fi #define __pyx_n_s_find_channel __pyx_mstate_global->__pyx_n_s_find_channel #define __pyx_n_s_flag __pyx_mstate_global->__pyx_n_s_flag #define __pyx_n_s_force __pyx_mstate_global->__pyx_n_s_force #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_frequency __pyx_mstate_global->__pyx_n_s_frequency #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_busy __pyx_mstate_global->__pyx_n_s_get_busy #define __pyx_n_s_get_endevent __pyx_mstate_global->__pyx_n_s_get_endevent #define __pyx_n_s_get_init __pyx_mstate_global->__pyx_n_s_get_init #define __pyx_n_s_get_length __pyx_mstate_global->__pyx_n_s_get_length #define __pyx_n_s_get_num_channels __pyx_mstate_global->__pyx_n_s_get_num_channels #define __pyx_n_s_get_queue __pyx_mstate_global->__pyx_n_s_get_queue #define __pyx_n_s_get_raw __pyx_mstate_global->__pyx_n_s_get_raw #define __pyx_n_s_get_sound __pyx_mstate_global->__pyx_n_s_get_sound #define __pyx_n_s_get_volume __pyx_mstate_global->__pyx_n_s_get_volume #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_lock __pyx_mstate_global->__pyx_n_s_lock #define __pyx_n_s_loops __pyx_mstate_global->__pyx_n_s_loops #define __pyx_n_s_loops_2 __pyx_mstate_global->__pyx_n_s_loops_2 #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_maxtime __pyx_mstate_global->__pyx_n_s_maxtime #define __pyx_n_s_maxtime_2 __pyx_mstate_global->__pyx_n_s_maxtime_2 #define __pyx_n_s_mixer_music __pyx_mstate_global->__pyx_n_s_mixer_music #define __pyx_n_s_ms __pyx_mstate_global->__pyx_n_s_ms #define __pyx_n_s_music __pyx_mstate_global->__pyx_n_s_music #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new #define __pyx_n_s_next_sound __pyx_mstate_global->__pyx_n_s_next_sound #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_pause __pyx_mstate_global->__pyx_n_s_pause #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle #define __pyx_n_s_play __pyx_mstate_global->__pyx_n_s_play #define __pyx_n_s_play_current __pyx_mstate_global->__pyx_n_s_play_current #define __pyx_n_s_pre_init __pyx_mstate_global->__pyx_n_s_pre_init #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_mixer __pyx_mstate_global->__pyx_n_s_pygame_sdl2_mixer #define __pyx_n_s_pygame_sdl2_mixer_music __pyx_mstate_global->__pyx_n_s_pygame_sdl2_mixer_music #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type #define __pyx_n_s_pyx_unpickle_Channel __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Channel #define __pyx_n_s_queue __pyx_mstate_global->__pyx_n_s_queue #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_register_init __pyx_mstate_global->__pyx_n_s_register_init #define __pyx_n_s_register_quit __pyx_mstate_global->__pyx_n_s_register_quit #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_endevent __pyx_mstate_global->__pyx_n_s_set_endevent #define __pyx_n_s_set_num_channels __pyx_mstate_global->__pyx_n_s_set_num_channels #define __pyx_n_s_set_reserved __pyx_mstate_global->__pyx_n_s_set_reserved #define __pyx_n_s_set_volume __pyx_mstate_global->__pyx_n_s_set_volume #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_sound __pyx_mstate_global->__pyx_n_s_sound #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_mixer_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_mixer_pyx #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys #define __pyx_n_s_target __pyx_mstate_global->__pyx_n_s_target #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_threading __pyx_mstate_global->__pyx_n_s_threading #define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time #define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type #define __pyx_n_s_unpause __pyx_mstate_global->__pyx_n_s_unpause #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_vol __pyx_mstate_global->__pyx_n_s_vol #define __pyx_n_s_volume __pyx_mstate_global->__pyx_n_s_volume #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_4096 __pyx_mstate_global->__pyx_int_4096 #define __pyx_int_22050 __pyx_mstate_global->__pyx_int_22050 #define __pyx_int_63693568 __pyx_mstate_global->__pyx_int_63693568 #define __pyx_int_79154262 __pyx_mstate_global->__pyx_int_79154262 #define __pyx_int_88229414 __pyx_mstate_global->__pyx_int_88229414 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 #define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 #define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 #define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58 #define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 #define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 #define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 #define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 #define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 #define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 #define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 #define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61 #define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63 #define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64 #define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 #define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68 #define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 #define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71 #define __pyx_codeobj__73 __pyx_mstate_global->__pyx_codeobj__73 /* #### Code section: module_code ### */ /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_1_play_current(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer__play_current, "_play_current(int channel)\n\n Caled by channel_callback to play the next sound. This has to be called\n from a different thread, as the channel callback isn't allowed to call\n MIX functions.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_1_play_current = {"_play_current", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_1_play_current, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer__play_current}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_1_play_current(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { int __pyx_v_channel; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_play_current (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_channel,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_channel)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_play_current") < 0)) __PYX_ERR(1, 41, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_channel = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_channel == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_play_current", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 41, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer._play_current", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer__play_current(__pyx_self, __pyx_v_channel); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer__play_current(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_channel) { struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_next_sound = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_play_current", 1); /* "pygame_sdl2/mixer.pyx":50 * cdef Sound next_sound * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 50, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 50, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/mixer.pyx":51 * * with _lock: * next_sound = channel_queued[channel] # <<<<<<<<<<<<<< * current_sounds[channel] = next_sound * channel_queued[channel] = None */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 51, __pyx_L7_error) } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 51, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 51, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11pygame_sdl2_5mixer_Sound))))) __PYX_ERR(1, 51, __pyx_L7_error) __pyx_v_next_sound = ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":52 * with _lock: * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound # <<<<<<<<<<<<<< * channel_queued[channel] = None * */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 52, __pyx_L7_error) } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 52, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_3, ((PyObject *)__pyx_v_next_sound)) < 0))) __PYX_ERR(1, 52, __pyx_L7_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":53 * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound * channel_queued[channel] = None # <<<<<<<<<<<<<< * * if next_sound: */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 53, __pyx_L7_error) } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 53, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_3, Py_None) < 0))) __PYX_ERR(1, 53, __pyx_L7_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":50 * cdef Sound next_sound * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer._play_current", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(1, 50, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 50, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 50, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_11 < 0) __PYX_ERR(1, 50, __pyx_L9_except_error) __pyx_t_12 = (!__pyx_t_11); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __PYX_ERR(1, 50, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L12_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L16; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L16:; } /* "pygame_sdl2/mixer.pyx":55 * channel_queued[channel] = None * * if next_sound: # <<<<<<<<<<<<<< * with nogil: * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) */ if (unlikely(!__pyx_v_next_sound)) { __Pyx_RaiseUnboundLocalError("next_sound"); __PYX_ERR(1, 55, __pyx_L1_error) } __pyx_t_12 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_next_sound)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(1, 55, __pyx_L1_error) if (__pyx_t_12) { /* "pygame_sdl2/mixer.pyx":56 * * if next_sound: * with nogil: # <<<<<<<<<<<<<< * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":57 * if next_sound: * with nogil: * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) # <<<<<<<<<<<<<< * * */ if (unlikely(!__pyx_v_next_sound)) { __Pyx_RaiseUnboundLocalError("next_sound"); __PYX_ERR(1, 57, __pyx_L19_error) } (void)(Mix_PlayChannelTimed(__pyx_v_channel, __pyx_v_next_sound->chunk, 0, -1)); } /* "pygame_sdl2/mixer.pyx":56 * * if next_sound: * with nogil: # <<<<<<<<<<<<<< * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L20; } __pyx_L19_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } __pyx_L20:; } } /* "pygame_sdl2/mixer.pyx":55 * channel_queued[channel] = None * * if next_sound: # <<<<<<<<<<<<<< * with nogil: * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) */ } /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer._play_current", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_next_sound); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":60 * * * cdef void channel_callback(int channel) noexcept with gil: # <<<<<<<<<<<<<< * * cdef int etype = 0 */ static void __pyx_f_11pygame_sdl2_5mixer_channel_callback(int __pyx_v_channel) { int __pyx_v_etype; SDL_Event __pyx_v_e; PyObject *__pyx_v_next_sound = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("channel_callback", 0); /* "pygame_sdl2/mixer.pyx":62 * cdef void channel_callback(int channel) noexcept with gil: * * cdef int etype = 0 # <<<<<<<<<<<<<< * cdef SDL_Event e * */ __pyx_v_etype = 0; /* "pygame_sdl2/mixer.pyx":65 * cdef SDL_Event e * * etype = channel_events.get(channel, 0) # <<<<<<<<<<<<<< * if etype != 0: * memset(&e, 0, sizeof(SDL_Event)) */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(1, 65, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_1, __pyx_int_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_etype = __pyx_t_3; /* "pygame_sdl2/mixer.pyx":66 * * etype = channel_events.get(channel, 0) * if etype != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype */ __pyx_t_4 = (__pyx_v_etype != 0); if (__pyx_t_4) { /* "pygame_sdl2/mixer.pyx":67 * etype = channel_events.get(channel, 0) * if etype != 0: * memset(&e, 0, sizeof(SDL_Event)) # <<<<<<<<<<<<<< * e.type = etype * SDL_PushEvent(&e) */ (void)(memset((&__pyx_v_e), 0, (sizeof(SDL_Event)))); /* "pygame_sdl2/mixer.pyx":68 * if etype != 0: * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype # <<<<<<<<<<<<<< * SDL_PushEvent(&e) * */ __pyx_v_e.type = __pyx_v_etype; /* "pygame_sdl2/mixer.pyx":69 * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype * SDL_PushEvent(&e) # <<<<<<<<<<<<<< * * with _lock: */ (void)(SDL_PushEvent((&__pyx_v_e))); /* "pygame_sdl2/mixer.pyx":66 * * etype = channel_events.get(channel, 0) * if etype != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype */ } /* "pygame_sdl2/mixer.pyx":71 * SDL_PushEvent(&e) * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued.get(channel) * if next_sound: */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 71, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { /* "pygame_sdl2/mixer.pyx":72 * * with _lock: * next_sound = channel_queued.get(channel) # <<<<<<<<<<<<<< * if next_sound: * threading.Thread(target=_play_current, args=(channel,)).start() */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(1, 72, __pyx_L8_error) } __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 72, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_next_sound = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":73 * with _lock: * next_sound = channel_queued.get(channel) * if next_sound: # <<<<<<<<<<<<<< * threading.Thread(target=_play_current, args=(channel,)).start() * */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_next_sound); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 73, __pyx_L8_error) if (__pyx_t_4) { /* "pygame_sdl2/mixer.pyx":74 * next_sound = channel_queued.get(channel) * if next_sound: * threading.Thread(target=_play_current, args=(channel,)).start() # <<<<<<<<<<<<<< * * # A list of errors that occured during mixer initialization. */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Thread); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_play_current); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target, __pyx_t_7) < 0) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7)) __PYX_ERR(1, 74, __pyx_L8_error); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_args, __pyx_t_12) < 0) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 74, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":73 * with _lock: * next_sound = channel_queued.get(channel) * if next_sound: # <<<<<<<<<<<<<< * threading.Thread(target=_play_current, args=(channel,)).start() * */ } /* "pygame_sdl2/mixer.pyx":71 * SDL_PushEvent(&e) * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued.get(channel) * if next_sound: */ } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L13_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.channel_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_12) < 0) __PYX_ERR(1, 71, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 71, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 71, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_4 < 0) __PYX_ERR(1, 71, __pyx_L10_except_error) __pyx_t_14 = (!__pyx_t_4); if (unlikely(__pyx_t_14)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_12); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_12 = 0; __PYX_ERR(1, 71, __pyx_L10_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); goto __pyx_L1_error; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); __pyx_L13_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_5) { __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } goto __pyx_L7; } __pyx_L7:; } goto __pyx_L18; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L1_error; __pyx_L18:; } /* "pygame_sdl2/mixer.pyx":60 * * * cdef void channel_callback(int channel) noexcept with gil: # <<<<<<<<<<<<<< * * cdef int etype = 0 */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_12); __Pyx_WriteUnraisable("pygame_sdl2.mixer.channel_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_XDECREF(__pyx_v_next_sound); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } /* "pygame_sdl2/mixer.pyx":79 * errors = [ ] * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_30__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_int_22050)); __Pyx_GIVEREF(((PyObject *)__pyx_int_22050)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_int_22050))) __PYX_ERR(1, 79, __pyx_L1_error); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_size); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_size); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_size)) __PYX_ERR(1, 79, __pyx_L1_error); __Pyx_INCREF(((PyObject *)__pyx_int_2)); __Pyx_GIVEREF(((PyObject *)__pyx_int_2)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_2))) __PYX_ERR(1, 79, __pyx_L1_error); __Pyx_INCREF(((PyObject *)__pyx_int_4096)); __Pyx_GIVEREF(((PyObject *)__pyx_int_4096)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_int_4096))) __PYX_ERR(1, 79, __pyx_L1_error); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 79, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(1, 79, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_3init(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_2init, "init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_3init = {"init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_3init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_2init}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_3init(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_frequency = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_channels = 0; PyObject *__pyx_v_buffer = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_size,&__pyx_n_s_channels,&__pyx_n_s_buffer,0}; __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_22050))); values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_size); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_2))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_4096))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_channels); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffer); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "init") < 0)) __PYX_ERR(1, 79, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_frequency = values[0]; __pyx_v_size = values[1]; __pyx_v_channels = values[2]; __pyx_v_buffer = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("init", 0, 0, 4, __pyx_nargs); __PYX_ERR(1, 79, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_2init(__pyx_self, __pyx_v_frequency, __pyx_v_size, __pyx_v_channels, __pyx_v_buffer); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_2init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffer) { PyObject *__pyx_v_flag = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); Uint16 __pyx_t_13; int __pyx_t_14; int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); __Pyx_INCREF(__pyx_v_frequency); __Pyx_INCREF(__pyx_v_size); __Pyx_INCREF(__pyx_v_channels); __Pyx_INCREF(__pyx_v_buffer); /* "pygame_sdl2/mixer.pyx":81 * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: # <<<<<<<<<<<<<< * return * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = (__pyx_t_1 != Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":82 * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: * return # <<<<<<<<<<<<<< * * for flag in (MIX_INIT_FLAC, MIX_INIT_MP3, MIX_INIT_OGG): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":81 * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/mixer.pyx":84 * return * * for flag in (MIX_INIT_FLAC, MIX_INIT_MP3, MIX_INIT_OGG): # <<<<<<<<<<<<<< * * if Mix_Init(flag) != flag: */ __pyx_t_1 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_FLAC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_MP3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_OGG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(1, 84, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3)) __PYX_ERR(1, 84, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (;;) { if (__pyx_t_7 >= 3) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(1, 84, __pyx_L1_error) #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_v_flag, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/mixer.pyx":86 * for flag in (MIX_INIT_FLAC, MIX_INIT_MP3, MIX_INIT_OGG): * * if Mix_Init(flag) != flag: # <<<<<<<<<<<<<< * errors.append("{}\n".format(SDL_GetError())) * */ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_flag); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 86, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_int(Mix_Init(__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_flag, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":87 * * if Mix_Init(flag) != flag: * errors.append("{}\n".format(SDL_GetError())) # <<<<<<<<<<<<<< * * if preinit_args: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s__2, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_11 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_6); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/mixer.pyx":86 * for flag in (MIX_INIT_FLAC, MIX_INIT_MP3, MIX_INIT_OGG): * * if Mix_Init(flag) != flag: # <<<<<<<<<<<<<< * errors.append("{}\n".format(SDL_GetError())) * */ } /* "pygame_sdl2/mixer.pyx":84 * return * * for flag in (MIX_INIT_FLAC, MIX_INIT_MP3, MIX_INIT_OGG): # <<<<<<<<<<<<<< * * if Mix_Init(flag) != flag: */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":89 * errors.append("{}\n".format(SDL_GetError())) * * if preinit_args: # <<<<<<<<<<<<<< * frequency, size, channels, buffer = preinit_args * */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_11pygame_sdl2_5mixer_preinit_args); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 89, __pyx_L1_error) if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":90 * * if preinit_args: * frequency, size, channels, buffer = preinit_args # <<<<<<<<<<<<<< * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: */ if ((likely(PyTuple_CheckExact(__pyx_v_11pygame_sdl2_5mixer_preinit_args))) || (PyList_CheckExact(__pyx_v_11pygame_sdl2_5mixer_preinit_args))) { PyObject* sequence = __pyx_v_11pygame_sdl2_5mixer_preinit_args; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(1, 90, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_2 = PyList_GET_ITEM(sequence, 2); __pyx_t_1 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_6,&__pyx_t_2,&__pyx_t_1}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(1, 90, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_6,&__pyx_t_2,&__pyx_t_1}; __pyx_t_9 = PyObject_GetIter(__pyx_v_11pygame_sdl2_5mixer_preinit_args); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_12(__pyx_t_9); if (unlikely(!item)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_9), 4) < 0) __PYX_ERR(1, 90, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(1, 90, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_frequency, __pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_channels, __pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":89 * errors.append("{}\n".format(SDL_GetError())) * * if preinit_args: # <<<<<<<<<<<<<< * frequency, size, channels, buffer = preinit_args * */ } /* "pygame_sdl2/mixer.pyx":92 * frequency, size, channels, buffer = preinit_args * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_frequency); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error) __pyx_t_13 = __Pyx_PyInt_As_uint16_t(__pyx_v_size); if (unlikely((__pyx_t_13 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error) __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_channels); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error) __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_buffer); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error) __pyx_t_5 = (Mix_OpenAudio(__pyx_t_8, __pyx_t_13, __pyx_t_14, __pyx_t_15) != 0); if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/mixer.pyx":93 * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: * raise error() # <<<<<<<<<<<<<< * * global output_spec */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 93, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":92 * frequency, size, channels, buffer = preinit_args * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/mixer.pyx":96 * * global output_spec * output_spec = get_init() # <<<<<<<<<<<<<< * * Mix_ChannelFinished(channel_callback) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_output_spec); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_output_spec, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":98 * output_spec = get_init() * * Mix_ChannelFinished(channel_callback) # <<<<<<<<<<<<<< * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): */ Mix_ChannelFinished(__pyx_f_11pygame_sdl2_5mixer_channel_callback); /* "pygame_sdl2/mixer.pyx":79 * errors = [ ] * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.mixer.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_flag); __Pyx_XDECREF(__pyx_v_frequency); __Pyx_XDECREF(__pyx_v_size); __Pyx_XDECREF(__pyx_v_channels); __Pyx_XDECREF(__pyx_v_buffer); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":100 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_32__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_int_22050)); __Pyx_GIVEREF(((PyObject *)__pyx_int_22050)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_int_22050))) __PYX_ERR(1, 100, __pyx_L1_error); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_size); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_size); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_size)) __PYX_ERR(1, 100, __pyx_L1_error); __Pyx_INCREF(((PyObject *)__pyx_int_2)); __Pyx_GIVEREF(((PyObject *)__pyx_int_2)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_2))) __PYX_ERR(1, 100, __pyx_L1_error); __Pyx_INCREF(((PyObject *)__pyx_int_4096)); __Pyx_GIVEREF(((PyObject *)__pyx_int_4096)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_int_4096))) __PYX_ERR(1, 100, __pyx_L1_error); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 100, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(1, 100, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5pre_init(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_4pre_init, "pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5pre_init = {"pre_init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5pre_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_4pre_init}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5pre_init(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_frequency = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_channels = 0; PyObject *__pyx_v_buffersize = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pre_init (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_size,&__pyx_n_s_channels,&__pyx_n_s_buffersize,0}; __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self); values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_22050))); values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_size); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_2))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_4096))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 100, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 100, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_channels); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 100, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffersize); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 100, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pre_init") < 0)) __PYX_ERR(1, 100, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_frequency = values[0]; __pyx_v_size = values[1]; __pyx_v_channels = values[2]; __pyx_v_buffersize = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pre_init", 0, 0, 4, __pyx_nargs); __PYX_ERR(1, 100, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.pre_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_4pre_init(__pyx_self, __pyx_v_frequency, __pyx_v_size, __pyx_v_channels, __pyx_v_buffersize); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_4pre_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffersize) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pre_init", 1); /* "pygame_sdl2/mixer.pyx":102 * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): * global preinit_args * preinit_args = (frequency, size, channels, buffersize) # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_frequency); __Pyx_GIVEREF(__pyx_v_frequency); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_frequency)) __PYX_ERR(1, 102, __pyx_L1_error); __Pyx_INCREF(__pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_size)) __PYX_ERR(1, 102, __pyx_L1_error); __Pyx_INCREF(__pyx_v_channels); __Pyx_GIVEREF(__pyx_v_channels); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_channels)) __PYX_ERR(1, 102, __pyx_L1_error); __Pyx_INCREF(__pyx_v_buffersize); __Pyx_GIVEREF(__pyx_v_buffersize); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_buffersize)) __PYX_ERR(1, 102, __pyx_L1_error); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_preinit_args); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_preinit_args, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":100 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.pre_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":104 * preinit_args = (frequency, size, channels, buffersize) * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * Mix_CloseAudio() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_6quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_6quit}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_6quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_6quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/mixer.pyx":106 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * Mix_CloseAudio() # <<<<<<<<<<<<<< * Mix_Quit() * */ Mix_CloseAudio(); /* "pygame_sdl2/mixer.pyx":107 * def quit(): # @ReservedAssignment * Mix_CloseAudio() * Mix_Quit() # <<<<<<<<<<<<<< * * def get_init(): */ Mix_Quit(); /* "pygame_sdl2/mixer.pyx":104 * preinit_args = (frequency, size, channels, buffersize) * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * Mix_CloseAudio() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":109 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_9get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_8get_init, "get_init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_9get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_9get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_8get_init}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_9get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_8get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_8get_init(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_frequency; Uint16 __pyx_v_format; int __pyx_v_channels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 1); /* "pygame_sdl2/mixer.pyx":114 * cdef int channels * * if Mix_QuerySpec(&frequency, &format, &channels) == 0: # <<<<<<<<<<<<<< * return None * else: */ __pyx_t_1 = (Mix_QuerySpec((&__pyx_v_frequency), (&__pyx_v_format), (&__pyx_v_channels)) == 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":115 * * if Mix_QuerySpec(&frequency, &format, &channels) == 0: * return None # <<<<<<<<<<<<<< * else: * return frequency, format, channels */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":114 * cdef int channels * * if Mix_QuerySpec(&frequency, &format, &channels) == 0: # <<<<<<<<<<<<<< * return None * else: */ } /* "pygame_sdl2/mixer.pyx":117 * return None * else: * return frequency, format, channels # <<<<<<<<<<<<<< * * def stop(): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_frequency); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint16_t(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_channels); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(1, 117, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(1, 117, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(1, 117, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "pygame_sdl2/mixer.pyx":109 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":119 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_11stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_10stop, "stop()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_11stop = {"stop", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_11stop, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_10stop}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_11stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_10stop(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_10stop(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 1); /* "pygame_sdl2/mixer.pyx":120 * * def stop(): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(-1) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":121 * def stop(): * with nogil: * Mix_HaltChannel(-1) # <<<<<<<<<<<<<< * * def pause(): */ (void)(Mix_HaltChannel(-1)); } /* "pygame_sdl2/mixer.pyx":120 * * def stop(): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(-1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":119 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":123 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_13pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_12pause, "pause()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_13pause = {"pause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_13pause, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_12pause}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_13pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_12pause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_12pause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause", 1); /* "pygame_sdl2/mixer.pyx":124 * * def pause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(-1) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":125 * def pause(): * with nogil: * Mix_Pause(-1) # <<<<<<<<<<<<<< * * def unpause(): */ Mix_Pause(-1); } /* "pygame_sdl2/mixer.pyx":124 * * def pause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(-1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":123 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":127 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_15unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_14unpause, "unpause()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_15unpause = {"unpause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_15unpause, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_14unpause}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_15unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_14unpause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_14unpause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause", 1); /* "pygame_sdl2/mixer.pyx":128 * * def unpause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(-1) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":129 * def unpause(): * with nogil: * Mix_Resume(-1) # <<<<<<<<<<<<<< * * def fadeout(time): */ Mix_Resume(-1); } /* "pygame_sdl2/mixer.pyx":128 * * def unpause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(-1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":127 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":131 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_17fadeout(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_16fadeout, "fadeout(time)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_17fadeout = {"fadeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_17fadeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_16fadeout}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_17fadeout(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_time = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fadeout") < 0)) __PYX_ERR(1, 131, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_time = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fadeout", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 131, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_16fadeout(__pyx_self, __pyx_v_time); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_16fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time) { int __pyx_v_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 1); /* "pygame_sdl2/mixer.pyx":132 * * def fadeout(time): * cdef int ms = time # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(-1, ms) */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L1_error) __pyx_v_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":133 * def fadeout(time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(-1, ms) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":134 * cdef int ms = time * with nogil: * Mix_FadeOutChannel(-1, ms) # <<<<<<<<<<<<<< * * def set_num_channels(count): */ (void)(Mix_FadeOutChannel(-1, __pyx_v_ms)); } /* "pygame_sdl2/mixer.pyx":133 * def fadeout(time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(-1, ms) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":131 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":136 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_19set_num_channels(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_18set_num_channels, "set_num_channels(count)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_19set_num_channels = {"set_num_channels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_19set_num_channels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_18set_num_channels}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_19set_num_channels(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_count = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_num_channels (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_count,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_count)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 136, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_num_channels") < 0)) __PYX_ERR(1, 136, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_count = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_num_channels", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 136, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.set_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_18set_num_channels(__pyx_self, __pyx_v_count); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_18set_num_channels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_num_channels", 1); /* "pygame_sdl2/mixer.pyx":137 * * def set_num_channels(count): * Mix_AllocateChannels(count) # <<<<<<<<<<<<<< * * def get_num_channels(): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_count); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 137, __pyx_L1_error) (void)(Mix_AllocateChannels(__pyx_t_1)); /* "pygame_sdl2/mixer.pyx":136 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.set_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":139 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_21get_num_channels(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_20get_num_channels, "get_num_channels()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_21get_num_channels = {"get_num_channels", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_21get_num_channels, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_20get_num_channels}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_21get_num_channels(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_channels (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_20get_num_channels(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_20get_num_channels(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_num_channels", 1); /* "pygame_sdl2/mixer.pyx":140 * * def get_num_channels(): * return Mix_AllocateChannels(-1) # <<<<<<<<<<<<<< * * def set_reserved(count): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(Mix_AllocateChannels(-1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":139 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.get_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":142 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_23set_reserved(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_22set_reserved, "set_reserved(count)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_23set_reserved = {"set_reserved", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_23set_reserved, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_22set_reserved}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_23set_reserved(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_count = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_reserved (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_count,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_count)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_reserved") < 0)) __PYX_ERR(1, 142, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_count = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_reserved", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 142, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.set_reserved", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_22set_reserved(__pyx_self, __pyx_v_count); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_22set_reserved(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_reserved", 1); /* "pygame_sdl2/mixer.pyx":143 * * def set_reserved(count): * Mix_ReserveChannels(count) # <<<<<<<<<<<<<< * * def find_channel(force=False): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_count); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 143, __pyx_L1_error) (void)(Mix_ReserveChannels(__pyx_t_1)); /* "pygame_sdl2/mixer.pyx":142 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.set_reserved", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":145 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_25find_channel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_24find_channel, "find_channel(force=False)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_25find_channel = {"find_channel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_25find_channel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_24find_channel}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_25find_channel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_force = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("find_channel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_force,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_force); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 145, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "find_channel") < 0)) __PYX_ERR(1, 145, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_force = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("find_channel", 0, 0, 1, __pyx_nargs); __PYX_ERR(1, 145, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.find_channel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_24find_channel(__pyx_self, __pyx_v_force); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_24find_channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_force) { int __pyx_v_chan; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("find_channel", 1); /* "pygame_sdl2/mixer.pyx":147 * def find_channel(force=False): * cdef int chan * chan = Mix_GroupAvailable(-1) # <<<<<<<<<<<<<< * if chan == -1: * if not force: */ __pyx_v_chan = Mix_GroupAvailable(-1); /* "pygame_sdl2/mixer.pyx":148 * cdef int chan * chan = Mix_GroupAvailable(-1) * if chan == -1: # <<<<<<<<<<<<<< * if not force: * return None */ __pyx_t_1 = (__pyx_v_chan == -1L); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":149 * chan = Mix_GroupAvailable(-1) * if chan == -1: * if not force: # <<<<<<<<<<<<<< * return None * chan = Mix_GroupOldest(-1) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 149, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":150 * if chan == -1: * if not force: * return None # <<<<<<<<<<<<<< * chan = Mix_GroupOldest(-1) * if chan == -1: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":149 * chan = Mix_GroupAvailable(-1) * if chan == -1: * if not force: # <<<<<<<<<<<<<< * return None * chan = Mix_GroupOldest(-1) */ } /* "pygame_sdl2/mixer.pyx":151 * if not force: * return None * chan = Mix_GroupOldest(-1) # <<<<<<<<<<<<<< * if chan == -1: * raise error() */ __pyx_v_chan = Mix_GroupOldest(-1); /* "pygame_sdl2/mixer.pyx":152 * return None * chan = Mix_GroupOldest(-1) * if chan == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(chan) */ __pyx_t_2 = (__pyx_v_chan == -1L); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/mixer.pyx":153 * chan = Mix_GroupOldest(-1) * if chan == -1: * raise error() # <<<<<<<<<<<<<< * return Channel(chan) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 153, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":152 * return None * chan = Mix_GroupOldest(-1) * if chan == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(chan) */ } /* "pygame_sdl2/mixer.pyx":148 * cdef int chan * chan = Mix_GroupAvailable(-1) * if chan == -1: # <<<<<<<<<<<<<< * if not force: * return None */ } /* "pygame_sdl2/mixer.pyx":154 * if chan == -1: * raise error() * return Channel(chan) # <<<<<<<<<<<<<< * * def get_busy(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_chan); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":145 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.find_channel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":156 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_27get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_26get_busy, "get_busy()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_27get_busy = {"get_busy", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_27get_busy, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mixer_26get_busy}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_27get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_busy (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_26get_busy(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_26get_busy(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_busy", 1); /* "pygame_sdl2/mixer.pyx":157 * * def get_busy(): * return Mix_GroupNewer(-1) != -1 # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((Mix_GroupNewer(-1) != -1L)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":156 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.get_busy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":163 * cdef Mix_Chunk *chunk * * def __cinit__(self): # <<<<<<<<<<<<<< * self.chunk = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound___cinit__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mixer_5Sound___cinit__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/mixer.pyx":164 * * def __cinit__(self): * self.chunk = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->chunk = NULL; /* "pygame_sdl2/mixer.pyx":163 * cdef Mix_Chunk *chunk * * def __cinit__(self): # <<<<<<<<<<<<<< * self.chunk = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/mixer.pyx":166 * self.chunk = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.chunk: * Mix_FreeChunk(self.chunk) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_5mixer_5Sound_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_5mixer_5Sound_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_5mixer_5Sound_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_5mixer_5Sound_2__dealloc__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_t_1; /* "pygame_sdl2/mixer.pyx":167 * * def __dealloc__(self): * if self.chunk: # <<<<<<<<<<<<<< * Mix_FreeChunk(self.chunk) * */ __pyx_t_1 = (__pyx_v_self->chunk != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":168 * def __dealloc__(self): * if self.chunk: * Mix_FreeChunk(self.chunk) # <<<<<<<<<<<<<< * * def __init__(self, fi): */ Mix_FreeChunk(__pyx_v_self->chunk); /* "pygame_sdl2/mixer.pyx":167 * * def __dealloc__(self): * if self.chunk: # <<<<<<<<<<<<<< * Mix_FreeChunk(self.chunk) * */ } /* "pygame_sdl2/mixer.pyx":166 * self.chunk = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.chunk: * Mix_FreeChunk(self.chunk) */ /* function exit code */ } /* "pygame_sdl2/mixer.pyx":170 * Mix_FreeChunk(self.chunk) * * def __init__(self, fi): # <<<<<<<<<<<<<< * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fi = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 170, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_fi = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 170, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_4__init__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v_fi); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mixer_5Sound_4__init__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_fi) { int __pyx_r; __Pyx_RefNannyDeclarations SDL_RWops *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/mixer.pyx":171 * * def __init__(self, fi): * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) # <<<<<<<<<<<<<< * if self.chunk == NULL: * raise error() */ __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_1 == ((SDL_RWops *)NULL))) __PYX_ERR(1, 171, __pyx_L1_error) __pyx_v_self->chunk = Mix_LoadWAV_RW(__pyx_t_1, 1); /* "pygame_sdl2/mixer.pyx":172 * def __init__(self, fi): * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_self->chunk == NULL); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/mixer.pyx":173 * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: * raise error() # <<<<<<<<<<<<<< * * def play(self, loops=0, maxtime=-1, fade_ms=0): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 173, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":172 * def __init__(self, fi): * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/mixer.pyx":170 * Mix_FreeChunk(self.chunk) * * def __init__(self, fi): # <<<<<<<<<<<<<< * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":175 * raise error() * * def play(self, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int cid * cdef int _loops = loops */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_6play, "Sound.play(self, loops=0, maxtime=-1, fade_ms=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_7play = {"play", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_6play}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_loops = 0; PyObject *__pyx_v_maxtime = 0; PyObject *__pyx_v_fade_ms = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loops,&__pyx_n_s_maxtime,&__pyx_n_s_fade_ms,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_neg_1)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loops); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxtime); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fade_ms); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "play") < 0)) __PYX_ERR(1, 175, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loops = values[0]; __pyx_v_maxtime = values[1]; __pyx_v_fade_ms = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play", 0, 0, 3, __pyx_nargs); __PYX_ERR(1, 175, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_6play(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v_loops, __pyx_v_maxtime, __pyx_v_fade_ms); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_6play(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms) { int __pyx_v_cid; int __pyx_v__loops; int __pyx_v__maxtime; int __pyx_v__fade_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("play", 1); /* "pygame_sdl2/mixer.pyx":177 * def play(self, loops=0, maxtime=-1, fade_ms=0): * cdef int cid * cdef int _loops = loops # <<<<<<<<<<<<<< * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 177, __pyx_L1_error) __pyx_v__loops = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":178 * cdef int cid * cdef int _loops = loops * cdef int _maxtime = maxtime # <<<<<<<<<<<<<< * cdef int _fade_ms = fade_ms * */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_maxtime); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 178, __pyx_L1_error) __pyx_v__maxtime = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":179 * cdef int _loops = loops * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_fade_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 179, __pyx_L1_error) __pyx_v__fade_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":181 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":182 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) * else: */ __pyx_t_2 = (__pyx_v__fade_ms != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":183 * with nogil: * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) # <<<<<<<<<<<<<< * else: * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) */ __pyx_v_cid = Mix_FadeInChannelTimed(-1, __pyx_v_self->chunk, __pyx_v__loops, __pyx_v__fade_ms, __pyx_v__maxtime); /* "pygame_sdl2/mixer.pyx":182 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) * else: */ goto __pyx_L6; } /* "pygame_sdl2/mixer.pyx":185 * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) * else: * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) # <<<<<<<<<<<<<< * * if cid == -1: */ /*else*/ { __pyx_v_cid = Mix_PlayChannelTimed(-1, __pyx_v_self->chunk, __pyx_v__loops, __pyx_v__maxtime); } __pyx_L6:; } /* "pygame_sdl2/mixer.pyx":181 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":187 * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(cid) */ __pyx_t_2 = (__pyx_v_cid == -1L); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/mixer.pyx":188 * * if cid == -1: * raise error() # <<<<<<<<<<<<<< * return Channel(cid) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 188, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":187 * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(cid) */ } /* "pygame_sdl2/mixer.pyx":189 * if cid == -1: * raise error() * return Channel(cid) # <<<<<<<<<<<<<< * * def stop(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":175 * raise error() * * def play(self, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int cid * cdef int _loops = loops */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":191 * return Channel(cid) * * def stop(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_8stop, "Sound.stop(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_9stop = {"stop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_8stop}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("stop", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "stop", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_8stop(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_8stop(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("stop", 1); /* "pygame_sdl2/mixer.pyx":192 * * def stop(self): * cdef int i = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":193 * def stop(self): * cdef int i = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_1 = (__pyx_v_i < Mix_AllocateChannels(-1)); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":194 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(i) */ __pyx_t_1 = (Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":195 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(i) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":196 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_HaltChannel(i) # <<<<<<<<<<<<<< * i += 1 * */ (void)(Mix_HaltChannel(__pyx_v_i)); } /* "pygame_sdl2/mixer.pyx":195 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(i) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/mixer.pyx":194 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(i) */ } /* "pygame_sdl2/mixer.pyx":197 * with nogil: * Mix_HaltChannel(i) * i += 1 # <<<<<<<<<<<<<< * * def pause(self): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":191 * return Channel(cid) * * def stop(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":199 * i += 1 * * def pause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_10pause, "Sound.pause(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_11pause = {"pause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_10pause}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("pause", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pause", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_10pause(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_10pause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("pause", 1); /* "pygame_sdl2/mixer.pyx":200 * * def pause(self): * cdef int i = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":201 * def pause(self): * cdef int i = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_1 = (__pyx_v_i < Mix_AllocateChannels(-1)); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":202 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(i) */ __pyx_t_1 = (Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":203 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(i) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":204 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_Pause(i) # <<<<<<<<<<<<<< * i += 1 * */ Mix_Pause(__pyx_v_i); } /* "pygame_sdl2/mixer.pyx":203 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(i) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/mixer.pyx":202 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(i) */ } /* "pygame_sdl2/mixer.pyx":205 * with nogil: * Mix_Pause(i) * i += 1 # <<<<<<<<<<<<<< * * def unpause(self): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":199 * i += 1 * * def pause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":207 * i += 1 * * def unpause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_12unpause, "Sound.unpause(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_13unpause = {"unpause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_12unpause}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("unpause", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "unpause", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_12unpause(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_12unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("unpause", 1); /* "pygame_sdl2/mixer.pyx":208 * * def unpause(self): * cdef int i = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":209 * def unpause(self): * cdef int i = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_1 = (__pyx_v_i < Mix_AllocateChannels(-1)); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":210 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(i) */ __pyx_t_1 = (Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":211 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(i) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":212 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_Resume(i) # <<<<<<<<<<<<<< * i += 1 * */ Mix_Resume(__pyx_v_i); } /* "pygame_sdl2/mixer.pyx":211 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(i) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/mixer.pyx":210 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(i) */ } /* "pygame_sdl2/mixer.pyx":213 * with nogil: * Mix_Resume(i) * i += 1 # <<<<<<<<<<<<<< * * def fadeout(self, time): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":207 * i += 1 * * def unpause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":215 * i += 1 * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int ms = time */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_14fadeout, "Sound.fadeout(self, time)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_15fadeout = {"fadeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_14fadeout}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_time = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 215, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fadeout") < 0)) __PYX_ERR(1, 215, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_time = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fadeout", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 215, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_14fadeout(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v_time); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_14fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_time) { int __pyx_v_i; int __pyx_v_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 1); /* "pygame_sdl2/mixer.pyx":216 * * def fadeout(self, time): * cdef int i = 0 # <<<<<<<<<<<<<< * cdef int ms = time * while i < Mix_AllocateChannels(-1): */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":217 * def fadeout(self, time): * cdef int i = 0 * cdef int ms = time # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 217, __pyx_L1_error) __pyx_v_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":218 * cdef int i = 0 * cdef int ms = time * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_2 = (__pyx_v_i < Mix_AllocateChannels(-1)); if (!__pyx_t_2) break; /* "pygame_sdl2/mixer.pyx":219 * cdef int ms = time * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(i, ms) */ __pyx_t_2 = (Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":220 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(i, ms) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":221 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_FadeOutChannel(i, ms) # <<<<<<<<<<<<<< * i += 1 * */ (void)(Mix_FadeOutChannel(__pyx_v_i, __pyx_v_ms)); } /* "pygame_sdl2/mixer.pyx":220 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(i, ms) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/mixer.pyx":219 * cdef int ms = time * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(i, ms) */ } /* "pygame_sdl2/mixer.pyx":222 * with nogil: * Mix_FadeOutChannel(i, ms) * i += 1 # <<<<<<<<<<<<<< * * def set_volume(self, value): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":215 * i += 1 * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int ms = time */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":224 * i += 1 * * def set_volume(self, value): # <<<<<<<<<<<<<< * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_16set_volume, "Sound.set_volume(self, value)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_17set_volume = {"set_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_16set_volume}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 224, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_volume") < 0)) __PYX_ERR(1, 224, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_value = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_volume", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 224, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_16set_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_16set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_volume", 1); /* "pygame_sdl2/mixer.pyx":225 * * def set_volume(self, value): * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) # <<<<<<<<<<<<<< * * def get_volume(self): */ __pyx_t_1 = __Pyx_PyInt_From___pyx_anon_enum(MIX_MAX_VOLUME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (void)(Mix_VolumeChunk(__pyx_v_self->chunk, __pyx_t_3)); /* "pygame_sdl2/mixer.pyx":224 * i += 1 * * def set_volume(self, value): # <<<<<<<<<<<<<< * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":227 * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * * def get_volume(self): # <<<<<<<<<<<<<< * return Mix_VolumeChunk(self.chunk, -1) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_18get_volume, "Sound.get_volume(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_19get_volume = {"get_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_18get_volume}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_volume (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_volume", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_volume", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_18get_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_18get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_volume", 1); /* "pygame_sdl2/mixer.pyx":228 * * def get_volume(self): * return Mix_VolumeChunk(self.chunk, -1) # <<<<<<<<<<<<<< * * def get_num_channels(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(Mix_VolumeChunk(__pyx_v_self->chunk, -1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":227 * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * * def get_volume(self): # <<<<<<<<<<<<<< * return Mix_VolumeChunk(self.chunk, -1) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":230 * return Mix_VolumeChunk(self.chunk, -1) * * def get_num_channels(self): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int n = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_20get_num_channels, "Sound.get_num_channels(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_21get_num_channels = {"get_num_channels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_20get_num_channels}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_channels (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_num_channels", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_num_channels", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_20get_num_channels(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_20get_num_channels(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; int __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_num_channels", 1); /* "pygame_sdl2/mixer.pyx":231 * * def get_num_channels(self): * cdef int i = 0 # <<<<<<<<<<<<<< * cdef int n = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":232 * def get_num_channels(self): * cdef int i = 0 * cdef int n = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_n = 0; /* "pygame_sdl2/mixer.pyx":233 * cdef int i = 0 * cdef int n = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * n += 1 */ while (1) { __pyx_t_1 = (__pyx_v_i < Mix_AllocateChannels(-1)); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":234 * cdef int n = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * n += 1 * i += 1 */ __pyx_t_1 = (Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":235 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * n += 1 # <<<<<<<<<<<<<< * i += 1 * return n */ __pyx_v_n = (__pyx_v_n + 1); /* "pygame_sdl2/mixer.pyx":234 * cdef int n = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * n += 1 * i += 1 */ } /* "pygame_sdl2/mixer.pyx":236 * if Mix_GetChunk(i) == self.chunk: * n += 1 * i += 1 # <<<<<<<<<<<<<< * return n * */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":237 * n += 1 * i += 1 * return n # <<<<<<<<<<<<<< * * def get_length(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":230 * return Mix_VolumeChunk(self.chunk, -1) * * def get_num_channels(self): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int n = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":239 * return n * * def get_length(self): # <<<<<<<<<<<<<< * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_22get_length, "Sound.get_length(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_23get_length = {"get_length", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_22get_length}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_length (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_length", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_length", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_22get_length(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_22get_length(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_length", 1); /* "pygame_sdl2/mixer.pyx":241 * def get_length(self): * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] # <<<<<<<<<<<<<< * * def get_raw(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_v_self->chunk->alen)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_11pygame_sdl2_5mixer_output_spec, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_3, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_11pygame_sdl2_5mixer_output_spec, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":239 * return n * * def get_length(self): # <<<<<<<<<<<<<< * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_length", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":243 * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] * * def get_raw(self): # <<<<<<<<<<<<<< * # return self.chunk.abuf * raise error("Not implemented.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_24get_raw, "Sound.get_raw(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_25get_raw = {"get_raw", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_24get_raw}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_raw (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_raw", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_raw", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_24get_raw(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_24get_raw(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_raw", 1); /* "pygame_sdl2/mixer.pyx":245 * def get_raw(self): * # return self.chunk.abuf * raise error("Not implemented.") # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Not_implemented}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 245, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":243 * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] * * def get_raw(self): # <<<<<<<<<<<<<< * # return self.chunk.abuf * raise error("Not implemented.") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_raw", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__, "Sound.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__, "Sound.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":251 * cdef int cid * * def __init__(self, cid): # <<<<<<<<<<<<<< * self.cid = cid * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_cid = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cid,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cid)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 251, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 251, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_cid = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 251, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel___init__(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_cid); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mixer_7Channel___init__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_cid) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/mixer.pyx":252 * * def __init__(self, cid): * self.cid = cid # <<<<<<<<<<<<<< * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_cid); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 252, __pyx_L1_error) __pyx_v_self->cid = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":251 * cdef int cid * * def __init__(self, cid): # <<<<<<<<<<<<<< * self.cid = cid * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/mixer.pyx":254 * self.cid = cid * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int _loops = loops * cdef int _maxtime = maxtime */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_2play, "Channel.play(self, Sound sound, loops=0, maxtime=-1, fade_ms=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_3play = {"play", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_2play}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound = 0; PyObject *__pyx_v_loops = 0; PyObject *__pyx_v_maxtime = 0; PyObject *__pyx_v_fade_ms = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sound,&__pyx_n_s_loops,&__pyx_n_s_maxtime,&__pyx_n_s_fade_ms,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_neg_1)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sound)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 254, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loops); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 254, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxtime); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 254, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fade_ms); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 254, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "play") < 0)) __PYX_ERR(1, 254, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_sound = ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)values[0]); __pyx_v_loops = values[1]; __pyx_v_maxtime = values[2]; __pyx_v_fade_ms = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play", 0, 1, 4, __pyx_nargs); __PYX_ERR(1, 254, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sound), __pyx_ptype_11pygame_sdl2_5mixer_Sound, 0, "sound", 0))) __PYX_ERR(1, 254, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_sound, __pyx_v_loops, __pyx_v_maxtime, __pyx_v_fade_ms); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms) { int __pyx_v__loops; int __pyx_v__maxtime; int __pyx_v__fade_ms; int __pyx_v_cid; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("play", 1); /* "pygame_sdl2/mixer.pyx":255 * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): * cdef int _loops = loops # <<<<<<<<<<<<<< * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 255, __pyx_L1_error) __pyx_v__loops = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":256 * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): * cdef int _loops = loops * cdef int _maxtime = maxtime # <<<<<<<<<<<<<< * cdef int _fade_ms = fade_ms * */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_maxtime); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 256, __pyx_L1_error) __pyx_v__maxtime = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":257 * cdef int _loops = loops * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_fade_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 257, __pyx_L1_error) __pyx_v__fade_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":259 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":260 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) * else: */ __pyx_t_2 = (__pyx_v__fade_ms != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":261 * with nogil: * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) # <<<<<<<<<<<<<< * else: * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) */ __pyx_v_cid = Mix_FadeInChannelTimed(__pyx_v_self->cid, __pyx_v_sound->chunk, __pyx_v__loops, __pyx_v__fade_ms, __pyx_v__maxtime); /* "pygame_sdl2/mixer.pyx":260 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) * else: */ goto __pyx_L6; } /* "pygame_sdl2/mixer.pyx":263 * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) * else: * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) # <<<<<<<<<<<<<< * * if cid == -1: */ /*else*/ { __pyx_v_cid = Mix_PlayChannelTimed(__pyx_v_self->cid, __pyx_v_sound->chunk, __pyx_v__loops, __pyx_v__maxtime); } __pyx_L6:; } /* "pygame_sdl2/mixer.pyx":259 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":265 * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_cid == -1L); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/mixer.pyx":266 * * if cid == -1: * raise error() # <<<<<<<<<<<<<< * * with _lock: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 266, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":265 * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/mixer.pyx":268 * raise error() * * with _lock: # <<<<<<<<<<<<<< * current_sounds[self.cid] = sound * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 268, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 268, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { /* "pygame_sdl2/mixer.pyx":269 * * with _lock: * current_sounds[self.cid] = sound # <<<<<<<<<<<<<< * * def stop(self): */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 269, __pyx_L12_error) } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 269, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_3, ((PyObject *)__pyx_v_sound)) < 0))) __PYX_ERR(1, 269, __pyx_L12_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":268 * raise error() * * with _lock: # <<<<<<<<<<<<<< * current_sounds[self.cid] = sound * */ } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L17_try_end; __pyx_L12_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(1, 268, __pyx_L14_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __pyx_t_8 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 268, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 268, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_2 < 0) __PYX_ERR(1, 268, __pyx_L14_except_error) __pyx_t_13 = (!__pyx_t_2); if (unlikely(__pyx_t_13)) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __PYX_ERR(1, 268, __pyx_L14_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L13_exception_handled; } __pyx_L14_except_error:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); goto __pyx_L1_error; __pyx_L13_exception_handled:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); __pyx_L17_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_7) { __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } goto __pyx_L11; } __pyx_L11:; } goto __pyx_L21; __pyx_L8_error:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L1_error; __pyx_L21:; } /* "pygame_sdl2/mixer.pyx":254 * self.cid = cid * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int _loops = loops * cdef int _maxtime = maxtime */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":271 * current_sounds[self.cid] = sound * * def stop(self): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_4stop, "Channel.stop(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_5stop = {"stop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_4stop}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("stop", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "stop", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_4stop(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_4stop(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 1); /* "pygame_sdl2/mixer.pyx":272 * * def stop(self): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(self.cid) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":273 * def stop(self): * with nogil: * Mix_HaltChannel(self.cid) # <<<<<<<<<<<<<< * * def pause(self): */ (void)(Mix_HaltChannel(__pyx_v_self->cid)); } /* "pygame_sdl2/mixer.pyx":272 * * def stop(self): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(self.cid) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":271 * current_sounds[self.cid] = sound * * def stop(self): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":275 * Mix_HaltChannel(self.cid) * * def pause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_6pause, "Channel.pause(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_7pause = {"pause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_6pause}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("pause", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pause", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_6pause(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_6pause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause", 1); /* "pygame_sdl2/mixer.pyx":276 * * def pause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(self.cid) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":277 * def pause(self): * with nogil: * Mix_Pause(self.cid) # <<<<<<<<<<<<<< * * def unpause(self): */ Mix_Pause(__pyx_v_self->cid); } /* "pygame_sdl2/mixer.pyx":276 * * def pause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(self.cid) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":275 * Mix_HaltChannel(self.cid) * * def pause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":279 * Mix_Pause(self.cid) * * def unpause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_8unpause, "Channel.unpause(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_9unpause = {"unpause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_8unpause}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("unpause", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "unpause", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_8unpause(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_8unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause", 1); /* "pygame_sdl2/mixer.pyx":280 * * def unpause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(self.cid) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":281 * def unpause(self): * with nogil: * Mix_Resume(self.cid) # <<<<<<<<<<<<<< * * def fadeout(self, time): */ Mix_Resume(__pyx_v_self->cid); } /* "pygame_sdl2/mixer.pyx":280 * * def unpause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(self.cid) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":279 * Mix_Pause(self.cid) * * def unpause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":283 * Mix_Resume(self.cid) * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_10fadeout, "Channel.fadeout(self, time)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_11fadeout = {"fadeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_10fadeout}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_time = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 283, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fadeout") < 0)) __PYX_ERR(1, 283, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_time = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fadeout", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 283, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_10fadeout(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_time); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_10fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_time) { int __pyx_v_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 1); /* "pygame_sdl2/mixer.pyx":284 * * def fadeout(self, time): * cdef int ms = time # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(self.cid, ms) */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 284, __pyx_L1_error) __pyx_v_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":285 * def fadeout(self, time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(self.cid, ms) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":286 * cdef int ms = time * with nogil: * Mix_FadeOutChannel(self.cid, ms) # <<<<<<<<<<<<<< * * def set_volume(self, volume): */ (void)(Mix_FadeOutChannel(__pyx_v_self->cid, __pyx_v_ms)); } /* "pygame_sdl2/mixer.pyx":285 * def fadeout(self, time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(self.cid, ms) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":283 * Mix_Resume(self.cid) * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":288 * Mix_FadeOutChannel(self.cid, ms) * * def set_volume(self, volume): # <<<<<<<<<<<<<< * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_12set_volume, "Channel.set_volume(self, volume)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_13set_volume = {"set_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_12set_volume}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_volume = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_volume,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_volume)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 288, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_volume") < 0)) __PYX_ERR(1, 288, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_volume = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_volume", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 288, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_12set_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_volume); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_12set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_volume) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_volume", 1); /* "pygame_sdl2/mixer.pyx":289 * * def set_volume(self, volume): * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) # <<<<<<<<<<<<<< * * def get_volume(self): */ __pyx_t_1 = __Pyx_PyInt_From___pyx_anon_enum(MIX_MAX_VOLUME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (void)(Mix_Volume(__pyx_v_self->cid, __pyx_t_3)); /* "pygame_sdl2/mixer.pyx":288 * Mix_FadeOutChannel(self.cid, ms) * * def set_volume(self, volume): # <<<<<<<<<<<<<< * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":291 * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * * def get_volume(self): # <<<<<<<<<<<<<< * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_14get_volume, "Channel.get_volume(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_15get_volume = {"get_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_14get_volume}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_volume (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_volume", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_volume", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_14get_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_14get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { int __pyx_v_vol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_volume", 1); /* "pygame_sdl2/mixer.pyx":292 * * def get_volume(self): * cdef int vol = Mix_Volume(self.cid, -1) # <<<<<<<<<<<<<< * return vol / MIX_MAX_VOLUME * */ __pyx_v_vol = Mix_Volume(__pyx_v_self->cid, -1); /* "pygame_sdl2/mixer.pyx":293 * def get_volume(self): * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME # <<<<<<<<<<<<<< * * def get_busy(self): */ __Pyx_XDECREF(__pyx_r); if (unlikely(((double)MIX_MAX_VOLUME) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(1, 293, __pyx_L1_error) } __pyx_t_1 = PyFloat_FromDouble((((double)__pyx_v_vol) / ((double)MIX_MAX_VOLUME))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":291 * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * * def get_volume(self): # <<<<<<<<<<<<<< * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":295 * return vol / MIX_MAX_VOLUME * * def get_busy(self): # <<<<<<<<<<<<<< * return Mix_Playing(self.cid) != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_16get_busy, "Channel.get_busy(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_17get_busy = {"get_busy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_16get_busy}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_busy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_busy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_busy", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_16get_busy(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_16get_busy(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_busy", 1); /* "pygame_sdl2/mixer.pyx":296 * * def get_busy(self): * return Mix_Playing(self.cid) != 0 # <<<<<<<<<<<<<< * * def get_sound(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((Mix_Playing(__pyx_v_self->cid) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":295 * return vol / MIX_MAX_VOLUME * * def get_busy(self): # <<<<<<<<<<<<<< * return Mix_Playing(self.cid) != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_busy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":298 * return Mix_Playing(self.cid) != 0 * * def get_sound(self): # <<<<<<<<<<<<<< * with _lock: * return current_sounds.get(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_18get_sound, "Channel.get_sound(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_19get_sound = {"get_sound", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_18get_sound}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_sound (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_sound", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_sound", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_18get_sound(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_18get_sound(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sound", 1); /* "pygame_sdl2/mixer.pyx":299 * * def get_sound(self): * with _lock: # <<<<<<<<<<<<<< * return current_sounds.get(self.cid) * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 299, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 299, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/mixer.pyx":300 * def get_sound(self): * with _lock: * return current_sounds.get(self.cid) # <<<<<<<<<<<<<< * * def queue(self, Sound sound): */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(1, 300, __pyx_L7_error) } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 300, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 300, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/mixer.pyx":299 * * def get_sound(self): * with _lock: # <<<<<<<<<<<<<< * return current_sounds.get(self.cid) * */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_sound", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(1, 299, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 299, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 299, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_11 < 0) __PYX_ERR(1, 299, __pyx_L9_except_error) __pyx_t_12 = (!__pyx_t_11); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __PYX_ERR(1, 299, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_9 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L16; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L16:; } /* "pygame_sdl2/mixer.pyx":298 * return Mix_Playing(self.cid) != 0 * * def get_sound(self): # <<<<<<<<<<<<<< * with _lock: * return current_sounds.get(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_sound", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":302 * return current_sounds.get(self.cid) * * def queue(self, Sound sound): # <<<<<<<<<<<<<< * if self.get_busy(): * with _lock: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_20queue, "Channel.queue(self, Sound sound)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_21queue = {"queue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_20queue}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("queue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sound,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sound)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 302, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "queue") < 0)) __PYX_ERR(1, 302, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sound = ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("queue", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 302, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sound), __pyx_ptype_11pygame_sdl2_5mixer_Sound, 1, "sound", 0))) __PYX_ERR(1, 302, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_20queue(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_sound); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_20queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("queue", 1); /* "pygame_sdl2/mixer.pyx":303 * * def queue(self, Sound sound): * if self.get_busy(): # <<<<<<<<<<<<<< * with _lock: * channel_queued[self.cid] = sound */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_busy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":304 * def queue(self, Sound sound): * if self.get_busy(): * with _lock: # <<<<<<<<<<<<<< * channel_queued[self.cid] = sound * else: */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 304, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 304, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "pygame_sdl2/mixer.pyx":305 * if self.get_busy(): * with _lock: * channel_queued[self.cid] = sound # <<<<<<<<<<<<<< * else: * self.play(sound) */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 305, __pyx_L8_error) } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 305, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1, ((PyObject *)__pyx_v_sound)) < 0))) __PYX_ERR(1, 305, __pyx_L8_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":304 * def queue(self, Sound sound): * if self.get_busy(): * with _lock: # <<<<<<<<<<<<<< * channel_queued[self.cid] = sound * else: */ } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L13_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(1, 304, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __pyx_t_7 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 304, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 304, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_5 < 0) __PYX_ERR(1, 304, __pyx_L10_except_error) __pyx_t_12 = (!__pyx_t_5); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __PYX_ERR(1, 304, __pyx_L10_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_L13_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_6) { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } goto __pyx_L7; } __pyx_L7:; } goto __pyx_L17; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L1_error; __pyx_L17:; } /* "pygame_sdl2/mixer.pyx":303 * * def queue(self, Sound sound): * if self.get_busy(): # <<<<<<<<<<<<<< * with _lock: * channel_queued[self.cid] = sound */ goto __pyx_L3; } /* "pygame_sdl2/mixer.pyx":307 * channel_queued[self.cid] = sound * else: * self.play(sound) # <<<<<<<<<<<<<< * * def get_queue(self): */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_play); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_sound)}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "pygame_sdl2/mixer.pyx":302 * return current_sounds.get(self.cid) * * def queue(self, Sound sound): # <<<<<<<<<<<<<< * if self.get_busy(): * with _lock: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":309 * self.play(sound) * * def get_queue(self): # <<<<<<<<<<<<<< * with _lock: * return channel_queued.get(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_22get_queue, "Channel.get_queue(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_23get_queue = {"get_queue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_22get_queue}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_queue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_queue", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_queue", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_22get_queue(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_22get_queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_queue", 1); /* "pygame_sdl2/mixer.pyx":310 * * def get_queue(self): * with _lock: # <<<<<<<<<<<<<< * return channel_queued.get(self.cid) * */ /*with:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 310, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 310, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/mixer.pyx":311 * def get_queue(self): * with _lock: * return channel_queued.get(self.cid) # <<<<<<<<<<<<<< * * def set_endevent(self, type=None): */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(1, 311, __pyx_L7_error) } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 311, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 311, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/mixer.pyx":310 * * def get_queue(self): * with _lock: # <<<<<<<<<<<<<< * return channel_queued.get(self.cid) * */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(1, 310, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 310, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 310, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_11 < 0) __PYX_ERR(1, 310, __pyx_L9_except_error) __pyx_t_12 = (!__pyx_t_11); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __PYX_ERR(1, 310, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_9 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L16; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L16:; } /* "pygame_sdl2/mixer.pyx":309 * self.play(sound) * * def get_queue(self): # <<<<<<<<<<<<<< * with _lock: * return channel_queued.get(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":313 * return channel_queued.get(self.cid) * * def set_endevent(self, type=None): # <<<<<<<<<<<<<< * channel_events[self.cid] = type or 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_24set_endevent, "Channel.set_endevent(self, type=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_25set_endevent = {"set_endevent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_24set_endevent}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_endevent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 313, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_endevent") < 0)) __PYX_ERR(1, 313, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_endevent", 0, 0, 1, __pyx_nargs); __PYX_ERR(1, 313, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_24set_endevent(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_24set_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_endevent", 1); /* "pygame_sdl2/mixer.pyx":314 * * def set_endevent(self, type=None): * channel_events[self.cid] = type or 0 # <<<<<<<<<<<<<< * * def get_endevent(self): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_type); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 314, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_type); __pyx_t_1 = __pyx_v_type; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; __pyx_L3_bool_binop_done:; if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 314, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(1, 314, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":313 * return channel_queued.get(self.cid) * * def set_endevent(self, type=None): # <<<<<<<<<<<<<< * channel_events[self.cid] = type or 0 * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":316 * channel_events[self.cid] = type or 0 * * def get_endevent(self): # <<<<<<<<<<<<<< * return channel_events.get(self.cid, 0) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_26get_endevent, "Channel.get_endevent(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_27get_endevent = {"get_endevent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_26get_endevent}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_endevent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_endevent", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_endevent", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_26get_endevent(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_26get_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_endevent", 1); /* "pygame_sdl2/mixer.pyx":317 * * def get_endevent(self): * return channel_events.get(self.cid, 0) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(1, 317, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_1, __pyx_int_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":316 * channel_events[self.cid] = type or 0 * * def get_endevent(self): # <<<<<<<<<<<<<< * return channel_events.get(self.cid, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__, "Channel.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self.cid,) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error); __pyx_t_1 = 0; __pyx_v_state = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self.cid,) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v__dict = __pyx_t_2; __pyx_t_2 = 0; /* "(tree fragment)":7 * state = (self.cid,) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_3 = (__pyx_v__dict != Py_None); if (__pyx_t_3) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict)) __PYX_ERR(0, 8, __pyx_L1_error); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = False */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self.cid,) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = False # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_Channel, (type(self), 0x5424626, None), state */ /*else*/ { __pyx_v_use_setstate = 0; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Channel, (type(self), 0x5424626, None), state * else: */ if (__pyx_v_use_setstate) { /* "(tree fragment)":13 * use_setstate = False * if use_setstate: * return __pyx_unpickle_Channel, (type(self), 0x5424626, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_Channel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(0, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_int_88229414); __Pyx_GIVEREF(__pyx_int_88229414); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_88229414)) __PYX_ERR(0, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None)) __PYX_ERR(0, 13, __pyx_L1_error); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(0, 13, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Channel, (type(self), 0x5424626, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_Channel, (type(self), 0x5424626, None), state * else: * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Channel__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Channel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_int_88229414); __Pyx_GIVEREF(__pyx_int_88229414); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_88229414)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state)) __PYX_ERR(0, 15, __pyx_L1_error); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Channel__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__, "Channel.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 16, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Channel__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(0, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_11pygame_sdl2_5mixer___pyx_unpickle_Channel__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Channel__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mixer_28__pyx_unpickle_Channel, "__pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel = {"__pyx_unpickle_Channel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_28__pyx_unpickle_Channel}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_Channel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Channel", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Channel", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Channel") < 0)) __PYX_ERR(0, 1, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Channel", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer.__pyx_unpickle_Channel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_28__pyx_unpickle_Channel(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_28__pyx_unpickle_Channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_Channel", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x5424626, 0x3cbe300, 0x4b7cc56): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__3, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum not in (0x5424626, 0x3cbe300, 0x4b7cc56): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum * __pyx_result = Channel.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(0, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v___pyx_PickleError = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum not in (0x5424626, 0x3cbe300, 0x4b7cc56): * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum # <<<<<<<<<<<<<< * __pyx_result = Channel.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x5424626, 0x3cbe300, 0x4b7cc56): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum * __pyx_result = Channel.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v___pyx_result = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum * __pyx_result = Channel.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_2 = (__pyx_v___pyx_state != Py_None); if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = Channel.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(0, 9, __pyx_L1_error) __pyx_t_1 = __pyx_f_11pygame_sdl2_5mixer___pyx_unpickle_Channel__set_state(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum * __pyx_result = Channel.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): * __pyx_result.cid = __pyx_state[0] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.mixer.__pyx_unpickle_Channel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.cid = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_11pygame_sdl2_5mixer___pyx_unpickle_Channel__set_state(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_Channel__set_state", 1); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): * __pyx_result.cid = __pyx_state[0] # <<<<<<<<<<<<<< * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->cid = __pyx_t_2; /* "(tree fragment)":13 * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): * __pyx_result.cid = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 13, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 13, __pyx_L1_error) __pyx_t_5 = (__pyx_t_4 > 1); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 13, __pyx_L1_error) __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { /* "(tree fragment)":14 * __pyx_result.cid = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 14, __pyx_L1_error) } __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): * __pyx_result.cid = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ } /* "(tree fragment)":11 * __pyx_unpickle_Channel__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.cid = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.mixer.__pyx_unpickle_Channel__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Sound(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_11pygame_sdl2_5mixer_5Sound_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_5mixer_Sound(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_5mixer_Sound) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_5mixer_5Sound_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_11pygame_sdl2_5mixer_Sound[] = { {"play", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_6play}, {"stop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_8stop}, {"pause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_10pause}, {"unpause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_12unpause}, {"fadeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_14fadeout}, {"set_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_16set_volume}, {"get_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_18get_volume}, {"get_num_channels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_20get_num_channels}, {"get_length", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_22get_length}, {"get_raw", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_24get_raw}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_5mixer_Sound_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_5mixer_Sound}, {Py_tp_doc, (void *)PyDoc_STR("Sound(fi)")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_5mixer_Sound}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_5mixer_Sound}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_5mixer_Sound_spec = { "pygame_sdl2.mixer.Sound", sizeof(struct __pyx_obj_11pygame_sdl2_5mixer_Sound), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_5mixer_Sound_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_5mixer_Sound = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.mixer.""Sound", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5mixer_Sound), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5mixer_Sound, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Sound(fi)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5mixer_Sound, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5mixer_Sound, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Channel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5mixer_Channel(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_5mixer_Channel) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_11pygame_sdl2_5mixer_Channel[] = { {"play", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_2play}, {"stop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_4stop}, {"pause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_6pause}, {"unpause", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_8unpause}, {"fadeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_10fadeout}, {"set_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_12set_volume}, {"get_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_14get_volume}, {"get_busy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_16get_busy}, {"get_sound", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_18get_sound}, {"queue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_20queue}, {"get_queue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_22get_queue}, {"set_endevent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_24set_endevent}, {"get_endevent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_26get_endevent}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_5mixer_Channel_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_5mixer_Channel}, {Py_tp_doc, (void *)PyDoc_STR("Channel(cid)")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_5mixer_Channel}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_5mixer_Channel}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_5mixer_Channel_spec = { "pygame_sdl2.mixer.Channel", sizeof(struct __pyx_obj_11pygame_sdl2_5mixer_Channel), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_5mixer_Channel_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_5mixer_Channel = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.mixer.""Channel", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5mixer_Channel), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5mixer_Channel, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Channel(cid)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5mixer_Channel, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5mixer_Channel, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Channel, __pyx_k_Channel, sizeof(__pyx_k_Channel), 0, 0, 1, 1}, {&__pyx_n_s_Channel___reduce_cython, __pyx_k_Channel___reduce_cython, sizeof(__pyx_k_Channel___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Channel___setstate_cython, __pyx_k_Channel___setstate_cython, sizeof(__pyx_k_Channel___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Channel_fadeout, __pyx_k_Channel_fadeout, sizeof(__pyx_k_Channel_fadeout), 0, 0, 1, 1}, {&__pyx_n_s_Channel_get_busy, __pyx_k_Channel_get_busy, sizeof(__pyx_k_Channel_get_busy), 0, 0, 1, 1}, {&__pyx_n_s_Channel_get_endevent, __pyx_k_Channel_get_endevent, sizeof(__pyx_k_Channel_get_endevent), 0, 0, 1, 1}, {&__pyx_n_s_Channel_get_queue, __pyx_k_Channel_get_queue, sizeof(__pyx_k_Channel_get_queue), 0, 0, 1, 1}, {&__pyx_n_s_Channel_get_sound, __pyx_k_Channel_get_sound, sizeof(__pyx_k_Channel_get_sound), 0, 0, 1, 1}, {&__pyx_n_s_Channel_get_volume, __pyx_k_Channel_get_volume, sizeof(__pyx_k_Channel_get_volume), 0, 0, 1, 1}, {&__pyx_n_s_Channel_pause, __pyx_k_Channel_pause, sizeof(__pyx_k_Channel_pause), 0, 0, 1, 1}, {&__pyx_n_s_Channel_play, __pyx_k_Channel_play, sizeof(__pyx_k_Channel_play), 0, 0, 1, 1}, {&__pyx_n_s_Channel_queue, __pyx_k_Channel_queue, sizeof(__pyx_k_Channel_queue), 0, 0, 1, 1}, {&__pyx_n_s_Channel_set_endevent, __pyx_k_Channel_set_endevent, sizeof(__pyx_k_Channel_set_endevent), 0, 0, 1, 1}, {&__pyx_n_s_Channel_set_volume, __pyx_k_Channel_set_volume, sizeof(__pyx_k_Channel_set_volume), 0, 0, 1, 1}, {&__pyx_n_s_Channel_stop, __pyx_k_Channel_stop, sizeof(__pyx_k_Channel_stop), 0, 0, 1, 1}, {&__pyx_n_s_Channel_unpause, __pyx_k_Channel_unpause, sizeof(__pyx_k_Channel_unpause), 0, 0, 1, 1}, {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, {&__pyx_n_s_Lock, __pyx_k_Lock, sizeof(__pyx_k_Lock), 0, 0, 1, 1}, {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_Sound, __pyx_k_Sound, sizeof(__pyx_k_Sound), 0, 0, 1, 1}, {&__pyx_n_s_Sound___reduce_cython, __pyx_k_Sound___reduce_cython, sizeof(__pyx_k_Sound___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Sound___setstate_cython, __pyx_k_Sound___setstate_cython, sizeof(__pyx_k_Sound___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Sound_fadeout, __pyx_k_Sound_fadeout, sizeof(__pyx_k_Sound_fadeout), 0, 0, 1, 1}, {&__pyx_n_s_Sound_get_length, __pyx_k_Sound_get_length, sizeof(__pyx_k_Sound_get_length), 0, 0, 1, 1}, {&__pyx_n_s_Sound_get_num_channels, __pyx_k_Sound_get_num_channels, sizeof(__pyx_k_Sound_get_num_channels), 0, 0, 1, 1}, {&__pyx_n_s_Sound_get_raw, __pyx_k_Sound_get_raw, sizeof(__pyx_k_Sound_get_raw), 0, 0, 1, 1}, {&__pyx_n_s_Sound_get_volume, __pyx_k_Sound_get_volume, sizeof(__pyx_k_Sound_get_volume), 0, 0, 1, 1}, {&__pyx_n_s_Sound_pause, __pyx_k_Sound_pause, sizeof(__pyx_k_Sound_pause), 0, 0, 1, 1}, {&__pyx_n_s_Sound_play, __pyx_k_Sound_play, sizeof(__pyx_k_Sound_play), 0, 0, 1, 1}, {&__pyx_n_s_Sound_set_volume, __pyx_k_Sound_set_volume, sizeof(__pyx_k_Sound_set_volume), 0, 0, 1, 1}, {&__pyx_n_s_Sound_stop, __pyx_k_Sound_stop, sizeof(__pyx_k_Sound_stop), 0, 0, 1, 1}, {&__pyx_n_s_Sound_unpause, __pyx_k_Sound_unpause, sizeof(__pyx_k_Sound_unpause), 0, 0, 1, 1}, {&__pyx_n_s_Thread, __pyx_k_Thread, sizeof(__pyx_k_Thread), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, {&__pyx_n_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 1}, {&__pyx_n_s__74, __pyx_k__74, sizeof(__pyx_k__74), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, {&__pyx_n_s_buffersize, __pyx_k_buffersize, sizeof(__pyx_k_buffersize), 0, 0, 1, 1}, {&__pyx_n_s_chan, __pyx_k_chan, sizeof(__pyx_k_chan), 0, 0, 1, 1}, {&__pyx_n_s_channel, __pyx_k_channel, sizeof(__pyx_k_channel), 0, 0, 1, 1}, {&__pyx_n_s_channels, __pyx_k_channels, sizeof(__pyx_k_channels), 0, 0, 1, 1}, {&__pyx_n_s_cid, __pyx_k_cid, sizeof(__pyx_k_cid), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_n_s_fade_ms, __pyx_k_fade_ms, sizeof(__pyx_k_fade_ms), 0, 0, 1, 1}, {&__pyx_n_s_fade_ms_2, __pyx_k_fade_ms_2, sizeof(__pyx_k_fade_ms_2), 0, 0, 1, 1}, {&__pyx_n_s_fadeout, __pyx_k_fadeout, sizeof(__pyx_k_fadeout), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_find_channel, __pyx_k_find_channel, sizeof(__pyx_k_find_channel), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_frequency, __pyx_k_frequency, sizeof(__pyx_k_frequency), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_busy, __pyx_k_get_busy, sizeof(__pyx_k_get_busy), 0, 0, 1, 1}, {&__pyx_n_s_get_endevent, __pyx_k_get_endevent, sizeof(__pyx_k_get_endevent), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_length, __pyx_k_get_length, sizeof(__pyx_k_get_length), 0, 0, 1, 1}, {&__pyx_n_s_get_num_channels, __pyx_k_get_num_channels, sizeof(__pyx_k_get_num_channels), 0, 0, 1, 1}, {&__pyx_n_s_get_queue, __pyx_k_get_queue, sizeof(__pyx_k_get_queue), 0, 0, 1, 1}, {&__pyx_n_s_get_raw, __pyx_k_get_raw, sizeof(__pyx_k_get_raw), 0, 0, 1, 1}, {&__pyx_n_s_get_sound, __pyx_k_get_sound, sizeof(__pyx_k_get_sound), 0, 0, 1, 1}, {&__pyx_n_s_get_volume, __pyx_k_get_volume, sizeof(__pyx_k_get_volume), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_loops, __pyx_k_loops, sizeof(__pyx_k_loops), 0, 0, 1, 1}, {&__pyx_n_s_loops_2, __pyx_k_loops_2, sizeof(__pyx_k_loops_2), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_maxtime, __pyx_k_maxtime, sizeof(__pyx_k_maxtime), 0, 0, 1, 1}, {&__pyx_n_s_maxtime_2, __pyx_k_maxtime_2, sizeof(__pyx_k_maxtime_2), 0, 0, 1, 1}, {&__pyx_n_s_mixer_music, __pyx_k_mixer_music, sizeof(__pyx_k_mixer_music), 0, 0, 1, 1}, {&__pyx_n_s_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 0, 1, 1}, {&__pyx_n_s_music, __pyx_k_music, sizeof(__pyx_k_music), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_next_sound, __pyx_k_next_sound, sizeof(__pyx_k_next_sound), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_pause, __pyx_k_pause, sizeof(__pyx_k_pause), 0, 0, 1, 1}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_play, __pyx_k_play, sizeof(__pyx_k_play), 0, 0, 1, 1}, {&__pyx_n_s_play_current, __pyx_k_play_current, sizeof(__pyx_k_play_current), 0, 0, 1, 1}, {&__pyx_n_s_pre_init, __pyx_k_pre_init, sizeof(__pyx_k_pre_init), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mixer, __pyx_k_pygame_sdl2_mixer, sizeof(__pyx_k_pygame_sdl2_mixer), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mixer_music, __pyx_k_pygame_sdl2_mixer_music, sizeof(__pyx_k_pygame_sdl2_mixer_music), 0, 0, 1, 1}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_Channel, __pyx_k_pyx_unpickle_Channel, sizeof(__pyx_k_pyx_unpickle_Channel), 0, 0, 1, 1}, {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_endevent, __pyx_k_set_endevent, sizeof(__pyx_k_set_endevent), 0, 0, 1, 1}, {&__pyx_n_s_set_num_channels, __pyx_k_set_num_channels, sizeof(__pyx_k_set_num_channels), 0, 0, 1, 1}, {&__pyx_n_s_set_reserved, __pyx_k_set_reserved, sizeof(__pyx_k_set_reserved), 0, 0, 1, 1}, {&__pyx_n_s_set_volume, __pyx_k_set_volume, sizeof(__pyx_k_set_volume), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_sound, __pyx_k_sound, sizeof(__pyx_k_sound), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_k_src_pygame_sdl2_mixer_pyx, sizeof(__pyx_k_src_pygame_sdl2_mixer_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_unpause, __pyx_k_unpause, sizeof(__pyx_k_unpause), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_vol, __pyx_k_vol, sizeof(__pyx_k_vol), 0, 0, 1, 1}, {&__pyx_n_s_volume, __pyx_k_volume, sizeof(__pyx_k_volume), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/mixer.pyx":50 * cdef Sound next_sound * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound */ __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x5424626, 0x3cbe300, 0x4b7cc56): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x5424626, 0x3cbe300, 0x4b7cc56) = (cid))" % __pyx_checksum */ __pyx_tuple__3 = PyTuple_Pack(3, __pyx_int_88229414, __pyx_int_63693568, __pyx_int_79154262); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/mixer.pyx":28 * from pygame_sdl2.error import error * * import pygame_sdl2.mixer_music as music # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_pygame_sdl2, __pyx_n_s_mixer_music); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_channel, __pyx_n_s_next_sound); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_play_current, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 41, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":79 * errors = [ ] * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: */ __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_frequency, __pyx_n_s_size, __pyx_n_s_channels, __pyx_n_s_buffer, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_init, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 79, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":100 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_frequency, __pyx_n_s_size, __pyx_n_s_channels, __pyx_n_s_buffersize); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_pre_init, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 100, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":104 * preinit_args = (frequency, size, channels, buffersize) * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * Mix_CloseAudio() */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_quit, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(1, 104, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":109 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_frequency, __pyx_n_s_format, __pyx_n_s_channels); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_init, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 109, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":119 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_stop, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 119, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":123 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_pause, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 123, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":127 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_unpause, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 127, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":131 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_time, __pyx_n_s_ms); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_fadeout, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 131, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":136 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_count); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_num_channels, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 136, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":139 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_num_channels, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 139, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":142 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_reserved, 142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 142, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":145 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_force, __pyx_n_s_chan); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_find_channel, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(1, 145, __pyx_L1_error) __pyx_tuple__27 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "pygame_sdl2/mixer.pyx":156 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_busy, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(1, 156, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":175 * raise error() * * def play(self, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int cid * cdef int _loops = loops */ __pyx_tuple__29 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_loops, __pyx_n_s_maxtime, __pyx_n_s_fade_ms, __pyx_n_s_cid, __pyx_n_s_loops_2, __pyx_n_s_maxtime_2, __pyx_n_s_fade_ms_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_play, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(1, 175, __pyx_L1_error) __pyx_tuple__31 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_neg_1, __pyx_int_0); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "pygame_sdl2/mixer.pyx":191 * return Channel(cid) * * def stop(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_i); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_stop, 191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(1, 191, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":199 * i += 1 * * def pause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_pause, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 199, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":207 * i += 1 * * def unpause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_unpause, 207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(1, 207, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":215 * i += 1 * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int ms = time */ __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_time, __pyx_n_s_i, __pyx_n_s_ms); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_fadeout, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 215, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":224 * i += 1 * * def set_volume(self, value): # <<<<<<<<<<<<<< * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * */ __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_volume, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 224, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":227 * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * * def get_volume(self): # <<<<<<<<<<<<<< * return Mix_VolumeChunk(self.chunk, -1) * */ __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_volume, 227, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(1, 227, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":230 * return Mix_VolumeChunk(self.chunk, -1) * * def get_num_channels(self): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int n = 0 */ __pyx_tuple__42 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_n); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_num_channels, 230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(1, 230, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":239 * return n * * def get_length(self): # <<<<<<<<<<<<<< * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] */ __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_length, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(1, 239, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":243 * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] * * def get_raw(self): # <<<<<<<<<<<<<< * # return self.chunk.abuf * raise error("Not implemented.") */ __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_raw, 243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(1, 243, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 3, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":254 * self.cid = cid * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int _loops = loops * cdef int _maxtime = maxtime */ __pyx_tuple__49 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_sound, __pyx_n_s_loops, __pyx_n_s_maxtime, __pyx_n_s_fade_ms, __pyx_n_s_loops_2, __pyx_n_s_maxtime_2, __pyx_n_s_fade_ms_2, __pyx_n_s_cid); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_play, 254, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(1, 254, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":271 * current_sounds[self.cid] = sound * * def stop(self): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(self.cid) */ __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_stop, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(1, 271, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":275 * Mix_HaltChannel(self.cid) * * def pause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(self.cid) */ __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_pause, 275, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(1, 275, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":279 * Mix_Pause(self.cid) * * def unpause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(self.cid) */ __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_unpause, 279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(1, 279, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":283 * Mix_Resume(self.cid) * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_time, __pyx_n_s_ms); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_fadeout, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(1, 283, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":288 * Mix_FadeOutChannel(self.cid, ms) * * def set_volume(self, volume): # <<<<<<<<<<<<<< * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * */ __pyx_tuple__56 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_volume); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_volume, 288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(1, 288, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":291 * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * * def get_volume(self): # <<<<<<<<<<<<<< * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME */ __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_vol); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_volume, 291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(1, 291, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":295 * return vol / MIX_MAX_VOLUME * * def get_busy(self): # <<<<<<<<<<<<<< * return Mix_Playing(self.cid) != 0 * */ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_busy, 295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 295, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":298 * return Mix_Playing(self.cid) != 0 * * def get_sound(self): # <<<<<<<<<<<<<< * with _lock: * return current_sounds.get(self.cid) */ __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_sound, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(1, 298, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":302 * return current_sounds.get(self.cid) * * def queue(self, Sound sound): # <<<<<<<<<<<<<< * if self.get_busy(): * with _lock: */ __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_sound); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_queue, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(1, 302, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":309 * self.play(sound) * * def get_queue(self): # <<<<<<<<<<<<<< * with _lock: * return channel_queued.get(self.cid) */ __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_queue, 309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(1, 309, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":313 * return channel_queued.get(self.cid) * * def set_endevent(self, type=None): # <<<<<<<<<<<<<< * channel_events[self.cid] = type or 0 * */ __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_type); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(1, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_endevent, 313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(1, 313, __pyx_L1_error) __pyx_tuple__67 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(1, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); /* "pygame_sdl2/mixer.pyx":316 * channel_events[self.cid] = type or 0 * * def get_endevent(self): # <<<<<<<<<<<<<< * return channel_events.get(self.cid, 0) */ __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_endevent, 316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(1, 316, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_tuple__69 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Channel__set_state(self, __pyx_state) */ __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_tuple__72 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Channel, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get; if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_4096 = PyInt_FromLong(4096); if (unlikely(!__pyx_int_4096)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_22050 = PyInt_FromLong(22050L); if (unlikely(!__pyx_int_22050)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_63693568 = PyInt_FromLong(63693568L); if (unlikely(!__pyx_int_63693568)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_79154262 = PyInt_FromLong(79154262L); if (unlikely(!__pyx_int_79154262)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_88229414 = PyInt_FromLong(88229414L); if (unlikely(!__pyx_int_88229414)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_5mixer_preinit_args = Py_None; Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_output_spec = Py_None; Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_channel_events = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_channel_queued = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_current_sounds = ((PyObject*)Py_None); Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_5mixer_Sound = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_5mixer_Sound_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_5mixer_Sound)) __PYX_ERR(1, 160, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_5mixer_Sound_spec, __pyx_ptype_11pygame_sdl2_5mixer_Sound) < 0) __PYX_ERR(1, 160, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_5mixer_Sound = &__pyx_type_11pygame_sdl2_5mixer_Sound; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_5mixer_Sound) < 0) __PYX_ERR(1, 160, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_5mixer_Sound->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_5mixer_Sound->tp_dictoffset && __pyx_ptype_11pygame_sdl2_5mixer_Sound->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_5mixer_Sound->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Sound, (PyObject *) __pyx_ptype_11pygame_sdl2_5mixer_Sound) < 0) __PYX_ERR(1, 160, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_5mixer_Sound) < 0) __PYX_ERR(1, 160, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_5mixer_Channel = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_5mixer_Channel_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_5mixer_Channel)) __PYX_ERR(1, 248, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_5mixer_Channel_spec, __pyx_ptype_11pygame_sdl2_5mixer_Channel) < 0) __PYX_ERR(1, 248, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_5mixer_Channel = &__pyx_type_11pygame_sdl2_5mixer_Channel; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_5mixer_Channel) < 0) __PYX_ERR(1, 248, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_5mixer_Channel->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_5mixer_Channel->tp_dictoffset && __pyx_ptype_11pygame_sdl2_5mixer_Channel->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_5mixer_Channel->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Channel, (PyObject *) __pyx_ptype_11pygame_sdl2_5mixer_Channel) < 0) __PYX_ERR(1, 248, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_5mixer_Channel) < 0) __PYX_ERR(1, 248, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_mixer(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_mixer}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "mixer", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initmixer(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initmixer(void) #else __Pyx_PyMODINIT_FUNC PyInit_mixer(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_mixer(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_mixer(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'mixer' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("mixer", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "mixer" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_mixer(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__mixer) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.mixer")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.mixer", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "pygame_sdl2/mixer.pyx":24 * from libc.string cimport memset * * import sys # <<<<<<<<<<<<<< * import threading * from pygame_sdl2.error import error */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":25 * * import sys * import threading # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_threading, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_2) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":26 * import sys * import threading * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * import pygame_sdl2.mixer_music as music */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(1, 26, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":28 * from pygame_sdl2.error import error * * import pygame_sdl2.mixer_music as music # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2_mixer_music, __pyx_tuple__6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_music, __pyx_t_3) < 0) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":29 * * import pygame_sdl2.mixer_music as music * import pygame_sdl2 # <<<<<<<<<<<<<< * * cdef object preinit_args = None */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":31 * import pygame_sdl2 * * cdef object preinit_args = None # <<<<<<<<<<<<<< * cdef object output_spec = None * */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_preinit_args); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_preinit_args, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer.pyx":32 * * cdef object preinit_args = None * cdef object output_spec = None # <<<<<<<<<<<<<< * * cdef dict channel_events = {} */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_output_spec); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_output_spec, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer.pyx":34 * cdef object output_spec = None * * cdef dict channel_events = {} # <<<<<<<<<<<<<< * cdef dict channel_queued = {} * cdef dict current_sounds = {} */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_channel_events); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_channel_events, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":35 * * cdef dict channel_events = {} * cdef dict channel_queued = {} # <<<<<<<<<<<<<< * cdef dict current_sounds = {} * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_channel_queued); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_channel_queued, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":36 * cdef dict channel_events = {} * cdef dict channel_queued = {} * cdef dict current_sounds = {} # <<<<<<<<<<<<<< * * # The lock protects channel_queued and current_sounds. */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_current_sounds); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_current_sounds, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":39 * * # The lock protects channel_queued and current_sounds. * _lock = threading.Lock() # <<<<<<<<<<<<<< * * def _play_current(int channel): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_lock, __pyx_t_3) < 0) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_1_play_current, 0, __pyx_n_s_play_current, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_play_current, __pyx_t_3) < 0) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":77 * * # A list of errors that occured during mixer initialization. * errors = [ ] # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_errors, __pyx_t_3) < 0) __PYX_ERR(1, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":79 * errors = [ ] * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_3init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults), 1)) __PYX_ERR(1, 79, __pyx_L1_error) /* "pygame_sdl2/mixer.pyx":80 * * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): # <<<<<<<<<<<<<< * if get_init() is not None: * return */ __pyx_t_4 = __Pyx_PyInt_From___pyx_anon_enum(MIX_DEFAULT_FORMAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_3)->__pyx_arg_size = __pyx_t_4; __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_11pygame_sdl2_5mixer_30__defaults__); /* "pygame_sdl2/mixer.pyx":79 * errors = [ ] * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/mixer.pyx":100 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5pre_init, 0, __pyx_n_s_pre_init, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults1), 1)) __PYX_ERR(1, 100, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(MIX_DEFAULT_FORMAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_4)->__pyx_arg_size = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_11pygame_sdl2_5mixer_32__defaults__); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pre_init, __pyx_t_4) < 0) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/mixer.pyx":104 * preinit_args = (frequency, size, channels, buffersize) * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * Mix_CloseAudio() */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":109 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_9get_init, 0, __pyx_n_s_get_init, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":119 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_11stop, 0, __pyx_n_s_stop, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(1, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":123 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_13pause, 0, __pyx_n_s_pause, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pause, __pyx_t_2) < 0) __PYX_ERR(1, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":127 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_15unpause, 0, __pyx_n_s_unpause, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpause, __pyx_t_2) < 0) __PYX_ERR(1, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":131 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_17fadeout, 0, __pyx_n_s_fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_fadeout, __pyx_t_2) < 0) __PYX_ERR(1, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":136 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_19set_num_channels, 0, __pyx_n_s_set_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_num_channels, __pyx_t_2) < 0) __PYX_ERR(1, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":139 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_21get_num_channels, 0, __pyx_n_s_get_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_channels, __pyx_t_2) < 0) __PYX_ERR(1, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":142 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_23set_reserved, 0, __pyx_n_s_set_reserved, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_reserved, __pyx_t_2) < 0) __PYX_ERR(1, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":145 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_25find_channel, 0, __pyx_n_s_find_channel, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__27); if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_channel, __pyx_t_2) < 0) __PYX_ERR(1, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":156 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_27get_busy, 0, __pyx_n_s_get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_busy, __pyx_t_2) < 0) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":175 * raise error() * * def play(self, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int cid * cdef int _loops = loops */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_7play, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_play, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__31); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_play, __pyx_t_2) < 0) __PYX_ERR(1, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":191 * return Channel(cid) * * def stop(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_9stop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_stop, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(1, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":199 * i += 1 * * def pause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_11pause, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_pause, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_pause, __pyx_t_2) < 0) __PYX_ERR(1, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":207 * i += 1 * * def unpause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_13unpause, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_unpause, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_unpause, __pyx_t_2) < 0) __PYX_ERR(1, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":215 * i += 1 * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int ms = time */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_15fadeout, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_fadeout, __pyx_t_2) < 0) __PYX_ERR(1, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":224 * i += 1 * * def set_volume(self, value): # <<<<<<<<<<<<<< * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_17set_volume, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_set_volume, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_set_volume, __pyx_t_2) < 0) __PYX_ERR(1, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":227 * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * * def get_volume(self): # <<<<<<<<<<<<<< * return Mix_VolumeChunk(self.chunk, -1) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_19get_volume, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_get_volume, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_get_volume, __pyx_t_2) < 0) __PYX_ERR(1, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":230 * return Mix_VolumeChunk(self.chunk, -1) * * def get_num_channels(self): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int n = 0 */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_21get_num_channels, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_get_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_get_num_channels, __pyx_t_2) < 0) __PYX_ERR(1, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":239 * return n * * def get_length(self): # <<<<<<<<<<<<<< * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_23get_length, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_get_length, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_get_length, __pyx_t_2) < 0) __PYX_ERR(1, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "pygame_sdl2/mixer.pyx":243 * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] * * def get_raw(self): # <<<<<<<<<<<<<< * # return self.chunk.abuf * raise error("Not implemented.") */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_25get_raw, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound_get_raw, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Sound, __pyx_n_s_get_raw, __pyx_t_2) < 0) __PYX_ERR(1, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Sound); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sound___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":254 * self.cid = cid * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int _loops = loops * cdef int _maxtime = maxtime */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_3play, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_play, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__31); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_play, __pyx_t_2) < 0) __PYX_ERR(1, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":271 * current_sounds[self.cid] = sound * * def stop(self): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(self.cid) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_5stop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_stop, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(1, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":275 * Mix_HaltChannel(self.cid) * * def pause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(self.cid) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_7pause, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_pause, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_pause, __pyx_t_2) < 0) __PYX_ERR(1, 275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":279 * Mix_Pause(self.cid) * * def unpause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(self.cid) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_9unpause, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_unpause, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_unpause, __pyx_t_2) < 0) __PYX_ERR(1, 279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":283 * Mix_Resume(self.cid) * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_11fadeout, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_fadeout, __pyx_t_2) < 0) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":288 * Mix_FadeOutChannel(self.cid, ms) * * def set_volume(self, volume): # <<<<<<<<<<<<<< * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_13set_volume, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_set_volume, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_set_volume, __pyx_t_2) < 0) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":291 * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * * def get_volume(self): # <<<<<<<<<<<<<< * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_15get_volume, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_volume, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_get_volume, __pyx_t_2) < 0) __PYX_ERR(1, 291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":295 * return vol / MIX_MAX_VOLUME * * def get_busy(self): # <<<<<<<<<<<<<< * return Mix_Playing(self.cid) != 0 * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_17get_busy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_get_busy, __pyx_t_2) < 0) __PYX_ERR(1, 295, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":298 * return Mix_Playing(self.cid) != 0 * * def get_sound(self): # <<<<<<<<<<<<<< * with _lock: * return current_sounds.get(self.cid) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_19get_sound, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_sound, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_get_sound, __pyx_t_2) < 0) __PYX_ERR(1, 298, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":302 * return current_sounds.get(self.cid) * * def queue(self, Sound sound): # <<<<<<<<<<<<<< * if self.get_busy(): * with _lock: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_21queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_queue, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_queue, __pyx_t_2) < 0) __PYX_ERR(1, 302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":309 * self.play(sound) * * def get_queue(self): # <<<<<<<<<<<<<< * with _lock: * return channel_queued.get(self.cid) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_23get_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_queue, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_get_queue, __pyx_t_2) < 0) __PYX_ERR(1, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":313 * return channel_queued.get(self.cid) * * def set_endevent(self, type=None): # <<<<<<<<<<<<<< * channel_events[self.cid] = type or 0 * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_25set_endevent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_set_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__67); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_set_endevent, __pyx_t_2) < 0) __PYX_ERR(1, 313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "pygame_sdl2/mixer.pyx":316 * channel_events[self.cid] = type or 0 * * def get_endevent(self): # <<<<<<<<<<<<<< * return channel_events.get(self.cid, 0) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_27get_endevent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_get_endevent, __pyx_t_2) < 0) __PYX_ERR(1, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "(tree fragment)":16 * else: * return __pyx_unpickle_Channel, (type(self), 0x5424626, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Channel__set_state(self, __pyx_state) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mixer_Channel); /* "(tree fragment)":1 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel, 0, __pyx_n_s_pyx_unpickle_Channel, NULL, __pyx_n_s_pygame_sdl2_mixer, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Channel, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.mixer", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.mixer"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* RaiseUnboundLocalError */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *result; PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); if (unlikely(!selfless_args)) return NULL; result = PyObject_Call(method, selfless_args, kwargs); Py_DECREF(selfless_args); return result; } static PyMethodDef __Pyx_UnboundCMethod_Def = { "CythonUnboundCMethod", __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), METH_VARARGS | METH_KEYWORDS, NULL }; static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #else if (likely(!__Pyx_CyOrPyCFunction_Check(method))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } else #endif #if CYTHON_COMPILING_IN_PYPY #else if (PyCFunction_Check(method)) #endif { PyObject *self; int self_found; #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY self = PyObject_GetAttrString(method, "__self__"); if (!self) { PyErr_Clear(); } #else self = PyCFunction_GET_SELF(method); #endif self_found = (self && self != Py_None); #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY Py_XDECREF(self); #endif if (self_found) { PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); if (unlikely(!unbound_method)) return -1; Py_DECREF(method); target->method = unbound_method; } } return 0; } /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { if (likely(cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); #endif } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } return __Pyx__CallUnboundCMethod1(cfunc, self, arg); } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(2, self, arg); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { if (likely(cfunc->func)) { PyObject *args[2] = {arg1, arg2}; if (cfunc->flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } #if PY_VERSION_HEX >= 0x030700A0 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); } #endif static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(3); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg1); PyTuple_SET_ITEM(args, 1, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 2, arg2); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(3, self, arg1, arg2); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* dict_getitem_default */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); if ((1)); #else if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; } Py_INCREF(value); } #endif else { if (default_value == Py_None) value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); else value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); else state = (PyGILState_STATE)0; #endif CYTHON_UNUSED_VAR(clineno); CYTHON_UNUSED_VAR(lineno); CYTHON_UNUSED_VAR(filename); CYTHON_MAYBE_UNUSED_VAR(nogil); __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(0); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) { return PyFloat_FromDouble((double)a / (double)b); } return PyInt_Type.tp_as_number->nb_true_divide(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; if (unlikely(__Pyx_PyLong_IsZero(op1))) { } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); } } if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) || __Pyx_PyLong_DigitCount(op1) <= 52 / PyLong_SHIFT) { return PyFloat_FromDouble((double)a / (double)b); } return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); return PyLong_FromLong(x); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("divide", return NULL) result = ((double)a) / (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); } #endif /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* GetAttr3 */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } #endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { r = __Pyx_NewRef(d); } return r; } #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); #endif } /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__4); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (!r) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__5; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MIX_InitFlags(MIX_InitFlags value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MIX_InitFlags neg_one = (MIX_InitFlags) -1, const_zero = (MIX_InitFlags) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MIX_InitFlags) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MIX_InitFlags) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MIX_InitFlags) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MIX_InitFlags) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MIX_InitFlags) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(MIX_InitFlags), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(MIX_InitFlags)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint16_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint16_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint16_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint16_t) -1; val = __Pyx_PyInt_As_uint16_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) >= 2 * PyLong_SHIFT)) { return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) >= 3 * PyLong_SHIFT)) { return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) >= 4 * PyLong_SHIFT)) { return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint16_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint16_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint16_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { return (uint16_t) (((uint16_t)-1)*(((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { return (uint16_t) ((((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { return (uint16_t) (((uint16_t)-1)*(((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { return (uint16_t) ((((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) { return (uint16_t) (((uint16_t)-1)*(((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) { return (uint16_t) ((((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; } } #endif if ((sizeof(uint16_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint16_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint16_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint16_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint16_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint16_t) -1; } else { stepval = v; } v = NULL; val = (uint16_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint16_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint16_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint16_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint16_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint16_t) 1) << (sizeof(uint16_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint16_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint16_t"); return (uint16_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint16_t"); return (uint16_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint16_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint16_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__74); } return name; } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12 #define __PYX_HAVE_RT_ImportFunction_3_0_12 static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635914.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.mixer_music.c0000664000175000017500000127221015026112612021416 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__mixer_music #define __PYX_HAVE_API__pygame_sdl2__mixer_music /* Early includes */ #include #include #include #include #include "SDL.h" #include "SDL_mixer.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/mixer_music.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_mixer" */ /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.mixer_music" */ static Mix_Music *__pyx_v_11pygame_sdl2_11mixer_music_current_music; static PyObject *__pyx_v_11pygame_sdl2_11mixer_music_queued_music = 0; static int __pyx_v_11pygame_sdl2_11mixer_music_endevent; static void __pyx_f_11pygame_sdl2_11mixer_music_music_finished(void); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.mixer_music" extern int __pyx_module_is_main_pygame_sdl2__mixer_music; int __pyx_module_is_main_pygame_sdl2__mixer_music = 0; /* Implementation of "pygame_sdl2.mixer_music" */ /* #### Code section: global_var ### */ /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; static const char __pyx_k_fi[] = "fi"; static const char __pyx_k__24[] = "?"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_load[] = "load"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_play[] = "play"; static const char __pyx_k_stop[] = "stop"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_time[] = "time"; static const char __pyx_k_type[] = "type"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_loops[] = "loops"; static const char __pyx_k_pause[] = "pause"; static const char __pyx_k_queue[] = "queue"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_rewind[] = "rewind"; static const char __pyx_k_fadeout[] = "fadeout"; static const char __pyx_k_get_pos[] = "get_pos"; static const char __pyx_k_set_pos[] = "set_pos"; static const char __pyx_k_unpause[] = "unpause"; static const char __pyx_k_get_busy[] = "get_busy"; static const char __pyx_k_get_volume[] = "get_volume"; static const char __pyx_k_set_volume[] = "set_volume"; static const char __pyx_k_get_endevent[] = "get_endevent"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_set_endevent[] = "set_endevent"; static const char __pyx_k_Not_implemented[] = "Not implemented."; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_mixer_music[] = "pygame_sdl2.mixer_music"; static const char __pyx_k_src_pygame_sdl2_mixer_music_pyx[] = "src/pygame_sdl2/mixer_music.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_2play(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loops, double __pyx_v_start); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_4rewind(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_6stop(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_8pause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_10unpause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_12fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_14set_volume(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_16get_volume(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_18get_busy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_20set_pos(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_22get_pos(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_24queue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_26set_endevent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_28get_endevent(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_u_; PyObject *__pyx_kp_s_Not_implemented; PyObject *__pyx_n_s__24; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_fadeout; PyObject *__pyx_n_s_fi; PyObject *__pyx_n_s_get_busy; PyObject *__pyx_n_s_get_endevent; PyObject *__pyx_n_s_get_pos; PyObject *__pyx_n_s_get_volume; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_load; PyObject *__pyx_n_s_loops; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_pause; PyObject *__pyx_n_s_play; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_mixer_music; PyObject *__pyx_n_s_queue; PyObject *__pyx_n_s_rewind; PyObject *__pyx_n_s_set_endevent; PyObject *__pyx_n_s_set_pos; PyObject *__pyx_n_s_set_volume; PyObject *__pyx_kp_s_src_pygame_sdl2_mixer_music_pyx; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_stop; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_time; PyObject *__pyx_n_s_type; PyObject *__pyx_n_s_unpause; PyObject *__pyx_n_s_value; PyObject *__pyx_int_0; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__22; PyObject *__pyx_codeobj__3; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_kp_s_Not_implemented); Py_CLEAR(clear_module_state->__pyx_n_s__24); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_fadeout); Py_CLEAR(clear_module_state->__pyx_n_s_fi); Py_CLEAR(clear_module_state->__pyx_n_s_get_busy); Py_CLEAR(clear_module_state->__pyx_n_s_get_endevent); Py_CLEAR(clear_module_state->__pyx_n_s_get_pos); Py_CLEAR(clear_module_state->__pyx_n_s_get_volume); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_load); Py_CLEAR(clear_module_state->__pyx_n_s_loops); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_pause); Py_CLEAR(clear_module_state->__pyx_n_s_play); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_mixer_music); Py_CLEAR(clear_module_state->__pyx_n_s_queue); Py_CLEAR(clear_module_state->__pyx_n_s_rewind); Py_CLEAR(clear_module_state->__pyx_n_s_set_endevent); Py_CLEAR(clear_module_state->__pyx_n_s_set_pos); Py_CLEAR(clear_module_state->__pyx_n_s_set_volume); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_mixer_music_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_stop); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_time); Py_CLEAR(clear_module_state->__pyx_n_s_type); Py_CLEAR(clear_module_state->__pyx_n_s_unpause); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_codeobj__3); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_kp_s_Not_implemented); Py_VISIT(traverse_module_state->__pyx_n_s__24); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_fadeout); Py_VISIT(traverse_module_state->__pyx_n_s_fi); Py_VISIT(traverse_module_state->__pyx_n_s_get_busy); Py_VISIT(traverse_module_state->__pyx_n_s_get_endevent); Py_VISIT(traverse_module_state->__pyx_n_s_get_pos); Py_VISIT(traverse_module_state->__pyx_n_s_get_volume); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_load); Py_VISIT(traverse_module_state->__pyx_n_s_loops); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_pause); Py_VISIT(traverse_module_state->__pyx_n_s_play); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_mixer_music); Py_VISIT(traverse_module_state->__pyx_n_s_queue); Py_VISIT(traverse_module_state->__pyx_n_s_rewind); Py_VISIT(traverse_module_state->__pyx_n_s_set_endevent); Py_VISIT(traverse_module_state->__pyx_n_s_set_pos); Py_VISIT(traverse_module_state->__pyx_n_s_set_volume); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_mixer_music_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_stop); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_time); Py_VISIT(traverse_module_state->__pyx_n_s_type); Py_VISIT(traverse_module_state->__pyx_n_s_unpause); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_codeobj__3); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_kp_s_Not_implemented __pyx_mstate_global->__pyx_kp_s_Not_implemented #define __pyx_n_s__24 __pyx_mstate_global->__pyx_n_s__24 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_fadeout __pyx_mstate_global->__pyx_n_s_fadeout #define __pyx_n_s_fi __pyx_mstate_global->__pyx_n_s_fi #define __pyx_n_s_get_busy __pyx_mstate_global->__pyx_n_s_get_busy #define __pyx_n_s_get_endevent __pyx_mstate_global->__pyx_n_s_get_endevent #define __pyx_n_s_get_pos __pyx_mstate_global->__pyx_n_s_get_pos #define __pyx_n_s_get_volume __pyx_mstate_global->__pyx_n_s_get_volume #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_load __pyx_mstate_global->__pyx_n_s_load #define __pyx_n_s_loops __pyx_mstate_global->__pyx_n_s_loops #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_pause __pyx_mstate_global->__pyx_n_s_pause #define __pyx_n_s_play __pyx_mstate_global->__pyx_n_s_play #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_mixer_music __pyx_mstate_global->__pyx_n_s_pygame_sdl2_mixer_music #define __pyx_n_s_queue __pyx_mstate_global->__pyx_n_s_queue #define __pyx_n_s_rewind __pyx_mstate_global->__pyx_n_s_rewind #define __pyx_n_s_set_endevent __pyx_mstate_global->__pyx_n_s_set_endevent #define __pyx_n_s_set_pos __pyx_mstate_global->__pyx_n_s_set_pos #define __pyx_n_s_set_volume __pyx_mstate_global->__pyx_n_s_set_volume #define __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_mixer_music_pyx #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time #define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type #define __pyx_n_s_unpause __pyx_mstate_global->__pyx_n_s_unpause #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 /* #### Code section: module_code ### */ /* "pygame_sdl2/mixer_music.pyx":30 * cdef int endevent = 0 * * cdef void music_finished() noexcept: # <<<<<<<<<<<<<< * global queued_music * if queued_music: */ static void __pyx_f_11pygame_sdl2_11mixer_music_music_finished(void) { SDL_Event __pyx_v_e; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("music_finished", 1); /* "pygame_sdl2/mixer_music.pyx":32 * cdef void music_finished() noexcept: * global queued_music * if queued_music: # <<<<<<<<<<<<<< * load(queued_music) * play() */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 32, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":33 * global queued_music * if queued_music: * load(queued_music) # <<<<<<<<<<<<<< * play() * queued_music = None */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_load); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_11pygame_sdl2_11mixer_music_queued_music}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer_music.pyx":34 * if queued_music: * load(queued_music) * play() # <<<<<<<<<<<<<< * queued_music = None * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_play); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer_music.pyx":35 * load(queued_music) * play() * queued_music = None # <<<<<<<<<<<<<< * * cdef SDL_Event e */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11mixer_music_queued_music, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer_music.pyx":32 * cdef void music_finished() noexcept: * global queued_music * if queued_music: # <<<<<<<<<<<<<< * load(queued_music) * play() */ } /* "pygame_sdl2/mixer_music.pyx":38 * * cdef SDL_Event e * if endevent != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent */ __pyx_t_1 = (__pyx_v_11pygame_sdl2_11mixer_music_endevent != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":39 * cdef SDL_Event e * if endevent != 0: * memset(&e, 0, sizeof(SDL_Event)) # <<<<<<<<<<<<<< * e.type = endevent * SDL_PushEvent(&e) */ (void)(memset((&__pyx_v_e), 0, (sizeof(SDL_Event)))); /* "pygame_sdl2/mixer_music.pyx":40 * if endevent != 0: * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent # <<<<<<<<<<<<<< * SDL_PushEvent(&e) * */ __pyx_v_e.type = __pyx_v_11pygame_sdl2_11mixer_music_endevent; /* "pygame_sdl2/mixer_music.pyx":41 * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent * SDL_PushEvent(&e) # <<<<<<<<<<<<<< * * */ (void)(SDL_PushEvent((&__pyx_v_e))); /* "pygame_sdl2/mixer_music.pyx":38 * * cdef SDL_Event e * if endevent != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent */ } /* "pygame_sdl2/mixer_music.pyx":30 * cdef int endevent = 0 * * cdef void music_finished() noexcept: # <<<<<<<<<<<<<< * global queued_music * if queued_music: */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_WriteUnraisable("pygame_sdl2.mixer_music.music_finished", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_1load(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_load, "load(fi)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_1load = {"load", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_1load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_load}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_1load(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fi = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load") < 0)) __PYX_ERR(0, 44, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fi = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 44, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_load(__pyx_self, __pyx_v_fi); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; SDL_RWops *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 1); /* "pygame_sdl2/mixer_music.pyx":48 * * # Free any previously loaded music. * if current_music != NULL: # <<<<<<<<<<<<<< * Mix_FreeMusic(current_music) * */ __pyx_t_1 = (__pyx_v_11pygame_sdl2_11mixer_music_current_music != NULL); if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":49 * # Free any previously loaded music. * if current_music != NULL: * Mix_FreeMusic(current_music) # <<<<<<<<<<<<<< * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) */ Mix_FreeMusic(__pyx_v_11pygame_sdl2_11mixer_music_current_music); /* "pygame_sdl2/mixer_music.pyx":48 * * # Free any previously loaded music. * if current_music != NULL: # <<<<<<<<<<<<<< * Mix_FreeMusic(current_music) * */ } /* "pygame_sdl2/mixer_music.pyx":51 * Mix_FreeMusic(current_music) * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) # <<<<<<<<<<<<<< * if current_music == NULL: * raise error() */ __pyx_t_2 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_2 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 51, __pyx_L1_error) __pyx_v_11pygame_sdl2_11mixer_music_current_music = Mix_LoadMUS_RW(__pyx_t_2, 1); /* "pygame_sdl2/mixer_music.pyx":52 * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) * if current_music == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_11pygame_sdl2_11mixer_music_current_music == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/mixer_music.pyx":53 * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) * if current_music == NULL: * raise error() # <<<<<<<<<<<<<< * * def play(loops=0, double start=0.0): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 53, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":52 * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) * if current_music == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer_music.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_3play(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_2play, "play(loops=0, double start=0.0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_3play = {"play", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_3play, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_2play}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_3play(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_loops = 0; double __pyx_v_start; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loops,&__pyx_n_s_start,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loops); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "play") < 0)) __PYX_ERR(0, 55, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loops = values[0]; if (values[1]) { __pyx_v_start = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_start == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) } else { __pyx_v_start = ((double)((double)0.0)); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 55, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_2play(__pyx_self, __pyx_v_loops, __pyx_v_start); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_2play(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loops, double __pyx_v_start) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("play", 1); /* "pygame_sdl2/mixer_music.pyx":56 * * def play(loops=0, double start=0.0): * Mix_FadeInMusicPos(current_music, loops, 0, start) # <<<<<<<<<<<<<< * * def rewind(): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error) (void)(Mix_FadeInMusicPos(__pyx_v_11pygame_sdl2_11mixer_music_current_music, __pyx_t_1, 0, __pyx_v_start)); /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":58 * Mix_FadeInMusicPos(current_music, loops, 0, start) * * def rewind(): # <<<<<<<<<<<<<< * Mix_RewindMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_5rewind(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_4rewind, "rewind()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_5rewind = {"rewind", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_5rewind, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_4rewind}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_5rewind(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rewind (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_4rewind(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_4rewind(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rewind", 1); /* "pygame_sdl2/mixer_music.pyx":59 * * def rewind(): * Mix_RewindMusic() # <<<<<<<<<<<<<< * * def stop(): */ Mix_RewindMusic(); /* "pygame_sdl2/mixer_music.pyx":58 * Mix_FadeInMusicPos(current_music, loops, 0, start) * * def rewind(): # <<<<<<<<<<<<<< * Mix_RewindMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_7stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_6stop, "stop()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_7stop = {"stop", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_7stop, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_6stop}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_7stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_6stop(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_6stop(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 1); /* "pygame_sdl2/mixer_music.pyx":62 * * def stop(): * Mix_HaltMusic() # <<<<<<<<<<<<<< * * def pause(): */ (void)(Mix_HaltMusic()); /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_9pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_8pause, "pause()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_9pause = {"pause", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_9pause, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_8pause}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_9pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_8pause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_8pause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause", 1); /* "pygame_sdl2/mixer_music.pyx":65 * * def pause(): * Mix_PauseMusic() # <<<<<<<<<<<<<< * * def unpause(): */ Mix_PauseMusic(); /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_11unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_10unpause, "unpause()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_11unpause = {"unpause", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_11unpause, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_10unpause}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_11unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_10unpause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_10unpause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause", 1); /* "pygame_sdl2/mixer_music.pyx":68 * * def unpause(): * Mix_ResumeMusic() # <<<<<<<<<<<<<< * * def fadeout(time): */ Mix_ResumeMusic(); /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_13fadeout(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_12fadeout, "fadeout(time)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_13fadeout = {"fadeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_13fadeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_12fadeout}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_13fadeout(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_time = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fadeout") < 0)) __PYX_ERR(0, 70, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_time = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fadeout", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 70, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_12fadeout(__pyx_self, __pyx_v_time); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_12fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 1); /* "pygame_sdl2/mixer_music.pyx":71 * * def fadeout(time): * Mix_FadeOutMusic(time) # <<<<<<<<<<<<<< * * def set_volume(double value): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) (void)(Mix_FadeOutMusic(__pyx_t_1)); /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_15set_volume(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_14set_volume, "set_volume(double value)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_15set_volume = {"set_volume", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_15set_volume, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_14set_volume}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_15set_volume(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { double __pyx_v_value; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_volume") < 0)) __PYX_ERR(0, 73, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_value = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_volume", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 73, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_14set_volume(__pyx_self, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_14set_volume(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume", 1); /* "pygame_sdl2/mixer_music.pyx":74 * * def set_volume(double value): * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) # <<<<<<<<<<<<<< * * def get_volume(): */ (void)(Mix_VolumeMusic(((int)(MIX_MAX_VOLUME * __pyx_v_value)))); /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_17get_volume(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_16get_volume, "get_volume()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_17get_volume = {"get_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_17get_volume, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_16get_volume}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_17get_volume(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_volume (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_16get_volume(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_16get_volume(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_volume", 1); /* "pygame_sdl2/mixer_music.pyx":77 * * def get_volume(): * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME # <<<<<<<<<<<<<< * * def get_busy(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = Mix_VolumeMusic(-1); if (unlikely(((double)MIX_MAX_VOLUME) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 77, __pyx_L1_error) } __pyx_t_2 = PyFloat_FromDouble((((double)__pyx_t_1) / ((double)MIX_MAX_VOLUME))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_19get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_18get_busy, "get_busy()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_19get_busy = {"get_busy", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_19get_busy, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_18get_busy}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_19get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_busy (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_18get_busy(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_18get_busy(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_busy", 1); /* "pygame_sdl2/mixer_music.pyx":80 * * def get_busy(): * return Mix_PlayingMusic() # <<<<<<<<<<<<<< * * def set_pos(double pos): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(Mix_PlayingMusic()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_busy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_21set_pos(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_20set_pos, "set_pos(double pos)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_21set_pos = {"set_pos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_21set_pos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_20set_pos}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_21set_pos(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { double __pyx_v_pos; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_pos (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_pos") < 0)) __PYX_ERR(0, 82, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pos = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_pos == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_pos", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 82, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_20set_pos(__pyx_self, __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_20set_pos(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_pos) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_pos", 1); /* "pygame_sdl2/mixer_music.pyx":83 * * def set_pos(double pos): * Mix_SetMusicPosition(pos) # <<<<<<<<<<<<<< * * def get_pos(): */ (void)(Mix_SetMusicPosition(__pyx_v_pos)); /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_23get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_22get_pos, "get_pos()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_23get_pos = {"get_pos", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_23get_pos, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_22get_pos}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_23get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pos (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_22get_pos(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_22get_pos(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pos", 1); /* "pygame_sdl2/mixer_music.pyx":87 * def get_pos(): * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def queue(fi): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Not_implemented}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 87, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_25queue(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_24queue, "queue(fi)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_25queue = {"queue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_25queue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_24queue}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_25queue(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fi = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("queue (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "queue") < 0)) __PYX_ERR(0, 89, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fi = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("queue", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 89, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_24queue(__pyx_self, __pyx_v_fi); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_24queue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("queue", 1); /* "pygame_sdl2/mixer_music.pyx":90 * * def queue(fi): * Mix_HookMusicFinished(music_finished) # <<<<<<<<<<<<<< * if get_busy(): * global queued_music */ Mix_HookMusicFinished(__pyx_f_11pygame_sdl2_11mixer_music_music_finished); /* "pygame_sdl2/mixer_music.pyx":91 * def queue(fi): * Mix_HookMusicFinished(music_finished) * if get_busy(): # <<<<<<<<<<<<<< * global queued_music * queued_music = fi */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_busy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/mixer_music.pyx":93 * if get_busy(): * global queued_music * queued_music = fi # <<<<<<<<<<<<<< * else: * load(fi) */ __Pyx_INCREF(__pyx_v_fi); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11mixer_music_queued_music, __pyx_v_fi); __Pyx_GIVEREF(__pyx_v_fi); /* "pygame_sdl2/mixer_music.pyx":91 * def queue(fi): * Mix_HookMusicFinished(music_finished) * if get_busy(): # <<<<<<<<<<<<<< * global queued_music * queued_music = fi */ goto __pyx_L3; } /* "pygame_sdl2/mixer_music.pyx":95 * queued_music = fi * else: * load(fi) # <<<<<<<<<<<<<< * play() * */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_load); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_fi}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer_music.pyx":96 * else: * load(fi) * play() # <<<<<<<<<<<<<< * * def set_endevent(type=None): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_play); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer_music.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_27set_endevent(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_26set_endevent, "set_endevent(type=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_27set_endevent = {"set_endevent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11mixer_music_27set_endevent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11mixer_music_26set_endevent}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_27set_endevent(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_endevent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_endevent") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_endevent", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_26set_endevent(__pyx_self, __pyx_v_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_26set_endevent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_endevent", 1); /* "pygame_sdl2/mixer_music.pyx":99 * * def set_endevent(type=None): * Mix_HookMusicFinished(music_finished) # <<<<<<<<<<<<<< * global endevent * endevent = type or 0 */ Mix_HookMusicFinished(__pyx_f_11pygame_sdl2_11mixer_music_music_finished); /* "pygame_sdl2/mixer_music.pyx":101 * Mix_HookMusicFinished(music_finished) * global endevent * endevent = type or 0 # <<<<<<<<<<<<<< * * def get_endevent(): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_type); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 101, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_type); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } __pyx_t_1 = 0; __pyx_L3_bool_binop_done:; __pyx_v_11pygame_sdl2_11mixer_music_endevent = __pyx_t_1; /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_29get_endevent(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11mixer_music_28get_endevent, "get_endevent()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_29get_endevent = {"get_endevent", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_29get_endevent, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_28get_endevent}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_29get_endevent(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_endevent (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_28get_endevent(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_28get_endevent(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_endevent", 1); /* "pygame_sdl2/mixer_music.pyx":104 * * def get_endevent(): * return endevent # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_11pygame_sdl2_11mixer_music_endevent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {"rewind", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_5rewind, METH_NOARGS, __pyx_doc_11pygame_sdl2_11mixer_music_4rewind}, {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0}, {&__pyx_n_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_fadeout, __pyx_k_fadeout, sizeof(__pyx_k_fadeout), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_get_busy, __pyx_k_get_busy, sizeof(__pyx_k_get_busy), 0, 0, 1, 1}, {&__pyx_n_s_get_endevent, __pyx_k_get_endevent, sizeof(__pyx_k_get_endevent), 0, 0, 1, 1}, {&__pyx_n_s_get_pos, __pyx_k_get_pos, sizeof(__pyx_k_get_pos), 0, 0, 1, 1}, {&__pyx_n_s_get_volume, __pyx_k_get_volume, sizeof(__pyx_k_get_volume), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1}, {&__pyx_n_s_loops, __pyx_k_loops, sizeof(__pyx_k_loops), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pause, __pyx_k_pause, sizeof(__pyx_k_pause), 0, 0, 1, 1}, {&__pyx_n_s_play, __pyx_k_play, sizeof(__pyx_k_play), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mixer_music, __pyx_k_pygame_sdl2_mixer_music, sizeof(__pyx_k_pygame_sdl2_mixer_music), 0, 0, 1, 1}, {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, {&__pyx_n_s_rewind, __pyx_k_rewind, sizeof(__pyx_k_rewind), 0, 0, 1, 1}, {&__pyx_n_s_set_endevent, __pyx_k_set_endevent, sizeof(__pyx_k_set_endevent), 0, 0, 1, 1}, {&__pyx_n_s_set_pos, __pyx_k_set_pos, sizeof(__pyx_k_set_pos), 0, 0, 1, 1}, {&__pyx_n_s_set_volume, __pyx_k_set_volume, sizeof(__pyx_k_set_volume), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_k_src_pygame_sdl2_mixer_music_pyx, sizeof(__pyx_k_src_pygame_sdl2_mixer_music_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_unpause, __pyx_k_unpause, sizeof(__pyx_k_unpause), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { return 0; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_fi); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_load, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 44, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_loops, __pyx_n_s_start); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_play, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 55, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":58 * Mix_FadeInMusicPos(current_music, loops, 0, start) * * def rewind(): # <<<<<<<<<<<<<< * Mix_RewindMusic() * */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_rewind, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 58, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_stop, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 61, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_pause, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 64, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_unpause, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 67, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_time); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_fadeout, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 70, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_set_volume, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 73, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_volume, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 76, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_busy, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 79, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_set_pos, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 82, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_pos, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 85, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_queue, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 89, __pyx_L1_error) /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_type); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_set_endevent, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_tuple__22 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_endevent, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_11mixer_music_queued_music = Py_None; Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_mixer_music(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_mixer_music}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "mixer_music", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initmixer_music(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initmixer_music(void) #else __Pyx_PyMODINIT_FUNC PyInit_mixer_music(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_mixer_music(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_mixer_music(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'mixer_music' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("mixer_music", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "mixer_music" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_mixer_music(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__mixer_music) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.mixer_music")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.mixer_music", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/mixer_music.pyx":24 * from libc.string cimport memset * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * cdef Mix_Music *current_music = NULL */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 24, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":26 * from pygame_sdl2.error import error * * cdef Mix_Music *current_music = NULL # <<<<<<<<<<<<<< * cdef object queued_music = None * cdef int endevent = 0 */ __pyx_v_11pygame_sdl2_11mixer_music_current_music = NULL; /* "pygame_sdl2/mixer_music.pyx":27 * * cdef Mix_Music *current_music = NULL * cdef object queued_music = None # <<<<<<<<<<<<<< * cdef int endevent = 0 * */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11mixer_music_queued_music, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer_music.pyx":28 * cdef Mix_Music *current_music = NULL * cdef object queued_music = None * cdef int endevent = 0 # <<<<<<<<<<<<<< * * cdef void music_finished() noexcept: */ __pyx_v_11pygame_sdl2_11mixer_music_endevent = 0; /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_1load, 0, __pyx_n_s_load, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_load, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ __pyx_t_3 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_int_0)); __Pyx_GIVEREF(((PyObject *)__pyx_int_0)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_int_0))) __PYX_ERR(0, 55, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_3play, 0, __pyx_n_s_play, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_play, __pyx_t_3) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":58 * Mix_FadeInMusicPos(current_music, loops, 0, start) * * def rewind(): # <<<<<<<<<<<<<< * Mix_RewindMusic() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_5rewind, 0, __pyx_n_s_rewind, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rewind, __pyx_t_3) < 0) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_7stop, 0, __pyx_n_s_stop, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop, __pyx_t_3) < 0) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_9pause, 0, __pyx_n_s_pause, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pause, __pyx_t_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_11unpause, 0, __pyx_n_s_unpause, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpause, __pyx_t_3) < 0) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_13fadeout, 0, __pyx_n_s_fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_fadeout, __pyx_t_3) < 0) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_15set_volume, 0, __pyx_n_s_set_volume, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_volume, __pyx_t_3) < 0) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_17get_volume, 0, __pyx_n_s_get_volume, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_volume, __pyx_t_3) < 0) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_19get_busy, 0, __pyx_n_s_get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_busy, __pyx_t_3) < 0) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_21set_pos, 0, __pyx_n_s_set_pos, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pos, __pyx_t_3) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_23get_pos, 0, __pyx_n_s_get_pos, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pos, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_25queue, 0, __pyx_n_s_queue, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue, __pyx_t_3) < 0) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_27set_endevent, 0, __pyx_n_s_set_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__22); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_endevent, __pyx_t_3) < 0) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11mixer_music_29get_endevent, 0, __pyx_n_s_get_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer_music, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_endevent, __pyx_t_3) < 0) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.mixer_music", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.mixer_music"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); else state = (PyGILState_STATE)0; #endif CYTHON_UNUSED_VAR(clineno); CYTHON_UNUSED_VAR(lineno); CYTHON_UNUSED_VAR(filename); CYTHON_MAYBE_UNUSED_VAR(nogil); __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(0); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__24); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12 #define __PYX_HAVE_RT_ImportFunction_3_0_12 static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635911.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.mouse.c0000664000175000017500000137553115026112607020240 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__mouse #define __PYX_HAVE_API__pygame_sdl2__mouse /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "", "src/pygame_sdl2/mouse.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/mouse.pyx":75 * active_cursor = False * * cdef class ColorCursor(object): # <<<<<<<<<<<<<< * * cdef SDL_Cursor *cursor */ struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor { PyObject_HEAD SDL_Cursor *cursor; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 #define __PYX_HAVE_RT_ImportType_proto_3_0_12 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_12 { __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* VoidPtrImport.proto */ static int __Pyx_ImportVoidPtr_3_0_12(PyObject *module, const char *name, void **p, const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.display" */ static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from "pygame_sdl2.mouse" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.mouse" extern int __pyx_module_is_main_pygame_sdl2__mouse; int __pyx_module_is_main_pygame_sdl2__mouse = 0; /* Implementation of "pygame_sdl2.mouse" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k__22[] = "?"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_reset[] = "reset"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_get_pos[] = "get_pos"; static const char __pyx_k_get_rel[] = "get_rel"; static const char __pyx_k_hotspot[] = "hotspot"; static const char __pyx_k_set_pos[] = "set_pos"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_visible[] = "visible"; static const char __pyx_k_activate[] = "activate"; static const char __pyx_k_andmasks[] = "andmasks"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_xormasks[] = "xormasks"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_get_cursor[] = "get_cursor"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_set_cursor[] = "set_cursor"; static const char __pyx_k_ColorCursor[] = "ColorCursor"; static const char __pyx_k_get_focused[] = "get_focused"; static const char __pyx_k_get_pressed[] = "get_pressed"; static const char __pyx_k_set_visible[] = "set_visible"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_active_cursor[] = "active_cursor"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_pygame_sdl2_mouse[] = "pygame_sdl2.mouse"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_ColorCursor_activate[] = "ColorCursor.activate"; static const char __pyx_k_src_pygame_sdl2_mouse_pyx[] = "src/pygame_sdl2/mouse.pyx"; static const char __pyx_k_ColorCursor___reduce_cython[] = "ColorCursor.__reduce_cython__"; static const char __pyx_k_ColorCursor___setstate_cython[] = "ColorCursor.__setstate_cython__"; static const char __pyx_k_self_cursor_cannot_be_converted[] = "self.cursor cannot be converted to a Python object for pickling"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_4reset(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_6get_pressed(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_8get_pos(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_10get_rel(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_12set_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_14set_visible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_visible); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_16get_focused(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_18set_cursor(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_hotspot, CYTHON_UNUSED PyObject *__pyx_v_xormasks, CYTHON_UNUSED PyObject *__pyx_v_andmasks); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_20get_cursor(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor___init__(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static void __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_2__dealloc__(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_4activate(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_5mouse_ColorCursor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window; #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_5mouse_ColorCursor; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor; PyObject *__pyx_n_s_ColorCursor; PyObject *__pyx_n_s_ColorCursor___reduce_cython; PyObject *__pyx_n_s_ColorCursor___setstate_cython; PyObject *__pyx_n_s_ColorCursor_activate; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s__22; PyObject *__pyx_n_s_activate; PyObject *__pyx_n_s_active_cursor; PyObject *__pyx_n_s_andmasks; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_cursor; PyObject *__pyx_n_s_get_focused; PyObject *__pyx_n_s_get_pos; PyObject *__pyx_n_s_get_pressed; PyObject *__pyx_n_s_get_rel; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_hotspot; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_pygame_sdl2_mouse; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_reset; PyObject *__pyx_n_s_self; PyObject *__pyx_kp_s_self_cursor_cannot_be_converted; PyObject *__pyx_n_s_set_cursor; PyObject *__pyx_n_s_set_pos; PyObject *__pyx_n_s_set_visible; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_size; PyObject *__pyx_kp_s_src_pygame_sdl2_mouse_pyx; PyObject *__pyx_n_s_state; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_visible; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_xormasks; PyObject *__pyx_n_s_y; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_codeobj_; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__20; PyObject *__pyx_codeobj__2; PyObject *__pyx_codeobj__3; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_5mouse_ColorCursor); Py_CLEAR(clear_module_state->__pyx_n_s_ColorCursor); Py_CLEAR(clear_module_state->__pyx_n_s_ColorCursor___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_ColorCursor___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_ColorCursor_activate); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s__22); Py_CLEAR(clear_module_state->__pyx_n_s_activate); Py_CLEAR(clear_module_state->__pyx_n_s_active_cursor); Py_CLEAR(clear_module_state->__pyx_n_s_andmasks); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_cursor); Py_CLEAR(clear_module_state->__pyx_n_s_get_focused); Py_CLEAR(clear_module_state->__pyx_n_s_get_pos); Py_CLEAR(clear_module_state->__pyx_n_s_get_pressed); Py_CLEAR(clear_module_state->__pyx_n_s_get_rel); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_hotspot); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_mouse); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_reset); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_kp_s_self_cursor_cannot_be_converted); Py_CLEAR(clear_module_state->__pyx_n_s_set_cursor); Py_CLEAR(clear_module_state->__pyx_n_s_set_pos); Py_CLEAR(clear_module_state->__pyx_n_s_set_visible); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_mouse_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_visible); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_xormasks); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_codeobj_); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_codeobj__2); Py_CLEAR(clear_module_state->__pyx_codeobj__3); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_5mouse_ColorCursor); Py_VISIT(traverse_module_state->__pyx_n_s_ColorCursor); Py_VISIT(traverse_module_state->__pyx_n_s_ColorCursor___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_ColorCursor___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_ColorCursor_activate); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s__22); Py_VISIT(traverse_module_state->__pyx_n_s_activate); Py_VISIT(traverse_module_state->__pyx_n_s_active_cursor); Py_VISIT(traverse_module_state->__pyx_n_s_andmasks); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_cursor); Py_VISIT(traverse_module_state->__pyx_n_s_get_focused); Py_VISIT(traverse_module_state->__pyx_n_s_get_pos); Py_VISIT(traverse_module_state->__pyx_n_s_get_pressed); Py_VISIT(traverse_module_state->__pyx_n_s_get_rel); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_hotspot); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_mouse); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_reset); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_kp_s_self_cursor_cannot_be_converted); Py_VISIT(traverse_module_state->__pyx_n_s_set_cursor); Py_VISIT(traverse_module_state->__pyx_n_s_set_pos); Py_VISIT(traverse_module_state->__pyx_n_s_set_visible); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_mouse_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_visible); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_xormasks); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_codeobj_); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_codeobj__2); Py_VISIT(traverse_module_state->__pyx_codeobj__3); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7display_Window __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7display_Window #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_5mouse_ColorCursor __pyx_mstate_global->__pyx_type_11pygame_sdl2_5mouse_ColorCursor #endif #define __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor #define __pyx_n_s_ColorCursor __pyx_mstate_global->__pyx_n_s_ColorCursor #define __pyx_n_s_ColorCursor___reduce_cython __pyx_mstate_global->__pyx_n_s_ColorCursor___reduce_cython #define __pyx_n_s_ColorCursor___setstate_cython __pyx_mstate_global->__pyx_n_s_ColorCursor___setstate_cython #define __pyx_n_s_ColorCursor_activate __pyx_mstate_global->__pyx_n_s_ColorCursor_activate #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s__22 __pyx_mstate_global->__pyx_n_s__22 #define __pyx_n_s_activate __pyx_mstate_global->__pyx_n_s_activate #define __pyx_n_s_active_cursor __pyx_mstate_global->__pyx_n_s_active_cursor #define __pyx_n_s_andmasks __pyx_mstate_global->__pyx_n_s_andmasks #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_cursor __pyx_mstate_global->__pyx_n_s_get_cursor #define __pyx_n_s_get_focused __pyx_mstate_global->__pyx_n_s_get_focused #define __pyx_n_s_get_pos __pyx_mstate_global->__pyx_n_s_get_pos #define __pyx_n_s_get_pressed __pyx_mstate_global->__pyx_n_s_get_pressed #define __pyx_n_s_get_rel __pyx_mstate_global->__pyx_n_s_get_rel #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_hotspot __pyx_mstate_global->__pyx_n_s_hotspot #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_pygame_sdl2_mouse __pyx_mstate_global->__pyx_n_s_pygame_sdl2_mouse #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_reset __pyx_mstate_global->__pyx_n_s_reset #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_kp_s_self_cursor_cannot_be_converted __pyx_mstate_global->__pyx_kp_s_self_cursor_cannot_be_converted #define __pyx_n_s_set_cursor __pyx_mstate_global->__pyx_n_s_set_cursor #define __pyx_n_s_set_pos __pyx_mstate_global->__pyx_n_s_set_pos #define __pyx_n_s_set_visible __pyx_mstate_global->__pyx_n_s_set_visible #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_kp_s_src_pygame_sdl2_mouse_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_mouse_pyx #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_visible __pyx_mstate_global->__pyx_n_s_visible #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_xormasks __pyx_mstate_global->__pyx_n_s_xormasks #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_ #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 /* #### Code section: module_code ### */ /* "pygame_sdl2/mouse.pyx":23 * from pygame_sdl2.surface cimport Surface * * def init(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_init}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/mouse.pyx":25 * def init(): * global active_cursor * active_cursor = None # <<<<<<<<<<<<<< * * def quit(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_active_cursor, Py_None) < 0) __PYX_ERR(1, 25, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":23 * from pygame_sdl2.surface cimport Surface * * def init(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":27 * active_cursor = None * * def quit(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_2quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_3quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_2quit}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/mouse.pyx":29 * def quit(): * global active_cursor * active_cursor = None # <<<<<<<<<<<<<< * * def reset(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_active_cursor, Py_None) < 0) __PYX_ERR(1, 29, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":27 * active_cursor = None * * def quit(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.quit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":31 * active_cursor = None * * def reset(): # <<<<<<<<<<<<<< * SDL_SetCursor(SDL_GetDefaultCursor()) * global active_cursor */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_5reset(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_4reset, "reset()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_5reset = {"reset", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_5reset, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_4reset}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_5reset(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_4reset(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_4reset(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 1); /* "pygame_sdl2/mouse.pyx":32 * * def reset(): * SDL_SetCursor(SDL_GetDefaultCursor()) # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ SDL_SetCursor(SDL_GetDefaultCursor()); /* "pygame_sdl2/mouse.pyx":34 * SDL_SetCursor(SDL_GetDefaultCursor()) * global active_cursor * active_cursor = None # <<<<<<<<<<<<<< * * def get_pressed(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_active_cursor, Py_None) < 0) __PYX_ERR(1, 34, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":31 * active_cursor = None * * def reset(): # <<<<<<<<<<<<<< * SDL_SetCursor(SDL_GetDefaultCursor()) * global active_cursor */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":36 * active_cursor = None * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_7get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_6get_pressed, "get_pressed()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_7get_pressed = {"get_pressed", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_7get_pressed, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_6get_pressed}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_7get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pressed (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_6get_pressed(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_6get_pressed(CYTHON_UNUSED PyObject *__pyx_self) { Uint32 __pyx_v_state; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pressed", 1); /* "pygame_sdl2/mouse.pyx":37 * * def get_pressed(): * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) # <<<<<<<<<<<<<< * return (1 if state & SDL_BUTTON_LMASK else 0, * 1 if state & SDL_BUTTON_MMASK else 0, */ __pyx_v_state = SDL_GetMouseState(NULL, NULL); /* "pygame_sdl2/mouse.pyx":38 * def get_pressed(): * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if state & SDL_BUTTON_MMASK else 0, * 1 if state & SDL_BUTTON_RMASK else 0) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((__pyx_v_state & SDL_BUTTON_LMASK) != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_int_1); __pyx_t_1 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; } /* "pygame_sdl2/mouse.pyx":39 * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, * 1 if state & SDL_BUTTON_MMASK else 0, # <<<<<<<<<<<<<< * 1 if state & SDL_BUTTON_RMASK else 0) * */ __pyx_t_2 = ((__pyx_v_state & SDL_BUTTON_MMASK) != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_int_1); __pyx_t_3 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_3 = __pyx_int_0; } /* "pygame_sdl2/mouse.pyx":40 * return (1 if state & SDL_BUTTON_LMASK else 0, * 1 if state & SDL_BUTTON_MMASK else 0, * 1 if state & SDL_BUTTON_RMASK else 0) # <<<<<<<<<<<<<< * * def get_pos(): */ __pyx_t_2 = ((__pyx_v_state & SDL_BUTTON_RMASK) != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_int_1); __pyx_t_4 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_4 = __pyx_int_0; } /* "pygame_sdl2/mouse.pyx":38 * def get_pressed(): * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if state & SDL_BUTTON_MMASK else 0, * 1 if state & SDL_BUTTON_RMASK else 0) */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(1, 38, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(1, 38, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":36 * active_cursor = None * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mouse.get_pressed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":42 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_9get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_8get_pos, "get_pos()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_9get_pos = {"get_pos", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_9get_pos, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_8get_pos}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_9get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pos (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_8get_pos(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_8get_pos(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_x; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pos", 1); /* "pygame_sdl2/mouse.pyx":44 * def get_pos(): * cdef int x, y * SDL_GetMouseState(&x, &y) # <<<<<<<<<<<<<< * return (x, y) * */ (void)(SDL_GetMouseState((&__pyx_v_x), (&__pyx_v_y))); /* "pygame_sdl2/mouse.pyx":45 * cdef int x, y * SDL_GetMouseState(&x, &y) * return (x, y) # <<<<<<<<<<<<<< * * def get_rel(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":42 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mouse.get_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":47 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetRelativeMouseState(&x, &y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11get_rel(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_10get_rel, "get_rel()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_11get_rel = {"get_rel", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_11get_rel, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_10get_rel}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11get_rel(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_rel (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_10get_rel(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_10get_rel(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_x; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_rel", 1); /* "pygame_sdl2/mouse.pyx":49 * def get_rel(): * cdef int x, y * SDL_GetRelativeMouseState(&x, &y) # <<<<<<<<<<<<<< * return (x, y) * */ (void)(SDL_GetRelativeMouseState((&__pyx_v_x), (&__pyx_v_y))); /* "pygame_sdl2/mouse.pyx":50 * cdef int x, y * SDL_GetRelativeMouseState(&x, &y) * return (x, y) # <<<<<<<<<<<<<< * * def set_pos(pos): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 50, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":47 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetRelativeMouseState(&x, &y) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mouse.get_rel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":52 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_13set_pos(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_12set_pos, "set_pos(pos)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_13set_pos = {"set_pos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_13set_pos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_12set_pos}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_13set_pos(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pos = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_pos (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 52, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_pos") < 0)) __PYX_ERR(1, 52, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pos = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_pos", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 52, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mouse.set_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_12set_pos(__pyx_self, __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_12set_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_pos", 1); /* "pygame_sdl2/mouse.pyx":53 * * def set_pos(pos): * (x, y) = pos # <<<<<<<<<<<<<< * SDL_WarpMouseInWindow(NULL, x, y) * */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(1, 53, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(1, 53, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(1, 53, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":54 * def set_pos(pos): * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) # <<<<<<<<<<<<<< * * def set_visible(visible): */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 54, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 54, __pyx_L1_error) SDL_WarpMouseInWindow(NULL, __pyx_t_5, __pyx_t_6); /* "pygame_sdl2/mouse.pyx":52 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mouse.set_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":56 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_15set_visible(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_14set_visible, "set_visible(visible)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_15set_visible = {"set_visible", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_15set_visible, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_14set_visible}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_15set_visible(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_visible = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_visible (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_visible,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_visible)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_visible") < 0)) __PYX_ERR(1, 56, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_visible = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_visible", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 56, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mouse.set_visible", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_14set_visible(__pyx_self, __pyx_v_visible); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_14set_visible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_visible) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; SDL_bool __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_visible", 1); /* "pygame_sdl2/mouse.pyx":57 * * def set_visible(visible): * SDL_ShowCursor(1 if visible else 0) # <<<<<<<<<<<<<< * * if SDL_GetWindowGrab(main_window.window) == SDL_ENABLE: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_visible); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 57, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_1 = 1; } else { __pyx_t_1 = 0; } (void)(SDL_ShowCursor(__pyx_t_1)); /* "pygame_sdl2/mouse.pyx":59 * SDL_ShowCursor(1 if visible else 0) * * if SDL_GetWindowGrab(main_window.window) == SDL_ENABLE: # <<<<<<<<<<<<<< * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) * */ __pyx_t_2 = (SDL_GetWindowGrab(__pyx_v_11pygame_sdl2_7display_main_window->window) == SDL_ENABLE); if (__pyx_t_2) { /* "pygame_sdl2/mouse.pyx":60 * * if SDL_GetWindowGrab(main_window.window) == SDL_ENABLE: * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) # <<<<<<<<<<<<<< * * def get_focused(): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_visible); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 60, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_3 = SDL_FALSE; } else { __pyx_t_3 = SDL_TRUE; } (void)(SDL_SetRelativeMouseMode(__pyx_t_3)); /* "pygame_sdl2/mouse.pyx":59 * SDL_ShowCursor(1 if visible else 0) * * if SDL_GetWindowGrab(main_window.window) == SDL_ENABLE: # <<<<<<<<<<<<<< * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) * */ } /* "pygame_sdl2/mouse.pyx":56 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.set_visible", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":62 * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_17get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_16get_focused, "get_focused()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_17get_focused = {"get_focused", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_17get_focused, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_16get_focused}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_17get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_focused (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_16get_focused(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_16get_focused(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_focused", 1); /* "pygame_sdl2/mouse.pyx":63 * * def get_focused(): * return SDL_GetMouseFocus() != NULL # <<<<<<<<<<<<<< * * def set_cursor(size, hotspot, xormasks, andmasks): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_GetMouseFocus() != NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":62 * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mouse.get_focused", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":65 * return SDL_GetMouseFocus() != NULL * * def set_cursor(size, hotspot, xormasks, andmasks): # <<<<<<<<<<<<<< * # Does anyone use this? SDL2 has much improved custom cursor support. * pass */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_19set_cursor(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_18set_cursor, "set_cursor(size, hotspot, xormasks, andmasks)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_19set_cursor = {"set_cursor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_19set_cursor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_18set_cursor}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_19set_cursor(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_size = 0; CYTHON_UNUSED PyObject *__pyx_v_hotspot = 0; CYTHON_UNUSED PyObject *__pyx_v_xormasks = 0; CYTHON_UNUSED PyObject *__pyx_v_andmasks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_cursor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_hotspot,&__pyx_n_s_xormasks,&__pyx_n_s_andmasks,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hotspot)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 1); __PYX_ERR(1, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xormasks)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 2); __PYX_ERR(1, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_andmasks)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 3); __PYX_ERR(1, 65, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_cursor") < 0)) __PYX_ERR(1, 65, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_size = values[0]; __pyx_v_hotspot = values[1]; __pyx_v_xormasks = values[2]; __pyx_v_andmasks = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 65, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mouse.set_cursor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_18set_cursor(__pyx_self, __pyx_v_size, __pyx_v_hotspot, __pyx_v_xormasks, __pyx_v_andmasks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_18set_cursor(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_hotspot, CYTHON_UNUSED PyObject *__pyx_v_xormasks, CYTHON_UNUSED PyObject *__pyx_v_andmasks) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_cursor", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":69 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_21get_cursor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_20get_cursor, "get_cursor()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_21get_cursor = {"get_cursor", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_21get_cursor, METH_NOARGS, __pyx_doc_11pygame_sdl2_5mouse_20get_cursor}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_21get_cursor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_cursor (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_20get_cursor(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_20get_cursor(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_cursor", 1); /* "pygame_sdl2/mouse.pyx":70 * * def get_cursor(): * return None # <<<<<<<<<<<<<< * * # The ColorCursor that is currently in use. */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":69 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":79 * cdef SDL_Cursor *cursor * * def __init__(self, Surface surface, x, y): # <<<<<<<<<<<<<< * self.cursor = SDL_CreateColorCursor(surface.surface, x, y) * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(1, 79, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(1, 79, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 79, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 79, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mouse.ColorCursor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(1, 79, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor___init__(((struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *)__pyx_v_self), __pyx_v_surface, __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor___init__(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/mouse.pyx":80 * * def __init__(self, Surface surface, x, y): * self.cursor = SDL_CreateColorCursor(surface.surface, x, y) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 80, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 80, __pyx_L1_error) __pyx_v_self->cursor = SDL_CreateColorCursor(__pyx_v_surface->surface, __pyx_t_1, __pyx_t_2); /* "pygame_sdl2/mouse.pyx":79 * cdef SDL_Cursor *cursor * * def __init__(self, Surface surface, x, y): # <<<<<<<<<<<<<< * self.cursor = SDL_CreateColorCursor(surface.surface, x, y) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.ColorCursor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/mouse.pyx":82 * self.cursor = SDL_CreateColorCursor(surface.surface, x, y) * * def __dealloc__(self): # <<<<<<<<<<<<<< * SDL_FreeCursor(self.cursor) * */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_2__dealloc__(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self) { /* "pygame_sdl2/mouse.pyx":83 * * def __dealloc__(self): * SDL_FreeCursor(self.cursor) # <<<<<<<<<<<<<< * * def activate(self): */ SDL_FreeCursor(__pyx_v_self->cursor); /* "pygame_sdl2/mouse.pyx":82 * self.cursor = SDL_CreateColorCursor(surface.surface, x, y) * * def __dealloc__(self): # <<<<<<<<<<<<<< * SDL_FreeCursor(self.cursor) * */ /* function exit code */ } /* "pygame_sdl2/mouse.pyx":85 * SDL_FreeCursor(self.cursor) * * def activate(self): # <<<<<<<<<<<<<< * global active_cursor * if active_cursor is not self: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_5activate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_4activate, "ColorCursor.activate(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_11ColorCursor_5activate = {"activate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_5activate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_4activate}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_5activate(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("activate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("activate", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "activate", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_4activate(((struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_4activate(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("activate", 1); /* "pygame_sdl2/mouse.pyx":87 * def activate(self): * global active_cursor * if active_cursor is not self: # <<<<<<<<<<<<<< * active_cursor = self * SDL_SetCursor(self.cursor) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_active_cursor); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 != ((PyObject *)__pyx_v_self)); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/mouse.pyx":88 * global active_cursor * if active_cursor is not self: * active_cursor = self # <<<<<<<<<<<<<< * SDL_SetCursor(self.cursor) * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_active_cursor, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(1, 88, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":89 * if active_cursor is not self: * active_cursor = self * SDL_SetCursor(self.cursor) # <<<<<<<<<<<<<< * */ SDL_SetCursor(__pyx_v_self->cursor); /* "pygame_sdl2/mouse.pyx":87 * def activate(self): * global active_cursor * if active_cursor is not self: # <<<<<<<<<<<<<< * active_cursor = self * SDL_SetCursor(self.cursor) */ } /* "pygame_sdl2/mouse.pyx":85 * SDL_FreeCursor(self.cursor) * * def activate(self): # <<<<<<<<<<<<<< * global active_cursor * if active_cursor is not self: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mouse.ColorCursor.activate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_6__reduce_cython__, "ColorCursor.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_11ColorCursor_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_6__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_6__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_cursor_cannot_be_converted, 0, 0); __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.ColorCursor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_8__setstate_cython__, "ColorCursor.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_11ColorCursor_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_8__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.mouse.ColorCursor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_8__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_11ColorCursor_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_cursor_cannot_be_converted, 0, 0); __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.ColorCursor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_5mouse_ColorCursor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5mouse_ColorCursor(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_5mouse_ColorCursor) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_11pygame_sdl2_5mouse_ColorCursor[] = { {"activate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_5activate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_4activate}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5mouse_11ColorCursor_8__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_5mouse_ColorCursor_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_5mouse_ColorCursor}, {Py_tp_doc, (void *)PyDoc_STR("ColorCursor(Surface surface, x, y)")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_5mouse_ColorCursor}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_5mouse_ColorCursor}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_5mouse_ColorCursor_spec = { "pygame_sdl2.mouse.ColorCursor", sizeof(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_5mouse_ColorCursor_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_5mouse_ColorCursor = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.mouse.""ColorCursor", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5mouse_ColorCursor), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5mouse_ColorCursor, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("ColorCursor(Surface surface, x, y)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5mouse_ColorCursor, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_5mouse_11ColorCursor_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5mouse_ColorCursor, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ColorCursor, __pyx_k_ColorCursor, sizeof(__pyx_k_ColorCursor), 0, 0, 1, 1}, {&__pyx_n_s_ColorCursor___reduce_cython, __pyx_k_ColorCursor___reduce_cython, sizeof(__pyx_k_ColorCursor___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_ColorCursor___setstate_cython, __pyx_k_ColorCursor___setstate_cython, sizeof(__pyx_k_ColorCursor___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_ColorCursor_activate, __pyx_k_ColorCursor_activate, sizeof(__pyx_k_ColorCursor_activate), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 1, 1}, {&__pyx_n_s_activate, __pyx_k_activate, sizeof(__pyx_k_activate), 0, 0, 1, 1}, {&__pyx_n_s_active_cursor, __pyx_k_active_cursor, sizeof(__pyx_k_active_cursor), 0, 0, 1, 1}, {&__pyx_n_s_andmasks, __pyx_k_andmasks, sizeof(__pyx_k_andmasks), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_cursor, __pyx_k_get_cursor, sizeof(__pyx_k_get_cursor), 0, 0, 1, 1}, {&__pyx_n_s_get_focused, __pyx_k_get_focused, sizeof(__pyx_k_get_focused), 0, 0, 1, 1}, {&__pyx_n_s_get_pos, __pyx_k_get_pos, sizeof(__pyx_k_get_pos), 0, 0, 1, 1}, {&__pyx_n_s_get_pressed, __pyx_k_get_pressed, sizeof(__pyx_k_get_pressed), 0, 0, 1, 1}, {&__pyx_n_s_get_rel, __pyx_k_get_rel, sizeof(__pyx_k_get_rel), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_hotspot, __pyx_k_hotspot, sizeof(__pyx_k_hotspot), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mouse, __pyx_k_pygame_sdl2_mouse, sizeof(__pyx_k_pygame_sdl2_mouse), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_kp_s_self_cursor_cannot_be_converted, __pyx_k_self_cursor_cannot_be_converted, sizeof(__pyx_k_self_cursor_cannot_be_converted), 0, 0, 1, 0}, {&__pyx_n_s_set_cursor, __pyx_k_set_cursor, sizeof(__pyx_k_set_cursor), 0, 0, 1, 1}, {&__pyx_n_s_set_pos, __pyx_k_set_pos, sizeof(__pyx_k_set_pos), 0, 0, 1, 1}, {&__pyx_n_s_set_visible, __pyx_k_set_visible, sizeof(__pyx_k_set_visible), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_k_src_pygame_sdl2_mouse_pyx, sizeof(__pyx_k_src_pygame_sdl2_mouse_pyx), 0, 0, 1, 0}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_visible, __pyx_k_visible, sizeof(__pyx_k_visible), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_xormasks, __pyx_k_xormasks, sizeof(__pyx_k_xormasks), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/mouse.pyx":23 * from pygame_sdl2.surface cimport Surface * * def init(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_init, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(1, 23, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":27 * active_cursor = None * * def quit(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_quit, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 27, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":31 * active_cursor = None * * def reset(): # <<<<<<<<<<<<<< * SDL_SetCursor(SDL_GetDefaultCursor()) * global active_cursor */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_reset, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 31, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":36 * active_cursor = None * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_pressed, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 36, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":42 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_pos, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(1, 42, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":47 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetRelativeMouseState(&x, &y) */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_rel, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 47, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":52 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_pos, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_set_pos, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 52, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":56 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_visible); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_set_visible, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 56, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":62 * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_focused, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(1, 62, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":65 * return SDL_GetMouseFocus() != NULL * * def set_cursor(size, hotspot, xormasks, andmasks): # <<<<<<<<<<<<<< * # Does anyone use this? SDL2 has much improved custom cursor support. * pass */ __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_size, __pyx_n_s_hotspot, __pyx_n_s_xormasks, __pyx_n_s_andmasks); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_set_cursor, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 65, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":69 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None * */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_cursor, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 69, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":85 * SDL_FreeCursor(self.cursor) * * def activate(self): # <<<<<<<<<<<<<< * global active_cursor * if active_cursor is not self: */ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_activate, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 85, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" */ __pyx_tuple__20 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_5mouse_ColorCursor_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor)) __PYX_ERR(1, 75, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_5mouse_ColorCursor_spec, __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor) < 0) __PYX_ERR(1, 75, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor = &__pyx_type_11pygame_sdl2_5mouse_ColorCursor; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor) < 0) __PYX_ERR(1, 75, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor->tp_dictoffset && __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ColorCursor, (PyObject *) __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor) < 0) __PYX_ERR(1, 75, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_5mouse_ColorCursor) < 0) __PYX_ERR(1, 75, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7display_Window),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7display_Window) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_mouse(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_mouse}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "mouse", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initmouse(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initmouse(void) #else __Pyx_PyMODINIT_FUNC PyInit_mouse(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_mouse(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_mouse(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'mouse' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("mouse", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "mouse" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_mouse(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__mouse) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.mouse")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.mouse", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_variable_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "pygame_sdl2/mouse.pyx":23 * from pygame_sdl2.surface cimport Surface * * def init(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":27 * active_cursor = None * * def quit(): # <<<<<<<<<<<<<< * global active_cursor * active_cursor = None */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_3quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":31 * active_cursor = None * * def reset(): # <<<<<<<<<<<<<< * SDL_SetCursor(SDL_GetDefaultCursor()) * global active_cursor */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_5reset, 0, __pyx_n_s_reset, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reset, __pyx_t_2) < 0) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":36 * active_cursor = None * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_7get_pressed, 0, __pyx_n_s_get_pressed, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pressed, __pyx_t_2) < 0) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":42 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_9get_pos, 0, __pyx_n_s_get_pos, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pos, __pyx_t_2) < 0) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":47 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetRelativeMouseState(&x, &y) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_11get_rel, 0, __pyx_n_s_get_rel, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_rel, __pyx_t_2) < 0) __PYX_ERR(1, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":52 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_13set_pos, 0, __pyx_n_s_set_pos, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pos, __pyx_t_2) < 0) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":56 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_15set_visible, 0, __pyx_n_s_set_visible, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_visible, __pyx_t_2) < 0) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":62 * SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_17get_focused, 0, __pyx_n_s_get_focused, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_focused, __pyx_t_2) < 0) __PYX_ERR(1, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":65 * return SDL_GetMouseFocus() != NULL * * def set_cursor(size, hotspot, xormasks, andmasks): # <<<<<<<<<<<<<< * # Does anyone use this? SDL2 has much improved custom cursor support. * pass */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_19set_cursor, 0, __pyx_n_s_set_cursor, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_cursor, __pyx_t_2) < 0) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":69 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_21get_cursor, 0, __pyx_n_s_get_cursor, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_cursor, __pyx_t_2) < 0) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":73 * * # The ColorCursor that is currently in use. * active_cursor = False # <<<<<<<<<<<<<< * * cdef class ColorCursor(object): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_active_cursor, Py_False) < 0) __PYX_ERR(1, 73, __pyx_L1_error) /* "pygame_sdl2/mouse.pyx":85 * SDL_FreeCursor(self.cursor) * * def activate(self): # <<<<<<<<<<<<<< * global active_cursor * if active_cursor is not self: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_11ColorCursor_5activate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ColorCursor_activate, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor, __pyx_n_s_activate, __pyx_t_2) < 0) __PYX_ERR(1, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_5mouse_ColorCursor); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_11ColorCursor_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ColorCursor___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.cursor cannot be converted to a Python object for pickling" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5mouse_11ColorCursor_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ColorCursor___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_mouse, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.mouse", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.mouse"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_12 #define __PYX_HAVE_RT_ImportType_3_0_12 static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__22); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* VoidPtrImport */ #ifndef __PYX_HAVE_RT_ImportVoidPtr_3_0_12 #define __PYX_HAVE_RT_ImportVoidPtr_3_0_12 static int __Pyx_ImportVoidPtr_3_0_12(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635911.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.power.c0000664000175000017500000111415515026112607020235 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__power #define __PYX_HAVE_API__pygame_sdl2__power /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/power.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.power" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.power" extern int __pyx_module_is_main_pygame_sdl2__power; int __pyx_module_is_main_pygame_sdl2__power = 0; /* Implementation of "pygame_sdl2.power" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_object; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; static const char __pyx_k__8[] = "?"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_INVALID[] = "INVALID"; static const char __pyx_k_percent[] = "percent"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_seconds[] = "seconds"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_PowerInfo[] = "PowerInfo"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_get_power_info[] = "get_power_info"; static const char __pyx_k_PowerInfo___repr[] = "PowerInfo.__repr__"; static const char __pyx_k_pygame_sdl2_power[] = "pygame_sdl2.power"; static const char __pyx_k_POWERSTATE_CHARGED[] = "POWERSTATE_CHARGED"; static const char __pyx_k_POWERSTATE_UNKNOWN[] = "POWERSTATE_UNKNOWN"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_powerstate_to_name[] = "powerstate_to_name"; static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static const char __pyx_k_POWERSTATE_CHARGING[] = "POWERSTATE_CHARGING"; static const char __pyx_k_POWERSTATE_NO_BATTERY[] = "POWERSTATE_NO_BATTERY"; static const char __pyx_k_POWERSTATE_ON_BATTERY[] = "POWERSTATE_ON_BATTERY"; static const char __pyx_k_src_pygame_sdl2_power_pyx[] = "src/pygame_sdl2/power.pyx"; static const char __pyx_k_PowerInfo_state_seconds_percent[] = ""; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5power_9PowerInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5power_get_power_info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_u_; PyObject *__pyx_n_s_INVALID; PyObject *__pyx_n_s_POWERSTATE_CHARGED; PyObject *__pyx_n_s_POWERSTATE_CHARGING; PyObject *__pyx_n_s_POWERSTATE_NO_BATTERY; PyObject *__pyx_n_s_POWERSTATE_ON_BATTERY; PyObject *__pyx_n_s_POWERSTATE_UNKNOWN; PyObject *__pyx_n_s_PowerInfo; PyObject *__pyx_n_s_PowerInfo___repr; PyObject *__pyx_kp_s_PowerInfo_state_seconds_percent; PyObject *__pyx_n_s__8; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_power_info; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_object; PyObject *__pyx_n_s_percent; PyObject *__pyx_n_s_powerstate_to_name; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_pygame_sdl2_locals; PyObject *__pyx_n_s_pygame_sdl2_power; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_repr; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_seconds; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_name; PyObject *__pyx_kp_s_src_pygame_sdl2_power_pyx; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_test; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_n_s_INVALID); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_CHARGED); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_CHARGING); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_NO_BATTERY); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_ON_BATTERY); Py_CLEAR(clear_module_state->__pyx_n_s_POWERSTATE_UNKNOWN); Py_CLEAR(clear_module_state->__pyx_n_s_PowerInfo); Py_CLEAR(clear_module_state->__pyx_n_s_PowerInfo___repr); Py_CLEAR(clear_module_state->__pyx_kp_s_PowerInfo_state_seconds_percent); Py_CLEAR(clear_module_state->__pyx_n_s__8); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_power_info); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_object); Py_CLEAR(clear_module_state->__pyx_n_s_percent); Py_CLEAR(clear_module_state->__pyx_n_s_powerstate_to_name); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_locals); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_power); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_repr); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_seconds); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_power_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_n_s_INVALID); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_CHARGED); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_CHARGING); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_NO_BATTERY); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_ON_BATTERY); Py_VISIT(traverse_module_state->__pyx_n_s_POWERSTATE_UNKNOWN); Py_VISIT(traverse_module_state->__pyx_n_s_PowerInfo); Py_VISIT(traverse_module_state->__pyx_n_s_PowerInfo___repr); Py_VISIT(traverse_module_state->__pyx_kp_s_PowerInfo_state_seconds_percent); Py_VISIT(traverse_module_state->__pyx_n_s__8); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_power_info); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_object); Py_VISIT(traverse_module_state->__pyx_n_s_percent); Py_VISIT(traverse_module_state->__pyx_n_s_powerstate_to_name); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_locals); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_power); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_repr); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_seconds); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_power_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_n_s_INVALID __pyx_mstate_global->__pyx_n_s_INVALID #define __pyx_n_s_POWERSTATE_CHARGED __pyx_mstate_global->__pyx_n_s_POWERSTATE_CHARGED #define __pyx_n_s_POWERSTATE_CHARGING __pyx_mstate_global->__pyx_n_s_POWERSTATE_CHARGING #define __pyx_n_s_POWERSTATE_NO_BATTERY __pyx_mstate_global->__pyx_n_s_POWERSTATE_NO_BATTERY #define __pyx_n_s_POWERSTATE_ON_BATTERY __pyx_mstate_global->__pyx_n_s_POWERSTATE_ON_BATTERY #define __pyx_n_s_POWERSTATE_UNKNOWN __pyx_mstate_global->__pyx_n_s_POWERSTATE_UNKNOWN #define __pyx_n_s_PowerInfo __pyx_mstate_global->__pyx_n_s_PowerInfo #define __pyx_n_s_PowerInfo___repr __pyx_mstate_global->__pyx_n_s_PowerInfo___repr #define __pyx_kp_s_PowerInfo_state_seconds_percent __pyx_mstate_global->__pyx_kp_s_PowerInfo_state_seconds_percent #define __pyx_n_s__8 __pyx_mstate_global->__pyx_n_s__8 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_power_info __pyx_mstate_global->__pyx_n_s_get_power_info #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object #define __pyx_n_s_percent __pyx_mstate_global->__pyx_n_s_percent #define __pyx_n_s_powerstate_to_name __pyx_mstate_global->__pyx_n_s_powerstate_to_name #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_pygame_sdl2_locals __pyx_mstate_global->__pyx_n_s_pygame_sdl2_locals #define __pyx_n_s_pygame_sdl2_power __pyx_mstate_global->__pyx_n_s_pygame_sdl2_power #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_seconds __pyx_mstate_global->__pyx_n_s_seconds #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_kp_s_src_pygame_sdl2_power_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_power_pyx #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 /* #### Code section: module_code ### */ /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5power_9PowerInfo_1__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5power_9PowerInfo___repr__, "PowerInfo.__repr__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5power_9PowerInfo_1__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5power_9PowerInfo_1__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5power_9PowerInfo___repr__}; static PyObject *__pyx_pw_11pygame_sdl2_5power_9PowerInfo_1__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 33, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 33, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.power.PowerInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5power_9PowerInfo___repr__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5power_9PowerInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/power.pyx":34 * class PowerInfo(object): * def __repr__(self): * return "".format( # <<<<<<<<<<<<<< * powerstate_to_name.get(self.state, "INVALID"), * self.seconds, */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_PowerInfo_state_seconds_percent, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/power.pyx":35 * def __repr__(self): * return "".format( * powerstate_to_name.get(self.state, "INVALID"), # <<<<<<<<<<<<<< * self.seconds, * self.percent) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_powerstate_to_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_state); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_INVALID}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "pygame_sdl2/power.pyx":36 * return "".format( * powerstate_to_name.get(self.state, "INVALID"), * self.seconds, # <<<<<<<<<<<<<< * self.percent) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_seconds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/power.pyx":37 * powerstate_to_name.get(self.state, "INVALID"), * self.seconds, * self.percent) # <<<<<<<<<<<<<< * * def get_power_info(): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_percent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.power.PowerInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5power_1get_power_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5power_get_power_info, "get_power_info()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5power_1get_power_info = {"get_power_info", (PyCFunction)__pyx_pw_11pygame_sdl2_5power_1get_power_info, METH_NOARGS, __pyx_doc_11pygame_sdl2_5power_get_power_info}; static PyObject *__pyx_pw_11pygame_sdl2_5power_1get_power_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_power_info (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5power_get_power_info(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5power_get_power_info(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_seconds; int __pyx_v_percent; SDL_PowerState __pyx_v_state; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_power_info", 1); /* "pygame_sdl2/power.pyx":44 * cdef int percent * * state = SDL_GetPowerInfo(&seconds, &percent) # <<<<<<<<<<<<<< * * rv = PowerInfo() */ __pyx_v_state = SDL_GetPowerInfo((&__pyx_v_seconds), (&__pyx_v_percent)); /* "pygame_sdl2/power.pyx":46 * state = SDL_GetPowerInfo(&seconds, &percent) * * rv = PowerInfo() # <<<<<<<<<<<<<< * rv.state = state * rv.seconds = seconds */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PowerInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":47 * * rv = PowerInfo() * rv.state = state # <<<<<<<<<<<<<< * rv.seconds = seconds * rv.percent = percent */ __pyx_t_1 = __Pyx_PyInt_From_SDL_PowerState(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_state, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":48 * rv = PowerInfo() * rv.state = state * rv.seconds = seconds # <<<<<<<<<<<<<< * rv.percent = percent * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_seconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_seconds, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":49 * rv.state = state * rv.seconds = seconds * rv.percent = percent # <<<<<<<<<<<<<< * * return rv */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_percent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_percent, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":51 * rv.percent = percent * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.power.get_power_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_INVALID, __pyx_k_INVALID, sizeof(__pyx_k_INVALID), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGED, __pyx_k_POWERSTATE_CHARGED, sizeof(__pyx_k_POWERSTATE_CHARGED), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGING, __pyx_k_POWERSTATE_CHARGING, sizeof(__pyx_k_POWERSTATE_CHARGING), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_k_POWERSTATE_NO_BATTERY, sizeof(__pyx_k_POWERSTATE_NO_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_k_POWERSTATE_ON_BATTERY, sizeof(__pyx_k_POWERSTATE_ON_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_UNKNOWN, __pyx_k_POWERSTATE_UNKNOWN, sizeof(__pyx_k_POWERSTATE_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_PowerInfo, __pyx_k_PowerInfo, sizeof(__pyx_k_PowerInfo), 0, 0, 1, 1}, {&__pyx_n_s_PowerInfo___repr, __pyx_k_PowerInfo___repr, sizeof(__pyx_k_PowerInfo___repr), 0, 0, 1, 1}, {&__pyx_kp_s_PowerInfo_state_seconds_percent, __pyx_k_PowerInfo_state_seconds_percent, sizeof(__pyx_k_PowerInfo_state_seconds_percent), 0, 0, 1, 0}, {&__pyx_n_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_power_info, __pyx_k_get_power_info, sizeof(__pyx_k_get_power_info), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_percent, __pyx_k_percent, sizeof(__pyx_k_percent), 0, 0, 1, 1}, {&__pyx_n_s_powerstate_to_name, __pyx_k_powerstate_to_name, sizeof(__pyx_k_powerstate_to_name), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_power, __pyx_k_pygame_sdl2_power, sizeof(__pyx_k_pygame_sdl2_power), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_power_pyx, __pyx_k_src_pygame_sdl2_power_pyx, sizeof(__pyx_k_src_pygame_sdl2_power_pyx), 0, 0, 1, 0}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 32, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/power.pyx":32 * * * class PowerInfo(object): # <<<<<<<<<<<<<< * def __repr__(self): * return "".format( */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); __pyx_tuple__3 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_power_pyx, __pyx_n_s_repr, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 33, __pyx_L1_error) /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ __pyx_tuple__6 = PyTuple_Pack(4, __pyx_n_s_seconds, __pyx_n_s_percent, __pyx_n_s_state, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_power_pyx, __pyx_n_s_get_power_info, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_power(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_power}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "power", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initpower(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initpower(void) #else __Pyx_PyMODINIT_FUNC PyInit_power(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_power(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_power(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'power' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("power", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "power" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_power(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__power) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.power")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.power", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/power.pyx":19 * # 3. This notice may not be removed or altered from any source distribution. * * from pygame_sdl2.locals import POWERSTATE_UNKNOWN, POWERSTATE_ON_BATTERY, POWERSTATE_NO_BATTERY, POWERSTATE_CHARGING, POWERSTATE_CHARGED # <<<<<<<<<<<<<< * * from sdl2 cimport * */ __pyx_t_2 = PyList_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_POWERSTATE_UNKNOWN); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_UNKNOWN); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_POWERSTATE_UNKNOWN)) __PYX_ERR(0, 19, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_POWERSTATE_ON_BATTERY); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_ON_BATTERY); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_POWERSTATE_ON_BATTERY)) __PYX_ERR(0, 19, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_POWERSTATE_NO_BATTERY); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_NO_BATTERY); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_POWERSTATE_NO_BATTERY)) __PYX_ERR(0, 19, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_POWERSTATE_CHARGING); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_CHARGING); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_POWERSTATE_CHARGING)) __PYX_ERR(0, 19, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_POWERSTATE_CHARGED); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_CHARGED); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_POWERSTATE_CHARGED)) __PYX_ERR(0, 19, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_UNKNOWN, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGING, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGED, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/power.pyx":24 * * powerstate_to_name = { * POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", # <<<<<<<<<<<<<< * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", */ __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_POWERSTATE_UNKNOWN) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":25 * powerstate_to_name = { * POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", # <<<<<<<<<<<<<< * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_POWERSTATE_ON_BATTERY) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":26 * POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", # <<<<<<<<<<<<<< * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", * POWERSTATE_CHARGED : "POWERSTATE_CHARGED", */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_POWERSTATE_NO_BATTERY) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":27 * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", # <<<<<<<<<<<<<< * POWERSTATE_CHARGED : "POWERSTATE_CHARGED", * } */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_POWERSTATE_CHARGING) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":28 * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", * POWERSTATE_CHARGED : "POWERSTATE_CHARGED", # <<<<<<<<<<<<<< * } * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_POWERSTATE_CHARGED) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_powerstate_to_name, __pyx_t_3) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/power.pyx":32 * * * class PowerInfo(object): # <<<<<<<<<<<<<< * def __repr__(self): * return "".format( */ __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_tuple__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_PowerInfo, __pyx_n_s_PowerInfo, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_power, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_3 != __pyx_tuple__3) { if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_tuple__3) < 0))) __PYX_ERR(0, 32, __pyx_L1_error) } /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5power_9PowerInfo_1__repr__, 0, __pyx_n_s_PowerInfo___repr, NULL, __pyx_n_s_pygame_sdl2_power, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_repr, __pyx_t_5) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/power.pyx":32 * * * class PowerInfo(object): # <<<<<<<<<<<<<< * def __repr__(self): * return "".format( */ __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PowerInfo, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PowerInfo, __pyx_t_5) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5power_1get_power_info, 0, __pyx_n_s_get_power_info, NULL, __pyx_n_s_pygame_sdl2_power, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_power_info, __pyx_t_3) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/power.pyx":1 * # Copyright 2017 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.power", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.power"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_PowerState neg_one = (SDL_PowerState) -1, const_zero = (SDL_PowerState) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_PowerState) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_PowerState) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_PowerState) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_PowerState) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_PowerState) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_PowerState), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_PowerState)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__8); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635912.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.pygame_time.c0000664000175000017500000156430615026112610021402 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__pygame_time #define __PYX_HAVE_API__pygame_sdl2__pygame_time /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/pygame_time.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* dict_getitem_default.proto */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod1.proto */ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #else #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) #endif /* CallUnboundCMethod2.proto */ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); #else #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* pop_index.proto */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #else #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix)) #endif /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* PyFloatBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check); #else #define __Pyx_PyFloat_TrueDivideCObj(op1, op2, floatval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "cython" */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.pygame_time" */ static int __pyx_v_11pygame_sdl2_11pygame_time_timer_id; static PyObject *__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event = 0; static Uint32 __pyx_f_11pygame_sdl2_11pygame_time_timer_callback(Uint32, void *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.pygame_time" extern int __pyx_module_is_main_pygame_sdl2__pygame_time; int __pyx_module_is_main_pygame_sdl2__pygame_time = 0; /* Implementation of "pygame_sdl2.pygame_time" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_sum; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "*"; static const char __pyx_k__2[] = "."; static const char __pyx_k__23[] = "?"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_now[] = "now"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_sum[] = "sum"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_last[] = "last"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_math[] = "math"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_tick[] = "tick"; static const char __pyx_k_wait[] = "wait"; static const char __pyx_k_Clock[] = "Clock"; static const char __pyx_k_delay[] = "delay"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_isnan[] = "isnan"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_init_2[] = "__init__"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_eventid[] = "eventid"; static const char __pyx_k_get_fps[] = "get_fps"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_get_time[] = "get_time"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_timer_id[] = "timer_id"; static const char __pyx_k_framerate[] = "framerate"; static const char __pyx_k_frametime[] = "frametime"; static const char __pyx_k_get_ticks[] = "get_ticks"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_set_timer[] = "set_timer"; static const char __pyx_k_Clock_tick[] = "Clock.tick"; static const char __pyx_k_total_time[] = "total_time"; static const char __pyx_k_average_fps[] = "average_fps"; static const char __pyx_k_get_rawtime[] = "get_rawtime"; static const char __pyx_k_last_frames[] = "last_frames"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_Clock___init[] = "Clock.__init__"; static const char __pyx_k_average_time[] = "average_time"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_milliseconds[] = "milliseconds"; static const char __pyx_k_Clock_get_fps[] = "Clock.get_fps"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_raw_frametime[] = "raw_frametime"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_sdl_main_init[] = "sdl_main_init"; static const char __pyx_k_Clock_get_time[] = "Clock.get_time"; static const char __pyx_k_frame_duration[] = "frame_duration"; static const char __pyx_k_tick_busy_loop[] = "tick_busy_loop"; static const char __pyx_k_Clock_get_rawtime[] = "Clock.get_rawtime"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Clock_tick_busy_loop[] = "Clock.tick_busy_loop"; static const char __pyx_k_pygame_sdl2_pygame_time[] = "pygame_sdl2.pygame_time"; static const char __pyx_k_src_pygame_sdl2_pygame_time_pyx[] = "src/pygame_sdl2/pygame_time.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_4get_ticks(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_6wait(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_milliseconds); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_8delay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_milliseconds); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_10set_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_eventid, PyObject *__pyx_v_milliseconds); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_2tick(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_6get_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_10get_fps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_n_s_; PyObject *__pyx_n_s_Clock; PyObject *__pyx_n_s_Clock___init; PyObject *__pyx_n_s_Clock_get_fps; PyObject *__pyx_n_s_Clock_get_rawtime; PyObject *__pyx_n_s_Clock_get_time; PyObject *__pyx_n_s_Clock_tick; PyObject *__pyx_n_s_Clock_tick_busy_loop; PyObject *__pyx_kp_u__2; PyObject *__pyx_n_s__23; PyObject *__pyx_n_s_append; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_average_fps; PyObject *__pyx_n_s_average_time; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_delay; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_display; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_eventid; PyObject *__pyx_n_s_frame_duration; PyObject *__pyx_n_s_framerate; PyObject *__pyx_n_s_frametime; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_fps; PyObject *__pyx_n_s_get_rawtime; PyObject *__pyx_n_s_get_ticks; PyObject *__pyx_n_s_get_time; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_2; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_isnan; PyObject *__pyx_n_s_last; PyObject *__pyx_n_s_last_frames; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_math; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_milliseconds; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_now; PyObject *__pyx_n_s_pop; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_pygame_time; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_quit; PyObject *__pyx_n_s_raw_frametime; PyObject *__pyx_n_s_register_init; PyObject *__pyx_n_s_register_quit; PyObject *__pyx_n_s_sdl_main_init; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_set_timer; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_pygame_time_pyx; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_sum; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_tick; PyObject *__pyx_n_s_tick_busy_loop; PyObject *__pyx_n_s_timer_id; PyObject *__pyx_n_s_total_time; PyObject *__pyx_n_s_wait; PyObject *__pyx_float_1_0; PyObject *__pyx_int_0; PyObject *__pyx_int_1000; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__21; PyObject *__pyx_codeobj__3; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_n_s_); Py_CLEAR(clear_module_state->__pyx_n_s_Clock); Py_CLEAR(clear_module_state->__pyx_n_s_Clock___init); Py_CLEAR(clear_module_state->__pyx_n_s_Clock_get_fps); Py_CLEAR(clear_module_state->__pyx_n_s_Clock_get_rawtime); Py_CLEAR(clear_module_state->__pyx_n_s_Clock_get_time); Py_CLEAR(clear_module_state->__pyx_n_s_Clock_tick); Py_CLEAR(clear_module_state->__pyx_n_s_Clock_tick_busy_loop); Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_n_s__23); Py_CLEAR(clear_module_state->__pyx_n_s_append); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_average_fps); Py_CLEAR(clear_module_state->__pyx_n_s_average_time); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_delay); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_display); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_eventid); Py_CLEAR(clear_module_state->__pyx_n_s_frame_duration); Py_CLEAR(clear_module_state->__pyx_n_s_framerate); Py_CLEAR(clear_module_state->__pyx_n_s_frametime); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_fps); Py_CLEAR(clear_module_state->__pyx_n_s_get_rawtime); Py_CLEAR(clear_module_state->__pyx_n_s_get_ticks); Py_CLEAR(clear_module_state->__pyx_n_s_get_time); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_2); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_isnan); Py_CLEAR(clear_module_state->__pyx_n_s_last); Py_CLEAR(clear_module_state->__pyx_n_s_last_frames); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_math); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_milliseconds); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_now); Py_CLEAR(clear_module_state->__pyx_n_s_pop); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_pygame_time); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_quit); Py_CLEAR(clear_module_state->__pyx_n_s_raw_frametime); Py_CLEAR(clear_module_state->__pyx_n_s_register_init); Py_CLEAR(clear_module_state->__pyx_n_s_register_quit); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_main_init); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_set_timer); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_pygame_time_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_sum); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_tick); Py_CLEAR(clear_module_state->__pyx_n_s_tick_busy_loop); Py_CLEAR(clear_module_state->__pyx_n_s_timer_id); Py_CLEAR(clear_module_state->__pyx_n_s_total_time); Py_CLEAR(clear_module_state->__pyx_n_s_wait); Py_CLEAR(clear_module_state->__pyx_float_1_0); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1000); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_codeobj__3); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_n_s_); Py_VISIT(traverse_module_state->__pyx_n_s_Clock); Py_VISIT(traverse_module_state->__pyx_n_s_Clock___init); Py_VISIT(traverse_module_state->__pyx_n_s_Clock_get_fps); Py_VISIT(traverse_module_state->__pyx_n_s_Clock_get_rawtime); Py_VISIT(traverse_module_state->__pyx_n_s_Clock_get_time); Py_VISIT(traverse_module_state->__pyx_n_s_Clock_tick); Py_VISIT(traverse_module_state->__pyx_n_s_Clock_tick_busy_loop); Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_n_s__23); Py_VISIT(traverse_module_state->__pyx_n_s_append); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_average_fps); Py_VISIT(traverse_module_state->__pyx_n_s_average_time); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_delay); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_display); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_eventid); Py_VISIT(traverse_module_state->__pyx_n_s_frame_duration); Py_VISIT(traverse_module_state->__pyx_n_s_framerate); Py_VISIT(traverse_module_state->__pyx_n_s_frametime); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_fps); Py_VISIT(traverse_module_state->__pyx_n_s_get_rawtime); Py_VISIT(traverse_module_state->__pyx_n_s_get_ticks); Py_VISIT(traverse_module_state->__pyx_n_s_get_time); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_2); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_isnan); Py_VISIT(traverse_module_state->__pyx_n_s_last); Py_VISIT(traverse_module_state->__pyx_n_s_last_frames); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_math); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_milliseconds); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_now); Py_VISIT(traverse_module_state->__pyx_n_s_pop); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_pygame_time); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_quit); Py_VISIT(traverse_module_state->__pyx_n_s_raw_frametime); Py_VISIT(traverse_module_state->__pyx_n_s_register_init); Py_VISIT(traverse_module_state->__pyx_n_s_register_quit); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_main_init); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_set_timer); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_pygame_time_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_sum); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_tick); Py_VISIT(traverse_module_state->__pyx_n_s_tick_busy_loop); Py_VISIT(traverse_module_state->__pyx_n_s_timer_id); Py_VISIT(traverse_module_state->__pyx_n_s_total_time); Py_VISIT(traverse_module_state->__pyx_n_s_wait); Py_VISIT(traverse_module_state->__pyx_float_1_0); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1000); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_codeobj__3); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ #define __pyx_n_s_Clock __pyx_mstate_global->__pyx_n_s_Clock #define __pyx_n_s_Clock___init __pyx_mstate_global->__pyx_n_s_Clock___init #define __pyx_n_s_Clock_get_fps __pyx_mstate_global->__pyx_n_s_Clock_get_fps #define __pyx_n_s_Clock_get_rawtime __pyx_mstate_global->__pyx_n_s_Clock_get_rawtime #define __pyx_n_s_Clock_get_time __pyx_mstate_global->__pyx_n_s_Clock_get_time #define __pyx_n_s_Clock_tick __pyx_mstate_global->__pyx_n_s_Clock_tick #define __pyx_n_s_Clock_tick_busy_loop __pyx_mstate_global->__pyx_n_s_Clock_tick_busy_loop #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_n_s__23 __pyx_mstate_global->__pyx_n_s__23 #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_average_fps __pyx_mstate_global->__pyx_n_s_average_fps #define __pyx_n_s_average_time __pyx_mstate_global->__pyx_n_s_average_time #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_delay __pyx_mstate_global->__pyx_n_s_delay #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_eventid __pyx_mstate_global->__pyx_n_s_eventid #define __pyx_n_s_frame_duration __pyx_mstate_global->__pyx_n_s_frame_duration #define __pyx_n_s_framerate __pyx_mstate_global->__pyx_n_s_framerate #define __pyx_n_s_frametime __pyx_mstate_global->__pyx_n_s_frametime #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_fps __pyx_mstate_global->__pyx_n_s_get_fps #define __pyx_n_s_get_rawtime __pyx_mstate_global->__pyx_n_s_get_rawtime #define __pyx_n_s_get_ticks __pyx_mstate_global->__pyx_n_s_get_ticks #define __pyx_n_s_get_time __pyx_mstate_global->__pyx_n_s_get_time #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_2 __pyx_mstate_global->__pyx_n_s_init_2 #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_isnan __pyx_mstate_global->__pyx_n_s_isnan #define __pyx_n_s_last __pyx_mstate_global->__pyx_n_s_last #define __pyx_n_s_last_frames __pyx_mstate_global->__pyx_n_s_last_frames #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_math __pyx_mstate_global->__pyx_n_s_math #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_milliseconds __pyx_mstate_global->__pyx_n_s_milliseconds #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_now __pyx_mstate_global->__pyx_n_s_now #define __pyx_n_s_pop __pyx_mstate_global->__pyx_n_s_pop #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_pygame_time __pyx_mstate_global->__pyx_n_s_pygame_sdl2_pygame_time #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_quit __pyx_mstate_global->__pyx_n_s_quit #define __pyx_n_s_raw_frametime __pyx_mstate_global->__pyx_n_s_raw_frametime #define __pyx_n_s_register_init __pyx_mstate_global->__pyx_n_s_register_init #define __pyx_n_s_register_quit __pyx_mstate_global->__pyx_n_s_register_quit #define __pyx_n_s_sdl_main_init __pyx_mstate_global->__pyx_n_s_sdl_main_init #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_set_timer __pyx_mstate_global->__pyx_n_s_set_timer #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_pygame_time_pyx #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_sum __pyx_mstate_global->__pyx_n_s_sum #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_tick __pyx_mstate_global->__pyx_n_s_tick #define __pyx_n_s_tick_busy_loop __pyx_mstate_global->__pyx_n_s_tick_busy_loop #define __pyx_n_s_timer_id __pyx_mstate_global->__pyx_n_s_timer_id #define __pyx_n_s_total_time __pyx_mstate_global->__pyx_n_s_total_time #define __pyx_n_s_wait __pyx_mstate_global->__pyx_n_s_wait #define __pyx_float_1_0 __pyx_mstate_global->__pyx_float_1_0 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1000 __pyx_mstate_global->__pyx_int_1000 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 /* #### Code section: module_code ### */ /* "pygame_sdl2/pygame_time.pyx":27 * cdef int timer_id = 0 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_11pygame_time_init}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "pygame_sdl2/pygame_time.pyx":29 * @pygame_sdl2.register_init * def init(): * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_TIMER): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":31 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_TIMER): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = (SDL_InitSubSystem(SDL_INIT_TIMER) != 0); if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/pygame_time.pyx":32 * * if SDL_InitSubSystem(SDL_INIT_TIMER): * raise error() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 32, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":31 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_TIMER): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/pygame_time.pyx":27 * cdef int timer_id = 0 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.pygame_time.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":34 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_2quit, "quit()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_3quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_11pygame_time_2quit}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 1); /* "pygame_sdl2/pygame_time.pyx":36 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) # <<<<<<<<<<<<<< * * def get_ticks(): */ SDL_QuitSubSystem(SDL_INIT_TIMER); /* "pygame_sdl2/pygame_time.pyx":34 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5get_ticks(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_4get_ticks, "get_ticks()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5get_ticks = {"get_ticks", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5get_ticks, METH_NOARGS, __pyx_doc_11pygame_sdl2_11pygame_time_4get_ticks}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5get_ticks(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_ticks (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_4get_ticks(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_4get_ticks(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_ticks", 1); /* "pygame_sdl2/pygame_time.pyx":39 * * def get_ticks(): * return SDL_GetTicks() # <<<<<<<<<<<<<< * * def wait(int milliseconds): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetTicks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.get_ticks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_7wait(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_6wait, "wait(int milliseconds)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_7wait = {"wait", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_7wait, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_6wait}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_7wait(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { int __pyx_v_milliseconds; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wait (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_milliseconds,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_milliseconds)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wait") < 0)) __PYX_ERR(0, 41, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_milliseconds = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_milliseconds == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("wait", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 41, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_6wait(__pyx_self, __pyx_v_milliseconds); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_6wait(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_milliseconds) { int __pyx_v_start; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("wait", 1); /* "pygame_sdl2/pygame_time.pyx":44 * cdef int start * * start = SDL_GetTicks() # <<<<<<<<<<<<<< * with nogil: * SDL_Delay(milliseconds) */ __pyx_v_start = SDL_GetTicks(); /* "pygame_sdl2/pygame_time.pyx":45 * * start = SDL_GetTicks() * with nogil: # <<<<<<<<<<<<<< * SDL_Delay(milliseconds) * return SDL_GetTicks() - start */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/pygame_time.pyx":46 * start = SDL_GetTicks() * with nogil: * SDL_Delay(milliseconds) # <<<<<<<<<<<<<< * return SDL_GetTicks() - start * */ SDL_Delay(__pyx_v_milliseconds); } /* "pygame_sdl2/pygame_time.pyx":45 * * start = SDL_GetTicks() * with nogil: # <<<<<<<<<<<<<< * SDL_Delay(milliseconds) * return SDL_GetTicks() - start */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/pygame_time.pyx":47 * with nogil: * SDL_Delay(milliseconds) * return SDL_GetTicks() - start # <<<<<<<<<<<<<< * * def delay(milliseconds): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t((SDL_GetTicks() - __pyx_v_start)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_9delay(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_8delay, "delay(milliseconds)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_9delay = {"delay", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_9delay, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_8delay}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_9delay(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_milliseconds = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("delay (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_milliseconds,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_milliseconds)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "delay") < 0)) __PYX_ERR(0, 49, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_milliseconds = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("delay", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 49, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.delay", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_8delay(__pyx_self, __pyx_v_milliseconds); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_8delay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_milliseconds) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("delay", 1); /* "pygame_sdl2/pygame_time.pyx":51 * def delay(milliseconds): * # SDL_Delay() should be accurate enough. * return wait(milliseconds) # <<<<<<<<<<<<<< * * cdef Uint32 timer_callback(Uint32 interval, void *param) nogil: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_wait); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_milliseconds}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.pygame_time.delay", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":53 * return wait(milliseconds) * * cdef Uint32 timer_callback(Uint32 interval, void *param) nogil: # <<<<<<<<<<<<<< * cdef SDL_Event e * e.type = param */ static Uint32 __pyx_f_11pygame_sdl2_11pygame_time_timer_callback(Uint32 __pyx_v_interval, void *__pyx_v_param) { SDL_Event __pyx_v_e; Uint32 __pyx_r; /* "pygame_sdl2/pygame_time.pyx":55 * cdef Uint32 timer_callback(Uint32 interval, void *param) nogil: * cdef SDL_Event e * e.type = param # <<<<<<<<<<<<<< * e.user.code = 0 * e.user.data1 = NULL */ __pyx_v_e.type = ((int)__pyx_v_param); /* "pygame_sdl2/pygame_time.pyx":56 * cdef SDL_Event e * e.type = param * e.user.code = 0 # <<<<<<<<<<<<<< * e.user.data1 = NULL * e.user.data2 = NULL */ __pyx_v_e.user.code = 0; /* "pygame_sdl2/pygame_time.pyx":57 * e.type = param * e.user.code = 0 * e.user.data1 = NULL # <<<<<<<<<<<<<< * e.user.data2 = NULL * SDL_PushEvent(&e) */ __pyx_v_e.user.data1 = NULL; /* "pygame_sdl2/pygame_time.pyx":58 * e.user.code = 0 * e.user.data1 = NULL * e.user.data2 = NULL # <<<<<<<<<<<<<< * SDL_PushEvent(&e) * return interval */ __pyx_v_e.user.data2 = NULL; /* "pygame_sdl2/pygame_time.pyx":59 * e.user.data1 = NULL * e.user.data2 = NULL * SDL_PushEvent(&e) # <<<<<<<<<<<<<< * return interval * */ (void)(SDL_PushEvent((&__pyx_v_e))); /* "pygame_sdl2/pygame_time.pyx":60 * e.user.data2 = NULL * SDL_PushEvent(&e) * return interval # <<<<<<<<<<<<<< * * # A map from eventid to SDL_Timer_ID. */ __pyx_r = __pyx_v_interval; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":53 * return wait(milliseconds) * * cdef Uint32 timer_callback(Uint32 interval, void *param) nogil: # <<<<<<<<<<<<<< * cdef SDL_Event e * e.type = param */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_11set_timer(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_10set_timer, "set_timer(eventid, milliseconds)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_11set_timer = {"set_timer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_11set_timer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_10set_timer}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_11set_timer(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_eventid = 0; PyObject *__pyx_v_milliseconds = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_timer (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_eventid,&__pyx_n_s_milliseconds,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eventid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_milliseconds)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_timer", 1, 2, 2, 1); __PYX_ERR(0, 65, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_timer") < 0)) __PYX_ERR(0, 65, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_eventid = values[0]; __pyx_v_milliseconds = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_timer", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 65, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.set_timer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_10set_timer(__pyx_self, __pyx_v_eventid, __pyx_v_milliseconds); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_10set_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_eventid, PyObject *__pyx_v_milliseconds) { int __pyx_v_timer_id; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Uint32 __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_timer", 1); /* "pygame_sdl2/pygame_time.pyx":67 * def set_timer(eventid, milliseconds): * * cdef int timer_id = timer_by_event.get(eventid, 0) # <<<<<<<<<<<<<< * * if timer_id != 0: */ if (unlikely(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(0, 67, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, __pyx_v_eventid, __pyx_int_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_timer_id = __pyx_t_2; /* "pygame_sdl2/pygame_time.pyx":69 * cdef int timer_id = timer_by_event.get(eventid, 0) * * if timer_id != 0: # <<<<<<<<<<<<<< * SDL_RemoveTimer(timer_id) * timer_id = 0 */ __pyx_t_3 = (__pyx_v_timer_id != 0); if (__pyx_t_3) { /* "pygame_sdl2/pygame_time.pyx":70 * * if timer_id != 0: * SDL_RemoveTimer(timer_id) # <<<<<<<<<<<<<< * timer_id = 0 * */ (void)(SDL_RemoveTimer(__pyx_v_timer_id)); /* "pygame_sdl2/pygame_time.pyx":71 * if timer_id != 0: * SDL_RemoveTimer(timer_id) * timer_id = 0 # <<<<<<<<<<<<<< * * if milliseconds > 0: */ __pyx_v_timer_id = 0; /* "pygame_sdl2/pygame_time.pyx":69 * cdef int timer_id = timer_by_event.get(eventid, 0) * * if timer_id != 0: # <<<<<<<<<<<<<< * SDL_RemoveTimer(timer_id) * timer_id = 0 */ } /* "pygame_sdl2/pygame_time.pyx":73 * timer_id = 0 * * if milliseconds > 0: # <<<<<<<<<<<<<< * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_milliseconds, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/pygame_time.pyx":74 * * if milliseconds > 0: * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) # <<<<<<<<<<<<<< * if timer_id == 0: * raise error() */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_milliseconds); if (unlikely((__pyx_t_4 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_eventid); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L1_error) __pyx_v_timer_id = SDL_AddTimer(__pyx_t_4, ((SDL_TimerCallback)__pyx_f_11pygame_sdl2_11pygame_time_timer_callback), ((void *)((int)__pyx_t_2))); /* "pygame_sdl2/pygame_time.pyx":75 * if milliseconds > 0: * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = (__pyx_v_timer_id == 0); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/pygame_time.pyx":76 * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: * raise error() # <<<<<<<<<<<<<< * * timer_by_event[eventid] = timer_id */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 76, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":75 * if milliseconds > 0: * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/pygame_time.pyx":73 * timer_id = 0 * * if milliseconds > 0: # <<<<<<<<<<<<<< * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: */ } /* "pygame_sdl2/pygame_time.pyx":78 * raise error() * * timer_by_event[eventid] = timer_id # <<<<<<<<<<<<<< * * class Clock: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_timer_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 78, __pyx_L1_error) } if (unlikely((PyDict_SetItem(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, __pyx_v_eventid, __pyx_t_1) < 0))) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.pygame_time.set_timer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_5Clock___init__, "Clock.__init__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_5Clock___init__}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 81, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 81, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock___init__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/pygame_time.pyx":82 * class Clock: * def __init__(self): * self.last = SDL_GetTicks() # <<<<<<<<<<<<<< * self.last_frames = [] * self.frametime = 0 */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetTicks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last, __pyx_t_1) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":83 * def __init__(self): * self.last = SDL_GetTicks() * self.last_frames = [] # <<<<<<<<<<<<<< * self.frametime = 0 * self.raw_frametime = 0 */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last_frames, __pyx_t_1) < 0) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":84 * self.last = SDL_GetTicks() * self.last_frames = [] * self.frametime = 0 # <<<<<<<<<<<<<< * self.raw_frametime = 0 * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_frametime, __pyx_int_0) < 0) __PYX_ERR(0, 84, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":85 * self.last_frames = [] * self.frametime = 0 * self.raw_frametime = 0 # <<<<<<<<<<<<<< * * def tick(self, framerate=0): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime, __pyx_int_0) < 0) __PYX_ERR(0, 85, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_3tick(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_5Clock_2tick, "Clock.tick(self, framerate=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_3tick = {"tick", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_3tick, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_5Clock_2tick}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_3tick(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_framerate = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tick (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_framerate,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_framerate); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tick") < 0)) __PYX_ERR(0, 87, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_framerate = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tick", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 87, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_2tick(__pyx_self, __pyx_v_self, __pyx_v_framerate); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_2tick(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate) { int __pyx_v_now; int __pyx_v_frame_duration; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; unsigned int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tick", 1); /* "pygame_sdl2/pygame_time.pyx":88 * * def tick(self, framerate=0): * cdef int now = SDL_GetTicks() # <<<<<<<<<<<<<< * self.raw_frametime = now - self.last * while len(self.last_frames) > 9: */ __pyx_v_now = SDL_GetTicks(); /* "pygame_sdl2/pygame_time.pyx":89 * def tick(self, framerate=0): * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last # <<<<<<<<<<<<<< * while len(self.last_frames) > 9: * self.last_frames.pop(0) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime, __pyx_t_3) < 0) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":90 * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last * while len(self.last_frames) > 9: # <<<<<<<<<<<<<< * self.last_frames.pop(0) * if framerate == 0: */ while (1) { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (__pyx_t_4 > 9); if (!__pyx_t_5) break; /* "pygame_sdl2/pygame_time.pyx":91 * self.raw_frametime = now - self.last * while len(self.last_frames) > 9: * self.last_frames.pop(0) # <<<<<<<<<<<<<< * if framerate == 0: * self.last = now */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_PopIndex(__pyx_t_3, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/pygame_time.pyx":92 * while len(self.last_frames) > 9: * self.last_frames.pop(0) * if framerate == 0: # <<<<<<<<<<<<<< * self.last = now * self.last_frames.append(self.raw_frametime) */ __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_framerate, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 92, __pyx_L1_error) if (__pyx_t_5) { /* "pygame_sdl2/pygame_time.pyx":93 * self.last_frames.pop(0) * if framerate == 0: * self.last = now # <<<<<<<<<<<<<< * self.last_frames.append(self.raw_frametime) * return self.raw_frametime */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":94 * if framerate == 0: * self.last = now * self.last_frames.append(self.raw_frametime) # <<<<<<<<<<<<<< * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":95 * self.last = now * self.last_frames.append(self.raw_frametime) * return self.raw_frametime # <<<<<<<<<<<<<< * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":92 * while len(self.last_frames) > 9: * self.last_frames.pop(0) * if framerate == 0: # <<<<<<<<<<<<<< * self.last = now * self.last_frames.append(self.raw_frametime) */ } /* "pygame_sdl2/pygame_time.pyx":96 * self.last_frames.append(self.raw_frametime) * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 # <<<<<<<<<<<<<< * if self.raw_frametime < frame_duration: * delay(frame_duration - self.raw_frametime) */ __pyx_t_3 = __Pyx_PyFloat_TrueDivideCObj(__pyx_float_1_0, __pyx_v_framerate, 1.0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_frame_duration = __pyx_t_7; /* "pygame_sdl2/pygame_time.pyx":97 * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: # <<<<<<<<<<<<<< * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_frame_duration); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/pygame_time.pyx":98 * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: * delay(frame_duration - self.raw_frametime) # <<<<<<<<<<<<<< * now = SDL_GetTicks() * self.frametime = now - self.last */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_delay); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_frame_duration); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyNumber_Subtract(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":97 * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: # <<<<<<<<<<<<<< * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() */ } /* "pygame_sdl2/pygame_time.pyx":99 * if self.raw_frametime < frame_duration: * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() # <<<<<<<<<<<<<< * self.frametime = now - self.last * self.last = now */ __pyx_v_now = SDL_GetTicks(); /* "pygame_sdl2/pygame_time.pyx":100 * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() * self.frametime = now - self.last # <<<<<<<<<<<<<< * self.last = now * self.last_frames.append(self.frametime) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_frametime, __pyx_t_9) < 0) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/pygame_time.pyx":101 * now = SDL_GetTicks() * self.frametime = now - self.last * self.last = now # <<<<<<<<<<<<<< * self.last_frames.append(self.frametime) * return self.frametime */ __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last, __pyx_t_9) < 0) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/pygame_time.pyx":102 * self.frametime = now - self.last * self.last = now * self.last_frames.append(self.frametime) # <<<<<<<<<<<<<< * return self.frametime * */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frametime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_9, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":103 * self.last = now * self.last_frames.append(self.frametime) * return self.frametime # <<<<<<<<<<<<<< * * def tick_busy_loop(self, framerate=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frametime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop, "Clock.tick_busy_loop(self, framerate=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop = {"tick_busy_loop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_framerate = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tick_busy_loop (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_framerate,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_framerate); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tick_busy_loop") < 0)) __PYX_ERR(0, 105, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_framerate = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tick_busy_loop", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 105, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick_busy_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop(__pyx_self, __pyx_v_self, __pyx_v_framerate); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tick_busy_loop", 1); /* "pygame_sdl2/pygame_time.pyx":106 * * def tick_busy_loop(self, framerate=0): * return self.tick(framerate) # <<<<<<<<<<<<<< * * def get_time(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tick); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_framerate}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick_busy_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_7get_time(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_5Clock_6get_time, "Clock.get_time(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_7get_time = {"get_time", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_7get_time, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_5Clock_6get_time}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_7get_time(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_time (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_time") < 0)) __PYX_ERR(0, 108, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_time", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 108, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_time", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_6get_time(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_6get_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_time", 1); /* "pygame_sdl2/pygame_time.pyx":109 * * def get_time(self): * return self.frametime # <<<<<<<<<<<<<< * * def get_rawtime(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frametime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_time", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime, "Clock.get_rawtime(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime = {"get_rawtime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_rawtime (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_rawtime") < 0)) __PYX_ERR(0, 111, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_rawtime", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 111, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_rawtime", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_rawtime", 1); /* "pygame_sdl2/pygame_time.pyx":112 * * def get_rawtime(self): * return self.raw_frametime # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_rawtime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":114 * return self.raw_frametime * * @cython.cdivision(True) # <<<<<<<<<<<<<< * def get_fps(self): * cdef int total_time = sum(self.last_frames) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_11get_fps(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_11pygame_time_5Clock_10get_fps, "Clock.get_fps(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_11get_fps = {"get_fps", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_11get_fps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_11pygame_time_5Clock_10get_fps}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_11get_fps(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_fps (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_fps") < 0)) __PYX_ERR(0, 114, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_fps", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 114, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_fps", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_10get_fps(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_10get_fps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { int __pyx_v_total_time; float __pyx_v_average_time; float __pyx_v_average_fps; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_fps", 1); /* "pygame_sdl2/pygame_time.pyx":116 * @cython.cdivision(True) * def get_fps(self): * cdef int total_time = sum(self.last_frames) # <<<<<<<<<<<<<< * cdef float average_time = total_time / 1000.0 / len(self.last_frames) * cdef float average_fps = 1.0 / average_time */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_total_time = __pyx_t_3; /* "pygame_sdl2/pygame_time.pyx":117 * def get_fps(self): * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) # <<<<<<<<<<<<<< * cdef float average_fps = 1.0 / average_time * return 0 if math.isnan(average_fps) else average_fps */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_average_time = ((((double)__pyx_v_total_time) / 1000.0) / ((double)__pyx_t_4)); /* "pygame_sdl2/pygame_time.pyx":118 * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) * cdef float average_fps = 1.0 / average_time # <<<<<<<<<<<<<< * return 0 if math.isnan(average_fps) else average_fps */ __pyx_v_average_fps = (1.0 / ((double)__pyx_v_average_time)); /* "pygame_sdl2/pygame_time.pyx":119 * cdef float average_time = total_time / 1000.0 / len(self.last_frames) * cdef float average_fps = 1.0 / average_time * return 0 if math.isnan(average_fps) else average_fps # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnan); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyFloat_FromDouble(__pyx_v_average_fps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { __Pyx_INCREF(__pyx_int_0); __pyx_t_2 = __pyx_int_0; } else { __pyx_t_1 = PyFloat_FromDouble(__pyx_v_average_fps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":114 * return self.raw_frametime * * @cython.cdivision(True) # <<<<<<<<<<<<<< * def get_fps(self): * cdef int total_time = sum(self.last_frames) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_fps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, {&__pyx_n_s_Clock, __pyx_k_Clock, sizeof(__pyx_k_Clock), 0, 0, 1, 1}, {&__pyx_n_s_Clock___init, __pyx_k_Clock___init, sizeof(__pyx_k_Clock___init), 0, 0, 1, 1}, {&__pyx_n_s_Clock_get_fps, __pyx_k_Clock_get_fps, sizeof(__pyx_k_Clock_get_fps), 0, 0, 1, 1}, {&__pyx_n_s_Clock_get_rawtime, __pyx_k_Clock_get_rawtime, sizeof(__pyx_k_Clock_get_rawtime), 0, 0, 1, 1}, {&__pyx_n_s_Clock_get_time, __pyx_k_Clock_get_time, sizeof(__pyx_k_Clock_get_time), 0, 0, 1, 1}, {&__pyx_n_s_Clock_tick, __pyx_k_Clock_tick, sizeof(__pyx_k_Clock_tick), 0, 0, 1, 1}, {&__pyx_n_s_Clock_tick_busy_loop, __pyx_k_Clock_tick_busy_loop, sizeof(__pyx_k_Clock_tick_busy_loop), 0, 0, 1, 1}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_average_fps, __pyx_k_average_fps, sizeof(__pyx_k_average_fps), 0, 0, 1, 1}, {&__pyx_n_s_average_time, __pyx_k_average_time, sizeof(__pyx_k_average_time), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_delay, __pyx_k_delay, sizeof(__pyx_k_delay), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_eventid, __pyx_k_eventid, sizeof(__pyx_k_eventid), 0, 0, 1, 1}, {&__pyx_n_s_frame_duration, __pyx_k_frame_duration, sizeof(__pyx_k_frame_duration), 0, 0, 1, 1}, {&__pyx_n_s_framerate, __pyx_k_framerate, sizeof(__pyx_k_framerate), 0, 0, 1, 1}, {&__pyx_n_s_frametime, __pyx_k_frametime, sizeof(__pyx_k_frametime), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_fps, __pyx_k_get_fps, sizeof(__pyx_k_get_fps), 0, 0, 1, 1}, {&__pyx_n_s_get_rawtime, __pyx_k_get_rawtime, sizeof(__pyx_k_get_rawtime), 0, 0, 1, 1}, {&__pyx_n_s_get_ticks, __pyx_k_get_ticks, sizeof(__pyx_k_get_ticks), 0, 0, 1, 1}, {&__pyx_n_s_get_time, __pyx_k_get_time, sizeof(__pyx_k_get_time), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_isnan, __pyx_k_isnan, sizeof(__pyx_k_isnan), 0, 0, 1, 1}, {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1}, {&__pyx_n_s_last_frames, __pyx_k_last_frames, sizeof(__pyx_k_last_frames), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_milliseconds, __pyx_k_milliseconds, sizeof(__pyx_k_milliseconds), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_pygame_time, __pyx_k_pygame_sdl2_pygame_time, sizeof(__pyx_k_pygame_sdl2_pygame_time), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_raw_frametime, __pyx_k_raw_frametime, sizeof(__pyx_k_raw_frametime), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_set_timer, __pyx_k_set_timer, sizeof(__pyx_k_set_timer), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_k_src_pygame_sdl2_pygame_time_pyx, sizeof(__pyx_k_src_pygame_sdl2_pygame_time_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_tick, __pyx_k_tick, sizeof(__pyx_k_tick), 0, 0, 1, 1}, {&__pyx_n_s_tick_busy_loop, __pyx_k_tick_busy_loop, sizeof(__pyx_k_tick_busy_loop), 0, 0, 1, 1}, {&__pyx_n_s_timer_id, __pyx_k_timer_id, sizeof(__pyx_k_timer_id), 0, 0, 1, 1}, {&__pyx_n_s_total_time, __pyx_k_total_time, sizeof(__pyx_k_total_time), 0, 0, 1, 1}, {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 116, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/pygame_time.pyx":27 * cdef int timer_id = 0 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_init, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 27, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":34 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) */ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_quit, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 34, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_ticks, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 38, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_milliseconds, __pyx_n_s_start); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_wait, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 41, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_milliseconds); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_delay, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 49, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ __pyx_tuple__10 = PyTuple_Pack(3, __pyx_n_s_eventid, __pyx_n_s_milliseconds, __pyx_n_s_timer_id); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_set_timer, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 65, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_init_2, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 81, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_framerate, __pyx_n_s_now, __pyx_n_s_frame_duration); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_tick, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 87, __pyx_L1_error) __pyx_tuple__16 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_framerate); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_tick_busy_loop, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 105, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_time, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 108, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_rawtime, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 111, __pyx_L1_error) /* "pygame_sdl2/pygame_time.pyx":114 * return self.raw_frametime * * @cython.cdivision(True) # <<<<<<<<<<<<<< * def get_fps(self): * cdef int total_time = sum(self.last_frames) */ __pyx_tuple__21 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_total_time, __pyx_n_s_average_time, __pyx_n_s_average_fps); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_fps, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get; if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_11pygame_time_timer_by_event = ((PyObject*)Py_None); Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_pygame_time(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_pygame_time}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "pygame_time", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initpygame_time(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initpygame_time(void) #else __Pyx_PyMODINIT_FUNC PyInit_pygame_time(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_pygame_time(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_pygame_time(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'pygame_time' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("pygame_time", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "pygame_time" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_pygame_time(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__pygame_time) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.pygame_time")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.pygame_time", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/pygame_time.pyx":20 * * import cython * import math # <<<<<<<<<<<<<< * from sdl2 cimport * * from pygame_sdl2.error import error */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_math, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":22 * import math * from sdl2 cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 22, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":23 * from sdl2 cimport * * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * cdef int timer_id = 0 */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":25 * import pygame_sdl2 * * cdef int timer_id = 0 # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_v_11pygame_sdl2_11pygame_time_timer_id = 0; /* "pygame_sdl2/pygame_time.pyx":27 * cdef int timer_id = 0 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":34 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_3quit, 0, __pyx_n_s_quit, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5get_ticks, 0, __pyx_n_s_get_ticks, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ticks, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_7wait, 0, __pyx_n_s_wait, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_9delay, 0, __pyx_n_s_delay, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_delay, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":63 * * # A map from eventid to SDL_Timer_ID. * cdef dict timer_by_event = { } # <<<<<<<<<<<<<< * * def set_timer(eventid, milliseconds): */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_11set_timer, 0, __pyx_n_s_set_timer, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_timer, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":80 * timer_by_event[eventid] = timer_id * * class Clock: # <<<<<<<<<<<<<< * def __init__(self): * self.last = SDL_GetTicks() */ __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Clock, __pyx_n_s_Clock, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_pygame_time, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_1__init__, 0, __pyx_n_s_Clock___init, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_3tick, 0, __pyx_n_s_Clock_tick, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__16); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_tick, __pyx_t_4) < 0) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop, 0, __pyx_n_s_Clock_tick_busy_loop, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__16); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_tick_busy_loop, __pyx_t_4) < 0) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_7get_time, 0, __pyx_n_s_Clock_get_time, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_time, __pyx_t_4) < 0) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime, 0, __pyx_n_s_Clock_get_rawtime, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_rawtime, __pyx_t_4) < 0) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":114 * return self.raw_frametime * * @cython.cdivision(True) # <<<<<<<<<<<<<< * def get_fps(self): * cdef int total_time = sum(self.last_frames) */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_11get_fps, 0, __pyx_n_s_Clock_get_fps, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_fps, __pyx_t_4) < 0) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/pygame_time.pyx":80 * timer_by_event[eventid] = timer_id * * class Clock: # <<<<<<<<<<<<<< * def __init__(self): * self.last = SDL_GetTicks() */ __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Clock, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Clock, __pyx_t_4) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.pygame_time", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.pygame_time"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *result; PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); if (unlikely(!selfless_args)) return NULL; result = PyObject_Call(method, selfless_args, kwargs); Py_DECREF(selfless_args); return result; } static PyMethodDef __Pyx_UnboundCMethod_Def = { "CythonUnboundCMethod", __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), METH_VARARGS | METH_KEYWORDS, NULL }; static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #else if (likely(!__Pyx_CyOrPyCFunction_Check(method))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } else #endif #if CYTHON_COMPILING_IN_PYPY #else if (PyCFunction_Check(method)) #endif { PyObject *self; int self_found; #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY self = PyObject_GetAttrString(method, "__self__"); if (!self) { PyErr_Clear(); } #else self = PyCFunction_GET_SELF(method); #endif self_found = (self && self != Py_None); #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY Py_XDECREF(self); #endif if (self_found) { PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); if (unlikely(!unbound_method)) return -1; Py_DECREF(method); target->method = unbound_method; } } return 0; } /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { if (likely(cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); #endif } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } return __Pyx__CallUnboundCMethod1(cfunc, self, arg); } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(2, self, arg); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { if (likely(cfunc->func)) { PyObject *args[2] = {arg1, arg2}; if (cfunc->flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } #if PY_VERSION_HEX >= 0x030700A0 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); } #endif static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(3); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg1); PyTuple_SET_ITEM(args, 1, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 2, arg2); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(3, self, arg1, arg2); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* dict_getitem_default */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); if ((1)); #else if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; } Py_INCREF(value); } #endif else { if (default_value == Py_None) value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); else value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* pop_index */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { PyObject *r; if (unlikely(!py_ix)) return NULL; r = __Pyx__PyObject_PopIndex(L, py_ix); Py_DECREF(py_ix); return r; } static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); } #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { Py_ssize_t size = PyList_GET_SIZE(L); if (likely(size > (((PyListObject*)L)->allocated >> 1))) { Py_ssize_t cix = ix; if (cix < 0) { cix += size; } if (likely(__Pyx_is_valid_index(cix, size))) { PyObject* v = PyList_GET_ITEM(L, cix); __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); size -= 1; memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); return v; } } if (py_ix == Py_None) { return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); } else { return __Pyx__PyObject_PopIndex(L, py_ix); } } #endif /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 1; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a == b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) == 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 0; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 0; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal == 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a == (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_EQ)); } /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); #ifdef HAVE_LONG_LONG if (sizeof(PY_LONG_LONG) > sizeof(long)) { PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; return (result >= LONG_MIN && result <= LONG_MAX) ? PyInt_FromLong((long)result) : PyLong_FromLongLong(result); } #endif #if CYTHON_USE_TYPE_SLOTS return PyInt_Type.tp_as_number->nb_multiply(op1, op2); #else return PyNumber_Multiply(op1, op2); #endif } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } } CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); #ifdef HAVE_LONG_LONG lla = a; goto long_long; #else return PyLong_Type.tp_as_number->nb_multiply(op1, op2); #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla * llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("multiply", return NULL) result = ((double)a) * (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #endif /* PyFloatBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) { const double a = floatval; double b, result; CYTHON_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); if (likely(PyFloat_CheckExact(op2))) { #if CYTHON_COMPILING_IN_LIMITED_API b = __pyx_PyFloat_AsDouble(op2); #else b = PyFloat_AS_DOUBLE(op2); #endif if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;} } else #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { b = (double) PyInt_AS_LONG(op2); if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;} } else #endif if (likely(PyLong_CheckExact(op2))) { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsZero(op2)) { b = 0.0; if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;} } else if (__Pyx_PyLong_IsCompact(op2)) { b = (double) __Pyx_PyLong_CompactValue(op2); } else { const digit* digits = __Pyx_PyLong_Digits(op2); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2); switch (size) { case -2: case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -2) b = -b; break; } } CYTHON_FALLTHROUGH; case -3: case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -3) b = -b; break; } } CYTHON_FALLTHROUGH; case -4: case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) { if (size == -4) b = -b; break; } } CYTHON_FALLTHROUGH; default: #endif b = PyLong_AsDouble(op2); if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL; #if !CYTHON_USE_PYLONG_INTERNALS if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;} #endif #if CYTHON_USE_PYLONG_INTERNALS } } #endif } else { return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); } PyFPE_START_PROTECT("divide", return NULL) result = a / b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s_; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint32_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint32_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = v; } v = NULL; val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint32_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint32_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__23); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635908.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.rect.c0000664000175000017500000317000015026112604020024 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__rect #define __PYX_HAVE_API__pygame_sdl2__rect /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/rect.pyx", "src/pygame_sdl2/rect.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* pybytes_as_double.proto */ static double __Pyx_SlowPyString_AsDouble(PyObject *obj); static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length); static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) { char* as_c_string; Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS as_c_string = PyBytes_AS_STRING(obj); size = PyBytes_GET_SIZE(obj); #else if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) { return (double)-1; } #endif return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); } static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) { char* as_c_string; Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS as_c_string = PyByteArray_AS_STRING(obj); size = PyByteArray_GET_SIZE(obj); #else as_c_string = PyByteArray_AsString(obj); if (as_c_string == NULL) { return (double)-1; } size = PyByteArray_Size(obj); #endif return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); } /* pyunicode_as_double.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) { int last_was_punctuation; Py_ssize_t i; last_was_punctuation = 1; for (i=start; i <= end; i++) { Py_UCS4 chr = PyUnicode_READ(kind, data, i); int is_punctuation = (chr == '_') | (chr == '.'); *buffer = (char)chr; buffer += (chr != '_'); if (unlikely(chr > 127)) goto parse_failure; if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure; last_was_punctuation = is_punctuation; } if (unlikely(last_was_punctuation)) goto parse_failure; *buffer = '\0'; return buffer; parse_failure: return NULL; } static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) { int matches = 1; Py_UCS4 chr; Py_UCS4 sign = PyUnicode_READ(kind, data, start); int is_signed = (sign == '-') | (sign == '+'); start += is_signed; length -= is_signed; switch (PyUnicode_READ(kind, data, start)) { #ifdef Py_NAN case 'n': case 'N': if (unlikely(length != 3)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+1); matches &= (chr == 'a') | (chr == 'A'); chr = PyUnicode_READ(kind, data, start+2); matches &= (chr == 'n') | (chr == 'N'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_NAN : Py_NAN; #endif case 'i': case 'I': if (unlikely(length < 3)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+1); matches &= (chr == 'n') | (chr == 'N'); chr = PyUnicode_READ(kind, data, start+2); matches &= (chr == 'f') | (chr == 'F'); if (likely(length == 3 && matches)) return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; if (unlikely(length != 8)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+3); matches &= (chr == 'i') | (chr == 'I'); chr = PyUnicode_READ(kind, data, start+4); matches &= (chr == 'n') | (chr == 'N'); chr = PyUnicode_READ(kind, data, start+5); matches &= (chr == 'i') | (chr == 'I'); chr = PyUnicode_READ(kind, data, start+6); matches &= (chr == 't') | (chr == 'T'); chr = PyUnicode_READ(kind, data, start+7); matches &= (chr == 'y') | (chr == 'Y'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: goto parse_failure; } return 0.0; parse_failure: return -1.0; } static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) { double value; const char *last; char *end; Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj); const int kind = PyUnicode_KIND(obj); const void* data = PyUnicode_DATA(obj); start = 0; while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start))) start++; while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1))) length--; length -= start; if (unlikely(length <= 0)) goto fallback; value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length); if (unlikely(value == -1.0)) goto fallback; if (value != 0.0) return value; if (length < 40) { char number[40]; last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); if (unlikely(!last)) goto fallback; value = PyOS_string_to_double(number, &end, NULL); } else { char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char)); if (unlikely(!number)) goto fallback; last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); if (unlikely(!last)) { PyMem_Free(number); goto fallback; } value = PyOS_string_to_double(number, &end, NULL); PyMem_Free(number); } if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { return value; } fallback: return __Pyx_SlowPyString_AsDouble(obj); } #endif static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) { #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS if (unlikely(__Pyx_PyUnicode_READY(obj) == -1)) return (double)-1; if (likely(PyUnicode_IS_ASCII(obj))) { const char *s; Py_ssize_t length; s = PyUnicode_AsUTF8AndSize(obj, &length); return __Pyx__PyBytes_AsDouble(obj, s, length); } return __Pyx_PyUnicode_AsDouble_WithSpaces(obj); #else return __Pyx_SlowPyString_AsDouble(obj); #endif } /* pynumber_float.proto */ static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj); #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x)) /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ (likely(is_tuple || PyTuple_Check(tuple)) ?\ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.rect" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.rect" extern int __pyx_module_is_main_pygame_sdl2__rect; int __pyx_module_is_main_pygame_sdl2__rect = 0; /* Implementation of "pygame_sdl2.rect" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_range; /* #### Code section: string_decls ### */ static const char __pyx_k_c[] = "c"; static const char __pyx_k_d[] = "d"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__3[] = "*"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k__47[] = "?"; static const char __pyx_k_fit[] = "fit"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_ret[] = "ret"; static const char __pyx_k_top[] = "top"; static const char __pyx_k_val[] = "val"; static const char __pyx_k_zip[] = "zip"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_clip[] = "clip"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_left[] = "left"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_move[] = "move"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_clamp[] = "clamp"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_other[] = "other"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_right[] = "right"; static const char __pyx_k_union[] = "union"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_bottom[] = "bottom"; static const char __pyx_k_center[] = "center"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_factor[] = "factor"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_height[] = "height"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_centerx[] = "centerx"; static const char __pyx_k_centery[] = "centery"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_flatten[] = "flatten"; static const char __pyx_k_h_ratio[] = "h_ratio"; static const char __pyx_k_inflate[] = "inflate"; static const char __pyx_k_move_ip[] = "move_ip"; static const char __pyx_k_topleft[] = "topleft"; static const char __pyx_k_w_ratio[] = "w_ratio"; static const char __pyx_k_Rect_fit[] = "Rect.fit"; static const char __pyx_k_clamp_ip[] = "clamp_ip"; static const char __pyx_k_contains[] = "contains"; static const char __pyx_k_union_ip[] = "union_ip"; static const char __pyx_k_unionall[] = "unionall"; static const char __pyx_k_Rect_clip[] = "Rect.clip"; static const char __pyx_k_Rect_copy[] = "Rect.copy"; static const char __pyx_k_Rect_move[] = "Rect.move"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_normalize[] = "normalize"; static const char __pyx_k_other_seq[] = "other_seq"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_Rect_clamp[] = "Rect.clamp"; static const char __pyx_k_Rect_union[] = "Rect.union"; static const char __pyx_k_inflate_ip[] = "inflate_ip"; static const char __pyx_k_other_dict[] = "other_dict"; static const char __pyx_k_other_list[] = "other_list"; static const char __pyx_k_collections[] = "collections"; static const char __pyx_k_collidedict[] = "collidedict"; static const char __pyx_k_collidelist[] = "collidelist"; static const char __pyx_k_colliderect[] = "colliderect"; static const char __pyx_k_unionall_ip[] = "unionall_ip"; static const char __pyx_k_Rect_inflate[] = "Rect.inflate"; static const char __pyx_k_Rect_move_ip[] = "Rect.move_ip"; static const char __pyx_k_collidepoint[] = "collidepoint"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_rect_d_d_d_d[] = ""; static const char __pyx_k_rects_values[] = "rects_values"; static const char __pyx_k_Rect___reduce[] = "Rect.__reduce__"; static const char __pyx_k_Rect_clamp_ip[] = "Rect.clamp_ip"; static const char __pyx_k_Rect_contains[] = "Rect.contains"; static const char __pyx_k_Rect_union_ip[] = "Rect.union_ip"; static const char __pyx_k_Rect_unionall[] = "Rect.unionall"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_Rect_normalize[] = "Rect.normalize"; static const char __pyx_k_collidedictall[] = "collidedictall"; static const char __pyx_k_collidelistall[] = "collidelistall"; static const char __pyx_k_Rect_inflate_ip[] = "Rect.inflate_ip"; static const char __pyx_k_Rect_collidedict[] = "Rect.collidedict"; static const char __pyx_k_Rect_collidelist[] = "Rect.collidelist"; static const char __pyx_k_Rect_colliderect[] = "Rect.colliderect"; static const char __pyx_k_Rect_unionall_ip[] = "Rect.unionall_ip"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_Rect_collidepoint[] = "Rect.collidepoint"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Rect_collidedictall[] = "Rect.collidedictall"; static const char __pyx_k_Rect_collidelistall[] = "Rect.collidelistall"; static const char __pyx_k_src_pygame_sdl2_rect_pyx[] = "src/pygame_sdl2/rect.pyx"; static const char __pyx_k_Argument_must_be_a_rect_style_ob[] = "Argument must be a rect style object."; static const char __pyx_k_Argument_must_be_a_rect_style_ob_2[] = "Argument {} must be a rect style object."; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_flatten(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static Py_ssize_t __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10__richcmp__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_14__setitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4left_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_3top_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5width_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6height_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5right_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4size_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6center_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_18move(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_30clip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_32union(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_38unionall_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_46collidepoint(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_54collidedict(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_56collidedictall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1x_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1y_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1w_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1h_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_4rect_Rect(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_4rect_Rect; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect; PyObject *__pyx_kp_s_Argument_must_be_a_rect_style_ob; PyObject *__pyx_kp_s_Argument_must_be_a_rect_style_ob_2; PyObject *__pyx_n_s_IndexError; PyObject *__pyx_n_s_Rect; PyObject *__pyx_n_s_Rect___reduce; PyObject *__pyx_n_s_Rect_clamp; PyObject *__pyx_n_s_Rect_clamp_ip; PyObject *__pyx_n_s_Rect_clip; PyObject *__pyx_n_s_Rect_collidedict; PyObject *__pyx_n_s_Rect_collidedictall; PyObject *__pyx_n_s_Rect_collidelist; PyObject *__pyx_n_s_Rect_collidelistall; PyObject *__pyx_n_s_Rect_collidepoint; PyObject *__pyx_n_s_Rect_colliderect; PyObject *__pyx_n_s_Rect_contains; PyObject *__pyx_n_s_Rect_copy; PyObject *__pyx_n_s_Rect_fit; PyObject *__pyx_n_s_Rect_inflate; PyObject *__pyx_n_s_Rect_inflate_ip; PyObject *__pyx_n_s_Rect_move; PyObject *__pyx_n_s_Rect_move_ip; PyObject *__pyx_n_s_Rect_normalize; PyObject *__pyx_n_s_Rect_union; PyObject *__pyx_n_s_Rect_union_ip; PyObject *__pyx_n_s_Rect_unionall; PyObject *__pyx_n_s_Rect_unionall_ip; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s__3; PyObject *__pyx_n_s__47; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_bottom; PyObject *__pyx_n_s_c; PyObject *__pyx_n_s_center; PyObject *__pyx_n_s_centerx; PyObject *__pyx_n_s_centery; PyObject *__pyx_n_s_clamp; PyObject *__pyx_n_s_clamp_ip; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_clip; PyObject *__pyx_n_s_collections; PyObject *__pyx_n_s_collidedict; PyObject *__pyx_n_s_collidedictall; PyObject *__pyx_n_s_collidelist; PyObject *__pyx_n_s_collidelistall; PyObject *__pyx_n_s_collidepoint; PyObject *__pyx_n_s_colliderect; PyObject *__pyx_n_s_contains; PyObject *__pyx_n_s_copy; PyObject *__pyx_n_s_d; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_factor; PyObject *__pyx_n_s_fit; PyObject *__pyx_n_s_flatten; PyObject *__pyx_n_s_format; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_h_ratio; PyObject *__pyx_n_s_height; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_inflate; PyObject *__pyx_n_s_inflate_ip; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_items; PyObject *__pyx_n_s_key; PyObject *__pyx_n_s_left; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_move; PyObject *__pyx_n_s_move_ip; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_normalize; PyObject *__pyx_n_s_other; PyObject *__pyx_n_s_other_dict; PyObject *__pyx_n_s_other_list; PyObject *__pyx_n_s_other_seq; PyObject *__pyx_n_s_pygame_sdl2_rect; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_range; PyObject *__pyx_kp_s_rect_d_d_d_d; PyObject *__pyx_n_s_rects_values; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_ret; PyObject *__pyx_n_s_right; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_rect_pyx; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_top; PyObject *__pyx_n_s_topleft; PyObject *__pyx_n_s_union; PyObject *__pyx_n_s_union_ip; PyObject *__pyx_n_s_unionall; PyObject *__pyx_n_s_unionall_ip; PyObject *__pyx_n_s_val; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_w_ratio; PyObject *__pyx_n_s_width; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_y; PyObject *__pyx_n_s_zip; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_2; PyObject *__pyx_int_3; PyObject *__pyx_int_neg_1; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__26; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__34; PyObject *__pyx_tuple__36; PyObject *__pyx_tuple__38; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__42; PyObject *__pyx_tuple__44; PyObject *__pyx_tuple__45; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__31; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__37; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__43; PyObject *__pyx_codeobj__46; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_4rect_Rect); Py_CLEAR(clear_module_state->__pyx_kp_s_Argument_must_be_a_rect_style_ob); Py_CLEAR(clear_module_state->__pyx_kp_s_Argument_must_be_a_rect_style_ob_2); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); Py_CLEAR(clear_module_state->__pyx_n_s_Rect); Py_CLEAR(clear_module_state->__pyx_n_s_Rect___reduce); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_clamp); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_clamp_ip); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_clip); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_collidedict); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_collidedictall); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_collidelist); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_collidelistall); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_collidepoint); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_colliderect); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_contains); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_copy); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_fit); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_inflate); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_inflate_ip); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_move); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_move_ip); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_normalize); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_union); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_union_ip); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_unionall); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_unionall_ip); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s__3); Py_CLEAR(clear_module_state->__pyx_n_s__47); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_bottom); Py_CLEAR(clear_module_state->__pyx_n_s_c); Py_CLEAR(clear_module_state->__pyx_n_s_center); Py_CLEAR(clear_module_state->__pyx_n_s_centerx); Py_CLEAR(clear_module_state->__pyx_n_s_centery); Py_CLEAR(clear_module_state->__pyx_n_s_clamp); Py_CLEAR(clear_module_state->__pyx_n_s_clamp_ip); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_clip); Py_CLEAR(clear_module_state->__pyx_n_s_collections); Py_CLEAR(clear_module_state->__pyx_n_s_collidedict); Py_CLEAR(clear_module_state->__pyx_n_s_collidedictall); Py_CLEAR(clear_module_state->__pyx_n_s_collidelist); Py_CLEAR(clear_module_state->__pyx_n_s_collidelistall); Py_CLEAR(clear_module_state->__pyx_n_s_collidepoint); Py_CLEAR(clear_module_state->__pyx_n_s_colliderect); Py_CLEAR(clear_module_state->__pyx_n_s_contains); Py_CLEAR(clear_module_state->__pyx_n_s_copy); Py_CLEAR(clear_module_state->__pyx_n_s_d); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_factor); Py_CLEAR(clear_module_state->__pyx_n_s_fit); Py_CLEAR(clear_module_state->__pyx_n_s_flatten); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_h_ratio); Py_CLEAR(clear_module_state->__pyx_n_s_height); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_inflate); Py_CLEAR(clear_module_state->__pyx_n_s_inflate_ip); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_items); Py_CLEAR(clear_module_state->__pyx_n_s_key); Py_CLEAR(clear_module_state->__pyx_n_s_left); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_move); Py_CLEAR(clear_module_state->__pyx_n_s_move_ip); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_normalize); Py_CLEAR(clear_module_state->__pyx_n_s_other); Py_CLEAR(clear_module_state->__pyx_n_s_other_dict); Py_CLEAR(clear_module_state->__pyx_n_s_other_list); Py_CLEAR(clear_module_state->__pyx_n_s_other_seq); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rect); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_kp_s_rect_d_d_d_d); Py_CLEAR(clear_module_state->__pyx_n_s_rects_values); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_ret); Py_CLEAR(clear_module_state->__pyx_n_s_right); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_rect_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_top); Py_CLEAR(clear_module_state->__pyx_n_s_topleft); Py_CLEAR(clear_module_state->__pyx_n_s_union); Py_CLEAR(clear_module_state->__pyx_n_s_union_ip); Py_CLEAR(clear_module_state->__pyx_n_s_unionall); Py_CLEAR(clear_module_state->__pyx_n_s_unionall_ip); Py_CLEAR(clear_module_state->__pyx_n_s_val); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_w_ratio); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_n_s_zip); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_3); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__26); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__34); Py_CLEAR(clear_module_state->__pyx_tuple__36); Py_CLEAR(clear_module_state->__pyx_tuple__38); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__42); Py_CLEAR(clear_module_state->__pyx_tuple__44); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__31); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__37); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__43); Py_CLEAR(clear_module_state->__pyx_codeobj__46); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_4rect_Rect); Py_VISIT(traverse_module_state->__pyx_kp_s_Argument_must_be_a_rect_style_ob); Py_VISIT(traverse_module_state->__pyx_kp_s_Argument_must_be_a_rect_style_ob_2); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); Py_VISIT(traverse_module_state->__pyx_n_s_Rect); Py_VISIT(traverse_module_state->__pyx_n_s_Rect___reduce); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_clamp); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_clamp_ip); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_clip); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_collidedict); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_collidedictall); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_collidelist); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_collidelistall); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_collidepoint); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_colliderect); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_contains); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_copy); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_fit); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_inflate); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_inflate_ip); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_move); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_move_ip); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_normalize); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_union); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_union_ip); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_unionall); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_unionall_ip); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s__3); Py_VISIT(traverse_module_state->__pyx_n_s__47); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_bottom); Py_VISIT(traverse_module_state->__pyx_n_s_c); Py_VISIT(traverse_module_state->__pyx_n_s_center); Py_VISIT(traverse_module_state->__pyx_n_s_centerx); Py_VISIT(traverse_module_state->__pyx_n_s_centery); Py_VISIT(traverse_module_state->__pyx_n_s_clamp); Py_VISIT(traverse_module_state->__pyx_n_s_clamp_ip); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_clip); Py_VISIT(traverse_module_state->__pyx_n_s_collections); Py_VISIT(traverse_module_state->__pyx_n_s_collidedict); Py_VISIT(traverse_module_state->__pyx_n_s_collidedictall); Py_VISIT(traverse_module_state->__pyx_n_s_collidelist); Py_VISIT(traverse_module_state->__pyx_n_s_collidelistall); Py_VISIT(traverse_module_state->__pyx_n_s_collidepoint); Py_VISIT(traverse_module_state->__pyx_n_s_colliderect); Py_VISIT(traverse_module_state->__pyx_n_s_contains); Py_VISIT(traverse_module_state->__pyx_n_s_copy); Py_VISIT(traverse_module_state->__pyx_n_s_d); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_factor); Py_VISIT(traverse_module_state->__pyx_n_s_fit); Py_VISIT(traverse_module_state->__pyx_n_s_flatten); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_h_ratio); Py_VISIT(traverse_module_state->__pyx_n_s_height); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_inflate); Py_VISIT(traverse_module_state->__pyx_n_s_inflate_ip); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_items); Py_VISIT(traverse_module_state->__pyx_n_s_key); Py_VISIT(traverse_module_state->__pyx_n_s_left); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_move); Py_VISIT(traverse_module_state->__pyx_n_s_move_ip); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_normalize); Py_VISIT(traverse_module_state->__pyx_n_s_other); Py_VISIT(traverse_module_state->__pyx_n_s_other_dict); Py_VISIT(traverse_module_state->__pyx_n_s_other_list); Py_VISIT(traverse_module_state->__pyx_n_s_other_seq); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rect); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_kp_s_rect_d_d_d_d); Py_VISIT(traverse_module_state->__pyx_n_s_rects_values); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_ret); Py_VISIT(traverse_module_state->__pyx_n_s_right); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_rect_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_top); Py_VISIT(traverse_module_state->__pyx_n_s_topleft); Py_VISIT(traverse_module_state->__pyx_n_s_union); Py_VISIT(traverse_module_state->__pyx_n_s_union_ip); Py_VISIT(traverse_module_state->__pyx_n_s_unionall); Py_VISIT(traverse_module_state->__pyx_n_s_unionall_ip); Py_VISIT(traverse_module_state->__pyx_n_s_val); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_w_ratio); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_n_s_zip); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_3); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__26); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__34); Py_VISIT(traverse_module_state->__pyx_tuple__36); Py_VISIT(traverse_module_state->__pyx_tuple__38); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__42); Py_VISIT(traverse_module_state->__pyx_tuple__44); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__31); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__37); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__43); Py_VISIT(traverse_module_state->__pyx_codeobj__46); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_4rect_Rect __pyx_mstate_global->__pyx_type_11pygame_sdl2_4rect_Rect #endif #define __pyx_ptype_11pygame_sdl2_4rect_Rect __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_4rect_Rect #define __pyx_kp_s_Argument_must_be_a_rect_style_ob __pyx_mstate_global->__pyx_kp_s_Argument_must_be_a_rect_style_ob #define __pyx_kp_s_Argument_must_be_a_rect_style_ob_2 __pyx_mstate_global->__pyx_kp_s_Argument_must_be_a_rect_style_ob_2 #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError #define __pyx_n_s_Rect __pyx_mstate_global->__pyx_n_s_Rect #define __pyx_n_s_Rect___reduce __pyx_mstate_global->__pyx_n_s_Rect___reduce #define __pyx_n_s_Rect_clamp __pyx_mstate_global->__pyx_n_s_Rect_clamp #define __pyx_n_s_Rect_clamp_ip __pyx_mstate_global->__pyx_n_s_Rect_clamp_ip #define __pyx_n_s_Rect_clip __pyx_mstate_global->__pyx_n_s_Rect_clip #define __pyx_n_s_Rect_collidedict __pyx_mstate_global->__pyx_n_s_Rect_collidedict #define __pyx_n_s_Rect_collidedictall __pyx_mstate_global->__pyx_n_s_Rect_collidedictall #define __pyx_n_s_Rect_collidelist __pyx_mstate_global->__pyx_n_s_Rect_collidelist #define __pyx_n_s_Rect_collidelistall __pyx_mstate_global->__pyx_n_s_Rect_collidelistall #define __pyx_n_s_Rect_collidepoint __pyx_mstate_global->__pyx_n_s_Rect_collidepoint #define __pyx_n_s_Rect_colliderect __pyx_mstate_global->__pyx_n_s_Rect_colliderect #define __pyx_n_s_Rect_contains __pyx_mstate_global->__pyx_n_s_Rect_contains #define __pyx_n_s_Rect_copy __pyx_mstate_global->__pyx_n_s_Rect_copy #define __pyx_n_s_Rect_fit __pyx_mstate_global->__pyx_n_s_Rect_fit #define __pyx_n_s_Rect_inflate __pyx_mstate_global->__pyx_n_s_Rect_inflate #define __pyx_n_s_Rect_inflate_ip __pyx_mstate_global->__pyx_n_s_Rect_inflate_ip #define __pyx_n_s_Rect_move __pyx_mstate_global->__pyx_n_s_Rect_move #define __pyx_n_s_Rect_move_ip __pyx_mstate_global->__pyx_n_s_Rect_move_ip #define __pyx_n_s_Rect_normalize __pyx_mstate_global->__pyx_n_s_Rect_normalize #define __pyx_n_s_Rect_union __pyx_mstate_global->__pyx_n_s_Rect_union #define __pyx_n_s_Rect_union_ip __pyx_mstate_global->__pyx_n_s_Rect_union_ip #define __pyx_n_s_Rect_unionall __pyx_mstate_global->__pyx_n_s_Rect_unionall #define __pyx_n_s_Rect_unionall_ip __pyx_mstate_global->__pyx_n_s_Rect_unionall_ip #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3 #define __pyx_n_s__47 __pyx_mstate_global->__pyx_n_s__47 #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_bottom __pyx_mstate_global->__pyx_n_s_bottom #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c #define __pyx_n_s_center __pyx_mstate_global->__pyx_n_s_center #define __pyx_n_s_centerx __pyx_mstate_global->__pyx_n_s_centerx #define __pyx_n_s_centery __pyx_mstate_global->__pyx_n_s_centery #define __pyx_n_s_clamp __pyx_mstate_global->__pyx_n_s_clamp #define __pyx_n_s_clamp_ip __pyx_mstate_global->__pyx_n_s_clamp_ip #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_clip __pyx_mstate_global->__pyx_n_s_clip #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections #define __pyx_n_s_collidedict __pyx_mstate_global->__pyx_n_s_collidedict #define __pyx_n_s_collidedictall __pyx_mstate_global->__pyx_n_s_collidedictall #define __pyx_n_s_collidelist __pyx_mstate_global->__pyx_n_s_collidelist #define __pyx_n_s_collidelistall __pyx_mstate_global->__pyx_n_s_collidelistall #define __pyx_n_s_collidepoint __pyx_mstate_global->__pyx_n_s_collidepoint #define __pyx_n_s_colliderect __pyx_mstate_global->__pyx_n_s_colliderect #define __pyx_n_s_contains __pyx_mstate_global->__pyx_n_s_contains #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy #define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_factor __pyx_mstate_global->__pyx_n_s_factor #define __pyx_n_s_fit __pyx_mstate_global->__pyx_n_s_fit #define __pyx_n_s_flatten __pyx_mstate_global->__pyx_n_s_flatten #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_h_ratio __pyx_mstate_global->__pyx_n_s_h_ratio #define __pyx_n_s_height __pyx_mstate_global->__pyx_n_s_height #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_inflate __pyx_mstate_global->__pyx_n_s_inflate #define __pyx_n_s_inflate_ip __pyx_mstate_global->__pyx_n_s_inflate_ip #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items #define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key #define __pyx_n_s_left __pyx_mstate_global->__pyx_n_s_left #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_move __pyx_mstate_global->__pyx_n_s_move #define __pyx_n_s_move_ip __pyx_mstate_global->__pyx_n_s_move_ip #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_normalize __pyx_mstate_global->__pyx_n_s_normalize #define __pyx_n_s_other __pyx_mstate_global->__pyx_n_s_other #define __pyx_n_s_other_dict __pyx_mstate_global->__pyx_n_s_other_dict #define __pyx_n_s_other_list __pyx_mstate_global->__pyx_n_s_other_list #define __pyx_n_s_other_seq __pyx_mstate_global->__pyx_n_s_other_seq #define __pyx_n_s_pygame_sdl2_rect __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rect #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_kp_s_rect_d_d_d_d __pyx_mstate_global->__pyx_kp_s_rect_d_d_d_d #define __pyx_n_s_rects_values __pyx_mstate_global->__pyx_n_s_rects_values #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_ret __pyx_mstate_global->__pyx_n_s_ret #define __pyx_n_s_right __pyx_mstate_global->__pyx_n_s_right #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_rect_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_rect_pyx #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_top __pyx_mstate_global->__pyx_n_s_top #define __pyx_n_s_topleft __pyx_mstate_global->__pyx_n_s_topleft #define __pyx_n_s_union __pyx_mstate_global->__pyx_n_s_union #define __pyx_n_s_union_ip __pyx_mstate_global->__pyx_n_s_union_ip #define __pyx_n_s_unionall __pyx_mstate_global->__pyx_n_s_unionall #define __pyx_n_s_unionall_ip __pyx_mstate_global->__pyx_n_s_unionall_ip #define __pyx_n_s_val __pyx_mstate_global->__pyx_n_s_val #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_w_ratio __pyx_mstate_global->__pyx_n_s_w_ratio #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 #define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 /* #### Code section: module_code ### */ /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_1flatten(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_flatten, "flatten(*args)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_1flatten = {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_1flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_flatten}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_1flatten(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flatten (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "flatten", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_flatten(__pyx_self, __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_flatten(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flatten", 1); /* "pygame_sdl2/rect.pyx":23 * * def flatten(*args): * if len(args) == 1: # <<<<<<<<<<<<<< * return args[0] * else: */ __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 23, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":24 * def flatten(*args): * if len(args) == 1: * return args[0] # <<<<<<<<<<<<<< * else: * return args */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":23 * * def flatten(*args): * if len(args) == 1: # <<<<<<<<<<<<<< * return args[0] * else: */ } /* "pygame_sdl2/rect.pyx":26 * return args[0] * else: * return args # <<<<<<<<<<<<<< * * cdef class Rect: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_args); __pyx_r = __pyx_v_args; goto __pyx_L0; } /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":30 * cdef class Rect: * * def __init__(self, *args): # <<<<<<<<<<<<<< * * cdef int x, y, w, h */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { int __pyx_v_x; int __pyx_v_y; int __pyx_v_w; int __pyx_v_h; int __pyx_v_len_args; struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_rect = 0; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_t_12; int __pyx_t_13; int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/rect.pyx":36 * cdef Rect rect * * len_args = len(args) # <<<<<<<<<<<<<< * * if len_args == 1 and isinstance(args[0], Rect): */ __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 36, __pyx_L1_error) __pyx_v_len_args = __pyx_t_1; /* "pygame_sdl2/rect.pyx":38 * len_args = len(args) * * if len_args == 1 and isinstance(args[0], Rect): # <<<<<<<<<<<<<< * rect = args[0] * x = rect.x */ __pyx_t_3 = (__pyx_v_len_args == 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_4, __pyx_ptype_11pygame_sdl2_4rect_Rect); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":39 * * if len_args == 1 and isinstance(args[0], Rect): * rect = args[0] # <<<<<<<<<<<<<< * x = rect.x * y = rect.y */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11pygame_sdl2_4rect_Rect))))) __PYX_ERR(0, 39, __pyx_L1_error) __pyx_v_rect = ((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":40 * if len_args == 1 and isinstance(args[0], Rect): * rect = args[0] * x = rect.x # <<<<<<<<<<<<<< * y = rect.y * w = rect.w */ __pyx_t_5 = __pyx_v_rect->x; __pyx_v_x = __pyx_t_5; /* "pygame_sdl2/rect.pyx":41 * rect = args[0] * x = rect.x * y = rect.y # <<<<<<<<<<<<<< * w = rect.w * h = rect.h */ __pyx_t_5 = __pyx_v_rect->y; __pyx_v_y = __pyx_t_5; /* "pygame_sdl2/rect.pyx":42 * x = rect.x * y = rect.y * w = rect.w # <<<<<<<<<<<<<< * h = rect.h * */ __pyx_t_5 = __pyx_v_rect->w; __pyx_v_w = __pyx_t_5; /* "pygame_sdl2/rect.pyx":43 * y = rect.y * w = rect.w * h = rect.h # <<<<<<<<<<<<<< * * elif len_args == 1 and len(args[0]) == 4: */ __pyx_t_5 = __pyx_v_rect->h; __pyx_v_h = __pyx_t_5; /* "pygame_sdl2/rect.pyx":38 * len_args = len(args) * * if len_args == 1 and isinstance(args[0], Rect): # <<<<<<<<<<<<<< * rect = args[0] * x = rect.x */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":45 * h = rect.h * * elif len_args == 1 and len(args[0]) == 4: # <<<<<<<<<<<<<< * x, y, w, h = args[0] * */ __pyx_t_3 = (__pyx_v_len_args == 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__pyx_t_1 == 4); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":46 * * elif len_args == 1 and len(args[0]) == 4: * x, y, w, h = args[0] # <<<<<<<<<<<<<< * * elif len_args == 1 and len(args[0]) == 2: */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 46, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); __pyx_t_9 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 4) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 46, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_12; __pyx_v_w = __pyx_t_13; __pyx_v_h = __pyx_t_14; /* "pygame_sdl2/rect.pyx":45 * h = rect.h * * elif len_args == 1 and len(args[0]) == 4: # <<<<<<<<<<<<<< * x, y, w, h = args[0] * */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":48 * x, y, w, h = args[0] * * elif len_args == 1 and len(args[0]) == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w = 0 */ __pyx_t_3 = (__pyx_v_len_args == 1); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L10_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__pyx_t_1 == 2); __pyx_t_2 = __pyx_t_3; __pyx_L10_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":49 * * elif len_args == 1 and len(args[0]) == 2: * x, y = args[0] # <<<<<<<<<<<<<< * w = 0 * h = 0 */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 49, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_7), 2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 49, __pyx_L1_error) __pyx_L13_unpacking_done:; } __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) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_x = __pyx_t_14; __pyx_v_y = __pyx_t_13; /* "pygame_sdl2/rect.pyx":50 * elif len_args == 1 and len(args[0]) == 2: * x, y = args[0] * w = 0 # <<<<<<<<<<<<<< * h = 0 * */ __pyx_v_w = 0; /* "pygame_sdl2/rect.pyx":51 * x, y = args[0] * w = 0 * h = 0 # <<<<<<<<<<<<<< * * elif len_args == 2: */ __pyx_v_h = 0; /* "pygame_sdl2/rect.pyx":48 * x, y, w, h = args[0] * * elif len_args == 1 and len(args[0]) == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w = 0 */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":53 * h = 0 * * elif len_args == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w, h = args[1] */ __pyx_t_2 = (__pyx_v_len_args == 2); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":54 * * elif len_args == 2: * x, y = args[0] # <<<<<<<<<<<<<< * w, h = args[1] * */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 54, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_8 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_7), 2) < 0) __PYX_ERR(0, 54, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 54, __pyx_L1_error) __pyx_L15_unpacking_done:; } __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_x = __pyx_t_13; __pyx_v_y = __pyx_t_14; /* "pygame_sdl2/rect.pyx":55 * elif len_args == 2: * x, y = args[0] * w, h = args[1] # <<<<<<<<<<<<<< * * elif len_args == 4: */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 55, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_7), 2) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L17_unpacking_done; __pyx_L16_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 55, __pyx_L1_error) __pyx_L17_unpacking_done:; } __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) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_w = __pyx_t_14; __pyx_v_h = __pyx_t_13; /* "pygame_sdl2/rect.pyx":53 * h = 0 * * elif len_args == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w, h = args[1] */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":57 * w, h = args[1] * * elif len_args == 4: # <<<<<<<<<<<<<< * x, y, w, h = args * */ __pyx_t_2 = (__pyx_v_len_args == 4); if (likely(__pyx_t_2)) { /* "pygame_sdl2/rect.pyx":58 * * elif len_args == 4: * x, y, w, h = args # <<<<<<<<<<<<<< * * else: */ if (1) { PyObject* sequence = __pyx_v_args; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 58, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_8,&__pyx_t_9,&__pyx_t_7}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_x = __pyx_t_13; __pyx_v_y = __pyx_t_14; __pyx_v_w = __pyx_t_12; __pyx_v_h = __pyx_t_5; /* "pygame_sdl2/rect.pyx":57 * w, h = args[1] * * elif len_args == 4: # <<<<<<<<<<<<<< * x, y, w, h = args * */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":61 * * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< * * self.x = x */ /*else*/ { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(0, 61, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/rect.pyx":63 * raise TypeError("Argument must be a rect style object.") * * self.x = x # <<<<<<<<<<<<<< * self.y = y * self.w = w */ __pyx_v_self->x = __pyx_v_x; /* "pygame_sdl2/rect.pyx":64 * * self.x = x * self.y = y # <<<<<<<<<<<<<< * self.w = w * self.h = h */ __pyx_v_self->y = __pyx_v_y; /* "pygame_sdl2/rect.pyx":65 * self.x = x * self.y = y * self.w = w # <<<<<<<<<<<<<< * self.h = h * */ __pyx_v_self->w = __pyx_v_w; /* "pygame_sdl2/rect.pyx":66 * self.y = y * self.w = w * self.h = h # <<<<<<<<<<<<<< * * def __reduce__(self): */ __pyx_v_self->h = __pyx_v_h; /* "pygame_sdl2/rect.pyx":30 * cdef class Rect: * * def __init__(self, *args): # <<<<<<<<<<<<<< * * cdef int x, y, w, h */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rect); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":68 * self.h = h * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Rect, (self.x, self.y, self.w, self.h)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_2__reduce__, "Rect.__reduce__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_3__reduce__ = {"__reduce__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_2__reduce__}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 1); /* "pygame_sdl2/rect.pyx":69 * * def __reduce__(self): * return (Rect, (self.x, self.y, self.w, self.h)) # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect); __Pyx_GIVEREF((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect))) __PYX_ERR(0, 69, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":68 * self.h = h * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Rect, (self.x, self.y, self.w, self.h)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":71 * return (Rect, (self.x, self.y, self.w, self.h)) * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.x, self.y, self.w, self.h) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/rect.pyx":72 * * def __repr__(self): * return "" % (self.x, self.y, self.w, self.h) # <<<<<<<<<<<<<< * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_rect_d_d_d_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":71 * return (Rect, (self.x, self.y, self.w, self.h)) * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.x, self.y, self.w, self.h) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":74 * return "" % (self.x, self.y, self.w, self.h) * * def __len__(self): # <<<<<<<<<<<<<< * return 4 * */ /* Python wrapper */ static Py_ssize_t __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { Py_ssize_t __pyx_r; /* "pygame_sdl2/rect.pyx":75 * * def __len__(self): * return 4 # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_r = 4; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":74 * return "" % (self.x, self.y, self.w, self.h) * * def __len__(self): # <<<<<<<<<<<<<< * return 4 * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pyx":77 * return 4 * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.w, self.h)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 1); /* "pygame_sdl2/rect.pyx":78 * * def __iter__(self): * return iter((self.x, self.y, self.w, self.h)) # <<<<<<<<<<<<<< * * def __richcmp__(Rect a, b, int op): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":77 * return 4 * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.w, self.h)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":80 * return iter((self.x, self.y, self.w, self.h)) * * def __richcmp__(Rect a, b, int op): # <<<<<<<<<<<<<< * if not isinstance(b, Rect): * b = Rect(b) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10__richcmp__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_a), ((PyObject *)__pyx_v_b), ((int)__pyx_v_op)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10__richcmp__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 0); __Pyx_INCREF(__pyx_v_b); /* "pygame_sdl2/rect.pyx":81 * * def __richcmp__(Rect a, b, int op): * if not isinstance(b, Rect): # <<<<<<<<<<<<<< * b = Rect(b) * if op == 2: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":82 * def __richcmp__(Rect a, b, int op): * if not isinstance(b, Rect): * b = Rect(b) # <<<<<<<<<<<<<< * if op == 2: * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":81 * * def __richcmp__(Rect a, b, int op): * if not isinstance(b, Rect): # <<<<<<<<<<<<<< * b = Rect(b) * if op == 2: */ } /* "pygame_sdl2/rect.pyx":83 * if not isinstance(b, Rect): * b = Rect(b) * if op == 2: # <<<<<<<<<<<<<< * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * */ __pyx_t_2 = (__pyx_v_op == 2); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":84 * b = Rect(b) * if op == 2: * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_a->x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_a->y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_a->w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_a->h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_L5_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":83 * if not isinstance(b, Rect): * b = Rect(b) * if op == 2: # <<<<<<<<<<<<<< * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * */ } /* "pygame_sdl2/rect.pyx":80 * return iter((self.x, self.y, self.w, self.h)) * * def __richcmp__(Rect a, b, int op): # <<<<<<<<<<<<<< * if not isinstance(b, Rect): * b = Rect(b) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_b); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":86 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return (self.x, self.y, self.w, self.h)[key] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "pygame_sdl2/rect.pyx":87 * * def __getitem__(self, key): * return (self.x, self.y, self.w, self.h)[key] # <<<<<<<<<<<<<< * * def __setitem__(self, key, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":86 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return (self.x, self.y, self.w, self.h)[key] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":89 * return (self.x, self.y, self.w, self.h)[key] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if key == 0: * self.x = val */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_14__setitem__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_14__setitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); /* "pygame_sdl2/rect.pyx":90 * * def __setitem__(self, key, val): * if key == 0: # <<<<<<<<<<<<<< * self.x = val * elif key == 1: */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 90, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":91 * def __setitem__(self, key, val): * if key == 0: * self.x = val # <<<<<<<<<<<<<< * elif key == 1: * self.y = val */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error) __pyx_v_self->x = __pyx_t_2; /* "pygame_sdl2/rect.pyx":90 * * def __setitem__(self, key, val): * if key == 0: # <<<<<<<<<<<<<< * self.x = val * elif key == 1: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":92 * if key == 0: * self.x = val * elif key == 1: # <<<<<<<<<<<<<< * self.y = val * elif key == 2: */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 92, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":93 * self.x = val * elif key == 1: * self.y = val # <<<<<<<<<<<<<< * elif key == 2: * self.w = val */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) __pyx_v_self->y = __pyx_t_2; /* "pygame_sdl2/rect.pyx":92 * if key == 0: * self.x = val * elif key == 1: # <<<<<<<<<<<<<< * self.y = val * elif key == 2: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":94 * elif key == 1: * self.y = val * elif key == 2: # <<<<<<<<<<<<<< * self.w = val * elif key == 3: */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_2, 2, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 94, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":95 * self.y = val * elif key == 2: * self.w = val # <<<<<<<<<<<<<< * elif key == 3: * self.h = val */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error) __pyx_v_self->w = __pyx_t_2; /* "pygame_sdl2/rect.pyx":94 * elif key == 1: * self.y = val * elif key == 2: # <<<<<<<<<<<<<< * self.w = val * elif key == 3: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":96 * elif key == 2: * self.w = val * elif key == 3: # <<<<<<<<<<<<<< * self.h = val * else: */ __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_key, __pyx_int_3, 3, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 96, __pyx_L1_error) if (likely(__pyx_t_1)) { /* "pygame_sdl2/rect.pyx":97 * self.w = val * elif key == 3: * self.h = val # <<<<<<<<<<<<<< * else: * raise IndexError(key) */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error) __pyx_v_self->h = __pyx_t_2; /* "pygame_sdl2/rect.pyx":96 * elif key == 2: * self.w = val * elif key == 3: # <<<<<<<<<<<<<< * self.h = val * else: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":99 * self.h = val * else: * raise IndexError(key) # <<<<<<<<<<<<<< * * property left: */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 99, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/rect.pyx":89 * return (self.x, self.y, self.w, self.h)[key] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if key == 0: * self.x = val */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":102 * * property left: * def __get__(self): # <<<<<<<<<<<<<< * return self.x * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":103 * property left: * def __get__(self): * return self.x # <<<<<<<<<<<<<< * def __set__(self, val): * self.x = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":102 * * property left: * def __get__(self): # <<<<<<<<<<<<<< * return self.x * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.left.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":104 * def __get__(self): * return self.x * def __set__(self, val): # <<<<<<<<<<<<<< * self.x = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4left_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4left_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/rect.pyx":105 * return self.x * def __set__(self, val): * self.x = val # <<<<<<<<<<<<<< * * property top: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) __pyx_v_self->x = __pyx_t_1; /* "pygame_sdl2/rect.pyx":104 * def __get__(self): * return self.x * def __set__(self, val): # <<<<<<<<<<<<<< * self.x = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.left.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pyx":108 * * property top: * def __get__(self): # <<<<<<<<<<<<<< * return self.y * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":109 * property top: * def __get__(self): * return self.y # <<<<<<<<<<<<<< * def __set__(self, val): * self.y = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":108 * * property top: * def __get__(self): # <<<<<<<<<<<<<< * return self.y * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.top.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":110 * def __get__(self): * return self.y * def __set__(self, val): # <<<<<<<<<<<<<< * self.y = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_3top_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_3top_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/rect.pyx":111 * return self.y * def __set__(self, val): * self.y = val # <<<<<<<<<<<<<< * * property width: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_v_self->y = __pyx_t_1; /* "pygame_sdl2/rect.pyx":110 * def __get__(self): * return self.y * def __set__(self, val): # <<<<<<<<<<<<<< * self.y = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.top.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pyx":114 * * property width: * def __get__(self): # <<<<<<<<<<<<<< * return self.w * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":115 * property width: * def __get__(self): * return self.w # <<<<<<<<<<<<<< * def __set__(self, val): * self.w = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":114 * * property width: * def __get__(self): # <<<<<<<<<<<<<< * return self.w * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":116 * def __get__(self): * return self.w * def __set__(self, val): # <<<<<<<<<<<<<< * self.w = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5width_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5width_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/rect.pyx":117 * return self.w * def __set__(self, val): * self.w = val # <<<<<<<<<<<<<< * * property height: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error) __pyx_v_self->w = __pyx_t_1; /* "pygame_sdl2/rect.pyx":116 * def __get__(self): * return self.w * def __set__(self, val): # <<<<<<<<<<<<<< * self.w = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pyx":120 * * property height: * def __get__(self): # <<<<<<<<<<<<<< * return self.h * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":121 * property height: * def __get__(self): * return self.h # <<<<<<<<<<<<<< * def __set__(self, val): * self.h = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":120 * * property height: * def __get__(self): # <<<<<<<<<<<<<< * return self.h * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.height.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":122 * def __get__(self): * return self.h * def __set__(self, val): # <<<<<<<<<<<<<< * self.h = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6height_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6height_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/rect.pyx":123 * return self.h * def __set__(self, val): * self.h = val # <<<<<<<<<<<<<< * * property right: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error) __pyx_v_self->h = __pyx_t_1; /* "pygame_sdl2/rect.pyx":122 * def __get__(self): * return self.h * def __set__(self, val): # <<<<<<<<<<<<<< * self.h = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.height.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pyx":126 * * property right: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + self.width * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":127 * property right: * def __get__(self): * return self.x + self.width # <<<<<<<<<<<<<< * def __set__(self, val): * self.x += val - self.right */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":126 * * property right: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + self.width * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.right.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":128 * def __get__(self): * return self.x + self.width * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.right * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5right_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5right_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":129 * return self.x + self.width * def __set__(self, val): * self.x += val - self.right # <<<<<<<<<<<<<< * * property bottom: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->x = __pyx_t_4; /* "pygame_sdl2/rect.pyx":128 * def __get__(self): * return self.x + self.width * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.right * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.right.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":132 * * property bottom: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + self.height * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":133 * property bottom: * def __get__(self): * return self.y + self.height # <<<<<<<<<<<<<< * def __set__(self, val): * self.y += val - self.bottom */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_height); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":132 * * property bottom: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + self.height * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":134 * def __get__(self): * return self.y + self.height * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.bottom * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":135 * return self.y + self.height * def __set__(self, val): * self.y += val - self.bottom # <<<<<<<<<<<<<< * * property size: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->y = __pyx_t_4; /* "pygame_sdl2/rect.pyx":134 * def __get__(self): * return self.y + self.height * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.bottom * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":138 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return (self.w, self.h) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":139 * property size: * def __get__(self): * return (self.w, self.h) # <<<<<<<<<<<<<< * def __set__(self, val): * self.w, self.h = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":138 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return (self.w, self.h) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":140 * def __get__(self): * return (self.w, self.h) * def __set__(self, val): # <<<<<<<<<<<<<< * self.w, self.h = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4size_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4size_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":141 * return (self.w, self.h) * def __set__(self, val): * self.w, self.h = val # <<<<<<<<<<<<<< * * property topleft: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 141, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 141, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 141, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->w = __pyx_t_5; __pyx_v_self->h = __pyx_t_6; /* "pygame_sdl2/rect.pyx":140 * def __get__(self): * return (self.w, self.h) * def __set__(self, val): # <<<<<<<<<<<<<< * self.w, self.h = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":144 * * property topleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.top) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":145 * property topleft: * def __get__(self): * return (self.left, self.top) # <<<<<<<<<<<<<< * def __set__(self, val): * self.left, self.top = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":144 * * property topleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.top) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":146 * def __get__(self): * return (self.left, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.top = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":147 * return (self.left, self.top) * def __set__(self, val): * self.left, self.top = val # <<<<<<<<<<<<<< * * property topright: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 147, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 147, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":146 * def __get__(self): * return (self.left, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.top = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":150 * * property topright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.top) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":151 * property topright: * def __get__(self): * return (self.right, self.top) # <<<<<<<<<<<<<< * def __set__(self, val): * self.right, self.top = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":150 * * property topright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.top) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":152 * def __get__(self): * return (self.right, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.top = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":153 * return (self.right, self.top) * def __set__(self, val): * self.right, self.top = val # <<<<<<<<<<<<<< * * property bottomright: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 153, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 153, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":152 * def __get__(self): * return (self.right, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.top = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":156 * * property bottomright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.bottom) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":157 * property bottomright: * def __get__(self): * return (self.right, self.bottom) # <<<<<<<<<<<<<< * def __set__(self, val): * self.right, self.bottom = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":156 * * property bottomright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.bottom) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":158 * def __get__(self): * return (self.right, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.bottom = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":159 * return (self.right, self.bottom) * def __set__(self, val): * self.right, self.bottom = val # <<<<<<<<<<<<<< * * property bottomleft: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 159, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 159, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":158 * def __get__(self): * return (self.right, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.bottom = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":162 * * property bottomleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.bottom) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":163 * property bottomleft: * def __get__(self): * return (self.left, self.bottom) # <<<<<<<<<<<<<< * def __set__(self, val): * self.left, self.bottom = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":162 * * property bottomleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.bottom) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":164 * def __get__(self): * return (self.left, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.bottom = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":165 * return (self.left, self.bottom) * def __set__(self, val): * self.left, self.bottom = val # <<<<<<<<<<<<<< * * property centerx: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 165, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 165, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":164 * def __get__(self): * return (self.left, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.bottom = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":168 * * property centerx: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + (self.w / 2) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":169 * property centerx: * def __get__(self): * return self.x + (self.w / 2) # <<<<<<<<<<<<<< * def __set__(self, val): * self.x += val - self.centerx */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->x + (((double)__pyx_v_self->w) / 2.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":168 * * property centerx: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + (self.w / 2) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centerx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":170 * def __get__(self): * return self.x + (self.w / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.centerx * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":171 * return self.x + (self.w / 2) * def __set__(self, val): * self.x += val - self.centerx # <<<<<<<<<<<<<< * * property centery: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->x = __pyx_t_4; /* "pygame_sdl2/rect.pyx":170 * def __get__(self): * return self.x + (self.w / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.centerx * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centerx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":174 * * property centery: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + (self.h / 2) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":175 * property centery: * def __get__(self): * return self.y + (self.h / 2) # <<<<<<<<<<<<<< * def __set__(self, val): * self.y += val - self.centery */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->y + (((double)__pyx_v_self->h) / 2.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":174 * * property centery: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + (self.h / 2) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centery.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":176 * def __get__(self): * return self.y + (self.h / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.centery * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":177 * return self.y + (self.h / 2) * def __set__(self, val): * self.y += val - self.centery # <<<<<<<<<<<<<< * * property center: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->y = __pyx_t_4; /* "pygame_sdl2/rect.pyx":176 * def __get__(self): * return self.y + (self.h / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.centery * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centery.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":180 * * property center: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.centery) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":181 * property center: * def __get__(self): * return (self.centerx, self.centery) # <<<<<<<<<<<<<< * def __set__(self, val): * self.centerx, self.centery = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":180 * * property center: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.centery) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.center.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":182 * def __get__(self): * return (self.centerx, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.centery = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6center_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6center_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":183 * return (self.centerx, self.centery) * def __set__(self, val): * self.centerx, self.centery = val # <<<<<<<<<<<<<< * * property midtop: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 183, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 183, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 183, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":182 * def __get__(self): * return (self.centerx, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.centery = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.center.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":186 * * property midtop: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.top) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":187 * property midtop: * def __get__(self): * return (self.centerx, self.top) # <<<<<<<<<<<<<< * def __set__(self, val): * self.centerx, self.top = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":186 * * property midtop: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.top) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midtop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":188 * def __get__(self): * return (self.centerx, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.top = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":189 * return (self.centerx, self.top) * def __set__(self, val): * self.centerx, self.top = val # <<<<<<<<<<<<<< * * property midleft: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 189, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 189, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 189, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":188 * def __get__(self): * return (self.centerx, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.top = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midtop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":192 * * property midleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.centery) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":193 * property midleft: * def __get__(self): * return (self.left, self.centery) # <<<<<<<<<<<<<< * def __set__(self, val): * self.left, self.centery = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":192 * * property midleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.centery) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":194 * def __get__(self): * return (self.left, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.centery = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":195 * return (self.left, self.centery) * def __set__(self, val): * self.left, self.centery = val # <<<<<<<<<<<<<< * * property midbottom: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 195, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 195, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 195, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":194 * def __get__(self): * return (self.left, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.centery = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":198 * * property midbottom: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.bottom) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":199 * property midbottom: * def __get__(self): * return (self.centerx, self.bottom) # <<<<<<<<<<<<<< * def __set__(self, val): * self.centerx, self.bottom = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":198 * * property midbottom: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.bottom) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midbottom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":200 * def __get__(self): * return (self.centerx, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.bottom = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":201 * return (self.centerx, self.bottom) * def __set__(self, val): * self.centerx, self.bottom = val # <<<<<<<<<<<<<< * * property midright: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 201, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 201, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 201, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":200 * def __get__(self): * return (self.centerx, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.bottom = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midbottom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":204 * * property midright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.centery) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/rect.pyx":205 * property midright: * def __get__(self): * return (self.right, self.centery) # <<<<<<<<<<<<<< * def __set__(self, val): * self.right, self.centery = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":204 * * property midright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.centery) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":206 * def __get__(self): * return (self.right, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.centery = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/rect.pyx":207 * return (self.right, self.centery) * def __set__(self, val): * self.right, self.centery = val # <<<<<<<<<<<<<< * * def copy(self): */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 207, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 207, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 207, __pyx_L1_error) __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":206 * def __get__(self): * return (self.right, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.centery = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":209 * self.right, self.centery = val * * def copy(self): # <<<<<<<<<<<<<< * return Rect(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_16copy, "Rect.copy(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_17copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_16copy}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); /* "pygame_sdl2/rect.pyx":210 * * def copy(self): * return Rect(self) # <<<<<<<<<<<<<< * * def move(self, *args): */ __Pyx_XDECREF(__pyx_r); __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) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":209 * self.right, self.centery = val * * def copy(self): # <<<<<<<<<<<<<< * return Rect(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":212 * return Rect(self) * * def move(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.move_ip(*args) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_19move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_18move, "Rect.move(self, *args)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_19move = {"move", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_19move, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_18move}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_19move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("move (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "move", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_18move(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_18move(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("move", 1); /* "pygame_sdl2/rect.pyx":213 * * def move(self, *args): * r = self.copy() # <<<<<<<<<<<<<< * r.move_ip(*args) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":214 * def move(self, *args): * r = self.copy() * r.move_ip(*args) # <<<<<<<<<<<<<< * return r * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_move_ip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":215 * r = self.copy() * r.move_ip(*args) * return r # <<<<<<<<<<<<<< * * def move_ip(self, *args): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":212 * return Rect(self) * * def move(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.move_ip(*args) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.move", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":217 * return r * * def move_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * self.x += x */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_20move_ip, "Rect.move_ip(self, *args)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_21move_ip = {"move_ip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_20move_ip}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("move_ip (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "move_ip", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("move_ip", 1); /* "pygame_sdl2/rect.pyx":218 * * def move_ip(self, *args): * x, y = flatten(args) # <<<<<<<<<<<<<< * self.x += x * self.y += y */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_args}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 218, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 218, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 218, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":219 * def move_ip(self, *args): * x, y = flatten(args) * self.x += x # <<<<<<<<<<<<<< * self.y += y * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->x = __pyx_t_7; /* "pygame_sdl2/rect.pyx":220 * x, y = flatten(args) * self.x += x * self.y += y # <<<<<<<<<<<<<< * * def inflate(self, *args): */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->y = __pyx_t_7; /* "pygame_sdl2/rect.pyx":217 * return r * * def move_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * self.x += x */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.move_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":222 * self.y += y * * def inflate(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.inflate_ip(*args) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_22inflate, "Rect.inflate(self, *args)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_23inflate = {"inflate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_22inflate}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("inflate (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "inflate", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("inflate", 1); /* "pygame_sdl2/rect.pyx":223 * * def inflate(self, *args): * r = self.copy() # <<<<<<<<<<<<<< * r.inflate_ip(*args) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":224 * def inflate(self, *args): * r = self.copy() * r.inflate_ip(*args) # <<<<<<<<<<<<<< * return r * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_inflate_ip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":225 * r = self.copy() * r.inflate_ip(*args) * return r # <<<<<<<<<<<<<< * * def inflate_ip(self, *args): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":222 * self.y += y * * def inflate(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.inflate_ip(*args) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.inflate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":227 * return r * * def inflate_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * c = self.center */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_24inflate_ip, "Rect.inflate_ip(self, *args)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_25inflate_ip = {"inflate_ip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_24inflate_ip}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("inflate_ip (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "inflate_ip", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("inflate_ip", 1); /* "pygame_sdl2/rect.pyx":228 * * def inflate_ip(self, *args): * x, y = flatten(args) # <<<<<<<<<<<<<< * c = self.center * self.w += x */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_args}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 228, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 228, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 228, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":229 * def inflate_ip(self, *args): * x, y = flatten(args) * c = self.center # <<<<<<<<<<<<<< * self.w += x * self.h += y */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":230 * x, y = flatten(args) * c = self.center * self.w += x # <<<<<<<<<<<<<< * self.h += y * self.center = c */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->w = __pyx_t_7; /* "pygame_sdl2/rect.pyx":231 * c = self.center * self.w += x * self.h += y # <<<<<<<<<<<<<< * self.center = c * */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->h = __pyx_t_7; /* "pygame_sdl2/rect.pyx":232 * self.w += x * self.h += y * self.center = c # <<<<<<<<<<<<<< * * def clamp(self, other): */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center, __pyx_v_c) < 0) __PYX_ERR(0, 232, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":227 * return r * * def inflate_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * c = self.center */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.inflate_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":234 * self.center = c * * def clamp(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.clamp_ip(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_26clamp, "Rect.clamp(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_27clamp = {"clamp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_26clamp}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clamp (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clamp") < 0)) __PYX_ERR(0, 234, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clamp", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 234, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clamp", 1); /* "pygame_sdl2/rect.pyx":235 * * def clamp(self, other): * r = self.copy() # <<<<<<<<<<<<<< * r.clamp_ip(other) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":236 * def clamp(self, other): * r = self.copy() * r.clamp_ip(other) # <<<<<<<<<<<<<< * return r * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_clamp_ip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_other}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":237 * r = self.copy() * r.clamp_ip(other) * return r # <<<<<<<<<<<<<< * * def clamp_ip(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":234 * self.center = c * * def clamp(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.clamp_ip(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":239 * return r * * def clamp_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_28clamp_ip, "Rect.clamp_ip(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_29clamp_ip = {"clamp_ip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_28clamp_ip}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clamp_ip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clamp_ip") < 0)) __PYX_ERR(0, 239, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clamp_ip", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 239, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clamp_ip", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":240 * * def clamp_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":241 * def clamp_ip(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * if self.w > other.w or self.h > other.h: */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":240 * * def clamp_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":243 * other = Rect(other) * * if self.w > other.w or self.h > other.h: # <<<<<<<<<<<<<< * self.center = other.center * else: */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":244 * * if self.w > other.w or self.h > other.h: * self.center = other.center # <<<<<<<<<<<<<< * else: * if self.left < other.left: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_center); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center, __pyx_t_3) < 0) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":243 * other = Rect(other) * * if self.w > other.w or self.h > other.h: # <<<<<<<<<<<<<< * self.center = other.center * else: */ goto __pyx_L4; } /* "pygame_sdl2/rect.pyx":246 * self.center = other.center * else: * if self.left < other.left: # <<<<<<<<<<<<<< * self.left = other.left * elif self.right > other.right: */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":247 * else: * if self.left < other.left: * self.left = other.left # <<<<<<<<<<<<<< * elif self.right > other.right: * self.right = other.right */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_5) < 0) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":246 * self.center = other.center * else: * if self.left < other.left: # <<<<<<<<<<<<<< * self.left = other.left * elif self.right > other.right: */ goto __pyx_L7; } /* "pygame_sdl2/rect.pyx":248 * if self.left < other.left: * self.left = other.left * elif self.right > other.right: # <<<<<<<<<<<<<< * self.right = other.right * if self.top < other.top: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":249 * self.left = other.left * elif self.right > other.right: * self.right = other.right # <<<<<<<<<<<<<< * if self.top < other.top: * self.top = other.top */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_3) < 0) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":248 * if self.left < other.left: * self.left = other.left * elif self.right > other.right: # <<<<<<<<<<<<<< * self.right = other.right * if self.top < other.top: */ } __pyx_L7:; /* "pygame_sdl2/rect.pyx":250 * elif self.right > other.right: * self.right = other.right * if self.top < other.top: # <<<<<<<<<<<<<< * self.top = other.top * elif self.bottom > other.bottom: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":251 * self.right = other.right * if self.top < other.top: * self.top = other.top # <<<<<<<<<<<<<< * elif self.bottom > other.bottom: * self.bottom = other.bottom */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_5) < 0) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":250 * elif self.right > other.right: * self.right = other.right * if self.top < other.top: # <<<<<<<<<<<<<< * self.top = other.top * elif self.bottom > other.bottom: */ goto __pyx_L8; } /* "pygame_sdl2/rect.pyx":252 * if self.top < other.top: * self.top = other.top * elif self.bottom > other.bottom: # <<<<<<<<<<<<<< * self.bottom = other.bottom * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":253 * self.top = other.top * elif self.bottom > other.bottom: * self.bottom = other.bottom # <<<<<<<<<<<<<< * * def clip(self, other, y=None, w=None, h=None): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_3) < 0) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":252 * if self.top < other.top: * self.top = other.top * elif self.bottom > other.bottom: # <<<<<<<<<<<<<< * self.bottom = other.bottom * */ } __pyx_L8:; } __pyx_L4:; /* "pygame_sdl2/rect.pyx":239 * return r * * def clamp_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":255 * self.bottom = other.bottom * * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<< * if type(other) == int: * other = Rect(other, y, w, h) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_30clip, "Rect.clip(self, other, y=None, w=None, h=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_31clip = {"clip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_30clip}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_w = 0; PyObject *__pyx_v_h = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_h,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_h); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clip") < 0)) __PYX_ERR(0, 255, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_other = values[0]; __pyx_v_y = values[1]; __pyx_v_w = values[2]; __pyx_v_h = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clip", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 255, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_30clip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other, __pyx_v_y, __pyx_v_w, __pyx_v_h); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_30clip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_d = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clip", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":256 * * def clip(self, other, y=None, w=None, h=None): * if type(other) == int: # <<<<<<<<<<<<<< * other = Rect(other, y, w, h) * */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_other)), ((PyObject *)(&PyInt_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":257 * def clip(self, other, y=None, w=None, h=None): * if type(other) == int: * other = Rect(other, y, w, h) # <<<<<<<<<<<<<< * * if not isinstance(other, Rect): */ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other)) __PYX_ERR(0, 257, __pyx_L1_error); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y)) __PYX_ERR(0, 257, __pyx_L1_error); __Pyx_INCREF(__pyx_v_w); __Pyx_GIVEREF(__pyx_v_w); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_w)) __PYX_ERR(0, 257, __pyx_L1_error); __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_h)) __PYX_ERR(0, 257, __pyx_L1_error); __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":256 * * def clip(self, other, y=None, w=None, h=None): * if type(other) == int: # <<<<<<<<<<<<<< * other = Rect(other, y, w, h) * */ } /* "pygame_sdl2/rect.pyx":259 * other = Rect(other, y, w, h) * * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_4 = (!__pyx_t_2); if (__pyx_t_4) { /* "pygame_sdl2/rect.pyx":260 * * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * if not self.colliderect(other): */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":259 * other = Rect(other, y, w, h) * * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":262 * other = Rect(other) * * if not self.colliderect(other): # <<<<<<<<<<<<<< * return Rect(0,0,0,0) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_other}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = (!__pyx_t_4); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":263 * * if not self.colliderect(other): * return Rect(0,0,0,0) # <<<<<<<<<<<<<< * * r = self.copy() */ __Pyx_XDECREF(__pyx_r); __pyx_t_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) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":262 * other = Rect(other) * * if not self.colliderect(other): # <<<<<<<<<<<<<< * return Rect(0,0,0,0) * */ } /* "pygame_sdl2/rect.pyx":265 * return Rect(0,0,0,0) * * r = self.copy() # <<<<<<<<<<<<<< * * # Remember that (0,0) is the top left. */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":268 * * # Remember that (0,0) is the top left. * if r.left < other.left: # <<<<<<<<<<<<<< * d = other.left - r.left * r.left += d */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":269 * # Remember that (0,0) is the top left. * if r.left < other.left: * d = other.left - r.left # <<<<<<<<<<<<<< * r.left += d * r.width -= d */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_d = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":270 * if r.left < other.left: * d = other.left - r.left * r.left += d # <<<<<<<<<<<<<< * r.width -= d * if r.right > other.right: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_left, __pyx_t_1) < 0) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":271 * d = other.left - r.left * r.left += d * r.width -= d # <<<<<<<<<<<<<< * if r.right > other.right: * d = r.right - other.right */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_3) < 0) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":268 * * # Remember that (0,0) is the top left. * if r.left < other.left: # <<<<<<<<<<<<<< * d = other.left - r.left * r.left += d */ } /* "pygame_sdl2/rect.pyx":272 * r.left += d * r.width -= d * if r.right > other.right: # <<<<<<<<<<<<<< * d = r.right - other.right * r.width -=d */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":273 * r.width -= d * if r.right > other.right: * d = r.right - other.right # <<<<<<<<<<<<<< * r.width -=d * if r.top < other.top: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":274 * if r.right > other.right: * d = r.right - other.right * r.width -=d # <<<<<<<<<<<<<< * if r.top < other.top: * d = other.top - r.top */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_1) < 0) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":272 * r.left += d * r.width -= d * if r.right > other.right: # <<<<<<<<<<<<<< * d = r.right - other.right * r.width -=d */ } /* "pygame_sdl2/rect.pyx":275 * d = r.right - other.right * r.width -=d * if r.top < other.top: # <<<<<<<<<<<<<< * d = other.top - r.top * r.top += d */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __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) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":276 * r.width -=d * if r.top < other.top: * d = other.top - r.top # <<<<<<<<<<<<<< * r.top += d * r.height -= d */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":277 * if r.top < other.top: * d = other.top - r.top * r.top += d # <<<<<<<<<<<<<< * r.height -= d * if r.bottom > other.bottom: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_top, __pyx_t_3) < 0) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":278 * d = other.top - r.top * r.top += d * r.height -= d # <<<<<<<<<<<<<< * if r.bottom > other.bottom: * d = r.bottom - other.bottom */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_1) < 0) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":275 * d = r.right - other.right * r.width -=d * if r.top < other.top: # <<<<<<<<<<<<<< * d = other.top - r.top * r.top += d */ } /* "pygame_sdl2/rect.pyx":279 * r.top += d * r.height -= d * if r.bottom > other.bottom: # <<<<<<<<<<<<<< * d = r.bottom - other.bottom * r.height -= d */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_bottom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __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) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":280 * r.height -= d * if r.bottom > other.bottom: * d = r.bottom - other.bottom # <<<<<<<<<<<<<< * r.height -= d * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":281 * if r.bottom > other.bottom: * d = r.bottom - other.bottom * r.height -= d # <<<<<<<<<<<<<< * * return r */ __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) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_3) < 0) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":279 * r.top += d * r.height -= d * if r.bottom > other.bottom: # <<<<<<<<<<<<<< * d = r.bottom - other.bottom * r.height -= d */ } /* "pygame_sdl2/rect.pyx":283 * r.height -= d * * return r # <<<<<<<<<<<<<< * * def union(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":255 * self.bottom = other.bottom * * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<< * if type(other) == int: * other = Rect(other, y, w, h) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_d); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":285 * return r * * def union(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.union_ip(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_33union(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_32union, "Rect.union(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_33union = {"union", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_33union, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_32union}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_33union(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("union (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "union") < 0)) __PYX_ERR(0, 285, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("union", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 285, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_32union(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_32union(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("union", 1); /* "pygame_sdl2/rect.pyx":286 * * def union(self, other): * r = self.copy() # <<<<<<<<<<<<<< * r.union_ip(other) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":287 * def union(self, other): * r = self.copy() * r.union_ip(other) # <<<<<<<<<<<<<< * return r * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_other}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":288 * r = self.copy() * r.union_ip(other) * return r # <<<<<<<<<<<<<< * * def union_ip(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":285 * return r * * def union(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.union_ip(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":290 * return r * * def union_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_34union_ip, "Rect.union_ip(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_35union_ip = {"union_ip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_34union_ip}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("union_ip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "union_ip") < 0)) __PYX_ERR(0, 290, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("union_ip", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 290, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("union_ip", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":291 * * def union_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":292 * def union_ip(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * x = min(self.x, other.x) */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":291 * * def union_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":294 * other = Rect(other) * * x = min(self.x, other.x) # <<<<<<<<<<<<<< * y = min(self.y, other.y) * self.w = max(self.right, other.right) - x */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_self->x; __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_t_3; } else { __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __pyx_t_7; __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_x = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":295 * * x = min(self.x, other.x) * y = min(self.y, other.y) # <<<<<<<<<<<<<< * self.w = max(self.right, other.right) - x * self.h = max(self.bottom, other.bottom) - y */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_self->y; __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __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) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_t_3; } else { __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":296 * x = min(self.x, other.x) * y = min(self.y, other.y) * self.w = max(self.right, other.right) - x # <<<<<<<<<<<<<< * self.h = max(self.bottom, other.bottom) - y * self.x = x */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = __pyx_t_3; } else { __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = __pyx_t_5; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->w = __pyx_t_4; /* "pygame_sdl2/rect.pyx":297 * y = min(self.y, other.y) * self.w = max(self.right, other.right) - x * self.h = max(self.bottom, other.bottom) - y # <<<<<<<<<<<<<< * self.x = x * self.y = y */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_6); __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) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_t_3; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->h = __pyx_t_4; /* "pygame_sdl2/rect.pyx":298 * self.w = max(self.right, other.right) - x * self.h = max(self.bottom, other.bottom) - y * self.x = x # <<<<<<<<<<<<<< * self.y = y * */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error) __pyx_v_self->x = __pyx_t_4; /* "pygame_sdl2/rect.pyx":299 * self.h = max(self.bottom, other.bottom) - y * self.x = x * self.y = y # <<<<<<<<<<<<<< * * def unionall(self, other_seq): */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error) __pyx_v_self->y = __pyx_t_4; /* "pygame_sdl2/rect.pyx":290 * return r * * def union_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":301 * self.y = y * * def unionall(self, other_seq): # <<<<<<<<<<<<<< * r = self.copy() * r.unionall_ip(other_seq) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_36unionall, "Rect.unionall(self, other_seq)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_37unionall = {"unionall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_36unionall}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other_seq = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unionall (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_seq,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other_seq)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "unionall") < 0)) __PYX_ERR(0, 301, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other_seq = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("unionall", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 301, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_seq); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unionall", 1); /* "pygame_sdl2/rect.pyx":302 * * def unionall(self, other_seq): * r = self.copy() # <<<<<<<<<<<<<< * r.unionall_ip(other_seq) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":303 * def unionall(self, other_seq): * r = self.copy() * r.unionall_ip(other_seq) # <<<<<<<<<<<<<< * return r * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_unionall_ip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_other_seq}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":304 * r = self.copy() * r.unionall_ip(other_seq) * return r # <<<<<<<<<<<<<< * * def unionall_ip(self, other_seq): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":301 * self.y = y * * def unionall(self, other_seq): # <<<<<<<<<<<<<< * r = self.copy() * r.unionall_ip(other_seq) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":306 * return r * * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<< * for other in other_seq: * self.union_ip(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_38unionall_ip, "Rect.unionall_ip(self, other_seq)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_39unionall_ip = {"unionall_ip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_38unionall_ip}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other_seq = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unionall_ip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_seq,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other_seq)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "unionall_ip") < 0)) __PYX_ERR(0, 306, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other_seq = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("unionall_ip", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 306, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_38unionall_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_seq); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_38unionall_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq) { PyObject *__pyx_v_other = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unionall_ip", 1); /* "pygame_sdl2/rect.pyx":307 * * def unionall_ip(self, other_seq): * for other in other_seq: # <<<<<<<<<<<<<< * self.union_ip(other) * */ if (likely(PyList_CheckExact(__pyx_v_other_seq)) || PyTuple_CheckExact(__pyx_v_other_seq)) { __pyx_t_1 = __pyx_v_other_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_other_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 307, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":308 * def unionall_ip(self, other_seq): * for other in other_seq: * self.union_ip(other) # <<<<<<<<<<<<<< * * def fit(self, other): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_union_ip); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_other}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":307 * * def unionall_ip(self, other_seq): * for other in other_seq: # <<<<<<<<<<<<<< * self.union_ip(other) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":306 * return r * * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<< * for other in other_seq: * self.union_ip(other) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":310 * self.union_ip(other) * * def fit(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_40fit, "Rect.fit(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_41fit = {"fit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_40fit}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fit (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fit") < 0)) __PYX_ERR(0, 310, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fit", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 310, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.fit", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_w_ratio = NULL; PyObject *__pyx_v_h_ratio = NULL; PyObject *__pyx_v_factor = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fit", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":311 * * def fit(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":312 * def fit(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * # Not sure if this is entirely correct. Docs and tests are ambiguous. */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":311 * * def fit(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":315 * * # Not sure if this is entirely correct. Docs and tests are ambiguous. * r = self.copy() # <<<<<<<<<<<<<< * r.topleft = other.topleft * w_ratio = other.w / float(r.w) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":316 * # Not sure if this is entirely correct. Docs and tests are ambiguous. * r = self.copy() * r.topleft = other.topleft # <<<<<<<<<<<<<< * w_ratio = other.w / float(r.w) * h_ratio = other.h / float(r.h) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_topleft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_topleft, __pyx_t_3) < 0) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":317 * r = self.copy() * r.topleft = other.topleft * w_ratio = other.w / float(r.w) # <<<<<<<<<<<<<< * h_ratio = other.h / float(r.h) * factor = min(w_ratio, h_ratio) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyNumber_Float(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_w_ratio = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":318 * r.topleft = other.topleft * w_ratio = other.w / float(r.w) * h_ratio = other.h / float(r.h) # <<<<<<<<<<<<<< * factor = min(w_ratio, h_ratio) * r.w *= factor */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_h_ratio = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":319 * w_ratio = other.w / float(r.w) * h_ratio = other.h / float(r.h) * factor = min(w_ratio, h_ratio) # <<<<<<<<<<<<<< * r.w *= factor * r.h *= factor */ __Pyx_INCREF(__pyx_v_h_ratio); __pyx_t_5 = __pyx_v_h_ratio; __Pyx_INCREF(__pyx_v_w_ratio); __pyx_t_3 = __pyx_v_w_ratio; __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 319, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = __pyx_t_5; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_factor = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":320 * h_ratio = other.h / float(r.h) * factor = min(w_ratio, h_ratio) * r.w *= factor # <<<<<<<<<<<<<< * r.h *= factor * return r */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_v_factor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_w, __pyx_t_4) < 0) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":321 * factor = min(w_ratio, h_ratio) * r.w *= factor * r.h *= factor # <<<<<<<<<<<<<< * return r * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_h, __pyx_t_5) < 0) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":322 * r.w *= factor * r.h *= factor * return r # <<<<<<<<<<<<<< * * def normalize(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":310 * self.union_ip(other) * * def fit(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.fit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_w_ratio); __Pyx_XDECREF(__pyx_v_h_ratio); __Pyx_XDECREF(__pyx_v_factor); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":324 * return r * * def normalize(self): # <<<<<<<<<<<<<< * if self.w < 0: * self.x += self.w */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_42normalize, "Rect.normalize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_43normalize = {"normalize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_42normalize}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normalize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("normalize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "normalize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("normalize", 1); /* "pygame_sdl2/rect.pyx":325 * * def normalize(self): * if self.w < 0: # <<<<<<<<<<<<<< * self.x += self.w * self.w = -self.w */ __pyx_t_1 = (__pyx_v_self->w < 0); if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":326 * def normalize(self): * if self.w < 0: * self.x += self.w # <<<<<<<<<<<<<< * self.w = -self.w * if self.h < 0: */ __pyx_v_self->x = (__pyx_v_self->x + __pyx_v_self->w); /* "pygame_sdl2/rect.pyx":327 * if self.w < 0: * self.x += self.w * self.w = -self.w # <<<<<<<<<<<<<< * if self.h < 0: * self.y += self.h */ __pyx_v_self->w = (-__pyx_v_self->w); /* "pygame_sdl2/rect.pyx":325 * * def normalize(self): * if self.w < 0: # <<<<<<<<<<<<<< * self.x += self.w * self.w = -self.w */ } /* "pygame_sdl2/rect.pyx":328 * self.x += self.w * self.w = -self.w * if self.h < 0: # <<<<<<<<<<<<<< * self.y += self.h * self.h = -self.h */ __pyx_t_1 = (__pyx_v_self->h < 0); if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":329 * self.w = -self.w * if self.h < 0: * self.y += self.h # <<<<<<<<<<<<<< * self.h = -self.h * */ __pyx_v_self->y = (__pyx_v_self->y + __pyx_v_self->h); /* "pygame_sdl2/rect.pyx":330 * if self.h < 0: * self.y += self.h * self.h = -self.h # <<<<<<<<<<<<<< * * def contains(self, other): */ __pyx_v_self->h = (-__pyx_v_self->h); /* "pygame_sdl2/rect.pyx":328 * self.x += self.w * self.w = -self.w * if self.h < 0: # <<<<<<<<<<<<<< * self.y += self.h * self.h = -self.h */ } /* "pygame_sdl2/rect.pyx":324 * return r * * def normalize(self): # <<<<<<<<<<<<<< * if self.w < 0: * self.x += self.w */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":332 * self.h = -self.h * * def contains(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_44contains, "Rect.contains(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_45contains = {"contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_44contains}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "contains") < 0)) __PYX_ERR(0, 332, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("contains", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 332, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("contains", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":333 * * def contains(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":334 * def contains(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * return other.x >= self.x and other.right <= self.right and \ */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":333 * * def contains(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":336 * other = Rect(other) * * return other.x >= self.x and other.right <= self.right and \ # <<<<<<<<<<<<<< * other.y >= self.y and other.bottom <= self.bottom and \ * other.left < self.right and other.top < self.bottom */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 336, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 336, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_bool_binop_done; } /* "pygame_sdl2/rect.pyx":337 * * return other.x >= self.x and other.right <= self.right and \ * other.y >= self.y and other.bottom <= self.bottom and \ # <<<<<<<<<<<<<< * other.left < self.right and other.top < self.bottom * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 337, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 337, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_bool_binop_done; } /* "pygame_sdl2/rect.pyx":338 * return other.x >= self.x and other.right <= self.right and \ * other.y >= self.y and other.bottom <= self.bottom and \ * other.left < self.right and other.top < self.bottom # <<<<<<<<<<<<<< * * def collidepoint(self, x, y=None): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 338, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_L4_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":332 * self.h = -self.h * * def contains(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":340 * other.left < self.right and other.top < self.bottom * * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<< * if type(x) == tuple: * x, y = x */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_46collidepoint, "Rect.collidepoint(self, x, y=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_47collidepoint = {"collidepoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_46collidepoint}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidepoint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collidepoint") < 0)) __PYX_ERR(0, 340, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = values[0]; __pyx_v_y = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidepoint", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 340, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidepoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_46collidepoint(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_46collidepoint(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidepoint", 0); __Pyx_INCREF(__pyx_v_x); __Pyx_INCREF(__pyx_v_y); /* "pygame_sdl2/rect.pyx":341 * * def collidepoint(self, x, y=None): * if type(x) == tuple: # <<<<<<<<<<<<<< * x, y = x * return x >= self.x and y >= self.y and \ */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_x)), ((PyObject *)(&PyTuple_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":342 * def collidepoint(self, x, y=None): * if type(x) == tuple: * x, y = x # <<<<<<<<<<<<<< * return x >= self.x and y >= self.y and \ * x < self.right and y < self.bottom */ if ((likely(PyTuple_CheckExact(__pyx_v_x))) || (PyList_CheckExact(__pyx_v_x))) { PyObject* sequence = __pyx_v_x; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 342, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 342, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 342, __pyx_L1_error) __pyx_L5_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":341 * * def collidepoint(self, x, y=None): * if type(x) == tuple: # <<<<<<<<<<<<<< * x, y = x * return x >= self.x and y >= self.y and \ */ } /* "pygame_sdl2/rect.pyx":343 * if type(x) == tuple: * x, y = x * return x >= self.x and y >= self.y and \ # <<<<<<<<<<<<<< * x < self.right and y < self.bottom * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 343, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 343, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L6_bool_binop_done; } /* "pygame_sdl2/rect.pyx":344 * x, y = x * return x >= self.x and y >= self.y and \ * x < self.right and y < self.bottom # <<<<<<<<<<<<<< * * def colliderect(self, other): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 344, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_L6_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":340 * other.left < self.right and other.top < self.bottom * * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<< * if type(x) == tuple: * x, y = x */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidepoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":346 * x < self.right and y < self.bottom * * def colliderect(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_48colliderect, "Rect.colliderect(self, other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_49colliderect = {"colliderect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_48colliderect}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("colliderect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "colliderect") < 0)) __PYX_ERR(0, 346, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("colliderect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 346, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.colliderect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("colliderect", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":347 * * def colliderect(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":348 * def colliderect(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * return self.left < other.right and self.top < other.bottom and \ */ __pyx_t_3 = __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":347 * * def colliderect(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":350 * other = Rect(other) * * return self.left < other.right and self.top < other.bottom and \ # <<<<<<<<<<<<<< * self.right > other.left and self.bottom > other.top * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 350, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 350, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_bool_binop_done; } /* "pygame_sdl2/rect.pyx":351 * * return self.left < other.right and self.top < other.bottom and \ * self.right > other.left and self.bottom > other.top # <<<<<<<<<<<<<< * * def collidelist(self, other_list): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_L4_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":346 * x < self.right and y < self.bottom * * def colliderect(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.colliderect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":353 * self.right > other.left and self.bottom > other.top * * def collidelist(self, other_list): # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_50collidelist, "Rect.collidelist(self, other_list)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_51collidelist = {"collidelist", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_50collidelist}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other_list = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidelist (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_list,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other_list)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collidelist") < 0)) __PYX_ERR(0, 353, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other_list = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidelist", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 353, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelist", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_list); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_other = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); unsigned int __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidelist", 1); /* "pygame_sdl2/rect.pyx":354 * * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * return n */ __pyx_t_1 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 354, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error); __Pyx_INCREF(__pyx_v_other_list); __Pyx_GIVEREF(__pyx_v_other_list); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_other_list)) __PYX_ERR(0, 354, __pyx_L1_error); __pyx_t_3 = 0; __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_4 = NULL; } else { __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 354, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 354, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 354, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 354, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 354, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 354, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":355 * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * return n * return -1 */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_other}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_10) { /* "pygame_sdl2/rect.pyx":356 * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): * return n # <<<<<<<<<<<<<< * return -1 * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_n); __pyx_r = __pyx_v_n; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":355 * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * return n * return -1 */ } /* "pygame_sdl2/rect.pyx":354 * * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * return n */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":357 * if self.colliderect(other): * return n * return -1 # <<<<<<<<<<<<<< * * def collidelistall(self, other_list): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_neg_1); __pyx_r = __pyx_int_neg_1; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":353 * self.right > other.left and self.bottom > other.top * * def collidelist(self, other_list): # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelist", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":359 * return -1 * * def collidelistall(self, other_list): # <<<<<<<<<<<<<< * ret = [] * for n, other in zip(range(len(other_list)), other_list): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_52collidelistall, "Rect.collidelistall(self, other_list)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_53collidelistall = {"collidelistall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_52collidelistall}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other_list = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidelistall (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_list,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other_list)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collidelistall") < 0)) __PYX_ERR(0, 359, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other_list = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidelistall", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 359, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelistall", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_list); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list) { PyObject *__pyx_v_ret = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_other = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); unsigned int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidelistall", 1); /* "pygame_sdl2/rect.pyx":360 * * def collidelistall(self, other_list): * ret = [] # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":361 * def collidelistall(self, other_list): * ret = [] * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * ret.append(n) */ __pyx_t_2 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 361, __pyx_L1_error) __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error); __Pyx_INCREF(__pyx_v_other_list); __Pyx_GIVEREF(__pyx_v_other_list); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_other_list)) __PYX_ERR(0, 361, __pyx_L1_error); __pyx_t_3 = 0; __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) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_4 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 361, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 361, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 361, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 361, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 361, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 361, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":362 * ret = [] * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * ret.append(n) * return ret */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_other}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_10) { /* "pygame_sdl2/rect.pyx":363 * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): * ret.append(n) # <<<<<<<<<<<<<< * return ret * */ __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_n); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 363, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":362 * ret = [] * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * ret.append(n) * return ret */ } /* "pygame_sdl2/rect.pyx":361 * def collidelistall(self, other_list): * ret = [] * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * ret.append(n) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":364 * if self.colliderect(other): * ret.append(n) * return ret # <<<<<<<<<<<<<< * * def collidedict(self, other_dict, rects_values=0): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":359 * return -1 * * def collidelistall(self, other_list): # <<<<<<<<<<<<<< * ret = [] * for n, other in zip(range(len(other_list)), other_list): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelistall", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ret); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":366 * return ret * * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_54collidedict, "Rect.collidedict(self, other_dict, rects_values=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_55collidedict = {"collidedict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_54collidedict}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other_dict = 0; CYTHON_UNUSED PyObject *__pyx_v_rects_values = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidedict (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_dict,&__pyx_n_s_rects_values,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other_dict)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 366, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rects_values); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 366, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collidedict") < 0)) __PYX_ERR(0, 366, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_other_dict = values[0]; __pyx_v_rects_values = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidedict", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 366, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedict", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_54collidedict(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_dict, __pyx_v_rects_values); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_54collidedict(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values) { PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidedict", 1); /* "pygame_sdl2/rect.pyx":368 * def collidedict(self, other_dict, rects_values=0): * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): # <<<<<<<<<<<<<< * if self.colliderect(val): * return key, val */ __pyx_t_2 = 0; if (unlikely(__pyx_v_other_dict == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 368, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_other_dict, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":369 * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): * if self.colliderect(val): # <<<<<<<<<<<<<< * return key, val * return None */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_val}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_10) { /* "pygame_sdl2/rect.pyx":370 * for key, val in other_dict.items(): * if self.colliderect(val): * return key, val # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key)) __PYX_ERR(0, 370, __pyx_L1_error); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_val)) __PYX_ERR(0, 370, __pyx_L1_error); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":369 * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): * if self.colliderect(val): # <<<<<<<<<<<<<< * return key, val * return None */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":371 * if self.colliderect(val): * return key, val * return None # <<<<<<<<<<<<<< * * def collidedictall(self, other_dict, rects_values=0): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/rect.pyx":366 * return ret * * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":373 * return None * * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * ret = [] * for key, val in other_dict.items(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_4rect_4Rect_56collidedictall, "Rect.collidedictall(self, other_dict, rects_values=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_4Rect_57collidedictall = {"collidedictall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_56collidedictall}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_other_dict = 0; CYTHON_UNUSED PyObject *__pyx_v_rects_values = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidedictall (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_dict,&__pyx_n_s_rects_values,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other_dict)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rects_values); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collidedictall") < 0)) __PYX_ERR(0, 373, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_other_dict = values[0]; __pyx_v_rects_values = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidedictall", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 373, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedictall", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_56collidedictall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_dict, __pyx_v_rects_values); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_56collidedictall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values) { PyObject *__pyx_v_ret = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidedictall", 1); /* "pygame_sdl2/rect.pyx":374 * * def collidedictall(self, other_dict, rects_values=0): * ret = [] # <<<<<<<<<<<<<< * for key, val in other_dict.items(): * if self.colliderect(val): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":375 * def collidedictall(self, other_dict, rects_values=0): * ret = [] * for key, val in other_dict.items(): # <<<<<<<<<<<<<< * if self.colliderect(val): * ret.append((key,val)) */ __pyx_t_2 = 0; if (unlikely(__pyx_v_other_dict == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 375, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_other_dict, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":376 * ret = [] * for key, val in other_dict.items(): * if self.colliderect(val): # <<<<<<<<<<<<<< * ret.append((key,val)) * return ret */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_val}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_10) { /* "pygame_sdl2/rect.pyx":377 * for key, val in other_dict.items(): * if self.colliderect(val): * ret.append((key,val)) # <<<<<<<<<<<<<< * return ret * */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key)) __PYX_ERR(0, 377, __pyx_L1_error); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_val)) __PYX_ERR(0, 377, __pyx_L1_error); __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_6); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":376 * ret = [] * for key, val in other_dict.items(): * if self.colliderect(val): # <<<<<<<<<<<<<< * ret.append((key,val)) * return ret */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":378 * if self.colliderect(val): * ret.append((key,val)) * return ret # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":373 * return None * * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * ret = [] * for key, val in other_dict.items(): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedictall", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ret); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pxd":25 * cdef object __weakref__ * * cdef public int x # <<<<<<<<<<<<<< * cdef public int y * cdef public int w */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.x.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1x_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1x_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __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) __pyx_v_self->x = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.x.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pxd":26 * * cdef public int x * cdef public int y # <<<<<<<<<<<<<< * cdef public int w * cdef public int h */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.y.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1y_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1y_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __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) __pyx_v_self->y = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.y.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pxd":27 * cdef public int x * cdef public int y * cdef public int w # <<<<<<<<<<<<<< * cdef public int h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1w_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1w_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __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) __pyx_v_self->w = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pxd":28 * cdef public int y * cdef public int w * cdef public int h # <<<<<<<<<<<<<< * * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.h.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1h_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1h_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __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) __pyx_v_self->h = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.h.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rect.pyx":381 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=None) except -1: # <<<<<<<<<<<<<< * """ * Converts `rectlike` to the SDL_Rect `rect`. */ static int __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(PyObject *__pyx_v_rectlike, SDL_Rect *__pyx_v_rect, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args) { PyObject *__pyx_v_argname = ((PyObject *)Py_None); struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_rl = 0; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *(*__pyx_t_12)(PyObject *); int __pyx_t_13; int __pyx_t_14; int __pyx_t_15; unsigned int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_sdl_rect", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_argname = __pyx_optional_args->argname; } } /* "pygame_sdl2/rect.pyx":391 * cdef Rect rl * * try: # <<<<<<<<<<<<<< * if isinstance(rectlike, Rect): * rl = rectlike */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "pygame_sdl2/rect.pyx":392 * * try: * if isinstance(rectlike, Rect): # <<<<<<<<<<<<<< * rl = rectlike * */ __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_rectlike, __pyx_ptype_11pygame_sdl2_4rect_Rect); if (__pyx_t_4) { /* "pygame_sdl2/rect.pyx":393 * try: * if isinstance(rectlike, Rect): * rl = rectlike # <<<<<<<<<<<<<< * * rect.x = rl.x */ if (!(likely(((__pyx_v_rectlike) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rectlike, __pyx_ptype_11pygame_sdl2_4rect_Rect))))) __PYX_ERR(0, 393, __pyx_L3_error) __pyx_t_5 = __pyx_v_rectlike; __Pyx_INCREF(__pyx_t_5); __pyx_v_rl = ((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":395 * rl = rectlike * * rect.x = rl.x # <<<<<<<<<<<<<< * rect.y = rl.y * rect.w = rl.w */ __pyx_t_6 = __pyx_v_rl->x; __pyx_v_rect->x = __pyx_t_6; /* "pygame_sdl2/rect.pyx":396 * * rect.x = rl.x * rect.y = rl.y # <<<<<<<<<<<<<< * rect.w = rl.w * rect.h = rl.h */ __pyx_t_6 = __pyx_v_rl->y; __pyx_v_rect->y = __pyx_t_6; /* "pygame_sdl2/rect.pyx":397 * rect.x = rl.x * rect.y = rl.y * rect.w = rl.w # <<<<<<<<<<<<<< * rect.h = rl.h * */ __pyx_t_6 = __pyx_v_rl->w; __pyx_v_rect->w = __pyx_t_6; /* "pygame_sdl2/rect.pyx":398 * rect.y = rl.y * rect.w = rl.w * rect.h = rl.h # <<<<<<<<<<<<<< * * return 0 */ __pyx_t_6 = __pyx_v_rl->h; __pyx_v_rect->h = __pyx_t_6; /* "pygame_sdl2/rect.pyx":400 * rect.h = rl.h * * return 0 # <<<<<<<<<<<<<< * * elif len(rectlike) == 4: */ __pyx_r = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/rect.pyx":392 * * try: * if isinstance(rectlike, Rect): # <<<<<<<<<<<<<< * rl = rectlike * */ } /* "pygame_sdl2/rect.pyx":402 * return 0 * * elif len(rectlike) == 4: # <<<<<<<<<<<<<< * rect.x, rect.y, rect.w, rect.h = rectlike * return 0 */ __pyx_t_7 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 402, __pyx_L3_error) __pyx_t_4 = (__pyx_t_7 == 4); if (__pyx_t_4) { /* "pygame_sdl2/rect.pyx":403 * * elif len(rectlike) == 4: * rect.x, rect.y, rect.w, rect.h = rectlike # <<<<<<<<<<<<<< * return 0 * */ if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) { PyObject* sequence = __pyx_v_rectlike; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 403, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); __pyx_t_10 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 403, __pyx_L3_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10}; __pyx_t_11 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 403, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_12(__pyx_t_11); if (unlikely(!item)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 4) < 0) __PYX_ERR(0, 403, __pyx_L3_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L11_unpacking_done; __pyx_L10_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 403, __pyx_L3_error) __pyx_L11_unpacking_done:; } __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L3_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L3_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L3_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_rect->x = __pyx_t_6; __pyx_v_rect->y = __pyx_t_13; __pyx_v_rect->w = __pyx_t_14; __pyx_v_rect->h = __pyx_t_15; /* "pygame_sdl2/rect.pyx":404 * elif len(rectlike) == 4: * rect.x, rect.y, rect.w, rect.h = rectlike * return 0 # <<<<<<<<<<<<<< * * elif len(rectlike) == 2: */ __pyx_r = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/rect.pyx":402 * return 0 * * elif len(rectlike) == 4: # <<<<<<<<<<<<<< * rect.x, rect.y, rect.w, rect.h = rectlike * return 0 */ } /* "pygame_sdl2/rect.pyx":406 * return 0 * * elif len(rectlike) == 2: # <<<<<<<<<<<<<< * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike */ __pyx_t_7 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 406, __pyx_L3_error) __pyx_t_4 = (__pyx_t_7 == 2); if (__pyx_t_4) { /* "pygame_sdl2/rect.pyx":407 * * elif len(rectlike) == 2: * rect.x, rect.y = rectlike # <<<<<<<<<<<<<< * rect.w, rect.h = rectlike * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) { PyObject* sequence = __pyx_v_rectlike; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 407, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 407, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 407, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 407, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) __PYX_ERR(0, 407, __pyx_L3_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 407, __pyx_L3_error) __pyx_L13_unpacking_done:; } __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_rect->x = __pyx_t_15; __pyx_v_rect->y = __pyx_t_14; /* "pygame_sdl2/rect.pyx":408 * elif len(rectlike) == 2: * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike # <<<<<<<<<<<<<< * return 0 * */ if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) { PyObject* sequence = __pyx_v_rectlike; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 408, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 408, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 408, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); #endif } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) __PYX_ERR(0, 408, __pyx_L3_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 408, __pyx_L3_error) __pyx_L15_unpacking_done:; } __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_rect->w = __pyx_t_14; __pyx_v_rect->h = __pyx_t_15; /* "pygame_sdl2/rect.pyx":409 * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike * return 0 # <<<<<<<<<<<<<< * * except: */ __pyx_r = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/rect.pyx":406 * return 0 * * elif len(rectlike) == 2: # <<<<<<<<<<<<<< * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike */ } /* "pygame_sdl2/rect.pyx":391 * cdef Rect rl * * try: # <<<<<<<<<<<<<< * if isinstance(rectlike, Rect): * rl = rectlike */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/rect.pyx":411 * return 0 * * except: # <<<<<<<<<<<<<< * pass * */ /*except:*/ { __Pyx_ErrRestore(0,0,0); goto __pyx_L4_exception_handled; } /* "pygame_sdl2/rect.pyx":391 * cdef Rect rl * * try: # <<<<<<<<<<<<<< * if isinstance(rectlike, Rect): * rl = rectlike */ __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "pygame_sdl2/rect.pyx":414 * pass * * if argname: # <<<<<<<<<<<<<< * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_argname); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 414, __pyx_L1_error) if (unlikely(__pyx_t_4)) { /* "pygame_sdl2/rect.pyx":415 * * if argname: * raise TypeError("Argument {} must be a rect style object.".format(argname)) # <<<<<<<<<<<<<< * else: * raise TypeError("Argument must be a rect style object.") */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Argument_must_be_a_rect_style_ob_2, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; __pyx_t_16 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_16 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_argname}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(0, 415, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":414 * pass * * if argname: # <<<<<<<<<<<<<< * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: */ } /* "pygame_sdl2/rect.pyx":417 * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< */ /*else*/ { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(0, 417, __pyx_L1_error) } /* "pygame_sdl2/rect.pyx":381 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=None) except -1: # <<<<<<<<<<<<<< * """ * Converts `rectlike` to the SDL_Rect `rect`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.rect.to_sdl_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rl); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_4rect_Rect(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif return o; } static void __pyx_tp_dealloc_11pygame_sdl2_4rect_Rect(PyObject *o) { struct __pyx_obj_11pygame_sdl2_4rect_Rect *p = (struct __pyx_obj_11pygame_sdl2_4rect_Rect *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_4rect_Rect) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_sq_item_11pygame_sdl2_4rect_Rect(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_11pygame_sdl2_4rect_Rect(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(o, i, v); } else { __Pyx_TypeName o_type_name; o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_left(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_left(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_top(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_top(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_width(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_width(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_height(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_height(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_right(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_right(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottom(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_topleft(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_topleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_topright(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_topright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomright(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomleft(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_centerx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_centerx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_centery(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_centery(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_center(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_center(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midtop(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midtop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midleft(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midbottom(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midbottom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midright(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_x(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_x(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_y(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_y(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_w(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_w(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_h(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_h(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_specialmethod___pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(self); } static PyMethodDef __pyx_methods_11pygame_sdl2_4rect_Rect[] = { {"__reduce__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_2__reduce__}, {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__, METH_NOARGS|METH_COEXIST, 0}, {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_16copy}, {"move", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_19move, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_18move}, {"move_ip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_20move_ip}, {"inflate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_22inflate}, {"inflate_ip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_24inflate_ip}, {"clamp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_26clamp}, {"clamp_ip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_28clamp_ip}, {"clip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_30clip}, {"union", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_33union, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_32union}, {"union_ip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_34union_ip}, {"unionall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_36unionall}, {"unionall_ip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_38unionall_ip}, {"fit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_40fit}, {"normalize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_42normalize}, {"contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_44contains}, {"collidepoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_46collidepoint}, {"colliderect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_48colliderect}, {"collidelist", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_50collidelist}, {"collidelistall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_52collidelistall}, {"collidedict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_54collidedict}, {"collidedictall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_4rect_4Rect_56collidedictall}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_4rect_Rect[] = { {(char *)"left", __pyx_getprop_11pygame_sdl2_4rect_4Rect_left, __pyx_setprop_11pygame_sdl2_4rect_4Rect_left, (char *)0, 0}, {(char *)"top", __pyx_getprop_11pygame_sdl2_4rect_4Rect_top, __pyx_setprop_11pygame_sdl2_4rect_4Rect_top, (char *)0, 0}, {(char *)"width", __pyx_getprop_11pygame_sdl2_4rect_4Rect_width, __pyx_setprop_11pygame_sdl2_4rect_4Rect_width, (char *)0, 0}, {(char *)"height", __pyx_getprop_11pygame_sdl2_4rect_4Rect_height, __pyx_setprop_11pygame_sdl2_4rect_4Rect_height, (char *)0, 0}, {(char *)"right", __pyx_getprop_11pygame_sdl2_4rect_4Rect_right, __pyx_setprop_11pygame_sdl2_4rect_4Rect_right, (char *)0, 0}, {(char *)"bottom", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottom, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottom, (char *)0, 0}, {(char *)"size", __pyx_getprop_11pygame_sdl2_4rect_4Rect_size, __pyx_setprop_11pygame_sdl2_4rect_4Rect_size, (char *)0, 0}, {(char *)"topleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_topleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_topleft, (char *)0, 0}, {(char *)"topright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_topright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_topright, (char *)0, 0}, {(char *)"bottomright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomright, (char *)0, 0}, {(char *)"bottomleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomleft, (char *)0, 0}, {(char *)"centerx", __pyx_getprop_11pygame_sdl2_4rect_4Rect_centerx, __pyx_setprop_11pygame_sdl2_4rect_4Rect_centerx, (char *)0, 0}, {(char *)"centery", __pyx_getprop_11pygame_sdl2_4rect_4Rect_centery, __pyx_setprop_11pygame_sdl2_4rect_4Rect_centery, (char *)0, 0}, {(char *)"center", __pyx_getprop_11pygame_sdl2_4rect_4Rect_center, __pyx_setprop_11pygame_sdl2_4rect_4Rect_center, (char *)0, 0}, {(char *)"midtop", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midtop, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midtop, (char *)0, 0}, {(char *)"midleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midleft, (char *)0, 0}, {(char *)"midbottom", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midbottom, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midbottom, (char *)0, 0}, {(char *)"midright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midright, (char *)0, 0}, {(char *)"x", __pyx_getprop_11pygame_sdl2_4rect_4Rect_x, __pyx_setprop_11pygame_sdl2_4rect_4Rect_x, (char *)PyDoc_STR("x: 'int'"), 0}, {(char *)"y", __pyx_getprop_11pygame_sdl2_4rect_4Rect_y, __pyx_setprop_11pygame_sdl2_4rect_4Rect_y, (char *)PyDoc_STR("y: 'int'"), 0}, {(char *)"w", __pyx_getprop_11pygame_sdl2_4rect_4Rect_w, __pyx_setprop_11pygame_sdl2_4rect_4Rect_w, (char *)PyDoc_STR("w: 'int'"), 0}, {(char *)"h", __pyx_getprop_11pygame_sdl2_4rect_4Rect_h, __pyx_setprop_11pygame_sdl2_4rect_4Rect_h, (char *)PyDoc_STR("h: 'int'"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_4rect_Rect_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_4rect_Rect}, {Py_tp_repr, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__}, {Py_sq_length, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__}, {Py_sq_item, (void *)__pyx_sq_item_11pygame_sdl2_4rect_Rect}, {Py_mp_length, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__}, {Py_mp_subscript, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_11pygame_sdl2_4rect_Rect}, {Py_tp_doc, (void *)PyDoc_STR("Rect(*args)")}, {Py_tp_richcompare, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__}, {Py_tp_iter, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_4rect_Rect}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_4rect_Rect}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_4rect_Rect}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_4rect_Rect_spec = { "pygame_sdl2.rect.Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_4rect_Rect_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence_Rect = { __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_4rect_Rect, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Rect = { __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__, /*mp_length*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_11pygame_sdl2_4rect_Rect, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_4rect_Rect = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.rect.""Rect", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_4rect_Rect, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_Rect, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Rect, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("Rect(*args)"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_4rect_Rect, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_4rect_Rect, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_4rect_Rect, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Argument_must_be_a_rect_style_ob, __pyx_k_Argument_must_be_a_rect_style_ob, sizeof(__pyx_k_Argument_must_be_a_rect_style_ob), 0, 0, 1, 0}, {&__pyx_kp_s_Argument_must_be_a_rect_style_ob_2, __pyx_k_Argument_must_be_a_rect_style_ob_2, sizeof(__pyx_k_Argument_must_be_a_rect_style_ob_2), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_Rect___reduce, __pyx_k_Rect___reduce, sizeof(__pyx_k_Rect___reduce), 0, 0, 1, 1}, {&__pyx_n_s_Rect_clamp, __pyx_k_Rect_clamp, sizeof(__pyx_k_Rect_clamp), 0, 0, 1, 1}, {&__pyx_n_s_Rect_clamp_ip, __pyx_k_Rect_clamp_ip, sizeof(__pyx_k_Rect_clamp_ip), 0, 0, 1, 1}, {&__pyx_n_s_Rect_clip, __pyx_k_Rect_clip, sizeof(__pyx_k_Rect_clip), 0, 0, 1, 1}, {&__pyx_n_s_Rect_collidedict, __pyx_k_Rect_collidedict, sizeof(__pyx_k_Rect_collidedict), 0, 0, 1, 1}, {&__pyx_n_s_Rect_collidedictall, __pyx_k_Rect_collidedictall, sizeof(__pyx_k_Rect_collidedictall), 0, 0, 1, 1}, {&__pyx_n_s_Rect_collidelist, __pyx_k_Rect_collidelist, sizeof(__pyx_k_Rect_collidelist), 0, 0, 1, 1}, {&__pyx_n_s_Rect_collidelistall, __pyx_k_Rect_collidelistall, sizeof(__pyx_k_Rect_collidelistall), 0, 0, 1, 1}, {&__pyx_n_s_Rect_collidepoint, __pyx_k_Rect_collidepoint, sizeof(__pyx_k_Rect_collidepoint), 0, 0, 1, 1}, {&__pyx_n_s_Rect_colliderect, __pyx_k_Rect_colliderect, sizeof(__pyx_k_Rect_colliderect), 0, 0, 1, 1}, {&__pyx_n_s_Rect_contains, __pyx_k_Rect_contains, sizeof(__pyx_k_Rect_contains), 0, 0, 1, 1}, {&__pyx_n_s_Rect_copy, __pyx_k_Rect_copy, sizeof(__pyx_k_Rect_copy), 0, 0, 1, 1}, {&__pyx_n_s_Rect_fit, __pyx_k_Rect_fit, sizeof(__pyx_k_Rect_fit), 0, 0, 1, 1}, {&__pyx_n_s_Rect_inflate, __pyx_k_Rect_inflate, sizeof(__pyx_k_Rect_inflate), 0, 0, 1, 1}, {&__pyx_n_s_Rect_inflate_ip, __pyx_k_Rect_inflate_ip, sizeof(__pyx_k_Rect_inflate_ip), 0, 0, 1, 1}, {&__pyx_n_s_Rect_move, __pyx_k_Rect_move, sizeof(__pyx_k_Rect_move), 0, 0, 1, 1}, {&__pyx_n_s_Rect_move_ip, __pyx_k_Rect_move_ip, sizeof(__pyx_k_Rect_move_ip), 0, 0, 1, 1}, {&__pyx_n_s_Rect_normalize, __pyx_k_Rect_normalize, sizeof(__pyx_k_Rect_normalize), 0, 0, 1, 1}, {&__pyx_n_s_Rect_union, __pyx_k_Rect_union, sizeof(__pyx_k_Rect_union), 0, 0, 1, 1}, {&__pyx_n_s_Rect_union_ip, __pyx_k_Rect_union_ip, sizeof(__pyx_k_Rect_union_ip), 0, 0, 1, 1}, {&__pyx_n_s_Rect_unionall, __pyx_k_Rect_unionall, sizeof(__pyx_k_Rect_unionall), 0, 0, 1, 1}, {&__pyx_n_s_Rect_unionall_ip, __pyx_k_Rect_unionall_ip, sizeof(__pyx_k_Rect_unionall_ip), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1}, {&__pyx_n_s__47, __pyx_k__47, sizeof(__pyx_k__47), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_bottom, __pyx_k_bottom, sizeof(__pyx_k_bottom), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 1}, {&__pyx_n_s_centerx, __pyx_k_centerx, sizeof(__pyx_k_centerx), 0, 0, 1, 1}, {&__pyx_n_s_centery, __pyx_k_centery, sizeof(__pyx_k_centery), 0, 0, 1, 1}, {&__pyx_n_s_clamp, __pyx_k_clamp, sizeof(__pyx_k_clamp), 0, 0, 1, 1}, {&__pyx_n_s_clamp_ip, __pyx_k_clamp_ip, sizeof(__pyx_k_clamp_ip), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_n_s_collidedict, __pyx_k_collidedict, sizeof(__pyx_k_collidedict), 0, 0, 1, 1}, {&__pyx_n_s_collidedictall, __pyx_k_collidedictall, sizeof(__pyx_k_collidedictall), 0, 0, 1, 1}, {&__pyx_n_s_collidelist, __pyx_k_collidelist, sizeof(__pyx_k_collidelist), 0, 0, 1, 1}, {&__pyx_n_s_collidelistall, __pyx_k_collidelistall, sizeof(__pyx_k_collidelistall), 0, 0, 1, 1}, {&__pyx_n_s_collidepoint, __pyx_k_collidepoint, sizeof(__pyx_k_collidepoint), 0, 0, 1, 1}, {&__pyx_n_s_colliderect, __pyx_k_colliderect, sizeof(__pyx_k_colliderect), 0, 0, 1, 1}, {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_factor, __pyx_k_factor, sizeof(__pyx_k_factor), 0, 0, 1, 1}, {&__pyx_n_s_fit, __pyx_k_fit, sizeof(__pyx_k_fit), 0, 0, 1, 1}, {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_h_ratio, __pyx_k_h_ratio, sizeof(__pyx_k_h_ratio), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_inflate, __pyx_k_inflate, sizeof(__pyx_k_inflate), 0, 0, 1, 1}, {&__pyx_n_s_inflate_ip, __pyx_k_inflate_ip, sizeof(__pyx_k_inflate_ip), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_move, __pyx_k_move, sizeof(__pyx_k_move), 0, 0, 1, 1}, {&__pyx_n_s_move_ip, __pyx_k_move_ip, sizeof(__pyx_k_move_ip), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_other_dict, __pyx_k_other_dict, sizeof(__pyx_k_other_dict), 0, 0, 1, 1}, {&__pyx_n_s_other_list, __pyx_k_other_list, sizeof(__pyx_k_other_list), 0, 0, 1, 1}, {&__pyx_n_s_other_seq, __pyx_k_other_seq, sizeof(__pyx_k_other_seq), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_kp_s_rect_d_d_d_d, __pyx_k_rect_d_d_d_d, sizeof(__pyx_k_rect_d_d_d_d), 0, 0, 1, 0}, {&__pyx_n_s_rects_values, __pyx_k_rects_values, sizeof(__pyx_k_rects_values), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__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}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1}, {&__pyx_n_s_topleft, __pyx_k_topleft, sizeof(__pyx_k_topleft), 0, 0, 1, 1}, {&__pyx_n_s_union, __pyx_k_union, sizeof(__pyx_k_union), 0, 0, 1, 1}, {&__pyx_n_s_union_ip, __pyx_k_union_ip, sizeof(__pyx_k_union_ip), 0, 0, 1, 1}, {&__pyx_n_s_unionall, __pyx_k_unionall, sizeof(__pyx_k_unionall), 0, 0, 1, 1}, {&__pyx_n_s_unionall_ip, __pyx_k_unionall_ip, sizeof(__pyx_k_unionall_ip), 0, 0, 1, 1}, {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_w_ratio, __pyx_k_w_ratio, sizeof(__pyx_k_w_ratio), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 61, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 99, __pyx_L1_error) __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 354, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 354, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/rect.pyx":61 * * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< * * self.x = x */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Argument_must_be_a_rect_style_ob); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/rect.pyx":263 * * if not self.colliderect(other): * return Rect(0,0,0,0) # <<<<<<<<<<<<<< * * r = self.copy() */ __pyx_tuple__2 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_args); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __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__5)) __PYX_ERR(0, 22, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":68 * self.h = h * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Rect, (self.x, self.y, self.w, self.h)) * */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_reduce, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 68, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":209 * self.right, self.centery = val * * def copy(self): # <<<<<<<<<<<<<< * return Rect(self) * */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_copy, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 209, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":212 * return Rect(self) * * def move(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.move_ip(*args) */ __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_r); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_move, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 212, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":217 * return r * * def move_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * self.x += x */ __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_move_ip, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 217, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":222 * self.y += y * * def inflate(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.inflate_ip(*args) */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_inflate, 222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 222, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":227 * return r * * def inflate_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * c = self.center */ __pyx_tuple__14 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_c); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_inflate_ip, 227, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 227, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":234 * self.center = c * * def clamp(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.clamp_ip(other) */ __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_r); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_clamp, 234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 234, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":239 * return r * * def clamp_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_clamp_ip, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 239, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":255 * self.bottom = other.bottom * * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<< * if type(other) == int: * other = Rect(other, y, w, h) */ __pyx_tuple__20 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_r, __pyx_n_s_d); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_clip, 255, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 255, __pyx_L1_error) __pyx_tuple__22 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "pygame_sdl2/rect.pyx":285 * return r * * def union(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.union_ip(other) */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_union, 285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 285, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":290 * return r * * def union_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_tuple__24 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_union_ip, 290, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 290, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":301 * self.y = y * * def unionall(self, other_seq): # <<<<<<<<<<<<<< * r = self.copy() * r.unionall_ip(other_seq) */ __pyx_tuple__26 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other_seq, __pyx_n_s_r); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_unionall, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 301, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":306 * return r * * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<< * for other in other_seq: * self.union_ip(other) */ __pyx_tuple__28 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other_seq, __pyx_n_s_other); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_unionall_ip, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 306, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":310 * self.union_ip(other) * * def fit(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_tuple__30 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_r, __pyx_n_s_w_ratio, __pyx_n_s_h_ratio, __pyx_n_s_factor); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_fit, 310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 310, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":324 * return r * * def normalize(self): # <<<<<<<<<<<<<< * if self.w < 0: * self.x += self.w */ __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_normalize, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 324, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":332 * self.h = -self.h * * def contains(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_contains, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 332, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":340 * other.left < self.right and other.top < self.bottom * * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<< * if type(x) == tuple: * x, y = x */ __pyx_tuple__34 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_collidepoint, 340, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 340, __pyx_L1_error) __pyx_tuple__36 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "pygame_sdl2/rect.pyx":346 * x < self.right and y < self.bottom * * def colliderect(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_colliderect, 346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 346, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":353 * self.right > other.left and self.bottom > other.top * * def collidelist(self, other_list): # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other_list, __pyx_n_s_n, __pyx_n_s_other); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_collidelist, 353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 353, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":359 * return -1 * * def collidelistall(self, other_list): # <<<<<<<<<<<<<< * ret = [] * for n, other in zip(range(len(other_list)), other_list): */ __pyx_tuple__40 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_other_list, __pyx_n_s_ret, __pyx_n_s_n, __pyx_n_s_other); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_collidelistall, 359, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 359, __pyx_L1_error) /* "pygame_sdl2/rect.pyx":366 * return ret * * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): */ __pyx_tuple__42 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_other_dict, __pyx_n_s_rects_values, __pyx_n_s_key, __pyx_n_s_val); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_collidedict, 366, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 366, __pyx_L1_error) __pyx_tuple__44 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); /* "pygame_sdl2/rect.pyx":373 * return None * * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * ret = [] * for key, val in other_dict.items(): */ __pyx_tuple__45 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_other_dict, __pyx_n_s_rects_values, __pyx_n_s_ret, __pyx_n_s_key, __pyx_n_s_val); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_collidedictall, 373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("to_sdl_rect", (void (*)(void))__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_4rect_Rect = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_4rect_Rect_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(0, 28, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_4rect_Rect_spec, __pyx_ptype_11pygame_sdl2_4rect_Rect) < 0) __PYX_ERR(0, 28, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_4rect_Rect = &__pyx_type_11pygame_sdl2_4rect_Rect; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_4rect_Rect) < 0) __PYX_ERR(0, 28, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_4rect_Rect->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_4rect_Rect->tp_dictoffset && __pyx_ptype_11pygame_sdl2_4rect_Rect->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_4rect_Rect->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Rect, (PyObject *) __pyx_ptype_11pygame_sdl2_4rect_Rect) < 0) __PYX_ERR(0, 28, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_4rect_Rect->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_4rect_Rect->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_4rect_Rect, __weakref__); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_rect(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_rect}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "rect", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initrect(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initrect(void) #else __Pyx_PyMODINIT_FUNC PyInit_rect(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_rect(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_rect(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'rect' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("rect", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "rect" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_rect(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__rect) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.rect")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.rect", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/rect.pyx":20 * # 3. This notice may not be removed or altered from any source distribution. * * import collections # <<<<<<<<<<<<<< * * def flatten(*args): */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_collections, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_1flatten, 0, __pyx_n_s_flatten, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flatten, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":68 * self.h = h * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Rect, (self.x, self.y, self.w, self.h)) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_3__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect___reduce, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_reduce, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":209 * self.right, self.centery = val * * def copy(self): # <<<<<<<<<<<<<< * return Rect(self) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_17copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_copy, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":212 * return Rect(self) * * def move(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.move_ip(*args) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_19move, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_move, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_move, __pyx_t_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":217 * return r * * def move_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * self.x += x */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_21move_ip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_move_ip, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_move_ip, __pyx_t_2) < 0) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":222 * self.y += y * * def inflate(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.inflate_ip(*args) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_23inflate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_inflate, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_inflate, __pyx_t_2) < 0) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":227 * return r * * def inflate_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * c = self.center */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_25inflate_ip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_inflate_ip, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_inflate_ip, __pyx_t_2) < 0) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":234 * self.center = c * * def clamp(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.clamp_ip(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_27clamp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_clamp, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_clamp, __pyx_t_2) < 0) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":239 * return r * * def clamp_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_29clamp_ip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_clamp_ip, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_clamp_ip, __pyx_t_2) < 0) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":255 * self.bottom = other.bottom * * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<< * if type(other) == int: * other = Rect(other, y, w, h) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_31clip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_clip, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__22); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_clip, __pyx_t_2) < 0) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":285 * return r * * def union(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.union_ip(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_33union, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_union, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_union, __pyx_t_2) < 0) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":290 * return r * * def union_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_35union_ip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_union_ip, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_union_ip, __pyx_t_2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":301 * self.y = y * * def unionall(self, other_seq): # <<<<<<<<<<<<<< * r = self.copy() * r.unionall_ip(other_seq) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_37unionall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_unionall, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_unionall, __pyx_t_2) < 0) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":306 * return r * * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<< * for other in other_seq: * self.union_ip(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_39unionall_ip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_unionall_ip, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_unionall_ip, __pyx_t_2) < 0) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":310 * self.union_ip(other) * * def fit(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_41fit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_fit, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_fit, __pyx_t_2) < 0) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":324 * return r * * def normalize(self): # <<<<<<<<<<<<<< * if self.w < 0: * self.x += self.w */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_43normalize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_normalize, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_normalize, __pyx_t_2) < 0) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":332 * self.h = -self.h * * def contains(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_45contains, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_contains, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_contains, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":340 * other.left < self.right and other.top < self.bottom * * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<< * if type(x) == tuple: * x, y = x */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_47collidepoint, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_collidepoint, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__36); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_collidepoint, __pyx_t_2) < 0) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":346 * x < self.right and y < self.bottom * * def colliderect(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_49colliderect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_colliderect, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_colliderect, __pyx_t_2) < 0) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":353 * self.right > other.left and self.bottom > other.top * * def collidelist(self, other_list): # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_51collidelist, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_collidelist, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_collidelist, __pyx_t_2) < 0) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":359 * return -1 * * def collidelistall(self, other_list): # <<<<<<<<<<<<<< * ret = [] * for n, other in zip(range(len(other_list)), other_list): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_53collidelistall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_collidelistall, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_collidelistall, __pyx_t_2) < 0) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":366 * return ret * * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.items(): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_55collidedict, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_collidedict, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__44); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_collidedict, __pyx_t_2) < 0) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":373 * return None * * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * ret = [] * for key, val in other_dict.items(): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_4rect_4Rect_57collidedictall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Rect_collidedictall, NULL, __pyx_n_s_pygame_sdl2_rect, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__44); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect, __pyx_n_s_collidedictall, __pyx_t_2) < 0) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_4rect_Rect); /* "pygame_sdl2/rect.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # Copyright 2014 Patrick Dawson * # */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.rect"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 1; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a == b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) == 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 0; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 0; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal == 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a == (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_EQ)); } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* pybytes_as_double */ static double __Pyx_SlowPyString_AsDouble(PyObject *obj) { PyObject *float_value; #if PY_MAJOR_VERSION >= 3 float_value = PyFloat_FromString(obj); #else float_value = PyFloat_FromString(obj, 0); #endif if (likely(float_value)) { #if CYTHON_ASSUME_SAFE_MACROS double value = PyFloat_AS_DOUBLE(float_value); #else double value = PyFloat_AsDouble(float_value); #endif Py_DECREF(float_value); return value; } return (double)-1; } static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) { int last_was_punctuation = 1; Py_ssize_t i; for (i=0; i < length; i++) { char chr = start[i]; int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E'); *buffer = chr; buffer += (chr != '_'); if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure; last_was_punctuation = is_punctuation; } if (unlikely(last_was_punctuation)) goto parse_failure; *buffer = '\0'; return buffer; parse_failure: return NULL; } static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) { int matches = 1; char sign = start[0]; int is_signed = (sign == '+') | (sign == '-'); start += is_signed; length -= is_signed; switch (start[0]) { #ifdef Py_NAN case 'n': case 'N': if (unlikely(length != 3)) goto parse_failure; matches &= (start[1] == 'a' || start[1] == 'A'); matches &= (start[2] == 'n' || start[2] == 'N'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_NAN : Py_NAN; #endif case 'i': case 'I': if (unlikely(length < 3)) goto parse_failure; matches &= (start[1] == 'n' || start[1] == 'N'); matches &= (start[2] == 'f' || start[2] == 'F'); if (likely(length == 3 && matches)) return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; if (unlikely(length != 8)) goto parse_failure; matches &= (start[3] == 'i' || start[3] == 'I'); matches &= (start[4] == 'n' || start[4] == 'N'); matches &= (start[5] == 'i' || start[5] == 'I'); matches &= (start[6] == 't' || start[6] == 'T'); matches &= (start[7] == 'y' || start[7] == 'Y'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: goto parse_failure; } return 0.0; parse_failure: return -1.0; } static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) { return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd)); } CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) { double value; Py_ssize_t i, digits; const char *last = start + length; char *end; while (__Pyx__PyBytes_AsDouble_IsSpace(*start)) start++; while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1])) last--; length = last - start; if (unlikely(length <= 0)) goto fallback; value = __Pyx__PyBytes_AsDouble_inf_nan(start, length); if (unlikely(value == -1.0)) goto fallback; if (value != 0.0) return value; digits = 0; for (i=0; i < length; digits += start[i++] != '_'); if (likely(digits == length)) { value = PyOS_string_to_double(start, &end, NULL); } else if (digits < 40) { char number[40]; last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); if (unlikely(!last)) goto fallback; value = PyOS_string_to_double(number, &end, NULL); } else { char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char)); if (unlikely(!number)) goto fallback; last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); if (unlikely(!last)) { PyMem_Free(number); goto fallback; } value = PyOS_string_to_double(number, &end, NULL); PyMem_Free(number); } if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { return value; } fallback: return __Pyx_SlowPyString_AsDouble(obj); } /* pynumber_float */ static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) { double val; if (PyLong_CheckExact(obj)) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(obj))) { val = (double) __Pyx_PyLong_CompactValue(obj); goto no_error; } #endif val = PyLong_AsDouble(obj); } else if (PyUnicode_CheckExact(obj)) { val = __Pyx_PyUnicode_AsDouble(obj); } else if (PyBytes_CheckExact(obj)) { val = __Pyx_PyBytes_AsDouble(obj); } else if (PyByteArray_CheckExact(obj)) { val = __Pyx_PyByteArray_AsDouble(obj); } else { return PyNumber_Float(obj); } if (unlikely(val == -1 && PyErr_Occurred())) { return NULL; } #if CYTHON_USE_PYLONG_INTERNALS no_error: #endif return PyFloat_FromDouble(val); } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } *pvalue1 = value1; *pvalue2 = value2; return 0; #if CYTHON_COMPILING_IN_PYPY bad: Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; #endif } static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = __Pyx_PyObject_GetIterNextFunc(iter); value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { #if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; #elif PY_MAJOR_VERSION >= 3 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { const char *name = PyUnicode_AsUTF8(method_name); if (strcmp(name, "iteritems") == 0) pp = &py_items; else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; else if (strcmp(name, "itervalues") == 0) pp = &py_values; if (pp) { if (!*pp) { *pp = PyUnicode_FromString(name + 4); if (!*pp) return NULL; } method_name = *pp; } } #endif } *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__3; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__47); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; cobj = PyCapsule_New(tmp.p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635915.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.render.c0000664000175000017500000342672315026112613020366 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__render #define __PYX_HAVE_API__pygame_sdl2__render /* Early includes */ #include #include #include #include #include "SDL.h" #include "sdl_image_compat.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/render.pyx", "", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", "src/pygame_sdl2/rect.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_6render_Renderer; struct __pyx_obj_11pygame_sdl2_6render_Texture; struct __pyx_obj_11pygame_sdl2_6render_TextureNode; struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas; struct __pyx_obj_11pygame_sdl2_6render_Sprite; struct __pyx_obj_11pygame_sdl2_6render_Container; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/render.pyx":67 * * * cdef class Renderer: # <<<<<<<<<<<<<< * cdef SDL_Renderer *renderer * cdef dict _info */ struct __pyx_obj_11pygame_sdl2_6render_Renderer { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *__pyx_vtab; SDL_Renderer *renderer; PyObject *_info; }; /* "pygame_sdl2/render.pyx":172 * * * cdef class Texture: # <<<<<<<<<<<<<< * """ Mostly for internal use. Users should only see this for RTT. """ * */ struct __pyx_obj_11pygame_sdl2_6render_Texture { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture *__pyx_vtab; SDL_Renderer *renderer; SDL_Texture *texture; int w; int h; }; /* "pygame_sdl2/render.pyx":200 * * * cdef class TextureNode: # <<<<<<<<<<<<<< * """ A specified area of a texture. """ * */ struct __pyx_obj_11pygame_sdl2_6render_TextureNode { PyObject_HEAD struct __pyx_obj_11pygame_sdl2_6render_Texture *texture; SDL_Rect source_rect; SDL_Rect trimmed_rect; int source_w; int source_h; }; /* "pygame_sdl2/render.pyx":245 * * * cdef class TextureAtlas: # <<<<<<<<<<<<<< * cdef object frames * */ struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas { PyObject_HEAD PyObject *frames; }; /* "pygame_sdl2/render.pyx":278 * * * cdef class Sprite: # <<<<<<<<<<<<<< * """ One or more TextureNodes, with possible transforms applied. """ * */ struct __pyx_obj_11pygame_sdl2_6render_Sprite { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *__pyx_vtab; PyObject *nodes; SDL_Rect _pos; SDL_Rect bounding_box; double _rotation; int _flip; SDL_Color _color; double _scalex; double _scaley; }; /* "pygame_sdl2/render.pyx":433 * * * cdef class Container: # <<<<<<<<<<<<<< * """ Multiple sprites, positioned relative to the container. """ * */ struct __pyx_obj_11pygame_sdl2_6render_Container { PyObject_HEAD SDL_Rect _rect; PyObject *sprites; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/render.pyx":67 * * * cdef class Renderer: # <<<<<<<<<<<<<< * cdef SDL_Renderer *renderer * cdef dict _info */ struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer { PyObject *(*set_drawcolor)(struct __pyx_obj_11pygame_sdl2_6render_Renderer *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *__pyx_vtabptr_11pygame_sdl2_6render_Renderer; /* "pygame_sdl2/render.pyx":172 * * * cdef class Texture: # <<<<<<<<<<<<<< * """ Mostly for internal use. Users should only see this for RTT. """ * */ struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture { PyObject *(*set)(struct __pyx_obj_11pygame_sdl2_6render_Texture *, SDL_Renderer *, SDL_Texture *); }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture *__pyx_vtabptr_11pygame_sdl2_6render_Texture; /* "pygame_sdl2/render.pyx":278 * * * cdef class Sprite: # <<<<<<<<<<<<<< * """ One or more TextureNodes, with possible transforms applied. """ * */ struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite { void (*adjust_rect)(struct __pyx_obj_11pygame_sdl2_6render_Sprite *, SDL_Rect const *, SDL_Rect const *, SDL_Rect *); }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *__pyx_vtabptr_11pygame_sdl2_6render_Sprite; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ (likely(is_tuple || PyTuple_Check(tuple)) ?\ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* ErrOccurredWithGIL.proto */ static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 #define __PYX_HAVE_RT_ImportType_proto_3_0_12 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_12 { __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); #endif /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_BlendMode(SDL_BlendMode value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* VoidPtrImport.proto */ static int __Pyx_ImportVoidPtr_3_0_12(PyObject *module, const char *name, void **p, const char *sig); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ static PyObject *__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_col); /* proto*/ static PyObject *__pyx_f_11pygame_sdl2_6render_7Texture_set(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, SDL_Renderer *__pyx_v_ren, SDL_Texture *__pyx_v_tex); /* proto*/ static void __pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, SDL_Rect const *__pyx_v_dest, SDL_Rect const *__pyx_v_rin, SDL_Rect *__pyx_v_rout); /* proto*/ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_image" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.display" */ static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.rect" */ static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.render" */ static int __pyx_v_11pygame_sdl2_6render_DEBUG_DRAW_BBOX; static PyObject *__pyx_f_11pygame_sdl2_6render_rinfo_to_dict(SDL_RendererInfo *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_6render___pyx_unpickle_TextureAtlas__set_state(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *, PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.render" extern int __pyx_module_is_main_pygame_sdl2__render; int __pyx_module_is_main_pygame_sdl2__render = 0; /* Implementation of "pygame_sdl2.render" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_open; /* #### Code section: string_decls ### */ static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k_g[] = "g"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "s"; static const char __pyx_k_t[] = "t"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__2[] = "."; static const char __pyx_k__3[] = "*"; static const char __pyx_k_fi[] = "fi"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_r1[] = "r1"; static const char __pyx_k_r2[] = "r2"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k_tn[] = "tn"; static const char __pyx_k_x1[] = "x1"; static const char __pyx_k_x2[] = "x2"; static const char __pyx_k_y1[] = "y1"; static const char __pyx_k_y2[] = "y2"; static const char __pyx_k__54[] = "?"; static const char __pyx_k_add[] = "add"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_ren[] = "ren"; static const char __pyx_k_rtt[] = "rtt"; static const char __pyx_k_tex[] = "tex"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_dest[] = "dest"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_info[] = "info"; static const char __pyx_k_json[] = "json"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_load[] = "load"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_meta[] = "meta"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_open[] = "open"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_warn[] = "warn"; static const char __pyx_k_Color[] = "Color"; static const char __pyx_k_clear[] = "clear"; static const char __pyx_k_color[] = "color"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_frame[] = "frame"; static const char __pyx_k_image[] = "image"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_nodes[] = "nodes"; static const char __pyx_k_other[] = "other"; static const char __pyx_k_pivot[] = "pivot"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_rinfo[] = "rinfo"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_vsync[] = "vsync"; static const char __pyx_k_Sprite[] = "Sprite"; static const char __pyx_k_dict_2[] = "_dict"; static const char __pyx_k_driver[] = "driver"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_frames[] = "frames"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_render[] = "render"; static const char __pyx_k_sprite[] = "sprite"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_vprect[] = "vprect"; static const char __pyx_k_window[] = "window"; static const char __pyx_k_Texture[] = "Texture"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_rotated[] = "rotated"; static const char __pyx_k_Renderer[] = "Renderer"; static const char __pyx_k_collides[] = "collides"; static const char __pyx_k_filename[] = "filename"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_software[] = "software"; static const char __pyx_k_warnings[] = "warnings"; static const char __pyx_k_Container[] = "Container"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_dest_rect[] = "dest_rect"; static const char __pyx_k_draw_line[] = "draw_line"; static const char __pyx_k_draw_rect[] = "draw_rect"; static const char __pyx_k_fill_rect[] = "fill_rect"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_real_dest[] = "real_dest"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_draw_point[] = "draw_point"; static const char __pyx_k_load_atlas[] = "load_atlas"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_sourceSize[] = "sourceSize"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_TextureNode[] = "TextureNode"; static const char __pyx_k_accelerated[] = "accelerated"; static const char __pyx_k_get_drivers[] = "get_drivers"; static const char __pyx_k_num_drivers[] = "num_drivers"; static const char __pyx_k_TextureAtlas[] = "TextureAtlas"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_load_texture[] = "load_texture"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_set_viewport[] = "set_viewport"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_use_setstate[] = "use_setstate"; static const char __pyx_k_BLENDMODE_ADD[] = "BLENDMODE_ADD"; static const char __pyx_k_BLENDMODE_MOD[] = "BLENDMODE_MOD"; static const char __pyx_k_Container_add[] = "Container.add"; static const char __pyx_k_Renderer_info[] = "Renderer.info"; static const char __pyx_k_Sprite_render[] = "Sprite.render"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_BLENDMODE_NONE[] = "BLENDMODE_NONE"; static const char __pyx_k_Renderer_clear[] = "Renderer.clear"; static const char __pyx_k_create_texture[] = "create_texture"; static const char __pyx_k_render_present[] = "render_present"; static const char __pyx_k_BLENDMODE_BLEND[] = "BLENDMODE_BLEND"; static const char __pyx_k_Sprite_collides[] = "Sprite.collides"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Container_render[] = "Container.render"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_spriteSourceSize[] = "spriteSourceSize"; static const char __pyx_k_TextureAtlas_keys[] = "TextureAtlas.keys"; static const char __pyx_k_max_texture_width[] = "max_texture_width"; static const char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_Invalid_argument_s[] = "Invalid argument: %s"; static const char __pyx_k_Renderer_draw_line[] = "Renderer.draw_line"; static const char __pyx_k_Renderer_draw_rect[] = "Renderer.draw_rect"; static const char __pyx_k_Renderer_fill_rect[] = "Renderer.fill_rect"; static const char __pyx_k_TextureNode_render[] = "TextureNode.render"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_max_texture_height[] = "max_texture_height"; static const char __pyx_k_pygame_sdl2_render[] = "pygame_sdl2.render"; static const char __pyx_k_Renderer_draw_point[] = "Renderer.draw_point"; static const char __pyx_k_Renderer_load_atlas[] = "Renderer.load_atlas"; static const char __pyx_k_Renderer_load_texture[] = "Renderer.load_texture"; static const char __pyx_k_Renderer_set_viewport[] = "Renderer.set_viewport"; static const char __pyx_k_Sprite___reduce_cython[] = "Sprite.__reduce_cython__"; static const char __pyx_k_Renderer_create_texture[] = "Renderer.create_texture"; static const char __pyx_k_Renderer_render_present[] = "Renderer.render_present"; static const char __pyx_k_Texture___reduce_cython[] = "Texture.__reduce_cython__"; static const char __pyx_k_Renderer___reduce_cython[] = "Renderer.__reduce_cython__"; static const char __pyx_k_Sprite___setstate_cython[] = "Sprite.__setstate_cython__"; static const char __pyx_k_Container___reduce_cython[] = "Container.__reduce_cython__"; static const char __pyx_k_Texture___setstate_cython[] = "Texture.__setstate_cython__"; static const char __pyx_k_pyx_unpickle_TextureAtlas[] = "__pyx_unpickle_TextureAtlas"; static const char __pyx_k_Renderer___setstate_cython[] = "Renderer.__setstate_cython__"; static const char __pyx_k_Rotation_not_supported_yet[] = "Rotation not supported yet."; static const char __pyx_k_src_pygame_sdl2_render_pyx[] = "src/pygame_sdl2/render.pyx"; static const char __pyx_k_Container___setstate_cython[] = "Container.__setstate_cython__"; static const char __pyx_k_Renderer_is_not_accelerated[] = "Renderer is not accelerated."; static const char __pyx_k_TextureNode___reduce_cython[] = "TextureNode.__reduce_cython__"; static const char __pyx_k_TextureAtlas___reduce_cython[] = "TextureAtlas.__reduce_cython__"; static const char __pyx_k_TextureNode___setstate_cython[] = "TextureNode.__setstate_cython__"; static const char __pyx_k_TextureAtlas___setstate_cython[] = "TextureAtlas.__setstate_cython__"; static const char __pyx_k_Pickling_of_struct_members_such[] = "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)"; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_Pickling_of_struct_members_such_2[] = "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)"; static const char __pyx_k_Pickling_of_struct_members_such_3[] = "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_6render_get_drivers(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_8Renderer___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_6render_8Renderer_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_8Renderer_4__init__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window, PyObject *__pyx_v_vsync, PyObject *__pyx_v_driver); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_6load_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_8load_atlas(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_10render_present(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_12info(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_14clear(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_16draw_line(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_18draw_point(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_20draw_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_22fill_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_24set_viewport(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_26create_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_28__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_30__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_7Texture___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_6render_7Texture_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1w___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_7Texture_1w_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1h___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_7Texture_1h_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_11TextureNode___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_tex); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_2render(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_dest); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_12TextureAtlas___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_ren, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_2__getitem__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_4keys(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite___init__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_nodes); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_2render(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_dest); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_4collides(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5color___set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5scale___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_arg); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_9Container___init__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_2add(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_sprite); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4render(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dest); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_9Container_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4rect___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_9Container_4rect_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_2__pyx_unpickle_TextureAtlas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Renderer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Texture(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureNode(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureAtlas(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Sprite(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Container(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect; #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_6render_Renderer; PyObject *__pyx_type_11pygame_sdl2_6render_Texture; PyObject *__pyx_type_11pygame_sdl2_6render_TextureNode; PyObject *__pyx_type_11pygame_sdl2_6render_TextureAtlas; PyObject *__pyx_type_11pygame_sdl2_6render_Sprite; PyObject *__pyx_type_11pygame_sdl2_6render_Container; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Renderer; PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Texture; PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_TextureNode; PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_TextureAtlas; PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Sprite; PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Container; PyObject *__pyx_n_s_BLENDMODE_ADD; PyObject *__pyx_n_s_BLENDMODE_BLEND; PyObject *__pyx_n_s_BLENDMODE_MOD; PyObject *__pyx_n_s_BLENDMODE_NONE; PyObject *__pyx_n_s_Color; PyObject *__pyx_n_s_Container; PyObject *__pyx_n_s_Container___reduce_cython; PyObject *__pyx_n_s_Container___setstate_cython; PyObject *__pyx_n_s_Container_add; PyObject *__pyx_n_s_Container_render; PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; PyObject *__pyx_kp_s_Invalid_argument_s; PyObject *__pyx_n_s_PickleError; PyObject *__pyx_kp_s_Pickling_of_struct_members_such; PyObject *__pyx_kp_s_Pickling_of_struct_members_such_2; PyObject *__pyx_kp_s_Pickling_of_struct_members_such_3; PyObject *__pyx_n_s_Rect; PyObject *__pyx_n_s_Renderer; PyObject *__pyx_n_s_Renderer___reduce_cython; PyObject *__pyx_n_s_Renderer___setstate_cython; PyObject *__pyx_n_s_Renderer_clear; PyObject *__pyx_n_s_Renderer_create_texture; PyObject *__pyx_n_s_Renderer_draw_line; PyObject *__pyx_n_s_Renderer_draw_point; PyObject *__pyx_n_s_Renderer_draw_rect; PyObject *__pyx_n_s_Renderer_fill_rect; PyObject *__pyx_n_s_Renderer_info; PyObject *__pyx_kp_s_Renderer_is_not_accelerated; PyObject *__pyx_n_s_Renderer_load_atlas; PyObject *__pyx_n_s_Renderer_load_texture; PyObject *__pyx_n_s_Renderer_render_present; PyObject *__pyx_n_s_Renderer_set_viewport; PyObject *__pyx_kp_s_Rotation_not_supported_yet; PyObject *__pyx_n_s_Sprite; PyObject *__pyx_n_s_Sprite___reduce_cython; PyObject *__pyx_n_s_Sprite___setstate_cython; PyObject *__pyx_n_s_Sprite_collides; PyObject *__pyx_n_s_Sprite_render; PyObject *__pyx_n_s_Texture; PyObject *__pyx_n_s_TextureAtlas; PyObject *__pyx_n_s_TextureAtlas___reduce_cython; PyObject *__pyx_n_s_TextureAtlas___setstate_cython; PyObject *__pyx_n_s_TextureAtlas_keys; PyObject *__pyx_n_s_TextureNode; PyObject *__pyx_n_s_TextureNode___reduce_cython; PyObject *__pyx_n_s_TextureNode___setstate_cython; PyObject *__pyx_n_s_TextureNode_render; PyObject *__pyx_n_s_Texture___reduce_cython; PyObject *__pyx_n_s_Texture___setstate_cython; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_kp_u__2; PyObject *__pyx_n_s__3; PyObject *__pyx_n_s__54; PyObject *__pyx_n_s_a; PyObject *__pyx_n_s_accelerated; PyObject *__pyx_n_s_add; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_b; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_clear; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_collides; PyObject *__pyx_n_s_color; PyObject *__pyx_n_s_create_texture; PyObject *__pyx_n_s_dest; PyObject *__pyx_n_s_dest_rect; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_dict_2; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_draw_line; PyObject *__pyx_n_s_draw_point; PyObject *__pyx_n_s_draw_rect; PyObject *__pyx_n_s_driver; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_fi; PyObject *__pyx_n_s_filename; PyObject *__pyx_n_s_fill_rect; PyObject *__pyx_n_s_frame; PyObject *__pyx_n_s_frames; PyObject *__pyx_n_s_g; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_drivers; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_image; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_info; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_items; PyObject *__pyx_n_s_json; PyObject *__pyx_n_s_keys; PyObject *__pyx_n_s_load; PyObject *__pyx_n_s_load_atlas; PyObject *__pyx_n_s_load_texture; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_max_texture_height; PyObject *__pyx_n_s_max_texture_width; PyObject *__pyx_n_s_meta; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_n_s_new; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_nodes; PyObject *__pyx_n_s_num_drivers; PyObject *__pyx_n_s_open; PyObject *__pyx_n_s_other; PyObject *__pyx_n_s_pickle; PyObject *__pyx_n_s_pivot; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_pygame_sdl2_color; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_rect; PyObject *__pyx_n_s_pygame_sdl2_render; PyObject *__pyx_n_s_pyx_PickleError; PyObject *__pyx_n_s_pyx_checksum; PyObject *__pyx_n_s_pyx_result; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_type; PyObject *__pyx_n_s_pyx_unpickle_TextureAtlas; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_r1; PyObject *__pyx_n_s_r2; PyObject *__pyx_n_s_range; PyObject *__pyx_n_s_real_dest; PyObject *__pyx_n_s_rect; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_ren; PyObject *__pyx_n_s_render; PyObject *__pyx_n_s_render_present; PyObject *__pyx_n_s_rinfo; PyObject *__pyx_n_s_rotated; PyObject *__pyx_n_s_rtt; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_s; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_viewport; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_software; PyObject *__pyx_n_s_sourceSize; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_sprite; PyObject *__pyx_n_s_spriteSourceSize; PyObject *__pyx_kp_s_src_pygame_sdl2_render_pyx; PyObject *__pyx_n_s_state; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_t; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_tex; PyObject *__pyx_n_s_tn; PyObject *__pyx_n_s_update; PyObject *__pyx_n_s_use_setstate; PyObject *__pyx_n_s_vprect; PyObject *__pyx_n_s_vsync; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_warn; PyObject *__pyx_n_s_warnings; PyObject *__pyx_n_s_window; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_x1; PyObject *__pyx_n_s_x2; PyObject *__pyx_n_s_y; PyObject *__pyx_n_s_y1; PyObject *__pyx_n_s_y2; PyObject *__pyx_int_0; PyObject *__pyx_int_93638610; PyObject *__pyx_int_231588268; PyObject *__pyx_int_243099540; PyObject *__pyx_int_neg_1; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__32; PyObject *__pyx_tuple__37; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__42; PyObject *__pyx_tuple__46; PyObject *__pyx_tuple__48; PyObject *__pyx_tuple__52; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__31; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__38; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__43; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__45; PyObject *__pyx_codeobj__47; PyObject *__pyx_codeobj__49; PyObject *__pyx_codeobj__50; PyObject *__pyx_codeobj__51; PyObject *__pyx_codeobj__53; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_6render_Renderer); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_6render_Renderer); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_6render_Texture); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_6render_Texture); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_6render_TextureNode); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_6render_TextureNode); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_6render_TextureAtlas); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_6render_TextureAtlas); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_6render_Sprite); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_6render_Sprite); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_6render_Container); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_6render_Container); Py_CLEAR(clear_module_state->__pyx_n_s_BLENDMODE_ADD); Py_CLEAR(clear_module_state->__pyx_n_s_BLENDMODE_BLEND); Py_CLEAR(clear_module_state->__pyx_n_s_BLENDMODE_MOD); Py_CLEAR(clear_module_state->__pyx_n_s_BLENDMODE_NONE); Py_CLEAR(clear_module_state->__pyx_n_s_Color); Py_CLEAR(clear_module_state->__pyx_n_s_Container); Py_CLEAR(clear_module_state->__pyx_n_s_Container___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Container___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Container_add); Py_CLEAR(clear_module_state->__pyx_n_s_Container_render); Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_CLEAR(clear_module_state->__pyx_kp_s_Invalid_argument_s); Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); Py_CLEAR(clear_module_state->__pyx_kp_s_Pickling_of_struct_members_such); Py_CLEAR(clear_module_state->__pyx_kp_s_Pickling_of_struct_members_such_2); Py_CLEAR(clear_module_state->__pyx_kp_s_Pickling_of_struct_members_such_3); Py_CLEAR(clear_module_state->__pyx_n_s_Rect); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_clear); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_create_texture); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_draw_line); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_draw_point); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_draw_rect); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_fill_rect); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_info); Py_CLEAR(clear_module_state->__pyx_kp_s_Renderer_is_not_accelerated); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_load_atlas); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_load_texture); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_render_present); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_set_viewport); Py_CLEAR(clear_module_state->__pyx_kp_s_Rotation_not_supported_yet); Py_CLEAR(clear_module_state->__pyx_n_s_Sprite); Py_CLEAR(clear_module_state->__pyx_n_s_Sprite___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Sprite___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Sprite_collides); Py_CLEAR(clear_module_state->__pyx_n_s_Sprite_render); Py_CLEAR(clear_module_state->__pyx_n_s_Texture); Py_CLEAR(clear_module_state->__pyx_n_s_TextureAtlas); Py_CLEAR(clear_module_state->__pyx_n_s_TextureAtlas___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_TextureAtlas___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_TextureAtlas_keys); Py_CLEAR(clear_module_state->__pyx_n_s_TextureNode); Py_CLEAR(clear_module_state->__pyx_n_s_TextureNode___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_TextureNode___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_TextureNode_render); Py_CLEAR(clear_module_state->__pyx_n_s_Texture___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Texture___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_n_s__3); Py_CLEAR(clear_module_state->__pyx_n_s__54); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_s_accelerated); Py_CLEAR(clear_module_state->__pyx_n_s_add); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_b); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_clear); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_collides); Py_CLEAR(clear_module_state->__pyx_n_s_color); Py_CLEAR(clear_module_state->__pyx_n_s_create_texture); Py_CLEAR(clear_module_state->__pyx_n_s_dest); Py_CLEAR(clear_module_state->__pyx_n_s_dest_rect); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_draw_line); Py_CLEAR(clear_module_state->__pyx_n_s_draw_point); Py_CLEAR(clear_module_state->__pyx_n_s_draw_rect); Py_CLEAR(clear_module_state->__pyx_n_s_driver); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_fi); Py_CLEAR(clear_module_state->__pyx_n_s_filename); Py_CLEAR(clear_module_state->__pyx_n_s_fill_rect); Py_CLEAR(clear_module_state->__pyx_n_s_frame); Py_CLEAR(clear_module_state->__pyx_n_s_frames); Py_CLEAR(clear_module_state->__pyx_n_s_g); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_drivers); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_image); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_info); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_items); Py_CLEAR(clear_module_state->__pyx_n_s_json); Py_CLEAR(clear_module_state->__pyx_n_s_keys); Py_CLEAR(clear_module_state->__pyx_n_s_load); Py_CLEAR(clear_module_state->__pyx_n_s_load_atlas); Py_CLEAR(clear_module_state->__pyx_n_s_load_texture); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_max_texture_height); Py_CLEAR(clear_module_state->__pyx_n_s_max_texture_width); Py_CLEAR(clear_module_state->__pyx_n_s_meta); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_n_s_new); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_nodes); Py_CLEAR(clear_module_state->__pyx_n_s_num_drivers); Py_CLEAR(clear_module_state->__pyx_n_s_open); Py_CLEAR(clear_module_state->__pyx_n_s_other); Py_CLEAR(clear_module_state->__pyx_n_s_pickle); Py_CLEAR(clear_module_state->__pyx_n_s_pivot); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_color); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rect); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_render); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_TextureAtlas); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_r1); Py_CLEAR(clear_module_state->__pyx_n_s_r2); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_s_real_dest); Py_CLEAR(clear_module_state->__pyx_n_s_rect); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_ren); Py_CLEAR(clear_module_state->__pyx_n_s_render); Py_CLEAR(clear_module_state->__pyx_n_s_render_present); Py_CLEAR(clear_module_state->__pyx_n_s_rinfo); Py_CLEAR(clear_module_state->__pyx_n_s_rotated); Py_CLEAR(clear_module_state->__pyx_n_s_rtt); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_s); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_viewport); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_software); Py_CLEAR(clear_module_state->__pyx_n_s_sourceSize); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_sprite); Py_CLEAR(clear_module_state->__pyx_n_s_spriteSourceSize); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_render_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_t); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_tex); Py_CLEAR(clear_module_state->__pyx_n_s_tn); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_vprect); Py_CLEAR(clear_module_state->__pyx_n_s_vsync); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_warn); Py_CLEAR(clear_module_state->__pyx_n_s_warnings); Py_CLEAR(clear_module_state->__pyx_n_s_window); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_x1); Py_CLEAR(clear_module_state->__pyx_n_s_x2); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_n_s_y1); Py_CLEAR(clear_module_state->__pyx_n_s_y2); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_93638610); Py_CLEAR(clear_module_state->__pyx_int_231588268); Py_CLEAR(clear_module_state->__pyx_int_243099540); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__32); Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__42); Py_CLEAR(clear_module_state->__pyx_tuple__46); Py_CLEAR(clear_module_state->__pyx_tuple__48); Py_CLEAR(clear_module_state->__pyx_tuple__52); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__31); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__38); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__43); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__45); Py_CLEAR(clear_module_state->__pyx_codeobj__47); Py_CLEAR(clear_module_state->__pyx_codeobj__49); Py_CLEAR(clear_module_state->__pyx_codeobj__50); Py_CLEAR(clear_module_state->__pyx_codeobj__51); Py_CLEAR(clear_module_state->__pyx_codeobj__53); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7display_Window); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_6render_Renderer); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_6render_Renderer); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_6render_Texture); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_6render_Texture); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_6render_TextureNode); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_6render_TextureNode); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_6render_TextureAtlas); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_6render_TextureAtlas); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_6render_Sprite); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_6render_Sprite); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_6render_Container); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_6render_Container); Py_VISIT(traverse_module_state->__pyx_n_s_BLENDMODE_ADD); Py_VISIT(traverse_module_state->__pyx_n_s_BLENDMODE_BLEND); Py_VISIT(traverse_module_state->__pyx_n_s_BLENDMODE_MOD); Py_VISIT(traverse_module_state->__pyx_n_s_BLENDMODE_NONE); Py_VISIT(traverse_module_state->__pyx_n_s_Color); Py_VISIT(traverse_module_state->__pyx_n_s_Container); Py_VISIT(traverse_module_state->__pyx_n_s_Container___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Container___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Container_add); Py_VISIT(traverse_module_state->__pyx_n_s_Container_render); Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_VISIT(traverse_module_state->__pyx_kp_s_Invalid_argument_s); Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); Py_VISIT(traverse_module_state->__pyx_kp_s_Pickling_of_struct_members_such); Py_VISIT(traverse_module_state->__pyx_kp_s_Pickling_of_struct_members_such_2); Py_VISIT(traverse_module_state->__pyx_kp_s_Pickling_of_struct_members_such_3); Py_VISIT(traverse_module_state->__pyx_n_s_Rect); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_clear); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_create_texture); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_draw_line); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_draw_point); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_draw_rect); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_fill_rect); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_info); Py_VISIT(traverse_module_state->__pyx_kp_s_Renderer_is_not_accelerated); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_load_atlas); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_load_texture); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_render_present); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_set_viewport); Py_VISIT(traverse_module_state->__pyx_kp_s_Rotation_not_supported_yet); Py_VISIT(traverse_module_state->__pyx_n_s_Sprite); Py_VISIT(traverse_module_state->__pyx_n_s_Sprite___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Sprite___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Sprite_collides); Py_VISIT(traverse_module_state->__pyx_n_s_Sprite_render); Py_VISIT(traverse_module_state->__pyx_n_s_Texture); Py_VISIT(traverse_module_state->__pyx_n_s_TextureAtlas); Py_VISIT(traverse_module_state->__pyx_n_s_TextureAtlas___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_TextureAtlas___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_TextureAtlas_keys); Py_VISIT(traverse_module_state->__pyx_n_s_TextureNode); Py_VISIT(traverse_module_state->__pyx_n_s_TextureNode___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_TextureNode___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_TextureNode_render); Py_VISIT(traverse_module_state->__pyx_n_s_Texture___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Texture___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_n_s__3); Py_VISIT(traverse_module_state->__pyx_n_s__54); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_s_accelerated); Py_VISIT(traverse_module_state->__pyx_n_s_add); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_b); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_clear); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_collides); Py_VISIT(traverse_module_state->__pyx_n_s_color); Py_VISIT(traverse_module_state->__pyx_n_s_create_texture); Py_VISIT(traverse_module_state->__pyx_n_s_dest); Py_VISIT(traverse_module_state->__pyx_n_s_dest_rect); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_draw_line); Py_VISIT(traverse_module_state->__pyx_n_s_draw_point); Py_VISIT(traverse_module_state->__pyx_n_s_draw_rect); Py_VISIT(traverse_module_state->__pyx_n_s_driver); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_fi); Py_VISIT(traverse_module_state->__pyx_n_s_filename); Py_VISIT(traverse_module_state->__pyx_n_s_fill_rect); Py_VISIT(traverse_module_state->__pyx_n_s_frame); Py_VISIT(traverse_module_state->__pyx_n_s_frames); Py_VISIT(traverse_module_state->__pyx_n_s_g); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_drivers); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_image); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_info); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_items); Py_VISIT(traverse_module_state->__pyx_n_s_json); Py_VISIT(traverse_module_state->__pyx_n_s_keys); Py_VISIT(traverse_module_state->__pyx_n_s_load); Py_VISIT(traverse_module_state->__pyx_n_s_load_atlas); Py_VISIT(traverse_module_state->__pyx_n_s_load_texture); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_max_texture_height); Py_VISIT(traverse_module_state->__pyx_n_s_max_texture_width); Py_VISIT(traverse_module_state->__pyx_n_s_meta); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_n_s_new); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_nodes); Py_VISIT(traverse_module_state->__pyx_n_s_num_drivers); Py_VISIT(traverse_module_state->__pyx_n_s_open); Py_VISIT(traverse_module_state->__pyx_n_s_other); Py_VISIT(traverse_module_state->__pyx_n_s_pickle); Py_VISIT(traverse_module_state->__pyx_n_s_pivot); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_color); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rect); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_render); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_TextureAtlas); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_r1); Py_VISIT(traverse_module_state->__pyx_n_s_r2); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_s_real_dest); Py_VISIT(traverse_module_state->__pyx_n_s_rect); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_ren); Py_VISIT(traverse_module_state->__pyx_n_s_render); Py_VISIT(traverse_module_state->__pyx_n_s_render_present); Py_VISIT(traverse_module_state->__pyx_n_s_rinfo); Py_VISIT(traverse_module_state->__pyx_n_s_rotated); Py_VISIT(traverse_module_state->__pyx_n_s_rtt); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_s); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_viewport); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_software); Py_VISIT(traverse_module_state->__pyx_n_s_sourceSize); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_sprite); Py_VISIT(traverse_module_state->__pyx_n_s_spriteSourceSize); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_render_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_t); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_tex); Py_VISIT(traverse_module_state->__pyx_n_s_tn); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_vprect); Py_VISIT(traverse_module_state->__pyx_n_s_vsync); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_warn); Py_VISIT(traverse_module_state->__pyx_n_s_warnings); Py_VISIT(traverse_module_state->__pyx_n_s_window); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_x1); Py_VISIT(traverse_module_state->__pyx_n_s_x2); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_n_s_y1); Py_VISIT(traverse_module_state->__pyx_n_s_y2); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_93638610); Py_VISIT(traverse_module_state->__pyx_int_231588268); Py_VISIT(traverse_module_state->__pyx_int_243099540); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__32); Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__42); Py_VISIT(traverse_module_state->__pyx_tuple__46); Py_VISIT(traverse_module_state->__pyx_tuple__48); Py_VISIT(traverse_module_state->__pyx_tuple__52); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__31); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__38); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__43); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__45); Py_VISIT(traverse_module_state->__pyx_codeobj__47); Py_VISIT(traverse_module_state->__pyx_codeobj__49); Py_VISIT(traverse_module_state->__pyx_codeobj__50); Py_VISIT(traverse_module_state->__pyx_codeobj__51); Py_VISIT(traverse_module_state->__pyx_codeobj__53); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7display_Window __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7display_Window #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_4rect_Rect __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_4rect_Rect #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_6render_Renderer __pyx_mstate_global->__pyx_type_11pygame_sdl2_6render_Renderer #define __pyx_type_11pygame_sdl2_6render_Texture __pyx_mstate_global->__pyx_type_11pygame_sdl2_6render_Texture #define __pyx_type_11pygame_sdl2_6render_TextureNode __pyx_mstate_global->__pyx_type_11pygame_sdl2_6render_TextureNode #define __pyx_type_11pygame_sdl2_6render_TextureAtlas __pyx_mstate_global->__pyx_type_11pygame_sdl2_6render_TextureAtlas #define __pyx_type_11pygame_sdl2_6render_Sprite __pyx_mstate_global->__pyx_type_11pygame_sdl2_6render_Sprite #define __pyx_type_11pygame_sdl2_6render_Container __pyx_mstate_global->__pyx_type_11pygame_sdl2_6render_Container #endif #define __pyx_ptype_11pygame_sdl2_6render_Renderer __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_6render_Renderer #define __pyx_ptype_11pygame_sdl2_6render_Texture __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_6render_Texture #define __pyx_ptype_11pygame_sdl2_6render_TextureNode __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_6render_TextureNode #define __pyx_ptype_11pygame_sdl2_6render_TextureAtlas __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_6render_TextureAtlas #define __pyx_ptype_11pygame_sdl2_6render_Sprite __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_6render_Sprite #define __pyx_ptype_11pygame_sdl2_6render_Container __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_6render_Container #define __pyx_n_s_BLENDMODE_ADD __pyx_mstate_global->__pyx_n_s_BLENDMODE_ADD #define __pyx_n_s_BLENDMODE_BLEND __pyx_mstate_global->__pyx_n_s_BLENDMODE_BLEND #define __pyx_n_s_BLENDMODE_MOD __pyx_mstate_global->__pyx_n_s_BLENDMODE_MOD #define __pyx_n_s_BLENDMODE_NONE __pyx_mstate_global->__pyx_n_s_BLENDMODE_NONE #define __pyx_n_s_Color __pyx_mstate_global->__pyx_n_s_Color #define __pyx_n_s_Container __pyx_mstate_global->__pyx_n_s_Container #define __pyx_n_s_Container___reduce_cython __pyx_mstate_global->__pyx_n_s_Container___reduce_cython #define __pyx_n_s_Container___setstate_cython __pyx_mstate_global->__pyx_n_s_Container___setstate_cython #define __pyx_n_s_Container_add __pyx_mstate_global->__pyx_n_s_Container_add #define __pyx_n_s_Container_render __pyx_mstate_global->__pyx_n_s_Container_render #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 #define __pyx_kp_s_Invalid_argument_s __pyx_mstate_global->__pyx_kp_s_Invalid_argument_s #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError #define __pyx_kp_s_Pickling_of_struct_members_such __pyx_mstate_global->__pyx_kp_s_Pickling_of_struct_members_such #define __pyx_kp_s_Pickling_of_struct_members_such_2 __pyx_mstate_global->__pyx_kp_s_Pickling_of_struct_members_such_2 #define __pyx_kp_s_Pickling_of_struct_members_such_3 __pyx_mstate_global->__pyx_kp_s_Pickling_of_struct_members_such_3 #define __pyx_n_s_Rect __pyx_mstate_global->__pyx_n_s_Rect #define __pyx_n_s_Renderer __pyx_mstate_global->__pyx_n_s_Renderer #define __pyx_n_s_Renderer___reduce_cython __pyx_mstate_global->__pyx_n_s_Renderer___reduce_cython #define __pyx_n_s_Renderer___setstate_cython __pyx_mstate_global->__pyx_n_s_Renderer___setstate_cython #define __pyx_n_s_Renderer_clear __pyx_mstate_global->__pyx_n_s_Renderer_clear #define __pyx_n_s_Renderer_create_texture __pyx_mstate_global->__pyx_n_s_Renderer_create_texture #define __pyx_n_s_Renderer_draw_line __pyx_mstate_global->__pyx_n_s_Renderer_draw_line #define __pyx_n_s_Renderer_draw_point __pyx_mstate_global->__pyx_n_s_Renderer_draw_point #define __pyx_n_s_Renderer_draw_rect __pyx_mstate_global->__pyx_n_s_Renderer_draw_rect #define __pyx_n_s_Renderer_fill_rect __pyx_mstate_global->__pyx_n_s_Renderer_fill_rect #define __pyx_n_s_Renderer_info __pyx_mstate_global->__pyx_n_s_Renderer_info #define __pyx_kp_s_Renderer_is_not_accelerated __pyx_mstate_global->__pyx_kp_s_Renderer_is_not_accelerated #define __pyx_n_s_Renderer_load_atlas __pyx_mstate_global->__pyx_n_s_Renderer_load_atlas #define __pyx_n_s_Renderer_load_texture __pyx_mstate_global->__pyx_n_s_Renderer_load_texture #define __pyx_n_s_Renderer_render_present __pyx_mstate_global->__pyx_n_s_Renderer_render_present #define __pyx_n_s_Renderer_set_viewport __pyx_mstate_global->__pyx_n_s_Renderer_set_viewport #define __pyx_kp_s_Rotation_not_supported_yet __pyx_mstate_global->__pyx_kp_s_Rotation_not_supported_yet #define __pyx_n_s_Sprite __pyx_mstate_global->__pyx_n_s_Sprite #define __pyx_n_s_Sprite___reduce_cython __pyx_mstate_global->__pyx_n_s_Sprite___reduce_cython #define __pyx_n_s_Sprite___setstate_cython __pyx_mstate_global->__pyx_n_s_Sprite___setstate_cython #define __pyx_n_s_Sprite_collides __pyx_mstate_global->__pyx_n_s_Sprite_collides #define __pyx_n_s_Sprite_render __pyx_mstate_global->__pyx_n_s_Sprite_render #define __pyx_n_s_Texture __pyx_mstate_global->__pyx_n_s_Texture #define __pyx_n_s_TextureAtlas __pyx_mstate_global->__pyx_n_s_TextureAtlas #define __pyx_n_s_TextureAtlas___reduce_cython __pyx_mstate_global->__pyx_n_s_TextureAtlas___reduce_cython #define __pyx_n_s_TextureAtlas___setstate_cython __pyx_mstate_global->__pyx_n_s_TextureAtlas___setstate_cython #define __pyx_n_s_TextureAtlas_keys __pyx_mstate_global->__pyx_n_s_TextureAtlas_keys #define __pyx_n_s_TextureNode __pyx_mstate_global->__pyx_n_s_TextureNode #define __pyx_n_s_TextureNode___reduce_cython __pyx_mstate_global->__pyx_n_s_TextureNode___reduce_cython #define __pyx_n_s_TextureNode___setstate_cython __pyx_mstate_global->__pyx_n_s_TextureNode___setstate_cython #define __pyx_n_s_TextureNode_render __pyx_mstate_global->__pyx_n_s_TextureNode_render #define __pyx_n_s_Texture___reduce_cython __pyx_mstate_global->__pyx_n_s_Texture___reduce_cython #define __pyx_n_s_Texture___setstate_cython __pyx_mstate_global->__pyx_n_s_Texture___setstate_cython #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3 #define __pyx_n_s__54 __pyx_mstate_global->__pyx_n_s__54 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_n_s_accelerated __pyx_mstate_global->__pyx_n_s_accelerated #define __pyx_n_s_add __pyx_mstate_global->__pyx_n_s_add #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_clear __pyx_mstate_global->__pyx_n_s_clear #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_collides __pyx_mstate_global->__pyx_n_s_collides #define __pyx_n_s_color __pyx_mstate_global->__pyx_n_s_color #define __pyx_n_s_create_texture __pyx_mstate_global->__pyx_n_s_create_texture #define __pyx_n_s_dest __pyx_mstate_global->__pyx_n_s_dest #define __pyx_n_s_dest_rect __pyx_mstate_global->__pyx_n_s_dest_rect #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_draw_line __pyx_mstate_global->__pyx_n_s_draw_line #define __pyx_n_s_draw_point __pyx_mstate_global->__pyx_n_s_draw_point #define __pyx_n_s_draw_rect __pyx_mstate_global->__pyx_n_s_draw_rect #define __pyx_n_s_driver __pyx_mstate_global->__pyx_n_s_driver #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_fi __pyx_mstate_global->__pyx_n_s_fi #define __pyx_n_s_filename __pyx_mstate_global->__pyx_n_s_filename #define __pyx_n_s_fill_rect __pyx_mstate_global->__pyx_n_s_fill_rect #define __pyx_n_s_frame __pyx_mstate_global->__pyx_n_s_frame #define __pyx_n_s_frames __pyx_mstate_global->__pyx_n_s_frames #define __pyx_n_s_g __pyx_mstate_global->__pyx_n_s_g #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_drivers __pyx_mstate_global->__pyx_n_s_get_drivers #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_image __pyx_mstate_global->__pyx_n_s_image #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_info __pyx_mstate_global->__pyx_n_s_info #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items #define __pyx_n_s_json __pyx_mstate_global->__pyx_n_s_json #define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys #define __pyx_n_s_load __pyx_mstate_global->__pyx_n_s_load #define __pyx_n_s_load_atlas __pyx_mstate_global->__pyx_n_s_load_atlas #define __pyx_n_s_load_texture __pyx_mstate_global->__pyx_n_s_load_texture #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_max_texture_height __pyx_mstate_global->__pyx_n_s_max_texture_height #define __pyx_n_s_max_texture_width __pyx_mstate_global->__pyx_n_s_max_texture_width #define __pyx_n_s_meta __pyx_mstate_global->__pyx_n_s_meta #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_nodes __pyx_mstate_global->__pyx_n_s_nodes #define __pyx_n_s_num_drivers __pyx_mstate_global->__pyx_n_s_num_drivers #define __pyx_n_s_open __pyx_mstate_global->__pyx_n_s_open #define __pyx_n_s_other __pyx_mstate_global->__pyx_n_s_other #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle #define __pyx_n_s_pivot __pyx_mstate_global->__pyx_n_s_pivot #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_pygame_sdl2_color __pyx_mstate_global->__pyx_n_s_pygame_sdl2_color #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_rect __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rect #define __pyx_n_s_pygame_sdl2_render __pyx_mstate_global->__pyx_n_s_pygame_sdl2_render #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type #define __pyx_n_s_pyx_unpickle_TextureAtlas __pyx_mstate_global->__pyx_n_s_pyx_unpickle_TextureAtlas #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_r1 __pyx_mstate_global->__pyx_n_s_r1 #define __pyx_n_s_r2 __pyx_mstate_global->__pyx_n_s_r2 #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_n_s_real_dest __pyx_mstate_global->__pyx_n_s_real_dest #define __pyx_n_s_rect __pyx_mstate_global->__pyx_n_s_rect #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_ren __pyx_mstate_global->__pyx_n_s_ren #define __pyx_n_s_render __pyx_mstate_global->__pyx_n_s_render #define __pyx_n_s_render_present __pyx_mstate_global->__pyx_n_s_render_present #define __pyx_n_s_rinfo __pyx_mstate_global->__pyx_n_s_rinfo #define __pyx_n_s_rotated __pyx_mstate_global->__pyx_n_s_rotated #define __pyx_n_s_rtt __pyx_mstate_global->__pyx_n_s_rtt #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_viewport __pyx_mstate_global->__pyx_n_s_set_viewport #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_software __pyx_mstate_global->__pyx_n_s_software #define __pyx_n_s_sourceSize __pyx_mstate_global->__pyx_n_s_sourceSize #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_sprite __pyx_mstate_global->__pyx_n_s_sprite #define __pyx_n_s_spriteSourceSize __pyx_mstate_global->__pyx_n_s_spriteSourceSize #define __pyx_kp_s_src_pygame_sdl2_render_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_render_pyx #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_tex __pyx_mstate_global->__pyx_n_s_tex #define __pyx_n_s_tn __pyx_mstate_global->__pyx_n_s_tn #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate #define __pyx_n_s_vprect __pyx_mstate_global->__pyx_n_s_vprect #define __pyx_n_s_vsync __pyx_mstate_global->__pyx_n_s_vsync #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn #define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings #define __pyx_n_s_window __pyx_mstate_global->__pyx_n_s_window #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_x1 __pyx_mstate_global->__pyx_n_s_x1 #define __pyx_n_s_x2 __pyx_mstate_global->__pyx_n_s_x2 #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_n_s_y1 __pyx_mstate_global->__pyx_n_s_y1 #define __pyx_n_s_y2 __pyx_mstate_global->__pyx_n_s_y2 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_93638610 __pyx_mstate_global->__pyx_int_93638610 #define __pyx_int_231588268 __pyx_mstate_global->__pyx_int_231588268 #define __pyx_int_243099540 __pyx_mstate_global->__pyx_int_243099540 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 #define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46 #define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48 #define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45 #define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 #define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 /* #### Code section: module_code ### */ /* "pygame_sdl2/render.pyx":40 * cdef bint DEBUG_DRAW_BBOX = True * * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): # <<<<<<<<<<<<<< * # Ignore texture_formats for now. * return { */ static PyObject *__pyx_f_11pygame_sdl2_6render_rinfo_to_dict(SDL_RendererInfo *__pyx_v_rinfo) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rinfo_to_dict", 1); /* "pygame_sdl2/render.pyx":42 * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): * # Ignore texture_formats for now. * return { # <<<<<<<<<<<<<< * "name" : rinfo.name, * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, */ __Pyx_XDECREF(__pyx_r); /* "pygame_sdl2/render.pyx":43 * # Ignore texture_formats for now. * return { * "name" : rinfo.name, # <<<<<<<<<<<<<< * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, */ __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rinfo->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":44 * return { * "name" : rinfo.name, * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, # <<<<<<<<<<<<<< * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_SOFTWARE) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_software, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":45 * "name" : rinfo.name, * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, # <<<<<<<<<<<<<< * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_ACCELERATED) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_accelerated, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":46 * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, # <<<<<<<<<<<<<< * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, * "max_texture_width" : rinfo.max_texture_width, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_PRESENTVSYNC) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_vsync, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":47 * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, # <<<<<<<<<<<<<< * "max_texture_width" : rinfo.max_texture_width, * "max_texture_height" : rinfo.max_texture_height, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_TARGETTEXTURE) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rtt, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":48 * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, * "max_texture_width" : rinfo.max_texture_width, # <<<<<<<<<<<<<< * "max_texture_height" : rinfo.max_texture_height, * } */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rinfo->max_texture_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_max_texture_width, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":49 * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, * "max_texture_width" : rinfo.max_texture_width, * "max_texture_height" : rinfo.max_texture_height, # <<<<<<<<<<<<<< * } * */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rinfo->max_texture_height); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_max_texture_height, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":40 * cdef bint DEBUG_DRAW_BBOX = True * * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): # <<<<<<<<<<<<<< * # Ignore texture_formats for now. * return { */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.rinfo_to_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_1get_drivers(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_get_drivers, "get_drivers()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_1get_drivers = {"get_drivers", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_1get_drivers, METH_NOARGS, __pyx_doc_11pygame_sdl2_6render_get_drivers}; static PyObject *__pyx_pw_11pygame_sdl2_6render_1get_drivers(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_drivers (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_get_drivers(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_get_drivers(CYTHON_UNUSED PyObject *__pyx_self) { SDL_RendererInfo __pyx_v_rinfo; int __pyx_v_num_drivers; PyObject *__pyx_v_rv = NULL; int __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_drivers", 1); /* "pygame_sdl2/render.pyx":55 * cdef SDL_RendererInfo rinfo * cdef int num_drivers * rv = [] # <<<<<<<<<<<<<< * * num_drivers = SDL_GetNumRenderDrivers() */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":57 * rv = [] * * num_drivers = SDL_GetNumRenderDrivers() # <<<<<<<<<<<<<< * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: */ __pyx_v_num_drivers = SDL_GetNumRenderDrivers(); /* "pygame_sdl2/render.pyx":58 * * num_drivers = SDL_GetNumRenderDrivers() * for n in range(num_drivers): # <<<<<<<<<<<<<< * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: * raise error() */ __pyx_t_2 = __pyx_v_num_drivers; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_n = __pyx_t_4; /* "pygame_sdl2/render.pyx":59 * num_drivers = SDL_GetNumRenderDrivers() * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = (SDL_GetRenderDriverInfo(__pyx_v_n, (&__pyx_v_rinfo)) != 0); if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/render.pyx":60 * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: * raise error() # <<<<<<<<<<<<<< * * rv.append(rinfo_to_dict(&rinfo)) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 60, __pyx_L1_error) /* "pygame_sdl2/render.pyx":59 * num_drivers = SDL_GetNumRenderDrivers() * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":62 * raise error() * * rv.append(rinfo_to_dict(&rinfo)) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_1 = __pyx_f_11pygame_sdl2_6render_rinfo_to_dict((&__pyx_v_rinfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "pygame_sdl2/render.pyx":64 * rv.append(rinfo_to_dict(&rinfo)) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.render.get_drivers", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":71 * cdef dict _info * * def __cinit__(self): # <<<<<<<<<<<<<< * self.renderer = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer___cinit__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_8Renderer___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/render.pyx":72 * * def __cinit__(self): * self.renderer = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->renderer = NULL; /* "pygame_sdl2/render.pyx":71 * cdef dict _info * * def __cinit__(self): # <<<<<<<<<<<<<< * self.renderer = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/render.pyx":74 * self.renderer = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.renderer: * SDL_DestroyRenderer(self.renderer) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_6render_8Renderer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_6render_8Renderer_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_6render_8Renderer_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_6render_8Renderer_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { int __pyx_t_1; /* "pygame_sdl2/render.pyx":75 * * def __dealloc__(self): * if self.renderer: # <<<<<<<<<<<<<< * SDL_DestroyRenderer(self.renderer) * */ __pyx_t_1 = (__pyx_v_self->renderer != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":76 * def __dealloc__(self): * if self.renderer: * SDL_DestroyRenderer(self.renderer) # <<<<<<<<<<<<<< * * def __init__(self, Window window=None, vsync=False, driver=-1): */ SDL_DestroyRenderer(__pyx_v_self->renderer); /* "pygame_sdl2/render.pyx":75 * * def __dealloc__(self): * if self.renderer: # <<<<<<<<<<<<<< * SDL_DestroyRenderer(self.renderer) * */ } /* "pygame_sdl2/render.pyx":74 * self.renderer = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.renderer: * SDL_DestroyRenderer(self.renderer) */ /* function exit code */ } /* "pygame_sdl2/render.pyx":78 * SDL_DestroyRenderer(self.renderer) * * def __init__(self, Window window=None, vsync=False, driver=-1): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window = 0; PyObject *__pyx_v_vsync = 0; PyObject *__pyx_v_driver = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_window,&__pyx_n_s_vsync,&__pyx_n_s_driver,0}; values[0] = __Pyx_Arg_NewRef_VARARGS((PyObject *)((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_False)); values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_neg_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_window); if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vsync); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_driver); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 78, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)values[0]); __pyx_v_vsync = values[1]; __pyx_v_driver = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 78, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_window), __pyx_ptype_11pygame_sdl2_7display_Window, 1, "window", 0))) __PYX_ERR(0, 78, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_4__init__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_window, __pyx_v_vsync, __pyx_v_driver); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_8Renderer_4__init__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window, PyObject *__pyx_v_vsync, PyObject *__pyx_v_driver) { uint32_t __pyx_v_flags; SDL_RendererInfo __pyx_v_rinfo; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF((PyObject *)__pyx_v_window); /* "pygame_sdl2/render.pyx":79 * * def __init__(self, Window window=None, vsync=False, driver=-1): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ __pyx_t_1 = (((PyObject *)__pyx_v_window) == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":80 * def __init__(self, Window window=None, vsync=False, driver=-1): * if window is None: * window = main_window # <<<<<<<<<<<<<< * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED */ __Pyx_INCREF((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); __Pyx_DECREF_SET(__pyx_v_window, __pyx_v_11pygame_sdl2_7display_main_window); /* "pygame_sdl2/render.pyx":79 * * def __init__(self, Window window=None, vsync=False, driver=-1): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ } /* "pygame_sdl2/render.pyx":82 * window = main_window * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED # <<<<<<<<<<<<<< * if vsync: * flags |= SDL_RENDERER_PRESENTVSYNC */ __pyx_v_flags = SDL_RENDERER_ACCELERATED; /* "pygame_sdl2/render.pyx":83 * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED * if vsync: # <<<<<<<<<<<<<< * flags |= SDL_RENDERER_PRESENTVSYNC * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_vsync); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 83, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":84 * cdef uint32_t flags = SDL_RENDERER_ACCELERATED * if vsync: * flags |= SDL_RENDERER_PRESENTVSYNC # <<<<<<<<<<<<<< * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) */ __pyx_v_flags = (__pyx_v_flags | SDL_RENDERER_PRESENTVSYNC); /* "pygame_sdl2/render.pyx":83 * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED * if vsync: # <<<<<<<<<<<<<< * flags |= SDL_RENDERER_PRESENTVSYNC * */ } /* "pygame_sdl2/render.pyx":86 * flags |= SDL_RENDERER_PRESENTVSYNC * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) # <<<<<<<<<<<<<< * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_driver); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_v_self->renderer = SDL_CreateRenderer(__pyx_v_window->window, __pyx_t_2, __pyx_v_flags); /* "pygame_sdl2/render.pyx":87 * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) * if self.renderer == NULL: # <<<<<<<<<<<<<< * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: */ __pyx_t_1 = (__pyx_v_self->renderer == NULL); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":88 * self.renderer = SDL_CreateRenderer(window.window, driver, flags) * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) # <<<<<<<<<<<<<< * if self.renderer == NULL: * raise error() */ __pyx_v_self->renderer = SDL_GetRenderer(__pyx_v_window->window); /* "pygame_sdl2/render.pyx":89 * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_self->renderer == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/render.pyx":90 * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: * raise error() # <<<<<<<<<<<<<< * * cdef SDL_RendererInfo rinfo */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 90, __pyx_L1_error) /* "pygame_sdl2/render.pyx":89 * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":87 * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) * if self.renderer == NULL: # <<<<<<<<<<<<<< * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: */ } /* "pygame_sdl2/render.pyx":93 * * cdef SDL_RendererInfo rinfo * if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetRendererInfo(__pyx_v_self->renderer, (&__pyx_v_rinfo)) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/render.pyx":94 * cdef SDL_RendererInfo rinfo * if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: * raise error() # <<<<<<<<<<<<<< * * self._info = rinfo_to_dict(&rinfo) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 94, __pyx_L1_error) /* "pygame_sdl2/render.pyx":93 * * cdef SDL_RendererInfo rinfo * if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":96 * raise error() * * self._info = rinfo_to_dict(&rinfo) # <<<<<<<<<<<<<< * * if not self.info()["accelerated"]: */ __pyx_t_3 = __pyx_f_11pygame_sdl2_6render_rinfo_to_dict((&__pyx_v_rinfo)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyDict_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_3))) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_info); __Pyx_DECREF(__pyx_v_self->_info); __pyx_v_self->_info = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":98 * self._info = rinfo_to_dict(&rinfo) * * if not self.info()["accelerated"]: # <<<<<<<<<<<<<< * warnings.warn("Renderer is not accelerated.") * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_accelerated); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = (!__pyx_t_1); if (__pyx_t_7) { /* "pygame_sdl2/render.pyx":99 * * if not self.info()["accelerated"]: * warnings.warn("Renderer is not accelerated.") # <<<<<<<<<<<<<< * * def load_texture(self, fi): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Renderer_is_not_accelerated}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":98 * self._info = rinfo_to_dict(&rinfo) * * if not self.info()["accelerated"]: # <<<<<<<<<<<<<< * warnings.warn("Renderer is not accelerated.") * */ } /* "pygame_sdl2/render.pyx":78 * SDL_DestroyRenderer(self.renderer) * * def __init__(self, Window window=None, vsync=False, driver=-1): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_window); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":101 * warnings.warn("Renderer is not accelerated.") * * def load_texture(self, fi): # <<<<<<<<<<<<<< * cdef SDL_Texture *tex * cdef Texture t = Texture() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_6load_texture, "Renderer.load_texture(self, fi)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_7load_texture = {"load_texture", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_6load_texture}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fi = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load_texture (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load_texture") < 0)) __PYX_ERR(0, 101, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fi = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load_texture", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 101, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.load_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_6load_texture(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_fi); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_6load_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_fi) { SDL_Texture *__pyx_v_tex; struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_t = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; SDL_RWops *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load_texture", 1); /* "pygame_sdl2/render.pyx":103 * def load_texture(self, fi): * cdef SDL_Texture *tex * cdef Texture t = Texture() # <<<<<<<<<<<<<< * * if isinstance(fi, Surface): */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Texture)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_t = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":105 * cdef Texture t = Texture() * * if isinstance(fi, Surface): # <<<<<<<<<<<<<< * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_fi, __pyx_ptype_11pygame_sdl2_7surface_Surface); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":106 * * if isinstance(fi, Surface): * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) # <<<<<<<<<<<<<< * else: * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) */ __pyx_v_tex = SDL_CreateTextureFromSurface(__pyx_v_self->renderer, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_fi)->surface); /* "pygame_sdl2/render.pyx":105 * cdef Texture t = Texture() * * if isinstance(fi, Surface): # <<<<<<<<<<<<<< * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":108 * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) * else: * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) # <<<<<<<<<<<<<< * * if tex == NULL: */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_3 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 108, __pyx_L1_error) __pyx_v_tex = IMG_LoadTexture_RW(__pyx_v_self->renderer, __pyx_t_3, 1); } __pyx_L3:; /* "pygame_sdl2/render.pyx":110 * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) * * if tex == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_tex == NULL); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/render.pyx":111 * * if tex == NULL: * raise error() # <<<<<<<<<<<<<< * * t.set(self.renderer, tex) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 111, __pyx_L1_error) /* "pygame_sdl2/render.pyx":110 * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) * * if tex == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":113 * raise error() * * t.set(self.renderer, tex) # <<<<<<<<<<<<<< * return TextureNode(t) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture *)__pyx_v_t->__pyx_vtab)->set(__pyx_v_t, __pyx_v_self->renderer, __pyx_v_tex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":114 * * t.set(self.renderer, tex) * return TextureNode(t) # <<<<<<<<<<<<<< * * def load_atlas(self, filename): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode), ((PyObject *)__pyx_v_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":101 * warnings.warn("Renderer is not accelerated.") * * def load_texture(self, fi): # <<<<<<<<<<<<<< * cdef SDL_Texture *tex * cdef Texture t = Texture() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.load_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_t); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":116 * return TextureNode(t) * * def load_atlas(self, filename): # <<<<<<<<<<<<<< * """ Loads a file in the popular JSON (Hash) format exported by * TexturePacker and other software. """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_8load_atlas, "Renderer.load_atlas(self, filename)\n Loads a file in the popular JSON (Hash) format exported by\n TexturePacker and other software. "); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_9load_atlas = {"load_atlas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_8load_atlas}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_filename = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load_atlas (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load_atlas") < 0)) __PYX_ERR(0, 116, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_filename = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load_atlas", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 116, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.load_atlas", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_8load_atlas(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_filename); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_8load_atlas(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_filename) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load_atlas", 1); /* "pygame_sdl2/render.pyx":120 * TexturePacker and other software. """ * * return TextureAtlas(self, filename) # <<<<<<<<<<<<<< * * def render_present(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 120, __pyx_L1_error); __Pyx_INCREF(__pyx_v_filename); __Pyx_GIVEREF(__pyx_v_filename); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_filename)) __PYX_ERR(0, 120, __pyx_L1_error); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureAtlas), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":116 * return TextureNode(t) * * def load_atlas(self, filename): # <<<<<<<<<<<<<< * """ Loads a file in the popular JSON (Hash) format exported by * TexturePacker and other software. """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.load_atlas", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":122 * return TextureAtlas(self, filename) * * def render_present(self): # <<<<<<<<<<<<<< * with nogil: * SDL_RenderPresent(self.renderer) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_10render_present, "Renderer.render_present(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_11render_present = {"render_present", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_10render_present}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render_present (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("render_present", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "render_present", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_10render_present(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_10render_present(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render_present", 1); /* "pygame_sdl2/render.pyx":123 * * def render_present(self): * with nogil: # <<<<<<<<<<<<<< * SDL_RenderPresent(self.renderer) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/render.pyx":124 * def render_present(self): * with nogil: * SDL_RenderPresent(self.renderer) # <<<<<<<<<<<<<< * * def info(self): */ SDL_RenderPresent(__pyx_v_self->renderer); } /* "pygame_sdl2/render.pyx":123 * * def render_present(self): * with nogil: # <<<<<<<<<<<<<< * SDL_RenderPresent(self.renderer) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/render.pyx":122 * return TextureAtlas(self, filename) * * def render_present(self): # <<<<<<<<<<<<<< * with nogil: * SDL_RenderPresent(self.renderer) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":126 * SDL_RenderPresent(self.renderer) * * def info(self): # <<<<<<<<<<<<<< * return self._info * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_13info(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_12info, "Renderer.info(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_13info = {"info", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_13info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_12info}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_13info(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("info (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("info", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "info", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_12info(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_12info(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("info", 1); /* "pygame_sdl2/render.pyx":127 * * def info(self): * return self._info # <<<<<<<<<<<<<< * * cdef set_drawcolor(self, col): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_info); __pyx_r = __pyx_v_self->_info; goto __pyx_L0; /* "pygame_sdl2/render.pyx":126 * SDL_RenderPresent(self.renderer) * * def info(self): # <<<<<<<<<<<<<< * return self._info * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":129 * return self._info * * cdef set_drawcolor(self, col): # <<<<<<<<<<<<<< * if not isinstance(col, Color): * col = Color(col) */ static PyObject *__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_col) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Uint8 __pyx_t_7; Uint8 __pyx_t_8; Uint8 __pyx_t_9; Uint8 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_drawcolor", 0); __Pyx_INCREF(__pyx_v_col); /* "pygame_sdl2/render.pyx":130 * * cdef set_drawcolor(self, col): * if not isinstance(col, Color): # <<<<<<<<<<<<<< * col = Color(col) * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_col, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":131 * cdef set_drawcolor(self, col): * if not isinstance(col, Color): * col = Color(col) # <<<<<<<<<<<<<< * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Color); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_col}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_col, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":130 * * cdef set_drawcolor(self, col): * if not isinstance(col, Color): # <<<<<<<<<<<<<< * col = Color(col) * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) */ } /* "pygame_sdl2/render.pyx":132 * if not isinstance(col, Color): * col = Color(col) * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) # <<<<<<<<<<<<<< * * def clear(self, color): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_9 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (void)(SDL_SetRenderDrawColor(__pyx_v_self->renderer, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10)); /* "pygame_sdl2/render.pyx":129 * return self._info * * cdef set_drawcolor(self, col): # <<<<<<<<<<<<<< * if not isinstance(col, Color): * col = Color(col) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.set_drawcolor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_col); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":134 * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * * def clear(self, color): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_14clear, "Renderer.clear(self, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_15clear = {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_14clear}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clear") < 0)) __PYX_ERR(0, 134, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_color = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clear", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 134, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_14clear(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_14clear(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear", 1); /* "pygame_sdl2/render.pyx":135 * * def clear(self, color): * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderClear(self.renderer) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":136 * def clear(self, color): * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) # <<<<<<<<<<<<<< * * def draw_line(self, color not None, x1, y1, x2, y2): */ (void)(SDL_RenderClear(__pyx_v_self->renderer)); /* "pygame_sdl2/render.pyx":134 * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * * def clear(self, color): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":138 * SDL_RenderClear(self.renderer) * * def draw_line(self, color not None, x1, y1, x2, y2): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_16draw_line, "Renderer.draw_line(self, color, x1, y1, x2, y2)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_17draw_line = {"draw_line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_16draw_line}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("draw_line (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 1); __PYX_ERR(0, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 2); __PYX_ERR(0, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 3); __PYX_ERR(0, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 4); __PYX_ERR(0, 138, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_line") < 0)) __PYX_ERR(0, 138, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_color = values[0]; __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 138, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); __PYX_ERR(0, 138, __pyx_L1_error) } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_16draw_line(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_16draw_line(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_line", 1); /* "pygame_sdl2/render.pyx":139 * * def draw_line(self, color not None, x1, y1, x2, y2): * self.set_drawcolor(color) # <<<<<<<<<<<<<< * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: * raise error() */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":140 * def draw_line(self, color not None, x1, y1, x2, y2): * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_x2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_y2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_6 = (SDL_RenderDrawLine(__pyx_v_self->renderer, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5) != 0); if (unlikely(__pyx_t_6)) { /* "pygame_sdl2/render.pyx":141 * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: * raise error() # <<<<<<<<<<<<<< * * def draw_point(self, color not None, x, y): */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 141, __pyx_L1_error) /* "pygame_sdl2/render.pyx":140 * def draw_line(self, color not None, x1, y1, x2, y2): * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":138 * SDL_RenderClear(self.renderer) * * def draw_line(self, color not None, x1, y1, x2, y2): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":143 * raise error() * * def draw_point(self, color not None, x, y): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_18draw_point, "Renderer.draw_point(self, color, x, y)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_19draw_point = {"draw_point", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_18draw_point}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("draw_point (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_x,&__pyx_n_s_y,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, 1); __PYX_ERR(0, 143, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, 2); __PYX_ERR(0, 143, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_point") < 0)) __PYX_ERR(0, 143, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_color = values[0]; __pyx_v_x = values[1]; __pyx_v_y = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 143, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); __PYX_ERR(0, 143, __pyx_L1_error) } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_18draw_point(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_18draw_point(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_point", 1); /* "pygame_sdl2/render.pyx":144 * * def draw_point(self, color not None, x, y): * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderDrawPoint(self.renderer, x, y) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":145 * def draw_point(self, color not None, x, y): * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) # <<<<<<<<<<<<<< * * def draw_rect(self, color not None, rect): */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) (void)(SDL_RenderDrawPoint(__pyx_v_self->renderer, __pyx_t_2, __pyx_t_3)); /* "pygame_sdl2/render.pyx":143 * raise error() * * def draw_point(self, color not None, x, y): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":147 * SDL_RenderDrawPoint(self.renderer, x, y) * * def draw_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_20draw_rect, "Renderer.draw_rect(self, color, rect)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_21draw_rect = {"draw_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_20draw_rect}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("draw_rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_rect,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("draw_rect", 1, 2, 2, 1); __PYX_ERR(0, 147, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_rect") < 0)) __PYX_ERR(0, 147, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_color = values[0]; __pyx_v_rect = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("draw_rect", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 147, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); __PYX_ERR(0, 147, __pyx_L1_error) } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_20draw_rect(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_rect); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_20draw_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_r; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_rect", 1); /* "pygame_sdl2/render.pyx":149 * def draw_rect(self, color not None, rect): * cdef SDL_Rect r * to_sdl_rect(rect, &r) # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawRect(self.renderer, &r) */ __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_r), NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error) /* "pygame_sdl2/render.pyx":150 * cdef SDL_Rect r * to_sdl_rect(rect, &r) * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderDrawRect(self.renderer, &r) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":151 * to_sdl_rect(rect, &r) * self.set_drawcolor(color) * SDL_RenderDrawRect(self.renderer, &r) # <<<<<<<<<<<<<< * * def fill_rect(self, color not None, rect): */ (void)(SDL_RenderDrawRect(__pyx_v_self->renderer, (&__pyx_v_r))); /* "pygame_sdl2/render.pyx":147 * SDL_RenderDrawPoint(self.renderer, x, y) * * def draw_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":153 * SDL_RenderDrawRect(self.renderer, &r) * * def fill_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_22fill_rect, "Renderer.fill_rect(self, color, rect)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_23fill_rect = {"fill_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_22fill_rect}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fill_rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_rect,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("fill_rect", 1, 2, 2, 1); __PYX_ERR(0, 153, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fill_rect") < 0)) __PYX_ERR(0, 153, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_color = values[0]; __pyx_v_rect = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fill_rect", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 153, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.fill_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); __PYX_ERR(0, 153, __pyx_L1_error) } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_22fill_rect(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_rect); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_22fill_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_r; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fill_rect", 1); /* "pygame_sdl2/render.pyx":155 * def fill_rect(self, color not None, rect): * cdef SDL_Rect r * to_sdl_rect(rect, &r) # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderFillRect(self.renderer, &r) */ __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_r), NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 155, __pyx_L1_error) /* "pygame_sdl2/render.pyx":156 * cdef SDL_Rect r * to_sdl_rect(rect, &r) * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderFillRect(self.renderer, &r) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":157 * to_sdl_rect(rect, &r) * self.set_drawcolor(color) * SDL_RenderFillRect(self.renderer, &r) # <<<<<<<<<<<<<< * * def set_viewport(self, rect=None): */ (void)(SDL_RenderFillRect(__pyx_v_self->renderer, (&__pyx_v_r))); /* "pygame_sdl2/render.pyx":153 * SDL_RenderDrawRect(self.renderer, &r) * * def fill_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.fill_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":159 * SDL_RenderFillRect(self.renderer, &r) * * def set_viewport(self, rect=None): # <<<<<<<<<<<<<< * cdef SDL_Rect vprect * if rect is None: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_24set_viewport, "Renderer.set_viewport(self, rect=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_25set_viewport = {"set_viewport", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_24set_viewport}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rect = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_viewport (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rect,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_viewport") < 0)) __PYX_ERR(0, 159, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rect = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_viewport", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 159, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.set_viewport", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_24set_viewport(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_rect); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_24set_viewport(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_vprect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_viewport", 1); /* "pygame_sdl2/render.pyx":161 * def set_viewport(self, rect=None): * cdef SDL_Rect vprect * if rect is None: # <<<<<<<<<<<<<< * SDL_RenderSetViewport(self.renderer, NULL) * else: */ __pyx_t_1 = (__pyx_v_rect == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":162 * cdef SDL_Rect vprect * if rect is None: * SDL_RenderSetViewport(self.renderer, NULL) # <<<<<<<<<<<<<< * else: * to_sdl_rect(rect, &vprect) */ (void)(SDL_RenderSetViewport(__pyx_v_self->renderer, NULL)); /* "pygame_sdl2/render.pyx":161 * def set_viewport(self, rect=None): * cdef SDL_Rect vprect * if rect is None: # <<<<<<<<<<<<<< * SDL_RenderSetViewport(self.renderer, NULL) * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":164 * SDL_RenderSetViewport(self.renderer, NULL) * else: * to_sdl_rect(rect, &vprect) # <<<<<<<<<<<<<< * SDL_RenderSetViewport(self.renderer, &vprect) * */ /*else*/ { __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_vprect), NULL); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 164, __pyx_L1_error) /* "pygame_sdl2/render.pyx":165 * else: * to_sdl_rect(rect, &vprect) * SDL_RenderSetViewport(self.renderer, &vprect) # <<<<<<<<<<<<<< * * def create_texture(self, size): */ (void)(SDL_RenderSetViewport(__pyx_v_self->renderer, (&__pyx_v_vprect))); } __pyx_L3:; /* "pygame_sdl2/render.pyx":159 * SDL_RenderFillRect(self.renderer, &r) * * def set_viewport(self, rect=None): # <<<<<<<<<<<<<< * cdef SDL_Rect vprect * if rect is None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.set_viewport", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":167 * SDL_RenderSetViewport(self.renderer, &vprect) * * def create_texture(self, size): # <<<<<<<<<<<<<< * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_26create_texture, "Renderer.create_texture(self, size)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_27create_texture = {"create_texture", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_26create_texture}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create_texture (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create_texture") < 0)) __PYX_ERR(0, 167, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_size = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create_texture", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 167, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.create_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_26create_texture(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_26create_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_texture", 1); /* "pygame_sdl2/render.pyx":168 * * def create_texture(self, size): * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_RenderTargetSupported(__pyx_v_self->renderer) != SDL_TRUE); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/render.pyx":169 * def create_texture(self, size): * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 169, __pyx_L1_error) /* "pygame_sdl2/render.pyx":168 * * def create_texture(self, size): * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":167 * SDL_RenderSetViewport(self.renderer, &vprect) * * def create_texture(self, size): # <<<<<<<<<<<<<< * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.create_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_29__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_28__reduce_cython__, "Renderer.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_29__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_29__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_28__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_29__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_28__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_28__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_31__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_8Renderer_30__setstate_cython__, "Renderer.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_8Renderer_31__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_31__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_30__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_31__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_30__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_30__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":179 * cdef public int w, h * * def __cinit__(self): # <<<<<<<<<<<<<< * self.texture = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture___cinit__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_7Texture___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/render.pyx":180 * * def __cinit__(self): * self.texture = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->texture = NULL; /* "pygame_sdl2/render.pyx":179 * cdef public int w, h * * def __cinit__(self): # <<<<<<<<<<<<<< * self.texture = NULL * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/render.pyx":182 * self.texture = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.texture: * SDL_DestroyTexture(self.texture) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_6render_7Texture_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_6render_7Texture_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_6render_7Texture_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_6render_7Texture_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { int __pyx_t_1; /* "pygame_sdl2/render.pyx":183 * * def __dealloc__(self): * if self.texture: # <<<<<<<<<<<<<< * SDL_DestroyTexture(self.texture) * */ __pyx_t_1 = (__pyx_v_self->texture != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":184 * def __dealloc__(self): * if self.texture: * SDL_DestroyTexture(self.texture) # <<<<<<<<<<<<<< * * cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): */ SDL_DestroyTexture(__pyx_v_self->texture); /* "pygame_sdl2/render.pyx":183 * * def __dealloc__(self): * if self.texture: # <<<<<<<<<<<<<< * SDL_DestroyTexture(self.texture) * */ } /* "pygame_sdl2/render.pyx":182 * self.texture = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.texture: * SDL_DestroyTexture(self.texture) */ /* function exit code */ } /* "pygame_sdl2/render.pyx":186 * SDL_DestroyTexture(self.texture) * * cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): # <<<<<<<<<<<<<< * cdef Uint32 format * cdef int access, w, h */ static PyObject *__pyx_f_11pygame_sdl2_6render_7Texture_set(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, SDL_Renderer *__pyx_v_ren, SDL_Texture *__pyx_v_tex) { Uint32 __pyx_v_format; int __pyx_v_access; int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 1); /* "pygame_sdl2/render.pyx":190 * cdef int access, w, h * * self.renderer = ren # <<<<<<<<<<<<<< * self.texture = tex * */ __pyx_v_self->renderer = __pyx_v_ren; /* "pygame_sdl2/render.pyx":191 * * self.renderer = ren * self.texture = tex # <<<<<<<<<<<<<< * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: */ __pyx_v_self->texture = __pyx_v_tex; /* "pygame_sdl2/render.pyx":193 * self.texture = tex * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_QueryTexture(__pyx_v_self->texture, (&__pyx_v_format), (&__pyx_v_access), (&__pyx_v_w), (&__pyx_v_h)) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/render.pyx":194 * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: * raise error() # <<<<<<<<<<<<<< * * self.w = w */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 194, __pyx_L1_error) /* "pygame_sdl2/render.pyx":193 * self.texture = tex * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":196 * raise error() * * self.w = w # <<<<<<<<<<<<<< * self.h = h * */ __pyx_v_self->w = __pyx_v_w; /* "pygame_sdl2/render.pyx":197 * * self.w = w * self.h = h # <<<<<<<<<<<<<< * * */ __pyx_v_self->h = __pyx_v_h; /* "pygame_sdl2/render.pyx":186 * SDL_DestroyTexture(self.texture) * * cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): # <<<<<<<<<<<<<< * cdef Uint32 format * cdef int access, w, h */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Texture.set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":177 * cdef SDL_Renderer *renderer * cdef SDL_Texture *texture * cdef public int w, h # <<<<<<<<<<<<<< * * def __cinit__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1w_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1w_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1w___get__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1w___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Texture.w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1w_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_7Texture_1w_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_v_self->w = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Texture.w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1h_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1h_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1h___get__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1h___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Texture.h.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1h_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_7Texture_1h_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_v_self->h = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Texture.h.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_7Texture_4__reduce_cython__, "Texture.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_7Texture_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_7Texture_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_7Texture_4__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_4__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Texture.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_7Texture_6__setstate_cython__, "Texture.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_7Texture_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_7Texture_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_7Texture_6__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Texture.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_6__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Texture.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":215 * cdef int source_h * * def __init__(self, tex): # <<<<<<<<<<<<<< * if isinstance(tex, Texture): * self.texture = tex */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tex = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tex,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tex)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 215, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_tex = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 215, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode___init__(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self), __pyx_v_tex); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_11TextureNode___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_tex) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/render.pyx":216 * * def __init__(self, tex): * if isinstance(tex, Texture): # <<<<<<<<<<<<<< * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_tex, __pyx_ptype_11pygame_sdl2_6render_Texture); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":217 * def __init__(self, tex): * if isinstance(tex, Texture): * self.texture = tex # <<<<<<<<<<<<<< * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) */ if (!(likely(((__pyx_v_tex) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_tex, __pyx_ptype_11pygame_sdl2_6render_Texture))))) __PYX_ERR(0, 217, __pyx_L1_error) __pyx_t_2 = __pyx_v_tex; __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF((PyObject *)__pyx_v_self->texture); __Pyx_DECREF((PyObject *)__pyx_v_self->texture); __pyx_v_self->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":218 * if isinstance(tex, Texture): * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) # <<<<<<<<<<<<<< * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) * self.source_w = tex.w */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0)) __PYX_ERR(0, 218, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0)) __PYX_ERR(0, 218, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_5 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_4, (&__pyx_v_self->source_rect), NULL); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":219 * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) # <<<<<<<<<<<<<< * self.source_w = tex.w * self.source_h = tex.h */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0)) __PYX_ERR(0, 219, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0)) __PYX_ERR(0, 219, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_5 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_2, (&__pyx_v_self->trimmed_rect), NULL); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":220 * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) * self.source_w = tex.w # <<<<<<<<<<<<<< * self.source_h = tex.h * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->source_w = __pyx_t_5; /* "pygame_sdl2/render.pyx":221 * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) * self.source_w = tex.w * self.source_h = tex.h # <<<<<<<<<<<<<< * * elif isinstance(tex, TextureNode): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->source_h = __pyx_t_5; /* "pygame_sdl2/render.pyx":216 * * def __init__(self, tex): * if isinstance(tex, Texture): # <<<<<<<<<<<<<< * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":223 * self.source_h = tex.h * * elif isinstance(tex, TextureNode): # <<<<<<<<<<<<<< * self.texture = (tex).texture * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_tex, __pyx_ptype_11pygame_sdl2_6render_TextureNode); if (likely(__pyx_t_1)) { /* "pygame_sdl2/render.pyx":224 * * elif isinstance(tex, TextureNode): * self.texture = (tex).texture # <<<<<<<<<<<<<< * * else: */ __pyx_t_2 = ((PyObject *)((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_tex)->texture); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF((PyObject *)__pyx_v_self->texture); __Pyx_DECREF((PyObject *)__pyx_v_self->texture); __pyx_v_self->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":223 * self.source_h = tex.h * * elif isinstance(tex, TextureNode): # <<<<<<<<<<<<<< * self.texture = (tex).texture * */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":227 * * else: * raise ValueError() # <<<<<<<<<<<<<< * * def render(self, dest=None): */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_builtin_ValueError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 227, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/render.pyx":215 * cdef int source_h * * def __init__(self, tex): # <<<<<<<<<<<<<< * if isinstance(tex, Texture): * self.texture = tex */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":229 * raise ValueError() * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_11TextureNode_2render, "TextureNode.render(self, dest=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_11TextureNode_3render = {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_11TextureNode_2render}; static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dest = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dest,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dest); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "render") < 0)) __PYX_ERR(0, 229, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dest = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 229, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode_2render(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self), __pyx_v_dest); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_2render(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_dest) { SDL_Rect __pyx_v_dest_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 1); /* "pygame_sdl2/render.pyx":232 * cdef SDL_Rect dest_rect * * if dest is None: # <<<<<<<<<<<<<< * with nogil: * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) */ __pyx_t_1 = (__pyx_v_dest == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":233 * * if dest is None: * with nogil: # <<<<<<<<<<<<<< * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/render.pyx":234 * if dest is None: * with nogil: * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) # <<<<<<<<<<<<<< * * else: */ (void)(SDL_RenderCopy(__pyx_v_self->texture->renderer, __pyx_v_self->texture->texture, NULL, NULL)); } /* "pygame_sdl2/render.pyx":233 * * if dest is None: * with nogil: # <<<<<<<<<<<<<< * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/render.pyx":232 * cdef SDL_Rect dest_rect * * if dest is None: # <<<<<<<<<<<<<< * with nogil: * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":237 * * else: * to_sdl_rect(dest, &dest_rect) # <<<<<<<<<<<<<< * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: */ /*else*/ { __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), NULL); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 237, __pyx_L1_error) /* "pygame_sdl2/render.pyx":238 * else: * to_sdl_rect(dest, &dest_rect) * with nogil: # <<<<<<<<<<<<<< * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/render.pyx":239 * to_sdl_rect(dest, &dest_rect) * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: # <<<<<<<<<<<<<< * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h */ __pyx_t_3 = (__pyx_v_dest_rect.w == 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L11_bool_binop_done; } __pyx_t_3 = (__pyx_v_dest_rect.h == 0); __pyx_t_1 = __pyx_t_3; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":240 * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w # <<<<<<<<<<<<<< * dest_rect.h = self.trimmed_rect.h * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) */ __pyx_t_2 = __pyx_v_self->trimmed_rect.w; __pyx_v_dest_rect.w = __pyx_t_2; /* "pygame_sdl2/render.pyx":241 * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h # <<<<<<<<<<<<<< * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) * */ __pyx_t_2 = __pyx_v_self->trimmed_rect.h; __pyx_v_dest_rect.h = __pyx_t_2; /* "pygame_sdl2/render.pyx":239 * to_sdl_rect(dest, &dest_rect) * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: # <<<<<<<<<<<<<< * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h */ } /* "pygame_sdl2/render.pyx":242 * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) # <<<<<<<<<<<<<< * * */ (void)(SDL_RenderCopy(__pyx_v_self->texture->renderer, __pyx_v_self->texture->texture, NULL, (&__pyx_v_dest_rect))); } /* "pygame_sdl2/render.pyx":238 * else: * to_sdl_rect(dest, &dest_rect) * with nogil: # <<<<<<<<<<<<<< * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } } __pyx_L3:; /* "pygame_sdl2/render.pyx":229 * raise ValueError() * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__, "TextureNode.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__, "TextureNode.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":248 * cdef object frames * * def __init__(self, Renderer ren, fi): # <<<<<<<<<<<<<< * jdata = json.load(open(fi, "r")) * image = jdata["meta"]["image"] */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_ren = 0; PyObject *__pyx_v_fi = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ren,&__pyx_n_s_fi,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ren)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fi)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 248, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 248, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); } __pyx_v_ren = ((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)values[0]); __pyx_v_fi = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 248, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ren), __pyx_ptype_11pygame_sdl2_6render_Renderer, 1, "ren", 0))) __PYX_ERR(0, 248, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas___init__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self), __pyx_v_ren, __pyx_v_fi); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_12TextureAtlas___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_ren, PyObject *__pyx_v_fi) { PyObject *__pyx_v_jdata = NULL; PyObject *__pyx_v_image = NULL; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_tn = 0; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_itex = 0; PyObject *__pyx_v_itm = NULL; PyObject *__pyx_v_iname = NULL; PyObject *__pyx_v_idict = NULL; PyObject *__pyx_v_f = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; int __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect __pyx_t_13; int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/render.pyx":249 * * def __init__(self, Renderer ren, fi): * jdata = json.load(open(fi, "r")) # <<<<<<<<<<<<<< * image = jdata["meta"]["image"] * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_json); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_load); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_fi); __Pyx_GIVEREF(__pyx_v_fi); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fi)) __PYX_ERR(0, 249, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_r); __Pyx_GIVEREF(__pyx_n_s_r); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_r)) __PYX_ERR(0, 249, __pyx_L1_error); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_jdata = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":250 * def __init__(self, Renderer ren, fi): * jdata = json.load(open(fi, "r")) * image = jdata["meta"]["image"] # <<<<<<<<<<<<<< * * cdef TextureNode tn = ren.load_texture(image) */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_jdata, __pyx_n_s_meta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_image); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_image = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":252 * image = jdata["meta"]["image"] * * cdef TextureNode tn = ren.load_texture(image) # <<<<<<<<<<<<<< * * self.frames = {} */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ren), __pyx_n_s_load_texture); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_image}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11pygame_sdl2_6render_TextureNode))))) __PYX_ERR(0, 252, __pyx_L1_error) __pyx_v_tn = ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":254 * cdef TextureNode tn = ren.load_texture(image) * * self.frames = {} # <<<<<<<<<<<<<< * * cdef TextureNode itex */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->frames); __Pyx_DECREF(__pyx_v_self->frames); __pyx_v_self->frames = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":257 * * cdef TextureNode itex * for itm in jdata["frames"].items(): # <<<<<<<<<<<<<< * iname, idict = itm * itex = TextureNode(tn) */ __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_jdata, __pyx_n_s_frames); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 257, __pyx_L1_error) } __pyx_t_4 = __Pyx_dict_iterator(__pyx_t_1, 0, __pyx_n_s_items, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_7, &__pyx_t_6, NULL, NULL, &__pyx_t_4, __pyx_t_8); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_itm, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":258 * cdef TextureNode itex * for itm in jdata["frames"].items(): * iname, idict = itm # <<<<<<<<<<<<<< * itex = TextureNode(tn) * f = idict["frame"] */ if ((likely(PyTuple_CheckExact(__pyx_v_itm))) || (PyList_CheckExact(__pyx_v_itm))) { PyObject* sequence = __pyx_v_itm; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 258, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { Py_ssize_t index = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_itm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_2), 2) < 0) __PYX_ERR(0, 258, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 258, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_iname, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_idict, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":259 * for itm in jdata["frames"].items(): * iname, idict = itm * itex = TextureNode(tn) # <<<<<<<<<<<<<< * f = idict["frame"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode), ((PyObject *)__pyx_v_tn)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_itex, ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_1)); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":260 * iname, idict = itm * itex = TextureNode(tn) * f = idict["frame"] # <<<<<<<<<<<<<< * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") * f = idict["spriteSourceSize"] */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_s_frame); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":261 * itex = TextureNode(tn) * f = idict["frame"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") # <<<<<<<<<<<<<< * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_h); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_11)) __PYX_ERR(0, 261, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_11 = 0; __pyx_t_13.__pyx_n = 1; __pyx_t_13.argname = __pyx_n_s_frame; __pyx_t_9 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_12, (&__pyx_v_itex->source_rect), &__pyx_t_13); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "pygame_sdl2/render.pyx":262 * f = idict["frame"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") * f = idict["spriteSourceSize"] # <<<<<<<<<<<<<< * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: */ __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_s_spriteSourceSize); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_12); __pyx_t_12 = 0; /* "pygame_sdl2/render.pyx":263 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") # <<<<<<<<<<<<<< * if idict["rotated"]: * raise error("Rotation not supported yet.") */ __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_x); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_12); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12)) __PYX_ERR(0, 263, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_11)) __PYX_ERR(0, 263, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error); __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_13.__pyx_n = 1; __pyx_t_13.argname = __pyx_n_s_spriteSourceSize; __pyx_t_9 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_1, (&__pyx_v_itex->trimmed_rect), &__pyx_t_13); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":264 * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: # <<<<<<<<<<<<<< * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_s_rotated); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_14)) { /* "pygame_sdl2/render.pyx":265 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: * raise error("Rotation not supported yet.") # <<<<<<<<<<<<<< * itex.source_w = idict["sourceSize"]["w"] * itex.source_h = idict["sourceSize"]["h"] */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s_Rotation_not_supported_yet}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 265, __pyx_L1_error) /* "pygame_sdl2/render.pyx":264 * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: # <<<<<<<<<<<<<< * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] */ } /* "pygame_sdl2/render.pyx":266 * if idict["rotated"]: * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] # <<<<<<<<<<<<<< * itex.source_h = idict["sourceSize"]["h"] * */ __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_s_sourceSize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_itex->source_w = __pyx_t_9; /* "pygame_sdl2/render.pyx":267 * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] * itex.source_h = idict["sourceSize"]["h"] # <<<<<<<<<<<<<< * * self.frames[iname] = itex */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_s_sourceSize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_itex->source_h = __pyx_t_9; /* "pygame_sdl2/render.pyx":269 * itex.source_h = idict["sourceSize"]["h"] * * self.frames[iname] = itex # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ if (unlikely((PyObject_SetItem(__pyx_v_self->frames, __pyx_v_iname, ((PyObject *)__pyx_v_itex)) < 0))) __PYX_ERR(0, 269, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":248 * cdef object frames * * def __init__(self, Renderer ren, fi): # <<<<<<<<<<<<<< * jdata = json.load(open(fi, "r")) * image = jdata["meta"]["image"] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_jdata); __Pyx_XDECREF(__pyx_v_image); __Pyx_XDECREF((PyObject *)__pyx_v_tn); __Pyx_XDECREF((PyObject *)__pyx_v_itex); __Pyx_XDECREF(__pyx_v_itm); __Pyx_XDECREF(__pyx_v_iname); __Pyx_XDECREF(__pyx_v_idict); __Pyx_XDECREF(__pyx_v_f); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":271 * self.frames[iname] = itex * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return self.frames[key] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_2__getitem__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_2__getitem__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "pygame_sdl2/render.pyx":272 * * def __getitem__(self, key): * return self.frames[key] # <<<<<<<<<<<<<< * * def keys(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->frames, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":271 * self.frames[iname] = itex * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return self.frames[key] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":274 * return self.frames[key] * * def keys(self): # <<<<<<<<<<<<<< * return self.frames.keys() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_12TextureAtlas_4keys, "TextureAtlas.keys(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_12TextureAtlas_5keys = {"keys", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_12TextureAtlas_4keys}; static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("keys (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("keys", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "keys", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_4keys(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_4keys(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("keys", 1); /* "pygame_sdl2/render.pyx":275 * * def keys(self): * return self.frames.keys() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frames, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":274 * return self.frames[key] * * def keys(self): # <<<<<<<<<<<<<< * return self.frames.keys() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__, "TextureAtlas.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self.frames,) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->frames); __Pyx_GIVEREF(__pyx_v_self->frames); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->frames)) __PYX_ERR(1, 5, __pyx_L1_error); __pyx_v_state = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self.frames,) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__dict = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":7 * state = (self.frames,) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_2 = (__pyx_v__dict != Py_None); if (__pyx_t_2) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self.frames is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self.frames,) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self.frames is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, None), state */ /*else*/ { __pyx_t_2 = (__pyx_v_self->frames != Py_None); __pyx_v_use_setstate = __pyx_t_2; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self.frames is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, None), state * else: */ if (__pyx_v_use_setstate) { /* "(tree fragment)":13 * use_setstate = self.frames is not None * if use_setstate: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_TextureAtlas); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_int_93638610); __Pyx_GIVEREF(__pyx_int_93638610); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_93638610)) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self.frames is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, None), state * else: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_TextureAtlas); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_int_93638610); __Pyx_GIVEREF(__pyx_int_93638610); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_93638610)) __PYX_ERR(1, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__, "TextureAtlas.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_11pygame_sdl2_6render___pyx_unpickle_TextureAtlas__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":291 * cdef double _scaley * * def __init__(self, nodes): # <<<<<<<<<<<<<< * self._color.r = 255 * self._color.g = 255 */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nodes = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodes,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nodes)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 291, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 291, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_nodes = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 291, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite___init__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), __pyx_v_nodes); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite___init__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_nodes) { PyObject *__pyx_v_node = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_nodes); /* "pygame_sdl2/render.pyx":292 * * def __init__(self, nodes): * self._color.r = 255 # <<<<<<<<<<<<<< * self._color.g = 255 * self._color.b = 255 */ __pyx_v_self->_color.r = 0xFF; /* "pygame_sdl2/render.pyx":293 * def __init__(self, nodes): * self._color.r = 255 * self._color.g = 255 # <<<<<<<<<<<<<< * self._color.b = 255 * self._color.a = 255 */ __pyx_v_self->_color.g = 0xFF; /* "pygame_sdl2/render.pyx":294 * self._color.r = 255 * self._color.g = 255 * self._color.b = 255 # <<<<<<<<<<<<<< * self._color.a = 255 * self._scalex = 1.0 */ __pyx_v_self->_color.b = 0xFF; /* "pygame_sdl2/render.pyx":295 * self._color.g = 255 * self._color.b = 255 * self._color.a = 255 # <<<<<<<<<<<<<< * self._scalex = 1.0 * self._scaley = 1.0 */ __pyx_v_self->_color.a = 0xFF; /* "pygame_sdl2/render.pyx":296 * self._color.b = 255 * self._color.a = 255 * self._scalex = 1.0 # <<<<<<<<<<<<<< * self._scaley = 1.0 * self._flip = SDL_FLIP_NONE */ __pyx_v_self->_scalex = 1.0; /* "pygame_sdl2/render.pyx":297 * self._color.a = 255 * self._scalex = 1.0 * self._scaley = 1.0 # <<<<<<<<<<<<<< * self._flip = SDL_FLIP_NONE * */ __pyx_v_self->_scaley = 1.0; /* "pygame_sdl2/render.pyx":298 * self._scalex = 1.0 * self._scaley = 1.0 * self._flip = SDL_FLIP_NONE # <<<<<<<<<<<<<< * * memset(&self._pos, 0, sizeof(SDL_Rect)) */ __pyx_v_self->_flip = SDL_FLIP_NONE; /* "pygame_sdl2/render.pyx":300 * self._flip = SDL_FLIP_NONE * * memset(&self._pos, 0, sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) * */ (void)(memset((&__pyx_v_self->_pos), 0, (sizeof(SDL_Rect)))); /* "pygame_sdl2/render.pyx":301 * * memset(&self._pos, 0, sizeof(SDL_Rect)) * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * * if isinstance(nodes, TextureNode): */ (void)(memset((&__pyx_v_self->bounding_box), 0, (sizeof(SDL_Rect)))); /* "pygame_sdl2/render.pyx":303 * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) * * if isinstance(nodes, TextureNode): # <<<<<<<<<<<<<< * nodes = [nodes] * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_nodes, __pyx_ptype_11pygame_sdl2_6render_TextureNode); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":304 * * if isinstance(nodes, TextureNode): * nodes = [nodes] # <<<<<<<<<<<<<< * * self.nodes = [] */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_nodes); __Pyx_GIVEREF(__pyx_v_nodes); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_nodes)) __PYX_ERR(0, 304, __pyx_L1_error); __Pyx_DECREF_SET(__pyx_v_nodes, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":303 * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) * * if isinstance(nodes, TextureNode): # <<<<<<<<<<<<<< * nodes = [nodes] * */ } /* "pygame_sdl2/render.pyx":306 * nodes = [nodes] * * self.nodes = [] # <<<<<<<<<<<<<< * # TODO: Check that they're all from the same texture. * for node in nodes: */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->nodes); __Pyx_DECREF(__pyx_v_self->nodes); __pyx_v_self->nodes = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":308 * self.nodes = [] * # TODO: Check that they're all from the same texture. * for node in nodes: # <<<<<<<<<<<<<< * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) */ if (likely(PyList_CheckExact(__pyx_v_nodes)) || PyTuple_CheckExact(__pyx_v_nodes)) { __pyx_t_2 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_nodes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 308, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":309 * # TODO: Check that they're all from the same texture. * for node in nodes: * if not isinstance(node, TextureNode): # <<<<<<<<<<<<<< * raise ValueError("Invalid argument: %s" % node) * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_node, __pyx_ptype_11pygame_sdl2_6render_TextureNode); __pyx_t_6 = (!__pyx_t_1); if (unlikely(__pyx_t_6)) { /* "pygame_sdl2/render.pyx":310 * for node in nodes: * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) # <<<<<<<<<<<<<< * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, * &self.bounding_box) */ __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_argument_s, __pyx_v_node); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(0, 310, __pyx_L1_error) /* "pygame_sdl2/render.pyx":309 * # TODO: Check that they're all from the same texture. * for node in nodes: * if not isinstance(node, TextureNode): # <<<<<<<<<<<<<< * raise ValueError("Invalid argument: %s" % node) * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, */ } /* "pygame_sdl2/render.pyx":311 * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, # <<<<<<<<<<<<<< * &self.bounding_box) * self.nodes.append(node) */ SDL_UnionRect((&__pyx_v_self->bounding_box), (&((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_node)->trimmed_rect), (&__pyx_v_self->bounding_box)); /* "pygame_sdl2/render.pyx":313 * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, * &self.bounding_box) * self.nodes.append(node) # <<<<<<<<<<<<<< * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); __PYX_ERR(0, 313, __pyx_L1_error) } __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->nodes, __pyx_v_node); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 313, __pyx_L1_error) /* "pygame_sdl2/render.pyx":308 * self.nodes = [] * # TODO: Check that they're all from the same texture. * for node in nodes: # <<<<<<<<<<<<<< * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":291 * cdef double _scaley * * def __init__(self, nodes): # <<<<<<<<<<<<<< * self._color.r = 255 * self._color.g = 255 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_node); __Pyx_XDECREF(__pyx_v_nodes); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":315 * self.nodes.append(node) * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: # <<<<<<<<<<<<<< * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) */ static void __pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, SDL_Rect const *__pyx_v_dest, SDL_Rect const *__pyx_v_rin, SDL_Rect *__pyx_v_rout) { /* "pygame_sdl2/render.pyx":316 * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: * rout.x = dest.x + (self._scalex * rin.x) # <<<<<<<<<<<<<< * rout.y = dest.y + (self._scaley * rin.y) * rout.w = (self._scalex * rin.w) */ __pyx_v_rout->x = (__pyx_v_dest->x + ((int)(__pyx_v_self->_scalex * __pyx_v_rin->x))); /* "pygame_sdl2/render.pyx":317 * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) # <<<<<<<<<<<<<< * rout.w = (self._scalex * rin.w) * rout.h = (self._scaley * rin.h) */ __pyx_v_rout->y = (__pyx_v_dest->y + ((int)(__pyx_v_self->_scaley * __pyx_v_rin->y))); /* "pygame_sdl2/render.pyx":318 * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) * rout.w = (self._scalex * rin.w) # <<<<<<<<<<<<<< * rout.h = (self._scaley * rin.h) * */ __pyx_v_rout->w = ((int)(__pyx_v_self->_scalex * __pyx_v_rin->w)); /* "pygame_sdl2/render.pyx":319 * rout.y = dest.y + (self._scaley * rin.y) * rout.w = (self._scalex * rin.w) * rout.h = (self._scaley * rin.h) # <<<<<<<<<<<<<< * * def render(self, dest=None): */ __pyx_v_rout->h = ((int)(__pyx_v_self->_scaley * __pyx_v_rin->h)); /* "pygame_sdl2/render.pyx":315 * self.nodes.append(node) * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: # <<<<<<<<<<<<<< * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) */ /* function exit code */ } /* "pygame_sdl2/render.pyx":321 * rout.h = (self._scaley * rin.h) * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef Texture tex = (self.nodes[0]).texture * cdef SDL_Rect dest_rect */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_6Sprite_2render, "Sprite.render(self, dest=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_6Sprite_3render = {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_3render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_2render}; static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_dest = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dest,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dest); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "render") < 0)) __PYX_ERR(0, 321, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dest = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 321, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Sprite.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_2render(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), __pyx_v_dest); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_2render(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_dest) { struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_tex = 0; SDL_Rect __pyx_v_dest_rect; SDL_Rect __pyx_v_real_dest; SDL_Point __pyx_v_pivot; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_tn = 0; PyObject *__pyx_v_x = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 1); /* "pygame_sdl2/render.pyx":322 * * def render(self, dest=None): * cdef Texture tex = (self.nodes[0]).texture # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect real_dest */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 322, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->nodes, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_1)->texture); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tex = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":327 * cdef SDL_Point pivot * * if dest is None: # <<<<<<<<<<<<<< * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) * else: */ __pyx_t_3 = (__pyx_v_dest == Py_None); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":328 * * if dest is None: * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * else: * to_sdl_rect(dest, &dest_rect) */ (void)(memcpy((&__pyx_v_dest_rect), (&__pyx_v_self->_pos), (sizeof(SDL_Rect)))); /* "pygame_sdl2/render.pyx":327 * cdef SDL_Point pivot * * if dest is None: # <<<<<<<<<<<<<< * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":330 * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) * else: * to_sdl_rect(dest, &dest_rect) # <<<<<<<<<<<<<< * * with nogil: */ /*else*/ { __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), NULL); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 330, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/render.pyx":332 * to_sdl_rect(dest, &dest_rect) * * with nogil: # <<<<<<<<<<<<<< * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) * SDL_SetTextureAlphaMod(tex.texture, self._color.a) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/render.pyx":333 * * with nogil: * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) # <<<<<<<<<<<<<< * SDL_SetTextureAlphaMod(tex.texture, self._color.a) * */ (void)(SDL_SetTextureColorMod(__pyx_v_tex->texture, __pyx_v_self->_color.r, __pyx_v_self->_color.g, __pyx_v_self->_color.b)); /* "pygame_sdl2/render.pyx":334 * with nogil: * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) * SDL_SetTextureAlphaMod(tex.texture, self._color.a) # <<<<<<<<<<<<<< * * if DEBUG_DRAW_BBOX: */ (void)(SDL_SetTextureAlphaMod(__pyx_v_tex->texture, __pyx_v_self->_color.a)); /* "pygame_sdl2/render.pyx":336 * SDL_SetTextureAlphaMod(tex.texture, self._color.a) * * if DEBUG_DRAW_BBOX: # <<<<<<<<<<<<<< * # TODO: Adjust for rotation. * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) */ if (__pyx_v_11pygame_sdl2_6render_DEBUG_DRAW_BBOX) { /* "pygame_sdl2/render.pyx":338 * if DEBUG_DRAW_BBOX: * # TODO: Adjust for rotation. * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) # <<<<<<<<<<<<<< * * SDL_SetRenderDrawColor(tex.renderer, 0x00, 0x00, 0x00, 0x00) */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_self->__pyx_vtab)->adjust_rect(__pyx_v_self, (&__pyx_v_dest_rect), (&__pyx_v_self->bounding_box), (&__pyx_v_real_dest)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 338, __pyx_L5_error) /* "pygame_sdl2/render.pyx":340 * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) * * SDL_SetRenderDrawColor(tex.renderer, 0x00, 0x00, 0x00, 0x00) # <<<<<<<<<<<<<< * * cdef TextureNode tn */ (void)(SDL_SetRenderDrawColor(__pyx_v_tex->renderer, 0x00, 0x00, 0x00, 0x00)); /* "pygame_sdl2/render.pyx":336 * SDL_SetTextureAlphaMod(tex.texture, self._color.a) * * if DEBUG_DRAW_BBOX: # <<<<<<<<<<<<<< * # TODO: Adjust for rotation. * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) */ } } /* "pygame_sdl2/render.pyx":332 * to_sdl_rect(dest, &dest_rect) * * with nogil: # <<<<<<<<<<<<<< * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) * SDL_SetTextureAlphaMod(tex.texture, self._color.a) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L5_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } __pyx_L6:; } } /* "pygame_sdl2/render.pyx":343 * * cdef TextureNode tn * for x in self.nodes: # <<<<<<<<<<<<<< * tn = x * */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 343, __pyx_L1_error) } __pyx_t_2 = __pyx_v_self->nodes; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":344 * cdef TextureNode tn * for x in self.nodes: * tn = x # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_1 = __pyx_v_x; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_tn, ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_1)); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":346 * tn = x * * with nogil: # <<<<<<<<<<<<<< * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/render.pyx":347 * * with nogil: * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) # <<<<<<<<<<<<<< * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) * */ __pyx_v_pivot.x = ((int)(__pyx_v_self->_scalex * ((((double)__pyx_v_tn->source_w) / 2.0) - __pyx_v_tn->trimmed_rect.x))); /* "pygame_sdl2/render.pyx":348 * with nogil: * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) # <<<<<<<<<<<<<< * * self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) */ __pyx_v_pivot.y = ((int)(__pyx_v_self->_scaley * ((((double)__pyx_v_tn->source_h) / 2.0) - __pyx_v_tn->trimmed_rect.y))); /* "pygame_sdl2/render.pyx":350 * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) * * self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) # <<<<<<<<<<<<<< * * SDL_RenderCopyEx(tex.renderer, tex.texture, &tn.source_rect, */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_self->__pyx_vtab)->adjust_rect(__pyx_v_self, (&__pyx_v_dest_rect), (&__pyx_v_tn->trimmed_rect), (&__pyx_v_real_dest)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 350, __pyx_L13_error) /* "pygame_sdl2/render.pyx":352 * self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) * * SDL_RenderCopyEx(tex.renderer, tex.texture, &tn.source_rect, # <<<<<<<<<<<<<< * &real_dest, self._rotation, &pivot, * self._flip) */ (void)(SDL_RenderCopyEx(__pyx_v_tex->renderer, __pyx_v_tex->texture, (&__pyx_v_tn->source_rect), (&__pyx_v_real_dest), __pyx_v_self->_rotation, (&__pyx_v_pivot), ((SDL_RendererFlip)__pyx_v_self->_flip))); } /* "pygame_sdl2/render.pyx":346 * tn = x * * with nogil: # <<<<<<<<<<<<<< * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L14; } __pyx_L13_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } __pyx_L14:; } } /* "pygame_sdl2/render.pyx":343 * * cdef TextureNode tn * for x in self.nodes: # <<<<<<<<<<<<<< * tn = x * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":321 * rout.h = (self._scaley * rin.h) * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef Texture tex = (self.nodes[0]).texture * cdef SDL_Rect dest_rect */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tex); __Pyx_XDECREF((PyObject *)__pyx_v_tn); __Pyx_XDECREF(__pyx_v_x); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":356 * self._flip) * * def collides(self, Sprite other not None): # <<<<<<<<<<<<<< * cdef SDL_Rect r1, r2 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_6Sprite_4collides, "Sprite.collides(self, Sprite other)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_6Sprite_5collides = {"collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_4collides}; static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collides (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collides") < 0)) __PYX_ERR(0, 356, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = ((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collides", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 356, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Sprite.collides", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_11pygame_sdl2_6render_Sprite, 0, "other", 0))) __PYX_ERR(0, 356, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_4collides(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), __pyx_v_other); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_4collides(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_other) { SDL_Rect __pyx_v_r1; SDL_Rect __pyx_v_r2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collides", 1); /* "pygame_sdl2/render.pyx":359 * cdef SDL_Rect r1, r2 * * self.adjust_rect(&self._pos, &self.bounding_box, &r1) # <<<<<<<<<<<<<< * other.adjust_rect(&other._pos, &other.bounding_box, &r2) * */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_self->__pyx_vtab)->adjust_rect(__pyx_v_self, (&__pyx_v_self->_pos), (&__pyx_v_self->bounding_box), (&__pyx_v_r1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L1_error) /* "pygame_sdl2/render.pyx":360 * * self.adjust_rect(&self._pos, &self.bounding_box, &r1) * other.adjust_rect(&other._pos, &other.bounding_box, &r2) # <<<<<<<<<<<<<< * * return SDL_HasIntersection(&r1, &r2) == SDL_TRUE */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_other->__pyx_vtab)->adjust_rect(__pyx_v_other, (&__pyx_v_other->_pos), (&__pyx_v_other->bounding_box), (&__pyx_v_r2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L1_error) /* "pygame_sdl2/render.pyx":362 * other.adjust_rect(&other._pos, &other.bounding_box, &r2) * * return SDL_HasIntersection(&r1, &r2) == SDL_TRUE # <<<<<<<<<<<<<< * * property pos: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_HasIntersection((&__pyx_v_r1), (&__pyx_v_r2)) == SDL_TRUE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":356 * self._flip) * * def collides(self, Sprite other not None): # <<<<<<<<<<<<<< * cdef SDL_Rect r1, r2 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.collides", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":365 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._pos.x, self._pos.y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":366 * property pos: * def __get__(self): * return self._pos.x, self._pos.y # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_pos.x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_pos.y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":365 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._pos.x, self._pos.y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":368 * return self._pos.x, self._pos.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._pos.x = val[0] * self._pos.y = val[1] */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/render.pyx":369 * * def __set__(self, val): * self._pos.x = val[0] # <<<<<<<<<<<<<< * self._pos.y = val[1] * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_pos.x = __pyx_t_2; /* "pygame_sdl2/render.pyx":370 * def __set__(self, val): * self._pos.x = val[0] * self._pos.y = val[1] # <<<<<<<<<<<<<< * * property color: */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_pos.y = __pyx_t_2; /* "pygame_sdl2/render.pyx":368 * return self._pos.x, self._pos.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._pos.x = val[0] * self._pos.y = val[1] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":373 * * property color: * def __set__(self, val): # <<<<<<<<<<<<<< * if not isinstance(val, Color): * val = Color(val) */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5color_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5color_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5color___set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5color___set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Uint8 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_val); /* "pygame_sdl2/render.pyx":374 * property color: * def __set__(self, val): * if not isinstance(val, Color): # <<<<<<<<<<<<<< * val = Color(val) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_val, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":375 * def __set__(self, val): * if not isinstance(val, Color): * val = Color(val) # <<<<<<<<<<<<<< * * self._color.r = val.r */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Color); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_val}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":374 * property color: * def __set__(self, val): * if not isinstance(val, Color): # <<<<<<<<<<<<<< * val = Color(val) * */ } /* "pygame_sdl2/render.pyx":377 * val = Color(val) * * self._color.r = val.r # <<<<<<<<<<<<<< * self._color.g = val.g * self._color.b = val.b */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.r = __pyx_t_7; /* "pygame_sdl2/render.pyx":378 * * self._color.r = val.r * self._color.g = val.g # <<<<<<<<<<<<<< * self._color.b = val.b * self._color.a = val.a */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.g = __pyx_t_7; /* "pygame_sdl2/render.pyx":379 * self._color.r = val.r * self._color.g = val.g * self._color.b = val.b # <<<<<<<<<<<<<< * self._color.a = val.a * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.b = __pyx_t_7; /* "pygame_sdl2/render.pyx":380 * self._color.g = val.g * self._color.b = val.b * self._color.a = val.a # <<<<<<<<<<<<<< * * property alpha: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.a = __pyx_t_7; /* "pygame_sdl2/render.pyx":373 * * property color: * def __set__(self, val): # <<<<<<<<<<<<<< * if not isinstance(val, Color): * val = Color(val) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.color.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_val); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":383 * * property alpha: * def __get__(self): # <<<<<<<<<<<<<< * return self._color.a * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":384 * property alpha: * def __get__(self): * return self._color.a # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->_color.a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":383 * * property alpha: * def __get__(self): # <<<<<<<<<<<<<< * return self._color.a * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.alpha.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":386 * return self._color.a * * def __set__(self, val): # <<<<<<<<<<<<<< * self._color.a = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/render.pyx":387 * * def __set__(self, val): * self._color.a = val # <<<<<<<<<<<<<< * * property rotation: */ __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_1 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) __pyx_v_self->_color.a = __pyx_t_1; /* "pygame_sdl2/render.pyx":386 * return self._color.a * * def __set__(self, val): # <<<<<<<<<<<<<< * self._color.a = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.alpha.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/render.pyx":390 * * property rotation: * def __get__(self): # <<<<<<<<<<<<<< * return self._rotation * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":391 * property rotation: * def __get__(self): * return self._rotation # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_rotation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":390 * * property rotation: * def __get__(self): # <<<<<<<<<<<<<< * return self._rotation * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.rotation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":393 * return self._rotation * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rotation = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; double __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/render.pyx":394 * * def __set__(self, val): * self._rotation = val # <<<<<<<<<<<<<< * * property scale: */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error) __pyx_v_self->_rotation = __pyx_t_1; /* "pygame_sdl2/render.pyx":393 * return self._rotation * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rotation = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.rotation.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/render.pyx":397 * * property scale: * def __get__(self): # <<<<<<<<<<<<<< * if self._scalex == self._scaley: * return self._scalex */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5scale___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":398 * property scale: * def __get__(self): * if self._scalex == self._scaley: # <<<<<<<<<<<<<< * return self._scalex * else: */ __pyx_t_1 = (__pyx_v_self->_scalex == __pyx_v_self->_scaley); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":399 * def __get__(self): * if self._scalex == self._scaley: * return self._scalex # <<<<<<<<<<<<<< * else: * return self._scalex, self._scaley */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_scalex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":398 * property scale: * def __get__(self): * if self._scalex == self._scaley: # <<<<<<<<<<<<<< * return self._scalex * else: */ } /* "pygame_sdl2/render.pyx":401 * return self._scalex * else: * return self._scalex, self._scaley # <<<<<<<<<<<<<< * * def __set__(self, arg): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_scalex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->_scaley); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/render.pyx":397 * * property scale: * def __get__(self): # <<<<<<<<<<<<<< * if self._scalex == self._scaley: * return self._scalex */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.scale.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":403 * return self._scalex, self._scaley * * def __set__(self, arg): # <<<<<<<<<<<<<< * if type(arg) == tuple: * x, y = arg */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_arg); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_arg) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_arg)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_arg) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); double __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/render.pyx":404 * * def __set__(self, arg): * if type(arg) == tuple: # <<<<<<<<<<<<<< * x, y = arg * else: */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_arg)), ((PyObject *)(&PyTuple_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":405 * def __set__(self, arg): * if type(arg) == tuple: * x, y = arg # <<<<<<<<<<<<<< * else: * x = y = arg */ if ((likely(PyTuple_CheckExact(__pyx_v_arg))) || (PyList_CheckExact(__pyx_v_arg))) { PyObject* sequence = __pyx_v_arg; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 405, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 405, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 405, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":404 * * def __set__(self, arg): * if type(arg) == tuple: # <<<<<<<<<<<<<< * x, y = arg * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":407 * x, y = arg * else: * x = y = arg # <<<<<<<<<<<<<< * * self._scalex = x */ /*else*/ { __Pyx_INCREF(__pyx_v_arg); __pyx_v_x = __pyx_v_arg; __Pyx_INCREF(__pyx_v_arg); __pyx_v_y = __pyx_v_arg; } __pyx_L3:; /* "pygame_sdl2/render.pyx":409 * x = y = arg * * self._scalex = x # <<<<<<<<<<<<<< * self._scaley = y * */ __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_x); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L1_error) __pyx_v_self->_scalex = __pyx_t_6; /* "pygame_sdl2/render.pyx":410 * * self._scalex = x * self._scaley = y # <<<<<<<<<<<<<< * * property hflip: */ __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_y); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error) __pyx_v_self->_scaley = __pyx_t_6; /* "pygame_sdl2/render.pyx":403 * return self._scalex, self._scaley * * def __set__(self, arg): # <<<<<<<<<<<<<< * if type(arg) == tuple: * x, y = arg */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.scale.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":413 * * property hflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_HORIZONTAL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":414 * property hflip: * def __get__(self): * return self._flip & SDL_FLIP_HORIZONTAL # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->_flip & SDL_FLIP_HORIZONTAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":413 * * property hflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_HORIZONTAL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.hflip.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":416 * return self._flip & SDL_FLIP_HORIZONTAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_HORIZONTAL */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/render.pyx":417 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_HORIZONTAL * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 417, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":418 * def __set__(self, val): * if val: * self._flip |= SDL_FLIP_HORIZONTAL # <<<<<<<<<<<<<< * else: * self._flip &= ~SDL_FLIP_HORIZONTAL */ __pyx_v_self->_flip = (__pyx_v_self->_flip | SDL_FLIP_HORIZONTAL); /* "pygame_sdl2/render.pyx":417 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_HORIZONTAL * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":420 * self._flip |= SDL_FLIP_HORIZONTAL * else: * self._flip &= ~SDL_FLIP_HORIZONTAL # <<<<<<<<<<<<<< * * property vflip: */ /*else*/ { __pyx_v_self->_flip = (__pyx_v_self->_flip & (~SDL_FLIP_HORIZONTAL)); } __pyx_L3:; /* "pygame_sdl2/render.pyx":416 * return self._flip & SDL_FLIP_HORIZONTAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_HORIZONTAL */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.hflip.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/render.pyx":423 * * property vflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_VERTICAL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":424 * property vflip: * def __get__(self): * return self._flip & SDL_FLIP_VERTICAL # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->_flip & SDL_FLIP_VERTICAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":423 * * property vflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_VERTICAL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.vflip.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":426 * return self._flip & SDL_FLIP_VERTICAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_VERTICAL */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/render.pyx":427 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_VERTICAL * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 427, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":428 * def __set__(self, val): * if val: * self._flip |= SDL_FLIP_VERTICAL # <<<<<<<<<<<<<< * else: * self._flip &= ~SDL_FLIP_VERTICAL */ __pyx_v_self->_flip = (__pyx_v_self->_flip | SDL_FLIP_VERTICAL); /* "pygame_sdl2/render.pyx":427 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_VERTICAL * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":430 * self._flip |= SDL_FLIP_VERTICAL * else: * self._flip &= ~SDL_FLIP_VERTICAL # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_v_self->_flip = (__pyx_v_self->_flip & (~SDL_FLIP_VERTICAL)); } __pyx_L3:; /* "pygame_sdl2/render.pyx":426 * return self._flip & SDL_FLIP_VERTICAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_VERTICAL */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.vflip.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_6Sprite_6__reduce_cython__, "Sprite.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_6Sprite_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_6__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_6__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such_2, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_6Sprite_8__setstate_cython__, "Sprite.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_6Sprite_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_8__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_8__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such_2, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":439 * cdef list sprites * * def __init__(self, rect): # <<<<<<<<<<<<<< * """ Parameter may be a position (no clipping) or a rect (clipped). """ * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_9Container_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_9Container___init__, " Parameter may be a position (no clipping) or a rect (clipped). "); #if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__; #endif static int __pyx_pw_11pygame_sdl2_6render_9Container_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rect = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rect,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 439, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_rect = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 439, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Container.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container___init__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), __pyx_v_rect); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_9Container___init__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_rect) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/render.pyx":442 * """ Parameter may be a position (no clipping) or a rect (clipped). """ * * self.sprites = [] # <<<<<<<<<<<<<< * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->sprites); __Pyx_DECREF(__pyx_v_self->sprites); __pyx_v_self->sprites = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":443 * * self.sprites = [] * to_sdl_rect(rect, &self._rect) # <<<<<<<<<<<<<< * if len(rect) == 2: * self._rect.w = self._rect.h = 0 */ __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_self->_rect), NULL); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 443, __pyx_L1_error) /* "pygame_sdl2/render.pyx":444 * self.sprites = [] * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: # <<<<<<<<<<<<<< * self._rect.w = self._rect.h = 0 * */ __pyx_t_3 = PyObject_Length(__pyx_v_rect); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 444, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 == 2); if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":445 * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: * self._rect.w = self._rect.h = 0 # <<<<<<<<<<<<<< * * def add(self, Sprite sprite not None): */ __pyx_v_self->_rect.w = 0; __pyx_v_self->_rect.h = 0; /* "pygame_sdl2/render.pyx":444 * self.sprites = [] * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: # <<<<<<<<<<<<<< * self._rect.w = self._rect.h = 0 * */ } /* "pygame_sdl2/render.pyx":439 * cdef list sprites * * def __init__(self, rect): # <<<<<<<<<<<<<< * """ Parameter may be a position (no clipping) or a rect (clipped). """ * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Container.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":447 * self._rect.w = self._rect.h = 0 * * def add(self, Sprite sprite not None): # <<<<<<<<<<<<<< * self.sprites.append(sprite) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3add(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_9Container_2add, "Container.add(self, Sprite sprite)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_9Container_3add = {"add", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_3add, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_2add}; static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3add(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_sprite = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sprite,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sprite)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add") < 0)) __PYX_ERR(0, 447, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_sprite = ((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 447, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Container.add", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sprite), __pyx_ptype_11pygame_sdl2_6render_Sprite, 0, "sprite", 0))) __PYX_ERR(0, 447, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_2add(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), __pyx_v_sprite); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_2add(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_sprite) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add", 1); /* "pygame_sdl2/render.pyx":448 * * def add(self, Sprite sprite not None): * self.sprites.append(sprite) # <<<<<<<<<<<<<< * * def render(self, dest=None): */ if (unlikely(__pyx_v_self->sprites == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); __PYX_ERR(0, 448, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->sprites, ((PyObject *)__pyx_v_sprite)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 448, __pyx_L1_error) /* "pygame_sdl2/render.pyx":447 * self._rect.w = self._rect.h = 0 * * def add(self, Sprite sprite not None): # <<<<<<<<<<<<<< * self.sprites.append(sprite) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.add", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":450 * self.sprites.append(sprite) * * def render(self, dest=None): # <<<<<<<<<<<<<< * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_5render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_9Container_4render, "Container.render(self, dest=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_9Container_5render = {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_5render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_4render}; static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_5render(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_dest = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dest,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dest); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "render") < 0)) __PYX_ERR(0, 450, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dest = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 450, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Container.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_4render(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), __pyx_v_dest); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4render(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dest) { SDL_Renderer *__pyx_v_ren; PyObject *__pyx_v_s = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; SDL_Renderer *__pyx_t_3; int __pyx_t_4; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 1); /* "pygame_sdl2/render.pyx":452 * def render(self, dest=None): * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer # <<<<<<<<<<<<<< * * if self._rect.w != 0 and self._rect.h != 0: */ if (unlikely(__pyx_v_self->sprites == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 452, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->sprites, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_t_1)->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 452, __pyx_L1_error) } __pyx_t_2 = __Pyx_GetItemInt_List(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_t_1)->nodes, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_2)->texture->renderer; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ren = __pyx_t_3; /* "pygame_sdl2/render.pyx":454 * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer * * if self._rect.w != 0 and self._rect.h != 0: # <<<<<<<<<<<<<< * SDL_RenderSetClipRect(ren, &self._rect) * */ __pyx_t_5 = (__pyx_v_self->_rect.w != 0); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = (__pyx_v_self->_rect.h != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":455 * * if self._rect.w != 0 and self._rect.h != 0: * SDL_RenderSetClipRect(ren, &self._rect) # <<<<<<<<<<<<<< * * for s in self.sprites: */ (void)(SDL_RenderSetClipRect(__pyx_v_ren, (&__pyx_v_self->_rect))); /* "pygame_sdl2/render.pyx":454 * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer * * if self._rect.w != 0 and self._rect.h != 0: # <<<<<<<<<<<<<< * SDL_RenderSetClipRect(ren, &self._rect) * */ } /* "pygame_sdl2/render.pyx":457 * SDL_RenderSetClipRect(ren, &self._rect) * * for s in self.sprites: # <<<<<<<<<<<<<< * s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) * */ if (unlikely(__pyx_v_self->sprites == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 457, __pyx_L1_error) } __pyx_t_2 = __pyx_v_self->sprites; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 457, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 457, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":458 * * for s in self.sprites: * s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) # <<<<<<<<<<<<<< * * # TODO: Save and restore previous clip rect instead? */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_render); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_pos); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyNumber_Add(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_pos); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = PyNumber_Add(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10)) __PYX_ERR(0, 458, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_11)) __PYX_ERR(0, 458, __pyx_L1_error); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":457 * SDL_RenderSetClipRect(ren, &self._rect) * * for s in self.sprites: # <<<<<<<<<<<<<< * s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":461 * * # TODO: Save and restore previous clip rect instead? * SDL_RenderSetClipRect(ren, NULL) # <<<<<<<<<<<<<< * * property pos: */ (void)(SDL_RenderSetClipRect(__pyx_v_ren, NULL)); /* "pygame_sdl2/render.pyx":450 * self.sprites.append(sprite) * * def render(self, dest=None): # <<<<<<<<<<<<<< * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.render.Container.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":464 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._rect.x, self._rect.y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3pos_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_3pos___get__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":465 * property pos: * def __get__(self): * return self._rect.x, self._rect.y # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":464 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._rect.x, self._rect.y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.render.Container.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":467 * return self._rect.x, self._rect.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rect.x = val[0] * self._rect.y = val[1] */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_9Container_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_9Container_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_3pos_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_9Container_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 1); /* "pygame_sdl2/render.pyx":468 * * def __set__(self, val): * self._rect.x = val[0] # <<<<<<<<<<<<<< * self._rect.y = val[1] * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_rect.x = __pyx_t_2; /* "pygame_sdl2/render.pyx":469 * def __set__(self, val): * self._rect.x = val[0] * self._rect.y = val[1] # <<<<<<<<<<<<<< * * property rect: */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_rect.y = __pyx_t_2; /* "pygame_sdl2/render.pyx":467 * return self._rect.x, self._rect.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rect.x = val[0] * self._rect.y = val[1] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Container.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":472 * * property rect: * def __get__(self): # <<<<<<<<<<<<<< * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_4rect_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_4rect_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_4rect___get__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4rect___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/render.pyx":473 * property rect: * def __get__(self): * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":472 * * property rect: * def __get__(self): # <<<<<<<<<<<<<< * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.render.Container.rect.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":475 * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * * def __set__(self, val): # <<<<<<<<<<<<<< * to_sdl_rect(val, &self._rect) * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_9Container_4rect_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_9Container_4rect_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_4rect_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_9Container_4rect_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/render.pyx":476 * * def __set__(self, val): * to_sdl_rect(val, &self._rect) # <<<<<<<<<<<<<< * */ __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_val, (&__pyx_v_self->_rect), NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 476, __pyx_L1_error) /* "pygame_sdl2/render.pyx":475 * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * * def __set__(self, val): # <<<<<<<<<<<<<< * to_sdl_rect(val, &self._rect) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.rect.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_9Container_6__reduce_cython__, "Container.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_9Container_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_6__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_6__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such_3, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_9Container_8__setstate_cython__, "Container.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_9Container_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_8__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.Container.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_8__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such_3, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_6render_2__pyx_unpickle_TextureAtlas, "__pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas = {"__pyx_unpickle_TextureAtlas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_2__pyx_unpickle_TextureAtlas}; static PyObject *__pyx_pw_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_TextureAtlas (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TextureAtlas", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TextureAtlas", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_TextureAtlas") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TextureAtlas", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.render.__pyx_unpickle_TextureAtlas", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_2__pyx_unpickle_TextureAtlas(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_2__pyx_unpickle_TextureAtlas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_TextureAtlas", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x594cfd2, 0xe7d6794, 0xdcdc1ac): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple_, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum not in (0x594cfd2, 0xe7d6794, 0xdcdc1ac): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum * __pyx_result = TextureAtlas.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v___pyx_PickleError = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum not in (0x594cfd2, 0xe7d6794, 0xdcdc1ac): * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum # <<<<<<<<<<<<<< * __pyx_result = TextureAtlas.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x594cfd2, 0xe7d6794, 0xdcdc1ac): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum * __pyx_result = TextureAtlas.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureAtlas), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v___pyx_result = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum * __pyx_result = TextureAtlas.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_2 = (__pyx_v___pyx_state != Py_None); if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = TextureAtlas.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_t_1 = __pyx_f_11pygame_sdl2_6render___pyx_unpickle_TextureAtlas__set_state(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum * __pyx_result = TextureAtlas.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): * __pyx_result.frames = __pyx_state[0] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.__pyx_unpickle_TextureAtlas", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.frames = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_11pygame_sdl2_6render___pyx_unpickle_TextureAtlas__set_state(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_TextureAtlas__set_state", 1); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): * __pyx_result.frames = __pyx_state[0] # <<<<<<<<<<<<<< * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->frames); __Pyx_DECREF(__pyx_v___pyx_result->frames); __pyx_v___pyx_result->frames = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): * __pyx_result.frames = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 13, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 > 1); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":14 * __pyx_result.frames = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 14, __pyx_L1_error) } __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): * __pyx_result.frames = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ } /* "(tree fragment)":11 * __pyx_unpickle_TextureAtlas__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.frames = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.render.__pyx_unpickle_TextureAtlas__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer __pyx_vtable_11pygame_sdl2_6render_Renderer; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Renderer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Renderer *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_6render_Renderer; p->_info = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_11pygame_sdl2_6render_8Renderer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Renderer(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_Renderer *p = (struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_6render_Renderer) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_6render_8Renderer_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->_info); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_6render_Renderer(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_Renderer *p = (struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o; if (p->_info) { e = (*v)(p->_info, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_Renderer(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_Renderer *p = (struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o; tmp = ((PyObject*)p->_info); p->_info = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Renderer[] = { {"load_texture", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_6load_texture}, {"load_atlas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_8load_atlas}, {"render_present", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_10render_present}, {"info", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_13info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_12info}, {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_14clear}, {"draw_line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_16draw_line}, {"draw_point", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_18draw_point}, {"draw_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_20draw_rect}, {"fill_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_22fill_rect}, {"set_viewport", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_24set_viewport}, {"create_texture", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_26create_texture}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_29__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_28__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_8Renderer_31__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_8Renderer_30__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_6render_Renderer_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_6render_Renderer}, {Py_tp_doc, (void *)PyDoc_STR("Renderer(Window window=None, vsync=False, driver=-1)")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_6render_Renderer}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_6render_Renderer}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_6render_Renderer}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_6render_Renderer}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_6render_Renderer_spec = { "pygame_sdl2.render.Renderer", sizeof(struct __pyx_obj_11pygame_sdl2_6render_Renderer), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_6render_Renderer_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_6render_Renderer = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.""Renderer", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Renderer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Renderer, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Renderer(Window window=None, vsync=False, driver=-1)"), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_Renderer, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_Renderer, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Renderer, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Renderer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture __pyx_vtable_11pygame_sdl2_6render_Texture; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Texture(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Texture *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_6render_Texture; if (unlikely(__pyx_pw_11pygame_sdl2_6render_7Texture_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Texture(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_6render_Texture) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_6render_7Texture_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_getprop_11pygame_sdl2_6render_7Texture_w(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1w_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_7Texture_w(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1w_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_7Texture_h(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1h_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_7Texture_h(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1h_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Texture[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_7Texture_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_7Texture_4__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_7Texture_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_7Texture_6__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_6render_Texture[] = { {(char *)"w", __pyx_getprop_11pygame_sdl2_6render_7Texture_w, __pyx_setprop_11pygame_sdl2_6render_7Texture_w, (char *)PyDoc_STR("w: 'int'"), 0}, {(char *)"h", __pyx_getprop_11pygame_sdl2_6render_7Texture_h, __pyx_setprop_11pygame_sdl2_6render_7Texture_h, (char *)PyDoc_STR("h: 'int'"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_6render_Texture_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_6render_Texture}, {Py_tp_doc, (void *)PyDoc_STR(" Mostly for internal use. Users should only see this for RTT. ")}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_6render_Texture}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_6render_Texture}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_6render_Texture}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_6render_Texture_spec = { "pygame_sdl2.render.Texture", sizeof(struct __pyx_obj_11pygame_sdl2_6render_Texture), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_11pygame_sdl2_6render_Texture_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_6render_Texture = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.""Texture", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Texture), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Texture, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR(" Mostly for internal use. Users should only see this for RTT. "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Texture, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_6render_Texture, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Texture, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureNode(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o); p->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_TextureNode(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_6render_TextureNode) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->texture); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_6render_TextureNode(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o; if (p->texture) { e = (*v)(((PyObject *)p->texture), a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_TextureNode(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o; tmp = ((PyObject*)p->texture); p->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_TextureNode[] = { {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_11TextureNode_2render}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_6render_TextureNode_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_6render_TextureNode}, {Py_tp_doc, (void *)PyDoc_STR("TextureNode(tex)\n A specified area of a texture. ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_6render_TextureNode}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_6render_TextureNode}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_6render_TextureNode}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_6render_TextureNode}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_6render_TextureNode_spec = { "pygame_sdl2.render.TextureNode", sizeof(struct __pyx_obj_11pygame_sdl2_6render_TextureNode), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_6render_TextureNode_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_6render_TextureNode = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.""TextureNode", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_TextureNode), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_TextureNode, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("TextureNode(tex)\n A specified area of a texture. "), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_TextureNode, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_TextureNode, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_TextureNode, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_TextureNode, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureAtlas(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o); p->frames = Py_None; Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_TextureAtlas(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_6render_TextureAtlas) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->frames); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_6render_TextureAtlas(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o; if (p->frames) { e = (*v)(p->frames, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_TextureAtlas(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o; tmp = ((PyObject*)p->frames); p->frames = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_sq_item_11pygame_sdl2_6render_TextureAtlas(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_TextureAtlas[] = { {"keys", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_12TextureAtlas_4keys}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_6render_TextureAtlas_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_6render_TextureAtlas}, {Py_sq_item, (void *)__pyx_sq_item_11pygame_sdl2_6render_TextureAtlas}, {Py_mp_subscript, (void *)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__}, {Py_tp_doc, (void *)PyDoc_STR("TextureAtlas(Renderer ren, fi)")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_6render_TextureAtlas}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_6render_TextureAtlas}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_6render_TextureAtlas}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_6render_TextureAtlas}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_6render_TextureAtlas_spec = { "pygame_sdl2.render.TextureAtlas", sizeof(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_6render_TextureAtlas_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence_TextureAtlas = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_6render_TextureAtlas, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_TextureAtlas = { 0, /*mp_length*/ __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_TextureAtlas = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.""TextureAtlas", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_TextureAtlas, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_TextureAtlas, /*tp_as_sequence*/ &__pyx_tp_as_mapping_TextureAtlas, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("TextureAtlas(Renderer ren, fi)"), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_TextureAtlas, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_TextureAtlas, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_TextureAtlas, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_TextureAtlas, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite __pyx_vtable_11pygame_sdl2_6render_Sprite; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Sprite(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Sprite *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_6render_Sprite; p->nodes = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Sprite(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_Sprite *p = (struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_6render_Sprite) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->nodes); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_6render_Sprite(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_Sprite *p = (struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o; if (p->nodes) { e = (*v)(p->nodes, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_Sprite(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_Sprite *p = (struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o; tmp = ((PyObject*)p->nodes); p->nodes = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_pos(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_color(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5color_1__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_alpha(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_alpha(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_rotation(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_rotation(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_scale(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_scale(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_hflip(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_hflip(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_vflip(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_vflip(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Sprite[] = { {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_3render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_2render}, {"collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_4collides}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_6Sprite_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_6Sprite_8__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_6render_Sprite[] = { {(char *)"pos", __pyx_getprop_11pygame_sdl2_6render_6Sprite_pos, __pyx_setprop_11pygame_sdl2_6render_6Sprite_pos, (char *)0, 0}, {(char *)"color", 0, __pyx_setprop_11pygame_sdl2_6render_6Sprite_color, (char *)0, 0}, {(char *)"alpha", __pyx_getprop_11pygame_sdl2_6render_6Sprite_alpha, __pyx_setprop_11pygame_sdl2_6render_6Sprite_alpha, (char *)0, 0}, {(char *)"rotation", __pyx_getprop_11pygame_sdl2_6render_6Sprite_rotation, __pyx_setprop_11pygame_sdl2_6render_6Sprite_rotation, (char *)0, 0}, {(char *)"scale", __pyx_getprop_11pygame_sdl2_6render_6Sprite_scale, __pyx_setprop_11pygame_sdl2_6render_6Sprite_scale, (char *)0, 0}, {(char *)"hflip", __pyx_getprop_11pygame_sdl2_6render_6Sprite_hflip, __pyx_setprop_11pygame_sdl2_6render_6Sprite_hflip, (char *)0, 0}, {(char *)"vflip", __pyx_getprop_11pygame_sdl2_6render_6Sprite_vflip, __pyx_setprop_11pygame_sdl2_6render_6Sprite_vflip, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_6render_Sprite_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_6render_Sprite}, {Py_tp_doc, (void *)PyDoc_STR("Sprite(nodes)\n One or more TextureNodes, with possible transforms applied. ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_6render_Sprite}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_6render_Sprite}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_6render_Sprite}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_6render_Sprite}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_6render_Sprite}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_6render_Sprite_spec = { "pygame_sdl2.render.Sprite", sizeof(struct __pyx_obj_11pygame_sdl2_6render_Sprite), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_6render_Sprite_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_6render_Sprite = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.""Sprite", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Sprite), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Sprite, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Sprite(nodes)\n One or more TextureNodes, with possible transforms applied. "), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_Sprite, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_Sprite, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Sprite, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_6render_Sprite, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Sprite, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Container(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Container *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_6render_Container *)o); p->sprites = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Container(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_Container *p = (struct __pyx_obj_11pygame_sdl2_6render_Container *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_6render_Container) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->sprites); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_6render_Container(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_Container *p = (struct __pyx_obj_11pygame_sdl2_6render_Container *)o; if (p->sprites) { e = (*v)(p->sprites, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_Container(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_Container *p = (struct __pyx_obj_11pygame_sdl2_6render_Container *)o; tmp = ((PyObject*)p->sprites); p->sprites = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_6render_9Container_pos(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_9Container_3pos_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_9Container_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_9Container_3pos_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_9Container_rect(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_9Container_4rect_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_9Container_rect(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_9Container_4rect_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Container[] = { {"add", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_3add, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_2add}, {"render", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_5render, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_4render}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_6render_9Container_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_6render_9Container_8__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_6render_Container[] = { {(char *)"pos", __pyx_getprop_11pygame_sdl2_6render_9Container_pos, __pyx_setprop_11pygame_sdl2_6render_9Container_pos, (char *)0, 0}, {(char *)"rect", __pyx_getprop_11pygame_sdl2_6render_9Container_rect, __pyx_setprop_11pygame_sdl2_6render_9Container_rect, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_6render_Container_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_6render_Container}, {Py_tp_doc, (void *)PyDoc_STR("Container(rect)\n Multiple sprites, positioned relative to the container. ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_6render_Container}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_6render_Container}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_6render_Container}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_6render_Container}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_6render_9Container_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_6render_Container}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_6render_Container_spec = { "pygame_sdl2.render.Container", sizeof(struct __pyx_obj_11pygame_sdl2_6render_Container), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_6render_Container_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_6render_Container = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.""Container", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Container), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Container, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Container(rect)\n Multiple sprites, positioned relative to the container. "), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_Container, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_Container, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Container, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_6render_Container, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_6render_9Container_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Container, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_BLENDMODE_ADD, __pyx_k_BLENDMODE_ADD, sizeof(__pyx_k_BLENDMODE_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLENDMODE_BLEND, __pyx_k_BLENDMODE_BLEND, sizeof(__pyx_k_BLENDMODE_BLEND), 0, 0, 1, 1}, {&__pyx_n_s_BLENDMODE_MOD, __pyx_k_BLENDMODE_MOD, sizeof(__pyx_k_BLENDMODE_MOD), 0, 0, 1, 1}, {&__pyx_n_s_BLENDMODE_NONE, __pyx_k_BLENDMODE_NONE, sizeof(__pyx_k_BLENDMODE_NONE), 0, 0, 1, 1}, {&__pyx_n_s_Color, __pyx_k_Color, sizeof(__pyx_k_Color), 0, 0, 1, 1}, {&__pyx_n_s_Container, __pyx_k_Container, sizeof(__pyx_k_Container), 0, 0, 1, 1}, {&__pyx_n_s_Container___reduce_cython, __pyx_k_Container___reduce_cython, sizeof(__pyx_k_Container___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Container___setstate_cython, __pyx_k_Container___setstate_cython, sizeof(__pyx_k_Container___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Container_add, __pyx_k_Container_add, sizeof(__pyx_k_Container_add), 0, 0, 1, 1}, {&__pyx_n_s_Container_render, __pyx_k_Container_render, sizeof(__pyx_k_Container_render), 0, 0, 1, 1}, {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_argument_s, __pyx_k_Invalid_argument_s, sizeof(__pyx_k_Invalid_argument_s), 0, 0, 1, 0}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_kp_s_Pickling_of_struct_members_such, __pyx_k_Pickling_of_struct_members_such, sizeof(__pyx_k_Pickling_of_struct_members_such), 0, 0, 1, 0}, {&__pyx_kp_s_Pickling_of_struct_members_such_2, __pyx_k_Pickling_of_struct_members_such_2, sizeof(__pyx_k_Pickling_of_struct_members_such_2), 0, 0, 1, 0}, {&__pyx_kp_s_Pickling_of_struct_members_such_3, __pyx_k_Pickling_of_struct_members_such_3, sizeof(__pyx_k_Pickling_of_struct_members_such_3), 0, 0, 1, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_Renderer, __pyx_k_Renderer, sizeof(__pyx_k_Renderer), 0, 0, 1, 1}, {&__pyx_n_s_Renderer___reduce_cython, __pyx_k_Renderer___reduce_cython, sizeof(__pyx_k_Renderer___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Renderer___setstate_cython, __pyx_k_Renderer___setstate_cython, sizeof(__pyx_k_Renderer___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_clear, __pyx_k_Renderer_clear, sizeof(__pyx_k_Renderer_clear), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_create_texture, __pyx_k_Renderer_create_texture, sizeof(__pyx_k_Renderer_create_texture), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_draw_line, __pyx_k_Renderer_draw_line, sizeof(__pyx_k_Renderer_draw_line), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_draw_point, __pyx_k_Renderer_draw_point, sizeof(__pyx_k_Renderer_draw_point), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_draw_rect, __pyx_k_Renderer_draw_rect, sizeof(__pyx_k_Renderer_draw_rect), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_fill_rect, __pyx_k_Renderer_fill_rect, sizeof(__pyx_k_Renderer_fill_rect), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_info, __pyx_k_Renderer_info, sizeof(__pyx_k_Renderer_info), 0, 0, 1, 1}, {&__pyx_kp_s_Renderer_is_not_accelerated, __pyx_k_Renderer_is_not_accelerated, sizeof(__pyx_k_Renderer_is_not_accelerated), 0, 0, 1, 0}, {&__pyx_n_s_Renderer_load_atlas, __pyx_k_Renderer_load_atlas, sizeof(__pyx_k_Renderer_load_atlas), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_load_texture, __pyx_k_Renderer_load_texture, sizeof(__pyx_k_Renderer_load_texture), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_render_present, __pyx_k_Renderer_render_present, sizeof(__pyx_k_Renderer_render_present), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_set_viewport, __pyx_k_Renderer_set_viewport, sizeof(__pyx_k_Renderer_set_viewport), 0, 0, 1, 1}, {&__pyx_kp_s_Rotation_not_supported_yet, __pyx_k_Rotation_not_supported_yet, sizeof(__pyx_k_Rotation_not_supported_yet), 0, 0, 1, 0}, {&__pyx_n_s_Sprite, __pyx_k_Sprite, sizeof(__pyx_k_Sprite), 0, 0, 1, 1}, {&__pyx_n_s_Sprite___reduce_cython, __pyx_k_Sprite___reduce_cython, sizeof(__pyx_k_Sprite___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Sprite___setstate_cython, __pyx_k_Sprite___setstate_cython, sizeof(__pyx_k_Sprite___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Sprite_collides, __pyx_k_Sprite_collides, sizeof(__pyx_k_Sprite_collides), 0, 0, 1, 1}, {&__pyx_n_s_Sprite_render, __pyx_k_Sprite_render, sizeof(__pyx_k_Sprite_render), 0, 0, 1, 1}, {&__pyx_n_s_Texture, __pyx_k_Texture, sizeof(__pyx_k_Texture), 0, 0, 1, 1}, {&__pyx_n_s_TextureAtlas, __pyx_k_TextureAtlas, sizeof(__pyx_k_TextureAtlas), 0, 0, 1, 1}, {&__pyx_n_s_TextureAtlas___reduce_cython, __pyx_k_TextureAtlas___reduce_cython, sizeof(__pyx_k_TextureAtlas___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_TextureAtlas___setstate_cython, __pyx_k_TextureAtlas___setstate_cython, sizeof(__pyx_k_TextureAtlas___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_TextureAtlas_keys, __pyx_k_TextureAtlas_keys, sizeof(__pyx_k_TextureAtlas_keys), 0, 0, 1, 1}, {&__pyx_n_s_TextureNode, __pyx_k_TextureNode, sizeof(__pyx_k_TextureNode), 0, 0, 1, 1}, {&__pyx_n_s_TextureNode___reduce_cython, __pyx_k_TextureNode___reduce_cython, sizeof(__pyx_k_TextureNode___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_TextureNode___setstate_cython, __pyx_k_TextureNode___setstate_cython, sizeof(__pyx_k_TextureNode___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_TextureNode_render, __pyx_k_TextureNode_render, sizeof(__pyx_k_TextureNode_render), 0, 0, 1, 1}, {&__pyx_n_s_Texture___reduce_cython, __pyx_k_Texture___reduce_cython, sizeof(__pyx_k_Texture___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Texture___setstate_cython, __pyx_k_Texture___setstate_cython, sizeof(__pyx_k_Texture___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1}, {&__pyx_n_s__54, __pyx_k__54, sizeof(__pyx_k__54), 0, 0, 1, 1}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_accelerated, __pyx_k_accelerated, sizeof(__pyx_k_accelerated), 0, 0, 1, 1}, {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_collides, __pyx_k_collides, sizeof(__pyx_k_collides), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_create_texture, __pyx_k_create_texture, sizeof(__pyx_k_create_texture), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_dest_rect, __pyx_k_dest_rect, sizeof(__pyx_k_dest_rect), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_draw_line, __pyx_k_draw_line, sizeof(__pyx_k_draw_line), 0, 0, 1, 1}, {&__pyx_n_s_draw_point, __pyx_k_draw_point, sizeof(__pyx_k_draw_point), 0, 0, 1, 1}, {&__pyx_n_s_draw_rect, __pyx_k_draw_rect, sizeof(__pyx_k_draw_rect), 0, 0, 1, 1}, {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, {&__pyx_n_s_fill_rect, __pyx_k_fill_rect, sizeof(__pyx_k_fill_rect), 0, 0, 1, 1}, {&__pyx_n_s_frame, __pyx_k_frame, sizeof(__pyx_k_frame), 0, 0, 1, 1}, {&__pyx_n_s_frames, __pyx_k_frames, sizeof(__pyx_k_frames), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_drivers, __pyx_k_get_drivers, sizeof(__pyx_k_get_drivers), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_image, __pyx_k_image, sizeof(__pyx_k_image), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1}, {&__pyx_n_s_load_atlas, __pyx_k_load_atlas, sizeof(__pyx_k_load_atlas), 0, 0, 1, 1}, {&__pyx_n_s_load_texture, __pyx_k_load_texture, sizeof(__pyx_k_load_texture), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_max_texture_height, __pyx_k_max_texture_height, sizeof(__pyx_k_max_texture_height), 0, 0, 1, 1}, {&__pyx_n_s_max_texture_width, __pyx_k_max_texture_width, sizeof(__pyx_k_max_texture_width), 0, 0, 1, 1}, {&__pyx_n_s_meta, __pyx_k_meta, sizeof(__pyx_k_meta), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1}, {&__pyx_n_s_num_drivers, __pyx_k_num_drivers, sizeof(__pyx_k_num_drivers), 0, 0, 1, 1}, {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_pivot, __pyx_k_pivot, sizeof(__pyx_k_pivot), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_render, __pyx_k_pygame_sdl2_render, sizeof(__pyx_k_pygame_sdl2_render), 0, 0, 1, 1}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_TextureAtlas, __pyx_k_pyx_unpickle_TextureAtlas, sizeof(__pyx_k_pyx_unpickle_TextureAtlas), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_r1, __pyx_k_r1, sizeof(__pyx_k_r1), 0, 0, 1, 1}, {&__pyx_n_s_r2, __pyx_k_r2, sizeof(__pyx_k_r2), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_real_dest, __pyx_k_real_dest, sizeof(__pyx_k_real_dest), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_ren, __pyx_k_ren, sizeof(__pyx_k_ren), 0, 0, 1, 1}, {&__pyx_n_s_render, __pyx_k_render, sizeof(__pyx_k_render), 0, 0, 1, 1}, {&__pyx_n_s_render_present, __pyx_k_render_present, sizeof(__pyx_k_render_present), 0, 0, 1, 1}, {&__pyx_n_s_rinfo, __pyx_k_rinfo, sizeof(__pyx_k_rinfo), 0, 0, 1, 1}, {&__pyx_n_s_rotated, __pyx_k_rotated, sizeof(__pyx_k_rotated), 0, 0, 1, 1}, {&__pyx_n_s_rtt, __pyx_k_rtt, sizeof(__pyx_k_rtt), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_viewport, __pyx_k_set_viewport, sizeof(__pyx_k_set_viewport), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_software, __pyx_k_software, sizeof(__pyx_k_software), 0, 0, 1, 1}, {&__pyx_n_s_sourceSize, __pyx_k_sourceSize, sizeof(__pyx_k_sourceSize), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_sprite, __pyx_k_sprite, sizeof(__pyx_k_sprite), 0, 0, 1, 1}, {&__pyx_n_s_spriteSourceSize, __pyx_k_spriteSourceSize, sizeof(__pyx_k_spriteSourceSize), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_k_src_pygame_sdl2_render_pyx, sizeof(__pyx_k_src_pygame_sdl2_render_pyx), 0, 0, 1, 0}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_tex, __pyx_k_tex, sizeof(__pyx_k_tex), 0, 0, 1, 1}, {&__pyx_n_s_tn, __pyx_k_tn, sizeof(__pyx_k_tn), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, {&__pyx_n_s_vprect, __pyx_k_vprect, sizeof(__pyx_k_vprect), 0, 0, 1, 1}, {&__pyx_n_s_vsync, __pyx_k_vsync, sizeof(__pyx_k_vsync), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 58, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 227, __pyx_L1_error) __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 249, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x594cfd2, 0xe7d6794, 0xdcdc1ac): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x594cfd2, 0xe7d6794, 0xdcdc1ac) = (frames))" % __pyx_checksum */ __pyx_tuple_ = PyTuple_Pack(3, __pyx_int_93638610, __pyx_int_243099540, __pyx_int_231588268); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ __pyx_tuple__4 = PyTuple_Pack(4, __pyx_n_s_rinfo, __pyx_n_s_num_drivers, __pyx_n_s_rv, __pyx_n_s_n); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_get_drivers, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 52, __pyx_L1_error) /* "pygame_sdl2/render.pyx":101 * warnings.warn("Renderer is not accelerated.") * * def load_texture(self, fi): # <<<<<<<<<<<<<< * cdef SDL_Texture *tex * cdef Texture t = Texture() */ __pyx_tuple__6 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_fi, __pyx_n_s_tex, __pyx_n_s_t); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_load_texture, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 101, __pyx_L1_error) /* "pygame_sdl2/render.pyx":116 * return TextureNode(t) * * def load_atlas(self, filename): # <<<<<<<<<<<<<< * """ Loads a file in the popular JSON (Hash) format exported by * TexturePacker and other software. """ */ __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_load_atlas, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 116, __pyx_L1_error) /* "pygame_sdl2/render.pyx":122 * return TextureAtlas(self, filename) * * def render_present(self): # <<<<<<<<<<<<<< * with nogil: * SDL_RenderPresent(self.renderer) */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_render_present, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 122, __pyx_L1_error) /* "pygame_sdl2/render.pyx":126 * SDL_RenderPresent(self.renderer) * * def info(self): # <<<<<<<<<<<<<< * return self._info * */ __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_info, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 126, __pyx_L1_error) /* "pygame_sdl2/render.pyx":134 * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * * def clear(self, color): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) */ __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_color); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_clear, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 134, __pyx_L1_error) /* "pygame_sdl2/render.pyx":138 * SDL_RenderClear(self.renderer) * * def draw_line(self, color not None, x1, y1, x2, y2): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: */ __pyx_tuple__15 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_draw_line, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 138, __pyx_L1_error) /* "pygame_sdl2/render.pyx":143 * raise error() * * def draw_point(self, color not None, x, y): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) */ __pyx_tuple__17 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_draw_point, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 143, __pyx_L1_error) /* "pygame_sdl2/render.pyx":147 * SDL_RenderDrawPoint(self.renderer, x, y) * * def draw_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ __pyx_tuple__19 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_r); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_draw_rect, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 147, __pyx_L1_error) /* "pygame_sdl2/render.pyx":153 * SDL_RenderDrawRect(self.renderer, &r) * * def fill_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_fill_rect, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 153, __pyx_L1_error) /* "pygame_sdl2/render.pyx":159 * SDL_RenderFillRect(self.renderer, &r) * * def set_viewport(self, rect=None): # <<<<<<<<<<<<<< * cdef SDL_Rect vprect * if rect is None: */ __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_rect, __pyx_n_s_vprect); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_set_viewport, 159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 159, __pyx_L1_error) __pyx_tuple__24 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "pygame_sdl2/render.pyx":167 * SDL_RenderSetViewport(self.renderer, &vprect) * * def create_texture(self, size): # <<<<<<<<<<<<<< * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() */ __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_size); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_create_texture, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 167, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(1, 3, __pyx_L1_error) /* "pygame_sdl2/render.pyx":229 * raise ValueError() * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * */ __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dest, __pyx_n_s_dest_rect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_render, 229, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 229, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" */ __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(1, 3, __pyx_L1_error) /* "pygame_sdl2/render.pyx":274 * return self.frames[key] * * def keys(self): # <<<<<<<<<<<<<< * return self.frames.keys() * */ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_keys, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 274, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_tuple__37 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state) */ __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 16, __pyx_L1_error) /* "pygame_sdl2/render.pyx":321 * rout.h = (self._scaley * rin.h) * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef Texture tex = (self.nodes[0]).texture * cdef SDL_Rect dest_rect */ __pyx_tuple__40 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_dest, __pyx_n_s_tex, __pyx_n_s_dest_rect, __pyx_n_s_real_dest, __pyx_n_s_pivot, __pyx_n_s_tn, __pyx_n_s_x); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_render, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 321, __pyx_L1_error) /* "pygame_sdl2/render.pyx":356 * self._flip) * * def collides(self, Sprite other not None): # <<<<<<<<<<<<<< * cdef SDL_Rect r1, r2 * */ __pyx_tuple__42 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_r1, __pyx_n_s_r2); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_collides, 356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 356, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" */ __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(1, 3, __pyx_L1_error) /* "pygame_sdl2/render.pyx":447 * self._rect.w = self._rect.h = 0 * * def add(self, Sprite sprite not None): # <<<<<<<<<<<<<< * self.sprites.append(sprite) * */ __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_sprite); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_add, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 447, __pyx_L1_error) /* "pygame_sdl2/render.pyx":450 * self.sprites.append(sprite) * * def render(self, dest=None): # <<<<<<<<<<<<<< * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer */ __pyx_tuple__48 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_dest, __pyx_n_s_ren, __pyx_n_s_s); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_render, 450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 450, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" */ __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_TextureAtlas, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_93638610 = PyInt_FromLong(93638610L); if (unlikely(!__pyx_int_93638610)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_231588268 = PyInt_FromLong(231588268L); if (unlikely(!__pyx_int_231588268)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_243099540 = PyInt_FromLong(243099540L); if (unlikely(!__pyx_int_243099540)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_6render_Renderer = &__pyx_vtable_11pygame_sdl2_6render_Renderer; __pyx_vtable_11pygame_sdl2_6render_Renderer.set_drawcolor = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_6render_Renderer *, PyObject *))__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_6render_Renderer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_6render_Renderer_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_6render_Renderer)) __PYX_ERR(0, 67, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_6render_Renderer_spec, __pyx_ptype_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_6render_Renderer = &__pyx_type_11pygame_sdl2_6render_Renderer; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_6render_Renderer->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_6render_Renderer->tp_dictoffset && __pyx_ptype_11pygame_sdl2_6render_Renderer->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_6render_Renderer->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_vtabptr_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Renderer, (PyObject *) __pyx_ptype_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error) #endif __pyx_vtabptr_11pygame_sdl2_6render_Texture = &__pyx_vtable_11pygame_sdl2_6render_Texture; __pyx_vtable_11pygame_sdl2_6render_Texture.set = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_6render_Texture *, SDL_Renderer *, SDL_Texture *))__pyx_f_11pygame_sdl2_6render_7Texture_set; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_6render_Texture = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_6render_Texture_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_6render_Texture)) __PYX_ERR(0, 172, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_6render_Texture_spec, __pyx_ptype_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_6render_Texture = &__pyx_type_11pygame_sdl2_6render_Texture; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_6render_Texture->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_6render_Texture->tp_dictoffset && __pyx_ptype_11pygame_sdl2_6render_Texture->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_6render_Texture->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_11pygame_sdl2_6render_Texture, __pyx_vtabptr_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Texture, (PyObject *) __pyx_ptype_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_6render_TextureNode = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_6render_TextureNode_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_6render_TextureNode)) __PYX_ERR(0, 200, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_6render_TextureNode_spec, __pyx_ptype_11pygame_sdl2_6render_TextureNode) < 0) __PYX_ERR(0, 200, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_6render_TextureNode = &__pyx_type_11pygame_sdl2_6render_TextureNode; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_6render_TextureNode) < 0) __PYX_ERR(0, 200, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_6render_TextureNode->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_6render_TextureNode->tp_dictoffset && __pyx_ptype_11pygame_sdl2_6render_TextureNode->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_6render_TextureNode->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TextureNode, (PyObject *) __pyx_ptype_11pygame_sdl2_6render_TextureNode) < 0) __PYX_ERR(0, 200, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_6render_TextureNode) < 0) __PYX_ERR(0, 200, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_6render_TextureAtlas = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_6render_TextureAtlas_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_6render_TextureAtlas)) __PYX_ERR(0, 245, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_6render_TextureAtlas_spec, __pyx_ptype_11pygame_sdl2_6render_TextureAtlas) < 0) __PYX_ERR(0, 245, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_6render_TextureAtlas = &__pyx_type_11pygame_sdl2_6render_TextureAtlas; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_6render_TextureAtlas) < 0) __PYX_ERR(0, 245, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_6render_TextureAtlas->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_6render_TextureAtlas->tp_dictoffset && __pyx_ptype_11pygame_sdl2_6render_TextureAtlas->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_6render_TextureAtlas->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TextureAtlas, (PyObject *) __pyx_ptype_11pygame_sdl2_6render_TextureAtlas) < 0) __PYX_ERR(0, 245, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_6render_TextureAtlas) < 0) __PYX_ERR(0, 245, __pyx_L1_error) #endif __pyx_vtabptr_11pygame_sdl2_6render_Sprite = &__pyx_vtable_11pygame_sdl2_6render_Sprite; __pyx_vtable_11pygame_sdl2_6render_Sprite.adjust_rect = (void (*)(struct __pyx_obj_11pygame_sdl2_6render_Sprite *, SDL_Rect const *, SDL_Rect const *, SDL_Rect *))__pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_6render_Sprite = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_6render_Sprite_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_6render_Sprite)) __PYX_ERR(0, 278, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_6render_Sprite_spec, __pyx_ptype_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_6render_Sprite = &__pyx_type_11pygame_sdl2_6render_Sprite; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_6render_Sprite->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_6render_Sprite->tp_dictoffset && __pyx_ptype_11pygame_sdl2_6render_Sprite->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_6render_Sprite->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_11pygame_sdl2_6render_Sprite, __pyx_vtabptr_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Sprite, (PyObject *) __pyx_ptype_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_6render_Container = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_6render_Container_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_6render_Container)) __PYX_ERR(0, 433, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_6render_Container_spec, __pyx_ptype_11pygame_sdl2_6render_Container) < 0) __PYX_ERR(0, 433, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_6render_Container = &__pyx_type_11pygame_sdl2_6render_Container; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_6render_Container) < 0) __PYX_ERR(0, 433, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_6render_Container->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_6render_Container->tp_dictoffset && __pyx_ptype_11pygame_sdl2_6render_Container->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_6render_Container->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Container, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 433, __pyx_L1_error) if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__.doc = __pyx_doc_11pygame_sdl2_6render_9Container___init__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__; } } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Container, (PyObject *) __pyx_ptype_11pygame_sdl2_6render_Container) < 0) __PYX_ERR(0, 433, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_6render_Container) < 0) __PYX_ERR(0, 433, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7display_Window),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7display_Window) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_4rect_Rect),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_4rect_Rect) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_render(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_render}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "render", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initrender(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initrender(void) #else __Pyx_PyMODINIT_FUNC PyInit_render(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_render(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_render(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'render' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("render", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "render" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_render(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__render) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.render")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.render", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_variable_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/render.pyx":27 * from pygame_sdl2.rect cimport to_sdl_rect * * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * from pygame_sdl2.color import Color */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Rect)) __PYX_ERR(0, 27, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":28 * * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.color import Color * import json */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error)) __PYX_ERR(0, 28, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":29 * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error * from pygame_sdl2.color import Color # <<<<<<<<<<<<<< * import json * import warnings */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Color); __Pyx_GIVEREF(__pyx_n_s_Color); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Color)) __PYX_ERR(0, 29, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_color, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Color, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":30 * from pygame_sdl2.error import error * from pygame_sdl2.color import Color * import json # <<<<<<<<<<<<<< * import warnings * */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_json, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":31 * from pygame_sdl2.color import Color * import json * import warnings # <<<<<<<<<<<<<< * * BLENDMODE_NONE = SDL_BLENDMODE_NONE */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":33 * import warnings * * BLENDMODE_NONE = SDL_BLENDMODE_NONE # <<<<<<<<<<<<<< * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND * BLENDMODE_ADD = SDL_BLENDMODE_ADD */ __pyx_t_3 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_NONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_NONE, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":34 * * BLENDMODE_NONE = SDL_BLENDMODE_NONE * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND # <<<<<<<<<<<<<< * BLENDMODE_ADD = SDL_BLENDMODE_ADD * BLENDMODE_MOD = SDL_BLENDMODE_MOD */ __pyx_t_3 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_BLEND); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_BLEND, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":35 * BLENDMODE_NONE = SDL_BLENDMODE_NONE * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND * BLENDMODE_ADD = SDL_BLENDMODE_ADD # <<<<<<<<<<<<<< * BLENDMODE_MOD = SDL_BLENDMODE_MOD * */ __pyx_t_3 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_ADD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_ADD, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":36 * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND * BLENDMODE_ADD = SDL_BLENDMODE_ADD * BLENDMODE_MOD = SDL_BLENDMODE_MOD # <<<<<<<<<<<<<< * * cdef bint DEBUG_DRAW_BBOX = True */ __pyx_t_3 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_MOD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_MOD, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":38 * BLENDMODE_MOD = SDL_BLENDMODE_MOD * * cdef bint DEBUG_DRAW_BBOX = True # <<<<<<<<<<<<<< * * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): */ __pyx_v_11pygame_sdl2_6render_DEBUG_DRAW_BBOX = 1; /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_1get_drivers, 0, __pyx_n_s_get_drivers, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drivers, __pyx_t_3) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":101 * warnings.warn("Renderer is not accelerated.") * * def load_texture(self, fi): # <<<<<<<<<<<<<< * cdef SDL_Texture *tex * cdef Texture t = Texture() */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_7load_texture, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_load_texture, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_load_texture, __pyx_t_3) < 0) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":116 * return TextureNode(t) * * def load_atlas(self, filename): # <<<<<<<<<<<<<< * """ Loads a file in the popular JSON (Hash) format exported by * TexturePacker and other software. """ */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_9load_atlas, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_load_atlas, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_load_atlas, __pyx_t_3) < 0) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":122 * return TextureAtlas(self, filename) * * def render_present(self): # <<<<<<<<<<<<<< * with nogil: * SDL_RenderPresent(self.renderer) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_11render_present, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_render_present, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_render_present, __pyx_t_3) < 0) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":126 * SDL_RenderPresent(self.renderer) * * def info(self): # <<<<<<<<<<<<<< * return self._info * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_13info, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_info, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_info, __pyx_t_3) < 0) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":134 * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * * def clear(self, color): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_15clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_clear, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_clear, __pyx_t_3) < 0) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":138 * SDL_RenderClear(self.renderer) * * def draw_line(self, color not None, x1, y1, x2, y2): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_17draw_line, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_line, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_draw_line, __pyx_t_3) < 0) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":143 * raise error() * * def draw_point(self, color not None, x, y): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_19draw_point, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_point, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_draw_point, __pyx_t_3) < 0) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":147 * SDL_RenderDrawPoint(self.renderer, x, y) * * def draw_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_21draw_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_rect, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_draw_rect, __pyx_t_3) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":153 * SDL_RenderDrawRect(self.renderer, &r) * * def fill_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_23fill_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_fill_rect, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_fill_rect, __pyx_t_3) < 0) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":159 * SDL_RenderFillRect(self.renderer, &r) * * def set_viewport(self, rect=None): # <<<<<<<<<<<<<< * cdef SDL_Rect vprect * if rect is None: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_25set_viewport, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_set_viewport, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_set_viewport, __pyx_t_3) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "pygame_sdl2/render.pyx":167 * SDL_RenderSetViewport(self.renderer, &vprect) * * def create_texture(self, size): # <<<<<<<<<<<<<< * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_27create_texture, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_create_texture, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Renderer, __pyx_n_s_create_texture, __pyx_t_3) < 0) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Renderer); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_29__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_8Renderer_31__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_7Texture_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Texture___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_7Texture_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Texture___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":229 * raise ValueError() * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_11TextureNode_3render, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TextureNode_render, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode, __pyx_n_s_render, __pyx_t_3) < 0) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_TextureNode); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TextureNode___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TextureNode___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":274 * return self.frames[key] * * def keys(self): # <<<<<<<<<<<<<< * return self.frames.keys() * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_12TextureAtlas_5keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TextureAtlas_keys, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureAtlas, __pyx_n_s_keys, __pyx_t_3) < 0) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_TextureAtlas); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TextureAtlas___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureAtlas, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_TextureAtlas); /* "(tree fragment)":16 * else: * return __pyx_unpickle_TextureAtlas, (type(self), 0x594cfd2, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TextureAtlas___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureAtlas, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_TextureAtlas); /* "pygame_sdl2/render.pyx":321 * rout.h = (self._scaley * rin.h) * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef Texture tex = (self.nodes[0]).texture * cdef SDL_Rect dest_rect */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_6Sprite_3render, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sprite_render, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Sprite, __pyx_n_s_render, __pyx_t_3) < 0) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Sprite); /* "pygame_sdl2/render.pyx":356 * self._flip) * * def collides(self, Sprite other not None): # <<<<<<<<<<<<<< * cdef SDL_Rect r1, r2 * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_6Sprite_5collides, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sprite_collides, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Sprite, __pyx_n_s_collides, __pyx_t_3) < 0) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Sprite); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_6Sprite_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sprite___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_6Sprite_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sprite___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":447 * self._rect.w = self._rect.h = 0 * * def add(self, Sprite sprite not None): # <<<<<<<<<<<<<< * self.sprites.append(sprite) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_9Container_3add, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Container_add, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Container, __pyx_n_s_add, __pyx_t_3) < 0) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Container); /* "pygame_sdl2/render.pyx":450 * self.sprites.append(sprite) * * def render(self, dest=None): # <<<<<<<<<<<<<< * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_9Container_5render, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Container_render, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Container, __pyx_n_s_render, __pyx_t_3) < 0) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_6render_Container); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_9Container_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Container___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_9Container_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Container___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":1 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas, 0, __pyx_n_s_pyx_unpickle_TextureAtlas, NULL, __pyx_n_s_pygame_sdl2_render, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_TextureAtlas, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.render", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.render"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } *pvalue1 = value1; *pvalue2 = value2; return 0; #if CYTHON_COMPILING_IN_PYPY bad: Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; #endif } static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = __Pyx_PyObject_GetIterNextFunc(iter); value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { #if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; #elif PY_MAJOR_VERSION >= 3 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { const char *name = PyUnicode_AsUTF8(method_name); if (strcmp(name, "iteritems") == 0) pp = &py_items; else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; else if (strcmp(name, "itervalues") == 0) pp = &py_values; if (pp) { if (!*pp) { *pp = PyUnicode_FromString(name + 4); if (!*pp) return NULL; } method_name = *pp; } } #endif } *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* GetAttr3 */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } #endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { r = __Pyx_NewRef(d); } return r; } #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); #endif } /* ErrOccurredWithGIL */ static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void) { int err; #ifdef WITH_THREAD PyGILState_STATE _save = PyGILState_Ensure(); #endif err = !!PyErr_Occurred(); #ifdef WITH_THREAD PyGILState_Release(_save); #endif return err; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (!r) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetVTable */ static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { PyObject *ob = PyCapsule_New(vtable, 0, 0); if (unlikely(!ob)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* MergeVTables */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type) { int i; void** base_vtables; __Pyx_TypeName tp_base_name; __Pyx_TypeName base_name; void* unknown = (void*)-1; PyObject* bases = type->tp_bases; int base_depth = 0; { PyTypeObject* base = type->tp_base; while (base) { base_depth += 1; base = base->tp_base; } } base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); if (base_vtable != NULL) { int j; PyTypeObject* base = type->tp_base; for (j = 0; j < base_depth; j++) { if (base_vtables[j] == unknown) { base_vtables[j] = __Pyx_GetVtable(base); base_vtables[j + 1] = unknown; } if (base_vtables[j] == base_vtable) { break; } else if (base_vtables[j] == NULL) { goto bad; } base = base->tp_base; } } } PyErr_Clear(); free(base_vtables); return 0; bad: tp_base_name = __Pyx_PyType_GetName(type->tp_base); base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); free(base_vtables); return -1; } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_12 #define __PYX_HAVE_RT_ImportType_3_0_12 static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__3; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_BlendMode(SDL_BlendMode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SDL_BlendMode neg_one = (SDL_BlendMode) -1, const_zero = (SDL_BlendMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_BlendMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_BlendMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_BlendMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_BlendMode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_BlendMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SDL_BlendMode), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SDL_BlendMode)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint8_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT)) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT)) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT)) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint8_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } } #endif if ((sizeof(uint8_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint8_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint8_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint8_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint8_t) -1; } else { stepval = v; } v = NULL; val = (uint8_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint8_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint8_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint8_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint8_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint8_t) 1) << (sizeof(uint8_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint8_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__54); } return name; } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* VoidPtrImport */ #ifndef __PYX_HAVE_RT_ImportVoidPtr_3_0_12 #define __PYX_HAVE_RT_ImportVoidPtr_3_0_12 static int __Pyx_ImportVoidPtr_3_0_12(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12 #define __PYX_HAVE_RT_ImportFunction_3_0_12 static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635909.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.rwobject.c0000664000175000017500000300331715026112605020715 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__rwobject #define __PYX_HAVE_API__pygame_sdl2__rwobject /* Early includes */ #include #include #include #include #include "SDL.h" #include #include "python_threads.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/rwobject.pyx", "", "type.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; struct __pyx_t_11pygame_sdl2_8rwobject_SubFile; struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile; struct __pyx_t_11pygame_sdl2_8rwobject_BufFile; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; PyObject *base; PyObject *length; }; /* "pygame_sdl2/rwobject.pyx":132 * return 0 * * cdef struct SubFile: # <<<<<<<<<<<<<< * SDL_RWops *rw * Sint64 base */ struct __pyx_t_11pygame_sdl2_8rwobject_SubFile { SDL_RWops *rw; Sint64 base; Sint64 length; Sint64 tell; }; /* "pygame_sdl2/rwobject.pyx":188 * * * cdef struct SplitFile: # <<<<<<<<<<<<<< * SDL_RWops *a * SDL_RWops *b */ struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile { SDL_RWops *a; SDL_RWops *b; Sint64 split; Sint64 tell; }; /* "pygame_sdl2/rwobject.pyx":271 * * * cdef struct BufFile: # <<<<<<<<<<<<<< * Py_buffer view * Uint8 *base */ struct __pyx_t_11pygame_sdl2_8rwobject_BufFile { Py_buffer view; Uint8 *base; Uint8 *here; Uint8 *stop; }; /* "pygame_sdl2/rwobject.pyx":491 * } * * cdef class RWopsIOImpl: # <<<<<<<<<<<<<< * """ * This wraps an SDL_RWops object in a Python file-like object. */ struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl { PyObject_HEAD SDL_RWops *ops; PyObject *name; PyObject *base; PyObject *length; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* PyObject_Str.proto */ #define __Pyx_PyObject_Str(obj)\ (likely(PyString_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* DivInt[ptrdiff_t].proto */ static CYTHON_INLINE ptrdiff_t __Pyx_div_ptrdiff_t(ptrdiff_t, ptrdiff_t); /* UnaryNegOverflows.proto */ #define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\ (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 #define __PYX_HAVE_RT_ImportType_proto_3_0_12 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_12 { __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value); /* CIntFromPy.proto */ static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.type" */ /* Module declarations from "cpython" */ /* Module declarations from "cpython.object" */ /* Module declarations from "cpython.ref" */ /* Module declarations from "cpython.buffer" */ /* Module declarations from "libc.stdlib" */ /* Module declarations from "pygame_sdl2.rwobject" */ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_to_rwops(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_8rwobject_set_error(PyObject *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_size(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_seek(SDL_RWops *, Sint64, int); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_read(SDL_RWops *, void *, size_t, size_t); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_write(SDL_RWops *, void const *, size_t, size_t); /*proto*/ static int __pyx_f_11pygame_sdl2_8rwobject_python_close(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_size(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_seek(SDL_RWops *, Sint64, int); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_subfile_read(SDL_RWops *, void *, size_t, size_t); /*proto*/ static int __pyx_f_11pygame_sdl2_8rwobject_subfile_close(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_splitfile_size(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_splitfile_seek(SDL_RWops *, Sint64, int); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_splitfile_read(SDL_RWops *, void *, size_t, size_t); /*proto*/ static int __pyx_f_11pygame_sdl2_8rwobject_splitfile_close(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_buffile_size(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_buffile_seek(SDL_RWops *, Sint64, int); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_buffile_read(SDL_RWops *, void *, size_t, size_t); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_buffile_write(SDL_RWops *, void const *, size_t, size_t); /*proto*/ static int __pyx_f_11pygame_sdl2_8rwobject_buffile_close(SDL_RWops *); /*proto*/ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython(PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.rwobject" extern int __pyx_module_is_main_pygame_sdl2__rwobject; int __pyx_module_is_main_pygame_sdl2__rwobject = 0; /* Implementation of "pygame_sdl2.rwobject" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_staticmethod; static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_IOError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_OSError; static PyObject *__pyx_builtin_MemoryError; /* #### Code section: string_decls ### */ static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k__7[] = "."; static const char __pyx_k__8[] = "*"; static const char __pyx_k_bf[] = "bf"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_io[] = "io"; static const char __pyx_k_rb[] = "rb"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k_rw[] = "rw"; static const char __pyx_k_sf[] = "sf"; static const char __pyx_k__39[] = "?"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_raw[] = "raw"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_read[] = "read"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_seek[] = "seek"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_tell[] = "tell"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_view[] = "view"; static const char __pyx_k_ascii[] = "ascii"; static const char __pyx_k_bytes[] = "bytes_"; static const char __pyx_k_close[] = "close"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_write[] = "write"; static const char __pyx_k_IOBase[] = "IOBase"; static const char __pyx_k_buffer[] = "buffer"; static const char __pyx_k_closed[] = "closed"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_fileno[] = "fileno"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_length[] = "length"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_offset[] = "offset"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_whence[] = "whence"; static const char __pyx_k_IOError[] = "IOError"; static const char __pyx_k_OSError[] = "OSError"; static const char __pyx_k_RWopsIO[] = "RWopsIO"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_unicode[] = "unicode_"; static const char __pyx_k_SEEK_CUR[] = "SEEK_CUR"; static const char __pyx_k_SEEK_END[] = "SEEK_END"; static const char __pyx_k_SEEK_SET[] = "SEEK_SET"; static const char __pyx_k_filelike[] = "filelike"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_property[] = "property"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_readable[] = "readable"; static const char __pyx_k_readinto[] = "readinto"; static const char __pyx_k_seekable[] = "seekable"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_truncate[] = "truncate"; static const char __pyx_k_writable[] = "writable"; static const char __pyx_k_RWopsIO_r[] = ""; static const char __pyx_k_RawIOBase[] = "RawIOBase"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_file_type[] = "file_type"; static const char __pyx_k_is_closed[] = "is_closed"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_whence_rw[] = "whence_rw"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_from_split[] = "from_split"; static const char __pyx_k_fsencoding[] = "fsencoding"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_RWopsIOImpl[] = "RWopsIOImpl"; static const char __pyx_k_from_buffer[] = "from_buffer"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_staticmethod[] = "staticmethod"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_AttributeError[] = "AttributeError"; static const char __pyx_k_Could_not_read[] = "Could not read: {}"; static const char __pyx_k_Could_not_seek[] = "Could not seek: {}"; static const char __pyx_k_RWopsIO___init[] = "RWopsIO.__init__"; static const char __pyx_k_RWopsIO___repr[] = "RWopsIO.__repr__"; static const char __pyx_k_RWopsIO_closed[] = "RWopsIO.closed"; static const char __pyx_k_RWopsIO_fileno[] = "RWopsIO.fileno"; static const char __pyx_k_whence_mapping[] = "whence_mapping"; static const char __pyx_k_Could_not_write[] = "Could not write: {}"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Could_not_open_r[] = "Could not open {!r}: {}"; static const char __pyx_k_RWopsIOImpl_seek[] = "RWopsIOImpl.seek"; static const char __pyx_k_RWopsIOImpl_tell[] = "RWopsIOImpl.tell"; static const char __pyx_k_RWopsIO_readable[] = "RWopsIO.readable"; static const char __pyx_k_RWopsIO_seekable[] = "RWopsIO.seekable"; static const char __pyx_k_RWopsIO_truncate[] = "RWopsIO.truncate"; static const char __pyx_k_RWopsIO_writable[] = "RWopsIO.writable"; static const char __pyx_k_RWopsIOImpl_close[] = "RWopsIOImpl.close"; static const char __pyx_k_RWopsIOImpl_write[] = "RWopsIOImpl.write"; static const char __pyx_k_I_O_on_closed_file[] = "I/O on closed file."; static const char __pyx_k_RWopsIO_from_split[] = "RWopsIO.from_split"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat"; static const char __pyx_k_RWopsIO_from_buffer[] = "RWopsIO.from_buffer"; static const char __pyx_k_Could_not_get_buffer[] = "Could not get buffer."; static const char __pyx_k_RWopsIOImpl_readinto[] = "RWopsIOImpl.readinto"; static const char __pyx_k_pygame_sdl2_rwobject[] = "pygame_sdl2.rwobject"; static const char __pyx_k_RWopsIOImpl_is_closed[] = "RWopsIOImpl.is_closed"; static const char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; static const char __pyx_k_Unknown_value_for_whence[] = "Unknown value for 'whence'"; static const char __pyx_k_RWopsIO_r_base_r_length_r[] = ""; static const char __pyx_k_RWopsIOImpl___reduce_cython[] = "RWopsIOImpl.__reduce_cython__"; static const char __pyx_k_I_O_operation_on_closed_file[] = "I/O operation on closed file."; static const char __pyx_k_src_pygame_sdl2_rwobject_pyx[] = "src/pygame_sdl2/rwobject.pyx"; static const char __pyx_k_RWopsIOImpl___setstate_cython[] = "RWopsIOImpl.__setstate_cython__"; static const char __pyx_k_r_is_not_a_filename_or_file_lik[] = "{!r} is not a filename or file-like object."; static const char __pyx_k_self_ops_cannot_be_converted_to[] = "self.ops cannot be converted to a Python object for pickling"; static const char __pyx_k_Passed_in_object_does_not_suppor[] = "Passed in object does not support buffer protocol"; /* #### Code section: decls ### */ static void __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl___dealloc__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_filelike, PyObject *__pyx_v_mode, PyObject *__pyx_v_base, PyObject *__pyx_v_length, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4close(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6is_closed(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_8seek(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PY_LONG_LONG __pyx_v_offset, PyObject *__pyx_v_whence); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_10tell(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_12readinto(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_14write(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name___get__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_2__set__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_4__del__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base___get__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_2__set__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_4__del__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length___get__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_2__set__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_4__del__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filelike, PyObject *__pyx_v_mode, PyObject *__pyx_v_base, PyObject *__pyx_v_length, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_4closed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_6fileno(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_8readable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_10seekable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_12truncate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_14writable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_16from_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buffer, CYTHON_UNUSED PyObject *__pyx_v_mode, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_18from_split(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_8rwobject_RWopsIOImpl(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl; PyObject *__pyx_n_s_AttributeError; PyObject *__pyx_kp_s_Could_not_get_buffer; PyObject *__pyx_kp_s_Could_not_open_r; PyObject *__pyx_kp_s_Could_not_read; PyObject *__pyx_kp_s_Could_not_seek; PyObject *__pyx_kp_s_Could_not_write; PyObject *__pyx_n_s_IOBase; PyObject *__pyx_n_s_IOError; PyObject *__pyx_kp_s_I_O_on_closed_file; PyObject *__pyx_kp_s_I_O_operation_on_closed_file; PyObject *__pyx_n_s_MemoryError; PyObject *__pyx_n_s_OSError; PyObject *__pyx_kp_s_Passed_in_object_does_not_suppor; PyObject *__pyx_n_s_RWopsIO; PyObject *__pyx_n_s_RWopsIOImpl; PyObject *__pyx_n_s_RWopsIOImpl___reduce_cython; PyObject *__pyx_n_s_RWopsIOImpl___setstate_cython; PyObject *__pyx_n_s_RWopsIOImpl_close; PyObject *__pyx_n_s_RWopsIOImpl_is_closed; PyObject *__pyx_n_s_RWopsIOImpl_readinto; PyObject *__pyx_n_s_RWopsIOImpl_seek; PyObject *__pyx_n_s_RWopsIOImpl_tell; PyObject *__pyx_n_s_RWopsIOImpl_write; PyObject *__pyx_n_s_RWopsIO___init; PyObject *__pyx_n_s_RWopsIO___repr; PyObject *__pyx_n_s_RWopsIO_closed; PyObject *__pyx_n_s_RWopsIO_fileno; PyObject *__pyx_n_s_RWopsIO_from_buffer; PyObject *__pyx_n_s_RWopsIO_from_split; PyObject *__pyx_kp_s_RWopsIO_r; PyObject *__pyx_kp_s_RWopsIO_r_base_r_length_r; PyObject *__pyx_n_s_RWopsIO_readable; PyObject *__pyx_n_s_RWopsIO_seekable; PyObject *__pyx_n_s_RWopsIO_truncate; PyObject *__pyx_n_s_RWopsIO_writable; PyObject *__pyx_n_s_RawIOBase; PyObject *__pyx_n_s_SEEK_CUR; PyObject *__pyx_n_s_SEEK_END; PyObject *__pyx_n_s_SEEK_SET; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_kp_s_Unknown_value_for_whence; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s__39; PyObject *__pyx_kp_u__7; PyObject *__pyx_n_s__8; PyObject *__pyx_n_s_a; PyObject *__pyx_n_s_ascii; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_b; PyObject *__pyx_n_s_base; PyObject *__pyx_n_s_bf; PyObject *__pyx_n_s_buffer; PyObject *__pyx_n_s_bytes; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_close; PyObject *__pyx_n_s_closed; PyObject *__pyx_n_s_decode; PyObject *__pyx_n_s_dict; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_doc; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_file_type; PyObject *__pyx_n_s_filelike; PyObject *__pyx_n_s_fileno; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_from_buffer; PyObject *__pyx_n_s_from_split; PyObject *__pyx_n_s_fsencoding; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_getfilesystemencoding; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_io; PyObject *__pyx_n_s_is_closed; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_length; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_mode; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_n_s_offset; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_property; PyObject *__pyx_n_s_pygame_sdl2_compat; PyObject *__pyx_n_s_pygame_sdl2_rwobject; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_qualname; PyObject *__pyx_kp_s_r_is_not_a_filename_or_file_lik; PyObject *__pyx_n_s_raw; PyObject *__pyx_n_b_rb; PyObject *__pyx_n_s_rb; PyObject *__pyx_n_s_read; PyObject *__pyx_n_s_readable; PyObject *__pyx_n_s_readinto; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_repr; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_rw; PyObject *__pyx_n_s_seek; PyObject *__pyx_n_s_seekable; PyObject *__pyx_n_s_self; PyObject *__pyx_kp_s_self_ops_cannot_be_converted_to; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_sf; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_rwobject_pyx; PyObject *__pyx_n_s_staticmethod; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_sys; PyObject *__pyx_n_s_tell; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_truncate; PyObject *__pyx_n_s_unicode; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_n_s_view; PyObject *__pyx_n_s_whence; PyObject *__pyx_n_s_whence_mapping; PyObject *__pyx_n_s_whence_rw; PyObject *__pyx_n_s_writable; PyObject *__pyx_n_s_write; PyObject *__pyx_int_0; PyObject *__pyx_int_2; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__34; PyObject *__pyx_tuple__36; PyObject *__pyx_tuple__37; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__24; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__38; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl); Py_CLEAR(clear_module_state->__pyx_n_s_AttributeError); Py_CLEAR(clear_module_state->__pyx_kp_s_Could_not_get_buffer); Py_CLEAR(clear_module_state->__pyx_kp_s_Could_not_open_r); Py_CLEAR(clear_module_state->__pyx_kp_s_Could_not_read); Py_CLEAR(clear_module_state->__pyx_kp_s_Could_not_seek); Py_CLEAR(clear_module_state->__pyx_kp_s_Could_not_write); Py_CLEAR(clear_module_state->__pyx_n_s_IOBase); Py_CLEAR(clear_module_state->__pyx_n_s_IOError); Py_CLEAR(clear_module_state->__pyx_kp_s_I_O_on_closed_file); Py_CLEAR(clear_module_state->__pyx_kp_s_I_O_operation_on_closed_file); Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); Py_CLEAR(clear_module_state->__pyx_n_s_OSError); Py_CLEAR(clear_module_state->__pyx_kp_s_Passed_in_object_does_not_suppor); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl_close); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl_is_closed); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl_readinto); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl_seek); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl_tell); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIOImpl_write); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO___init); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO___repr); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_closed); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_fileno); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_from_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_from_split); Py_CLEAR(clear_module_state->__pyx_kp_s_RWopsIO_r); Py_CLEAR(clear_module_state->__pyx_kp_s_RWopsIO_r_base_r_length_r); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_readable); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_seekable); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_truncate); Py_CLEAR(clear_module_state->__pyx_n_s_RWopsIO_writable); Py_CLEAR(clear_module_state->__pyx_n_s_RawIOBase); Py_CLEAR(clear_module_state->__pyx_n_s_SEEK_CUR); Py_CLEAR(clear_module_state->__pyx_n_s_SEEK_END); Py_CLEAR(clear_module_state->__pyx_n_s_SEEK_SET); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_kp_s_Unknown_value_for_whence); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_n_s__39); Py_CLEAR(clear_module_state->__pyx_kp_u__7); Py_CLEAR(clear_module_state->__pyx_n_s__8); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_s_ascii); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_b); Py_CLEAR(clear_module_state->__pyx_n_s_base); Py_CLEAR(clear_module_state->__pyx_n_s_bf); Py_CLEAR(clear_module_state->__pyx_n_s_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_bytes); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_close); Py_CLEAR(clear_module_state->__pyx_n_s_closed); Py_CLEAR(clear_module_state->__pyx_n_s_decode); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_file_type); Py_CLEAR(clear_module_state->__pyx_n_s_filelike); Py_CLEAR(clear_module_state->__pyx_n_s_fileno); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_from_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_from_split); Py_CLEAR(clear_module_state->__pyx_n_s_fsencoding); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_getfilesystemencoding); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_io); Py_CLEAR(clear_module_state->__pyx_n_s_is_closed); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_length); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_mode); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_n_s_offset); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_property); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_compat); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rwobject); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_kp_s_r_is_not_a_filename_or_file_lik); Py_CLEAR(clear_module_state->__pyx_n_s_raw); Py_CLEAR(clear_module_state->__pyx_n_b_rb); Py_CLEAR(clear_module_state->__pyx_n_s_rb); Py_CLEAR(clear_module_state->__pyx_n_s_read); Py_CLEAR(clear_module_state->__pyx_n_s_readable); Py_CLEAR(clear_module_state->__pyx_n_s_readinto); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_repr); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_rw); Py_CLEAR(clear_module_state->__pyx_n_s_seek); Py_CLEAR(clear_module_state->__pyx_n_s_seekable); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_kp_s_self_ops_cannot_be_converted_to); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_sf); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_rwobject_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_staticmethod); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_sys); Py_CLEAR(clear_module_state->__pyx_n_s_tell); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_truncate); Py_CLEAR(clear_module_state->__pyx_n_s_unicode); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_n_s_view); Py_CLEAR(clear_module_state->__pyx_n_s_whence); Py_CLEAR(clear_module_state->__pyx_n_s_whence_mapping); Py_CLEAR(clear_module_state->__pyx_n_s_whence_rw); Py_CLEAR(clear_module_state->__pyx_n_s_writable); Py_CLEAR(clear_module_state->__pyx_n_s_write); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__34); Py_CLEAR(clear_module_state->__pyx_tuple__36); Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__24); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__38); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl); Py_VISIT(traverse_module_state->__pyx_n_s_AttributeError); Py_VISIT(traverse_module_state->__pyx_kp_s_Could_not_get_buffer); Py_VISIT(traverse_module_state->__pyx_kp_s_Could_not_open_r); Py_VISIT(traverse_module_state->__pyx_kp_s_Could_not_read); Py_VISIT(traverse_module_state->__pyx_kp_s_Could_not_seek); Py_VISIT(traverse_module_state->__pyx_kp_s_Could_not_write); Py_VISIT(traverse_module_state->__pyx_n_s_IOBase); Py_VISIT(traverse_module_state->__pyx_n_s_IOError); Py_VISIT(traverse_module_state->__pyx_kp_s_I_O_on_closed_file); Py_VISIT(traverse_module_state->__pyx_kp_s_I_O_operation_on_closed_file); Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); Py_VISIT(traverse_module_state->__pyx_n_s_OSError); Py_VISIT(traverse_module_state->__pyx_kp_s_Passed_in_object_does_not_suppor); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl_close); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl_is_closed); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl_readinto); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl_seek); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl_tell); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIOImpl_write); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO___init); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO___repr); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_closed); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_fileno); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_from_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_from_split); Py_VISIT(traverse_module_state->__pyx_kp_s_RWopsIO_r); Py_VISIT(traverse_module_state->__pyx_kp_s_RWopsIO_r_base_r_length_r); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_readable); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_seekable); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_truncate); Py_VISIT(traverse_module_state->__pyx_n_s_RWopsIO_writable); Py_VISIT(traverse_module_state->__pyx_n_s_RawIOBase); Py_VISIT(traverse_module_state->__pyx_n_s_SEEK_CUR); Py_VISIT(traverse_module_state->__pyx_n_s_SEEK_END); Py_VISIT(traverse_module_state->__pyx_n_s_SEEK_SET); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_kp_s_Unknown_value_for_whence); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_n_s__39); Py_VISIT(traverse_module_state->__pyx_kp_u__7); Py_VISIT(traverse_module_state->__pyx_n_s__8); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_s_ascii); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_b); Py_VISIT(traverse_module_state->__pyx_n_s_base); Py_VISIT(traverse_module_state->__pyx_n_s_bf); Py_VISIT(traverse_module_state->__pyx_n_s_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_bytes); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_close); Py_VISIT(traverse_module_state->__pyx_n_s_closed); Py_VISIT(traverse_module_state->__pyx_n_s_decode); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_file_type); Py_VISIT(traverse_module_state->__pyx_n_s_filelike); Py_VISIT(traverse_module_state->__pyx_n_s_fileno); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_from_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_from_split); Py_VISIT(traverse_module_state->__pyx_n_s_fsencoding); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_getfilesystemencoding); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_io); Py_VISIT(traverse_module_state->__pyx_n_s_is_closed); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_length); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_mode); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_n_s_offset); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_property); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_compat); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rwobject); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_kp_s_r_is_not_a_filename_or_file_lik); Py_VISIT(traverse_module_state->__pyx_n_s_raw); Py_VISIT(traverse_module_state->__pyx_n_b_rb); Py_VISIT(traverse_module_state->__pyx_n_s_rb); Py_VISIT(traverse_module_state->__pyx_n_s_read); Py_VISIT(traverse_module_state->__pyx_n_s_readable); Py_VISIT(traverse_module_state->__pyx_n_s_readinto); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_repr); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_rw); Py_VISIT(traverse_module_state->__pyx_n_s_seek); Py_VISIT(traverse_module_state->__pyx_n_s_seekable); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_kp_s_self_ops_cannot_be_converted_to); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_sf); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_rwobject_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_staticmethod); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_sys); Py_VISIT(traverse_module_state->__pyx_n_s_tell); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_truncate); Py_VISIT(traverse_module_state->__pyx_n_s_unicode); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_n_s_view); Py_VISIT(traverse_module_state->__pyx_n_s_whence); Py_VISIT(traverse_module_state->__pyx_n_s_whence_mapping); Py_VISIT(traverse_module_state->__pyx_n_s_whence_rw); Py_VISIT(traverse_module_state->__pyx_n_s_writable); Py_VISIT(traverse_module_state->__pyx_n_s_write); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__34); Py_VISIT(traverse_module_state->__pyx_tuple__36); Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__24); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__38); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl __pyx_mstate_global->__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl #endif #define __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl #define __pyx_n_s_AttributeError __pyx_mstate_global->__pyx_n_s_AttributeError #define __pyx_kp_s_Could_not_get_buffer __pyx_mstate_global->__pyx_kp_s_Could_not_get_buffer #define __pyx_kp_s_Could_not_open_r __pyx_mstate_global->__pyx_kp_s_Could_not_open_r #define __pyx_kp_s_Could_not_read __pyx_mstate_global->__pyx_kp_s_Could_not_read #define __pyx_kp_s_Could_not_seek __pyx_mstate_global->__pyx_kp_s_Could_not_seek #define __pyx_kp_s_Could_not_write __pyx_mstate_global->__pyx_kp_s_Could_not_write #define __pyx_n_s_IOBase __pyx_mstate_global->__pyx_n_s_IOBase #define __pyx_n_s_IOError __pyx_mstate_global->__pyx_n_s_IOError #define __pyx_kp_s_I_O_on_closed_file __pyx_mstate_global->__pyx_kp_s_I_O_on_closed_file #define __pyx_kp_s_I_O_operation_on_closed_file __pyx_mstate_global->__pyx_kp_s_I_O_operation_on_closed_file #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError #define __pyx_n_s_OSError __pyx_mstate_global->__pyx_n_s_OSError #define __pyx_kp_s_Passed_in_object_does_not_suppor __pyx_mstate_global->__pyx_kp_s_Passed_in_object_does_not_suppor #define __pyx_n_s_RWopsIO __pyx_mstate_global->__pyx_n_s_RWopsIO #define __pyx_n_s_RWopsIOImpl __pyx_mstate_global->__pyx_n_s_RWopsIOImpl #define __pyx_n_s_RWopsIOImpl___reduce_cython __pyx_mstate_global->__pyx_n_s_RWopsIOImpl___reduce_cython #define __pyx_n_s_RWopsIOImpl___setstate_cython __pyx_mstate_global->__pyx_n_s_RWopsIOImpl___setstate_cython #define __pyx_n_s_RWopsIOImpl_close __pyx_mstate_global->__pyx_n_s_RWopsIOImpl_close #define __pyx_n_s_RWopsIOImpl_is_closed __pyx_mstate_global->__pyx_n_s_RWopsIOImpl_is_closed #define __pyx_n_s_RWopsIOImpl_readinto __pyx_mstate_global->__pyx_n_s_RWopsIOImpl_readinto #define __pyx_n_s_RWopsIOImpl_seek __pyx_mstate_global->__pyx_n_s_RWopsIOImpl_seek #define __pyx_n_s_RWopsIOImpl_tell __pyx_mstate_global->__pyx_n_s_RWopsIOImpl_tell #define __pyx_n_s_RWopsIOImpl_write __pyx_mstate_global->__pyx_n_s_RWopsIOImpl_write #define __pyx_n_s_RWopsIO___init __pyx_mstate_global->__pyx_n_s_RWopsIO___init #define __pyx_n_s_RWopsIO___repr __pyx_mstate_global->__pyx_n_s_RWopsIO___repr #define __pyx_n_s_RWopsIO_closed __pyx_mstate_global->__pyx_n_s_RWopsIO_closed #define __pyx_n_s_RWopsIO_fileno __pyx_mstate_global->__pyx_n_s_RWopsIO_fileno #define __pyx_n_s_RWopsIO_from_buffer __pyx_mstate_global->__pyx_n_s_RWopsIO_from_buffer #define __pyx_n_s_RWopsIO_from_split __pyx_mstate_global->__pyx_n_s_RWopsIO_from_split #define __pyx_kp_s_RWopsIO_r __pyx_mstate_global->__pyx_kp_s_RWopsIO_r #define __pyx_kp_s_RWopsIO_r_base_r_length_r __pyx_mstate_global->__pyx_kp_s_RWopsIO_r_base_r_length_r #define __pyx_n_s_RWopsIO_readable __pyx_mstate_global->__pyx_n_s_RWopsIO_readable #define __pyx_n_s_RWopsIO_seekable __pyx_mstate_global->__pyx_n_s_RWopsIO_seekable #define __pyx_n_s_RWopsIO_truncate __pyx_mstate_global->__pyx_n_s_RWopsIO_truncate #define __pyx_n_s_RWopsIO_writable __pyx_mstate_global->__pyx_n_s_RWopsIO_writable #define __pyx_n_s_RawIOBase __pyx_mstate_global->__pyx_n_s_RawIOBase #define __pyx_n_s_SEEK_CUR __pyx_mstate_global->__pyx_n_s_SEEK_CUR #define __pyx_n_s_SEEK_END __pyx_mstate_global->__pyx_n_s_SEEK_END #define __pyx_n_s_SEEK_SET __pyx_mstate_global->__pyx_n_s_SEEK_SET #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_kp_s_Unknown_value_for_whence __pyx_mstate_global->__pyx_kp_s_Unknown_value_for_whence #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_n_s__39 __pyx_mstate_global->__pyx_n_s__39 #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 #define __pyx_n_s__8 __pyx_mstate_global->__pyx_n_s__8 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_n_s_ascii __pyx_mstate_global->__pyx_n_s_ascii #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base #define __pyx_n_s_bf __pyx_mstate_global->__pyx_n_s_bf #define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer #define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close #define __pyx_n_s_closed __pyx_mstate_global->__pyx_n_s_closed #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_file_type __pyx_mstate_global->__pyx_n_s_file_type #define __pyx_n_s_filelike __pyx_mstate_global->__pyx_n_s_filelike #define __pyx_n_s_fileno __pyx_mstate_global->__pyx_n_s_fileno #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_from_buffer __pyx_mstate_global->__pyx_n_s_from_buffer #define __pyx_n_s_from_split __pyx_mstate_global->__pyx_n_s_from_split #define __pyx_n_s_fsencoding __pyx_mstate_global->__pyx_n_s_fsencoding #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_getfilesystemencoding __pyx_mstate_global->__pyx_n_s_getfilesystemencoding #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_io __pyx_mstate_global->__pyx_n_s_io #define __pyx_n_s_is_closed __pyx_mstate_global->__pyx_n_s_is_closed #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_length __pyx_mstate_global->__pyx_n_s_length #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_property __pyx_mstate_global->__pyx_n_s_property #define __pyx_n_s_pygame_sdl2_compat __pyx_mstate_global->__pyx_n_s_pygame_sdl2_compat #define __pyx_n_s_pygame_sdl2_rwobject __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rwobject #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_kp_s_r_is_not_a_filename_or_file_lik __pyx_mstate_global->__pyx_kp_s_r_is_not_a_filename_or_file_lik #define __pyx_n_s_raw __pyx_mstate_global->__pyx_n_s_raw #define __pyx_n_b_rb __pyx_mstate_global->__pyx_n_b_rb #define __pyx_n_s_rb __pyx_mstate_global->__pyx_n_s_rb #define __pyx_n_s_read __pyx_mstate_global->__pyx_n_s_read #define __pyx_n_s_readable __pyx_mstate_global->__pyx_n_s_readable #define __pyx_n_s_readinto __pyx_mstate_global->__pyx_n_s_readinto #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_rw __pyx_mstate_global->__pyx_n_s_rw #define __pyx_n_s_seek __pyx_mstate_global->__pyx_n_s_seek #define __pyx_n_s_seekable __pyx_mstate_global->__pyx_n_s_seekable #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_kp_s_self_ops_cannot_be_converted_to __pyx_mstate_global->__pyx_kp_s_self_ops_cannot_be_converted_to #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_sf __pyx_mstate_global->__pyx_n_s_sf #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_rwobject_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_rwobject_pyx #define __pyx_n_s_staticmethod __pyx_mstate_global->__pyx_n_s_staticmethod #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys #define __pyx_n_s_tell __pyx_mstate_global->__pyx_n_s_tell #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_truncate __pyx_mstate_global->__pyx_n_s_truncate #define __pyx_n_s_unicode __pyx_mstate_global->__pyx_n_s_unicode #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_n_s_view __pyx_mstate_global->__pyx_n_s_view #define __pyx_n_s_whence __pyx_mstate_global->__pyx_n_s_whence #define __pyx_n_s_whence_mapping __pyx_mstate_global->__pyx_n_s_whence_mapping #define __pyx_n_s_whence_rw __pyx_mstate_global->__pyx_n_s_whence_rw #define __pyx_n_s_writable __pyx_mstate_global->__pyx_n_s_writable #define __pyx_n_s_write __pyx_mstate_global->__pyx_n_s_write #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 /* #### Code section: module_code ### */ /* "pygame_sdl2/rwobject.pyx":60 * void init_python_threads() * * cdef set_error(e): # <<<<<<<<<<<<<< * cdef char *msg * e = str(e) */ static PyObject *__pyx_f_11pygame_sdl2_8rwobject_set_error(PyObject *__pyx_v_e) { char *__pyx_v_msg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_error", 0); __Pyx_INCREF(__pyx_v_e); /* "pygame_sdl2/rwobject.pyx":62 * cdef set_error(e): * cdef char *msg * e = str(e) # <<<<<<<<<<<<<< * msg = e * SDL_SetError("%s", msg) */ __pyx_t_1 = __Pyx_PyObject_Str(__pyx_v_e); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_e, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":63 * cdef char *msg * e = str(e) * msg = e # <<<<<<<<<<<<<< * SDL_SetError("%s", msg) * */ __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_e); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_v_msg = ((char *)__pyx_t_2); /* "pygame_sdl2/rwobject.pyx":64 * e = str(e) * msg = e * SDL_SetError("%s", msg) # <<<<<<<<<<<<<< * * cdef Sint64 python_size(SDL_RWops *context) noexcept with gil: */ (void)(SDL_SetError(((char const *)"%s"), __pyx_v_msg)); /* "pygame_sdl2/rwobject.pyx":60 * void init_python_threads() * * cdef set_error(e): # <<<<<<<<<<<<<< * cdef char *msg * e = str(e) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rwobject.set_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_e); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":66 * SDL_SetError("%s", msg) * * cdef Sint64 python_size(SDL_RWops *context) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_size(SDL_RWops *__pyx_v_context) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_cur = NULL; PyObject *__pyx_v_rv = NULL; CYTHON_UNUSED PyObject *__pyx_v_e = NULL; Sint64 __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_t_8; Sint64 __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_size", 0); /* "pygame_sdl2/rwobject.pyx":67 * * cdef Sint64 python_size(SDL_RWops *context) noexcept with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":69 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * cur = f.tell() * f.seek(0, 2) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":70 * * try: * cur = f.tell() # <<<<<<<<<<<<<< * f.seek(0, 2) * rv = f.tell() */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_tell); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_cur = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":71 * try: * cur = f.tell() * f.seek(0, 2) # <<<<<<<<<<<<<< * rv = f.tell() * f.seek(cur, 0) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":72 * cur = f.tell() * f.seek(0, 2) * rv = f.tell() # <<<<<<<<<<<<<< * f.seek(cur, 0) * except Exception as e: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_tell); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_rv = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":73 * f.seek(0, 2) * rv = f.tell() * f.seek(cur, 0) # <<<<<<<<<<<<<< * except Exception as e: * return -1 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_cur, __pyx_int_0}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":69 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * cur = f.tell() * f.seek(0, 2) */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":74 * rv = f.tell() * f.seek(cur, 0) * except Exception as e: # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_size", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_6) < 0) __PYX_ERR(0, 74, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_v_e = __pyx_t_1; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":75 * f.seek(cur, 0) * except Exception as e: * return -1 # <<<<<<<<<<<<<< * * return rv */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L13_return; } /* "pygame_sdl2/rwobject.pyx":74 * rv = f.tell() * f.seek(cur, 0) * except Exception as e: # <<<<<<<<<<<<<< * return -1 * */ /*finally:*/ { __pyx_L13_return: { __pyx_t_9 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; __pyx_r = __pyx_t_9; goto __pyx_L6_except_return; } } } goto __pyx_L5_except_error; /* "pygame_sdl2/rwobject.pyx":69 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * cur = f.tell() * f.seek(0, 2) */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L8_try_end:; } /* "pygame_sdl2/rwobject.pyx":77 * return -1 * * return rv # <<<<<<<<<<<<<< * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept with gil: */ __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_v_rv); if (unlikely((__pyx_t_9 == ((Sint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_r = __pyx_t_9; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":66 * SDL_SetError("%s", msg) * * cdef Sint64 python_size(SDL_RWops *context) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_cur); __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":79 * return rv * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_seek(SDL_RWops *__pyx_v_context, Sint64 __pyx_v_seek, int __pyx_v_whence) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_e = NULL; Sint64 __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; char const *__pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; Sint64 __pyx_t_19; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_seek", 0); /* "pygame_sdl2/rwobject.pyx":80 * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":82 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.seek(seek, whence) * rv = f.tell() */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":83 * * try: * f.seek(seek, whence) # <<<<<<<<<<<<<< * rv = f.tell() * except Exception as e: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_seek); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 83, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_whence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":84 * try: * f.seek(seek, whence) * rv = f.tell() # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_tell); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":82 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.seek(seek, whence) * rv = f.tell() */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pygame_sdl2/rwobject.pyx":85 * f.seek(seek, whence) * rv = f.tell() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_10) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_seek", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 85, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":86 * rv = f.tell() * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":87 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * return rv */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L13_return; } /* "pygame_sdl2/rwobject.pyx":85 * f.seek(seek, whence) * rv = f.tell() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ /*finally:*/ { __pyx_L14_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); } __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; goto __pyx_L5_except_error; } __pyx_L13_return: { __pyx_t_19 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; __pyx_r = __pyx_t_19; goto __pyx_L6_except_return; } } } goto __pyx_L5_except_error; /* "pygame_sdl2/rwobject.pyx":82 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.seek(seek, whence) * rv = f.tell() */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L8_try_end:; } /* "pygame_sdl2/rwobject.pyx":89 * return -1 * * return rv # <<<<<<<<<<<<<< * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept with gil: */ __pyx_t_19 = __Pyx_PyInt_As_int64_t(__pyx_v_rv); if (unlikely((__pyx_t_19 == ((Sint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error) __pyx_r = __pyx_t_19; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":79 * return rv * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_seek", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":91 * return rv * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_read(SDL_RWops *__pyx_v_context, void *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_data = NULL; PyObject *__pyx_v_e = NULL; size_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; char const *__pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; size_t __pyx_t_18; char *__pyx_t_19; Py_ssize_t __pyx_t_20; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_read", 0); /* "pygame_sdl2/rwobject.pyx":92 * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":94 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * data = f.read(size * maxnum) * except Exception as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":95 * * try: * data = f.read(size * maxnum) # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_FromSize_t((__pyx_v_size * __pyx_v_maxnum)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":94 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * data = f.read(size * maxnum) * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":96 * try: * data = f.read(size * maxnum) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_9) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_read", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 96, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":97 * data = f.read(size * maxnum) * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_7 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":98 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * memcpy(ptr, data, len(data)) */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L13_return; } /* "pygame_sdl2/rwobject.pyx":96 * try: * data = f.read(size * maxnum) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ /*finally:*/ { __pyx_L14_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L5_except_error; } __pyx_L13_return: { __pyx_t_18 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; __pyx_r = __pyx_t_18; goto __pyx_L6_except_return; } } } goto __pyx_L5_except_error; /* "pygame_sdl2/rwobject.pyx":94 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * data = f.read(size * maxnum) * except Exception as e: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L8_try_end:; } /* "pygame_sdl2/rwobject.pyx":100 * return -1 * * memcpy(ptr, data, len(data)) # <<<<<<<<<<<<<< * return len(data) * */ __pyx_t_19 = __Pyx_PyObject_AsWritableString(__pyx_v_data); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_20 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_20 == ((Py_ssize_t)-1))) __PYX_ERR(0, 100, __pyx_L1_error) (void)(memcpy(__pyx_v_ptr, ((void *)((char *)__pyx_t_19)), __pyx_t_20)); /* "pygame_sdl2/rwobject.pyx":101 * * memcpy(ptr, data, len(data)) * return len(data) # <<<<<<<<<<<<<< * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) noexcept with gil: */ __pyx_t_20 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_20 == ((Py_ssize_t)-1))) __PYX_ERR(0, 101, __pyx_L1_error) __pyx_r = __pyx_t_20; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":91 * return rv * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":103 * return len(data) * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * data = ( ptr)[:size * maxnum] */ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_write(SDL_RWops *__pyx_v_context, void const *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_data = NULL; PyObject *__pyx_v_e = NULL; size_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; char const *__pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; size_t __pyx_t_18; Py_ssize_t __pyx_t_19; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_write", 0); /* "pygame_sdl2/rwobject.pyx":104 * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) noexcept with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * data = ( ptr)[:size * maxnum] * */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":105 * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) noexcept with gil: * f = context.hidden.unknown.data1 * data = ( ptr)[:size * maxnum] # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_ptr) + 0, (__pyx_v_size * __pyx_v_maxnum) - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":107 * data = ( ptr)[:size * maxnum] * * try: # <<<<<<<<<<<<<< * f.write(data) * except Exception as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":108 * * try: * f.write(data) # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":107 * data = ( ptr)[:size * maxnum] * * try: # <<<<<<<<<<<<<< * f.write(data) * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":109 * try: * f.write(data) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_write", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 109, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":110 * f.write(data) * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_9 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 110, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/rwobject.pyx":111 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * return len(data) */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L13_return; } /* "pygame_sdl2/rwobject.pyx":109 * try: * f.write(data) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ /*finally:*/ { __pyx_L14_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_8 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L5_except_error; } __pyx_L13_return: { __pyx_t_18 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; __pyx_r = __pyx_t_18; goto __pyx_L6_except_return; } } } goto __pyx_L5_except_error; /* "pygame_sdl2/rwobject.pyx":107 * data = ( ptr)[:size * maxnum] * * try: # <<<<<<<<<<<<<< * f.write(data) * except Exception as e: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L8_try_end:; } /* "pygame_sdl2/rwobject.pyx":113 * return -1 * * return len(data) # <<<<<<<<<<<<<< * * cdef int python_close(SDL_RWops *context) noexcept with gil: */ __pyx_t_19 = __Pyx_PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_19 == ((Py_ssize_t)-1))) __PYX_ERR(0, 113, __pyx_L1_error) __pyx_r = __pyx_t_19; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":103 * return len(data) * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) noexcept with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * data = ( ptr)[:size * maxnum] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_write", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":115 * return len(data) * * cdef int python_close(SDL_RWops *context) noexcept with gil: # <<<<<<<<<<<<<< * if context != NULL: * if context.hidden.unknown.data1 != NULL: */ static int __pyx_f_11pygame_sdl2_8rwobject_python_close(SDL_RWops *__pyx_v_context) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_e = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; char const *__pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_close", 0); /* "pygame_sdl2/rwobject.pyx":116 * * cdef int python_close(SDL_RWops *context) noexcept with gil: * if context != NULL: # <<<<<<<<<<<<<< * if context.hidden.unknown.data1 != NULL: * f = context.hidden.unknown.data1 */ __pyx_t_1 = (__pyx_v_context != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":117 * cdef int python_close(SDL_RWops *context) noexcept with gil: * if context != NULL: * if context.hidden.unknown.data1 != NULL: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ __pyx_t_1 = (__pyx_v_context->hidden.unknown.data1 != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":118 * if context != NULL: * if context.hidden.unknown.data1 != NULL: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_2); __pyx_v_f = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":120 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.close() * except Exception as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":121 * * try: * f.close() # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":120 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.close() * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L10_try_end; __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":122 * try: * f.close() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_9) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_close", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 122, __pyx_L7_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_v_e = __pyx_t_6; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":123 * f.close() * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_10 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 123, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "pygame_sdl2/rwobject.pyx":124 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * Py_DECREF(f) */ __pyx_r = -1; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L15_return; } /* "pygame_sdl2/rwobject.pyx":122 * try: * f.close() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ /*finally:*/ { __pyx_L16_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __pyx_t_9 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); } __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; goto __pyx_L7_except_error; } __pyx_L15_return: { __pyx_t_11 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; __pyx_r = __pyx_t_11; goto __pyx_L8_except_return; } } } goto __pyx_L7_except_error; /* "pygame_sdl2/rwobject.pyx":120 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.close() * except Exception as e: */ __pyx_L7_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L8_except_return:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; __pyx_L10_try_end:; } /* "pygame_sdl2/rwobject.pyx":126 * return -1 * * Py_DECREF(f) # <<<<<<<<<<<<<< * * context.hidden.unknown.data1 = NULL */ Py_DECREF(__pyx_v_f); /* "pygame_sdl2/rwobject.pyx":128 * Py_DECREF(f) * * context.hidden.unknown.data1 = NULL # <<<<<<<<<<<<<< * SDL_FreeRW(context) * return 0 */ __pyx_v_context->hidden.unknown.data1 = NULL; /* "pygame_sdl2/rwobject.pyx":117 * cdef int python_close(SDL_RWops *context) noexcept with gil: * if context != NULL: * if context.hidden.unknown.data1 != NULL: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ } /* "pygame_sdl2/rwobject.pyx":129 * * context.hidden.unknown.data1 = NULL * SDL_FreeRW(context) # <<<<<<<<<<<<<< * return 0 * */ SDL_FreeRW(__pyx_v_context); /* "pygame_sdl2/rwobject.pyx":116 * * cdef int python_close(SDL_RWops *context) noexcept with gil: * if context != NULL: # <<<<<<<<<<<<<< * if context.hidden.unknown.data1 != NULL: * f = context.hidden.unknown.data1 */ } /* "pygame_sdl2/rwobject.pyx":130 * context.hidden.unknown.data1 = NULL * SDL_FreeRW(context) * return 0 # <<<<<<<<<<<<<< * * cdef struct SubFile: */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":115 * return len(data) * * cdef int python_close(SDL_RWops *context) noexcept with gil: # <<<<<<<<<<<<<< * if context != NULL: * if context.hidden.unknown.data1 != NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_close", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":138 * Sint64 tell * * cdef Sint64 subfile_size(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * return sf.length */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_size(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; Sint64 __pyx_r; /* "pygame_sdl2/rwobject.pyx":139 * * cdef Sint64 subfile_size(SDL_RWops *context) noexcept nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * return sf.length * */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":140 * cdef Sint64 subfile_size(SDL_RWops *context) noexcept nogil: * cdef SubFile *sf = context.hidden.unknown.data1 * return sf.length # <<<<<<<<<<<<<< * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: */ __pyx_r = __pyx_v_sf->length; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":138 * Sint64 tell * * cdef Sint64 subfile_size(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * return sf.length */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":142 * return sf.length * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_seek(SDL_RWops *__pyx_v_context, Sint64 __pyx_v_seek, int __pyx_v_whence) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; Sint64 __pyx_r; /* "pygame_sdl2/rwobject.pyx":143 * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * if whence == RW_SEEK_SET: */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":145 * cdef SubFile *sf = context.hidden.unknown.data1 * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: */ switch (__pyx_v_whence) { case RW_SEEK_SET: /* "pygame_sdl2/rwobject.pyx":146 * * if whence == RW_SEEK_SET: * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base # <<<<<<<<<<<<<< * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base */ __pyx_v_sf->tell = (SDL_RWseek(__pyx_v_sf->rw, (__pyx_v_seek + __pyx_v_sf->base), RW_SEEK_SET) - __pyx_v_sf->base); /* "pygame_sdl2/rwobject.pyx":145 * cdef SubFile *sf = context.hidden.unknown.data1 * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: */ break; case RW_SEEK_CUR: /* "pygame_sdl2/rwobject.pyx":148 * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base # <<<<<<<<<<<<<< * elif whence == RW_SEEK_END: * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base */ __pyx_v_sf->tell = (SDL_RWseek(__pyx_v_sf->rw, __pyx_v_seek, RW_SEEK_CUR) - __pyx_v_sf->base); /* "pygame_sdl2/rwobject.pyx":147 * if whence == RW_SEEK_SET: * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: */ break; case RW_SEEK_END: /* "pygame_sdl2/rwobject.pyx":150 * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base # <<<<<<<<<<<<<< * * return sf.tell */ __pyx_v_sf->tell = (SDL_RWseek(__pyx_v_sf->rw, ((__pyx_v_sf->base + __pyx_v_sf->length) + __pyx_v_seek), RW_SEEK_SET) - __pyx_v_sf->base); /* "pygame_sdl2/rwobject.pyx":149 * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base * */ break; default: break; } /* "pygame_sdl2/rwobject.pyx":152 * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base * * return sf.tell # <<<<<<<<<<<<<< * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: */ __pyx_r = __pyx_v_sf->tell; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":142 * return sf.length * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":154 * return sf.tell * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ static size_t __pyx_f_11pygame_sdl2_8rwobject_subfile_read(SDL_RWops *__pyx_v_context, void *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; Sint64 __pyx_v_left; size_t __pyx_v_rv; size_t __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "pygame_sdl2/rwobject.pyx":155 * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * cdef Sint64 left = sf.length - sf.tell */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":157 * cdef SubFile *sf = context.hidden.unknown.data1 * * cdef Sint64 left = sf.length - sf.tell # <<<<<<<<<<<<<< * cdef size_t rv * */ __pyx_v_left = (__pyx_v_sf->length - __pyx_v_sf->tell); /* "pygame_sdl2/rwobject.pyx":160 * cdef size_t rv * * if size * maxnum > left: # <<<<<<<<<<<<<< * maxnum = left // size * */ __pyx_t_1 = ((__pyx_v_size * __pyx_v_maxnum) > __pyx_v_left); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":161 * * if size * maxnum > left: * maxnum = left // size # <<<<<<<<<<<<<< * * if maxnum == 0: */ if (unlikely(__pyx_v_size == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 161, __pyx_L1_error) } __pyx_v_maxnum = (__pyx_v_left / __pyx_v_size); /* "pygame_sdl2/rwobject.pyx":160 * cdef size_t rv * * if size * maxnum > left: # <<<<<<<<<<<<<< * maxnum = left // size * */ } /* "pygame_sdl2/rwobject.pyx":163 * maxnum = left // size * * if maxnum == 0: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = (__pyx_v_maxnum == 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":164 * * if maxnum == 0: * return 0 # <<<<<<<<<<<<<< * * rv = SDL_RWread(sf.rw, ptr, size, maxnum) */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":163 * maxnum = left // size * * if maxnum == 0: # <<<<<<<<<<<<<< * return 0 * */ } /* "pygame_sdl2/rwobject.pyx":166 * return 0 * * rv = SDL_RWread(sf.rw, ptr, size, maxnum) # <<<<<<<<<<<<<< * * if rv > 0: */ __pyx_v_rv = SDL_RWread(__pyx_v_sf->rw, __pyx_v_ptr, __pyx_v_size, __pyx_v_maxnum); /* "pygame_sdl2/rwobject.pyx":168 * rv = SDL_RWread(sf.rw, ptr, size, maxnum) * * if rv > 0: # <<<<<<<<<<<<<< * sf.tell += size * rv * */ __pyx_t_1 = (__pyx_v_rv > 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":169 * * if rv > 0: * sf.tell += size * rv # <<<<<<<<<<<<<< * * return rv */ __pyx_v_sf->tell = (__pyx_v_sf->tell + (__pyx_v_size * __pyx_v_rv)); /* "pygame_sdl2/rwobject.pyx":168 * rv = SDL_RWread(sf.rw, ptr, size, maxnum) * * if rv > 0: # <<<<<<<<<<<<<< * sf.tell += size * rv * */ } /* "pygame_sdl2/rwobject.pyx":171 * sf.tell += size * rv * * return rv # <<<<<<<<<<<<<< * * cdef int subfile_close(SDL_RWops *context) noexcept nogil: */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":154 * return sf.tell * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_WriteUnraisable("pygame_sdl2.rwobject.subfile_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":173 * return rv * * cdef int subfile_close(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf * */ static int __pyx_f_11pygame_sdl2_8rwobject_subfile_close(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; int __pyx_r; int __pyx_t_1; /* "pygame_sdl2/rwobject.pyx":176 * cdef SubFile *sf * * if context != NULL: # <<<<<<<<<<<<<< * sf = context.hidden.unknown.data1 * if sf.rw != NULL: */ __pyx_t_1 = (__pyx_v_context != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":177 * * if context != NULL: * sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * if sf.rw != NULL: * SDL_RWclose(sf.rw) */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":178 * if context != NULL: * sf = context.hidden.unknown.data1 * if sf.rw != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(sf.rw) * if sf != NULL: */ __pyx_t_1 = (__pyx_v_sf->rw != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":179 * sf = context.hidden.unknown.data1 * if sf.rw != NULL: * SDL_RWclose(sf.rw) # <<<<<<<<<<<<<< * if sf != NULL: * free(sf) */ (void)(SDL_RWclose(__pyx_v_sf->rw)); /* "pygame_sdl2/rwobject.pyx":178 * if context != NULL: * sf = context.hidden.unknown.data1 * if sf.rw != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(sf.rw) * if sf != NULL: */ } /* "pygame_sdl2/rwobject.pyx":180 * if sf.rw != NULL: * SDL_RWclose(sf.rw) * if sf != NULL: # <<<<<<<<<<<<<< * free(sf) * context.hidden.unknown.data1 = NULL */ __pyx_t_1 = (__pyx_v_sf != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":181 * SDL_RWclose(sf.rw) * if sf != NULL: * free(sf) # <<<<<<<<<<<<<< * context.hidden.unknown.data1 = NULL * SDL_FreeRW(context) */ free(__pyx_v_sf); /* "pygame_sdl2/rwobject.pyx":182 * if sf != NULL: * free(sf) * context.hidden.unknown.data1 = NULL # <<<<<<<<<<<<<< * SDL_FreeRW(context) * */ __pyx_v_context->hidden.unknown.data1 = NULL; /* "pygame_sdl2/rwobject.pyx":180 * if sf.rw != NULL: * SDL_RWclose(sf.rw) * if sf != NULL: # <<<<<<<<<<<<<< * free(sf) * context.hidden.unknown.data1 = NULL */ } /* "pygame_sdl2/rwobject.pyx":183 * free(sf) * context.hidden.unknown.data1 = NULL * SDL_FreeRW(context) # <<<<<<<<<<<<<< * * return 0 */ SDL_FreeRW(__pyx_v_context); /* "pygame_sdl2/rwobject.pyx":176 * cdef SubFile *sf * * if context != NULL: # <<<<<<<<<<<<<< * sf = context.hidden.unknown.data1 * if sf.rw != NULL: */ } /* "pygame_sdl2/rwobject.pyx":185 * SDL_FreeRW(context) * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":173 * return rv * * cdef int subfile_close(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":194 * Sint64 tell * * cdef Sint64 splitfile_size(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 rv */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_splitfile_size(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *__pyx_v_sf; Sint64 __pyx_r; /* "pygame_sdl2/rwobject.pyx":195 * * cdef Sint64 splitfile_size(SDL_RWops *context) noexcept nogil: * cdef SplitFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * cdef Sint64 rv * */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":198 * cdef Sint64 rv * * return SDL_RWsize(sf.a) + SDL_RWsize(sf.b) # <<<<<<<<<<<<<< * * cdef Sint64 splitfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: */ __pyx_r = (SDL_RWsize(__pyx_v_sf->a) + SDL_RWsize(__pyx_v_sf->b)); goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":194 * Sint64 tell * * cdef Sint64 splitfile_size(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 rv */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":200 * return SDL_RWsize(sf.a) + SDL_RWsize(sf.b) * * cdef Sint64 splitfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 rv */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_splitfile_seek(SDL_RWops *__pyx_v_context, Sint64 __pyx_v_seek, int __pyx_v_whence) { struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *__pyx_v_sf; Sint64 __pyx_v_rv; Sint64 __pyx_r; int __pyx_t_1; /* "pygame_sdl2/rwobject.pyx":201 * * cdef Sint64 splitfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: * cdef SplitFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * cdef Sint64 rv * */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":204 * cdef Sint64 rv * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * sf.tell = seek * elif whence == RW_SEEK_CUR: */ switch (__pyx_v_whence) { case RW_SEEK_SET: /* "pygame_sdl2/rwobject.pyx":205 * * if whence == RW_SEEK_SET: * sf.tell = seek # <<<<<<<<<<<<<< * elif whence == RW_SEEK_CUR: * sf.tell += seek */ __pyx_v_sf->tell = __pyx_v_seek; /* "pygame_sdl2/rwobject.pyx":204 * cdef Sint64 rv * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * sf.tell = seek * elif whence == RW_SEEK_CUR: */ break; case RW_SEEK_CUR: /* "pygame_sdl2/rwobject.pyx":207 * sf.tell = seek * elif whence == RW_SEEK_CUR: * sf.tell += seek # <<<<<<<<<<<<<< * elif whence == RW_SEEK_END: * sf.tell = splitfile_size(context) + seek */ __pyx_v_sf->tell = (__pyx_v_sf->tell + __pyx_v_seek); /* "pygame_sdl2/rwobject.pyx":206 * if whence == RW_SEEK_SET: * sf.tell = seek * elif whence == RW_SEEK_CUR: # <<<<<<<<<<<<<< * sf.tell += seek * elif whence == RW_SEEK_END: */ break; case RW_SEEK_END: /* "pygame_sdl2/rwobject.pyx":209 * sf.tell += seek * elif whence == RW_SEEK_END: * sf.tell = splitfile_size(context) + seek # <<<<<<<<<<<<<< * * if sf.tell < sf.split: */ __pyx_v_sf->tell = (__pyx_f_11pygame_sdl2_8rwobject_splitfile_size(__pyx_v_context) + __pyx_v_seek); /* "pygame_sdl2/rwobject.pyx":208 * elif whence == RW_SEEK_CUR: * sf.tell += seek * elif whence == RW_SEEK_END: # <<<<<<<<<<<<<< * sf.tell = splitfile_size(context) + seek * */ break; default: break; } /* "pygame_sdl2/rwobject.pyx":211 * sf.tell = splitfile_size(context) + seek * * if sf.tell < sf.split: # <<<<<<<<<<<<<< * rv = SDL_RWseek(sf.a, sf.tell, RW_SEEK_SET) * SDL_RWseek(sf.b, 0, RW_SEEK_SET) */ __pyx_t_1 = (__pyx_v_sf->tell < __pyx_v_sf->split); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":212 * * if sf.tell < sf.split: * rv = SDL_RWseek(sf.a, sf.tell, RW_SEEK_SET) # <<<<<<<<<<<<<< * SDL_RWseek(sf.b, 0, RW_SEEK_SET) * else: */ __pyx_v_rv = SDL_RWseek(__pyx_v_sf->a, __pyx_v_sf->tell, RW_SEEK_SET); /* "pygame_sdl2/rwobject.pyx":213 * if sf.tell < sf.split: * rv = SDL_RWseek(sf.a, sf.tell, RW_SEEK_SET) * SDL_RWseek(sf.b, 0, RW_SEEK_SET) # <<<<<<<<<<<<<< * else: * SDL_RWseek(sf.a, sf.split, RW_SEEK_SET) */ (void)(SDL_RWseek(__pyx_v_sf->b, 0, RW_SEEK_SET)); /* "pygame_sdl2/rwobject.pyx":211 * sf.tell = splitfile_size(context) + seek * * if sf.tell < sf.split: # <<<<<<<<<<<<<< * rv = SDL_RWseek(sf.a, sf.tell, RW_SEEK_SET) * SDL_RWseek(sf.b, 0, RW_SEEK_SET) */ goto __pyx_L3; } /* "pygame_sdl2/rwobject.pyx":215 * SDL_RWseek(sf.b, 0, RW_SEEK_SET) * else: * SDL_RWseek(sf.a, sf.split, RW_SEEK_SET) # <<<<<<<<<<<<<< * rv = SDL_RWseek(sf.b, sf.tell - sf.split, RW_SEEK_SET) * */ /*else*/ { (void)(SDL_RWseek(__pyx_v_sf->a, __pyx_v_sf->split, RW_SEEK_SET)); /* "pygame_sdl2/rwobject.pyx":216 * else: * SDL_RWseek(sf.a, sf.split, RW_SEEK_SET) * rv = SDL_RWseek(sf.b, sf.tell - sf.split, RW_SEEK_SET) # <<<<<<<<<<<<<< * * if rv < 0: */ __pyx_v_rv = SDL_RWseek(__pyx_v_sf->b, (__pyx_v_sf->tell - __pyx_v_sf->split), RW_SEEK_SET); } __pyx_L3:; /* "pygame_sdl2/rwobject.pyx":218 * rv = SDL_RWseek(sf.b, sf.tell - sf.split, RW_SEEK_SET) * * if rv < 0: # <<<<<<<<<<<<<< * return rv * else: */ __pyx_t_1 = (__pyx_v_rv < 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":219 * * if rv < 0: * return rv # <<<<<<<<<<<<<< * else: * return sf.tell */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":218 * rv = SDL_RWseek(sf.b, sf.tell - sf.split, RW_SEEK_SET) * * if rv < 0: # <<<<<<<<<<<<<< * return rv * else: */ } /* "pygame_sdl2/rwobject.pyx":221 * return rv * else: * return sf.tell # <<<<<<<<<<<<<< * * cdef size_t splitfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: */ /*else*/ { __pyx_r = __pyx_v_sf->tell; goto __pyx_L0; } /* "pygame_sdl2/rwobject.pyx":200 * return SDL_RWsize(sf.a) + SDL_RWsize(sf.b) * * cdef Sint64 splitfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 rv */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":223 * return sf.tell * * cdef size_t splitfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 left = splitfile_size(context) - sf.tell */ static size_t __pyx_f_11pygame_sdl2_8rwobject_splitfile_read(SDL_RWops *__pyx_v_context, void *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *__pyx_v_sf; CYTHON_UNUSED Sint64 __pyx_v_left; size_t __pyx_v_total_read; size_t __pyx_v_left_read; size_t __pyx_v_right_read; size_t __pyx_r; Sint64 __pyx_t_1; size_t __pyx_t_2; size_t __pyx_t_3; int __pyx_t_4; long __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "pygame_sdl2/rwobject.pyx":224 * * cdef size_t splitfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: * cdef SplitFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * cdef Sint64 left = splitfile_size(context) - sf.tell * cdef size_t rv */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":225 * cdef size_t splitfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 left = splitfile_size(context) - sf.tell # <<<<<<<<<<<<<< * cdef size_t rv * */ __pyx_v_left = (__pyx_f_11pygame_sdl2_8rwobject_splitfile_size(__pyx_v_context) - __pyx_v_sf->tell); /* "pygame_sdl2/rwobject.pyx":233 * cdef size_t ret * * total_read = size * maxnum # <<<<<<<<<<<<<< * * left_read = min(total_read, sf.split - sf.tell) */ __pyx_v_total_read = (__pyx_v_size * __pyx_v_maxnum); /* "pygame_sdl2/rwobject.pyx":235 * total_read = size * maxnum * * left_read = min(total_read, sf.split - sf.tell) # <<<<<<<<<<<<<< * left_read = max(left_read, 0) * */ __pyx_t_1 = (__pyx_v_sf->split - __pyx_v_sf->tell); __pyx_t_2 = __pyx_v_total_read; __pyx_t_4 = (__pyx_t_1 < __pyx_t_2); if (__pyx_t_4) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_left_read = __pyx_t_3; /* "pygame_sdl2/rwobject.pyx":236 * * left_read = min(total_read, sf.split - sf.tell) * left_read = max(left_read, 0) # <<<<<<<<<<<<<< * * if left_read > 0: */ __pyx_t_5 = 0; __pyx_t_3 = __pyx_v_left_read; __pyx_t_4 = (__pyx_t_5 > __pyx_t_3); if (__pyx_t_4) { __pyx_t_2 = __pyx_t_5; } else { __pyx_t_2 = __pyx_t_3; } __pyx_v_left_read = __pyx_t_2; /* "pygame_sdl2/rwobject.pyx":238 * left_read = max(left_read, 0) * * if left_read > 0: # <<<<<<<<<<<<<< * left_read = SDL_RWread(sf.a, ptr, 1, left_read) * if left_read < 0: */ __pyx_t_4 = (__pyx_v_left_read > 0); if (__pyx_t_4) { /* "pygame_sdl2/rwobject.pyx":239 * * if left_read > 0: * left_read = SDL_RWread(sf.a, ptr, 1, left_read) # <<<<<<<<<<<<<< * if left_read < 0: * return left_read */ __pyx_v_left_read = SDL_RWread(__pyx_v_sf->a, __pyx_v_ptr, 1, __pyx_v_left_read); /* "pygame_sdl2/rwobject.pyx":240 * if left_read > 0: * left_read = SDL_RWread(sf.a, ptr, 1, left_read) * if left_read < 0: # <<<<<<<<<<<<<< * return left_read * */ __pyx_t_4 = (__pyx_v_left_read < 0); if (__pyx_t_4) { /* "pygame_sdl2/rwobject.pyx":241 * left_read = SDL_RWread(sf.a, ptr, 1, left_read) * if left_read < 0: * return left_read # <<<<<<<<<<<<<< * * right_read = total_read - left_read */ __pyx_r = __pyx_v_left_read; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":240 * if left_read > 0: * left_read = SDL_RWread(sf.a, ptr, 1, left_read) * if left_read < 0: # <<<<<<<<<<<<<< * return left_read * */ } /* "pygame_sdl2/rwobject.pyx":238 * left_read = max(left_read, 0) * * if left_read > 0: # <<<<<<<<<<<<<< * left_read = SDL_RWread(sf.a, ptr, 1, left_read) * if left_read < 0: */ } /* "pygame_sdl2/rwobject.pyx":243 * return left_read * * right_read = total_read - left_read # <<<<<<<<<<<<<< * * if right_read > 0: */ __pyx_v_right_read = (__pyx_v_total_read - __pyx_v_left_read); /* "pygame_sdl2/rwobject.pyx":245 * right_read = total_read - left_read * * if right_read > 0: # <<<<<<<<<<<<<< * right_read = SDL_RWread(sf.b, ptr + left_read, 1, right_read) * if right_read < 0: */ __pyx_t_4 = (__pyx_v_right_read > 0); if (__pyx_t_4) { /* "pygame_sdl2/rwobject.pyx":246 * * if right_read > 0: * right_read = SDL_RWread(sf.b, ptr + left_read, 1, right_read) # <<<<<<<<<<<<<< * if right_read < 0: * return right_read */ __pyx_v_right_read = SDL_RWread(__pyx_v_sf->b, (((char *)__pyx_v_ptr) + __pyx_v_left_read), 1, __pyx_v_right_read); /* "pygame_sdl2/rwobject.pyx":247 * if right_read > 0: * right_read = SDL_RWread(sf.b, ptr + left_read, 1, right_read) * if right_read < 0: # <<<<<<<<<<<<<< * return right_read * */ __pyx_t_4 = (__pyx_v_right_read < 0); if (__pyx_t_4) { /* "pygame_sdl2/rwobject.pyx":248 * right_read = SDL_RWread(sf.b, ptr + left_read, 1, right_read) * if right_read < 0: * return right_read # <<<<<<<<<<<<<< * * sf.tell += left_read + right_read */ __pyx_r = __pyx_v_right_read; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":247 * if right_read > 0: * right_read = SDL_RWread(sf.b, ptr + left_read, 1, right_read) * if right_read < 0: # <<<<<<<<<<<<<< * return right_read * */ } /* "pygame_sdl2/rwobject.pyx":245 * right_read = total_read - left_read * * if right_read > 0: # <<<<<<<<<<<<<< * right_read = SDL_RWread(sf.b, ptr + left_read, 1, right_read) * if right_read < 0: */ } /* "pygame_sdl2/rwobject.pyx":250 * return right_read * * sf.tell += left_read + right_read # <<<<<<<<<<<<<< * * return (left_read + right_read) // size */ __pyx_v_sf->tell = (__pyx_v_sf->tell + (__pyx_v_left_read + __pyx_v_right_read)); /* "pygame_sdl2/rwobject.pyx":252 * sf.tell += left_read + right_read * * return (left_read + right_read) // size # <<<<<<<<<<<<<< * * cdef int splitfile_close(SDL_RWops *context) noexcept nogil: */ __pyx_t_2 = (__pyx_v_left_read + __pyx_v_right_read); if (unlikely(__pyx_v_size == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 252, __pyx_L1_error) } __pyx_r = (__pyx_t_2 / __pyx_v_size); goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":223 * return sf.tell * * cdef size_t splitfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf = context.hidden.unknown.data1 * cdef Sint64 left = splitfile_size(context) - sf.tell */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_WriteUnraisable("pygame_sdl2.rwobject.splitfile_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":254 * return (left_read + right_read) // size * * cdef int splitfile_close(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf * */ static int __pyx_f_11pygame_sdl2_8rwobject_splitfile_close(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *__pyx_v_sf; int __pyx_r; int __pyx_t_1; /* "pygame_sdl2/rwobject.pyx":257 * cdef SplitFile *sf * * if context != NULL: # <<<<<<<<<<<<<< * sf = context.hidden.unknown.data1 * if sf.a != NULL: */ __pyx_t_1 = (__pyx_v_context != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":258 * * if context != NULL: * sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * if sf.a != NULL: * SDL_RWclose(sf.a) */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":259 * if context != NULL: * sf = context.hidden.unknown.data1 * if sf.a != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(sf.a) * if sf.b != NULL: */ __pyx_t_1 = (__pyx_v_sf->a != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":260 * sf = context.hidden.unknown.data1 * if sf.a != NULL: * SDL_RWclose(sf.a) # <<<<<<<<<<<<<< * if sf.b != NULL: * SDL_RWclose(sf.b) */ (void)(SDL_RWclose(__pyx_v_sf->a)); /* "pygame_sdl2/rwobject.pyx":259 * if context != NULL: * sf = context.hidden.unknown.data1 * if sf.a != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(sf.a) * if sf.b != NULL: */ } /* "pygame_sdl2/rwobject.pyx":261 * if sf.a != NULL: * SDL_RWclose(sf.a) * if sf.b != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(sf.b) * if sf != NULL: */ __pyx_t_1 = (__pyx_v_sf->b != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":262 * SDL_RWclose(sf.a) * if sf.b != NULL: * SDL_RWclose(sf.b) # <<<<<<<<<<<<<< * if sf != NULL: * free(sf) */ (void)(SDL_RWclose(__pyx_v_sf->b)); /* "pygame_sdl2/rwobject.pyx":261 * if sf.a != NULL: * SDL_RWclose(sf.a) * if sf.b != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(sf.b) * if sf != NULL: */ } /* "pygame_sdl2/rwobject.pyx":263 * if sf.b != NULL: * SDL_RWclose(sf.b) * if sf != NULL: # <<<<<<<<<<<<<< * free(sf) * context.hidden.unknown.data1 = NULL */ __pyx_t_1 = (__pyx_v_sf != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":264 * SDL_RWclose(sf.b) * if sf != NULL: * free(sf) # <<<<<<<<<<<<<< * context.hidden.unknown.data1 = NULL * SDL_FreeRW(context) */ free(__pyx_v_sf); /* "pygame_sdl2/rwobject.pyx":265 * if sf != NULL: * free(sf) * context.hidden.unknown.data1 = NULL # <<<<<<<<<<<<<< * SDL_FreeRW(context) * */ __pyx_v_context->hidden.unknown.data1 = NULL; /* "pygame_sdl2/rwobject.pyx":263 * if sf.b != NULL: * SDL_RWclose(sf.b) * if sf != NULL: # <<<<<<<<<<<<<< * free(sf) * context.hidden.unknown.data1 = NULL */ } /* "pygame_sdl2/rwobject.pyx":266 * free(sf) * context.hidden.unknown.data1 = NULL * SDL_FreeRW(context) # <<<<<<<<<<<<<< * * return 0 */ SDL_FreeRW(__pyx_v_context); /* "pygame_sdl2/rwobject.pyx":257 * cdef SplitFile *sf * * if context != NULL: # <<<<<<<<<<<<<< * sf = context.hidden.unknown.data1 * if sf.a != NULL: */ } /* "pygame_sdl2/rwobject.pyx":268 * SDL_FreeRW(context) * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":254 * return (left_read + right_read) // size * * cdef int splitfile_close(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef SplitFile *sf * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":277 * Uint8 *stop * * cdef Sint64 buffile_size(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_buffile_size(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *__pyx_v_bf; Sint64 __pyx_r; /* "pygame_sdl2/rwobject.pyx":278 * * cdef Sint64 buffile_size(SDL_RWops *context) noexcept nogil: * cdef BufFile *bf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * return bf.stop - bf.base */ __pyx_v_bf = ((struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":280 * cdef BufFile *bf = context.hidden.unknown.data1 * * return bf.stop - bf.base # <<<<<<<<<<<<<< * * cdef Sint64 buffile_seek(SDL_RWops *context, Sint64 offset, int whence) noexcept nogil: */ __pyx_r = (__pyx_v_bf->stop - __pyx_v_bf->base); goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":277 * Uint8 *stop * * cdef Sint64 buffile_size(SDL_RWops *context) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":282 * return bf.stop - bf.base * * cdef Sint64 buffile_seek(SDL_RWops *context, Sint64 offset, int whence) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_buffile_seek(SDL_RWops *__pyx_v_context, Sint64 __pyx_v_offset, int __pyx_v_whence) { struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *__pyx_v_bf; Uint8 *__pyx_v_newpos; Sint64 __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Uint8 *__pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif __Pyx_RefNannySetupContext("buffile_seek", 1); /* "pygame_sdl2/rwobject.pyx":283 * * cdef Sint64 buffile_seek(SDL_RWops *context, Sint64 offset, int whence) noexcept nogil: * cdef BufFile *bf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * cdef Uint8 *newpos */ __pyx_v_bf = ((struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":287 * cdef Uint8 *newpos * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * newpos = bf.base + offset * elif whence == RW_SEEK_CUR: */ switch (__pyx_v_whence) { case RW_SEEK_SET: /* "pygame_sdl2/rwobject.pyx":288 * * if whence == RW_SEEK_SET: * newpos = bf.base + offset # <<<<<<<<<<<<<< * elif whence == RW_SEEK_CUR: * newpos = bf.here + offset */ __pyx_v_newpos = (__pyx_v_bf->base + __pyx_v_offset); /* "pygame_sdl2/rwobject.pyx":287 * cdef Uint8 *newpos * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * newpos = bf.base + offset * elif whence == RW_SEEK_CUR: */ break; case RW_SEEK_CUR: /* "pygame_sdl2/rwobject.pyx":290 * newpos = bf.base + offset * elif whence == RW_SEEK_CUR: * newpos = bf.here + offset # <<<<<<<<<<<<<< * elif whence == RW_SEEK_END: * newpos = bf.stop + offset */ __pyx_v_newpos = (__pyx_v_bf->here + __pyx_v_offset); /* "pygame_sdl2/rwobject.pyx":289 * if whence == RW_SEEK_SET: * newpos = bf.base + offset * elif whence == RW_SEEK_CUR: # <<<<<<<<<<<<<< * newpos = bf.here + offset * elif whence == RW_SEEK_END: */ break; case RW_SEEK_END: /* "pygame_sdl2/rwobject.pyx":292 * newpos = bf.here + offset * elif whence == RW_SEEK_END: * newpos = bf.stop + offset # <<<<<<<<<<<<<< * else: * with gil: */ __pyx_v_newpos = (__pyx_v_bf->stop + __pyx_v_offset); /* "pygame_sdl2/rwobject.pyx":291 * elif whence == RW_SEEK_CUR: * newpos = bf.here + offset * elif whence == RW_SEEK_END: # <<<<<<<<<<<<<< * newpos = bf.stop + offset * else: */ break; default: /* "pygame_sdl2/rwobject.pyx":294 * newpos = bf.stop + offset * else: * with gil: # <<<<<<<<<<<<<< * set_error("Unknown value for 'whence'") * return -1 */ { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":295 * else: * with gil: * set_error("Unknown value for 'whence'") # <<<<<<<<<<<<<< * return -1 * if newpos < bf.base: */ __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_kp_s_Unknown_value_for_whence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "pygame_sdl2/rwobject.pyx":294 * newpos = bf.stop + offset * else: * with gil: # <<<<<<<<<<<<<< * set_error("Unknown value for 'whence'") * return -1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif goto __pyx_L5; } __pyx_L4_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif goto __pyx_L1_error; } __pyx_L5:; } } /* "pygame_sdl2/rwobject.pyx":296 * with gil: * set_error("Unknown value for 'whence'") * return -1 # <<<<<<<<<<<<<< * if newpos < bf.base: * newpos = bf.base */ __pyx_r = -1L; goto __pyx_L0; break; } /* "pygame_sdl2/rwobject.pyx":297 * set_error("Unknown value for 'whence'") * return -1 * if newpos < bf.base: # <<<<<<<<<<<<<< * newpos = bf.base * if newpos > bf.stop: */ __pyx_t_2 = (__pyx_v_newpos < __pyx_v_bf->base); if (__pyx_t_2) { /* "pygame_sdl2/rwobject.pyx":298 * return -1 * if newpos < bf.base: * newpos = bf.base # <<<<<<<<<<<<<< * if newpos > bf.stop: * newpos = bf.stop */ __pyx_t_3 = __pyx_v_bf->base; __pyx_v_newpos = __pyx_t_3; /* "pygame_sdl2/rwobject.pyx":297 * set_error("Unknown value for 'whence'") * return -1 * if newpos < bf.base: # <<<<<<<<<<<<<< * newpos = bf.base * if newpos > bf.stop: */ } /* "pygame_sdl2/rwobject.pyx":299 * if newpos < bf.base: * newpos = bf.base * if newpos > bf.stop: # <<<<<<<<<<<<<< * newpos = bf.stop * bf.here = newpos */ __pyx_t_2 = (__pyx_v_newpos > __pyx_v_bf->stop); if (__pyx_t_2) { /* "pygame_sdl2/rwobject.pyx":300 * newpos = bf.base * if newpos > bf.stop: * newpos = bf.stop # <<<<<<<<<<<<<< * bf.here = newpos * */ __pyx_t_3 = __pyx_v_bf->stop; __pyx_v_newpos = __pyx_t_3; /* "pygame_sdl2/rwobject.pyx":299 * if newpos < bf.base: * newpos = bf.base * if newpos > bf.stop: # <<<<<<<<<<<<<< * newpos = bf.stop * bf.here = newpos */ } /* "pygame_sdl2/rwobject.pyx":301 * if newpos > bf.stop: * newpos = bf.stop * bf.here = newpos # <<<<<<<<<<<<<< * * return bf.here - bf.base */ __pyx_v_bf->here = __pyx_v_newpos; /* "pygame_sdl2/rwobject.pyx":303 * bf.here = newpos * * return bf.here - bf.base # <<<<<<<<<<<<<< * * cdef size_t buffile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: */ __pyx_r = (__pyx_v_bf->here - __pyx_v_bf->base); goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":282 * return bf.stop - bf.base * * cdef Sint64 buffile_seek(SDL_RWops *context, Sint64 offset, int whence) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_XDECREF(__pyx_t_1); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.buffile_seek", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; __Pyx_RefNannyFinishContextNogil() return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":305 * return bf.here - bf.base * * cdef size_t buffile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * cdef size_t total_bytes = 0 */ static size_t __pyx_f_11pygame_sdl2_8rwobject_buffile_read(SDL_RWops *__pyx_v_context, void *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *__pyx_v_bf; size_t __pyx_v_total_bytes; size_t __pyx_v_mem_available; size_t __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "pygame_sdl2/rwobject.pyx":306 * * cdef size_t buffile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: * cdef BufFile *bf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * cdef size_t total_bytes = 0 * cdef size_t mem_available = 0 */ __pyx_v_bf = ((struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":307 * cdef size_t buffile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: * cdef BufFile *bf = context.hidden.unknown.data1 * cdef size_t total_bytes = 0 # <<<<<<<<<<<<<< * cdef size_t mem_available = 0 * */ __pyx_v_total_bytes = 0; /* "pygame_sdl2/rwobject.pyx":308 * cdef BufFile *bf = context.hidden.unknown.data1 * cdef size_t total_bytes = 0 * cdef size_t mem_available = 0 # <<<<<<<<<<<<<< * * total_bytes = maxnum * size */ __pyx_v_mem_available = 0; /* "pygame_sdl2/rwobject.pyx":310 * cdef size_t mem_available = 0 * * total_bytes = maxnum * size # <<<<<<<<<<<<<< * if (maxnum == 0) or (size == 0) or ((total_bytes // maxnum) != size): * return 0 */ __pyx_v_total_bytes = (__pyx_v_maxnum * __pyx_v_size); /* "pygame_sdl2/rwobject.pyx":311 * * total_bytes = maxnum * size * if (maxnum == 0) or (size == 0) or ((total_bytes // maxnum) != size): # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_2 = (__pyx_v_maxnum == 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_size == 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } if (unlikely(__pyx_v_maxnum == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 311, __pyx_L1_error) } __pyx_t_2 = ((__pyx_v_total_bytes / __pyx_v_maxnum) != __pyx_v_size); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":312 * total_bytes = maxnum * size * if (maxnum == 0) or (size == 0) or ((total_bytes // maxnum) != size): * return 0 # <<<<<<<<<<<<<< * * mem_available = bf.stop - bf.here */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":311 * * total_bytes = maxnum * size * if (maxnum == 0) or (size == 0) or ((total_bytes // maxnum) != size): # <<<<<<<<<<<<<< * return 0 * */ } /* "pygame_sdl2/rwobject.pyx":314 * return 0 * * mem_available = bf.stop - bf.here # <<<<<<<<<<<<<< * if total_bytes > mem_available: * total_bytes = mem_available */ __pyx_v_mem_available = (__pyx_v_bf->stop - __pyx_v_bf->here); /* "pygame_sdl2/rwobject.pyx":315 * * mem_available = bf.stop - bf.here * if total_bytes > mem_available: # <<<<<<<<<<<<<< * total_bytes = mem_available * */ __pyx_t_1 = (__pyx_v_total_bytes > __pyx_v_mem_available); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":316 * mem_available = bf.stop - bf.here * if total_bytes > mem_available: * total_bytes = mem_available # <<<<<<<<<<<<<< * * SDL_memcpy(ptr, bf.here, total_bytes) */ __pyx_v_total_bytes = __pyx_v_mem_available; /* "pygame_sdl2/rwobject.pyx":315 * * mem_available = bf.stop - bf.here * if total_bytes > mem_available: # <<<<<<<<<<<<<< * total_bytes = mem_available * */ } /* "pygame_sdl2/rwobject.pyx":318 * total_bytes = mem_available * * SDL_memcpy(ptr, bf.here, total_bytes) # <<<<<<<<<<<<<< * bf.here += total_bytes * */ (void)(SDL_memcpy(__pyx_v_ptr, __pyx_v_bf->here, __pyx_v_total_bytes)); /* "pygame_sdl2/rwobject.pyx":319 * * SDL_memcpy(ptr, bf.here, total_bytes) * bf.here += total_bytes # <<<<<<<<<<<<<< * * return (total_bytes // size) */ __pyx_v_bf->here = (__pyx_v_bf->here + __pyx_v_total_bytes); /* "pygame_sdl2/rwobject.pyx":321 * bf.here += total_bytes * * return (total_bytes // size) # <<<<<<<<<<<<<< * * cdef size_t buffile_write(SDL_RWops *context, const void *ptr, size_t size, size_t num) noexcept nogil: */ if (unlikely(__pyx_v_size == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 321, __pyx_L1_error) } __pyx_r = (__pyx_v_total_bytes / __pyx_v_size); goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":305 * return bf.here - bf.base * * cdef size_t buffile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * cdef size_t total_bytes = 0 */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_WriteUnraisable("pygame_sdl2.rwobject.buffile_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":323 * return (total_bytes // size) * * cdef size_t buffile_write(SDL_RWops *context, const void *ptr, size_t size, size_t num) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * */ static size_t __pyx_f_11pygame_sdl2_8rwobject_buffile_write(SDL_RWops *__pyx_v_context, void const *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_num) { struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *__pyx_v_bf; size_t __pyx_r; int __pyx_t_1; ptrdiff_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "pygame_sdl2/rwobject.pyx":324 * * cdef size_t buffile_write(SDL_RWops *context, const void *ptr, size_t size, size_t num) noexcept nogil: * cdef BufFile *bf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * if bf.view.readonly != 0: */ __pyx_v_bf = ((struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":326 * cdef BufFile *bf = context.hidden.unknown.data1 * * if bf.view.readonly != 0: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = (__pyx_v_bf->view.readonly != 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":327 * * if bf.view.readonly != 0: * return 0 # <<<<<<<<<<<<<< * * if (bf.here + (num * size)) > bf.stop: */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":326 * cdef BufFile *bf = context.hidden.unknown.data1 * * if bf.view.readonly != 0: # <<<<<<<<<<<<<< * return 0 * */ } /* "pygame_sdl2/rwobject.pyx":329 * return 0 * * if (bf.here + (num * size)) > bf.stop: # <<<<<<<<<<<<<< * num = (bf.stop - bf.here) // size * SDL_memcpy(bf.here, ptr, num * size) */ __pyx_t_1 = ((__pyx_v_bf->here + (__pyx_v_num * __pyx_v_size)) > __pyx_v_bf->stop); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":330 * * if (bf.here + (num * size)) > bf.stop: * num = (bf.stop - bf.here) // size # <<<<<<<<<<<<<< * SDL_memcpy(bf.here, ptr, num * size) * bf.here += num * size */ __pyx_t_2 = (__pyx_v_bf->stop - __pyx_v_bf->here); if (unlikely(__pyx_v_size == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 330, __pyx_L1_error) } else if (sizeof(ptrdiff_t) == sizeof(long) && (!(((size_t)-1) > 0)) && unlikely(__pyx_v_size == (size_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_t_2))) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 330, __pyx_L1_error) } __pyx_v_num = __Pyx_div_ptrdiff_t(__pyx_t_2, __pyx_v_size); /* "pygame_sdl2/rwobject.pyx":329 * return 0 * * if (bf.here + (num * size)) > bf.stop: # <<<<<<<<<<<<<< * num = (bf.stop - bf.here) // size * SDL_memcpy(bf.here, ptr, num * size) */ } /* "pygame_sdl2/rwobject.pyx":331 * if (bf.here + (num * size)) > bf.stop: * num = (bf.stop - bf.here) // size * SDL_memcpy(bf.here, ptr, num * size) # <<<<<<<<<<<<<< * bf.here += num * size * */ (void)(SDL_memcpy(__pyx_v_bf->here, __pyx_v_ptr, (__pyx_v_num * __pyx_v_size))); /* "pygame_sdl2/rwobject.pyx":332 * num = (bf.stop - bf.here) // size * SDL_memcpy(bf.here, ptr, num * size) * bf.here += num * size # <<<<<<<<<<<<<< * * return num */ __pyx_v_bf->here = (__pyx_v_bf->here + (__pyx_v_num * __pyx_v_size)); /* "pygame_sdl2/rwobject.pyx":334 * bf.here += num * size * * return num # <<<<<<<<<<<<<< * * cdef int buffile_close(SDL_RWops *context) noexcept with gil: */ __pyx_r = __pyx_v_num; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":323 * return (total_bytes // size) * * cdef size_t buffile_write(SDL_RWops *context, const void *ptr, size_t size, size_t num) noexcept nogil: # <<<<<<<<<<<<<< * cdef BufFile *bf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_WriteUnraisable("pygame_sdl2.rwobject.buffile_write", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":336 * return num * * cdef int buffile_close(SDL_RWops *context) noexcept with gil: # <<<<<<<<<<<<<< * cdef BufFile *bf * */ static int __pyx_f_11pygame_sdl2_8rwobject_buffile_close(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *__pyx_v_bf; int __pyx_r; int __pyx_t_1; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /* "pygame_sdl2/rwobject.pyx":339 * cdef BufFile *bf * * if context != NULL: # <<<<<<<<<<<<<< * bf = context.hidden.unknown.data1 * if bf != NULL: */ __pyx_t_1 = (__pyx_v_context != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":340 * * if context != NULL: * bf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * if bf != NULL: * PyBuffer_Release(&bf.view) */ __pyx_v_bf = ((struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":341 * if context != NULL: * bf = context.hidden.unknown.data1 * if bf != NULL: # <<<<<<<<<<<<<< * PyBuffer_Release(&bf.view) * free(bf) */ __pyx_t_1 = (__pyx_v_bf != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":342 * bf = context.hidden.unknown.data1 * if bf != NULL: * PyBuffer_Release(&bf.view) # <<<<<<<<<<<<<< * free(bf) * bf = NULL */ PyBuffer_Release((&__pyx_v_bf->view)); /* "pygame_sdl2/rwobject.pyx":343 * if bf != NULL: * PyBuffer_Release(&bf.view) * free(bf) # <<<<<<<<<<<<<< * bf = NULL * SDL_FreeRW(context) */ free(__pyx_v_bf); /* "pygame_sdl2/rwobject.pyx":344 * PyBuffer_Release(&bf.view) * free(bf) * bf = NULL # <<<<<<<<<<<<<< * SDL_FreeRW(context) * */ __pyx_v_bf = NULL; /* "pygame_sdl2/rwobject.pyx":341 * if context != NULL: * bf = context.hidden.unknown.data1 * if bf != NULL: # <<<<<<<<<<<<<< * PyBuffer_Release(&bf.view) * free(bf) */ } /* "pygame_sdl2/rwobject.pyx":345 * free(bf) * bf = NULL * SDL_FreeRW(context) # <<<<<<<<<<<<<< * * return 0 */ SDL_FreeRW(__pyx_v_context); /* "pygame_sdl2/rwobject.pyx":339 * cdef BufFile *bf * * if context != NULL: # <<<<<<<<<<<<<< * bf = context.hidden.unknown.data1 * if bf != NULL: */ } /* "pygame_sdl2/rwobject.pyx":347 * SDL_FreeRW(context) * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":336 * return num * * cdef int buffile_close(SDL_RWops *context) noexcept with gil: # <<<<<<<<<<<<<< * cdef BufFile *bf * */ /* function exit code */ __pyx_L0:; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":350 * * * cdef SDL_RWops *to_rwops(filelike, mode="rb", base=None, length=None) except NULL: # <<<<<<<<<<<<<< * """ * This accepts, in order: */ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_to_rwops(PyObject *__pyx_v_filelike, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args) { PyObject *__pyx_v_mode = ((PyObject *)__pyx_n_s_rb); PyObject *__pyx_v_base = ((PyObject *)Py_None); PyObject *__pyx_v_length = ((PyObject *)Py_None); struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; SDL_RWops *__pyx_v_rv; SDL_RWops *__pyx_v_rw; char *__pyx_v_cname; char *__pyx_v_cmode; struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_rwopsio = 0; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_dname = NULL; SDL_RWops *__pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; SDL_RWops *__pyx_t_11; int __pyx_t_12; PyObject *__pyx_t_13 = NULL; char *__pyx_t_14; Sint64 __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_rwops", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_mode = __pyx_optional_args->mode; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_base = __pyx_optional_args->base; if (__pyx_optional_args->__pyx_n > 2) { __pyx_v_length = __pyx_optional_args->length; } } } } __Pyx_INCREF(__pyx_v_filelike); __Pyx_INCREF(__pyx_v_mode); __Pyx_INCREF(__pyx_v_base); __Pyx_INCREF(__pyx_v_length); /* "pygame_sdl2/rwobject.pyx":385 * cdef RWopsIOImpl rwopsio * * if not isinstance(mode, bytes_): # <<<<<<<<<<<<<< * mode = mode.encode("ascii") * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_mode, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":386 * * if not isinstance(mode, bytes_): * mode = mode.encode("ascii") # <<<<<<<<<<<<<< * * name = filelike */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_mode, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_n_s_ascii}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":385 * cdef RWopsIOImpl rwopsio * * if not isinstance(mode, bytes_): # <<<<<<<<<<<<<< * mode = mode.encode("ascii") * */ } /* "pygame_sdl2/rwobject.pyx":388 * mode = mode.encode("ascii") * * name = filelike # <<<<<<<<<<<<<< * * # Handle turning BufferedIOBase and RWopsIO objects into their underlying */ __Pyx_INCREF(__pyx_v_filelike); __pyx_v_name = __pyx_v_filelike; /* "pygame_sdl2/rwobject.pyx":392 * # Handle turning BufferedIOBase and RWopsIO objects into their underlying * # objects. * try: # <<<<<<<<<<<<<< * while True: * filelike = filelike.raw */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":393 * # objects. * try: * while True: # <<<<<<<<<<<<<< * filelike = filelike.raw * except AttributeError: */ while (1) { /* "pygame_sdl2/rwobject.pyx":394 * try: * while True: * filelike = filelike.raw # <<<<<<<<<<<<<< * except AttributeError: * pass */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_raw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_filelike, __pyx_t_1); __pyx_t_1 = 0; } /* "pygame_sdl2/rwobject.pyx":392 * # Handle turning BufferedIOBase and RWopsIO objects into their underlying * # objects. * try: # <<<<<<<<<<<<<< * while True: * filelike = filelike.raw */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":395 * while True: * filelike = filelike.raw * except AttributeError: # <<<<<<<<<<<<<< * pass * */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_10) { __Pyx_ErrRestore(0,0,0); goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; /* "pygame_sdl2/rwobject.pyx":392 * # Handle turning BufferedIOBase and RWopsIO objects into their underlying * # objects. * try: # <<<<<<<<<<<<<< * while True: * filelike = filelike.raw */ __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L5_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L9_try_end:; } /* "pygame_sdl2/rwobject.pyx":398 * pass * * if isinstance(filelike, RWopsIOImpl): # <<<<<<<<<<<<<< * rwopsio = filelike * if not rwopsio.ops: */ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_filelike, __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":399 * * if isinstance(filelike, RWopsIOImpl): * rwopsio = filelike # <<<<<<<<<<<<<< * if not rwopsio.ops: * raise ValueError("I/O on closed file.") */ __pyx_t_1 = __pyx_v_filelike; __Pyx_INCREF(__pyx_t_1); __pyx_v_rwopsio = ((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":400 * if isinstance(filelike, RWopsIOImpl): * rwopsio = filelike * if not rwopsio.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O on closed file.") * */ __pyx_t_3 = (!(__pyx_v_rwopsio->ops != 0)); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/rwobject.pyx":401 * rwopsio = filelike * if not rwopsio.ops: * raise ValueError("I/O on closed file.") # <<<<<<<<<<<<<< * * rv = rwopsio.ops */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 401, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":400 * if isinstance(filelike, RWopsIOImpl): * rwopsio = filelike * if not rwopsio.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O on closed file.") * */ } /* "pygame_sdl2/rwobject.pyx":403 * raise ValueError("I/O on closed file.") * * rv = rwopsio.ops # <<<<<<<<<<<<<< * rwopsio.ops = NULL * return rv */ __pyx_t_11 = __pyx_v_rwopsio->ops; __pyx_v_rv = __pyx_t_11; /* "pygame_sdl2/rwobject.pyx":404 * * rv = rwopsio.ops * rwopsio.ops = NULL # <<<<<<<<<<<<<< * return rv * */ __pyx_v_rwopsio->ops = NULL; /* "pygame_sdl2/rwobject.pyx":405 * rv = rwopsio.ops * rwopsio.ops = NULL * return rv # <<<<<<<<<<<<<< * * if isinstance(filelike, (file_type, io.IOBase)) and mode == "rb": */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":398 * pass * * if isinstance(filelike, RWopsIOImpl): # <<<<<<<<<<<<<< * rwopsio = filelike * if not rwopsio.ops: */ } /* "pygame_sdl2/rwobject.pyx":407 * return rv * * if isinstance(filelike, (file_type, io.IOBase)) and mode == "rb": # <<<<<<<<<<<<<< * name = getattr(filelike, "name", None) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_file_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_io); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_IOBase); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_1); if (!__pyx_t_12) { } else { __pyx_t_2 = __pyx_t_12; goto __pyx_L17_bool_binop_done; } __pyx_t_12 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_5); __pyx_t_2 = __pyx_t_12; __pyx_L17_bool_binop_done:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L15_bool_binop_done; } __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_rb, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 407, __pyx_L1_error) __pyx_t_3 = __pyx_t_2; __pyx_L15_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":408 * * if isinstance(filelike, (file_type, io.IOBase)) and mode == "rb": * name = getattr(filelike, "name", None) # <<<<<<<<<<<<<< * * # Try to open as a file. */ __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_filelike, __pyx_n_s_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":407 * return rv * * if isinstance(filelike, (file_type, io.IOBase)) and mode == "rb": # <<<<<<<<<<<<<< * name = getattr(filelike, "name", None) * */ } /* "pygame_sdl2/rwobject.pyx":411 * * # Try to open as a file. * if isinstance(name, bytes_): # <<<<<<<<<<<<<< * name = name.decode(fsencoding) * elif isinstance(name, unicode_): */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_name, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":412 * # Try to open as a file. * if isinstance(name, bytes_): * name = name.decode(fsencoding) # <<<<<<<<<<<<<< * elif isinstance(name, unicode_): * pass */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fsencoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":411 * * # Try to open as a file. * if isinstance(name, bytes_): # <<<<<<<<<<<<<< * name = name.decode(fsencoding) * elif isinstance(name, unicode_): */ goto __pyx_L19; } /* "pygame_sdl2/rwobject.pyx":413 * if isinstance(name, bytes_): * name = name.decode(fsencoding) * elif isinstance(name, unicode_): # <<<<<<<<<<<<<< * pass * else: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_name, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { goto __pyx_L19; } /* "pygame_sdl2/rwobject.pyx":416 * pass * else: * name = None # <<<<<<<<<<<<<< * * if (mode == b"rb") and (name is not None): */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_name, Py_None); } __pyx_L19:; /* "pygame_sdl2/rwobject.pyx":418 * name = None * * if (mode == b"rb") and (name is not None): # <<<<<<<<<<<<<< * * dname = name.encode("utf-8") */ __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_mode, __pyx_n_b_rb, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 418, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L21_bool_binop_done; } __pyx_t_2 = (__pyx_v_name != Py_None); __pyx_t_3 = __pyx_t_2; __pyx_L21_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":420 * if (mode == b"rb") and (name is not None): * * dname = name.encode("utf-8") # <<<<<<<<<<<<<< * cname = dname * cmode = mode */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_dname = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":421 * * dname = name.encode("utf-8") * cname = dname # <<<<<<<<<<<<<< * cmode = mode * */ __pyx_t_14 = __Pyx_PyObject_AsWritableString(__pyx_v_dname); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(0, 421, __pyx_L1_error) __pyx_v_cname = __pyx_t_14; /* "pygame_sdl2/rwobject.pyx":422 * dname = name.encode("utf-8") * cname = dname * cmode = mode # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_14 = __Pyx_PyObject_AsWritableString(__pyx_v_mode); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(0, 422, __pyx_L1_error) __pyx_v_cmode = __pyx_t_14; /* "pygame_sdl2/rwobject.pyx":424 * cmode = mode * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWFromFile(cname, cmode) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":425 * * with nogil: * rv = SDL_RWFromFile(cname, cmode) # <<<<<<<<<<<<<< * * if rv == NULL: */ __pyx_v_rv = SDL_RWFromFile(__pyx_v_cname, __pyx_v_cmode); } /* "pygame_sdl2/rwobject.pyx":424 * cmode = mode * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWFromFile(cname, cmode) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L25; } __pyx_L25:; } } /* "pygame_sdl2/rwobject.pyx":427 * rv = SDL_RWFromFile(cname, cmode) * * if rv == NULL: # <<<<<<<<<<<<<< * raise IOError("Could not open {!r}: {}".format(name, SDL_GetError())) * */ __pyx_t_3 = (__pyx_v_rv == NULL); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/rwobject.pyx":428 * * if rv == NULL: * raise IOError("Could not open {!r}: {}".format(name, SDL_GetError())) # <<<<<<<<<<<<<< * * if base is None and length is None: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Could_not_open_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_v_name, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 428, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":427 * rv = SDL_RWFromFile(cname, cmode) * * if rv == NULL: # <<<<<<<<<<<<<< * raise IOError("Could not open {!r}: {}".format(name, SDL_GetError())) * */ } /* "pygame_sdl2/rwobject.pyx":430 * raise IOError("Could not open {!r}: {}".format(name, SDL_GetError())) * * if base is None and length is None: # <<<<<<<<<<<<<< * try: * base = filelike.base */ __pyx_t_2 = (__pyx_v_base == Py_None); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } __pyx_t_2 = (__pyx_v_length == Py_None); __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":431 * * if base is None and length is None: * try: # <<<<<<<<<<<<<< * base = filelike.base * length = filelike.length */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":432 * if base is None and length is None: * try: * base = filelike.base # <<<<<<<<<<<<<< * length = filelike.length * except AttributeError: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_base); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_base, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":433 * try: * base = filelike.base * length = filelike.length # <<<<<<<<<<<<<< * except AttributeError: * pass */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 433, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_length, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":431 * * if base is None and length is None: * try: # <<<<<<<<<<<<<< * base = filelike.base * length = filelike.length */ } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L35_try_end; __pyx_L30_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":434 * base = filelike.base * length = filelike.length * except AttributeError: # <<<<<<<<<<<<<< * pass * */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_10) { __Pyx_ErrRestore(0,0,0); goto __pyx_L31_exception_handled; } goto __pyx_L32_except_error; /* "pygame_sdl2/rwobject.pyx":431 * * if base is None and length is None: * try: # <<<<<<<<<<<<<< * base = filelike.base * length = filelike.length */ __pyx_L32_except_error:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7); goto __pyx_L1_error; __pyx_L31_exception_handled:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7); __pyx_L35_try_end:; } /* "pygame_sdl2/rwobject.pyx":430 * raise IOError("Could not open {!r}: {}".format(name, SDL_GetError())) * * if base is None and length is None: # <<<<<<<<<<<<<< * try: * base = filelike.base */ } /* "pygame_sdl2/rwobject.pyx":437 * pass * * if base is not None and length is not None: # <<<<<<<<<<<<<< * * # If we have these properties, we're either an APK asset or a Ren'Py-style */ __pyx_t_2 = (__pyx_v_base != Py_None); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L37_bool_binop_done; } __pyx_t_2 = (__pyx_v_length != Py_None); __pyx_t_3 = __pyx_t_2; __pyx_L37_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":442 * # subfile, so use an optimized path. * * rw = rv # <<<<<<<<<<<<<< * * SDL_RWseek(rw, base, RW_SEEK_SET); */ __pyx_v_rw = __pyx_v_rv; /* "pygame_sdl2/rwobject.pyx":444 * rw = rv * * SDL_RWseek(rw, base, RW_SEEK_SET); # <<<<<<<<<<<<<< * * sf = calloc(sizeof(SubFile), 1) */ __pyx_t_15 = __Pyx_PyInt_As_int64_t(__pyx_v_base); if (unlikely((__pyx_t_15 == ((Sint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L1_error) (void)(SDL_RWseek(__pyx_v_rw, __pyx_t_15, RW_SEEK_SET)); /* "pygame_sdl2/rwobject.pyx":446 * SDL_RWseek(rw, base, RW_SEEK_SET); * * sf = calloc(sizeof(SubFile), 1) # <<<<<<<<<<<<<< * sf.rw = rw * sf.base = base */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)calloc((sizeof(struct __pyx_t_11pygame_sdl2_8rwobject_SubFile)), 1)); /* "pygame_sdl2/rwobject.pyx":447 * * sf = calloc(sizeof(SubFile), 1) * sf.rw = rw # <<<<<<<<<<<<<< * sf.base = base * sf.length = length */ __pyx_v_sf->rw = __pyx_v_rw; /* "pygame_sdl2/rwobject.pyx":448 * sf = calloc(sizeof(SubFile), 1) * sf.rw = rw * sf.base = base # <<<<<<<<<<<<<< * sf.length = length * sf.tell = 0 */ __pyx_t_15 = __Pyx_PyInt_As_int64_t(__pyx_v_base); if (unlikely((__pyx_t_15 == ((Sint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error) __pyx_v_sf->base = __pyx_t_15; /* "pygame_sdl2/rwobject.pyx":449 * sf.rw = rw * sf.base = base * sf.length = length # <<<<<<<<<<<<<< * sf.tell = 0 * */ __pyx_t_15 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_15 == ((Sint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) __pyx_v_sf->length = __pyx_t_15; /* "pygame_sdl2/rwobject.pyx":450 * sf.base = base * sf.length = length * sf.tell = 0 # <<<<<<<<<<<<<< * * rv = SDL_AllocRW() */ __pyx_v_sf->tell = 0; /* "pygame_sdl2/rwobject.pyx":452 * sf.tell = 0 * * rv = SDL_AllocRW() # <<<<<<<<<<<<<< * rv.size = subfile_size * rv.seek = subfile_seek */ __pyx_v_rv = SDL_AllocRW(); /* "pygame_sdl2/rwobject.pyx":453 * * rv = SDL_AllocRW() * rv.size = subfile_size # <<<<<<<<<<<<<< * rv.seek = subfile_seek * rv.read = subfile_read */ __pyx_v_rv->size = __pyx_f_11pygame_sdl2_8rwobject_subfile_size; /* "pygame_sdl2/rwobject.pyx":454 * rv = SDL_AllocRW() * rv.size = subfile_size * rv.seek = subfile_seek # <<<<<<<<<<<<<< * rv.read = subfile_read * rv.write = NULL */ __pyx_v_rv->seek = __pyx_f_11pygame_sdl2_8rwobject_subfile_seek; /* "pygame_sdl2/rwobject.pyx":455 * rv.size = subfile_size * rv.seek = subfile_seek * rv.read = subfile_read # <<<<<<<<<<<<<< * rv.write = NULL * rv.close = subfile_close */ __pyx_v_rv->read = __pyx_f_11pygame_sdl2_8rwobject_subfile_read; /* "pygame_sdl2/rwobject.pyx":456 * rv.seek = subfile_seek * rv.read = subfile_read * rv.write = NULL # <<<<<<<<<<<<<< * rv.close = subfile_close * rv.type = 0 */ __pyx_v_rv->write = NULL; /* "pygame_sdl2/rwobject.pyx":457 * rv.read = subfile_read * rv.write = NULL * rv.close = subfile_close # <<<<<<<<<<<<<< * rv.type = 0 * rv.hidden.unknown.data1 = sf */ __pyx_v_rv->close = __pyx_f_11pygame_sdl2_8rwobject_subfile_close; /* "pygame_sdl2/rwobject.pyx":458 * rv.write = NULL * rv.close = subfile_close * rv.type = 0 # <<<<<<<<<<<<<< * rv.hidden.unknown.data1 = sf * */ __pyx_v_rv->type = 0; /* "pygame_sdl2/rwobject.pyx":459 * rv.close = subfile_close * rv.type = 0 * rv.hidden.unknown.data1 = sf # <<<<<<<<<<<<<< * * try: */ __pyx_v_rv->hidden.unknown.data1 = ((void *)__pyx_v_sf); /* "pygame_sdl2/rwobject.pyx":437 * pass * * if base is not None and length is not None: # <<<<<<<<<<<<<< * * # If we have these properties, we're either an APK asset or a Ren'Py-style */ } /* "pygame_sdl2/rwobject.pyx":461 * rv.hidden.unknown.data1 = sf * * try: # <<<<<<<<<<<<<< * filelike.close() * except: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":462 * * try: * filelike.close() # <<<<<<<<<<<<<< * except: * pass */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_close); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L39_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L39_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":461 * rv.hidden.unknown.data1 = sf * * try: # <<<<<<<<<<<<<< * filelike.close() * except: */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L44_try_end; __pyx_L39_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":463 * try: * filelike.close() * except: # <<<<<<<<<<<<<< * pass * */ /*except:*/ { __Pyx_ErrRestore(0,0,0); goto __pyx_L40_exception_handled; } __pyx_L40_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L44_try_end:; } /* "pygame_sdl2/rwobject.pyx":466 * pass * * return rv # <<<<<<<<<<<<<< * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":418 * name = None * * if (mode == b"rb") and (name is not None): # <<<<<<<<<<<<<< * * dname = name.encode("utf-8") */ } /* "pygame_sdl2/rwobject.pyx":468 * return rv * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): # <<<<<<<<<<<<<< * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) * */ __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filelike, __pyx_n_s_read); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 468, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L46_bool_binop_done; } __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filelike, __pyx_n_s_write); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 468, __pyx_L1_error) __pyx_t_3 = __pyx_t_2; __pyx_L46_bool_binop_done:; __pyx_t_2 = (!__pyx_t_3); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/rwobject.pyx":469 * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) # <<<<<<<<<<<<<< * * Py_INCREF(filelike) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_r_is_not_a_filename_or_file_lik, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_filelike}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 469, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":468 * return rv * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): # <<<<<<<<<<<<<< * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) * */ } /* "pygame_sdl2/rwobject.pyx":471 * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) * * Py_INCREF(filelike) # <<<<<<<<<<<<<< * * rv = SDL_AllocRW() */ Py_INCREF(__pyx_v_filelike); /* "pygame_sdl2/rwobject.pyx":473 * Py_INCREF(filelike) * * rv = SDL_AllocRW() # <<<<<<<<<<<<<< * rv.size = python_size * rv.seek = python_seek */ __pyx_v_rv = SDL_AllocRW(); /* "pygame_sdl2/rwobject.pyx":474 * * rv = SDL_AllocRW() * rv.size = python_size # <<<<<<<<<<<<<< * rv.seek = python_seek * rv.read = python_read */ __pyx_v_rv->size = __pyx_f_11pygame_sdl2_8rwobject_python_size; /* "pygame_sdl2/rwobject.pyx":475 * rv = SDL_AllocRW() * rv.size = python_size * rv.seek = python_seek # <<<<<<<<<<<<<< * rv.read = python_read * rv.write = python_write */ __pyx_v_rv->seek = __pyx_f_11pygame_sdl2_8rwobject_python_seek; /* "pygame_sdl2/rwobject.pyx":476 * rv.size = python_size * rv.seek = python_seek * rv.read = python_read # <<<<<<<<<<<<<< * rv.write = python_write * rv.close = python_close */ __pyx_v_rv->read = __pyx_f_11pygame_sdl2_8rwobject_python_read; /* "pygame_sdl2/rwobject.pyx":477 * rv.seek = python_seek * rv.read = python_read * rv.write = python_write # <<<<<<<<<<<<<< * rv.close = python_close * rv.type = 0 */ __pyx_v_rv->write = __pyx_f_11pygame_sdl2_8rwobject_python_write; /* "pygame_sdl2/rwobject.pyx":478 * rv.read = python_read * rv.write = python_write * rv.close = python_close # <<<<<<<<<<<<<< * rv.type = 0 * rv.hidden.unknown.data1 = filelike */ __pyx_v_rv->close = __pyx_f_11pygame_sdl2_8rwobject_python_close; /* "pygame_sdl2/rwobject.pyx":479 * rv.write = python_write * rv.close = python_close * rv.type = 0 # <<<<<<<<<<<<<< * rv.hidden.unknown.data1 = filelike * */ __pyx_v_rv->type = 0; /* "pygame_sdl2/rwobject.pyx":480 * rv.close = python_close * rv.type = 0 * rv.hidden.unknown.data1 = filelike # <<<<<<<<<<<<<< * * return rv */ __pyx_v_rv->hidden.unknown.data1 = ((void *)__pyx_v_filelike); /* "pygame_sdl2/rwobject.pyx":482 * rv.hidden.unknown.data1 = filelike * * return rv # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":350 * * * cdef SDL_RWops *to_rwops(filelike, mode="rb", base=None, length=None) except NULL: # <<<<<<<<<<<<<< * """ * This accepts, in order: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("pygame_sdl2.rwobject.to_rwops", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rwopsio); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_dname); __Pyx_XDECREF(__pyx_v_filelike); __Pyx_XDECREF(__pyx_v_mode); __Pyx_XDECREF(__pyx_v_base); __Pyx_XDECREF(__pyx_v_length); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":501 * cdef public object length * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.ops != NULL: * SDL_RWclose(self.ops) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_1__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl___dealloc__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl___dealloc__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { int __pyx_t_1; /* "pygame_sdl2/rwobject.pyx":502 * * def __dealloc__(self): * if self.ops != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(self.ops) * self.ops = NULL */ __pyx_t_1 = (__pyx_v_self->ops != NULL); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":503 * def __dealloc__(self): * if self.ops != NULL: * SDL_RWclose(self.ops) # <<<<<<<<<<<<<< * self.ops = NULL * */ (void)(SDL_RWclose(__pyx_v_self->ops)); /* "pygame_sdl2/rwobject.pyx":504 * if self.ops != NULL: * SDL_RWclose(self.ops) * self.ops = NULL # <<<<<<<<<<<<<< * * def __init__(self, filelike, mode="rb", base=None, length=None, name=None): */ __pyx_v_self->ops = NULL; /* "pygame_sdl2/rwobject.pyx":502 * * def __dealloc__(self): * if self.ops != NULL: # <<<<<<<<<<<<<< * SDL_RWclose(self.ops) * self.ops = NULL */ } /* "pygame_sdl2/rwobject.pyx":501 * cdef public object length * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.ops != NULL: * SDL_RWclose(self.ops) */ /* function exit code */ } /* "pygame_sdl2/rwobject.pyx":506 * self.ops = NULL * * def __init__(self, filelike, mode="rb", base=None, length=None, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object. All parameter are passed to to_rwops */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__, "\n Creates a new RWopsIO object. All parameter are passed to to_rwops\n to create the SDL_RWops object.\n "); #if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__; #endif static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filelike = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_base = 0; PyObject *__pyx_v_length = 0; PyObject *__pyx_v_name = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filelike,&__pyx_n_s_mode,&__pyx_n_s_base,&__pyx_n_s_length,&__pyx_n_s_name,0}; values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_s_rb)); values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filelike)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_base); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name); if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 506, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_filelike = values[0]; __pyx_v_mode = values[1]; __pyx_v_base = values[2]; __pyx_v_length = values[3]; __pyx_v_name = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 506, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), __pyx_v_filelike, __pyx_v_mode, __pyx_v_base, __pyx_v_length, __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_filelike, PyObject *__pyx_v_mode, PyObject *__pyx_v_base, PyObject *__pyx_v_length, PyObject *__pyx_v_name) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; SDL_RWops *__pyx_t_3; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/rwobject.pyx":512 * """ * * if name is not None: # <<<<<<<<<<<<<< * self.name = name * elif isinstance(filelike, basestring): */ __pyx_t_1 = (__pyx_v_name != Py_None); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":513 * * if name is not None: * self.name = name # <<<<<<<<<<<<<< * elif isinstance(filelike, basestring): * self.name = filelike */ __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_name; /* "pygame_sdl2/rwobject.pyx":512 * """ * * if name is not None: # <<<<<<<<<<<<<< * self.name = name * elif isinstance(filelike, basestring): */ goto __pyx_L3; } /* "pygame_sdl2/rwobject.pyx":514 * if name is not None: * self.name = name * elif isinstance(filelike, basestring): # <<<<<<<<<<<<<< * self.name = filelike * else: */ __pyx_t_1 = __Pyx_PyBaseString_Check(__pyx_v_filelike); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":515 * self.name = name * elif isinstance(filelike, basestring): * self.name = filelike # <<<<<<<<<<<<<< * else: * self.name = getattr(filelike, "name", name) */ __Pyx_INCREF(__pyx_v_filelike); __Pyx_GIVEREF(__pyx_v_filelike); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_filelike; /* "pygame_sdl2/rwobject.pyx":514 * if name is not None: * self.name = name * elif isinstance(filelike, basestring): # <<<<<<<<<<<<<< * self.name = filelike * else: */ goto __pyx_L3; } /* "pygame_sdl2/rwobject.pyx":517 * self.name = filelike * else: * self.name = getattr(filelike, "name", name) # <<<<<<<<<<<<<< * * self.base = base */ /*else*/ { __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_filelike, __pyx_n_s_name, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L3:; /* "pygame_sdl2/rwobject.pyx":519 * self.name = getattr(filelike, "name", name) * * self.base = base # <<<<<<<<<<<<<< * self.length = length * */ __Pyx_INCREF(__pyx_v_base); __Pyx_GIVEREF(__pyx_v_base); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = __pyx_v_base; /* "pygame_sdl2/rwobject.pyx":520 * * self.base = base * self.length = length # <<<<<<<<<<<<<< * * if filelike is not None: */ __Pyx_INCREF(__pyx_v_length); __Pyx_GIVEREF(__pyx_v_length); __Pyx_GOTREF(__pyx_v_self->length); __Pyx_DECREF(__pyx_v_self->length); __pyx_v_self->length = __pyx_v_length; /* "pygame_sdl2/rwobject.pyx":522 * self.length = length * * if filelike is not None: # <<<<<<<<<<<<<< * self.ops = to_rwops(filelike, mode, base, length) * else: */ __pyx_t_1 = (__pyx_v_filelike != Py_None); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":523 * * if filelike is not None: * self.ops = to_rwops(filelike, mode, base, length) # <<<<<<<<<<<<<< * else: * self.ops = NULL */ __pyx_t_4.__pyx_n = 3; __pyx_t_4.mode = __pyx_v_mode; __pyx_t_4.base = __pyx_v_base; __pyx_t_4.length = __pyx_v_length; __pyx_t_3 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filelike, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 523, __pyx_L1_error) __pyx_v_self->ops = __pyx_t_3; /* "pygame_sdl2/rwobject.pyx":522 * self.length = length * * if filelike is not None: # <<<<<<<<<<<<<< * self.ops = to_rwops(filelike, mode, base, length) * else: */ goto __pyx_L4; } /* "pygame_sdl2/rwobject.pyx":525 * self.ops = to_rwops(filelike, mode, base, length) * else: * self.ops = NULL # <<<<<<<<<<<<<< * * def close(self): */ /*else*/ { __pyx_v_self->ops = NULL; } __pyx_L4:; /* "pygame_sdl2/rwobject.pyx":506 * self.ops = NULL * * def __init__(self, filelike, mode="rb", base=None, length=None, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object. All parameter are passed to to_rwops */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":527 * self.ops = NULL * * def close(self): # <<<<<<<<<<<<<< * * # A closed file may be closed again. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_5close(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_4close, "RWopsIOImpl.close(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_5close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_5close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_4close}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_5close(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("close", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "close", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4close(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4close(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("close", 1); /* "pygame_sdl2/rwobject.pyx":531 * # A closed file may be closed again. * * if self.ops: # <<<<<<<<<<<<<< * SDL_RWclose(self.ops) * self.ops = NULL */ __pyx_t_1 = (__pyx_v_self->ops != 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":532 * * if self.ops: * SDL_RWclose(self.ops) # <<<<<<<<<<<<<< * self.ops = NULL * */ (void)(SDL_RWclose(__pyx_v_self->ops)); /* "pygame_sdl2/rwobject.pyx":533 * if self.ops: * SDL_RWclose(self.ops) * self.ops = NULL # <<<<<<<<<<<<<< * * def is_closed(self): */ __pyx_v_self->ops = NULL; /* "pygame_sdl2/rwobject.pyx":531 * # A closed file may be closed again. * * if self.ops: # <<<<<<<<<<<<<< * SDL_RWclose(self.ops) * self.ops = NULL */ } /* "pygame_sdl2/rwobject.pyx":527 * self.ops = NULL * * def close(self): # <<<<<<<<<<<<<< * * # A closed file may be closed again. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":535 * self.ops = NULL * * def is_closed(self): # <<<<<<<<<<<<<< * return not self.ops * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_7is_closed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_6is_closed, "RWopsIOImpl.is_closed(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_7is_closed = {"is_closed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_7is_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_6is_closed}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_7is_closed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_closed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_closed", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_closed", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6is_closed(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6is_closed(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_closed", 1); /* "pygame_sdl2/rwobject.pyx":536 * * def is_closed(self): * return not self.ops # <<<<<<<<<<<<<< * * def seek(self, long long offset, whence=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((!(__pyx_v_self->ops != 0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":535 * self.ops = NULL * * def is_closed(self): # <<<<<<<<<<<<<< * return not self.ops * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.is_closed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":538 * return not self.ops * * def seek(self, long long offset, whence=0): # <<<<<<<<<<<<<< * cdef int whence_rw * cdef long long rv */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_9seek(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_8seek, "RWopsIOImpl.seek(self, long long offset, whence=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_9seek = {"seek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_9seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_8seek}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_9seek(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PY_LONG_LONG __pyx_v_offset; PyObject *__pyx_v_whence = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seek (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_whence,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 538, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_whence); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 538, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "seek") < 0)) __PYX_ERR(0, 538, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_offset = __Pyx_PyInt_As_PY_LONG_LONG(values[0]); if (unlikely((__pyx_v_offset == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 538, __pyx_L3_error) __pyx_v_whence = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 538, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.seek", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_8seek(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), __pyx_v_offset, __pyx_v_whence); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_8seek(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PY_LONG_LONG __pyx_v_offset, PyObject *__pyx_v_whence) { int __pyx_v_whence_rw; PY_LONG_LONG __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("seek", 1); /* "pygame_sdl2/rwobject.pyx":542 * cdef long long rv * * if not self.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O operation on closed file.") * */ __pyx_t_1 = (!(__pyx_v_self->ops != 0)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":543 * * if not self.ops: * raise ValueError("I/O operation on closed file.") # <<<<<<<<<<<<<< * * whence_rw = whence_mapping.get(whence, RW_SEEK_SET) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 543, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":542 * cdef long long rv * * if not self.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O operation on closed file.") * */ } /* "pygame_sdl2/rwobject.pyx":545 * raise ValueError("I/O operation on closed file.") * * whence_rw = whence_mapping.get(whence, RW_SEEK_SET) # <<<<<<<<<<<<<< * * with nogil: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_whence_mapping); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(RW_SEEK_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_whence, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_whence_rw = __pyx_t_7; /* "pygame_sdl2/rwobject.pyx":547 * whence_rw = whence_mapping.get(whence, RW_SEEK_SET) * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWseek(self.ops, offset, whence_rw) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":548 * * with nogil: * rv = SDL_RWseek(self.ops, offset, whence_rw) # <<<<<<<<<<<<<< * * if rv < 0: */ __pyx_v_rv = SDL_RWseek(__pyx_v_self->ops, __pyx_v_offset, __pyx_v_whence_rw); } /* "pygame_sdl2/rwobject.pyx":547 * whence_rw = whence_mapping.get(whence, RW_SEEK_SET) * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWseek(self.ops, offset, whence_rw) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/rwobject.pyx":550 * rv = SDL_RWseek(self.ops, offset, whence_rw) * * if rv < 0: # <<<<<<<<<<<<<< * raise IOError("Could not seek: {}".format(SDL_GetError())) * */ __pyx_t_1 = (__pyx_v_rv < 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":551 * * if rv < 0: * raise IOError("Could not seek: {}".format(SDL_GetError())) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Could_not_seek, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 551, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":550 * rv = SDL_RWseek(self.ops, offset, whence_rw) * * if rv < 0: # <<<<<<<<<<<<<< * raise IOError("Could not seek: {}".format(SDL_GetError())) * */ } /* "pygame_sdl2/rwobject.pyx":553 * raise IOError("Could not seek: {}".format(SDL_GetError())) * * return rv # <<<<<<<<<<<<<< * * def tell(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":538 * return not self.ops * * def seek(self, long long offset, whence=0): # <<<<<<<<<<<<<< * cdef int whence_rw * cdef long long rv */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.seek", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":555 * return rv * * def tell(self): # <<<<<<<<<<<<<< * cdef long long rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_11tell(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_10tell, "RWopsIOImpl.tell(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_11tell = {"tell", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_11tell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_10tell}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_11tell(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tell (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("tell", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "tell", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_10tell(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_10tell(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PY_LONG_LONG __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tell", 1); /* "pygame_sdl2/rwobject.pyx":558 * cdef long long rv * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWtell(self.ops) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":559 * * with nogil: * rv = SDL_RWtell(self.ops) # <<<<<<<<<<<<<< * * return rv */ __pyx_v_rv = SDL_RWtell(__pyx_v_self->ops); } /* "pygame_sdl2/rwobject.pyx":558 * cdef long long rv * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWtell(self.ops) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/rwobject.pyx":561 * rv = SDL_RWtell(self.ops) * * return rv # <<<<<<<<<<<<<< * * def readinto(self, b): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":555 * return rv * * def tell(self): # <<<<<<<<<<<<<< * cdef long long rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.tell", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":563 * return rv * * def readinto(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_13readinto(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_12readinto, "RWopsIOImpl.readinto(self, b)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_13readinto = {"readinto", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_13readinto, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_12readinto}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_13readinto(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("readinto (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 563, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "readinto") < 0)) __PYX_ERR(0, 563, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_b = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("readinto", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 563, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.readinto", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_12readinto(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), __pyx_v_b); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_12readinto(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_b) { Py_buffer __pyx_v_view; PY_LONG_LONG __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; unsigned int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("readinto", 1); /* "pygame_sdl2/rwobject.pyx":565 * def readinto(self, b): * cdef Py_buffer view * cdef long long rv = 0 # <<<<<<<<<<<<<< * * if not self.ops: */ __pyx_v_rv = 0; /* "pygame_sdl2/rwobject.pyx":567 * cdef long long rv = 0 * * if not self.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O operation on closed file.") * */ __pyx_t_1 = (!(__pyx_v_self->ops != 0)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":568 * * if not self.ops: * raise ValueError("I/O operation on closed file.") # <<<<<<<<<<<<<< * * if not PyObject_CheckBuffer(b): */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 568, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":567 * cdef long long rv = 0 * * if not self.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O operation on closed file.") * */ } /* "pygame_sdl2/rwobject.pyx":570 * raise ValueError("I/O operation on closed file.") * * if not PyObject_CheckBuffer(b): # <<<<<<<<<<<<<< * raise ValueError("Passed in object does not support buffer protocol") * */ __pyx_t_1 = (!PyObject_CheckBuffer(__pyx_v_b)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":571 * * if not PyObject_CheckBuffer(b): * raise ValueError("Passed in object does not support buffer protocol") # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 571, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":570 * raise ValueError("I/O operation on closed file.") * * if not PyObject_CheckBuffer(b): # <<<<<<<<<<<<<< * raise ValueError("Passed in object does not support buffer protocol") * */ } /* "pygame_sdl2/rwobject.pyx":573 * raise ValueError("Passed in object does not support buffer protocol") * * try: # <<<<<<<<<<<<<< * PyObject_GetBuffer(b, &view, PyBUF_CONTIG) * */ /*try:*/ { /* "pygame_sdl2/rwobject.pyx":574 * * try: * PyObject_GetBuffer(b, &view, PyBUF_CONTIG) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_b, (&__pyx_v_view), PyBUF_CONTIG); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 574, __pyx_L6_error) /* "pygame_sdl2/rwobject.pyx":576 * PyObject_GetBuffer(b, &view, PyBUF_CONTIG) * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWread(self.ops, view.buf, 1, view.len) * finally: */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":577 * * with nogil: * rv = SDL_RWread(self.ops, view.buf, 1, view.len) # <<<<<<<<<<<<<< * finally: * PyBuffer_Release(&view) */ __pyx_v_rv = SDL_RWread(__pyx_v_self->ops, __pyx_v_view.buf, 1, __pyx_v_view.len); } /* "pygame_sdl2/rwobject.pyx":576 * PyObject_GetBuffer(b, &view, PyBUF_CONTIG) * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWread(self.ops, view.buf, 1, view.len) * finally: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } } /* "pygame_sdl2/rwobject.pyx":579 * rv = SDL_RWread(self.ops, view.buf, 1, view.len) * finally: * PyBuffer_Release(&view) # <<<<<<<<<<<<<< * * if rv < 0: */ /*finally:*/ { /*normal exit:*/{ PyBuffer_Release((&__pyx_v_view)); goto __pyx_L7; } __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { PyBuffer_Release((&__pyx_v_view)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; } __pyx_L7:; } /* "pygame_sdl2/rwobject.pyx":581 * PyBuffer_Release(&view) * * if rv < 0: # <<<<<<<<<<<<<< * raise IOError("Could not read: {}".format(SDL_GetError())) * */ __pyx_t_1 = (__pyx_v_rv < 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":582 * * if rv < 0: * raise IOError("Could not read: {}".format(SDL_GetError())) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Could_not_read, __pyx_n_s_format); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_15 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_15 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_13}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_12, 0, 0, 0); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(0, 582, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":581 * PyBuffer_Release(&view) * * if rv < 0: # <<<<<<<<<<<<<< * raise IOError("Could not read: {}".format(SDL_GetError())) * */ } /* "pygame_sdl2/rwobject.pyx":584 * raise IOError("Could not read: {}".format(SDL_GetError())) * * return rv # <<<<<<<<<<<<<< * * def write(self, b): */ __Pyx_XDECREF(__pyx_r); __pyx_t_12 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_r = __pyx_t_12; __pyx_t_12 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":563 * return rv * * def readinto(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.readinto", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":586 * return rv * * def write(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_15write(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_14write, "RWopsIOImpl.write(self, b)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_15write = {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_15write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_14write}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_15write(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "write") < 0)) __PYX_ERR(0, 586, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_b = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 586, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.write", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_14write(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), __pyx_v_b); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_14write(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_b) { Py_buffer __pyx_v_view; PY_LONG_LONG __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; unsigned int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write", 1); /* "pygame_sdl2/rwobject.pyx":588 * def write(self, b): * cdef Py_buffer view * cdef long long rv = 0 # <<<<<<<<<<<<<< * * if not self.ops: */ __pyx_v_rv = 0; /* "pygame_sdl2/rwobject.pyx":590 * cdef long long rv = 0 * * if not self.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O operation on closed file.") * */ __pyx_t_1 = (!(__pyx_v_self->ops != 0)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":591 * * if not self.ops: * raise ValueError("I/O operation on closed file.") # <<<<<<<<<<<<<< * * if not PyObject_CheckBuffer(b): */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 591, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":590 * cdef long long rv = 0 * * if not self.ops: # <<<<<<<<<<<<<< * raise ValueError("I/O operation on closed file.") * */ } /* "pygame_sdl2/rwobject.pyx":593 * raise ValueError("I/O operation on closed file.") * * if not PyObject_CheckBuffer(b): # <<<<<<<<<<<<<< * raise ValueError("Passed in object does not support buffer protocol") * */ __pyx_t_1 = (!PyObject_CheckBuffer(__pyx_v_b)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":594 * * if not PyObject_CheckBuffer(b): * raise ValueError("Passed in object does not support buffer protocol") # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 594, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":593 * raise ValueError("I/O operation on closed file.") * * if not PyObject_CheckBuffer(b): # <<<<<<<<<<<<<< * raise ValueError("Passed in object does not support buffer protocol") * */ } /* "pygame_sdl2/rwobject.pyx":596 * raise ValueError("Passed in object does not support buffer protocol") * * try: # <<<<<<<<<<<<<< * PyObject_GetBuffer(b, &view, PyBUF_CONTIG_RO) * with nogil: */ /*try:*/ { /* "pygame_sdl2/rwobject.pyx":597 * * try: * PyObject_GetBuffer(b, &view, PyBUF_CONTIG_RO) # <<<<<<<<<<<<<< * with nogil: * rv = SDL_RWwrite(self.ops, view.buf, 1, view.len) */ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_b, (&__pyx_v_view), PyBUF_CONTIG_RO); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 597, __pyx_L6_error) /* "pygame_sdl2/rwobject.pyx":598 * try: * PyObject_GetBuffer(b, &view, PyBUF_CONTIG_RO) * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWwrite(self.ops, view.buf, 1, view.len) * finally: */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":599 * PyObject_GetBuffer(b, &view, PyBUF_CONTIG_RO) * with nogil: * rv = SDL_RWwrite(self.ops, view.buf, 1, view.len) # <<<<<<<<<<<<<< * finally: * PyBuffer_Release(&view) */ __pyx_v_rv = SDL_RWwrite(__pyx_v_self->ops, __pyx_v_view.buf, 1, __pyx_v_view.len); } /* "pygame_sdl2/rwobject.pyx":598 * try: * PyObject_GetBuffer(b, &view, PyBUF_CONTIG_RO) * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWwrite(self.ops, view.buf, 1, view.len) * finally: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } } /* "pygame_sdl2/rwobject.pyx":601 * rv = SDL_RWwrite(self.ops, view.buf, 1, view.len) * finally: * PyBuffer_Release(&view) # <<<<<<<<<<<<<< * * if rv < 0: */ /*finally:*/ { /*normal exit:*/{ PyBuffer_Release((&__pyx_v_view)); goto __pyx_L7; } __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { PyBuffer_Release((&__pyx_v_view)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; } __pyx_L7:; } /* "pygame_sdl2/rwobject.pyx":603 * PyBuffer_Release(&view) * * if rv < 0: # <<<<<<<<<<<<<< * raise IOError("Could not write: {}".format(SDL_GetError())) * */ __pyx_t_1 = (__pyx_v_rv < 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":604 * * if rv < 0: * raise IOError("Could not write: {}".format(SDL_GetError())) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Could_not_write, __pyx_n_s_format); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_15 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_15 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_13}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_12, 0, 0, 0); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(0, 604, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":603 * PyBuffer_Release(&view) * * if rv < 0: # <<<<<<<<<<<<<< * raise IOError("Could not write: {}".format(SDL_GetError())) * */ } /* "pygame_sdl2/rwobject.pyx":606 * raise IOError("Could not write: {}".format(SDL_GetError())) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_12 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_r = __pyx_t_12; __pyx_t_12 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":586 * return rv * * def write(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.write", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":497 * * cdef SDL_RWops *ops * cdef public object name # <<<<<<<<<<<<<< * cdef public object base * cdef public object length */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name___get__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name___get__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->name); __pyx_r = __pyx_v_self->name; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_2__set__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_2__set__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 1); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_5__del__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_4__del__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_4__del__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":498 * cdef SDL_RWops *ops * cdef public object name * cdef public object base # <<<<<<<<<<<<<< * cdef public object length * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base___get__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base___get__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->base); __pyx_r = __pyx_v_self->base; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_2__set__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_2__set__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 1); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_5__del__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_4__del__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_4__del__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":499 * cdef public object name * cdef public object base * cdef public object length # <<<<<<<<<<<<<< * * def __dealloc__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length___get__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length___get__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->length); __pyx_r = __pyx_v_self->length; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_2__set__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_2__set__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 1); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->length); __Pyx_DECREF(__pyx_v_self->length); __pyx_v_self->length = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_5__del__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_4__del__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_4__del__(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->length); __Pyx_DECREF(__pyx_v_self->length); __pyx_v_self->length = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_17__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_16__reduce_cython__, "RWopsIOImpl.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_17__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_16__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_17__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_16__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_ops_cannot_be_converted_to, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_19__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_18__setstate_cython__, "RWopsIOImpl.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_19__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_18__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_19__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_18__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_11RWopsIOImpl_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_ops_cannot_be_converted_to, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIOImpl.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":609 * * * cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: # <<<<<<<<<<<<<< * return to_rwops(filelike, "rb", None, None) * */ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython(PyObject *__pyx_v_filelike) { SDL_RWops *__pyx_r; SDL_RWops *__pyx_t_1; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/rwobject.pyx":610 * * cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: * return to_rwops(filelike, "rb", None, None) # <<<<<<<<<<<<<< * * */ __pyx_t_2.__pyx_n = 3; __pyx_t_2.mode = __pyx_n_s_rb; __pyx_t_2.base = Py_None; __pyx_t_2.length = Py_None; __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filelike, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 610, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":609 * * * cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: # <<<<<<<<<<<<<< * return to_rwops(filelike, "rb", None, None) * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsFromPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":615 * class RWopsIO(io.RawIOBase): * * def __init__(self, filelike, mode='rb', base=None, length=None, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object. All parameter are passed to to_rwops */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO___init__, "RWopsIO.__init__(self, filelike, mode='rb', base=None, length=None, name=None)\n\n Creates a new RWopsIO object. All parameter are passed to to_rwops\n to create the SDL_RWops object.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO___init__}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_filelike = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_base = 0; PyObject *__pyx_v_length = 0; PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filelike,&__pyx_n_s_mode,&__pyx_n_s_base,&__pyx_n_s_length,&__pyx_n_s_name,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_s_rb))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filelike)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 6, 1); __PYX_ERR(0, 615, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_base); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 615, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_filelike = values[1]; __pyx_v_mode = values[2]; __pyx_v_base = values[3]; __pyx_v_length = values[4]; __pyx_v_name = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 6, __pyx_nargs); __PYX_ERR(0, 615, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO___init__(__pyx_self, __pyx_v_self, __pyx_v_filelike, __pyx_v_mode, __pyx_v_base, __pyx_v_length, __pyx_v_name); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filelike, PyObject *__pyx_v_mode, PyObject *__pyx_v_base, PyObject *__pyx_v_length, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/rwobject.pyx":621 * """ * * io.RawIOBase.__init__(self) # <<<<<<<<<<<<<< * * self.raw = RWopsIOImpl(filelike, mode=mode, base=base, length=length, name=name) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RawIOBase); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":623 * io.RawIOBase.__init__(self) * * self.raw = RWopsIOImpl(filelike, mode=mode, base=base, length=length, name=name) # <<<<<<<<<<<<<< * * self.close = self.raw.close */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_filelike); __Pyx_GIVEREF(__pyx_v_filelike); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filelike)) __PYX_ERR(0, 623, __pyx_L1_error); __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mode, __pyx_v_mode) < 0) __PYX_ERR(0, 623, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_base, __pyx_v_base) < 0) __PYX_ERR(0, 623, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_length, __pyx_v_length) < 0) __PYX_ERR(0, 623, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 623, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_raw, __pyx_t_3) < 0) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":625 * self.raw = RWopsIOImpl(filelike, mode=mode, base=base, length=length, name=name) * * self.close = self.raw.close # <<<<<<<<<<<<<< * self.seek = self.raw.seek * self.tell = self.raw.tell */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":626 * * self.close = self.raw.close * self.seek = self.raw.seek # <<<<<<<<<<<<<< * self.tell = self.raw.tell * self.write = self.raw.write */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_seek); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_seek, __pyx_t_3) < 0) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":627 * self.close = self.raw.close * self.seek = self.raw.seek * self.tell = self.raw.tell # <<<<<<<<<<<<<< * self.write = self.raw.write * self.readinto = self.raw.readinto */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tell); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tell, __pyx_t_2) < 0) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":628 * self.seek = self.raw.seek * self.tell = self.raw.tell * self.write = self.raw.write # <<<<<<<<<<<<<< * self.readinto = self.raw.readinto * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_write, __pyx_t_3) < 0) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":629 * self.tell = self.raw.tell * self.write = self.raw.write * self.readinto = self.raw.readinto # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_readinto); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_readinto, __pyx_t_2) < 0) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":615 * class RWopsIO(io.RawIOBase): * * def __init__(self, filelike, mode='rb', base=None, length=None, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object. All parameter are passed to to_rwops */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":631 * self.readinto = self.raw.readinto * * def __repr__(self): # <<<<<<<<<<<<<< * if self.raw.base is not None: * return "".format(self.raw.name, self.raw.base, self.raw.length) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_3__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_2__repr__, "RWopsIO.__repr__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_3__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_2__repr__}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_3__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 631, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 631, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 631, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_2__repr__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/rwobject.pyx":632 * * def __repr__(self): * if self.raw.base is not None: # <<<<<<<<<<<<<< * return "".format(self.raw.name, self.raw.base, self.raw.length) * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":633 * def __repr__(self): * if self.raw.base is not None: * return "".format(self.raw.name, self.raw.base, self.raw.length) # <<<<<<<<<<<<<< * else: * return "".format(self.raw.name) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_RWopsIO_r_base_r_length_r, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":632 * * def __repr__(self): * if self.raw.base is not None: # <<<<<<<<<<<<<< * return "".format(self.raw.name, self.raw.base, self.raw.length) * else: */ } /* "pygame_sdl2/rwobject.pyx":635 * return "".format(self.raw.name, self.raw.base, self.raw.length) * else: * return "".format(self.raw.name) # <<<<<<<<<<<<<< * * # Implemented class: io.IOBase */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_RWopsIO_r, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/rwobject.pyx":631 * self.readinto = self.raw.readinto * * def __repr__(self): # <<<<<<<<<<<<<< * if self.raw.base is not None: * return "".format(self.raw.name, self.raw.base, self.raw.length) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":641 * # close is taken from RWopsIOImpl. * * @property # <<<<<<<<<<<<<< * def closed(self): * return self.raw.is_closed() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_5closed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_4closed, "RWopsIO.closed(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_5closed = {"closed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_5closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_4closed}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_5closed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("closed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closed") < 0)) __PYX_ERR(0, 641, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("closed", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 641, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.closed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_4closed(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_4closed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("closed", 1); /* "pygame_sdl2/rwobject.pyx":643 * @property * def closed(self): * return self.raw.is_closed() # <<<<<<<<<<<<<< * * def fileno(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_closed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":641 * # close is taken from RWopsIOImpl. * * @property # <<<<<<<<<<<<<< * def closed(self): * return self.raw.is_closed() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.closed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":645 * return self.raw.is_closed() * * def fileno(self): # <<<<<<<<<<<<<< * raise OSError() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_7fileno(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_6fileno, "RWopsIO.fileno(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_7fileno = {"fileno", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_7fileno, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_6fileno}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_7fileno(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fileno (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fileno") < 0)) __PYX_ERR(0, 645, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fileno", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 645, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_6fileno(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_6fileno(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fileno", 1); /* "pygame_sdl2/rwobject.pyx":646 * * def fileno(self): * raise OSError() # <<<<<<<<<<<<<< * * # inherited flush is used */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_OSError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 646, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":645 * return self.raw.is_closed() * * def fileno(self): # <<<<<<<<<<<<<< * raise OSError() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":652 * # inherited isatty is used * * def readable(self): # <<<<<<<<<<<<<< * return True * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_9readable(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_8readable, "RWopsIO.readable(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_9readable = {"readable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_9readable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_8readable}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_9readable(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("readable (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 652, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "readable") < 0)) __PYX_ERR(0, 652, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("readable", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 652, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.readable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_8readable(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_8readable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("readable", 1); /* "pygame_sdl2/rwobject.pyx":653 * * def readable(self): * return True # <<<<<<<<<<<<<< * * # inherited readline is used */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":652 * # inherited isatty is used * * def readable(self): # <<<<<<<<<<<<<< * return True * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":661 * # seek is taken from RWopsIOImpl. * * def seekable(self): # <<<<<<<<<<<<<< * return True * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_11seekable(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_10seekable, "RWopsIO.seekable(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_11seekable = {"seekable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_11seekable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_10seekable}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_11seekable(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seekable (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 661, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "seekable") < 0)) __PYX_ERR(0, 661, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("seekable", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 661, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.seekable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_10seekable(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_10seekable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("seekable", 1); /* "pygame_sdl2/rwobject.pyx":662 * * def seekable(self): * return True # <<<<<<<<<<<<<< * * # tell is taken from RWopsIOImpl. */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":661 * # seek is taken from RWopsIOImpl. * * def seekable(self): # <<<<<<<<<<<<<< * return True * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":666 * # tell is taken from RWopsIOImpl. * * def truncate(self, size=None): # <<<<<<<<<<<<<< * raise OSError() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_13truncate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_12truncate, "RWopsIO.truncate(self, size=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_13truncate = {"truncate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_13truncate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_12truncate}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_13truncate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("truncate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_size,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "truncate") < 0)) __PYX_ERR(0, 666, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_size = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("truncate", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 666, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_12truncate(__pyx_self, __pyx_v_self, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_12truncate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("truncate", 1); /* "pygame_sdl2/rwobject.pyx":667 * * def truncate(self, size=None): * raise OSError() # <<<<<<<<<<<<<< * * def writable(self): */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_OSError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 667, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":666 * # tell is taken from RWopsIOImpl. * * def truncate(self, size=None): # <<<<<<<<<<<<<< * raise OSError() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":669 * raise OSError() * * def writable(self): # <<<<<<<<<<<<<< * return True * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_15writable(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_14writable, "RWopsIO.writable(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_15writable = {"writable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_15writable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_14writable}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_15writable(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("writable (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 669, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "writable") < 0)) __PYX_ERR(0, 669, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("writable", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 669, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.writable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_14writable(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_14writable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("writable", 1); /* "pygame_sdl2/rwobject.pyx":670 * * def writable(self): * return True # <<<<<<<<<<<<<< * * # inherited writelines is used */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":669 * raise OSError() * * def writable(self): # <<<<<<<<<<<<<< * return True * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":686 * # write is taken from RWopsIOImpl. * * @staticmethod # <<<<<<<<<<<<<< * def from_buffer(buffer, mode="rb", name=None): * """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_17from_buffer(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_16from_buffer, "RWopsIO.from_buffer(buffer, mode='rb', name=None)\n\n Creates a new RWopsIO object from a buffer.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_17from_buffer = {"from_buffer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_17from_buffer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_16from_buffer}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_17from_buffer(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_buffer = 0; CYTHON_UNUSED PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("from_buffer (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buffer,&__pyx_n_s_mode,&__pyx_n_s_name,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_s_rb))); /* "pygame_sdl2/rwobject.pyx":687 * * @staticmethod * def from_buffer(buffer, mode="rb", name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object from a buffer. */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffer)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_buffer") < 0)) __PYX_ERR(0, 686, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_buffer = values[0]; __pyx_v_mode = values[1]; __pyx_v_name = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("from_buffer", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 686, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.from_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_16from_buffer(__pyx_self, __pyx_v_buffer, __pyx_v_mode, __pyx_v_name); /* "pygame_sdl2/rwobject.pyx":686 * # write is taken from RWopsIOImpl. * * @staticmethod # <<<<<<<<<<<<<< * def from_buffer(buffer, mode="rb", name=None): * """ */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_16from_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buffer, CYTHON_UNUSED PyObject *__pyx_v_mode, PyObject *__pyx_v_name) { struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *__pyx_v_bf; SDL_RWops *__pyx_v_rw; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; Uint8 *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_buffer", 1); /* "pygame_sdl2/rwobject.pyx":695 * cdef SDL_RWops *rw * * if not PyObject_CheckBuffer(buffer): # <<<<<<<<<<<<<< * raise ValueError("Passed in object does not support buffer protocol") * */ __pyx_t_1 = (!PyObject_CheckBuffer(__pyx_v_buffer)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":696 * * if not PyObject_CheckBuffer(buffer): * raise ValueError("Passed in object does not support buffer protocol") # <<<<<<<<<<<<<< * * bf = calloc(sizeof(BufFile), 1) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 696, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":695 * cdef SDL_RWops *rw * * if not PyObject_CheckBuffer(buffer): # <<<<<<<<<<<<<< * raise ValueError("Passed in object does not support buffer protocol") * */ } /* "pygame_sdl2/rwobject.pyx":698 * raise ValueError("Passed in object does not support buffer protocol") * * bf = calloc(sizeof(BufFile), 1) # <<<<<<<<<<<<<< * if bf == NULL: * raise MemoryError() */ __pyx_v_bf = ((struct __pyx_t_11pygame_sdl2_8rwobject_BufFile *)calloc((sizeof(struct __pyx_t_11pygame_sdl2_8rwobject_BufFile)), 1)); /* "pygame_sdl2/rwobject.pyx":699 * * bf = calloc(sizeof(BufFile), 1) * if bf == NULL: # <<<<<<<<<<<<<< * raise MemoryError() * */ __pyx_t_1 = (__pyx_v_bf == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":700 * bf = calloc(sizeof(BufFile), 1) * if bf == NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * if PyObject_GetBuffer(buffer, &bf.view, PyBUF_CONTIG_RO) < 0: */ PyErr_NoMemory(); __PYX_ERR(0, 700, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":699 * * bf = calloc(sizeof(BufFile), 1) * if bf == NULL: # <<<<<<<<<<<<<< * raise MemoryError() * */ } /* "pygame_sdl2/rwobject.pyx":702 * raise MemoryError() * * if PyObject_GetBuffer(buffer, &bf.view, PyBUF_CONTIG_RO) < 0: # <<<<<<<<<<<<<< * free(bf) * raise ValueError("Could not get buffer.") */ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_buffer, (&__pyx_v_bf->view), PyBUF_CONTIG_RO); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 702, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 < 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":703 * * if PyObject_GetBuffer(buffer, &bf.view, PyBUF_CONTIG_RO) < 0: * free(bf) # <<<<<<<<<<<<<< * raise ValueError("Could not get buffer.") * */ free(__pyx_v_bf); /* "pygame_sdl2/rwobject.pyx":704 * if PyObject_GetBuffer(buffer, &bf.view, PyBUF_CONTIG_RO) < 0: * free(bf) * raise ValueError("Could not get buffer.") # <<<<<<<<<<<<<< * * bf.base = bf.view.buf */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 704, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":702 * raise MemoryError() * * if PyObject_GetBuffer(buffer, &bf.view, PyBUF_CONTIG_RO) < 0: # <<<<<<<<<<<<<< * free(bf) * raise ValueError("Could not get buffer.") */ } /* "pygame_sdl2/rwobject.pyx":706 * raise ValueError("Could not get buffer.") * * bf.base = bf.view.buf # <<<<<<<<<<<<<< * bf.here = bf.base * bf.stop = bf.base + bf.view.len */ __pyx_v_bf->base = ((Uint8 *)__pyx_v_bf->view.buf); /* "pygame_sdl2/rwobject.pyx":707 * * bf.base = bf.view.buf * bf.here = bf.base # <<<<<<<<<<<<<< * bf.stop = bf.base + bf.view.len * */ __pyx_t_4 = __pyx_v_bf->base; __pyx_v_bf->here = __pyx_t_4; /* "pygame_sdl2/rwobject.pyx":708 * bf.base = bf.view.buf * bf.here = bf.base * bf.stop = bf.base + bf.view.len # <<<<<<<<<<<<<< * * rw = SDL_AllocRW() */ __pyx_v_bf->stop = (__pyx_v_bf->base + __pyx_v_bf->view.len); /* "pygame_sdl2/rwobject.pyx":710 * bf.stop = bf.base + bf.view.len * * rw = SDL_AllocRW() # <<<<<<<<<<<<<< * rw.size = buffile_size * rw.seek = buffile_seek */ __pyx_v_rw = SDL_AllocRW(); /* "pygame_sdl2/rwobject.pyx":711 * * rw = SDL_AllocRW() * rw.size = buffile_size # <<<<<<<<<<<<<< * rw.seek = buffile_seek * rw.read = buffile_read */ __pyx_v_rw->size = __pyx_f_11pygame_sdl2_8rwobject_buffile_size; /* "pygame_sdl2/rwobject.pyx":712 * rw = SDL_AllocRW() * rw.size = buffile_size * rw.seek = buffile_seek # <<<<<<<<<<<<<< * rw.read = buffile_read * rw.write = buffile_write */ __pyx_v_rw->seek = __pyx_f_11pygame_sdl2_8rwobject_buffile_seek; /* "pygame_sdl2/rwobject.pyx":713 * rw.size = buffile_size * rw.seek = buffile_seek * rw.read = buffile_read # <<<<<<<<<<<<<< * rw.write = buffile_write * rw.close = buffile_close */ __pyx_v_rw->read = __pyx_f_11pygame_sdl2_8rwobject_buffile_read; /* "pygame_sdl2/rwobject.pyx":714 * rw.seek = buffile_seek * rw.read = buffile_read * rw.write = buffile_write # <<<<<<<<<<<<<< * rw.close = buffile_close * rw.type = 0 */ __pyx_v_rw->write = __pyx_f_11pygame_sdl2_8rwobject_buffile_write; /* "pygame_sdl2/rwobject.pyx":715 * rw.read = buffile_read * rw.write = buffile_write * rw.close = buffile_close # <<<<<<<<<<<<<< * rw.type = 0 * rw.hidden.unknown.data1 = bf */ __pyx_v_rw->close = __pyx_f_11pygame_sdl2_8rwobject_buffile_close; /* "pygame_sdl2/rwobject.pyx":716 * rw.write = buffile_write * rw.close = buffile_close * rw.type = 0 # <<<<<<<<<<<<<< * rw.hidden.unknown.data1 = bf * */ __pyx_v_rw->type = 0; /* "pygame_sdl2/rwobject.pyx":717 * rw.close = buffile_close * rw.type = 0 * rw.hidden.unknown.data1 = bf # <<<<<<<<<<<<<< * * rv = RWopsIO(None, name=name) */ __pyx_v_rw->hidden.unknown.data1 = ((void *)__pyx_v_bf); /* "pygame_sdl2/rwobject.pyx":719 * rw.hidden.unknown.data1 = bf * * rv = RWopsIO(None, name=name) # <<<<<<<<<<<<<< * ( rv.raw).ops = rw * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RWopsIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 719, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_rv = __pyx_t_6; __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":720 * * rv = RWopsIO(None, name=name) * ( rv.raw).ops = rw # <<<<<<<<<<<<<< * return rv * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rv, __pyx_n_s_raw); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); ((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_t_6)->ops = __pyx_v_rw; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":721 * rv = RWopsIO(None, name=name) * ( rv.raw).ops = rw * return rv # <<<<<<<<<<<<<< * * @staticmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":686 * # write is taken from RWopsIOImpl. * * @staticmethod # <<<<<<<<<<<<<< * def from_buffer(buffer, mode="rb", name=None): * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.from_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":723 * return rv * * @staticmethod # <<<<<<<<<<<<<< * def from_split(a, b, name=None): * """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_19from_split(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_18from_split, "RWopsIO.from_split(a, b, name=None)\n\n Creates a new RWopsIO object from two other RWopsIO objects,\n representing the concatenation of the two.\n "); static PyMethodDef __pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_19from_split = {"from_split", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_19from_split, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_7RWopsIO_18from_split}; static PyObject *__pyx_pw_11pygame_sdl2_8rwobject_7RWopsIO_19from_split(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_a = 0; PyObject *__pyx_v_b = 0; PyObject *__pyx_v_name = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("from_split (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_name,0}; /* "pygame_sdl2/rwobject.pyx":724 * * @staticmethod * def from_split(a, b, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object from two other RWopsIO objects, */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("from_split", 0, 2, 3, 1); __PYX_ERR(0, 723, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_split") < 0)) __PYX_ERR(0, 723, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_a = values[0]; __pyx_v_b = values[1]; __pyx_v_name = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("from_split", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 723, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.from_split", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_18from_split(__pyx_self, __pyx_v_a, __pyx_v_b, __pyx_v_name); /* "pygame_sdl2/rwobject.pyx":723 * return rv * * @staticmethod # <<<<<<<<<<<<<< * def from_split(a, b, name=None): * """ */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8rwobject_7RWopsIO_18from_split(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_name) { struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *__pyx_v_sf; SDL_RWops *__pyx_v_rw; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; SDL_RWops *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_split", 1); /* "pygame_sdl2/rwobject.pyx":733 * cdef SDL_RWops *rw * * sf = calloc(sizeof(SplitFile), 1) # <<<<<<<<<<<<<< * if sf == NULL: * raise MemoryError() */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile *)calloc((sizeof(struct __pyx_t_11pygame_sdl2_8rwobject_SplitFile)), 1)); /* "pygame_sdl2/rwobject.pyx":734 * * sf = calloc(sizeof(SplitFile), 1) * if sf == NULL: # <<<<<<<<<<<<<< * raise MemoryError() * */ __pyx_t_1 = (__pyx_v_sf == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/rwobject.pyx":735 * sf = calloc(sizeof(SplitFile), 1) * if sf == NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * sf.a = to_rwops(a) */ PyErr_NoMemory(); __PYX_ERR(0, 735, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":734 * * sf = calloc(sizeof(SplitFile), 1) * if sf == NULL: # <<<<<<<<<<<<<< * raise MemoryError() * */ } /* "pygame_sdl2/rwobject.pyx":737 * raise MemoryError() * * sf.a = to_rwops(a) # <<<<<<<<<<<<<< * sf.b = to_rwops(b) * sf.split = SDL_RWsize(sf.a) */ __pyx_t_2 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_a, NULL); if (unlikely(__pyx_t_2 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 737, __pyx_L1_error) __pyx_v_sf->a = __pyx_t_2; /* "pygame_sdl2/rwobject.pyx":738 * * sf.a = to_rwops(a) * sf.b = to_rwops(b) # <<<<<<<<<<<<<< * sf.split = SDL_RWsize(sf.a) * sf.tell = 0 */ __pyx_t_2 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_b, NULL); if (unlikely(__pyx_t_2 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 738, __pyx_L1_error) __pyx_v_sf->b = __pyx_t_2; /* "pygame_sdl2/rwobject.pyx":739 * sf.a = to_rwops(a) * sf.b = to_rwops(b) * sf.split = SDL_RWsize(sf.a) # <<<<<<<<<<<<<< * sf.tell = 0 * */ __pyx_v_sf->split = SDL_RWsize(__pyx_v_sf->a); /* "pygame_sdl2/rwobject.pyx":740 * sf.b = to_rwops(b) * sf.split = SDL_RWsize(sf.a) * sf.tell = 0 # <<<<<<<<<<<<<< * * rw = SDL_AllocRW() */ __pyx_v_sf->tell = 0; /* "pygame_sdl2/rwobject.pyx":742 * sf.tell = 0 * * rw = SDL_AllocRW() # <<<<<<<<<<<<<< * rw.size = splitfile_size * rw.seek = splitfile_seek */ __pyx_v_rw = SDL_AllocRW(); /* "pygame_sdl2/rwobject.pyx":743 * * rw = SDL_AllocRW() * rw.size = splitfile_size # <<<<<<<<<<<<<< * rw.seek = splitfile_seek * rw.read = splitfile_read */ __pyx_v_rw->size = __pyx_f_11pygame_sdl2_8rwobject_splitfile_size; /* "pygame_sdl2/rwobject.pyx":744 * rw = SDL_AllocRW() * rw.size = splitfile_size * rw.seek = splitfile_seek # <<<<<<<<<<<<<< * rw.read = splitfile_read * rw.write = NULL */ __pyx_v_rw->seek = __pyx_f_11pygame_sdl2_8rwobject_splitfile_seek; /* "pygame_sdl2/rwobject.pyx":745 * rw.size = splitfile_size * rw.seek = splitfile_seek * rw.read = splitfile_read # <<<<<<<<<<<<<< * rw.write = NULL * rw.close = splitfile_close */ __pyx_v_rw->read = __pyx_f_11pygame_sdl2_8rwobject_splitfile_read; /* "pygame_sdl2/rwobject.pyx":746 * rw.seek = splitfile_seek * rw.read = splitfile_read * rw.write = NULL # <<<<<<<<<<<<<< * rw.close = splitfile_close * rw.type = 0 */ __pyx_v_rw->write = NULL; /* "pygame_sdl2/rwobject.pyx":747 * rw.read = splitfile_read * rw.write = NULL * rw.close = splitfile_close # <<<<<<<<<<<<<< * rw.type = 0 * rw.hidden.unknown.data1 = sf */ __pyx_v_rw->close = __pyx_f_11pygame_sdl2_8rwobject_splitfile_close; /* "pygame_sdl2/rwobject.pyx":748 * rw.write = NULL * rw.close = splitfile_close * rw.type = 0 # <<<<<<<<<<<<<< * rw.hidden.unknown.data1 = sf * */ __pyx_v_rw->type = 0; /* "pygame_sdl2/rwobject.pyx":749 * rw.close = splitfile_close * rw.type = 0 * rw.hidden.unknown.data1 = sf # <<<<<<<<<<<<<< * * rv = RWopsIO(None, name=name) */ __pyx_v_rw->hidden.unknown.data1 = ((void *)__pyx_v_sf); /* "pygame_sdl2/rwobject.pyx":751 * rw.hidden.unknown.data1 = sf * * rv = RWopsIO(None, name=name) # <<<<<<<<<<<<<< * ( rv.raw).ops = rw * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RWopsIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 751, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_rv = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":752 * * rv = RWopsIO(None, name=name) * ( rv.raw).ops = rw # <<<<<<<<<<<<<< * return rv * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rv, __pyx_n_s_raw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); ((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)__pyx_t_5)->ops = __pyx_v_rw; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":753 * rv = RWopsIO(None, name=name) * ( rv.raw).ops = rw * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":723 * return rv * * @staticmethod # <<<<<<<<<<<<<< * def from_split(a, b, name=None): * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsIO.from_split", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_8rwobject_RWopsIOImpl(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)o); p->name = Py_None; Py_INCREF(Py_None); p->base = Py_None; Py_INCREF(Py_None); p->length = Py_None; Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_8rwobject_RWopsIOImpl(PyObject *o) { struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *p = (struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_8rwobject_RWopsIOImpl) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_1__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->name); Py_CLEAR(p->base); Py_CLEAR(p->length); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_8rwobject_RWopsIOImpl(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *p = (struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)o; if (p->name) { e = (*v)(p->name, a); if (e) return e; } if (p->base) { e = (*v)(p->base, a); if (e) return e; } if (p->length) { e = (*v)(p->length, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_8rwobject_RWopsIOImpl(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *p = (struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl *)o; tmp = ((PyObject*)p->name); p->name = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->base); p->base = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->length); p->length = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_3__set__(o, v); } else { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4name_5__del__(o); } } static PyObject *__pyx_getprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_base(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_base(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_3__set__(o, v); } else { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_4base_5__del__(o); } } static PyObject *__pyx_getprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_length(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_length(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_3__set__(o, v); } else { return __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_6length_5__del__(o); } } static PyMethodDef __pyx_methods_11pygame_sdl2_8rwobject_RWopsIOImpl[] = { {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_5close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_4close}, {"is_closed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_7is_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_6is_closed}, {"seek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_9seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_8seek}, {"tell", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_11tell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_10tell}, {"readinto", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_13readinto, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_12readinto}, {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_15write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_14write}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_16__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_18__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_8rwobject_RWopsIOImpl[] = { {(char *)"name", __pyx_getprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_name, __pyx_setprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_name, (char *)PyDoc_STR("name: object"), 0}, {(char *)"base", __pyx_getprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_base, __pyx_setprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_base, (char *)PyDoc_STR("base: object"), 0}, {(char *)"length", __pyx_getprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_length, __pyx_setprop_11pygame_sdl2_8rwobject_11RWopsIOImpl_length, (char *)PyDoc_STR("length: object"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_8rwobject_RWopsIOImpl}, {Py_tp_doc, (void *)PyDoc_STR("RWopsIOImpl(filelike, mode='rb', base=None, length=None, name=None)\n\n This wraps an SDL_RWops object in a Python file-like object.\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_8rwobject_RWopsIOImpl}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_8rwobject_RWopsIOImpl}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_8rwobject_RWopsIOImpl}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_8rwobject_RWopsIOImpl}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_3__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_8rwobject_RWopsIOImpl}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl_spec = { "pygame_sdl2.rwobject.RWopsIOImpl", sizeof(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.rwobject.""RWopsIOImpl", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_8rwobject_RWopsIOImpl), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_8rwobject_RWopsIOImpl, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("RWopsIOImpl(filelike, mode='rb', base=None, length=None, name=None)\n\n This wraps an SDL_RWops object in a Python file-like object.\n "), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_8rwobject_RWopsIOImpl, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_8rwobject_RWopsIOImpl, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_8rwobject_RWopsIOImpl, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_8rwobject_RWopsIOImpl, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_8rwobject_11RWopsIOImpl_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_8rwobject_RWopsIOImpl, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_kp_s_Could_not_get_buffer, __pyx_k_Could_not_get_buffer, sizeof(__pyx_k_Could_not_get_buffer), 0, 0, 1, 0}, {&__pyx_kp_s_Could_not_open_r, __pyx_k_Could_not_open_r, sizeof(__pyx_k_Could_not_open_r), 0, 0, 1, 0}, {&__pyx_kp_s_Could_not_read, __pyx_k_Could_not_read, sizeof(__pyx_k_Could_not_read), 0, 0, 1, 0}, {&__pyx_kp_s_Could_not_seek, __pyx_k_Could_not_seek, sizeof(__pyx_k_Could_not_seek), 0, 0, 1, 0}, {&__pyx_kp_s_Could_not_write, __pyx_k_Could_not_write, sizeof(__pyx_k_Could_not_write), 0, 0, 1, 0}, {&__pyx_n_s_IOBase, __pyx_k_IOBase, sizeof(__pyx_k_IOBase), 0, 0, 1, 1}, {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, {&__pyx_kp_s_I_O_on_closed_file, __pyx_k_I_O_on_closed_file, sizeof(__pyx_k_I_O_on_closed_file), 0, 0, 1, 0}, {&__pyx_kp_s_I_O_operation_on_closed_file, __pyx_k_I_O_operation_on_closed_file, sizeof(__pyx_k_I_O_operation_on_closed_file), 0, 0, 1, 0}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1}, {&__pyx_kp_s_Passed_in_object_does_not_suppor, __pyx_k_Passed_in_object_does_not_suppor, sizeof(__pyx_k_Passed_in_object_does_not_suppor), 0, 0, 1, 0}, {&__pyx_n_s_RWopsIO, __pyx_k_RWopsIO, sizeof(__pyx_k_RWopsIO), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl, __pyx_k_RWopsIOImpl, sizeof(__pyx_k_RWopsIOImpl), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl___reduce_cython, __pyx_k_RWopsIOImpl___reduce_cython, sizeof(__pyx_k_RWopsIOImpl___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl___setstate_cython, __pyx_k_RWopsIOImpl___setstate_cython, sizeof(__pyx_k_RWopsIOImpl___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl_close, __pyx_k_RWopsIOImpl_close, sizeof(__pyx_k_RWopsIOImpl_close), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl_is_closed, __pyx_k_RWopsIOImpl_is_closed, sizeof(__pyx_k_RWopsIOImpl_is_closed), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl_readinto, __pyx_k_RWopsIOImpl_readinto, sizeof(__pyx_k_RWopsIOImpl_readinto), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl_seek, __pyx_k_RWopsIOImpl_seek, sizeof(__pyx_k_RWopsIOImpl_seek), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl_tell, __pyx_k_RWopsIOImpl_tell, sizeof(__pyx_k_RWopsIOImpl_tell), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIOImpl_write, __pyx_k_RWopsIOImpl_write, sizeof(__pyx_k_RWopsIOImpl_write), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO___init, __pyx_k_RWopsIO___init, sizeof(__pyx_k_RWopsIO___init), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO___repr, __pyx_k_RWopsIO___repr, sizeof(__pyx_k_RWopsIO___repr), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_closed, __pyx_k_RWopsIO_closed, sizeof(__pyx_k_RWopsIO_closed), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_fileno, __pyx_k_RWopsIO_fileno, sizeof(__pyx_k_RWopsIO_fileno), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_from_buffer, __pyx_k_RWopsIO_from_buffer, sizeof(__pyx_k_RWopsIO_from_buffer), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_from_split, __pyx_k_RWopsIO_from_split, sizeof(__pyx_k_RWopsIO_from_split), 0, 0, 1, 1}, {&__pyx_kp_s_RWopsIO_r, __pyx_k_RWopsIO_r, sizeof(__pyx_k_RWopsIO_r), 0, 0, 1, 0}, {&__pyx_kp_s_RWopsIO_r_base_r_length_r, __pyx_k_RWopsIO_r_base_r_length_r, sizeof(__pyx_k_RWopsIO_r_base_r_length_r), 0, 0, 1, 0}, {&__pyx_n_s_RWopsIO_readable, __pyx_k_RWopsIO_readable, sizeof(__pyx_k_RWopsIO_readable), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_seekable, __pyx_k_RWopsIO_seekable, sizeof(__pyx_k_RWopsIO_seekable), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_truncate, __pyx_k_RWopsIO_truncate, sizeof(__pyx_k_RWopsIO_truncate), 0, 0, 1, 1}, {&__pyx_n_s_RWopsIO_writable, __pyx_k_RWopsIO_writable, sizeof(__pyx_k_RWopsIO_writable), 0, 0, 1, 1}, {&__pyx_n_s_RawIOBase, __pyx_k_RawIOBase, sizeof(__pyx_k_RawIOBase), 0, 0, 1, 1}, {&__pyx_n_s_SEEK_CUR, __pyx_k_SEEK_CUR, sizeof(__pyx_k_SEEK_CUR), 0, 0, 1, 1}, {&__pyx_n_s_SEEK_END, __pyx_k_SEEK_END, sizeof(__pyx_k_SEEK_END), 0, 0, 1, 1}, {&__pyx_n_s_SEEK_SET, __pyx_k_SEEK_SET, sizeof(__pyx_k_SEEK_SET), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_s_Unknown_value_for_whence, __pyx_k_Unknown_value_for_whence, sizeof(__pyx_k_Unknown_value_for_whence), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 0, 1, 1}, {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, {&__pyx_n_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 1}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_s_bf, __pyx_k_bf, sizeof(__pyx_k_bf), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_file_type, __pyx_k_file_type, sizeof(__pyx_k_file_type), 0, 0, 1, 1}, {&__pyx_n_s_filelike, __pyx_k_filelike, sizeof(__pyx_k_filelike), 0, 0, 1, 1}, {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_from_buffer, __pyx_k_from_buffer, sizeof(__pyx_k_from_buffer), 0, 0, 1, 1}, {&__pyx_n_s_from_split, __pyx_k_from_split, sizeof(__pyx_k_from_split), 0, 0, 1, 1}, {&__pyx_n_s_fsencoding, __pyx_k_fsencoding, sizeof(__pyx_k_fsencoding), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1}, {&__pyx_n_s_is_closed, __pyx_k_is_closed, sizeof(__pyx_k_is_closed), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_compat, __pyx_k_pygame_sdl2_compat, sizeof(__pyx_k_pygame_sdl2_compat), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rwobject, __pyx_k_pygame_sdl2_rwobject, sizeof(__pyx_k_pygame_sdl2_rwobject), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_kp_s_r_is_not_a_filename_or_file_lik, __pyx_k_r_is_not_a_filename_or_file_lik, sizeof(__pyx_k_r_is_not_a_filename_or_file_lik), 0, 0, 1, 0}, {&__pyx_n_s_raw, __pyx_k_raw, sizeof(__pyx_k_raw), 0, 0, 1, 1}, {&__pyx_n_b_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 0, 1}, {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1}, {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, {&__pyx_n_s_readable, __pyx_k_readable, sizeof(__pyx_k_readable), 0, 0, 1, 1}, {&__pyx_n_s_readinto, __pyx_k_readinto, sizeof(__pyx_k_readinto), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_rw, __pyx_k_rw, sizeof(__pyx_k_rw), 0, 0, 1, 1}, {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1}, {&__pyx_n_s_seekable, __pyx_k_seekable, sizeof(__pyx_k_seekable), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_kp_s_self_ops_cannot_be_converted_to, __pyx_k_self_ops_cannot_be_converted_to, sizeof(__pyx_k_self_ops_cannot_be_converted_to), 0, 0, 1, 0}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_sf, __pyx_k_sf, sizeof(__pyx_k_sf), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_k_src_pygame_sdl2_rwobject_pyx, sizeof(__pyx_k_src_pygame_sdl2_rwobject_pyx), 0, 0, 1, 0}, {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1}, {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, {&__pyx_n_s_whence, __pyx_k_whence, sizeof(__pyx_k_whence), 0, 0, 1, 1}, {&__pyx_n_s_whence_mapping, __pyx_k_whence_mapping, sizeof(__pyx_k_whence_mapping), 0, 0, 1, 1}, {&__pyx_n_s_whence_rw, __pyx_k_whence_rw, sizeof(__pyx_k_whence_rw), 0, 0, 1, 1}, {&__pyx_n_s_writable, __pyx_k_writable, sizeof(__pyx_k_writable), 0, 0, 1, 1}, {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 641, __pyx_L1_error) __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 686, __pyx_L1_error) __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 395, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 401, __pyx_L1_error) __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 428, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 646, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 700, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/rwobject.pyx":71 * try: * cur = f.tell() * f.seek(0, 2) # <<<<<<<<<<<<<< * rv = f.tell() * f.seek(cur, 0) */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_0, __pyx_int_2); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/rwobject.pyx":401 * rwopsio = filelike * if not rwopsio.ops: * raise ValueError("I/O on closed file.") # <<<<<<<<<<<<<< * * rv = rwopsio.ops */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_I_O_on_closed_file); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/rwobject.pyx":543 * * if not self.ops: * raise ValueError("I/O operation on closed file.") # <<<<<<<<<<<<<< * * whence_rw = whence_mapping.get(whence, RW_SEEK_SET) */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/rwobject.pyx":571 * * if not PyObject_CheckBuffer(b): * raise ValueError("Passed in object does not support buffer protocol") # <<<<<<<<<<<<<< * * try: */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Passed_in_object_does_not_suppor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/rwobject.pyx":704 * if PyObject_GetBuffer(buffer, &bf.view, PyBUF_CONTIG_RO) < 0: * free(bf) * raise ValueError("Could not get buffer.") # <<<<<<<<<<<<<< * * bf.base = bf.view.buf */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Could_not_get_buffer); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/rwobject.pyx":719 * rw.hidden.unknown.data1 = bf * * rv = RWopsIO(None, name=name) # <<<<<<<<<<<<<< * ( rv.raw).ops = rw * return rv */ __pyx_tuple__6 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/rwobject.pyx":527 * self.ops = NULL * * def close(self): # <<<<<<<<<<<<<< * * # A closed file may be closed again. */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_close, 527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 527, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":535 * self.ops = NULL * * def is_closed(self): # <<<<<<<<<<<<<< * return not self.ops * */ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_is_closed, 535, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 535, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":538 * return not self.ops * * def seek(self, long long offset, whence=0): # <<<<<<<<<<<<<< * cdef int whence_rw * cdef long long rv */ __pyx_tuple__12 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_offset, __pyx_n_s_whence, __pyx_n_s_whence_rw, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_seek, 538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 538, __pyx_L1_error) __pyx_tuple__14 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "pygame_sdl2/rwobject.pyx":555 * return rv * * def tell(self): # <<<<<<<<<<<<<< * cdef long long rv * */ __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_tell, 555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 555, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":563 * return rv * * def readinto(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ __pyx_tuple__17 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_b, __pyx_n_s_view, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_readinto, 563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 563, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":586 * return rv * * def write(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_write, 586, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 586, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" */ __pyx_tuple__21 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 3, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":615 * class RWopsIO(io.RawIOBase): * * def __init__(self, filelike, mode='rb', base=None, length=None, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object. All parameter are passed to to_rwops */ __pyx_tuple__23 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_filelike, __pyx_n_s_mode, __pyx_n_s_base, __pyx_n_s_length, __pyx_n_s_name); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_init, 615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 615, __pyx_L1_error) __pyx_tuple__25 = PyTuple_Pack(4, ((PyObject*)__pyx_n_s_rb), Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "pygame_sdl2/rwobject.pyx":631 * self.readinto = self.raw.readinto * * def __repr__(self): # <<<<<<<<<<<<<< * if self.raw.base is not None: * return "".format(self.raw.name, self.raw.base, self.raw.length) */ __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_repr, 631, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 631, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":641 * # close is taken from RWopsIOImpl. * * @property # <<<<<<<<<<<<<< * def closed(self): * return self.raw.is_closed() */ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_closed, 641, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 641, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":645 * return self.raw.is_closed() * * def fileno(self): # <<<<<<<<<<<<<< * raise OSError() * */ __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_fileno, 645, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 645, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":652 * # inherited isatty is used * * def readable(self): # <<<<<<<<<<<<<< * return True * */ __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_readable, 652, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 652, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":661 * # seek is taken from RWopsIOImpl. * * def seekable(self): # <<<<<<<<<<<<<< * return True * */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_seekable, 661, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 661, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":666 * # tell is taken from RWopsIOImpl. * * def truncate(self, size=None): # <<<<<<<<<<<<<< * raise OSError() * */ __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_size); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_truncate, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 666, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":669 * raise OSError() * * def writable(self): # <<<<<<<<<<<<<< * return True * */ __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_writable, 669, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 669, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":686 * # write is taken from RWopsIOImpl. * * @staticmethod # <<<<<<<<<<<<<< * def from_buffer(buffer, mode="rb", name=None): * """ */ __pyx_tuple__34 = PyTuple_Pack(6, __pyx_n_s_buffer, __pyx_n_s_mode, __pyx_n_s_name, __pyx_n_s_bf, __pyx_n_s_rw, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_from_buffer, 686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 686, __pyx_L1_error) __pyx_tuple__36 = PyTuple_Pack(2, ((PyObject*)__pyx_n_s_rb), Py_None); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "pygame_sdl2/rwobject.pyx":723 * return rv * * @staticmethod # <<<<<<<<<<<<<< * def from_split(a, b, name=None): * """ */ __pyx_tuple__37 = PyTuple_Pack(6, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_name, __pyx_n_s_sf, __pyx_n_s_rw, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rwobject_pyx, __pyx_n_s_from_split, 723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("to_rwops", (void (*)(void))__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("RWopsFromPython", (void (*)(void))__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython, "SDL_RWops *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl)) __PYX_ERR(0, 491, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl_spec, __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl) < 0) __PYX_ERR(0, 491, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl = &__pyx_type_11pygame_sdl2_8rwobject_RWopsIOImpl; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl) < 0) __PYX_ERR(0, 491, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl->tp_dictoffset && __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 491, __pyx_L1_error) if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { __pyx_wrapperbase_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__.doc = __pyx_doc_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_8rwobject_11RWopsIOImpl_2__init__; } } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RWopsIOImpl, (PyObject *) __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl) < 0) __PYX_ERR(0, 491, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl) < 0) __PYX_ERR(0, 491, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject), #else sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_rwobject(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_rwobject}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "rwobject", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initrwobject(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initrwobject(void) #else __Pyx_PyMODINIT_FUNC PyInit_rwobject(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_rwobject(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_rwobject(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'rwobject' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("rwobject", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "rwobject" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_rwobject(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__rwobject) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.rwobject")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.rwobject", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/rwobject.pyx":27 * from libc.stdint cimport uintptr_t * * from pygame_sdl2.compat import file_type, bytes_, unicode_ # <<<<<<<<<<<<<< * * import sys */ __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_file_type); __Pyx_GIVEREF(__pyx_n_s_file_type); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_file_type)) __PYX_ERR(0, 27, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_bytes); __Pyx_GIVEREF(__pyx_n_s_bytes); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_bytes)) __PYX_ERR(0, 27, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_unicode); __Pyx_GIVEREF(__pyx_n_s_unicode); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_unicode)) __PYX_ERR(0, 27, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_file_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_type, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":29 * from pygame_sdl2.compat import file_type, bytes_, unicode_ * * import sys # <<<<<<<<<<<<<< * import io * */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_3) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":30 * * import sys * import io # <<<<<<<<<<<<<< * * # The fsencoding. */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_io, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_io, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":33 * * # The fsencoding. * fsencoding = sys.getfilesystemencoding() or "utf-8" # <<<<<<<<<<<<<< * * cdef extern from "SDL.h" nogil: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 33, __pyx_L1_error) if (!__pyx_t_5) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L2_bool_binop_done; } __Pyx_INCREF(__pyx_kp_s_utf_8); __pyx_t_3 = __pyx_kp_s_utf_8; __pyx_L2_bool_binop_done:; if (PyDict_SetItem(__pyx_d, __pyx_n_s_fsencoding, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":486 * * whence_mapping = { * io.SEEK_SET : RW_SEEK_SET, # <<<<<<<<<<<<<< * io.SEEK_CUR : RW_SEEK_CUR, * io.SEEK_END : RW_SEEK_END, */ __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SEEK_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(RW_SEEK_SET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":487 * whence_mapping = { * io.SEEK_SET : RW_SEEK_SET, * io.SEEK_CUR : RW_SEEK_CUR, # <<<<<<<<<<<<<< * io.SEEK_END : RW_SEEK_END, * } */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SEEK_CUR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(RW_SEEK_CUR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":488 * io.SEEK_SET : RW_SEEK_SET, * io.SEEK_CUR : RW_SEEK_CUR, * io.SEEK_END : RW_SEEK_END, # <<<<<<<<<<<<<< * } * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SEEK_END); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From___pyx_anon_enum(RW_SEEK_END); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_whence_mapping, __pyx_t_3) < 0) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":527 * self.ops = NULL * * def close(self): # <<<<<<<<<<<<<< * * # A closed file may be closed again. */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_5close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl_close, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, __pyx_n_s_close, __pyx_t_3) < 0) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); /* "pygame_sdl2/rwobject.pyx":535 * self.ops = NULL * * def is_closed(self): # <<<<<<<<<<<<<< * return not self.ops * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_7is_closed, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl_is_closed, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, __pyx_n_s_is_closed, __pyx_t_3) < 0) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); /* "pygame_sdl2/rwobject.pyx":538 * return not self.ops * * def seek(self, long long offset, whence=0): # <<<<<<<<<<<<<< * cdef int whence_rw * cdef long long rv */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_9seek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl_seek, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, __pyx_n_s_seek, __pyx_t_3) < 0) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); /* "pygame_sdl2/rwobject.pyx":555 * return rv * * def tell(self): # <<<<<<<<<<<<<< * cdef long long rv * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_11tell, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl_tell, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, __pyx_n_s_tell, __pyx_t_3) < 0) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); /* "pygame_sdl2/rwobject.pyx":563 * return rv * * def readinto(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_13readinto, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl_readinto, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, __pyx_n_s_readinto, __pyx_t_3) < 0) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); /* "pygame_sdl2/rwobject.pyx":586 * return rv * * def write(self, b): # <<<<<<<<<<<<<< * cdef Py_buffer view * cdef long long rv = 0 */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_15write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl_write, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl, __pyx_n_s_write, __pyx_t_3) < 0) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_8rwobject_RWopsIOImpl); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "self.ops cannot be converted to a Python object for pickling" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "self.ops cannot be converted to a Python object for pickling" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_11RWopsIOImpl_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RWopsIOImpl___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":613 * * * class RWopsIO(io.RawIOBase): # <<<<<<<<<<<<<< * * def __init__(self, filelike, mode='rb', base=None, length=None, name=None): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_io); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RawIOBase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_n_s_RWopsIO, __pyx_n_s_RWopsIO, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_rwobject, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2 != __pyx_t_3) { if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 613, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":615 * class RWopsIO(io.RawIOBase): * * def __init__(self, filelike, mode='rb', base=None, length=None, name=None): # <<<<<<<<<<<<<< * """ * Creates a new RWopsIO object. All parameter are passed to to_rwops */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_1__init__, 0, __pyx_n_s_RWopsIO___init, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__25); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":631 * self.readinto = self.raw.readinto * * def __repr__(self): # <<<<<<<<<<<<<< * if self.raw.base is not None: * return "".format(self.raw.name, self.raw.base, self.raw.length) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_3__repr__, 0, __pyx_n_s_RWopsIO___repr, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_repr, __pyx_t_3) < 0) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":641 * # close is taken from RWopsIOImpl. * * @property # <<<<<<<<<<<<<< * def closed(self): * return self.raw.is_closed() */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_5closed, 0, __pyx_n_s_RWopsIO_closed, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_closed, __pyx_t_7) < 0) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":645 * return self.raw.is_closed() * * def fileno(self): # <<<<<<<<<<<<<< * raise OSError() * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_7fileno, 0, __pyx_n_s_RWopsIO_fileno, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fileno, __pyx_t_7) < 0) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":652 * # inherited isatty is used * * def readable(self): # <<<<<<<<<<<<<< * return True * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_9readable, 0, __pyx_n_s_RWopsIO_readable, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_readable, __pyx_t_7) < 0) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":661 * # seek is taken from RWopsIOImpl. * * def seekable(self): # <<<<<<<<<<<<<< * return True * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_11seekable, 0, __pyx_n_s_RWopsIO_seekable, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_seekable, __pyx_t_7) < 0) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":666 * # tell is taken from RWopsIOImpl. * * def truncate(self, size=None): # <<<<<<<<<<<<<< * raise OSError() * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_13truncate, 0, __pyx_n_s_RWopsIO_truncate, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__6); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_truncate, __pyx_t_7) < 0) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":669 * raise OSError() * * def writable(self): # <<<<<<<<<<<<<< * return True * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_15writable, 0, __pyx_n_s_RWopsIO_writable, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_writable, __pyx_t_7) < 0) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":686 * # write is taken from RWopsIOImpl. * * @staticmethod # <<<<<<<<<<<<<< * def from_buffer(buffer, mode="rb", name=None): * """ */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_17from_buffer, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_RWopsIO_from_buffer, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__36); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_from_buffer, __pyx_t_3) < 0) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rwobject.pyx":723 * return rv * * @staticmethod # <<<<<<<<<<<<<< * def from_split(a, b, name=None): * """ */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_8rwobject_7RWopsIO_19from_split, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_RWopsIO_from_split, NULL, __pyx_n_s_pygame_sdl2_rwobject, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__6); __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_from_split, __pyx_t_7) < 0) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":613 * * * class RWopsIO(io.RawIOBase): # <<<<<<<<<<<<<< * * def __init__(self, filelike, mode='rb', base=None, length=None, name=None): */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_RWopsIO, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RWopsIO, __pyx_t_7) < 0) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":757 * * * init_python_threads() # <<<<<<<<<<<<<< */ init_python_threads(); /* "pygame_sdl2/rwobject.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.rwobject", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.rwobject"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); else state = (PyGILState_STATE)0; #endif CYTHON_UNUSED_VAR(clineno); CYTHON_UNUSED_VAR(lineno); CYTHON_UNUSED_VAR(filename); CYTHON_MAYBE_UNUSED_VAR(nogil); __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(0); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* DivInt[ptrdiff_t] */ static CYTHON_INLINE ptrdiff_t __Pyx_div_ptrdiff_t(ptrdiff_t a, ptrdiff_t b) { ptrdiff_t q = a / b; ptrdiff_t r = a - q*b; q -= ((r != 0) & ((r ^ b) < 0)); return q; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* GetAttr3 */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } #endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { r = __Pyx_NewRef(d); } return r; } #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (!r) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_12 #define __PYX_HAVE_RT_ImportType_3_0_12 static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__7); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__8; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PY_LONG_LONG) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PY_LONG_LONG) val; } } #endif if (unlikely(!PyLong_Check(x))) { PY_LONG_LONG val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PY_LONG_LONG) -1; val = __Pyx_PyInt_As_PY_LONG_LONG(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) >= 2 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])); } } break; case 3: if ((8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) >= 3 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])); } } break; case 4: if ((8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) >= 4 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PY_LONG_LONG) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PY_LONG_LONG) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case 2: if ((8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { return (PY_LONG_LONG) ((((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case -3: if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case 3: if ((8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { return (PY_LONG_LONG) ((((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case -4: if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case 4: if ((8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) { return (PY_LONG_LONG) ((((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; } } #endif if ((sizeof(PY_LONG_LONG) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { PY_LONG_LONG val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (PY_LONG_LONG) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (PY_LONG_LONG) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (PY_LONG_LONG) -1; } else { stepval = v; } v = NULL; val = (PY_LONG_LONG) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(PY_LONG_LONG) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((PY_LONG_LONG) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(PY_LONG_LONG) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((PY_LONG_LONG) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((PY_LONG_LONG) 1) << (sizeof(PY_LONG_LONG) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (PY_LONG_LONG) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PY_LONG_LONG"); return (PY_LONG_LONG) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PY_LONG_LONG"); return (PY_LONG_LONG) -1; } /* CIntFromPy */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int64_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int64_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { int64_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int64_t) -1; val = __Pyx_PyInt_As_int64_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 2 * PyLong_SHIFT)) { return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 3: if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 3 * PyLong_SHIFT)) { return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 4: if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 4 * PyLong_SHIFT)) { return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int64_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int64_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 2: if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -3: if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 3: if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -4: if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 4: if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; } } #endif if ((sizeof(int64_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int64_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int64_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int64_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int64_t) -1; } else { stepval = v; } v = NULL; val = (int64_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int64_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int64_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int64_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int64_t"); return (int64_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int64_t"); return (int64_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PY_LONG_LONG) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PY_LONG_LONG) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PY_LONG_LONG)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__39); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; cobj = PyCapsule_New(tmp.p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635909.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.rwobject_api.h0000664000175000017500000000361315026112605021547 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef __PYX_HAVE_API__pygame_sdl2__rwobject #define __PYX_HAVE_API__pygame_sdl2__rwobject #ifdef __MINGW64__ #define MS_WIN64 #endif #include "Python.h" static SDL_RWops *(*__pyx_api_f_11pygame_sdl2_8rwobject_RWopsFromPython)(PyObject *) = 0; #define RWopsFromPython __pyx_api_f_11pygame_sdl2_8rwobject_RWopsFromPython #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12 #define __PYX_HAVE_RT_ImportFunction_3_0_12 static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int import_pygame_sdl2__rwobject(void) { PyObject *module = 0; module = PyImport_ImportModule("pygame_sdl2.rwobject"); if (!module) goto bad; if (__Pyx_ImportFunction_3_0_12(module, "RWopsFromPython", (void (**)(void))&__pyx_api_f_11pygame_sdl2_8rwobject_RWopsFromPython, "SDL_RWops *(PyObject *)") < 0) goto bad; Py_DECREF(module); module = 0; return 0; bad: Py_XDECREF(module); return -1; } #endif /* !__PYX_HAVE_API__pygame_sdl2__rwobject */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635914.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.scrap.c0000664000175000017500000120766215026112612020213 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__scrap #define __PYX_HAVE_API__pygame_sdl2__scrap /* Early includes */ #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/scrap.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.scrap" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.scrap" extern int __pyx_module_is_main_pygame_sdl2__scrap; int __pyx_module_is_main_pygame_sdl2__scrap = 0; /* Implementation of "pygame_sdl2.scrap" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_ImportError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "*"; static const char __pyx_k_1[] = "\\\\\\1"; static const char __pyx_k__2[] = "([\\\\`$])"; static const char __pyx_k__3[] = "."; static const char __pyx_k_re[] = "re"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__15[] = "?"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_put[] = "put"; static const char __pyx_k_sub[] = "sub"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_lost[] = "lost"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_text[] = "text"; static const char __pyx_k_type[] = "type"; static const char __pyx_k_bytes[] = "bytes_"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_types[] = "_types"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_script[] = "script"; static const char __pyx_k_contains[] = "contains"; static const char __pyx_k_set_mode[] = "set_mode"; static const char __pyx_k_get_types[] = "get_types"; static const char __pyx_k_SCRAP_TEXT[] = "SCRAP_TEXT"; static const char __pyx_k_emscripten[] = "emscripten"; static const char __pyx_k_run_script[] = "run_script"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_SCRAP_TEXT_int[] = "\nSCRAP_TEXT : int \n"; static const char __pyx_k_Not_implemented[] = "Not implemented."; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_pygame_sdl2_scrap[] = "pygame_sdl2.scrap"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat"; static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static const char __pyx_k_src_pygame_sdl2_scrap_pyx[] = "src/pygame_sdl2/scrap.pyx"; static const char __pyx_k_navigator_clipboard_writeText_s[] = "navigator.clipboard.writeText(`%s`)"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_4get_types(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_6put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_8contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_10lost(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_mode); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_n_s_; PyObject *__pyx_kp_s_1; PyObject *__pyx_n_s_ImportError; PyObject *__pyx_kp_s_Not_implemented; PyObject *__pyx_n_s_SCRAP_TEXT; PyObject *__pyx_kp_s_SCRAP_TEXT_int; PyObject *__pyx_n_s__15; PyObject *__pyx_kp_s__2; PyObject *__pyx_kp_u__3; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_bytes; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_contains; PyObject *__pyx_n_s_data; PyObject *__pyx_n_s_decode; PyObject *__pyx_n_s_emscripten; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_types; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_lost; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_mode; PyObject *__pyx_n_s_name; PyObject *__pyx_kp_s_navigator_clipboard_writeText_s; PyObject *__pyx_n_s_put; PyObject *__pyx_n_s_pygame_sdl2_compat; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_locals; PyObject *__pyx_n_s_pygame_sdl2_scrap; PyObject *__pyx_n_s_re; PyObject *__pyx_n_s_run_script; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_script; PyObject *__pyx_n_s_set_mode; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_pygame_sdl2_scrap_pyx; PyObject *__pyx_n_s_sub; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_text; PyObject *__pyx_n_s_type; PyObject *__pyx_n_s_types; PyObject *__pyx_kp_s_utf_8; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__13; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__14; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_n_s_); Py_CLEAR(clear_module_state->__pyx_kp_s_1); Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); Py_CLEAR(clear_module_state->__pyx_kp_s_Not_implemented); Py_CLEAR(clear_module_state->__pyx_n_s_SCRAP_TEXT); Py_CLEAR(clear_module_state->__pyx_kp_s_SCRAP_TEXT_int); Py_CLEAR(clear_module_state->__pyx_n_s__15); Py_CLEAR(clear_module_state->__pyx_kp_s__2); Py_CLEAR(clear_module_state->__pyx_kp_u__3); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_bytes); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_contains); Py_CLEAR(clear_module_state->__pyx_n_s_data); Py_CLEAR(clear_module_state->__pyx_n_s_decode); Py_CLEAR(clear_module_state->__pyx_n_s_emscripten); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_types); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_lost); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_mode); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_kp_s_navigator_clipboard_writeText_s); Py_CLEAR(clear_module_state->__pyx_n_s_put); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_compat); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_locals); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_scrap); Py_CLEAR(clear_module_state->__pyx_n_s_re); Py_CLEAR(clear_module_state->__pyx_n_s_run_script); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_script); Py_CLEAR(clear_module_state->__pyx_n_s_set_mode); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_scrap_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_sub); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_text); Py_CLEAR(clear_module_state->__pyx_n_s_type); Py_CLEAR(clear_module_state->__pyx_n_s_types); Py_CLEAR(clear_module_state->__pyx_kp_s_utf_8); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__14); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_n_s_); Py_VISIT(traverse_module_state->__pyx_kp_s_1); Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); Py_VISIT(traverse_module_state->__pyx_kp_s_Not_implemented); Py_VISIT(traverse_module_state->__pyx_n_s_SCRAP_TEXT); Py_VISIT(traverse_module_state->__pyx_kp_s_SCRAP_TEXT_int); Py_VISIT(traverse_module_state->__pyx_n_s__15); Py_VISIT(traverse_module_state->__pyx_kp_s__2); Py_VISIT(traverse_module_state->__pyx_kp_u__3); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_bytes); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_contains); Py_VISIT(traverse_module_state->__pyx_n_s_data); Py_VISIT(traverse_module_state->__pyx_n_s_decode); Py_VISIT(traverse_module_state->__pyx_n_s_emscripten); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_types); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_lost); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_mode); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_kp_s_navigator_clipboard_writeText_s); Py_VISIT(traverse_module_state->__pyx_n_s_put); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_compat); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_locals); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_scrap); Py_VISIT(traverse_module_state->__pyx_n_s_re); Py_VISIT(traverse_module_state->__pyx_n_s_run_script); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_script); Py_VISIT(traverse_module_state->__pyx_n_s_set_mode); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_scrap_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_sub); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_text); Py_VISIT(traverse_module_state->__pyx_n_s_type); Py_VISIT(traverse_module_state->__pyx_n_s_types); Py_VISIT(traverse_module_state->__pyx_kp_s_utf_8); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__14); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ #define __pyx_kp_s_1 __pyx_mstate_global->__pyx_kp_s_1 #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError #define __pyx_kp_s_Not_implemented __pyx_mstate_global->__pyx_kp_s_Not_implemented #define __pyx_n_s_SCRAP_TEXT __pyx_mstate_global->__pyx_n_s_SCRAP_TEXT #define __pyx_kp_s_SCRAP_TEXT_int __pyx_mstate_global->__pyx_kp_s_SCRAP_TEXT_int #define __pyx_n_s__15 __pyx_mstate_global->__pyx_n_s__15 #define __pyx_kp_s__2 __pyx_mstate_global->__pyx_kp_s__2 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_contains __pyx_mstate_global->__pyx_n_s_contains #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode #define __pyx_n_s_emscripten __pyx_mstate_global->__pyx_n_s_emscripten #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_types __pyx_mstate_global->__pyx_n_s_get_types #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_lost __pyx_mstate_global->__pyx_n_s_lost #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_kp_s_navigator_clipboard_writeText_s __pyx_mstate_global->__pyx_kp_s_navigator_clipboard_writeText_s #define __pyx_n_s_put __pyx_mstate_global->__pyx_n_s_put #define __pyx_n_s_pygame_sdl2_compat __pyx_mstate_global->__pyx_n_s_pygame_sdl2_compat #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_locals __pyx_mstate_global->__pyx_n_s_pygame_sdl2_locals #define __pyx_n_s_pygame_sdl2_scrap __pyx_mstate_global->__pyx_n_s_pygame_sdl2_scrap #define __pyx_n_s_re __pyx_mstate_global->__pyx_n_s_re #define __pyx_n_s_run_script __pyx_mstate_global->__pyx_n_s_run_script #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_script __pyx_mstate_global->__pyx_n_s_script #define __pyx_n_s_set_mode __pyx_mstate_global->__pyx_n_s_set_mode #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_pygame_sdl2_scrap_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_scrap_pyx #define __pyx_n_s_sub __pyx_mstate_global->__pyx_n_s_sub #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_text __pyx_mstate_global->__pyx_n_s_text #define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type #define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types #define __pyx_kp_s_utf_8 __pyx_mstate_global->__pyx_kp_s_utf_8 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 /* #### Code section: module_code ### */ /* "pygame_sdl2/scrap.pyx":31 * emscripten = None * * def init(): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_init, "init()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_5scrap_init}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":34 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_3get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_2get, "get(type)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_3get = {"get", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5scrap_3get, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5scrap_2get}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_3get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get") < 0)) __PYX_ERR(0, 34, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 34, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.scrap.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_2get(__pyx_self, __pyx_v_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type) { char *__pyx_v_text; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get", 1); /* "pygame_sdl2/scrap.pyx":35 * * def get(type): * cdef char *text = NULL # <<<<<<<<<<<<<< * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() */ __pyx_v_text = NULL; /* "pygame_sdl2/scrap.pyx":36 * def get(type): * cdef char *text = NULL * if type == SCRAP_TEXT: # <<<<<<<<<<<<<< * text = SDL_GetClipboardText() * if text == NULL: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_type, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(__pyx_t_3)) { /* "pygame_sdl2/scrap.pyx":37 * cdef char *text = NULL * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() # <<<<<<<<<<<<<< * if text == NULL: * raise error() */ __pyx_v_text = SDL_GetClipboardText(); /* "pygame_sdl2/scrap.pyx":38 * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() * if text == NULL: # <<<<<<<<<<<<<< * raise error() * rv = bytes_(text) */ __pyx_t_3 = (__pyx_v_text == NULL); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/scrap.pyx":39 * text = SDL_GetClipboardText() * if text == NULL: * raise error() # <<<<<<<<<<<<<< * rv = bytes_(text) * SDL_free(text) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 39, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":38 * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() * if text == NULL: # <<<<<<<<<<<<<< * raise error() * rv = bytes_(text) */ } /* "pygame_sdl2/scrap.pyx":40 * if text == NULL: * raise error() * rv = bytes_(text) # <<<<<<<<<<<<<< * SDL_free(text) * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_rv = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":41 * raise error() * rv = bytes_(text) * SDL_free(text) # <<<<<<<<<<<<<< * return rv * else: */ SDL_free(__pyx_v_text); /* "pygame_sdl2/scrap.pyx":42 * rv = bytes_(text) * SDL_free(text) * return rv # <<<<<<<<<<<<<< * else: * raise error("Not implemented.") */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":36 * def get(type): * cdef char *text = NULL * if type == SCRAP_TEXT: # <<<<<<<<<<<<<< * text = SDL_GetClipboardText() * if text == NULL: */ } /* "pygame_sdl2/scrap.pyx":44 * return rv * else: * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def get_types(): */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_Not_implemented}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 44, __pyx_L1_error) } /* "pygame_sdl2/scrap.pyx":34 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.scrap.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":46 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_5get_types(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_4get_types, "get_types()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_5get_types = {"get_types", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_5get_types, METH_NOARGS, __pyx_doc_11pygame_sdl2_5scrap_4get_types}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_5get_types(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_types (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_4get_types(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_4get_types(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_types", 1); /* "pygame_sdl2/scrap.pyx":47 * * def get_types(): * return [SCRAP_TEXT] # <<<<<<<<<<<<<< * * def put(type, data): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":46 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.scrap.get_types", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":49 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_7put(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_6put, "put(type, data)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_7put = {"put", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5scrap_7put, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5scrap_6put}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_7put(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_type = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("put (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, 1); __PYX_ERR(0, 49, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "put") < 0)) __PYX_ERR(0, 49, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_type = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 49, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.scrap.put", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_6put(__pyx_self, __pyx_v_type, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_6put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type, PyObject *__pyx_v_data) { PyObject *__pyx_v_re = NULL; PyObject *__pyx_v_text = NULL; PyObject *__pyx_v_script = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; char const *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("put", 0); __Pyx_INCREF(__pyx_v_data); /* "pygame_sdl2/scrap.pyx":50 * * def put(type, data): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_type, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/scrap.pyx":51 * def put(type, data): * if type != SCRAP_TEXT: * raise error("Not implemented.") # <<<<<<<<<<<<<< * * if emscripten is not None: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_Not_implemented}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 51, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":50 * * def put(type, data): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ } /* "pygame_sdl2/scrap.pyx":53 * raise error("Not implemented.") * * if emscripten is not None: # <<<<<<<<<<<<<< * # SDL_SetClipboardText() is not implemented for Web * import re */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_emscripten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":55 * if emscripten is not None: * # SDL_SetClipboardText() is not implemented for Web * import re # <<<<<<<<<<<<<< * text = data.decode('utf-8') * script = 'navigator.clipboard.writeText(`%s`)' % (re.sub(r'([\\`$])', r'\\\1', text),) */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_re = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":56 * # SDL_SetClipboardText() is not implemented for Web * import re * text = data.decode('utf-8') # <<<<<<<<<<<<<< * script = 'navigator.clipboard.writeText(`%s`)' % (re.sub(r'([\\`$])', r'\\\1', text),) * emscripten.run_script(script) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_utf_8}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_text = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":57 * import re * text = data.decode('utf-8') * script = 'navigator.clipboard.writeText(`%s`)' % (re.sub(r'([\\`$])', r'\\\1', text),) # <<<<<<<<<<<<<< * emscripten.run_script(script) * return */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_re, __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_kp_s__2, __pyx_kp_s_1, __pyx_v_text}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_navigator_clipboard_writeText_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_script = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":58 * text = data.decode('utf-8') * script = 'navigator.clipboard.writeText(`%s`)' % (re.sub(r'([\\`$])', r'\\\1', text),) * emscripten.run_script(script) # <<<<<<<<<<<<<< * return * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_emscripten); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_run_script); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_script}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":59 * script = 'navigator.clipboard.writeText(`%s`)' % (re.sub(r'([\\`$])', r'\\\1', text),) * emscripten.run_script(script) * return # <<<<<<<<<<<<<< * * data = bytes_(data) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":53 * raise error("Not implemented.") * * if emscripten is not None: # <<<<<<<<<<<<<< * # SDL_SetClipboardText() is not implemented for Web * import re */ } /* "pygame_sdl2/scrap.pyx":61 * return * * data = bytes_(data) # <<<<<<<<<<<<<< * * if SDL_SetClipboardText(data) != 0: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_data}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":63 * data = bytes_(data) * * if SDL_SetClipboardText(data) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_t_3 = (SDL_SetClipboardText(__pyx_t_6) != 0); if (unlikely(__pyx_t_3)) { /* "pygame_sdl2/scrap.pyx":64 * * if SDL_SetClipboardText(data) != 0: * raise error() # <<<<<<<<<<<<<< * * def contains(type): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 64, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":63 * data = bytes_(data) * * if SDL_SetClipboardText(data) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/scrap.pyx":49 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.scrap.put", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_re); __Pyx_XDECREF(__pyx_v_text); __Pyx_XDECREF(__pyx_v_script); __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":66 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_9contains(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_8contains, "contains(type)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_9contains = {"contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5scrap_9contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5scrap_8contains}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_9contains(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "contains") < 0)) __PYX_ERR(0, 66, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_type = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("contains", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 66, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.scrap.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_8contains(__pyx_self, __pyx_v_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_8contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("contains", 1); /* "pygame_sdl2/scrap.pyx":67 * * def contains(type): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * return False * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_type, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":68 * def contains(type): * if type != SCRAP_TEXT: * return False # <<<<<<<<<<<<<< * * return SDL_HasClipboardText() == SDL_TRUE */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":67 * * def contains(type): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/scrap.pyx":70 * return False * * return SDL_HasClipboardText() == SDL_TRUE # <<<<<<<<<<<<<< * * def lost(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong((SDL_HasClipboardText() == SDL_TRUE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":66 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.scrap.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":72 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_11lost(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_10lost, "lost()"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_11lost = {"lost", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_11lost, METH_NOARGS, __pyx_doc_11pygame_sdl2_5scrap_10lost}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_11lost(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lost (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_10lost(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_10lost(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lost", 1); /* "pygame_sdl2/scrap.pyx":73 * * def lost(): * return False # <<<<<<<<<<<<<< * * def set_mode(mode): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":72 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":75 * return False * * def set_mode(mode): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_13set_mode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_5scrap_12set_mode, "set_mode(mode)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_13set_mode = {"set_mode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_5scrap_13set_mode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_5scrap_12set_mode}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_13set_mode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_mode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mode (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_mode") < 0)) __PYX_ERR(0, 75, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_mode = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_mode", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 75, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.scrap.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_12set_mode(__pyx_self, __pyx_v_mode); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_mode) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mode", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0}, {&__pyx_n_s_SCRAP_TEXT, __pyx_k_SCRAP_TEXT, sizeof(__pyx_k_SCRAP_TEXT), 0, 0, 1, 1}, {&__pyx_kp_s_SCRAP_TEXT_int, __pyx_k_SCRAP_TEXT_int, sizeof(__pyx_k_SCRAP_TEXT_int), 0, 0, 1, 0}, {&__pyx_n_s__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_emscripten, __pyx_k_emscripten, sizeof(__pyx_k_emscripten), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_types, __pyx_k_get_types, sizeof(__pyx_k_get_types), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_lost, __pyx_k_lost, sizeof(__pyx_k_lost), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_kp_s_navigator_clipboard_writeText_s, __pyx_k_navigator_clipboard_writeText_s, sizeof(__pyx_k_navigator_clipboard_writeText_s), 0, 0, 1, 0}, {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_compat, __pyx_k_pygame_sdl2_compat, sizeof(__pyx_k_pygame_sdl2_compat), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_scrap, __pyx_k_pygame_sdl2_scrap, sizeof(__pyx_k_pygame_sdl2_scrap), 0, 0, 1, 1}, {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, {&__pyx_n_s_run_script, __pyx_k_run_script, sizeof(__pyx_k_run_script), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_script, __pyx_k_script, sizeof(__pyx_k_script), 0, 0, 1, 1}, {&__pyx_n_s_set_mode, __pyx_k_set_mode, sizeof(__pyx_k_set_mode), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_k_src_pygame_sdl2_scrap_pyx, sizeof(__pyx_k_src_pygame_sdl2_scrap_pyx), 0, 0, 1, 0}, {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 28, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/scrap.pyx":31 * emscripten = None * * def init(): # <<<<<<<<<<<<<< * pass * */ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_init, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 31, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":34 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_type, __pyx_n_s_text, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_get, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 34, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":46 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_get_types, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 46, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":49 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ __pyx_tuple__8 = PyTuple_Pack(5, __pyx_n_s_type, __pyx_n_s_data, __pyx_n_s_re, __pyx_n_s_text, __pyx_n_s_script); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_put, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 49, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":66 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_type); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_contains, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 66, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":72 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_lost, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 72, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":75 * return False * * def set_mode(mode): # <<<<<<<<<<<<<< * pass * */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_mode); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_set_mode, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_scrap(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_scrap}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "scrap", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initscrap(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initscrap(void) #else __Pyx_PyMODINIT_FUNC PyInit_scrap(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_scrap(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_scrap(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'scrap' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("scrap", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "scrap" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_scrap(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__scrap) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.scrap")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.scrap", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/scrap.pyx":21 * from sdl2 cimport * * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.locals import SCRAP_TEXT * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 21, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/scrap.pyx":22 * * from pygame_sdl2.error import error * from pygame_sdl2.locals import SCRAP_TEXT # <<<<<<<<<<<<<< * * from pygame_sdl2.compat import bytes_ */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_SCRAP_TEXT); __Pyx_GIVEREF(__pyx_n_s_SCRAP_TEXT); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_SCRAP_TEXT)) __PYX_ERR(0, 22, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCRAP_TEXT, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":24 * from pygame_sdl2.locals import SCRAP_TEXT * * from pygame_sdl2.compat import bytes_ # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_bytes); __Pyx_GIVEREF(__pyx_n_s_bytes); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_bytes)) __PYX_ERR(0, 24, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/scrap.pyx":26 * from pygame_sdl2.compat import bytes_ * * try: # <<<<<<<<<<<<<< * import emscripten * except ImportError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "pygame_sdl2/scrap.pyx":27 * * try: * import emscripten # <<<<<<<<<<<<<< * except ImportError: * emscripten = None */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_emscripten, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_emscripten, __pyx_t_3) < 0) __PYX_ERR(0, 27, __pyx_L2_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/scrap.pyx":26 * from pygame_sdl2.compat import bytes_ * * try: # <<<<<<<<<<<<<< * import emscripten * except ImportError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L7_try_end; __pyx_L2_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/scrap.pyx":28 * try: * import emscripten * except ImportError: # <<<<<<<<<<<<<< * emscripten = None * */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); if (__pyx_t_6) { __Pyx_AddTraceback("pygame_sdl2.scrap", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 28, __pyx_L4_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_7); /* "pygame_sdl2/scrap.pyx":29 * import emscripten * except ImportError: * emscripten = None # <<<<<<<<<<<<<< * * def init(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_emscripten, Py_None) < 0) __PYX_ERR(0, 29, __pyx_L4_except_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L3_exception_handled; } goto __pyx_L4_except_error; /* "pygame_sdl2/scrap.pyx":26 * from pygame_sdl2.compat import bytes_ * * try: # <<<<<<<<<<<<<< * import emscripten * except ImportError: */ __pyx_L4_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L3_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); __pyx_L7_try_end:; } /* "pygame_sdl2/scrap.pyx":31 * emscripten = None * * def init(): # <<<<<<<<<<<<<< * pass * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_1init, 0, __pyx_n_s_init, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":34 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_3get, 0, __pyx_n_s_get, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get, __pyx_t_7) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":46 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_5get_types, 0, __pyx_n_s_get_types, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_types, __pyx_t_7) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":49 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_7put, 0, __pyx_n_s_put, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_put, __pyx_t_7) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":66 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_9contains, 0, __pyx_n_s_contains, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_contains, __pyx_t_7) < 0) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":72 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_11lost, 0, __pyx_n_s_lost, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_lost, __pyx_t_7) < 0) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":75 * return False * * def set_mode(mode): # <<<<<<<<<<<<<< * pass * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_5scrap_13set_mode, 0, __pyx_n_s_set_mode, NULL, __pyx_n_s_pygame_sdl2_scrap, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_7) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/scrap.pyx":78 * pass * * _types = """ # <<<<<<<<<<<<<< * SCRAP_TEXT : int * """ */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_kp_s_SCRAP_TEXT_int) < 0) __PYX_ERR(0, 78, __pyx_L1_error) /* "pygame_sdl2/scrap.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.scrap", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.scrap"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s_; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__3); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__15); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635909.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.surface.c0000664000175000017500000401346315026112605020532 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__surface #define __PYX_HAVE_API__pygame_sdl2__surface /* Early includes */ #include #include #include #include #include "SDL.h" #include "src/surface.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/surface.pyx", "", "src/pygame_sdl2/color.pxd", "src/pygame_sdl2/rect.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_5color_Color; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* "pygame_sdl2/surface.pyx":53 * total_size = 0 * * cdef class Surface: # <<<<<<<<<<<<<< * * def __cinit__(self): */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* AssertionsEnabled.proto */ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (1) #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) static int __Pyx_init_assertions_enabled(void) { PyObject *builtins, *debug, *debug_str; int flag; builtins = PyEval_GetBuiltins(); if (!builtins) goto bad; debug_str = PyUnicode_FromStringAndSize("__debug__", 9); if (!debug_str) goto bad; debug = PyObject_GetItem(builtins, debug_str); Py_DECREF(debug_str); if (!debug) goto bad; flag = PyObject_IsTrue(debug); Py_DECREF(debug); if (flag == -1) goto bad; __pyx_assertions_enabled_flag = flag; return 0; bad: __pyx_assertions_enabled_flag = 1; return -1; } #else #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ (likely(is_tuple || PyTuple_Check(tuple)) ?\ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 #define __PYX_HAVE_RT_ImportType_proto_3_0_12 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_12 { __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ static void __pyx_f_11pygame_sdl2_7surface_7Surface_take_surface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, SDL_Surface *__pyx_v_surface); /* proto*/ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "pygame_sdl2.color" */ static Uint32 (*__pyx_f_11pygame_sdl2_5color_map_color)(SDL_Surface *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_11pygame_sdl2_5color_get_color)(Uint32, SDL_Surface *); /*proto*/ /* Module declarations from "pygame_sdl2.rect" */ static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from "pygame_sdl2.surface" */ static void __pyx_f_11pygame_sdl2_7surface_move_pixels(Uint8 *, Uint8 *, int, int, int, int); /*proto*/ static SDL_Surface *__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface(PyObject *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_7surface_PySurface_New(SDL_Surface *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.surface" extern int __pyx_module_is_main_pygame_sdl2__surface; int __pyx_module_is_main_pygame_sdl2__surface = 0; /* Implementation of "pygame_sdl2.surface" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_2[] = "2"; static const char __pyx_k_d[] = "d"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_k[] = "k"; static const char __pyx_k_p[] = "p"; static const char __pyx_k_v[] = "v"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__5[] = "."; static const char __pyx_k__6[] = "*"; static const char __pyx_k_dx[] = "dx"; static const char __pyx_k_dy[] = "dy"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__89[] = "?"; static const char __pyx_k_err[] = "err"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_row[] = "row"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_amin[] = "amin"; static const char __pyx_k_area[] = "area"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_blit[] = "blit"; static const char __pyx_k_clip[] = "clip"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_dest[] = "dest"; static const char __pyx_k_fill[] = "fill"; static const char __pyx_k_kind[] = "kind"; static const char __pyx_k_lock[] = "lock"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_maxx[] = "maxx"; static const char __pyx_k_maxy[] = "maxy"; static const char __pyx_k_minx[] = "minx"; static const char __pyx_k_miny[] = "miny"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_root[] = "root"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_srcx[] = "srcx"; static const char __pyx_k_srcy[] = "srcy"; static const char __pyx_k_surf[] = "surf"; static const char __pyx_k_temp[] = "temp"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_warn[] = "warn"; static const char __pyx_k_alpha[] = "alpha"; static const char __pyx_k_amask[] = "amask"; static const char __pyx_k_bmask[] = "bmask"; static const char __pyx_k_color[] = "color"; static const char __pyx_k_depth[] = "depth"; static const char __pyx_k_destx[] = "destx"; static const char __pyx_k_desty[] = "desty"; static const char __pyx_k_dirty[] = "dirty"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_gmask[] = "gmask"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_masks[] = "masks"; static const char __pyx_k_pixel[] = "pixel"; static const char __pyx_k_rmask[] = "rmask"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_get_at[] = "get_at"; static const char __pyx_k_height[] = "height"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_kwargs[] = "kwargs"; static const char __pyx_k_pixels[] = "pixels"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_remove[] = "remove"; static const char __pyx_k_scroll[] = "scroll"; static const char __pyx_k_set_at[] = "set_at"; static const char __pyx_k_shifts[] = "shifts"; static const char __pyx_k_sizeof[] = "__sizeof__"; static const char __pyx_k_source[] = "source"; static const char __pyx_k_srcptr[] = "srcptr"; static const char __pyx_k_unlock[] = "unlock"; static const char __pyx_k_Surface[] = "Surface"; static const char __pyx_k_convert[] = "convert"; static const char __pyx_k_destptr[] = "destptr"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_map_rgb[] = "map_rgb"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_topleft[] = "topleft"; static const char __pyx_k_SRCALPHA[] = "SRCALPHA"; static const char __pyx_k_area_ptr[] = "area_ptr"; static const char __pyx_k_botright[] = "botright"; static const char __pyx_k_colorkey[] = "colorkey"; static const char __pyx_k_get_clip[] = "get_clip"; static const char __pyx_k_get_rect[] = "get_rect"; static const char __pyx_k_get_size[] = "get_size"; static const char __pyx_k_get_view[] = "get_view"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_mustlock[] = "mustlock"; static const char __pyx_k_offset_x[] = "offset_x"; static const char __pyx_k_offset_y[] = "offset_y"; static const char __pyx_k_sdl_rect[] = "sdl_rect"; static const char __pyx_k_set_clip[] = "set_clip"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_warnings[] = "warnings"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_area_rect[] = "area_rect"; static const char __pyx_k_dest_rect[] = "dest_rect"; static const char __pyx_k_from_data[] = "from_data"; static const char __pyx_k_get_alpha[] = "get_alpha"; static const char __pyx_k_get_flags[] = "get_flags"; static const char __pyx_k_get_locks[] = "get_locks"; static const char __pyx_k_get_masks[] = "get_masks"; static const char __pyx_k_get_pitch[] = "get_pitch"; static const char __pyx_k_get_width[] = "get_width"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_min_alpha[] = "min_alpha"; static const char __pyx_k_per_pixel[] = "per_pixel"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_set_alpha[] = "set_alpha"; static const char __pyx_k_set_masks[] = "set_masks"; static const char __pyx_k_unmap_rgb[] = "unmap_rgb"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_get_buffer[] = "get_buffer"; static const char __pyx_k_get_height[] = "get_height"; static const char __pyx_k_get_locked[] = "get_locked"; static const char __pyx_k_get_losses[] = "get_losses"; static const char __pyx_k_get_offset[] = "get_offset"; static const char __pyx_k_get_parent[] = "get_parent"; static const char __pyx_k_get_shifts[] = "get_shifts"; static const char __pyx_k_move_width[] = "move_width"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_set_shifts[] = "set_shifts"; static const char __pyx_k_subsurface[] = "subsurface"; static const char __pyx_k_total_size[] = "total_size"; static const char __pyx_k_use_format[] = "use_format"; static const char __pyx_k_Surface_x_x[] = ""; static const char __pyx_k_get_bitsize[] = "get_bitsize"; static const char __pyx_k_get_surface[] = "get_surface"; static const char __pyx_k_move_height[] = "move_height"; static const char __pyx_k_new_surface[] = "new_surface"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_Surface_blit[] = "Surface.blit"; static const char __pyx_k_Surface_copy[] = "Surface.copy"; static const char __pyx_k_Surface_fill[] = "Surface.fill"; static const char __pyx_k_Surface_lock[] = "Surface.lock"; static const char __pyx_k_get_bytesize[] = "get_bytesize"; static const char __pyx_k_get_colorkey[] = "get_colorkey"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_pixel_format[] = "pixel_format"; static const char __pyx_k_set_colorkey[] = "set_colorkey"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_convert_alpha[] = "convert_alpha"; static const char __pyx_k_get_at_mapped[] = "get_at_mapped"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_sample_format[] = "sample_format"; static const char __pyx_k_special_flags[] = "special_flags"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_Surface_get_at[] = "Surface.get_at"; static const char __pyx_k_Surface_scroll[] = "Surface.scroll"; static const char __pyx_k_Surface_set_at[] = "Surface.set_at"; static const char __pyx_k_Surface_unlock[] = "Surface.unlock"; static const char __pyx_k_get_abs_offset[] = "get_abs_offset"; static const char __pyx_k_get_abs_parent[] = "get_abs_parent"; static const char __pyx_k_Surface_convert[] = "Surface.convert"; static const char __pyx_k_Surface_map_rgb[] = "Surface.map_rgb"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Surface___sizeof[] = "Surface.__sizeof__"; static const char __pyx_k_Surface_get_clip[] = "Surface.get_clip"; static const char __pyx_k_Surface_get_rect[] = "Surface.get_rect"; static const char __pyx_k_Surface_get_size[] = "Surface.get_size"; static const char __pyx_k_Surface_get_view[] = "Surface.get_view"; static const char __pyx_k_Surface_mustlock[] = "Surface.mustlock"; static const char __pyx_k_Surface_set_clip[] = "Surface.set_clip"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_Surface_from_data[] = "Surface.from_data"; static const char __pyx_k_Surface_get_alpha[] = "Surface.get_alpha"; static const char __pyx_k_Surface_get_flags[] = "Surface.get_flags"; static const char __pyx_k_Surface_get_locks[] = "Surface.get_locks"; static const char __pyx_k_Surface_get_masks[] = "Surface.get_masks"; static const char __pyx_k_Surface_get_pitch[] = "Surface.get_pitch"; static const char __pyx_k_Surface_get_width[] = "Surface.get_width"; static const char __pyx_k_Surface_set_alpha[] = "Surface.set_alpha"; static const char __pyx_k_Surface_set_masks[] = "Surface.set_masks"; static const char __pyx_k_Surface_unmap_rgb[] = "Surface.unmap_rgb"; static const char __pyx_k_get_bounding_rect[] = "get_bounding_rect"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_Surface_get_buffer[] = "Surface.get_buffer"; static const char __pyx_k_Surface_get_height[] = "Surface.get_height"; static const char __pyx_k_Surface_get_locked[] = "Surface.get_locked"; static const char __pyx_k_Surface_get_losses[] = "Surface.get_losses"; static const char __pyx_k_Surface_get_offset[] = "Surface.get_offset"; static const char __pyx_k_Surface_get_parent[] = "Surface.get_parent"; static const char __pyx_k_Surface_get_shifts[] = "Surface.get_shifts"; static const char __pyx_k_Surface_set_shifts[] = "Surface.set_shifts"; static const char __pyx_k_Surface_subsurface[] = "Surface.subsurface"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static const char __pyx_k_Surface_get_bitsize[] = "Surface.get_bitsize"; static const char __pyx_k_pygame_sdl2_surface[] = "pygame_sdl2.surface"; static const char __pyx_k_Surface_get_bytesize[] = "Surface.get_bytesize"; static const char __pyx_k_Surface_get_colorkey[] = "Surface.get_colorkey"; static const char __pyx_k_Surface_set_colorkey[] = "Surface.set_colorkey"; static const char __pyx_k_Surface_convert_alpha[] = "Surface.convert_alpha"; static const char __pyx_k_Surface_get_at_mapped[] = "Surface.get_at_mapped"; static const char __pyx_k_Surface_get_abs_offset[] = "Surface.get_abs_offset"; static const char __pyx_k_Surface_get_abs_parent[] = "Surface.get_abs_parent"; static const char __pyx_k_Surface___reduce_cython[] = "Surface.__reduce_cython__"; static const char __pyx_k_Position_outside_surface[] = "Position outside surface."; static const char __pyx_k_Surface___setstate_cython[] = "Surface.__setstate_cython__"; static const char __pyx_k_Surface_get_bounding_rect[] = "Surface.get_bounding_rect"; static const char __pyx_k_src_pygame_sdl2_surface_pyx[] = "src/pygame_sdl2/surface.pyx"; static const char __pyx_k_A_null_pointer_was_passed_in[] = "A null pointer was passed in."; static const char __pyx_k_The_data_must_fill_the_surface[] = "The data must fill the surface."; static const char __pyx_k_Memory_leak_via_Surface_in_pygam[] = "Memory leak via Surface in pygame_sdl2."; static const char __pyx_k_Surface_get_view_is_not_supporte[] = "Surface.get_view is not supported."; static const char __pyx_k_Surface_has_unsupported_bytesize[] = "Surface has unsupported bytesize."; static const char __pyx_k_Surface_set_masks_is_not_support[] = "Surface.set_masks is not supported."; static const char __pyx_k_Surface_set_shifts_is_not_suppor[] = "Surface.set_shifts is not supported."; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_subsurface_rectangle_outside_sur[] = "subsurface rectangle outside surface area."; static const char __pyx_k_subsurface_size_must_be_non_nega[] = "subsurface size must be non-negative."; /* #### Code section: decls ### */ static int __pyx_pf_11pygame_sdl2_7surface_7Surface___cinit__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_7surface_7Surface_2__dealloc__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_4__sizeof__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_7surface_7Surface_6__init__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_masks); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_8__repr__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_10blit(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_source, PyObject *__pyx_v_dest, PyObject *__pyx_v_area, int __pyx_v_special_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_12convert(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_14convert_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_16copy(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_18fill(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_special_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_20scroll(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, int __pyx_v_dx, int __pyx_v_dy); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_22set_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_24get_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_26set_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_28get_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_30lock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_32unlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_34mustlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_36get_locked(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_38get_locks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_40get_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_42set_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_44get_at_mapped(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_46map_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_48unmap_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pixel); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_50set_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_52get_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_54subsurface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_56get_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_58get_abs_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_60get_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_62get_abs_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_64get_size(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_66get_width(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_68get_height(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_70get_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_72get_bitsize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_74get_bytesize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_76get_flags(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_78get_pitch(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_80get_masks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_82set_masks(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_masks); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_84get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_86set_shifts(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_shifts); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_88get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_90get_losses(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_92get_bounding_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_min_alpha); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_94get_view(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kind); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_96get_buffer(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_15_pixels_address___get__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_98from_data(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_100__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_102__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_7surface_Surface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color; #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect; #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_11pygame_sdl2_7surface_Surface; #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; PyObject *__pyx_kp_s_2; PyObject *__pyx_kp_s_A_null_pointer_was_passed_in; PyObject *__pyx_n_s_AssertionError; PyObject *__pyx_n_s_IndexError; PyObject *__pyx_kp_s_Memory_leak_via_Surface_in_pygam; PyObject *__pyx_kp_s_Position_outside_surface; PyObject *__pyx_n_s_Rect; PyObject *__pyx_n_s_SRCALPHA; PyObject *__pyx_n_s_Surface; PyObject *__pyx_n_s_Surface___reduce_cython; PyObject *__pyx_n_s_Surface___setstate_cython; PyObject *__pyx_n_s_Surface___sizeof; PyObject *__pyx_n_s_Surface_blit; PyObject *__pyx_n_s_Surface_convert; PyObject *__pyx_n_s_Surface_convert_alpha; PyObject *__pyx_n_s_Surface_copy; PyObject *__pyx_n_s_Surface_fill; PyObject *__pyx_n_s_Surface_from_data; PyObject *__pyx_n_s_Surface_get_abs_offset; PyObject *__pyx_n_s_Surface_get_abs_parent; PyObject *__pyx_n_s_Surface_get_alpha; PyObject *__pyx_n_s_Surface_get_at; PyObject *__pyx_n_s_Surface_get_at_mapped; PyObject *__pyx_n_s_Surface_get_bitsize; PyObject *__pyx_n_s_Surface_get_bounding_rect; PyObject *__pyx_n_s_Surface_get_buffer; PyObject *__pyx_n_s_Surface_get_bytesize; PyObject *__pyx_n_s_Surface_get_clip; PyObject *__pyx_n_s_Surface_get_colorkey; PyObject *__pyx_n_s_Surface_get_flags; PyObject *__pyx_n_s_Surface_get_height; PyObject *__pyx_n_s_Surface_get_locked; PyObject *__pyx_n_s_Surface_get_locks; PyObject *__pyx_n_s_Surface_get_losses; PyObject *__pyx_n_s_Surface_get_masks; PyObject *__pyx_n_s_Surface_get_offset; PyObject *__pyx_n_s_Surface_get_parent; PyObject *__pyx_n_s_Surface_get_pitch; PyObject *__pyx_n_s_Surface_get_rect; PyObject *__pyx_n_s_Surface_get_shifts; PyObject *__pyx_n_s_Surface_get_size; PyObject *__pyx_n_s_Surface_get_view; PyObject *__pyx_kp_s_Surface_get_view_is_not_supporte; PyObject *__pyx_n_s_Surface_get_width; PyObject *__pyx_kp_s_Surface_has_unsupported_bytesize; PyObject *__pyx_n_s_Surface_lock; PyObject *__pyx_n_s_Surface_map_rgb; PyObject *__pyx_n_s_Surface_mustlock; PyObject *__pyx_n_s_Surface_scroll; PyObject *__pyx_n_s_Surface_set_alpha; PyObject *__pyx_n_s_Surface_set_at; PyObject *__pyx_n_s_Surface_set_clip; PyObject *__pyx_n_s_Surface_set_colorkey; PyObject *__pyx_n_s_Surface_set_masks; PyObject *__pyx_kp_s_Surface_set_masks_is_not_support; PyObject *__pyx_n_s_Surface_set_shifts; PyObject *__pyx_kp_s_Surface_set_shifts_is_not_suppor; PyObject *__pyx_n_s_Surface_subsurface; PyObject *__pyx_n_s_Surface_unlock; PyObject *__pyx_n_s_Surface_unmap_rgb; PyObject *__pyx_kp_s_Surface_x_x; PyObject *__pyx_kp_s_The_data_must_fill_the_surface; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_kp_u__5; PyObject *__pyx_n_s__6; PyObject *__pyx_n_s__89; PyObject *__pyx_n_s_alpha; PyObject *__pyx_n_s_amask; PyObject *__pyx_n_s_amin; PyObject *__pyx_n_s_append; PyObject *__pyx_n_s_area; PyObject *__pyx_n_s_area_ptr; PyObject *__pyx_n_s_area_rect; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_blit; PyObject *__pyx_n_s_bmask; PyObject *__pyx_n_s_botright; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_clip; PyObject *__pyx_n_s_color; PyObject *__pyx_n_s_colorkey; PyObject *__pyx_n_s_convert; PyObject *__pyx_n_s_convert_alpha; PyObject *__pyx_n_s_copy; PyObject *__pyx_n_s_d; PyObject *__pyx_n_s_data; PyObject *__pyx_n_s_depth; PyObject *__pyx_n_s_dest; PyObject *__pyx_n_s_dest_rect; PyObject *__pyx_n_s_destptr; PyObject *__pyx_n_s_destx; PyObject *__pyx_n_s_desty; PyObject *__pyx_n_s_dirty; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_display; PyObject *__pyx_n_s_dx; PyObject *__pyx_n_s_dy; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_err; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_fill; PyObject *__pyx_n_s_flags; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_from_data; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_abs_offset; PyObject *__pyx_n_s_get_abs_parent; PyObject *__pyx_n_s_get_alpha; PyObject *__pyx_n_s_get_at; PyObject *__pyx_n_s_get_at_mapped; PyObject *__pyx_n_s_get_bitsize; PyObject *__pyx_n_s_get_bounding_rect; PyObject *__pyx_n_s_get_buffer; PyObject *__pyx_n_s_get_bytesize; PyObject *__pyx_n_s_get_clip; PyObject *__pyx_n_s_get_colorkey; PyObject *__pyx_n_s_get_flags; PyObject *__pyx_n_s_get_height; PyObject *__pyx_n_s_get_locked; PyObject *__pyx_n_s_get_locks; PyObject *__pyx_n_s_get_losses; PyObject *__pyx_n_s_get_masks; PyObject *__pyx_n_s_get_offset; PyObject *__pyx_n_s_get_parent; PyObject *__pyx_n_s_get_pitch; PyObject *__pyx_n_s_get_rect; PyObject *__pyx_n_s_get_shifts; PyObject *__pyx_n_s_get_size; PyObject *__pyx_n_s_get_surface; PyObject *__pyx_n_s_get_view; PyObject *__pyx_n_s_get_width; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_gmask; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_height; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_items; PyObject *__pyx_n_s_k; PyObject *__pyx_n_s_key; PyObject *__pyx_n_s_kind; PyObject *__pyx_n_s_kwargs; PyObject *__pyx_n_s_lock; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_map_rgb; PyObject *__pyx_n_s_masks; PyObject *__pyx_n_s_maxx; PyObject *__pyx_n_s_maxy; PyObject *__pyx_n_s_min_alpha; PyObject *__pyx_n_s_minx; PyObject *__pyx_n_s_miny; PyObject *__pyx_n_s_move_height; PyObject *__pyx_n_s_move_width; PyObject *__pyx_n_s_mustlock; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_new_surface; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_offset_x; PyObject *__pyx_n_s_offset_y; PyObject *__pyx_n_s_p; PyObject *__pyx_n_s_per_pixel; PyObject *__pyx_n_s_pixel; PyObject *__pyx_n_s_pixel_format; PyObject *__pyx_n_s_pixels; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_pygame_sdl2; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_locals; PyObject *__pyx_n_s_pygame_sdl2_rect; PyObject *__pyx_n_s_pygame_sdl2_surface; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_rect; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_remove; PyObject *__pyx_n_s_rmask; PyObject *__pyx_n_s_root; PyObject *__pyx_n_s_row; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_sample_format; PyObject *__pyx_n_s_scroll; PyObject *__pyx_n_s_sdl_rect; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_alpha; PyObject *__pyx_n_s_set_at; PyObject *__pyx_n_s_set_clip; PyObject *__pyx_n_s_set_colorkey; PyObject *__pyx_n_s_set_masks; PyObject *__pyx_n_s_set_shifts; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_shifts; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_sizeof; PyObject *__pyx_n_s_source; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_special_flags; PyObject *__pyx_kp_s_src_pygame_sdl2_surface_pyx; PyObject *__pyx_n_s_srcptr; PyObject *__pyx_n_s_srcx; PyObject *__pyx_n_s_srcy; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_subsurface; PyObject *__pyx_kp_s_subsurface_rectangle_outside_sur; PyObject *__pyx_kp_s_subsurface_size_must_be_non_nega; PyObject *__pyx_n_s_surf; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_temp; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_topleft; PyObject *__pyx_n_s_total_size; PyObject *__pyx_n_s_unlock; PyObject *__pyx_n_s_unmap_rgb; PyObject *__pyx_n_s_use_format; PyObject *__pyx_n_s_v; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_warn; PyObject *__pyx_n_s_warnings; PyObject *__pyx_n_s_width; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_y; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_32; PyObject *__pyx_int_255; PyObject *__pyx_int_16843009; PyObject *__pyx_int_4294967295; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__34; PyObject *__pyx_tuple__38; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__45; PyObject *__pyx_tuple__47; PyObject *__pyx_tuple__49; PyObject *__pyx_tuple__51; PyObject *__pyx_tuple__56; PyObject *__pyx_tuple__61; PyObject *__pyx_tuple__67; PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__72; PyObject *__pyx_tuple__76; PyObject *__pyx_tuple__78; PyObject *__pyx_tuple__79; PyObject *__pyx_tuple__81; PyObject *__pyx_tuple__82; PyObject *__pyx_tuple__84; PyObject *__pyx_tuple__87; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__37; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__42; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__48; PyObject *__pyx_codeobj__50; PyObject *__pyx_codeobj__52; PyObject *__pyx_codeobj__53; PyObject *__pyx_codeobj__54; PyObject *__pyx_codeobj__55; PyObject *__pyx_codeobj__57; PyObject *__pyx_codeobj__58; PyObject *__pyx_codeobj__59; PyObject *__pyx_codeobj__60; PyObject *__pyx_codeobj__62; PyObject *__pyx_codeobj__63; PyObject *__pyx_codeobj__64; PyObject *__pyx_codeobj__65; PyObject *__pyx_codeobj__66; PyObject *__pyx_codeobj__68; PyObject *__pyx_codeobj__70; PyObject *__pyx_codeobj__71; PyObject *__pyx_codeobj__73; PyObject *__pyx_codeobj__74; PyObject *__pyx_codeobj__75; PyObject *__pyx_codeobj__77; PyObject *__pyx_codeobj__80; PyObject *__pyx_codeobj__83; PyObject *__pyx_codeobj__85; PyObject *__pyx_codeobj__86; PyObject *__pyx_codeobj__88; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_type_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_kp_s_2); Py_CLEAR(clear_module_state->__pyx_kp_s_A_null_pointer_was_passed_in); Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); Py_CLEAR(clear_module_state->__pyx_kp_s_Memory_leak_via_Surface_in_pygam); Py_CLEAR(clear_module_state->__pyx_kp_s_Position_outside_surface); Py_CLEAR(clear_module_state->__pyx_n_s_Rect); Py_CLEAR(clear_module_state->__pyx_n_s_SRCALPHA); Py_CLEAR(clear_module_state->__pyx_n_s_Surface); Py_CLEAR(clear_module_state->__pyx_n_s_Surface___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Surface___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Surface___sizeof); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_blit); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_convert); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_convert_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_copy); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_fill); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_from_data); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_abs_offset); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_abs_parent); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_at); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_at_mapped); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_bitsize); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_bounding_rect); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_bytesize); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_clip); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_colorkey); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_flags); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_height); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_locked); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_locks); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_losses); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_masks); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_offset); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_parent); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_pitch); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_rect); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_shifts); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_size); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_view); Py_CLEAR(clear_module_state->__pyx_kp_s_Surface_get_view_is_not_supporte); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_get_width); Py_CLEAR(clear_module_state->__pyx_kp_s_Surface_has_unsupported_bytesize); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_lock); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_map_rgb); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_mustlock); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_scroll); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_set_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_set_at); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_set_clip); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_set_colorkey); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_set_masks); Py_CLEAR(clear_module_state->__pyx_kp_s_Surface_set_masks_is_not_support); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_set_shifts); Py_CLEAR(clear_module_state->__pyx_kp_s_Surface_set_shifts_is_not_suppor); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_subsurface); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_unlock); Py_CLEAR(clear_module_state->__pyx_n_s_Surface_unmap_rgb); Py_CLEAR(clear_module_state->__pyx_kp_s_Surface_x_x); Py_CLEAR(clear_module_state->__pyx_kp_s_The_data_must_fill_the_surface); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_kp_u__5); Py_CLEAR(clear_module_state->__pyx_n_s__6); Py_CLEAR(clear_module_state->__pyx_n_s__89); Py_CLEAR(clear_module_state->__pyx_n_s_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_amask); Py_CLEAR(clear_module_state->__pyx_n_s_amin); Py_CLEAR(clear_module_state->__pyx_n_s_append); Py_CLEAR(clear_module_state->__pyx_n_s_area); Py_CLEAR(clear_module_state->__pyx_n_s_area_ptr); Py_CLEAR(clear_module_state->__pyx_n_s_area_rect); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_blit); Py_CLEAR(clear_module_state->__pyx_n_s_bmask); Py_CLEAR(clear_module_state->__pyx_n_s_botright); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_clip); Py_CLEAR(clear_module_state->__pyx_n_s_color); Py_CLEAR(clear_module_state->__pyx_n_s_colorkey); Py_CLEAR(clear_module_state->__pyx_n_s_convert); Py_CLEAR(clear_module_state->__pyx_n_s_convert_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_copy); Py_CLEAR(clear_module_state->__pyx_n_s_d); Py_CLEAR(clear_module_state->__pyx_n_s_data); Py_CLEAR(clear_module_state->__pyx_n_s_depth); Py_CLEAR(clear_module_state->__pyx_n_s_dest); Py_CLEAR(clear_module_state->__pyx_n_s_dest_rect); Py_CLEAR(clear_module_state->__pyx_n_s_destptr); Py_CLEAR(clear_module_state->__pyx_n_s_destx); Py_CLEAR(clear_module_state->__pyx_n_s_desty); Py_CLEAR(clear_module_state->__pyx_n_s_dirty); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_display); Py_CLEAR(clear_module_state->__pyx_n_s_dx); Py_CLEAR(clear_module_state->__pyx_n_s_dy); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_err); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_fill); Py_CLEAR(clear_module_state->__pyx_n_s_flags); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_from_data); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_abs_offset); Py_CLEAR(clear_module_state->__pyx_n_s_get_abs_parent); Py_CLEAR(clear_module_state->__pyx_n_s_get_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_get_at); Py_CLEAR(clear_module_state->__pyx_n_s_get_at_mapped); Py_CLEAR(clear_module_state->__pyx_n_s_get_bitsize); Py_CLEAR(clear_module_state->__pyx_n_s_get_bounding_rect); Py_CLEAR(clear_module_state->__pyx_n_s_get_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_get_bytesize); Py_CLEAR(clear_module_state->__pyx_n_s_get_clip); Py_CLEAR(clear_module_state->__pyx_n_s_get_colorkey); Py_CLEAR(clear_module_state->__pyx_n_s_get_flags); Py_CLEAR(clear_module_state->__pyx_n_s_get_height); Py_CLEAR(clear_module_state->__pyx_n_s_get_locked); Py_CLEAR(clear_module_state->__pyx_n_s_get_locks); Py_CLEAR(clear_module_state->__pyx_n_s_get_losses); Py_CLEAR(clear_module_state->__pyx_n_s_get_masks); Py_CLEAR(clear_module_state->__pyx_n_s_get_offset); Py_CLEAR(clear_module_state->__pyx_n_s_get_parent); Py_CLEAR(clear_module_state->__pyx_n_s_get_pitch); Py_CLEAR(clear_module_state->__pyx_n_s_get_rect); Py_CLEAR(clear_module_state->__pyx_n_s_get_shifts); Py_CLEAR(clear_module_state->__pyx_n_s_get_size); Py_CLEAR(clear_module_state->__pyx_n_s_get_surface); Py_CLEAR(clear_module_state->__pyx_n_s_get_view); Py_CLEAR(clear_module_state->__pyx_n_s_get_width); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_gmask); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_height); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_items); Py_CLEAR(clear_module_state->__pyx_n_s_k); Py_CLEAR(clear_module_state->__pyx_n_s_key); Py_CLEAR(clear_module_state->__pyx_n_s_kind); Py_CLEAR(clear_module_state->__pyx_n_s_kwargs); Py_CLEAR(clear_module_state->__pyx_n_s_lock); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_map_rgb); Py_CLEAR(clear_module_state->__pyx_n_s_masks); Py_CLEAR(clear_module_state->__pyx_n_s_maxx); Py_CLEAR(clear_module_state->__pyx_n_s_maxy); Py_CLEAR(clear_module_state->__pyx_n_s_min_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_minx); Py_CLEAR(clear_module_state->__pyx_n_s_miny); Py_CLEAR(clear_module_state->__pyx_n_s_move_height); Py_CLEAR(clear_module_state->__pyx_n_s_move_width); Py_CLEAR(clear_module_state->__pyx_n_s_mustlock); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_new_surface); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_offset_x); Py_CLEAR(clear_module_state->__pyx_n_s_offset_y); Py_CLEAR(clear_module_state->__pyx_n_s_p); Py_CLEAR(clear_module_state->__pyx_n_s_per_pixel); Py_CLEAR(clear_module_state->__pyx_n_s_pixel); Py_CLEAR(clear_module_state->__pyx_n_s_pixel_format); Py_CLEAR(clear_module_state->__pyx_n_s_pixels); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_locals); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_rect); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_surface); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_rect); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_remove); Py_CLEAR(clear_module_state->__pyx_n_s_rmask); Py_CLEAR(clear_module_state->__pyx_n_s_root); Py_CLEAR(clear_module_state->__pyx_n_s_row); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_sample_format); Py_CLEAR(clear_module_state->__pyx_n_s_scroll); Py_CLEAR(clear_module_state->__pyx_n_s_sdl_rect); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_alpha); Py_CLEAR(clear_module_state->__pyx_n_s_set_at); Py_CLEAR(clear_module_state->__pyx_n_s_set_clip); Py_CLEAR(clear_module_state->__pyx_n_s_set_colorkey); Py_CLEAR(clear_module_state->__pyx_n_s_set_masks); Py_CLEAR(clear_module_state->__pyx_n_s_set_shifts); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_shifts); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_sizeof); Py_CLEAR(clear_module_state->__pyx_n_s_source); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_special_flags); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_surface_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_srcptr); Py_CLEAR(clear_module_state->__pyx_n_s_srcx); Py_CLEAR(clear_module_state->__pyx_n_s_srcy); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_subsurface); Py_CLEAR(clear_module_state->__pyx_kp_s_subsurface_rectangle_outside_sur); Py_CLEAR(clear_module_state->__pyx_kp_s_subsurface_size_must_be_non_nega); Py_CLEAR(clear_module_state->__pyx_n_s_surf); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_temp); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_topleft); Py_CLEAR(clear_module_state->__pyx_n_s_total_size); Py_CLEAR(clear_module_state->__pyx_n_s_unlock); Py_CLEAR(clear_module_state->__pyx_n_s_unmap_rgb); Py_CLEAR(clear_module_state->__pyx_n_s_use_format); Py_CLEAR(clear_module_state->__pyx_n_s_v); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_warn); Py_CLEAR(clear_module_state->__pyx_n_s_warnings); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_32); Py_CLEAR(clear_module_state->__pyx_int_255); Py_CLEAR(clear_module_state->__pyx_int_16843009); Py_CLEAR(clear_module_state->__pyx_int_4294967295); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__34); Py_CLEAR(clear_module_state->__pyx_tuple__38); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_tuple__47); Py_CLEAR(clear_module_state->__pyx_tuple__49); Py_CLEAR(clear_module_state->__pyx_tuple__51); Py_CLEAR(clear_module_state->__pyx_tuple__56); Py_CLEAR(clear_module_state->__pyx_tuple__61); Py_CLEAR(clear_module_state->__pyx_tuple__67); Py_CLEAR(clear_module_state->__pyx_tuple__69); Py_CLEAR(clear_module_state->__pyx_tuple__72); Py_CLEAR(clear_module_state->__pyx_tuple__76); Py_CLEAR(clear_module_state->__pyx_tuple__78); Py_CLEAR(clear_module_state->__pyx_tuple__79); Py_CLEAR(clear_module_state->__pyx_tuple__81); Py_CLEAR(clear_module_state->__pyx_tuple__82); Py_CLEAR(clear_module_state->__pyx_tuple__84); Py_CLEAR(clear_module_state->__pyx_tuple__87); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__37); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__42); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__48); Py_CLEAR(clear_module_state->__pyx_codeobj__50); Py_CLEAR(clear_module_state->__pyx_codeobj__52); Py_CLEAR(clear_module_state->__pyx_codeobj__53); Py_CLEAR(clear_module_state->__pyx_codeobj__54); Py_CLEAR(clear_module_state->__pyx_codeobj__55); Py_CLEAR(clear_module_state->__pyx_codeobj__57); Py_CLEAR(clear_module_state->__pyx_codeobj__58); Py_CLEAR(clear_module_state->__pyx_codeobj__59); Py_CLEAR(clear_module_state->__pyx_codeobj__60); Py_CLEAR(clear_module_state->__pyx_codeobj__62); Py_CLEAR(clear_module_state->__pyx_codeobj__63); Py_CLEAR(clear_module_state->__pyx_codeobj__64); Py_CLEAR(clear_module_state->__pyx_codeobj__65); Py_CLEAR(clear_module_state->__pyx_codeobj__66); Py_CLEAR(clear_module_state->__pyx_codeobj__68); Py_CLEAR(clear_module_state->__pyx_codeobj__70); Py_CLEAR(clear_module_state->__pyx_codeobj__71); Py_CLEAR(clear_module_state->__pyx_codeobj__73); Py_CLEAR(clear_module_state->__pyx_codeobj__74); Py_CLEAR(clear_module_state->__pyx_codeobj__75); Py_CLEAR(clear_module_state->__pyx_codeobj__77); Py_CLEAR(clear_module_state->__pyx_codeobj__80); Py_CLEAR(clear_module_state->__pyx_codeobj__83); Py_CLEAR(clear_module_state->__pyx_codeobj__85); Py_CLEAR(clear_module_state->__pyx_codeobj__86); Py_CLEAR(clear_module_state->__pyx_codeobj__88); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_5color_Color); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_4rect_Rect); Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_type_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_kp_s_2); Py_VISIT(traverse_module_state->__pyx_kp_s_A_null_pointer_was_passed_in); Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); Py_VISIT(traverse_module_state->__pyx_kp_s_Memory_leak_via_Surface_in_pygam); Py_VISIT(traverse_module_state->__pyx_kp_s_Position_outside_surface); Py_VISIT(traverse_module_state->__pyx_n_s_Rect); Py_VISIT(traverse_module_state->__pyx_n_s_SRCALPHA); Py_VISIT(traverse_module_state->__pyx_n_s_Surface); Py_VISIT(traverse_module_state->__pyx_n_s_Surface___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Surface___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Surface___sizeof); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_blit); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_convert); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_convert_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_copy); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_fill); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_from_data); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_abs_offset); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_abs_parent); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_at); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_at_mapped); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_bitsize); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_bounding_rect); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_bytesize); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_clip); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_colorkey); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_flags); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_height); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_locked); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_locks); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_losses); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_masks); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_offset); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_parent); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_pitch); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_rect); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_shifts); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_size); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_view); Py_VISIT(traverse_module_state->__pyx_kp_s_Surface_get_view_is_not_supporte); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_get_width); Py_VISIT(traverse_module_state->__pyx_kp_s_Surface_has_unsupported_bytesize); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_lock); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_map_rgb); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_mustlock); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_scroll); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_set_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_set_at); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_set_clip); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_set_colorkey); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_set_masks); Py_VISIT(traverse_module_state->__pyx_kp_s_Surface_set_masks_is_not_support); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_set_shifts); Py_VISIT(traverse_module_state->__pyx_kp_s_Surface_set_shifts_is_not_suppor); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_subsurface); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_unlock); Py_VISIT(traverse_module_state->__pyx_n_s_Surface_unmap_rgb); Py_VISIT(traverse_module_state->__pyx_kp_s_Surface_x_x); Py_VISIT(traverse_module_state->__pyx_kp_s_The_data_must_fill_the_surface); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_kp_u__5); Py_VISIT(traverse_module_state->__pyx_n_s__6); Py_VISIT(traverse_module_state->__pyx_n_s__89); Py_VISIT(traverse_module_state->__pyx_n_s_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_amask); Py_VISIT(traverse_module_state->__pyx_n_s_amin); Py_VISIT(traverse_module_state->__pyx_n_s_append); Py_VISIT(traverse_module_state->__pyx_n_s_area); Py_VISIT(traverse_module_state->__pyx_n_s_area_ptr); Py_VISIT(traverse_module_state->__pyx_n_s_area_rect); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_blit); Py_VISIT(traverse_module_state->__pyx_n_s_bmask); Py_VISIT(traverse_module_state->__pyx_n_s_botright); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_clip); Py_VISIT(traverse_module_state->__pyx_n_s_color); Py_VISIT(traverse_module_state->__pyx_n_s_colorkey); Py_VISIT(traverse_module_state->__pyx_n_s_convert); Py_VISIT(traverse_module_state->__pyx_n_s_convert_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_copy); Py_VISIT(traverse_module_state->__pyx_n_s_d); Py_VISIT(traverse_module_state->__pyx_n_s_data); Py_VISIT(traverse_module_state->__pyx_n_s_depth); Py_VISIT(traverse_module_state->__pyx_n_s_dest); Py_VISIT(traverse_module_state->__pyx_n_s_dest_rect); Py_VISIT(traverse_module_state->__pyx_n_s_destptr); Py_VISIT(traverse_module_state->__pyx_n_s_destx); Py_VISIT(traverse_module_state->__pyx_n_s_desty); Py_VISIT(traverse_module_state->__pyx_n_s_dirty); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_display); Py_VISIT(traverse_module_state->__pyx_n_s_dx); Py_VISIT(traverse_module_state->__pyx_n_s_dy); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_err); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_fill); Py_VISIT(traverse_module_state->__pyx_n_s_flags); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_from_data); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_abs_offset); Py_VISIT(traverse_module_state->__pyx_n_s_get_abs_parent); Py_VISIT(traverse_module_state->__pyx_n_s_get_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_get_at); Py_VISIT(traverse_module_state->__pyx_n_s_get_at_mapped); Py_VISIT(traverse_module_state->__pyx_n_s_get_bitsize); Py_VISIT(traverse_module_state->__pyx_n_s_get_bounding_rect); Py_VISIT(traverse_module_state->__pyx_n_s_get_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_get_bytesize); Py_VISIT(traverse_module_state->__pyx_n_s_get_clip); Py_VISIT(traverse_module_state->__pyx_n_s_get_colorkey); Py_VISIT(traverse_module_state->__pyx_n_s_get_flags); Py_VISIT(traverse_module_state->__pyx_n_s_get_height); Py_VISIT(traverse_module_state->__pyx_n_s_get_locked); Py_VISIT(traverse_module_state->__pyx_n_s_get_locks); Py_VISIT(traverse_module_state->__pyx_n_s_get_losses); Py_VISIT(traverse_module_state->__pyx_n_s_get_masks); Py_VISIT(traverse_module_state->__pyx_n_s_get_offset); Py_VISIT(traverse_module_state->__pyx_n_s_get_parent); Py_VISIT(traverse_module_state->__pyx_n_s_get_pitch); Py_VISIT(traverse_module_state->__pyx_n_s_get_rect); Py_VISIT(traverse_module_state->__pyx_n_s_get_shifts); Py_VISIT(traverse_module_state->__pyx_n_s_get_size); Py_VISIT(traverse_module_state->__pyx_n_s_get_surface); Py_VISIT(traverse_module_state->__pyx_n_s_get_view); Py_VISIT(traverse_module_state->__pyx_n_s_get_width); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_gmask); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_height); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_items); Py_VISIT(traverse_module_state->__pyx_n_s_k); Py_VISIT(traverse_module_state->__pyx_n_s_key); Py_VISIT(traverse_module_state->__pyx_n_s_kind); Py_VISIT(traverse_module_state->__pyx_n_s_kwargs); Py_VISIT(traverse_module_state->__pyx_n_s_lock); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_map_rgb); Py_VISIT(traverse_module_state->__pyx_n_s_masks); Py_VISIT(traverse_module_state->__pyx_n_s_maxx); Py_VISIT(traverse_module_state->__pyx_n_s_maxy); Py_VISIT(traverse_module_state->__pyx_n_s_min_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_minx); Py_VISIT(traverse_module_state->__pyx_n_s_miny); Py_VISIT(traverse_module_state->__pyx_n_s_move_height); Py_VISIT(traverse_module_state->__pyx_n_s_move_width); Py_VISIT(traverse_module_state->__pyx_n_s_mustlock); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_new_surface); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_offset_x); Py_VISIT(traverse_module_state->__pyx_n_s_offset_y); Py_VISIT(traverse_module_state->__pyx_n_s_p); Py_VISIT(traverse_module_state->__pyx_n_s_per_pixel); Py_VISIT(traverse_module_state->__pyx_n_s_pixel); Py_VISIT(traverse_module_state->__pyx_n_s_pixel_format); Py_VISIT(traverse_module_state->__pyx_n_s_pixels); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_locals); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_rect); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_surface); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_rect); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_remove); Py_VISIT(traverse_module_state->__pyx_n_s_rmask); Py_VISIT(traverse_module_state->__pyx_n_s_root); Py_VISIT(traverse_module_state->__pyx_n_s_row); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_sample_format); Py_VISIT(traverse_module_state->__pyx_n_s_scroll); Py_VISIT(traverse_module_state->__pyx_n_s_sdl_rect); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_alpha); Py_VISIT(traverse_module_state->__pyx_n_s_set_at); Py_VISIT(traverse_module_state->__pyx_n_s_set_clip); Py_VISIT(traverse_module_state->__pyx_n_s_set_colorkey); Py_VISIT(traverse_module_state->__pyx_n_s_set_masks); Py_VISIT(traverse_module_state->__pyx_n_s_set_shifts); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_shifts); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_sizeof); Py_VISIT(traverse_module_state->__pyx_n_s_source); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_special_flags); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_surface_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_srcptr); Py_VISIT(traverse_module_state->__pyx_n_s_srcx); Py_VISIT(traverse_module_state->__pyx_n_s_srcy); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_subsurface); Py_VISIT(traverse_module_state->__pyx_kp_s_subsurface_rectangle_outside_sur); Py_VISIT(traverse_module_state->__pyx_kp_s_subsurface_size_must_be_non_nega); Py_VISIT(traverse_module_state->__pyx_n_s_surf); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_temp); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_topleft); Py_VISIT(traverse_module_state->__pyx_n_s_total_size); Py_VISIT(traverse_module_state->__pyx_n_s_unlock); Py_VISIT(traverse_module_state->__pyx_n_s_unmap_rgb); Py_VISIT(traverse_module_state->__pyx_n_s_use_format); Py_VISIT(traverse_module_state->__pyx_n_s_v); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_warn); Py_VISIT(traverse_module_state->__pyx_n_s_warnings); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_32); Py_VISIT(traverse_module_state->__pyx_int_255); Py_VISIT(traverse_module_state->__pyx_int_16843009); Py_VISIT(traverse_module_state->__pyx_int_4294967295); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__34); Py_VISIT(traverse_module_state->__pyx_tuple__38); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_tuple__47); Py_VISIT(traverse_module_state->__pyx_tuple__49); Py_VISIT(traverse_module_state->__pyx_tuple__51); Py_VISIT(traverse_module_state->__pyx_tuple__56); Py_VISIT(traverse_module_state->__pyx_tuple__61); Py_VISIT(traverse_module_state->__pyx_tuple__67); Py_VISIT(traverse_module_state->__pyx_tuple__69); Py_VISIT(traverse_module_state->__pyx_tuple__72); Py_VISIT(traverse_module_state->__pyx_tuple__76); Py_VISIT(traverse_module_state->__pyx_tuple__78); Py_VISIT(traverse_module_state->__pyx_tuple__79); Py_VISIT(traverse_module_state->__pyx_tuple__81); Py_VISIT(traverse_module_state->__pyx_tuple__82); Py_VISIT(traverse_module_state->__pyx_tuple__84); Py_VISIT(traverse_module_state->__pyx_tuple__87); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__37); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__42); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__48); Py_VISIT(traverse_module_state->__pyx_codeobj__50); Py_VISIT(traverse_module_state->__pyx_codeobj__52); Py_VISIT(traverse_module_state->__pyx_codeobj__53); Py_VISIT(traverse_module_state->__pyx_codeobj__54); Py_VISIT(traverse_module_state->__pyx_codeobj__55); Py_VISIT(traverse_module_state->__pyx_codeobj__57); Py_VISIT(traverse_module_state->__pyx_codeobj__58); Py_VISIT(traverse_module_state->__pyx_codeobj__59); Py_VISIT(traverse_module_state->__pyx_codeobj__60); Py_VISIT(traverse_module_state->__pyx_codeobj__62); Py_VISIT(traverse_module_state->__pyx_codeobj__63); Py_VISIT(traverse_module_state->__pyx_codeobj__64); Py_VISIT(traverse_module_state->__pyx_codeobj__65); Py_VISIT(traverse_module_state->__pyx_codeobj__66); Py_VISIT(traverse_module_state->__pyx_codeobj__68); Py_VISIT(traverse_module_state->__pyx_codeobj__70); Py_VISIT(traverse_module_state->__pyx_codeobj__71); Py_VISIT(traverse_module_state->__pyx_codeobj__73); Py_VISIT(traverse_module_state->__pyx_codeobj__74); Py_VISIT(traverse_module_state->__pyx_codeobj__75); Py_VISIT(traverse_module_state->__pyx_codeobj__77); Py_VISIT(traverse_module_state->__pyx_codeobj__80); Py_VISIT(traverse_module_state->__pyx_codeobj__83); Py_VISIT(traverse_module_state->__pyx_codeobj__85); Py_VISIT(traverse_module_state->__pyx_codeobj__86); Py_VISIT(traverse_module_state->__pyx_codeobj__88); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_5color_Color __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_5color_Color #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_4rect_Rect __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_4rect_Rect #if CYTHON_USE_MODULE_STATE #define __pyx_type_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_type_11pygame_sdl2_7surface_Surface #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #define __pyx_kp_s_2 __pyx_mstate_global->__pyx_kp_s_2 #define __pyx_kp_s_A_null_pointer_was_passed_in __pyx_mstate_global->__pyx_kp_s_A_null_pointer_was_passed_in #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError #define __pyx_kp_s_Memory_leak_via_Surface_in_pygam __pyx_mstate_global->__pyx_kp_s_Memory_leak_via_Surface_in_pygam #define __pyx_kp_s_Position_outside_surface __pyx_mstate_global->__pyx_kp_s_Position_outside_surface #define __pyx_n_s_Rect __pyx_mstate_global->__pyx_n_s_Rect #define __pyx_n_s_SRCALPHA __pyx_mstate_global->__pyx_n_s_SRCALPHA #define __pyx_n_s_Surface __pyx_mstate_global->__pyx_n_s_Surface #define __pyx_n_s_Surface___reduce_cython __pyx_mstate_global->__pyx_n_s_Surface___reduce_cython #define __pyx_n_s_Surface___setstate_cython __pyx_mstate_global->__pyx_n_s_Surface___setstate_cython #define __pyx_n_s_Surface___sizeof __pyx_mstate_global->__pyx_n_s_Surface___sizeof #define __pyx_n_s_Surface_blit __pyx_mstate_global->__pyx_n_s_Surface_blit #define __pyx_n_s_Surface_convert __pyx_mstate_global->__pyx_n_s_Surface_convert #define __pyx_n_s_Surface_convert_alpha __pyx_mstate_global->__pyx_n_s_Surface_convert_alpha #define __pyx_n_s_Surface_copy __pyx_mstate_global->__pyx_n_s_Surface_copy #define __pyx_n_s_Surface_fill __pyx_mstate_global->__pyx_n_s_Surface_fill #define __pyx_n_s_Surface_from_data __pyx_mstate_global->__pyx_n_s_Surface_from_data #define __pyx_n_s_Surface_get_abs_offset __pyx_mstate_global->__pyx_n_s_Surface_get_abs_offset #define __pyx_n_s_Surface_get_abs_parent __pyx_mstate_global->__pyx_n_s_Surface_get_abs_parent #define __pyx_n_s_Surface_get_alpha __pyx_mstate_global->__pyx_n_s_Surface_get_alpha #define __pyx_n_s_Surface_get_at __pyx_mstate_global->__pyx_n_s_Surface_get_at #define __pyx_n_s_Surface_get_at_mapped __pyx_mstate_global->__pyx_n_s_Surface_get_at_mapped #define __pyx_n_s_Surface_get_bitsize __pyx_mstate_global->__pyx_n_s_Surface_get_bitsize #define __pyx_n_s_Surface_get_bounding_rect __pyx_mstate_global->__pyx_n_s_Surface_get_bounding_rect #define __pyx_n_s_Surface_get_buffer __pyx_mstate_global->__pyx_n_s_Surface_get_buffer #define __pyx_n_s_Surface_get_bytesize __pyx_mstate_global->__pyx_n_s_Surface_get_bytesize #define __pyx_n_s_Surface_get_clip __pyx_mstate_global->__pyx_n_s_Surface_get_clip #define __pyx_n_s_Surface_get_colorkey __pyx_mstate_global->__pyx_n_s_Surface_get_colorkey #define __pyx_n_s_Surface_get_flags __pyx_mstate_global->__pyx_n_s_Surface_get_flags #define __pyx_n_s_Surface_get_height __pyx_mstate_global->__pyx_n_s_Surface_get_height #define __pyx_n_s_Surface_get_locked __pyx_mstate_global->__pyx_n_s_Surface_get_locked #define __pyx_n_s_Surface_get_locks __pyx_mstate_global->__pyx_n_s_Surface_get_locks #define __pyx_n_s_Surface_get_losses __pyx_mstate_global->__pyx_n_s_Surface_get_losses #define __pyx_n_s_Surface_get_masks __pyx_mstate_global->__pyx_n_s_Surface_get_masks #define __pyx_n_s_Surface_get_offset __pyx_mstate_global->__pyx_n_s_Surface_get_offset #define __pyx_n_s_Surface_get_parent __pyx_mstate_global->__pyx_n_s_Surface_get_parent #define __pyx_n_s_Surface_get_pitch __pyx_mstate_global->__pyx_n_s_Surface_get_pitch #define __pyx_n_s_Surface_get_rect __pyx_mstate_global->__pyx_n_s_Surface_get_rect #define __pyx_n_s_Surface_get_shifts __pyx_mstate_global->__pyx_n_s_Surface_get_shifts #define __pyx_n_s_Surface_get_size __pyx_mstate_global->__pyx_n_s_Surface_get_size #define __pyx_n_s_Surface_get_view __pyx_mstate_global->__pyx_n_s_Surface_get_view #define __pyx_kp_s_Surface_get_view_is_not_supporte __pyx_mstate_global->__pyx_kp_s_Surface_get_view_is_not_supporte #define __pyx_n_s_Surface_get_width __pyx_mstate_global->__pyx_n_s_Surface_get_width #define __pyx_kp_s_Surface_has_unsupported_bytesize __pyx_mstate_global->__pyx_kp_s_Surface_has_unsupported_bytesize #define __pyx_n_s_Surface_lock __pyx_mstate_global->__pyx_n_s_Surface_lock #define __pyx_n_s_Surface_map_rgb __pyx_mstate_global->__pyx_n_s_Surface_map_rgb #define __pyx_n_s_Surface_mustlock __pyx_mstate_global->__pyx_n_s_Surface_mustlock #define __pyx_n_s_Surface_scroll __pyx_mstate_global->__pyx_n_s_Surface_scroll #define __pyx_n_s_Surface_set_alpha __pyx_mstate_global->__pyx_n_s_Surface_set_alpha #define __pyx_n_s_Surface_set_at __pyx_mstate_global->__pyx_n_s_Surface_set_at #define __pyx_n_s_Surface_set_clip __pyx_mstate_global->__pyx_n_s_Surface_set_clip #define __pyx_n_s_Surface_set_colorkey __pyx_mstate_global->__pyx_n_s_Surface_set_colorkey #define __pyx_n_s_Surface_set_masks __pyx_mstate_global->__pyx_n_s_Surface_set_masks #define __pyx_kp_s_Surface_set_masks_is_not_support __pyx_mstate_global->__pyx_kp_s_Surface_set_masks_is_not_support #define __pyx_n_s_Surface_set_shifts __pyx_mstate_global->__pyx_n_s_Surface_set_shifts #define __pyx_kp_s_Surface_set_shifts_is_not_suppor __pyx_mstate_global->__pyx_kp_s_Surface_set_shifts_is_not_suppor #define __pyx_n_s_Surface_subsurface __pyx_mstate_global->__pyx_n_s_Surface_subsurface #define __pyx_n_s_Surface_unlock __pyx_mstate_global->__pyx_n_s_Surface_unlock #define __pyx_n_s_Surface_unmap_rgb __pyx_mstate_global->__pyx_n_s_Surface_unmap_rgb #define __pyx_kp_s_Surface_x_x __pyx_mstate_global->__pyx_kp_s_Surface_x_x #define __pyx_kp_s_The_data_must_fill_the_surface __pyx_mstate_global->__pyx_kp_s_The_data_must_fill_the_surface #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 #define __pyx_n_s__6 __pyx_mstate_global->__pyx_n_s__6 #define __pyx_n_s__89 __pyx_mstate_global->__pyx_n_s__89 #define __pyx_n_s_alpha __pyx_mstate_global->__pyx_n_s_alpha #define __pyx_n_s_amask __pyx_mstate_global->__pyx_n_s_amask #define __pyx_n_s_amin __pyx_mstate_global->__pyx_n_s_amin #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append #define __pyx_n_s_area __pyx_mstate_global->__pyx_n_s_area #define __pyx_n_s_area_ptr __pyx_mstate_global->__pyx_n_s_area_ptr #define __pyx_n_s_area_rect __pyx_mstate_global->__pyx_n_s_area_rect #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_blit __pyx_mstate_global->__pyx_n_s_blit #define __pyx_n_s_bmask __pyx_mstate_global->__pyx_n_s_bmask #define __pyx_n_s_botright __pyx_mstate_global->__pyx_n_s_botright #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_clip __pyx_mstate_global->__pyx_n_s_clip #define __pyx_n_s_color __pyx_mstate_global->__pyx_n_s_color #define __pyx_n_s_colorkey __pyx_mstate_global->__pyx_n_s_colorkey #define __pyx_n_s_convert __pyx_mstate_global->__pyx_n_s_convert #define __pyx_n_s_convert_alpha __pyx_mstate_global->__pyx_n_s_convert_alpha #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy #define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data #define __pyx_n_s_depth __pyx_mstate_global->__pyx_n_s_depth #define __pyx_n_s_dest __pyx_mstate_global->__pyx_n_s_dest #define __pyx_n_s_dest_rect __pyx_mstate_global->__pyx_n_s_dest_rect #define __pyx_n_s_destptr __pyx_mstate_global->__pyx_n_s_destptr #define __pyx_n_s_destx __pyx_mstate_global->__pyx_n_s_destx #define __pyx_n_s_desty __pyx_mstate_global->__pyx_n_s_desty #define __pyx_n_s_dirty __pyx_mstate_global->__pyx_n_s_dirty #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display #define __pyx_n_s_dx __pyx_mstate_global->__pyx_n_s_dx #define __pyx_n_s_dy __pyx_mstate_global->__pyx_n_s_dy #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_fill __pyx_mstate_global->__pyx_n_s_fill #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_from_data __pyx_mstate_global->__pyx_n_s_from_data #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_abs_offset __pyx_mstate_global->__pyx_n_s_get_abs_offset #define __pyx_n_s_get_abs_parent __pyx_mstate_global->__pyx_n_s_get_abs_parent #define __pyx_n_s_get_alpha __pyx_mstate_global->__pyx_n_s_get_alpha #define __pyx_n_s_get_at __pyx_mstate_global->__pyx_n_s_get_at #define __pyx_n_s_get_at_mapped __pyx_mstate_global->__pyx_n_s_get_at_mapped #define __pyx_n_s_get_bitsize __pyx_mstate_global->__pyx_n_s_get_bitsize #define __pyx_n_s_get_bounding_rect __pyx_mstate_global->__pyx_n_s_get_bounding_rect #define __pyx_n_s_get_buffer __pyx_mstate_global->__pyx_n_s_get_buffer #define __pyx_n_s_get_bytesize __pyx_mstate_global->__pyx_n_s_get_bytesize #define __pyx_n_s_get_clip __pyx_mstate_global->__pyx_n_s_get_clip #define __pyx_n_s_get_colorkey __pyx_mstate_global->__pyx_n_s_get_colorkey #define __pyx_n_s_get_flags __pyx_mstate_global->__pyx_n_s_get_flags #define __pyx_n_s_get_height __pyx_mstate_global->__pyx_n_s_get_height #define __pyx_n_s_get_locked __pyx_mstate_global->__pyx_n_s_get_locked #define __pyx_n_s_get_locks __pyx_mstate_global->__pyx_n_s_get_locks #define __pyx_n_s_get_losses __pyx_mstate_global->__pyx_n_s_get_losses #define __pyx_n_s_get_masks __pyx_mstate_global->__pyx_n_s_get_masks #define __pyx_n_s_get_offset __pyx_mstate_global->__pyx_n_s_get_offset #define __pyx_n_s_get_parent __pyx_mstate_global->__pyx_n_s_get_parent #define __pyx_n_s_get_pitch __pyx_mstate_global->__pyx_n_s_get_pitch #define __pyx_n_s_get_rect __pyx_mstate_global->__pyx_n_s_get_rect #define __pyx_n_s_get_shifts __pyx_mstate_global->__pyx_n_s_get_shifts #define __pyx_n_s_get_size __pyx_mstate_global->__pyx_n_s_get_size #define __pyx_n_s_get_surface __pyx_mstate_global->__pyx_n_s_get_surface #define __pyx_n_s_get_view __pyx_mstate_global->__pyx_n_s_get_view #define __pyx_n_s_get_width __pyx_mstate_global->__pyx_n_s_get_width #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_gmask __pyx_mstate_global->__pyx_n_s_gmask #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_height __pyx_mstate_global->__pyx_n_s_height #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items #define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k #define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key #define __pyx_n_s_kind __pyx_mstate_global->__pyx_n_s_kind #define __pyx_n_s_kwargs __pyx_mstate_global->__pyx_n_s_kwargs #define __pyx_n_s_lock __pyx_mstate_global->__pyx_n_s_lock #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_map_rgb __pyx_mstate_global->__pyx_n_s_map_rgb #define __pyx_n_s_masks __pyx_mstate_global->__pyx_n_s_masks #define __pyx_n_s_maxx __pyx_mstate_global->__pyx_n_s_maxx #define __pyx_n_s_maxy __pyx_mstate_global->__pyx_n_s_maxy #define __pyx_n_s_min_alpha __pyx_mstate_global->__pyx_n_s_min_alpha #define __pyx_n_s_minx __pyx_mstate_global->__pyx_n_s_minx #define __pyx_n_s_miny __pyx_mstate_global->__pyx_n_s_miny #define __pyx_n_s_move_height __pyx_mstate_global->__pyx_n_s_move_height #define __pyx_n_s_move_width __pyx_mstate_global->__pyx_n_s_move_width #define __pyx_n_s_mustlock __pyx_mstate_global->__pyx_n_s_mustlock #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_new_surface __pyx_mstate_global->__pyx_n_s_new_surface #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_offset_x __pyx_mstate_global->__pyx_n_s_offset_x #define __pyx_n_s_offset_y __pyx_mstate_global->__pyx_n_s_offset_y #define __pyx_n_s_p __pyx_mstate_global->__pyx_n_s_p #define __pyx_n_s_per_pixel __pyx_mstate_global->__pyx_n_s_per_pixel #define __pyx_n_s_pixel __pyx_mstate_global->__pyx_n_s_pixel #define __pyx_n_s_pixel_format __pyx_mstate_global->__pyx_n_s_pixel_format #define __pyx_n_s_pixels __pyx_mstate_global->__pyx_n_s_pixels #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_pygame_sdl2 __pyx_mstate_global->__pyx_n_s_pygame_sdl2 #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_locals __pyx_mstate_global->__pyx_n_s_pygame_sdl2_locals #define __pyx_n_s_pygame_sdl2_rect __pyx_mstate_global->__pyx_n_s_pygame_sdl2_rect #define __pyx_n_s_pygame_sdl2_surface __pyx_mstate_global->__pyx_n_s_pygame_sdl2_surface #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_rect __pyx_mstate_global->__pyx_n_s_rect #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_remove __pyx_mstate_global->__pyx_n_s_remove #define __pyx_n_s_rmask __pyx_mstate_global->__pyx_n_s_rmask #define __pyx_n_s_root __pyx_mstate_global->__pyx_n_s_root #define __pyx_n_s_row __pyx_mstate_global->__pyx_n_s_row #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_sample_format __pyx_mstate_global->__pyx_n_s_sample_format #define __pyx_n_s_scroll __pyx_mstate_global->__pyx_n_s_scroll #define __pyx_n_s_sdl_rect __pyx_mstate_global->__pyx_n_s_sdl_rect #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_alpha __pyx_mstate_global->__pyx_n_s_set_alpha #define __pyx_n_s_set_at __pyx_mstate_global->__pyx_n_s_set_at #define __pyx_n_s_set_clip __pyx_mstate_global->__pyx_n_s_set_clip #define __pyx_n_s_set_colorkey __pyx_mstate_global->__pyx_n_s_set_colorkey #define __pyx_n_s_set_masks __pyx_mstate_global->__pyx_n_s_set_masks #define __pyx_n_s_set_shifts __pyx_mstate_global->__pyx_n_s_set_shifts #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_shifts __pyx_mstate_global->__pyx_n_s_shifts #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_sizeof __pyx_mstate_global->__pyx_n_s_sizeof #define __pyx_n_s_source __pyx_mstate_global->__pyx_n_s_source #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_special_flags __pyx_mstate_global->__pyx_n_s_special_flags #define __pyx_kp_s_src_pygame_sdl2_surface_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_surface_pyx #define __pyx_n_s_srcptr __pyx_mstate_global->__pyx_n_s_srcptr #define __pyx_n_s_srcx __pyx_mstate_global->__pyx_n_s_srcx #define __pyx_n_s_srcy __pyx_mstate_global->__pyx_n_s_srcy #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_subsurface __pyx_mstate_global->__pyx_n_s_subsurface #define __pyx_kp_s_subsurface_rectangle_outside_sur __pyx_mstate_global->__pyx_kp_s_subsurface_rectangle_outside_sur #define __pyx_kp_s_subsurface_size_must_be_non_nega __pyx_mstate_global->__pyx_kp_s_subsurface_size_must_be_non_nega #define __pyx_n_s_surf __pyx_mstate_global->__pyx_n_s_surf #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_temp __pyx_mstate_global->__pyx_n_s_temp #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_topleft __pyx_mstate_global->__pyx_n_s_topleft #define __pyx_n_s_total_size __pyx_mstate_global->__pyx_n_s_total_size #define __pyx_n_s_unlock __pyx_mstate_global->__pyx_n_s_unlock #define __pyx_n_s_unmap_rgb __pyx_mstate_global->__pyx_n_s_unmap_rgb #define __pyx_n_s_use_format __pyx_mstate_global->__pyx_n_s_use_format #define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn #define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 #define __pyx_int_255 __pyx_mstate_global->__pyx_int_255 #define __pyx_int_16843009 __pyx_mstate_global->__pyx_int_16843009 #define __pyx_int_4294967295 __pyx_mstate_global->__pyx_int_4294967295 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 #define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 #define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 #define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72 #define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 #define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 #define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81 #define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82 #define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 #define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 #define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 #define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54 #define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 #define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 #define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 #define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 #define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62 #define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63 #define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64 #define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 #define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 #define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68 #define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 #define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71 #define __pyx_codeobj__73 __pyx_mstate_global->__pyx_codeobj__73 #define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74 #define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75 #define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 #define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 #define __pyx_codeobj__83 __pyx_mstate_global->__pyx_codeobj__83 #define __pyx_codeobj__85 __pyx_mstate_global->__pyx_codeobj__85 #define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86 #define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88 /* #### Code section: module_code ### */ /* "pygame_sdl2/surface.pyx":37 * SDL_Surface * dst, SDL_Rect * dstrect, int the_args); * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) noexcept nogil: # <<<<<<<<<<<<<< * if src < dst: * src += (h - 1) * srcpitch; */ static void __pyx_f_11pygame_sdl2_7surface_move_pixels(Uint8 *__pyx_v_src, Uint8 *__pyx_v_dst, int __pyx_v_h, int __pyx_v_span, int __pyx_v_srcpitch, int __pyx_v_dstpitch) { int __pyx_t_1; /* "pygame_sdl2/surface.pyx":38 * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) noexcept nogil: * if src < dst: # <<<<<<<<<<<<<< * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; */ __pyx_t_1 = (__pyx_v_src < __pyx_v_dst); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":39 * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) noexcept nogil: * if src < dst: * src += (h - 1) * srcpitch; # <<<<<<<<<<<<<< * dst += (h - 1) * dstpitch; * srcpitch = -srcpitch; */ __pyx_v_src = (__pyx_v_src + ((__pyx_v_h - 1) * __pyx_v_srcpitch)); /* "pygame_sdl2/surface.pyx":40 * if src < dst: * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; # <<<<<<<<<<<<<< * srcpitch = -srcpitch; * dstpitch = -dstpitch; */ __pyx_v_dst = (__pyx_v_dst + ((__pyx_v_h - 1) * __pyx_v_dstpitch)); /* "pygame_sdl2/surface.pyx":41 * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; * srcpitch = -srcpitch; # <<<<<<<<<<<<<< * dstpitch = -dstpitch; * */ __pyx_v_srcpitch = (-__pyx_v_srcpitch); /* "pygame_sdl2/surface.pyx":42 * dst += (h - 1) * dstpitch; * srcpitch = -srcpitch; * dstpitch = -dstpitch; # <<<<<<<<<<<<<< * * while h: */ __pyx_v_dstpitch = (-__pyx_v_dstpitch); /* "pygame_sdl2/surface.pyx":38 * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) noexcept nogil: * if src < dst: # <<<<<<<<<<<<<< * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; */ } /* "pygame_sdl2/surface.pyx":44 * dstpitch = -dstpitch; * * while h: # <<<<<<<<<<<<<< * h -= 1 * memmove(dst, src, span); */ while (1) { __pyx_t_1 = (__pyx_v_h != 0); if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":45 * * while h: * h -= 1 # <<<<<<<<<<<<<< * memmove(dst, src, span); * src += srcpitch; */ __pyx_v_h = (__pyx_v_h - 1); /* "pygame_sdl2/surface.pyx":46 * while h: * h -= 1 * memmove(dst, src, span); # <<<<<<<<<<<<<< * src += srcpitch; * dst += dstpitch; */ (void)(memmove(__pyx_v_dst, __pyx_v_src, __pyx_v_span)); /* "pygame_sdl2/surface.pyx":47 * h -= 1 * memmove(dst, src, span); * src += srcpitch; # <<<<<<<<<<<<<< * dst += dstpitch; * */ __pyx_v_src = (__pyx_v_src + __pyx_v_srcpitch); /* "pygame_sdl2/surface.pyx":48 * memmove(dst, src, span); * src += srcpitch; * dst += dstpitch; # <<<<<<<<<<<<<< * * # The total size of all allocated surfaces */ __pyx_v_dst = (__pyx_v_dst + __pyx_v_dstpitch); } /* "pygame_sdl2/surface.pyx":37 * SDL_Surface * dst, SDL_Rect * dstrect, int the_args); * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) noexcept nogil: # <<<<<<<<<<<<<< * if src < dst: * src += (h - 1) * srcpitch; */ /* function exit code */ } /* "pygame_sdl2/surface.pyx":55 * cdef class Surface: * * def __cinit__(self): # <<<<<<<<<<<<<< * self.surface = NULL * self.owns_surface = False */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface___cinit__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7surface_7Surface___cinit__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { int __pyx_r; /* "pygame_sdl2/surface.pyx":56 * * def __cinit__(self): * self.surface = NULL # <<<<<<<<<<<<<< * self.owns_surface = False * self.window_surface = False */ __pyx_v_self->surface = NULL; /* "pygame_sdl2/surface.pyx":57 * def __cinit__(self): * self.surface = NULL * self.owns_surface = False # <<<<<<<<<<<<<< * self.window_surface = False * self.has_alpha = False */ __pyx_v_self->owns_surface = 0; /* "pygame_sdl2/surface.pyx":58 * self.surface = NULL * self.owns_surface = False * self.window_surface = False # <<<<<<<<<<<<<< * self.has_alpha = False * */ __pyx_v_self->window_surface = 0; /* "pygame_sdl2/surface.pyx":59 * self.owns_surface = False * self.window_surface = False * self.has_alpha = False # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->has_alpha = 0; /* "pygame_sdl2/surface.pyx":55 * cdef class Surface: * * def __cinit__(self): # <<<<<<<<<<<<<< * self.surface = NULL * self.owns_surface = False */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/surface.pyx":61 * self.has_alpha = False * * def __dealloc__(self): # <<<<<<<<<<<<<< * global total_size * */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_7surface_7Surface_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_7surface_7Surface_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_11pygame_sdl2_7surface_7Surface_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_7surface_7Surface_2__dealloc__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 1); /* "pygame_sdl2/surface.pyx":64 * global total_size * * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * if total_size: * total_size -= self.surface.pitch * self.surface.h */ __pyx_t_2 = (__pyx_v_self->surface != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = __pyx_v_self->owns_surface; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":65 * * if self.surface and self.owns_surface: * if total_size: # <<<<<<<<<<<<<< * total_size -= self.surface.pitch * self.surface.h * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_total_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":66 * if self.surface and self.owns_surface: * if total_size: * total_size -= self.surface.pitch * self.surface.h # <<<<<<<<<<<<<< * * SDL_FreeSurface(self.surface) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_total_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->surface->pitch * __pyx_v_self->surface->h)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_size, __pyx_t_5) < 0) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/surface.pyx":65 * * if self.surface and self.owns_surface: * if total_size: # <<<<<<<<<<<<<< * total_size -= self.surface.pitch * self.surface.h * */ } /* "pygame_sdl2/surface.pyx":68 * total_size -= self.surface.pitch * self.surface.h * * SDL_FreeSurface(self.surface) # <<<<<<<<<<<<<< * return * elif self.window_surface: */ SDL_FreeSurface(__pyx_v_self->surface); /* "pygame_sdl2/surface.pyx":69 * * SDL_FreeSurface(self.surface) * return # <<<<<<<<<<<<<< * elif self.window_surface: * return */ goto __pyx_L0; /* "pygame_sdl2/surface.pyx":64 * global total_size * * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * if total_size: * total_size -= self.surface.pitch * self.surface.h */ } /* "pygame_sdl2/surface.pyx":70 * SDL_FreeSurface(self.surface) * return * elif self.window_surface: # <<<<<<<<<<<<<< * return * elif self.parent: */ if (__pyx_v_self->window_surface) { /* "pygame_sdl2/surface.pyx":71 * return * elif self.window_surface: * return # <<<<<<<<<<<<<< * elif self.parent: * SDL_FreeSurface(self.surface) */ goto __pyx_L0; /* "pygame_sdl2/surface.pyx":70 * SDL_FreeSurface(self.surface) * return * elif self.window_surface: # <<<<<<<<<<<<<< * return * elif self.parent: */ } /* "pygame_sdl2/surface.pyx":72 * elif self.window_surface: * return * elif self.parent: # <<<<<<<<<<<<<< * SDL_FreeSurface(self.surface) * return */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->parent)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 72, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":73 * return * elif self.parent: * SDL_FreeSurface(self.surface) # <<<<<<<<<<<<<< * return * */ SDL_FreeSurface(__pyx_v_self->surface); /* "pygame_sdl2/surface.pyx":74 * elif self.parent: * SDL_FreeSurface(self.surface) * return # <<<<<<<<<<<<<< * * warnings.warn("Memory leak via Surface in pygame_sdl2.") */ goto __pyx_L0; /* "pygame_sdl2/surface.pyx":72 * elif self.window_surface: * return * elif self.parent: # <<<<<<<<<<<<<< * SDL_FreeSurface(self.surface) * return */ } /* "pygame_sdl2/surface.pyx":76 * return * * warnings.warn("Memory leak via Surface in pygame_sdl2.") # <<<<<<<<<<<<<< * * def __sizeof__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_Memory_leak_via_Surface_in_pygam}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/surface.pyx":61 * self.has_alpha = False * * def __dealloc__(self): # <<<<<<<<<<<<<< * global total_size * */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_WriteUnraisable("pygame_sdl2.surface.Surface.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/surface.pyx":78 * warnings.warn("Memory leak via Surface in pygame_sdl2.") * * def __sizeof__(self): # <<<<<<<<<<<<<< * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_4__sizeof__, "Surface.__sizeof__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_5__sizeof__ = {"__sizeof__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_4__sizeof__}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__sizeof__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__sizeof__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__sizeof__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_4__sizeof__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_4__sizeof__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__sizeof__", 1); /* "pygame_sdl2/surface.pyx":79 * * def __sizeof__(self): * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * return self.surface.pitch * self.surface.h * else: */ __pyx_t_2 = (__pyx_v_self->surface != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = __pyx_v_self->owns_surface; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":80 * def __sizeof__(self): * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h # <<<<<<<<<<<<<< * else: * return 0 */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->surface->pitch * __pyx_v_self->surface->h)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":79 * * def __sizeof__(self): * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * return self.surface.pitch * self.surface.h * else: */ } /* "pygame_sdl2/surface.pyx":82 * return self.surface.pitch * self.surface.h * else: * return 0 # <<<<<<<<<<<<<< * * def __init__(self, size, flags=0, depth=32, masks=None): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":78 * warnings.warn("Memory leak via Surface in pygame_sdl2.") * * def __sizeof__(self): # <<<<<<<<<<<<<< * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__sizeof__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":84 * return 0 * * def __init__(self, size, flags=0, depth=32, masks=None): # <<<<<<<<<<<<<< * * self.locklist = None */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_depth = 0; PyObject *__pyx_v_masks = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_flags,&__pyx_n_s_depth,&__pyx_n_s_masks,0}; values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_0)); values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_32)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depth); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_masks); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 84, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_flags = values[1]; __pyx_v_depth = values[2]; __pyx_v_masks = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 84, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_6__init__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_size, __pyx_v_flags, __pyx_v_depth, __pyx_v_masks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7surface_7Surface_6__init__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_masks) { int __pyx_v_w; int __pyx_v_h; Uint32 __pyx_v_Rmask; Uint32 __pyx_v_Gmask; Uint32 __pyx_v_Bmask; Uint32 __pyx_v_Amask; SDL_Surface *__pyx_v_sample; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_pysample = 0; int __pyx_v_depth_int; SDL_Surface *__pyx_v_surface; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Uint32 __pyx_t_10; Uint32 __pyx_t_11; Uint32 __pyx_t_12; Uint32 __pyx_t_13; SDL_Surface *__pyx_t_14; Uint8 __pyx_t_15; unsigned int __pyx_t_16; int __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pygame_sdl2/surface.pyx":86 * def __init__(self, size, flags=0, depth=32, masks=None): * * self.locklist = None # <<<<<<<<<<<<<< * self.parent = None * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->locklist); __Pyx_DECREF(__pyx_v_self->locklist); __pyx_v_self->locklist = Py_None; /* "pygame_sdl2/surface.pyx":87 * * self.locklist = None * self.parent = None # <<<<<<<<<<<<<< * * self.offset_x = 0 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF((PyObject *)__pyx_v_self->parent); __Pyx_DECREF((PyObject *)__pyx_v_self->parent); __pyx_v_self->parent = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); /* "pygame_sdl2/surface.pyx":89 * self.parent = None * * self.offset_x = 0 # <<<<<<<<<<<<<< * self.offset_y = 0 * */ __pyx_v_self->offset_x = 0; /* "pygame_sdl2/surface.pyx":90 * * self.offset_x = 0 * self.offset_y = 0 # <<<<<<<<<<<<<< * * self.get_window_flags = None */ __pyx_v_self->offset_y = 0; /* "pygame_sdl2/surface.pyx":92 * self.offset_y = 0 * * self.get_window_flags = None # <<<<<<<<<<<<<< * * # When size is an empty tuple, we do not create a surface, and */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->get_window_flags); __Pyx_DECREF(__pyx_v_self->get_window_flags); __pyx_v_self->get_window_flags = Py_None; /* "pygame_sdl2/surface.pyx":96 * # When size is an empty tuple, we do not create a surface, and * # expect our caller to set this object up. * if size == (): # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_size, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":97 * # expect our caller to set this object up. * if size == (): * return # <<<<<<<<<<<<<< * * cdef int w */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":96 * # When size is an empty tuple, we do not create a surface, and * # expect our caller to set this object up. * if size == (): # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/surface.pyx":102 * cdef int h * * w, h = size # <<<<<<<<<<<<<< * assert w >= 0 * assert h >= 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 102, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 102, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_w = __pyx_t_6; __pyx_v_h = __pyx_t_7; /* "pygame_sdl2/surface.pyx":103 * * w, h = size * assert w >= 0 # <<<<<<<<<<<<<< * assert h >= 0 * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_w >= 0); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 103, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 103, __pyx_L1_error) #endif /* "pygame_sdl2/surface.pyx":104 * w, h = size * assert w >= 0 * assert h >= 0 # <<<<<<<<<<<<<< * * cdef Uint32 Rmask, Gmask, Bmask, Amask */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_h >= 0); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 104, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 104, __pyx_L1_error) #endif /* "pygame_sdl2/surface.pyx":111 * cdef int depth_int * * if masks is not None: # <<<<<<<<<<<<<< * Rmask, Gmask, Bmask, Amask = masks * depth_int = depth */ __pyx_t_2 = (__pyx_v_masks != Py_None); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":112 * * if masks is not None: * Rmask, Gmask, Bmask, Amask = masks # <<<<<<<<<<<<<< * depth_int = depth * */ if ((likely(PyTuple_CheckExact(__pyx_v_masks))) || (PyList_CheckExact(__pyx_v_masks))) { PyObject* sequence = __pyx_v_masks; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 112, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_8 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_1,&__pyx_t_4,&__pyx_t_8}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_1,&__pyx_t_4,&__pyx_t_8}; __pyx_t_9 = PyObject_GetIter(__pyx_v_masks); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); for (index=0; index < 4; index++) { PyObject* item = __pyx_t_5(__pyx_t_9); if (unlikely(!item)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_9), 4) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 112, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_10 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_10 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_11 = __Pyx_PyInt_As_uint32_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_12 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint32_t(__pyx_t_8); if (unlikely((__pyx_t_13 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_Rmask = __pyx_t_10; __pyx_v_Gmask = __pyx_t_11; __pyx_v_Bmask = __pyx_t_12; __pyx_v_Amask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":113 * if masks is not None: * Rmask, Gmask, Bmask, Amask = masks * depth_int = depth # <<<<<<<<<<<<<< * * elif isinstance(depth, Surface): */ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_depth); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error) __pyx_v_depth_int = __pyx_t_7; /* "pygame_sdl2/surface.pyx":111 * cdef int depth_int * * if masks is not None: # <<<<<<<<<<<<<< * Rmask, Gmask, Bmask, Amask = masks * depth_int = depth */ goto __pyx_L6; } /* "pygame_sdl2/surface.pyx":115 * depth_int = depth * * elif isinstance(depth, Surface): # <<<<<<<<<<<<<< * * pysample = depth */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_depth, __pyx_ptype_11pygame_sdl2_7surface_Surface); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":117 * elif isinstance(depth, Surface): * * pysample = depth # <<<<<<<<<<<<<< * sample = pysample.surface * Rmask = sample.format.Rmask */ if (!(likely(((__pyx_v_depth) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_depth, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 117, __pyx_L1_error) __pyx_t_8 = __pyx_v_depth; __Pyx_INCREF(__pyx_t_8); __pyx_v_pysample = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_8); __pyx_t_8 = 0; /* "pygame_sdl2/surface.pyx":118 * * pysample = depth * sample = pysample.surface # <<<<<<<<<<<<<< * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask */ __pyx_t_14 = __pyx_v_pysample->surface; __pyx_v_sample = __pyx_t_14; /* "pygame_sdl2/surface.pyx":119 * pysample = depth * sample = pysample.surface * Rmask = sample.format.Rmask # <<<<<<<<<<<<<< * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask */ __pyx_t_13 = __pyx_v_sample->format->Rmask; __pyx_v_Rmask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":120 * sample = pysample.surface * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask # <<<<<<<<<<<<<< * Bmask = sample.format.Bmask * Amask = sample.format.Amask */ __pyx_t_13 = __pyx_v_sample->format->Gmask; __pyx_v_Gmask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":121 * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask # <<<<<<<<<<<<<< * Amask = sample.format.Amask * depth_int = sample.format.BitsPerPixel */ __pyx_t_13 = __pyx_v_sample->format->Bmask; __pyx_v_Bmask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":122 * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask * Amask = sample.format.Amask # <<<<<<<<<<<<<< * depth_int = sample.format.BitsPerPixel * */ __pyx_t_13 = __pyx_v_sample->format->Amask; __pyx_v_Amask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":123 * Bmask = sample.format.Bmask * Amask = sample.format.Amask * depth_int = sample.format.BitsPerPixel # <<<<<<<<<<<<<< * * else: */ __pyx_t_15 = __pyx_v_sample->format->BitsPerPixel; __pyx_v_depth_int = __pyx_t_15; /* "pygame_sdl2/surface.pyx":115 * depth_int = depth * * elif isinstance(depth, Surface): # <<<<<<<<<<<<<< * * pysample = depth */ goto __pyx_L6; } /* "pygame_sdl2/surface.pyx":127 * else: * * pysample = pygame_sdl2.display.get_surface() # <<<<<<<<<<<<<< * * if pysample and pysample.surface.format.BitsPerPixel == 32: */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_16 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_16 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_16, 0+__pyx_t_16); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 127, __pyx_L1_error) __pyx_v_pysample = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_8); __pyx_t_8 = 0; /* "pygame_sdl2/surface.pyx":129 * pysample = pygame_sdl2.display.get_surface() * * if pysample and pysample.surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * sample = pysample.surface * Rmask = sample.format.Rmask */ __pyx_t_17 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_pysample)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 129, __pyx_L1_error) if (__pyx_t_17) { } else { __pyx_t_2 = __pyx_t_17; goto __pyx_L10_bool_binop_done; } __pyx_t_17 = (__pyx_v_pysample->surface->format->BitsPerPixel == 32); __pyx_t_2 = __pyx_t_17; __pyx_L10_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":130 * * if pysample and pysample.surface.format.BitsPerPixel == 32: * sample = pysample.surface # <<<<<<<<<<<<<< * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask */ __pyx_t_14 = __pyx_v_pysample->surface; __pyx_v_sample = __pyx_t_14; /* "pygame_sdl2/surface.pyx":131 * if pysample and pysample.surface.format.BitsPerPixel == 32: * sample = pysample.surface * Rmask = sample.format.Rmask # <<<<<<<<<<<<<< * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask */ __pyx_t_13 = __pyx_v_sample->format->Rmask; __pyx_v_Rmask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":132 * sample = pysample.surface * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask # <<<<<<<<<<<<<< * Bmask = sample.format.Bmask * Amask = sample.format.Amask */ __pyx_t_13 = __pyx_v_sample->format->Gmask; __pyx_v_Gmask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":133 * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask # <<<<<<<<<<<<<< * Amask = sample.format.Amask * */ __pyx_t_13 = __pyx_v_sample->format->Bmask; __pyx_v_Bmask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":134 * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask * Amask = sample.format.Amask # <<<<<<<<<<<<<< * * else: */ __pyx_t_13 = __pyx_v_sample->format->Amask; __pyx_v_Amask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":129 * pysample = pygame_sdl2.display.get_surface() * * if pysample and pysample.surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * sample = pysample.surface * Rmask = sample.format.Rmask */ goto __pyx_L9; } /* "pygame_sdl2/surface.pyx":139 * * # RGB(A) * if SDL_BYTEORDER == SDL_BIG_ENDIAN: # <<<<<<<<<<<<<< * Rmask = 0xff000000 * Gmask = 0x00ff0000 */ /*else*/ { __pyx_t_2 = (SDL_BYTEORDER == SDL_BIG_ENDIAN); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":140 * # RGB(A) * if SDL_BYTEORDER == SDL_BIG_ENDIAN: * Rmask = 0xff000000 # <<<<<<<<<<<<<< * Gmask = 0x00ff0000 * Bmask = 0x0000ff00 */ __pyx_v_Rmask = 0xff000000; /* "pygame_sdl2/surface.pyx":141 * if SDL_BYTEORDER == SDL_BIG_ENDIAN: * Rmask = 0xff000000 * Gmask = 0x00ff0000 # <<<<<<<<<<<<<< * Bmask = 0x0000ff00 * Amask = 0 */ __pyx_v_Gmask = 0x00ff0000; /* "pygame_sdl2/surface.pyx":142 * Rmask = 0xff000000 * Gmask = 0x00ff0000 * Bmask = 0x0000ff00 # <<<<<<<<<<<<<< * Amask = 0 * else: */ __pyx_v_Bmask = 0x0000ff00; /* "pygame_sdl2/surface.pyx":143 * Gmask = 0x00ff0000 * Bmask = 0x0000ff00 * Amask = 0 # <<<<<<<<<<<<<< * else: * Rmask = 0x000000ff */ __pyx_v_Amask = 0; /* "pygame_sdl2/surface.pyx":139 * * # RGB(A) * if SDL_BYTEORDER == SDL_BIG_ENDIAN: # <<<<<<<<<<<<<< * Rmask = 0xff000000 * Gmask = 0x00ff0000 */ goto __pyx_L12; } /* "pygame_sdl2/surface.pyx":145 * Amask = 0 * else: * Rmask = 0x000000ff # <<<<<<<<<<<<<< * Gmask = 0x0000ff00 * Bmask = 0x00ff0000 */ /*else*/ { __pyx_v_Rmask = 0x000000ff; /* "pygame_sdl2/surface.pyx":146 * else: * Rmask = 0x000000ff * Gmask = 0x0000ff00 # <<<<<<<<<<<<<< * Bmask = 0x00ff0000 * Amask = 0 */ __pyx_v_Gmask = 0x0000ff00; /* "pygame_sdl2/surface.pyx":147 * Rmask = 0x000000ff * Gmask = 0x0000ff00 * Bmask = 0x00ff0000 # <<<<<<<<<<<<<< * Amask = 0 * */ __pyx_v_Bmask = 0x00ff0000; /* "pygame_sdl2/surface.pyx":148 * Gmask = 0x0000ff00 * Bmask = 0x00ff0000 * Amask = 0 # <<<<<<<<<<<<<< * * if (flags & SRCALPHA): */ __pyx_v_Amask = 0; } __pyx_L12:; } __pyx_L9:; /* "pygame_sdl2/surface.pyx":150 * Amask = 0 * * if (flags & SRCALPHA): # <<<<<<<<<<<<<< * if not Amask: * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = PyNumber_And(__pyx_v_flags, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":151 * * if (flags & SRCALPHA): * if not Amask: # <<<<<<<<<<<<<< * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) * else: */ __pyx_t_2 = (!(__pyx_v_Amask != 0)); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":152 * if (flags & SRCALPHA): * if not Amask: * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) # <<<<<<<<<<<<<< * else: * Amask = 0 */ __pyx_t_4 = __Pyx_PyInt_From_uint32_t((~((__pyx_v_Rmask | __pyx_v_Gmask) | __pyx_v_Bmask))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PyNumber_And(__pyx_int_4294967295, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint32_t(__pyx_t_8); if (unlikely((__pyx_t_13 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_Amask = __pyx_t_13; /* "pygame_sdl2/surface.pyx":151 * * if (flags & SRCALPHA): * if not Amask: # <<<<<<<<<<<<<< * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) * else: */ } /* "pygame_sdl2/surface.pyx":150 * Amask = 0 * * if (flags & SRCALPHA): # <<<<<<<<<<<<<< * if not Amask: * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) */ goto __pyx_L13; } /* "pygame_sdl2/surface.pyx":154 * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) * else: * Amask = 0 # <<<<<<<<<<<<<< * * depth_int = 32 */ /*else*/ { __pyx_v_Amask = 0; } __pyx_L13:; /* "pygame_sdl2/surface.pyx":156 * Amask = 0 * * depth_int = 32 # <<<<<<<<<<<<<< * * cdef SDL_Surface *surface */ __pyx_v_depth_int = 32; } __pyx_L6:; /* "pygame_sdl2/surface.pyx":160 * cdef SDL_Surface *surface * * with nogil: # <<<<<<<<<<<<<< * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":161 * * with nogil: * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) # <<<<<<<<<<<<<< * * if not surface: */ __pyx_v_surface = SDL_CreateRGBSurface(0, __pyx_v_w, __pyx_v_h, __pyx_v_depth_int, __pyx_v_Rmask, __pyx_v_Gmask, __pyx_v_Bmask, __pyx_v_Amask); } /* "pygame_sdl2/surface.pyx":160 * cdef SDL_Surface *surface * * with nogil: # <<<<<<<<<<<<<< * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } /* "pygame_sdl2/surface.pyx":163 * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * * if not surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (!(__pyx_v_surface != 0)); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":164 * * if not surface: * raise error() # <<<<<<<<<<<<<< * * self.take_surface(surface) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_16 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_16 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_16, 0+__pyx_t_16); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 164, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":163 * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * * if not surface: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":166 * raise error() * * self.take_surface(surface) # <<<<<<<<<<<<<< * * cdef void take_surface(self, SDL_Surface *surface): */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_self->__pyx_vtab)->take_surface(__pyx_v_self, __pyx_v_surface); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":84 * return 0 * * def __init__(self, size, flags=0, depth=32, masks=None): # <<<<<<<<<<<<<< * * self.locklist = None */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_pysample); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":168 * self.take_surface(surface) * * cdef void take_surface(self, SDL_Surface *surface): # <<<<<<<<<<<<<< * if not surface: * raise error("A null pointer was passed in.") */ static void __pyx_f_11pygame_sdl2_7surface_7Surface_take_surface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, SDL_Surface *__pyx_v_surface) { __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("take_surface", 1); /* "pygame_sdl2/surface.pyx":169 * * cdef void take_surface(self, SDL_Surface *surface): * if not surface: # <<<<<<<<<<<<<< * raise error("A null pointer was passed in.") * */ __pyx_t_1 = (!(__pyx_v_surface != 0)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":170 * cdef void take_surface(self, SDL_Surface *surface): * if not surface: * raise error("A null pointer was passed in.") # <<<<<<<<<<<<<< * * self.surface = surface */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_A_null_pointer_was_passed_in}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 170, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":169 * * cdef void take_surface(self, SDL_Surface *surface): * if not surface: # <<<<<<<<<<<<<< * raise error("A null pointer was passed in.") * */ } /* "pygame_sdl2/surface.pyx":172 * raise error("A null pointer was passed in.") * * self.surface = surface # <<<<<<<<<<<<<< * self.owns_surface = True * */ __pyx_v_self->surface = __pyx_v_surface; /* "pygame_sdl2/surface.pyx":173 * * self.surface = surface * self.owns_surface = True # <<<<<<<<<<<<<< * * global total_size */ __pyx_v_self->owns_surface = 1; /* "pygame_sdl2/surface.pyx":177 * global total_size * * total_size += self.surface.pitch * self.surface.h # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_total_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->surface->pitch * __pyx_v_self->surface->h)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_size, __pyx_t_4) < 0) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":168 * self.take_surface(surface) * * cdef void take_surface(self, SDL_Surface *surface): # <<<<<<<<<<<<<< * if not surface: * raise error("A null pointer was passed in.") */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.take_surface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/surface.pyx":179 * total_size += self.surface.pitch * self.surface.h * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_8__repr__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_8__repr__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "pygame_sdl2/surface.pyx":180 * * def __repr__(self): * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) # <<<<<<<<<<<<<< * * def blit(self, Surface source, dest, area=None, int special_flags=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Surface_x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->surface->format->BitsPerPixel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":179 * total_size += self.surface.pitch * self.surface.h * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":182 * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * * def blit(self, Surface source, dest, area=None, int special_flags=0): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_10blit, "Surface.blit(self, Surface source, dest, area=None, int special_flags=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_11blit = {"blit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_10blit}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_source = 0; PyObject *__pyx_v_dest = 0; PyObject *__pyx_v_area = 0; int __pyx_v_special_flags; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("blit (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_dest,&__pyx_n_s_area,&__pyx_n_s_special_flags,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_source)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dest)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("blit", 0, 2, 4, 1); __PYX_ERR(0, 182, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_area); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_special_flags); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "blit") < 0)) __PYX_ERR(0, 182, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_source = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_dest = values[1]; __pyx_v_area = values[2]; if (values[3]) { __pyx_v_special_flags = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_special_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) } else { __pyx_v_special_flags = ((int)0); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("blit", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 182, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.blit", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "source", 0))) __PYX_ERR(0, 182, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_10blit(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_source, __pyx_v_dest, __pyx_v_area, __pyx_v_special_flags); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_10blit(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_source, PyObject *__pyx_v_dest, PyObject *__pyx_v_area, int __pyx_v_special_flags) { SDL_Rect __pyx_v_dest_rect; SDL_Rect __pyx_v_area_rect; SDL_Rect *__pyx_v_area_ptr; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_temp = 0; int __pyx_v_err; Uint32 __pyx_v_key; Uint8 __pyx_v_alpha; int __pyx_v_colorkey; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("blit", 0); __Pyx_INCREF((PyObject *)__pyx_v_source); __Pyx_INCREF(__pyx_v_area); /* "pygame_sdl2/surface.pyx":185 * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect * cdef SDL_Rect *area_ptr = NULL # <<<<<<<<<<<<<< * * cdef Surface temp */ __pyx_v_area_ptr = NULL; /* "pygame_sdl2/surface.pyx":194 * cdef bint colorkey * * colorkey = (SDL_GetColorKey(source.surface, &key) == 0) # <<<<<<<<<<<<<< * * if not source.surface.format.Amask: */ __pyx_v_colorkey = (SDL_GetColorKey(__pyx_v_source->surface, (&__pyx_v_key)) == 0); /* "pygame_sdl2/surface.pyx":196 * colorkey = (SDL_GetColorKey(source.surface, &key) == 0) * * if not source.surface.format.Amask: # <<<<<<<<<<<<<< * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): * raise error() */ __pyx_t_1 = (!(__pyx_v_source->surface->format->Amask != 0)); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":197 * * if not source.surface.format.Amask: * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetSurfaceAlphaMod(__pyx_v_source->surface, (&__pyx_v_alpha)) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":198 * if not source.surface.format.Amask: * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): * raise error() # <<<<<<<<<<<<<< * * if alpha != 255 and (self.surface.format.Amask or colorkey): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 198, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":197 * * if not source.surface.format.Amask: * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":200 * raise error() * * if alpha != 255 and (self.surface.format.Amask or colorkey): # <<<<<<<<<<<<<< * * if area: */ __pyx_t_6 = (__pyx_v_alpha != 0xFF); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __pyx_t_6 = (__pyx_v_self->surface->format->Amask != 0); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __pyx_t_1 = __pyx_v_colorkey; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":202 * if alpha != 255 and (self.surface.format.Amask or colorkey): * * if area: # <<<<<<<<<<<<<< * source = source.subsurface(area) * area = None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_area); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":203 * * if area: * source = source.subsurface(area) # <<<<<<<<<<<<<< * area = None * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_subsurface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_area}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_source, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":204 * if area: * source = source.subsurface(area) * area = None # <<<<<<<<<<<<<< * * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_area, Py_None); /* "pygame_sdl2/surface.pyx":202 * if alpha != 255 and (self.surface.format.Amask or colorkey): * * if area: # <<<<<<<<<<<<<< * source = source.subsurface(area) * area = None */ } /* "pygame_sdl2/surface.pyx":206 * area = None * * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): # <<<<<<<<<<<<<< * raise error() * temp = Surface(source.get_size(), SRCALPHA) */ __pyx_t_1 = (SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_NONE) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":207 * * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): * raise error() # <<<<<<<<<<<<<< * temp = Surface(source.get_size(), SRCALPHA) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 207, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":206 * area = None * * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): # <<<<<<<<<<<<<< * raise error() * temp = Surface(source.get_size(), SRCALPHA) */ } /* "pygame_sdl2/surface.pyx":208 * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): * raise error() * temp = Surface(source.get_size(), SRCALPHA) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_temp = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":210 * temp = Surface(source.get_size(), SRCALPHA) * * with nogil: # <<<<<<<<<<<<<< * err = SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":211 * * with nogil: * err = SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) # <<<<<<<<<<<<<< * * if err: */ __pyx_v_err = SDL_UpperBlit(__pyx_v_source->surface, NULL, __pyx_v_temp->surface, NULL); } /* "pygame_sdl2/surface.pyx":210 * temp = Surface(source.get_size(), SRCALPHA) * * with nogil: # <<<<<<<<<<<<<< * err = SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L13; } __pyx_L13:; } } /* "pygame_sdl2/surface.pyx":213 * err = SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_err != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":214 * * if err: * raise error() # <<<<<<<<<<<<<< * * source = temp */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 214, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":213 * err = SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":216 * raise error() * * source = temp # <<<<<<<<<<<<<< * colorkey = False * */ __Pyx_INCREF((PyObject *)__pyx_v_temp); __Pyx_DECREF_SET(__pyx_v_source, __pyx_v_temp); /* "pygame_sdl2/surface.pyx":217 * * source = temp * colorkey = False # <<<<<<<<<<<<<< * * if colorkey: */ __pyx_v_colorkey = 0; /* "pygame_sdl2/surface.pyx":200 * raise error() * * if alpha != 255 and (self.surface.format.Amask or colorkey): # <<<<<<<<<<<<<< * * if area: */ } /* "pygame_sdl2/surface.pyx":196 * colorkey = (SDL_GetColorKey(source.surface, &key) == 0) * * if not source.surface.format.Amask: # <<<<<<<<<<<<<< * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): * raise error() */ } /* "pygame_sdl2/surface.pyx":219 * colorkey = False * * if colorkey: # <<<<<<<<<<<<<< * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): * raise error() */ if (__pyx_v_colorkey) { /* "pygame_sdl2/surface.pyx":220 * * if colorkey: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): # <<<<<<<<<<<<<< * raise error() * else: */ __pyx_t_1 = (SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_NONE) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":221 * if colorkey: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): * raise error() # <<<<<<<<<<<<<< * else: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 221, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":220 * * if colorkey: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): # <<<<<<<<<<<<<< * raise error() * else: */ } /* "pygame_sdl2/surface.pyx":219 * colorkey = False * * if colorkey: # <<<<<<<<<<<<<< * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): * raise error() */ goto __pyx_L15; } /* "pygame_sdl2/surface.pyx":223 * raise error() * else: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_1 = (SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_BLEND) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":224 * else: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND): * raise error() # <<<<<<<<<<<<<< * * to_sdl_rect(dest, &dest_rect, "dest") */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 224, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":223 * raise error() * else: * if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L15:; /* "pygame_sdl2/surface.pyx":226 * raise error() * * to_sdl_rect(dest, &dest_rect, "dest") # <<<<<<<<<<<<<< * * if area is not None: */ __pyx_t_8.__pyx_n = 1; __pyx_t_8.argname = __pyx_n_s_dest; __pyx_t_7 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), &__pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 226, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":228 * to_sdl_rect(dest, &dest_rect, "dest") * * if area is not None: # <<<<<<<<<<<<<< * to_sdl_rect(area, &area_rect, "area") * area_ptr = &area_rect */ __pyx_t_1 = (__pyx_v_area != Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":229 * * if area is not None: * to_sdl_rect(area, &area_rect, "area") # <<<<<<<<<<<<<< * area_ptr = &area_rect * */ __pyx_t_8.__pyx_n = 1; __pyx_t_8.argname = __pyx_n_s_area; __pyx_t_7 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_area, (&__pyx_v_area_rect), &__pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 229, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":230 * if area is not None: * to_sdl_rect(area, &area_rect, "area") * area_ptr = &area_rect # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_area_ptr = (&__pyx_v_area_rect); /* "pygame_sdl2/surface.pyx":228 * to_sdl_rect(dest, &dest_rect, "dest") * * if area is not None: # <<<<<<<<<<<<<< * to_sdl_rect(area, &area_rect, "area") * area_ptr = &area_rect */ } /* "pygame_sdl2/surface.pyx":232 * area_ptr = &area_rect * * with nogil: # <<<<<<<<<<<<<< * * if source.surface.format.Amask or special_flags: */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":234 * with nogil: * * if source.surface.format.Amask or special_flags: # <<<<<<<<<<<<<< * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) * else: */ __pyx_t_6 = (__pyx_v_source->surface->format->Amask != 0); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L23_bool_binop_done; } __pyx_t_6 = (__pyx_v_special_flags != 0); __pyx_t_1 = __pyx_t_6; __pyx_L23_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":235 * * if source.surface.format.Amask or special_flags: * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) # <<<<<<<<<<<<<< * else: * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) */ __pyx_v_err = pygame_Blit(__pyx_v_source->surface, __pyx_v_area_ptr, __pyx_v_self->surface, (&__pyx_v_dest_rect), __pyx_v_special_flags); /* "pygame_sdl2/surface.pyx":234 * with nogil: * * if source.surface.format.Amask or special_flags: # <<<<<<<<<<<<<< * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) * else: */ goto __pyx_L22; } /* "pygame_sdl2/surface.pyx":237 * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) * else: * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) # <<<<<<<<<<<<<< * * if err: */ /*else*/ { __pyx_v_err = SDL_UpperBlit(__pyx_v_source->surface, __pyx_v_area_ptr, __pyx_v_self->surface, (&__pyx_v_dest_rect)); } __pyx_L22:; } /* "pygame_sdl2/surface.pyx":232 * area_ptr = &area_rect * * with nogil: # <<<<<<<<<<<<<< * * if source.surface.format.Amask or special_flags: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L21; } __pyx_L21:; } } /* "pygame_sdl2/surface.pyx":239 * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_err != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":240 * * if err: * raise error() # <<<<<<<<<<<<<< * * dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 240, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":239 * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":242 * raise error() * * dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) # <<<<<<<<<<<<<< * return dirty.clip(self.get_rect()) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_dest, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_dest, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_source->surface->w); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_source->surface->h); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_12, __pyx_t_2, __pyx_t_9, __pyx_t_10, __pyx_t_11}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_dirty = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":243 * * dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) * return dirty.clip(self.get_rect()) # <<<<<<<<<<<<<< * * def convert(self, surface=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_t_10 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":182 * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * * def blit(self, Surface source, dest, area=None, int special_flags=0): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.blit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_temp); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF((PyObject *)__pyx_v_source); __Pyx_XDECREF(__pyx_v_area); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":245 * return dirty.clip(self.get_rect()) * * def convert(self, surface=None): # <<<<<<<<<<<<<< * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_12convert, "Surface.convert(self, surface=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_13convert = {"convert", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_12convert}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_surface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("convert (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "convert") < 0)) __PYX_ERR(0, 245, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("convert", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 245, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_12convert(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_surface); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_12convert(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_surface) { SDL_PixelFormat *__pyx_v_sample_format; Uint32 __pyx_v_amask; Uint32 __pyx_v_rmask; Uint32 __pyx_v_gmask; Uint32 __pyx_v_bmask; Uint32 __pyx_v_pixel_format; SDL_Surface *__pyx_v_new_surface; CYTHON_UNUSED SDL_PixelFormat *__pyx_v_use_format; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; SDL_PixelFormat *__pyx_t_7; Uint32 __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert", 0); __Pyx_INCREF(__pyx_v_surface); /* "pygame_sdl2/surface.pyx":246 * * def convert(self, surface=None): * if not isinstance(surface, Surface): # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_surface, __pyx_ptype_11pygame_sdl2_7surface_Surface); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":247 * def convert(self, surface=None): * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() # <<<<<<<<<<<<<< * * cdef SDL_PixelFormat *sample_format */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_surface, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":246 * * def convert(self, surface=None): * if not isinstance(surface, Surface): # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ } /* "pygame_sdl2/surface.pyx":251 * cdef SDL_PixelFormat *sample_format * * if surface is None: # <<<<<<<<<<<<<< * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRX8888) * else: */ __pyx_t_2 = (__pyx_v_surface == Py_None); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":252 * * if surface is None: * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRX8888) # <<<<<<<<<<<<<< * else: * sample_format = ( surface).surface.format */ __pyx_v_sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRX8888); /* "pygame_sdl2/surface.pyx":251 * cdef SDL_PixelFormat *sample_format * * if surface is None: # <<<<<<<<<<<<<< * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRX8888) * else: */ goto __pyx_L4; } /* "pygame_sdl2/surface.pyx":254 * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRX8888) * else: * sample_format = ( surface).surface.format # <<<<<<<<<<<<<< * * cdef Uint32 amask */ /*else*/ { __pyx_t_7 = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_surface)->surface->format; __pyx_v_sample_format = __pyx_t_7; } __pyx_L4:; /* "pygame_sdl2/surface.pyx":265 * * # If the sample surface has alpha, use it. * if not sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ __pyx_t_2 = (!(__pyx_v_sample_format->Amask != 0)); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":266 * # If the sample surface has alpha, use it. * if not sample_format.Amask: * use_format = sample_format # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_use_format = __pyx_v_sample_format; /* "pygame_sdl2/surface.pyx":268 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":269 * * with nogil: * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) # <<<<<<<<<<<<<< * * if not new_surface: */ __pyx_v_new_surface = SDL_ConvertSurface(__pyx_v_self->surface, __pyx_v_sample_format, 0); } /* "pygame_sdl2/surface.pyx":268 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "pygame_sdl2/surface.pyx":271 * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (!(__pyx_v_new_surface != 0)); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":272 * * if not new_surface: * raise error() # <<<<<<<<<<<<<< * * else: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 272, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":271 * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":265 * * # If the sample surface has alpha, use it. * if not sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ goto __pyx_L5; } /* "pygame_sdl2/surface.pyx":276 * else: * * rmask = sample_format.Rmask # <<<<<<<<<<<<<< * gmask = sample_format.Gmask * bmask = sample_format.Bmask */ /*else*/ { __pyx_t_8 = __pyx_v_sample_format->Rmask; __pyx_v_rmask = __pyx_t_8; /* "pygame_sdl2/surface.pyx":277 * * rmask = sample_format.Rmask * gmask = sample_format.Gmask # <<<<<<<<<<<<<< * bmask = sample_format.Bmask * amask = 0 */ __pyx_t_8 = __pyx_v_sample_format->Gmask; __pyx_v_gmask = __pyx_t_8; /* "pygame_sdl2/surface.pyx":278 * rmask = sample_format.Rmask * gmask = sample_format.Gmask * bmask = sample_format.Bmask # <<<<<<<<<<<<<< * amask = 0 * */ __pyx_t_8 = __pyx_v_sample_format->Bmask; __pyx_v_bmask = __pyx_t_8; /* "pygame_sdl2/surface.pyx":279 * gmask = sample_format.Gmask * bmask = sample_format.Bmask * amask = 0 # <<<<<<<<<<<<<< * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) */ __pyx_v_amask = 0; /* "pygame_sdl2/surface.pyx":281 * amask = 0 * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_pixel_format = SDL_MasksToPixelFormatEnum(32, __pyx_v_rmask, __pyx_v_gmask, __pyx_v_bmask, __pyx_v_amask); /* "pygame_sdl2/surface.pyx":283 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":284 * * with nogil: * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) # <<<<<<<<<<<<<< * * if not new_surface: */ __pyx_v_new_surface = SDL_ConvertSurfaceFormat(__pyx_v_self->surface, __pyx_v_pixel_format, 0); } /* "pygame_sdl2/surface.pyx":283 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L12; } __pyx_L12:; } } /* "pygame_sdl2/surface.pyx":286 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (!(__pyx_v_new_surface != 0)); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":287 * * if not new_surface: * raise error() # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 287, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":286 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L5:; /* "pygame_sdl2/surface.pyx":289 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":290 * * cdef Surface rv = Surface(()) * rv.take_surface(new_surface) # <<<<<<<<<<<<<< * * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_new_surface); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":292 * rv.take_surface(new_surface) * * return rv # <<<<<<<<<<<<<< * * def convert_alpha(self, Surface surface=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":245 * return dirty.clip(self.get_rect()) * * def convert(self, surface=None): # <<<<<<<<<<<<<< * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XDECREF(__pyx_v_surface); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":294 * return rv * * def convert_alpha(self, Surface surface=None): # <<<<<<<<<<<<<< * if surface is None: * surface = pygame_sdl2.display.get_surface() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_14convert_alpha, "Surface.convert_alpha(self, Surface surface=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_15convert_alpha = {"convert_alpha", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_14convert_alpha}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("convert_alpha (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "convert_alpha") < 0)) __PYX_ERR(0, 294, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("convert_alpha", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 294, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 294, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_14convert_alpha(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_surface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_14convert_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface) { SDL_PixelFormat *__pyx_v_sample_format; Uint32 __pyx_v_amask; Uint32 __pyx_v_rmask; Uint32 __pyx_v_gmask; Uint32 __pyx_v_bmask; Uint32 __pyx_v_pixel_format; SDL_Surface *__pyx_v_new_surface; CYTHON_UNUSED SDL_PixelFormat *__pyx_v_use_format; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; SDL_PixelFormat *__pyx_t_6; Uint32 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_alpha", 0); __Pyx_INCREF((PyObject *)__pyx_v_surface); /* "pygame_sdl2/surface.pyx":295 * * def convert_alpha(self, Surface surface=None): * if surface is None: # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ __pyx_t_1 = (((PyObject *)__pyx_v_surface) == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":296 * def convert_alpha(self, Surface surface=None): * if surface is None: * surface = pygame_sdl2.display.get_surface() # <<<<<<<<<<<<<< * * cdef SDL_PixelFormat *sample_format */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_surface, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":295 * * def convert_alpha(self, Surface surface=None): * if surface is None: # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ } /* "pygame_sdl2/surface.pyx":300 * cdef SDL_PixelFormat *sample_format * * if surface is None: # <<<<<<<<<<<<<< * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRA8888) * else: */ __pyx_t_1 = (((PyObject *)__pyx_v_surface) == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":301 * * if surface is None: * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRA8888) # <<<<<<<<<<<<<< * else: * sample_format = ( surface).surface.format */ __pyx_v_sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRA8888); /* "pygame_sdl2/surface.pyx":300 * cdef SDL_PixelFormat *sample_format * * if surface is None: # <<<<<<<<<<<<<< * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRA8888) * else: */ goto __pyx_L4; } /* "pygame_sdl2/surface.pyx":303 * sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRA8888) * else: * sample_format = ( surface).surface.format # <<<<<<<<<<<<<< * * cdef Uint32 amask = 0xff000000 */ /*else*/ { __pyx_t_6 = __pyx_v_surface->surface->format; __pyx_v_sample_format = __pyx_t_6; } __pyx_L4:; /* "pygame_sdl2/surface.pyx":305 * sample_format = ( surface).surface.format * * cdef Uint32 amask = 0xff000000 # <<<<<<<<<<<<<< * cdef Uint32 rmask = 0x00ff0000 * cdef Uint32 gmask = 0x0000ff00 */ __pyx_v_amask = 0xff000000; /* "pygame_sdl2/surface.pyx":306 * * cdef Uint32 amask = 0xff000000 * cdef Uint32 rmask = 0x00ff0000 # <<<<<<<<<<<<<< * cdef Uint32 gmask = 0x0000ff00 * cdef Uint32 bmask = 0x000000ff */ __pyx_v_rmask = 0x00ff0000; /* "pygame_sdl2/surface.pyx":307 * cdef Uint32 amask = 0xff000000 * cdef Uint32 rmask = 0x00ff0000 * cdef Uint32 gmask = 0x0000ff00 # <<<<<<<<<<<<<< * cdef Uint32 bmask = 0x000000ff * */ __pyx_v_gmask = 0x0000ff00; /* "pygame_sdl2/surface.pyx":308 * cdef Uint32 rmask = 0x00ff0000 * cdef Uint32 gmask = 0x0000ff00 * cdef Uint32 bmask = 0x000000ff # <<<<<<<<<<<<<< * * cdef Uint32 pixel_format */ __pyx_v_bmask = 0x000000ff; /* "pygame_sdl2/surface.pyx":314 * * # If the sample surface has alpha, use it. * if sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ __pyx_t_1 = (__pyx_v_sample_format->Amask != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":315 * # If the sample surface has alpha, use it. * if sample_format.Amask: * use_format = sample_format # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_use_format = __pyx_v_sample_format; /* "pygame_sdl2/surface.pyx":317 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":318 * * with nogil: * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) # <<<<<<<<<<<<<< * * if not new_surface: */ __pyx_v_new_surface = SDL_ConvertSurface(__pyx_v_self->surface, __pyx_v_sample_format, 0); } /* "pygame_sdl2/surface.pyx":317 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "pygame_sdl2/surface.pyx":320 * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (!(__pyx_v_new_surface != 0)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":321 * * if not new_surface: * raise error() # <<<<<<<<<<<<<< * * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 321, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":320 * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":314 * * # If the sample surface has alpha, use it. * if sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ goto __pyx_L5; } /* "pygame_sdl2/surface.pyx":325 * else: * * if sample_format.BytesPerPixel == 4: # <<<<<<<<<<<<<< * rmask = sample_format.Rmask * gmask = sample_format.Gmask */ /*else*/ { __pyx_t_1 = (__pyx_v_sample_format->BytesPerPixel == 4); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":326 * * if sample_format.BytesPerPixel == 4: * rmask = sample_format.Rmask # <<<<<<<<<<<<<< * gmask = sample_format.Gmask * bmask = sample_format.Bmask */ __pyx_t_7 = __pyx_v_sample_format->Rmask; __pyx_v_rmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":327 * if sample_format.BytesPerPixel == 4: * rmask = sample_format.Rmask * gmask = sample_format.Gmask # <<<<<<<<<<<<<< * bmask = sample_format.Bmask * amask = 0xffffffff & ~(rmask | gmask | bmask) */ __pyx_t_7 = __pyx_v_sample_format->Gmask; __pyx_v_gmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":328 * rmask = sample_format.Rmask * gmask = sample_format.Gmask * bmask = sample_format.Bmask # <<<<<<<<<<<<<< * amask = 0xffffffff & ~(rmask | gmask | bmask) * */ __pyx_t_7 = __pyx_v_sample_format->Bmask; __pyx_v_bmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":329 * gmask = sample_format.Gmask * bmask = sample_format.Bmask * amask = 0xffffffff & ~(rmask | gmask | bmask) # <<<<<<<<<<<<<< * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t((~((__pyx_v_rmask | __pyx_v_gmask) | __pyx_v_bmask))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_And(__pyx_int_4294967295, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_7 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_amask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":325 * else: * * if sample_format.BytesPerPixel == 4: # <<<<<<<<<<<<<< * rmask = sample_format.Rmask * gmask = sample_format.Gmask */ } /* "pygame_sdl2/surface.pyx":331 * amask = 0xffffffff & ~(rmask | gmask | bmask) * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_pixel_format = SDL_MasksToPixelFormatEnum(32, __pyx_v_rmask, __pyx_v_gmask, __pyx_v_bmask, __pyx_v_amask); /* "pygame_sdl2/surface.pyx":333 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":334 * * with nogil: * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) # <<<<<<<<<<<<<< * * if not new_surface: */ __pyx_v_new_surface = SDL_ConvertSurfaceFormat(__pyx_v_self->surface, __pyx_v_pixel_format, 0); } /* "pygame_sdl2/surface.pyx":333 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L13; } __pyx_L13:; } } /* "pygame_sdl2/surface.pyx":336 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (!(__pyx_v_new_surface != 0)); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":337 * * if not new_surface: * raise error() # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 337, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":336 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L5:; /* "pygame_sdl2/surface.pyx":339 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":340 * * cdef Surface rv = Surface(()) * rv.take_surface(new_surface) # <<<<<<<<<<<<<< * * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_new_surface); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":342 * rv.take_surface(new_surface) * * return rv # <<<<<<<<<<<<<< * * def copy(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":294 * return rv * * def convert_alpha(self, Surface surface=None): # <<<<<<<<<<<<<< * if surface is None: * surface = pygame_sdl2.display.get_surface() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XDECREF((PyObject *)__pyx_v_surface); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":344 * return rv * * def copy(self): # <<<<<<<<<<<<<< * if self.surface.format.Amask: * return self.convert_alpha(self) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_16copy, "Surface.copy(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_17copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_16copy}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_16copy(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_16copy(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); /* "pygame_sdl2/surface.pyx":345 * * def copy(self): * if self.surface.format.Amask: # <<<<<<<<<<<<<< * return self.convert_alpha(self) * else: */ __pyx_t_1 = (__pyx_v_self->surface->format->Amask != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":346 * def copy(self): * if self.surface.format.Amask: * return self.convert_alpha(self) # <<<<<<<<<<<<<< * else: * return self.convert(self) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert_alpha); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":345 * * def copy(self): * if self.surface.format.Amask: # <<<<<<<<<<<<<< * return self.convert_alpha(self) * else: */ } /* "pygame_sdl2/surface.pyx":348 * return self.convert_alpha(self) * else: * return self.convert(self) # <<<<<<<<<<<<<< * * def fill(self, color, rect=None, special_flags=0): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":344 * return rv * * def copy(self): # <<<<<<<<<<<<<< * if self.surface.format.Amask: * return self.convert_alpha(self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":350 * return self.convert(self) * * def fill(self, color, rect=None, special_flags=0): # <<<<<<<<<<<<<< * * cdef SDL_Rect sdl_rect */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_18fill, "Surface.fill(self, color, rect=None, special_flags=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_19fill = {"fill", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_18fill}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; CYTHON_UNUSED PyObject *__pyx_v_special_flags = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fill (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_special_flags,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_special_flags); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fill") < 0)) __PYX_ERR(0, 350, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_color = values[0]; __pyx_v_rect = values[1]; __pyx_v_special_flags = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fill", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 350, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.fill", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_18fill(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_color, __pyx_v_rect, __pyx_v_special_flags); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_18fill(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_special_flags) { SDL_Rect __pyx_v_sdl_rect; Uint32 __pyx_v_pixel; int __pyx_v_err; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fill", 1); /* "pygame_sdl2/surface.pyx":353 * * cdef SDL_Rect sdl_rect * cdef Uint32 pixel = map_color(self.surface, color) # <<<<<<<<<<<<<< * cdef int err * */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_1 == ((Uint32)0xaabbccdd) && PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L1_error) __pyx_v_pixel = __pyx_t_1; /* "pygame_sdl2/surface.pyx":356 * cdef int err * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * */ __pyx_t_2 = (__pyx_v_rect != Py_None); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":357 * * if rect is not None: * to_sdl_rect(rect, &sdl_rect) # <<<<<<<<<<<<<< * * if sdl_rect.x < 0: */ __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 357, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":359 * to_sdl_rect(rect, &sdl_rect) * * if sdl_rect.x < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.w + sdl_rect.x * sdl_rect.x = 0 */ __pyx_t_2 = (__pyx_v_sdl_rect.x < 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":360 * * if sdl_rect.x < 0: * sdl_rect.w = sdl_rect.w + sdl_rect.x # <<<<<<<<<<<<<< * sdl_rect.x = 0 * */ __pyx_v_sdl_rect.w = (__pyx_v_sdl_rect.w + __pyx_v_sdl_rect.x); /* "pygame_sdl2/surface.pyx":361 * if sdl_rect.x < 0: * sdl_rect.w = sdl_rect.w + sdl_rect.x * sdl_rect.x = 0 # <<<<<<<<<<<<<< * * if sdl_rect.y < 0: */ __pyx_v_sdl_rect.x = 0; /* "pygame_sdl2/surface.pyx":359 * to_sdl_rect(rect, &sdl_rect) * * if sdl_rect.x < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.w + sdl_rect.x * sdl_rect.x = 0 */ } /* "pygame_sdl2/surface.pyx":363 * sdl_rect.x = 0 * * if sdl_rect.y < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.h + sdl_rect.y * sdl_rect.y = 0 */ __pyx_t_2 = (__pyx_v_sdl_rect.y < 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":364 * * if sdl_rect.y < 0: * sdl_rect.w = sdl_rect.h + sdl_rect.y # <<<<<<<<<<<<<< * sdl_rect.y = 0 * */ __pyx_v_sdl_rect.w = (__pyx_v_sdl_rect.h + __pyx_v_sdl_rect.y); /* "pygame_sdl2/surface.pyx":365 * if sdl_rect.y < 0: * sdl_rect.w = sdl_rect.h + sdl_rect.y * sdl_rect.y = 0 # <<<<<<<<<<<<<< * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: */ __pyx_v_sdl_rect.y = 0; /* "pygame_sdl2/surface.pyx":363 * sdl_rect.x = 0 * * if sdl_rect.y < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.h + sdl_rect.y * sdl_rect.y = 0 */ } /* "pygame_sdl2/surface.pyx":367 * sdl_rect.y = 0 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: # <<<<<<<<<<<<<< * return Rect(0, 0, 0, 0) * */ __pyx_t_4 = (__pyx_v_sdl_rect.w <= 0); if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L7_bool_binop_done; } __pyx_t_4 = (__pyx_v_sdl_rect.h <= 0); __pyx_t_2 = __pyx_t_4; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":368 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: * return Rect(0, 0, 0, 0) # <<<<<<<<<<<<<< * * with nogil: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":367 * sdl_rect.y = 0 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: # <<<<<<<<<<<<<< * return Rect(0, 0, 0, 0) * */ } /* "pygame_sdl2/surface.pyx":370 * return Rect(0, 0, 0, 0) * * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":371 * * with nogil: * err = SDL_FillRect(self.surface, &sdl_rect, pixel) # <<<<<<<<<<<<<< * * if err: */ __pyx_v_err = SDL_FillRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect), __pyx_v_pixel); } /* "pygame_sdl2/surface.pyx":370 * return Rect(0, 0, 0, 0) * * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } /* "pygame_sdl2/surface.pyx":373 * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_err != 0); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":374 * * if err: * raise error() # <<<<<<<<<<<<<< * * return Rect(sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 374, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":373 * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":376 * raise error() * * return Rect(sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.w); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.h); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_12, __pyx_t_7, __pyx_t_9, __pyx_t_10, __pyx_t_11}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":356 * cdef int err * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * */ } /* "pygame_sdl2/surface.pyx":379 * * else: * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, NULL, pixel) * */ /*else*/ { { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":380 * else: * with nogil: * err = SDL_FillRect(self.surface, NULL, pixel) # <<<<<<<<<<<<<< * * if err: */ __pyx_v_err = SDL_FillRect(__pyx_v_self->surface, NULL, __pyx_v_pixel); } /* "pygame_sdl2/surface.pyx":379 * * else: * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, NULL, pixel) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L15; } __pyx_L15:; } } /* "pygame_sdl2/surface.pyx":382 * err = SDL_FillRect(self.surface, NULL, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_err != 0); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":383 * * if err: * raise error() # <<<<<<<<<<<<<< * * return Rect(0, 0, self.surface.w, self.surface.h) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 383, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":382 * err = SDL_FillRect(self.surface, NULL, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":385 * raise error() * * return Rect(0, 0, self.surface.w, self.surface.h) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_int_0, __pyx_int_0, __pyx_t_11, __pyx_t_10}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":350 * return self.convert(self) * * def fill(self, color, rect=None, special_flags=0): # <<<<<<<<<<<<<< * * cdef SDL_Rect sdl_rect */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.fill", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":388 * * * def scroll(self, int dx=0, int dy=0): # <<<<<<<<<<<<<< * cdef int srcx, destx, move_width * cdef int srcy, desty, move_height */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_20scroll, "Surface.scroll(self, int dx=0, int dy=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_21scroll = {"scroll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_20scroll}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { int __pyx_v_dx; int __pyx_v_dy; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scroll (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dx,&__pyx_n_s_dy,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dx); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dy); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scroll") < 0)) __PYX_ERR(0, 388, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } if (values[0]) { __pyx_v_dx = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_dx == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error) } else { __pyx_v_dx = ((int)0); } if (values[1]) { __pyx_v_dy = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error) } else { __pyx_v_dy = ((int)0); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scroll", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 388, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.scroll", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_20scroll(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_dx, __pyx_v_dy); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_20scroll(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, int __pyx_v_dx, int __pyx_v_dy) { int __pyx_v_srcx; int __pyx_v_destx; int __pyx_v_move_width; int __pyx_v_srcy; int __pyx_v_desty; int __pyx_v_move_height; int __pyx_v_width; int __pyx_v_height; int __pyx_v_per_pixel; Uint8 *__pyx_v_srcptr; Uint8 *__pyx_v_destptr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Uint8 __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scroll", 1); /* "pygame_sdl2/surface.pyx":392 * cdef int srcy, desty, move_height * * cdef int width = self.surface.w # <<<<<<<<<<<<<< * cdef int height = self.surface.h * */ __pyx_t_1 = __pyx_v_self->surface->w; __pyx_v_width = __pyx_t_1; /* "pygame_sdl2/surface.pyx":393 * * cdef int width = self.surface.w * cdef int height = self.surface.h # <<<<<<<<<<<<<< * * cdef int per_pixel = self.surface.format.BytesPerPixel */ __pyx_t_1 = __pyx_v_self->surface->h; __pyx_v_height = __pyx_t_1; /* "pygame_sdl2/surface.pyx":395 * cdef int height = self.surface.h * * cdef int per_pixel = self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * * if dx >= 0: */ __pyx_t_2 = __pyx_v_self->surface->format->BytesPerPixel; __pyx_v_per_pixel = __pyx_t_2; /* "pygame_sdl2/surface.pyx":397 * cdef int per_pixel = self.surface.format.BytesPerPixel * * if dx >= 0: # <<<<<<<<<<<<<< * srcx = 0 * destx = dx */ __pyx_t_3 = (__pyx_v_dx >= 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":398 * * if dx >= 0: * srcx = 0 # <<<<<<<<<<<<<< * destx = dx * move_width = width - dx */ __pyx_v_srcx = 0; /* "pygame_sdl2/surface.pyx":399 * if dx >= 0: * srcx = 0 * destx = dx # <<<<<<<<<<<<<< * move_width = width - dx * else: */ __pyx_v_destx = __pyx_v_dx; /* "pygame_sdl2/surface.pyx":400 * srcx = 0 * destx = dx * move_width = width - dx # <<<<<<<<<<<<<< * else: * srcx = -dx */ __pyx_v_move_width = (__pyx_v_width - __pyx_v_dx); /* "pygame_sdl2/surface.pyx":397 * cdef int per_pixel = self.surface.format.BytesPerPixel * * if dx >= 0: # <<<<<<<<<<<<<< * srcx = 0 * destx = dx */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":402 * move_width = width - dx * else: * srcx = -dx # <<<<<<<<<<<<<< * destx = 0 * move_width = width + dx */ /*else*/ { __pyx_v_srcx = (-__pyx_v_dx); /* "pygame_sdl2/surface.pyx":403 * else: * srcx = -dx * destx = 0 # <<<<<<<<<<<<<< * move_width = width + dx * */ __pyx_v_destx = 0; /* "pygame_sdl2/surface.pyx":404 * srcx = -dx * destx = 0 * move_width = width + dx # <<<<<<<<<<<<<< * * if dy >= 0: */ __pyx_v_move_width = (__pyx_v_width + __pyx_v_dx); } __pyx_L3:; /* "pygame_sdl2/surface.pyx":406 * move_width = width + dx * * if dy >= 0: # <<<<<<<<<<<<<< * srcy = 0 * desty = dy */ __pyx_t_3 = (__pyx_v_dy >= 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":407 * * if dy >= 0: * srcy = 0 # <<<<<<<<<<<<<< * desty = dy * move_height = height - dy */ __pyx_v_srcy = 0; /* "pygame_sdl2/surface.pyx":408 * if dy >= 0: * srcy = 0 * desty = dy # <<<<<<<<<<<<<< * move_height = height - dy * else: */ __pyx_v_desty = __pyx_v_dy; /* "pygame_sdl2/surface.pyx":409 * srcy = 0 * desty = dy * move_height = height - dy # <<<<<<<<<<<<<< * else: * srcy = -dy */ __pyx_v_move_height = (__pyx_v_height - __pyx_v_dy); /* "pygame_sdl2/surface.pyx":406 * move_width = width + dx * * if dy >= 0: # <<<<<<<<<<<<<< * srcy = 0 * desty = dy */ goto __pyx_L4; } /* "pygame_sdl2/surface.pyx":411 * move_height = height - dy * else: * srcy = -dy # <<<<<<<<<<<<<< * desty = 0 * move_height = height + dy */ /*else*/ { __pyx_v_srcy = (-__pyx_v_dy); /* "pygame_sdl2/surface.pyx":412 * else: * srcy = -dy * desty = 0 # <<<<<<<<<<<<<< * move_height = height + dy * */ __pyx_v_desty = 0; /* "pygame_sdl2/surface.pyx":413 * srcy = -dy * desty = 0 * move_height = height + dy # <<<<<<<<<<<<<< * * cdef Uint8 *srcptr = self.surface.pixels */ __pyx_v_move_height = (__pyx_v_height + __pyx_v_dy); } __pyx_L4:; /* "pygame_sdl2/surface.pyx":415 * move_height = height + dy * * cdef Uint8 *srcptr = self.surface.pixels # <<<<<<<<<<<<<< * cdef Uint8 *destptr = self.surface.pixels * */ __pyx_v_srcptr = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":416 * * cdef Uint8 *srcptr = self.surface.pixels * cdef Uint8 *destptr = self.surface.pixels # <<<<<<<<<<<<<< * * srcptr += srcy * self.surface.pitch + srcx * per_pixel */ __pyx_v_destptr = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":418 * cdef Uint8 *destptr = self.surface.pixels * * srcptr += srcy * self.surface.pitch + srcx * per_pixel # <<<<<<<<<<<<<< * destptr += desty * self.surface.pitch + destx * per_pixel * */ __pyx_v_srcptr = (__pyx_v_srcptr + ((__pyx_v_srcy * __pyx_v_self->surface->pitch) + (__pyx_v_srcx * __pyx_v_per_pixel))); /* "pygame_sdl2/surface.pyx":419 * * srcptr += srcy * self.surface.pitch + srcx * per_pixel * destptr += desty * self.surface.pitch + destx * per_pixel # <<<<<<<<<<<<<< * * self.lock() */ __pyx_v_destptr = (__pyx_v_destptr + ((__pyx_v_desty * __pyx_v_self->surface->pitch) + (__pyx_v_destx * __pyx_v_per_pixel))); /* "pygame_sdl2/surface.pyx":421 * destptr += desty * self.surface.pitch + destx * per_pixel * * self.lock() # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":423 * self.lock() * * with nogil: # <<<<<<<<<<<<<< * move_pixels( * srcptr, */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":424 * * with nogil: * move_pixels( # <<<<<<<<<<<<<< * srcptr, * destptr, */ __pyx_f_11pygame_sdl2_7surface_move_pixels(__pyx_v_srcptr, __pyx_v_destptr, __pyx_v_move_height, (__pyx_v_move_width * __pyx_v_per_pixel), __pyx_v_self->surface->pitch, __pyx_v_self->surface->pitch); } /* "pygame_sdl2/surface.pyx":423 * self.lock() * * with nogil: # <<<<<<<<<<<<<< * move_pixels( * srcptr, */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L7; } __pyx_L7:; } } /* "pygame_sdl2/surface.pyx":432 * self.surface.pitch) * * self.unlock() # <<<<<<<<<<<<<< * * def set_colorkey(self, color, flags=0): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":388 * * * def scroll(self, int dx=0, int dy=0): # <<<<<<<<<<<<<< * cdef int srcx, destx, move_width * cdef int srcy, desty, move_height */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.scroll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":434 * self.unlock() * * def set_colorkey(self, color, flags=0): # <<<<<<<<<<<<<< * * if color is None: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_22set_colorkey, "Surface.set_colorkey(self, color, flags=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_23set_colorkey = {"set_colorkey", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_22set_colorkey}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_colorkey (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_flags,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 434, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 434, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_colorkey") < 0)) __PYX_ERR(0, 434, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_color = values[0]; __pyx_v_flags = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_colorkey", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 434, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_colorkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_22set_colorkey(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_color, __pyx_v_flags); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_22set_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; Uint32 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_colorkey", 1); /* "pygame_sdl2/surface.pyx":436 * def set_colorkey(self, color, flags=0): * * if color is None: # <<<<<<<<<<<<<< * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): * raise error() */ __pyx_t_1 = (__pyx_v_color == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":437 * * if color is None: * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_SetColorKey(__pyx_v_self->surface, SDL_FALSE, 0) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":438 * if color is None: * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): * raise error() # <<<<<<<<<<<<<< * * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 438, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":437 * * if color is None: * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":436 * def set_colorkey(self, color, flags=0): * * if color is None: # <<<<<<<<<<<<<< * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): * raise error() */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":441 * * else: * if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_6 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_6 == ((Uint32)0xaabbccdd) && PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L1_error) __pyx_t_1 = (SDL_SetColorKey(__pyx_v_self->surface, SDL_TRUE, __pyx_t_6) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":442 * else: * if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): * raise error() # <<<<<<<<<<<<<< * * def get_colorkey(self): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 442, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":441 * * else: * if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L3:; /* "pygame_sdl2/surface.pyx":434 * self.unlock() * * def set_colorkey(self, color, flags=0): # <<<<<<<<<<<<<< * * if color is None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_colorkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":444 * raise error() * * def get_colorkey(self): # <<<<<<<<<<<<<< * cdef Uint32 key * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_24get_colorkey, "Surface.get_colorkey(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_25get_colorkey = {"get_colorkey", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_24get_colorkey}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_colorkey (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_colorkey", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_colorkey", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_24get_colorkey(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_24get_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { Uint32 __pyx_v_key; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_colorkey", 1); /* "pygame_sdl2/surface.pyx":447 * cdef Uint32 key * * if SDL_GetColorKey(self.surface, &key): # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = (SDL_GetColorKey(__pyx_v_self->surface, (&__pyx_v_key)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":448 * * if SDL_GetColorKey(self.surface, &key): * return None # <<<<<<<<<<<<<< * * return get_color(key, self.surface) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":447 * cdef Uint32 key * * if SDL_GetColorKey(self.surface, &key): # <<<<<<<<<<<<<< * return None * */ } /* "pygame_sdl2/surface.pyx":450 * return None * * return get_color(key, self.surface) # <<<<<<<<<<<<<< * * def set_alpha(self, value, flags=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5color_get_color(__pyx_v_key, __pyx_v_self->surface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":444 * raise error() * * def get_colorkey(self): # <<<<<<<<<<<<<< * cdef Uint32 key * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_colorkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":452 * return get_color(key, self.surface) * * def set_alpha(self, value, flags=0): # <<<<<<<<<<<<<< * if value is None: * value = 255 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_26set_alpha, "Surface.set_alpha(self, value, flags=0)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_27set_alpha = {"set_alpha", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_26set_alpha}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_value = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_alpha (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_flags,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_alpha") < 0)) __PYX_ERR(0, 452, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_value = values[0]; __pyx_v_flags = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_alpha", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 452, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_26set_alpha(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_value, __pyx_v_flags); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_26set_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Uint8 __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_alpha", 0); __Pyx_INCREF(__pyx_v_value); /* "pygame_sdl2/surface.pyx":453 * * def set_alpha(self, value, flags=0): * if value is None: # <<<<<<<<<<<<<< * value = 255 * self.has_alpha = False */ __pyx_t_1 = (__pyx_v_value == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":454 * def set_alpha(self, value, flags=0): * if value is None: * value = 255 # <<<<<<<<<<<<<< * self.has_alpha = False * else: */ __Pyx_INCREF(__pyx_int_255); __Pyx_DECREF_SET(__pyx_v_value, __pyx_int_255); /* "pygame_sdl2/surface.pyx":455 * if value is None: * value = 255 * self.has_alpha = False # <<<<<<<<<<<<<< * else: * self.has_alpha = True */ __pyx_v_self->has_alpha = 0; /* "pygame_sdl2/surface.pyx":453 * * def set_alpha(self, value, flags=0): * if value is None: # <<<<<<<<<<<<<< * value = 255 * self.has_alpha = False */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":457 * self.has_alpha = False * else: * self.has_alpha = True # <<<<<<<<<<<<<< * * if SDL_SetSurfaceAlphaMod(self.surface, value): */ /*else*/ { __pyx_v_self->has_alpha = 1; } __pyx_L3:; /* "pygame_sdl2/surface.pyx":459 * self.has_alpha = True * * if SDL_SetSurfaceAlphaMod(self.surface, value): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_2 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 459, __pyx_L1_error) __pyx_t_1 = (SDL_SetSurfaceAlphaMod(__pyx_v_self->surface, __pyx_t_2) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":460 * * if SDL_SetSurfaceAlphaMod(self.surface, value): * raise error() # <<<<<<<<<<<<<< * * def get_alpha(self): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 460, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":459 * self.has_alpha = True * * if SDL_SetSurfaceAlphaMod(self.surface, value): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":452 * return get_color(key, self.surface) * * def set_alpha(self, value, flags=0): # <<<<<<<<<<<<<< * if value is None: * value = 255 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":462 * raise error() * * def get_alpha(self): # <<<<<<<<<<<<<< * cdef Uint8 rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_28get_alpha, "Surface.get_alpha(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_29get_alpha = {"get_alpha", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_28get_alpha}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_alpha (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_alpha", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_alpha", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_28get_alpha(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_28get_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { Uint8 __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_alpha", 1); /* "pygame_sdl2/surface.pyx":465 * cdef Uint8 rv * * if self.has_alpha or self.surface.format.Amask: # <<<<<<<<<<<<<< * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): */ if (!__pyx_v_self->has_alpha) { } else { __pyx_t_1 = __pyx_v_self->has_alpha; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->surface->format->Amask != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":467 * if self.has_alpha or self.surface.format.Amask: * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetSurfaceAlphaMod(__pyx_v_self->surface, (&__pyx_v_rv)) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":468 * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): * raise error() # <<<<<<<<<<<<<< * * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 468, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":467 * if self.has_alpha or self.surface.format.Amask: * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":470 * raise error() * * return rv # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":465 * cdef Uint8 rv * * if self.has_alpha or self.surface.format.Amask: # <<<<<<<<<<<<<< * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): */ } /* "pygame_sdl2/surface.pyx":473 * * else: * return None # <<<<<<<<<<<<<< * * def lock(self, lock=None): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":462 * raise error() * * def get_alpha(self): # <<<<<<<<<<<<<< * cdef Uint8 rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":475 * return None * * def lock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_30lock, "Surface.lock(self, lock=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_31lock = {"lock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_30lock}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_lock = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lock (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lock,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lock); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lock") < 0)) __PYX_ERR(0, 475, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_lock = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lock", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 475, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.lock", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_30lock(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_lock); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_30lock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lock", 0); __Pyx_INCREF(__pyx_v_lock); /* "pygame_sdl2/surface.pyx":476 * * def lock(self, lock=None): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":478 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 478, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":479 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * if lock is None: */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":481 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ __pyx_t_1 = (__pyx_v_lock == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":482 * * if lock is None: * lock = self # <<<<<<<<<<<<<< * * if root.locklist is None: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_DECREF_SET(__pyx_v_lock, ((PyObject *)__pyx_v_self)); /* "pygame_sdl2/surface.pyx":481 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ } /* "pygame_sdl2/surface.pyx":484 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ __pyx_t_1 = (__pyx_v_root->locklist == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":485 * * if root.locklist is None: * root.locklist = [ ] # <<<<<<<<<<<<<< * * root.locklist.append(lock) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_root->locklist); __Pyx_DECREF(__pyx_v_root->locklist); __pyx_v_root->locklist = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":484 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ } /* "pygame_sdl2/surface.pyx":487 * root.locklist = [ ] * * root.locklist.append(lock) # <<<<<<<<<<<<<< * * if SDL_LockSurface(root.surface): */ __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_root->locklist, __pyx_v_lock); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 487, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":489 * root.locklist.append(lock) * * if SDL_LockSurface(root.surface): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_LockSurface(__pyx_v_root->surface) != 0); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/surface.pyx":490 * * if SDL_LockSurface(root.surface): * raise error() # <<<<<<<<<<<<<< * * def unlock(self, lock=None): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 490, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":489 * root.locklist.append(lock) * * if SDL_LockSurface(root.surface): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":475 * return None * * def lock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.lock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XDECREF(__pyx_v_lock); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":492 * raise error() * * def unlock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_32unlock, "Surface.unlock(self, lock=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_33unlock = {"unlock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_32unlock}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_lock = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unlock (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lock,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lock); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "unlock") < 0)) __PYX_ERR(0, 492, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_lock = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("unlock", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 492, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_32unlock(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_lock); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_32unlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unlock", 0); __Pyx_INCREF(__pyx_v_lock); /* "pygame_sdl2/surface.pyx":493 * * def unlock(self, lock=None): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":495 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 495, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":496 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * if lock is None: */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":498 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ __pyx_t_1 = (__pyx_v_lock == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":499 * * if lock is None: * lock = self # <<<<<<<<<<<<<< * * if root.locklist is None: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_DECREF_SET(__pyx_v_lock, ((PyObject *)__pyx_v_self)); /* "pygame_sdl2/surface.pyx":498 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ } /* "pygame_sdl2/surface.pyx":501 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ __pyx_t_1 = (__pyx_v_root->locklist == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":502 * * if root.locklist is None: * root.locklist = [ ] # <<<<<<<<<<<<<< * * root.locklist.remove(lock) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_root->locklist); __Pyx_DECREF(__pyx_v_root->locklist); __pyx_v_root->locklist = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":501 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ } /* "pygame_sdl2/surface.pyx":504 * root.locklist = [ ] * * root.locklist.remove(lock) # <<<<<<<<<<<<<< * * SDL_UnlockSurface(root.surface) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_root->locklist, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_lock}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":506 * root.locklist.remove(lock) * * SDL_UnlockSurface(root.surface) # <<<<<<<<<<<<<< * * def mustlock(self): */ SDL_UnlockSurface(__pyx_v_root->surface); /* "pygame_sdl2/surface.pyx":492 * raise error() * * def unlock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XDECREF(__pyx_v_lock); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":508 * SDL_UnlockSurface(root.surface) * * def mustlock(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_34mustlock, "Surface.mustlock(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_35mustlock = {"mustlock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_34mustlock}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mustlock (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("mustlock", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "mustlock", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_34mustlock(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_34mustlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mustlock", 1); /* "pygame_sdl2/surface.pyx":509 * * def mustlock(self): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":511 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 511, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":512 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * return SDL_MUSTLOCK(root.surface) */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":514 * root = root.parent * * return SDL_MUSTLOCK(root.surface) # <<<<<<<<<<<<<< * * def get_locked(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_MUSTLOCK(__pyx_v_root->surface)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":508 * SDL_UnlockSurface(root.surface) * * def mustlock(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.mustlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":516 * return SDL_MUSTLOCK(root.surface) * * def get_locked(self): # <<<<<<<<<<<<<< * if self.locklist: * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_36get_locked, "Surface.get_locked(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_37get_locked = {"get_locked", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_36get_locked}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_locked (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_locked", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_locked", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_36get_locked(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_36get_locked(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_locked", 1); /* "pygame_sdl2/surface.pyx":517 * * def get_locked(self): * if self.locklist: # <<<<<<<<<<<<<< * return True * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->locklist); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 517, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":518 * def get_locked(self): * if self.locklist: * return True # <<<<<<<<<<<<<< * * def get_locks(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":517 * * def get_locked(self): * if self.locklist: # <<<<<<<<<<<<<< * return True * */ } /* "pygame_sdl2/surface.pyx":516 * return SDL_MUSTLOCK(root.surface) * * def get_locked(self): # <<<<<<<<<<<<<< * if self.locklist: * return True */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_locked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":520 * return True * * def get_locks(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_38get_locks, "Surface.get_locks(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_39get_locks = {"get_locks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_38get_locks}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_locks (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_locks", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_locks", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_38get_locks(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_38get_locks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_locks", 1); /* "pygame_sdl2/surface.pyx":521 * * def get_locks(self): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":523 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 523, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":524 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * if root.locklist is None: */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":526 * root = root.parent * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ __pyx_t_1 = (__pyx_v_root->locklist == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":527 * * if root.locklist is None: * root.locklist = [ ] # <<<<<<<<<<<<<< * * return root.locklist */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_root->locklist); __Pyx_DECREF(__pyx_v_root->locklist); __pyx_v_root->locklist = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":526 * root = root.parent * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ } /* "pygame_sdl2/surface.pyx":529 * root.locklist = [ ] * * return root.locklist # <<<<<<<<<<<<<< * * def get_at(self, pos): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_root->locklist); __pyx_r = __pyx_v_root->locklist; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":520 * return True * * def get_locks(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_locks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":531 * return root.locklist * * def get_at(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_40get_at, "Surface.get_at(self, pos)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_41get_at = {"get_at", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_40get_at}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pos = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_at (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 531, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_at") < 0)) __PYX_ERR(0, 531, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pos = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_at", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 531, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_40get_at(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_40get_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos) { int __pyx_v_x; int __pyx_v_y; Uint8 *__pyx_v_p; Uint32 __pyx_v_pixel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; unsigned int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_at", 1); /* "pygame_sdl2/surface.pyx":535 * cdef Uint8 *p * * x, y = pos # <<<<<<<<<<<<<< * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 535, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 535, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 535, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/surface.pyx":537 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise IndexError("Position outside surface.") * */ __pyx_t_8 = (0 <= __pyx_v_x); if (__pyx_t_8) { __pyx_t_8 = (__pyx_v_x < __pyx_v_self->surface->w); } __pyx_t_9 = (!__pyx_t_8); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = (0 <= __pyx_v_y); if (__pyx_t_9) { __pyx_t_9 = (__pyx_v_y < __pyx_v_self->surface->h); } __pyx_t_8 = (!__pyx_t_9); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_7)) { /* "pygame_sdl2/surface.pyx":538 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise IndexError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 538, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":537 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise IndexError("Position outside surface.") * */ } /* "pygame_sdl2/surface.pyx":540 * raise IndexError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_7 = (__pyx_v_self->surface->format->BytesPerPixel != 4); if (unlikely(__pyx_t_7)) { /* "pygame_sdl2/surface.pyx":541 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * self.lock() */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Surface_has_unsupported_bytesize}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 541, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":540 * raise IndexError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/surface.pyx":543 * raise error("Surface has unsupported bytesize.") * * self.lock() # <<<<<<<<<<<<<< * * p = self.surface.pixels */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":545 * self.lock() * * p = self.surface.pixels # <<<<<<<<<<<<<< * p += y * self.surface.pitch * p += x * 4 */ __pyx_v_p = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":546 * * p = self.surface.pixels * p += y * self.surface.pitch # <<<<<<<<<<<<<< * p += x * 4 * */ __pyx_v_p = (__pyx_v_p + (__pyx_v_y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":547 * p = self.surface.pixels * p += y * self.surface.pitch * p += x * 4 # <<<<<<<<<<<<<< * * cdef Uint32 pixel = ( p)[0] */ __pyx_v_p = (__pyx_v_p + (__pyx_v_x * 4)); /* "pygame_sdl2/surface.pyx":549 * p += x * 4 * * cdef Uint32 pixel = ( p)[0] # <<<<<<<<<<<<<< * * self.unlock() */ __pyx_v_pixel = (((Uint32 *)__pyx_v_p)[0]); /* "pygame_sdl2/surface.pyx":551 * cdef Uint32 pixel = ( p)[0] * * self.unlock() # <<<<<<<<<<<<<< * * return get_color(pixel, self.surface) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":553 * self.unlock() * * return get_color(pixel, self.surface) # <<<<<<<<<<<<<< * * def set_at(self, pos, color): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5color_get_color(__pyx_v_pixel, __pyx_v_self->surface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":531 * return root.locklist * * def get_at(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":555 * return get_color(pixel, self.surface) * * def set_at(self, pos, color): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_42set_at, "Surface.set_at(self, pos, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_43set_at = {"set_at", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_42set_at}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pos = 0; PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_at (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_at", 1, 2, 2, 1); __PYX_ERR(0, 555, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_at") < 0)) __PYX_ERR(0, 555, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_pos = values[0]; __pyx_v_color = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_at", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 555, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_42set_at(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_pos, __pyx_v_color); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_42set_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos, PyObject *__pyx_v_color) { int __pyx_v_x; int __pyx_v_y; Uint8 *__pyx_v_p; Uint32 __pyx_v_pixel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; unsigned int __pyx_t_10; Uint32 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_at", 1); /* "pygame_sdl2/surface.pyx":560 * cdef Uint32 pixel * * x, y = pos # <<<<<<<<<<<<<< * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 560, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 560, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 560, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/surface.pyx":562 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ __pyx_t_8 = (0 <= __pyx_v_x); if (__pyx_t_8) { __pyx_t_8 = (__pyx_v_x < __pyx_v_self->surface->w); } __pyx_t_9 = (!__pyx_t_8); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = (0 <= __pyx_v_y); if (__pyx_t_9) { __pyx_t_9 = (__pyx_v_y < __pyx_v_self->surface->h); } __pyx_t_8 = (!__pyx_t_9); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_7)) { /* "pygame_sdl2/surface.pyx":563 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise ValueError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 563, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":562 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ } /* "pygame_sdl2/surface.pyx":565 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_7 = (__pyx_v_self->surface->format->BytesPerPixel != 4); if (unlikely(__pyx_t_7)) { /* "pygame_sdl2/surface.pyx":566 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * pixel = map_color(self.surface, color) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Surface_has_unsupported_bytesize}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 566, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":565 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/surface.pyx":568 * raise error("Surface has unsupported bytesize.") * * pixel = map_color(self.surface, color) # <<<<<<<<<<<<<< * * self.lock() */ __pyx_t_11 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_11 == ((Uint32)0xaabbccdd) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L1_error) __pyx_v_pixel = __pyx_t_11; /* "pygame_sdl2/surface.pyx":570 * pixel = map_color(self.surface, color) * * self.lock() # <<<<<<<<<<<<<< * * p = self.surface.pixels */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":572 * self.lock() * * p = self.surface.pixels # <<<<<<<<<<<<<< * p += y * self.surface.pitch * p += x * 4 */ __pyx_v_p = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":573 * * p = self.surface.pixels * p += y * self.surface.pitch # <<<<<<<<<<<<<< * p += x * 4 * */ __pyx_v_p = (__pyx_v_p + (__pyx_v_y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":574 * p = self.surface.pixels * p += y * self.surface.pitch * p += x * 4 # <<<<<<<<<<<<<< * * ( p)[0] = pixel */ __pyx_v_p = (__pyx_v_p + (__pyx_v_x * 4)); /* "pygame_sdl2/surface.pyx":576 * p += x * 4 * * ( p)[0] = pixel # <<<<<<<<<<<<<< * * self.unlock() */ (((Uint32 *)__pyx_v_p)[0]) = __pyx_v_pixel; /* "pygame_sdl2/surface.pyx":578 * ( p)[0] = pixel * * self.unlock() # <<<<<<<<<<<<<< * * def get_at_mapped(self, pos): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":555 * return get_color(pixel, self.surface) * * def set_at(self, pos, color): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":580 * self.unlock() * * def get_at_mapped(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_44get_at_mapped, "Surface.get_at_mapped(self, pos)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_45get_at_mapped = {"get_at_mapped", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_44get_at_mapped}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pos = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_at_mapped (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_at_mapped") < 0)) __PYX_ERR(0, 580, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pos = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_at_mapped", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 580, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_at_mapped", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_44get_at_mapped(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_pos); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_44get_at_mapped(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos) { int __pyx_v_x; int __pyx_v_y; Uint8 *__pyx_v_p; Uint32 __pyx_v_pixel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; unsigned int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_at_mapped", 1); /* "pygame_sdl2/surface.pyx":584 * cdef Uint8 *p * * x, y = pos # <<<<<<<<<<<<<< * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 584, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 584, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/surface.pyx":586 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ __pyx_t_8 = (0 <= __pyx_v_x); if (__pyx_t_8) { __pyx_t_8 = (__pyx_v_x < __pyx_v_self->surface->w); } __pyx_t_9 = (!__pyx_t_8); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = (0 <= __pyx_v_y); if (__pyx_t_9) { __pyx_t_9 = (__pyx_v_y < __pyx_v_self->surface->h); } __pyx_t_8 = (!__pyx_t_9); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_7)) { /* "pygame_sdl2/surface.pyx":587 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise ValueError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 587, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":586 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ } /* "pygame_sdl2/surface.pyx":589 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_7 = (__pyx_v_self->surface->format->BytesPerPixel != 4); if (unlikely(__pyx_t_7)) { /* "pygame_sdl2/surface.pyx":590 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * self.lock() */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Surface_has_unsupported_bytesize}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 590, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":589 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/surface.pyx":592 * raise error("Surface has unsupported bytesize.") * * self.lock() # <<<<<<<<<<<<<< * * p = self.surface.pixels */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":594 * self.lock() * * p = self.surface.pixels # <<<<<<<<<<<<<< * p += y * self.surface.pitch * p += x * 4 */ __pyx_v_p = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":595 * * p = self.surface.pixels * p += y * self.surface.pitch # <<<<<<<<<<<<<< * p += x * 4 * */ __pyx_v_p = (__pyx_v_p + (__pyx_v_y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":596 * p = self.surface.pixels * p += y * self.surface.pitch * p += x * 4 # <<<<<<<<<<<<<< * * cdef Uint32 pixel = ( p)[0] */ __pyx_v_p = (__pyx_v_p + (__pyx_v_x * 4)); /* "pygame_sdl2/surface.pyx":598 * p += x * 4 * * cdef Uint32 pixel = ( p)[0] # <<<<<<<<<<<<<< * * self.unlock() */ __pyx_v_pixel = (((Uint32 *)__pyx_v_p)[0]); /* "pygame_sdl2/surface.pyx":600 * cdef Uint32 pixel = ( p)[0] * * self.unlock() # <<<<<<<<<<<<<< * * return pixel */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":602 * self.unlock() * * return pixel # <<<<<<<<<<<<<< * * def map_rgb(self, color): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_pixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":580 * self.unlock() * * def get_at_mapped(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_at_mapped", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":604 * return pixel * * def map_rgb(self, color): # <<<<<<<<<<<<<< * return map_color(self.surface, color) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_46map_rgb, "Surface.map_rgb(self, color)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_47map_rgb = {"map_rgb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_46map_rgb}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_color = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("map_rgb (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "map_rgb") < 0)) __PYX_ERR(0, 604, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_color = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("map_rgb", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 604, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.map_rgb", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_46map_rgb(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_color); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_46map_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("map_rgb", 1); /* "pygame_sdl2/surface.pyx":605 * * def map_rgb(self, color): * return map_color(self.surface, color) # <<<<<<<<<<<<<< * * def unmap_rgb(self, pixel): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_1 == ((Uint32)0xaabbccdd) && PyErr_Occurred())) __PYX_ERR(0, 605, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":604 * return pixel * * def map_rgb(self, color): # <<<<<<<<<<<<<< * return map_color(self.surface, color) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.map_rgb", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":607 * return map_color(self.surface, color) * * def unmap_rgb(self, pixel): # <<<<<<<<<<<<<< * return get_color(pixel, self.surface) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_48unmap_rgb, "Surface.unmap_rgb(self, pixel)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_49unmap_rgb = {"unmap_rgb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_48unmap_rgb}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pixel = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unmap_rgb (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pixel,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pixel)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 607, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "unmap_rgb") < 0)) __PYX_ERR(0, 607, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pixel = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("unmap_rgb", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 607, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unmap_rgb", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_48unmap_rgb(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_pixel); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_48unmap_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pixel) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unmap_rgb", 1); /* "pygame_sdl2/surface.pyx":608 * * def unmap_rgb(self, pixel): * return get_color(pixel, self.surface) # <<<<<<<<<<<<<< * * def set_clip(self, rect): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_v_pixel); if (unlikely((__pyx_t_1 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 608, __pyx_L1_error) __pyx_t_2 = __pyx_f_11pygame_sdl2_5color_get_color(__pyx_t_1, __pyx_v_self->surface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":607 * return map_color(self.surface, color) * * def unmap_rgb(self, pixel): # <<<<<<<<<<<<<< * return get_color(pixel, self.surface) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unmap_rgb", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":610 * return get_color(pixel, self.surface) * * def set_clip(self, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_50set_clip, "Surface.set_clip(self, rect)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_51set_clip = {"set_clip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_50set_clip}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_rect = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_clip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rect,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_clip") < 0)) __PYX_ERR(0, 610, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_rect = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_clip", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 610, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_50set_clip(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_rect); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_50set_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_sdl_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_clip", 1); /* "pygame_sdl2/surface.pyx":613 * cdef SDL_Rect sdl_rect * * if rect is None: # <<<<<<<<<<<<<< * SDL_SetClipRect(self.surface, NULL) * else: */ __pyx_t_1 = (__pyx_v_rect == Py_None); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":614 * * if rect is None: * SDL_SetClipRect(self.surface, NULL) # <<<<<<<<<<<<<< * else: * to_sdl_rect(rect, &sdl_rect) */ (void)(SDL_SetClipRect(__pyx_v_self->surface, NULL)); /* "pygame_sdl2/surface.pyx":613 * cdef SDL_Rect sdl_rect * * if rect is None: # <<<<<<<<<<<<<< * SDL_SetClipRect(self.surface, NULL) * else: */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":616 * SDL_SetClipRect(self.surface, NULL) * else: * to_sdl_rect(rect, &sdl_rect) # <<<<<<<<<<<<<< * SDL_SetClipRect(self.surface, &sdl_rect) * */ /*else*/ { __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 616, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":617 * else: * to_sdl_rect(rect, &sdl_rect) * SDL_SetClipRect(self.surface, &sdl_rect) # <<<<<<<<<<<<<< * * def get_clip(self): */ (void)(SDL_SetClipRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect))); } __pyx_L3:; /* "pygame_sdl2/surface.pyx":610 * return get_color(pixel, self.surface) * * def set_clip(self, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":619 * SDL_SetClipRect(self.surface, &sdl_rect) * * def get_clip(self): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_52get_clip, "Surface.get_clip(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_53get_clip = {"get_clip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_52get_clip}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_clip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_clip", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_clip", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_52get_clip(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_52get_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_Rect __pyx_v_sdl_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_clip", 1); /* "pygame_sdl2/surface.pyx":622 * cdef SDL_Rect sdl_rect * * SDL_GetClipRect(self.surface, &sdl_rect) # <<<<<<<<<<<<<< * * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) */ SDL_GetClipRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect)); /* "pygame_sdl2/surface.pyx":624 * SDL_GetClipRect(self.surface, &sdl_rect) * * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) # <<<<<<<<<<<<<< * * def subsurface(self, *args): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":619 * SDL_SetClipRect(self.surface, &sdl_rect) * * def get_clip(self): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":626 * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) * * def subsurface(self, *args): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_54subsurface, "Surface.subsurface(self, *args)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_55subsurface = {"subsurface", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_54subsurface}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("subsurface (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "subsurface", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_54subsurface(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_54subsurface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_args) { SDL_Rect __pyx_v_sdl_rect; Uint8 *__pyx_v_pixels; SDL_Surface *__pyx_v_new_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("subsurface", 1); /* "pygame_sdl2/surface.pyx":629 * cdef SDL_Rect sdl_rect * * if len(args) == 1: # <<<<<<<<<<<<<< * to_sdl_rect(args[0], &sdl_rect) * else: */ __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 629, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 1); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":630 * * if len(args) == 1: * to_sdl_rect(args[0], &sdl_rect) # <<<<<<<<<<<<<< * else: * to_sdl_rect(args, &sdl_rect) */ __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_3, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":629 * cdef SDL_Rect sdl_rect * * if len(args) == 1: # <<<<<<<<<<<<<< * to_sdl_rect(args[0], &sdl_rect) * else: */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":632 * to_sdl_rect(args[0], &sdl_rect) * else: * to_sdl_rect(args, &sdl_rect) # <<<<<<<<<<<<<< * * if sdl_rect.w < 0 or sdl_rect.h < 0: */ /*else*/ { __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_args, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 632, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/surface.pyx":634 * to_sdl_rect(args, &sdl_rect) * * if sdl_rect.w < 0 or sdl_rect.h < 0: # <<<<<<<<<<<<<< * raise error("subsurface size must be non-negative.") * */ __pyx_t_5 = (__pyx_v_sdl_rect.w < 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = (__pyx_v_sdl_rect.h < 0); __pyx_t_2 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":635 * * if sdl_rect.w < 0 or sdl_rect.h < 0: * raise error("subsurface size must be non-negative.") # <<<<<<<<<<<<<< * * if ((sdl_rect.x < 0) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_s_subsurface_size_must_be_non_nega}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 635, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":634 * to_sdl_rect(args, &sdl_rect) * * if sdl_rect.w < 0 or sdl_rect.h < 0: # <<<<<<<<<<<<<< * raise error("subsurface size must be non-negative.") * */ } /* "pygame_sdl2/surface.pyx":637 * raise error("subsurface size must be non-negative.") * * if ((sdl_rect.x < 0) # <<<<<<<<<<<<<< * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) */ __pyx_t_5 = (__pyx_v_sdl_rect.x < 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } /* "pygame_sdl2/surface.pyx":638 * * if ((sdl_rect.x < 0) * or (sdl_rect.y < 0) # <<<<<<<<<<<<<< * or (sdl_rect.x + sdl_rect.w > self.surface.w) * or (sdl_rect.y + sdl_rect.h > self.surface.h)): */ __pyx_t_5 = (__pyx_v_sdl_rect.y < 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } /* "pygame_sdl2/surface.pyx":639 * if ((sdl_rect.x < 0) * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) # <<<<<<<<<<<<<< * or (sdl_rect.y + sdl_rect.h > self.surface.h)): * */ __pyx_t_5 = ((__pyx_v_sdl_rect.x + __pyx_v_sdl_rect.w) > __pyx_v_self->surface->w); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } /* "pygame_sdl2/surface.pyx":640 * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) * or (sdl_rect.y + sdl_rect.h > self.surface.h)): # <<<<<<<<<<<<<< * * raise error("subsurface rectangle outside surface area.") */ __pyx_t_5 = ((__pyx_v_sdl_rect.y + __pyx_v_sdl_rect.h) > __pyx_v_self->surface->h); __pyx_t_2 = __pyx_t_5; __pyx_L8_bool_binop_done:; /* "pygame_sdl2/surface.pyx":637 * raise error("subsurface size must be non-negative.") * * if ((sdl_rect.x < 0) # <<<<<<<<<<<<<< * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) */ if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":642 * or (sdl_rect.y + sdl_rect.h > self.surface.h)): * * raise error("subsurface rectangle outside surface area.") # <<<<<<<<<<<<<< * * cdef Uint8 *pixels = self.surface.pixels */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_s_subsurface_rectangle_outside_sur}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 642, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":637 * raise error("subsurface size must be non-negative.") * * if ((sdl_rect.x < 0) # <<<<<<<<<<<<<< * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) */ } /* "pygame_sdl2/surface.pyx":644 * raise error("subsurface rectangle outside surface area.") * * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * pixels += sdl_rect.y * self.surface.pitch * pixels += sdl_rect.x * self.surface.format.BytesPerPixel */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":645 * * cdef Uint8 *pixels = self.surface.pixels * pixels += sdl_rect.y * self.surface.pitch # <<<<<<<<<<<<<< * pixels += sdl_rect.x * self.surface.format.BytesPerPixel * */ __pyx_v_pixels = (__pyx_v_pixels + (__pyx_v_sdl_rect.y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":646 * cdef Uint8 *pixels = self.surface.pixels * pixels += sdl_rect.y * self.surface.pitch * pixels += sdl_rect.x * self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * * cdef SDL_Surface *new_surface = SDL_CreateRGBSurfaceFrom( */ __pyx_v_pixels = (__pyx_v_pixels + (__pyx_v_sdl_rect.x * __pyx_v_self->surface->format->BytesPerPixel)); /* "pygame_sdl2/surface.pyx":648 * pixels += sdl_rect.x * self.surface.format.BytesPerPixel * * cdef SDL_Surface *new_surface = SDL_CreateRGBSurfaceFrom( # <<<<<<<<<<<<<< * pixels, * sdl_rect.w, */ __pyx_v_new_surface = SDL_CreateRGBSurfaceFrom(__pyx_v_pixels, __pyx_v_sdl_rect.w, __pyx_v_sdl_rect.h, __pyx_v_self->surface->format->BitsPerPixel, __pyx_v_self->surface->pitch, __pyx_v_self->surface->format->Rmask, __pyx_v_self->surface->format->Gmask, __pyx_v_self->surface->format->Bmask, __pyx_v_self->surface->format->Amask); /* "pygame_sdl2/surface.pyx":659 * self.surface.format.Amask) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (!(__pyx_v_new_surface != 0)); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":660 * * if not new_surface: * raise error() # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 660, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":659 * self.surface.format.Amask) * * if not new_surface: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":662 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * * rv.surface = new_surface */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":664 * cdef Surface rv = Surface(()) * * rv.surface = new_surface # <<<<<<<<<<<<<< * rv.parent = self * rv.offset_x = sdl_rect.x */ __pyx_v_rv->surface = __pyx_v_new_surface; /* "pygame_sdl2/surface.pyx":665 * * rv.surface = new_surface * rv.parent = self # <<<<<<<<<<<<<< * rv.offset_x = sdl_rect.x * rv.offset_y = sdl_rect.y */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); __Pyx_GOTREF((PyObject *)__pyx_v_rv->parent); __Pyx_DECREF((PyObject *)__pyx_v_rv->parent); __pyx_v_rv->parent = __pyx_v_self; /* "pygame_sdl2/surface.pyx":666 * rv.surface = new_surface * rv.parent = self * rv.offset_x = sdl_rect.x # <<<<<<<<<<<<<< * rv.offset_y = sdl_rect.y * */ __pyx_t_4 = __pyx_v_sdl_rect.x; __pyx_v_rv->offset_x = __pyx_t_4; /* "pygame_sdl2/surface.pyx":667 * rv.parent = self * rv.offset_x = sdl_rect.x * rv.offset_y = sdl_rect.y # <<<<<<<<<<<<<< * * if self.has_alpha: */ __pyx_t_4 = __pyx_v_sdl_rect.y; __pyx_v_rv->offset_y = __pyx_t_4; /* "pygame_sdl2/surface.pyx":669 * rv.offset_y = sdl_rect.y * * if self.has_alpha: # <<<<<<<<<<<<<< * rv.set_alpha(self.get_alpha()) * */ if (__pyx_v_self->has_alpha) { /* "pygame_sdl2/surface.pyx":670 * * if self.has_alpha: * rv.set_alpha(self.get_alpha()) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_set_alpha); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_alpha); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":669 * rv.offset_y = sdl_rect.y * * if self.has_alpha: # <<<<<<<<<<<<<< * rv.set_alpha(self.get_alpha()) * */ } /* "pygame_sdl2/surface.pyx":672 * rv.set_alpha(self.get_alpha()) * * return rv # <<<<<<<<<<<<<< * * def get_parent(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":626 * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) * * def subsurface(self, *args): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.subsurface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":674 * return rv * * def get_parent(self): # <<<<<<<<<<<<<< * return self.parent * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_56get_parent, "Surface.get_parent(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_57get_parent = {"get_parent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_56get_parent}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_parent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_parent", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_parent", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_56get_parent(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_56get_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_parent", 1); /* "pygame_sdl2/surface.pyx":675 * * def get_parent(self): * return self.parent # <<<<<<<<<<<<<< * * def get_abs_parent(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->parent); __pyx_r = ((PyObject *)__pyx_v_self->parent); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":674 * return rv * * def get_parent(self): # <<<<<<<<<<<<<< * return self.parent * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":677 * return self.parent * * def get_abs_parent(self): # <<<<<<<<<<<<<< * rv = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_58get_abs_parent, "Surface.get_abs_parent(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_59get_abs_parent = {"get_abs_parent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_58get_abs_parent}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_abs_parent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_abs_parent", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_abs_parent", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_58get_abs_parent(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_58get_abs_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_abs_parent", 1); /* "pygame_sdl2/surface.pyx":678 * * def get_abs_parent(self): * rv = self # <<<<<<<<<<<<<< * * while rv.parent: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_rv = __pyx_v_self; /* "pygame_sdl2/surface.pyx":680 * rv = self * * while rv.parent: # <<<<<<<<<<<<<< * rv = rv.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_rv->parent)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 680, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":681 * * while rv.parent: * rv = rv.parent # <<<<<<<<<<<<<< * * return rv */ __pyx_t_2 = ((PyObject *)__pyx_v_rv->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_rv, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":683 * rv = rv.parent * * return rv # <<<<<<<<<<<<<< * * def get_offset(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":677 * return self.parent * * def get_abs_parent(self): # <<<<<<<<<<<<<< * rv = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_abs_parent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":685 * return rv * * def get_offset(self): # <<<<<<<<<<<<<< * return (self.offset_x, self.offset_y) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_60get_offset, "Surface.get_offset(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_61get_offset = {"get_offset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_60get_offset}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_offset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_offset", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_offset", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_60get_offset(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_60get_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_offset", 1); /* "pygame_sdl2/surface.pyx":686 * * def get_offset(self): * return (self.offset_x, self.offset_y) # <<<<<<<<<<<<<< * * def get_abs_offset(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->offset_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->offset_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":685 * return rv * * def get_offset(self): # <<<<<<<<<<<<<< * return (self.offset_x, self.offset_y) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":688 * return (self.offset_x, self.offset_y) * * def get_abs_offset(self): # <<<<<<<<<<<<<< * cdef Surface surf = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_62get_abs_offset, "Surface.get_abs_offset(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_63get_abs_offset = {"get_abs_offset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_62get_abs_offset}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_abs_offset (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_abs_offset", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_abs_offset", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_62get_abs_offset(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_62get_abs_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf = 0; int __pyx_v_offset_x; int __pyx_v_offset_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_abs_offset", 1); /* "pygame_sdl2/surface.pyx":689 * * def get_abs_offset(self): * cdef Surface surf = self # <<<<<<<<<<<<<< * * cdef int offset_x = 0 */ __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_surf = __pyx_v_self; /* "pygame_sdl2/surface.pyx":691 * cdef Surface surf = self * * cdef int offset_x = 0 # <<<<<<<<<<<<<< * cdef int offset_y = 0 * */ __pyx_v_offset_x = 0; /* "pygame_sdl2/surface.pyx":692 * * cdef int offset_x = 0 * cdef int offset_y = 0 # <<<<<<<<<<<<<< * * while surf: */ __pyx_v_offset_y = 0; /* "pygame_sdl2/surface.pyx":694 * cdef int offset_y = 0 * * while surf: # <<<<<<<<<<<<<< * offset_x += surf.offset_x * offset_y += surf.offset_y */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_surf)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 694, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":695 * * while surf: * offset_x += surf.offset_x # <<<<<<<<<<<<<< * offset_y += surf.offset_y * surf = surf.parent */ __pyx_v_offset_x = (__pyx_v_offset_x + __pyx_v_surf->offset_x); /* "pygame_sdl2/surface.pyx":696 * while surf: * offset_x += surf.offset_x * offset_y += surf.offset_y # <<<<<<<<<<<<<< * surf = surf.parent * */ __pyx_v_offset_y = (__pyx_v_offset_y + __pyx_v_surf->offset_y); /* "pygame_sdl2/surface.pyx":697 * offset_x += surf.offset_x * offset_y += surf.offset_y * surf = surf.parent # <<<<<<<<<<<<<< * * return (offset_x, offset_y) */ __pyx_t_2 = ((PyObject *)__pyx_v_surf->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_surf, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":699 * surf = surf.parent * * return (offset_x, offset_y) # <<<<<<<<<<<<<< * * def get_size(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_offset_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_offset_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":688 * return (self.offset_x, self.offset_y) * * def get_abs_offset(self): # <<<<<<<<<<<<<< * cdef Surface surf = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_abs_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":701 * return (offset_x, offset_y) * * def get_size(self): # <<<<<<<<<<<<<< * return self.surface.w, self.surface.h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_64get_size, "Surface.get_size(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_65get_size = {"get_size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_64get_size}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_size (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_size", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_size", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_64get_size(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_64get_size(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_size", 1); /* "pygame_sdl2/surface.pyx":702 * * def get_size(self): * return self.surface.w, self.surface.h # <<<<<<<<<<<<<< * * def get_width(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":701 * return (offset_x, offset_y) * * def get_size(self): # <<<<<<<<<<<<<< * return self.surface.w, self.surface.h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":704 * return self.surface.w, self.surface.h * * def get_width(self): # <<<<<<<<<<<<<< * return self.surface.w * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_66get_width, "Surface.get_width(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_67get_width = {"get_width", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_66get_width}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_width (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_width", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_width", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_66get_width(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_66get_width(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_width", 1); /* "pygame_sdl2/surface.pyx":705 * * def get_width(self): * return self.surface.w # <<<<<<<<<<<<<< * * def get_height(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":704 * return self.surface.w, self.surface.h * * def get_width(self): # <<<<<<<<<<<<<< * return self.surface.w * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_width", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":707 * return self.surface.w * * def get_height(self): # <<<<<<<<<<<<<< * return self.surface.h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_68get_height, "Surface.get_height(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_69get_height = {"get_height", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_68get_height}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_height (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_height", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_height", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_68get_height(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_68get_height(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_height", 1); /* "pygame_sdl2/surface.pyx":708 * * def get_height(self): * return self.surface.h # <<<<<<<<<<<<<< * * def get_rect(self, **kwargs): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":707 * return self.surface.w * * def get_height(self): # <<<<<<<<<<<<<< * return self.surface.h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_height", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":710 * return self.surface.h * * def get_rect(self, **kwargs): # <<<<<<<<<<<<<< * rv = Rect((0, 0, self.surface.w, self.surface.h)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_70get_rect, "Surface.get_rect(self, **kwargs)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_71get_rect = {"get_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_70get_rect}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_kwargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_rect", 1, 0, 0, __pyx_nargs); return NULL;} if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_rect", 1))) return NULL; if (__pyx_kwds) { __pyx_v_kwargs = __Pyx_KwargsAsDict_FASTCALL(__pyx_kwds, __pyx_kwvalues); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); } else { __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); } __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_70get_rect(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_kwargs); /* function exit code */ __Pyx_DECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_70get_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Py_ssize_t __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_rect", 1); /* "pygame_sdl2/surface.pyx":711 * * def get_rect(self, **kwargs): * rv = Rect((0, 0, self.surface.w, self.surface.h)) # <<<<<<<<<<<<<< * * for k, v in kwargs.items(): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0)) __PYX_ERR(0, 711, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0)) __PYX_ERR(0, 711, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":713 * rv = Rect((0, 0, self.surface.w, self.surface.h)) * * for k, v in kwargs.items(): # <<<<<<<<<<<<<< * setattr(rv, k, v) * */ __pyx_t_7 = 0; __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_kwargs, 1, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_8, &__pyx_t_7, &__pyx_t_2, &__pyx_t_5, NULL, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/surface.pyx":714 * * for k, v in kwargs.items(): * setattr(rv, k, v) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_11 = PyObject_SetAttr(__pyx_v_rv, __pyx_v_k, __pyx_v_v); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 714, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":716 * setattr(rv, k, v) * * return rv # <<<<<<<<<<<<<< * * def get_bitsize(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":710 * return self.surface.h * * def get_rect(self, **kwargs): # <<<<<<<<<<<<<< * rv = Rect((0, 0, self.surface.w, self.surface.h)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":718 * return rv * * def get_bitsize(self): # <<<<<<<<<<<<<< * return self.surface.format.BitsPerPixel * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_72get_bitsize, "Surface.get_bitsize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_73get_bitsize = {"get_bitsize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_72get_bitsize}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bitsize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_bitsize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_bitsize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_72get_bitsize(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_72get_bitsize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_bitsize", 1); /* "pygame_sdl2/surface.pyx":719 * * def get_bitsize(self): * return self.surface.format.BitsPerPixel # <<<<<<<<<<<<<< * * def get_bytesize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->surface->format->BitsPerPixel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":718 * return rv * * def get_bitsize(self): # <<<<<<<<<<<<<< * return self.surface.format.BitsPerPixel * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bitsize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":721 * return self.surface.format.BitsPerPixel * * def get_bytesize(self): # <<<<<<<<<<<<<< * return self.surface.format.BytesPerPixel * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_74get_bytesize, "Surface.get_bytesize(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_75get_bytesize = {"get_bytesize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_74get_bytesize}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bytesize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_bytesize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_bytesize", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_74get_bytesize(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_74get_bytesize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_bytesize", 1); /* "pygame_sdl2/surface.pyx":722 * * def get_bytesize(self): * return self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * * def get_flags(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->surface->format->BytesPerPixel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":721 * return self.surface.format.BitsPerPixel * * def get_bytesize(self): # <<<<<<<<<<<<<< * return self.surface.format.BytesPerPixel * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bytesize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":724 * return self.surface.format.BytesPerPixel * * def get_flags(self): # <<<<<<<<<<<<<< * * if self.get_window_flags: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_76get_flags, "Surface.get_flags(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_77get_flags = {"get_flags", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_76get_flags}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_flags (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_flags", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_flags", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_76get_flags(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_76get_flags(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_flags", 1); /* "pygame_sdl2/surface.pyx":726 * def get_flags(self): * * if self.get_window_flags: # <<<<<<<<<<<<<< * rv = self.get_window_flags() * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->get_window_flags); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":727 * * if self.get_window_flags: * rv = self.get_window_flags() # <<<<<<<<<<<<<< * else: * rv = 0 */ __Pyx_INCREF(__pyx_v_self->get_window_flags); __pyx_t_3 = __pyx_v_self->get_window_flags; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_rv = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":726 * def get_flags(self): * * if self.get_window_flags: # <<<<<<<<<<<<<< * rv = self.get_window_flags() * else: */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":729 * rv = self.get_window_flags() * else: * rv = 0 # <<<<<<<<<<<<<< * * if self.surface.format.Amask or self.has_alpha: */ /*else*/ { __Pyx_INCREF(__pyx_int_0); __pyx_v_rv = __pyx_int_0; } __pyx_L3:; /* "pygame_sdl2/surface.pyx":731 * rv = 0 * * if self.surface.format.Amask or self.has_alpha: # <<<<<<<<<<<<<< * rv = rv | SRCALPHA * */ __pyx_t_6 = (__pyx_v_self->surface->format->Amask != 0); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L5_bool_binop_done; } __pyx_t_1 = __pyx_v_self->has_alpha; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":732 * * if self.surface.format.Amask or self.has_alpha: * rv = rv | SRCALPHA # <<<<<<<<<<<<<< * * return rv */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Or(__pyx_v_rv, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":731 * rv = 0 * * if self.surface.format.Amask or self.has_alpha: # <<<<<<<<<<<<<< * rv = rv | SRCALPHA * */ } /* "pygame_sdl2/surface.pyx":734 * rv = rv | SRCALPHA * * return rv # <<<<<<<<<<<<<< * * def get_pitch(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":724 * return self.surface.format.BytesPerPixel * * def get_flags(self): # <<<<<<<<<<<<<< * * if self.get_window_flags: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":736 * return rv * * def get_pitch(self): # <<<<<<<<<<<<<< * return self.surface.pitch * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_78get_pitch, "Surface.get_pitch(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_79get_pitch = {"get_pitch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_78get_pitch}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pitch (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_pitch", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_pitch", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_78get_pitch(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_78get_pitch(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pitch", 1); /* "pygame_sdl2/surface.pyx":737 * * def get_pitch(self): * return self.surface.pitch # <<<<<<<<<<<<<< * * def get_masks(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->pitch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":736 * return rv * * def get_pitch(self): # <<<<<<<<<<<<<< * return self.surface.pitch * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_pitch", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":739 * return self.surface.pitch * * def get_masks(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_80get_masks, "Surface.get_masks(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_81get_masks = {"get_masks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_80get_masks}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_masks (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_masks", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_masks", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_80get_masks(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_80get_masks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_masks", 1); /* "pygame_sdl2/surface.pyx":740 * * def get_masks(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":741 * def get_masks(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) # <<<<<<<<<<<<<< * * def set_masks(self, masks): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":739 * return self.surface.pitch * * def get_masks(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_masks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":743 * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * * def set_masks(self, masks): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_masks is not supported.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_82set_masks, "Surface.set_masks(self, masks)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_83set_masks = {"set_masks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_82set_masks}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_masks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_masks (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_masks,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_masks)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 743, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_masks") < 0)) __PYX_ERR(0, 743, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_masks = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_masks", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 743, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_masks", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_82set_masks(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_masks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_82set_masks(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_masks) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_masks", 1); /* "pygame_sdl2/surface.pyx":744 * * def set_masks(self, masks): * warnings.warn("Surface.set_masks is not supported.") # <<<<<<<<<<<<<< * * def get_shifts(self): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_warnings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s_Surface_set_masks_is_not_support}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":743 * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * * def set_masks(self, masks): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_masks is not supported.") * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_masks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":746 * warnings.warn("Surface.set_masks is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_84get_shifts, "Surface.get_shifts(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_85get_shifts = {"get_shifts", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_84get_shifts}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_shifts (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_shifts", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_shifts", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_84get_shifts(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_84get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_shifts", 1); /* "pygame_sdl2/surface.pyx":747 * * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":748 * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) # <<<<<<<<<<<<<< * * def set_shifts(self, shifts): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 748, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":746 * warnings.warn("Surface.set_masks is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":750 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def set_shifts(self, shifts): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_shifts is not supported.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_86set_shifts, "Surface.set_shifts(self, shifts)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_87set_shifts = {"set_shifts", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_86set_shifts}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_shifts = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_shifts (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shifts,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shifts)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 750, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_shifts") < 0)) __PYX_ERR(0, 750, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_shifts = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_shifts", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 750, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_86set_shifts(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_shifts); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_86set_shifts(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_shifts) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_shifts", 1); /* "pygame_sdl2/surface.pyx":751 * * def set_shifts(self, shifts): * warnings.warn("Surface.set_shifts is not supported.") # <<<<<<<<<<<<<< * * def get_shifts(self): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_warnings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s_Surface_set_shifts_is_not_suppor}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":750 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def set_shifts(self, shifts): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_shifts is not supported.") * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":753 * warnings.warn("Surface.set_shifts is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_88get_shifts, "Surface.get_shifts(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_89get_shifts = {"get_shifts", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_88get_shifts}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_shifts (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_shifts", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_shifts", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_88get_shifts(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_88get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_shifts", 1); /* "pygame_sdl2/surface.pyx":754 * * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":755 * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) # <<<<<<<<<<<<<< * * def get_losses(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 755, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":753 * warnings.warn("Surface.set_shifts is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":757 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def get_losses(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_90get_losses, "Surface.get_losses(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_91get_losses = {"get_losses", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_90get_losses}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_losses (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_losses", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_losses", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_90get_losses(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_90get_losses(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_losses", 1); /* "pygame_sdl2/surface.pyx":758 * * def get_losses(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":759 * def get_losses(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) # <<<<<<<<<<<<<< * * def get_bounding_rect(self, min_alpha=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":757 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def get_losses(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_losses", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":761 * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * * def get_bounding_rect(self, min_alpha=1): # <<<<<<<<<<<<<< * * cdef Uint32 amask = self.surface.format.Amask */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_92get_bounding_rect, "Surface.get_bounding_rect(self, min_alpha=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_93get_bounding_rect = {"get_bounding_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_92get_bounding_rect}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_min_alpha = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bounding_rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_min_alpha,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_min_alpha); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_bounding_rect") < 0)) __PYX_ERR(0, 761, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_min_alpha = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_bounding_rect", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 761, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bounding_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_92get_bounding_rect(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_min_alpha); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_92get_bounding_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_min_alpha) { Uint32 __pyx_v_amask; Uint32 __pyx_v_amin; int __pyx_v_x; int __pyx_v_y; int __pyx_v_w; int __pyx_v_h; int __pyx_v_minx; int __pyx_v_maxx; int __pyx_v_miny; int __pyx_v_maxy; Uint32 *__pyx_v_row; Uint32 __pyx_v_topleft; Uint32 __pyx_v_botright; Uint8 *__pyx_v_pixels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; long __pyx_t_12; long __pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_bounding_rect", 1); /* "pygame_sdl2/surface.pyx":763 * def get_bounding_rect(self, min_alpha=1): * * cdef Uint32 amask = self.surface.format.Amask # <<<<<<<<<<<<<< * cdef Uint32 amin = (0x01010101 * min_alpha) & amask * */ __pyx_t_1 = __pyx_v_self->surface->format->Amask; __pyx_v_amask = __pyx_t_1; /* "pygame_sdl2/surface.pyx":764 * * cdef Uint32 amask = self.surface.format.Amask * cdef Uint32 amin = (0x01010101 * min_alpha) & amask # <<<<<<<<<<<<<< * * cdef int x */ __pyx_t_2 = __Pyx_PyInt_MultiplyCObj(__pyx_int_16843009, __pyx_v_min_alpha, 0x01010101, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_amask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_1 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_amin = __pyx_t_1; /* "pygame_sdl2/surface.pyx":771 * cdef int h * * cdef int minx = self.surface.w - 1 # <<<<<<<<<<<<<< * cdef int maxx = 0 * cdef int miny = self.surface.h - 1 */ __pyx_v_minx = (__pyx_v_self->surface->w - 1); /* "pygame_sdl2/surface.pyx":772 * * cdef int minx = self.surface.w - 1 * cdef int maxx = 0 # <<<<<<<<<<<<<< * cdef int miny = self.surface.h - 1 * cdef int maxy = 0 */ __pyx_v_maxx = 0; /* "pygame_sdl2/surface.pyx":773 * cdef int minx = self.surface.w - 1 * cdef int maxx = 0 * cdef int miny = self.surface.h - 1 # <<<<<<<<<<<<<< * cdef int maxy = 0 * */ __pyx_v_miny = (__pyx_v_self->surface->h - 1); /* "pygame_sdl2/surface.pyx":774 * cdef int maxx = 0 * cdef int miny = self.surface.h - 1 * cdef int maxy = 0 # <<<<<<<<<<<<<< * * cdef Uint32 *row */ __pyx_v_maxy = 0; /* "pygame_sdl2/surface.pyx":781 * cdef Uint32 botright * * if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): # <<<<<<<<<<<<<< * return Rect((0, 0, self.surface.w, self.surface.h)) * */ __pyx_t_6 = (!(__pyx_v_amask != 0)); if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = (__pyx_v_self->surface->w == 0); if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = (__pyx_v_self->surface->h == 0); __pyx_t_5 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":782 * * if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): * return Rect((0, 0, self.surface.w, self.surface.h)) # <<<<<<<<<<<<<< * * self.lock() */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_int_0)) __PYX_ERR(0, 782, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_0)) __PYX_ERR(0, 782, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7)) __PYX_ERR(0, 782, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":781 * cdef Uint32 botright * * if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): # <<<<<<<<<<<<<< * return Rect((0, 0, self.surface.w, self.surface.h)) * */ } /* "pygame_sdl2/surface.pyx":784 * return Rect((0, 0, self.surface.w, self.surface.h)) * * self.lock() # <<<<<<<<<<<<<< * * cdef Uint8 *pixels = self.surface.pixels */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":786 * self.lock() * * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":788 * cdef Uint8 *pixels = self.surface.pixels * * with nogil: # <<<<<<<<<<<<<< * * topleft = ( pixels)[0] */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":790 * with nogil: * * topleft = ( pixels)[0] # <<<<<<<<<<<<<< * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] * */ __pyx_v_topleft = (((Uint32 *)__pyx_v_pixels)[0]); /* "pygame_sdl2/surface.pyx":791 * * topleft = ( pixels)[0] * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] # <<<<<<<<<<<<<< * * if ((topleft & amask) > amin) and ((botright & amask) > amin): */ __pyx_v_botright = (((Uint32 *)(__pyx_v_pixels + (__pyx_v_self->surface->pitch * (__pyx_v_self->surface->h - 1))))[(__pyx_v_self->surface->w - 1)]); /* "pygame_sdl2/surface.pyx":793 * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] * * if ((topleft & amask) > amin) and ((botright & amask) > amin): # <<<<<<<<<<<<<< * * # Bounding box covers image. */ __pyx_t_6 = ((__pyx_v_topleft & __pyx_v_amask) > __pyx_v_amin); if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L11_bool_binop_done; } __pyx_t_6 = ((__pyx_v_botright & __pyx_v_amask) > __pyx_v_amin); __pyx_t_5 = __pyx_t_6; __pyx_L11_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":797 * # Bounding box covers image. * * minx = 0 # <<<<<<<<<<<<<< * miny = 0 * maxx = self.surface.w - 1 */ __pyx_v_minx = 0; /* "pygame_sdl2/surface.pyx":798 * * minx = 0 * miny = 0 # <<<<<<<<<<<<<< * maxx = self.surface.w - 1 * maxy = self.surface.h - 1 */ __pyx_v_miny = 0; /* "pygame_sdl2/surface.pyx":799 * minx = 0 * miny = 0 * maxx = self.surface.w - 1 # <<<<<<<<<<<<<< * maxy = self.surface.h - 1 * */ __pyx_v_maxx = (__pyx_v_self->surface->w - 1); /* "pygame_sdl2/surface.pyx":800 * miny = 0 * maxx = self.surface.w - 1 * maxy = self.surface.h - 1 # <<<<<<<<<<<<<< * * else: */ __pyx_v_maxy = (__pyx_v_self->surface->h - 1); /* "pygame_sdl2/surface.pyx":793 * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] * * if ((topleft & amask) > amin) and ((botright & amask) > amin): # <<<<<<<<<<<<<< * * # Bounding box covers image. */ goto __pyx_L10; } /* "pygame_sdl2/surface.pyx":806 * # Bounding box is smaller than image. * * for 0 <= y < self.surface.h: # <<<<<<<<<<<<<< * row = (pixels + self.surface.pitch * y) * */ /*else*/ { __pyx_t_10 = __pyx_v_self->surface->h; for (__pyx_v_y = 0; __pyx_v_y < __pyx_t_10; __pyx_v_y++) { /* "pygame_sdl2/surface.pyx":807 * * for 0 <= y < self.surface.h: * row = (pixels + self.surface.pitch * y) # <<<<<<<<<<<<<< * * for 0 <= x < self.surface.w: */ __pyx_v_row = ((Uint32 *)(__pyx_v_pixels + (__pyx_v_self->surface->pitch * __pyx_v_y))); /* "pygame_sdl2/surface.pyx":809 * row = (pixels + self.surface.pitch * y) * * for 0 <= x < self.surface.w: # <<<<<<<<<<<<<< * * if (row[x] & amask) >= amin: */ __pyx_t_11 = __pyx_v_self->surface->w; for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_11; __pyx_v_x++) { /* "pygame_sdl2/surface.pyx":811 * for 0 <= x < self.surface.w: * * if (row[x] & amask) >= amin: # <<<<<<<<<<<<<< * * if minx > x: */ __pyx_t_5 = (((__pyx_v_row[__pyx_v_x]) & __pyx_v_amask) >= __pyx_v_amin); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":813 * if (row[x] & amask) >= amin: * * if minx > x: # <<<<<<<<<<<<<< * minx = x * if miny > y: */ __pyx_t_5 = (__pyx_v_minx > __pyx_v_x); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":814 * * if minx > x: * minx = x # <<<<<<<<<<<<<< * if miny > y: * miny = y */ __pyx_v_minx = __pyx_v_x; /* "pygame_sdl2/surface.pyx":813 * if (row[x] & amask) >= amin: * * if minx > x: # <<<<<<<<<<<<<< * minx = x * if miny > y: */ } /* "pygame_sdl2/surface.pyx":815 * if minx > x: * minx = x * if miny > y: # <<<<<<<<<<<<<< * miny = y * if maxx < x: */ __pyx_t_5 = (__pyx_v_miny > __pyx_v_y); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":816 * minx = x * if miny > y: * miny = y # <<<<<<<<<<<<<< * if maxx < x: * maxx = x */ __pyx_v_miny = __pyx_v_y; /* "pygame_sdl2/surface.pyx":815 * if minx > x: * minx = x * if miny > y: # <<<<<<<<<<<<<< * miny = y * if maxx < x: */ } /* "pygame_sdl2/surface.pyx":817 * if miny > y: * miny = y * if maxx < x: # <<<<<<<<<<<<<< * maxx = x * if maxy < y: */ __pyx_t_5 = (__pyx_v_maxx < __pyx_v_x); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":818 * miny = y * if maxx < x: * maxx = x # <<<<<<<<<<<<<< * if maxy < y: * maxy = y */ __pyx_v_maxx = __pyx_v_x; /* "pygame_sdl2/surface.pyx":817 * if miny > y: * miny = y * if maxx < x: # <<<<<<<<<<<<<< * maxx = x * if maxy < y: */ } /* "pygame_sdl2/surface.pyx":819 * if maxx < x: * maxx = x * if maxy < y: # <<<<<<<<<<<<<< * maxy = y * */ __pyx_t_5 = (__pyx_v_maxy < __pyx_v_y); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":820 * maxx = x * if maxy < y: * maxy = y # <<<<<<<<<<<<<< * * self.unlock() */ __pyx_v_maxy = __pyx_v_y; /* "pygame_sdl2/surface.pyx":819 * if maxx < x: * maxx = x * if maxy < y: # <<<<<<<<<<<<<< * maxy = y * */ } /* "pygame_sdl2/surface.pyx":811 * for 0 <= x < self.surface.w: * * if (row[x] & amask) >= amin: # <<<<<<<<<<<<<< * * if minx > x: */ } } } } __pyx_L10:; } /* "pygame_sdl2/surface.pyx":788 * cdef Uint8 *pixels = self.surface.pixels * * with nogil: # <<<<<<<<<<<<<< * * topleft = ( pixels)[0] */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } /* "pygame_sdl2/surface.pyx":822 * maxy = y * * self.unlock() # <<<<<<<<<<<<<< * * # Totally empty surface. */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":825 * * # Totally empty surface. * if minx > maxx: # <<<<<<<<<<<<<< * return Rect((0, 0, 0, 0)) * */ __pyx_t_5 = (__pyx_v_minx > __pyx_v_maxx); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":826 * # Totally empty surface. * if minx > maxx: * return Rect((0, 0, 0, 0)) # <<<<<<<<<<<<<< * * x = minx */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_tuple__2}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":825 * * # Totally empty surface. * if minx > maxx: # <<<<<<<<<<<<<< * return Rect((0, 0, 0, 0)) * */ } /* "pygame_sdl2/surface.pyx":828 * return Rect((0, 0, 0, 0)) * * x = minx # <<<<<<<<<<<<<< * y = miny * w = min(maxx - minx + 1, self.surface.w - x) */ __pyx_v_x = __pyx_v_minx; /* "pygame_sdl2/surface.pyx":829 * * x = minx * y = miny # <<<<<<<<<<<<<< * w = min(maxx - minx + 1, self.surface.w - x) * h = min(maxy - miny + 1, self.surface.h - y) */ __pyx_v_y = __pyx_v_miny; /* "pygame_sdl2/surface.pyx":830 * x = minx * y = miny * w = min(maxx - minx + 1, self.surface.w - x) # <<<<<<<<<<<<<< * h = min(maxy - miny + 1, self.surface.h - y) * */ __pyx_t_10 = (__pyx_v_self->surface->w - __pyx_v_x); __pyx_t_12 = ((__pyx_v_maxx - __pyx_v_minx) + 1); __pyx_t_5 = (__pyx_t_10 < __pyx_t_12); if (__pyx_t_5) { __pyx_t_13 = __pyx_t_10; } else { __pyx_t_13 = __pyx_t_12; } __pyx_v_w = __pyx_t_13; /* "pygame_sdl2/surface.pyx":831 * y = miny * w = min(maxx - minx + 1, self.surface.w - x) * h = min(maxy - miny + 1, self.surface.h - y) # <<<<<<<<<<<<<< * * return Rect((x, y, w, h)) */ __pyx_t_10 = (__pyx_v_self->surface->h - __pyx_v_y); __pyx_t_13 = ((__pyx_v_maxy - __pyx_v_miny) + 1); __pyx_t_5 = (__pyx_t_10 < __pyx_t_13); if (__pyx_t_5) { __pyx_t_12 = __pyx_t_10; } else { __pyx_t_12 = __pyx_t_13; } __pyx_v_h = __pyx_t_12; /* "pygame_sdl2/surface.pyx":833 * h = min(maxy - miny + 1, self.surface.h - y) * * return Rect((x, y, w, h)) # <<<<<<<<<<<<<< * * def get_view(self, kind='2'): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_8)) __PYX_ERR(0, 833, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_14); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_14)) __PYX_ERR(0, 833, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0; __pyx_t_14 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_15}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":761 * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * * def get_bounding_rect(self, min_alpha=1): # <<<<<<<<<<<<<< * * cdef Uint32 amask = self.surface.format.Amask */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bounding_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":835 * return Rect((x, y, w, h)) * * def get_view(self, kind='2'): # <<<<<<<<<<<<<< * raise error("Surface.get_view is not supported.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_94get_view, "Surface.get_view(self, kind='2')"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_95get_view = {"get_view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_94get_view}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_kind = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_view (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_kind,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_kp_s_2)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kind); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 835, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_view") < 0)) __PYX_ERR(0, 835, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_kind = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_view", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 835, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_94get_view(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_kind); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_94get_view(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kind) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_view", 1); /* "pygame_sdl2/surface.pyx":836 * * def get_view(self, kind='2'): * raise error("Surface.get_view is not supported.") # <<<<<<<<<<<<<< * * def get_buffer(self): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Surface_get_view_is_not_supporte}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 836, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":835 * return Rect((x, y, w, h)) * * def get_view(self, kind='2'): # <<<<<<<<<<<<<< * raise error("Surface.get_view is not supported.") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":838 * raise error("Surface.get_view is not supported.") * * def get_buffer(self): # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_96get_buffer, "Surface.get_buffer(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_97get_buffer = {"get_buffer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_96get_buffer}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_buffer (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_buffer", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_buffer", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_96get_buffer(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_96get_buffer(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { Uint8 *__pyx_v_pixels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_buffer", 1); /* "pygame_sdl2/surface.pyx":839 * * def get_buffer(self): * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * return pixels[self.surface.h * self.surface.pitch] * */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":840 * def get_buffer(self): * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] # <<<<<<<<<<<<<< * * property _pixels_address: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t((__pyx_v_pixels[(__pyx_v_self->surface->h * __pyx_v_self->surface->pitch)])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":838 * raise error("Surface.get_view is not supported.") * * def get_buffer(self): # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":843 * * property _pixels_address: * def __get__(self): # <<<<<<<<<<<<<< * return self.surface.pixels * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15_pixels_address_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15_pixels_address_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_15_pixels_address___get__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_15_pixels_address___get__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "pygame_sdl2/surface.pyx":844 * property _pixels_address: * def __get__(self): * return self.surface.pixels # <<<<<<<<<<<<<< * * def from_data(self, data): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint64_t(((Uint64)__pyx_v_self->surface->pixels)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":843 * * property _pixels_address: * def __get__(self): # <<<<<<<<<<<<<< * return self.surface.pixels * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface._pixels_address.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":846 * return self.surface.pixels * * def from_data(self, data): # <<<<<<<<<<<<<< * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: * raise ValueError("The data must fill the surface.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_99from_data(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_98from_data, "Surface.from_data(self, data)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_99from_data = {"from_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_99from_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_98from_data}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_99from_data(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("from_data (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 846, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_data") < 0)) __PYX_ERR(0, 846, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("from_data", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 846, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.from_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_98from_data(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_98from_data(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_data) { Uint8 *__pyx_v_d; Uint8 *__pyx_v_pixels; CYTHON_UNUSED int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Uint8 *__pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_data", 1); /* "pygame_sdl2/surface.pyx":847 * * def from_data(self, data): * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: # <<<<<<<<<<<<<< * raise ValueError("The data must fill the surface.") * */ __pyx_t_1 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 847, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != ((__pyx_v_self->surface->w * __pyx_v_self->surface->h) * __pyx_v_self->surface->format->BytesPerPixel)); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/surface.pyx":848 * def from_data(self, data): * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: * raise ValueError("The data must fill the surface.") # <<<<<<<<<<<<<< * * cdef Uint8 *d = data */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 848, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":847 * * def from_data(self, data): * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: # <<<<<<<<<<<<<< * raise ValueError("The data must fill the surface.") * */ } /* "pygame_sdl2/surface.pyx":850 * raise ValueError("The data must fill the surface.") * * cdef Uint8 *d = data # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * */ __pyx_t_4 = __Pyx_PyObject_AsWritableUString(__pyx_v_data); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 850, __pyx_L1_error) __pyx_v_d = ((Uint8 *)__pyx_t_4); /* "pygame_sdl2/surface.pyx":851 * * cdef Uint8 *d = data * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * * cdef int i */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":855 * cdef int i * * for 0 <= i < self.surface.h: # <<<<<<<<<<<<<< * memmove(pixels, d, self.surface.w * self.surface.format.BytesPerPixel) * d += self.surface.w * self.surface.format.BytesPerPixel */ __pyx_t_5 = __pyx_v_self->surface->h; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "pygame_sdl2/surface.pyx":856 * * for 0 <= i < self.surface.h: * memmove(pixels, d, self.surface.w * self.surface.format.BytesPerPixel) # <<<<<<<<<<<<<< * d += self.surface.w * self.surface.format.BytesPerPixel * pixels += self.surface.pitch */ (void)(memmove(__pyx_v_pixels, __pyx_v_d, (__pyx_v_self->surface->w * __pyx_v_self->surface->format->BytesPerPixel))); /* "pygame_sdl2/surface.pyx":857 * for 0 <= i < self.surface.h: * memmove(pixels, d, self.surface.w * self.surface.format.BytesPerPixel) * d += self.surface.w * self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * pixels += self.surface.pitch * */ __pyx_v_d = (__pyx_v_d + (__pyx_v_self->surface->w * __pyx_v_self->surface->format->BytesPerPixel)); /* "pygame_sdl2/surface.pyx":858 * memmove(pixels, d, self.surface.w * self.surface.format.BytesPerPixel) * d += self.surface.w * self.surface.format.BytesPerPixel * pixels += self.surface.pitch # <<<<<<<<<<<<<< * * cdef api SDL_Surface *PySurface_AsSurface(surface): */ __pyx_v_pixels = (__pyx_v_pixels + __pyx_v_self->surface->pitch); } /* "pygame_sdl2/surface.pyx":846 * return self.surface.pixels * * def from_data(self, data): # <<<<<<<<<<<<<< * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: * raise ValueError("The data must fill the surface.") */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.from_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_101__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_100__reduce_cython__, "Surface.__reduce_cython__(self)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_101__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_101__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_100__reduce_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_101__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_100__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_100__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_103__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_7surface_7Surface_102__setstate_cython__, "Surface.__setstate_cython__(self, __pyx_state)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_7surface_7Surface_103__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_103__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_102__setstate_cython__}; static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_103__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_102__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_102__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":860 * pixels += self.surface.pitch * * cdef api SDL_Surface *PySurface_AsSurface(surface): # <<<<<<<<<<<<<< * return ( surface).surface * */ static SDL_Surface *__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface(PyObject *__pyx_v_surface) { SDL_Surface *__pyx_r; /* "pygame_sdl2/surface.pyx":861 * * cdef api SDL_Surface *PySurface_AsSurface(surface): * return ( surface).surface # <<<<<<<<<<<<<< * * cdef api object PySurface_New(SDL_Surface *surf): */ __pyx_r = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_surface)->surface; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":860 * pixels += self.surface.pitch * * cdef api SDL_Surface *PySurface_AsSurface(surface): # <<<<<<<<<<<<<< * return ( surface).surface * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/surface.pyx":863 * return ( surface).surface * * cdef api object PySurface_New(SDL_Surface *surf): # <<<<<<<<<<<<<< * cdef Surface rv = Surface(()) * rv.take_surface(surf) */ static PyObject *__pyx_f_11pygame_sdl2_7surface_PySurface_New(SDL_Surface *__pyx_v_surf) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PySurface_New", 1); /* "pygame_sdl2/surface.pyx":864 * * cdef api object PySurface_New(SDL_Surface *surf): * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * return rv */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":865 * cdef api object PySurface_New(SDL_Surface *surf): * cdef Surface rv = Surface(()) * rv.take_surface(surf) # <<<<<<<<<<<<<< * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_surf); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 865, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":866 * cdef Surface rv = Surface(()) * rv.take_surface(surf) * return rv # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":863 * return ( surface).surface * * cdef api object PySurface_New(SDL_Surface *surf): # <<<<<<<<<<<<<< * cdef Surface rv = Surface(()) * rv.take_surface(surf) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.PySurface_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface __pyx_vtable_11pygame_sdl2_7surface_Surface; static PyObject *__pyx_tp_new_11pygame_sdl2_7surface_Surface(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_7surface_Surface; p->locklist = Py_None; Py_INCREF(Py_None); p->parent = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); p->root = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); p->get_window_flags = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_11pygame_sdl2_7surface_7Surface_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_7surface_Surface(PyObject *o) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *p = (struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_11pygame_sdl2_7surface_Surface) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); if (p->__weakref__) PyObject_ClearWeakRefs(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_11pygame_sdl2_7surface_7Surface_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->locklist); Py_CLEAR(p->parent); Py_CLEAR(p->root); Py_CLEAR(p->get_window_flags); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_11pygame_sdl2_7surface_Surface(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_7surface_Surface *p = (struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o; if (p->locklist) { e = (*v)(p->locklist, a); if (e) return e; } if (p->parent) { e = (*v)(((PyObject *)p->parent), a); if (e) return e; } if (p->root) { e = (*v)(((PyObject *)p->root), a); if (e) return e; } if (p->get_window_flags) { e = (*v)(p->get_window_flags, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_7surface_Surface(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_7surface_Surface *p = (struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o; tmp = ((PyObject*)p->locklist); p->locklist = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->parent); p->parent = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->root); p->root = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->get_window_flags); p->get_window_flags = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_7surface_7Surface__pixels_address(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_7surface_7Surface_15_pixels_address_1__get__(o); } static PyObject *__pyx_specialmethod___pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__(self); } static PyMethodDef __pyx_methods_11pygame_sdl2_7surface_Surface[] = { {"__sizeof__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_4__sizeof__}, {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__, METH_NOARGS|METH_COEXIST, 0}, {"blit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_10blit}, {"convert", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_12convert}, {"convert_alpha", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_14convert_alpha}, {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_16copy}, {"fill", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_18fill}, {"scroll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_20scroll}, {"set_colorkey", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_22set_colorkey}, {"get_colorkey", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_24get_colorkey}, {"set_alpha", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_26set_alpha}, {"get_alpha", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_28get_alpha}, {"lock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_30lock}, {"unlock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_32unlock}, {"mustlock", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_34mustlock}, {"get_locked", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_36get_locked}, {"get_locks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_38get_locks}, {"get_at", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_40get_at}, {"set_at", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_42set_at}, {"get_at_mapped", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_44get_at_mapped}, {"map_rgb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_46map_rgb}, {"unmap_rgb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_48unmap_rgb}, {"set_clip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_50set_clip}, {"get_clip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_52get_clip}, {"subsurface", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_54subsurface}, {"get_parent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_56get_parent}, {"get_abs_parent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_58get_abs_parent}, {"get_offset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_60get_offset}, {"get_abs_offset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_62get_abs_offset}, {"get_size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_64get_size}, {"get_width", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_66get_width}, {"get_height", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_68get_height}, {"get_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_70get_rect}, {"get_bitsize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_72get_bitsize}, {"get_bytesize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_74get_bytesize}, {"get_flags", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_76get_flags}, {"get_pitch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_78get_pitch}, {"get_masks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_80get_masks}, {"set_masks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_82set_masks}, {"get_shifts", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_84get_shifts}, {"set_shifts", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_86set_shifts}, {"get_shifts", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_88get_shifts}, {"get_losses", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_90get_losses}, {"get_bounding_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_92get_bounding_rect}, {"get_view", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_94get_view}, {"get_buffer", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_96get_buffer}, {"from_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_99from_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_98from_data}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_101__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_100__reduce_cython__}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_7surface_7Surface_103__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7surface_7Surface_102__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_7surface_Surface[] = { {(char *)"_pixels_address", __pyx_getprop_11pygame_sdl2_7surface_7Surface__pixels_address, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_11pygame_sdl2_7surface_Surface_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_11pygame_sdl2_7surface_Surface}, {Py_tp_repr, (void *)__pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__}, {Py_tp_doc, (void *)PyDoc_STR("Surface(size, flags=0, depth=32, masks=None)")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_11pygame_sdl2_7surface_Surface}, {Py_tp_clear, (void *)__pyx_tp_clear_11pygame_sdl2_7surface_Surface}, {Py_tp_methods, (void *)__pyx_methods_11pygame_sdl2_7surface_Surface}, {Py_tp_getset, (void *)__pyx_getsets_11pygame_sdl2_7surface_Surface}, {Py_tp_init, (void *)__pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__}, {Py_tp_new, (void *)__pyx_tp_new_11pygame_sdl2_7surface_Surface}, {0, 0}, }; static PyType_Spec __pyx_type_11pygame_sdl2_7surface_Surface_spec = { "pygame_sdl2.surface.Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_11pygame_sdl2_7surface_Surface_slots, }; #else static PyTypeObject __pyx_type_11pygame_sdl2_7surface_Surface = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.surface.""Surface", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_7surface_Surface, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Surface(size, flags=0, depth=32, masks=None)"), /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_7surface_Surface, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_7surface_Surface, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_7surface_Surface, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_7surface_Surface, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_7surface_Surface, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, {&__pyx_kp_s_A_null_pointer_was_passed_in, __pyx_k_A_null_pointer_was_passed_in, sizeof(__pyx_k_A_null_pointer_was_passed_in), 0, 0, 1, 0}, {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_s_Memory_leak_via_Surface_in_pygam, __pyx_k_Memory_leak_via_Surface_in_pygam, sizeof(__pyx_k_Memory_leak_via_Surface_in_pygam), 0, 0, 1, 0}, {&__pyx_kp_s_Position_outside_surface, __pyx_k_Position_outside_surface, sizeof(__pyx_k_Position_outside_surface), 0, 0, 1, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_SRCALPHA, __pyx_k_SRCALPHA, sizeof(__pyx_k_SRCALPHA), 0, 0, 1, 1}, {&__pyx_n_s_Surface, __pyx_k_Surface, sizeof(__pyx_k_Surface), 0, 0, 1, 1}, {&__pyx_n_s_Surface___reduce_cython, __pyx_k_Surface___reduce_cython, sizeof(__pyx_k_Surface___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Surface___setstate_cython, __pyx_k_Surface___setstate_cython, sizeof(__pyx_k_Surface___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Surface___sizeof, __pyx_k_Surface___sizeof, sizeof(__pyx_k_Surface___sizeof), 0, 0, 1, 1}, {&__pyx_n_s_Surface_blit, __pyx_k_Surface_blit, sizeof(__pyx_k_Surface_blit), 0, 0, 1, 1}, {&__pyx_n_s_Surface_convert, __pyx_k_Surface_convert, sizeof(__pyx_k_Surface_convert), 0, 0, 1, 1}, {&__pyx_n_s_Surface_convert_alpha, __pyx_k_Surface_convert_alpha, sizeof(__pyx_k_Surface_convert_alpha), 0, 0, 1, 1}, {&__pyx_n_s_Surface_copy, __pyx_k_Surface_copy, sizeof(__pyx_k_Surface_copy), 0, 0, 1, 1}, {&__pyx_n_s_Surface_fill, __pyx_k_Surface_fill, sizeof(__pyx_k_Surface_fill), 0, 0, 1, 1}, {&__pyx_n_s_Surface_from_data, __pyx_k_Surface_from_data, sizeof(__pyx_k_Surface_from_data), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_abs_offset, __pyx_k_Surface_get_abs_offset, sizeof(__pyx_k_Surface_get_abs_offset), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_abs_parent, __pyx_k_Surface_get_abs_parent, sizeof(__pyx_k_Surface_get_abs_parent), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_alpha, __pyx_k_Surface_get_alpha, sizeof(__pyx_k_Surface_get_alpha), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_at, __pyx_k_Surface_get_at, sizeof(__pyx_k_Surface_get_at), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_at_mapped, __pyx_k_Surface_get_at_mapped, sizeof(__pyx_k_Surface_get_at_mapped), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_bitsize, __pyx_k_Surface_get_bitsize, sizeof(__pyx_k_Surface_get_bitsize), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_bounding_rect, __pyx_k_Surface_get_bounding_rect, sizeof(__pyx_k_Surface_get_bounding_rect), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_buffer, __pyx_k_Surface_get_buffer, sizeof(__pyx_k_Surface_get_buffer), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_bytesize, __pyx_k_Surface_get_bytesize, sizeof(__pyx_k_Surface_get_bytesize), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_clip, __pyx_k_Surface_get_clip, sizeof(__pyx_k_Surface_get_clip), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_colorkey, __pyx_k_Surface_get_colorkey, sizeof(__pyx_k_Surface_get_colorkey), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_flags, __pyx_k_Surface_get_flags, sizeof(__pyx_k_Surface_get_flags), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_height, __pyx_k_Surface_get_height, sizeof(__pyx_k_Surface_get_height), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_locked, __pyx_k_Surface_get_locked, sizeof(__pyx_k_Surface_get_locked), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_locks, __pyx_k_Surface_get_locks, sizeof(__pyx_k_Surface_get_locks), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_losses, __pyx_k_Surface_get_losses, sizeof(__pyx_k_Surface_get_losses), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_masks, __pyx_k_Surface_get_masks, sizeof(__pyx_k_Surface_get_masks), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_offset, __pyx_k_Surface_get_offset, sizeof(__pyx_k_Surface_get_offset), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_parent, __pyx_k_Surface_get_parent, sizeof(__pyx_k_Surface_get_parent), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_pitch, __pyx_k_Surface_get_pitch, sizeof(__pyx_k_Surface_get_pitch), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_rect, __pyx_k_Surface_get_rect, sizeof(__pyx_k_Surface_get_rect), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_shifts, __pyx_k_Surface_get_shifts, sizeof(__pyx_k_Surface_get_shifts), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_size, __pyx_k_Surface_get_size, sizeof(__pyx_k_Surface_get_size), 0, 0, 1, 1}, {&__pyx_n_s_Surface_get_view, __pyx_k_Surface_get_view, sizeof(__pyx_k_Surface_get_view), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_get_view_is_not_supporte, __pyx_k_Surface_get_view_is_not_supporte, sizeof(__pyx_k_Surface_get_view_is_not_supporte), 0, 0, 1, 0}, {&__pyx_n_s_Surface_get_width, __pyx_k_Surface_get_width, sizeof(__pyx_k_Surface_get_width), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_has_unsupported_bytesize, __pyx_k_Surface_has_unsupported_bytesize, sizeof(__pyx_k_Surface_has_unsupported_bytesize), 0, 0, 1, 0}, {&__pyx_n_s_Surface_lock, __pyx_k_Surface_lock, sizeof(__pyx_k_Surface_lock), 0, 0, 1, 1}, {&__pyx_n_s_Surface_map_rgb, __pyx_k_Surface_map_rgb, sizeof(__pyx_k_Surface_map_rgb), 0, 0, 1, 1}, {&__pyx_n_s_Surface_mustlock, __pyx_k_Surface_mustlock, sizeof(__pyx_k_Surface_mustlock), 0, 0, 1, 1}, {&__pyx_n_s_Surface_scroll, __pyx_k_Surface_scroll, sizeof(__pyx_k_Surface_scroll), 0, 0, 1, 1}, {&__pyx_n_s_Surface_set_alpha, __pyx_k_Surface_set_alpha, sizeof(__pyx_k_Surface_set_alpha), 0, 0, 1, 1}, {&__pyx_n_s_Surface_set_at, __pyx_k_Surface_set_at, sizeof(__pyx_k_Surface_set_at), 0, 0, 1, 1}, {&__pyx_n_s_Surface_set_clip, __pyx_k_Surface_set_clip, sizeof(__pyx_k_Surface_set_clip), 0, 0, 1, 1}, {&__pyx_n_s_Surface_set_colorkey, __pyx_k_Surface_set_colorkey, sizeof(__pyx_k_Surface_set_colorkey), 0, 0, 1, 1}, {&__pyx_n_s_Surface_set_masks, __pyx_k_Surface_set_masks, sizeof(__pyx_k_Surface_set_masks), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_set_masks_is_not_support, __pyx_k_Surface_set_masks_is_not_support, sizeof(__pyx_k_Surface_set_masks_is_not_support), 0, 0, 1, 0}, {&__pyx_n_s_Surface_set_shifts, __pyx_k_Surface_set_shifts, sizeof(__pyx_k_Surface_set_shifts), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_set_shifts_is_not_suppor, __pyx_k_Surface_set_shifts_is_not_suppor, sizeof(__pyx_k_Surface_set_shifts_is_not_suppor), 0, 0, 1, 0}, {&__pyx_n_s_Surface_subsurface, __pyx_k_Surface_subsurface, sizeof(__pyx_k_Surface_subsurface), 0, 0, 1, 1}, {&__pyx_n_s_Surface_unlock, __pyx_k_Surface_unlock, sizeof(__pyx_k_Surface_unlock), 0, 0, 1, 1}, {&__pyx_n_s_Surface_unmap_rgb, __pyx_k_Surface_unmap_rgb, sizeof(__pyx_k_Surface_unmap_rgb), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_x_x, __pyx_k_Surface_x_x, sizeof(__pyx_k_Surface_x_x), 0, 0, 1, 0}, {&__pyx_kp_s_The_data_must_fill_the_surface, __pyx_k_The_data_must_fill_the_surface, sizeof(__pyx_k_The_data_must_fill_the_surface), 0, 0, 1, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, {&__pyx_n_s__89, __pyx_k__89, sizeof(__pyx_k__89), 0, 0, 1, 1}, {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1}, {&__pyx_n_s_amask, __pyx_k_amask, sizeof(__pyx_k_amask), 0, 0, 1, 1}, {&__pyx_n_s_amin, __pyx_k_amin, sizeof(__pyx_k_amin), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_area, __pyx_k_area, sizeof(__pyx_k_area), 0, 0, 1, 1}, {&__pyx_n_s_area_ptr, __pyx_k_area_ptr, sizeof(__pyx_k_area_ptr), 0, 0, 1, 1}, {&__pyx_n_s_area_rect, __pyx_k_area_rect, sizeof(__pyx_k_area_rect), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_blit, __pyx_k_blit, sizeof(__pyx_k_blit), 0, 0, 1, 1}, {&__pyx_n_s_bmask, __pyx_k_bmask, sizeof(__pyx_k_bmask), 0, 0, 1, 1}, {&__pyx_n_s_botright, __pyx_k_botright, sizeof(__pyx_k_botright), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_colorkey, __pyx_k_colorkey, sizeof(__pyx_k_colorkey), 0, 0, 1, 1}, {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, {&__pyx_n_s_convert_alpha, __pyx_k_convert_alpha, sizeof(__pyx_k_convert_alpha), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_dest_rect, __pyx_k_dest_rect, sizeof(__pyx_k_dest_rect), 0, 0, 1, 1}, {&__pyx_n_s_destptr, __pyx_k_destptr, sizeof(__pyx_k_destptr), 0, 0, 1, 1}, {&__pyx_n_s_destx, __pyx_k_destx, sizeof(__pyx_k_destx), 0, 0, 1, 1}, {&__pyx_n_s_desty, __pyx_k_desty, sizeof(__pyx_k_desty), 0, 0, 1, 1}, {&__pyx_n_s_dirty, __pyx_k_dirty, sizeof(__pyx_k_dirty), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1}, {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_from_data, __pyx_k_from_data, sizeof(__pyx_k_from_data), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_abs_offset, __pyx_k_get_abs_offset, sizeof(__pyx_k_get_abs_offset), 0, 0, 1, 1}, {&__pyx_n_s_get_abs_parent, __pyx_k_get_abs_parent, sizeof(__pyx_k_get_abs_parent), 0, 0, 1, 1}, {&__pyx_n_s_get_alpha, __pyx_k_get_alpha, sizeof(__pyx_k_get_alpha), 0, 0, 1, 1}, {&__pyx_n_s_get_at, __pyx_k_get_at, sizeof(__pyx_k_get_at), 0, 0, 1, 1}, {&__pyx_n_s_get_at_mapped, __pyx_k_get_at_mapped, sizeof(__pyx_k_get_at_mapped), 0, 0, 1, 1}, {&__pyx_n_s_get_bitsize, __pyx_k_get_bitsize, sizeof(__pyx_k_get_bitsize), 0, 0, 1, 1}, {&__pyx_n_s_get_bounding_rect, __pyx_k_get_bounding_rect, sizeof(__pyx_k_get_bounding_rect), 0, 0, 1, 1}, {&__pyx_n_s_get_buffer, __pyx_k_get_buffer, sizeof(__pyx_k_get_buffer), 0, 0, 1, 1}, {&__pyx_n_s_get_bytesize, __pyx_k_get_bytesize, sizeof(__pyx_k_get_bytesize), 0, 0, 1, 1}, {&__pyx_n_s_get_clip, __pyx_k_get_clip, sizeof(__pyx_k_get_clip), 0, 0, 1, 1}, {&__pyx_n_s_get_colorkey, __pyx_k_get_colorkey, sizeof(__pyx_k_get_colorkey), 0, 0, 1, 1}, {&__pyx_n_s_get_flags, __pyx_k_get_flags, sizeof(__pyx_k_get_flags), 0, 0, 1, 1}, {&__pyx_n_s_get_height, __pyx_k_get_height, sizeof(__pyx_k_get_height), 0, 0, 1, 1}, {&__pyx_n_s_get_locked, __pyx_k_get_locked, sizeof(__pyx_k_get_locked), 0, 0, 1, 1}, {&__pyx_n_s_get_locks, __pyx_k_get_locks, sizeof(__pyx_k_get_locks), 0, 0, 1, 1}, {&__pyx_n_s_get_losses, __pyx_k_get_losses, sizeof(__pyx_k_get_losses), 0, 0, 1, 1}, {&__pyx_n_s_get_masks, __pyx_k_get_masks, sizeof(__pyx_k_get_masks), 0, 0, 1, 1}, {&__pyx_n_s_get_offset, __pyx_k_get_offset, sizeof(__pyx_k_get_offset), 0, 0, 1, 1}, {&__pyx_n_s_get_parent, __pyx_k_get_parent, sizeof(__pyx_k_get_parent), 0, 0, 1, 1}, {&__pyx_n_s_get_pitch, __pyx_k_get_pitch, sizeof(__pyx_k_get_pitch), 0, 0, 1, 1}, {&__pyx_n_s_get_rect, __pyx_k_get_rect, sizeof(__pyx_k_get_rect), 0, 0, 1, 1}, {&__pyx_n_s_get_shifts, __pyx_k_get_shifts, sizeof(__pyx_k_get_shifts), 0, 0, 1, 1}, {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1}, {&__pyx_n_s_get_surface, __pyx_k_get_surface, sizeof(__pyx_k_get_surface), 0, 0, 1, 1}, {&__pyx_n_s_get_view, __pyx_k_get_view, sizeof(__pyx_k_get_view), 0, 0, 1, 1}, {&__pyx_n_s_get_width, __pyx_k_get_width, sizeof(__pyx_k_get_width), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_gmask, __pyx_k_gmask, sizeof(__pyx_k_gmask), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_map_rgb, __pyx_k_map_rgb, sizeof(__pyx_k_map_rgb), 0, 0, 1, 1}, {&__pyx_n_s_masks, __pyx_k_masks, sizeof(__pyx_k_masks), 0, 0, 1, 1}, {&__pyx_n_s_maxx, __pyx_k_maxx, sizeof(__pyx_k_maxx), 0, 0, 1, 1}, {&__pyx_n_s_maxy, __pyx_k_maxy, sizeof(__pyx_k_maxy), 0, 0, 1, 1}, {&__pyx_n_s_min_alpha, __pyx_k_min_alpha, sizeof(__pyx_k_min_alpha), 0, 0, 1, 1}, {&__pyx_n_s_minx, __pyx_k_minx, sizeof(__pyx_k_minx), 0, 0, 1, 1}, {&__pyx_n_s_miny, __pyx_k_miny, sizeof(__pyx_k_miny), 0, 0, 1, 1}, {&__pyx_n_s_move_height, __pyx_k_move_height, sizeof(__pyx_k_move_height), 0, 0, 1, 1}, {&__pyx_n_s_move_width, __pyx_k_move_width, sizeof(__pyx_k_move_width), 0, 0, 1, 1}, {&__pyx_n_s_mustlock, __pyx_k_mustlock, sizeof(__pyx_k_mustlock), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_new_surface, __pyx_k_new_surface, sizeof(__pyx_k_new_surface), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_offset_x, __pyx_k_offset_x, sizeof(__pyx_k_offset_x), 0, 0, 1, 1}, {&__pyx_n_s_offset_y, __pyx_k_offset_y, sizeof(__pyx_k_offset_y), 0, 0, 1, 1}, {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, {&__pyx_n_s_per_pixel, __pyx_k_per_pixel, sizeof(__pyx_k_per_pixel), 0, 0, 1, 1}, {&__pyx_n_s_pixel, __pyx_k_pixel, sizeof(__pyx_k_pixel), 0, 0, 1, 1}, {&__pyx_n_s_pixel_format, __pyx_k_pixel_format, sizeof(__pyx_k_pixel_format), 0, 0, 1, 1}, {&__pyx_n_s_pixels, __pyx_k_pixels, sizeof(__pyx_k_pixels), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_surface, __pyx_k_pygame_sdl2_surface, sizeof(__pyx_k_pygame_sdl2_surface), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, {&__pyx_n_s_rmask, __pyx_k_rmask, sizeof(__pyx_k_rmask), 0, 0, 1, 1}, {&__pyx_n_s_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 0, 1, 1}, {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_sample_format, __pyx_k_sample_format, sizeof(__pyx_k_sample_format), 0, 0, 1, 1}, {&__pyx_n_s_scroll, __pyx_k_scroll, sizeof(__pyx_k_scroll), 0, 0, 1, 1}, {&__pyx_n_s_sdl_rect, __pyx_k_sdl_rect, sizeof(__pyx_k_sdl_rect), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_alpha, __pyx_k_set_alpha, sizeof(__pyx_k_set_alpha), 0, 0, 1, 1}, {&__pyx_n_s_set_at, __pyx_k_set_at, sizeof(__pyx_k_set_at), 0, 0, 1, 1}, {&__pyx_n_s_set_clip, __pyx_k_set_clip, sizeof(__pyx_k_set_clip), 0, 0, 1, 1}, {&__pyx_n_s_set_colorkey, __pyx_k_set_colorkey, sizeof(__pyx_k_set_colorkey), 0, 0, 1, 1}, {&__pyx_n_s_set_masks, __pyx_k_set_masks, sizeof(__pyx_k_set_masks), 0, 0, 1, 1}, {&__pyx_n_s_set_shifts, __pyx_k_set_shifts, sizeof(__pyx_k_set_shifts), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_shifts, __pyx_k_shifts, sizeof(__pyx_k_shifts), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_sizeof, __pyx_k_sizeof, sizeof(__pyx_k_sizeof), 0, 0, 1, 1}, {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_special_flags, __pyx_k_special_flags, sizeof(__pyx_k_special_flags), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_k_src_pygame_sdl2_surface_pyx, sizeof(__pyx_k_src_pygame_sdl2_surface_pyx), 0, 0, 1, 0}, {&__pyx_n_s_srcptr, __pyx_k_srcptr, sizeof(__pyx_k_srcptr), 0, 0, 1, 1}, {&__pyx_n_s_srcx, __pyx_k_srcx, sizeof(__pyx_k_srcx), 0, 0, 1, 1}, {&__pyx_n_s_srcy, __pyx_k_srcy, sizeof(__pyx_k_srcy), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_subsurface, __pyx_k_subsurface, sizeof(__pyx_k_subsurface), 0, 0, 1, 1}, {&__pyx_kp_s_subsurface_rectangle_outside_sur, __pyx_k_subsurface_rectangle_outside_sur, sizeof(__pyx_k_subsurface_rectangle_outside_sur), 0, 0, 1, 0}, {&__pyx_kp_s_subsurface_size_must_be_non_nega, __pyx_k_subsurface_size_must_be_non_nega, sizeof(__pyx_k_subsurface_size_must_be_non_nega), 0, 0, 1, 0}, {&__pyx_n_s_surf, __pyx_k_surf, sizeof(__pyx_k_surf), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_temp, __pyx_k_temp, sizeof(__pyx_k_temp), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_topleft, __pyx_k_topleft, sizeof(__pyx_k_topleft), 0, 0, 1, 1}, {&__pyx_n_s_total_size, __pyx_k_total_size, sizeof(__pyx_k_total_size), 0, 0, 1, 1}, {&__pyx_n_s_unlock, __pyx_k_unlock, sizeof(__pyx_k_unlock), 0, 0, 1, 1}, {&__pyx_n_s_unmap_rgb, __pyx_k_unmap_rgb, sizeof(__pyx_k_unmap_rgb), 0, 0, 1, 1}, {&__pyx_n_s_use_format, __pyx_k_use_format, sizeof(__pyx_k_use_format), 0, 0, 1, 1}, {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 103, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 538, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 563, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/surface.pyx":289 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/surface.pyx":368 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: * return Rect(0, 0, 0, 0) # <<<<<<<<<<<<<< * * with nogil: */ __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, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/surface.pyx":538 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise IndexError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Position_outside_surface); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/surface.pyx":848 * def from_data(self, data): * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: * raise ValueError("The data must fill the surface.") # <<<<<<<<<<<<<< * * cdef Uint8 *d = data */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_The_data_must_fill_the_surface); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/surface.pyx":78 * warnings.warn("Memory leak via Surface in pygame_sdl2.") * * def __sizeof__(self): # <<<<<<<<<<<<<< * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_sizeof, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 78, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":182 * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * * def blit(self, Surface source, dest, area=None, int special_flags=0): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect */ __pyx_tuple__9 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_source, __pyx_n_s_dest, __pyx_n_s_area, __pyx_n_s_special_flags, __pyx_n_s_dest_rect, __pyx_n_s_area_rect, __pyx_n_s_area_ptr, __pyx_n_s_temp, __pyx_n_s_err, __pyx_n_s_key, __pyx_n_s_alpha, __pyx_n_s_colorkey, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_blit, 182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 182, __pyx_L1_error) __pyx_tuple__11 = PyTuple_Pack(2, Py_None, __pyx_int_0); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "pygame_sdl2/surface.pyx":245 * return dirty.clip(self.get_rect()) * * def convert(self, surface=None): # <<<<<<<<<<<<<< * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() */ __pyx_tuple__12 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_surface, __pyx_n_s_sample_format, __pyx_n_s_amask, __pyx_n_s_rmask, __pyx_n_s_gmask, __pyx_n_s_bmask, __pyx_n_s_pixel_format, __pyx_n_s_new_surface, __pyx_n_s_use_format, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_convert, 245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 245, __pyx_L1_error) __pyx_tuple__14 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "pygame_sdl2/surface.pyx":294 * return rv * * def convert_alpha(self, Surface surface=None): # <<<<<<<<<<<<<< * if surface is None: * surface = pygame_sdl2.display.get_surface() */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_convert_alpha, 294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 294, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":344 * return rv * * def copy(self): # <<<<<<<<<<<<<< * if self.surface.format.Amask: * return self.convert_alpha(self) */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_copy, 344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 344, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":350 * return self.convert(self) * * def fill(self, color, rect=None, special_flags=0): # <<<<<<<<<<<<<< * * cdef SDL_Rect sdl_rect */ __pyx_tuple__17 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_special_flags, __pyx_n_s_sdl_rect, __pyx_n_s_pixel, __pyx_n_s_err); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_fill, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 350, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":388 * * * def scroll(self, int dx=0, int dy=0): # <<<<<<<<<<<<<< * cdef int srcx, destx, move_width * cdef int srcy, desty, move_height */ __pyx_tuple__19 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_srcx, __pyx_n_s_destx, __pyx_n_s_move_width, __pyx_n_s_srcy, __pyx_n_s_desty, __pyx_n_s_move_height, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_per_pixel, __pyx_n_s_srcptr, __pyx_n_s_destptr); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_scroll, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 388, __pyx_L1_error) __pyx_tuple__21 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "pygame_sdl2/surface.pyx":434 * self.unlock() * * def set_colorkey(self, color, flags=0): # <<<<<<<<<<<<<< * * if color is None: */ __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_flags); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_set_colorkey, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 434, __pyx_L1_error) __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "pygame_sdl2/surface.pyx":444 * raise error() * * def get_colorkey(self): # <<<<<<<<<<<<<< * cdef Uint32 key * */ __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_colorkey, 444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 444, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":452 * return get_color(key, self.surface) * * def set_alpha(self, value, flags=0): # <<<<<<<<<<<<<< * if value is None: * value = 255 */ __pyx_tuple__27 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_flags); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_set_alpha, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 452, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":462 * raise error() * * def get_alpha(self): # <<<<<<<<<<<<<< * cdef Uint8 rv * */ __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_alpha, 462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 462, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":475 * return None * * def lock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_tuple__31 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_lock, __pyx_n_s_root); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_lock, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 475, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":492 * raise error() * * def unlock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_unlock, 492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 492, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":508 * SDL_UnlockSurface(root.surface) * * def mustlock(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_root); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_mustlock, 508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 508, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":516 * return SDL_MUSTLOCK(root.surface) * * def get_locked(self): # <<<<<<<<<<<<<< * if self.locklist: * return True */ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_locked, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 516, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":520 * return True * * def get_locks(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_locks, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 520, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":531 * return root.locklist * * def get_at(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ __pyx_tuple__38 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_pos, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_p, __pyx_n_s_pixel); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_at, 531, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 531, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":555 * return get_color(pixel, self.surface) * * def set_at(self, pos, color): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ __pyx_tuple__40 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_pos, __pyx_n_s_color, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_p, __pyx_n_s_pixel); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_set_at, 555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 555, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":580 * self.unlock() * * def get_at_mapped(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_at_mapped, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 580, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":604 * return pixel * * def map_rgb(self, color): # <<<<<<<<<<<<<< * return map_color(self.surface, color) * */ __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_color); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_map_rgb, 604, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 604, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":607 * return map_color(self.surface, color) * * def unmap_rgb(self, pixel): # <<<<<<<<<<<<<< * return get_color(pixel, self.surface) * */ __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pixel); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_unmap_rgb, 607, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 607, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":610 * return get_color(pixel, self.surface) * * def set_clip(self, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ __pyx_tuple__47 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_rect, __pyx_n_s_sdl_rect); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_set_clip, 610, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 610, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":619 * SDL_SetClipRect(self.surface, &sdl_rect) * * def get_clip(self): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_sdl_rect); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_clip, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 619, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":626 * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) * * def subsurface(self, *args): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ __pyx_tuple__51 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_sdl_rect, __pyx_n_s_pixels, __pyx_n_s_new_surface, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_subsurface, 626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 626, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":674 * return rv * * def get_parent(self): # <<<<<<<<<<<<<< * return self.parent * */ __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_parent, 674, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 674, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":677 * return self.parent * * def get_abs_parent(self): # <<<<<<<<<<<<<< * rv = self * */ __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_abs_parent, 677, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 677, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":685 * return rv * * def get_offset(self): # <<<<<<<<<<<<<< * return (self.offset_x, self.offset_y) * */ __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_offset, 685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 685, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":688 * return (self.offset_x, self.offset_y) * * def get_abs_offset(self): # <<<<<<<<<<<<<< * cdef Surface surf = self * */ __pyx_tuple__56 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_surf, __pyx_n_s_offset_x, __pyx_n_s_offset_y); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_abs_offset, 688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 688, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":701 * return (offset_x, offset_y) * * def get_size(self): # <<<<<<<<<<<<<< * return self.surface.w, self.surface.h * */ __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_size, 701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 701, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":704 * return self.surface.w, self.surface.h * * def get_width(self): # <<<<<<<<<<<<<< * return self.surface.w * */ __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_width, 704, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 704, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":707 * return self.surface.w * * def get_height(self): # <<<<<<<<<<<<<< * return self.surface.h * */ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_height, 707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 707, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":710 * return self.surface.h * * def get_rect(self, **kwargs): # <<<<<<<<<<<<<< * rv = Rect((0, 0, self.surface.w, self.surface.h)) * */ __pyx_tuple__61 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_kwargs, __pyx_n_s_rv, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_rect, 710, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 710, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":718 * return rv * * def get_bitsize(self): # <<<<<<<<<<<<<< * return self.surface.format.BitsPerPixel * */ __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_bitsize, 718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 718, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":721 * return self.surface.format.BitsPerPixel * * def get_bytesize(self): # <<<<<<<<<<<<<< * return self.surface.format.BytesPerPixel * */ __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_bytesize, 721, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 721, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":724 * return self.surface.format.BytesPerPixel * * def get_flags(self): # <<<<<<<<<<<<<< * * if self.get_window_flags: */ __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_flags, 724, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 724, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":736 * return rv * * def get_pitch(self): # <<<<<<<<<<<<<< * return self.surface.pitch * */ __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_pitch, 736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 736, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":739 * return self.surface.pitch * * def get_masks(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) */ __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_format); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_masks, 739, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 739, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":743 * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * * def set_masks(self, masks): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_masks is not supported.") * */ __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_masks); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_set_masks, 743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 743, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":746 * warnings.warn("Surface.set_masks is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_shifts, 746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 746, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":750 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def set_shifts(self, shifts): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_shifts is not supported.") * */ __pyx_tuple__72 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_shifts); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_set_shifts, 750, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 750, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":753 * warnings.warn("Surface.set_shifts is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_shifts, 753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 753, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":757 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def get_losses(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) */ __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_losses, 757, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 757, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":761 * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * * def get_bounding_rect(self, min_alpha=1): # <<<<<<<<<<<<<< * * cdef Uint32 amask = self.surface.format.Amask */ __pyx_tuple__76 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_min_alpha, __pyx_n_s_amask, __pyx_n_s_amin, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_minx, __pyx_n_s_maxx, __pyx_n_s_miny, __pyx_n_s_maxy, __pyx_n_s_row, __pyx_n_s_topleft, __pyx_n_s_botright, __pyx_n_s_pixels); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_bounding_rect, 761, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 761, __pyx_L1_error) __pyx_tuple__78 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); /* "pygame_sdl2/surface.pyx":835 * return Rect((x, y, w, h)) * * def get_view(self, kind='2'): # <<<<<<<<<<<<<< * raise error("Surface.get_view is not supported.") * */ __pyx_tuple__79 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_kind); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_view, 835, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 835, __pyx_L1_error) __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_2); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); /* "pygame_sdl2/surface.pyx":838 * raise error("Surface.get_view is not supported.") * * def get_buffer(self): # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] */ __pyx_tuple__82 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pixels); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__82); __Pyx_GIVEREF(__pyx_tuple__82); __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_get_buffer, 838, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 838, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":846 * return self.surface.pixels * * def from_data(self, data): # <<<<<<<<<<<<<< * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: * raise ValueError("The data must fill the surface.") */ __pyx_tuple__84 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_d, __pyx_n_s_pixels, __pyx_n_s_i); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84); __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_surface_pyx, __pyx_n_s_from_data, 846, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 846, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__87 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87); __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16843009 = PyInt_FromLong(16843009L); if (unlikely(!__pyx_int_16843009)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4294967295 = PyInt_FromString((char *)"4294967295", 0, 0); if (unlikely(!__pyx_int_4294967295)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("PySurface_AsSurface", (void (*)(void))__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface, "SDL_Surface *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PySurface_New", (void (*)(void))__pyx_f_11pygame_sdl2_7surface_PySurface_New, "PyObject *(SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_7surface_Surface = &__pyx_vtable_11pygame_sdl2_7surface_Surface; __pyx_vtable_11pygame_sdl2_7surface_Surface.take_surface = (void (*)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *))__pyx_f_11pygame_sdl2_7surface_7Surface_take_surface; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_11pygame_sdl2_7surface_Surface = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11pygame_sdl2_7surface_Surface_spec, NULL); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(0, 53, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11pygame_sdl2_7surface_Surface_spec, __pyx_ptype_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) #else __pyx_ptype_11pygame_sdl2_7surface_Surface = &__pyx_type_11pygame_sdl2_7surface_Surface; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11pygame_sdl2_7surface_Surface->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dictoffset && __pyx_ptype_11pygame_sdl2_7surface_Surface->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_11pygame_sdl2_7surface_Surface->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_vtabptr_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Surface, (PyObject *) __pyx_ptype_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) if (__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_weaklistoffset == 0) __pyx_ptype_11pygame_sdl2_7surface_Surface->tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7surface_Surface, __weakref__); #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.color"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_5color_Color),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_5color_Color) __PYX_ERR(2, 26, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_4rect_Rect),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_4rect_Rect) __PYX_ERR(3, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.color"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "map_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_map_color, "Uint32 (SDL_Surface *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "get_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_get_color, "PyObject *(Uint32, SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_surface(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_surface}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "surface", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initsurface(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initsurface(void) #else __Pyx_PyMODINIT_FUNC PyInit_surface(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_surface(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_surface(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'surface' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("surface", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "surface" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_surface(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__surface) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.surface")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.surface", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/surface.pyx":25 * from pygame_sdl2.color cimport map_color, get_color * from pygame_sdl2.rect cimport to_sdl_rect * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * * from pygame_sdl2.error import error */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Rect)) __PYX_ERR(0, 25, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":27 * from pygame_sdl2.rect import Rect * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.locals import SRCALPHA * import pygame_sdl2 */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error)) __PYX_ERR(0, 27, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":28 * * from pygame_sdl2.error import error * from pygame_sdl2.locals import SRCALPHA # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_SRCALPHA); __Pyx_GIVEREF(__pyx_n_s_SRCALPHA); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SRCALPHA)) __PYX_ERR(0, 28, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":29 * from pygame_sdl2.error import error * from pygame_sdl2.locals import SRCALPHA * import pygame_sdl2 # <<<<<<<<<<<<<< * * import warnings */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pygame_sdl2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":31 * import pygame_sdl2 * * import warnings # <<<<<<<<<<<<<< * * cdef extern from "src/surface.h" nogil: */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":51 * * # The total size of all allocated surfaces * total_size = 0 # <<<<<<<<<<<<<< * * cdef class Surface: */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_size, __pyx_int_0) < 0) __PYX_ERR(0, 51, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":78 * warnings.warn("Memory leak via Surface in pygame_sdl2.") * * def __sizeof__(self): # <<<<<<<<<<<<<< * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_5__sizeof__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface___sizeof, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_sizeof, __pyx_t_3) < 0) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":182 * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * * def blit(self, Surface source, dest, area=None, int special_flags=0): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_11blit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_blit, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__11); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_blit, __pyx_t_3) < 0) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":245 * return dirty.clip(self.get_rect()) * * def convert(self, surface=None): # <<<<<<<<<<<<<< * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_13convert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_convert, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_convert, __pyx_t_3) < 0) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":294 * return rv * * def convert_alpha(self, Surface surface=None): # <<<<<<<<<<<<<< * if surface is None: * surface = pygame_sdl2.display.get_surface() */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_15convert_alpha, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_convert_alpha, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_convert_alpha, __pyx_t_3) < 0) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":344 * return rv * * def copy(self): # <<<<<<<<<<<<<< * if self.surface.format.Amask: * return self.convert_alpha(self) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_17copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_copy, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_copy, __pyx_t_3) < 0) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":350 * return self.convert(self) * * def fill(self, color, rect=None, special_flags=0): # <<<<<<<<<<<<<< * * cdef SDL_Rect sdl_rect */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_19fill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_fill, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__11); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":388 * * * def scroll(self, int dx=0, int dy=0): # <<<<<<<<<<<<<< * cdef int srcx, destx, move_width * cdef int srcy, desty, move_height */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_21scroll, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_scroll, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__21); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_scroll, __pyx_t_3) < 0) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":434 * self.unlock() * * def set_colorkey(self, color, flags=0): # <<<<<<<<<<<<<< * * if color is None: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_23set_colorkey, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_set_colorkey, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_set_colorkey, __pyx_t_3) < 0) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":444 * raise error() * * def get_colorkey(self): # <<<<<<<<<<<<<< * cdef Uint32 key * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_25get_colorkey, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_colorkey, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_colorkey, __pyx_t_3) < 0) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":452 * return get_color(key, self.surface) * * def set_alpha(self, value, flags=0): # <<<<<<<<<<<<<< * if value is None: * value = 255 */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_27set_alpha, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_set_alpha, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_set_alpha, __pyx_t_3) < 0) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":462 * raise error() * * def get_alpha(self): # <<<<<<<<<<<<<< * cdef Uint8 rv * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_29get_alpha, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_alpha, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_alpha, __pyx_t_3) < 0) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":475 * return None * * def lock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_31lock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_lock, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_lock, __pyx_t_3) < 0) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":492 * raise error() * * def unlock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_33unlock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_unlock, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_unlock, __pyx_t_3) < 0) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":508 * SDL_UnlockSurface(root.surface) * * def mustlock(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_35mustlock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_mustlock, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_mustlock, __pyx_t_3) < 0) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":516 * return SDL_MUSTLOCK(root.surface) * * def get_locked(self): # <<<<<<<<<<<<<< * if self.locklist: * return True */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_37get_locked, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_locked, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_locked, __pyx_t_3) < 0) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":520 * return True * * def get_locks(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_39get_locks, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_locks, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_locks, __pyx_t_3) < 0) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":531 * return root.locklist * * def get_at(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_41get_at, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_at, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_at, __pyx_t_3) < 0) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":555 * return get_color(pixel, self.surface) * * def set_at(self, pos, color): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_43set_at, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_set_at, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_set_at, __pyx_t_3) < 0) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":580 * self.unlock() * * def get_at_mapped(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_45get_at_mapped, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_at_mapped, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_at_mapped, __pyx_t_3) < 0) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":604 * return pixel * * def map_rgb(self, color): # <<<<<<<<<<<<<< * return map_color(self.surface, color) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_47map_rgb, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_map_rgb, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_map_rgb, __pyx_t_3) < 0) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":607 * return map_color(self.surface, color) * * def unmap_rgb(self, pixel): # <<<<<<<<<<<<<< * return get_color(pixel, self.surface) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_49unmap_rgb, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_unmap_rgb, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_unmap_rgb, __pyx_t_3) < 0) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":610 * return get_color(pixel, self.surface) * * def set_clip(self, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_51set_clip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_set_clip, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_set_clip, __pyx_t_3) < 0) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":619 * SDL_SetClipRect(self.surface, &sdl_rect) * * def get_clip(self): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_53get_clip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_clip, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_clip, __pyx_t_3) < 0) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":626 * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) * * def subsurface(self, *args): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_55subsurface, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_subsurface, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_subsurface, __pyx_t_3) < 0) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":674 * return rv * * def get_parent(self): # <<<<<<<<<<<<<< * return self.parent * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_57get_parent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_parent, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_parent, __pyx_t_3) < 0) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":677 * return self.parent * * def get_abs_parent(self): # <<<<<<<<<<<<<< * rv = self * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_59get_abs_parent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_abs_parent, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_abs_parent, __pyx_t_3) < 0) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":685 * return rv * * def get_offset(self): # <<<<<<<<<<<<<< * return (self.offset_x, self.offset_y) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_61get_offset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_offset, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_offset, __pyx_t_3) < 0) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":688 * return (self.offset_x, self.offset_y) * * def get_abs_offset(self): # <<<<<<<<<<<<<< * cdef Surface surf = self * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_63get_abs_offset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_abs_offset, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_abs_offset, __pyx_t_3) < 0) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":701 * return (offset_x, offset_y) * * def get_size(self): # <<<<<<<<<<<<<< * return self.surface.w, self.surface.h * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_65get_size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_size, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_size, __pyx_t_3) < 0) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":704 * return self.surface.w, self.surface.h * * def get_width(self): # <<<<<<<<<<<<<< * return self.surface.w * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_67get_width, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_width, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_width, __pyx_t_3) < 0) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":707 * return self.surface.w * * def get_height(self): # <<<<<<<<<<<<<< * return self.surface.h * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_69get_height, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_height, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_height, __pyx_t_3) < 0) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":710 * return self.surface.h * * def get_rect(self, **kwargs): # <<<<<<<<<<<<<< * rv = Rect((0, 0, self.surface.w, self.surface.h)) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_71get_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_rect, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_rect, __pyx_t_3) < 0) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":718 * return rv * * def get_bitsize(self): # <<<<<<<<<<<<<< * return self.surface.format.BitsPerPixel * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_73get_bitsize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_bitsize, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_bitsize, __pyx_t_3) < 0) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":721 * return self.surface.format.BitsPerPixel * * def get_bytesize(self): # <<<<<<<<<<<<<< * return self.surface.format.BytesPerPixel * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_75get_bytesize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_bytesize, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_bytesize, __pyx_t_3) < 0) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":724 * return self.surface.format.BytesPerPixel * * def get_flags(self): # <<<<<<<<<<<<<< * * if self.get_window_flags: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_77get_flags, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_flags, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_flags, __pyx_t_3) < 0) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":736 * return rv * * def get_pitch(self): # <<<<<<<<<<<<<< * return self.surface.pitch * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_79get_pitch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_pitch, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_pitch, __pyx_t_3) < 0) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":739 * return self.surface.pitch * * def get_masks(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_81get_masks, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_masks, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_masks, __pyx_t_3) < 0) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":743 * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * * def set_masks(self, masks): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_masks is not supported.") * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_83set_masks, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_set_masks, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_set_masks, __pyx_t_3) < 0) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":746 * warnings.warn("Surface.set_masks is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_85get_shifts, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_shifts, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_shifts, __pyx_t_3) < 0) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":750 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def set_shifts(self, shifts): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_shifts is not supported.") * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_87set_shifts, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_set_shifts, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_set_shifts, __pyx_t_3) < 0) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":753 * warnings.warn("Surface.set_shifts is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_89get_shifts, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_shifts, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_shifts, __pyx_t_3) < 0) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":757 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def get_losses(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_91get_losses, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_losses, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_losses, __pyx_t_3) < 0) __PYX_ERR(0, 757, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":761 * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * * def get_bounding_rect(self, min_alpha=1): # <<<<<<<<<<<<<< * * cdef Uint32 amask = self.surface.format.Amask */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_93get_bounding_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_bounding_rect, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__78); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_bounding_rect, __pyx_t_3) < 0) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":835 * return Rect((x, y, w, h)) * * def get_view(self, kind='2'): # <<<<<<<<<<<<<< * raise error("Surface.get_view is not supported.") * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_95get_view, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_view, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__81); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_view, __pyx_t_3) < 0) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":838 * raise error("Surface.get_view is not supported.") * * def get_buffer(self): # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_97get_buffer, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_get_buffer, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_get_buffer, __pyx_t_3) < 0) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "pygame_sdl2/surface.pyx":846 * return self.surface.pixels * * def from_data(self, data): # <<<<<<<<<<<<<< * if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: * raise ValueError("The data must fill the surface.") */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_99from_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface_from_data, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface, __pyx_n_s_from_data, __pyx_t_3) < 0) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_11pygame_sdl2_7surface_Surface); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_101__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface___reduce_cython, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7surface_7Surface_103__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Surface___setstate_cython, NULL, __pyx_n_s_pygame_sdl2_surface, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Copyright 2014 Tom Rothamel * # */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.surface", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.surface"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); else state = (PyGILState_STATE)0; #endif CYTHON_UNUSED_VAR(clineno); CYTHON_UNUSED_VAR(lineno); CYTHON_UNUSED_VAR(filename); CYTHON_MAYBE_UNUSED_VAR(nogil); __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(0); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } *pvalue1 = value1; *pvalue2 = value2; return 0; #if CYTHON_COMPILING_IN_PYPY bad: Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; #endif } static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = __Pyx_PyObject_GetIterNextFunc(iter); value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { #if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; #elif PY_MAJOR_VERSION >= 3 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { const char *name = PyUnicode_AsUTF8(method_name); if (strcmp(name, "iteritems") == 0) pp = &py_items; else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; else if (strcmp(name, "itervalues") == 0) pp = &py_values; if (pp) { if (!*pp) { *pp = PyUnicode_FromString(name + 4); if (!*pp) return NULL; } method_name = *pp; } } #endif } *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { const long a = intval; long b = PyInt_AS_LONG(op2); #ifdef HAVE_LONG_LONG if (sizeof(PY_LONG_LONG) > sizeof(long)) { PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; return (result >= LONG_MIN && result <= LONG_MAX) ? PyInt_FromLong((long)result) : PyLong_FromLongLong(result); } #endif #if CYTHON_USE_TYPE_SLOTS return PyInt_Type.tp_as_number->nb_multiply(op1, op2); #else return PyNumber_Multiply(op1, op2); #endif } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op2))) { const long a = intval; long b, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG lla = intval; PY_LONG_LONG llb, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op2))) { return __Pyx_NewRef(op2); } if (likely(__Pyx_PyLong_IsCompact(op2))) { b = __Pyx_PyLong_CompactValue(op2); } else { const digit* digits = __Pyx_PyLong_Digits(op2); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } } CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); #ifdef HAVE_LONG_LONG llb = b; goto long_long; #else return PyLong_Type.tp_as_number->nb_multiply(op1, op2); #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla * llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op2)) { const long a = intval; #if CYTHON_COMPILING_IN_LIMITED_API double b = __pyx_PyFloat_AsDouble(op2); #else double b = PyFloat_AS_DOUBLE(op2); #endif double result; PyFPE_START_PROTECT("multiply", return NULL) result = ((double)a) * (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #endif /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetVTable */ static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { PyObject *ob = PyCapsule_New(vtable, 0, 0); if (unlikely(!ob)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* MergeVTables */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type) { int i; void** base_vtables; __Pyx_TypeName tp_base_name; __Pyx_TypeName base_name; void* unknown = (void*)-1; PyObject* bases = type->tp_bases; int base_depth = 0; { PyTypeObject* base = type->tp_base; while (base) { base_depth += 1; base = base->tp_base; } } base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); if (base_vtable != NULL) { int j; PyTypeObject* base = type->tp_base; for (j = 0; j < base_depth; j++) { if (base_vtables[j] == unknown) { base_vtables[j] = __Pyx_GetVtable(base); base_vtables[j + 1] = unknown; } if (base_vtables[j] == base_vtable) { break; } else if (base_vtables[j] == NULL) { goto bad; } base = base->tp_base; } } } PyErr_Clear(); free(base_vtables); return 0; bad: tp_base_name = __Pyx_PyType_GetName(type->tp_base); base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); free(base_vtables); return -1; } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_12 #define __PYX_HAVE_RT_ImportType_3_0_12 static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__5); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__6; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint32_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint32_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = v; } v = NULL; val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint32_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint32_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint8_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT)) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT)) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT)) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint8_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } } #endif if ((sizeof(uint8_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint8_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint8_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint8_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint8_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint8_t) -1; } else { stepval = v; } v = NULL; val = (uint8_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint8_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint8_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint8_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint8_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint8_t) 1) << (sizeof(uint8_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint8_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint64_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__89); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; cobj = PyCapsule_New(tmp.p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12 #define __PYX_HAVE_RT_ImportFunction_3_0_12 static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635909.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.surface_api.h0000664000175000017500000000434615026112605021364 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef __PYX_HAVE_API__pygame_sdl2__surface #define __PYX_HAVE_API__pygame_sdl2__surface #ifdef __MINGW64__ #define MS_WIN64 #endif #include "Python.h" static SDL_Surface *(*__pyx_api_f_11pygame_sdl2_7surface_PySurface_AsSurface)(PyObject *) = 0; #define PySurface_AsSurface __pyx_api_f_11pygame_sdl2_7surface_PySurface_AsSurface static PyObject *(*__pyx_api_f_11pygame_sdl2_7surface_PySurface_New)(SDL_Surface *) = 0; #define PySurface_New __pyx_api_f_11pygame_sdl2_7surface_PySurface_New #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12 #define __PYX_HAVE_RT_ImportFunction_3_0_12 static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int import_pygame_sdl2__surface(void) { PyObject *module = 0; module = PyImport_ImportModule("pygame_sdl2.surface"); if (!module) goto bad; if (__Pyx_ImportFunction_3_0_12(module, "PySurface_AsSurface", (void (**)(void))&__pyx_api_f_11pygame_sdl2_7surface_PySurface_AsSurface, "SDL_Surface *(PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction_3_0_12(module, "PySurface_New", (void (**)(void))&__pyx_api_f_11pygame_sdl2_7surface_PySurface_New, "PyObject *(SDL_Surface *)") < 0) goto bad; Py_DECREF(module); module = 0; return 0; bad: Py_XDECREF(module); return -1; } #endif /* !__PYX_HAVE_API__pygame_sdl2__surface */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1750635912.0 pygame_sdl2-2.1.0+renpy8.4.1/gen3/pygame_sdl2.transform.c0000664000175000017500000147435215026112610021116 0ustar00tomtom/* Generated by Cython 3.0.12 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__transform #define __PYX_HAVE_API__pygame_sdl2__transform /* Early includes */ #include #include #include #include #include "SDL.h" #include "SDL2_rotozoom.h" #include "SDL_gfxPrimitives.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/pygame_sdl2/transform.pyx", "src/pygame_sdl2/surface.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 #define __PYX_HAVE_RT_ImportType_proto_3_0_12 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_12 { __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "sdl2" */ /* Module declarations from "sdl2_gfx" */ /* Module declarations from "pygame_sdl2.surface" */ /* Module declarations from "pygame_sdl2.transform" */ static uint32_t __pyx_f_11pygame_sdl2_9transform_get_at(SDL_Surface *, int, int); /*proto*/ static void __pyx_f_11pygame_sdl2_9transform_set_at(SDL_Surface *, int, int, uint32_t); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pygame_sdl2.transform" extern int __pyx_module_is_main_pygame_sdl2__transform; int __pyx_module_is_main_pygame_sdl2__transform = 0; /* Implementation of "pygame_sdl2.transform" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_range; /* #### Code section: string_decls ### */ static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k_c[] = "c"; static const char __pyx_k_d[] = "d"; static const char __pyx_k_e[] = "e"; static const char __pyx_k_f[] = "f"; static const char __pyx_k_g[] = "g"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k__2[] = "."; static const char __pyx_k_e0[] = "e0"; static const char __pyx_k_e1[] = "e1"; static const char __pyx_k_e2[] = "e2"; static const char __pyx_k_e3[] = "e3"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k__16[] = "?"; static const char __pyx_k_err[] = "err"; static const char __pyx_k_src[] = "src"; static const char __pyx_k_dest[] = "dest"; static const char __pyx_k_flip[] = "flip"; static const char __pyx_k_lock[] = "lock"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_angle[] = "angle"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_rsurf[] = "rsurf"; static const char __pyx_k_scale[] = "scale"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_xbool[] = "xbool"; static const char __pyx_k_ybool[] = "ybool"; static const char __pyx_k_height[] = "height"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_rotate[] = "rotate"; static const char __pyx_k_smooth[] = "smooth"; static const char __pyx_k_unlock[] = "unlock"; static const char __pyx_k_scale2x[] = "scale2x"; static const char __pyx_k_scale_x[] = "scale_x"; static const char __pyx_k_scale_y[] = "scale_y"; static const char __pyx_k_src_end[] = "src_end"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_get_size[] = "get_size"; static const char __pyx_k_rotozoom[] = "rotozoom"; static const char __pyx_k_surf_out[] = "surf_out"; static const char __pyx_k_get_flags[] = "get_flags"; static const char __pyx_k_get_width[] = "get_width"; static const char __pyx_k_src_pixel[] = "src_pixel"; static const char __pyx_k_dest_delta[] = "dest_delta"; static const char __pyx_k_dest_pixel[] = "dest_pixel"; static const char __pyx_k_get_height[] = "get_height"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_DestSurface[] = "DestSurface"; static const char __pyx_k_smoothscale[] = "smoothscale"; static const char __pyx_k_get_bytesize[] = "get_bytesize"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pygame_sdl2_transform[] = "pygame_sdl2.transform"; static const char __pyx_k_src_pygame_sdl2_transform_pyx[] = "src/pygame_sdl2/transform.pyx"; static const char __pyx_k_Surface_has_unsupported_bytesize[] = "Surface has unsupported bytesize."; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_flip(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, int __pyx_v_xbool, int __pyx_v_ybool); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_2scale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_4rotate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_angle); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_6rotozoom(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, double __pyx_v_angle, double __pyx_v_scale, int __pyx_v_smooth); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_8scale2x(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_10smoothscale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface; #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_n_s_DestSurface; PyObject *__pyx_kp_s_Surface_has_unsupported_bytesize; PyObject *__pyx_n_s__16; PyObject *__pyx_kp_u__2; PyObject *__pyx_n_s_a; PyObject *__pyx_n_s_angle; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_b; PyObject *__pyx_n_s_c; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_d; PyObject *__pyx_n_s_dest; PyObject *__pyx_n_s_dest_delta; PyObject *__pyx_n_s_dest_pixel; PyObject *__pyx_n_s_e; PyObject *__pyx_n_s_e0; PyObject *__pyx_n_s_e1; PyObject *__pyx_n_s_e2; PyObject *__pyx_n_s_e3; PyObject *__pyx_n_s_err; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_f; PyObject *__pyx_n_s_flip; PyObject *__pyx_n_s_g; PyObject *__pyx_n_s_get_bytesize; PyObject *__pyx_n_s_get_flags; PyObject *__pyx_n_s_get_height; PyObject *__pyx_n_s_get_size; PyObject *__pyx_n_s_get_width; PyObject *__pyx_n_s_h; PyObject *__pyx_n_s_height; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_lock; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_pygame_sdl2_error; PyObject *__pyx_n_s_pygame_sdl2_transform; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_range; PyObject *__pyx_n_s_rotate; PyObject *__pyx_n_s_rotozoom; PyObject *__pyx_n_s_rsurf; PyObject *__pyx_n_s_rv; PyObject *__pyx_n_s_scale; PyObject *__pyx_n_s_scale2x; PyObject *__pyx_n_s_scale_x; PyObject *__pyx_n_s_scale_y; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_smooth; PyObject *__pyx_n_s_smoothscale; PyObject *__pyx_n_s_src; PyObject *__pyx_n_s_src_end; PyObject *__pyx_n_s_src_pixel; PyObject *__pyx_kp_s_src_pygame_sdl2_transform_pyx; PyObject *__pyx_n_s_surf_out; PyObject *__pyx_n_s_surface; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_unlock; PyObject *__pyx_n_s_width; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_xbool; PyObject *__pyx_n_s_y; PyObject *__pyx_n_s_ybool; PyObject *__pyx_float_1_0; PyObject *__pyx_int_0; PyObject *__pyx_int_2; PyObject *__pyx_int_4; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_CLEAR(clear_module_state->__pyx_n_s_DestSurface); Py_CLEAR(clear_module_state->__pyx_kp_s_Surface_has_unsupported_bytesize); Py_CLEAR(clear_module_state->__pyx_n_s__16); Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_s_angle); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_b); Py_CLEAR(clear_module_state->__pyx_n_s_c); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_d); Py_CLEAR(clear_module_state->__pyx_n_s_dest); Py_CLEAR(clear_module_state->__pyx_n_s_dest_delta); Py_CLEAR(clear_module_state->__pyx_n_s_dest_pixel); Py_CLEAR(clear_module_state->__pyx_n_s_e); Py_CLEAR(clear_module_state->__pyx_n_s_e0); Py_CLEAR(clear_module_state->__pyx_n_s_e1); Py_CLEAR(clear_module_state->__pyx_n_s_e2); Py_CLEAR(clear_module_state->__pyx_n_s_e3); Py_CLEAR(clear_module_state->__pyx_n_s_err); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_f); Py_CLEAR(clear_module_state->__pyx_n_s_flip); Py_CLEAR(clear_module_state->__pyx_n_s_g); Py_CLEAR(clear_module_state->__pyx_n_s_get_bytesize); Py_CLEAR(clear_module_state->__pyx_n_s_get_flags); Py_CLEAR(clear_module_state->__pyx_n_s_get_height); Py_CLEAR(clear_module_state->__pyx_n_s_get_size); Py_CLEAR(clear_module_state->__pyx_n_s_get_width); Py_CLEAR(clear_module_state->__pyx_n_s_h); Py_CLEAR(clear_module_state->__pyx_n_s_height); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_lock); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_error); Py_CLEAR(clear_module_state->__pyx_n_s_pygame_sdl2_transform); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_s_rotate); Py_CLEAR(clear_module_state->__pyx_n_s_rotozoom); Py_CLEAR(clear_module_state->__pyx_n_s_rsurf); Py_CLEAR(clear_module_state->__pyx_n_s_rv); Py_CLEAR(clear_module_state->__pyx_n_s_scale); Py_CLEAR(clear_module_state->__pyx_n_s_scale2x); Py_CLEAR(clear_module_state->__pyx_n_s_scale_x); Py_CLEAR(clear_module_state->__pyx_n_s_scale_y); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_smooth); Py_CLEAR(clear_module_state->__pyx_n_s_smoothscale); Py_CLEAR(clear_module_state->__pyx_n_s_src); Py_CLEAR(clear_module_state->__pyx_n_s_src_end); Py_CLEAR(clear_module_state->__pyx_n_s_src_pixel); Py_CLEAR(clear_module_state->__pyx_kp_s_src_pygame_sdl2_transform_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_surf_out); Py_CLEAR(clear_module_state->__pyx_n_s_surface); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_unlock); Py_CLEAR(clear_module_state->__pyx_n_s_width); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_xbool); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_n_s_ybool); Py_CLEAR(clear_module_state->__pyx_float_1_0); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_4); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_11pygame_sdl2_7surface_Surface); Py_VISIT(traverse_module_state->__pyx_n_s_DestSurface); Py_VISIT(traverse_module_state->__pyx_kp_s_Surface_has_unsupported_bytesize); Py_VISIT(traverse_module_state->__pyx_n_s__16); Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_s_angle); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_b); Py_VISIT(traverse_module_state->__pyx_n_s_c); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_d); Py_VISIT(traverse_module_state->__pyx_n_s_dest); Py_VISIT(traverse_module_state->__pyx_n_s_dest_delta); Py_VISIT(traverse_module_state->__pyx_n_s_dest_pixel); Py_VISIT(traverse_module_state->__pyx_n_s_e); Py_VISIT(traverse_module_state->__pyx_n_s_e0); Py_VISIT(traverse_module_state->__pyx_n_s_e1); Py_VISIT(traverse_module_state->__pyx_n_s_e2); Py_VISIT(traverse_module_state->__pyx_n_s_e3); Py_VISIT(traverse_module_state->__pyx_n_s_err); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_f); Py_VISIT(traverse_module_state->__pyx_n_s_flip); Py_VISIT(traverse_module_state->__pyx_n_s_g); Py_VISIT(traverse_module_state->__pyx_n_s_get_bytesize); Py_VISIT(traverse_module_state->__pyx_n_s_get_flags); Py_VISIT(traverse_module_state->__pyx_n_s_get_height); Py_VISIT(traverse_module_state->__pyx_n_s_get_size); Py_VISIT(traverse_module_state->__pyx_n_s_get_width); Py_VISIT(traverse_module_state->__pyx_n_s_h); Py_VISIT(traverse_module_state->__pyx_n_s_height); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_lock); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_error); Py_VISIT(traverse_module_state->__pyx_n_s_pygame_sdl2_transform); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_s_rotate); Py_VISIT(traverse_module_state->__pyx_n_s_rotozoom); Py_VISIT(traverse_module_state->__pyx_n_s_rsurf); Py_VISIT(traverse_module_state->__pyx_n_s_rv); Py_VISIT(traverse_module_state->__pyx_n_s_scale); Py_VISIT(traverse_module_state->__pyx_n_s_scale2x); Py_VISIT(traverse_module_state->__pyx_n_s_scale_x); Py_VISIT(traverse_module_state->__pyx_n_s_scale_y); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_smooth); Py_VISIT(traverse_module_state->__pyx_n_s_smoothscale); Py_VISIT(traverse_module_state->__pyx_n_s_src); Py_VISIT(traverse_module_state->__pyx_n_s_src_end); Py_VISIT(traverse_module_state->__pyx_n_s_src_pixel); Py_VISIT(traverse_module_state->__pyx_kp_s_src_pygame_sdl2_transform_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_surf_out); Py_VISIT(traverse_module_state->__pyx_n_s_surface); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_unlock); Py_VISIT(traverse_module_state->__pyx_n_s_width); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_xbool); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_n_s_ybool); Py_VISIT(traverse_module_state->__pyx_float_1_0); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_4); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_11pygame_sdl2_7surface_Surface __pyx_mstate_global->__pyx_ptype_11pygame_sdl2_7surface_Surface #if CYTHON_USE_MODULE_STATE #endif #define __pyx_n_s_DestSurface __pyx_mstate_global->__pyx_n_s_DestSurface #define __pyx_kp_s_Surface_has_unsupported_bytesize __pyx_mstate_global->__pyx_kp_s_Surface_has_unsupported_bytesize #define __pyx_n_s__16 __pyx_mstate_global->__pyx_n_s__16 #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_n_s_angle __pyx_mstate_global->__pyx_n_s_angle #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d #define __pyx_n_s_dest __pyx_mstate_global->__pyx_n_s_dest #define __pyx_n_s_dest_delta __pyx_mstate_global->__pyx_n_s_dest_delta #define __pyx_n_s_dest_pixel __pyx_mstate_global->__pyx_n_s_dest_pixel #define __pyx_n_s_e __pyx_mstate_global->__pyx_n_s_e #define __pyx_n_s_e0 __pyx_mstate_global->__pyx_n_s_e0 #define __pyx_n_s_e1 __pyx_mstate_global->__pyx_n_s_e1 #define __pyx_n_s_e2 __pyx_mstate_global->__pyx_n_s_e2 #define __pyx_n_s_e3 __pyx_mstate_global->__pyx_n_s_e3 #define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_f __pyx_mstate_global->__pyx_n_s_f #define __pyx_n_s_flip __pyx_mstate_global->__pyx_n_s_flip #define __pyx_n_s_g __pyx_mstate_global->__pyx_n_s_g #define __pyx_n_s_get_bytesize __pyx_mstate_global->__pyx_n_s_get_bytesize #define __pyx_n_s_get_flags __pyx_mstate_global->__pyx_n_s_get_flags #define __pyx_n_s_get_height __pyx_mstate_global->__pyx_n_s_get_height #define __pyx_n_s_get_size __pyx_mstate_global->__pyx_n_s_get_size #define __pyx_n_s_get_width __pyx_mstate_global->__pyx_n_s_get_width #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h #define __pyx_n_s_height __pyx_mstate_global->__pyx_n_s_height #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_lock __pyx_mstate_global->__pyx_n_s_lock #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_pygame_sdl2_error __pyx_mstate_global->__pyx_n_s_pygame_sdl2_error #define __pyx_n_s_pygame_sdl2_transform __pyx_mstate_global->__pyx_n_s_pygame_sdl2_transform #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_n_s_rotate __pyx_mstate_global->__pyx_n_s_rotate #define __pyx_n_s_rotozoom __pyx_mstate_global->__pyx_n_s_rotozoom #define __pyx_n_s_rsurf __pyx_mstate_global->__pyx_n_s_rsurf #define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv #define __pyx_n_s_scale __pyx_mstate_global->__pyx_n_s_scale #define __pyx_n_s_scale2x __pyx_mstate_global->__pyx_n_s_scale2x #define __pyx_n_s_scale_x __pyx_mstate_global->__pyx_n_s_scale_x #define __pyx_n_s_scale_y __pyx_mstate_global->__pyx_n_s_scale_y #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_smooth __pyx_mstate_global->__pyx_n_s_smooth #define __pyx_n_s_smoothscale __pyx_mstate_global->__pyx_n_s_smoothscale #define __pyx_n_s_src __pyx_mstate_global->__pyx_n_s_src #define __pyx_n_s_src_end __pyx_mstate_global->__pyx_n_s_src_end #define __pyx_n_s_src_pixel __pyx_mstate_global->__pyx_n_s_src_pixel #define __pyx_kp_s_src_pygame_sdl2_transform_pyx __pyx_mstate_global->__pyx_kp_s_src_pygame_sdl2_transform_pyx #define __pyx_n_s_surf_out __pyx_mstate_global->__pyx_n_s_surf_out #define __pyx_n_s_surface __pyx_mstate_global->__pyx_n_s_surface #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_unlock __pyx_mstate_global->__pyx_n_s_unlock #define __pyx_n_s_width __pyx_mstate_global->__pyx_n_s_width #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_xbool __pyx_mstate_global->__pyx_n_s_xbool #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_n_s_ybool __pyx_mstate_global->__pyx_n_s_ybool #define __pyx_float_1_0 __pyx_mstate_global->__pyx_float_1_0 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 /* #### Code section: module_code ### */ /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_1flip(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_9transform_flip, "flip(Surface surface, bool xbool, bool ybool)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_1flip = {"flip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_9transform_1flip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_9transform_flip}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_1flip(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; int __pyx_v_xbool; int __pyx_v_ybool; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flip (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_xbool,&__pyx_n_s_ybool,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xbool)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, 1); __PYX_ERR(0, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ybool)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, 2); __PYX_ERR(0, 26, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "flip") < 0)) __PYX_ERR(0, 26, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_xbool = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_xbool == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) __pyx_v_ybool = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_ybool == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 26, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.transform.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 26, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_9transform_flip(__pyx_self, __pyx_v_surface, __pyx_v_xbool, __pyx_v_ybool); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_flip(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, int __pyx_v_xbool, int __pyx_v_ybool) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; SDL_Surface *__pyx_v_src; SDL_Surface *__pyx_v_dest; Uint32 *__pyx_v_src_pixel; Uint32 *__pyx_v_src_end; Uint32 *__pyx_v_dest_pixel; int __pyx_v_dest_delta; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; PyObject *__pyx_t_5 = NULL; SDL_Surface *__pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flip", 1); /* "pygame_sdl2/transform.pyx":28 * def flip(Surface surface, bint xbool, bint ybool): * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) # <<<<<<<<<<<<<< * cdef SDL_Surface *src = surface.surface * cdef SDL_Surface *dest = rv.surface */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_surface); __Pyx_GIVEREF((PyObject *)__pyx_v_surface); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_surface))) __PYX_ERR(0, 28, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":29 * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) * cdef SDL_Surface *src = surface.surface # <<<<<<<<<<<<<< * cdef SDL_Surface *dest = rv.surface * */ __pyx_t_6 = __pyx_v_surface->surface; __pyx_v_src = __pyx_t_6; /* "pygame_sdl2/transform.pyx":30 * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) * cdef SDL_Surface *src = surface.surface * cdef SDL_Surface *dest = rv.surface # <<<<<<<<<<<<<< * * cdef Uint32 *src_pixel */ __pyx_t_6 = __pyx_v_rv->surface; __pyx_v_dest = __pyx_t_6; /* "pygame_sdl2/transform.pyx":40 * cdef int y * * with nogil: # <<<<<<<<<<<<<< * for 0 <= y < src.h: * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":41 * * with nogil: * for 0 <= y < src.h: # <<<<<<<<<<<<<< * * src_pixel = (( src.pixels) + y * src.pitch) */ __pyx_t_7 = __pyx_v_src->h; for (__pyx_v_y = 0; __pyx_v_y < __pyx_t_7; __pyx_v_y++) { /* "pygame_sdl2/transform.pyx":43 * for 0 <= y < src.h: * * src_pixel = (( src.pixels) + y * src.pitch) # <<<<<<<<<<<<<< * src_end = src_pixel + src.w * */ __pyx_v_src_pixel = ((Uint32 *)(((Uint8 *)__pyx_v_src->pixels) + (__pyx_v_y * __pyx_v_src->pitch))); /* "pygame_sdl2/transform.pyx":44 * * src_pixel = (( src.pixels) + y * src.pitch) * src_end = src_pixel + src.w # <<<<<<<<<<<<<< * * if ybool: */ __pyx_v_src_end = (__pyx_v_src_pixel + __pyx_v_src->w); /* "pygame_sdl2/transform.pyx":46 * src_end = src_pixel + src.w * * if ybool: # <<<<<<<<<<<<<< * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) * else: */ if (__pyx_v_ybool) { /* "pygame_sdl2/transform.pyx":47 * * if ybool: * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) # <<<<<<<<<<<<<< * else: * dest_pixel = (( dest.pixels) + y * dest.pitch) */ __pyx_v_dest_pixel = ((Uint32 *)(((Uint8 *)__pyx_v_dest->pixels) + (((__pyx_v_dest->h - __pyx_v_y) - 1) * __pyx_v_dest->pitch))); /* "pygame_sdl2/transform.pyx":46 * src_end = src_pixel + src.w * * if ybool: # <<<<<<<<<<<<<< * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) * else: */ goto __pyx_L8; } /* "pygame_sdl2/transform.pyx":49 * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) * else: * dest_pixel = (( dest.pixels) + y * dest.pitch) # <<<<<<<<<<<<<< * * if xbool: */ /*else*/ { __pyx_v_dest_pixel = ((Uint32 *)(((Uint8 *)__pyx_v_dest->pixels) + (__pyx_v_y * __pyx_v_dest->pitch))); } __pyx_L8:; /* "pygame_sdl2/transform.pyx":51 * dest_pixel = (( dest.pixels) + y * dest.pitch) * * if xbool: # <<<<<<<<<<<<<< * dest_pixel += (src.w - 1) * dest_delta = -1 */ if (__pyx_v_xbool) { /* "pygame_sdl2/transform.pyx":52 * * if xbool: * dest_pixel += (src.w - 1) # <<<<<<<<<<<<<< * dest_delta = -1 * else: */ __pyx_v_dest_pixel = (__pyx_v_dest_pixel + (__pyx_v_src->w - 1)); /* "pygame_sdl2/transform.pyx":53 * if xbool: * dest_pixel += (src.w - 1) * dest_delta = -1 # <<<<<<<<<<<<<< * else: * dest_delta = 1 */ __pyx_v_dest_delta = -1; /* "pygame_sdl2/transform.pyx":51 * dest_pixel = (( dest.pixels) + y * dest.pitch) * * if xbool: # <<<<<<<<<<<<<< * dest_pixel += (src.w - 1) * dest_delta = -1 */ goto __pyx_L9; } /* "pygame_sdl2/transform.pyx":55 * dest_delta = -1 * else: * dest_delta = 1 # <<<<<<<<<<<<<< * * while src_pixel < src_end: */ /*else*/ { __pyx_v_dest_delta = 1; } __pyx_L9:; /* "pygame_sdl2/transform.pyx":57 * dest_delta = 1 * * while src_pixel < src_end: # <<<<<<<<<<<<<< * dest_pixel[0] = src_pixel[0] * src_pixel += 1 */ while (1) { __pyx_t_8 = (__pyx_v_src_pixel < __pyx_v_src_end); if (!__pyx_t_8) break; /* "pygame_sdl2/transform.pyx":58 * * while src_pixel < src_end: * dest_pixel[0] = src_pixel[0] # <<<<<<<<<<<<<< * src_pixel += 1 * dest_pixel += dest_delta */ (__pyx_v_dest_pixel[0]) = (__pyx_v_src_pixel[0]); /* "pygame_sdl2/transform.pyx":59 * while src_pixel < src_end: * dest_pixel[0] = src_pixel[0] * src_pixel += 1 # <<<<<<<<<<<<<< * dest_pixel += dest_delta * */ __pyx_v_src_pixel = (__pyx_v_src_pixel + 1); /* "pygame_sdl2/transform.pyx":60 * dest_pixel[0] = src_pixel[0] * src_pixel += 1 * dest_pixel += dest_delta # <<<<<<<<<<<<<< * * return rv */ __pyx_v_dest_pixel = (__pyx_v_dest_pixel + __pyx_v_dest_delta); } } } /* "pygame_sdl2/transform.pyx":40 * cdef int y * * with nogil: # <<<<<<<<<<<<<< * for 0 <= y < src.h: * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/transform.pyx":62 * dest_pixel += dest_delta * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.transform.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_3scale(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_9transform_2scale, "scale(Surface surface, size, Surface DestSurface=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_3scale = {"scale", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_9transform_3scale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_9transform_2scale}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_3scale(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_size = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scale (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_size,&__pyx_n_s_DestSurface,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("scale", 0, 2, 3, 1); __PYX_ERR(0, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_DestSurface); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scale") < 0)) __PYX_ERR(0, 65, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_size = values[1]; __pyx_v_DestSurface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scale", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 65, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.transform.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 65, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_DestSurface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "DestSurface", 0))) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_9transform_2scale(__pyx_self, __pyx_v_surface, __pyx_v_size, __pyx_v_DestSurface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_2scale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf_out = 0; int __pyx_v_err; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scale", 1); /* "pygame_sdl2/transform.pyx":67 * def scale(Surface surface, size, Surface DestSurface=None): * cdef Surface surf_out * cdef int err = -1 # <<<<<<<<<<<<<< * * if DestSurface == None: */ __pyx_v_err = -1; /* "pygame_sdl2/transform.pyx":69 * cdef int err = -1 * * if DestSurface == None: # <<<<<<<<<<<<<< * surf_out = Surface(size, 0, surface) * else: */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_DestSurface), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/transform.pyx":70 * * if DestSurface == None: * surf_out = Surface(size, 0, surface) # <<<<<<<<<<<<<< * else: * surf_out = DestSurface */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size)) __PYX_ERR(0, 70, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 70, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_surface); __Pyx_GIVEREF((PyObject *)__pyx_v_surface); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_surface))) __PYX_ERR(0, 70, __pyx_L1_error); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_surf_out = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":69 * cdef int err = -1 * * if DestSurface == None: # <<<<<<<<<<<<<< * surf_out = Surface(size, 0, surface) * else: */ goto __pyx_L3; } /* "pygame_sdl2/transform.pyx":72 * surf_out = Surface(size, 0, surface) * else: * surf_out = DestSurface # <<<<<<<<<<<<<< * * with nogil: */ /*else*/ { __Pyx_INCREF((PyObject *)__pyx_v_DestSurface); __pyx_v_surf_out = __pyx_v_DestSurface; } __pyx_L3:; /* "pygame_sdl2/transform.pyx":74 * surf_out = DestSurface * * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":75 * * with nogil: * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) # <<<<<<<<<<<<<< * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) * */ (void)(SDL_SetSurfaceBlendMode(__pyx_v_surface->surface, SDL_BLENDMODE_NONE)); /* "pygame_sdl2/transform.pyx":76 * with nogil: * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) # <<<<<<<<<<<<<< * * if err != 0: */ __pyx_v_err = SDL_UpperBlitScaled(__pyx_v_surface->surface, NULL, __pyx_v_surf_out->surface, NULL); } /* "pygame_sdl2/transform.pyx":74 * surf_out = DestSurface * * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/transform.pyx":78 * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (__pyx_v_err != 0); if (unlikely(__pyx_t_2)) { /* "pygame_sdl2/transform.pyx":79 * * if err != 0: * raise error() # <<<<<<<<<<<<<< * * return surf_out */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 79, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":78 * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/transform.pyx":81 * raise error() * * return surf_out # <<<<<<<<<<<<<< * * def rotate(Surface surface, angle): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_surf_out); __pyx_r = ((PyObject *)__pyx_v_surf_out); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.transform.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_5rotate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_9transform_4rotate, "rotate(Surface surface, angle)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_5rotate = {"rotate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_9transform_5rotate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_9transform_4rotate}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_5rotate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_angle = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rotate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_angle,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_angle)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rotate", 1, 2, 2, 1); __PYX_ERR(0, 83, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rotate") < 0)) __PYX_ERR(0, 83, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_angle = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rotate", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 83, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.transform.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 83, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_9transform_4rotate(__pyx_self, __pyx_v_surface, __pyx_v_angle); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_4rotate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_angle) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rotate", 1); /* "pygame_sdl2/transform.pyx":90 * # if rsurf == NULL: * # raise error() * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) # <<<<<<<<<<<<<< * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_rotozoom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From___pyx_anon_enum(SMOOTHING_OFF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, ((PyObject *)__pyx_v_surface), __pyx_v_angle, __pyx_float_1_0, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.transform.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_7rotozoom(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_9transform_6rotozoom, "rotozoom(Surface surface, double angle, double scale, int smooth=1)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_7rotozoom = {"rotozoom", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_9transform_7rotozoom, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_9transform_6rotozoom}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_7rotozoom(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; double __pyx_v_angle; double __pyx_v_scale; int __pyx_v_smooth; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rotozoom (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_angle,&__pyx_n_s_scale,&__pyx_n_s_smooth,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_angle)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, 1); __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scale)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, 2); __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_smooth); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rotozoom") < 0)) __PYX_ERR(0, 92, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_angle = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_angle == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) __pyx_v_scale = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_scale == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) if (values[3]) { __pyx_v_smooth = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_smooth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) } else { __pyx_v_smooth = ((int)((int)1)); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 92, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.transform.rotozoom", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 92, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_9transform_6rotozoom(__pyx_self, __pyx_v_surface, __pyx_v_angle, __pyx_v_scale, __pyx_v_smooth); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_6rotozoom(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, double __pyx_v_angle, double __pyx_v_scale, int __pyx_v_smooth) { SDL_Surface *__pyx_v_rsurf; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rotozoom", 1); /* "pygame_sdl2/transform.pyx":93 * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): * cdef SDL_Surface *rsurf = NULL # <<<<<<<<<<<<<< * cdef Surface rv * */ __pyx_v_rsurf = NULL; /* "pygame_sdl2/transform.pyx":96 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":97 * * with nogil: * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) # <<<<<<<<<<<<<< * * if rsurf == NULL: */ __pyx_v_rsurf = rotozoomSurface(__pyx_v_surface->surface, __pyx_v_angle, __pyx_v_scale, __pyx_v_smooth); } /* "pygame_sdl2/transform.pyx":96 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/transform.pyx":99 * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (__pyx_v_rsurf == NULL); if (unlikely(__pyx_t_1)) { /* "pygame_sdl2/transform.pyx":100 * * if rsurf == NULL: * raise error() # <<<<<<<<<<<<<< * * rv = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 100, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":99 * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/transform.pyx":102 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":103 * * rv = Surface(()) * rv.take_surface(rsurf) # <<<<<<<<<<<<<< * * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_rsurf); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":105 * rv.take_surface(rsurf) * * return rv # <<<<<<<<<<<<<< * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) noexcept nogil: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.transform.rotozoom", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":107 * return rv * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) noexcept nogil: # <<<<<<<<<<<<<< * if x < 0: * x = 0 */ static uint32_t __pyx_f_11pygame_sdl2_9transform_get_at(SDL_Surface *__pyx_v_surf, int __pyx_v_x, int __pyx_v_y) { uint32_t *__pyx_v_p; uint32_t __pyx_r; int __pyx_t_1; size_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "pygame_sdl2/transform.pyx":108 * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) noexcept nogil: * if x < 0: # <<<<<<<<<<<<<< * x = 0 * elif x >= surf.w: */ __pyx_t_1 = (__pyx_v_x < 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":109 * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) noexcept nogil: * if x < 0: * x = 0 # <<<<<<<<<<<<<< * elif x >= surf.w: * x = surf.w - 1 */ __pyx_v_x = 0; /* "pygame_sdl2/transform.pyx":108 * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) noexcept nogil: * if x < 0: # <<<<<<<<<<<<<< * x = 0 * elif x >= surf.w: */ goto __pyx_L3; } /* "pygame_sdl2/transform.pyx":110 * if x < 0: * x = 0 * elif x >= surf.w: # <<<<<<<<<<<<<< * x = surf.w - 1 * if y < 0: */ __pyx_t_1 = (__pyx_v_x >= __pyx_v_surf->w); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":111 * x = 0 * elif x >= surf.w: * x = surf.w - 1 # <<<<<<<<<<<<<< * if y < 0: * y = 0 */ __pyx_v_x = (__pyx_v_surf->w - 1); /* "pygame_sdl2/transform.pyx":110 * if x < 0: * x = 0 * elif x >= surf.w: # <<<<<<<<<<<<<< * x = surf.w - 1 * if y < 0: */ } __pyx_L3:; /* "pygame_sdl2/transform.pyx":112 * elif x >= surf.w: * x = surf.w - 1 * if y < 0: # <<<<<<<<<<<<<< * y = 0 * elif y >= surf.h: */ __pyx_t_1 = (__pyx_v_y < 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":113 * x = surf.w - 1 * if y < 0: * y = 0 # <<<<<<<<<<<<<< * elif y >= surf.h: * y = surf.h - 1 */ __pyx_v_y = 0; /* "pygame_sdl2/transform.pyx":112 * elif x >= surf.w: * x = surf.w - 1 * if y < 0: # <<<<<<<<<<<<<< * y = 0 * elif y >= surf.h: */ goto __pyx_L4; } /* "pygame_sdl2/transform.pyx":114 * if y < 0: * y = 0 * elif y >= surf.h: # <<<<<<<<<<<<<< * y = surf.h - 1 * */ __pyx_t_1 = (__pyx_v_y >= __pyx_v_surf->h); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":115 * y = 0 * elif y >= surf.h: * y = surf.h - 1 # <<<<<<<<<<<<<< * * cdef uint32_t *p = surf.pixels */ __pyx_v_y = (__pyx_v_surf->h - 1); /* "pygame_sdl2/transform.pyx":114 * if y < 0: * y = 0 * elif y >= surf.h: # <<<<<<<<<<<<<< * y = surf.h - 1 * */ } __pyx_L4:; /* "pygame_sdl2/transform.pyx":117 * y = surf.h - 1 * * cdef uint32_t *p = surf.pixels # <<<<<<<<<<<<<< * p += y * (surf.pitch // sizeof(uint32_t)) * p += x */ __pyx_v_p = ((uint32_t *)__pyx_v_surf->pixels); /* "pygame_sdl2/transform.pyx":118 * * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) # <<<<<<<<<<<<<< * p += x * return p[0] */ __pyx_t_2 = (sizeof(uint32_t)); if (unlikely(__pyx_t_2 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 118, __pyx_L1_error) } __pyx_v_p = (__pyx_v_p + (__pyx_v_y * (__pyx_v_surf->pitch / __pyx_t_2))); /* "pygame_sdl2/transform.pyx":119 * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) * p += x # <<<<<<<<<<<<<< * return p[0] * */ __pyx_v_p = (__pyx_v_p + __pyx_v_x); /* "pygame_sdl2/transform.pyx":120 * p += y * (surf.pitch // sizeof(uint32_t)) * p += x * return p[0] # <<<<<<<<<<<<<< * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) noexcept nogil: */ __pyx_r = (__pyx_v_p[0]); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":107 * return rv * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) noexcept nogil: # <<<<<<<<<<<<<< * if x < 0: * x = 0 */ /* function exit code */ __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_WriteUnraisable("pygame_sdl2.transform.get_at", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/transform.pyx":122 * return p[0] * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) noexcept nogil: # <<<<<<<<<<<<<< * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) */ static void __pyx_f_11pygame_sdl2_9transform_set_at(SDL_Surface *__pyx_v_surf, int __pyx_v_x, int __pyx_v_y, uint32_t __pyx_v_color) { uint32_t *__pyx_v_p; size_t __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save; #endif /* "pygame_sdl2/transform.pyx":123 * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) noexcept nogil: * cdef uint32_t *p = surf.pixels # <<<<<<<<<<<<<< * p += y * (surf.pitch // sizeof(uint32_t)) * p += x */ __pyx_v_p = ((uint32_t *)__pyx_v_surf->pixels); /* "pygame_sdl2/transform.pyx":124 * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) noexcept nogil: * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) # <<<<<<<<<<<<<< * p += x * p[0] = color */ __pyx_t_1 = (sizeof(uint32_t)); if (unlikely(__pyx_t_1 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 124, __pyx_L1_error) } __pyx_v_p = (__pyx_v_p + (__pyx_v_y * (__pyx_v_surf->pitch / __pyx_t_1))); /* "pygame_sdl2/transform.pyx":125 * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) * p += x # <<<<<<<<<<<<<< * p[0] = color * */ __pyx_v_p = (__pyx_v_p + __pyx_v_x); /* "pygame_sdl2/transform.pyx":126 * p += y * (surf.pitch // sizeof(uint32_t)) * p += x * p[0] = color # <<<<<<<<<<<<<< * * def scale2x(Surface surface, Surface DestSurface=None): */ (__pyx_v_p[0]) = __pyx_v_color; /* "pygame_sdl2/transform.pyx":122 * return p[0] * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) noexcept nogil: # <<<<<<<<<<<<<< * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; #ifdef WITH_THREAD __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_WriteUnraisable("pygame_sdl2.transform.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif __pyx_L0:; } /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_9scale2x(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_9transform_8scale2x, "scale2x(Surface surface, Surface DestSurface=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_9scale2x = {"scale2x", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_9transform_9scale2x, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_9transform_8scale2x}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_9scale2x(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scale2x (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_DestSurface,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_DestSurface); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scale2x") < 0)) __PYX_ERR(0, 128, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_DestSurface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scale2x", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 128, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.transform.scale2x", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 128, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_DestSurface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "DestSurface", 0))) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_9transform_8scale2x(__pyx_self, __pyx_v_surface, __pyx_v_DestSurface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_8scale2x(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface) { int __pyx_v_x; int __pyx_v_y; CYTHON_UNUSED uint32_t __pyx_v_a; uint32_t __pyx_v_b; CYTHON_UNUSED uint32_t __pyx_v_c; uint32_t __pyx_v_d; uint32_t __pyx_v_e; uint32_t __pyx_v_f; CYTHON_UNUSED uint32_t __pyx_v_g; uint32_t __pyx_v_h; CYTHON_UNUSED uint32_t __pyx_v_i; uint32_t __pyx_v_e0; uint32_t __pyx_v_e1; uint32_t __pyx_v_e2; uint32_t __pyx_v_e3; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf_out = 0; int __pyx_v_width; int __pyx_v_height; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; int __pyx_t_14; uint32_t __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scale2x", 1); /* "pygame_sdl2/transform.pyx":134 * cdef uint32_t e0, e1, e2, e3 * * if surface.get_bytesize() != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_bytesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = (__Pyx_PyInt_BoolNeObjC(__pyx_t_1, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/transform.pyx":135 * * if surface.get_bytesize() != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * cdef Surface surf_out = DestSurface */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_Surface_has_unsupported_bytesize}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 135, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":134 * cdef uint32_t e0, e1, e2, e3 * * if surface.get_bytesize() != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/transform.pyx":137 * raise error("Surface has unsupported bytesize.") * * cdef Surface surf_out = DestSurface # <<<<<<<<<<<<<< * if surf_out == None: * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) */ __Pyx_INCREF((PyObject *)__pyx_v_DestSurface); __pyx_v_surf_out = __pyx_v_DestSurface; /* "pygame_sdl2/transform.pyx":138 * * cdef Surface surf_out = DestSurface * if surf_out == None: # <<<<<<<<<<<<<< * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) * */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_surf_out), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/transform.pyx":139 * cdef Surface surf_out = DestSurface * if surf_out == None: * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) # <<<<<<<<<<<<<< * * surface.lock() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(0, 139, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_surface); __Pyx_GIVEREF((PyObject *)__pyx_v_surface); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_surface))) __PYX_ERR(0, 139, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_surf_out, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1)); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":138 * * cdef Surface surf_out = DestSurface * if surf_out == None: # <<<<<<<<<<<<<< * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) * */ } /* "pygame_sdl2/transform.pyx":141 * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) * * surface.lock() # <<<<<<<<<<<<<< * surf_out.lock() * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":142 * * surface.lock() * surf_out.lock() # <<<<<<<<<<<<<< * * cdef int width, height */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf_out), __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":145 * * cdef int width, height * width, height = surface.get_size() # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 145, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 145, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 145, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_width = __pyx_t_8; __pyx_v_height = __pyx_t_9; /* "pygame_sdl2/transform.pyx":147 * width, height = surface.get_size() * * with nogil: # <<<<<<<<<<<<<< * for x in range(width): * for y in range(height): */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":148 * * with nogil: * for x in range(width): # <<<<<<<<<<<<<< * for y in range(height): * # Get the surrounding 9 pixels. */ __pyx_t_9 = __pyx_v_width; __pyx_t_8 = __pyx_t_9; for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_8; __pyx_t_10+=1) { __pyx_v_x = __pyx_t_10; /* "pygame_sdl2/transform.pyx":149 * with nogil: * for x in range(width): * for y in range(height): # <<<<<<<<<<<<<< * # Get the surrounding 9 pixels. * a = get_at(surface.surface, x - 1, y - 1) */ __pyx_t_11 = __pyx_v_height; __pyx_t_12 = __pyx_t_11; for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_y = __pyx_t_13; /* "pygame_sdl2/transform.pyx":151 * for y in range(height): * # Get the surrounding 9 pixels. * a = get_at(surface.surface, x - 1, y - 1) # <<<<<<<<<<<<<< * b = get_at(surface.surface, x, y - 1) * c = get_at(surface.surface, x + 1, y - 1) */ __pyx_v_a = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x - 1), (__pyx_v_y - 1)); /* "pygame_sdl2/transform.pyx":152 * # Get the surrounding 9 pixels. * a = get_at(surface.surface, x - 1, y - 1) * b = get_at(surface.surface, x, y - 1) # <<<<<<<<<<<<<< * c = get_at(surface.surface, x + 1, y - 1) * */ __pyx_v_b = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, __pyx_v_x, (__pyx_v_y - 1)); /* "pygame_sdl2/transform.pyx":153 * a = get_at(surface.surface, x - 1, y - 1) * b = get_at(surface.surface, x, y - 1) * c = get_at(surface.surface, x + 1, y - 1) # <<<<<<<<<<<<<< * * d = get_at(surface.surface, x - 1, y) */ __pyx_v_c = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x + 1), (__pyx_v_y - 1)); /* "pygame_sdl2/transform.pyx":155 * c = get_at(surface.surface, x + 1, y - 1) * * d = get_at(surface.surface, x - 1, y) # <<<<<<<<<<<<<< * e = get_at(surface.surface, x, y) * f = get_at(surface.surface, x + 1, y) */ __pyx_v_d = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x - 1), __pyx_v_y); /* "pygame_sdl2/transform.pyx":156 * * d = get_at(surface.surface, x - 1, y) * e = get_at(surface.surface, x, y) # <<<<<<<<<<<<<< * f = get_at(surface.surface, x + 1, y) * */ __pyx_v_e = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, __pyx_v_x, __pyx_v_y); /* "pygame_sdl2/transform.pyx":157 * d = get_at(surface.surface, x - 1, y) * e = get_at(surface.surface, x, y) * f = get_at(surface.surface, x + 1, y) # <<<<<<<<<<<<<< * * g = get_at(surface.surface, x - 1, y + 1) */ __pyx_v_f = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x + 1), __pyx_v_y); /* "pygame_sdl2/transform.pyx":159 * f = get_at(surface.surface, x + 1, y) * * g = get_at(surface.surface, x - 1, y + 1) # <<<<<<<<<<<<<< * h = get_at(surface.surface, x, y + 1) * i = get_at(surface.surface, x + 1, y + 1) */ __pyx_v_g = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x - 1), (__pyx_v_y + 1)); /* "pygame_sdl2/transform.pyx":160 * * g = get_at(surface.surface, x - 1, y + 1) * h = get_at(surface.surface, x, y + 1) # <<<<<<<<<<<<<< * i = get_at(surface.surface, x + 1, y + 1) * */ __pyx_v_h = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, __pyx_v_x, (__pyx_v_y + 1)); /* "pygame_sdl2/transform.pyx":161 * g = get_at(surface.surface, x - 1, y + 1) * h = get_at(surface.surface, x, y + 1) * i = get_at(surface.surface, x + 1, y + 1) # <<<<<<<<<<<<<< * * # Expand the center pixel. */ __pyx_v_i = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x + 1), (__pyx_v_y + 1)); /* "pygame_sdl2/transform.pyx":164 * * # Expand the center pixel. * if b != h and d != f: # <<<<<<<<<<<<<< * e0 = d if d == b else e * e1 = f if b == f else e */ __pyx_t_14 = (__pyx_v_b != __pyx_v_h); if (__pyx_t_14) { } else { __pyx_t_5 = __pyx_t_14; goto __pyx_L15_bool_binop_done; } __pyx_t_14 = (__pyx_v_d != __pyx_v_f); __pyx_t_5 = __pyx_t_14; __pyx_L15_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/transform.pyx":165 * # Expand the center pixel. * if b != h and d != f: * e0 = d if d == b else e # <<<<<<<<<<<<<< * e1 = f if b == f else e * e2 = d if d == h else e */ __pyx_t_5 = (__pyx_v_d == __pyx_v_b); if (__pyx_t_5) { __pyx_t_15 = __pyx_v_d; } else { __pyx_t_15 = __pyx_v_e; } __pyx_v_e0 = __pyx_t_15; /* "pygame_sdl2/transform.pyx":166 * if b != h and d != f: * e0 = d if d == b else e * e1 = f if b == f else e # <<<<<<<<<<<<<< * e2 = d if d == h else e * e3 = f if h == f else e */ __pyx_t_5 = (__pyx_v_b == __pyx_v_f); if (__pyx_t_5) { __pyx_t_15 = __pyx_v_f; } else { __pyx_t_15 = __pyx_v_e; } __pyx_v_e1 = __pyx_t_15; /* "pygame_sdl2/transform.pyx":167 * e0 = d if d == b else e * e1 = f if b == f else e * e2 = d if d == h else e # <<<<<<<<<<<<<< * e3 = f if h == f else e * else: */ __pyx_t_5 = (__pyx_v_d == __pyx_v_h); if (__pyx_t_5) { __pyx_t_15 = __pyx_v_d; } else { __pyx_t_15 = __pyx_v_e; } __pyx_v_e2 = __pyx_t_15; /* "pygame_sdl2/transform.pyx":168 * e1 = f if b == f else e * e2 = d if d == h else e * e3 = f if h == f else e # <<<<<<<<<<<<<< * else: * e0 = e1 = e2 = e3 = e */ __pyx_t_5 = (__pyx_v_h == __pyx_v_f); if (__pyx_t_5) { __pyx_t_15 = __pyx_v_f; } else { __pyx_t_15 = __pyx_v_e; } __pyx_v_e3 = __pyx_t_15; /* "pygame_sdl2/transform.pyx":164 * * # Expand the center pixel. * if b != h and d != f: # <<<<<<<<<<<<<< * e0 = d if d == b else e * e1 = f if b == f else e */ goto __pyx_L14; } /* "pygame_sdl2/transform.pyx":170 * e3 = f if h == f else e * else: * e0 = e1 = e2 = e3 = e # <<<<<<<<<<<<<< * * set_at(surf_out.surface, x*2, y*2, e0) */ /*else*/ { __pyx_v_e0 = __pyx_v_e; __pyx_v_e1 = __pyx_v_e; __pyx_v_e2 = __pyx_v_e; __pyx_v_e3 = __pyx_v_e; } __pyx_L14:; /* "pygame_sdl2/transform.pyx":172 * e0 = e1 = e2 = e3 = e * * set_at(surf_out.surface, x*2, y*2, e0) # <<<<<<<<<<<<<< * set_at(surf_out.surface, (x*2)+1, y*2, e1) * set_at(surf_out.surface, x*2, (y*2)+1, e2) */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, (__pyx_v_x * 2), (__pyx_v_y * 2), __pyx_v_e0); /* "pygame_sdl2/transform.pyx":173 * * set_at(surf_out.surface, x*2, y*2, e0) * set_at(surf_out.surface, (x*2)+1, y*2, e1) # <<<<<<<<<<<<<< * set_at(surf_out.surface, x*2, (y*2)+1, e2) * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, ((__pyx_v_x * 2) + 1), (__pyx_v_y * 2), __pyx_v_e1); /* "pygame_sdl2/transform.pyx":174 * set_at(surf_out.surface, x*2, y*2, e0) * set_at(surf_out.surface, (x*2)+1, y*2, e1) * set_at(surf_out.surface, x*2, (y*2)+1, e2) # <<<<<<<<<<<<<< * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) * */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, (__pyx_v_x * 2), ((__pyx_v_y * 2) + 1), __pyx_v_e2); /* "pygame_sdl2/transform.pyx":175 * set_at(surf_out.surface, (x*2)+1, y*2, e1) * set_at(surf_out.surface, x*2, (y*2)+1, e2) * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) # <<<<<<<<<<<<<< * * surf_out.unlock() */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, ((__pyx_v_x * 2) + 1), ((__pyx_v_y * 2) + 1), __pyx_v_e3); } } } /* "pygame_sdl2/transform.pyx":147 * width, height = surface.get_size() * * with nogil: # <<<<<<<<<<<<<< * for x in range(width): * for y in range(height): */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } /* "pygame_sdl2/transform.pyx":177 * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) * * surf_out.unlock() # <<<<<<<<<<<<<< * surface.unlock() * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf_out), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":178 * * surf_out.unlock() * surface.unlock() # <<<<<<<<<<<<<< * * return surf_out */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":180 * surface.unlock() * * return surf_out # <<<<<<<<<<<<<< * * def smoothscale(Surface surface, size, Surface DestSurface=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_surf_out); __pyx_r = ((PyObject *)__pyx_v_surf_out); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.transform.scale2x", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_11smoothscale(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_11pygame_sdl2_9transform_10smoothscale, "smoothscale(Surface surface, size, Surface DestSurface=None)"); static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_11smoothscale = {"smoothscale", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11pygame_sdl2_9transform_11smoothscale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_9transform_10smoothscale}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_11smoothscale(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_size = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("smoothscale (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_size,&__pyx_n_s_DestSurface,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("smoothscale", 0, 2, 3, 1); __PYX_ERR(0, 182, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_DestSurface); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "smoothscale") < 0)) __PYX_ERR(0, 182, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_size = values[1]; __pyx_v_DestSurface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("smoothscale", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 182, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pygame_sdl2.transform.smoothscale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 182, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_DestSurface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "DestSurface", 0))) __PYX_ERR(0, 182, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_9transform_10smoothscale(__pyx_self, __pyx_v_surface, __pyx_v_size, __pyx_v_DestSurface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_10smoothscale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface) { double __pyx_v_scale_x; double __pyx_v_scale_y; SDL_Surface *__pyx_v_rsurf; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; double __pyx_t_4; int __pyx_t_5; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("smoothscale", 1); /* "pygame_sdl2/transform.pyx":183 * * def smoothscale(Surface surface, size, Surface DestSurface=None): * cdef double scale_x = size[0] / surface.surface.w # <<<<<<<<<<<<<< * cdef double scale_y = size[1] / surface.surface.h * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_v_surface->surface->w)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_scale_x = __pyx_t_4; /* "pygame_sdl2/transform.pyx":184 * def smoothscale(Surface surface, size, Surface DestSurface=None): * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h # <<<<<<<<<<<<<< * * cdef SDL_Surface *rsurf = NULL */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_v_surface->surface->h)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_scale_y = __pyx_t_4; /* "pygame_sdl2/transform.pyx":186 * cdef double scale_y = size[1] / surface.surface.h * * cdef SDL_Surface *rsurf = NULL # <<<<<<<<<<<<<< * cdef Surface rv * */ __pyx_v_rsurf = NULL; /* "pygame_sdl2/transform.pyx":189 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":190 * * with nogil: * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) # <<<<<<<<<<<<<< * * if rsurf == NULL: */ __pyx_v_rsurf = rotozoomSurfaceXY(__pyx_v_surface->surface, 0.0, __pyx_v_scale_x, __pyx_v_scale_y, SMOOTHING_ON); } /* "pygame_sdl2/transform.pyx":189 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/transform.pyx":192 * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = (__pyx_v_rsurf == NULL); if (unlikely(__pyx_t_5)) { /* "pygame_sdl2/transform.pyx":193 * * if rsurf == NULL: * raise error() # <<<<<<<<<<<<<< * * rv = Surface(()) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 193, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":192 * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/transform.pyx":195 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":196 * * rv = Surface(()) * rv.take_surface(rsurf) # <<<<<<<<<<<<<< * * # This is inefficient. */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_rsurf); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":199 * * # This is inefficient. * if DestSurface: # <<<<<<<<<<<<<< * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) */ __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_DestSurface)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 199, __pyx_L1_error) if (__pyx_t_5) { /* "pygame_sdl2/transform.pyx":200 * # This is inefficient. * if DestSurface: * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":201 * if DestSurface: * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) # <<<<<<<<<<<<<< * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) * */ (void)(SDL_SetSurfaceBlendMode(__pyx_v_rv->surface, SDL_BLENDMODE_NONE)); /* "pygame_sdl2/transform.pyx":202 * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) # <<<<<<<<<<<<<< * * return rv */ (void)(SDL_UpperBlit(__pyx_v_rv->surface, NULL, __pyx_v_DestSurface->surface, NULL)); } /* "pygame_sdl2/transform.pyx":200 * # This is inefficient. * if DestSurface: * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/transform.pyx":199 * * # This is inefficient. * if DestSurface: # <<<<<<<<<<<<<< * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) */ } /* "pygame_sdl2/transform.pyx":204 * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) * * return rv # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_rv); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.transform.smoothscale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_DestSurface, __pyx_k_DestSurface, sizeof(__pyx_k_DestSurface), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_has_unsupported_bytesize, __pyx_k_Surface_has_unsupported_bytesize, sizeof(__pyx_k_Surface_has_unsupported_bytesize), 0, 0, 1, 0}, {&__pyx_n_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 1}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_angle, __pyx_k_angle, sizeof(__pyx_k_angle), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_dest_delta, __pyx_k_dest_delta, sizeof(__pyx_k_dest_delta), 0, 0, 1, 1}, {&__pyx_n_s_dest_pixel, __pyx_k_dest_pixel, sizeof(__pyx_k_dest_pixel), 0, 0, 1, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_e0, __pyx_k_e0, sizeof(__pyx_k_e0), 0, 0, 1, 1}, {&__pyx_n_s_e1, __pyx_k_e1, sizeof(__pyx_k_e1), 0, 0, 1, 1}, {&__pyx_n_s_e2, __pyx_k_e2, sizeof(__pyx_k_e2), 0, 0, 1, 1}, {&__pyx_n_s_e3, __pyx_k_e3, sizeof(__pyx_k_e3), 0, 0, 1, 1}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, {&__pyx_n_s_flip, __pyx_k_flip, sizeof(__pyx_k_flip), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_get_bytesize, __pyx_k_get_bytesize, sizeof(__pyx_k_get_bytesize), 0, 0, 1, 1}, {&__pyx_n_s_get_flags, __pyx_k_get_flags, sizeof(__pyx_k_get_flags), 0, 0, 1, 1}, {&__pyx_n_s_get_height, __pyx_k_get_height, sizeof(__pyx_k_get_height), 0, 0, 1, 1}, {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1}, {&__pyx_n_s_get_width, __pyx_k_get_width, sizeof(__pyx_k_get_width), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_transform, __pyx_k_pygame_sdl2_transform, sizeof(__pyx_k_pygame_sdl2_transform), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rotate, __pyx_k_rotate, sizeof(__pyx_k_rotate), 0, 0, 1, 1}, {&__pyx_n_s_rotozoom, __pyx_k_rotozoom, sizeof(__pyx_k_rotozoom), 0, 0, 1, 1}, {&__pyx_n_s_rsurf, __pyx_k_rsurf, sizeof(__pyx_k_rsurf), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1}, {&__pyx_n_s_scale2x, __pyx_k_scale2x, sizeof(__pyx_k_scale2x), 0, 0, 1, 1}, {&__pyx_n_s_scale_x, __pyx_k_scale_x, sizeof(__pyx_k_scale_x), 0, 0, 1, 1}, {&__pyx_n_s_scale_y, __pyx_k_scale_y, sizeof(__pyx_k_scale_y), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_smooth, __pyx_k_smooth, sizeof(__pyx_k_smooth), 0, 0, 1, 1}, {&__pyx_n_s_smoothscale, __pyx_k_smoothscale, sizeof(__pyx_k_smoothscale), 0, 0, 1, 1}, {&__pyx_n_s_src, __pyx_k_src, sizeof(__pyx_k_src), 0, 0, 1, 1}, {&__pyx_n_s_src_end, __pyx_k_src_end, sizeof(__pyx_k_src_end), 0, 0, 1, 1}, {&__pyx_n_s_src_pixel, __pyx_k_src_pixel, sizeof(__pyx_k_src_pixel), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_k_src_pygame_sdl2_transform_pyx, sizeof(__pyx_k_src_pygame_sdl2_transform_pyx), 0, 0, 1, 0}, {&__pyx_n_s_surf_out, __pyx_k_surf_out, sizeof(__pyx_k_surf_out), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_unlock, __pyx_k_unlock, sizeof(__pyx_k_unlock), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_xbool, __pyx_k_xbool, sizeof(__pyx_k_xbool), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_ybool, __pyx_k_ybool, sizeof(__pyx_k_ybool), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 148, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/transform.pyx":102 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ __pyx_tuple__3 = PyTuple_Pack(11, __pyx_n_s_surface, __pyx_n_s_xbool, __pyx_n_s_ybool, __pyx_n_s_rv, __pyx_n_s_src, __pyx_n_s_dest, __pyx_n_s_src_pixel, __pyx_n_s_src_end, __pyx_n_s_dest_pixel, __pyx_n_s_dest_delta, __pyx_n_s_y); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_flip, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 26, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ __pyx_tuple__5 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_size, __pyx_n_s_DestSurface, __pyx_n_s_surf_out, __pyx_n_s_err); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_scale, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_tuple__7 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_surface, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_rotate, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 83, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_angle, __pyx_n_s_scale, __pyx_n_s_smooth, __pyx_n_s_rsurf, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_rotozoom, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 92, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ __pyx_tuple__12 = PyTuple_Pack(20, __pyx_n_s_surface, __pyx_n_s_DestSurface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_c, __pyx_n_s_d, __pyx_n_s_e, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_h, __pyx_n_s_i, __pyx_n_s_e0, __pyx_n_s_e1, __pyx_n_s_e2, __pyx_n_s_e3, __pyx_n_s_surf_out, __pyx_n_s_width, __pyx_n_s_height); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_scale2x, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 128, __pyx_L1_error) /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ __pyx_tuple__14 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_size, __pyx_n_s_DestSurface, __pyx_n_s_scale_x, __pyx_n_s_scale_y, __pyx_n_s_rsurf, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_smoothscale, 182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType_3_0_12(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_11pygame_sdl2_7surface_Surface),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(1, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_transform(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_transform}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "transform", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC inittransform(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC inittransform(void) #else __Pyx_PyMODINIT_FUNC PyInit_transform(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_transform(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else 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) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_transform(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'transform' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("transform", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "transform" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_transform(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__transform) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.transform")) { if (unlikely((PyDict_SetItemString(modules, "pygame_sdl2.transform", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/transform.pyx":23 * from sdl2_gfx cimport * * from pygame_sdl2.surface cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error)) __PYX_ERR(0, 23, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_9transform_1flip, 0, __pyx_n_s_flip, NULL, __pyx_n_s_pygame_sdl2_transform, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_9transform_3scale, 0, __pyx_n_s_scale, NULL, __pyx_n_s_pygame_sdl2_transform, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_scale, __pyx_t_3) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_9transform_5rotate, 0, __pyx_n_s_rotate, NULL, __pyx_n_s_pygame_sdl2_transform, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotate, __pyx_t_3) < 0) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ __pyx_t_3 = __Pyx_PyInt_From_int(((int)1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_9transform_7rotozoom, 0, __pyx_n_s_rotozoom, NULL, __pyx_n_s_pygame_sdl2_transform, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotozoom, __pyx_t_3) < 0) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_9transform_9scale2x, 0, __pyx_n_s_scale2x, NULL, __pyx_n_s_pygame_sdl2_transform, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_scale2x, __pyx_t_3) < 0) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_9transform_11smoothscale, 0, __pyx_n_s_smoothscale, NULL, __pyx_n_s_pygame_sdl2_transform, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_smoothscale, __pyx_t_3) < 0) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Tom Rothamel * # */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pygame_sdl2.transform", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.transform"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); else state = (PyGILState_STATE)0; #endif CYTHON_UNUSED_VAR(clineno); CYTHON_UNUSED_VAR(lineno); CYTHON_UNUSED_VAR(filename); CYTHON_MAYBE_UNUSED_VAR(nogil); __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(0); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 0; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a != b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) != 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 1; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 1; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (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)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal != 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a != (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_NE)); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); #ifdef HAVE_LONG_LONG if (sizeof(PY_LONG_LONG) > sizeof(long)) { PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; return (result >= LONG_MIN && result <= LONG_MAX) ? PyInt_FromLong((long)result) : PyLong_FromLongLong(result); } #endif #if CYTHON_USE_TYPE_SLOTS return PyInt_Type.tp_as_number->nb_multiply(op1, op2); #else return PyNumber_Multiply(op1, op2); #endif } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } } CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); #ifdef HAVE_LONG_LONG lla = a; goto long_long; #else return PyLong_Type.tp_as_number->nb_multiply(op1, op2); #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla * llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("multiply", return NULL) result = ((double)a) * (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #endif /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_12 #define __PYX_HAVE_RT_ImportType_3_0_12 static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From___pyx_anon_enum(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__16); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000003100000000000010207 xustar0025 mtime=1753336711.1482 pygame_sdl2-2.1.0+renpy8.4.1/include/0000775000175000017500000000000015040345607015313 5ustar00tomtom././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1611641989.0 pygame_sdl2-2.1.0+renpy8.4.1/include/color_dict.pxi0000664000175000017500000005273314003732205020160 0ustar00tomtom# Automatically generated by generate_colordict.py # Do not edit! cdef object colors = { 'aliceblue' : (240, 248, 255), 'antiquewhite' : (250, 235, 215), 'antiquewhite1' : (255, 239, 219), 'antiquewhite2' : (238, 223, 204), 'antiquewhite3' : (205, 192, 176), 'antiquewhite4' : (139, 131, 120), 'aquamarine' : (127, 255, 212), 'aquamarine1' : (127, 255, 212), 'aquamarine2' : (118, 238, 198), 'aquamarine3' : (102, 205, 170), 'aquamarine4' : (69, 139, 116), 'azure' : (240, 255, 255), 'azure1' : (240, 255, 255), 'azure2' : (224, 238, 238), 'azure3' : (193, 205, 205), 'azure4' : (131, 139, 139), 'beige' : (245, 245, 220), 'bisque' : (255, 228, 196), 'bisque1' : (255, 228, 196), 'bisque2' : (238, 213, 183), 'bisque3' : (205, 183, 158), 'bisque4' : (139, 125, 107), 'black' : (0, 0, 0), 'blanchedalmond' : (255, 235, 205), 'blue' : (0, 0, 255), 'blue1' : (0, 0, 255), 'blue2' : (0, 0, 238), 'blue3' : (0, 0, 205), 'blue4' : (0, 0, 139), 'blueviolet' : (138, 43, 226), 'brown' : (165, 42, 42), 'brown1' : (255, 64, 64), 'brown2' : (238, 59, 59), 'brown3' : (205, 51, 51), 'brown4' : (139, 35, 35), 'burlywood' : (222, 184, 135), 'burlywood1' : (255, 211, 155), 'burlywood2' : (238, 197, 145), 'burlywood3' : (205, 170, 125), 'burlywood4' : (139, 115, 85), 'cadetblue' : (95, 158, 160), 'cadetblue1' : (152, 245, 255), 'cadetblue2' : (142, 229, 238), 'cadetblue3' : (122, 197, 205), 'cadetblue4' : (83, 134, 139), 'chartreuse' : (127, 255, 0), 'chartreuse1' : (127, 255, 0), 'chartreuse2' : (118, 238, 0), 'chartreuse3' : (102, 205, 0), 'chartreuse4' : (69, 139, 0), 'chocolate' : (210, 105, 30), 'chocolate1' : (255, 127, 36), 'chocolate2' : (238, 118, 33), 'chocolate3' : (205, 102, 29), 'chocolate4' : (139, 69, 19), 'coral' : (255, 127, 80), 'coral1' : (255, 114, 86), 'coral2' : (238, 106, 80), 'coral3' : (205, 91, 69), 'coral4' : (139, 62, 47), 'cornflowerblue' : (100, 149, 237), 'cornsilk' : (255, 248, 220), 'cornsilk1' : (255, 248, 220), 'cornsilk2' : (238, 232, 205), 'cornsilk3' : (205, 200, 177), 'cornsilk4' : (139, 136, 120), 'cyan' : (0, 255, 255), 'cyan1' : (0, 255, 255), 'cyan2' : (0, 238, 238), 'cyan3' : (0, 205, 205), 'cyan4' : (0, 139, 139), 'darkblue' : (0, 0, 139), 'darkcyan' : (0, 139, 139), 'darkgoldenrod' : (184, 134, 11), 'darkgoldenrod1' : (255, 185, 15), 'darkgoldenrod2' : (238, 173, 14), 'darkgoldenrod3' : (205, 149, 12), 'darkgoldenrod4' : (139, 101, 8), 'darkgray' : (169, 169, 169), 'darkgreen' : (0, 100, 0), 'darkgrey' : (169, 169, 169), 'darkkhaki' : (189, 183, 107), 'darkmagenta' : (139, 0, 139), 'darkolivegreen' : (85, 107, 47), 'darkolivegreen1' : (202, 255, 112), 'darkolivegreen2' : (188, 238, 104), 'darkolivegreen3' : (162, 205, 90), 'darkolivegreen4' : (110, 139, 61), 'darkorange' : (255, 140, 0), 'darkorange1' : (255, 127, 0), 'darkorange2' : (238, 118, 0), 'darkorange3' : (205, 102, 0), 'darkorange4' : (139, 69, 0), 'darkorchid' : (153, 50, 204), 'darkorchid1' : (191, 62, 255), 'darkorchid2' : (178, 58, 238), 'darkorchid3' : (154, 50, 205), 'darkorchid4' : (104, 34, 139), 'darkred' : (139, 0, 0), 'darksalmon' : (233, 150, 122), 'darkseagreen' : (143, 188, 143), 'darkseagreen1' : (193, 255, 193), 'darkseagreen2' : (180, 238, 180), 'darkseagreen3' : (155, 205, 155), 'darkseagreen4' : (105, 139, 105), 'darkslateblue' : (72, 61, 139), 'darkslategray' : (47, 79, 79), 'darkslategray1' : (151, 255, 255), 'darkslategray2' : (141, 238, 238), 'darkslategray3' : (121, 205, 205), 'darkslategray4' : (82, 139, 139), 'darkslategrey' : (47, 79, 79), 'darkturquoise' : (0, 206, 209), 'darkviolet' : (148, 0, 211), 'debianred' : (215, 7, 81), 'deeppink' : (255, 20, 147), 'deeppink1' : (255, 20, 147), 'deeppink2' : (238, 18, 137), 'deeppink3' : (205, 16, 118), 'deeppink4' : (139, 10, 80), 'deepskyblue' : (0, 191, 255), 'deepskyblue1' : (0, 191, 255), 'deepskyblue2' : (0, 178, 238), 'deepskyblue3' : (0, 154, 205), 'deepskyblue4' : (0, 104, 139), 'dimgray' : (105, 105, 105), 'dimgrey' : (105, 105, 105), 'dodgerblue' : (30, 144, 255), 'dodgerblue1' : (30, 144, 255), 'dodgerblue2' : (28, 134, 238), 'dodgerblue3' : (24, 116, 205), 'dodgerblue4' : (16, 78, 139), 'firebrick' : (178, 34, 34), 'firebrick1' : (255, 48, 48), 'firebrick2' : (238, 44, 44), 'firebrick3' : (205, 38, 38), 'firebrick4' : (139, 26, 26), 'floralwhite' : (255, 250, 240), 'forestgreen' : (34, 139, 34), 'gainsboro' : (220, 220, 220), 'ghostwhite' : (248, 248, 255), 'gold' : (255, 215, 0), 'gold1' : (255, 215, 0), 'gold2' : (238, 201, 0), 'gold3' : (205, 173, 0), 'gold4' : (139, 117, 0), 'goldenrod' : (218, 165, 32), 'goldenrod1' : (255, 193, 37), 'goldenrod2' : (238, 180, 34), 'goldenrod3' : (205, 155, 29), 'goldenrod4' : (139, 105, 20), 'gray' : (190, 190, 190), 'gray0' : (0, 0, 0), 'gray1' : (3, 3, 3), 'gray10' : (26, 26, 26), 'gray100' : (255, 255, 255), 'gray11' : (28, 28, 28), 'gray12' : (31, 31, 31), 'gray13' : (33, 33, 33), 'gray14' : (36, 36, 36), 'gray15' : (38, 38, 38), 'gray16' : (41, 41, 41), 'gray17' : (43, 43, 43), 'gray18' : (46, 46, 46), 'gray19' : (48, 48, 48), 'gray2' : (5, 5, 5), 'gray20' : (51, 51, 51), 'gray21' : (54, 54, 54), 'gray22' : (56, 56, 56), 'gray23' : (59, 59, 59), 'gray24' : (61, 61, 61), 'gray25' : (64, 64, 64), 'gray26' : (66, 66, 66), 'gray27' : (69, 69, 69), 'gray28' : (71, 71, 71), 'gray29' : (74, 74, 74), 'gray3' : (8, 8, 8), 'gray30' : (77, 77, 77), 'gray31' : (79, 79, 79), 'gray32' : (82, 82, 82), 'gray33' : (84, 84, 84), 'gray34' : (87, 87, 87), 'gray35' : (89, 89, 89), 'gray36' : (92, 92, 92), 'gray37' : (94, 94, 94), 'gray38' : (97, 97, 97), 'gray39' : (99, 99, 99), 'gray4' : (10, 10, 10), 'gray40' : (102, 102, 102), 'gray41' : (105, 105, 105), 'gray42' : (107, 107, 107), 'gray43' : (110, 110, 110), 'gray44' : (112, 112, 112), 'gray45' : (115, 115, 115), 'gray46' : (117, 117, 117), 'gray47' : (120, 120, 120), 'gray48' : (122, 122, 122), 'gray49' : (125, 125, 125), 'gray5' : (13, 13, 13), 'gray50' : (127, 127, 127), 'gray51' : (130, 130, 130), 'gray52' : (133, 133, 133), 'gray53' : (135, 135, 135), 'gray54' : (138, 138, 138), 'gray55' : (140, 140, 140), 'gray56' : (143, 143, 143), 'gray57' : (145, 145, 145), 'gray58' : (148, 148, 148), 'gray59' : (150, 150, 150), 'gray6' : (15, 15, 15), 'gray60' : (153, 153, 153), 'gray61' : (156, 156, 156), 'gray62' : (158, 158, 158), 'gray63' : (161, 161, 161), 'gray64' : (163, 163, 163), 'gray65' : (166, 166, 166), 'gray66' : (168, 168, 168), 'gray67' : (171, 171, 171), 'gray68' : (173, 173, 173), 'gray69' : (176, 176, 176), 'gray7' : (18, 18, 18), 'gray70' : (179, 179, 179), 'gray71' : (181, 181, 181), 'gray72' : (184, 184, 184), 'gray73' : (186, 186, 186), 'gray74' : (189, 189, 189), 'gray75' : (191, 191, 191), 'gray76' : (194, 194, 194), 'gray77' : (196, 196, 196), 'gray78' : (199, 199, 199), 'gray79' : (201, 201, 201), 'gray8' : (20, 20, 20), 'gray80' : (204, 204, 204), 'gray81' : (207, 207, 207), 'gray82' : (209, 209, 209), 'gray83' : (212, 212, 212), 'gray84' : (214, 214, 214), 'gray85' : (217, 217, 217), 'gray86' : (219, 219, 219), 'gray87' : (222, 222, 222), 'gray88' : (224, 224, 224), 'gray89' : (227, 227, 227), 'gray9' : (23, 23, 23), 'gray90' : (229, 229, 229), 'gray91' : (232, 232, 232), 'gray92' : (235, 235, 235), 'gray93' : (237, 237, 237), 'gray94' : (240, 240, 240), 'gray95' : (242, 242, 242), 'gray96' : (245, 245, 245), 'gray97' : (247, 247, 247), 'gray98' : (250, 250, 250), 'gray99' : (252, 252, 252), 'green' : (0, 255, 0), 'green1' : (0, 255, 0), 'green2' : (0, 238, 0), 'green3' : (0, 205, 0), 'green4' : (0, 139, 0), 'greenyellow' : (173, 255, 47), 'grey' : (190, 190, 190), 'grey0' : (0, 0, 0), 'grey1' : (3, 3, 3), 'grey10' : (26, 26, 26), 'grey100' : (255, 255, 255), 'grey11' : (28, 28, 28), 'grey12' : (31, 31, 31), 'grey13' : (33, 33, 33), 'grey14' : (36, 36, 36), 'grey15' : (38, 38, 38), 'grey16' : (41, 41, 41), 'grey17' : (43, 43, 43), 'grey18' : (46, 46, 46), 'grey19' : (48, 48, 48), 'grey2' : (5, 5, 5), 'grey20' : (51, 51, 51), 'grey21' : (54, 54, 54), 'grey22' : (56, 56, 56), 'grey23' : (59, 59, 59), 'grey24' : (61, 61, 61), 'grey25' : (64, 64, 64), 'grey26' : (66, 66, 66), 'grey27' : (69, 69, 69), 'grey28' : (71, 71, 71), 'grey29' : (74, 74, 74), 'grey3' : (8, 8, 8), 'grey30' : (77, 77, 77), 'grey31' : (79, 79, 79), 'grey32' : (82, 82, 82), 'grey33' : (84, 84, 84), 'grey34' : (87, 87, 87), 'grey35' : (89, 89, 89), 'grey36' : (92, 92, 92), 'grey37' : (94, 94, 94), 'grey38' : (97, 97, 97), 'grey39' : (99, 99, 99), 'grey4' : (10, 10, 10), 'grey40' : (102, 102, 102), 'grey41' : (105, 105, 105), 'grey42' : (107, 107, 107), 'grey43' : (110, 110, 110), 'grey44' : (112, 112, 112), 'grey45' : (115, 115, 115), 'grey46' : (117, 117, 117), 'grey47' : (120, 120, 120), 'grey48' : (122, 122, 122), 'grey49' : (125, 125, 125), 'grey5' : (13, 13, 13), 'grey50' : (127, 127, 127), 'grey51' : (130, 130, 130), 'grey52' : (133, 133, 133), 'grey53' : (135, 135, 135), 'grey54' : (138, 138, 138), 'grey55' : (140, 140, 140), 'grey56' : (143, 143, 143), 'grey57' : (145, 145, 145), 'grey58' : (148, 148, 148), 'grey59' : (150, 150, 150), 'grey6' : (15, 15, 15), 'grey60' : (153, 153, 153), 'grey61' : (156, 156, 156), 'grey62' : (158, 158, 158), 'grey63' : (161, 161, 161), 'grey64' : (163, 163, 163), 'grey65' : (166, 166, 166), 'grey66' : (168, 168, 168), 'grey67' : (171, 171, 171), 'grey68' : (173, 173, 173), 'grey69' : (176, 176, 176), 'grey7' : (18, 18, 18), 'grey70' : (179, 179, 179), 'grey71' : (181, 181, 181), 'grey72' : (184, 184, 184), 'grey73' : (186, 186, 186), 'grey74' : (189, 189, 189), 'grey75' : (191, 191, 191), 'grey76' : (194, 194, 194), 'grey77' : (196, 196, 196), 'grey78' : (199, 199, 199), 'grey79' : (201, 201, 201), 'grey8' : (20, 20, 20), 'grey80' : (204, 204, 204), 'grey81' : (207, 207, 207), 'grey82' : (209, 209, 209), 'grey83' : (212, 212, 212), 'grey84' : (214, 214, 214), 'grey85' : (217, 217, 217), 'grey86' : (219, 219, 219), 'grey87' : (222, 222, 222), 'grey88' : (224, 224, 224), 'grey89' : (227, 227, 227), 'grey9' : (23, 23, 23), 'grey90' : (229, 229, 229), 'grey91' : (232, 232, 232), 'grey92' : (235, 235, 235), 'grey93' : (237, 237, 237), 'grey94' : (240, 240, 240), 'grey95' : (242, 242, 242), 'grey96' : (245, 245, 245), 'grey97' : (247, 247, 247), 'grey98' : (250, 250, 250), 'grey99' : (252, 252, 252), 'honeydew' : (240, 255, 240), 'honeydew1' : (240, 255, 240), 'honeydew2' : (224, 238, 224), 'honeydew3' : (193, 205, 193), 'honeydew4' : (131, 139, 131), 'hotpink' : (255, 105, 180), 'hotpink1' : (255, 110, 180), 'hotpink2' : (238, 106, 167), 'hotpink3' : (205, 96, 144), 'hotpink4' : (139, 58, 98), 'indianred' : (205, 92, 92), 'indianred1' : (255, 106, 106), 'indianred2' : (238, 99, 99), 'indianred3' : (205, 85, 85), 'indianred4' : (139, 58, 58), 'ivory' : (255, 255, 240), 'ivory1' : (255, 255, 240), 'ivory2' : (238, 238, 224), 'ivory3' : (205, 205, 193), 'ivory4' : (139, 139, 131), 'khaki' : (240, 230, 140), 'khaki1' : (255, 246, 143), 'khaki2' : (238, 230, 133), 'khaki3' : (205, 198, 115), 'khaki4' : (139, 134, 78), 'lavender' : (230, 230, 250), 'lavenderblush' : (255, 240, 245), 'lavenderblush1' : (255, 240, 245), 'lavenderblush2' : (238, 224, 229), 'lavenderblush3' : (205, 193, 197), 'lavenderblush4' : (139, 131, 134), 'lawngreen' : (124, 252, 0), 'lemonchiffon' : (255, 250, 205), 'lemonchiffon1' : (255, 250, 205), 'lemonchiffon2' : (238, 233, 191), 'lemonchiffon3' : (205, 201, 165), 'lemonchiffon4' : (139, 137, 112), 'lightblue' : (173, 216, 230), 'lightblue1' : (191, 239, 255), 'lightblue2' : (178, 223, 238), 'lightblue3' : (154, 192, 205), 'lightblue4' : (104, 131, 139), 'lightcoral' : (240, 128, 128), 'lightcyan' : (224, 255, 255), 'lightcyan1' : (224, 255, 255), 'lightcyan2' : (209, 238, 238), 'lightcyan3' : (180, 205, 205), 'lightcyan4' : (122, 139, 139), 'lightgoldenrod' : (238, 221, 130), 'lightgoldenrod1' : (255, 236, 139), 'lightgoldenrod2' : (238, 220, 130), 'lightgoldenrod3' : (205, 190, 112), 'lightgoldenrod4' : (139, 129, 76), 'lightgoldenrodyellow' : (250, 250, 210), 'lightgray' : (211, 211, 211), 'lightgreen' : (144, 238, 144), 'lightgrey' : (211, 211, 211), 'lightpink' : (255, 182, 193), 'lightpink1' : (255, 174, 185), 'lightpink2' : (238, 162, 173), 'lightpink3' : (205, 140, 149), 'lightpink4' : (139, 95, 101), 'lightsalmon' : (255, 160, 122), 'lightsalmon1' : (255, 160, 122), 'lightsalmon2' : (238, 149, 114), 'lightsalmon3' : (205, 129, 98), 'lightsalmon4' : (139, 87, 66), 'lightseagreen' : (32, 178, 170), 'lightskyblue' : (135, 206, 250), 'lightskyblue1' : (176, 226, 255), 'lightskyblue2' : (164, 211, 238), 'lightskyblue3' : (141, 182, 205), 'lightskyblue4' : (96, 123, 139), 'lightslateblue' : (132, 112, 255), 'lightslategray' : (119, 136, 153), 'lightslategrey' : (119, 136, 153), 'lightsteelblue' : (176, 196, 222), 'lightsteelblue1' : (202, 225, 255), 'lightsteelblue2' : (188, 210, 238), 'lightsteelblue3' : (162, 181, 205), 'lightsteelblue4' : (110, 123, 139), 'lightyellow' : (255, 255, 224), 'lightyellow1' : (255, 255, 224), 'lightyellow2' : (238, 238, 209), 'lightyellow3' : (205, 205, 180), 'lightyellow4' : (139, 139, 122), 'limegreen' : (50, 205, 50), 'linen' : (250, 240, 230), 'magenta' : (255, 0, 255), 'magenta1' : (255, 0, 255), 'magenta2' : (238, 0, 238), 'magenta3' : (205, 0, 205), 'magenta4' : (139, 0, 139), 'maroon' : (176, 48, 96), 'maroon1' : (255, 52, 179), 'maroon2' : (238, 48, 167), 'maroon3' : (205, 41, 144), 'maroon4' : (139, 28, 98), 'mediumaquamarine' : (102, 205, 170), 'mediumblue' : (0, 0, 205), 'mediumorchid' : (186, 85, 211), 'mediumorchid1' : (224, 102, 255), 'mediumorchid2' : (209, 95, 238), 'mediumorchid3' : (180, 82, 205), 'mediumorchid4' : (122, 55, 139), 'mediumpurple' : (147, 112, 219), 'mediumpurple1' : (171, 130, 255), 'mediumpurple2' : (159, 121, 238), 'mediumpurple3' : (137, 104, 205), 'mediumpurple4' : (93, 71, 139), 'mediumseagreen' : (60, 179, 113), 'mediumslateblue' : (123, 104, 238), 'mediumspringgreen' : (0, 250, 154), 'mediumturquoise' : (72, 209, 204), 'mediumvioletred' : (199, 21, 133), 'midnightblue' : (25, 25, 112), 'mintcream' : (245, 255, 250), 'mistyrose' : (255, 228, 225), 'mistyrose1' : (255, 228, 225), 'mistyrose2' : (238, 213, 210), 'mistyrose3' : (205, 183, 181), 'mistyrose4' : (139, 125, 123), 'moccasin' : (255, 228, 181), 'navajowhite' : (255, 222, 173), 'navajowhite1' : (255, 222, 173), 'navajowhite2' : (238, 207, 161), 'navajowhite3' : (205, 179, 139), 'navajowhite4' : (139, 121, 94), 'navy' : (0, 0, 128), 'navyblue' : (0, 0, 128), 'oldlace' : (253, 245, 230), 'olivedrab' : (107, 142, 35), 'olivedrab1' : (192, 255, 62), 'olivedrab2' : (179, 238, 58), 'olivedrab3' : (154, 205, 50), 'olivedrab4' : (105, 139, 34), 'orange' : (255, 165, 0), 'orange1' : (255, 165, 0), 'orange2' : (238, 154, 0), 'orange3' : (205, 133, 0), 'orange4' : (139, 90, 0), 'orangered' : (255, 69, 0), 'orangered1' : (255, 69, 0), 'orangered2' : (238, 64, 0), 'orangered3' : (205, 55, 0), 'orangered4' : (139, 37, 0), 'orchid' : (218, 112, 214), 'orchid1' : (255, 131, 250), 'orchid2' : (238, 122, 233), 'orchid3' : (205, 105, 201), 'orchid4' : (139, 71, 137), 'palegoldenrod' : (238, 232, 170), 'palegreen' : (152, 251, 152), 'palegreen1' : (154, 255, 154), 'palegreen2' : (144, 238, 144), 'palegreen3' : (124, 205, 124), 'palegreen4' : (84, 139, 84), 'paleturquoise' : (175, 238, 238), 'paleturquoise1' : (187, 255, 255), 'paleturquoise2' : (174, 238, 238), 'paleturquoise3' : (150, 205, 205), 'paleturquoise4' : (102, 139, 139), 'palevioletred' : (219, 112, 147), 'palevioletred1' : (255, 130, 171), 'palevioletred2' : (238, 121, 159), 'palevioletred3' : (205, 104, 137), 'palevioletred4' : (139, 71, 93), 'papayawhip' : (255, 239, 213), 'peachpuff' : (255, 218, 185), 'peachpuff1' : (255, 218, 185), 'peachpuff2' : (238, 203, 173), 'peachpuff3' : (205, 175, 149), 'peachpuff4' : (139, 119, 101), 'peru' : (205, 133, 63), 'pink' : (255, 192, 203), 'pink1' : (255, 181, 197), 'pink2' : (238, 169, 184), 'pink3' : (205, 145, 158), 'pink4' : (139, 99, 108), 'plum' : (221, 160, 221), 'plum1' : (255, 187, 255), 'plum2' : (238, 174, 238), 'plum3' : (205, 150, 205), 'plum4' : (139, 102, 139), 'powderblue' : (176, 224, 230), 'purple' : (160, 32, 240), 'purple1' : (155, 48, 255), 'purple2' : (145, 44, 238), 'purple3' : (125, 38, 205), 'purple4' : (85, 26, 139), 'red' : (255, 0, 0), 'red1' : (255, 0, 0), 'red2' : (238, 0, 0), 'red3' : (205, 0, 0), 'red4' : (139, 0, 0), 'rosybrown' : (188, 143, 143), 'rosybrown1' : (255, 193, 193), 'rosybrown2' : (238, 180, 180), 'rosybrown3' : (205, 155, 155), 'rosybrown4' : (139, 105, 105), 'royalblue' : (65, 105, 225), 'royalblue1' : (72, 118, 255), 'royalblue2' : (67, 110, 238), 'royalblue3' : (58, 95, 205), 'royalblue4' : (39, 64, 139), 'saddlebrown' : (139, 69, 19), 'salmon' : (250, 128, 114), 'salmon1' : (255, 140, 105), 'salmon2' : (238, 130, 98), 'salmon3' : (205, 112, 84), 'salmon4' : (139, 76, 57), 'sandybrown' : (244, 164, 96), 'seagreen' : (46, 139, 87), 'seagreen1' : (84, 255, 159), 'seagreen2' : (78, 238, 148), 'seagreen3' : (67, 205, 128), 'seagreen4' : (46, 139, 87), 'seashell' : (255, 245, 238), 'seashell1' : (255, 245, 238), 'seashell2' : (238, 229, 222), 'seashell3' : (205, 197, 191), 'seashell4' : (139, 134, 130), 'sienna' : (160, 82, 45), 'sienna1' : (255, 130, 71), 'sienna2' : (238, 121, 66), 'sienna3' : (205, 104, 57), 'sienna4' : (139, 71, 38), 'skyblue' : (135, 206, 235), 'skyblue1' : (135, 206, 255), 'skyblue2' : (126, 192, 238), 'skyblue3' : (108, 166, 205), 'skyblue4' : (74, 112, 139), 'slateblue' : (106, 90, 205), 'slateblue1' : (131, 111, 255), 'slateblue2' : (122, 103, 238), 'slateblue3' : (105, 89, 205), 'slateblue4' : (71, 60, 139), 'slategray' : (112, 128, 144), 'slategray1' : (198, 226, 255), 'slategray2' : (185, 211, 238), 'slategray3' : (159, 182, 205), 'slategray4' : (108, 123, 139), 'slategrey' : (112, 128, 144), 'snow' : (255, 250, 250), 'snow1' : (255, 250, 250), 'snow2' : (238, 233, 233), 'snow3' : (205, 201, 201), 'snow4' : (139, 137, 137), 'springgreen' : (0, 255, 127), 'springgreen1' : (0, 255, 127), 'springgreen2' : (0, 238, 118), 'springgreen3' : (0, 205, 102), 'springgreen4' : (0, 139, 69), 'steelblue' : (70, 130, 180), 'steelblue1' : (99, 184, 255), 'steelblue2' : (92, 172, 238), 'steelblue3' : (79, 148, 205), 'steelblue4' : (54, 100, 139), 'tan' : (210, 180, 140), 'tan1' : (255, 165, 79), 'tan2' : (238, 154, 73), 'tan3' : (205, 133, 63), 'tan4' : (139, 90, 43), 'thistle' : (216, 191, 216), 'thistle1' : (255, 225, 255), 'thistle2' : (238, 210, 238), 'thistle3' : (205, 181, 205), 'thistle4' : (139, 123, 139), 'tomato' : (255, 99, 71), 'tomato1' : (255, 99, 71), 'tomato2' : (238, 92, 66), 'tomato3' : (205, 79, 57), 'tomato4' : (139, 54, 38), 'turquoise' : (64, 224, 208), 'turquoise1' : (0, 245, 255), 'turquoise2' : (0, 229, 238), 'turquoise3' : (0, 197, 205), 'turquoise4' : (0, 134, 139), 'violet' : (238, 130, 238), 'violetred' : (208, 32, 144), 'violetred1' : (255, 62, 150), 'violetred2' : (238, 58, 140), 'violetred3' : (205, 50, 120), 'violetred4' : (139, 34, 82), 'wheat' : (245, 222, 179), 'wheat1' : (255, 231, 186), 'wheat2' : (238, 216, 174), 'wheat3' : (205, 186, 150), 'wheat4' : (139, 126, 102), 'white' : (255, 255, 255), 'whitesmoke' : (245, 245, 245), 'yellow' : (255, 255, 0), 'yellow1' : (255, 255, 0), 'yellow2' : (238, 238, 0), 'yellow3' : (205, 205, 0), 'yellow4' : (139, 139, 0), 'yellowgreen' : (154, 205, 50), } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1611641994.0 pygame_sdl2-2.1.0+renpy8.4.1/include/controller.pxi0000664000175000017500000000256014003732212020211 0ustar00tomtomCONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1611641997.0 pygame_sdl2-2.1.0+renpy8.4.1/include/event_enum.pxi0000664000175000017500000000271014003732215020173 0ustar00tomtom# Automatically generated by generate_event_list.py # Do not edit! cdef extern from "SDL.h": enum SDL_EventType: SDL_FIRSTEVENT SDL_QUIT SDL_APP_TERMINATING SDL_APP_LOWMEMORY SDL_APP_WILLENTERBACKGROUND SDL_APP_DIDENTERBACKGROUND SDL_APP_WILLENTERFOREGROUND SDL_APP_DIDENTERFOREGROUND SDL_DISPLAYEVENT SDL_WINDOWEVENT SDL_SYSWMEVENT SDL_KEYDOWN SDL_KEYUP SDL_TEXTEDITING SDL_TEXTINPUT SDL_KEYMAPCHANGED SDL_MOUSEMOTION SDL_MOUSEBUTTONDOWN SDL_MOUSEBUTTONUP SDL_MOUSEWHEEL SDL_JOYAXISMOTION SDL_JOYBALLMOTION SDL_JOYHATMOTION SDL_JOYBUTTONDOWN SDL_JOYBUTTONUP SDL_JOYDEVICEADDED SDL_JOYDEVICEREMOVED SDL_CONTROLLERAXISMOTION SDL_CONTROLLERBUTTONDOWN SDL_CONTROLLERBUTTONUP SDL_CONTROLLERDEVICEADDED SDL_CONTROLLERDEVICEREMOVED SDL_CONTROLLERDEVICEREMAPPED SDL_FINGERDOWN SDL_FINGERUP SDL_FINGERMOTION SDL_DOLLARGESTURE SDL_DOLLARRECORD SDL_MULTIGESTURE SDL_CLIPBOARDUPDATE SDL_DROPFILE SDL_DROPTEXT SDL_DROPBEGIN SDL_DROPCOMPLETE SDL_AUDIODEVICEADDED SDL_AUDIODEVICEREMOVED SDL_SENSORUPDATE SDL_RENDER_TARGETS_RESET SDL_RENDER_DEVICE_RESET SDL_USEREVENT SDL_LASTEVENT ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1611641997.0 pygame_sdl2-2.1.0+renpy8.4.1/include/event_list.pxi0000664000175000017500000000351714003732215020210 0ustar00tomtom# Automatically generated by generate_event_list.py # Do not edit! NOEVENT = SDL_FIRSTEVENT QUIT = SDL_QUIT APP_TERMINATING = SDL_APP_TERMINATING APP_LOWMEMORY = SDL_APP_LOWMEMORY APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND DISPLAYEVENT = SDL_DISPLAYEVENT WINDOWEVENT = SDL_WINDOWEVENT SYSWMEVENT = SDL_SYSWMEVENT KEYDOWN = SDL_KEYDOWN KEYUP = SDL_KEYUP TEXTEDITING = SDL_TEXTEDITING TEXTINPUT = SDL_TEXTINPUT KEYMAPCHANGED = SDL_KEYMAPCHANGED MOUSEMOTION = SDL_MOUSEMOTION MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN MOUSEBUTTONUP = SDL_MOUSEBUTTONUP MOUSEWHEEL = SDL_MOUSEWHEEL JOYAXISMOTION = SDL_JOYAXISMOTION JOYBALLMOTION = SDL_JOYBALLMOTION JOYHATMOTION = SDL_JOYHATMOTION JOYBUTTONDOWN = SDL_JOYBUTTONDOWN JOYBUTTONUP = SDL_JOYBUTTONUP JOYDEVICEADDED = SDL_JOYDEVICEADDED JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED FINGERDOWN = SDL_FINGERDOWN FINGERUP = SDL_FINGERUP FINGERMOTION = SDL_FINGERMOTION DOLLARGESTURE = SDL_DOLLARGESTURE DOLLARRECORD = SDL_DOLLARRECORD MULTIGESTURE = SDL_MULTIGESTURE CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE DROPFILE = SDL_DROPFILE DROPTEXT = SDL_DROPTEXT DROPBEGIN = SDL_DROPBEGIN DROPCOMPLETE = SDL_DROPCOMPLETE AUDIODEVICEADDED = SDL_AUDIODEVICEADDED AUDIODEVICEREMOVED = SDL_AUDIODEVICEREMOVED SENSORUPDATE = SDL_SENSORUPDATE RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET RENDER_DEVICE_RESET = SDL_RENDER_DEVICE_RESET USEREVENT = SDL_USEREVENT LASTEVENT = SDL_LASTEVENT ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1611641997.0 pygame_sdl2-2.1.0+renpy8.4.1/include/event_names.pxi0000664000175000017500000000430714003732215020336 0ustar00tomtom# Automatically generated by generate_event_list.py # Do not edit! event_names = { SDL_FIRSTEVENT : u'NOEVENT', SDL_QUIT : 'QUIT', SDL_APP_TERMINATING : 'APP_TERMINATING', SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', SDL_DISPLAYEVENT : 'DISPLAYEVENT', SDL_WINDOWEVENT : 'WINDOWEVENT', SDL_SYSWMEVENT : 'SYSWMEVENT', SDL_KEYDOWN : 'KEYDOWN', SDL_KEYUP : 'KEYUP', SDL_TEXTEDITING : 'TEXTEDITING', SDL_TEXTINPUT : 'TEXTINPUT', SDL_KEYMAPCHANGED : 'KEYMAPCHANGED', SDL_MOUSEMOTION : 'MOUSEMOTION', SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', SDL_MOUSEWHEEL : 'MOUSEWHEEL', SDL_JOYAXISMOTION : 'JOYAXISMOTION', SDL_JOYBALLMOTION : 'JOYBALLMOTION', SDL_JOYHATMOTION : 'JOYHATMOTION', SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', SDL_JOYBUTTONUP : 'JOYBUTTONUP', SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', SDL_FINGERDOWN : 'FINGERDOWN', SDL_FINGERUP : 'FINGERUP', SDL_FINGERMOTION : 'FINGERMOTION', SDL_DOLLARGESTURE : 'DOLLARGESTURE', SDL_DOLLARRECORD : 'DOLLARRECORD', SDL_MULTIGESTURE : 'MULTIGESTURE', SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', SDL_DROPFILE : 'DROPFILE', SDL_DROPTEXT : 'DROPTEXT', SDL_DROPBEGIN : 'DROPBEGIN', SDL_DROPCOMPLETE : 'DROPCOMPLETE', SDL_AUDIODEVICEADDED : 'AUDIODEVICEADDED', SDL_AUDIODEVICEREMOVED : 'AUDIODEVICEREMOVED', SDL_SENSORUPDATE : 'SENSORUPDATE', SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', SDL_RENDER_DEVICE_RESET : 'RENDER_DEVICE_RESET', SDL_USEREVENT : 'USEREVENT', SDL_LASTEVENT : 'LASTEVENT', } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1611642000.0 pygame_sdl2-2.1.0+renpy8.4.1/include/glattr.pxi0000664000175000017500000000230414003732220017316 0ustar00tomtomGL_RED_SIZE = SDL_GL_RED_SIZE GL_GREEN_SIZE = SDL_GL_GREEN_SIZE GL_BLUE_SIZE = SDL_GL_BLUE_SIZE GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE GL_STEREO = SDL_GL_STEREO GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE GL_CONTEXT_RELEASE_BEHAVIOR = SDL_GL_CONTEXT_RELEASE_BEHAVIOR GL_CONTEXT_RESET_NOTIFICATION = SDL_GL_CONTEXT_RESET_NOTIFICATION GL_CONTEXT_NO_ERROR = SDL_GL_CONTEXT_NO_ERROR ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1611642003.0 pygame_sdl2-2.1.0+renpy8.4.1/include/keycode_list.pxi0000664000175000017500000001302214003732223020501 0ustar00tomtom# Automatically generated by generate_keycode_list.py # Do not edit! K_UNKNOWN = SDLK_UNKNOWN K_RETURN = SDLK_RETURN K_ESCAPE = SDLK_ESCAPE K_BACKSPACE = SDLK_BACKSPACE K_TAB = SDLK_TAB K_SPACE = SDLK_SPACE K_EXCLAIM = SDLK_EXCLAIM K_QUOTEDBL = SDLK_QUOTEDBL K_HASH = SDLK_HASH K_PERCENT = SDLK_PERCENT K_DOLLAR = SDLK_DOLLAR K_AMPERSAND = SDLK_AMPERSAND K_QUOTE = SDLK_QUOTE K_LEFTPAREN = SDLK_LEFTPAREN K_RIGHTPAREN = SDLK_RIGHTPAREN K_ASTERISK = SDLK_ASTERISK K_PLUS = SDLK_PLUS K_COMMA = SDLK_COMMA K_MINUS = SDLK_MINUS K_PERIOD = SDLK_PERIOD K_SLASH = SDLK_SLASH K_0 = SDLK_0 K_1 = SDLK_1 K_2 = SDLK_2 K_3 = SDLK_3 K_4 = SDLK_4 K_5 = SDLK_5 K_6 = SDLK_6 K_7 = SDLK_7 K_8 = SDLK_8 K_9 = SDLK_9 K_COLON = SDLK_COLON K_SEMICOLON = SDLK_SEMICOLON K_LESS = SDLK_LESS K_EQUALS = SDLK_EQUALS K_GREATER = SDLK_GREATER K_QUESTION = SDLK_QUESTION K_AT = SDLK_AT K_LEFTBRACKET = SDLK_LEFTBRACKET K_BACKSLASH = SDLK_BACKSLASH K_RIGHTBRACKET = SDLK_RIGHTBRACKET K_CARET = SDLK_CARET K_UNDERSCORE = SDLK_UNDERSCORE K_BACKQUOTE = SDLK_BACKQUOTE K_a = SDLK_a K_b = SDLK_b K_c = SDLK_c K_d = SDLK_d K_e = SDLK_e K_f = SDLK_f K_g = SDLK_g K_h = SDLK_h K_i = SDLK_i K_j = SDLK_j K_k = SDLK_k K_l = SDLK_l K_m = SDLK_m K_n = SDLK_n K_o = SDLK_o K_p = SDLK_p K_q = SDLK_q K_r = SDLK_r K_s = SDLK_s K_t = SDLK_t K_u = SDLK_u K_v = SDLK_v K_w = SDLK_w K_x = SDLK_x K_y = SDLK_y K_z = SDLK_z K_CAPSLOCK = SDLK_CAPSLOCK K_F1 = SDLK_F1 K_F2 = SDLK_F2 K_F3 = SDLK_F3 K_F4 = SDLK_F4 K_F5 = SDLK_F5 K_F6 = SDLK_F6 K_F7 = SDLK_F7 K_F8 = SDLK_F8 K_F9 = SDLK_F9 K_F10 = SDLK_F10 K_F11 = SDLK_F11 K_F12 = SDLK_F12 K_PRINTSCREEN = SDLK_PRINTSCREEN K_SCROLLLOCK = SDLK_SCROLLLOCK K_PAUSE = SDLK_PAUSE K_INSERT = SDLK_INSERT K_HOME = SDLK_HOME K_PAGEUP = SDLK_PAGEUP K_DELETE = SDLK_DELETE K_END = SDLK_END K_PAGEDOWN = SDLK_PAGEDOWN K_RIGHT = SDLK_RIGHT K_LEFT = SDLK_LEFT K_DOWN = SDLK_DOWN K_UP = SDLK_UP K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR K_KP_DIVIDE = SDLK_KP_DIVIDE K_KP_MULTIPLY = SDLK_KP_MULTIPLY K_KP_MINUS = SDLK_KP_MINUS K_KP_PLUS = SDLK_KP_PLUS K_KP_ENTER = SDLK_KP_ENTER K_KP_1 = SDLK_KP_1 K_KP_2 = SDLK_KP_2 K_KP_3 = SDLK_KP_3 K_KP_4 = SDLK_KP_4 K_KP_5 = SDLK_KP_5 K_KP_6 = SDLK_KP_6 K_KP_7 = SDLK_KP_7 K_KP_8 = SDLK_KP_8 K_KP_9 = SDLK_KP_9 K_KP_0 = SDLK_KP_0 K_KP_PERIOD = SDLK_KP_PERIOD K_APPLICATION = SDLK_APPLICATION K_POWER = SDLK_POWER K_KP_EQUALS = SDLK_KP_EQUALS K_F13 = SDLK_F13 K_F14 = SDLK_F14 K_F15 = SDLK_F15 K_F16 = SDLK_F16 K_F17 = SDLK_F17 K_F18 = SDLK_F18 K_F19 = SDLK_F19 K_F20 = SDLK_F20 K_F21 = SDLK_F21 K_F22 = SDLK_F22 K_F23 = SDLK_F23 K_F24 = SDLK_F24 K_EXECUTE = SDLK_EXECUTE K_HELP = SDLK_HELP K_MENU = SDLK_MENU K_SELECT = SDLK_SELECT K_STOP = SDLK_STOP K_AGAIN = SDLK_AGAIN K_UNDO = SDLK_UNDO K_CUT = SDLK_CUT K_COPY = SDLK_COPY K_PASTE = SDLK_PASTE K_FIND = SDLK_FIND K_MUTE = SDLK_MUTE K_VOLUMEUP = SDLK_VOLUMEUP K_VOLUMEDOWN = SDLK_VOLUMEDOWN K_KP_COMMA = SDLK_KP_COMMA K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 K_ALTERASE = SDLK_ALTERASE K_SYSREQ = SDLK_SYSREQ K_CANCEL = SDLK_CANCEL K_CLEAR = SDLK_CLEAR K_PRIOR = SDLK_PRIOR K_RETURN2 = SDLK_RETURN2 K_SEPARATOR = SDLK_SEPARATOR K_OUT = SDLK_OUT K_OPER = SDLK_OPER K_CLEARAGAIN = SDLK_CLEARAGAIN K_CRSEL = SDLK_CRSEL K_EXSEL = SDLK_EXSEL K_KP_00 = SDLK_KP_00 K_KP_000 = SDLK_KP_000 K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR K_CURRENCYUNIT = SDLK_CURRENCYUNIT K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE K_KP_TAB = SDLK_KP_TAB K_KP_BACKSPACE = SDLK_KP_BACKSPACE K_KP_A = SDLK_KP_A K_KP_B = SDLK_KP_B K_KP_C = SDLK_KP_C K_KP_D = SDLK_KP_D K_KP_E = SDLK_KP_E K_KP_F = SDLK_KP_F K_KP_XOR = SDLK_KP_XOR K_KP_POWER = SDLK_KP_POWER K_KP_PERCENT = SDLK_KP_PERCENT K_KP_LESS = SDLK_KP_LESS K_KP_GREATER = SDLK_KP_GREATER K_KP_AMPERSAND = SDLK_KP_AMPERSAND K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR K_KP_COLON = SDLK_KP_COLON K_KP_HASH = SDLK_KP_HASH K_KP_SPACE = SDLK_KP_SPACE K_KP_AT = SDLK_KP_AT K_KP_EXCLAM = SDLK_KP_EXCLAM K_KP_MEMSTORE = SDLK_KP_MEMSTORE K_KP_MEMRECALL = SDLK_KP_MEMRECALL K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR K_KP_MEMADD = SDLK_KP_MEMADD K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS K_KP_CLEAR = SDLK_KP_CLEAR K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY K_KP_BINARY = SDLK_KP_BINARY K_KP_OCTAL = SDLK_KP_OCTAL K_KP_DECIMAL = SDLK_KP_DECIMAL K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL K_LCTRL = SDLK_LCTRL K_LSHIFT = SDLK_LSHIFT K_LALT = SDLK_LALT K_LGUI = SDLK_LGUI K_RCTRL = SDLK_RCTRL K_RSHIFT = SDLK_RSHIFT K_RALT = SDLK_RALT K_RGUI = SDLK_RGUI K_MODE = SDLK_MODE K_AUDIONEXT = SDLK_AUDIONEXT K_AUDIOPREV = SDLK_AUDIOPREV K_AUDIOSTOP = SDLK_AUDIOSTOP K_AUDIOPLAY = SDLK_AUDIOPLAY K_AUDIOMUTE = SDLK_AUDIOMUTE K_MEDIASELECT = SDLK_MEDIASELECT K_WWW = SDLK_WWW K_MAIL = SDLK_MAIL K_CALCULATOR = SDLK_CALCULATOR K_COMPUTER = SDLK_COMPUTER K_AC_SEARCH = SDLK_AC_SEARCH K_AC_HOME = SDLK_AC_HOME K_AC_BACK = SDLK_AC_BACK K_AC_FORWARD = SDLK_AC_FORWARD K_AC_STOP = SDLK_AC_STOP K_AC_REFRESH = SDLK_AC_REFRESH K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN K_KBDILLUMUP = SDLK_KBDILLUMUP K_EJECT = SDLK_EJECT K_SLEEP = SDLK_SLEEP K_APP1 = SDLK_APP1 K_APP2 = SDLK_APP2 K_AUDIOREWIND = SDLK_AUDIOREWIND K_AUDIOFASTFORWARD = SDLK_AUDIOFASTFORWARD ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1611642399.0 pygame_sdl2-2.1.0+renpy8.4.1/include/sdl2.pxd0000664000175000017500000025671614003733037016711 0ustar00tomtomfrom libc.stdint cimport * from libc.stdio cimport * from libc.stddef cimport * cdef extern from "SDL.h" nogil: cdef struct _SDL_iconv_t cdef struct SDL_BlitMap ctypedef struct SDL_AudioCVT const char *SDL_GetPlatform() ctypedef enum SDL_bool: SDL_FALSE SDL_TRUE ctypedef int8_t Sint8 ctypedef uint8_t Uint8 ctypedef int16_t Sint16 ctypedef uint16_t Uint16 ctypedef int32_t Sint32 ctypedef uint32_t Uint32 ctypedef int64_t Sint64 ctypedef uint64_t Uint64 void *SDL_malloc(size_t size) void *SDL_calloc(size_t nmemb, size_t size) void *SDL_realloc(void *mem, size_t size) void SDL_free(void *mem) ctypedef void *(*SDL_malloc_func)(size_t size) ctypedef void *(*SDL_calloc_func)(size_t nmemb, size_t size) ctypedef void *(*SDL_realloc_func)(void *mem, size_t size) ctypedef void (*SDL_free_func)(void *mem) void SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func, SDL_calloc_func *calloc_func, SDL_realloc_func *realloc_func, SDL_free_func *free_func) int SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, SDL_calloc_func calloc_func, SDL_realloc_func realloc_func, SDL_free_func free_func) int SDL_GetNumAllocations() char *SDL_getenv(const char *name) int SDL_setenv(const char *name, const char *value, int overwrite) void SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare)(const void *, const void *)) int SDL_abs(int x) int SDL_isdigit(int x) int SDL_isspace(int x) int SDL_toupper(int x) int SDL_tolower(int x) void *SDL_memset(void *dst, int c, size_t len) void *SDL_memcpy(void *dst, const void *src, size_t len) void *SDL_memmove(void *dst, const void *src, size_t len) int SDL_memcmp(const void *s1, const void *s2, size_t len) wchar_t *SDL_wcsdup(const wchar_t *wstr) size_t SDL_wcslen(const wchar_t *wstr) size_t SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen) size_t SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen) int SDL_wcscmp(const wchar_t *str1, const wchar_t *str2) size_t SDL_strlen(const char *str) size_t SDL_strlcpy(char *dst, const char *src, size_t maxlen) size_t SDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes) size_t SDL_strlcat(char *dst, const char *src, size_t maxlen) char *SDL_strdup(const char *str) char *SDL_strrev(char *str) char *SDL_strupr(char *str) char *SDL_strlwr(char *str) char *SDL_strchr(const char *str, int c) char *SDL_strrchr(const char *str, int c) char *SDL_strstr(const char *haystack, const char *needle) size_t SDL_utf8strlen(const char *str) char *SDL_itoa(int value, char *str, int radix) char *SDL_uitoa(unsigned int value, char *str, int radix) char *SDL_ltoa(long value, char *str, int radix) char *SDL_ultoa(unsigned long value, char *str, int radix) char *SDL_lltoa(Sint64 value, char *str, int radix) char *SDL_ulltoa(Uint64 value, char *str, int radix) int SDL_atoi(const char *str) double SDL_atof(const char *str) long SDL_strtol(const char *str, char **endp, int base) unsigned long SDL_strtoul(const char *str, char **endp, int base) Sint64 SDL_strtoll(const char *str, char **endp, int base) Uint64 SDL_strtoull(const char *str, char **endp, int base) double SDL_strtod(const char *str, char **endp) int SDL_strcmp(const char *str1, const char *str2) int SDL_strncmp(const char *str1, const char *str2, size_t maxlen) int SDL_strcasecmp(const char *str1, const char *str2) int SDL_strncasecmp(const char *str1, const char *str2, size_t len) int SDL_sscanf(const char *text, const char *fmt, ...) int SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...) double SDL_acos(double x) float SDL_acosf(float x) double SDL_asin(double x) float SDL_asinf(float x) double SDL_atan(double x) float SDL_atanf(float x) double SDL_atan2(double x, double y) float SDL_atan2f(float x, float y) double SDL_ceil(double x) float SDL_ceilf(float x) double SDL_copysign(double x, double y) float SDL_copysignf(float x, float y) double SDL_cos(double x) float SDL_cosf(float x) double SDL_exp(double x) float SDL_expf(float x) double SDL_fabs(double x) float SDL_fabsf(float x) double SDL_floor(double x) float SDL_floorf(float x) double SDL_fmod(double x, double y) float SDL_fmodf(float x, float y) double SDL_log(double x) float SDL_logf(float x) double SDL_log10(double x) float SDL_log10f(float x) double SDL_pow(double x, double y) float SDL_powf(float x, float y) double SDL_scalbn(double x, int n) float SDL_scalbnf(float x, int n) double SDL_sin(double x) float SDL_sinf(float x) double SDL_sqrt(double x) float SDL_sqrtf(float x) double SDL_tan(double x) float SDL_tanf(float x) ctypedef _SDL_iconv_t *SDL_iconv_t SDL_iconv_t SDL_iconv_open(const char *tocode, const char *fromcode) int SDL_iconv_close(SDL_iconv_t cd) size_t SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft) ctypedef int (*SDL_main_func)(int argc, char *argv[]) int SDL_main(int argc, char *argv[]) void SDL_SetMainReady() ctypedef enum SDL_AssertState: SDL_ASSERTION_RETRY SDL_ASSERTION_BREAK SDL_ASSERTION_ABORT SDL_ASSERTION_IGNORE SDL_ASSERTION_ALWAYS_IGNORE ctypedef struct SDL_AssertData: int always_ignore unsigned int trigger_count const char *condition const char *filename int linenum const char *function const SDL_AssertData *next SDL_AssertState SDL_ReportAssertion(SDL_AssertData *, const char *, const char *, int) ctypedef SDL_AssertState (*SDL_AssertionHandler)(const SDL_AssertData *data, void *userdata) void SDL_SetAssertionHandler(SDL_AssertionHandler handler, void *userdata) SDL_AssertionHandler SDL_GetDefaultAssertionHandler() SDL_AssertionHandler SDL_GetAssertionHandler(void **puserdata) const SDL_AssertData *SDL_GetAssertionReport() void SDL_ResetAssertionReport() ctypedef int SDL_SpinLock SDL_bool SDL_AtomicTryLock(SDL_SpinLock *lock) void SDL_AtomicLock(SDL_SpinLock *lock) void SDL_AtomicUnlock(SDL_SpinLock *lock) void SDL_MemoryBarrierReleaseFunction() void SDL_MemoryBarrierAcquireFunction() ctypedef struct SDL_atomic_t: int value SDL_bool SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval) int SDL_AtomicSet(SDL_atomic_t *a, int v) int SDL_AtomicGet(SDL_atomic_t *a) int SDL_AtomicAdd(SDL_atomic_t *a, int v) SDL_bool SDL_AtomicCASPtr(void **a, void *oldval, void *newval) void *SDL_AtomicSetPtr(void **a, void *v) void *SDL_AtomicGetPtr(void **a) int SDL_SetError(const char *fmt, ...) const char *SDL_GetError() void SDL_ClearError() ctypedef enum SDL_errorcode: SDL_ENOMEM SDL_EFREAD SDL_EFWRITE SDL_EFSEEK SDL_UNSUPPORTED SDL_LASTERROR int SDL_Error(SDL_errorcode code) ctypedef struct SDL_mutex SDL_mutex *SDL_CreateMutex() int SDL_LockMutex(SDL_mutex *mutex) int SDL_TryLockMutex(SDL_mutex *mutex) int SDL_UnlockMutex(SDL_mutex *mutex) void SDL_DestroyMutex(SDL_mutex *mutex) cdef struct SDL_semaphore ctypedef struct SDL_sem SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) void SDL_DestroySemaphore(SDL_sem *sem) int SDL_SemWait(SDL_sem *sem) int SDL_SemTryWait(SDL_sem *sem) int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms) int SDL_SemPost(SDL_sem *sem) Uint32 SDL_SemValue(SDL_sem *sem) ctypedef struct SDL_cond SDL_cond *SDL_CreateCond() void SDL_DestroyCond(SDL_cond *cond) int SDL_CondSignal(SDL_cond *cond) int SDL_CondBroadcast(SDL_cond *cond) int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) ctypedef struct SDL_Thread ctypedef unsigned long SDL_threadID ctypedef unsigned int SDL_TLSID ctypedef enum SDL_ThreadPriority: SDL_THREAD_PRIORITY_LOW SDL_THREAD_PRIORITY_NORMAL SDL_THREAD_PRIORITY_HIGH SDL_THREAD_PRIORITY_TIME_CRITICAL ctypedef int (*SDL_ThreadFunction)(void *data) SDL_Thread *SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data) SDL_Thread *SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data) const char *SDL_GetThreadName(SDL_Thread *thread) SDL_threadID SDL_ThreadID() SDL_threadID SDL_GetThreadID(SDL_Thread *thread) int SDL_SetThreadPriority(SDL_ThreadPriority priority) void SDL_WaitThread(SDL_Thread *thread, int *status) void SDL_DetachThread(SDL_Thread *thread) SDL_TLSID SDL_TLSCreate() void *SDL_TLSGet(SDL_TLSID id) int SDL_TLSSet(SDL_TLSID id, const void *value, void (*destructor)(void *)) cdef struct anon_struct_2: SDL_bool autoclose FILE *fp cdef struct anon_struct_3: Uint8 *base Uint8 *here Uint8 *stop cdef struct anon_struct_4: void *data1 void *data2 cdef union anon_union_1: anon_struct_2 stdio anon_struct_3 mem anon_struct_4 unknown ctypedef struct SDL_RWops: Sint64 (*size)(SDL_RWops *context) Sint64 (*seek)(SDL_RWops *context, Sint64 offset, int whence) size_t (*read)(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) size_t (*write)(SDL_RWops *context, const void *ptr, size_t size, size_t num) int (*close)(SDL_RWops *context) Uint32 type anon_union_1 hidden SDL_RWops *SDL_RWFromFile(const char *file, const char *mode) SDL_RWops *SDL_RWFromFP(FILE *fp, SDL_bool autoclose) SDL_RWops *SDL_RWFromMem(void *mem, int size) SDL_RWops *SDL_RWFromConstMem(const void *mem, int size) SDL_RWops *SDL_AllocRW() void SDL_FreeRW(SDL_RWops *area) Sint64 SDL_RWsize(SDL_RWops *context) Sint64 SDL_RWseek(SDL_RWops *context, Sint64 offset, int whence) Sint64 SDL_RWtell(SDL_RWops *context) size_t SDL_RWread(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) size_t SDL_RWwrite(SDL_RWops *context, const void *ptr, size_t size, size_t num) int SDL_RWclose(SDL_RWops *context) void *SDL_LoadFile_RW(SDL_RWops *src, size_t *datasize, int freesrc) void *SDL_LoadFile(const char *file, size_t *datasize) Uint8 SDL_ReadU8(SDL_RWops *src) Uint16 SDL_ReadLE16(SDL_RWops *src) Uint16 SDL_ReadBE16(SDL_RWops *src) Uint32 SDL_ReadLE32(SDL_RWops *src) Uint32 SDL_ReadBE32(SDL_RWops *src) Uint64 SDL_ReadLE64(SDL_RWops *src) Uint64 SDL_ReadBE64(SDL_RWops *src) size_t SDL_WriteU8(SDL_RWops *dst, Uint8 value) size_t SDL_WriteLE16(SDL_RWops *dst, Uint16 value) size_t SDL_WriteBE16(SDL_RWops *dst, Uint16 value) size_t SDL_WriteLE32(SDL_RWops *dst, Uint32 value) size_t SDL_WriteBE32(SDL_RWops *dst, Uint32 value) size_t SDL_WriteLE64(SDL_RWops *dst, Uint64 value) size_t SDL_WriteBE64(SDL_RWops *dst, Uint64 value) ctypedef Uint16 SDL_AudioFormat ctypedef void (*SDL_AudioCallback)(void *userdata, Uint8 *stream, int len) ctypedef struct SDL_AudioSpec: int freq SDL_AudioFormat format Uint8 channels Uint8 silence Uint16 samples Uint16 padding Uint32 size SDL_AudioCallback callback void *userdata ctypedef void (*SDL_AudioFilter)(SDL_AudioCVT *cvt, SDL_AudioFormat format) ctypedef struct SDL_AudioCVT: int needed SDL_AudioFormat src_format SDL_AudioFormat dst_format double rate_incr Uint8 *buf int len int len_cvt int len_mult double len_ratio SDL_AudioFilter filters[9 + 1] int filter_index int SDL_GetNumAudioDrivers() const char *SDL_GetAudioDriver(int index) int SDL_AudioInit(const char *driver_name) void SDL_AudioQuit() const char *SDL_GetCurrentAudioDriver() int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained) ctypedef Uint32 SDL_AudioDeviceID int SDL_GetNumAudioDevices(int iscapture) const char *SDL_GetAudioDeviceName(int index, int iscapture) SDL_AudioDeviceID SDL_OpenAudioDevice(const char *device, int iscapture, const SDL_AudioSpec *desired, SDL_AudioSpec *obtained, int allowed_changes) ctypedef enum SDL_AudioStatus: SDL_AUDIO_STOPPED SDL_AUDIO_PLAYING SDL_AUDIO_PAUSED SDL_AudioStatus SDL_GetAudioStatus() SDL_AudioStatus SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev) void SDL_PauseAudio(int pause_on) void SDL_PauseAudioDevice(SDL_AudioDeviceID dev, int pause_on) SDL_AudioSpec *SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) void SDL_FreeWAV(Uint8 *audio_buf) int SDL_BuildAudioCVT(SDL_AudioCVT *cvt, SDL_AudioFormat src_format, Uint8 src_channels, int src_rate, SDL_AudioFormat dst_format, Uint8 dst_channels, int dst_rate) int SDL_ConvertAudio(SDL_AudioCVT *cvt) ctypedef struct SDL_AudioStream SDL_AudioStream *SDL_NewAudioStream(const SDL_AudioFormat src_format, const Uint8 src_channels, const int src_rate, const SDL_AudioFormat dst_format, const Uint8 dst_channels, const int dst_rate) int SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len) int SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len) int SDL_AudioStreamAvailable(SDL_AudioStream *stream) int SDL_AudioStreamFlush(SDL_AudioStream *stream) void SDL_AudioStreamClear(SDL_AudioStream *stream) void SDL_FreeAudioStream(SDL_AudioStream *stream) void SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume) void SDL_MixAudioFormat(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, int volume) int SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len) Uint32 SDL_DequeueAudio(SDL_AudioDeviceID dev, void *data, Uint32 len) Uint32 SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev) void SDL_ClearQueuedAudio(SDL_AudioDeviceID dev) void SDL_LockAudio() void SDL_LockAudioDevice(SDL_AudioDeviceID dev) void SDL_UnlockAudio() void SDL_UnlockAudioDevice(SDL_AudioDeviceID dev) void SDL_CloseAudio() void SDL_CloseAudioDevice(SDL_AudioDeviceID dev) int SDL_SetClipboardText(const char *text) char *SDL_GetClipboardText() SDL_bool SDL_HasClipboardText() int SDL_GetCPUCount() int SDL_GetCPUCacheLineSize() SDL_bool SDL_HasRDTSC() SDL_bool SDL_HasAltiVec() SDL_bool SDL_HasMMX() SDL_bool SDL_Has3DNow() SDL_bool SDL_HasSSE() SDL_bool SDL_HasSSE2() SDL_bool SDL_HasSSE3() SDL_bool SDL_HasSSE41() SDL_bool SDL_HasSSE42() SDL_bool SDL_HasAVX() SDL_bool SDL_HasAVX2() SDL_bool SDL_HasAVX512F() SDL_bool SDL_HasNEON() int SDL_GetSystemRAM() size_t SDL_SIMDGetAlignment() void *SDL_SIMDAlloc(const size_t len) void SDL_SIMDFree(void *ptr) cdef enum: SDL_PIXELTYPE_UNKNOWN SDL_PIXELTYPE_INDEX1 SDL_PIXELTYPE_INDEX4 SDL_PIXELTYPE_INDEX8 SDL_PIXELTYPE_PACKED8 SDL_PIXELTYPE_PACKED16 SDL_PIXELTYPE_PACKED32 SDL_PIXELTYPE_ARRAYU8 SDL_PIXELTYPE_ARRAYU16 SDL_PIXELTYPE_ARRAYU32 SDL_PIXELTYPE_ARRAYF16 SDL_PIXELTYPE_ARRAYF32 cdef enum: SDL_BITMAPORDER_NONE SDL_BITMAPORDER_4321 SDL_BITMAPORDER_1234 cdef enum: SDL_PACKEDORDER_NONE SDL_PACKEDORDER_XRGB SDL_PACKEDORDER_RGBX SDL_PACKEDORDER_ARGB SDL_PACKEDORDER_RGBA SDL_PACKEDORDER_XBGR SDL_PACKEDORDER_BGRX SDL_PACKEDORDER_ABGR SDL_PACKEDORDER_BGRA cdef enum: SDL_ARRAYORDER_NONE SDL_ARRAYORDER_RGB SDL_ARRAYORDER_RGBA SDL_ARRAYORDER_ARGB SDL_ARRAYORDER_BGR SDL_ARRAYORDER_BGRA SDL_ARRAYORDER_ABGR cdef enum: SDL_PACKEDLAYOUT_NONE SDL_PACKEDLAYOUT_332 SDL_PACKEDLAYOUT_4444 SDL_PACKEDLAYOUT_1555 SDL_PACKEDLAYOUT_5551 SDL_PACKEDLAYOUT_565 SDL_PACKEDLAYOUT_8888 SDL_PACKEDLAYOUT_2101010 SDL_PACKEDLAYOUT_1010102 ctypedef enum SDL_PixelFormatEnum: SDL_PIXELFORMAT_UNKNOWN SDL_PIXELFORMAT_INDEX1LSB SDL_PIXELFORMAT_INDEX1MSB SDL_PIXELFORMAT_INDEX4LSB SDL_PIXELFORMAT_INDEX4MSB SDL_PIXELFORMAT_INDEX8 SDL_PIXELFORMAT_RGB332 SDL_PIXELFORMAT_RGB444 SDL_PIXELFORMAT_RGB555 SDL_PIXELFORMAT_BGR555 SDL_PIXELFORMAT_ARGB4444 SDL_PIXELFORMAT_RGBA4444 SDL_PIXELFORMAT_ABGR4444 SDL_PIXELFORMAT_BGRA4444 SDL_PIXELFORMAT_ARGB1555 SDL_PIXELFORMAT_RGBA5551 SDL_PIXELFORMAT_ABGR1555 SDL_PIXELFORMAT_BGRA5551 SDL_PIXELFORMAT_RGB565 SDL_PIXELFORMAT_BGR565 SDL_PIXELFORMAT_RGB24 SDL_PIXELFORMAT_BGR24 SDL_PIXELFORMAT_RGB888 SDL_PIXELFORMAT_RGBX8888 SDL_PIXELFORMAT_BGR888 SDL_PIXELFORMAT_BGRX8888 SDL_PIXELFORMAT_ARGB8888 SDL_PIXELFORMAT_RGBA8888 SDL_PIXELFORMAT_ABGR8888 SDL_PIXELFORMAT_BGRA8888 SDL_PIXELFORMAT_ARGB2101010 SDL_PIXELFORMAT_RGBA32 SDL_PIXELFORMAT_ARGB32 SDL_PIXELFORMAT_BGRA32 SDL_PIXELFORMAT_ABGR32 SDL_PIXELFORMAT_YV12 SDL_PIXELFORMAT_IYUV SDL_PIXELFORMAT_YUY2 SDL_PIXELFORMAT_UYVY SDL_PIXELFORMAT_YVYU SDL_PIXELFORMAT_NV12 SDL_PIXELFORMAT_NV21 SDL_PIXELFORMAT_EXTERNAL_OES ctypedef struct SDL_Color: Uint8 r Uint8 g Uint8 b Uint8 a ctypedef struct SDL_Palette: int ncolors SDL_Color *colors Uint32 version int refcount ctypedef struct SDL_PixelFormat: Uint32 format SDL_Palette *palette Uint8 BitsPerPixel Uint8 BytesPerPixel Uint8 padding[2] Uint32 Rmask Uint32 Gmask Uint32 Bmask Uint32 Amask Uint8 Rloss Uint8 Gloss Uint8 Bloss Uint8 Aloss Uint8 Rshift Uint8 Gshift Uint8 Bshift Uint8 Ashift int refcount SDL_PixelFormat *next const char *SDL_GetPixelFormatName(Uint32 format) SDL_bool SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask) Uint32 SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) SDL_PixelFormat *SDL_AllocFormat(Uint32 pixel_format) void SDL_FreeFormat(SDL_PixelFormat *format) SDL_Palette *SDL_AllocPalette(int ncolors) int SDL_SetPixelFormatPalette(SDL_PixelFormat *format, SDL_Palette *palette) int SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors) void SDL_FreePalette(SDL_Palette *palette) Uint32 SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b) Uint32 SDL_MapRGBA(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, Uint8 a) void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, Uint8 *b) void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) void SDL_CalculateGammaRamp(float gamma, Uint16 *ramp) ctypedef struct SDL_Point: int x int y ctypedef struct SDL_FPoint: float x float y ctypedef struct SDL_Rect: int x int y int w int h ctypedef struct SDL_FRect: float x float y float w float h SDL_bool SDL_HasIntersection(const SDL_Rect *A, const SDL_Rect *B) SDL_bool SDL_IntersectRect(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result) void SDL_UnionRect(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result) SDL_bool SDL_EnclosePoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result) SDL_bool SDL_IntersectRectAndLine(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2) ctypedef enum SDL_BlendMode: SDL_BLENDMODE_NONE SDL_BLENDMODE_BLEND SDL_BLENDMODE_ADD SDL_BLENDMODE_MOD SDL_BLENDMODE_INVALID ctypedef enum SDL_BlendOperation: SDL_BLENDOPERATION_ADD SDL_BLENDOPERATION_SUBTRACT SDL_BLENDOPERATION_REV_SUBTRACT SDL_BLENDOPERATION_MINIMUM SDL_BLENDOPERATION_MAXIMUM ctypedef enum SDL_BlendFactor: SDL_BLENDFACTOR_ZERO SDL_BLENDFACTOR_ONE SDL_BLENDFACTOR_SRC_COLOR SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR SDL_BLENDFACTOR_SRC_ALPHA SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA SDL_BLENDFACTOR_DST_COLOR SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR SDL_BLENDFACTOR_DST_ALPHA SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA SDL_BlendMode SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation) ctypedef struct SDL_Surface: Uint32 flags SDL_PixelFormat *format int w int h int pitch void *pixels void *userdata int locked void *lock_data SDL_Rect clip_rect SDL_BlitMap *map int refcount ctypedef int (*SDL_blit)(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) ctypedef enum SDL_YUV_CONVERSION_MODE: SDL_YUV_CONVERSION_JPEG SDL_YUV_CONVERSION_BT601 SDL_YUV_CONVERSION_BT709 SDL_YUV_CONVERSION_AUTOMATIC SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format) SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) SDL_Surface *SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 format) void SDL_FreeSurface(SDL_Surface *surface) int SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette) int SDL_LockSurface(SDL_Surface *surface) void SDL_UnlockSurface(SDL_Surface *surface) SDL_Surface *SDL_LoadBMP_RW(SDL_RWops *src, int freesrc) int SDL_SaveBMP_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst) int SDL_SetSurfaceRLE(SDL_Surface *surface, int flag) int SDL_SetColorKey(SDL_Surface *surface, int flag, Uint32 key) SDL_bool SDL_HasColorKey(SDL_Surface *surface) int SDL_GetColorKey(SDL_Surface *surface, Uint32 *key) int SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b) int SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b) int SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha) int SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha) int SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode) int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode) SDL_bool SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect) void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect) SDL_Surface *SDL_DuplicateSurface(SDL_Surface *surface) SDL_Surface *SDL_ConvertSurface(SDL_Surface *src, const SDL_PixelFormat *fmt, Uint32 flags) SDL_Surface *SDL_ConvertSurfaceFormat(SDL_Surface *src, Uint32 pixel_format, Uint32 flags) int SDL_ConvertPixels(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch) int SDL_FillRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color) int SDL_FillRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color) int SDL_UpperBlit(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) int SDL_LowerBlit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) int SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect) int SDL_UpperBlitScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) int SDL_LowerBlitScaled(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) void SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode) SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode() SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionModeForResolution(int width, int height) ctypedef struct SDL_DisplayMode: Uint32 format int w int h int refresh_rate void *driverdata ctypedef struct SDL_Window ctypedef enum SDL_WindowFlags: SDL_WINDOW_FULLSCREEN SDL_WINDOW_OPENGL SDL_WINDOW_SHOWN SDL_WINDOW_HIDDEN SDL_WINDOW_BORDERLESS SDL_WINDOW_RESIZABLE SDL_WINDOW_MINIMIZED SDL_WINDOW_MAXIMIZED SDL_WINDOW_INPUT_GRABBED SDL_WINDOW_INPUT_FOCUS SDL_WINDOW_MOUSE_FOCUS SDL_WINDOW_FULLSCREEN_DESKTOP SDL_WINDOW_FOREIGN SDL_WINDOW_ALLOW_HIGHDPI SDL_WINDOW_MOUSE_CAPTURE SDL_WINDOW_ALWAYS_ON_TOP SDL_WINDOW_SKIP_TASKBAR SDL_WINDOW_UTILITY SDL_WINDOW_TOOLTIP SDL_WINDOW_POPUP_MENU SDL_WINDOW_VULKAN ctypedef enum SDL_WindowEventID: SDL_WINDOWEVENT_NONE SDL_WINDOWEVENT_SHOWN SDL_WINDOWEVENT_HIDDEN SDL_WINDOWEVENT_EXPOSED SDL_WINDOWEVENT_MOVED SDL_WINDOWEVENT_RESIZED SDL_WINDOWEVENT_SIZE_CHANGED SDL_WINDOWEVENT_MINIMIZED SDL_WINDOWEVENT_MAXIMIZED SDL_WINDOWEVENT_RESTORED SDL_WINDOWEVENT_ENTER SDL_WINDOWEVENT_LEAVE SDL_WINDOWEVENT_FOCUS_GAINED SDL_WINDOWEVENT_FOCUS_LOST SDL_WINDOWEVENT_CLOSE SDL_WINDOWEVENT_TAKE_FOCUS SDL_WINDOWEVENT_HIT_TEST ctypedef enum SDL_DisplayEventID: SDL_DISPLAYEVENT_NONE SDL_DISPLAYEVENT_ORIENTATION ctypedef enum SDL_DisplayOrientation: SDL_ORIENTATION_UNKNOWN SDL_ORIENTATION_LANDSCAPE SDL_ORIENTATION_LANDSCAPE_FLIPPED SDL_ORIENTATION_PORTRAIT SDL_ORIENTATION_PORTRAIT_FLIPPED ctypedef void *SDL_GLContext ctypedef enum SDL_GLattr: SDL_GL_RED_SIZE SDL_GL_GREEN_SIZE SDL_GL_BLUE_SIZE SDL_GL_ALPHA_SIZE SDL_GL_BUFFER_SIZE SDL_GL_DOUBLEBUFFER SDL_GL_DEPTH_SIZE SDL_GL_STENCIL_SIZE SDL_GL_ACCUM_RED_SIZE SDL_GL_ACCUM_GREEN_SIZE SDL_GL_ACCUM_BLUE_SIZE SDL_GL_ACCUM_ALPHA_SIZE SDL_GL_STEREO SDL_GL_MULTISAMPLEBUFFERS SDL_GL_MULTISAMPLESAMPLES SDL_GL_ACCELERATED_VISUAL SDL_GL_RETAINED_BACKING SDL_GL_CONTEXT_MAJOR_VERSION SDL_GL_CONTEXT_MINOR_VERSION SDL_GL_CONTEXT_EGL SDL_GL_CONTEXT_FLAGS SDL_GL_CONTEXT_PROFILE_MASK SDL_GL_SHARE_WITH_CURRENT_CONTEXT SDL_GL_FRAMEBUFFER_SRGB_CAPABLE SDL_GL_CONTEXT_RELEASE_BEHAVIOR SDL_GL_CONTEXT_RESET_NOTIFICATION SDL_GL_CONTEXT_NO_ERROR ctypedef enum SDL_GLprofile: SDL_GL_CONTEXT_PROFILE_CORE SDL_GL_CONTEXT_PROFILE_COMPATIBILITY SDL_GL_CONTEXT_PROFILE_ES ctypedef enum SDL_GLcontextFlag: SDL_GL_CONTEXT_DEBUG_FLAG SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG SDL_GL_CONTEXT_RESET_ISOLATION_FLAG ctypedef enum SDL_GLcontextReleaseFlag: SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH ctypedef enum SDL_GLContextResetNotification: SDL_GL_CONTEXT_RESET_NO_NOTIFICATION SDL_GL_CONTEXT_RESET_LOSE_CONTEXT int SDL_GetNumVideoDrivers() const char *SDL_GetVideoDriver(int index) int SDL_VideoInit(const char *driver_name) void SDL_VideoQuit() const char *SDL_GetCurrentVideoDriver() int SDL_GetNumVideoDisplays() const char *SDL_GetDisplayName(int displayIndex) int SDL_GetDisplayBounds(int displayIndex, SDL_Rect *rect) int SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect *rect) int SDL_GetDisplayDPI(int displayIndex, float *ddpi, float *hdpi, float *vdpi) SDL_DisplayOrientation SDL_GetDisplayOrientation(int displayIndex) int SDL_GetNumDisplayModes(int displayIndex) int SDL_GetDisplayMode(int displayIndex, int modeIndex, SDL_DisplayMode *mode) int SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode *mode) int SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode *mode) SDL_DisplayMode *SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode *mode, SDL_DisplayMode *closest) int SDL_GetWindowDisplayIndex(SDL_Window *window) int SDL_SetWindowDisplayMode(SDL_Window *window, const SDL_DisplayMode *mode) int SDL_GetWindowDisplayMode(SDL_Window *window, SDL_DisplayMode *mode) Uint32 SDL_GetWindowPixelFormat(SDL_Window *window) SDL_Window *SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) SDL_Window *SDL_CreateWindowFrom(const void *data) Uint32 SDL_GetWindowID(SDL_Window *window) SDL_Window *SDL_GetWindowFromID(Uint32 id) Uint32 SDL_GetWindowFlags(SDL_Window *window) void SDL_SetWindowTitle(SDL_Window *window, const char *title) const char *SDL_GetWindowTitle(SDL_Window *window) void SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon) void *SDL_SetWindowData(SDL_Window *window, const char *name, void *userdata) void *SDL_GetWindowData(SDL_Window *window, const char *name) void SDL_SetWindowPosition(SDL_Window *window, int x, int y) void SDL_GetWindowPosition(SDL_Window *window, int *x, int *y) void SDL_SetWindowSize(SDL_Window *window, int w, int h) void SDL_GetWindowSize(SDL_Window *window, int *w, int *h) int SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right) void SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h) void SDL_GetWindowMinimumSize(SDL_Window *window, int *w, int *h) void SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h) void SDL_GetWindowMaximumSize(SDL_Window *window, int *w, int *h) void SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered) void SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable) void SDL_ShowWindow(SDL_Window *window) void SDL_HideWindow(SDL_Window *window) void SDL_RaiseWindow(SDL_Window *window) void SDL_MaximizeWindow(SDL_Window *window) void SDL_MinimizeWindow(SDL_Window *window) void SDL_RestoreWindow(SDL_Window *window) int SDL_SetWindowFullscreen(SDL_Window *window, Uint32 flags) SDL_Surface *SDL_GetWindowSurface(SDL_Window *window) int SDL_UpdateWindowSurface(SDL_Window *window) int SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, int numrects) void SDL_SetWindowGrab(SDL_Window *window, SDL_bool grabbed) SDL_bool SDL_GetWindowGrab(SDL_Window *window) SDL_Window *SDL_GetGrabbedWindow() int SDL_SetWindowBrightness(SDL_Window *window, float brightness) float SDL_GetWindowBrightness(SDL_Window *window) int SDL_SetWindowOpacity(SDL_Window *window, float opacity) int SDL_GetWindowOpacity(SDL_Window *window, float *out_opacity) int SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_Window *parent_window) int SDL_SetWindowInputFocus(SDL_Window *window) int SDL_SetWindowGammaRamp(SDL_Window *window, const Uint16 *red, const Uint16 *green, const Uint16 *blue) int SDL_GetWindowGammaRamp(SDL_Window *window, Uint16 *red, Uint16 *green, Uint16 *blue) ctypedef enum SDL_HitTestResult: SDL_HITTEST_NORMAL SDL_HITTEST_DRAGGABLE SDL_HITTEST_RESIZE_TOPLEFT SDL_HITTEST_RESIZE_TOP SDL_HITTEST_RESIZE_TOPRIGHT SDL_HITTEST_RESIZE_RIGHT SDL_HITTEST_RESIZE_BOTTOMRIGHT SDL_HITTEST_RESIZE_BOTTOM SDL_HITTEST_RESIZE_BOTTOMLEFT SDL_HITTEST_RESIZE_LEFT ctypedef SDL_HitTestResult (*SDL_HitTest)(SDL_Window *win, const SDL_Point *area, void *data) int SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data) void SDL_DestroyWindow(SDL_Window *window) SDL_bool SDL_IsScreenSaverEnabled() void SDL_EnableScreenSaver() void SDL_DisableScreenSaver() int SDL_GL_LoadLibrary(const char *path) void *SDL_GL_GetProcAddress(const char *proc) void SDL_GL_UnloadLibrary() SDL_bool SDL_GL_ExtensionSupported(const char *extension) void SDL_GL_ResetAttributes() int SDL_GL_SetAttribute(SDL_GLattr attr, int value) int SDL_GL_GetAttribute(SDL_GLattr attr, int *value) SDL_GLContext SDL_GL_CreateContext(SDL_Window *window) int SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context) SDL_Window *SDL_GL_GetCurrentWindow() SDL_GLContext SDL_GL_GetCurrentContext() void SDL_GL_GetDrawableSize(SDL_Window *window, int *w, int *h) int SDL_GL_SetSwapInterval(int interval) int SDL_GL_GetSwapInterval() void SDL_GL_SwapWindow(SDL_Window *window) void SDL_GL_DeleteContext(SDL_GLContext context) ctypedef enum SDL_Scancode: SDL_SCANCODE_UNKNOWN SDL_SCANCODE_A SDL_SCANCODE_B SDL_SCANCODE_C SDL_SCANCODE_D SDL_SCANCODE_E SDL_SCANCODE_F SDL_SCANCODE_G SDL_SCANCODE_H SDL_SCANCODE_I SDL_SCANCODE_J SDL_SCANCODE_K SDL_SCANCODE_L SDL_SCANCODE_M SDL_SCANCODE_N SDL_SCANCODE_O SDL_SCANCODE_P SDL_SCANCODE_Q SDL_SCANCODE_R SDL_SCANCODE_S SDL_SCANCODE_T SDL_SCANCODE_U SDL_SCANCODE_V SDL_SCANCODE_W SDL_SCANCODE_X SDL_SCANCODE_Y SDL_SCANCODE_Z SDL_SCANCODE_1 SDL_SCANCODE_2 SDL_SCANCODE_3 SDL_SCANCODE_4 SDL_SCANCODE_5 SDL_SCANCODE_6 SDL_SCANCODE_7 SDL_SCANCODE_8 SDL_SCANCODE_9 SDL_SCANCODE_0 SDL_SCANCODE_RETURN SDL_SCANCODE_ESCAPE SDL_SCANCODE_BACKSPACE SDL_SCANCODE_TAB SDL_SCANCODE_SPACE SDL_SCANCODE_MINUS SDL_SCANCODE_EQUALS SDL_SCANCODE_LEFTBRACKET SDL_SCANCODE_RIGHTBRACKET SDL_SCANCODE_BACKSLASH SDL_SCANCODE_NONUSHASH SDL_SCANCODE_SEMICOLON SDL_SCANCODE_APOSTROPHE SDL_SCANCODE_GRAVE SDL_SCANCODE_COMMA SDL_SCANCODE_PERIOD SDL_SCANCODE_SLASH SDL_SCANCODE_CAPSLOCK SDL_SCANCODE_F1 SDL_SCANCODE_F2 SDL_SCANCODE_F3 SDL_SCANCODE_F4 SDL_SCANCODE_F5 SDL_SCANCODE_F6 SDL_SCANCODE_F7 SDL_SCANCODE_F8 SDL_SCANCODE_F9 SDL_SCANCODE_F10 SDL_SCANCODE_F11 SDL_SCANCODE_F12 SDL_SCANCODE_PRINTSCREEN SDL_SCANCODE_SCROLLLOCK SDL_SCANCODE_PAUSE SDL_SCANCODE_INSERT SDL_SCANCODE_HOME SDL_SCANCODE_PAGEUP SDL_SCANCODE_DELETE SDL_SCANCODE_END SDL_SCANCODE_PAGEDOWN SDL_SCANCODE_RIGHT SDL_SCANCODE_LEFT SDL_SCANCODE_DOWN SDL_SCANCODE_UP SDL_SCANCODE_NUMLOCKCLEAR SDL_SCANCODE_KP_DIVIDE SDL_SCANCODE_KP_MULTIPLY SDL_SCANCODE_KP_MINUS SDL_SCANCODE_KP_PLUS SDL_SCANCODE_KP_ENTER SDL_SCANCODE_KP_1 SDL_SCANCODE_KP_2 SDL_SCANCODE_KP_3 SDL_SCANCODE_KP_4 SDL_SCANCODE_KP_5 SDL_SCANCODE_KP_6 SDL_SCANCODE_KP_7 SDL_SCANCODE_KP_8 SDL_SCANCODE_KP_9 SDL_SCANCODE_KP_0 SDL_SCANCODE_KP_PERIOD SDL_SCANCODE_NONUSBACKSLASH SDL_SCANCODE_APPLICATION SDL_SCANCODE_POWER SDL_SCANCODE_KP_EQUALS SDL_SCANCODE_F13 SDL_SCANCODE_F14 SDL_SCANCODE_F15 SDL_SCANCODE_F16 SDL_SCANCODE_F17 SDL_SCANCODE_F18 SDL_SCANCODE_F19 SDL_SCANCODE_F20 SDL_SCANCODE_F21 SDL_SCANCODE_F22 SDL_SCANCODE_F23 SDL_SCANCODE_F24 SDL_SCANCODE_EXECUTE SDL_SCANCODE_HELP SDL_SCANCODE_MENU SDL_SCANCODE_SELECT SDL_SCANCODE_STOP SDL_SCANCODE_AGAIN SDL_SCANCODE_UNDO SDL_SCANCODE_CUT SDL_SCANCODE_COPY SDL_SCANCODE_PASTE SDL_SCANCODE_FIND SDL_SCANCODE_MUTE SDL_SCANCODE_VOLUMEUP SDL_SCANCODE_VOLUMEDOWN SDL_SCANCODE_KP_COMMA SDL_SCANCODE_KP_EQUALSAS400 SDL_SCANCODE_INTERNATIONAL1 SDL_SCANCODE_INTERNATIONAL2 SDL_SCANCODE_INTERNATIONAL3 SDL_SCANCODE_INTERNATIONAL4 SDL_SCANCODE_INTERNATIONAL5 SDL_SCANCODE_INTERNATIONAL6 SDL_SCANCODE_INTERNATIONAL7 SDL_SCANCODE_INTERNATIONAL8 SDL_SCANCODE_INTERNATIONAL9 SDL_SCANCODE_LANG1 SDL_SCANCODE_LANG2 SDL_SCANCODE_LANG3 SDL_SCANCODE_LANG4 SDL_SCANCODE_LANG5 SDL_SCANCODE_LANG6 SDL_SCANCODE_LANG7 SDL_SCANCODE_LANG8 SDL_SCANCODE_LANG9 SDL_SCANCODE_ALTERASE SDL_SCANCODE_SYSREQ SDL_SCANCODE_CANCEL SDL_SCANCODE_CLEAR SDL_SCANCODE_PRIOR SDL_SCANCODE_RETURN2 SDL_SCANCODE_SEPARATOR SDL_SCANCODE_OUT SDL_SCANCODE_OPER SDL_SCANCODE_CLEARAGAIN SDL_SCANCODE_CRSEL SDL_SCANCODE_EXSEL SDL_SCANCODE_KP_00 SDL_SCANCODE_KP_000 SDL_SCANCODE_THOUSANDSSEPARATOR SDL_SCANCODE_DECIMALSEPARATOR SDL_SCANCODE_CURRENCYUNIT SDL_SCANCODE_CURRENCYSUBUNIT SDL_SCANCODE_KP_LEFTPAREN SDL_SCANCODE_KP_RIGHTPAREN SDL_SCANCODE_KP_LEFTBRACE SDL_SCANCODE_KP_RIGHTBRACE SDL_SCANCODE_KP_TAB SDL_SCANCODE_KP_BACKSPACE SDL_SCANCODE_KP_A SDL_SCANCODE_KP_B SDL_SCANCODE_KP_C SDL_SCANCODE_KP_D SDL_SCANCODE_KP_E SDL_SCANCODE_KP_F SDL_SCANCODE_KP_XOR SDL_SCANCODE_KP_POWER SDL_SCANCODE_KP_PERCENT SDL_SCANCODE_KP_LESS SDL_SCANCODE_KP_GREATER SDL_SCANCODE_KP_AMPERSAND SDL_SCANCODE_KP_DBLAMPERSAND SDL_SCANCODE_KP_VERTICALBAR SDL_SCANCODE_KP_DBLVERTICALBAR SDL_SCANCODE_KP_COLON SDL_SCANCODE_KP_HASH SDL_SCANCODE_KP_SPACE SDL_SCANCODE_KP_AT SDL_SCANCODE_KP_EXCLAM SDL_SCANCODE_KP_MEMSTORE SDL_SCANCODE_KP_MEMRECALL SDL_SCANCODE_KP_MEMCLEAR SDL_SCANCODE_KP_MEMADD SDL_SCANCODE_KP_MEMSUBTRACT SDL_SCANCODE_KP_MEMMULTIPLY SDL_SCANCODE_KP_MEMDIVIDE SDL_SCANCODE_KP_PLUSMINUS SDL_SCANCODE_KP_CLEAR SDL_SCANCODE_KP_CLEARENTRY SDL_SCANCODE_KP_BINARY SDL_SCANCODE_KP_OCTAL SDL_SCANCODE_KP_DECIMAL SDL_SCANCODE_KP_HEXADECIMAL SDL_SCANCODE_LCTRL SDL_SCANCODE_LSHIFT SDL_SCANCODE_LALT SDL_SCANCODE_LGUI SDL_SCANCODE_RCTRL SDL_SCANCODE_RSHIFT SDL_SCANCODE_RALT SDL_SCANCODE_RGUI SDL_SCANCODE_MODE SDL_SCANCODE_AUDIONEXT SDL_SCANCODE_AUDIOPREV SDL_SCANCODE_AUDIOSTOP SDL_SCANCODE_AUDIOPLAY SDL_SCANCODE_AUDIOMUTE SDL_SCANCODE_MEDIASELECT SDL_SCANCODE_WWW SDL_SCANCODE_MAIL SDL_SCANCODE_CALCULATOR SDL_SCANCODE_COMPUTER SDL_SCANCODE_AC_SEARCH SDL_SCANCODE_AC_HOME SDL_SCANCODE_AC_BACK SDL_SCANCODE_AC_FORWARD SDL_SCANCODE_AC_STOP SDL_SCANCODE_AC_REFRESH SDL_SCANCODE_AC_BOOKMARKS SDL_SCANCODE_BRIGHTNESSDOWN SDL_SCANCODE_BRIGHTNESSUP SDL_SCANCODE_DISPLAYSWITCH SDL_SCANCODE_KBDILLUMTOGGLE SDL_SCANCODE_KBDILLUMDOWN SDL_SCANCODE_KBDILLUMUP SDL_SCANCODE_EJECT SDL_SCANCODE_SLEEP SDL_SCANCODE_APP1 SDL_SCANCODE_APP2 SDL_SCANCODE_AUDIOREWIND SDL_SCANCODE_AUDIOFASTFORWARD SDL_NUM_SCANCODES ctypedef Sint32 SDL_Keycode cdef enum: SDLK_UNKNOWN SDLK_RETURN SDLK_ESCAPE SDLK_BACKSPACE SDLK_TAB SDLK_SPACE SDLK_EXCLAIM SDLK_QUOTEDBL SDLK_HASH SDLK_PERCENT SDLK_DOLLAR SDLK_AMPERSAND SDLK_QUOTE SDLK_LEFTPAREN SDLK_RIGHTPAREN SDLK_ASTERISK SDLK_PLUS SDLK_COMMA SDLK_MINUS SDLK_PERIOD SDLK_SLASH SDLK_0 SDLK_1 SDLK_2 SDLK_3 SDLK_4 SDLK_5 SDLK_6 SDLK_7 SDLK_8 SDLK_9 SDLK_COLON SDLK_SEMICOLON SDLK_LESS SDLK_EQUALS SDLK_GREATER SDLK_QUESTION SDLK_AT SDLK_LEFTBRACKET SDLK_BACKSLASH SDLK_RIGHTBRACKET SDLK_CARET SDLK_UNDERSCORE SDLK_BACKQUOTE SDLK_a SDLK_b SDLK_c SDLK_d SDLK_e SDLK_f SDLK_g SDLK_h SDLK_i SDLK_j SDLK_k SDLK_l SDLK_m SDLK_n SDLK_o SDLK_p SDLK_q SDLK_r SDLK_s SDLK_t SDLK_u SDLK_v SDLK_w SDLK_x SDLK_y SDLK_z SDLK_CAPSLOCK SDLK_F1 SDLK_F2 SDLK_F3 SDLK_F4 SDLK_F5 SDLK_F6 SDLK_F7 SDLK_F8 SDLK_F9 SDLK_F10 SDLK_F11 SDLK_F12 SDLK_PRINTSCREEN SDLK_SCROLLLOCK SDLK_PAUSE SDLK_INSERT SDLK_HOME SDLK_PAGEUP SDLK_DELETE SDLK_END SDLK_PAGEDOWN SDLK_RIGHT SDLK_LEFT SDLK_DOWN SDLK_UP SDLK_NUMLOCKCLEAR SDLK_KP_DIVIDE SDLK_KP_MULTIPLY SDLK_KP_MINUS SDLK_KP_PLUS SDLK_KP_ENTER SDLK_KP_1 SDLK_KP_2 SDLK_KP_3 SDLK_KP_4 SDLK_KP_5 SDLK_KP_6 SDLK_KP_7 SDLK_KP_8 SDLK_KP_9 SDLK_KP_0 SDLK_KP_PERIOD SDLK_APPLICATION SDLK_POWER SDLK_KP_EQUALS SDLK_F13 SDLK_F14 SDLK_F15 SDLK_F16 SDLK_F17 SDLK_F18 SDLK_F19 SDLK_F20 SDLK_F21 SDLK_F22 SDLK_F23 SDLK_F24 SDLK_EXECUTE SDLK_HELP SDLK_MENU SDLK_SELECT SDLK_STOP SDLK_AGAIN SDLK_UNDO SDLK_CUT SDLK_COPY SDLK_PASTE SDLK_FIND SDLK_MUTE SDLK_VOLUMEUP SDLK_VOLUMEDOWN SDLK_KP_COMMA SDLK_KP_EQUALSAS400 SDLK_ALTERASE SDLK_SYSREQ SDLK_CANCEL SDLK_CLEAR SDLK_PRIOR SDLK_RETURN2 SDLK_SEPARATOR SDLK_OUT SDLK_OPER SDLK_CLEARAGAIN SDLK_CRSEL SDLK_EXSEL SDLK_KP_00 SDLK_KP_000 SDLK_THOUSANDSSEPARATOR SDLK_DECIMALSEPARATOR SDLK_CURRENCYUNIT SDLK_CURRENCYSUBUNIT SDLK_KP_LEFTPAREN SDLK_KP_RIGHTPAREN SDLK_KP_LEFTBRACE SDLK_KP_RIGHTBRACE SDLK_KP_TAB SDLK_KP_BACKSPACE SDLK_KP_A SDLK_KP_B SDLK_KP_C SDLK_KP_D SDLK_KP_E SDLK_KP_F SDLK_KP_XOR SDLK_KP_POWER SDLK_KP_PERCENT SDLK_KP_LESS SDLK_KP_GREATER SDLK_KP_AMPERSAND SDLK_KP_DBLAMPERSAND SDLK_KP_VERTICALBAR SDLK_KP_DBLVERTICALBAR SDLK_KP_COLON SDLK_KP_HASH SDLK_KP_SPACE SDLK_KP_AT SDLK_KP_EXCLAM SDLK_KP_MEMSTORE SDLK_KP_MEMRECALL SDLK_KP_MEMCLEAR SDLK_KP_MEMADD SDLK_KP_MEMSUBTRACT SDLK_KP_MEMMULTIPLY SDLK_KP_MEMDIVIDE SDLK_KP_PLUSMINUS SDLK_KP_CLEAR SDLK_KP_CLEARENTRY SDLK_KP_BINARY SDLK_KP_OCTAL SDLK_KP_DECIMAL SDLK_KP_HEXADECIMAL SDLK_LCTRL SDLK_LSHIFT SDLK_LALT SDLK_LGUI SDLK_RCTRL SDLK_RSHIFT SDLK_RALT SDLK_RGUI SDLK_MODE SDLK_AUDIONEXT SDLK_AUDIOPREV SDLK_AUDIOSTOP SDLK_AUDIOPLAY SDLK_AUDIOMUTE SDLK_MEDIASELECT SDLK_WWW SDLK_MAIL SDLK_CALCULATOR SDLK_COMPUTER SDLK_AC_SEARCH SDLK_AC_HOME SDLK_AC_BACK SDLK_AC_FORWARD SDLK_AC_STOP SDLK_AC_REFRESH SDLK_AC_BOOKMARKS SDLK_BRIGHTNESSDOWN SDLK_BRIGHTNESSUP SDLK_DISPLAYSWITCH SDLK_KBDILLUMTOGGLE SDLK_KBDILLUMDOWN SDLK_KBDILLUMUP SDLK_EJECT SDLK_SLEEP SDLK_APP1 SDLK_APP2 SDLK_AUDIOREWIND SDLK_AUDIOFASTFORWARD ctypedef enum SDL_Keymod: KMOD_NONE KMOD_LSHIFT KMOD_RSHIFT KMOD_LCTRL KMOD_RCTRL KMOD_LALT KMOD_RALT KMOD_LGUI KMOD_RGUI KMOD_NUM KMOD_CAPS KMOD_MODE KMOD_RESERVED ctypedef struct SDL_Keysym: SDL_Scancode scancode SDL_Keycode sym Uint16 mod Uint32 unused SDL_Window *SDL_GetKeyboardFocus() const Uint8 *SDL_GetKeyboardState(int *numkeys) SDL_Keymod SDL_GetModState() void SDL_SetModState(SDL_Keymod modstate) SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode) SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key) const char *SDL_GetScancodeName(SDL_Scancode scancode) SDL_Scancode SDL_GetScancodeFromName(const char *name) const char *SDL_GetKeyName(SDL_Keycode key) SDL_Keycode SDL_GetKeyFromName(const char *name) void SDL_StartTextInput() SDL_bool SDL_IsTextInputActive() void SDL_StopTextInput() void SDL_SetTextInputRect(SDL_Rect *rect) SDL_bool SDL_HasScreenKeyboardSupport() SDL_bool SDL_IsScreenKeyboardShown(SDL_Window *window) ctypedef struct SDL_Cursor ctypedef enum SDL_SystemCursor: SDL_SYSTEM_CURSOR_ARROW SDL_SYSTEM_CURSOR_IBEAM SDL_SYSTEM_CURSOR_WAIT SDL_SYSTEM_CURSOR_CROSSHAIR SDL_SYSTEM_CURSOR_WAITARROW SDL_SYSTEM_CURSOR_SIZENWSE SDL_SYSTEM_CURSOR_SIZENESW SDL_SYSTEM_CURSOR_SIZEWE SDL_SYSTEM_CURSOR_SIZENS SDL_SYSTEM_CURSOR_SIZEALL SDL_SYSTEM_CURSOR_NO SDL_SYSTEM_CURSOR_HAND SDL_NUM_SYSTEM_CURSORS ctypedef enum SDL_MouseWheelDirection: SDL_MOUSEWHEEL_NORMAL SDL_MOUSEWHEEL_FLIPPED SDL_Window *SDL_GetMouseFocus() Uint32 SDL_GetMouseState(int *x, int *y) Uint32 SDL_GetGlobalMouseState(int *x, int *y) Uint32 SDL_GetRelativeMouseState(int *x, int *y) void SDL_WarpMouseInWindow(SDL_Window *window, int x, int y) int SDL_WarpMouseGlobal(int x, int y) int SDL_SetRelativeMouseMode(SDL_bool enabled) int SDL_CaptureMouse(SDL_bool enabled) SDL_bool SDL_GetRelativeMouseMode() SDL_Cursor *SDL_CreateCursor(const Uint8 *data, const Uint8 *mask, int w, int h, int hot_x, int hot_y) SDL_Cursor *SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y) SDL_Cursor *SDL_CreateSystemCursor(SDL_SystemCursor id) void SDL_SetCursor(SDL_Cursor *cursor) SDL_Cursor *SDL_GetCursor() SDL_Cursor *SDL_GetDefaultCursor() void SDL_FreeCursor(SDL_Cursor *cursor) int SDL_ShowCursor(int toggle) ctypedef struct SDL_Joystick ctypedef struct SDL_JoystickGUID: Uint8 data[16] ctypedef Sint32 SDL_JoystickID ctypedef enum SDL_JoystickType: SDL_JOYSTICK_TYPE_UNKNOWN SDL_JOYSTICK_TYPE_GAMECONTROLLER SDL_JOYSTICK_TYPE_WHEEL SDL_JOYSTICK_TYPE_ARCADE_STICK SDL_JOYSTICK_TYPE_FLIGHT_STICK SDL_JOYSTICK_TYPE_DANCE_PAD SDL_JOYSTICK_TYPE_GUITAR SDL_JOYSTICK_TYPE_DRUM_KIT SDL_JOYSTICK_TYPE_ARCADE_PAD SDL_JOYSTICK_TYPE_THROTTLE ctypedef enum SDL_JoystickPowerLevel: SDL_JOYSTICK_POWER_UNKNOWN SDL_JOYSTICK_POWER_EMPTY SDL_JOYSTICK_POWER_LOW SDL_JOYSTICK_POWER_MEDIUM SDL_JOYSTICK_POWER_FULL SDL_JOYSTICK_POWER_WIRED SDL_JOYSTICK_POWER_MAX void SDL_LockJoysticks() void SDL_UnlockJoysticks() int SDL_NumJoysticks() const char *SDL_JoystickNameForIndex(int device_index) int SDL_JoystickGetDevicePlayerIndex(int device_index) SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int device_index) Uint16 SDL_JoystickGetDeviceVendor(int device_index) Uint16 SDL_JoystickGetDeviceProduct(int device_index) Uint16 SDL_JoystickGetDeviceProductVersion(int device_index) SDL_JoystickType SDL_JoystickGetDeviceType(int device_index) SDL_JoystickID SDL_JoystickGetDeviceInstanceID(int device_index) SDL_Joystick *SDL_JoystickOpen(int device_index) SDL_Joystick *SDL_JoystickFromInstanceID(SDL_JoystickID joyid) const char *SDL_JoystickName(SDL_Joystick *joystick) int SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick) SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick *joystick) Uint16 SDL_JoystickGetVendor(SDL_Joystick *joystick) Uint16 SDL_JoystickGetProduct(SDL_Joystick *joystick) Uint16 SDL_JoystickGetProductVersion(SDL_Joystick *joystick) SDL_JoystickType SDL_JoystickGetType(SDL_Joystick *joystick) void SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID) SDL_JoystickGUID SDL_JoystickGetGUIDFromString(const char *pchGUID) SDL_bool SDL_JoystickGetAttached(SDL_Joystick *joystick) SDL_JoystickID SDL_JoystickInstanceID(SDL_Joystick *joystick) int SDL_JoystickNumAxes(SDL_Joystick *joystick) int SDL_JoystickNumBalls(SDL_Joystick *joystick) int SDL_JoystickNumHats(SDL_Joystick *joystick) int SDL_JoystickNumButtons(SDL_Joystick *joystick) void SDL_JoystickUpdate() int SDL_JoystickEventState(int state) Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis) SDL_bool SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state) Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat) int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy) Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button) int SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) void SDL_JoystickClose(SDL_Joystick *joystick) SDL_JoystickPowerLevel SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick) ctypedef struct SDL_GameController ctypedef enum SDL_GameControllerBindType: SDL_CONTROLLER_BINDTYPE_NONE SDL_CONTROLLER_BINDTYPE_BUTTON SDL_CONTROLLER_BINDTYPE_AXIS SDL_CONTROLLER_BINDTYPE_HAT cdef struct anon_struct_6: int hat int hat_mask cdef union anon_union_5: int button int axis anon_struct_6 hat ctypedef struct SDL_GameControllerButtonBind: SDL_GameControllerBindType bindType anon_union_5 value int SDL_GameControllerAddMappingsFromRW(SDL_RWops *rw, int freerw) int SDL_GameControllerAddMapping(const char *mappingString) int SDL_GameControllerNumMappings() char *SDL_GameControllerMappingForIndex(int mapping_index) char *SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid) char *SDL_GameControllerMapping(SDL_GameController *gamecontroller) SDL_bool SDL_IsGameController(int joystick_index) const char *SDL_GameControllerNameForIndex(int joystick_index) char *SDL_GameControllerMappingForDeviceIndex(int joystick_index) SDL_GameController *SDL_GameControllerOpen(int joystick_index) SDL_GameController *SDL_GameControllerFromInstanceID(SDL_JoystickID joyid) const char *SDL_GameControllerName(SDL_GameController *gamecontroller) int SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller) Uint16 SDL_GameControllerGetVendor(SDL_GameController *gamecontroller) Uint16 SDL_GameControllerGetProduct(SDL_GameController *gamecontroller) Uint16 SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller) SDL_bool SDL_GameControllerGetAttached(SDL_GameController *gamecontroller) SDL_Joystick *SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller) int SDL_GameControllerEventState(int state) void SDL_GameControllerUpdate() ctypedef enum SDL_GameControllerAxis: SDL_CONTROLLER_AXIS_INVALID SDL_CONTROLLER_AXIS_LEFTX SDL_CONTROLLER_AXIS_LEFTY SDL_CONTROLLER_AXIS_RIGHTX SDL_CONTROLLER_AXIS_RIGHTY SDL_CONTROLLER_AXIS_TRIGGERLEFT SDL_CONTROLLER_AXIS_TRIGGERRIGHT SDL_CONTROLLER_AXIS_MAX SDL_GameControllerAxis SDL_GameControllerGetAxisFromString(const char *pchString) const char *SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis) SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) Sint16 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) ctypedef enum SDL_GameControllerButton: SDL_CONTROLLER_BUTTON_INVALID SDL_CONTROLLER_BUTTON_A SDL_CONTROLLER_BUTTON_B SDL_CONTROLLER_BUTTON_X SDL_CONTROLLER_BUTTON_Y SDL_CONTROLLER_BUTTON_BACK SDL_CONTROLLER_BUTTON_GUIDE SDL_CONTROLLER_BUTTON_START SDL_CONTROLLER_BUTTON_LEFTSTICK SDL_CONTROLLER_BUTTON_RIGHTSTICK SDL_CONTROLLER_BUTTON_LEFTSHOULDER SDL_CONTROLLER_BUTTON_RIGHTSHOULDER SDL_CONTROLLER_BUTTON_DPAD_UP SDL_CONTROLLER_BUTTON_DPAD_DOWN SDL_CONTROLLER_BUTTON_DPAD_LEFT SDL_CONTROLLER_BUTTON_DPAD_RIGHT SDL_CONTROLLER_BUTTON_MAX SDL_GameControllerButton SDL_GameControllerGetButtonFromString(const char *pchString) const char *SDL_GameControllerGetStringForButton(SDL_GameControllerButton button) SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) Uint8 SDL_GameControllerGetButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) int SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) void SDL_GameControllerClose(SDL_GameController *gamecontroller) ctypedef Sint64 SDL_TouchID ctypedef Sint64 SDL_FingerID ctypedef enum SDL_TouchDeviceType: SDL_TOUCH_DEVICE_INVALID SDL_TOUCH_DEVICE_DIRECT SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE SDL_TOUCH_DEVICE_INDIRECT_RELATIVE ctypedef struct SDL_Finger: SDL_FingerID id float x float y float pressure int SDL_GetNumTouchDevices() SDL_TouchID SDL_GetTouchDevice(int index) SDL_TouchDeviceType SDL_GetTouchDeviceType(SDL_TouchID touchID) int SDL_GetNumTouchFingers(SDL_TouchID touchID) SDL_Finger *SDL_GetTouchFinger(SDL_TouchID touchID, int index) ctypedef Sint64 SDL_GestureID int SDL_RecordGesture(SDL_TouchID touchId) int SDL_SaveAllDollarTemplates(SDL_RWops *dst) int SDL_SaveDollarTemplate(SDL_GestureID gestureId, SDL_RWops *dst) int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src) ctypedef enum SDL_EventType: SDL_FIRSTEVENT SDL_QUIT SDL_APP_TERMINATING SDL_APP_LOWMEMORY SDL_APP_WILLENTERBACKGROUND SDL_APP_DIDENTERBACKGROUND SDL_APP_WILLENTERFOREGROUND SDL_APP_DIDENTERFOREGROUND SDL_DISPLAYEVENT SDL_WINDOWEVENT SDL_SYSWMEVENT SDL_KEYDOWN SDL_KEYUP SDL_TEXTEDITING SDL_TEXTINPUT SDL_KEYMAPCHANGED SDL_MOUSEMOTION SDL_MOUSEBUTTONDOWN SDL_MOUSEBUTTONUP SDL_MOUSEWHEEL SDL_JOYAXISMOTION SDL_JOYBALLMOTION SDL_JOYHATMOTION SDL_JOYBUTTONDOWN SDL_JOYBUTTONUP SDL_JOYDEVICEADDED SDL_JOYDEVICEREMOVED SDL_CONTROLLERAXISMOTION SDL_CONTROLLERBUTTONDOWN SDL_CONTROLLERBUTTONUP SDL_CONTROLLERDEVICEADDED SDL_CONTROLLERDEVICEREMOVED SDL_CONTROLLERDEVICEREMAPPED SDL_FINGERDOWN SDL_FINGERUP SDL_FINGERMOTION SDL_DOLLARGESTURE SDL_DOLLARRECORD SDL_MULTIGESTURE SDL_CLIPBOARDUPDATE SDL_DROPFILE SDL_DROPTEXT SDL_DROPBEGIN SDL_DROPCOMPLETE SDL_AUDIODEVICEADDED SDL_AUDIODEVICEREMOVED SDL_SENSORUPDATE SDL_RENDER_TARGETS_RESET SDL_RENDER_DEVICE_RESET SDL_USEREVENT SDL_LASTEVENT ctypedef struct SDL_CommonEvent: Uint32 type Uint32 timestamp ctypedef struct SDL_DisplayEvent: Uint32 type Uint32 timestamp Uint32 display Uint8 event Uint8 padding1 Uint8 padding2 Uint8 padding3 Sint32 data1 ctypedef struct SDL_WindowEvent: Uint32 type Uint32 timestamp Uint32 windowID Uint8 event Uint8 padding1 Uint8 padding2 Uint8 padding3 Sint32 data1 Sint32 data2 ctypedef struct SDL_KeyboardEvent: Uint32 type Uint32 timestamp Uint32 windowID Uint8 state Uint8 repeat Uint8 padding2 Uint8 padding3 SDL_Keysym keysym ctypedef struct SDL_TextEditingEvent: Uint32 type Uint32 timestamp Uint32 windowID char text[32] Sint32 start Sint32 length ctypedef struct SDL_TextInputEvent: Uint32 type Uint32 timestamp Uint32 windowID char text[32] ctypedef struct SDL_MouseMotionEvent: Uint32 type Uint32 timestamp Uint32 windowID Uint32 which Uint32 state Sint32 x Sint32 y Sint32 xrel Sint32 yrel ctypedef struct SDL_MouseButtonEvent: Uint32 type Uint32 timestamp Uint32 windowID Uint32 which Uint8 button Uint8 state Uint8 clicks Uint8 padding1 Sint32 x Sint32 y ctypedef struct SDL_MouseWheelEvent: Uint32 type Uint32 timestamp Uint32 windowID Uint32 which Sint32 x Sint32 y Uint32 direction ctypedef struct SDL_JoyAxisEvent: Uint32 type Uint32 timestamp SDL_JoystickID which Uint8 axis Uint8 padding1 Uint8 padding2 Uint8 padding3 Sint16 value Uint16 padding4 ctypedef struct SDL_JoyBallEvent: Uint32 type Uint32 timestamp SDL_JoystickID which Uint8 ball Uint8 padding1 Uint8 padding2 Uint8 padding3 Sint16 xrel Sint16 yrel ctypedef struct SDL_JoyHatEvent: Uint32 type Uint32 timestamp SDL_JoystickID which Uint8 hat Uint8 value Uint8 padding1 Uint8 padding2 ctypedef struct SDL_JoyButtonEvent: Uint32 type Uint32 timestamp SDL_JoystickID which Uint8 button Uint8 state Uint8 padding1 Uint8 padding2 ctypedef struct SDL_JoyDeviceEvent: Uint32 type Uint32 timestamp Sint32 which ctypedef struct SDL_ControllerAxisEvent: Uint32 type Uint32 timestamp SDL_JoystickID which Uint8 axis Uint8 padding1 Uint8 padding2 Uint8 padding3 Sint16 value Uint16 padding4 ctypedef struct SDL_ControllerButtonEvent: Uint32 type Uint32 timestamp SDL_JoystickID which Uint8 button Uint8 state Uint8 padding1 Uint8 padding2 ctypedef struct SDL_ControllerDeviceEvent: Uint32 type Uint32 timestamp Sint32 which ctypedef struct SDL_AudioDeviceEvent: Uint32 type Uint32 timestamp Uint32 which Uint8 iscapture Uint8 padding1 Uint8 padding2 Uint8 padding3 ctypedef struct SDL_TouchFingerEvent: Uint32 type Uint32 timestamp SDL_TouchID touchId SDL_FingerID fingerId float x float y float dx float dy float pressure ctypedef struct SDL_MultiGestureEvent: Uint32 type Uint32 timestamp SDL_TouchID touchId float dTheta float dDist float x float y Uint16 numFingers Uint16 padding ctypedef struct SDL_DollarGestureEvent: Uint32 type Uint32 timestamp SDL_TouchID touchId SDL_GestureID gestureId Uint32 numFingers float error float x float y ctypedef struct SDL_DropEvent: Uint32 type Uint32 timestamp char *file Uint32 windowID ctypedef struct SDL_SensorEvent: Uint32 type Uint32 timestamp Sint32 which float data[6] ctypedef struct SDL_QuitEvent: Uint32 type Uint32 timestamp ctypedef struct SDL_OSEvent: Uint32 type Uint32 timestamp ctypedef struct SDL_UserEvent: Uint32 type Uint32 timestamp Uint32 windowID Sint32 code void *data1 void *data2 ctypedef struct SDL_SysWMmsg ctypedef struct SDL_SysWMEvent: Uint32 type Uint32 timestamp SDL_SysWMmsg *msg ctypedef union SDL_Event: Uint32 type SDL_CommonEvent common SDL_DisplayEvent display SDL_WindowEvent window SDL_KeyboardEvent key SDL_TextEditingEvent edit SDL_TextInputEvent text SDL_MouseMotionEvent motion SDL_MouseButtonEvent button SDL_MouseWheelEvent wheel SDL_JoyAxisEvent jaxis SDL_JoyBallEvent jball SDL_JoyHatEvent jhat SDL_JoyButtonEvent jbutton SDL_JoyDeviceEvent jdevice SDL_ControllerAxisEvent caxis SDL_ControllerButtonEvent cbutton SDL_ControllerDeviceEvent cdevice SDL_AudioDeviceEvent adevice SDL_SensorEvent sensor SDL_QuitEvent quit SDL_UserEvent user SDL_SysWMEvent syswm SDL_TouchFingerEvent tfinger SDL_MultiGestureEvent mgesture SDL_DollarGestureEvent dgesture SDL_DropEvent drop Uint8 padding[56] void SDL_PumpEvents() ctypedef enum SDL_eventaction: SDL_ADDEVENT SDL_PEEKEVENT SDL_GETEVENT int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, Uint32 minType, Uint32 maxType) SDL_bool SDL_HasEvent(Uint32 type) SDL_bool SDL_HasEvents(Uint32 minType, Uint32 maxType) void SDL_FlushEvent(Uint32 type) void SDL_FlushEvents(Uint32 minType, Uint32 maxType) int SDL_PollEvent(SDL_Event *event) int SDL_WaitEvent(SDL_Event *event) int SDL_WaitEventTimeout(SDL_Event *event, int timeout) int SDL_PushEvent(SDL_Event *event) ctypedef int (*SDL_EventFilter)(void *userdata, SDL_Event *event) void SDL_SetEventFilter(SDL_EventFilter filter, void *userdata) SDL_bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata) void SDL_AddEventWatch(SDL_EventFilter filter, void *userdata) void SDL_DelEventWatch(SDL_EventFilter filter, void *userdata) void SDL_FilterEvents(SDL_EventFilter filter, void *userdata) Uint8 SDL_EventState(Uint32 type, int state) Uint32 SDL_RegisterEvents(int numevents) char *SDL_GetBasePath() char *SDL_GetPrefPath(const char *org, const char *app) ctypedef struct SDL_Haptic ctypedef struct SDL_HapticDirection: Uint8 type Sint32 dir[3] ctypedef struct SDL_HapticConstant: Uint16 type SDL_HapticDirection direction Uint32 length Uint16 delay Uint16 button Uint16 interval Sint16 level Uint16 attack_length Uint16 attack_level Uint16 fade_length Uint16 fade_level ctypedef struct SDL_HapticPeriodic: Uint16 type SDL_HapticDirection direction Uint32 length Uint16 delay Uint16 button Uint16 interval Uint16 period Sint16 magnitude Sint16 offset Uint16 phase Uint16 attack_length Uint16 attack_level Uint16 fade_length Uint16 fade_level ctypedef struct SDL_HapticCondition: Uint16 type SDL_HapticDirection direction Uint32 length Uint16 delay Uint16 button Uint16 interval Uint16 right_sat[3] Uint16 left_sat[3] Sint16 right_coeff[3] Sint16 left_coeff[3] Uint16 deadband[3] Sint16 center[3] ctypedef struct SDL_HapticRamp: Uint16 type SDL_HapticDirection direction Uint32 length Uint16 delay Uint16 button Uint16 interval Sint16 start Sint16 end Uint16 attack_length Uint16 attack_level Uint16 fade_length Uint16 fade_level ctypedef struct SDL_HapticLeftRight: Uint16 type Uint32 length Uint16 large_magnitude Uint16 small_magnitude ctypedef struct SDL_HapticCustom: Uint16 type SDL_HapticDirection direction Uint32 length Uint16 delay Uint16 button Uint16 interval Uint8 channels Uint16 period Uint16 samples Uint16 *data Uint16 attack_length Uint16 attack_level Uint16 fade_length Uint16 fade_level ctypedef union SDL_HapticEffect: Uint16 type SDL_HapticConstant constant SDL_HapticPeriodic periodic SDL_HapticCondition condition SDL_HapticRamp ramp SDL_HapticLeftRight leftright SDL_HapticCustom custom int SDL_NumHaptics() const char *SDL_HapticName(int device_index) SDL_Haptic *SDL_HapticOpen(int device_index) int SDL_HapticOpened(int device_index) int SDL_HapticIndex(SDL_Haptic *haptic) int SDL_MouseIsHaptic() SDL_Haptic *SDL_HapticOpenFromMouse() int SDL_JoystickIsHaptic(SDL_Joystick *joystick) SDL_Haptic *SDL_HapticOpenFromJoystick(SDL_Joystick *joystick) void SDL_HapticClose(SDL_Haptic *haptic) int SDL_HapticNumEffects(SDL_Haptic *haptic) int SDL_HapticNumEffectsPlaying(SDL_Haptic *haptic) unsigned int SDL_HapticQuery(SDL_Haptic *haptic) int SDL_HapticNumAxes(SDL_Haptic *haptic) int SDL_HapticEffectSupported(SDL_Haptic *haptic, SDL_HapticEffect *effect) int SDL_HapticNewEffect(SDL_Haptic *haptic, SDL_HapticEffect *effect) int SDL_HapticUpdateEffect(SDL_Haptic *haptic, int effect, SDL_HapticEffect *data) int SDL_HapticRunEffect(SDL_Haptic *haptic, int effect, Uint32 iterations) int SDL_HapticStopEffect(SDL_Haptic *haptic, int effect) void SDL_HapticDestroyEffect(SDL_Haptic *haptic, int effect) int SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect) int SDL_HapticSetGain(SDL_Haptic *haptic, int gain) int SDL_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter) int SDL_HapticPause(SDL_Haptic *haptic) int SDL_HapticUnpause(SDL_Haptic *haptic) int SDL_HapticStopAll(SDL_Haptic *haptic) int SDL_HapticRumbleSupported(SDL_Haptic *haptic) int SDL_HapticRumbleInit(SDL_Haptic *haptic) int SDL_HapticRumblePlay(SDL_Haptic *haptic, float strength, Uint32 length) int SDL_HapticRumbleStop(SDL_Haptic *haptic) ctypedef enum SDL_HintPriority: SDL_HINT_DEFAULT SDL_HINT_NORMAL SDL_HINT_OVERRIDE SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority) SDL_bool SDL_SetHint(const char *name, const char *value) const char *SDL_GetHint(const char *name) SDL_bool SDL_GetHintBoolean(const char *name, SDL_bool default_value) ctypedef void (*SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue) void SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata) void SDL_DelHintCallback(const char *name, SDL_HintCallback callback, void *userdata) void SDL_ClearHints() void *SDL_LoadObject(const char *sofile) void *SDL_LoadFunction(void *handle, const char *name) void SDL_UnloadObject(void *handle) cdef enum: SDL_LOG_CATEGORY_APPLICATION SDL_LOG_CATEGORY_ERROR SDL_LOG_CATEGORY_ASSERT SDL_LOG_CATEGORY_SYSTEM SDL_LOG_CATEGORY_AUDIO SDL_LOG_CATEGORY_VIDEO SDL_LOG_CATEGORY_RENDER SDL_LOG_CATEGORY_INPUT SDL_LOG_CATEGORY_TEST SDL_LOG_CATEGORY_RESERVED1 SDL_LOG_CATEGORY_RESERVED2 SDL_LOG_CATEGORY_RESERVED3 SDL_LOG_CATEGORY_RESERVED4 SDL_LOG_CATEGORY_RESERVED5 SDL_LOG_CATEGORY_RESERVED6 SDL_LOG_CATEGORY_RESERVED7 SDL_LOG_CATEGORY_RESERVED8 SDL_LOG_CATEGORY_RESERVED9 SDL_LOG_CATEGORY_RESERVED10 SDL_LOG_CATEGORY_CUSTOM ctypedef enum SDL_LogPriority: SDL_LOG_PRIORITY_VERBOSE SDL_LOG_PRIORITY_DEBUG SDL_LOG_PRIORITY_INFO SDL_LOG_PRIORITY_WARN SDL_LOG_PRIORITY_ERROR SDL_LOG_PRIORITY_CRITICAL SDL_NUM_LOG_PRIORITIES void SDL_LogSetAllPriority(SDL_LogPriority priority) void SDL_LogSetPriority(int category, SDL_LogPriority priority) SDL_LogPriority SDL_LogGetPriority(int category) void SDL_LogResetPriorities() void SDL_Log(const char *fmt, ...) void SDL_LogVerbose(int category, const char *fmt, ...) void SDL_LogDebug(int category, const char *fmt, ...) void SDL_LogInfo(int category, const char *fmt, ...) void SDL_LogWarn(int category, const char *fmt, ...) void SDL_LogError(int category, const char *fmt, ...) void SDL_LogCritical(int category, const char *fmt, ...) void SDL_LogMessage(int category, SDL_LogPriority priority, const char *fmt, ...) ctypedef void (*SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message) void SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata) void SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata) ctypedef enum SDL_MessageBoxFlags: SDL_MESSAGEBOX_ERROR SDL_MESSAGEBOX_WARNING SDL_MESSAGEBOX_INFORMATION ctypedef enum SDL_MessageBoxButtonFlags: SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT ctypedef struct SDL_MessageBoxButtonData: Uint32 flags int buttonid const char *text ctypedef struct SDL_MessageBoxColor: Uint8 r Uint8 g Uint8 b ctypedef enum SDL_MessageBoxColorType: SDL_MESSAGEBOX_COLOR_BACKGROUND SDL_MESSAGEBOX_COLOR_TEXT SDL_MESSAGEBOX_COLOR_BUTTON_BORDER SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED SDL_MESSAGEBOX_COLOR_MAX ctypedef struct SDL_MessageBoxColorScheme: SDL_MessageBoxColor colors[5] ctypedef struct SDL_MessageBoxData: Uint32 flags SDL_Window *window const char *title const char *message int numbuttons const SDL_MessageBoxButtonData *buttons const SDL_MessageBoxColorScheme *colorScheme int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) int SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window) ctypedef enum SDL_PowerState: SDL_POWERSTATE_UNKNOWN SDL_POWERSTATE_ON_BATTERY SDL_POWERSTATE_NO_BATTERY SDL_POWERSTATE_CHARGING SDL_POWERSTATE_CHARGED SDL_PowerState SDL_GetPowerInfo(int *secs, int *pct) ctypedef enum SDL_RendererFlags: SDL_RENDERER_SOFTWARE SDL_RENDERER_ACCELERATED SDL_RENDERER_PRESENTVSYNC SDL_RENDERER_TARGETTEXTURE ctypedef struct SDL_RendererInfo: const char *name Uint32 flags Uint32 num_texture_formats Uint32 texture_formats[16] int max_texture_width int max_texture_height ctypedef enum SDL_TextureAccess: SDL_TEXTUREACCESS_STATIC SDL_TEXTUREACCESS_STREAMING SDL_TEXTUREACCESS_TARGET ctypedef enum SDL_TextureModulate: SDL_TEXTUREMODULATE_NONE SDL_TEXTUREMODULATE_COLOR SDL_TEXTUREMODULATE_ALPHA ctypedef enum SDL_RendererFlip: SDL_FLIP_NONE SDL_FLIP_HORIZONTAL SDL_FLIP_VERTICAL ctypedef struct SDL_Renderer ctypedef struct SDL_Texture int SDL_GetNumRenderDrivers() int SDL_GetRenderDriverInfo(int index, SDL_RendererInfo *info) int SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags, SDL_Window **window, SDL_Renderer **renderer) SDL_Renderer *SDL_CreateRenderer(SDL_Window *window, int index, Uint32 flags) SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface) SDL_Renderer *SDL_GetRenderer(SDL_Window *window) int SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_RendererInfo *info) int SDL_GetRendererOutputSize(SDL_Renderer *renderer, int *w, int *h) SDL_Texture *SDL_CreateTexture(SDL_Renderer *renderer, Uint32 format, int access, int w, int h) SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface) int SDL_QueryTexture(SDL_Texture *texture, Uint32 *format, int *access, int *w, int *h) int SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b) int SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b) int SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha) int SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha) int SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode) int SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode) int SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) int SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch) int SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) void SDL_UnlockTexture(SDL_Texture *texture) SDL_bool SDL_RenderTargetSupported(SDL_Renderer *renderer) int SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) SDL_Texture *SDL_GetRenderTarget(SDL_Renderer *renderer) int SDL_RenderSetLogicalSize(SDL_Renderer *renderer, int w, int h) void SDL_RenderGetLogicalSize(SDL_Renderer *renderer, int *w, int *h) int SDL_RenderSetIntegerScale(SDL_Renderer *renderer, SDL_bool enable) SDL_bool SDL_RenderGetIntegerScale(SDL_Renderer *renderer) int SDL_RenderSetViewport(SDL_Renderer *renderer, const SDL_Rect *rect) void SDL_RenderGetViewport(SDL_Renderer *renderer, SDL_Rect *rect) int SDL_RenderSetClipRect(SDL_Renderer *renderer, const SDL_Rect *rect) void SDL_RenderGetClipRect(SDL_Renderer *renderer, SDL_Rect *rect) SDL_bool SDL_RenderIsClipEnabled(SDL_Renderer *renderer) int SDL_RenderSetScale(SDL_Renderer *renderer, float scaleX, float scaleY) void SDL_RenderGetScale(SDL_Renderer *renderer, float *scaleX, float *scaleY) int SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) int SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) int SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode) int SDL_RenderClear(SDL_Renderer *renderer) int SDL_RenderDrawPoint(SDL_Renderer *renderer, int x, int y) int SDL_RenderDrawPoints(SDL_Renderer *renderer, const SDL_Point *points, int count) int SDL_RenderDrawLine(SDL_Renderer *renderer, int x1, int y1, int x2, int y2) int SDL_RenderDrawLines(SDL_Renderer *renderer, const SDL_Point *points, int count) int SDL_RenderDrawRect(SDL_Renderer *renderer, const SDL_Rect *rect) int SDL_RenderDrawRects(SDL_Renderer *renderer, const SDL_Rect *rects, int count) int SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_Rect *rect) int SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_Rect *rects, int count) int SDL_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_Rect *dstrect) int SDL_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_Rect *dstrect, const double angle, const SDL_Point *center, const SDL_RendererFlip flip) int SDL_RenderDrawPointF(SDL_Renderer *renderer, float x, float y) int SDL_RenderDrawPointsF(SDL_Renderer *renderer, const SDL_FPoint *points, int count) int SDL_RenderDrawLineF(SDL_Renderer *renderer, float x1, float y1, float x2, float y2) int SDL_RenderDrawLinesF(SDL_Renderer *renderer, const SDL_FPoint *points, int count) int SDL_RenderDrawRectF(SDL_Renderer *renderer, const SDL_FRect *rect) int SDL_RenderDrawRectsF(SDL_Renderer *renderer, const SDL_FRect *rects, int count) int SDL_RenderFillRectF(SDL_Renderer *renderer, const SDL_FRect *rect) int SDL_RenderFillRectsF(SDL_Renderer *renderer, const SDL_FRect *rects, int count) int SDL_RenderCopyF(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect) int SDL_RenderCopyExF(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip) int SDL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch) void SDL_RenderPresent(SDL_Renderer *renderer) void SDL_DestroyTexture(SDL_Texture *texture) void SDL_DestroyRenderer(SDL_Renderer *renderer) int SDL_RenderFlush(SDL_Renderer *renderer) int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh) int SDL_GL_UnbindTexture(SDL_Texture *texture) void *SDL_RenderGetMetalLayer(SDL_Renderer *renderer) void *SDL_RenderGetMetalCommandEncoder(SDL_Renderer *renderer) ctypedef struct SDL_Sensor ctypedef Sint32 SDL_SensorID ctypedef enum SDL_SensorType: SDL_SENSOR_INVALID SDL_SENSOR_UNKNOWN SDL_SENSOR_ACCEL SDL_SENSOR_GYRO int SDL_NumSensors() const char *SDL_SensorGetDeviceName(int device_index) SDL_SensorType SDL_SensorGetDeviceType(int device_index) int SDL_SensorGetDeviceNonPortableType(int device_index) SDL_SensorID SDL_SensorGetDeviceInstanceID(int device_index) SDL_Sensor *SDL_SensorOpen(int device_index) SDL_Sensor *SDL_SensorFromInstanceID(SDL_SensorID instance_id) const char *SDL_SensorGetName(SDL_Sensor *sensor) SDL_SensorType SDL_SensorGetType(SDL_Sensor *sensor) int SDL_SensorGetNonPortableType(SDL_Sensor *sensor) SDL_SensorID SDL_SensorGetInstanceID(SDL_Sensor *sensor) int SDL_SensorGetData(SDL_Sensor *sensor, float *data, int num_values) void SDL_SensorClose(SDL_Sensor *sensor) void SDL_SensorUpdate() SDL_Window *SDL_CreateShapedWindow(const char *title, unsigned int x, unsigned int y, unsigned int w, unsigned int h, Uint32 flags) SDL_bool SDL_IsShapedWindow(const SDL_Window *window) ctypedef enum WindowShapeMode: ShapeModeDefault ShapeModeBinarizeAlpha ShapeModeReverseBinarizeAlpha ShapeModeColorKey ctypedef union SDL_WindowShapeParams: Uint8 binarizationCutoff SDL_Color colorKey ctypedef struct SDL_WindowShapeMode: WindowShapeMode mode SDL_WindowShapeParams parameters int SDL_SetWindowShape(SDL_Window *window, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode) int SDL_GetShapedWindowMode(SDL_Window *window, SDL_WindowShapeMode *shape_mode) int SDL_LinuxSetThreadPriority(Sint64 threadID, int priority) SDL_bool SDL_IsTablet() Uint32 SDL_GetTicks() Uint64 SDL_GetPerformanceCounter() Uint64 SDL_GetPerformanceFrequency() void SDL_Delay(Uint32 ms) ctypedef Uint32 (*SDL_TimerCallback)(Uint32 interval, void *param) ctypedef int SDL_TimerID SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param) SDL_bool SDL_RemoveTimer(SDL_TimerID id) ctypedef struct SDL_version: Uint8 major Uint8 minor Uint8 patch void SDL_GetVersion(SDL_version *ver) const char *SDL_GetRevision() int SDL_GetRevisionNumber() int SDL_Init(Uint32 flags) int SDL_InitSubSystem(Uint32 flags) void SDL_QuitSubSystem(Uint32 flags) Uint32 SDL_WasInit(Uint32 flags) void SDL_Quit() cdef enum: AUDIO_F32 AUDIO_F32LSB AUDIO_F32MSB AUDIO_F32SYS AUDIO_S16 AUDIO_S16LSB AUDIO_S16MSB AUDIO_S16SYS AUDIO_S32 AUDIO_S32LSB AUDIO_S32MSB AUDIO_S32SYS AUDIO_S8 AUDIO_U16 AUDIO_U16LSB AUDIO_U16MSB AUDIO_U16SYS AUDIO_U8 KMOD_ALT KMOD_CTRL KMOD_GUI KMOD_SHIFT RW_SEEK_CUR RW_SEEK_END RW_SEEK_SET SDLK_SCANCODE_MASK SDL_AUDIOCVT_MAX_FILTERS SDL_AUDIOCVT_PACKED SDL_AUDIO_ALLOW_ANY_CHANGE SDL_AUDIO_ALLOW_CHANNELS_CHANGE SDL_AUDIO_ALLOW_FORMAT_CHANGE SDL_AUDIO_ALLOW_FREQUENCY_CHANGE SDL_AUDIO_ALLOW_SAMPLES_CHANGE SDL_AUDIO_BITSIZE SDL_AUDIO_ISBIGENDIAN SDL_AUDIO_ISFLOAT SDL_AUDIO_ISINT SDL_AUDIO_ISLITTLEENDIAN SDL_AUDIO_ISSIGNED SDL_AUDIO_ISUNSIGNED SDL_AUDIO_MASK_BITSIZE SDL_AUDIO_MASK_DATATYPE SDL_AUDIO_MASK_ENDIAN SDL_AUDIO_MASK_SIGNED SDL_BIG_ENDIAN SDL_BUTTON SDL_BUTTON_LEFT SDL_BUTTON_LMASK SDL_BUTTON_MIDDLE SDL_BUTTON_MMASK SDL_BUTTON_RIGHT SDL_BUTTON_RMASK SDL_BUTTON_X1 SDL_BUTTON_X1MASK SDL_BUTTON_X2 SDL_BUTTON_X2MASK SDL_BYTEORDER SDL_DISABLE SDL_DONTFREE SDL_ENABLE SDL_HAPTIC_AUTOCENTER SDL_HAPTIC_CARTESIAN SDL_HAPTIC_CONSTANT SDL_HAPTIC_CUSTOM SDL_HAPTIC_DAMPER SDL_HAPTIC_FRICTION SDL_HAPTIC_GAIN SDL_HAPTIC_INERTIA SDL_HAPTIC_INFINITY SDL_HAPTIC_LEFTRIGHT SDL_HAPTIC_PAUSE SDL_HAPTIC_POLAR SDL_HAPTIC_RAMP SDL_HAPTIC_SAWTOOTHDOWN SDL_HAPTIC_SAWTOOTHUP SDL_HAPTIC_SINE SDL_HAPTIC_SPHERICAL SDL_HAPTIC_SPRING SDL_HAPTIC_STATUS SDL_HAPTIC_TRIANGLE SDL_HAT_CENTERED SDL_HAT_DOWN SDL_HAT_LEFT SDL_HAT_LEFTDOWN SDL_HAT_LEFTUP SDL_HAT_RIGHT SDL_HAT_RIGHTDOWN SDL_HAT_RIGHTUP SDL_HAT_UP SDL_HINT_ACCELEROMETER_AS_JOYSTICK SDL_HINT_ALLOW_TOPMOST SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION SDL_HINT_ANDROID_BLOCK_ON_PAUSE SDL_HINT_ANDROID_TRAP_BACK_BUTTON SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION SDL_HINT_AUDIO_CATEGORY SDL_HINT_AUDIO_RESAMPLING_MODE SDL_HINT_BMP_SAVE_LEGACY_FORMAT SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT SDL_HINT_ENABLE_STEAM_CONTROLLERS SDL_HINT_EVENT_LOGGING SDL_HINT_FRAMEBUFFER_ACCELERATION SDL_HINT_GAMECONTROLLERCONFIG SDL_HINT_GAMECONTROLLERCONFIG_FILE SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT SDL_HINT_GRAB_KEYBOARD SDL_HINT_IDLE_TIMER_DISABLED SDL_HINT_IME_INTERNAL_EDITING SDL_HINT_IOS_HIDE_HOME_INDICATOR SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS SDL_HINT_JOYSTICK_HIDAPI SDL_HINT_JOYSTICK_HIDAPI_PS4 SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE SDL_HINT_JOYSTICK_HIDAPI_STEAM SDL_HINT_JOYSTICK_HIDAPI_SWITCH SDL_HINT_JOYSTICK_HIDAPI_XBOX SDL_HINT_MAC_BACKGROUND_APP SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS SDL_HINT_MOUSE_DOUBLE_CLICK_TIME SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH SDL_HINT_MOUSE_NORMAL_SPEED_SCALE SDL_HINT_MOUSE_RELATIVE_MODE_WARP SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE SDL_HINT_MOUSE_TOUCH_EVENTS SDL_HINT_NO_SIGNAL_HANDLERS SDL_HINT_OPENGL_ES_DRIVER SDL_HINT_ORIENTATIONS SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION SDL_HINT_QTWAYLAND_WINDOW_FLAGS SDL_HINT_RENDER_BATCHING SDL_HINT_RENDER_DIRECT3D11_DEBUG SDL_HINT_RENDER_DIRECT3D_THREADSAFE SDL_HINT_RENDER_DRIVER SDL_HINT_RENDER_LOGICAL_SIZE_MODE SDL_HINT_RENDER_OPENGL_SHADERS SDL_HINT_RENDER_SCALE_QUALITY SDL_HINT_RENDER_VSYNC SDL_HINT_RETURN_KEY_HIDES_IME SDL_HINT_RPI_VIDEO_LAYER SDL_HINT_THREAD_STACK_SIZE SDL_HINT_TIMER_RESOLUTION SDL_HINT_TOUCH_MOUSE_EVENTS SDL_HINT_TV_REMOTE_AS_JOYSTICK SDL_HINT_VIDEO_ALLOW_SCREENSAVER SDL_HINT_VIDEO_DOUBLE_BUFFER SDL_HINT_VIDEO_HIGHDPI_DISABLED SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT SDL_HINT_VIDEO_WIN_D3DCOMPILER SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR SDL_HINT_VIDEO_X11_NET_WM_PING SDL_HINT_VIDEO_X11_XINERAMA SDL_HINT_VIDEO_X11_XRANDR SDL_HINT_VIDEO_X11_XVIDMODE SDL_HINT_WAVE_FACT_CHUNK SDL_HINT_WAVE_RIFF_CHUNK_SIZE SDL_HINT_WAVE_TRUNCATION SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP SDL_HINT_WINDOWS_INTRESOURCE_ICON SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN SDL_HINT_WINRT_HANDLE_BACK_BUTTON SDL_HINT_WINRT_PRIVACY_POLICY_LABEL SDL_HINT_WINRT_PRIVACY_POLICY_URL SDL_HINT_XINPUT_ENABLED SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING SDL_IGNORE SDL_INIT_AUDIO SDL_INIT_EVENTS SDL_INIT_EVERYTHING SDL_INIT_GAMECONTROLLER SDL_INIT_HAPTIC SDL_INIT_JOYSTICK SDL_INIT_NOPARACHUTE SDL_INIT_SENSOR SDL_INIT_TIMER SDL_INIT_VIDEO SDL_LIL_ENDIAN SDL_MAJOR_VERSION SDL_MINOR_VERSION SDL_PATCHLEVEL SDL_PREALLOC SDL_PRESSED SDL_QUERY SDL_RELEASED SDL_RLEACCEL SDL_RWOPS_JNIFILE SDL_RWOPS_MEMORY SDL_RWOPS_MEMORY_RO SDL_RWOPS_STDFILE SDL_RWOPS_UNKNOWN SDL_RWOPS_WINFILE SDL_SWSURFACE SDL_TEXTEDITINGEVENT_TEXT_SIZE SDL_TEXTINPUTEVENT_TEXT_SIZE SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY SDL_WINDOWPOS_CENTERED_MASK SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY SDL_WINDOWPOS_UNDEFINED_MASK int SDL_MUSTLOCK(SDL_Surface *) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1429188640.0 pygame_sdl2-2.1.0+renpy8.4.1/include/sdl2_gfx.pxd0000664000175000017500000001644212513730040017536 0ustar00tomtomfrom sdl2 cimport * cdef extern from "SDL2_rotozoom.h" nogil: cdef enum: SMOOTHING_OFF SMOOTHING_ON SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int smooth) SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, double zoomy, int smooth) void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight) void rotozoomSurfaceSizeXY(int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight) SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth) void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight) SDL_Surface *shrinkSurface(SDL_Surface * src, int factorx, int factory) SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns) cdef extern from "SDL_gfxPrimitives.h" nogil: int pixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) int pixelRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int hlineColor(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color) int hlineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int vlineColor(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color) int vlineRGBA(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int rectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) int rectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int roundedRectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color) int roundedRectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int boxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) int boxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int roundedBoxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color) int roundedBoxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int lineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) int lineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int aalineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) int aalineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int thickLineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color) int thickLineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int circleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color) int circleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int arcColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color) int arcRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int aacircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color) int aacircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int filledCircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color) int filledCircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int ellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) int ellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int aaellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) int aaellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int filledEllipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) int filledEllipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int pieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color) int pieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int filledPieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color) int filledPieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int trigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) int trigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int aatrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) int aatrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int filledTrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) int filledTrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int polygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color) int polygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int aapolygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color) int aapolygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int filledPolygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color) int filledPolygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int texturedPolygon(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, SDL_Surface * texture,int texture_dx,int texture_dy) int bezierColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, int s, Uint32 color) int bezierRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a) void gfxPrimitivesSetFont(const void *fontdata, Uint32 cw, Uint32 ch) void gfxPrimitivesSetFontRotation(Uint32 rotation) int characterColor(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint32 color) int characterRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int stringColor(SDL_Surface * dst, Sint16 x, Sint16 y, const char *s, Uint32 color) int stringRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1674096549.0 pygame_sdl2-2.1.0+renpy8.4.1/include/sdl2_image.pxd0000664000175000017500000000166514362127645020054 0ustar00tomtomfrom sdl2 cimport * cdef extern from "sdl_image_compat.h" nogil: ctypedef enum IMG_InitFlags: IMG_INIT_JPG IMG_INIT_PNG IMG_INIT_TIF IMG_INIT_WEBP IMG_INIT_JXL IMG_INIT_AVIF int IMG_Init(int flags) void IMG_Quit() SDL_Surface *IMG_Load(const char *file) SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc) SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, const char *type) SDL_Surface *IMG_LoadSizedSVG_RW(SDL_RWops *src, int width, int height) SDL_Texture *IMG_LoadTexture(SDL_Renderer *renderer, const char *file) SDL_Texture *IMG_LoadTexture_RW(SDL_Renderer *renderer, SDL_RWops *src, int freesrc) SDL_Texture *IMG_LoadTextureTyped_RW(SDL_Renderer *renderer, SDL_RWops *src, int freesrc, const char *type) int IMG_SavePNG(SDL_Surface *surface, const char *file) int IMG_SavePNG_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1522804933.0 pygame_sdl2-2.1.0+renpy8.4.1/include/sdl2_mixer.pxd0000644000175000017500000001111113261024305020061 0ustar00tomtomfrom sdl2 cimport * # Acquire the GIL for callbacks. cdef extern from "SDL_mixer.h": void Mix_ChannelFinished(void (*channel_finished)(int channel)) void Mix_HookMusicFinished(void (*music_finished)()) void Mix_SetPostMix(void (*mix_func)(void *udata, Uint8 *stream, int len), void *arg) void Mix_HookMusic(void (*mix_func)(void *udata, Uint8 *stream, int len), void *arg) cdef extern from "SDL_mixer.h" nogil: cdef enum: SDL_MIXER_MAJOR_VERSION SDL_MIXER_MINOR_VERSION SDL_MIXER_PATCHLEVEL const SDL_version * Mix_Linked_Version() ctypedef enum MIX_InitFlags: MIX_INIT_FLAC MIX_INIT_MP3 MIX_INIT_OGG int Mix_Init(int flags) void Mix_Quit() cdef enum: MIX_CHANNELS MIX_DEFAULT_FREQUENCY MIX_DEFAULT_FORMAT MIX_DEFAULT_CHANNELS MIX_MAX_VOLUME ctypedef struct Mix_Chunk: int allocated Uint8 *abuf Uint32 alen Uint8 volume ctypedef enum Mix_Fading: MIX_NO_FADING MIX_FADING_OUT MIX_FADING_IN ctypedef enum Mix_MusicType: MUS_NONE MUS_CMD MUS_WAV MUS_MOD MUS_MID MUS_OGG MUS_MP3 MUS_MP3_MAD MUS_FLAC MUS_MODPLUG ctypedef struct _Mix_Music ctypedef _Mix_Music Mix_Music int Mix_OpenAudio(int frequency, Uint16 format, int channels, int chunksize) int Mix_AllocateChannels(int numchans) int Mix_QuerySpec(int *frequency,Uint16 *format,int *channels) Mix_Chunk * Mix_LoadWAV_RW(SDL_RWops *src, int freesrc) Mix_Music * Mix_LoadMUS(const char *file) Mix_Music * Mix_LoadMUS_RW(SDL_RWops *src, int freesrc) Mix_Music * Mix_LoadMUSType_RW(SDL_RWops *src, Mix_MusicType type, int freesrc) Mix_Chunk * Mix_QuickLoad_WAV(Uint8 *mem) Mix_Chunk * Mix_QuickLoad_RAW(Uint8 *mem, Uint32 len) void Mix_FreeChunk(Mix_Chunk *chunk) void Mix_FreeMusic(Mix_Music *music) int Mix_GetNumChunkDecoders() const char * Mix_GetChunkDecoder(int index) int Mix_GetNumMusicDecoders() const char * Mix_GetMusicDecoder(int index) Mix_MusicType Mix_GetMusicType(const Mix_Music *music) void * Mix_GetMusicHookData() cdef enum: MIX_CHANNEL_POST ctypedef void (*Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata) ctypedef void (*Mix_EffectDone_t)(int chan, void *udata) int Mix_RegisterEffect(int chan, Mix_EffectFunc_t f, Mix_EffectDone_t d, void *arg) int Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f) int Mix_UnregisterAllEffects(int channel) cdef enum: MIX_EFFECTSMAXSPEED int Mix_SetPanning(int channel, Uint8 left, Uint8 right) int Mix_SetPosition(int channel, Sint16 angle, Uint8 distance) int Mix_SetDistance(int channel, Uint8 distance) int Mix_SetReverseStereo(int channel, int flip) int Mix_ReserveChannels(int num) int Mix_GroupChannel(int which, int tag) int Mix_GroupChannels(int from_, int to, int tag) int Mix_GroupAvailable(int tag) int Mix_GroupCount(int tag) int Mix_GroupOldest(int tag) int Mix_GroupNewer(int tag) int Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ticks) int Mix_PlayMusic(Mix_Music *music, int loops) int Mix_FadeInMusic(Mix_Music *music, int loops, int ms) int Mix_FadeInMusicPos(Mix_Music *music, int loops, int ms, double position) int Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks) int Mix_Volume(int channel, int volume) int Mix_VolumeChunk(Mix_Chunk *chunk, int volume) int Mix_VolumeMusic(int volume) int Mix_HaltChannel(int channel) int Mix_HaltGroup(int tag) int Mix_HaltMusic() int Mix_ExpireChannel(int channel, int ticks) int Mix_FadeOutChannel(int which, int ms) int Mix_FadeOutGroup(int tag, int ms) int Mix_FadeOutMusic(int ms) Mix_Fading Mix_FadingMusic() Mix_Fading Mix_FadingChannel(int which) void Mix_Pause(int channel) void Mix_Resume(int channel) int Mix_Paused(int channel) void Mix_PauseMusic() void Mix_ResumeMusic() void Mix_RewindMusic() int Mix_PausedMusic() int Mix_SetMusicPosition(double position) int Mix_Playing(int channel) int Mix_PlayingMusic() int Mix_SetMusicCMD(const char *command) int Mix_SetSynchroValue(int value) int Mix_GetSynchroValue() int Mix_SetSoundFonts(const char *paths) const char* Mix_GetSoundFonts() int Mix_EachSoundFont(int (*function)(const char*, void*), void *data) Mix_Chunk * Mix_GetChunk(int channel) void Mix_CloseAudio() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1415242907.0 pygame_sdl2-2.1.0+renpy8.4.1/include/sdl2_ttf.pxd0000664000175000017500000001010212426562233017544 0ustar00tomtomfrom sdl2 cimport * cdef extern from "SDL_ttf.h" nogil: cdef enum: SDL_TTF_MAJOR_VERSION SDL_TTF_MINOR_VERSION SDL_TTF_PATCHLEVEL const SDL_version * TTF_Linked_Version() cdef enum: UNICODE_BOM_NATIVE UNICODE_BOM_SWAPPED void TTF_ByteSwappedUNICODE(int swapped) ctypedef struct _TTF_Font ctypedef _TTF_Font TTF_Font int TTF_Init() TTF_Font * TTF_OpenFont(const char *file, int ptsize) TTF_Font * TTF_OpenFontIndex(const char *file, int ptsize, long index) TTF_Font * TTF_OpenFontRW(SDL_RWops *src, int freesrc, int ptsize) TTF_Font * TTF_OpenFontIndexRW(SDL_RWops *src, int freesrc, int ptsize, long index) cdef enum: TTF_STYLE_NORMAL TTF_STYLE_BOLD TTF_STYLE_ITALIC TTF_STYLE_UNDERLINE TTF_STYLE_STRIKETHROUGH int TTF_GetFontStyle(const TTF_Font *font) void TTF_SetFontStyle(TTF_Font *font, int style) int TTF_GetFontOutline(const TTF_Font *font) void TTF_SetFontOutline(TTF_Font *font, int outline) cdef enum: TTF_HINTING_NORMAL TTF_HINTING_LIGHT TTF_HINTING_MONO TTF_HINTING_NONE int TTF_GetFontHinting(const TTF_Font *font) void TTF_SetFontHinting(TTF_Font *font, int hinting) int TTF_FontHeight(const TTF_Font *font) int TTF_FontAscent(const TTF_Font *font) int TTF_FontDescent(const TTF_Font *font) int TTF_FontLineSkip(const TTF_Font *font) int TTF_GetFontKerning(const TTF_Font *font) void TTF_SetFontKerning(TTF_Font *font, int allowed) long TTF_FontFaces(const TTF_Font *font) int TTF_FontFaceIsFixedWidth(const TTF_Font *font) char * TTF_FontFaceFamilyName(const TTF_Font *font) char * TTF_FontFaceStyleName(const TTF_Font *font) int TTF_GlyphIsProvided(const TTF_Font *font, Uint16 ch) int TTF_GlyphMetrics(TTF_Font *font, Uint16 ch, int *minx, int *maxx, int *miny, int *maxy, int *advance) int TTF_SizeText(TTF_Font *font, const char *text, int *w, int *h) int TTF_SizeUTF8(TTF_Font *font, const char *text, int *w, int *h) int TTF_SizeUNICODE(TTF_Font *font, const Uint16 *text, int *w, int *h) SDL_Surface * TTF_RenderText_Solid(TTF_Font *font, const char *text, SDL_Color fg) SDL_Surface * TTF_RenderUTF8_Solid(TTF_Font *font, const char *text, SDL_Color fg) SDL_Surface * TTF_RenderUNICODE_Solid(TTF_Font *font, const Uint16 *text, SDL_Color fg) SDL_Surface * TTF_RenderGlyph_Solid(TTF_Font *font, Uint16 ch, SDL_Color fg) SDL_Surface * TTF_RenderText_Shaded(TTF_Font *font, const char *text, SDL_Color fg, SDL_Color bg) SDL_Surface * TTF_RenderUTF8_Shaded(TTF_Font *font, const char *text, SDL_Color fg, SDL_Color bg) SDL_Surface * TTF_RenderUNICODE_Shaded(TTF_Font *font, const Uint16 *text, SDL_Color fg, SDL_Color bg) SDL_Surface * TTF_RenderGlyph_Shaded(TTF_Font *font, Uint16 ch, SDL_Color fg, SDL_Color bg) SDL_Surface * TTF_RenderText_Blended(TTF_Font *font, const char *text, SDL_Color fg) SDL_Surface * TTF_RenderUTF8_Blended(TTF_Font *font, const char *text, SDL_Color fg) SDL_Surface * TTF_RenderUNICODE_Blended(TTF_Font *font, const Uint16 *text, SDL_Color fg) SDL_Surface * TTF_RenderText_Blended_Wrapped(TTF_Font *font, const char *text, SDL_Color fg, Uint32 wrapLength) SDL_Surface * TTF_RenderUTF8_Blended_Wrapped(TTF_Font *font, const char *text, SDL_Color fg, Uint32 wrapLength) SDL_Surface * TTF_RenderUNICODE_Blended_Wrapped(TTF_Font *font, const Uint16 *text, SDL_Color fg, Uint32 wrapLength) SDL_Surface * TTF_RenderGlyph_Blended(TTF_Font *font, Uint16 ch, SDL_Color fg) void TTF_CloseFont(TTF_Font *font) void TTF_Quit() int TTF_WasInit() int TTF_GetFontKerningSize(TTF_Font *font, int prev_index, int index) ././@PaxHeader0000000000000000000000000000003100000000000010207 xustar0025 mtime=1753336711.1562 pygame_sdl2-2.1.0+renpy8.4.1/pygame_sdl2.egg-info/0000775000175000017500000000000015040345607017570 5ustar00tomtom././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1753336711.0 pygame_sdl2-2.1.0+renpy8.4.1/pygame_sdl2.egg-info/PKG-INFO0000644000175000017500000000034515040345607020665 0ustar00tomtomMetadata-Version: 2.1 Name: pygame_sdl2 Version: 2.1.0+renpy8.4.1 Home-page: https://github.com/renpy/pygame_sdl2 Maintainer: Tom Rothamel Maintainer-email: tom@rothamel.us License-File: COPYING.LGPL21 License-File: COPYING.ZLIB ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1753336711.0 pygame_sdl2-2.1.0+renpy8.4.1/pygame_sdl2.egg-info/SOURCES.txt0000664000175000017500000000633515040345607021463 0ustar00tomtomCOPYING.LGPL21 COPYING.ZLIB MANIFEST.in README.rst fix_virtualenv.py setup.py setuplib.py gen/pygame_sdl2.color.c gen/pygame_sdl2.controller.c gen/pygame_sdl2.display.c gen/pygame_sdl2.display_api.h gen/pygame_sdl2.draw.c gen/pygame_sdl2.error.c gen/pygame_sdl2.event.c gen/pygame_sdl2.event.h gen/pygame_sdl2.font.c gen/pygame_sdl2.gfxdraw.c gen/pygame_sdl2.image.c gen/pygame_sdl2.joystick.c gen/pygame_sdl2.key.c gen/pygame_sdl2.locals.c gen/pygame_sdl2.mixer.c gen/pygame_sdl2.mixer_music.c gen/pygame_sdl2.mouse.c gen/pygame_sdl2.power.c gen/pygame_sdl2.pygame_time.c gen/pygame_sdl2.rect.c gen/pygame_sdl2.render.c gen/pygame_sdl2.rwobject.c gen/pygame_sdl2.rwobject_api.h gen/pygame_sdl2.scrap.c gen/pygame_sdl2.surface.c gen/pygame_sdl2.surface_api.h gen/pygame_sdl2.transform.c gen3/pygame_sdl2.color.c gen3/pygame_sdl2.controller.c gen3/pygame_sdl2.display.c gen3/pygame_sdl2.display_api.h gen3/pygame_sdl2.draw.c gen3/pygame_sdl2.error.c gen3/pygame_sdl2.event.c gen3/pygame_sdl2.event.h gen3/pygame_sdl2.font.c gen3/pygame_sdl2.gfxdraw.c gen3/pygame_sdl2.image.c gen3/pygame_sdl2.joystick.c gen3/pygame_sdl2.key.c gen3/pygame_sdl2.locals.c gen3/pygame_sdl2.mixer.c gen3/pygame_sdl2.mixer_music.c gen3/pygame_sdl2.mouse.c gen3/pygame_sdl2.power.c gen3/pygame_sdl2.pygame_time.c gen3/pygame_sdl2.rect.c gen3/pygame_sdl2.render.c gen3/pygame_sdl2.rwobject.c gen3/pygame_sdl2.rwobject_api.h gen3/pygame_sdl2.scrap.c gen3/pygame_sdl2.surface.c gen3/pygame_sdl2.surface_api.h gen3/pygame_sdl2.transform.c include/color_dict.pxi include/controller.pxi include/event_enum.pxi include/event_list.pxi include/event_names.pxi include/glattr.pxi include/keycode_list.pxi include/sdl2.pxd include/sdl2_gfx.pxd include/sdl2_image.pxd include/sdl2_mixer.pxd include/sdl2_ttf.pxd pygame_sdl2.egg-info/PKG-INFO pygame_sdl2.egg-info/SOURCES.txt pygame_sdl2.egg-info/dependency_links.txt pygame_sdl2.egg-info/not-zip-safe pygame_sdl2.egg-info/top_level.txt src/SDL2_rotozoom.c src/SDL2_rotozoom.h src/SDL_gfxPrimitives.c src/SDL_gfxPrimitives.h src/SDL_gfxPrimitives_font.h src/alphablit.c src/python_threads.h src/sdl_image_compat.h src/surface.h src/write_jpeg.c src/write_jpeg.h src/write_png.c src/write_png.h src/pygame_sdl2/DejaVuSans.ttf src/pygame_sdl2/DejaVuSans.txt src/pygame_sdl2/__init__.py src/pygame_sdl2/color.pxd src/pygame_sdl2/color.pyx src/pygame_sdl2/compat.py src/pygame_sdl2/controller.pyx src/pygame_sdl2/display.pxd src/pygame_sdl2/display.pyx src/pygame_sdl2/draw.pyx src/pygame_sdl2/error.pyx src/pygame_sdl2/event.pyx src/pygame_sdl2/font.pyx src/pygame_sdl2/gfxdraw.pyx src/pygame_sdl2/image.pyx src/pygame_sdl2/joystick.pyx src/pygame_sdl2/key.pyx src/pygame_sdl2/locals.pyx src/pygame_sdl2/mixer.pyx src/pygame_sdl2/mixer_music.pyx src/pygame_sdl2/mouse.pyx src/pygame_sdl2/power.pyx src/pygame_sdl2/pygame_sdl2.h src/pygame_sdl2/pygame_time.pyx src/pygame_sdl2/rect.pxd src/pygame_sdl2/rect.pyx src/pygame_sdl2/render.pyx src/pygame_sdl2/rwobject.pxd src/pygame_sdl2/rwobject.pyx src/pygame_sdl2/scrap.pyx src/pygame_sdl2/sprite.py src/pygame_sdl2/surface.pxd src/pygame_sdl2/surface.pyx src/pygame_sdl2/sysfont.py src/pygame_sdl2/time.py src/pygame_sdl2/transform.pyx src/pygame_sdl2/version.py src/pygame_sdl2/threads/Py25Queue.py src/pygame_sdl2/threads/__init__.py././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1753336711.0 pygame_sdl2-2.1.0+renpy8.4.1/pygame_sdl2.egg-info/dependency_links.txt0000664000175000017500000000000115040345607023636 0ustar00tomtom ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1726116069.0 pygame_sdl2-2.1.0+renpy8.4.1/pygame_sdl2.egg-info/not-zip-safe0000664000175000017500000000000114670470345022024 0ustar00tomtom ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1753336711.0 pygame_sdl2-2.1.0+renpy8.4.1/pygame_sdl2.egg-info/top_level.txt0000664000175000017500000000001415040345607022315 0ustar00tomtompygame_sdl2 ././@PaxHeader0000000000000000000000000000003100000000000010207 xustar0025 mtime=1753336711.1562 pygame_sdl2-2.1.0+renpy8.4.1/setup.cfg0000664000175000017500000000006115040345607015506 0ustar00tomtom[egg_info] tag_build = +renpy8.4.1 tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1742275671.0 pygame_sdl2-2.1.0+renpy8.4.1/setup.py0000775000175000017500000001324114766202127015411 0ustar00tomtom#!/usr/bin/env python # Copyright 2024 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from __future__ import division, absolute_import, print_function # The version of pygame_sdl2. This should also be updated in version.py VERSION = "2.1.0" from setuplib import android, ios, windows, cython, pymodule, setup, parse_cflags, parse_libs, find_unnecessary_gen, gen import setuplib import os import platform import shutil import sys import sysconfig def setup_env(name): # If PYGAME_SDL2_CC or PYGAME_SDL2_LD are in the environment, and CC or LD are not, use them. renpy_name = "PYGAME_SDL2_" + name if (renpy_name in os.environ) and (name not in os.environ): os.environ[name] = os.environ[renpy_name] setup_env("CC") setup_env("LD") setup_env("CXX") temporary_package_data = [ ] if android or ios: sdl_libs = [ 'SDL2' ] else: setuplib.package_data.extend([ "DejaVuSans.ttf", "DejaVuSans.txt", ]) try: parse_cflags([ "sh", "-c", "sdl2-config --cflags" ]) sdl_libs = parse_libs([ "sh", "-c", "sdl2-config --libs" ]) except: if not windows: raise windeps = os.path.join(os.path.dirname(__file__), "pygame_sdl2_windeps") if not os.path.isdir(windeps): raise sdl_libs = [ 'SDL2' ] setuplib.include_dirs.append(os.path.join(windeps, "include")) if sys.version_info[0] < 3: setuplib.include_dirs.append(os.path.join(windeps, "include27")) if platform.architecture()[0] == "32bit": libdir = os.path.join(windeps, "lib/x86") else: libdir = os.path.join(windeps, "lib/x64") setuplib.library_dirs.append(libdir) for i in os.listdir(libdir): if i.lower().endswith(".dll"): shutil.copy( os.path.join(libdir, i), os.path.join(os.path.dirname(__file__), "src", "pygame_sdl2", i), ) temporary_package_data.append(i) setuplib.package_data.extend(temporary_package_data) if android: png = "png16" else: png = "png" pymodule("pygame_sdl2.__init__") pymodule("pygame_sdl2.compat") pymodule("pygame_sdl2.threads.__init__") pymodule("pygame_sdl2.threads.Py25Queue") pymodule("pygame_sdl2.sprite") pymodule("pygame_sdl2.sysfont") pymodule("pygame_sdl2.time") pymodule("pygame_sdl2.version") cython("pygame_sdl2.error", libs=sdl_libs) cython("pygame_sdl2.color", libs=sdl_libs) cython("pygame_sdl2.controller", libs=sdl_libs) cython("pygame_sdl2.rect", libs=sdl_libs) cython("pygame_sdl2.rwobject", libs=sdl_libs) cython("pygame_sdl2.surface", source=[ "src/alphablit.c" ], libs=sdl_libs) cython("pygame_sdl2.display", libs=sdl_libs) cython("pygame_sdl2.event", libs=sdl_libs) cython("pygame_sdl2.locals", libs=sdl_libs) cython("pygame_sdl2.key", libs=sdl_libs) cython("pygame_sdl2.mouse", libs=sdl_libs) cython("pygame_sdl2.joystick", libs=sdl_libs) cython("pygame_sdl2.power", libs=sdl_libs) cython("pygame_sdl2.pygame_time", libs=sdl_libs) cython("pygame_sdl2.image", source=[ "src/write_jpeg.c", "src/write_png.c" ], libs=[ 'SDL2_image', "jpeg", png ] + sdl_libs) cython("pygame_sdl2.transform", source=[ "src/SDL2_rotozoom.c" ], libs=sdl_libs) cython("pygame_sdl2.gfxdraw", source=[ "src/SDL_gfxPrimitives.c" ], libs=sdl_libs) cython("pygame_sdl2.draw", libs=sdl_libs) cython("pygame_sdl2.font", libs=['SDL2_ttf'] + sdl_libs) cython("pygame_sdl2.mixer", libs=['SDL2_mixer'] + sdl_libs) cython("pygame_sdl2.mixer_music", libs=['SDL2_mixer'] + sdl_libs) cython("pygame_sdl2.scrap", libs=sdl_libs) cython("pygame_sdl2.render", libs=['SDL2_image'] + sdl_libs) headers = [ "src/pygame_sdl2/pygame_sdl2.h", gen + "/pygame_sdl2.rwobject_api.h", gen + "/pygame_sdl2.surface_api.h", gen + "/pygame_sdl2.display_api.h", ] if __name__ == "__main__": if sys.version_info.major <= 3 and sys.version_info.minor <= 11: py_headers = headers headers = [ ] else: py_headers = [ ] setup( "pygame_sdl2", VERSION, headers=py_headers, url="https://github.com/renpy/pygame_sdl2", maintainer="Tom Rothamel", maintainer_email="tom@rothamel.us", ) find_unnecessary_gen() for i in temporary_package_data: os.unlink(os.path.join(os.path.dirname(__file__), "src", "pygame_sdl2", i)) if headers: import pathlib virtual_env = os.environ.get("VIRTUAL_ENV", None) if virtual_env: headers_dir = pathlib.Path(virtual_env) / "include" / "pygame_sdl2" else: headers_dir = pathlib.Path(sysconfig.get_paths()['include']) / "pygame_sdl2" headers_dir.mkdir(parents=True, exist_ok=True) for header in headers: srcpath = pathlib.Path(header) dstpath = headers_dir / srcpath.name shutil.copy(srcpath, dstpath) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740708990.0 pygame_sdl2-2.1.0+renpy8.4.1/setuplib.py0000664000175000017500000002333714760216176016107 0ustar00tomtom# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from __future__ import division, absolute_import, print_function import os import sys import re import subprocess import platform import warnings import setuptools warnings.simplefilter("ignore", category=setuptools.SetuptoolsDeprecationWarning) # The include and library dirs that we compile against. include_dirs = [ ".", "src" ] library_dirs = [ ] # Extra arguments that will be given to the compiler. extra_compile_args = [ ] extra_link_args = [ ] # Data files (including DLLs) to include with the package. package_data = [ ] # A list of extension objects that we use. extensions = [ ] # A list of macros that are defined for all modules. global_macros = [ ] # True if we're building on android. android = "PYGAME_SDL2_ANDROID" in os.environ # True if we're building on ios. ios = "PYGAME_SDL2_IOS" in os.environ # True if we're doing a static build. static = "PYGAME_SDL2_STATIC" in os.environ windows = platform.win32_ver()[0] # The cython command. if windows: cython_command = os.path.join(os.path.dirname(sys.executable), "Scripts", "cython.exe") else: cython_command = "cython" if sys.version_info[0] >= 3: gen = "gen3" else: gen = "gen" version_flag = "--3str" if static: gen = gen + "-static" def system_path(path): """ On windows/msys, converts a unix-style path returned from sdl2-config to a windows path. Otherwise, returns path. """ if "MSYSTEM" in os.environ: path = subprocess.check_output([ "sh", "-c", "cmd //c echo " + path ]).strip() return path def parse_cflags(command): """ Runs `command`, and uses the command's output to set up include_dirs and extra_compile_args. if `command` is None, parses the cflags from the environment. """ if "PYGAME_SDL2_CFLAGS" in os.environ: output = os.environ["PYGAME_SDL2_CFLAGS"] elif command is not None: output = subprocess.check_output(command, universal_newlines=True) else: output = os.environ.get("CFLAGS", "") for i in output.split(): if i.startswith("-I"): include_dirs.append(system_path(i[2:])) else: extra_compile_args.append(i) parse_cflags(None) def parse_libs(command): """ Runs `command`, and uses the command's output to set up library_dirs and extra_link_args. Returns a list of libraries to link against. If `command` is None, parses LDFLAGS from the environment. """ if "PYGAME_SDL2_LDFLAGS" in os.environ: output = os.environ["PYGAME_SDL2_LDFLAGS"] else: output = subprocess.check_output(command, universal_newlines=True) libs = [ ] for i in output.split(): if i.startswith("-L"): library_dirs.append(system_path(i[2:])) elif i.startswith("-l"): libs.append(i[2:]) else: extra_compile_args.append(i) return libs # A list of modules we do not wish to include. exclude = set(os.environ.get("PYGAME_SDL2_EXCLUDE", "").split()) def cmodule(name, source, libs=[], define_macros=[]): """ Compiles the python module `name` from the files given in `source`, and the libraries in `libs`. """ if name in exclude: return extensions.append(setuptools.Extension( name, source, include_dirs=include_dirs, library_dirs=library_dirs, extra_compile_args=extra_compile_args, extra_link_args=extra_link_args, libraries=libs, define_macros=define_macros + global_macros, )) necessary_gen = [ ] def cython(name, source=[], libs=[], compile_if=True, define_macros=[]): """ Compiles a cython module. This takes care of regenerating it as necessary when it, or any of the files it depends on, changes. """ # Find the pyx file. split_name = name.split(".") fn = "src/" + "/".join(split_name) + ".pyx" if not os.path.exists(fn): print("Could not find {0}.".format(fn)) sys.exit(-1) module_dir = os.path.dirname(fn) # Figure out what it depends on. deps = [ fn ] f = open(fn, "r") for l in f: m = re.search(r'from\s*([\w.]+)\s*cimport', l) if m: deps.append(m.group(1).replace(".", "/") + ".pxd") continue m = re.search(r'cimport\s*([\w.]+)', l) if m: deps.append(m.group(1).replace(".", "/") + ".pxd") continue m = re.search(r'include\s*"(.*?)"', l) if m: deps.append(m.group(1)) continue f.close() # Filter out cython stdlib dependencies. deps = [ i for i in deps if (not i.startswith("cpython/")) and (not i.startswith("libc/")) ] # Determine if any of the dependencies are newer than the c file. c_fn = os.path.join(gen, name + ".c") necessary_gen.append(name + ".c") if os.path.exists(c_fn): c_mtime = os.path.getmtime(c_fn) else: c_mtime = 0 out_of_date = False # print c_fn, "depends on", deps for dep_fn in deps: if os.path.exists(os.path.join("src", dep_fn)): dep_fn = os.path.join("src", dep_fn) elif os.path.exists(os.path.join("include", dep_fn)): dep_fn = os.path.join("include", dep_fn) elif os.path.exists(os.path.join(gen, dep_fn)): dep_fn = os.path.join(gen, dep_fn) elif os.path.exists(dep_fn): pass else: print("{0} depends on {1}, which can't be found.".format(fn, dep_fn)) sys.exit(-1) if os.path.getmtime(dep_fn) > c_mtime: out_of_date = True if out_of_date and not cython_command: print("WARNING:", name, "is out of date, but RENPY_CYTHON isn't set.") out_of_date = False # If the file is out of date, regenerate it. if out_of_date: print(name, "is out of date.") try: subprocess.check_call([ cython_command, version_flag, "-X", "profile=False", "-X", "embedsignature=True", "-Iinclude", "-I" + gen, "-a", fn, "-o", c_fn]) # Fix-up source for static loading if static: parent_module = '.'.join(split_name[:-1]) parent_module_identifier = parent_module.replace('.', '_') with open(c_fn, 'r') as f: ccode = f.read() with open(c_fn + ".dynamic", 'w') as f: f.write(ccode) if len(split_name) > 1: ccode = re.sub(r'Py_InitModule4\("([^"]+)"', 'Py_InitModule4("' + parent_module + '.\\1"', ccode) # Py2 ccode = re.sub(r'(__pyx_moduledef.*?"){}"'.format(re.escape(split_name[-1])), '\\1' + '.'.join(split_name) + '"', ccode, count=1, flags=re.DOTALL) # Py3 ccode = re.sub(r'^__Pyx_PyMODINIT_FUNC init', '__Pyx_PyMODINIT_FUNC init' + parent_module_identifier + '_', ccode, 0, re.MULTILINE) # Py2 Cython 0.28+ ccode = re.sub(r'^__Pyx_PyMODINIT_FUNC PyInit_', '__Pyx_PyMODINIT_FUNC PyInit_' + parent_module_identifier + '_', ccode, 0, re.MULTILINE) # Py3 Cython 0.28+ ccode = re.sub(r'^PyMODINIT_FUNC init', 'PyMODINIT_FUNC init' + parent_module_identifier + '_', ccode, 0, re.MULTILINE) # Py2 Cython 0.25.2 with open(c_fn, 'w') as f: f.write(ccode) except subprocess.CalledProcessError as e: print() print(str(e)) print() sys.exit(-1) # Build the module normally once we have the c file. if compile_if: cmodule(name, [ c_fn ] + source, libs=libs, define_macros=define_macros) def find_unnecessary_gen(): for i in os.listdir(gen): if not i.endswith(".c"): continue if i in necessary_gen: continue print("Unnecessary file", os.path.join(gen, i)) py_modules = [ ] def pymodule(name): """ Causes a python module to be included in the build. """ if name in exclude: return py_modules.append(name) def setup(name, version, **kwargs): """ Calls the distutils setup function. """ global extensions if (len(sys.argv) >= 2) and (sys.argv[1] == "generate"): return if "--no-extensions" in sys.argv: sys.argv = [ i for i in sys.argv if i != "--no-extensions" ] extensions = [ ] setuptools.setup( name=name, version=version, ext_modules=extensions, py_modules=py_modules, packages=[ name ], package_dir={ name : 'src/' + name }, package_data={ name : package_data }, zip_safe=False, **kwargs ) # Start in the directory containing setup.py. os.chdir(os.path.abspath(os.path.dirname(sys.argv[0]))) # Ensure the gen directory exists. if not os.path.exists(gen): os.mkdir(gen) ././@PaxHeader0000000000000000000000000000003100000000000010207 xustar0025 mtime=1753336711.1522 pygame_sdl2-2.1.0+renpy8.4.1/src/0000775000175000017500000000000015040345607014457 5ustar00tomtom././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1522802270.0 pygame_sdl2-2.1.0+renpy8.4.1/src/SDL2_rotozoom.c0000644000175000017500000011724513261017136017303 0ustar00tomtom/* SDL2_rotozoom.c: rotozoomer, zoomer and shrinker for 32bit or 8bit surfaces Copyright (C) 2012 Andreas Schiffler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Andreas Schiffler -- aschiffler at ferzkopp dot net */ #ifdef WIN32 #include #endif #include #include #include "SDL2_rotozoom.h" /* ---- Internally used structures */ /*! \brief A 32 bit RGBA pixel. */ typedef struct tColorRGBA { Uint8 r; Uint8 g; Uint8 b; Uint8 a; } tColorRGBA; /*! \brief A 8bit Y/palette pixel. */ typedef struct tColorY { Uint8 y; } tColorY; /*! \brief Returns maximum of two numbers a and b. */ #define MAX(a,b) (((a) > (b)) ? (a) : (b)) /*! \brief Number of guard rows added to destination surfaces. This is a simple but effective workaround for observed issues. These rows allocate extra memory and are then hidden from the surface. Rows are added to the end of destination surfaces when they are allocated. This catches any potential overflows which seem to happen with just the right src image dimensions and scale/rotation and can lead to a situation where the program can segfault. */ #define GUARD_ROWS (2) /*! \brief Lower limit of absolute zoom factor or rotation degrees. */ #define VALUE_LIMIT 0.001 /*! \brief Returns colorkey info for a surface */ Uint32 _colorkey(SDL_Surface *src) { Uint32 key = 0; SDL_GetColorKey(src, &key); return key; } /*! \brief Internal 32 bit integer-factor averaging Shrinker. Shrinks 32 bit RGBA/ABGR 'src' surface to 'dst' surface. Averages color and alpha values values of src pixels to calculate dst pixels. Assumes src and dst surfaces are of 32 bit depth. Assumes dst surface was allocated with the correct dimensions. \param src The surface to shrink (input). \param dst The shrunken surface (output). \param factorx The horizontal shrinking ratio. \param factory The vertical shrinking ratio. \return 0 for success or -1 for error. */ int _shrinkSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int factorx, int factory) { int x, y, dx, dy, dgap, ra, ga, ba, aa; int n_average; tColorRGBA *sp, *osp, *oosp; tColorRGBA *dp; /* * Averaging integer shrink */ /* Precalculate division factor */ n_average = factorx*factory; /* * Scan destination */ sp = (tColorRGBA *) src->pixels; dp = (tColorRGBA *) dst->pixels; dgap = dst->pitch - dst->w * 4; for (y = 0; y < dst->h; y++) { osp=sp; for (x = 0; x < dst->w; x++) { /* Trace out source box and accumulate */ oosp=sp; ra=ga=ba=aa=0; for (dy=0; dy < factory; dy++) { for (dx=0; dx < factorx; dx++) { ra += sp->r; ga += sp->g; ba += sp->b; aa += sp->a; sp++; } /* src dx loop */ sp = (tColorRGBA *)((Uint8*)sp + (src->pitch - 4*factorx)); // next y } /* src dy loop */ /* next box-x */ sp = (tColorRGBA *)((Uint8*)oosp + 4*factorx); /* Store result in destination */ dp->r = ra/n_average; dp->g = ga/n_average; dp->b = ba/n_average; dp->a = aa/n_average; /* * Advance destination pointer */ dp++; } /* dst x loop */ /* next box-y */ sp = (tColorRGBA *)((Uint8*)osp + src->pitch*factory); /* * Advance destination pointers */ dp = (tColorRGBA *) ((Uint8 *) dp + dgap); } /* dst y loop */ return (0); } /*! \brief Internal 8 bit integer-factor averaging shrinker. Shrinks 8bit Y 'src' surface to 'dst' surface. Averages color (brightness) values values of src pixels to calculate dst pixels. Assumes src and dst surfaces are of 8 bit depth. Assumes dst surface was allocated with the correct dimensions. \param src The surface to shrink (input). \param dst The shrunken surface (output). \param factorx The horizontal shrinking ratio. \param factory The vertical shrinking ratio. \return 0 for success or -1 for error. */ int _shrinkSurfaceY(SDL_Surface * src, SDL_Surface * dst, int factorx, int factory) { int x, y, dx, dy, dgap, a; int n_average; Uint8 *sp, *osp, *oosp; Uint8 *dp; /* * Averaging integer shrink */ /* Precalculate division factor */ n_average = factorx*factory; /* * Scan destination */ sp = (Uint8 *) src->pixels; dp = (Uint8 *) dst->pixels; dgap = dst->pitch - dst->w; for (y = 0; y < dst->h; y++) { osp=sp; for (x = 0; x < dst->w; x++) { /* Trace out source box and accumulate */ oosp=sp; a=0; for (dy=0; dy < factory; dy++) { for (dx=0; dx < factorx; dx++) { a += (*sp); /* next x */ sp++; } /* end src dx loop */ /* next y */ sp = (Uint8 *)((Uint8*)sp + (src->pitch - factorx)); } /* end src dy loop */ /* next box-x */ sp = (Uint8 *)((Uint8*)oosp + factorx); /* Store result in destination */ *dp = a/n_average; /* * Advance destination pointer */ dp++; } /* end dst x loop */ /* next box-y */ sp = (Uint8 *)((Uint8*)osp + src->pitch*factory); /* * Advance destination pointers */ dp = (Uint8 *)((Uint8 *)dp + dgap); } /* end dst y loop */ return (0); } /*! \brief Internal 32 bit Zoomer with optional anti-aliasing by bilinear interpolation. Zooms 32 bit RGBA/ABGR 'src' surface to 'dst' surface. Assumes src and dst surfaces are of 32 bit depth. Assumes dst surface was allocated with the correct dimensions. \param src The surface to zoom (input). \param dst The zoomed surface (output). \param flipx Flag indicating if the image should be horizontally flipped. \param flipy Flag indicating if the image should be vertically flipped. \param smooth Antialiasing flag; set to SMOOTHING_ON to enable. \return 0 for success or -1 for error. */ int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int flipy, int smooth) { int x, y, sx, sy, ssx, ssy, *sax, *say, *csax, *csay, *salast, csx, csy, ex, ey, cx, cy, sstep, sstepx, sstepy; tColorRGBA *c00, *c01, *c10, *c11; tColorRGBA *sp, *csp, *dp; int spixelgap, spixelw, spixelh, dgap, t1, t2; /* * Allocate memory for row/column increments */ if ((sax = (int *) malloc((dst->w + 1) * sizeof(Uint32))) == NULL) { return (-1); } if ((say = (int *) malloc((dst->h + 1) * sizeof(Uint32))) == NULL) { free(sax); return (-1); } /* * Precalculate row increments */ spixelw = (src->w - 1); spixelh = (src->h - 1); if (smooth) { sx = (int) (65536.0 * (float) spixelw / (float) (dst->w - 1)); sy = (int) (65536.0 * (float) spixelh / (float) (dst->h - 1)); } else { sx = (int) (65536.0 * (float) (src->w) / (float) (dst->w)); sy = (int) (65536.0 * (float) (src->h) / (float) (dst->h)); } /* Maximum scaled source size */ ssx = (src->w << 16) - 1; ssy = (src->h << 16) - 1; /* Precalculate horizontal row increments */ csx = 0; csax = sax; for (x = 0; x <= dst->w; x++) { *csax = csx; csax++; csx += sx; /* Guard from overflows */ if (csx > ssx) { csx = ssx; } } /* Precalculate vertical row increments */ csy = 0; csay = say; for (y = 0; y <= dst->h; y++) { *csay = csy; csay++; csy += sy; /* Guard from overflows */ if (csy > ssy) { csy = ssy; } } sp = (tColorRGBA *) src->pixels; dp = (tColorRGBA *) dst->pixels; dgap = dst->pitch - dst->w * 4; spixelgap = src->pitch/4; if (flipx) sp += spixelw; if (flipy) sp += (spixelgap * spixelh); /* * Switch between interpolating and non-interpolating code */ if (smooth) { /* * Interpolating Zoom */ csay = say; for (y = 0; y < dst->h; y++) { csp = sp; csax = sax; for (x = 0; x < dst->w; x++) { /* * Setup color source pointers */ ex = (*csax & 0xffff); ey = (*csay & 0xffff); cx = (*csax >> 16); cy = (*csay >> 16); sstepx = cx < spixelw; sstepy = cy < spixelh; c00 = sp; c01 = sp; c10 = sp; if (sstepy) { if (flipy) { c10 -= spixelgap; } else { c10 += spixelgap; } } c11 = c10; if (sstepx) { if (flipx) { c01--; c11--; } else { c01++; c11++; } } /* * Draw and interpolate colors */ t1 = ((((c01->r - c00->r) * ex) >> 16) + c00->r) & 0xff; t2 = ((((c11->r - c10->r) * ex) >> 16) + c10->r) & 0xff; dp->r = (((t2 - t1) * ey) >> 16) + t1; t1 = ((((c01->g - c00->g) * ex) >> 16) + c00->g) & 0xff; t2 = ((((c11->g - c10->g) * ex) >> 16) + c10->g) & 0xff; dp->g = (((t2 - t1) * ey) >> 16) + t1; t1 = ((((c01->b - c00->b) * ex) >> 16) + c00->b) & 0xff; t2 = ((((c11->b - c10->b) * ex) >> 16) + c10->b) & 0xff; dp->b = (((t2 - t1) * ey) >> 16) + t1; t1 = ((((c01->a - c00->a) * ex) >> 16) + c00->a) & 0xff; t2 = ((((c11->a - c10->a) * ex) >> 16) + c10->a) & 0xff; dp->a = (((t2 - t1) * ey) >> 16) + t1; /* * Advance source pointer x */ salast = csax; csax++; sstep = (*csax >> 16) - (*salast >> 16); if (flipx) { sp -= sstep; } else { sp += sstep; } /* * Advance destination pointer x */ dp++; } /* * Advance source pointer y */ salast = csay; csay++; sstep = (*csay >> 16) - (*salast >> 16); sstep *= spixelgap; if (flipy) { sp = csp - sstep; } else { sp = csp + sstep; } /* * Advance destination pointer y */ dp = (tColorRGBA *) ((Uint8 *) dp + dgap); } } else { /* * Non-Interpolating Zoom */ csay = say; for (y = 0; y < dst->h; y++) { csp = sp; csax = sax; for (x = 0; x < dst->w; x++) { /* * Draw */ *dp = *sp; /* * Advance source pointer x */ salast = csax; csax++; sstep = (*csax >> 16) - (*salast >> 16); if (flipx) sstep = -sstep; sp += sstep; /* * Advance destination pointer x */ dp++; } /* * Advance source pointer y */ salast = csay; csay++; sstep = (*csay >> 16) - (*salast >> 16); sstep *= spixelgap; if (flipy) sstep = -sstep; sp = csp + sstep; /* * Advance destination pointer y */ dp = (tColorRGBA *) ((Uint8 *) dp + dgap); } } /* * Remove temp arrays */ free(sax); free(say); return (0); } /*! \brief Internal 8 bit Zoomer without smoothing. Zooms 8bit palette/Y 'src' surface to 'dst' surface. Assumes src and dst surfaces are of 8 bit depth. Assumes dst surface was allocated with the correct dimensions. \param src The surface to zoom (input). \param dst The zoomed surface (output). \param flipx Flag indicating if the image should be horizontally flipped. \param flipy Flag indicating if the image should be vertically flipped. \return 0 for success or -1 for error. */ int _zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst, int flipx, int flipy) { int x, y; Uint32 *sax, *say, *csax, *csay; int csx, csy; Uint8 *sp, *dp, *csp; int dgap; /* * Allocate memory for row increments */ if ((sax = (Uint32 *) malloc((dst->w + 1) * sizeof(Uint32))) == NULL) { return (-1); } if ((say = (Uint32 *) malloc((dst->h + 1) * sizeof(Uint32))) == NULL) { free(sax); return (-1); } /* * Pointer setup */ sp = csp = (Uint8 *) src->pixels; dp = (Uint8 *) dst->pixels; dgap = dst->pitch - dst->w; if (flipx) csp += (src->w-1); if (flipy) csp = ( (Uint8*)csp + src->pitch*(src->h-1) ); /* * Precalculate row increments */ csx = 0; csax = sax; for (x = 0; x < dst->w; x++) { csx += src->w; *csax = 0; while (csx >= dst->w) { csx -= dst->w; (*csax)++; } (*csax) = (*csax) * (flipx ? -1 : 1); csax++; } csy = 0; csay = say; for (y = 0; y < dst->h; y++) { csy += src->h; *csay = 0; while (csy >= dst->h) { csy -= dst->h; (*csay)++; } (*csay) = (*csay) * (flipy ? -1 : 1); csay++; } /* * Draw */ csay = say; for (y = 0; y < dst->h; y++) { csax = sax; sp = csp; for (x = 0; x < dst->w; x++) { /* * Draw */ *dp = *sp; /* * Advance source pointers */ sp += (*csax); csax++; /* * Advance destination pointer */ dp++; } /* * Advance source pointer (for row) */ csp += ((*csay) * src->pitch); csay++; /* * Advance destination pointers */ dp += dgap; } /* * Remove temp arrays */ free(sax); free(say); return (0); } /*! \brief Internal 32 bit rotozoomer with optional anti-aliasing. Rotates and zooms 32 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control parameters by scanning the destination surface and applying optionally anti-aliasing by bilinear interpolation. Assumes src and dst surfaces are of 32 bit depth. Assumes dst surface was allocated with the correct dimensions. \param src Source surface. \param dst Destination surface. \param cx Horizontal center coordinate. \param cy Vertical center coordinate. \param isin Integer version of sine of angle. \param icos Integer version of cosine of angle. \param flipx Flag indicating horizontal mirroring should be applied. \param flipy Flag indicating vertical mirroring should be applied. \param smooth Flag indicating anti-aliasing should be used. */ void _transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int flipx, int flipy, int smooth) { int x, y, t1, t2, dx, dy, xd, yd, sdx, sdy, ax, ay, ex, ey, sw, sh; tColorRGBA c00, c01, c10, c11, cswap; tColorRGBA *pc, *sp; int gap; /* * Variable setup */ xd = ((src->w - dst->w) << 15); yd = ((src->h - dst->h) << 15); ax = (cx << 16) - (icos * cx); ay = (cy << 16) - (isin * cx); sw = src->w - 1; sh = src->h - 1; pc = (tColorRGBA*) dst->pixels; gap = dst->pitch - dst->w * 4; /* * Switch between interpolating and non-interpolating code */ if (smooth) { for (y = 0; y < dst->h; y++) { dy = cy - y; sdx = (ax + (isin * dy)) + xd; sdy = (ay - (icos * dy)) + yd; for (x = 0; x < dst->w; x++) { dx = (sdx >> 16); dy = (sdy >> 16); if (flipx) dx = sw - dx; if (flipy) dy = sh - dy; if ((dx > -1) && (dy > -1) && (dx < (src->w-1)) && (dy < (src->h-1))) { sp = (tColorRGBA *)src->pixels;; sp += ((src->pitch/4) * dy); sp += dx; c00 = *sp; sp += 1; c01 = *sp; sp += (src->pitch/4); c11 = *sp; sp -= 1; c10 = *sp; if (flipx) { cswap = c00; c00=c01; c01=cswap; cswap = c10; c10=c11; c11=cswap; } if (flipy) { cswap = c00; c00=c10; c10=cswap; cswap = c01; c01=c11; c11=cswap; } /* * Interpolate colors */ ex = (sdx & 0xffff); ey = (sdy & 0xffff); t1 = ((((c01.r - c00.r) * ex) >> 16) + c00.r) & 0xff; t2 = ((((c11.r - c10.r) * ex) >> 16) + c10.r) & 0xff; pc->r = (((t2 - t1) * ey) >> 16) + t1; t1 = ((((c01.g - c00.g) * ex) >> 16) + c00.g) & 0xff; t2 = ((((c11.g - c10.g) * ex) >> 16) + c10.g) & 0xff; pc->g = (((t2 - t1) * ey) >> 16) + t1; t1 = ((((c01.b - c00.b) * ex) >> 16) + c00.b) & 0xff; t2 = ((((c11.b - c10.b) * ex) >> 16) + c10.b) & 0xff; pc->b = (((t2 - t1) * ey) >> 16) + t1; t1 = ((((c01.a - c00.a) * ex) >> 16) + c00.a) & 0xff; t2 = ((((c11.a - c10.a) * ex) >> 16) + c10.a) & 0xff; pc->a = (((t2 - t1) * ey) >> 16) + t1; } sdx += icos; sdy += isin; pc++; } pc = (tColorRGBA *) ((Uint8 *) pc + gap); } } else { for (y = 0; y < dst->h; y++) { dy = cy - y; sdx = (ax + (isin * dy)) + xd; sdy = (ay - (icos * dy)) + yd; for (x = 0; x < dst->w; x++) { dx = (short) (sdx >> 16); dy = (short) (sdy >> 16); if (flipx) dx = (src->w-1)-dx; if (flipy) dy = (src->h-1)-dy; if ((dx >= 0) && (dy >= 0) && (dx < src->w) && (dy < src->h)) { sp = (tColorRGBA *) ((Uint8 *) src->pixels + src->pitch * dy); sp += dx; *pc = *sp; } sdx += icos; sdy += isin; pc++; } pc = (tColorRGBA *) ((Uint8 *) pc + gap); } } } /*! \brief Rotates and zooms 8 bit palette/Y 'src' surface to 'dst' surface without smoothing. Rotates and zooms 8 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control parameters by scanning the destination surface. Assumes src and dst surfaces are of 8 bit depth. Assumes dst surface was allocated with the correct dimensions. \param src Source surface. \param dst Destination surface. \param cx Horizontal center coordinate. \param cy Vertical center coordinate. \param isin Integer version of sine of angle. \param icos Integer version of cosine of angle. \param flipx Flag indicating horizontal mirroring should be applied. \param flipy Flag indicating vertical mirroring should be applied. */ void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int flipx, int flipy) { int x, y, dx, dy, xd, yd, sdx, sdy, ax, ay; tColorY *pc, *sp; int gap; /* * Variable setup */ xd = ((src->w - dst->w) << 15); yd = ((src->h - dst->h) << 15); ax = (cx << 16) - (icos * cx); ay = (cy << 16) - (isin * cx); pc = (tColorY*) dst->pixels; gap = dst->pitch - dst->w; /* * Clear surface to colorkey */ memset(pc, (int)(_colorkey(src) & 0xff), dst->pitch * dst->h); /* * Iterate through destination surface */ for (y = 0; y < dst->h; y++) { dy = cy - y; sdx = (ax + (isin * dy)) + xd; sdy = (ay - (icos * dy)) + yd; for (x = 0; x < dst->w; x++) { dx = (short) (sdx >> 16); dy = (short) (sdy >> 16); if (flipx) dx = (src->w-1)-dx; if (flipy) dy = (src->h-1)-dy; if ((dx >= 0) && (dy >= 0) && (dx < src->w) && (dy < src->h)) { sp = (tColorY *) (src->pixels); sp += (src->pitch * dy + dx); *pc = *sp; } sdx += icos; sdy += isin; pc++; } pc += gap; } } /*! \brief Rotates a 8/16/24/32 bit surface in increments of 90 degrees. Specialized 90 degree rotator which rotates a 'src' surface in 90 degree increments clockwise returning a new surface. Faster than rotozoomer since no scanning or interpolation takes place. Input surface must be 8/16/24/32 bit. (code contributed by J. Schiller, improved by C. Allport and A. Schiffler) \param src Source surface to rotate. \param numClockwiseTurns Number of clockwise 90 degree turns to apply to the source. \returns The new, rotated surface; or NULL for surfaces with incorrect input format. */ SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns) { int row, col, newWidth, newHeight; int bpp, bpr; SDL_Surface* dst; Uint8* srcBuf; Uint8* dstBuf; int normalizedClockwiseTurns; /* Has to be a valid surface pointer and be a Nbit surface where n is divisible by 8 */ if (!src || !src->format) { SDL_SetError("NULL source surface or source surface format"); return NULL; } if ((src->format->BitsPerPixel % 8) != 0) { SDL_SetError("Invalid source surface bit depth"); return NULL; } /* normalize numClockwiseTurns */ normalizedClockwiseTurns = (numClockwiseTurns % 4); if (normalizedClockwiseTurns < 0) { normalizedClockwiseTurns += 4; } /* If turns are even, our new width/height will be the same as the source surface */ if (normalizedClockwiseTurns % 2) { newWidth = src->h; newHeight = src->w; } else { newWidth = src->w; newHeight = src->h; } dst = SDL_CreateRGBSurface( src->flags, newWidth, newHeight, src->format->BitsPerPixel, src->format->Rmask, src->format->Gmask, src->format->Bmask, src->format->Amask); if(!dst) { SDL_SetError("Could not create destination surface"); return NULL; } if (SDL_MUSTLOCK(src)) { SDL_LockSurface(src); } if (SDL_MUSTLOCK(dst)) { SDL_LockSurface(dst); } /* Calculate byte-per-pixel */ bpp = src->format->BitsPerPixel / 8; switch(normalizedClockwiseTurns) { case 0: /* Make a copy of the surface */ { /* Unfortunately SDL_BlitSurface cannot be used to make a copy of the surface since it does not preserve alpha. */ if (src->pitch == dst->pitch) { /* If the pitch is the same for both surfaces, the memory can be copied all at once. */ memcpy(dst->pixels, src->pixels, (src->h * src->pitch)); } else { /* If the pitch differs, copy each row separately */ srcBuf = (Uint8*)(src->pixels); dstBuf = (Uint8*)(dst->pixels); bpr = src->w * bpp; for (row = 0; row < src->h; row++) { memcpy(dstBuf, srcBuf, bpr); srcBuf += src->pitch; dstBuf += dst->pitch; } } } break; /* rotate clockwise */ case 1: /* rotated 90 degrees clockwise */ { for (row = 0; row < src->h; ++row) { srcBuf = (Uint8*)(src->pixels) + (row * src->pitch); dstBuf = (Uint8*)(dst->pixels) + (dst->w - row - 1) * bpp; for (col = 0; col < src->w; ++col) { memcpy (dstBuf, srcBuf, bpp); srcBuf += bpp; dstBuf += dst->pitch; } } } break; case 2: /* rotated 180 degrees clockwise */ { for (row = 0; row < src->h; ++row) { srcBuf = (Uint8*)(src->pixels) + (row * src->pitch); dstBuf = (Uint8*)(dst->pixels) + ((dst->h - row - 1) * dst->pitch) + (dst->w - 1) * bpp; for (col = 0; col < src->w; ++col) { memcpy (dstBuf, srcBuf, bpp); srcBuf += bpp; dstBuf -= bpp; } } } break; case 3: /* rotated 270 degrees clockwise */ { for (row = 0; row < src->h; ++row) { srcBuf = (Uint8*)(src->pixels) + (row * src->pitch); dstBuf = (Uint8*)(dst->pixels) + (row * bpp) + (dst->h * dst->pitch); for (col = 0; col < src->w; ++col) { memcpy (dstBuf, srcBuf, bpp); srcBuf += bpp; dstBuf -= dst->pitch; } } } break; } /* end switch */ if (SDL_MUSTLOCK(src)) { SDL_UnlockSurface(src); } if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return dst; } /*! \brief Internal target surface sizing function for rotozooms with trig result return. \param width The source surface width. \param height The source surface height. \param angle The angle to rotate in degrees. \param zoomx The horizontal scaling factor. \param zoomy The vertical scaling factor. \param dstwidth The calculated width of the destination surface. \param dstheight The calculated height of the destination surface. \param canglezoom The sine of the angle adjusted by the zoom factor. \param sanglezoom The cosine of the angle adjusted by the zoom factor. */ void _rotozoomSurfaceSizeTrig(int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight, double *canglezoom, double *sanglezoom) { double x, y, cx, cy, sx, sy; double radangle; int dstwidthhalf, dstheighthalf; /* * Determine destination width and height by rotating a centered source box */ radangle = angle * (M_PI / 180.0); *sanglezoom = sin(radangle); *canglezoom = cos(radangle); *sanglezoom *= zoomx; *canglezoom *= zoomx; x = (double)(width / 2); y = (double)(height / 2); cx = *canglezoom * x; cy = *canglezoom * y; sx = *sanglezoom * x; sy = *sanglezoom * y; dstwidthhalf = MAX((int) ceil(MAX(MAX(MAX(fabs(cx + sy), fabs(cx - sy)), fabs(-cx + sy)), fabs(-cx - sy))), 1); dstheighthalf = MAX((int) ceil(MAX(MAX(MAX(fabs(sx + cy), fabs(sx - cy)), fabs(-sx + cy)), fabs(-sx - cy))), 1); *dstwidth = 2 * dstwidthhalf; *dstheight = 2 * dstheighthalf; } /*! \brief Returns the size of the resulting target surface for a rotozoomSurfaceXY() call. \param width The source surface width. \param height The source surface height. \param angle The angle to rotate in degrees. \param zoomx The horizontal scaling factor. \param zoomy The vertical scaling factor. \param dstwidth The calculated width of the rotozoomed destination surface. \param dstheight The calculated height of the rotozoomed destination surface. */ void rotozoomSurfaceSizeXY(int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight) { double dummy_sanglezoom, dummy_canglezoom; _rotozoomSurfaceSizeTrig(width, height, angle, zoomx, zoomy, dstwidth, dstheight, &dummy_sanglezoom, &dummy_canglezoom); } /*! \brief Returns the size of the resulting target surface for a rotozoomSurface() call. \param width The source surface width. \param height The source surface height. \param angle The angle to rotate in degrees. \param zoom The scaling factor. \param dstwidth The calculated width of the rotozoomed destination surface. \param dstheight The calculated height of the rotozoomed destination surface. */ void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight) { double dummy_sanglezoom, dummy_canglezoom; _rotozoomSurfaceSizeTrig(width, height, angle, zoom, zoom, dstwidth, dstheight, &dummy_sanglezoom, &dummy_canglezoom); } /*! \brief Rotates and zooms a surface and optional anti-aliasing. Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'angle' is the rotation in degrees and 'zoom' a scaling factor. If 'smooth' is set then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. \param src The surface to rotozoom. \param angle The angle to rotate in degrees. \param zoom The scaling factor. \param smooth Antialiasing flag; set to SMOOTHING_ON to enable. \return The new rotozoomed surface. */ SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int smooth) { return rotozoomSurfaceXY(src, angle, zoom, zoom, smooth); } /*! \brief Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing. Rotates and zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'angle' is the rotation in degrees, 'zoomx and 'zoomy' scaling factors. If 'smooth' is set then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. \param src The surface to rotozoom. \param angle The angle to rotate in degrees. \param zoomx The horizontal scaling factor. \param zoomy The vertical scaling factor. \param smooth Antialiasing flag; set to SMOOTHING_ON to enable. \return The new rotozoomed surface. */ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, double zoomy, int smooth) { SDL_Surface *rz_src; SDL_Surface *rz_dst; double zoominv; double sanglezoom, canglezoom, sanglezoominv, canglezoominv; int dstwidthhalf, dstwidth, dstheighthalf, dstheight; int is32bit; int i, src_converted; int flipx,flipy; /* * Sanity check */ if (src == NULL) { return (NULL); } /* * Determine if source surface is 32bit or 8bit */ is32bit = (src->format->BitsPerPixel == 32); if ((is32bit) || (src->format->BitsPerPixel == 8)) { /* * Use source surface 'as is' */ rz_src = src; src_converted = 0; } else { /* * New source surface is 32bit with a defined RGBA ordering */ rz_src = SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32, #if SDL_BYTEORDER == SDL_LIL_ENDIAN 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 #else 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff #endif ); SDL_BlitSurface(src, NULL, rz_src, NULL); src_converted = 1; is32bit = 1; } /* * Sanity check zoom factor */ flipx = (zoomx<0.0); if (flipx) zoomx=-zoomx; flipy = (zoomy<0.0); if (flipy) zoomy=-zoomy; if (zoomx < VALUE_LIMIT) zoomx = VALUE_LIMIT; if (zoomy < VALUE_LIMIT) zoomy = VALUE_LIMIT; zoominv = 65536.0 / (zoomx * zoomx); /* * Check if we have a rotozoom or just a zoom */ if (fabs(angle) > VALUE_LIMIT) { /* * Angle!=0: full rotozoom */ /* * ----------------------- */ /* Determine target size */ _rotozoomSurfaceSizeTrig(rz_src->w, rz_src->h, angle, zoomx, zoomy, &dstwidth, &dstheight, &canglezoom, &sanglezoom); /* * Calculate target factors from sin/cos and zoom */ sanglezoominv = sanglezoom; canglezoominv = canglezoom; sanglezoominv *= zoominv; canglezoominv *= zoominv; /* Calculate half size */ dstwidthhalf = dstwidth / 2; dstheighthalf = dstheight / 2; /* * Alloc space to completely contain the rotated surface */ rz_dst = NULL; if (is32bit) { /* * Target surface is 32bit with source RGBA/ABGR ordering */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32, rz_src->format->Rmask, rz_src->format->Gmask, rz_src->format->Bmask, rz_src->format->Amask); } else { /* * Target surface is 8bit */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0); } /* Check target */ if (rz_dst == NULL) return NULL; /* Adjust for guard rows */ rz_dst->h = dstheight; /* * Lock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_LockSurface(rz_src); } /* * Check which kind of surface we have */ if (is32bit) { /* * Call the 32bit transformation routine to do the rotation (using alpha) */ _transformSurfaceRGBA(rz_src, rz_dst, dstwidthhalf, dstheighthalf, (int) (sanglezoominv), (int) (canglezoominv), flipx, flipy, smooth); } else { /* * Copy palette and colorkey info */ for (i = 0; i < rz_src->format->palette->ncolors; i++) { rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i]; } rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors; /* * Call the 8bit transformation routine to do the rotation */ transformSurfaceY(rz_src, rz_dst, dstwidthhalf, dstheighthalf, (int) (sanglezoominv), (int) (canglezoominv), flipx, flipy); } /* * Unlock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_UnlockSurface(rz_src); } } else { /* * Angle=0: Just a zoom */ /* * -------------------- */ /* * Calculate target size */ zoomSurfaceSize(rz_src->w, rz_src->h, zoomx, zoomy, &dstwidth, &dstheight); /* * Alloc space to completely contain the zoomed surface */ rz_dst = NULL; if (is32bit) { /* * Target surface is 32bit with source RGBA/ABGR ordering */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32, rz_src->format->Rmask, rz_src->format->Gmask, rz_src->format->Bmask, rz_src->format->Amask); } else { /* * Target surface is 8bit */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0); } /* Check target */ if (rz_dst == NULL) return NULL; /* Adjust for guard rows */ rz_dst->h = dstheight; /* * Lock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_LockSurface(rz_src); } /* * Check which kind of surface we have */ if (is32bit) { /* * Call the 32bit transformation routine to do the zooming (using alpha) */ _zoomSurfaceRGBA(rz_src, rz_dst, flipx, flipy, smooth); } else { /* * Copy palette and colorkey info */ for (i = 0; i < rz_src->format->palette->ncolors; i++) { rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i]; } rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors; /* * Call the 8bit transformation routine to do the zooming */ _zoomSurfaceY(rz_src, rz_dst, flipx, flipy); } /* * Unlock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_UnlockSurface(rz_src); } } /* * Cleanup temp surface */ if (src_converted) { SDL_FreeSurface(rz_src); } /* * Return destination surface */ return (rz_dst); } /*! \brief Calculates the size of the target surface for a zoomSurface() call. The minimum size of the target surface is 1. The input factors can be positive or negative. \param width The width of the source surface to zoom. \param height The height of the source surface to zoom. \param zoomx The horizontal zoom factor. \param zoomy The vertical zoom factor. \param dstwidth Pointer to an integer to store the calculated width of the zoomed target surface. \param dstheight Pointer to an integer to store the calculated height of the zoomed target surface. */ void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight) { /* * Make zoom factors positive */ int flipx, flipy; flipx = (zoomx<0.0); if (flipx) zoomx = -zoomx; flipy = (zoomy<0.0); if (flipy) zoomy = -zoomy; /* * Sanity check zoom factors */ if (zoomx < VALUE_LIMIT) { zoomx = VALUE_LIMIT; } if (zoomy < VALUE_LIMIT) { zoomy = VALUE_LIMIT; } /* * Calculate target size */ *dstwidth = (int) floor(((double) width * zoomx) + 0.5); *dstheight = (int) floor(((double) height * zoomy) + 0.5); if (*dstwidth < 1) { *dstwidth = 1; } if (*dstheight < 1) { *dstheight = 1; } } /*! \brief Zoom a surface by independent horizontal and vertical factors with optional smoothing. Zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is on then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. If zoom factors are negative, the image is flipped on the axes. \param src The surface to zoom. \param zoomx The horizontal zoom factor. \param zoomy The vertical zoom factor. \param smooth Antialiasing flag; set to SMOOTHING_ON to enable. \return The new, zoomed surface. */ SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth) { SDL_Surface *rz_src; SDL_Surface *rz_dst; int dstwidth, dstheight; int is32bit; int i, src_converted; int flipx, flipy; /* * Sanity check */ if (src == NULL) return (NULL); /* * Determine if source surface is 32bit or 8bit */ is32bit = (src->format->BitsPerPixel == 32); if ((is32bit) || (src->format->BitsPerPixel == 8)) { /* * Use source surface 'as is' */ rz_src = src; src_converted = 0; } else { /* * New source surface is 32bit with a defined RGBA ordering */ rz_src = SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32, #if SDL_BYTEORDER == SDL_LIL_ENDIAN 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 #else 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff #endif ); if (rz_src == NULL) { return NULL; } SDL_BlitSurface(src, NULL, rz_src, NULL); src_converted = 1; is32bit = 1; } flipx = (zoomx<0.0); if (flipx) zoomx = -zoomx; flipy = (zoomy<0.0); if (flipy) zoomy = -zoomy; /* Get size if target */ zoomSurfaceSize(rz_src->w, rz_src->h, zoomx, zoomy, &dstwidth, &dstheight); /* * Alloc space to completely contain the zoomed surface */ rz_dst = NULL; if (is32bit) { /* * Target surface is 32bit with source RGBA/ABGR ordering */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32, rz_src->format->Rmask, rz_src->format->Gmask, rz_src->format->Bmask, rz_src->format->Amask); } else { /* * Target surface is 8bit */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0); } /* Check target */ if (rz_dst == NULL) { /* * Cleanup temp surface */ if (src_converted) { SDL_FreeSurface(rz_src); } return NULL; } /* Adjust for guard rows */ rz_dst->h = dstheight; /* * Lock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_LockSurface(rz_src); } /* * Check which kind of surface we have */ if (is32bit) { /* * Call the 32bit transformation routine to do the zooming (using alpha) */ _zoomSurfaceRGBA(rz_src, rz_dst, flipx, flipy, smooth); } else { /* * Copy palette and colorkey info */ for (i = 0; i < rz_src->format->palette->ncolors; i++) { rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i]; } rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors; /* * Call the 8bit transformation routine to do the zooming */ _zoomSurfaceY(rz_src, rz_dst, flipx, flipy); } /* * Unlock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_UnlockSurface(rz_src); } /* * Cleanup temp surface */ if (src_converted) { SDL_FreeSurface(rz_src); } /* * Return destination surface */ return (rz_dst); } /*! \brief Shrink a surface by an integer ratio using averaging. Shrinks a 32bit or 8bit 'src' surface to a newly created 'dst' surface. 'factorx' and 'factory' are the shrinking ratios (i.e. 2=1/2 the size, 3=1/3 the size, etc.) The destination surface is antialiased by averaging the source box RGBA or Y information. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. The input surface is not modified. The output surface is newly allocated. \param src The surface to shrink. \param factorx The horizontal shrinking ratio. \param factory The vertical shrinking ratio. \return The new, shrunken surface. */ /*@null@*/ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory) { int result; SDL_Surface *rz_src; SDL_Surface *rz_dst = NULL; int dstwidth, dstheight; int is32bit; int i, src_converted; int haveError = 0; /* * Sanity check */ if (src == NULL) { return (NULL); } /* * Determine if source surface is 32bit or 8bit */ is32bit = (src->format->BitsPerPixel == 32); if ((is32bit) || (src->format->BitsPerPixel == 8)) { /* * Use source surface 'as is' */ rz_src = src; src_converted = 0; } else { /* * New source surface is 32bit with a defined RGBA ordering */ rz_src = SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32, #if SDL_BYTEORDER == SDL_LIL_ENDIAN 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 #else 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff #endif ); if (rz_src==NULL) { haveError = 1; goto exitShrinkSurface; } SDL_BlitSurface(src, NULL, rz_src, NULL); src_converted = 1; is32bit = 1; } /* * Lock the surface */ if (SDL_MUSTLOCK(rz_src)) { if (SDL_LockSurface(rz_src) < 0) { haveError = 1; goto exitShrinkSurface; } } /* Get size for target */ dstwidth=rz_src->w/factorx; while (dstwidth*factorx>rz_src->w) { dstwidth--; } dstheight=rz_src->h/factory; while (dstheight*factory>rz_src->h) { dstheight--; } /* * Alloc space to completely contain the shrunken surface * (with added guard rows) */ if (is32bit==1) { /* * Target surface is 32bit with source RGBA/ABGR ordering */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32, rz_src->format->Rmask, rz_src->format->Gmask, rz_src->format->Bmask, rz_src->format->Amask); } else { /* * Target surface is 8bit */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0); } /* Check target */ if (rz_dst == NULL) { haveError = 1; goto exitShrinkSurface; } /* Adjust for guard rows */ rz_dst->h = dstheight; /* * Check which kind of surface we have */ if (is32bit==1) { /* * Call the 32bit transformation routine to do the shrinking (using alpha) */ result = _shrinkSurfaceRGBA(rz_src, rz_dst, factorx, factory); if ((result!=0) || (rz_dst==NULL)) { haveError = 1; goto exitShrinkSurface; } } else { /* * Copy palette and colorkey info */ for (i = 0; i < rz_src->format->palette->ncolors; i++) { rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i]; } rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors; /* * Call the 8bit transformation routine to do the shrinking */ result = _shrinkSurfaceY(rz_src, rz_dst, factorx, factory); if (result!=0) { haveError = 1; goto exitShrinkSurface; } } exitShrinkSurface: if (rz_src!=NULL) { /* * Unlock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_UnlockSurface(rz_src); } /* * Cleanup temp surface */ if (src_converted==1) { SDL_FreeSurface(rz_src); } } /* Check error state; maybe need to cleanup destination */ if (haveError==1) { if (rz_dst!=NULL) { SDL_FreeSurface(rz_dst); } rz_dst=NULL; } /* * Return destination surface */ return (rz_dst); } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1429188731.0 pygame_sdl2-2.1.0+renpy8.4.1/src/SDL2_rotozoom.h0000644000175000017500000000567012513730173017310 0ustar00tomtom/* SDL2_rotozoom.c: rotozoomer, zoomer and shrinker for 32bit or 8bit surfaces Copyright (C) 2001-2012 Andreas Schiffler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Andreas Schiffler -- aschiffler at ferzkopp dot net */ #ifndef _SDL2_rotozoom_h #define _SDL2_rotozoom_h #include /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif #ifndef M_PI #define M_PI 3.1415926535897932384626433832795 #endif #include "SDL.h" /* ---- Defines */ /*! \brief Disable anti-aliasing (no smoothing). */ #define SMOOTHING_OFF 0 /*! \brief Enable anti-aliasing (smoothing). */ #define SMOOTHING_ON 1 /* ---- Function Prototypes */ #ifdef _MSC_VER # if defined(DLL_EXPORT) && !defined(LIBSDL2_GFX_DLL_IMPORT) # define SDL2_ROTOZOOM_SCOPE __declspec(dllexport) # else # ifdef LIBSDL2_GFX_DLL_IMPORT # define SDL2_ROTOZOOM_SCOPE __declspec(dllimport) # endif # endif #endif #ifndef SDL2_ROTOZOOM_SCOPE # define SDL2_ROTOZOOM_SCOPE extern #endif /* Rotozoom functions */ SDL2_ROTOZOOM_SCOPE SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int smooth); SDL2_ROTOZOOM_SCOPE SDL_Surface *rotozoomSurfaceXY (SDL_Surface * src, double angle, double zoomx, double zoomy, int smooth); SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight); SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSizeXY (int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight); /* Zooming functions */ SDL2_ROTOZOOM_SCOPE SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth); SDL2_ROTOZOOM_SCOPE void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight); /* Shrinking functions */ SDL2_ROTOZOOM_SCOPE SDL_Surface *shrinkSurface(SDL_Surface * src, int factorx, int factory); /* Specialized rotation functions */ SDL2_ROTOZOOM_SCOPE SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #endif /* _SDL2_rotozoom_h */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1487825606.0 pygame_sdl2-2.1.0+renpy8.4.1/src/SDL_gfxPrimitives.c0000664000175000017500000047204013053465306020175 0ustar00tomtom/* SDL_gfxPrimitives - Graphics primitives for SDL surfaces LGPL (c) A. Schiffler */ #include #include #include #include #include "SDL_gfxPrimitives.h" //#include "SDL_rotozoom.h" #include "SDL_gfxPrimitives_font.h" /* -===================- */ #define DEFAULT_ALPHA_PIXEL_ROUTINE #undef EXPERIMENTAL_ALPHA_PIXEL_ROUTINE /* ---- Structures */ /*! \brief The structure passed to the internal Bresenham iterator. */ typedef struct { Sint16 x, y; int dx, dy, s1, s2, swapdir, error; Uint32 count; } SDL_gfxBresenhamIterator; /*! \brief The structure passed to the internal Murphy iterator. */ typedef struct { Uint32 color; SDL_Surface *dst; int u, v; /* delta x , delta y */ int ku, kt, kv, kd; /* loop constants */ int oct2; int quad4; Sint16 last1x, last1y, last2x, last2y, first1x, first1y, first2x, first2y, tempx, tempy; } SDL_gfxMurphyIterator; /* ----- Defines for pixel clipping tests */ #define clip_xmin(surface) surface->clip_rect.x #define clip_xmax(surface) surface->clip_rect.x+surface->clip_rect.w-1 #define clip_ymin(surface) surface->clip_rect.y #define clip_ymax(surface) surface->clip_rect.y+surface->clip_rect.h-1 /*! \brief Internal pixel drawing - fast, no blending, no locking, clipping. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param color The color value of the pixel to draw. \returns Returns 0 on success, -1 on failure. */ int fastPixelColorNolock(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { int bpp; Uint8 *p; /* * Honor clipping setup at pixel level */ if ((x >= clip_xmin(dst)) && (x <= clip_xmax(dst)) && (y >= clip_ymin(dst)) && (y <= clip_ymax(dst))) { /* * Get destination format */ bpp = dst->format->BytesPerPixel; p = (Uint8 *) dst->pixels + y * dst->pitch + x * bpp; switch (bpp) { case 1: *p = color; break; case 2: *(Uint16 *) p = color; break; case 3: if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { p[0] = (color >> 16) & 0xff; p[1] = (color >> 8) & 0xff; p[2] = color & 0xff; } else { p[0] = color & 0xff; p[1] = (color >> 8) & 0xff; p[2] = (color >> 16) & 0xff; } break; case 4: *(Uint32 *) p = color; break; } /* switch */ } return (0); } /*! \brief Internal pixel drawing - fast, no blending, no locking, no clipping. Function is faster but dangerous since no clipping check is done. Code needs to make sure we stay in surface bounds before calling. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param color The color value of the pixel to draw. \returns Returns 0 on success, -1 on failure. */ int fastPixelColorNolockNoclip(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { int bpp; Uint8 *p; /* * Get destination format */ bpp = dst->format->BytesPerPixel; p = (Uint8 *) dst->pixels + y * dst->pitch + x * bpp; switch (bpp) { case 1: *p = color; break; case 2: *(Uint16 *) p = color; break; case 3: if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { p[0] = (color >> 16) & 0xff; p[1] = (color >> 8) & 0xff; p[2] = color & 0xff; } else { p[0] = color & 0xff; p[1] = (color >> 8) & 0xff; p[2] = (color >> 16) & 0xff; } break; case 4: *(Uint32 *) p = color; break; } /* switch */ return (0); } /*! \brief Internal pixel drawing - fast, no blending, locking, clipping. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param color The color value of the pixel to draw. \returns Returns 0 on success, -1 on failure. */ int fastPixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { int result; /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } result = fastPixelColorNolock(dst, x, y, color); /* * Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Internal pixel drawing - fast, no blending, locking, RGB input. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param r The red value of the pixel to draw. \param g The green value of the pixel to draw. \param b The blue value of the pixel to draw. \param a The alpha value of the pixel to draw. \returns Returns 0 on success, -1 on failure. */ int fastPixelRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Uint32 color; /* * Setup color */ color = SDL_MapRGBA(dst->format, r, g, b, a); /* * Draw */ return (fastPixelColor(dst, x, y, color)); } /*! \brief Internal pixel drawing - fast, no blending, no locking RGB input. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param r The red value of the pixel to draw. \param g The green value of the pixel to draw. \param b The blue value of the pixel to draw. \param a The alpha value of the pixel to draw. \returns Returns 0 on success, -1 on failure. */ int fastPixelRGBANolock(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Uint32 color; /* * Setup color */ color = SDL_MapRGBA(dst->format, r, g, b, a); /* * Draw */ return (fastPixelColorNolock(dst, x, y, color)); } /*! \brief Internal pixel drawing function with alpha blending where input color in in destination format. Contains two alternative 32 bit alpha blending routines which can be enabled at the source level with the defines DEFAULT_ALPHA_PIXEL_ROUTINE or EXPERIMENTAL_ALPHA_PIXEL_ROUTINE. Only the bits up to the surface depth are significant in the color value. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param color The color value of the pixel to draw. \param alpha The blend factor to apply while drawing. \returns Returns 0 on success, -1 on failure. */ int _putPixelAlpha(SDL_Surface *dst, Sint16 x, Sint16 y, Uint32 color, Uint8 alpha) { SDL_PixelFormat *format; Uint32 Rmask, Gmask, Bmask, Amask; Uint32 Rshift, Gshift, Bshift, Ashift; Uint32 R, G, B, A; if (dst == NULL) { return (-1); } if (x >= clip_xmin(dst) && x <= clip_xmax(dst) && y >= clip_ymin(dst) && y <= clip_ymax(dst)) { format = dst->format; switch (format->BytesPerPixel) { case 1: { /* Assuming 8-bpp */ if (alpha == 255) { *((Uint8 *) dst->pixels + y * dst->pitch + x) = color; } else { Uint8 *pixel = (Uint8 *) dst->pixels + y * dst->pitch + x; SDL_Palette *palette = format->palette; SDL_Color *colors = palette->colors; SDL_Color dColor = colors[*pixel]; SDL_Color sColor = colors[color]; Uint8 dR = dColor.r; Uint8 dG = dColor.g; Uint8 dB = dColor.b; Uint8 sR = sColor.r; Uint8 sG = sColor.g; Uint8 sB = sColor.b; dR = dR + ((sR - dR) * alpha >> 8); dG = dG + ((sG - dG) * alpha >> 8); dB = dB + ((sB - dB) * alpha >> 8); *pixel = SDL_MapRGB(format, dR, dG, dB); } } break; case 2: { /* Probably 15-bpp or 16-bpp */ if (alpha == 255) { *((Uint16 *) dst->pixels + y * dst->pitch / 2 + x) = color; } else { Uint16 *pixel = (Uint16 *) dst->pixels + y * dst->pitch / 2 + x; Uint32 dc = *pixel; Rmask = format->Rmask; Gmask = format->Gmask; Bmask = format->Bmask; Amask = format->Amask; R = ((dc & Rmask) + (((color & Rmask) - (dc & Rmask)) * alpha >> 8)) & Rmask; G = ((dc & Gmask) + (((color & Gmask) - (dc & Gmask)) * alpha >> 8)) & Gmask; B = ((dc & Bmask) + (((color & Bmask) - (dc & Bmask)) * alpha >> 8)) & Bmask; *pixel = R | G | B; if (Amask!=0) { A = ((dc & Amask) + (((color & Amask) - (dc & Amask)) * alpha >> 8)) & Amask; *pixel |= A; } } } break; case 3: { /* Slow 24-bpp mode, usually not used */ Uint8 Rshift8, Gshift8, Bshift8, Ashift8; Uint8 *pixel = (Uint8 *) dst->pixels + y * dst->pitch + x * 3; Rshift = format->Rshift; Gshift = format->Gshift; Bshift = format->Bshift; Ashift = format->Ashift; Rshift8 = Rshift / 8; Gshift8 = Gshift / 8; Bshift8 = Bshift / 8; Ashift8 = Ashift / 8; if (alpha == 255) { *(pixel + Rshift8) = color >> Rshift; *(pixel + Gshift8) = color >> Gshift; *(pixel + Bshift8) = color >> Bshift; *(pixel + Ashift8) = color >> Ashift; } else { Uint8 dR, dG, dB, dA = 0; Uint8 sR, sG, sB, sA = 0; dR = *((pixel) + Rshift8); dG = *((pixel) + Gshift8); dB = *((pixel) + Bshift8); dA = *((pixel) + Ashift8); sR = (color >> Rshift) & 0xff; sG = (color >> Gshift) & 0xff; sB = (color >> Bshift) & 0xff; sA = (color >> Ashift) & 0xff; dR = dR + ((sR - dR) * alpha >> 8); dG = dG + ((sG - dG) * alpha >> 8); dB = dB + ((sB - dB) * alpha >> 8); dA = dA + ((sA - dA) * alpha >> 8); *((pixel) + Rshift8) = dR; *((pixel) + Gshift8) = dG; *((pixel) + Bshift8) = dB; *((pixel) + Ashift8) = dA; } } break; #ifdef DEFAULT_ALPHA_PIXEL_ROUTINE case 4: { /* Probably :-) 32-bpp */ if (alpha == 255) { *((Uint32 *) dst->pixels + y * dst->pitch / 4 + x) = color; } else { Uint32 *pixel = (Uint32 *) dst->pixels + y * dst->pitch / 4 + x; Uint32 dc = *pixel; Rmask = format->Rmask; Gmask = format->Gmask; Bmask = format->Bmask; Amask = format->Amask; Rshift = format->Rshift; Gshift = format->Gshift; Bshift = format->Bshift; Ashift = format->Ashift; R = ((dc & Rmask) + (((((color & Rmask) - (dc & Rmask)) >> Rshift) * alpha >> 8) << Rshift)) & Rmask; G = ((dc & Gmask) + (((((color & Gmask) - (dc & Gmask)) >> Gshift) * alpha >> 8) << Gshift)) & Gmask; B = ((dc & Bmask) + (((((color & Bmask) - (dc & Bmask)) >> Bshift) * alpha >> 8) << Bshift)) & Bmask; *pixel = R | G | B; if (Amask!=0) { A = ((dc & Amask) + (((((color & Amask) - (dc & Amask)) >> Ashift) * alpha >> 8) << Ashift)) & Amask; *pixel |= A; } } } break; #endif #ifdef EXPERIMENTAL_ALPHA_PIXEL_ROUTINE case 4:{ /* Probably :-) 32-bpp */ if (alpha == 255) { *((Uint32 *) dst->pixels + y * dst->pitch / 4 + x) = color; } else { Uint32 *pixel = (Uint32 *) dst->pixels + y * dst->pitch / 4 + x; Uint32 dR, dG, dB, dA; Uint32 dc = *pixel; Uint32 surfaceAlpha, preMultR, preMultG, preMultB; Uint32 aTmp; Rmask = format->Rmask; Gmask = format->Gmask; Bmask = format->Bmask; Amask = format->Amask; dR = (color & Rmask); dG = (color & Gmask); dB = (color & Bmask); dA = (color & Amask); Rshift = format->Rshift; Gshift = format->Gshift; Bshift = format->Bshift; Ashift = format->Ashift; preMultR = (alpha * (dR >> Rshift)); preMultG = (alpha * (dG >> Gshift)); preMultB = (alpha * (dB >> Bshift)); surfaceAlpha = ((dc & Amask) >> Ashift); aTmp = (255 - alpha); if (A = 255 - ((aTmp * (255 - surfaceAlpha)) >> 8 )) { aTmp *= surfaceAlpha; R = (preMultR + ((aTmp * ((dc & Rmask) >> Rshift)) >> 8)) / A << Rshift & Rmask; G = (preMultG + ((aTmp * ((dc & Gmask) >> Gshift)) >> 8)) / A << Gshift & Gmask; B = (preMultB + ((aTmp * ((dc & Bmask) >> Bshift)) >> 8)) / A << Bshift & Bmask; } *pixel = R | G | B | (A << Ashift & Amask); } } break; #endif } } return (0); } /*! \brief Pixel draw with blending enabled if a<255. \param dst The surface to draw on. \param x X (horizontal) coordinate of the pixel. \param y Y (vertical) coordinate of the pixel. \param color The color value of the pixel to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int pixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { Uint8 alpha; Uint32 mcolor; int result = 0; /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Setup color */ alpha = color & 0x000000ff; mcolor = SDL_MapRGBA(dst->format, (color & 0xff000000) >> 24, (color & 0x00ff0000) >> 16, (color & 0x0000ff00) >> 8, alpha); /* * Draw */ result = _putPixelAlpha(dst, x, y, mcolor, alpha); /* * Unlock the surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Pixel draw with blending enabled if a<255 - no surface locking. \param dst The surface to draw on. \param x X (horizontal) coordinate of the pixel. \param y Y (vertical) coordinate of the pixel. \param color The color value of the pixel to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int pixelColorNolock(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { Uint8 alpha; Uint32 mcolor; int result = 0; /* * Setup color */ alpha = color & 0x000000ff; mcolor = SDL_MapRGBA(dst->format, (color & 0xff000000) >> 24, (color & 0x00ff0000) >> 16, (color & 0x0000ff00) >> 8, alpha); /* * Draw */ result = _putPixelAlpha(dst, x, y, mcolor, alpha); return (result); } /*! \brief Internal function to draw filled rectangle with alpha blending. Assumes color is in destination format. \param dst The surface to draw on. \param x1 X coordinate of the first corner (upper left) of the rectangle. \param y1 Y coordinate of the first corner (upper left) of the rectangle. \param x2 X coordinate of the second corner (lower right) of the rectangle. \param y2 Y coordinate of the second corner (lower right) of the rectangle. \param color The color value of the rectangle to draw (0xRRGGBBAA). \param alpha Alpha blending amount for pixels. \returns Returns 0 on success, -1 on failure. */ int _filledRectAlpha(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color, Uint8 alpha) { SDL_PixelFormat *format; Uint32 Rmask, Bmask, Gmask, Amask; Uint32 Rshift, Bshift, Gshift, Ashift; Uint8 sR, sG, sB, sA; Uint32 R, G, B, A; Sint16 x, y; format = dst->format; switch (format->BytesPerPixel) { case 1: { /* Assuming 8-bpp */ Uint8 *row, *pixel; Uint8 dR, dG, dB; SDL_Palette *palette = format->palette; SDL_Color *colors = palette->colors; sR = colors[color].r; sG = colors[color].g; sB = colors[color].b; for (y = y1; y <= y2; y++) { row = (Uint8 *) dst->pixels + y * dst->pitch; for (x = x1; x <= x2; x++) { pixel = row + x; dR = colors[*pixel].r; dG = colors[*pixel].g; dB = colors[*pixel].b; dR = dR + ((sR - dR) * alpha >> 8); dG = dG + ((sG - dG) * alpha >> 8); dB = dB + ((sB - dB) * alpha >> 8); *pixel = SDL_MapRGB(format, dR, dG, dB); } } } break; case 2: { /* Probably 15-bpp or 16-bpp */ Uint16 *row, *pixel; Uint32 dR, dG, dB, dA; Rmask = format->Rmask; Gmask = format->Gmask; Bmask = format->Bmask; Amask = format->Amask; dR = (color & Rmask); dG = (color & Gmask); dB = (color & Bmask); dA = (color & Amask); for (y = y1; y <= y2; y++) { row = (Uint16 *) dst->pixels + y * dst->pitch / 2; for (x = x1; x <= x2; x++) { pixel = row + x; R = ((*pixel & Rmask) + ((dR - (*pixel & Rmask)) * alpha >> 8)) & Rmask; G = ((*pixel & Gmask) + ((dG - (*pixel & Gmask)) * alpha >> 8)) & Gmask; B = ((*pixel & Bmask) + ((dB - (*pixel & Bmask)) * alpha >> 8)) & Bmask; *pixel = R | G | B; if (Amask!=0) { A = ((*pixel & Amask) + ((dA - (*pixel & Amask)) * alpha >> 8)) & Amask; *pixel |= A; } } } } break; case 3: { /* Slow 24-bpp mode, usually not used */ Uint8 *row, *pix; Uint8 dR, dG, dB, dA; Uint8 Rshift8, Gshift8, Bshift8, Ashift8; Rshift = format->Rshift; Gshift = format->Gshift; Bshift = format->Bshift; Ashift = format->Ashift; Rshift8 = Rshift / 8; Gshift8 = Gshift / 8; Bshift8 = Bshift / 8; Ashift8 = Ashift / 8; sR = (color >> Rshift) & 0xff; sG = (color >> Gshift) & 0xff; sB = (color >> Bshift) & 0xff; sA = (color >> Ashift) & 0xff; for (y = y1; y <= y2; y++) { row = (Uint8 *) dst->pixels + y * dst->pitch; for (x = x1; x <= x2; x++) { pix = row + x * 3; dR = *((pix) + Rshift8); dG = *((pix) + Gshift8); dB = *((pix) + Bshift8); dA = *((pix) + Ashift8); dR = dR + ((sR - dR) * alpha >> 8); dG = dG + ((sG - dG) * alpha >> 8); dB = dB + ((sB - dB) * alpha >> 8); dA = dA + ((sA - dA) * alpha >> 8); *((pix) + Rshift8) = dR; *((pix) + Gshift8) = dG; *((pix) + Bshift8) = dB; *((pix) + Ashift8) = dA; } } } break; #ifdef DEFAULT_ALPHA_PIXEL_ROUTINE case 4: { /* Probably :-) 32-bpp */ Uint32 *row, *pixel; Uint32 dR, dG, dB, dA; Rmask = format->Rmask; Gmask = format->Gmask; Bmask = format->Bmask; Amask = format->Amask; Rshift = format->Rshift; Gshift = format->Gshift; Bshift = format->Bshift; Ashift = format->Ashift; dR = (color & Rmask); dG = (color & Gmask); dB = (color & Bmask); dA = (color & Amask); for (y = y1; y <= y2; y++) { row = (Uint32 *) dst->pixels + y * dst->pitch / 4; for (x = x1; x <= x2; x++) { pixel = row + x; R = ((*pixel & Rmask) + ((((dR - (*pixel & Rmask)) >> Rshift) * alpha >> 8) << Rshift)) & Rmask; G = ((*pixel & Gmask) + ((((dG - (*pixel & Gmask)) >> Gshift) * alpha >> 8) << Gshift)) & Gmask; B = ((*pixel & Bmask) + ((((dB - (*pixel & Bmask)) >> Bshift) * alpha >> 8) << Bshift)) & Bmask; *pixel = R | G | B; if (Amask!=0) { A = ((*pixel & Amask) + ((((dA - (*pixel & Amask)) >> Ashift) * alpha >> 8) << Ashift)) & Amask; *pixel |= A; } } } } break; #endif #ifdef EXPERIMENTAL_ALPHA_PIXEL_ROUTINE case 4:{ /* Probably :-) 32-bpp */ Uint32 *row, *pixel; Uint32 dR, dG, dB, dA; Uint32 dc; Uint32 surfaceAlpha, preMultR, preMultG, preMultB; Uint32 aTmp; Rmask = format->Rmask; Gmask = format->Gmask; Bmask = format->Bmask; Amask = format->Amask; dR = (color & Rmask); dG = (color & Gmask); dB = (color & Bmask); dA = (color & Amask); Rshift = format->Rshift; Gshift = format->Gshift; Bshift = format->Bshift; Ashift = format->Ashift; preMultR = (alpha * (dR >> Rshift)); preMultG = (alpha * (dG >> Gshift)); preMultB = (alpha * (dB >> Bshift)); for (y = y1; y <= y2; y++) { row = (Uint32 *) dst->pixels + y * dst->pitch / 4; for (x = x1; x <= x2; x++) { pixel = row + x; dc = *pixel; surfaceAlpha = ((dc & Amask) >> Ashift); aTmp = (255 - alpha); if (A = 255 - ((aTmp * (255 - surfaceAlpha)) >> 8 )) { aTmp *= surfaceAlpha; R = (preMultR + ((aTmp * ((dc & Rmask) >> Rshift)) >> 8)) / A << Rshift & Rmask; G = (preMultG + ((aTmp * ((dc & Gmask) >> Gshift)) >> 8)) / A << Gshift & Gmask; B = (preMultB + ((aTmp * ((dc & Bmask) >> Bshift)) >> 8)) / A << Bshift & Bmask; } *pixel = R | G | B | (A << Ashift & Amask); } } } break; #endif } return (0); } /*! \brief Draw filled rectangle of RGBA color with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first corner (upper left) of the rectangle. \param y1 Y coordinate of the first corner (upper left) of the rectangle. \param x2 X coordinate of the second corner (lower right) of the rectangle. \param y2 Y coordinate of the second corner (lower right) of the rectangle. \param color The color value of the rectangle to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int filledRectAlpha(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { Uint8 alpha; Uint32 mcolor; int result = 0; /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Setup color */ alpha = color & 0x000000ff; mcolor = SDL_MapRGBA(dst->format, (color & 0xff000000) >> 24, (color & 0x00ff0000) >> 16, (color & 0x0000ff00) >> 8, alpha); /* * Draw */ result = _filledRectAlpha(dst, x1, y1, x2, y2, mcolor, alpha); /* * Unlock the surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Internal function to draw horizontal line of RGBA color with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. left) of the line. \param x2 X coordinate of the second point (i.e. right) of the line. \param y Y coordinate of the points of the line. \param color The color value of the line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int _HLineAlpha(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color) { return (filledRectAlpha(dst, x1, y, x2, y, color)); } /*! \brief Internal function to draw vertical line of RGBA color with alpha blending. \param dst The surface to draw on. \param x X coordinate of the points of the line. \param y1 Y coordinate of the first point (top) of the line. \param y2 Y coordinate of the second point (bottom) of the line. \param color The color value of the line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int _VLineAlpha(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color) { return (filledRectAlpha(dst, x, y1, x, y2, color)); } /*! \brief Pixel draw with blending enabled and using alpha weight on color. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param color The color value of the pixel to draw (0xRRGGBBAA). \param weight The weight multiplied into the alpha value of the pixel. \returns Returns 0 on success, -1 on failure. */ int pixelColorWeight(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color, Uint32 weight) { Uint32 a; /* * Get alpha */ a = (color & (Uint32) 0x000000ff); /* * Modify Alpha by weight */ a = ((a * weight) >> 8); return (pixelColor(dst, x, y, (color & (Uint32) 0xffffff00) | (Uint32) a)); } /*! \brief Pixel draw with blending enabled and using alpha weight on color - no locking. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param color The color value of the pixel to draw (0xRRGGBBAA). \param weight The weight multiplied into the alpha value of the pixel. \returns Returns 0 on success, -1 on failure. */ int pixelColorWeightNolock(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color, Uint32 weight) { Uint32 a; /* * Get alpha */ a = (color & (Uint32) 0x000000ff); /* * Modify Alpha by weight */ a = ((a * weight) >> 8); return (pixelColorNolock(dst, x, y, (color & (Uint32) 0xffffff00) | (Uint32) a)); } /*! \brief Pixel draw with blending enabled if a<255. \param dst The surface to draw on. \param x X (horizontal) coordinate of the pixel. \param y Y (vertical) coordinate of the pixel. \param r The red color value of the pixel to draw. \param g The green color value of the pixel to draw. \param b The blue color value of the pixel to draw. \param a The alpha value of the pixel to draw. \returns Returns 0 on success, -1 on failure. */ int pixelRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Uint32 color; /* * Check Alpha */ if (a == 255) { /* * No alpha blending required */ /* * Setup color */ color = SDL_MapRGBA(dst->format, r, g, b, a); /* * Draw */ return (fastPixelColor(dst, x, y, color)); } else { /* * Alpha blending required */ /* * Draw */ return (pixelColor(dst, x, y, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } } /*! \brief Draw horizontal line without blending; Just stores the color value (including the alpha component) without blending. Only the same number of bits of the destination surface are transfered from the input color value. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. left) of the line. \param x2 X coordinate of the second point (i.e. right) of the line. \param y Y coordinate of the points of the line. \param color The color value of the line to draw. \returns Returns 0 on success, -1 on failure. */ int hlineColorStore(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color) { Sint16 left, right, top, bottom; Uint8 *pixel, *pixellast; int dx; int pixx, pixy; Sint16 w; Sint16 xtmp; int result = -1; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Swap x1, x2 if required to ensure x1<=x2 */ if (x1 > x2) { xtmp = x1; x1 = x2; x2 = xtmp; } /* * Get clipping boundary and * check visibility of hline */ left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; if ((ybottom)) { return (0); } /* * Clip x */ if (x1 < left) { x1 = left; } if (x2 > right) { x2 = right; } /* * Calculate width */ w = x2 - x1; /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * More variable setup */ dx = w; pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x1 + pixy * (int) y; /* * Draw */ switch (dst->format->BytesPerPixel) { case 1: memset(pixel, color, dx+1); break; case 2: pixellast = pixel + dx + dx; for (; pixel <= pixellast; pixel += pixx) { *(Uint16 *) pixel = color; } break; case 3: pixellast = pixel + dx + dx + dx; for (; pixel <= pixellast; pixel += pixx) { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { pixel[0] = (color >> 16) & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = color & 0xff; } else { pixel[0] = color & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = (color >> 16) & 0xff; } } break; default: /* case 4 */ dx = dx + dx; pixellast = pixel + dx + dx; for (; pixel <= pixellast; pixel += pixx) { *(Uint32 *) pixel = color; } break; } /* * Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } /* * Set result code */ result = 0; return (result); } /*! \brief Draw horizontal line without blending Just stores the color value (including the alpha component) without blending. Function should only be used for 32 bit target surfaces. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. left) of the line. \param x2 X coordinate of the second point (i.e. right) of the line. \param y Y coordinate of the points of the line. \param r The red value of the line to draw. \param g The green value of the line to draw. \param b The blue value of the line to draw. \param a The alpha value of the line to draw. \returns Returns 0 on success, -1 on failure. */ int hlineRGBAStore(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (hlineColorStore(dst, x1, x2, y, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /*! \brief Draw horizontal line with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. left) of the line. \param x2 X coordinate of the second point (i.e. right) of the line. \param y Y coordinate of the points of the line. \param color The color value of the line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int hlineColor(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color) { Sint16 left, right, top, bottom; Uint8 *pixel, *pixellast; int dx; int pixx, pixy; Sint16 xtmp; int result = -1; Uint8 *colorptr; Uint8 color3[3]; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Swap x1, x2 if required to ensure x1<=x2 */ if (x1 > x2) { xtmp = x1; x1 = x2; x2 = xtmp; } /* * Get clipping boundary and * check visibility of hline */ left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; if ((ybottom)) { return (0); } /* * Clip x */ if (x1 < left) { x1 = left; } if (x2 > right) { x2 = right; } /* * Calculate width difference */ dx = x2 - x1; /* * Alpha check */ if ((color & 255) == 255) { /* * No alpha-blending required */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * More variable setup */ pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x1 + pixy * (int) y; /* * Draw */ switch (dst->format->BytesPerPixel) { case 1: memset(pixel, color, dx + 1); break; case 2: pixellast = pixel + dx + dx; for (; pixel <= pixellast; pixel += pixx) { *(Uint16 *) pixel = color; } break; case 3: pixellast = pixel + dx + dx + dx; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color3[0] = (color >> 16) & 0xff; color3[1] = (color >> 8) & 0xff; color3[2] = color & 0xff; } else { color3[0] = color & 0xff; color3[1] = (color >> 8) & 0xff; color3[2] = (color >> 16) & 0xff; } for (; pixel <= pixellast; pixel += pixx) { memcpy(pixel, color3, 3); } break; default: /* case 4 */ dx = dx + dx; pixellast = pixel + dx + dx; for (; pixel <= pixellast; pixel += pixx) { *(Uint32 *) pixel = color; } break; } /* * Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } /* * Set result code */ result = 0; } else { /* * Alpha blending blit */ result = _HLineAlpha(dst, x1, x1 + dx, y, color); } return (result); } /*! \brief Draw horizontal line with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. left) of the line. \param x2 X coordinate of the second point (i.e. right) of the line. \param y Y coordinate of the points of the line. \param r The red value of the line to draw. \param g The green value of the line to draw. \param b The blue value of the line to draw. \param a The alpha value of the line to draw. \returns Returns 0 on success, -1 on failure. */ int hlineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (hlineColor(dst, x1, x2, y, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /*! \brief Draw vertical line with blending. \param dst The surface to draw on. \param x X coordinate of the points of the line. \param y1 Y coordinate of the first point (i.e. top) of the line. \param y2 Y coordinate of the second point (i.e. bottom) of the line. \param color The color value of the line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int vlineColor(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color) { Sint16 left, right, top, bottom; Uint8 *pixel, *pixellast; int dy; int pixx, pixy; Sint16 h; Sint16 ytmp; int result = -1; Uint8 *colorptr; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Swap y1, y2 if required to ensure y1<=y2 */ if (y1 > y2) { ytmp = y1; y1 = y2; y2 = ytmp; } /* * Get clipping boundary and * check visibility of vline */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; if ((xright)) { return (0); } top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* * Clip x */ if (y1 < top) { y1 = top; } if (y2 > bottom) { y2 = bottom; } /* * Calculate height */ h = y2 - y1; /* * Alpha check */ if ((color & 255) == 255) { /* * No alpha-blending required */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * More variable setup */ dy = h; pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x + pixy * (int) y1; pixellast = pixel + pixy * dy; /* * Draw */ switch (dst->format->BytesPerPixel) { case 1: for (; pixel <= pixellast; pixel += pixy) { *(Uint8 *) pixel = color; } break; case 2: for (; pixel <= pixellast; pixel += pixy) { *(Uint16 *) pixel = color; } break; case 3: for (; pixel <= pixellast; pixel += pixy) { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { pixel[0] = (color >> 16) & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = color & 0xff; } else { pixel[0] = color & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = (color >> 16) & 0xff; } } break; default: /* case 4 */ for (; pixel <= pixellast; pixel += pixy) { *(Uint32 *) pixel = color; } break; } /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } /* * Set result code */ result = 0; } else { /* * Alpha blending blit */ result = _VLineAlpha(dst, x, y1, y1 + h, color); } return (result); } /*! \brief Draw vertical line with blending. \param dst The surface to draw on. \param x X coordinate of the points of the line. \param y1 Y coordinate of the first point (i.e. top) of the line. \param y2 Y coordinate of the second point (i.e. bottom) of the line. \param r The red value of the line to draw. \param g The green value of the line to draw. \param b The blue value of the line to draw. \param a The alpha value of the line to draw. \returns Returns 0 on success, -1 on failure. */ int vlineRGBA(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (vlineColor(dst, x, y1, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /*! \brief Draw rectangle with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the rectangle. \param y1 Y coordinate of the first point (i.e. top right) of the rectangle. \param x2 X coordinate of the second point (i.e. bottom left) of the rectangle. \param y2 Y coordinate of the second point (i.e. bottom left) of the rectangle. \param color The color value of the rectangle to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int rectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { int result; Sint16 tmp; /* Check destination surface */ if (dst == NULL) { return -1; } /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return 0; } /* * Test for special cases of straight lines or single point */ if (x1 == x2) { if (y1 == y2) { return (pixelColor(dst, x1, y1, color)); } else { return (vlineColor(dst, x1, y1, y2, color)); } } else { if (y1 == y2) { return (hlineColor(dst, x1, x2, y1, color)); } } /* * Swap x1, x2 if required */ if (x1 > x2) { tmp = x1; x1 = x2; x2 = tmp; } /* * Swap y1, y2 if required */ if (y1 > y2) { tmp = y1; y1 = y2; y2 = tmp; } /* * Draw rectangle */ result = 0; result |= hlineColor(dst, x1, x2, y1, color); result |= hlineColor(dst, x1, x2, y2, color); y1 += 1; y2 -= 1; if (y1 <= y2) { result |= vlineColor(dst, x1, y1, y2, color); result |= vlineColor(dst, x2, y1, y2, color); } return (result); } /*! \brief Draw rectangle with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the rectangle. \param y1 Y coordinate of the first point (i.e. top right) of the rectangle. \param x2 X coordinate of the second point (i.e. bottom left) of the rectangle. \param y2 Y coordinate of the second point (i.e. bottom left) of the rectangle. \param r The red value of the rectangle to draw. \param g The green value of the rectangle to draw. \param b The blue value of the rectangle to draw. \param a The alpha value of the rectangle to draw. \returns Returns 0 on success, -1 on failure. */ int rectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (rectangleColor (dst, x1, y1, x2, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /*! \brief Draw rounded-corner rectangle with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the rectangle. \param y1 Y coordinate of the first point (i.e. top right) of the rectangle. \param x2 X coordinate of the second point (i.e. bottom left) of the rectangle. \param y2 Y coordinate of the second point (i.e. bottom left) of the rectangle. \param rad The radius of the corner arc. \param color The color value of the rectangle to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int roundedRectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color) { int result; Sint16 w, h, tmp; Sint16 xx1, xx2, yy1, yy2; /* * Check destination surface */ if (dst == NULL) { return -1; } /* * Check radius vor valid range */ if (rad < 0) { return -1; } /* * Special case - no rounding */ if (rad == 0) { return rectangleColor(dst, x1, y1, x2, y2, color); } /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return 0; } /* * Test for special cases of straight lines or single point */ if (x1 == x2) { if (y1 == y2) { return (pixelColor(dst, x1, y1, color)); } else { return (vlineColor(dst, x1, y1, y2, color)); } } else { if (y1 == y2) { return (hlineColor(dst, x1, x2, y1, color)); } } /* * Swap x1, x2 if required */ if (x1 > x2) { tmp = x1; x1 = x2; x2 = tmp; } /* * Swap y1, y2 if required */ if (y1 > y2) { tmp = y1; y1 = y2; y2 = tmp; } /* * Calculate width&height */ w = x2 - x1; h = y2 - y1; /* * Maybe adjust radius */ if ((rad * 2) > w) { rad = w / 2; } if ((rad * 2) > h) { rad = h / 2; } /* * Draw corners */ result = 0; xx1 = x1 + rad; xx2 = x2 - rad; yy1 = y1 + rad; yy2 = y2 - rad; result |= arcColor(dst, xx1, yy1, rad, 180, 270, color); result |= arcColor(dst, xx2, yy1, rad, 270, 360, color); result |= arcColor(dst, xx1, yy2, rad, 90, 180, color); result |= arcColor(dst, xx2, yy2, rad, 0, 90, color); /* * Draw lines */ if (xx1 <= xx2) { result |= hlineColor(dst, xx1, xx2, y1, color); result |= hlineColor(dst, xx1, xx2, y2, color); } if (yy1 <= yy2) { result |= vlineColor(dst, x1, yy1, yy2, color); result |= vlineColor(dst, x2, yy1, yy2, color); } return result; } /*! \brief Draw rounded-corner rectangle with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the rectangle. \param y1 Y coordinate of the first point (i.e. top right) of the rectangle. \param x2 X coordinate of the second point (i.e. bottom left) of the rectangle. \param y2 Y coordinate of the second point (i.e. bottom left) of the rectangle. \param rad The radius of the corner arc. \param r The red value of the rectangle to draw. \param g The green value of the rectangle to draw. \param b The blue value of the rectangle to draw. \param a The alpha value of the rectangle to draw. \returns Returns 0 on success, -1 on failure. */ int roundedRectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (roundedRectangleColor (dst, x1, y1, x2, y2, rad, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /*! \brief Draw rounded-corner box (filled rectangle) with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the box. \param y1 Y coordinate of the first point (i.e. top right) of the box. \param x2 X coordinate of the second point (i.e. bottom left) of the box. \param y2 Y coordinate of the second point (i.e. bottom left) of the box. \param rad The radius of the corner arcs of the box. \param color The color value of the box to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int roundedBoxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color) { int result; Sint16 w, h, tmp; Sint16 xx1, xx2, yy1, yy2; /* * Check destination surface */ if (dst == NULL) { return -1; } /* * Check radius vor valid range */ if (rad < 0) { return -1; } /* * Special case - no rounding */ if (rad == 0) { return rectangleColor(dst, x1, y1, x2, y2, color); } /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return 0; } /* * Test for special cases of straight lines or single point */ if (x1 == x2) { if (y1 == y2) { return (pixelColor(dst, x1, y1, color)); } else { return (vlineColor(dst, x1, y1, y2, color)); } } else { if (y1 == y2) { return (hlineColor(dst, x1, x2, y1, color)); } } /* * Swap x1, x2 if required */ if (x1 > x2) { tmp = x1; x1 = x2; x2 = tmp; } /* * Swap y1, y2 if required */ if (y1 > y2) { tmp = y1; y1 = y2; y2 = tmp; } /* * Calculate width&height */ w = x2 - x1; h = y2 - y1; /* * Maybe adjust radius */ if ((rad * 2) > w) { rad = w / 2; } if ((rad * 2) > h) { rad = h / 2; } /* * Draw corners */ result = 0; xx1 = x1 + rad; xx2 = x2 - rad; yy1 = y1 + rad; yy2 = y2 - rad; result |= filledPieColor(dst, xx1, yy1, rad, 180, 270, color); result |= filledPieColor(dst, xx2, yy1, rad, 270, 360, color); result |= filledPieColor(dst, xx1, yy2, rad, 90, 180, color); result |= filledPieColor(dst, xx2, yy2, rad, 0, 90, color); /* * Draw body */ xx1++; xx2--; yy1++; yy2--; if (xx1 <= xx2) { result |= boxColor(dst, xx1, y1, xx2, y2, color); } if (yy1 <= yy2) { result |= boxColor(dst, x1, yy1, xx1-1, yy2, color); result |= boxColor(dst, xx2+1, yy1, x2, yy2, color); } return result; } /*! \brief Draw rounded-corner box (filled rectangle) with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the box. \param y1 Y coordinate of the first point (i.e. top right) of the box. \param x2 X coordinate of the second point (i.e. bottom left) of the box. \param y2 Y coordinate of the second point (i.e. bottom left) of the box. \param rad The radius of the corner arcs of the box. \param r The red value of the box to draw. \param g The green value of the box to draw. \param b The blue value of the box to draw. \param a The alpha value of the box to draw. \returns Returns 0 on success, -1 on failure. */ int roundedBoxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (roundedBoxColor (dst, x1, y1, x2, y2, rad, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* --------- Clipping routines for line */ /* Clipping based heavily on code from */ /* http://www.ncsa.uiuc.edu/Vis/Graphics/src/clipCohSuth.c */ #define CLIP_LEFT_EDGE 0x1 #define CLIP_RIGHT_EDGE 0x2 #define CLIP_BOTTOM_EDGE 0x4 #define CLIP_TOP_EDGE 0x8 #define CLIP_INSIDE(a) (!a) #define CLIP_REJECT(a,b) (a&b) #define CLIP_ACCEPT(a,b) (!(a|b)) /*! \brief Internal clip-encoding routine. Calculates a segement-based clipping encoding for a point against a rectangle. \param x X coordinate of point. \param y Y coordinate of point. \param left X coordinate of left edge of the rectangle. \param top Y coordinate of top edge of the rectangle. \param right X coordinate of right edge of the rectangle. \param bottom Y coordinate of bottom edge of the rectangle. */ static int _clipEncode(Sint16 x, Sint16 y, Sint16 left, Sint16 top, Sint16 right, Sint16 bottom) { int code = 0; if (x < left) { code |= CLIP_LEFT_EDGE; } else if (x > right) { code |= CLIP_RIGHT_EDGE; } if (y < top) { code |= CLIP_TOP_EDGE; } else if (y > bottom) { code |= CLIP_BOTTOM_EDGE; } return code; } /*! \brief Clip line to a the clipping rectangle of a surface. \param dst Target surface to draw on. \param x1 Pointer to X coordinate of first point of line. \param y1 Pointer to Y coordinate of first point of line. \param x2 Pointer to X coordinate of second point of line. \param y2 Pointer to Y coordinate of second point of line. */ static int _clipLine(SDL_Surface * dst, Sint16 * x1, Sint16 * y1, Sint16 * x2, Sint16 * y2) { Sint16 left, right, top, bottom; int code1, code2; int draw = 0; Sint16 swaptmp; float m; /* * Get clipping boundary */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; while (1) { code1 = _clipEncode(*x1, *y1, left, top, right, bottom); code2 = _clipEncode(*x2, *y2, left, top, right, bottom); if (CLIP_ACCEPT(code1, code2)) { draw = 1; break; } else if (CLIP_REJECT(code1, code2)) break; else { if (CLIP_INSIDE(code1)) { swaptmp = *x2; *x2 = *x1; *x1 = swaptmp; swaptmp = *y2; *y2 = *y1; *y1 = swaptmp; swaptmp = code2; code2 = code1; code1 = swaptmp; } if (*x2 != *x1) { m = (float)(*y2 - *y1) / (float)(*x2 - *x1); } else { m = 1.0f; } if (code1 & CLIP_LEFT_EDGE) { *y1 += (Sint16) ((left - *x1) * m); *x1 = left; } else if (code1 & CLIP_RIGHT_EDGE) { *y1 += (Sint16) ((right - *x1) * m); *x1 = right; } else if (code1 & CLIP_BOTTOM_EDGE) { if (*x2 != *x1) { *x1 += (Sint16) ((bottom - *y1) / m); } *y1 = bottom; } else if (code1 & CLIP_TOP_EDGE) { if (*x2 != *x1) { *x1 += (Sint16) ((top - *y1) / m); } *y1 = top; } } } return draw; } /*! \brief Draw box (filled rectangle) with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the box. \param y1 Y coordinate of the first point (i.e. top right) of the box. \param x2 X coordinate of the second point (i.e. bottom left) of the box. \param y2 Y coordinate of the second point (i.e. bottom left) of the box. \param color The color value of the box to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int boxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { Sint16 left, right, top, bottom; Uint8 *pixel, *pixellast; int x, dx; int dy; int pixx, pixy; Sint16 w, h, tmp; int result; Uint8 *colorptr; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Order coordinates to ensure that * x1<=x2 and y1<=y2 */ if (x1 > x2) { tmp = x1; x1 = x2; x2 = tmp; } if (y1 > y2) { tmp = y1; y1 = y2; y2 = tmp; } /* * Get clipping boundary and * check visibility */ left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* Clip all points */ if (x1right) { x1=right; } if (x2right) { x2=right; } if (y1bottom) { y1=bottom; } if (y2bottom) { y2=bottom; } /* * Test for special cases of straight line or single point */ if (x1 == x2) { if (y1 == y2) { return (pixelColor(dst, x1, y1, color)); } else { return (vlineColor(dst, x1, y1, y2, color)); } } if (y1 == y2) { return (hlineColor(dst, x1, x2, y1, color)); } /* * Calculate width&height */ w = x2 - x1; h = y2 - y1; /* * Alpha check */ if ((color & 255) == 255) { /* * No alpha-blending required */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * More variable setup */ dx = w; dy = h; pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x1 + pixy * (int) y1; pixellast = pixel + pixx * dx + pixy * dy; dx++; /* * Draw */ switch (dst->format->BytesPerPixel) { case 1: for (; pixel <= pixellast; pixel += pixy) { memset(pixel, (Uint8) color, dx); } break; case 2: pixy -= (pixx * dx); for (; pixel <= pixellast; pixel += pixy) { for (x = 0; x < dx; x++) { *(Uint16*) pixel = color; pixel += pixx; } } break; case 3: pixy -= (pixx * dx); for (; pixel <= pixellast; pixel += pixy) { for (x = 0; x < dx; x++) { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { pixel[0] = (color >> 16) & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = color & 0xff; } else { pixel[0] = color & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = (color >> 16) & 0xff; } pixel += pixx; } } break; default: /* case 4 */ pixy -= (pixx * dx); for (; pixel <= pixellast; pixel += pixy) { for (x = 0; x < dx; x++) { *(Uint32 *) pixel = color; pixel += pixx; } } break; } /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } result = 0; } else { result = filledRectAlpha(dst, x1, y1, x1 + w, y1 + h, color); } return (result); } /*! \brief Draw box (filled rectangle) with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the box. \param y1 Y coordinate of the first point (i.e. top right) of the box. \param x2 X coordinate of the second point (i.e. bottom left) of the box. \param y2 Y coordinate of the second point (i.e. bottom left) of the box. \param r The red value of the box to draw. \param g The green value of the box to draw. \param b The blue value of the box to draw. \param a The alpha value of the box to draw. \returns Returns 0 on success, -1 on failure. */ int boxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (boxColor(dst, x1, y1, x2, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- Line */ /* Non-alpha line drawing code adapted from routine */ /* by Pete Shinners, pete@shinners.org */ /* Originally from pygame, http://pygame.seul.org */ #define ABS(a) (((a)<0) ? -(a) : (a)) /*! \brief Draw line with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the line. \param y1 Y coordinate of the first point of the line. \param x2 X coordinate of the second point of the line. \param y2 Y coordinate of the second point of the line. \param color The color value of the line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int lineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { int pixx, pixy; int x, y; int dx, dy; int ax, ay; int sx, sy; int swaptmp; Uint8 *pixel; Uint8 *colorptr; /* * Clip line and test if we have to draw */ if (!(_clipLine(dst, &x1, &y1, &x2, &y2))) { return (0); } /* * Test for special cases of straight lines or single point */ if (x1 == x2) { if (y1 < y2) { return (vlineColor(dst, x1, y1, y2, color)); } else if (y1 > y2) { return (vlineColor(dst, x1, y2, y1, color)); } else { return (pixelColor(dst, x1, y1, color)); } } if (y1 == y2) { if (x1 < x2) { return (hlineColor(dst, x1, x2, y1, color)); } else if (x1 > x2) { return (hlineColor(dst, x2, x1, y1, color)); } } /* * Variable setup */ dx = x2 - x1; dy = y2 - y1; sx = (dx >= 0) ? 1 : -1; sy = (dy >= 0) ? 1 : -1; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Check for alpha blending */ if ((color & 255) == 255) { /* * No alpha blending - use fast pixel routines */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * More variable setup */ dx = sx * dx + 1; dy = sy * dy + 1; pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x1 + pixy * (int) y1; pixx *= sx; pixy *= sy; if (dx < dy) { swaptmp = dx; dx = dy; dy = swaptmp; swaptmp = pixx; pixx = pixy; pixy = swaptmp; } /* * Draw */ x = 0; y = 0; switch (dst->format->BytesPerPixel) { case 1: for (; x < dx; x++, pixel += pixx) { *pixel = color; y += dy; if (y >= dx) { y -= dx; pixel += pixy; } } break; case 2: for (; x < dx; x++, pixel += pixx) { *(Uint16 *) pixel = color; y += dy; if (y >= dx) { y -= dx; pixel += pixy; } } break; case 3: for (; x < dx; x++, pixel += pixx) { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { pixel[0] = (color >> 16) & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = color & 0xff; } else { pixel[0] = color & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = (color >> 16) & 0xff; } y += dy; if (y >= dx) { y -= dx; pixel += pixy; } } break; default: /* case 4 */ for (; x < dx; x++, pixel += pixx) { *(Uint32 *) pixel = color; y += dy; if (y >= dx) { y -= dx; pixel += pixy; } } break; } } else { /* * Alpha blending required - use single-pixel blits */ ax = ABS(dx) << 1; ay = ABS(dy) << 1; x = x1; y = y1; if (ax > ay) { int d = ay - (ax >> 1); while (x != x2) { pixelColorNolock (dst, x, y, color); if (d > 0 || (d == 0 && sx == 1)) { y += sy; d -= ax; } x += sx; d += ay; } } else { int d = ax - (ay >> 1); while (y != y2) { pixelColorNolock (dst, x, y, color); if (d > 0 || ((d == 0) && (sy == 1))) { x += sx; d -= ay; } y += sy; d += ax; } } pixelColorNolock (dst, x, y, color); } /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (0); } /*! \brief Draw line with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the line. \param y1 Y coordinate of the first point of the line. \param x2 X coordinate of the second point of the line. \param y2 Y coordinate of the second point of the line. \param r The red value of the line to draw. \param g The green value of the line to draw. \param b The blue value of the line to draw. \param a The alpha value of the line to draw. \returns Returns 0 on success, -1 on failure. */ int lineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (lineColor(dst, x1, y1, x2, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* AA Line */ #define AAlevels 256 #define AAbits 8 /*! \brief Internal function to draw anti-aliased line with alpha blending and endpoint control. This implementation of the Wu antialiasing code is based on Mike Abrash's DDJ article which was reprinted as Chapter 42 of his Graphics Programming Black Book, but has been optimized to work with SDL and utilizes 32-bit fixed-point arithmetic by A. Schiffler. The endpoint control allows the supression to draw the last pixel useful for rendering continous aa-lines with alpha<255. \param dst The surface to draw on. \param x1 X coordinate of the first point of the aa-line. \param y1 Y coordinate of the first point of the aa-line. \param x2 X coordinate of the second point of the aa-line. \param y2 Y coordinate of the second point of the aa-line. \param color The color value of the aa-line to draw (0xRRGGBBAA). \param draw_endpoint Flag indicating if the endpoint should be drawn; draw if non-zero. \returns Returns 0 on success, -1 on failure. */ int _aalineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color, int draw_endpoint) { Sint32 xx0, yy0, xx1, yy1; int result; Uint32 intshift, erracc, erradj; Uint32 erracctmp, wgt, wgtcompmask; int dx, dy, tmp, xdir, y0p1, x0pxdir; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Clip line and test if we have to draw */ if (!(_clipLine(dst, &x1, &y1, &x2, &y2))) { return (0); } /* * Keep on working with 32bit numbers */ xx0 = x1; yy0 = y1; xx1 = x2; yy1 = y2; /* * Reorder points if required */ if (yy0 > yy1) { tmp = yy0; yy0 = yy1; yy1 = tmp; tmp = xx0; xx0 = xx1; xx1 = tmp; } /* * Calculate distance */ dx = xx1 - xx0; dy = yy1 - yy0; /* * Check for special cases */ if (dx == 0) { /* * Vertical line */ if (draw_endpoint) { return (vlineColor(dst, x1, y1, y2, color)); } else { if (dy>0) { return (vlineColor(dst, x1, yy0, yy0+dy, color)); } else { return (pixelColor(dst, x1, y1, color)); } } } else if (dy == 0) { /* * Horizontal line */ if (draw_endpoint) { return (hlineColor(dst, x1, x2, y1, color)); } else { if (dx>0) { return (hlineColor(dst, xx0, xx0+dx, y1, color)); } else { return (pixelColor(dst, x1, y1, color)); } } } else if ((dx == dy) && (draw_endpoint)) { /* * Diagonal line (with endpoint) */ return (lineColor(dst, x1, y1, x2, y2, color)); } /* * Adjust for negative dx and set xdir */ if (dx >= 0) { xdir = 1; } else { xdir = -1; dx = (-dx); } /* * Line is not horizontal, vertical or diagonal (with endpoint) */ result = 0; /* * Zero accumulator */ erracc = 0; /* * # of bits by which to shift erracc to get intensity level */ intshift = 32 - AAbits; /* * Mask used to flip all bits in an intensity weighting */ wgtcompmask = AAlevels - 1; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Draw the initial pixel in the foreground color */ result |= pixelColorNolock(dst, x1, y1, color); /* * x-major or y-major? */ if (dy > dx) { /* * y-major. Calculate 16-bit fixed point fractional part of a pixel that * X advances every time Y advances 1 pixel, truncating the result so that * we won't overrun the endpoint along the X axis */ /* * Not-so-portable version: erradj = ((Uint64)dx << 32) / (Uint64)dy; */ erradj = ((dx << 16) / dy) << 16; /* * draw all pixels other than the first and last */ x0pxdir = xx0 + xdir; while (--dy) { erracctmp = erracc; erracc += erradj; if (erracc <= erracctmp) { /* * rollover in error accumulator, x coord advances */ xx0 = x0pxdir; x0pxdir += xdir; } yy0++; /* y-major so always advance Y */ /* * the AAbits most significant bits of erracc give us the intensity * weighting for this pixel, and the complement of the weighting for * the paired pixel. */ wgt = (erracc >> intshift) & 255; result |= pixelColorWeightNolock (dst, xx0, yy0, color, 255 - wgt); result |= pixelColorWeightNolock (dst, x0pxdir, yy0, color, wgt); } } else { /* * x-major line. Calculate 16-bit fixed-point fractional part of a pixel * that Y advances each time X advances 1 pixel, truncating the result so * that we won't overrun the endpoint along the X axis. */ /* * Not-so-portable version: erradj = ((Uint64)dy << 32) / (Uint64)dx; */ erradj = ((dy << 16) / dx) << 16; /* * draw all pixels other than the first and last */ y0p1 = yy0 + 1; while (--dx) { erracctmp = erracc; erracc += erradj; if (erracc <= erracctmp) { /* * Accumulator turned over, advance y */ yy0 = y0p1; y0p1++; } xx0 += xdir; /* x-major so always advance X */ /* * the AAbits most significant bits of erracc give us the intensity * weighting for this pixel, and the complement of the weighting for * the paired pixel. */ wgt = (erracc >> intshift) & 255; result |= pixelColorWeightNolock (dst, xx0, yy0, color, 255 - wgt); result |= pixelColorWeightNolock (dst, xx0, y0p1, color, wgt); } } /* * Do we have to draw the endpoint */ if (draw_endpoint) { /* * Draw final pixel, always exactly intersected by the line and doesn't * need to be weighted. */ result |= pixelColorNolock (dst, x2, y2, color); } /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Ddraw anti-aliased line with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the aa-line. \param y1 Y coordinate of the first point of the aa-line. \param x2 X coordinate of the second point of the aa-line. \param y2 Y coordinate of the second point of the aa-line. \param color The color value of the aa-line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int aalineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { return (_aalineColor(dst, x1, y1, x2, y2, color, 1)); } /*! \brief Draw anti-aliased line with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the aa-line. \param y1 Y coordinate of the first point of the aa-line. \param x2 X coordinate of the second point of the aa-line. \param y2 Y coordinate of the second point of the aa-line. \param r The red value of the aa-line to draw. \param g The green value of the aa-line to draw. \param b The blue value of the aa-line to draw. \param a The alpha value of the aa-line to draw. \returns Returns 0 on success, -1 on failure. */ int aalineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { return (_aalineColor (dst, x1, y1, x2, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a, 1)); } /* ----- Circle */ /*! \brief Draw circle with blending. Note: Circle drawing routine is based on an algorithms from the sge library, but modified by A. Schiffler for multiple pixel-draw removal and other minor speedup changes. \param dst The surface to draw on. \param x X coordinate of the center of the circle. \param y Y coordinate of the center of the circle. \param rad Radius in pixels of the circle. \param color The color value of the circle to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int circleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; Sint16 cx = 0; Sint16 cy = rad; Sint16 df = 1 - rad; Sint16 d_e = 3; Sint16 d_se = -2 * rad + 5; Sint16 xpcx, xmcx, xpcy, xmcy; Sint16 ypcy, ymcy, ypcx, ymcx; Uint8 *colorptr; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radius */ if (rad < 0) { return (-1); } /* * Special case for rad=0 - draw a point */ if (rad == 0) { return (pixelColor(dst, x, y, color)); } /* * Get circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rad; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + rad; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* * Draw circle */ result = 0; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Alpha Check */ if ((color & 255) == 255) { /* * No Alpha - direct memory writes */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Draw */ do { ypcy = y + cy; ymcy = y - cy; if (cx > 0) { xpcx = x + cx; xmcx = x - cx; result |= fastPixelColorNolock(dst, xmcx, ypcy, color); result |= fastPixelColorNolock(dst, xpcx, ypcy, color); result |= fastPixelColorNolock(dst, xmcx, ymcy, color); result |= fastPixelColorNolock(dst, xpcx, ymcy, color); } else { result |= fastPixelColorNolock(dst, x, ymcy, color); result |= fastPixelColorNolock(dst, x, ypcy, color); } xpcy = x + cy; xmcy = x - cy; if ((cx > 0) && (cx != cy)) { ypcx = y + cx; ymcx = y - cx; result |= fastPixelColorNolock(dst, xmcy, ypcx, color); result |= fastPixelColorNolock(dst, xpcy, ypcx, color); result |= fastPixelColorNolock(dst, xmcy, ymcx, color); result |= fastPixelColorNolock(dst, xpcy, ymcx, color); } else if (cx == 0) { result |= fastPixelColorNolock(dst, xmcy, y, color); result |= fastPixelColorNolock(dst, xpcy, y, color); } /* * Update */ if (df < 0) { df += d_e; d_e += 2; d_se += 2; } else { df += d_se; d_e += 2; d_se += 4; cy--; } cx++; } while (cx <= cy); /* * Unlock surface */ SDL_UnlockSurface(dst); } else { /* * Using Alpha - blended pixel blits */ do { /* * Draw */ ypcy = y + cy; ymcy = y - cy; if (cx > 0) { xpcx = x + cx; xmcx = x - cx; result |= pixelColorNolock (dst, xmcx, ypcy, color); result |= pixelColorNolock (dst, xpcx, ypcy, color); result |= pixelColorNolock (dst, xmcx, ymcy, color); result |= pixelColorNolock (dst, xpcx, ymcy, color); } else { result |= pixelColorNolock (dst, x, ymcy, color); result |= pixelColorNolock (dst, x, ypcy, color); } xpcy = x + cy; xmcy = x - cy; if ((cx > 0) && (cx != cy)) { ypcx = y + cx; ymcx = y - cx; result |= pixelColorNolock (dst, xmcy, ypcx, color); result |= pixelColorNolock (dst, xpcy, ypcx, color); result |= pixelColorNolock (dst, xmcy, ymcx, color); result |= pixelColorNolock (dst, xpcy, ymcx, color); } else if (cx == 0) { result |= pixelColorNolock (dst, xmcy, y, color); result |= pixelColorNolock (dst, xpcy, y, color); } /* * Update */ if (df < 0) { df += d_e; d_e += 2; d_se += 2; } else { df += d_se; d_e += 2; d_se += 4; cy--; } cx++; } while (cx <= cy); } /* Alpha check */ /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Draw circle with blending. \param dst The surface to draw on. \param x X coordinate of the center of the circle. \param y Y coordinate of the center of the circle. \param rad Radius in pixels of the circle. \param r The red value of the circle to draw. \param g The green value of the circle to draw. \param b The blue value of the circle to draw. \param a The alpha value of the circle to draw. \returns Returns 0 on success, -1 on failure. */ int circleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (circleColor(dst, x, y, rad, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- Arc */ /*! \brief Arc with blending. Note Arc drawing is based on circle algorithm by A. Schiffler and written by D. Raber. Calculates which octants arc goes through and renders pixels accordingly. \param dst The surface to draw on. \param x X coordinate of the center of the arc. \param y Y coordinate of the center of the arc. \param rad Radius in pixels of the arc. \param start Starting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise. \param end Ending radius in degrees of the arc. 0 degrees is down, increasing counterclockwise. \param color The color value of the arc to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int arcColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; Sint16 cx = 0; Sint16 cy = rad; Sint16 df = 1 - rad; Sint16 d_e = 3; Sint16 d_se = -2 * rad + 5; Sint16 xpcx, xmcx, xpcy, xmcy; Sint16 ypcy, ymcy, ypcx, ymcx; Uint8 *colorptr; Uint8 drawoct; int startoct, endoct, oct, stopval_start = 0, stopval_end = 0; double dstart, dend, temp = 0.; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radius */ if (rad < 0) { return (-1); } /* * Special case for rad=0 - draw a point */ if (rad == 0) { return (pixelColor(dst, x, y, color)); } /* * Get arc's circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rad; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + rad; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } // Octant labelling // // \ 5 | 6 / // \ | / // 4 \ | / 7 // \|/ //------+------ +x // /|\ // 3 / | \ 0 // / | \ // / 2 | 1 \ // +y // Initially reset bitmask to 0x00000000 // the set whether or not to keep drawing a given octant. // For example: 0x00111100 means we're drawing in octants 2-5 drawoct = 0; /* * Fixup angles */ start %= 360; end %= 360; // 0 <= start & end < 360; note that sometimes start > end - if so, arc goes back through 0. while (start < 0) start += 360; while (end < 0) end += 360; start %= 360; end %= 360; // now, we find which octants we're drawing in. startoct = start / 45; endoct = end / 45; oct = startoct - 1; // we increment as first step in loop // stopval_start, stopval_end; // what values of cx to stop at. do { oct = (oct + 1) % 8; if (oct == startoct) { // need to compute stopval_start for this octant. Look at picture above if this is unclear dstart = (double)start; switch (oct) { case 0: case 3: temp = sin(dstart * M_PI / 180.); break; case 1: case 6: temp = cos(dstart * M_PI / 180.); break; case 2: case 5: temp = -cos(dstart * M_PI / 180.); break; case 4: case 7: temp = -sin(dstart * M_PI / 180.); break; } temp *= rad; stopval_start = (int)temp; // always round down. // This isn't arbitrary, but requires graph paper to explain well. // The basic idea is that we're always changing drawoct after we draw, so we // stop immediately after we render the last sensible pixel at x = ((int)temp). // and whether to draw in this octant initially if (oct % 2) drawoct |= (1 << oct); // this is basically like saying drawoct[oct] = true, if drawoct were a bool array else drawoct &= 255 - (1 << oct); // this is basically like saying drawoct[oct] = false } if (oct == endoct) { // need to compute stopval_end for this octant dend = (double)end; switch (oct) { case 0: case 3: temp = sin(dend * M_PI / 180); break; case 1: case 6: temp = cos(dend * M_PI / 180); break; case 2: case 5: temp = -cos(dend * M_PI / 180); break; case 4: case 7: temp = -sin(dend * M_PI / 180); break; } temp *= rad; stopval_end = (int)temp; // and whether to draw in this octant initially if (startoct == endoct) { // note: we start drawing, stop, then start again in this case // otherwise: we only draw in this octant, so initialize it to false, it will get set back to true if (start > end) { // unfortunately, if we're in the same octant and need to draw over the whole circle, // we need to set the rest to true, because the while loop will end at the bottom. drawoct = 255; } else { drawoct &= 255 - (1 << oct); } } else if (oct % 2) drawoct &= 255 - (1 << oct); else drawoct |= (1 << oct); } else if (oct != startoct) { // already verified that it's != endoct drawoct |= (1 << oct); // draw this entire segment } } while (oct != endoct); // so now we have what octants to draw and when to draw them. all that's left is the actual raster code. /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Draw arc */ result = 0; /* * Alpha Check */ if ((color & 255) == 255) { /* * No Alpha - direct memory writes */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Draw */ do { ypcy = y + cy; ymcy = y - cy; if (cx > 0) { xpcx = x + cx; xmcx = x - cx; // always check if we're drawing a certain octant before adding a pixel to that octant. if (drawoct & 4) result |= fastPixelColorNolock(dst, xmcx, ypcy, color); // drawoct & 4 = 22; drawoct[2] if (drawoct & 2) result |= fastPixelColorNolock(dst, xpcx, ypcy, color); if (drawoct & 32) result |= fastPixelColorNolock(dst, xmcx, ymcy, color); if (drawoct & 64) result |= fastPixelColorNolock(dst, xpcx, ymcy, color); } else { if (drawoct & 6) result |= fastPixelColorNolock(dst, x, ypcy, color); // 4 + 2; drawoct[2] || drawoct[1] if (drawoct & 96) result |= fastPixelColorNolock(dst, x, ymcy, color); // 32 + 64 } xpcy = x + cy; xmcy = x - cy; if (cx > 0 && cx != cy) { ypcx = y + cx; ymcx = y - cx; if (drawoct & 8) result |= fastPixelColorNolock(dst, xmcy, ypcx, color); if (drawoct & 1) result |= fastPixelColorNolock(dst, xpcy, ypcx, color); if (drawoct & 16) result |= fastPixelColorNolock(dst, xmcy, ymcx, color); if (drawoct & 128) result |= fastPixelColorNolock(dst, xpcy, ymcx, color); } else if (cx == 0) { if (drawoct & 24) result |= fastPixelColorNolock(dst, xmcy, y, color); // 8 + 16 if (drawoct & 129) result |= fastPixelColorNolock(dst, xpcy, y, color); // 1 + 128 } /* * Update whether we're drawing an octant */ if (stopval_start == cx) { // works like an on-off switch because start & end may be in the same octant. if (drawoct & (1 << startoct)) drawoct &= 255 - (1 << startoct); else drawoct |= (1 << startoct); } if (stopval_end == cx) { if (drawoct & (1 << endoct)) drawoct &= 255 - (1 << endoct); else drawoct |= (1 << endoct); } /* * Update pixels */ if (df < 0) { df += d_e; d_e += 2; d_se += 2; } else { df += d_se; d_e += 2; d_se += 4; cy--; } cx++; } while (cx <= cy); /* * Unlock surface */ SDL_UnlockSurface(dst); } else { /* * Using Alpha - blended pixel blits */ do { ypcy = y + cy; ymcy = y - cy; if (cx > 0) { xpcx = x + cx; xmcx = x - cx; // always check if we're drawing a certain octant before adding a pixel to that octant. if (drawoct & 4) result |= pixelColorNolock(dst, xmcx, ypcy, color); if (drawoct & 2) result |= pixelColorNolock(dst, xpcx, ypcy, color); if (drawoct & 32) result |= pixelColorNolock(dst, xmcx, ymcy, color); if (drawoct & 64) result |= pixelColorNolock(dst, xpcx, ymcy, color); } else { if (drawoct & 96) result |= pixelColorNolock(dst, x, ymcy, color); if (drawoct & 6) result |= pixelColorNolock(dst, x, ypcy, color); } xpcy = x + cy; xmcy = x - cy; if (cx > 0 && cx != cy) { ypcx = y + cx; ymcx = y - cx; if (drawoct & 8) result |= pixelColorNolock(dst, xmcy, ypcx, color); if (drawoct & 1) result |= pixelColorNolock(dst, xpcy, ypcx, color); if (drawoct & 16) result |= pixelColorNolock(dst, xmcy, ymcx, color); if (drawoct & 128) result |= pixelColorNolock(dst, xpcy, ymcx, color); } else if (cx == 0) { if (drawoct & 24) result |= pixelColorNolock(dst, xmcy, y, color); if (drawoct & 129) result |= pixelColorNolock(dst, xpcy, y, color); } /* * Update whether we're drawing an octant */ if (stopval_start == cx) { // works like an on-off switch. // This is just in case start & end are in the same octant. if (drawoct & (1 << startoct)) drawoct &= 255 - (1 << startoct); else drawoct |= (1 << startoct); } if (stopval_end == cx) { if (drawoct & (1 << endoct)) drawoct &= 255 - (1 << endoct); else drawoct |= (1 << endoct); } /* * Update pixels */ if (df < 0) { df += d_e; d_e += 2; d_se += 2; } else { df += d_se; d_e += 2; d_se += 4; cy--; } cx++; } while (cx <= cy); } /* Alpha check */ /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Arc with blending. \param dst The surface to draw on. \param x X coordinate of the center of the arc. \param y Y coordinate of the center of the arc. \param rad Radius in pixels of the arc. \param start Starting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise. \param end Ending radius in degrees of the arc. 0 degrees is down, increasing counterclockwise. \param r The red value of the arc to draw. \param g The green value of the arc to draw. \param b The blue value of the arc to draw. \param a The alpha value of the arc to draw. \returns Returns 0 on success, -1 on failure. */ int arcRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (arcColor(dst, x, y, rad, start, end, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- AA Circle */ /*! \brief Draw anti-aliased circle with blending. Note: The AA-circle routine is based on AA-ellipse with identical radii. \param dst The surface to draw on. \param x X coordinate of the center of the aa-circle. \param y Y coordinate of the center of the aa-circle. \param rad Radius in pixels of the aa-circle. \param color The color value of the aa-circle to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int aacircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color) { return (aaellipseColor(dst, x, y, rad, rad, color)); } /*! \brief Draw anti-aliased circle with blending. \param dst The surface to draw on. \param x X coordinate of the center of the aa-circle. \param y Y coordinate of the center of the aa-circle. \param rad Radius in pixels of the aa-circle. \param r The red value of the aa-circle to draw. \param g The green value of the aa-circle to draw. \param b The blue value of the aa-circle to draw. \param a The alpha value of the aa-circle to draw. \returns Returns 0 on success, -1 on failure. */ int aacircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (aaellipseColor (dst, x, y, rad, rad, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- Filled Circle */ /*! \brief Draw filled circle with blending. Note: Based on algorithms from sge library with modifications by A. Schiffler for multiple-hline draw removal and other minor speedup changes. \param dst The surface to draw on. \param x X coordinate of the center of the filled circle. \param y Y coordinate of the center of the filled circle. \param rad Radius in pixels of the filled circle. \param color The color value of the filled circle to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int filledCircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; Sint16 cx = 0; Sint16 cy = rad; Sint16 ocx = (Sint16) 0xffff; Sint16 ocy = (Sint16) 0xffff; Sint16 df = 1 - rad; Sint16 d_e = 3; Sint16 d_se = -2 * rad + 5; Sint16 xpcx, xmcx, xpcy, xmcy; Sint16 ypcy, ymcy, ypcx, ymcx; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radius */ if (rad < 0) { return (-1); } /* * Special case for rad=0 - draw a point */ if (rad == 0) { return (pixelColor(dst, x, y, color)); } /* * Get circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rad; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + rad; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* * Draw */ result = 0; do { xpcx = x + cx; xmcx = x - cx; xpcy = x + cy; xmcy = x - cy; if (ocy != cy) { if (cy > 0) { ypcy = y + cy; ymcy = y - cy; result |= hlineColor(dst, xmcx, xpcx, ypcy, color); result |= hlineColor(dst, xmcx, xpcx, ymcy, color); } else { result |= hlineColor(dst, xmcx, xpcx, y, color); } ocy = cy; } if (ocx != cx) { if (cx != cy) { if (cx > 0) { ypcx = y + cx; ymcx = y - cx; result |= hlineColor(dst, xmcy, xpcy, ymcx, color); result |= hlineColor(dst, xmcy, xpcy, ypcx, color); } else { result |= hlineColor(dst, xmcy, xpcy, y, color); } } ocx = cx; } /* * Update */ if (df < 0) { df += d_e; d_e += 2; d_se += 2; } else { df += d_se; d_e += 2; d_se += 4; cy--; } cx++; } while (cx <= cy); return (result); } /*! \brief Draw filled circle with blending. \param dst The surface to draw on. \param x X coordinate of the center of the filled circle. \param y Y coordinate of the center of the filled circle. \param rad Radius in pixels of the filled circle. \param r The red value of the filled circle to draw. \param g The green value of the filled circle to draw. \param b The blue value of the filled circle to draw. \param a The alpha value of the filled circle to draw. \returns Returns 0 on success, -1 on failure. */ int filledCircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (filledCircleColor (dst, x, y, rad, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- Ellipse */ /*! \brief Draw ellipse with blending. Note: Based on algorithms from sge library with modifications by A. Schiffler for multiple-pixel draw removal and other minor speedup changes. \param dst The surface to draw on. \param x X coordinate of the center of the ellipse. \param y Y coordinate of the center of the ellipse. \param rx Horizontal radius in pixels of the ellipse. \param ry Vertical radius in pixels of the ellipse. \param color The color value of the ellipse to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int ellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; int ix, iy; int h, i, j, k; int oh, oi, oj, ok; int xmh, xph, ypk, ymk; int xmi, xpi, ymj, ypj; int xmj, xpj, ymi, ypi; int xmk, xpk, ymh, yph; Uint8 *colorptr; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radii */ if ((rx < 0) || (ry < 0)) { return (-1); } /* * Special case for rx=0 - draw a vline */ if (rx == 0) { return (vlineColor(dst, x, y - ry, y + ry, color)); } /* * Special case for ry=0 - draw a hline */ if (ry == 0) { return (hlineColor(dst, x - rx, x + rx, y, color)); } /* * Get circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rx; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + ry; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* * Init vars */ oh = oi = oj = ok = 0xFFFF; /* * Draw */ result = 0; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Check alpha */ if ((color & 255) == 255) { /* * No Alpha - direct memory writes */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } if (rx > ry) { ix = 0; iy = rx * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * ry) / rx; k = (i * ry) / rx; if (((ok != k) && (oj != k)) || ((oj != j) && (ok != j)) || (k != j)) { xph = x + h; xmh = x - h; if (k > 0) { ypk = y + k; ymk = y - k; result |= fastPixelColorNolock(dst, xmh, ypk, color); result |= fastPixelColorNolock(dst, xph, ypk, color); result |= fastPixelColorNolock(dst, xmh, ymk, color); result |= fastPixelColorNolock(dst, xph, ymk, color); } else { result |= fastPixelColorNolock(dst, xmh, y, color); result |= fastPixelColorNolock(dst, xph, y, color); } ok = k; xpi = x + i; xmi = x - i; if (j > 0) { ypj = y + j; ymj = y - j; result |= fastPixelColorNolock(dst, xmi, ypj, color); result |= fastPixelColorNolock(dst, xpi, ypj, color); result |= fastPixelColorNolock(dst, xmi, ymj, color); result |= fastPixelColorNolock(dst, xpi, ymj, color); } else { result |= fastPixelColorNolock(dst, xmi, y, color); result |= fastPixelColorNolock(dst, xpi, y, color); } oj = j; } ix = ix + iy / rx; iy = iy - ix / rx; } while (i > h); } else { ix = 0; iy = ry * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * rx) / ry; k = (i * rx) / ry; if (((oi != i) && (oh != i)) || ((oh != h) && (oi != h) && (i != h))) { xmj = x - j; xpj = x + j; if (i > 0) { ypi = y + i; ymi = y - i; result |= fastPixelColorNolock(dst, xmj, ypi, color); result |= fastPixelColorNolock(dst, xpj, ypi, color); result |= fastPixelColorNolock(dst, xmj, ymi, color); result |= fastPixelColorNolock(dst, xpj, ymi, color); } else { result |= fastPixelColorNolock(dst, xmj, y, color); result |= fastPixelColorNolock(dst, xpj, y, color); } oi = i; xmk = x - k; xpk = x + k; if (h > 0) { yph = y + h; ymh = y - h; result |= fastPixelColorNolock(dst, xmk, yph, color); result |= fastPixelColorNolock(dst, xpk, yph, color); result |= fastPixelColorNolock(dst, xmk, ymh, color); result |= fastPixelColorNolock(dst, xpk, ymh, color); } else { result |= fastPixelColorNolock(dst, xmk, y, color); result |= fastPixelColorNolock(dst, xpk, y, color); } oh = h; } ix = ix + iy / ry; iy = iy - ix / ry; } while (i > h); } } else { if (rx > ry) { ix = 0; iy = rx * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * ry) / rx; k = (i * ry) / rx; if (((ok != k) && (oj != k)) || ((oj != j) && (ok != j)) || (k != j)) { xph = x + h; xmh = x - h; if (k > 0) { ypk = y + k; ymk = y - k; result |= pixelColorNolock (dst, xmh, ypk, color); result |= pixelColorNolock (dst, xph, ypk, color); result |= pixelColorNolock (dst, xmh, ymk, color); result |= pixelColorNolock (dst, xph, ymk, color); } else { result |= pixelColorNolock (dst, xmh, y, color); result |= pixelColorNolock (dst, xph, y, color); } ok = k; xpi = x + i; xmi = x - i; if (j > 0) { ypj = y + j; ymj = y - j; result |= pixelColorNolock (dst, xmi, ypj, color); result |= pixelColorNolock (dst, xpi, ypj, color); result |= pixelColorNolock (dst, xmi, ymj, color); result |= pixelColor(dst, xpi, ymj, color); } else { result |= pixelColorNolock (dst, xmi, y, color); result |= pixelColorNolock (dst, xpi, y, color); } oj = j; } ix = ix + iy / rx; iy = iy - ix / rx; } while (i > h); } else { ix = 0; iy = ry * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * rx) / ry; k = (i * rx) / ry; if (((oi != i) && (oh != i)) || ((oh != h) && (oi != h) && (i != h))) { xmj = x - j; xpj = x + j; if (i > 0) { ypi = y + i; ymi = y - i; result |= pixelColorNolock (dst, xmj, ypi, color); result |= pixelColorNolock (dst, xpj, ypi, color); result |= pixelColorNolock (dst, xmj, ymi, color); result |= pixelColorNolock (dst, xpj, ymi, color); } else { result |= pixelColorNolock (dst, xmj, y, color); result |= pixelColorNolock (dst, xpj, y, color); } oi = i; xmk = x - k; xpk = x + k; if (h > 0) { yph = y + h; ymh = y - h; result |= pixelColorNolock (dst, xmk, yph, color); result |= pixelColorNolock (dst, xpk, yph, color); result |= pixelColorNolock (dst, xmk, ymh, color); result |= pixelColorNolock (dst, xpk, ymh, color); } else { result |= pixelColorNolock (dst, xmk, y, color); result |= pixelColorNolock (dst, xpk, y, color); } oh = h; } ix = ix + iy / ry; iy = iy - ix / ry; } while (i > h); } } /* Alpha check */ /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Draw ellipse with blending. \param dst The surface to draw on. \param x X coordinate of the center of the ellipse. \param y Y coordinate of the center of the ellipse. \param rx Horizontal radius in pixels of the ellipse. \param ry Vertical radius in pixels of the ellipse. \param r The red value of the ellipse to draw. \param g The green value of the ellipse to draw. \param b The blue value of the ellipse to draw. \param a The alpha value of the ellipse to draw. \returns Returns 0 on success, -1 on failure. */ int ellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (ellipseColor(dst, x, y, rx, ry, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- AA Ellipse */ /* Windows targets do not have lrint, so provide a local inline version */ #if defined(_MSC_VER) /* Detect 64bit and use intrinsic version */ #ifdef _M_X64 #include static __inline long lrint(float f) { return _mm_cvtss_si32(_mm_load_ss(&f)); } #elif defined(_M_IX86) __inline long int lrint (double flt) { int intgr; _asm { fld flt fistp intgr }; return intgr; } #elif defined(_M_ARM) #include #pragma warning(push) #pragma warning(disable: 4716) __declspec(naked) long int lrint (double flt) { __emit(0xEC410B10); // fmdrr d0, r0, r1 __emit(0xEEBD0B40); // ftosid s0, d0 __emit(0xEE100A10); // fmrs r0, s0 __emit(0xE12FFF1E); // bx lr } #pragma warning(pop) #else #error lrint needed for MSVC on non X86/AMD64/ARM targets. #endif #endif /*! \brief Draw anti-aliased ellipse with blending. Note: Based on code from Anders Lindstroem, which is based on code from sge library, which is based on code from TwinLib. \param dst The surface to draw on. \param x X coordinate of the center of the aa-ellipse. \param y Y coordinate of the center of the aa-ellipse. \param rx Horizontal radius in pixels of the aa-ellipse. \param ry Vertical radius in pixels of the aa-ellipse. \param color The color value of the aa-ellipse to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int aaellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) { Sint16 left, right, top, bottom; Sint16 x1,y1,x2,y2; int i; int a2, b2, ds, dt, dxt, t, s, d; Sint16 xp, yp, xs, ys, dyt, od, xx, yy, xc2, yc2; float cp; double sab; Uint8 weight, iweight; int result; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radii */ if ((rx < 0) || (ry < 0)) { return (-1); } /* * Special case for rx=0 - draw a vline */ if (rx == 0) { return (vlineColor(dst, x, y - ry, y + ry, color)); } /* * Special case for ry=0 - draw an hline */ if (ry == 0) { return (hlineColor(dst, x - rx, x + rx, y, color)); } /* * Get circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rx; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + ry; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* Variable setup */ a2 = rx * rx; b2 = ry * ry; ds = 2 * a2; dt = 2 * b2; xc2 = 2 * x; yc2 = 2 * y; sab = sqrt((double)(a2 + b2)); od = (Sint16)lrint(sab*0.01) + 1; /* introduce some overdraw */ dxt = (Sint16)lrint((double)a2 / sab) + od; t = 0; s = -2 * a2 * ry; d = 0; xp = x; yp = y - ry; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* Draw */ result = 0; /* "End points" */ result |= pixelColorNolock(dst, xp, yp, color); result |= pixelColorNolock(dst, xc2 - xp, yp, color); result |= pixelColorNolock(dst, xp, yc2 - yp, color); result |= pixelColorNolock(dst, xc2 - xp, yc2 - yp, color); for (i = 1; i <= dxt; i++) { xp--; d += t - b2; if (d >= 0) ys = yp - 1; else if ((d - s - a2) > 0) { if ((2 * d - s - a2) >= 0) ys = yp + 1; else { ys = yp; yp++; d -= s + a2; s += ds; } } else { yp++; ys = yp + 1; d -= s + a2; s += ds; } t -= dt; /* Calculate alpha */ if (s != 0) { cp = (float) abs(d) / (float) abs(s); if (cp > 1.0) { cp = 1.0; } } else { cp = 1.0; } /* Calculate weights */ weight = (Uint8) (cp * 255); iweight = 255 - weight; /* Upper half */ xx = xc2 - xp; result |= pixelColorWeightNolock(dst, xp, yp, color, iweight); result |= pixelColorWeightNolock(dst, xx, yp, color, iweight); result |= pixelColorWeightNolock(dst, xp, ys, color, weight); result |= pixelColorWeightNolock(dst, xx, ys, color, weight); /* Lower half */ yy = yc2 - yp; result |= pixelColorWeightNolock(dst, xp, yy, color, iweight); result |= pixelColorWeightNolock(dst, xx, yy, color, iweight); yy = yc2 - ys; result |= pixelColorWeightNolock(dst, xp, yy, color, weight); result |= pixelColorWeightNolock(dst, xx, yy, color, weight); } /* Replaces original approximation code dyt = abs(yp - yc); */ dyt = (Sint16)lrint((double)b2 / sab ) + od; for (i = 1; i <= dyt; i++) { yp++; d -= s + a2; if (d <= 0) xs = xp + 1; else if ((d + t - b2) < 0) { if ((2 * d + t - b2) <= 0) xs = xp - 1; else { xs = xp; xp--; d += t - b2; t -= dt; } } else { xp--; xs = xp - 1; d += t - b2; t -= dt; } s += ds; /* Calculate alpha */ if (t != 0) { cp = (float) abs(d) / (float) abs(t); if (cp > 1.0) { cp = 1.0; } } else { cp = 1.0; } /* Calculate weight */ weight = (Uint8) (cp * 255); iweight = 255 - weight; /* Left half */ xx = xc2 - xp; yy = yc2 - yp; result |= pixelColorWeightNolock(dst, xp, yp, color, iweight); result |= pixelColorWeightNolock(dst, xx, yp, color, iweight); result |= pixelColorWeightNolock(dst, xp, yy, color, iweight); result |= pixelColorWeightNolock(dst, xx, yy, color, iweight); /* Right half */ xx = xc2 - xs; result |= pixelColorWeightNolock(dst, xs, yp, color, weight); result |= pixelColorWeightNolock(dst, xx, yp, color, weight); result |= pixelColorWeightNolock(dst, xs, yy, color, weight); result |= pixelColorWeightNolock(dst, xx, yy, color, weight); } /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Draw anti-aliased ellipse with blending. \param dst The surface to draw on. \param x X coordinate of the center of the aa-ellipse. \param y Y coordinate of the center of the aa-ellipse. \param rx Horizontal radius in pixels of the aa-ellipse. \param ry Vertical radius in pixels of the aa-ellipse. \param r The red value of the aa-ellipse to draw. \param g The green value of the aa-ellipse to draw. \param b The blue value of the aa-ellipse to draw. \param a The alpha value of the aa-ellipse to draw. \returns Returns 0 on success, -1 on failure. */ int aaellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (aaellipseColor (dst, x, y, rx, ry, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ---- Filled Ellipse */ /* Note: */ /* Based on algorithm from sge library with multiple-hline draw removal */ /* and other speedup changes. */ /*! \brief Draw filled ellipse with blending. Note: Based on algorithm from sge library with multiple-hline draw removal and other speedup changes. \param dst The surface to draw on. \param x X coordinate of the center of the filled ellipse. \param y Y coordinate of the center of the filled ellipse. \param rx Horizontal radius in pixels of the filled ellipse. \param ry Vertical radius in pixels of the filled ellipse. \param color The color value of the filled ellipse to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int filledEllipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; int ix, iy; int h, i, j, k; int oh, oi, oj, ok; int xmh, xph; int xmi, xpi; int xmj, xpj; int xmk, xpk; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radii */ if ((rx < 0) || (ry < 0)) { return (-1); } /* * Special case for rx=0 - draw a vline */ if (rx == 0) { return (vlineColor(dst, x, y - ry, y + ry, color)); } /* * Special case for ry=0 - draw a hline */ if (ry == 0) { return (hlineColor(dst, x - rx, x + rx, y, color)); } /* * Get circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rx; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + ry; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* * Init vars */ oh = oi = oj = ok = 0xFFFF; /* * Draw */ result = 0; if (rx > ry) { ix = 0; iy = rx * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * ry) / rx; k = (i * ry) / rx; if ((ok != k) && (oj != k)) { xph = x + h; xmh = x - h; if (k > 0) { result |= hlineColor(dst, xmh, xph, y + k, color); result |= hlineColor(dst, xmh, xph, y - k, color); } else { result |= hlineColor(dst, xmh, xph, y, color); } ok = k; } if ((oj != j) && (ok != j) && (k != j)) { xmi = x - i; xpi = x + i; if (j > 0) { result |= hlineColor(dst, xmi, xpi, y + j, color); result |= hlineColor(dst, xmi, xpi, y - j, color); } else { result |= hlineColor(dst, xmi, xpi, y, color); } oj = j; } ix = ix + iy / rx; iy = iy - ix / rx; } while (i > h); } else { ix = 0; iy = ry * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * rx) / ry; k = (i * rx) / ry; if ((oi != i) && (oh != i)) { xmj = x - j; xpj = x + j; if (i > 0) { result |= hlineColor(dst, xmj, xpj, y + i, color); result |= hlineColor(dst, xmj, xpj, y - i, color); } else { result |= hlineColor(dst, xmj, xpj, y, color); } oi = i; } if ((oh != h) && (oi != h) && (i != h)) { xmk = x - k; xpk = x + k; if (h > 0) { result |= hlineColor(dst, xmk, xpk, y + h, color); result |= hlineColor(dst, xmk, xpk, y - h, color); } else { result |= hlineColor(dst, xmk, xpk, y, color); } oh = h; } ix = ix + iy / ry; iy = iy - ix / ry; } while (i > h); } return (result); } /*! \brief Draw filled ellipse with blending. \param dst The surface to draw on. \param x X coordinate of the center of the filled ellipse. \param y Y coordinate of the center of the filled ellipse. \param rx Horizontal radius in pixels of the filled ellipse. \param ry Vertical radius in pixels of the filled ellipse. \param r The red value of the filled ellipse to draw. \param g The green value of the filled ellipse to draw. \param b The blue value of the filled ellipse to draw. \param a The alpha value of the filled ellipse to draw. \returns Returns 0 on success, -1 on failure. */ int filledEllipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (filledEllipseColor (dst, x, y, rx, ry, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- pie */ /*! \brief Internal float (low-speed) pie-calc implementation by drawing polygons. Note: Determines vertex array and uses polygon or filledPolygon drawing routines to render. \param dst The surface to draw on. \param x X coordinate of the center of the pie. \param y Y coordinate of the center of the pie. \param rad Radius in pixels of the pie. \param start Starting radius in degrees of the pie. \param end Ending radius in degrees of the pie. \param color The color value of the pie to draw (0xRRGGBBAA). \param filled Flag indicating if the pie should be filled (=1) or not (=0). \returns Returns 0 on success, -1 on failure. */ int _pieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color, Uint8 filled) { Sint16 left, right, top, bottom; Sint16 x1, y1, x2, y2; int result; double angle, start_angle, end_angle; double deltaAngle; double dr; int numpoints, i; Sint16 *vx, *vy; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radii */ if (rad < 0) { return (-1); } /* * Fixup angles */ start = start % 360; end = end % 360; /* * Special case for rad=0 - draw a point */ if (rad == 0) { return (pixelColor(dst, x, y, color)); } /* * Clip against circle, not pie (not 100% optimal). * Get pie's circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rad; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + rad; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* * Variable setup */ dr = (double) rad; deltaAngle = 3.0 / dr; start_angle = (double) start *(2.0 * M_PI / 360.0); end_angle = (double) end *(2.0 * M_PI / 360.0); if (start > end) { end_angle += (2.0 * M_PI); } /* We will always have at least 2 points */ numpoints = 2; /* Count points (rather than calculating it) */ angle = start_angle; while (angle < end_angle) { angle += deltaAngle; numpoints++; } /* Allocate combined vertex array */ vx = vy = (Sint16 *) malloc(2 * sizeof(Uint16) * numpoints); if (vx == NULL) { return (-1); } /* Update point to start of vy */ vy += numpoints; /* Center */ vx[0] = x; vy[0] = y; /* First vertex */ angle = start_angle; vx[1] = x + (int) (dr * cos(angle)); vy[1] = y + (int) (dr * sin(angle)); if (numpoints<3) { result = lineColor(dst, vx[0], vy[0], vx[1], vy[1], color); } else { /* Calculate other vertices */ i = 2; angle = start_angle; while (angle < end_angle) { angle += deltaAngle; if (angle>end_angle) { angle = end_angle; } vx[i] = x + (int) (dr * cos(angle)); vy[i] = y + (int) (dr * sin(angle)); i++; } /* Draw */ if (filled) { result = filledPolygonColor(dst, vx, vy, numpoints, color); } else { result = polygonColor(dst, vx, vy, numpoints, color); } } /* Free combined vertex array */ free(vx); return (result); } /*! \brief Draw pie (outline) with alpha blending. \param dst The surface to draw on. \param x X coordinate of the center of the pie. \param y Y coordinate of the center of the pie. \param rad Radius in pixels of the pie. \param start Starting radius in degrees of the pie. \param end Ending radius in degrees of the pie. \param color The color value of the pie to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int pieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color) { return (_pieColor(dst, x, y, rad, start, end, color, 0)); } /*! \brief Draw pie (outline) with alpha blending. \param dst The surface to draw on. \param x X coordinate of the center of the pie. \param y Y coordinate of the center of the pie. \param rad Radius in pixels of the pie. \param start Starting radius in degrees of the pie. \param end Ending radius in degrees of the pie. \param r The red value of the pie to draw. \param g The green value of the pie to draw. \param b The blue value of the pie to draw. \param a The alpha value of the pie to draw. \returns Returns 0 on success, -1 on failure. */ int pieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { return (_pieColor(dst, x, y, rad, start, end, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a, 0)); } /*! \brief Draw filled pie with alpha blending. \param dst The surface to draw on. \param x X coordinate of the center of the filled pie. \param y Y coordinate of the center of the filled pie. \param rad Radius in pixels of the filled pie. \param start Starting radius in degrees of the filled pie. \param end Ending radius in degrees of the filled pie. \param color The color value of the filled pie to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int filledPieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color) { return (_pieColor(dst, x, y, rad, start, end, color, 1)); } /*! \brief Draw filled pie with alpha blending. \param dst The surface to draw on. \param x X coordinate of the center of the filled pie. \param y Y coordinate of the center of the filled pie. \param rad Radius in pixels of the filled pie. \param start Starting radius in degrees of the filled pie. \param end Ending radius in degrees of the filled pie. \param r The red value of the filled pie to draw. \param g The green value of the filled pie to draw. \param b The blue value of the filled pie to draw. \param a The alpha value of the filled pie to draw. \returns Returns 0 on success, -1 on failure. */ int filledPieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { return (_pieColor(dst, x, y, rad, start, end, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a, 1)); } /* ------ Trigon */ /*! \brief Draw trigon (triangle outline) with alpha blending. Note: Creates vertex array and uses polygon routine to render. \param dst The surface to draw on. \param x1 X coordinate of the first point of the trigon. \param y1 Y coordinate of the first point of the trigon. \param x2 X coordinate of the second point of the trigon. \param y2 Y coordinate of the second point of the trigon. \param x3 X coordinate of the third point of the trigon. \param y3 Y coordinate of the third point of the trigon. \param color The color value of the trigon to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int trigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(polygonColor(dst,vx,vy,3,color)); } /*! \brief Draw trigon (triangle outline) with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the trigon. \param y1 Y coordinate of the first point of the trigon. \param x2 X coordinate of the second point of the trigon. \param y2 Y coordinate of the second point of the trigon. \param x3 X coordinate of the third point of the trigon. \param y3 Y coordinate of the third point of the trigon. \param r The red value of the trigon to draw. \param g The green value of the trigon to draw. \param b The blue value of the trigon to draw. \param a The alpha value of the trigon to draw. \returns Returns 0 on success, -1 on failure. */ int trigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(polygonRGBA(dst,vx,vy,3,r,g,b,a)); } /* ------ AA-Trigon */ /*! \brief Draw anti-aliased trigon (triangle outline) with alpha blending. Note: Creates vertex array and uses aapolygon routine to render. \param dst The surface to draw on. \param x1 X coordinate of the first point of the aa-trigon. \param y1 Y coordinate of the first point of the aa-trigon. \param x2 X coordinate of the second point of the aa-trigon. \param y2 Y coordinate of the second point of the aa-trigon. \param x3 X coordinate of the third point of the aa-trigon. \param y3 Y coordinate of the third point of the aa-trigon. \param color The color value of the aa-trigon to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int aatrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(aapolygonColor(dst,vx,vy,3,color)); } /*! \brief Draw anti-aliased trigon (triangle outline) with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the aa-trigon. \param y1 Y coordinate of the first point of the aa-trigon. \param x2 X coordinate of the second point of the aa-trigon. \param y2 Y coordinate of the second point of the aa-trigon. \param x3 X coordinate of the third point of the aa-trigon. \param y3 Y coordinate of the third point of the aa-trigon. \param r The red value of the aa-trigon to draw. \param g The green value of the aa-trigon to draw. \param b The blue value of the aa-trigon to draw. \param a The alpha value of the aa-trigon to draw. \returns Returns 0 on success, -1 on failure. */ int aatrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(aapolygonRGBA(dst,vx,vy,3,r,g,b,a)); } /* ------ Filled Trigon */ /*! \brief Draw filled trigon (triangle) with alpha blending. Note: Creates vertex array and uses aapolygon routine to render. \param dst The surface to draw on. \param x1 X coordinate of the first point of the filled trigon. \param y1 Y coordinate of the first point of the filled trigon. \param x2 X coordinate of the second point of the filled trigon. \param y2 Y coordinate of the second point of the filled trigon. \param x3 X coordinate of the third point of the filled trigon. \param y3 Y coordinate of the third point of the filled trigon. \param color The color value of the filled trigon to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int filledTrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(filledPolygonColor(dst,vx,vy,3,color)); } /*! \brief Draw filled trigon (triangle) with alpha blending. Note: Creates vertex array and uses aapolygon routine to render. \param dst The surface to draw on. \param x1 X coordinate of the first point of the filled trigon. \param y1 Y coordinate of the first point of the filled trigon. \param x2 X coordinate of the second point of the filled trigon. \param y2 Y coordinate of the second point of the filled trigon. \param x3 X coordinate of the third point of the filled trigon. \param y3 Y coordinate of the third point of the filled trigon. \param r The red value of the filled trigon to draw. \param g The green value of the filled trigon to draw. \param b The blue value of the filled trigon to draw. \param a The alpha value of the filled trigon to draw. \returns Returns 0 on success, -1 on failure. */ int filledTrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(filledPolygonRGBA(dst,vx,vy,3,r,g,b,a)); } /* ---- Polygon */ /*! \brief Draw polygon with alpha blending. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the polygon. \param vy Vertex array containing Y coordinates of the points of the polygon. \param n Number of points in the vertex array. Minimum number is 3. \param color The color value of the polygon to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int polygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color) { int result; int i; const Sint16 *x1, *y1, *x2, *y2; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Vertex array NULL check */ if (vx == NULL) { return (-1); } if (vy == NULL) { return (-1); } /* * Sanity check */ if (n < 3) { return (-1); } /* * Pointer setup */ x1 = x2 = vx; y1 = y2 = vy; x2++; y2++; /* * Draw */ result = 0; for (i = 1; i < n; i++) { result |= lineColor(dst, *x1, *y1, *x2, *y2, color); x1 = x2; y1 = y2; x2++; y2++; } result |= lineColor(dst, *x1, *y1, *vx, *vy, color); return (result); } /*! \brief Draw polygon with alpha blending. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the polygon. \param vy Vertex array containing Y coordinates of the points of the polygon. \param n Number of points in the vertex array. Minimum number is 3. \param r The red value of the polygon to draw. \param g The green value of the polygon to draw. \param b The blue value of the polygon to draw. \param a The alpha value of the polygon to draw. \returns Returns 0 on success, -1 on failure. */ int polygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (polygonColor(dst, vx, vy, n, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ---- AA-Polygon */ /*! \brief Draw anti-aliased polygon with alpha blending. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the aa-polygon. \param vy Vertex array containing Y coordinates of the points of the aa-polygon. \param n Number of points in the vertex array. Minimum number is 3. \param color The color value of the aa-polygon to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int aapolygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color) { int result; int i; const Sint16 *x1, *y1, *x2, *y2; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Vertex array NULL check */ if (vx == NULL) { return (-1); } if (vy == NULL) { return (-1); } /* * Sanity check */ if (n < 3) { return (-1); } /* * Pointer setup */ x1 = x2 = vx; y1 = y2 = vy; x2++; y2++; /* * Draw */ result = 0; for (i = 1; i < n; i++) { result |= _aalineColor(dst, *x1, *y1, *x2, *y2, color, 0); x1 = x2; y1 = y2; x2++; y2++; } result |= _aalineColor(dst, *x1, *y1, *vx, *vy, color, 0); return (result); } /*! \brief Draw anti-aliased polygon with alpha blending. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the aa-polygon. \param vy Vertex array containing Y coordinates of the points of the aa-polygon. \param n Number of points in the vertex array. Minimum number is 3. \param r The red value of the aa-polygon to draw. \param g The green value of the aa-polygon to draw. \param b The blue value of the aa-polygon to draw. \param a The alpha value of the aa-polygon to draw. \returns Returns 0 on success, -1 on failure. */ int aapolygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (aapolygonColor(dst, vx, vy, n, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ---- Filled Polygon */ /*! \brief Internal helper qsort callback functions used in filled polygon drawing. \param a The surface to draw on. \param b Vertex array containing X coordinates of the points of the polygon. \returns Returns 0 if a==b, a negative number if ab. */ int _gfxPrimitivesCompareInt(const void *a, const void *b) { return (*(const int *) a) - (*(const int *) b); } /*! \brief Global vertex array to use if optional parameters are not given in filledPolygonMT calls. Note: Used for non-multithreaded (default) operation of filledPolygonMT. */ static int *gfxPrimitivesPolyIntsGlobal = NULL; /*! \brief Flag indicating if global vertex array was already allocated. Note: Used for non-multithreaded (default) operation of filledPolygonMT. */ static int gfxPrimitivesPolyAllocatedGlobal = 0; /*! \brief Draw filled polygon with alpha blending (multi-threaded capable). Note: The last two parameters are optional; but are required for multithreaded operation. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the filled polygon. \param vy Vertex array containing Y coordinates of the points of the filled polygon. \param n Number of points in the vertex array. Minimum number is 3. \param color The color value of the filled polygon to draw (0xRRGGBBAA). \param polyInts Preallocated, temporary vertex array used for sorting vertices. Required for multithreaded operation; set to NULL otherwise. \param polyAllocated Flag indicating if temporary vertex array was allocated. Required for multithreaded operation; set to NULL otherwise. \returns Returns 0 on success, -1 on failure. */ int filledPolygonColorMT(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color, int **polyInts, int *polyAllocated) { int result; int i; int y, xa, xb; int miny, maxy; int x1, y1; int x2, y2; int ind1, ind2; int ints; int *gfxPrimitivesPolyInts = NULL; int *gfxPrimitivesPolyIntsNew = NULL; int gfxPrimitivesPolyAllocated = 0; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Vertex array NULL check */ if (vx == NULL) { return (-1); } if (vy == NULL) { return (-1); } /* * Sanity check number of edges */ if (n < 3) { return -1; } /* * Map polygon cache */ if ((polyInts==NULL) || (polyAllocated==NULL)) { /* Use global cache */ gfxPrimitivesPolyInts = gfxPrimitivesPolyIntsGlobal; gfxPrimitivesPolyAllocated = gfxPrimitivesPolyAllocatedGlobal; } else { /* Use local cache */ gfxPrimitivesPolyInts = *polyInts; gfxPrimitivesPolyAllocated = *polyAllocated; } /* * Allocate temp array, only grow array */ if (!gfxPrimitivesPolyAllocated) { gfxPrimitivesPolyInts = (int *) malloc(sizeof(int) * n); gfxPrimitivesPolyAllocated = n; } else { if (gfxPrimitivesPolyAllocated < n) { gfxPrimitivesPolyIntsNew = (int *) realloc(gfxPrimitivesPolyInts, sizeof(int) * n); if (!gfxPrimitivesPolyIntsNew) { if (!gfxPrimitivesPolyInts) { free(gfxPrimitivesPolyInts); gfxPrimitivesPolyInts = NULL; } gfxPrimitivesPolyAllocated = 0; } else { gfxPrimitivesPolyInts = gfxPrimitivesPolyIntsNew; gfxPrimitivesPolyAllocated = n; } } } /* * Check temp array */ if (gfxPrimitivesPolyInts==NULL) { gfxPrimitivesPolyAllocated = 0; } /* * Update cache variables */ if ((polyInts==NULL) || (polyAllocated==NULL)) { gfxPrimitivesPolyIntsGlobal = gfxPrimitivesPolyInts; gfxPrimitivesPolyAllocatedGlobal = gfxPrimitivesPolyAllocated; } else { *polyInts = gfxPrimitivesPolyInts; *polyAllocated = gfxPrimitivesPolyAllocated; } /* * Check temp array again */ if (gfxPrimitivesPolyInts==NULL) { return(-1); } /* * Determine Y maxima */ miny = vy[0]; maxy = vy[0]; for (i = 1; (i < n); i++) { if (vy[i] < miny) { miny = vy[i]; } else if (vy[i] > maxy) { maxy = vy[i]; } } /* * Draw, scanning y */ result = 0; for (y = miny; (y <= maxy); y++) { ints = 0; for (i = 0; (i < n); i++) { if (!i) { ind1 = n - 1; ind2 = 0; } else { ind1 = i - 1; ind2 = i; } y1 = vy[ind1]; y2 = vy[ind2]; if (y1 < y2) { x1 = vx[ind1]; x2 = vx[ind2]; } else if (y1 > y2) { y2 = vy[ind1]; y1 = vy[ind2]; x2 = vx[ind1]; x1 = vx[ind2]; } else { continue; } if ( ((y >= y1) && (y < y2)) || ((y == maxy) && (y > y1) && (y <= y2)) ) { gfxPrimitivesPolyInts[ints++] = ((65536 * (y - y1)) / (y2 - y1)) * (x2 - x1) + (65536 * x1); } } qsort(gfxPrimitivesPolyInts, ints, sizeof(int), _gfxPrimitivesCompareInt); for (i = 0; (i < ints); i += 2) { xa = gfxPrimitivesPolyInts[i] + 1; xa = (xa >> 16) + ((xa & 32768) >> 15); xb = gfxPrimitivesPolyInts[i+1] - 1; xb = (xb >> 16) + ((xb & 32768) >> 15); result |= hlineColor(dst, xa, xb, y, color); } } return (result); } /*! \brief Draw filled polygon with alpha blending (multi-threaded capable). Note: The last two parameters are optional; but are required for multithreaded operation. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the filled polygon. \param vy Vertex array containing Y coordinates of the points of the filled polygon. \param n Number of points in the vertex array. Minimum number is 3. \param r The red value of the filled polygon to draw. \param g The green value of the filled polygon to draw. \param b The blue value of the filed polygon to draw. \param a The alpha value of the filled polygon to draw. \param polyInts Preallocated, temporary vertex array used for sorting vertices. Required for multithreaded operation; set to NULL otherwise. \param polyAllocated Flag indicating if temporary vertex array was allocated. Required for multithreaded operation; set to NULL otherwise. \returns Returns 0 on success, -1 on failure. */ int filledPolygonRGBAMT(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a, int **polyInts, int *polyAllocated) { /* * Draw */ return (filledPolygonColorMT(dst, vx, vy, n, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a, polyInts, polyAllocated)); } /*! \brief Draw filled polygon with alpha blending. Note: Standard filledPolygon function is calling multithreaded version with NULL parameters to use the global vertex cache. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the filled polygon. \param vy Vertex array containing Y coordinates of the points of the filled polygon. \param n Number of points in the vertex array. Minimum number is 3. \param color The color value of the filled polygon to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int filledPolygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color) { /* * Draw */ return (filledPolygonColorMT(dst, vx, vy, n, color, NULL, NULL)); } /*! \brief Draw filled polygon with alpha blending. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the filled polygon. \param vy Vertex array containing Y coordinates of the points of the filled polygon. \param n Number of points in the vertex array. Minimum number is 3. \param r The red value of the filled polygon to draw. \param g The green value of the filled polygon to draw. \param b The blue value of the filed polygon to draw. \param a The alpha value of the filled polygon to draw. \returns Returns 0 on success, -1 on failure. */ int filledPolygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (filledPolygonColorMT(dst, vx, vy, n, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a, NULL, NULL)); } /*! \brief Internal function to draw a textured horizontal line. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. left) of the line. \param x2 X coordinate of the second point (i.e. right) of the line. \param y Y coordinate of the points of the line. \param texture The texture surface to retrieve color information from. \param texture_dx The X offset for the texture lookup. \param texture_dy The Y offset for the textured lookup. \returns Returns 0 on success, -1 on failure. */ int _HLineTextured(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, SDL_Surface *texture, int texture_dx, int texture_dy) { Sint16 left, right, top, bottom; Sint16 w; Sint16 xtmp; int result = 0; int texture_x_walker; int texture_y_start; SDL_Rect source_rect,dst_rect; int pixels_written,write_width; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Swap x1, x2 if required to ensure x1<=x2 */ if (x1 > x2) { xtmp = x1; x1 = x2; x2 = xtmp; } /* * Get clipping boundary and * check visibility of hline */ left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; if ((ybottom)) { return (0); } /* * Clip x */ if (x1 < left) { x1 = left; } if (x2 > right) { x2 = right; } /* * Calculate width to draw */ w = x2 - x1 + 1; /* * Determine where in the texture we start drawing */ texture_x_walker = (x1 - texture_dx) % texture->w; if (texture_x_walker < 0){ texture_x_walker = texture->w + texture_x_walker ; } texture_y_start = (y + texture_dy) % texture->h; if (texture_y_start < 0){ texture_y_start = texture->h + texture_y_start; } // setup the source rectangle; we are only drawing one horizontal line source_rect.y = texture_y_start; source_rect.x = texture_x_walker; source_rect.h = 1; // we will draw to the current y dst_rect.y = y; // if there are enough pixels left in the current row of the texture // draw it all at once if (w <= texture->w -texture_x_walker){ source_rect.w = w; source_rect.x = texture_x_walker; dst_rect.x= x1; result = (SDL_BlitSurface (texture, &source_rect , dst, &dst_rect) == 0); } else { // we need to draw multiple times // draw the first segment pixels_written = texture->w - texture_x_walker; source_rect.w = pixels_written; source_rect.x = texture_x_walker; dst_rect.x= x1; result |= (SDL_BlitSurface (texture, &source_rect , dst, &dst_rect) == 0); write_width = texture->w; // now draw the rest // set the source x to 0 source_rect.x = 0; while (pixels_written < w){ if (write_width >= w - pixels_written) { write_width = w - pixels_written; } source_rect.w = write_width; dst_rect.x = x1 + pixels_written; result |= (SDL_BlitSurface (texture,&source_rect , dst, &dst_rect) == 0); pixels_written += write_width; } } return result; } /*! \brief Draws a polygon filled with the given texture (Multi-Threading Capable). This operation use internally SDL_BlitSurface for lines of the source texture. It supports alpha drawing. To get the best performance of this operation you need to make sure the texture and the dst surface have the same format (see http://docs.mandragor.org/files/Common_libs_documentation/SDL/SDL_Documentation_project_en/sdlblitsurface.html). The last two parameters are optional, but required for multithreaded operation. When set to NULL, uses global static temp array. \param dst the destination surface, \param vx array of x vector components \param vy array of x vector components \param n the amount of vectors in the vx and vy array \param texture the sdl surface to use to fill the polygon \param texture_dx the offset of the texture relative to the screeen. if you move the polygon 10 pixels to the left and want the texture to apear the same you need to increase the texture_dx value \param texture_dy see texture_dx \param polyInts preallocated temp array storage for vertex sorting (used for multi-threaded operation) \param polyAllocated flag indicating oif the temp array was allocated (used for multi-threaded operation) \returns Returns 0 on success, -1 on failure. */ int texturedPolygonMT(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, SDL_Surface * texture, int texture_dx, int texture_dy, int **polyInts, int *polyAllocated) { int result; int i; int y, xa, xb; int minx,maxx,miny, maxy; int x1, y1; int x2, y2; int ind1, ind2; int ints; int *gfxPrimitivesPolyInts = NULL; int gfxPrimitivesPolyAllocated = 0; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check number of edges */ if (n < 3) { return -1; } /* * Map polygon cache */ if ((polyInts==NULL) || (polyAllocated==NULL)) { /* Use global cache */ gfxPrimitivesPolyInts = gfxPrimitivesPolyIntsGlobal; gfxPrimitivesPolyAllocated = gfxPrimitivesPolyAllocatedGlobal; } else { /* Use local cache */ gfxPrimitivesPolyInts = *polyInts; gfxPrimitivesPolyAllocated = *polyAllocated; } /* * Allocate temp array, only grow array */ if (!gfxPrimitivesPolyAllocated) { gfxPrimitivesPolyInts = (int *) malloc(sizeof(int) * n); gfxPrimitivesPolyAllocated = n; } else { if (gfxPrimitivesPolyAllocated < n) { gfxPrimitivesPolyInts = (int *) realloc(gfxPrimitivesPolyInts, sizeof(int) * n); gfxPrimitivesPolyAllocated = n; } } /* * Check temp array */ if (gfxPrimitivesPolyInts==NULL) { gfxPrimitivesPolyAllocated = 0; } /* * Update cache variables */ if ((polyInts==NULL) || (polyAllocated==NULL)) { gfxPrimitivesPolyIntsGlobal = gfxPrimitivesPolyInts; gfxPrimitivesPolyAllocatedGlobal = gfxPrimitivesPolyAllocated; } else { *polyInts = gfxPrimitivesPolyInts; *polyAllocated = gfxPrimitivesPolyAllocated; } /* * Check temp array again */ if (gfxPrimitivesPolyInts==NULL) { return(-1); } /* * Determine X,Y minima,maxima */ miny = vy[0]; maxy = vy[0]; minx = vx[0]; maxx = vx[0]; for (i = 1; (i < n); i++) { if (vy[i] < miny) { miny = vy[i]; } else if (vy[i] > maxy) { maxy = vy[i]; } if (vx[i] < minx) { minx = vx[i]; } else if (vx[i] > maxx) { maxx = vx[i]; } } if (maxx <0 || minx > dst->w){ return -1; } if (maxy <0 || miny > dst->h){ return -1; } /* * Draw, scanning y */ result = 0; for (y = miny; (y <= maxy); y++) { ints = 0; for (i = 0; (i < n); i++) { if (!i) { ind1 = n - 1; ind2 = 0; } else { ind1 = i - 1; ind2 = i; } y1 = vy[ind1]; y2 = vy[ind2]; if (y1 < y2) { x1 = vx[ind1]; x2 = vx[ind2]; } else if (y1 > y2) { y2 = vy[ind1]; y1 = vy[ind2]; x2 = vx[ind1]; x1 = vx[ind2]; } else { continue; } if ( ((y >= y1) && (y < y2)) || ((y == maxy) && (y > y1) && (y <= y2)) ) { gfxPrimitivesPolyInts[ints++] = ((65536 * (y - y1)) / (y2 - y1)) * (x2 - x1) + (65536 * x1); } } qsort(gfxPrimitivesPolyInts, ints, sizeof(int), _gfxPrimitivesCompareInt); for (i = 0; (i < ints); i += 2) { xa = gfxPrimitivesPolyInts[i] + 1; xa = (xa >> 16) + ((xa & 32768) >> 15); xb = gfxPrimitivesPolyInts[i+1] - 1; xb = (xb >> 16) + ((xb & 32768) >> 15); result |= _HLineTextured(dst, xa, xb, y, texture, texture_dx, texture_dy); } } return (result); } /*! \brief Draws a polygon filled with the given texture. This standard version is calling multithreaded versions with NULL cache parameters. \param dst the destination surface, \param vx array of x vector components \param vy array of x vector components \param n the amount of vectors in the vx and vy array \param texture the sdl surface to use to fill the polygon \param texture_dx the offset of the texture relative to the screeen. if you move the polygon 10 pixels to the left and want the texture to apear the same you need to increase the texture_dx value \param texture_dy see texture_dx \returns Returns 0 on success, -1 on failure. */ int texturedPolygon(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, SDL_Surface *texture, int texture_dx, int texture_dy) { /* * Draw */ return (texturedPolygonMT(dst, vx, vy, n, texture, texture_dx, texture_dy, NULL, NULL)); } /* For now, do not compile the font stuff, as it's not used by pygame. */ #if 0 /* ---- Character */ /*! \brief Global cache for NxM pixel font surfaces created at runtime. */ static SDL_Surface *gfxPrimitivesFont[256]; /*! \brief Global cache of the color used for the font surfaces created at runtime. */ static Uint32 gfxPrimitivesFontColor[256]; /*! \brief Pointer to the current font data. Default is a 8x8 pixel internal font. */ static const unsigned char *currentFontdata = gfxPrimitivesFontdata; /*! \brief Width of the current font. Default is 8. */ static Uint32 charWidth = 8; /*! \brief Height of the current font. Default is 8. */ static Uint32 charHeight = 8; /*! \brief Width for rendering. Autocalculated. */ static Uint32 charWidthLocal = 8; /*! \brief Height for rendering. Autocalculated. */ static Uint32 charHeightLocal = 8; /*! \brief Pitch of the current font in bytes. Default is 1. */ static Uint32 charPitch = 1; /*! \brief Characters 90deg clockwise rotations. Default is 0. Max is 3. */ static Uint32 charRotation = 0; /*! \brief Character data size in bytes of the current font. Default is 8. */ static Uint32 charSize = 8; /*! \brief Sets or resets the current global font data. The font data array is organized in follows: [fontdata] = [character 0][character 1]...[character 255] where [character n] = [byte 1 row 1][byte 2 row 1]...[byte {pitch} row 1][byte 1 row 2] ...[byte {pitch} row height] where [byte n] = [bit 0]...[bit 7] where [bit n] = [0 for transparent pixel|1 for colored pixel] \param fontdata Pointer to array of font data. Set to NULL, to reset global font to the default 8x8 font. \param cw Width of character in bytes. Ignored if fontdata==NULL. \param ch Height of character in bytes. Ignored if fontdata==NULL. */ void gfxPrimitivesSetFont(const void *fontdata, Uint32 cw, Uint32 ch) { int i; if ((fontdata) && (cw) && (ch)) { currentFontdata = fontdata; charWidth = cw; charHeight = ch; } else { currentFontdata = gfxPrimitivesFontdata; charWidth = 8; charHeight = 8; } charPitch = (charWidth+7)/8; charSize = charPitch * charHeight; /* Maybe flip width/height for rendering */ if ((charRotation==1) || (charRotation==3)) { charWidthLocal = charHeight; charHeightLocal = charWidth; } else { charWidthLocal = charWidth; charHeightLocal = charHeight; } /* Clear character cache */ for (i = 0; i < 256; i++) { if (gfxPrimitivesFont[i]) { SDL_FreeSurface(gfxPrimitivesFont[i]); gfxPrimitivesFont[i] = NULL; } } } /*! \brief Sets current global font character rotation steps. Default is 0 (no rotation). 1 = 90deg clockwise. 2 = 180deg clockwise. 3 = 270deg clockwise. Changing the rotation, will reset the character cache. \param rotation Number of 90deg clockwise steps to rotate */ void gfxPrimitivesSetFontRotation(Uint32 rotation) { int i; rotation = rotation & 3; if (charRotation != rotation) { /* Store rotation */ charRotation = rotation; /* Maybe flip width/height for rendering */ if ((charRotation==1) || (charRotation==3)) { charWidthLocal = charHeight; charHeightLocal = charWidth; } else { charWidthLocal = charWidth; charHeightLocal = charHeight; } /* Clear character cache */ for (i = 0; i < 256; i++) { if (gfxPrimitivesFont[i]) { SDL_FreeSurface(gfxPrimitivesFont[i]); gfxPrimitivesFont[i] = NULL; } } } } /*! \brief Draw a character of the currently set font. On first call for a particular character and color combination, the function needs to generate the character surface (slower. Subsequent calls blit a cached surface (fast). Uses alpha blending if A<255 in color. \param dst The surface to draw on. \param x X (horizontal) coordinate of the upper left corner of the character. \param y Y (vertical) coordinate of the upper left corner of the character. \param c The character to draw. \param color The color value of the character to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int characterColor(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint32 color) { Sint16 left, right, top, bottom; Sint16 x1, y1, x2, y2; SDL_Rect srect; SDL_Rect drect; int result; Uint32 ix, iy; const unsigned char *charpos; Uint8 *curpos; int forced_redraw; Uint8 patt, mask; Uint8 *linepos; Uint32 pitch; SDL_Surface *rotatedCharacter; Uint32 ci; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Get text and clipping boundary and * test if bounding box of character is visible */ left = dst->clip_rect.x; x2 = x + charWidthLocal; if (x2clip_rect.x + dst->clip_rect.w - 1; x1 = x; if (x1>right) { return(0); } top = dst->clip_rect.y; y2 = y + charHeightLocal; if (y2clip_rect.y + dst->clip_rect.h - 1; y1 = y; if (y1>bottom) { return(0); } /* * Setup source rectangle */ srect.x = 0; srect.y = 0; srect.w = charWidthLocal; srect.h = charHeightLocal; /* * Setup destination rectangle */ drect.x = x; drect.y = y; drect.w = charWidthLocal; drect.h = charHeightLocal; /* Character index in cache */ ci = (unsigned char) c; /* * Create new charWidth x charHeight bitmap surface if not already present. * Might get rotated later. */ if (gfxPrimitivesFont[ci] == NULL) { gfxPrimitivesFont[ci] = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_SRCALPHA, charWidth, charHeight, 32, 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF); /* * Check pointer */ if (gfxPrimitivesFont[ci] == NULL) { return (-1); } /* * Definitely redraw */ forced_redraw = 1; } else { forced_redraw = 0; } /* * Check if color has changed */ if ((gfxPrimitivesFontColor[ci] != color) || (forced_redraw)) { /* * Redraw character */ SDL_SetAlpha(gfxPrimitivesFont[ci], SDL_SRCALPHA, 255); gfxPrimitivesFontColor[ci] = color; /* Lock font-surface */ if (SDL_LockSurface(gfxPrimitivesFont[ci]) != 0) return (-1); /* * Variable setup */ charpos = currentFontdata + ci * charSize; linepos = (Uint8 *) gfxPrimitivesFont[ci]->pixels; pitch = gfxPrimitivesFont[ci]->pitch; /* * Drawing loop */ patt = 0; for (iy = 0; iy < charHeight; iy++) { mask = 0x00; curpos = linepos; for (ix = 0; ix < charWidth; ix++) { if (!(mask >>= 1)) { patt = *charpos++; mask = 0x80; } if (patt & mask) *(Uint32 *)curpos = color; else *(Uint32 *)curpos = 0; curpos += 4; } linepos += pitch; } /* Unlock font-surface */ SDL_UnlockSurface(gfxPrimitivesFont[ci]); /* Maybe rotate and replace cached image */ if (charRotation>0) { // XXX: NOTE: To drop dependency on the rotateSurface90Degrees call. //rotatedCharacter = rotateSurface90Degrees(gfxPrimitivesFont[ci], charRotation); //SDL_FreeSurface(gfxPrimitivesFont[ci]); //gfxPrimitivesFont[ci] = rotatedCharacter; } } /* * Draw bitmap onto destination surface */ result = SDL_BlitSurface(gfxPrimitivesFont[ci], &srect, dst, &drect); return (result); } /*! \brief Draw a character of the currently set font. \param dst The surface to draw on. \param x X (horizontal) coordinate of the upper left corner of the character. \param y Y (vertical) coordinate of the upper left corner of the character. \param c The character to draw. \param r The red value of the character to draw. \param g The green value of the character to draw. \param b The blue value of the character to draw. \param a The alpha value of the character to draw. \returns Returns 0 on success, -1 on failure. */ int characterRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (characterColor(dst, x, y, c, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /*! \brief Draw a string in the currently set font. The spacing between consequtive characters in the string is the fixed number of pixels of the character width of the current global font. \param dst The surface to draw on. \param x X (horizontal) coordinate of the upper left corner of the string. \param y Y (vertical) coordinate of the upper left corner of the string. \param s The string to draw. \param color The color value of the string to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int stringColor(SDL_Surface * dst, Sint16 x, Sint16 y, const char *s, Uint32 color) { int result = 0; Sint16 curx = x; Sint16 cury = y; const char *curchar = s; while (*curchar && !result) { result |= characterColor(dst, curx, cury, *curchar, color); switch (charRotation) { case 0: curx += charWidthLocal; break; case 2: curx -= charWidthLocal; break; case 1: cury += charHeightLocal; break; case 3: cury -= charHeightLocal; break; } curchar++; } return (result); } /*! \brief Draw a string in the currently set font. \param dst The surface to draw on. \param x X (horizontal) coordinate of the upper left corner of the string. \param y Y (vertical) coordinate of the upper left corner of the string. \param s The string to draw. \param r The red value of the string to draw. \param g The green value of the string to draw. \param b The blue value of the string to draw. \param a The alpha value of the string to draw. \returns Returns 0 on success, -1 on failure. */ int stringRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (stringColor(dst, x, y, s, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } #endif /* ---- Bezier curve */ /*! \brief Internal function to calculate bezier interpolator of data array with ndata values at position 't'. \param data Array of values. \param ndata Size of array. \param t Position for which to calculate interpolated value. t should be between [0, ndata]. \returns Interpolated value at position t, value[0] when t<0, value[n-1] when t>n. */ double _evaluateBezier (double *data, int ndata, double t) { double mu, result; int n,k,kn,nn,nkn; double blend,muk,munk; /* Sanity check bounds */ if (t<0.0) { return(data[0]); } if (t>=(double)ndata) { return(data[ndata-1]); } /* Adjust t to the range 0.0 to 1.0 */ mu=t/(double)ndata; /* Calculate interpolate */ n=ndata-1; result=0.0; muk = 1; munk = pow(1-mu,(double)n); for (k=0;k<=n;k++) { nn = n; kn = k; nkn = n - k; blend = muk * munk; muk *= mu; munk /= (1-mu); while (nn >= 1) { blend *= nn; nn--; if (kn > 1) { blend /= (double)kn; kn--; } if (nkn > 1) { blend /= (double)nkn; nkn--; } } result += data[k] * blend; } return (result); } /*! \brief Draw a bezier curve with alpha blending. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the bezier curve. \param vy Vertex array containing Y coordinates of the points of the bezier curve. \param n Number of points in the vertex array. Minimum number is 3. \param s Number of steps for the interpolation. Minimum number is 2. \param color The color value of the bezier curve to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int bezierColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, int s, Uint32 color) { int result; int i; double *x, *y, t, stepsize; Sint16 x1, y1, x2, y2; /* * Sanity check */ if (n < 3) { return (-1); } if (s < 2) { return (-1); } /* * Variable setup */ stepsize=(double)1.0/(double)s; /* Transfer vertices into float arrays */ if ((x=(double *)malloc(sizeof(double)*(n+1)))==NULL) { return(-1); } if ((y=(double *)malloc(sizeof(double)*(n+1)))==NULL) { free(x); return(-1); } for (i=0; ix = x1; b->y = y1; /* dx = abs(x2-x1), s1 = sign(x2-x1) */ if ((b->dx = x2 - x1) != 0) { if (b->dx < 0) { b->dx = -b->dx; b->s1 = -1; } else { b->s1 = 1; } } else { b->s1 = 0; } /* dy = abs(y2-y1), s2 = sign(y2-y1) */ if ((b->dy = y2 - y1) != 0) { if (b->dy < 0) { b->dy = -b->dy; b->s2 = -1; } else { b->s2 = 1; } } else { b->s2 = 0; } if (b->dy > b->dx) { temp = b->dx; b->dx = b->dy; b->dy = temp; b->swapdir = 1; } else { b->swapdir = 0; } b->count = (b->dx<0) ? 0 : (unsigned int)b->dx; b->dy <<= 1; b->error = b->dy - b->dx; b->dx <<= 1; return(0); } /*! \brief Internal function to move Bresenham line iterator to the next position. Maybe updates the x and y coordinates of the iterator struct. \param b Pointer to struct for bresenham line drawing state. \returns Returns 0 on success, 1 if last point was reached, 2 if moving past end-of-line, -1 on failure. */ int _bresenhamIterate(SDL_gfxBresenhamIterator *b) { if (b==NULL) { return (-1); } /* last point check */ if (b->count==0) { return (2); } while (b->error >= 0) { if (b->swapdir) { b->x += b->s1; } else { b->y += b->s2; } b->error -= b->dx; } if (b->swapdir) { b->y += b->s2; } else { b->x += b->s1; } b->error += b->dy; b->count--; /* count==0 indicates "end-of-line" */ return ((b->count) ? 0 : 1); } /*! \brief Internal function to to draw parallel lines with Murphy algorithm. \param m Pointer to struct for murphy iterator. \param x X coordinate of point. \param y Y coordinate of point. \param d1 Direction square/diagonal. */ void _murphyParaline(SDL_gfxMurphyIterator *m, Sint16 x, Sint16 y, int d1) { int p; d1 = -d1; /* * Lock the surface */ if (SDL_MUSTLOCK(m->dst)) { SDL_LockSurface(m->dst); } for (p = 0; p <= m->u; p++) { pixelColorNolock(m->dst, x, y, m->color); if (d1 <= m->kt) { if (m->oct2 == 0) { x++; } else { if (m->quad4 == 0) { y++; } else { y--; } } d1 += m->kv; } else { x++; if (m->quad4 == 0) { y++; } else { y--; } d1 += m->kd; } } /* Unlock surface */ if (SDL_MUSTLOCK(m->dst)) { SDL_UnlockSurface(m->dst); } m->tempx = x; m->tempy = y; } /*! \brief Internal function to to draw one iteration of the Murphy algorithm. \param m Pointer to struct for murphy iterator. \param miter Iteration count. \param ml1bx X coordinate of a point. \param ml1by Y coordinate of a point. \param ml2bx X coordinate of a point. \param ml2by Y coordinate of a point. \param ml1x X coordinate of a point. \param ml1y Y coordinate of a point. \param ml2x X coordinate of a point. \param ml2y Y coordinate of a point. */ void _murphyIteration(SDL_gfxMurphyIterator *m, Uint8 miter, Uint16 ml1bx, Uint16 ml1by, Uint16 ml2bx, Uint16 ml2by, Uint16 ml1x, Uint16 ml1y, Uint16 ml2x, Uint16 ml2y) { int atemp1, atemp2; int ftmp1, ftmp2; Uint16 m1x, m1y, m2x, m2y; Uint16 fix, fiy, lax, lay, curx, cury; Uint16 px[4], py[4]; SDL_gfxBresenhamIterator b; if (miter > 1) { if (m->first1x != -32768) { fix = (m->first1x + m->first2x) / 2; fiy = (m->first1y + m->first2y) / 2; lax = (m->last1x + m->last2x) / 2; lay = (m->last1y + m->last2y) / 2; curx = (ml1x + ml2x) / 2; cury = (ml1y + ml2y) / 2; atemp1 = (fix - curx); atemp2 = (fiy - cury); ftmp1 = atemp1 * atemp1 + atemp2 * atemp2; atemp1 = (lax - curx); atemp2 = (lay - cury); ftmp2 = atemp1 * atemp1 + atemp2 * atemp2; if (ftmp1 <= ftmp2) { m1x = m->first1x; m1y = m->first1y; m2x = m->first2x; m2y = m->first2y; } else { m1x = m->last1x; m1y = m->last1y; m2x = m->last2x; m2y = m->last2y; } atemp1 = (m2x - ml2x); atemp2 = (m2y - ml2y); ftmp1 = atemp1 * atemp1 + atemp2 * atemp2; atemp1 = (m2x - ml2bx); atemp2 = (m2y - ml2by); ftmp2 = atemp1 * atemp1 + atemp2 * atemp2; if (ftmp2 >= ftmp1) { ftmp1 = ml2bx; ftmp2 = ml2by; ml2bx = ml2x; ml2by = ml2y; ml2x = ftmp1; ml2y = ftmp2; ftmp1 = ml1bx; ftmp2 = ml1by; ml1bx = ml1x; ml1by = ml1y; ml1x = ftmp1; ml1y = ftmp2; } /* * Lock the surface */ if (SDL_MUSTLOCK(m->dst)) { SDL_LockSurface(m->dst); } _bresenhamInitialize(&b, m2x, m2y, m1x, m1y); do { pixelColorNolock(m->dst, b.x, b.y, m->color); } while (_bresenhamIterate(&b)==0); _bresenhamInitialize(&b, m1x, m1y, ml1bx, ml1by); do { pixelColorNolock(m->dst, b.x, b.y, m->color); } while (_bresenhamIterate(&b)==0); _bresenhamInitialize(&b, ml1bx, ml1by, ml2bx, ml2by); do { pixelColorNolock(m->dst, b.x, b.y, m->color); } while (_bresenhamIterate(&b)==0); _bresenhamInitialize(&b, ml2bx, ml2by, m2x, m2y); do { pixelColorNolock(m->dst, b.x, b.y, m->color); } while (_bresenhamIterate(&b)==0); /* Unlock surface */ if (SDL_MUSTLOCK(m->dst)) { SDL_UnlockSurface(m->dst); } px[0] = m1x; px[1] = m2x; px[2] = ml1bx; px[3] = ml2bx; py[0] = m1y; py[1] = m2y; py[2] = ml1by; py[3] = ml2by; polygonColor(m->dst, px, py, 4, m->color); } } m->last1x = ml1x; m->last1y = ml1y; m->last2x = ml2x; m->last2y = ml2y; m->first1x = ml1bx; m->first1y = ml1by; m->first2x = ml2bx; m->first2y = ml2by; } #define HYPOT(x,y) sqrt((double)(x)*(double)(x)+(double)(y)*(double)(y)) /*! \brief Internal function to to draw wide lines with Murphy algorithm. Draws lines parallel to ideal line. \param m Pointer to struct for murphy iterator. \param x1 X coordinate of first point. \param y1 Y coordinate of first point. \param x2 X coordinate of second point. \param y2 Y coordinate of second point. \param width Width of line. \param miter Iteration count. */ void _murphyWideline(SDL_gfxMurphyIterator *m, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 miter) { float offset = (float)width / 2.f; Sint16 temp; Sint16 ptx, pty, ptxx, ptxy, ml1x, ml1y, ml2x, ml2y, ml1bx, ml1by, ml2bx, ml2by; int d0, d1; /* difference terms d0=perpendicular to line, d1=along line */ int q; /* pel counter,q=perpendicular to line */ int tmp; int dd; /* distance along line */ int tk; /* thickness threshold */ double ang; /* angle for initial point calculation */ double sang, cang; /* Initialisation */ m->u = x2 - x1; /* delta x */ m->v = y2 - y1; /* delta y */ if (m->u < 0) { /* swap to make sure we are in quadrants 1 or 4 */ temp = x1; x1 = x2; x2 = temp; temp = y1; y1 = y2; y2 = temp; m->u *= -1; m->v *= -1; } if (m->v < 0) { /* swap to 1st quadrant and flag */ m->v *= -1; m->quad4 = 1; } else { m->quad4 = 0; } if (m->v > m->u) { /* swap things if in 2 octant */ tmp = m->u; m->u = m->v; m->v = tmp; m->oct2 = 1; } else { m->oct2 = 0; } m->ku = m->u + m->u; /* change in l for square shift */ m->kv = m->v + m->v; /* change in d for square shift */ m->kd = m->kv - m->ku; /* change in d for diagonal shift */ m->kt = m->u - m->kv; /* diag/square decision threshold */ d0 = 0; d1 = 0; dd = 0; ang = atan((double) m->v / (double) m->u); /* calc new initial point - offset both sides of ideal */ sang = sin(ang); cang = cos(ang); if (m->oct2 == 0) { ptx = x1 + (Sint16)lrint(offset * sang); if (m->quad4 == 0) { pty = y1 - (Sint16)lrint(offset * cang); } else { pty = y1 + (Sint16)lrint(offset * cang); } } else { ptx = x1 - (Sint16)lrint(offset * cang); if (m->quad4 == 0) { pty = y1 + (Sint16)lrint(offset * sang); } else { pty = y1 - (Sint16)lrint(offset * sang); } } /* used here for constant thickness line */ tk = (int) (4. * HYPOT(ptx - x1, pty - y1) * HYPOT(m->u, m->v)); if (miter == 0) { m->first1x = -32768; m->first1y = -32768; m->first2x = -32768; m->first2y = -32768; m->last1x = -32768; m->last1y = -32768; m->last2x = -32768; m->last2y = -32768; } ptxx = ptx; ptxy = pty; for (q = 0; dd <= tk; q++) { /* outer loop, stepping perpendicular to line */ _murphyParaline(m, ptx, pty, d1); /* call to inner loop - right edge */ if (q == 0) { ml1x = ptx; ml1y = pty; ml1bx = m->tempx; ml1by = m->tempy; } else { ml2x = ptx; ml2y = pty; ml2bx = m->tempx; ml2by = m->tempy; } if (d0 < m->kt) { /* square move */ if (m->oct2 == 0) { if (m->quad4 == 0) { pty++; } else { pty--; } } else { ptx++; } } else { /* diagonal move */ dd += m->kv; d0 -= m->ku; if (d1 < m->kt) { /* normal diagonal */ if (m->oct2 == 0) { ptx--; if (m->quad4 == 0) { pty++; } else { pty--; } } else { ptx++; if (m->quad4 == 0) { pty--; } else { pty++; } } d1 += m->kv; } else { /* double square move, extra parallel line */ if (m->oct2 == 0) { ptx--; } else { if (m->quad4 == 0) { pty--; } else { pty++; } } d1 += m->kd; if (dd > tk) { _murphyIteration(m, miter, ml1bx, ml1by, ml2bx, ml2by, ml1x, ml1y, ml2x, ml2y); return; /* breakout on the extra line */ } _murphyParaline(m, ptx, pty, d1); if (m->oct2 == 0) { if (m->quad4 == 0) { pty++; } else { pty--; } } else { ptx++; } } } dd += m->ku; d0 += m->kv; } _murphyIteration(m, miter, ml1bx, ml1by, ml2bx, ml2by, ml1x, ml1y, ml2x, ml2y); } /*! \brief Draw a thick line with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the line. \param y1 Y coordinate of the first point of the line. \param x2 X coordinate of the second point of the line. \param y2 Y coordinate of the second point of the line. \param width Width of the line in pixels. Must be >0. \param color The color value of the line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int thickLineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color) { SDL_gfxMurphyIterator m; if (dst == NULL) return -1; if (width < 1) return -1; m.dst = dst; m.color = color; _murphyWideline(&m, x1, y1, x2, y2, width, 0); _murphyWideline(&m, x1, y1, x2, y2, width, 1); return(0); } /*! \brief Draw a thick line with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the line. \param y1 Y coordinate of the first point of the line. \param x2 X coordinate of the second point of the line. \param y2 Y coordinate of the second point of the line. \param width Width of the line in pixels. Must be >0. \param r The red value of the character to draw. \param g The green value of the character to draw. \param b The blue value of the character to draw. \param a The alpha value of the character to draw. \returns Returns 0 on success, -1 on failure. */ int thickLineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { return (thickLineColor(dst, x1, y1, x2, y2, width, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1429186792.0 pygame_sdl2-2.1.0+renpy8.4.1/src/SDL_gfxPrimitives.h0000664000175000017500000002353512513724350020200 0ustar00tomtom/* SDL_gfxPrimitives: graphics primitives for SDL LGPL (c) A. Schiffler */ #ifndef _SDL_gfxPrimitives_h #define _SDL_gfxPrimitives_h #include #ifndef M_PI #define M_PI 3.1415926535897932384626433832795 #endif #include "SDL.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* ----- Versioning */ #define SDL_GFXPRIMITIVES_MAJOR 2 #define SDL_GFXPRIMITIVES_MINOR 0 #define SDL_GFXPRIMITIVES_MICRO 23 /* ---- Function Prototypes */ #ifdef _MSC_VER # if defined(DLL_EXPORT) && !defined(LIBSDL_GFX_DLL_IMPORT) # define SDL_GFXPRIMITIVES_SCOPE __declspec(dllexport) # else # ifdef LIBSDL_GFX_DLL_IMPORT # define SDL_GFXPRIMITIVES_SCOPE __declspec(dllimport) # endif # endif #endif #ifndef SDL_GFXPRIMITIVES_SCOPE # define SDL_GFXPRIMITIVES_SCOPE extern #endif /* Note: all ___Color routines expect the color to be in format 0xRRGGBBAA */ /* Pixel */ SDL_GFXPRIMITIVES_SCOPE int pixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int pixelRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Horizontal line */ SDL_GFXPRIMITIVES_SCOPE int hlineColor(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int hlineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Vertical line */ SDL_GFXPRIMITIVES_SCOPE int vlineColor(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int vlineRGBA(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Rectangle */ SDL_GFXPRIMITIVES_SCOPE int rectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int rectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Rounded-Corner Rectangle */ SDL_GFXPRIMITIVES_SCOPE int roundedRectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int roundedRectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled rectangle (Box) */ SDL_GFXPRIMITIVES_SCOPE int boxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int boxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Rounded-Corner Filled rectangle (Box) */ SDL_GFXPRIMITIVES_SCOPE int roundedBoxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int roundedBoxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Line */ SDL_GFXPRIMITIVES_SCOPE int lineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int lineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA Line */ SDL_GFXPRIMITIVES_SCOPE int aalineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int aalineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Thick Line */ SDL_GFXPRIMITIVES_SCOPE int thickLineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int thickLineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Circle */ SDL_GFXPRIMITIVES_SCOPE int circleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int circleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Arc */ SDL_GFXPRIMITIVES_SCOPE int arcColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int arcRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA Circle */ SDL_GFXPRIMITIVES_SCOPE int aacircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int aacircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Circle */ SDL_GFXPRIMITIVES_SCOPE int filledCircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int filledCircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Ellipse */ SDL_GFXPRIMITIVES_SCOPE int ellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int ellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA Ellipse */ SDL_GFXPRIMITIVES_SCOPE int aaellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int aaellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Ellipse */ SDL_GFXPRIMITIVES_SCOPE int filledEllipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int filledEllipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Pie */ SDL_GFXPRIMITIVES_SCOPE int pieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int pieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Pie */ SDL_GFXPRIMITIVES_SCOPE int filledPieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int filledPieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Trigon */ SDL_GFXPRIMITIVES_SCOPE int trigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int trigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA-Trigon */ SDL_GFXPRIMITIVES_SCOPE int aatrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int aatrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Trigon */ SDL_GFXPRIMITIVES_SCOPE int filledTrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int filledTrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Polygon */ SDL_GFXPRIMITIVES_SCOPE int polygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int polygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA-Polygon */ SDL_GFXPRIMITIVES_SCOPE int aapolygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int aapolygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Polygon */ SDL_GFXPRIMITIVES_SCOPE int filledPolygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int filledPolygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a); SDL_GFXPRIMITIVES_SCOPE int texturedPolygon(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, SDL_Surface * texture,int texture_dx,int texture_dy); /* (Note: These MT versions are required for multi-threaded operation.) */ SDL_GFXPRIMITIVES_SCOPE int filledPolygonColorMT(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color, int **polyInts, int *polyAllocated); SDL_GFXPRIMITIVES_SCOPE int filledPolygonRGBAMT(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a, int **polyInts, int *polyAllocated); SDL_GFXPRIMITIVES_SCOPE int texturedPolygonMT(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, SDL_Surface * texture,int texture_dx,int texture_dy, int **polyInts, int *polyAllocated); /* Bezier */ SDL_GFXPRIMITIVES_SCOPE int bezierColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, int s, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int bezierRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Characters/Strings */ SDL_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFont(const void *fontdata, Uint32 cw, Uint32 ch); SDL_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFontRotation(Uint32 rotation); SDL_GFXPRIMITIVES_SCOPE int characterColor(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int characterRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a); SDL_GFXPRIMITIVES_SCOPE int stringColor(SDL_Surface * dst, Sint16 x, Sint16 y, const char *s, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int stringRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #endif /* _SDL_gfxPrimitives_h */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1429186792.0 pygame_sdl2-2.1.0+renpy8.4.1/src/SDL_gfxPrimitives_font.h0000664000175000017500000015513312513724350021226 0ustar00tomtom /* ---- 8x8 font definition ---- */ /* LGPL (c) A. Schiffler */ #define GFX_FONTDATAMAX (8*256) static unsigned char gfxPrimitivesFontdata[GFX_FONTDATAMAX] = { /* * 0 0x00 '^@' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 1 0x01 '^A' */ 0x7e, /* 01111110 */ 0x81, /* 10000001 */ 0xa5, /* 10100101 */ 0x81, /* 10000001 */ 0xbd, /* 10111101 */ 0x99, /* 10011001 */ 0x81, /* 10000001 */ 0x7e, /* 01111110 */ /* * 2 0x02 '^B' */ 0x7e, /* 01111110 */ 0xff, /* 11111111 */ 0xdb, /* 11011011 */ 0xff, /* 11111111 */ 0xc3, /* 11000011 */ 0xe7, /* 11100111 */ 0xff, /* 11111111 */ 0x7e, /* 01111110 */ /* * 3 0x03 '^C' */ 0x6c, /* 01101100 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0x7c, /* 01111100 */ 0x38, /* 00111000 */ 0x10, /* 00010000 */ 0x00, /* 00000000 */ /* * 4 0x04 '^D' */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ 0x7c, /* 01111100 */ 0xfe, /* 11111110 */ 0x7c, /* 01111100 */ 0x38, /* 00111000 */ 0x10, /* 00010000 */ 0x00, /* 00000000 */ /* * 5 0x05 '^E' */ 0x38, /* 00111000 */ 0x7c, /* 01111100 */ 0x38, /* 00111000 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0xd6, /* 11010110 */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ /* * 6 0x06 '^F' */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ 0x7c, /* 01111100 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0x7c, /* 01111100 */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ /* * 7 0x07 '^G' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 8 0x08 '^H' */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xe7, /* 11100111 */ 0xc3, /* 11000011 */ 0xc3, /* 11000011 */ 0xe7, /* 11100111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ /* * 9 0x09 '^I' */ 0x00, /* 00000000 */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x42, /* 01000010 */ 0x42, /* 01000010 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 10 0x0a '^J' */ 0xff, /* 11111111 */ 0xc3, /* 11000011 */ 0x99, /* 10011001 */ 0xbd, /* 10111101 */ 0xbd, /* 10111101 */ 0x99, /* 10011001 */ 0xc3, /* 11000011 */ 0xff, /* 11111111 */ /* * 11 0x0b '^K' */ 0x0f, /* 00001111 */ 0x07, /* 00000111 */ 0x0f, /* 00001111 */ 0x7d, /* 01111101 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x78, /* 01111000 */ /* * 12 0x0c '^L' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ /* * 13 0x0d '^M' */ 0x3f, /* 00111111 */ 0x33, /* 00110011 */ 0x3f, /* 00111111 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x70, /* 01110000 */ 0xf0, /* 11110000 */ 0xe0, /* 11100000 */ /* * 14 0x0e '^N' */ 0x7f, /* 01111111 */ 0x63, /* 01100011 */ 0x7f, /* 01111111 */ 0x63, /* 01100011 */ 0x63, /* 01100011 */ 0x67, /* 01100111 */ 0xe6, /* 11100110 */ 0xc0, /* 11000000 */ /* * 15 0x0f '^O' */ 0x18, /* 00011000 */ 0xdb, /* 11011011 */ 0x3c, /* 00111100 */ 0xe7, /* 11100111 */ 0xe7, /* 11100111 */ 0x3c, /* 00111100 */ 0xdb, /* 11011011 */ 0x18, /* 00011000 */ /* * 16 0x10 '^P' */ 0x80, /* 10000000 */ 0xe0, /* 11100000 */ 0xf8, /* 11111000 */ 0xfe, /* 11111110 */ 0xf8, /* 11111000 */ 0xe0, /* 11100000 */ 0x80, /* 10000000 */ 0x00, /* 00000000 */ /* * 17 0x11 '^Q' */ 0x02, /* 00000010 */ 0x0e, /* 00001110 */ 0x3e, /* 00111110 */ 0xfe, /* 11111110 */ 0x3e, /* 00111110 */ 0x0e, /* 00001110 */ 0x02, /* 00000010 */ 0x00, /* 00000000 */ /* * 18 0x12 '^R' */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ /* * 19 0x13 '^S' */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ /* * 20 0x14 '^T' */ 0x7f, /* 01111111 */ 0xdb, /* 11011011 */ 0xdb, /* 11011011 */ 0x7b, /* 01111011 */ 0x1b, /* 00011011 */ 0x1b, /* 00011011 */ 0x1b, /* 00011011 */ 0x00, /* 00000000 */ /* * 21 0x15 '^U' */ 0x3e, /* 00111110 */ 0x61, /* 01100001 */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x86, /* 10000110 */ 0x7c, /* 01111100 */ /* * 22 0x16 '^V' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x7e, /* 01111110 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 23 0x17 '^W' */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ /* * 24 0x18 '^X' */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 25 0x19 '^Y' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 26 0x1a '^Z' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0xfe, /* 11111110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 27 0x1b '^[' */ 0x00, /* 00000000 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0xfe, /* 11111110 */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 28 0x1c '^\' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 29 0x1d '^]' */ 0x00, /* 00000000 */ 0x24, /* 00100100 */ 0x66, /* 01100110 */ 0xff, /* 11111111 */ 0x66, /* 01100110 */ 0x24, /* 00100100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 30 0x1e '^^' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 31 0x1f '^_' */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0x7e, /* 01111110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 32 0x20 ' ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 33 0x21 '!' */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 34 0x22 '"' */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x24, /* 00100100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 35 0x23 '#' */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x00, /* 00000000 */ /* * 36 0x24 '$' */ 0x18, /* 00011000 */ 0x3e, /* 00111110 */ 0x60, /* 01100000 */ 0x3c, /* 00111100 */ 0x06, /* 00000110 */ 0x7c, /* 01111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 37 0x25 '%' */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xcc, /* 11001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x66, /* 01100110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 38 0x26 '&' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 39 0x27 ''' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 40 0x28 '(' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x00, /* 00000000 */ /* * 41 0x29 ')' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ /* * 42 0x2a '*' */ 0x00, /* 00000000 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0xff, /* 11111111 */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 43 0x2b '+' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 44 0x2c ',' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ /* * 45 0x2d '-' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 46 0x2e '.' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 47 0x2f '/' */ 0x06, /* 00000110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0xc0, /* 11000000 */ 0x80, /* 10000000 */ 0x00, /* 00000000 */ /* * 48 0x30 '0' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xd6, /* 11010110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* * 49 0x31 '1' */ 0x18, /* 00011000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 50 0x32 '2' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0x06, /* 00000110 */ 0x1c, /* 00011100 */ 0x30, /* 00110000 */ 0x66, /* 01100110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 51 0x33 '3' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0x06, /* 00000110 */ 0x3c, /* 00111100 */ 0x06, /* 00000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 52 0x34 '4' */ 0x1c, /* 00011100 */ 0x3c, /* 00111100 */ 0x6c, /* 01101100 */ 0xcc, /* 11001100 */ 0xfe, /* 11111110 */ 0x0c, /* 00001100 */ 0x1e, /* 00011110 */ 0x00, /* 00000000 */ /* * 53 0x35 '5' */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xfc, /* 11111100 */ 0x06, /* 00000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 54 0x36 '6' */ 0x38, /* 00111000 */ 0x60, /* 01100000 */ 0xc0, /* 11000000 */ 0xfc, /* 11111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 55 0x37 '7' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ /* * 56 0x38 '8' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 57 0x39 '9' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7e, /* 01111110 */ 0x06, /* 00000110 */ 0x0c, /* 00001100 */ 0x78, /* 01111000 */ 0x00, /* 00000000 */ /* * 58 0x3a ':' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 59 0x3b ';' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ /* * 60 0x3c '<' */ 0x06, /* 00000110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x06, /* 00000110 */ 0x00, /* 00000000 */ /* * 61 0x3d '=' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 62 0x3e '>' */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0x00, /* 00000000 */ /* * 63 0x3f '?' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 64 0x40 '@' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xde, /* 11011110 */ 0xde, /* 11011110 */ 0xde, /* 11011110 */ 0xc0, /* 11000000 */ 0x78, /* 01111000 */ 0x00, /* 00000000 */ /* * 65 0x41 'A' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 66 0x42 'B' */ 0xfc, /* 11111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0xfc, /* 11111100 */ 0x00, /* 00000000 */ /* * 67 0x43 'C' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 68 0x44 'D' */ 0xf8, /* 11111000 */ 0x6c, /* 01101100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x6c, /* 01101100 */ 0xf8, /* 11111000 */ 0x00, /* 00000000 */ /* * 69 0x45 'E' */ 0xfe, /* 11111110 */ 0x62, /* 01100010 */ 0x68, /* 01101000 */ 0x78, /* 01111000 */ 0x68, /* 01101000 */ 0x62, /* 01100010 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 70 0x46 'F' */ 0xfe, /* 11111110 */ 0x62, /* 01100010 */ 0x68, /* 01101000 */ 0x78, /* 01111000 */ 0x68, /* 01101000 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ 0x00, /* 00000000 */ /* * 71 0x47 'G' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xce, /* 11001110 */ 0x66, /* 01100110 */ 0x3a, /* 00111010 */ 0x00, /* 00000000 */ /* * 72 0x48 'H' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 73 0x49 'I' */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 74 0x4a 'J' */ 0x1e, /* 00011110 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x78, /* 01111000 */ 0x00, /* 00000000 */ /* * 75 0x4b 'K' */ 0xe6, /* 11100110 */ 0x66, /* 01100110 */ 0x6c, /* 01101100 */ 0x78, /* 01111000 */ 0x6c, /* 01101100 */ 0x66, /* 01100110 */ 0xe6, /* 11100110 */ 0x00, /* 00000000 */ /* * 76 0x4c 'L' */ 0xf0, /* 11110000 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0x62, /* 01100010 */ 0x66, /* 01100110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 77 0x4d 'M' */ 0xc6, /* 11000110 */ 0xee, /* 11101110 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0xd6, /* 11010110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 78 0x4e 'N' */ 0xc6, /* 11000110 */ 0xe6, /* 11100110 */ 0xf6, /* 11110110 */ 0xde, /* 11011110 */ 0xce, /* 11001110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 79 0x4f 'O' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 80 0x50 'P' */ 0xfc, /* 11111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ 0x00, /* 00000000 */ /* * 81 0x51 'Q' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xce, /* 11001110 */ 0x7c, /* 01111100 */ 0x0e, /* 00001110 */ /* * 82 0x52 'R' */ 0xfc, /* 11111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0x6c, /* 01101100 */ 0x66, /* 01100110 */ 0xe6, /* 11100110 */ 0x00, /* 00000000 */ /* * 83 0x53 'S' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 84 0x54 'T' */ 0x7e, /* 01111110 */ 0x7e, /* 01111110 */ 0x5a, /* 01011010 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 85 0x55 'U' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 86 0x56 'V' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* * 87 0x57 'W' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xd6, /* 11010110 */ 0xd6, /* 11010110 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0x00, /* 00000000 */ /* * 88 0x58 'X' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 89 0x59 'Y' */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 90 0x5a 'Z' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0x8c, /* 10001100 */ 0x18, /* 00011000 */ 0x32, /* 00110010 */ 0x66, /* 01100110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 91 0x5b '[' */ 0x3c, /* 00111100 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 92 0x5c '\' */ 0xc0, /* 11000000 */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x06, /* 00000110 */ 0x02, /* 00000010 */ 0x00, /* 00000000 */ /* * 93 0x5d ']' */ 0x3c, /* 00111100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 94 0x5e '^' */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 95 0x5f '_' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ /* * 96 0x60 '`' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 97 0x61 'a' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 98 0x62 'b' */ 0xe0, /* 11100000 */ 0x60, /* 01100000 */ 0x7c, /* 01111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ /* * 99 0x63 'c' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc0, /* 11000000 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 100 0x64 'd' */ 0x1c, /* 00011100 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 101 0x65 'e' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 102 0x66 'f' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x60, /* 01100000 */ 0xf8, /* 11111000 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ 0x00, /* 00000000 */ /* * 103 0x67 'g' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x7c, /* 01111100 */ 0x0c, /* 00001100 */ 0xf8, /* 11111000 */ /* * 104 0x68 'h' */ 0xe0, /* 11100000 */ 0x60, /* 01100000 */ 0x6c, /* 01101100 */ 0x76, /* 01110110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0xe6, /* 11100110 */ 0x00, /* 00000000 */ /* * 105 0x69 'i' */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 106 0x6a 'j' */ 0x06, /* 00000110 */ 0x00, /* 00000000 */ 0x06, /* 00000110 */ 0x06, /* 00000110 */ 0x06, /* 00000110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ /* * 107 0x6b 'k' */ 0xe0, /* 11100000 */ 0x60, /* 01100000 */ 0x66, /* 01100110 */ 0x6c, /* 01101100 */ 0x78, /* 01111000 */ 0x6c, /* 01101100 */ 0xe6, /* 11100110 */ 0x00, /* 00000000 */ /* * 108 0x6c 'l' */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 109 0x6d 'm' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xec, /* 11101100 */ 0xfe, /* 11111110 */ 0xd6, /* 11010110 */ 0xd6, /* 11010110 */ 0xd6, /* 11010110 */ 0x00, /* 00000000 */ /* * 110 0x6e 'n' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xdc, /* 11011100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ /* * 111 0x6f 'o' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 112 0x70 'p' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xdc, /* 11011100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ /* * 113 0x71 'q' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x7c, /* 01111100 */ 0x0c, /* 00001100 */ 0x1e, /* 00011110 */ /* * 114 0x72 'r' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xdc, /* 11011100 */ 0x76, /* 01110110 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ 0x00, /* 00000000 */ /* * 115 0x73 's' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x06, /* 00000110 */ 0xfc, /* 11111100 */ 0x00, /* 00000000 */ /* * 116 0x74 't' */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0xfc, /* 11111100 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x36, /* 00110110 */ 0x1c, /* 00011100 */ 0x00, /* 00000000 */ /* * 117 0x75 'u' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 118 0x76 'v' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* * 119 0x77 'w' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xd6, /* 11010110 */ 0xd6, /* 11010110 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0x00, /* 00000000 */ /* * 120 0x78 'x' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 121 0x79 'y' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7e, /* 01111110 */ 0x06, /* 00000110 */ 0xfc, /* 11111100 */ /* * 122 0x7a 'z' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x4c, /* 01001100 */ 0x18, /* 00011000 */ 0x32, /* 00110010 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 123 0x7b '{' */ 0x0e, /* 00001110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x70, /* 01110000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x0e, /* 00001110 */ 0x00, /* 00000000 */ /* * 124 0x7c '|' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 125 0x7d '}' */ 0x70, /* 01110000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x0e, /* 00001110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x70, /* 01110000 */ 0x00, /* 00000000 */ /* * 126 0x7e '~' */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 127 0x7f '' */ 0x00, /* 00000000 */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 128 0x80 '€' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x0c, /* 00001100 */ 0x78, /* 01111000 */ /* * 129 0x81 '' */ 0xcc, /* 11001100 */ 0x00, /* 00000000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 130 0x82 '‚' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 131 0x83 'ƒ' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 132 0x84 '„' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 133 0x85 '…' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 134 0x86 '†' */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 135 0x87 '‡' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x7e, /* 01111110 */ 0x0c, /* 00001100 */ 0x38, /* 00111000 */ /* * 136 0x88 'ˆ' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 137 0x89 '‰' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 138 0x8a 'Š' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 139 0x8b '‹' */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 140 0x8c 'Œ' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 141 0x8d '' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 142 0x8e 'Ž' */ 0xc6, /* 11000110 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 143 0x8f '' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 144 0x90 '' */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0xf8, /* 11111000 */ 0xc0, /* 11000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 145 0x91 '‘' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0xd8, /* 11011000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 146 0x92 '’' */ 0x3e, /* 00111110 */ 0x6c, /* 01101100 */ 0xcc, /* 11001100 */ 0xfe, /* 11111110 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xce, /* 11001110 */ 0x00, /* 00000000 */ /* * 147 0x93 '“' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 148 0x94 '”' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 149 0x95 '•' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 150 0x96 '–' */ 0x78, /* 01111000 */ 0x84, /* 10000100 */ 0x00, /* 00000000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 151 0x97 '—' */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 152 0x98 '˜' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7e, /* 01111110 */ 0x06, /* 00000110 */ 0xfc, /* 11111100 */ /* * 153 0x99 '™' */ 0xc6, /* 11000110 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* * 154 0x9a 'š' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 155 0x9b '›' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 156 0x9c 'œ' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x64, /* 01100100 */ 0xf0, /* 11110000 */ 0x60, /* 01100000 */ 0x66, /* 01100110 */ 0xfc, /* 11111100 */ 0x00, /* 00000000 */ /* * 157 0x9d '' */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 158 0x9e 'ž' */ 0xf8, /* 11111000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xfa, /* 11111010 */ 0xc6, /* 11000110 */ 0xcf, /* 11001111 */ 0xc6, /* 11000110 */ 0xc7, /* 11000111 */ /* * 159 0x9f 'Ÿ' */ 0x0e, /* 00001110 */ 0x1b, /* 00011011 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0xd8, /* 11011000 */ 0x70, /* 01110000 */ 0x00, /* 00000000 */ /* * 160 0xa0 ' ' */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 161 0xa1 '¡' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 162 0xa2 '¢' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 163 0xa3 '£' */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 164 0xa4 '¤' */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0xdc, /* 11011100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ /* * 165 0xa5 '¥' */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0xe6, /* 11100110 */ 0xf6, /* 11110110 */ 0xde, /* 11011110 */ 0xce, /* 11001110 */ 0x00, /* 00000000 */ /* * 166 0xa6 '¦' */ 0x3c, /* 00111100 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x3e, /* 00111110 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 167 0xa7 '§' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 168 0xa8 '¨' */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x63, /* 01100011 */ 0x3e, /* 00111110 */ 0x00, /* 00000000 */ /* * 169 0xa9 '©' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 170 0xaa 'ª' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x06, /* 00000110 */ 0x06, /* 00000110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 171 0xab '«' */ 0x63, /* 01100011 */ 0xe6, /* 11100110 */ 0x6c, /* 01101100 */ 0x7e, /* 01111110 */ 0x33, /* 00110011 */ 0x66, /* 01100110 */ 0xcc, /* 11001100 */ 0x0f, /* 00001111 */ /* * 172 0xac '¬' */ 0x63, /* 01100011 */ 0xe6, /* 11100110 */ 0x6c, /* 01101100 */ 0x7a, /* 01111010 */ 0x36, /* 00110110 */ 0x6a, /* 01101010 */ 0xdf, /* 11011111 */ 0x06, /* 00000110 */ /* * 173 0xad '­' */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 174 0xae '®' */ 0x00, /* 00000000 */ 0x33, /* 00110011 */ 0x66, /* 01100110 */ 0xcc, /* 11001100 */ 0x66, /* 01100110 */ 0x33, /* 00110011 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 175 0xaf '¯' */ 0x00, /* 00000000 */ 0xcc, /* 11001100 */ 0x66, /* 01100110 */ 0x33, /* 00110011 */ 0x66, /* 01100110 */ 0xcc, /* 11001100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 176 0xb0 '°' */ 0x22, /* 00100010 */ 0x88, /* 10001000 */ 0x22, /* 00100010 */ 0x88, /* 10001000 */ 0x22, /* 00100010 */ 0x88, /* 10001000 */ 0x22, /* 00100010 */ 0x88, /* 10001000 */ /* * 177 0xb1 '±' */ 0x55, /* 01010101 */ 0xaa, /* 10101010 */ 0x55, /* 01010101 */ 0xaa, /* 10101010 */ 0x55, /* 01010101 */ 0xaa, /* 10101010 */ 0x55, /* 01010101 */ 0xaa, /* 10101010 */ /* * 178 0xb2 '²' */ 0x77, /* 01110111 */ 0xdd, /* 11011101 */ 0x77, /* 01110111 */ 0xdd, /* 11011101 */ 0x77, /* 01110111 */ 0xdd, /* 11011101 */ 0x77, /* 01110111 */ 0xdd, /* 11011101 */ /* * 179 0xb3 '³' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 180 0xb4 '´' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 181 0xb5 'µ' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 182 0xb6 '¶' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf6, /* 11110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 183 0xb7 '·' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 184 0xb8 '¸' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 185 0xb9 '¹' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf6, /* 11110110 */ 0x06, /* 00000110 */ 0xf6, /* 11110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 186 0xba 'º' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 187 0xbb '»' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x06, /* 00000110 */ 0xf6, /* 11110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 188 0xbc '¼' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf6, /* 11110110 */ 0x06, /* 00000110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 189 0xbd '½' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 190 0xbe '¾' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 191 0xbf '¿' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 192 0xc0 'À' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 193 0xc1 'Á' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 194 0xc2 'Â' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 195 0xc3 'Ã' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 196 0xc4 'Ä' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 197 0xc5 'Å' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 198 0xc6 'Æ' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 199 0xc7 'Ç' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x37, /* 00110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 200 0xc8 'È' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x37, /* 00110111 */ 0x30, /* 00110000 */ 0x3f, /* 00111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 201 0xc9 'É' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x3f, /* 00111111 */ 0x30, /* 00110000 */ 0x37, /* 00110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 202 0xca 'Ê' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf7, /* 11110111 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 203 0xcb 'Ë' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0xf7, /* 11110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 204 0xcc 'Ì' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x37, /* 00110111 */ 0x30, /* 00110000 */ 0x37, /* 00110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 205 0xcd 'Í' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 206 0xce 'Î' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf7, /* 11110111 */ 0x00, /* 00000000 */ 0xf7, /* 11110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 207 0xcf 'Ï' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 208 0xd0 'Ð' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 209 0xd1 'Ñ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 210 0xd2 'Ò' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 211 0xd3 'Ó' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x3f, /* 00111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 212 0xd4 'Ô' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 213 0xd5 'Õ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 214 0xd6 'Ö' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x3f, /* 00111111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 215 0xd7 '×' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xff, /* 11111111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 216 0xd8 'Ø' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 217 0xd9 'Ù' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 218 0xda 'Ú' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 219 0xdb 'Û' */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ /* * 220 0xdc 'Ü' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ /* * 221 0xdd 'Ý' */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ /* * 222 0xde 'Þ' */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ /* * 223 0xdf 'ß' */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 224 0xe0 'à' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0xc8, /* 11001000 */ 0xdc, /* 11011100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 225 0xe1 'á' */ 0x78, /* 01111000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xd8, /* 11011000 */ 0xcc, /* 11001100 */ 0xc6, /* 11000110 */ 0xcc, /* 11001100 */ 0x00, /* 00000000 */ /* * 226 0xe2 'â' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x00, /* 00000000 */ /* * 227 0xe3 'ã' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x00, /* 00000000 */ /* * 228 0xe4 'ä' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 229 0xe5 'å' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0xd8, /* 11011000 */ 0xd8, /* 11011000 */ 0xd8, /* 11011000 */ 0x70, /* 01110000 */ 0x00, /* 00000000 */ /* * 230 0xe6 'æ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0xc0, /* 11000000 */ /* * 231 0xe7 'ç' */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 232 0xe8 'è' */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ /* * 233 0xe9 'é' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* * 234 0xea 'ê' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0xee, /* 11101110 */ 0x00, /* 00000000 */ /* * 235 0xeb 'ë' */ 0x0e, /* 00001110 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x3e, /* 00111110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 236 0xec 'ì' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0xdb, /* 11011011 */ 0xdb, /* 11011011 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 237 0xed 'í' */ 0x06, /* 00000110 */ 0x0c, /* 00001100 */ 0x7e, /* 01111110 */ 0xdb, /* 11011011 */ 0xdb, /* 11011011 */ 0x7e, /* 01111110 */ 0x60, /* 01100000 */ 0xc0, /* 11000000 */ /* * 238 0xee 'î' */ 0x1e, /* 00011110 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0x7e, /* 01111110 */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x1e, /* 00011110 */ 0x00, /* 00000000 */ /* * 239 0xef 'ï' */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 240 0xf0 'ð' */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 241 0xf1 'ñ' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 242 0xf2 'ò' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 243 0xf3 'ó' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 244 0xf4 'ô' */ 0x0e, /* 00001110 */ 0x1b, /* 00011011 */ 0x1b, /* 00011011 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 245 0xf5 'õ' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xd8, /* 11011000 */ 0xd8, /* 11011000 */ 0x70, /* 01110000 */ /* * 246 0xf6 'ö' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 247 0xf7 '÷' */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 248 0xf8 'ø' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 249 0xf9 'ù' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 250 0xfa 'ú' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 251 0xfb 'û' */ 0x0f, /* 00001111 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0xec, /* 11101100 */ 0x6c, /* 01101100 */ 0x3c, /* 00111100 */ 0x1c, /* 00011100 */ /* * 252 0xfc 'ü' */ 0x6c, /* 01101100 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 253 0xfd 'ý' */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 254 0xfe 'þ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 255 0xff ' ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ }; ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1455159516.0 pygame_sdl2-2.1.0+renpy8.4.1/src/alphablit.c0000664000175000017500000023040012656774334016577 0ustar00tomtom/* pygame - Python Game Library Copyright (C) 2000-2001 Pete Shinners Copyright (C) 2006 Rene Dudfield Copyright (C) 2007 Marcus von Appen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Pete Shinners pete@shinners.org */ #include "surface.h" /* The structure passed to the low level blit functions */ typedef struct { int width; int height; Uint8 *s_pixels; int s_pxskip; int s_skip; Uint8 *d_pixels; int d_pxskip; int d_skip; SDL_PixelFormat *src; SDL_PixelFormat *dst; Uint32 src_flags; Uint32 dst_flags; } SDL_BlitInfo; static void alphablit_alpha (SDL_BlitInfo * info); #if 0 static void alphablit_colorkey (SDL_BlitInfo * info); #endif static void alphablit_solid (SDL_BlitInfo * info); static void blit_blend_add (SDL_BlitInfo * info); static void blit_blend_sub (SDL_BlitInfo * info); static void blit_blend_mul (SDL_BlitInfo * info); static void blit_blend_min (SDL_BlitInfo * info); static void blit_blend_max (SDL_BlitInfo * info); static void blit_blend_rgba_add (SDL_BlitInfo * info); static void blit_blend_rgba_sub (SDL_BlitInfo * info); static void blit_blend_rgba_mul (SDL_BlitInfo * info); static void blit_blend_rgba_min (SDL_BlitInfo * info); static void blit_blend_rgba_max (SDL_BlitInfo * info); static void blit_blend_premultiplied (SDL_BlitInfo * info); static int SoftBlitPyGame (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args); extern int SDL_RLESurface (SDL_Surface * surface); extern void SDL_UnRLESurface (SDL_Surface * surface, int recode); static int SoftBlitPyGame (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args) { int okay; int src_locked; int dst_locked; /* Everything is okay at the beginning... */ okay = 1; /* Lock the destination if it's in hardware */ dst_locked = 0; if (SDL_MUSTLOCK (dst)) { if (SDL_LockSurface (dst) < 0) okay = 0; else dst_locked = 1; } /* Lock the source if it's in hardware */ src_locked = 0; if (SDL_MUSTLOCK (src)) { if (SDL_LockSurface (src) < 0) okay = 0; else src_locked = 1; } /* Set up source and destination buffer pointers, and BLIT! */ if (okay && srcrect->w && srcrect->h) { SDL_BlitInfo info; /* Set up the blit information */ info.width = srcrect->w; info.height = srcrect->h; info.s_pixels = (Uint8 *) src->pixels + (Uint16) srcrect->y * src->pitch + (Uint16) srcrect->x * src->format->BytesPerPixel; info.s_pxskip = src->format->BytesPerPixel; info.s_skip = src->pitch - info.width * src->format->BytesPerPixel; info.d_pixels = (Uint8 *) dst->pixels + (Uint16) dstrect->y * dst->pitch + (Uint16) dstrect->x * dst->format->BytesPerPixel; info.d_pxskip = dst->format->BytesPerPixel; info.d_skip = dst->pitch - info.width * dst->format->BytesPerPixel; info.src = src->format; info.dst = dst->format; info.src_flags = src->flags; info.dst_flags = dst->flags; if (info.d_pixels > info.s_pixels) { int span = info.width * info.src->BytesPerPixel; Uint8 *srcpixend = info.s_pixels + (info.height - 1) * src->pitch + span; if (info.d_pixels < srcpixend) { int dstoffset = (info.d_pixels - info.s_pixels) % src->pitch; if (dstoffset < span || dstoffset > src->pitch - span) { /* Overlapping Self blit with positive destination offset. Reverse direction of the blit. */ info.s_pixels = srcpixend - info.s_pxskip; info.s_pxskip = -info.s_pxskip; info.s_skip = -info.s_skip; info.d_pixels = (info.d_pixels + (info.height - 1) * dst->pitch + span - info.d_pxskip); info.d_pxskip = -info.d_pxskip; info.d_skip = -info.d_skip; } } } switch (the_args) { case 0: { if (src->format->Amask) alphablit_alpha (&info); else alphablit_solid (&info); break; } case PYGAME_BLEND_ADD: { blit_blend_add (&info); break; } case PYGAME_BLEND_SUB: { blit_blend_sub (&info); break; } case PYGAME_BLEND_MULT: { blit_blend_mul (&info); break; } case PYGAME_BLEND_MIN: { blit_blend_min (&info); break; } case PYGAME_BLEND_MAX: { blit_blend_max (&info); break; } case PYGAME_BLEND_RGBA_ADD: { blit_blend_rgba_add (&info); break; } case PYGAME_BLEND_RGBA_SUB: { blit_blend_rgba_sub (&info); break; } case PYGAME_BLEND_RGBA_MULT: { blit_blend_rgba_mul (&info); break; } case PYGAME_BLEND_RGBA_MIN: { blit_blend_rgba_min (&info); break; } case PYGAME_BLEND_RGBA_MAX: { blit_blend_rgba_max (&info); break; } case PYGAME_BLEND_PREMULTIPLIED: { blit_blend_premultiplied (&info); break; } default: { SDL_SetError ("Invalid argument passed to blit."); okay = 0; break; } } } /* We need to unlock the surfaces if they're locked */ if (dst_locked) SDL_UnlockSurface (dst); if (src_locked) SDL_UnlockSurface (src); /* Blit is done! */ return (okay ? 0 : -1); } /* --------------------------------------------------------- */ static void blit_blend_rgba_add (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; Uint32 tmp; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (!dstppa) { blit_blend_add (info); return; } if (srcbpp == 4 && dstbpp == 4 && srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask && srcfmt->Amask == dstfmt->Amask && srcfmt->Amask) { int incr = srcpxskip > 0 ? 1 : -1; if (incr < 0) { src += 3; dst += 3; } while (height--) { LOOP_UNROLLED4( { REPEAT_4( { tmp = (*dst) + (*src); (*dst) = (tmp <= 255 ? tmp : 255); src += incr; dst += incr; }); }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_rgba_sub (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; Sint32 tmp2; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (!dstppa) { blit_blend_sub (info); return; } if (srcbpp == 4 && dstbpp == 4 && srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask && srcfmt->Amask == dstfmt->Amask && srcfmt->Amask) { int incr = srcpxskip > 0 ? 1 : -1; if (incr < 0) { src += 3; dst += 3; } while (height--) { LOOP_UNROLLED4( { REPEAT_4( { tmp2 = (*dst) - (*src); (*dst) = (tmp2 >= 0 ? tmp2 : 0); src += incr; dst += incr; }); }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_rgba_mul (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; Uint32 tmp; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (!dstppa) { blit_blend_mul (info); return; } if (srcbpp == 4 && dstbpp == 4 && srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask && srcfmt->Amask == dstfmt->Amask && srcfmt->Amask) { int incr = srcpxskip > 0 ? 1 : -1; if (incr < 0) { src += 3; dst += 3; } while (height--) { LOOP_UNROLLED4( { REPEAT_4( { tmp = ((*dst) && (*src)) ? ((*dst) * (*src)) >> 8 : 0; (*dst) = (tmp <= 255 ? tmp : 255); src += incr; dst += incr; }); }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_MULT (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_MULT (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_MULT (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_MULT (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_rgba_min (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (!dstppa) { blit_blend_min (info); return; } if (srcbpp == 4 && dstbpp == 4 && srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask && srcfmt->Amask == dstfmt->Amask && srcfmt->Amask) { int incr = srcpxskip > 0 ? 1 : -1; if (incr < 0) { src += 3; dst += 3; } while (height--) { LOOP_UNROLLED4( { REPEAT_4( { if ((*src) < (*dst)) (*dst) = (*src); src += incr; dst += incr; }); }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_MIN (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_MIN (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_MIN (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_MIN (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_rgba_max (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (!dstppa) { blit_blend_max (info); return; } if (srcbpp == 4 && dstbpp == 4 && srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask && srcfmt->Amask == dstfmt->Amask && srcfmt->Amask) { int incr = srcpxskip > 0 ? 1 : -1; if (incr < 0) { src += 3; dst += 3; } while (height--) { LOOP_UNROLLED4( { REPEAT_4( { if ((*src) > (*dst)) (*dst) = (*src); src += incr; dst += incr; }); }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_MAX (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_MAX (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_MAX (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_MAX (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_premultiplied (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); int tmp; /* printf ("Premultiplied alpha blit with %d and %d\n", srcbpp, dstbpp); */ if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND_PREMULTIPLIED (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND_PREMULTIPLIED (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND_PREMULTIPLIED (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND_PREMULTIPLIED (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } /* --------------------------------------------------------- */ static void blit_blend_add (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; Uint32 tmp; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (srcbpp >= 3 && dstbpp >= 3 && !(srcfmt->Amask)) { size_t srcoffsetR, srcoffsetG, srcoffsetB; size_t dstoffsetR, dstoffsetG, dstoffsetB; if (srcbpp == 3) { SET_OFFSETS_24 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } else { SET_OFFSETS_32 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } if (dstbpp == 3) { SET_OFFSETS_24 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } else { SET_OFFSETS_32 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } while (height--) { LOOP_UNROLLED4( { tmp = dst[dstoffsetR] + src[srcoffsetR]; dst[dstoffsetR] = (tmp <= 255 ? tmp : 255); tmp = dst[dstoffsetG] + src[srcoffsetG]; dst[dstoffsetG] = (tmp <= 255 ? tmp : 255); tmp = dst[dstoffsetB] + src[srcoffsetB]; dst[dstoffsetB] = (tmp <= 255 ? tmp : 255); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_sub (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; Sint32 tmp2; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (srcbpp >= 3 && dstbpp >= 3 && !(srcfmt->Amask)) { size_t srcoffsetR, srcoffsetG, srcoffsetB; size_t dstoffsetR, dstoffsetG, dstoffsetB; if (srcbpp == 3) { SET_OFFSETS_24 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } else { SET_OFFSETS_32 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } if (dstbpp == 3) { SET_OFFSETS_24 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } else { SET_OFFSETS_32 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } while (height--) { LOOP_UNROLLED4( { tmp2 = dst[dstoffsetR] - src[srcoffsetR]; dst[dstoffsetR] = (tmp2 >= 0 ? tmp2 : 0); tmp2 = dst[dstoffsetG] - src[srcoffsetG]; dst[dstoffsetG] = (tmp2 >= 0 ? tmp2 : 0); tmp2 = dst[dstoffsetB] - src[srcoffsetB]; dst[dstoffsetB] = (tmp2 >= 0 ? tmp2 : 0); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstfmt); BLEND_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_mul (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; Uint32 tmp; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (srcbpp >= 3 && dstbpp >= 3 && !(srcfmt->Amask)) { size_t srcoffsetR, srcoffsetG, srcoffsetB; size_t dstoffsetR, dstoffsetG, dstoffsetB; if (srcbpp == 3) { SET_OFFSETS_24 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } else { SET_OFFSETS_32 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } if (dstbpp == 3) { SET_OFFSETS_24 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } else { SET_OFFSETS_32 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } while (height--) { LOOP_UNROLLED4( { tmp = ((dst[dstoffsetR] && src[srcoffsetR]) ? (dst[dstoffsetR] * src[srcoffsetR]) >> 8 : 0); dst[dstoffsetR] = (tmp <= 255 ? tmp : 255); tmp = ((dst[dstoffsetG] && src[srcoffsetG]) ? (dst[dstoffsetG] * src[srcoffsetG]) >> 8 : 0); dst[dstoffsetG] = (tmp <= 255 ? tmp : 255); tmp = ((dst[dstoffsetB] && src[srcoffsetB]) ? (dst[dstoffsetB] * src[srcoffsetB]) >> 8 : 0); dst[dstoffsetB] = (tmp <= 255 ? tmp : 255); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_MULT (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MULT (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MULT (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_MULT (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MULT (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MULT (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_min (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (srcbpp >= 3 && dstbpp >= 3 && !(srcfmt->Amask)) { size_t srcoffsetR, srcoffsetG, srcoffsetB; size_t dstoffsetR, dstoffsetG, dstoffsetB; if (srcbpp == 3) { SET_OFFSETS_24 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } else { SET_OFFSETS_32 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } if (dstbpp == 3) { SET_OFFSETS_24 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } else { SET_OFFSETS_32 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } while (height--) { LOOP_UNROLLED4( { if (src[srcoffsetR] < dst[dstoffsetR]) { dst[dstoffsetR] = src[srcoffsetR]; } if (src[srcoffsetG] < dst[dstoffsetG]) { dst[dstoffsetG] = src[srcoffsetG]; } if (src[srcoffsetB] < dst[dstoffsetB]) { dst[dstoffsetB] = src[srcoffsetB]; } src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_MIN (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MIN (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MIN (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_MIN (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MIN (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MIN (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_max (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (srcbpp >= 3 && dstbpp >= 3 && !(srcfmt->Amask)) { size_t srcoffsetR, srcoffsetG, srcoffsetB; size_t dstoffsetR, dstoffsetG, dstoffsetB; if (srcbpp == 3) { SET_OFFSETS_24 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } else { SET_OFFSETS_32 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } if (dstbpp == 3) { SET_OFFSETS_24 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } else { SET_OFFSETS_32 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } while (height--) { LOOP_UNROLLED4( { if (src[srcoffsetR] > dst[dstoffsetR]) { dst[dstoffsetR] = src[srcoffsetR]; } if (src[srcoffsetG] > dst[dstoffsetG]) { dst[dstoffsetG] = src[srcoffsetG]; } if (src[srcoffsetB] > dst[dstoffsetB]) { dst[dstoffsetB] = src[srcoffsetB]; } src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_MAX (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MAX (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MAX (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_MAX (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MAX (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MAX (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } /* --------------------------------------------------------- */ static void alphablit_alpha (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; int dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); /* printf ("Alpha blit with %d and %d\n", srcbpp, dstbpp); */ if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } #if 0 static void alphablit_colorkey (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; int dR, dG, dB, dA, sR, sG, sB, sA; int alpha = 255; Uint32 colorkey = 0; // srcfmt->colorkey; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); /* printf ("Colorkey blit with %d and %d\n", srcbpp, dstbpp); */ if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); sA = (*src == colorkey) ? 0 : alpha; GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); sA = (*src == colorkey) ? 0 : alpha; GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); sA = (pixel == colorkey) ? 0 : alpha; GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { /* This is interim code until SDL can properly handle self blits of surfaces with blanket alpha. */ size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); sA = (pixel == colorkey) ? 0 : alpha; GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); sA = (pixel == colorkey) ? 0 : alpha; GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } #endif static void alphablit_solid (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; int dR, dG, dB, dA, sR, sG, sB, sA; int alpha = 255; int pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); /* printf ("Solid blit with %d and %d\n", srcbpp, dstbpp); */ if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND (sR, sG, sB, alpha, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, alpha, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND (sR, sG, sB, alpha, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { /* This is interim code until SDL can properly handle self blits of surfaces with blanket alpha. */ size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, alpha, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, alpha, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n ,width); src += srcskip; dst += dstskip; } } } } /*we assume the "dst" has pixel alpha*/ int pygame_Blit (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args) { SDL_Rect fulldst; int srcx, srcy, w, h; /* Make sure the surfaces aren't locked */ if (!src || !dst) { SDL_SetError ("SDL_UpperBlit: passed a NULL surface"); return (-1); } if (src->locked || dst->locked) { SDL_SetError ("Surfaces must not be locked during blit"); return (-1); } /* If the destination rectangle is NULL, use the entire dest surface */ if (dstrect == NULL) { fulldst.x = fulldst.y = 0; dstrect = &fulldst; } /* clip the source rectangle to the source surface */ if (srcrect) { int maxw, maxh; srcx = srcrect->x; w = srcrect->w; if (srcx < 0) { w += srcx; dstrect->x -= srcx; srcx = 0; } maxw = src->w - srcx; if (maxw < w) w = maxw; srcy = srcrect->y; h = srcrect->h; if (srcy < 0) { h += srcy; dstrect->y -= srcy; srcy = 0; } maxh = src->h - srcy; if (maxh < h) h = maxh; } else { srcx = srcy = 0; w = src->w; h = src->h; } /* clip the destination rectangle against the clip rectangle */ { SDL_Rect *clip = &dst->clip_rect; int dx, dy; dx = clip->x - dstrect->x; if (dx > 0) { w -= dx; dstrect->x += dx; srcx += dx; } dx = dstrect->x + w - clip->x - clip->w; if (dx > 0) w -= dx; dy = clip->y - dstrect->y; if (dy > 0) { h -= dy; dstrect->y += dy; srcy += dy; } dy = dstrect->y + h - clip->y - clip->h; if (dy > 0) h -= dy; } if (w > 0 && h > 0) { SDL_Rect sr; sr.x = srcx; sr.y = srcy; sr.w = dstrect->w = w; sr.h = dstrect->h = h; return SoftBlitPyGame (src, &sr, dst, dstrect, the_args); } dstrect->w = dstrect->h = 0; return 0; } int pygame_AlphaBlit (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args) { return pygame_Blit (src, srcrect, dst, dstrect, the_args); } ././@PaxHeader0000000000000000000000000000003100000000000010207 xustar0025 mtime=1753336711.1552 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/0000775000175000017500000000000015040345607016665 5ustar00tomtom././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1453653471.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/DejaVuSans.ttf0000664000175000017500000270455012651176737021437 0ustar00tomtom@FFTMo9ž¸LGDEF”#ŽBh”GPOS œ&öüžGSUB¹¿8Z¢ÞMATH§6€·ü>OS/2Y-v-¾<Vcmap‘Áʾ”îcvt i9Õ„þfpgmq4vjׄ«gaspØ0 glyfh„h1Ø<y\head]‡ Q˜6hhea Ÿ¿ QÐ$hmtxÅ5Øý Qôafkern ½E ³\?üloca`–ÆŒ óXaˆmaxpÎq Tà namemM¡ U=post xŽ ’ñõprep;ñ „hÌ=¢ÏÑ}ýôÑ}ýô(0Y°±ÅÆÆÇÊËÌÍÑÒÓÔäåéêóôôõõöö÷ÿ          $%%&JKKLNOSTrs€‘>??@ABIJPQVWö÷üý     ( ) + , ~   €  ‘ — ˜ ˜ ™ œ ž Ÿ ¶ · ¸ ¹ Ñ Ò Ò Ó­®º»»¼¼½æççèdeeffgghjkklvwëìóô !tu|}Ö×ר`±ÆÇÊÍרØÙÙÚäêíîõöö÷÷øúûýþÿ Ü\DFLTzarab†armn¨brai´cansÀcherÌcyrlØgeorôgrekhanihebrkana*lao 6latnFmath†nko ’ogam runr¬tfng¸thaiÆÿÿKUR SND URD ÿÿÿÿÿÿÿÿÿÿMKD SRB ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ4ISM 4KSM 4LSM 4MOL 4NSM 4ROM 4SKS 4SSM 4ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ kern8kern>markFmarkTmark\markdmkmkjmkmkrmkmkx    "*2:BLT\dlt|„Œž¦ŒÞ¦ØfF ü f!<":#ø8ª9Ò;‚=4BÞC^FüX„q´ròš 0&: þ þÔýóux}ux}Ú® *06<BHNTZ`flrx~„Š–œ:¤:Ü::ܤ:þr:ü Äü4 Ä4Ð `Kstvwyz{|~uvwxyz{|Kstvwyz{|~uvwxyz{|RX^djpv|‚ˆŽ”𠦬²¸¾Ä°°°°°°°°°°°°°°°°°°°°$ ýlýàIFG ý¨ý¨N>X  &,ý„öýlwýlwýlwýfný„ö?BCDEHQV &,28ýl`ýl~ýl~ýl`ýl~ýl`Z&” #HNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöüþýÞþýÞþþþþþýÚþþþþþþþþ‰þþ‰þþ‰þýÚþþþþtþþtþþþþþþ;þþþþþþ8þþ8þþ8þþ¿þýÚþþþþþþ þþþþþþþþþþþþþýÚÇÊÍÑÔâ êíøúþÿ!" ÇÊÍÑÔ× Úâ êíøúþÿ !†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþBÞŽ :v|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌþhþhþhþ=þþþDþþþÅþþhþhþ¨þ¨þhþVþDþ“þþhþhþ=þÐþDþDþþþþÚþnnnnþþþþþhþhþþþþþþþþøþøþøþøþøþøþÛþøþøþ±Âîîðóõõ÷÷ûý   !÷ü# ‘ —)01 2××9 ±Âîîðóõõ÷÷ûý÷ü ‘ —% ,××78âèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,þ{þ{þ{þ°þþþþþþ{þ{þ{þ{þ{þ{þ{þþþþþ{þ{þ°þþþþ{þ{þ{þþ{þþþþþ{þ{þþþþþþþþ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{¸®Ú $6HZl~ cÿœÈÿj cÿœÈÿj cÿœÈÿj cÿœÈÿj cÿœÈýÚ cÿœÈýÚ cÿœÈÿj cÿœÈÿjìó%ux}>DJPV\bhntz€†Œ’Æ< wðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ÞUÛø«,«Áå£!ì¸þ8©|ÿúšQþ'Änâââÿœÿœôþ ýÚ¼þpÿœ„þpôÿj„ÿj„ÿj,ýv,ý¨,ývÂÿjÂÿjôþ ôþ Xý¨Xý¨Xý¨XýD[ÿj[ÿj×ý¨×ý¨,ÿœ ÿ8¼ýÚ ÿ8¼þ>ðý¨îþ>ôÿjôþ ¼þp¼ýÚ„ÿj¼ýÚ„ÿj„ÿj„ý¨„þ^„ÿj„ý¨„ÿj„ý¨,ý¨,ý¨,ý¨,ý¨,ý¨,ý¨,ý¨Âÿjôþ^ôþpôþpÂÿjóþ¢ÂÿjÂÿjÂÿjôþ ôþ ôþ ôþ ôþ ôþ ôþ ôþ ôþ Xý¨Xý¨Xý¨Xý¨Xý¨[ÿj×ý¨ ÿ8¶þp¶þp ÿ8¶ýv ÿ8¼ýÚ¼ýÚ ÿj ÿj ÿj ÿ8 ÿ8 ýv ÿj ÿj ÿj þp ýD ÿj¼þ>¼þ>¼þ>îü®ýDîþ>îþ>ýîþ> ÿj,ý¨ôþ ôþ ôþ ôþ ¼þp¼þpÕüšôÿjI«^`’k/©ÕÝ#€eÝ€YYY„ý¨„ý¨+ýÚ+ýÚ„ý¨„ý¨+ýÚ+ýÚ„ý¨„ý¨+ýÚ+ýÚ„ÿj„ÿj+ÿœ+ÿœ„ÿj„ÿj+ÿœ+ÿœ„ÿj„ÿj+ÿœ+ÿœ ÿ8 ÿ8ôÿjÿj ÿ8 ÿ8ôÿjÿj,ý¨,ý¨Xþ Xþ ,ý¨,ý¨XÿXÿ,ý¨,ý¨Xþ Xþ ,ý¨,ý¨Xþ Xþ óþ¢óþ¢ÂÿjÂÿjÂÿjÂÿjÂÿjÂÿjôþ ôþ ôþ ôþ  ÿj ÿj,ÿj,ÿj ÿj ÿj,ÿj,ÿj ýD ýDývýv ÿj ÿj,ÿj,ÿjîþ>îý¨îþ>îý¨+ÿœ+ÿœ ÿjRý¨Âÿjôý¨ ÿ8 ÿ8,ÿj,ÿjôþ ôþ ôþ ôþ ôþ ôþ ôþ ôþ ÕüšÕüš+ýÚ+ýÚ+ÿœ+ÿœ¼þp¼þp+þ¢+þ¢,ÿœ,ÿœ,ÿœÅÿœ,þ ,ÿœ,ÿœ,ÿœ,ÿœ,þÔ,þÔ,ÿœ,ÿœ,ÿœ,ÿœô2ÿœÿœÿœÿœôþ ôþ ý¨ý¨¼þp¼þp+ÿœ+ÿœÿœÿœ„þp„þp+þ¢+þ¢ôÿjôÿj„ÿj„ÿj+ÿœ+ÿœ„ÿj„ÿj+ÿœ+ÿœ,ý¨,ý¨Xþ¢Xþ¢,ý¨,ý¨XÿœXÿœ,ý¨,ý¨XÿœXÿœÂÿjÂÿjÂÿjÂÿjôþ ôþ ôþ ôþ Xý¨Xý¨ŠÿjŠÿjXý¨Xý¨ŠÿjŠÿjXý¨Xý¨&ÿj&ÿjXý¨Xý¨&ÿj&ÿj[ÿj[ÿjSÿjSÿj[ÿj[ÿjSÿjSÿjŠý¨×ý¨XÿœîÿœŠý¨×ý¨Xÿœîÿœ ÿ8 ÿ8ôÿjÿj¼ýÚ¼ý¨ôÿjÿj ÿ8 ÿ8,ÿj,ÿj¼þ>¼þ>SÿœSÿœðý¨ðý¨&ÿj&ÿjîþ>îý¨+ÿœ+ÿœôÿjôÿjÂÿjôý¨ôþ ôþ ¼þp¼þp¼ýÚ¼ýÚ+þ¢+þ¢„ÿj+ÿœ+ÿœ ÿ8ôÿjÿj¼ý™ôÿjÿj+ÿœ+ÿœ„þ^+þÂ+þ„ÿj+ÿœ+ÿœ,ý¨XÿœXÿœ,ý¨XÿœXÿœ,ý¨XÿœXÿœ,ý¨Xþ Xþ ôþ ôþ ¼þ>SÿœSÿœ¼þp+þ¢+þ¢ôþ ôÿjIII«««^^^```’’’kkk///©©©ÕÕÕÝÝÝ###€€€eeeÝÝÝ€€€YYYYYYYYYôþ^ôþpôþpÂÿjÂÿjôþ ôþ ôþ ôþ ôþ Xý¨èþpèþpXý¨èýÚèýÚXý¨èýÚèýÚXý¨ þp þpXý¨&ÿj&ÿj[ÿjSÿjSÿj×ý¨Xÿœîÿœ¶þpóþ¢óþ¢¶þpóþ¢óþ¢¶ývôý¨ôý¨¼ý™ôÿjÿj¼ý™ôÿjÿj ÿj¤ÿj¤ÿj ÿj,ÿj,ÿj ÿ8,ÿj,ÿj ývý¨ý¨ ÿj,ÿj,ÿj þpþ¢þ¢ ÿj,ÿj,ÿj¼þ>SÿœSÿœ¼þ>SÿœSÿœîü®+ýÚIýÚü•+þ¢+þ¢üc+þÂ+þÂîý¨+ÿœ+ÿœ &COrŽB’àDõ“èS±hë'1¡3D¬`h¾jjÇ}ÖÈä8"%ux}BHNTZ`flrx~„Š–œÿÿôÆú 06<BHNTZ`flrx~„Š–œ¢¨®´cŒÑ0ò0¬0™080µ00q=i0Õ0è0«0Ø10Íf0ä0j=Æ0P&,.244 67 9:<@ºº™0¸®è $6HZl~ cr– cr– cr–ä cr–ä cr–Ü cr–Ü cr–Ü cr–ÜìóKstvwyz{|~»uvwxyz{|Z`flrx~„Š–œ¢¨®´ºÀÆÌÒØ`°°°°°°°°°°°°`°°°°°°°°LîŒ \ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜR``S`ž4Âârôr„èÂL„R„LŠèŠèŠâèâ¼î¼èX X X X [r[rÂ~Âx,°¼LôL¼ÜŠŠ¶ŠèÂRôîôîôî„èôL„â„L„è„R„è„è„L„芊܊èŠèŠÜŠèŠèÂ@èèÂ@ÂâèÂܪÂܼx¼°¼î¼î¼î¼î¼è¼â¼âX X X X X [rôr¼L¼L¼L¼L¼L¼LôLôLôxôxôx99¼Üôxôxôxôxôxôx¼4¼4¼fŠŠèŠî¼_Šè¼âRLŠâôâôFôªôâôîôâôîÂRðIð«ð^ððð`ððàððnðð§ð©ðËðÝð#ðò€òðð”ðÝð€òYððððYðYð„è„è+è+è„è„è+è+è„è„è+è+è„L„L++„L„L++„â„â+ª+ª¼L¼Lô@ª¼L¼Lô@ªŠèŠèXèXèŠèŠèXèXèŠèŠèXèXèŠèŠèXèXèèèÂâÂâÂÜÂÜÂ@Â@¼â¼â¼x¼xôxôxúúôxôxú¤ú¤ôxôxú¤ú¤ôxôxllŠîŠŠ¼_¼e+ª+ªRLR ôLô 99žžôFôFôâôâôªôªôâôâôîXî+è+è+è+èôîXV+è+è,¤,¤,:Ű,°,Ü,Ü,:,:,°,°,,,:,:ÂLÐИ˜ÂâÂârrôX+F+Frr„è„è+è+èÂL&L„R„R++„L„L++ŠèŠèXèXèŠèŠèXèXèŠâŠâX~X~èèââ¼î¼î¼è¼èX X ЄЄX X RâRâX X & & X X &è&è[r[rSrSr[r[rSrSrÂ~ôèÂ~îèÂxô~Âxî~¼L¼LôF°ôLôRôF°¼Ü¼ÜúúŠŠSrSrжŠR&R&RŠèŠî++ÂR&RôLô ôîôîôîXVôîXî+è+è„è+è+è¼LôL¶ôRôL¶++„R++„è++ŠXªXªŠÜXxXxŠÜXxXxŠâX~X~¼î¼î¼4S4S4¼¶+°+°¼°&RðððIðIðIð«ð«ð«ð^ð^ð^ððððððð`ð`ð`ððððàðàðàððððnðnðnðððð§ð§ð§ð©ð©ð©ðËðËðËðÝðÝðÝð#ð#ð#ðòòò€ò€ò€òðððððð”ð”ð”ðÝðÝðÝð€ò€ò€òYðYðYððððððððððYðYðYðYðYðYðèèÂ@ªÂܼî¼î¼î¼è¼âX RRX ЄЄX RâRâX & & X XâXâ[rSrSrôxôrîx¼LôL¶¼LôF°¼LôL¶ôRôF°ôRô@ªôxxxxxôxúú9¤¤¼Üúúôxú¤ú¤ôxú¤ú¤ôxff¼4S4S4¼fSfSfŠSrSrŠî++Šî++¼è++''11::OrŽ'’à)õxèS–hë'1†3D‘`h£jj¬}Ö­ä8Kstvwyz{|~»uvwxyz{|z€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(`°°°°°°°°°°°°{{{{{{{{`°°°°°°°°ö <BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞä]xÜþxÿ@€[")ÿ@>Eö"~~€x2 x::"<abFGI"> @FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîô]kxyyÜyšxy€z[f"w)h>yEy`Pö["~[~t`€zxy2{` ”ˆuxJJ:ˆ:ˆ"<PP__ab ?BCDEHQRSTUV 28>DJPV\bhnttbbbbt`~~`~` Z ¦þR© ÇÊÍÑÔ× Úä êíøúþÿ!"#ޔ𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZþÿÿþÿÿþþþÿþþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿþþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿŒ¶” •,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððð#$=D]šš4ºº5ÆÇ6ÐÑ8óó:();AA=HH>QR?YYAaaBy{CFGHI**J77KTTLÐÐM  NèêXíî[ôô]øù^`d$o&*y/2~9E‚IMGG”eg ððbNj $*06<Jìm–s}ìPþ‰ÃÐÕí-  ±² þ{þ{ŒÖ’ Y´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÿL-ž./++'¢î¾Ñ¦f–s.}////'sÑÿþ€Ñþ€–////s}\'Ä/'¾–ˆþR///‡ÂRJsþR//'s{y5D;Í+¢.’/}þRY$&'(+,01268=DFGHKLPQRVX]ޑ𮝰±ºÃÆÇÕêëìíîïòó-HQRYayz{‘’ÊËÌÍ*7T + , Å Æèô!"?@CDELGãØþî ¶( µlrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤‹‹‹‹‹‹‹‹‹‹¼¼Lìžž\/.þRž™sõ'ž'}“sî¼õÍr¾J·¤f–;¦þR¦þR¦é¦s¦þRˆþR%ô}^Gb`þR////'ã}sJÿþ€Ñþ€ìf–ªÐ////¦‰þRssô};·\f'Ä7þR/'þz`þR¾–ˆþR///¦ô¼î¼ž”.þRþR'}r`þR‡TÖ¦TþRTcRRJ@@îþRjþRjþR¦bþRb}þR¦¦þR€™þþRîþRééþRéþR‰þR‰þR‰sé¦þR555þRþRaþRƒt;Q'þRþRþRñþRþRþRôþR}}^G^dþRþRþR°:°:þR'aH¦£ÿöþR«þR_ˆþR°:þþþRþGþRŽ þR~þRJ}'/'}ž¦'}^T¦TT@¦X‚}±½½½Tg^GþX^¦þRìfìþ‰fþ‰ìþ¿fþ¿ìþtfþtìþfþ//“èLBRþRfÖÞ,4$þR'„˜_úzþRf4÷ÆŽLÆó}÷`þRüe·™™žTô¦ž¦¾'sþR¼Ãÿä^õG^£5sÔ“þR¾þR/þR‰þRwþRžþRJþVÑ1×ÅÑüvüvÿöüvþRž®•’Ë®;Ínž¦þRªÄþR'ˆþRÛþR þR¦þR÷þRõ¦\¦þRž¦õ¦}“%fOœ’œ©L5s/Ìõî<\’‘þRô&ÕRäx9Ô´\‹‹w‹‹‹‹‹‹‹þRŠÇ}þR^$= D]$Ž‘>ššB¨¨C®²DººIÃÃJÆÇKÐÑMÕÕOèïPòóXúúZ  [\]()^--`AAaEEbHHcNNdQReTTgYYhaailljvvky{l‘’oÊÍqöøu xJ€Lg½ikÙmmÜFFÝIIÞLL߈ˆàššáêëâä""æ33ç66è|}éghëjoírzó~‚ü†‹ÐÐ   + , Å Æ ÷ ø š š ¢ ¥ § © ¬ ¬ ¯ ´! » »' ¿ ¿( à Ä) Æ È+ Ê Ê. Ì Ð/ Ó Ö4 Ë Ë8ÛÛ9ÝÞ:àñ<óõNøùQ??ST  X Z*f/2v8Mzt†žž£  ¤ÕÞ¥GH¯__±ii²ss³ãã´ ÇÊÍÑÔ× Úä êíøúþÿ!"#ޔ𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZþÿÿþÿÿþþþÿþþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿþþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿHz” iÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬´ºÂÈÐÖÜâèîôú &,4:@FLRX^djrx~†Œ’˜ ¦¬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü"(.4:@FNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäìòøþ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú &,28>DJRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü"(.4:@FLRX^djpv|‚ˆŽ–œ¢¨®´ºÀÆÌÒØàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`f‹ð‹ð‹ð‹ð‹ð‹ð‹ð‹ð‹ð‹ð¼ð¼ðLðìðžðžð\ðð/ð.ðžð*ðsðõð'ðžð'ð}ð“ðsðîð¼ðõðÍðrð¾ðJ{#ð¤{þð–{àðj{ð//ððé{‰{s{ ¦{o{{'{ð}{^{G{b{`{{'ðã{¦{}ðs{ð¼ðJ{#þðªðQð{¦{‰{{sðð}{àððð\ðLðþðXð'ðÄðžð;ð\ð¿ð/ð/ððð‚ðõð'ððÀð'{ððsððsð§ðrð`{¾ð{¾ð–ðˆ{'ðð‰{ð{¼ðîð¼ðžð{.ð/'ð}ð{rð`{‡{T{Ö{ðÎ{¦{þðþðc{R{R{J|@{@{î{{jðj{¦{b{b{}{ðð/{€{™ðþðððé{é{é{‰{‰{‰{s{{é{¦ð3{3ð3{^{a{p{‚{;{Q{'{ððñ{ð{ð}{}{^{G{^ðd{{{{{°ð:ð°ð:ð'ða{H{¦ð£{/«{{jð°ð:ðþðþðþðGðŽ{ ððJ{~ð^{}ðJ|Eð‰{}ð{£{‚ð‡{{Eð}{p{¦{t{}{j{{ª{b{¤{^{~ð~ð ðî{}{t{^{ï{¦{¦{/'ð¦{ò{ð¦{Hð“ð/ðÕðrðð¼ð¼ð¼ð™ðtðžðOðsðõðîð}ðsðð'ððžðLðsðoðqðÍðð²ðGðGðYð‡ð¼ðNðsðàðT{›ða{E{ö{{›{@{‚{t{ø{{‚{}{{¦{¦{T{`{kðb{{K{©{©{{{{²{ö{t{¦{'{///ú{ó{4ð{¼ð^{óðc{sðö{„ð"{Oð–{,ðs{Oð–{ð%ú'ð}{ð•{žð¦{Oð›{îðt{îðt{îðððe{ðsðK{£{‰{{'ð}{E{Íðb{ø{îðt{ø{‚{^{{{T{¦{TƒT{{@{¦{{{‚{}{±{½{½{½{{{{{T{g{b{^{G{{þ{{^{ø{¦{ìðþðìðþðìðþðìðþð“ðèðLðBðRðfðÆðÖðÞð,ð4â${ð'ð „ð˜ð_âúâzðfð4ðÊDÆðŽðLððÆðóçç}1÷{`{üðeðð*ðð*ðžð}ðT{ðððžðð¾ð{'ðsð¼ðÃÓ^{õðG{^{ð£{ª{3ðs{Ô{“ð¾ðˆðžð/ð³ð {0ðÆ{™ðö{Õð{™ð{'ðlðÚ{nð{T{T{ððwðžðJ{{ðÑ{1ð×{ÅðÑ{üðv{üðvqüðv{žðð*ð’ð\ð®ð;ðÍ{nð{žð¦{ªðÄ{'ðo{ððÛð{ðð‰{²ð÷ðõð‰{\ðj{žððõð‰{}ð{“ð'{fðOï’©{Lð5ðsð/ˆÌðõðîð<ðð\ð’ð‘ððôðð&ððÕðRðäðx÷9÷Ô÷´{\{‹ð‹ðwð‹ð‹ð‹ð‹ð‹ð‹ð‹ðõð{{êðð{{{Çð}{w$= D]$šš>¨©?²²AººBÀÀCÆÇDÑÑFèéGóóIúúJ  KL()M55OABPEERHISNNUPVVXY][]___baacffdijelpgt{l¬¬töùu yJLg¾ikÚmmÝE]Þde÷iiùkkúmmûooüwwý„ŠþŒŒ˜šž £¬ ®ÌÎã5èïKóS b"#h*+j.6l@@uMMvXXw^^xbby|}z‹‹|’“}§§²³€µµ‚··ƒgo„r{~‚—…‹œ£ÐФ ¥ ÷ ø­ š š¯ ¢ ¥° § ©´ ¬ ¬· ¯ ´¸ » »¾ ¿ ¿¿ à ÄÀ Æ ÈÂ Ê ÊÅ Ì ÐÆ Ó ÖË Ë ËÏÛõÐøùë%%í99î??ïÔ×ðÚàôâåûèèÿêê   *,,#.2$7M)t†@žžS  TÕÞUFH___biicmmdpqessgããh ±Åîóõõ÷÷ûý "#÷ü( ‘ —. 5××@A$*06>FLRX`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>FNTZ`flrx~„Š–þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þŠoþrþrþ{þŠrþ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{ýŽ{þ{þA{þ{üê{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{ þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{>þD >DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìØÀX(ÿþ³l>túþV(t>\X(¾–ˆþR‡ÂDtþR<D$(,28<=DHLRX\]šºóHYayz{*7TèGÙýô&ð!0# 5PÿÓÿ·Kr9KÿDÿˆÿ­ÿšÿ &ÿÉÿÜ&ÿÓKÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿÜÿÜÿaÿaÿuÿ­ÿþøÿ/ÿÜÿÜÿÜÿÜÿÁÿ·ÿÿÁÿÜÿÜÿÜÿÜÿÜÿÜÿ·ÿÿÜÿ·ÿÿÿ­ÿÜÿÜÿÜÿÜÿÜ&ÿÜÿÜÿÿÜÿÜÿÜÿÿÿÓÿÉÿDþ·ÿaÿDÿÜÿÜÿDÿÿkÿ·ÿkÿÿDÿDÿÿ·ÿÿDÿDÿÿkÿ·ÿÜÿÜÿÿDÿ·ÿÜÿ·ÿDÿÓþˆÿ·ÿšÿÜÿÜÿÓÿÓÿÉÿÜÿ·ÿÁÿ·ÿ·ÿÜÿÜÿÜÿ·ÿÁÿÿ)ÿÜÿÿÿaÿÉÿ·ÿ·ÿÜÿšÿšÿšÿkÿ}ÿÿÜÿšÿšÿšÿÁÿÁÿÜ/ÿ·þæÿšÿÿDþðÿÜÿÜÿÜÿDÿÜÿÜÿÜþaýæ9ÿ­ÿÜÿÜÿÜÿ}ÿÿÜÿÓÿÜÿDÿÓþÁÿ}ÿÓÿ¤ÿ·ÿÓÿÜÿ·ÿÜÿÜÿÜÿÜÿ¤ÿ·ÿ·ÿÜ&&þ·9ÿÓÿÜÿ}ÿ­ÿ·ÿÁÿ­ÿšÿkÿÿ­ÿ}ÿÓÿ¤ÿ¤ÿ¤ÿÿÿÜÿšÿÓÿ¤ÿ¤ÿ¤ÿkÿ}ÿÜ&ÿDÿ ÿÿaÿˆÿÜþ­þ¤þ¤ÿÁþ¤þÓþ­þÉþ­þÁÿDÿÿˆÿþàþôþçþ¤ÿÓþøÿÜÿˆþøÿYÿ}ÿÜÿaÿaÿÓÿaÿuÿÉÿNÿÿaÿaÿaÿuþæÿ­ÿÿˆÿÿ}ÿˆÿÓÿˆÿ¤ÿ·ÿÜÿÿÜÿ}ÿˆÿˆÿ·ÿÜþøÿšÿkÿ}ÿÜÿ¤ÿÿkÿ¤ÿaÿ­ÿÓÿ þaþðÿaÿÿþæþðÿ·þðÿÿÿkÿþæþðþðÿÿÿÜþøÿÜÿÜÿÜÿÜÿÜÿÿkÿ·ÿÜÿÜÿÜÿ·ÿÜAÿÿÜÿ·ÿ·ÿÁÿ·ÿÜÿ·ÿ·ÿÁÿkÿÿ¤&ÿÜÿÁÿkÿ·ÿ}ÿ}ÿDÿÜÿÓÿÜÿÓÿÜÿÜÿÓÿÜÿÉÿ·ÿÓÿÓÿÓHVþÉÿÉÿaÿÿÜÿÜÿÜþðÿDÿÿÜÿÜÿ)ÿÜÿÁÿÁÿÁÿÁÿÜÿÜþÜÿkÿÜÿÜþÓÿÜÿÜÿÜÿÜÿÜÿÿÿÜÿkÿÜÿÜÿÜ—ÿÜÿÜÿ·ÿ·ÿÜÿÜÿÜÿÜÿDÿNÿÿÿÿÜÿÜÿÜÿÜÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿÜþøÿ/ÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿÜÿþøÿ/ÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿþøÿ/ÿ­ÿ¤ÿÿÜÿÜÿÜ&ÿkÿ·ÿÜÿD&ÿÿÿ­ÿ¤ÿÿ·ÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿÜÿþøÿ/ÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿ·ÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿÜÿþøÿ/ÿÜÿÜÿÿÜÿÜÿÓÿÉÿDÿ?ÿ}ÿDÿÜÿÓÿÜÿÓÿÜÿÜÿÓÿÜÿÉÿ·ÿÓÿÓÿÓÿÜVþÉÿDÿ ÿÿaÿˆÿÜþ­þ¤þ¤ÿÁþ¤þÓþ­þÉþ­þÁÿDÿÿˆþ­þ¤þ¤þÉþ¤ÿÓþøÿÓÿ·Kr9KÿDÿˆÿ­ÿšÿ &ÿÉÿÜ&KþøÿÁÿ·ÿÁÿÁÿ·ÿÁÿ·ÿ·ÿˆÿÜÿ·ÿÿkÿÿ·ÿ·ÿ·þ}ÿ·ÿ·ÿkÿ·&ÿ·ÿÿ·ÿ·ÿ·/ÿÿþæþˆÿÿ·þˆÿÜÿ·ÿ·ÿ·ÿÿ<ÿ&ÿÿ·ÿ·ÿ·R$$%%&&''))**++-- .. // 22 33 445566778899::;;<<==HHIINNQQRRUUYYZZ[[ \\!mm"}}#‚‚$ƒ„%……&††%ˆˆ'‰‰(’’”˜ ›žŸŸ  )¡¡*ª­²²+³³´¸¿¿!ÁÁ!ÂÂ,ÄÄ,ÆÆ-ÈÈ(ÎÎ(ÐÐÒÒ.ÝÝààûû ÿÿ /  0  ""&&100::?? ò ò2 þ þ3 4 ¢$$%%&&''))** ++-- ./22 3344 5566 778899::;;<<==DDFFGGHHIIJKLLOOPPQQRRTTUUVV WW!XX"YY#ZZ$[[%\\&mm'}}(‚†ˆˆ)‰‰*”˜ ›žŸŸ ¡¢¢+££¤§+©©ªª,««¬­,²²-³³´´.µµ¶¸.»»/¼¼"½¾/¿¿&ÁÁ&ÂÂ0ÃÃ1ÄÄ0ÅÅ1ÆÆ0ÇÇ1ÈÈÉÉ2ÊÊ3ËË4ÌÌ3ÍÍ5ÎÎÏÏ2ÐÐÑÑ6ÓÓ7ÕÕ8××8ÙÙ8ÛÛ8ÝÝÞÞ3àà9ááââ3ää:ññ;õõ;ûûÿÿ  3<3<=<;    !! "" ## $$>%%5&&''!((?++@--@//@0011"33@55@66A77B88C99D::??ˆˆ4¬¬E­­F®®E¯¯FÚÚ ÜÜGÝÝ4ðð3ññHóó4ôôIõõJ } }A ~ ~K  L € €B A ‚ ‚B ï ïC ð ðD þ þM ÿ ÿN Oa$%&')*+-./23456789:;<=HINQRUYZ[\m}‚ƒ„…†ˆ‰’”•–—˜›œžŸ ¡ª«¬­²³´µ¶·¸¿ÁÂÄÆÈÎÐÒÝàûÿ  "&0:? ò þ `$XÿØÿ±ÿ£ÿœOgOSUY[_ ae J¸DFLTzarabŠarmnÄbraiÒcansÞcherêcyrlögeorgrek$hani4hebr@kanaRlao ^latnjmathònko þogamrunrtfng(thai4 KUR SND (URD (ÿÿ ÿÿ ÿÿ ÿÿÿÿÿÿMKD SRB ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿF CAT ZESP ZGAL ZISM bKSM bLSM bMOL vNSM bROM vSKS bSSM bÿÿ ÿÿÿÿ ÿÿ ÿÿ ÿÿÿÿÿÿÿÿ RQD°aalt¶aalt¼aaltÂcaseÈccmpÎccmpÔccmpÜccmpädligîdligôdligúfinafinahlig hliginitinitliga$liga,locl2locl8medi>mediDrligJrligTsalt\saltbsalth     (RZbjrŒ”œ¤¬´¼ÄÌÔÜäìôü $,4<DLT\dlt|„Œ”œR `Ô  ”ìDœôLŽÖfެ° ´ ø  ú  >    d F z     \ HXœ¬¼PTXv”ªÜàHPX`hp 9:;cW,,,Hõ   ï ï}Ö õ   ï ï}Ö&   B8%%88ŒŒŒ D9LMñ *_±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅîïðñòóôõ÷ûüý‡êì * È ‘ ’ “ ” ß àj$=EEGGIIKKLMNOWW‚˜š¡ÂÂÄÄÆÆÈÈÊÊÌÌÎÎÐÐÒÒÔÔÖÖØØÚÚÜÜÞÞààââääæêììîîððññòòôôööøøû      ""$$&&((**,,..0022446688:;==??AAHHRRTTVVyz‘“••¤¤¬¬®®ÚÚÜÜððôô  **__±ÅÇÊÍäêíîõöö÷÷øúûýþÿ‡‡êêìì * * È È ‘ ” ß à&!!!&   $$4F§«§§¨«""$$4F§«§##$$4F§«§$$$$4F§«§%%$$4F§«§ª««&&(0§§§OR'.6¨¨¨SSUW'.6©©©XY[\'.6ªªª]_aa'(0«««be' º¼/CèÅ: B}€ƒ†‰Œ’•˜›ž¡¤§ª­°³¶¹¼¿ÂÅÈËÎÑÔõîty{}…‡‹‘•™¡£¥§©­±µ¹½ÁÅÉÍÑÕÙÝáåçé'-ýõé36íùñ9<  ?äåæçè#héê`ëì!íîñô÷úý*  %?)1!-$b'*-05736;BECGIQeKjOgirŽ#’à%B~„‡Š“–™œŸ¢¥¨«®±´·º½ÀÃÆÉÌÏÒÕõªRƒ‰“—›Ÿ«¯³·»¿ÃÇËÏÓ×ÛßãOë)/ÿ÷ë58ïûó;> Aðóöùüÿ, 'A+ 3#/&d),/21958=DSgM SSUUW[`gioqrŽ’ ³Ø)ÝßOB‚…ˆ‹Ž‘”—𠣦©¬¯²µ¸»¾ÁÄÇÊÍÐÓÖõªR‚ˆŽ’–šžª®²¶º¾ÂÆÊÎÒÖÚÞâNê(.þöê47îúò:= @ïòõøûþ+  &@*2".%c(+.10847<CRfL SSUUW[`gioqrŽ’ ³Ø)ÝßO2  wyzy zxwuuxy~&8Jluyvy {|xy ||yy ywxvvtus |w{vstvwy| ò…ó…Ö×> $ðî{ìyñï{íyÖ×6 "(²IO±IL°O¯L®II²Rlž¨$*06<uzsyqxowmvlujthsR}P|O{ &,vztyrxpwnvisQ|S|Thprç2&B 8  ¹ó·ñ¶ëµü¸üëú´WV³WAˆ(:FPZfr +"  * )" Ò$; V ·0 ¸(/ ˜F žX R")567DFœœgfhdeji#9?FLTZgfhdeji#9?FLTZs_iF,-DO *"&s_iãF,-DO\ …8 ×  ±²³´·¸¹»¼½À óùm!GHùóùpqno LMñ *_‡êì * È ß à§§«¬§«±§«¶§«»§«ggggg§« àèP< Ý‚`Õ``h`UvZZZZZZZZrZZ8û<(ú:0 ‚†ŠŽ’–šž¢®ºÆÒÞêö&2>JVbfjnr~Š–¢®ºÆÒÞêö&2>JVbfjnr~Š–¢®ºÆPp°ÐN ™K= P šK> P ›K? P@ µÂ@ ø ¶ÂA ø ·ÂB ø ¸ÂC ø ¹ÂD ø ºÂE ø »ÂF ø ¼ÂG ø ½ÂH ø JKI P KKJ P LKK P MKL PÈÞô n‘M ³o‘N ³p‘O ³qÂP ørÂQ øsÂR øtÂS øuÂT øvÂU øwÂV øxÂW øyÂX øzÂY ø{ÂZ ø|Â[ ø}Â\ ø~Â] øÂ^ ø€­_ D­` E0F\r ÜP   ÜQ   íR ± .ÜV   0ÜW   ZÜS   \ÜT   ^íU ± ´( u ³((  ²( – ·( u ¶((  µ( – º( u ¹((  ¸( q ½( f ¼(( ~ »( q À( r Á(( ˜ ¿(( Š Á(( ˜ ¾( ƒ_(_( Ä( r Á(( ˜ Ã(( Š Á(( ˜ Â( ƒ ø( ø( £( o Å(( ‰ ¢( l ¹(  ¸( q ¼( ~ »( q º( u ¹(  ½( f ¼( ~ ( (B((B((q(Vq(Vq(Vq(V >>@@^` ø ø ™ › µ ½ J M ’ •n Bq    . 0 Z \ ^3™3™×f çnÿÒýÿ $`) PfEd@ ÿÿþšmã`ÿßÿ, Ìä, Ì ää~éîó÷OSXZbw~ŠŒ¡%V_‡ŠÃÇêô  :UWZpt¿ÈÌÎÐÕùçõú?‚„ˆŠ—Ÿ£¥§«¹½ÄÆÍÙÝÅü5JR½ê>Pj…–¯ÞáGvœ#.[jx{}…¿ÉûEMWY[]}´ÄÓÛïôþ d q Ž œ µ º ½ Ñ × Ü á! !I!K!N!…!‰###!#(#,#u#z#}#‡#”#®#Ï#ã#å#è$#$i&œ&¸&Ã&â'' '''K'M'R'V'^'”'¯'¾'Æ'à'ë(ÿ)) )A)„)Õ)ë)û***/*k* *º*ú++$+T,w,-%-e-o...%..Mÿ¤ÿ¦G¦M¦Q¦W¦n¦¦•§§§+§A§K§S§W§g§ƒ§Ž§‘§ª§ÿïðô&ôAöÅûûû6û<û>ûAûDûOû£û­ûÜûßûéûÿþþ#þtþüþÿÿýÿÿ  ìó÷QWZ\pz„ŒŽ£1Ya‰°ÆÐð  !@WZ`tyÆËÎÐÕðÀëø?„‡Š”™¡¥§ª­»ÀÆÈÐÜ Ð 7LTÀì@RtŠ ÞáFn€&0]w{}…›Ä HPY[]_€¶ÆÖÝòö j t   ¸ ½ Ð Ö Û á!! !K!N!P!‰!###$#+#s#z#}#‡#”#›#Î#ã#å#è$"$`%&ž&À&â''' ')'M'O'V'X'a'˜'±'Å'à'æ'ð)) )@)ƒ)Î)ë)ú** */*j*}*®*ù+++S,`,y--0-o..."..MÀ¤Ð¦D¦L¦P¦T¦b¦Š¦”§§§"§0§F§N§V§d§€§‰§§ §øïðôô(öÅûûûû8û>û@ûCûFûRûªûÓûÞûäûüþþ þpþvþÿÿùÿÿÿãÿÂÿÀÿ¼ÿ¹ÿ±ÿ°ÿ­ÿ¬ÿ«ÿžÿœÿ—ÿ–ÿ•ÿ”ÿ‰ÿ‡ÿ†ÿ…ÿ`ÿ^ÿVÿQÿ@ÿ?ÿ>ÿ6ÿ1ÿ.ÿ-ÿ(ÿ'ÿ%ÿ ÿÿÿÿÿÿÿ þñþ+þ(þ&÷â÷¡÷ ÷ž÷÷›÷•÷”÷“÷’÷‘÷÷Ž÷÷‹÷Š÷‰÷‡÷…õÃõ¹òµò´ò³ò²ò±ò°ò®ò­ò¥ò¤ò£òšò–òò_ò]ñùñÓñÊëgëfëdëcëbëVëTëSëLë7ë3êýêùê÷êõêóêñêðêïêîêíêëêêêéêçêæêäêãêâêÝêÛêÚê×êÕêÓêÁê½êºê¶ê˜ê—ê–ê”ê“êêŠê„ê‚ê€ê~ê8ê4ê2ê)êêéøéåéäéâé©émè×èÖèÏè±è“è’èèèŽèèŠè‰è‡è„èƒè}èdè_è[èUèSèçÞç•ç€çrçnçeçSççæûæ½æ¸æ´æ†å{åzäúäðäçä?ä9ä7ä/ÄžmÎlŠl†l„l‚lxl]lWkåkákßkÛk×kÕkÓkÇk¯kªk©k›kN$N#hlk订œ›š™˜–kjfTTDø÷õü  ~ ébìî¬óó¯÷÷°O±QSWXZZ\bpwz~„ŠŒŒ"Ž¡#£%71VºY_àa‡ç‰Š°ÃÆÇ$Ðê&ðôAF  H  JKLM!:N@UhWW~ZZ`p€tt‘y¿’ÆÈÙËÌÜÎÎÞÐÐßÕÕàðùáÀçëëõøú??!‚"„„$‡ˆ%ŠŠ'(”—)™Ÿ-¡£4¥¥7§§8ª«9­¹;»½HÀÄKÆÆPÈÍQÐÙWÜÝa ÅcÐü‰¶ ½5Ð7JéLRýT½Àênì™>µ@PäRjõt…Š–  ¯-ÞÞ=áá>FG?nvA€œJg#|&.Š0[“]j¿wxÍ{{Ï}}Ð……Ñ›¿ÒÄÉ÷ûý ù  E HM ;PW AYY I[[ J]] K_} L€´ k¶Ä  ÆÓ ¯ÖÛ ½Ýï Ãòô Ööþ Ù d â j q G t Ž O œ j   µ w ¸ º ½ ½ Ð Ñ ‘ Ö × “ Û Ü • á á —!! ˜! !I ¢!K!K á!N!N â!P!… ã!‰!‰ !# ## œ##! ž#$#( ¤#+#, ©#s#u «#z#z ®#}#} ¯#‡#‡ °#”#” ±#›#® ²#Î#Ï Æ#ã#ã È#å#å É#è#è Ê$"$# Ë$`$i Í%&œ ×&ž&¸t&À&Ã&â&â“''”'' ˜' ''œ')'K¸'M'MÛ'O'RÜ'V'Và'X'^á'a'”è'˜'¯'±'¾4'Å'ÆB'à'àD'æ'ëE'ð(ÿK))[) ) ])@)A_)ƒ)„a)Î)Õc)ë)ëk)ú)ûl**n* *q*/*/‚*j*kƒ*}* …*®*º©*ù*ú¶++¸++$Ó+S+TÙ,`,wÛ,y,ó--%ú-0-e -o-oV..W..X.".%Y....]MÀMÿ^¤Ð¤ÿž¦D¦GΦL¦MÒ¦P¦QÔ¦T¦WÖ¦b¦nÚ¦Š¦禔¦•ë§§í§§ü§"§+§0§A §F§K§N§S#§V§W)§d§g+§€§ƒ/§‰§Ž3§§‘9§ §ª;§ø§ÿFïïNððhôô&lô(ôA“öÅöÅ­ûû®ûûµûû6ºû8û<Ôû>û>Ùû@ûAÚûCûDÜûFûOÞûRû£èûªû­:ûÓûÜ>ûÞûßHûäûéJûüûÿPþþTþ þ#dþpþthþvþümþÿþÿôÿùÿýõú #ÓÓVÕ8Õ9tÕ;Õ>vÕ@ÕDzÕFÕFÕJÕP€ÕRÕk‡Õ ÕÓ¡ר×ëÕîîéîîíî!î"î$î$ î'î' î)î2 î4î7î9î9î;î;îaîbîdîdîgîjîlîr#îtîw*îyî|.î~î~2ð0ð“3ð ð®—ð±ð¾¦ðÁðÏ´ðÑðßÃô-ô.Òô1ô1Ôô5ô5Õöö#Öö%ö+úö-ö@   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a†‡‰‹“˜ž£¢¤¦¥§©«ª¬­¯®°±³µ´¶¸·¼»½¾ rdei x¡pk ¹vj ꈚ ¨s î ïgw Œ › ™T µl|=¨ºcn ¤T Ò m} b‚…— õ ö þ ÿ ú û¹¡Á: & ƒ  ¯° y ü „ŒƒŠ‘Ž•–”œ›óˆžqš›œzŸ‰5¸ËËÁªœ¦¸fqË ²…u¸Ãˉ-˦ðÓª‡ËªJ3ËÙôT´œ99N´R¸çÍ7sÍ`s3¢V¦V9Åɸßsºé3¼Dßͪåªˤ{¸o{RÇÍššoËÍžÓðºƒÕ˜HžÕÁËöƒT3fÓǤ͚sÕ þ+¤´œbœ-ÕÕÕð{T¤¸#Ӹ˦Ãì“ Ó\qÛ…#¨H99`Õš#fy```{œw`ªé`b{Å{´RÍf¼fwÍ;…‰{ÍJ/œœ}oo5jo{®²-–{öƒT7öœáföÍD)fîs–·, °%Id°@QX ÈY!-,°%Id°@QX ÈY!-,  °P° y ¸ÿÿPXY°°%°%#á °P° y ¸ÿÿPXY°°%á-,KPX °ýEDY!-,°%E`D-,KSX°%°%EDY!!-,ED-,°%°%I°%°%I`° ch ŠŠ#:Še:-ÿÿfþ–f¤@ ûû/ÄÔì1ÔìÔì0!%!!füsüåþ–øòr)5Õ 5@ƒ üK° TX¹ÿÀ8Y<ì2991/äüÌ0¶ P ]%3#3#5ËËË¢þþÕýqþ›eŪéÕB@„üK°TK°T[X¹ÿÀ8YüÜì1ô<ì20@0 @ P ` p   ¿ ]#!#oª$ªÕýÕ+ýÕ+ž¾`@1 ‡  ‡   üÌ91/<Ô<<ü<<Ô<<Ä2ì220@   ]!! !3!!!!#!#!5!!5!þÝT%Dh$i g8þ¡R>þ›h gþÛg¡hþÅ`Tþ¾if…þ²‡þaŸþašþ²™þbžþbž™NšŸªþÓm!(/½@U" '&( /)/))/B" ) *!††#Љ*Љ- ) " & 0üK° TX¹ÿÀ8YK° TK°T[K°T[X¹@8Y<ìô<ü<ôäì1/äìÄÔäì2Äîî99990KSXíí9í9íY"#.'5.546753.'>54&´diÒjfÑoÝÉÚÌd]®SS¯\ãÖãÖdtzqá{þÓ---´@AÈ$¬–£¼ëè¯*.þU#´œ©Ãš jXV`ÕþOnZXhqÿã)ð #'3‰@6$%&%&'$'B’ ’.’$’ &Œ($‘4'!%   ! + 1 4üK° TK° T[K° T[K°T[K°T[K° T[X¹1ÿÀ8YÄìôìîöî991ä2ô<äìîöîî0KSXííY""32654&'2#"&546"32654&%3#2#"&546ÑWccWUccUžº» º»ü—VcbWWcd1 üZ ž¼»ŸŸ¹º‘”„‚••‚ƒ•Ü»»ÛÛ»¼Ûa•‚„””„–ùó Û»½ÚÛ¼ºÜÿãþð 0Í@–  † †  † †††  !         B  (('•+•'”$‘Œ .  .'.'!!1üìÄÔÔìÆî99999991/ÆäöæîîÆ9990KSXíí9í9í9í9í9íí9í9ííí9Y"²2]@² " ) **&:4D ^YZ UZZY0g{›š™—• “••"™-  ' (   2'') #**(/2; 49?2J LKFO2VZ Y UY\_2j i`2uy z““—•œœŸš › š 2 2°29]]3267 >73#'#"5467.54632.#"ò[UÔ _¦Iþ{ü;Bº h]ühäƒñþΆ†02Þ¸S¥UWžDiƒ;#Q¡X’Â?@ýøYËr„þþ~þã“YW×€ác?}<¢Å$$¶/1oX3gŪoÕ7@ „üK°TK°T[X¹ÿÀ8Yì1ôì0@ @P`p ]#oªÕýÕ+°þò{ 7@˜—  ÜK°TX¹ ÿÀ8YK°TX¹ @8Yä2ì991üì0#&547{†‚ƒ… –•”—æþ>ççþ;åëÆàßÄì¤þòo @˜— Ü<ôì991üì03#654¤ –••– …ƒƒìþ<ßàþ:ëåÅççÂ=JÃðN@,  ™ ™ ‘    Ô<ä2Ü<ä2991ôÔ<ì2Äì2990 %#'-73%Ãþ™g:þ°rþ°:gþ™:PrPßÂÃbËþ‡yËbÃÂcËyþ‡ËÙÛ #@ œ  Üü<ü<ì1/Ô<ü<Ä0!!#!5!®-ýÓ¨ýÓ-ýÓªýÓ-ª-žÿÃþ@ žƒüìÔÌ1üì073#ðÓ¤Rþ¬þÀ@d߃¶œÜÌ1Ôì0!!dý僤ۮþ·ƒüì1/ì073#ÛÓÓþþÿB²Õ-@BŸ/Ä991ôì0KSXííY"3#ªýøªÕùm‡ÿãð #@   ‘Œ üìôì1äôìî0"32'2#"‹œœû þ÷ûûþ÷ PþÍþÌþÍþÍ3343 þsþ†þ‡þsyzáZÕ @@B     ÔK°TX¹@8YìÄüì1/ì2ôìÔì0KSXY"´]7!5%3!!þJþ™eÊJü¤ªsH¸HúÕª–Jðž@'B¡”  ‘   üK°TK°T[K°T[X¹ÿÀ8YÄÔìÀÀ91/ì2ôìôì0KSXíí°9Y"@2UVVzzv‡tvust‚†‚‚‚¨¨]]%!!567>54&#"5>32‰ÁüLs3aM§†_ÓxzÔXèE[þôªªªw‘:m—Iw–BCÌ12èÂ\¥pþëœÿãsð(p@. † †     “  “#‘Œ£)&  )üK°TK°T[X¹ ÿÀ8YÄÄÔìôì991ìäôäìæîîîî90@ daa d!]!"&'532654&+532654&#"5>32?‘£þÐþè^ÇjTÈm¾Ç¹¥®¶•ž£˜S¾rsÉYæ Ž%ÄÝò%%Ã12–„•¦wps{$&´ Ѳ|«d¤Õ @   B     ÜK° TK° T[X¹ ÿÀ8YÔ<Äì291/äÔ<ì290KSXÉÉY"@* *HYiwŠ+&+6NO O Vfuz… ]] !33##!5þþ5þÕÕÉý^%üãÍü3¨þ `ÞÿãdÕ^@#†  ‰   Œ¤  üK°TK°T[X¹ÿÀ8YK°TX¹@8YÄÔìÄî1ääôìæîþÄî90!!>32!"&'532654&#"Ýý ,X,ú$þÔþï^ÃhZÀk­ÊÊ­Q¡TÕªþ’þîêñþõ Ë10¶œœ¶$&ÿã–ð $X@$ †   ¥  ‰"‘Œ% " !%üììôìä1äôäüäîîî90@ËËÍÍÍËˤ²]]"32654&.#">32# !2¤ˆŸŸˆˆŸŸ L›LÈÓ;²káþðâþýþîPL›;º¢¡»»¡¢ºy¸$&þòþïW]þïëæþêyb¥¨hÕc@B üÌÄ991/ôì0KSXííY"K°TX½@ÿÀ878Y@X9Hg°°]]!#!¨ÀýâÓþý3ÕVú+‹ÿã‹ð #/C@%  ' - ‘Œ'£0 $*$ !0üÄìôÄìîî991ìäôìîî990"32654&%.54$32#"$54632654&#"‹¥¥¦¥þ¥‚‘ÿÞßþ‘’£þ÷÷÷þ÷¤H‘ƒ‚““‚ƒ‘Åš‡‡š›†‡šV ²€³Ðг€² "ÆÙèèÙÆat‚‚tt‚‚ÿã‡ð$X@#†  ¥ ‰ ‘Œ%!"" %üìäôìì1äôìæþõîî90@ÄÂÀÀÀÂμé]]7532#"543 !"&2654&#"áLœKÈÓ:²làþûâþ±þåLœ>ˆŸŸˆˆŸŸ¸$& V\ëæþsþ†þŸþ[—º¢¡»»¡¢ºðÃ#@ƒ¦ƒü<ì21/ìôì073#3#ðÓÓÓÓþþ#þžÿÃ# %@ƒžƒ¦  ü<ì2ÔÌ1äüìî03#3#ðÓÓÓ¤R#þýÙ¬þÀ@Ù^Û¦M@*œœœœB¨§$#üì291ôì90KSXííííY" 5Ûûøúþðþ‘þ“¶ѦÑÙ`Û¢@ œœ#ü<Ä21ÔìÔì0!!!!Ùúþúþ¢¨ðªÙ^Û¦O@+œœœœB¨§$#ü<ì91ôì90KSXííííY"55Ùúþð¶þ/¦þ/¶m“°ð$e@+$  †ˆ•‘ƒ   &%ÜK° TX¹ÿÀ8YÄüìÔìî99991/îöþôîÍ9990¶y z z ]%3##546?>54&#"5>32‡ËËÅ¿8ZZ93ƒlO³a^Ág¸ßHZX/'þþ‘še‚VY5^1YnFC¼98ŸL‰VV/5<4‡þœq¢ L•@2  ©©L43¬0©7¬$©7CM34( (+(I+*(I,=MÜìüìþýþ<Æî991ÔÄüìþíÔÆÅî2Äî990K° TK° T[K°T[K°T[K°T[X½MÿÀMM@878Y@ NN/N?N]32654&#"#"&5463253>54&'&$#"3267#"$'&5476$32úŽ|{zy!<›g¬×Ø«gœ;’¥?@hþÕ°{â`±smiùhZ}þÙ˜¹þ¸€€†ˆ~R½Ôk{KOþÂþè£¤ŽŒ¥¤þHMIùÈÈúKLƒý ß±k¼Pƒ‹A@fþµÁŸþêjhmWQoagƒ}}I½¶J}‡® bæ{þùþÐhÕ Â@A       B•    ÔÄ91/<äÔì90KSXííííííííY"² ]@BXvpŒ  VXP ghxv|rwx‡ˆ€ ˜™–]] !3#!#¼þî%þ{å9Òˆý_ˆÕý®ú+þÉìÕ C@#• •• ­ . !üì2üìÔì9991/ììôìî90²"]!2654&#!2654&#%!2#!“D££þ¼+”‘‘”þ çú€|•¥þðûýèÉý݇‹Œ…fþ>orqp¦À±‰¢ ˘ÈÚsÿã'ð6@ ¡® •¡®•‘Œ 0üì2ì1äôìôìîöî0´].# !267# !2'fç‚ÿþð‚çfjí„þ­þz†S†íbÕ_^þÇþØþÙþÇ^_ÓHHŸghŸGɰÕ.@• •  2 üìôì99991/ìôì0²`]3 !%! )“ô5þáþËþBŸ²–þhþPþa/ûw.,¦þ—þ€þ~þ–É‹Õ .@•••­   üì2ÔÄÄ1/ììôìî0² ]!!!!!!ɰýÇý9øü>ÕªþFªýãªÉ#Õ )@••­ üì2ÔÄ1/ìôìî0² ]!!!!#ÉZýpPý°ÊÕªþHªý7sÿã‹ð9@ ••¡®•‘Œ43 üìüäüÄ1äôìôìþÔî990%!5!# !2.# !26Ãþ¶uþæ þ¢þu‹^’opü‹þîþík¨Õ‘¦ýSU™mn™HF×_`þÎþÑþÒþÎ%É;Õ ,@•­ 8  üì2üì21/<ä2üì0²P ]3!3#!#ÉÊÞÊÊý"ÊÕýœdú+Çý9É“Õ.·¯üK°TX¹@8Yì1/ì0@ 0@P`Ÿ]3#ÉÊÊÕú+ÿ–þf“Õ B@ •° 9 üK°TX¹@8Yìä991äüì990@ 0 @ P ` Ÿ ]3+53265ÉÊÍãM?†nÕú“þòôª–ÂÉjÕ ï@(B¯  üì2ÔÄ91/<ì290KSXííííY"²]@’ ((764GFCUgvwƒˆ”›ç    (+*66650 A@E@@@ b`hgwp ‹‹Ž š¶µÅÅ×Öèéèê÷øù,]q]q3! !#ÉÊžýþöý3ÊÕý‰wýHüãÏý1ÉjÕ%@ •:üìì1/äì0@ 0P€€]3!!ÉÊ×ü_ÕúÕªÉÕ ¿@4  B ¯   >  üìüì91/<Äì290KSXííííY"²p]@V   && & 45 i|{y €‚‚  #,'( 4<VY ej vy •›]]! !###É-}-ÅþËþÄÕüøú+üúáÉ3Õ y@B¯6 üìüì991/<ì2990KSXííY"² ]@068HGif€ FIWXeiy…Š•šŸ ]]!3!#É–ÄþðýjÄÕûáú+áûsÿãÙð #@•• ‘Œ 3üìüì1äôìî0"32' ! 'ÜþýÜÜþÿÜ:xþˆþÆþÅþ‡yLþ¸þåþæþ¸HH¤þ[þžþŸþ[¤bb¥ÉÕ:@••   ? üì2üì91/ôìÔì0@ ?_¯]32654&#%!2+#“þššþ8ÈûþÿûþÊ/ýÏ’‡†’¦ãÛÝâý¨sþøÙð R@*  B ••‘Œ    3üìüì9991Ääôìî990KSXíí9Y""32#'# ! 'ÜþýÜÜþÿ? ôÝ!#þÅþ‡y;:xÑLþ¸þåþæþ¸HHúÏþÝï¥ab¥þ[þžþüþŽÉTÕ±@5  B• •   ?  üì2üÄì99991/<ôìÔì9990KSXíí9Y"²@]@Bz%%%&'&&& 66FFhuuwˆˆ˜˜]]#.+#! 32654&#A{>ÍÙ¿J‹xÜÊÈüƒý‰þ’••’¼~þh–bý‰ÕÖØºOýƒ…‡ÿã¢ð'~@<    B ¡”••”%‘Œ( "-"(ÜÄìüìä99991äôäìîöîÆ90KSXí9í9Y"²)]¶)/)O)].#"!"&'532654&/.54$32HsÌ_¥³w¦zâ×þÝþçjï€{ìr­¼‡š{âÊõiÚ¤Å76€vce+Ù¶Ùà0/ÐEFˆ~n|-À«Æä&ÿúéÕJ@•@@Ôäüä1/ôì20K° TX½@ÿÀ878Y@  @ p Ÿ ]!!#!ïýîËýîÕªúÕ+²ÿã)Õ@@ •Œ  8AüK°TX¹ÿÀ8Yìüì1ä2ôì99990¶Ÿ]332653! ²Ë®Ã®ËþßþæþåþßÕüuðÓÓð‹ü\þÜþÖ*$hÕ·@'B¯ÔÄ91/ì290KSXííííY"²P]@b*GGZ}ƒ *&&))% 833<<7HEEIIGYVfiizvvyyu€˜—)]]!3 3JýÆÓÙÚÒýÇÕûéú+D¦Õ {@I      B ¯    ÔÌ91/<ì2290KSXííííííííY"²]@ò  ($ >>4 0 LMB @ Yjkg ` {|€ –•     !   # $ %  <:5306 9 ? 0FFJ@E@BBB@@ D M @@XVY Pfgab```d d d wv{xwtyywpx  †‡ˆ‰… Š —Ÿ¯[]]3 3 3# #DÌ:9ã:9Íþ‰þþÅþÂþÕûîûîú+úð=;Õ f@  ÔÄÜÄÄ1´€ ]@¯ /<ì20K°BPX@   ìììì@    Y3 3 # #ÙsuÙþ Ùþ\þYÚÕýÕ+ý3üø{ý…ÿüçÕ”@(B¯@@ Ôäüä91/ì290KSXííííY"² ]@<5000F@@@QQQe„“ &)78@ ghxp Ÿ ]]3 3#Ùž›ÙýðËÕýšfüòý9Ç\Õ @B••B ÜK° TK° T[X¹ÿÀ8YÄÔä991/ìôì0KSXííY"@@ )&8HGH    / 59? GJO UYfio wx Ÿ ]]!!!5!s•üPÇû=°ügÕšûoªš‘°þòX;@©²©±CÜK° TX¹@8YK°TK°T[X¹ÿÀ8YüÌ21üìôì0!#3!°¨ððþXùüÿB²Õ-@BŸ/Ä991ôì0KSXííY"#ªªýøÕùm“Çþòo0@©²©±CüK°TK°T[X¹@8Y<Üì1üìôì0!53#5oþXïïøÞÙ¨ÛÕ@ ÜÌ91ôÌ290 # #¼ÉþHþHÉÕýÓ‹þu-ÿìþþ¬µ©ÄÄ1Ôì0!5ûØþ¬ªð‰f1@ ´³DÜì1ôì0K° TK°T[X½ÿÀ@878Y #o™þºfþŠv{ÿã-{ %¼@'  ©¹ †º¹#¸Œ   E&üìÌÔì22991/ÄäôüôìÆîî9990@n0000 0!0"?'@@@@ @!@"PPPP P!P"P'p'…‡‡‡ ‡!…"' 'ð'000 0!@@@ @!PPP P!``` `!ppp p!€€€ €!]]"326=7#5#"&5463!54&#"5>32¾ß¬o™¹¸¸?¼ˆ¬Ëýû§—`¶Te¾Zóð3f{bsÙ´)LýªfaÁ¢½À‹..ª''üºÿ㤠8@¹  ¹Œ¸—G Füì22ôì1/ìäôÄìÆî0¶`€ ]4&#"326>32#"&'#3å§’’§§’’§ýŽ:±{ÌÿÿÌ{±:¹¹/ËççËËççRdaþ¼þøþøþ¼ad¨qÿãç{?@†ˆ† ˆ ¹¹¸Œ HEüä2ì1äôìþôîõî0@ € ].#"3267#"!2çNP³ÆÆ³PNM¥]ýþÖ-U¢5¬++ãÍÍã++ª$$>:#qÿãZ8@¹¹Œ¸—G Eüìôì221/ìäôÄìÄî0¶`€ ]3#5#"3232654&#"¢¸¸:±|ËÿÿË|±ýǧ’’¨¨’’§¶^ùì¨daDDaþËççËËççqÿã{p@$ †ˆ©¹ »¹¸ ŒKEüìôìÄ91äôìäîîôî90@)?p Ðð?????,// , ooooo ]q]!3267# 32.#"ü² Í·jÇbcÐkþôþÇ)ü⸥ˆš¹^Z¾Ç44®*,8 CþÝÄ—´®ž/øY@ ©‡—¼    LüK° TX¹ @8YK°TX¹ ÿÀ8Y<Äü<ÄÄ991/ä2üìî2990¶@P ]#"!!##535463ø°cM/þѹ°°®½™Phcü/ÑN»«qþVZ{ (J@#  †¹¹&#¸'¼ ¹½& G E)üÄìôì221/ÄäìäôÄìþÕî990¶`*€* *]4&#"326!"&'5326=#"3253¢¥•”¥¥”•¥¸þþúa¬QQžRµ´9²|ÎüüÎ|²9¸=ÈÜÜÈÇÜÜëþâþé³,*½¿[cb::bcªºd4@ ‡¸ — N  Füì2ôì1/<ìôÄì90²`]#4&#"#3>32d¸||•¬¹¹B³uÁƤý\žŸž¾¤ý‡ýžedïÁy+@¾±¼Fü<ì21/äüì0@  @ P ` p ]3#3#Á¸¸¸¸`û éÿÛþVy D@ ¾ ‡½¼ ±O  Fü<ì2ä991ìäôìî990@ @P`p]3+532653#Á¸£µF1iL¸¸`ûŒÖÀœa™(麜 ¼@)B¼— F üì2ÔÄ91/<ìä90KSXííííY"² ]@_ ')+Vfgsw‚‰Ž“–—£    ('(++@ h` ‰…‰š—ª§¶ÅÖ÷ð÷ð]q]33 ##º¹%ëý®kðýǹüiãýôý¬#ýÝÁy"·—Füì1/ì0@ @P`pð]3#Á¸¸ùìº{"Z@&  ‡ ¸¼PPF#üì2üüüì91/<<äô<Äì290@0$P$p$$ $ $¿$ß$ÿ$ ]>32#4&#"#4&#"#3>32)EÀ‚¯¾¹ru¦¹rw¦¹¹?°yz«‰|võâý\ž¡œ¾¤ý‡ž¢›¿£ý‡`®gb|ºd{6@ ‡¸ ¼ N  Füì2ôì1/<äôÄì90´`Ï]#4&#"#3>32d¸||•¬¹¹B³uÁƤý\žŸž¾¤ý‡`®edïqÿãu{ J@¹¹ ¸Œ QEüìôì1äôìî0@#?{{   {  { ð]"32654&'2#"s”¬«•“¬¬“ðþîðñþïßçÉÉçèÈÇéœþÈþìþíþÇ98ºþV¤{>@¹¹¸Œ½¼ GFüì22ôì1äääôÄìÄî0@ `€ à]%#3>32#"&4&#"326s¹¹:±{ÌÿÿÌ{±8§’’§§’’§¨ý® ªdaþ¼þøþøþ¼aëËççËËççqþVZ{ >@¹  ¹¸Œ½¼ GEüìôì221äääôÄìÆî0@ `€ à]32654&#"#"3253#/§’’¨¨’’§s:±|ËÿÿË|±:¸¸/ËççËËççý®daDDadªùöºJ{0@  ‡¸ ¼ FüÄì21/äôìÄÔÌ90´PŸ].#"#3>32JI,œ§¹¹:º….´˾ý²`®fcoÿãÇ{'ç@<  S  SB †‰†‰¹¹%¸Œ( R"E(üÄìÔìä99991äôìþõîõî90KSXí9í9Y"²']@m   . , , , ; ; ; ; $( ( *//*(() )!$'† † † †      '/)?)_))€)) )ð)]]q.#"#"&'532654&/.54632‹N¨Z‰‰b”?Ä¥÷ØZÃlfÆa‚Œe«@«˜àÎf´?®((TT@I!*™‰œ¶##¾55YQKP%$•‚ž¬7òž8@©¼‡  Fü<Äü<Ä2991/ìô<Äì2990²¯]!!;#"&5#53w{þ…Ks½½Õ¢‡‡žþÂý ‰NšŸÒ`>®ÿãX{;@ ‡Œ ¼¸  NFüìô9ì21/ää2ôÄì90´oÀ]332653#5#"&®¸||•­¸¸C±uÁÈϺ¦ýaŸŸ¾¤{û ¬fcð¨=`û@'B¿ÔK° TX¹@8YK°TK°T[X¹ÿÀ8YÄ91/ì290KSXííííY"@ŽHj{†€‘¤  &&)) 55::0FFIIFH@VVYYPffiigh`ut{{uz……‰‰‰†––—š˜˜—¨§°Àßÿ>]]3 3#=Ã^^Ãþ\ú`üT¬û V5` ë@IU U U U   B ¿    ÔK° TK°T[K°T[K°T[K° T[X¹@8YK° TK° T[K°T[X¹ÿÀ8YÌ91/<ì2290KSXííííííííY"@ÿ" 5 IIF @ [[U P nnf yy‡™˜” ¼¼ÎÇÏ         %%#'!%""%' $ ! # 9669 0FHF@B@@@D D D @@VVVPQRRPS T U cdejejjjn a g ouuy}x}zzxy  { v } ‡ˆ——”“œ›˜˜™@/– Ÿ¦¦¤¤««©©«¤ ¯µ±½»¸ ¿ÄÃÌÊy]]333# #V¸æåÙæå¸þÛÙñòÙ`ü–jü–jû –üj;y` C@F      B ¿  ÔK° TK°T[K°T[K°T[X¹@8YK°TX¹ÿÀ8YÄÔÄ91/<ì290KSXííííííííY"@˜   & =1 UWX f vzvt ‚ ™Ÿ—’ ¦©¯¥£       )&% * :9746 9 0 IFE J @ YVYYWVYVV Y P o x ›”«¤° Ï ß ÿ /]] # # 3 dþkªÙþºþºÙ³þrÙ))`ýßýÁ¸þHJþq=þV`‹@C        B  ‡½ ¼  ÔK° TK°T[X¹ @8YK°TX¹ ÿÀ8YÄÄ91ä2ôì9990KSXíííííí2Y"@ð     # 5 I O N Z Z j ‡ € “        '$$  )( % $ $ ' ** 755008 6 6 8 990A@@@@@@@@B E G II@TQQUPPVUVW W U U YYPffh ii`{xx‰Š … … ‰ ‰‰™ • • šš¤ ¤ ««°Ïßÿe]]+5326?3 3“N”|“lLT3!þ;Ã^^ÃhÈzšH†TNü”lXÛ` @B©¼© ÜK° TK° T[X¹ÿÀ8YK°TX¹@8YÄ2Ä991/ìôì0KSXííY"@B&GI  + 690 @@E@@CWY_ ``f``b € ¯ ]]!!!5!qjýL´ü}´ýe`¨üÛ“¨%þ²$w@4 %   ! © ©À ©±% $  C %ÔK° TX¹@8Y<Äü<Ä299999991üìÄôìî99999990²&]#"&=4&+5326=46;#"3>ù©lŽ==k©ù>DV[noZV¾”Ýï—ts•ðÝ“XøŽŽœøXþ®·±Ôì1üÌ0#®ªøþ²$‡@6%   ©©#À©±%#C %ÔK° TX¹ÿÀ8YK°TX¹@8Y<Ä2ü<Ä99999991üìÄôìî99999990²&]326=467.=4&+532;#"+FŒUZooZUŒF?ù§lŽ>>Žl§ù?¾VøœŽŽøŽW“Ýð•st—ïÝ”ÙÓÛ1#@ œœ ÔÄ1ÔüÔìÀ990#"'&'&'&#"5>32326Ûi³an’ ›^X¬bi³an“ ›^V©1²OD;>MS²OE<>L5þ‹` e@ƒ¼  ü<ì2991ôäüÌ0K° TX½ @ ÿÀ878YK°TK°T[K°T[X½ ÿÀ @878Y¶ P ]#53#3ËËË¢bþú+eþ›¬þÇ#˜!Q@+  †ˆ †ˆ ¹ ¹¸Œ"  "ÜìÔ<Ô<<ì221äô<ÄìÄþôîõî9990%.'>7#&73¦“¤¤JˆDF‰HA‰Mfñþ÷ ñfI‰ƒX⸹⡬)*ü *'ª#þä 32þá!bð`@!† ©  ”‘   Ü<ÌÌü<ÄÔÄ1/ì2ôäìÔ<î2î990K° TX½ÿÀ@878Y´66].#"!!!!53#535632NLˆ=”t‡þy-üìÇÇÖè=—´¶))›Ô×þ/ªªÑîó^R¼²#/ƒ@I -'! - -¹ëì'¹ë!0 *$0* $ $(st*(s0Üäìôäì9999999991ÔäìôäìÀ9999999907'#"&''7.5467'7>324&#"326{ÏrÎ%$&(ÑrÏ;t=:x=ÏqÏ%%&&ÏsÏ7t@?s9ÏqÏ(&%%ÏsÎ>v:@t8ÎsÏ'%$þ|pššprœRÃÕÆ@F  B Ó Ó   fe f eÔ<ì2ìüì2ì99991/ä2Ô<ì2Ô<ì290KSXííííY"K° TX½ÿÀ@878Y@(†¦ µ' ' ')((79‡ ˆ¦ ¥ª©]]!#!5!5'!5!3 3!!!þcÉþ` Tþ´þþ{y¿þÂþµTŸÇþ9Ç{3›{JýD¼ý¶{›3þ¢®˜@ õõÜ<ì21ÔìÔì0##®ªªª˜ý öý ö\ÿ=¢ð >‘@54&.#"#"&'532654/.5467.54632{?>‹ú?>ÌS8alÎÓƒ\]>9Ì­IšXW”:fqÝÖ€][;;ȦI™¨.Z.L…‡-[.Kˆ“¤''PGZswšeZŒ54m@ލ¤''TLf{x™f[1,pE‚Ÿ×F)’@ÎÍddÜüÔì1ü<ì20K° TK° T[X½@ÿÀ878YK° TK° T[K°T[K°T[X½ÿÀ@878YK°TK°T[X½@ÿÀ878Y@````pppp]3#%3#^ËËþyËËÊÊÊåÍ/IC@&=Ë>:ÌAÊ$1Ë04ÌGÊÉÈ$É 7aD=0^* D^ JÜÌüìþí2î1/îöþýîÖîýîÖî02#"$'&5476$"3267>54&'..#"3267#"&54632˜mmllmmþù˜˜þùmmllmm˜ƒâ^^``^^⃄ã^]]^\^ã§B‚B•§«›@zBC‰FØûûØIˆÍnmmþúš˜þûmmnnmm˜šmmng^^^å‚ã^^__^]⃅ã]^^õ! ¯Ÿ®"ôÐÑòsÕ;ð)_@3(%ãÝá%Ý ßÞÝ à‘* "(kl"k *ÜìÌüì22ÀÀ9991ôäüôìÄîíÖîî99990!!#5#"&546;54&#"5>32"326=‹°ýP®•,]€˜¿¼¶uu>ˆDI‘E·³þì¡~bRh‚P{¸þ@p?D‡q‡Š[[""°ðCO@Mrž%# †@Ièèèè è è è  è B  ç¦ o o nüü<Ôì2991ô<ì2990KSXííííííííY" 5 5%þÓ-þ+#þÓ-þ+#¿þôþô¿¢R¢¿þôþô¿¢RÙÛ^@ œÜÔì1ÔÄì0!#!Ù¨û¦^ýÁ•d߃¶œÜÌ1Ôì0!!dý僤åÍ/8L`@6EBC?2ÉH0É9JCÊ 9ÊÉÈ É$HE301B54&'.'2#"$'&5476$#32654&'2#'.+#ƒâ^^``^^⃄ã^]]^\^ㄘmmllmmþù˜˜þùmmllmm}{{nWXf°®i`C.‰¬;I6B›f^^^å‚ã^^__^]⃅ã]^^gnmmþúš˜þûmmnnmm˜šmmnþbþì>KL?gwyVpMIßÑ`3þœDÕb+ö/·ïîÔÌ1üì0K° TK°T[X½ÿÀ@878Y!!ÕVýªö”Ãu=ð  @ÃÄà ‘ Z[ZÜìüì1ôìüì0"32654&'2#"&546PnnPPnoO@v+..¹†‡´¸ooPOmmOOp1.-rB„·´‡†ºÙÛ .@МР œ   Ô<ì2ü<ì21/ìÔ<ìü<ì0!!#!5!!!®-ýÓ¨ýÓ-ýÓúþþ}ªþ}ƒªƒû¦ª^œ´ðJ@$}}BÝÝ÷ Ý‘~ÜÄÔÄì91ôÄìüìî90KSXí2íY"!!56754&#"5>32 ¨ýª"?XhU4zHM…9‘®þµ8rn81^BQ##{„l‹þä0bÍð(H@' Ý Ý Ý Ý ø÷Ý ø#‘)~&~ )ÜÄÄÔìÔì9991ôäìüäìÔìîî90#"&'532654&+532654&#"5>32 \e¾±9}F4wCmxolV^^ad_(fQI€7©Z`mR|†yOFJLl?<:=svcE`sîRf1@ ´³DÔì1ôì0K° TK°T[X½ÿÀ@878Y3#‹Çþº™fþˆ®þVå` M@% ‡Œ ¼½!   NF!üì2ôìÄ91ää2ô<ìÜÄ990¶"`"Ï"]3326533267#"&'#"&'®¸Š‡”•¸#% )I#ER2‘bf*þV ýH‘”¨¨ü¢<9 ”NPOONNýמÿ;9Õ %@Á]] ÔÔüÜì91Ä2ôì90!###.54$yÀ¾Ž×ëÕùfùáNݸ¾èÛH®F·ƒÔì1Ôì03#ÛÓÓFþ#þuÁ@  ó' ÜÔìÔÌ1/ÔüÄ90!#"&'532654&'T76xv.W+"J/;<+->i0Y[ ƒ0.W=‰œÅß ,@Ý ÝÝ ÷‘ |]|| Üôäüä1ôììÔìî2035733!œÌßæ‰Íý× c)t'ý+n`Õdð.@ãáÝ àÝ‘ klk Üìüì991ôìôìüì0!!2#"&546"32654&‹°ýPX³Îγ³Ðгi~hi}|P{Ý¿¿Ûܾ¿Ýs¡ˆ…  …‰ ÁH# †@I è è è è èèèèB  ç¦ o opü<üÔ<ì991ô<ì2990KSXííííííííY"5 %5 ÁÕþ+-þÓ²Õþ+-þÓ#þ^Rþ^¿  ¿þ^Rþ^¿  ÿÿ‰ÿãð&{' O‹ýd &5ÿÿ‰ÿã?ð&{'t‹ýd &5ÿÿbÿãð&u' O‹ýd &5þn¬` $†@/ †ˆ !ƒ# •½#¼%" " "!& %ÜìÔüìÔì99991äôìþÍôî9990K°TK°T[K°T[X½%ÿÀ%%@878Y@ ttttv]33267#"&546?>7>5#53ô¾7ZZ:3ƒmN´`^Àg¸àIYX0&ÄÊÊÏœe‚WX5^1YnFC¼98ŸL‰VV/5<6þÿÿhk&$¼uÿÿhk&$¼uÿÿhm&$¼u´  +@ ]1ÿÿh^&$¼u´ #+@ @O# /#]1ÿÿhN&$¼u´  +@ 0?  ]1hm !Ë@T   !!  ! !!!B  Á • Ž  !  VV!"ÔÄÔì2Ôî299999991/<æÖîÔî9990KSXííííííííY"² #]@  s › P#f iu {yyv v!€# ]]4&#"326!.54632#!#TY?@WX??Y˜þð!þX=>Ÿsr¡?<Òˆý_ˆÕZ?YWA?XXþóýN)sIs ¡rFv)ú‹þHÕ‡@9  B• ••••­    ÔÔ<ì2ÔÄÄ91/<ììÄôììîî0KSXííííY"²€]@gww† …– ¿ ]!!!!!!#!5ýÇý9øü=ýð Íq‹þ¶ËÕªþFªýãªþÕžüðÿÿsþu'ð&&z-ÿÿÉ‹k&(žuÿÿÉ‹k&(žuÿÿÉ‹m&(žu@@ ]1ÿÿÉ‹N&(žu @@ @]1ÿÿ;ºk&,/uÿÿ¢k&,/uÿÿÿþ`m&,/u´ +1ÿÿXN&,/u´ +1 ºÕ g@  © ••  2  yô<ì2ÄôìÄ91/Æ2îöîî20@( °Ÿ Ÿ Ÿ Ÿ ŸŸŸŸ¿ ¿ ¿ ¿ ¿¿¿¿]]! )#53!!3 !Ó ±–þiþPþ`ÉÉËPþ°ó5þáþËÕþ—þ€þ~þ–¼ãþýê.,ÿÿÉ3^&1þu´"+@ 0?""]1ÿÿsÿãÙk&2'uÿÿsÿãÙk&2'uÿÿsÿãÙm&2'u´+@]1ÿÿsÿãÙ^&2'u´!0 +@ 0!?0 !/0!0]1ÿÿsÿãÙN&2'u´ +@ @O]1?œÅ …@M œ  œœœœœ œ œ B   Ô<Ì291Ô<Ì290KSXííííííííY"  ' 7 œþ7Éwþ5þ5vÈþ8vËËLþ5þ7yËþ5yÉËyþ5Ëfÿºå +ž@< +,  )&  *&•& •‘&Œ,+,* # )#3,üìüìÀ999999991äôìîÀÀ99999990@*WZWU!je!{vu! FYVjddj(|svz( ]] 324&'.#"&5!27!"&''¶ý3>¡_Ü'y=¡_Üþý''†NOy;‚ÝW¢fªNPþˆþÆ€Ý[¢gXü²@CHp¸¸@Cþ¸þåp¼Džf b¥MK¿YÆgþöžþŸþ[KK¿Xÿÿ²ÿã)k&8îuÿÿ²ÿã)k&8îuÿÿ²ÿã)m&8îu´ +@ / ]1ÿÿ²ÿã)N&8îu´ +@P_@O /]1ÿÿÿüçk&<suÉÕ =@• •ö  ? üì22üì91/ôüìÔì0@ ?_]332+#32654&#ÉÊþûþÿûþÊÊþš™ŽÕþøáÜÜâþ®'ýÑ’††‘ºÿã¬/š@0-'!  *†¹*¹—Œ.  !' $'$-F0üÄüÌÆîÔîî99991/äþîþÕî990@@'(Š Š     ! "&  : :!MM I!I"jj ¥¥¦ ]]4632#"&'532654&/.5467.#"#ºïÚÐÛ—¨:A9¦`áÓ@ˆIPŒAtx;e\`W§—ƒq‚ˆ»qÈÛèàs`/Q*%jŽd¬·¤_[?T>7;‡[¬gp‹ƒû“ÿÿ{ÿã-f&DCR @?&/&&]1ÿÿ{ÿã-f&DvR @?&/&&]1ÿÿ{ÿã-f&DˆR´ (,+1ÿÿ{ÿã-7&DžR´.< +@ ./<.<]1ÿÿ{ÿã-&DjR ´-( +@(o(P-_(@-O(0-?(-( ]1ÿÿ{ÿã-&DœR%@&,,& 2882 +Ä+Ä1@ ?5?/5/]0{ÿão{3>@C'-%= 4©%†ˆ©:¹.†-º*¹»1 ¸Œ%?47&%7& =&-7"E?üìÌÔü<ÔìÄ999991Ää2ô<Ääü<ôìÄî2îôîî9990@0+0,0-0.0/00@+@,@-@.@/@0P+P,P-P.P/P0…+…0€@@ @°@À@Ð@à@à@ð@??? ??0,0-0.0/@,@-@.@/P,P-P.P/ooo oo`,`-`.`/p,p-p.p/€,€-€.€/]q].#">32!3267#"&'#"&5463!54&#"5>32"326=¶¥‰™¹DJÔ„âü² Ì·hÈddÐj§øMIؽÒýû§—`¶Te¾ZŽÕï߬o™¹”—´®ž0Z^þÝúZ¿È55®*,ywxx»¨½À‹..ª''`þf{bsÙ´)ÿÿqþuç{&Fzÿÿqÿãf&HC‹ÿÿqÿãf&Hv‹ÿÿqÿãf&Hˆ‹´"+1ÿÿqÿã&Hj‹@@ ]1ÿÿÿǦf'Cÿóÿÿof'vÿóÿÿÿÞ\f&óˆÿ´ +1ÿÿÿôF&ójÿ´ +1qÿãu('@^%{&%#${##{#({'(#&'('%$%(('"#" ! B('&%"! ##¹ ¹Œ#±)&' ! (%#" QE)üìôì99999991ìÄôìî9990KSXÉÉÉÉííííY"²?*]@v%+("/#/$)%-&-'*(6%F%X X!` `!f"u u!u"%#%$&&&''(6$6%F$E%Z Z!b b!z{     {zzv v!x" *ð*']].#"32654&#"432''%'3%F2X)§¹®’‘®6 ~rþäæçþåÝ4*ŸþÁ!µäM!þÙ“ØÃ¼ÞÞ¼z¼&þà­ÿþÉ7ÿú7´kc\Ì‘oabÿÿºd7&Qž˜ÿÿqÿãuf&RCsÿÿqÿãuf&Rvsÿÿqÿãuf&Rˆs´+1ÿÿqÿãu7&Ržs´ .+@ /. .]1ÿÿqÿãu&Rjs´ +@ @O0?]1Ù–Ûo )@êêœ r ÜÔ<ü<Ä1ÔÄüÄîî03#3#!!ßööööýúúþoöþõAªHÿ¢œ¼ +ä@<+,&  )&  *&¹& ¹¸&Œ,+,* # #Q)E,üì2ôì2À9999991äôìîÀÀ99999990@p(?-YVUV jf!{    { z{ {!"#$%{&›•%¨ -ð-&YVUZ(ifej(ztvz(‰•š$¢­$]] 32654&'.#".5327#"&''‰þ)gA“¬\*g>—©}66ñ]ŸC‹_’56þîð`¡?‹`!ý°*(èÈOuš))ëÓHn.—MÅw834¨O³MÆxþíþÇ43¨Nÿÿ®ÿãXf&XC{ÿÿ®ÿãXf&Xv{ÿÿ®ÿãXf&Xˆ{´ +1ÿÿ®ÿãX&Xj{´ +@ @O0?]1ÿÿ=þVf&\v^ºþV¤>@¹¹Œ¸½— GFüì22ôì1ìääôÄìÆî0@ `€ à]%#3>32#"&4&#"326s¹¹:±{ÌÿÿÌ{±8§’’§§’’§¨ý®¾ý¢daþ¼þøþøþ¼aëËççËËççÿÿ=þV&\j^´+@ 0? /]1ÿÿh1'q¼;$´ +@@O]1ÿÿ{ÿã-ö&qJD´+@o]1ÿÿh’'šÎJ$´+1@oo]0ÿÿ{ÿã-&šO×D´"+1ÿÿþu¥Õ&$äÿÿ{þu€{&D¿ÿÿsÿã'k&&-uÿÿqÿãçf&Fv‰ÿÿsÿã'm'Lu& ²<=/1ÿÿqÿãçf&Fˆ¤ÿÿsÿã'P'Lu&ÿÿqÿãç'¸¤Fÿÿsÿã'm&&-u@]1ÿÿqÿãçf&F‰‰ÿÿɰm'ìu'ÿÿqÿãÛ&G @_?]1ÿÿ ºÕ’qÿãô$J@$Ó ù"¹¹ Œ¸—   GE%üìô<Äü<Ä1/ìäôÄìÄîý<î20¶`&€& &]!5!533##5#"3232654&#"¢þºF¸šš¸:±|ËÿÿË|±ýǧ’’¨¨’’§¶N}““}úü¨daDDaþËççËËççÿÿÉ‹3&(q¡=ÿÿqÿãö'q–H@p]1ÿÿÉ‹m'¡u(@@]1ÿÿqÿãH'š–H@p]1ÿÿÉ‹P'žu(ÿÿqÿã'¸–HÿÿÉþuÕ&(Ìÿÿqþu{&HxÿÿÉ‹g&(¦o@@ ]1ÿÿqÿãa&H‰”ÿû´!+@!]1ÿÿsÿã‹m'\u* ²<=/1ÿÿqþVZf&ˆhJ ² <=/1ÿÿsÿã‹m&*uÿÿqþVZH&Jš‹ÿÿsÿã‹P'\u*@?]0ÿÿqþVZ'¸jJÿÿsþ‹ð'×^ÿí*ÿÿqþVZ4'Ãà JÿÿÉ;m'u+´ +@ / ]1ÿÿÿådm'uK*´+1K°QX»ÿÀÿÀ88Y@ €€@@]É‹Õ:@•  •­  8 Üì22Ìüì22Ì1/<ä2üìÜ22ì2203!533##!##53!5qÊÞʨ¨Êý"ʨ¨ÊÞÕààà¤û¯Çý9Q¤¤ààxŸ>@! ‡ ‡¸— N  Ü2ì22ÌÌôì1/<ìôÄìÜ2ì290#4&#"##5353!!>32Ÿ¸||•¬¹}}¹`þ B³uÁƤý\žŸž¾¤ý‡ö¤zz¤þ¼edïÿÿÿäx^'.u,´ +1ÿÿÿÓg7'žÿó´+1ÿÿY1'qÿ.;,´+1ÿÿÿòHõ'qÿÿÿó´+1ÿÿÿõgm'.u,´+1ÿÿÿäVH'šÿó´+1ÿÿ°þu%Õ'ÿd,ÿÿ–þu 'ÿJLÿÿÉ•P&,/u³<<1´??]0Áy{,@ ¸¿Füì91/ìä0@4D@P`p]3#Á¸¸\`û {ÿÿÉþfïÕ'-\,@ì1ÿÿÁþV±'M8L@Fì1ÿÿÿ–þf_m'.u-´+1ÿÿÿÛþV\f'ˆÿù´+1ÿÿÉþjÕ'× .ÿÿºþœ'׬ Nºœ` »@(B¼ F üì2ÔÄ91/<ì290KSXííííY"² ]@_ ')+Vfgsw‚‰Ž“–—£    ('(++@ h` ‰…‰š—ª§¶ÅÖ÷ð÷ð]q]33 ##º¹%ëý®kðýǹ`þåýòý®!ýßÿÿÉjl'nv/ÿÿÁJl'ZvO±<1K°QX¹@8Y@ŸO]0ÿÿÉþjÕ'×› /ÿÿˆþ­'× O@@]1ÿÿÉjÕ'ŸÿÃ/ÿÿÁ'9O @]1ÿÿÉjÕ'y1w/ÿÿÁ„'yÖsOK° QK°SK°QZ[X¹@8Y1ÿòuÕ ?@ •  : yô<ìÄü<Ä991/äì90´0P]3%!!'7ÓË9Pþw×ü^”MáÕý˜Ûoþîýãª;jnžH ^@ — z z Ô<äü<ä991/ì90K°TX½ @ ÿÀ878Y@ @ P ` sz p à ð ]37#'7Ǹ}Lɸ{JÅý¦ZjüãšXjÿÿÉ3l'Åv1@O]1ÿÿºdm&vBQ @?O]1ÿÿÉþ3Õ'× 1ÿÿºþd{'× QÿÿÉ3_&1õg´ +@ /  ]1ÿÿºdf&Q‰´ +@]1ÿÿ͹Õ'QU~ÉþVð;@  AüK°TX¹ÿÀ8Yì2ÔüÌ1@ •°•‘/äôìôì0!"#367632+53265Pþͳ×ÊÊNij™ãéQRµW1fO¬ÿÞü²Õñ†CCþÁþÌüoÕa`œZ ºþVd{;@ ‡‡¸¼ NF üì2ôìÄ1/äôÄìÔì90´`!Ï!]+5327654&#"#367632dRQµþéi&&||•¬¹¹BYZuÁcc¤ýHÖ``œ01™²Ÿž¾¤ý‡`®e22wxÿÿsÿãÙ1'q';2´ +@]1ÿÿqÿãuõ&qsÿR´+1ÿÿsÿãÙm''u2´+@]1ÿÿqÿãuH&šsR´#+1ÿÿsÿãÙk''u2ÿÿqÿãuf'Ÿ Rs Õ;@•••­   üìÔÄÄÔì299991/ìì2ôì2î0!!!!! !# !3úýÇý9øû×þOþA¿±gþ¿þÀ@AÕªþFªýãª|pm|ªþáþàþßþßqÿãÃ{'3„@1†ˆ ©. ¹(¹»"%¸Œ4"1 K1 Q+E4üìôüôìÄ9991ä2ô<Ääì2Äî2îôî90@%?5_5p5Ÿ5Ï5Ð5ð5????? ooooo ]q].#"!3267#"&'#"32>32%"32654& ¤‰™¹Hü² Ì·jÈbdÐj òQGÑŒñþïñŒÓBNèâú°”¬«•“¬¬”˜³®ž5Z¾Ç44®*,nmnm98olkpþ݇çÉÉçèÈÇéÿÿÉTl'•v5ÿÿº”m&vBUÿÿÉþTÕ'× 5ÿÿ‚þJ{'× UÿÿÉT_&5}g@_]0ÿÿºZf&U‰´ +@]1ÿÿ‡ÿã¢l'•v6ÿÿoÿãÇm&vBVÿÿ‡ÿã¢m'“u6 ´ ))Ic:1ÿÿoÿãÇf&ˆ%V ´ ))Ic:1ÿÿ‡þu¢ð&6z‹ÿÿoþuÇ{&Vzÿÿ‡ÿã¢m&6‹u ´+ ""Ic:1ÿÿoÿãÇf&V½' ´+ ""Ic:1ÿÿÿúþuéÕ&zP7ÿÿ7þuòž&záWÿÿÿúé_&7sg´ +1@_]0ÿÿ7þ‚&W7p@]1ÿúéÕF@ • • @ @ Ô<äÌü<äÌ1/ôì2Ô<ì20@@pŸ ]!!!!#!5!!ïýî þ÷Ëþ÷ ýîÕªýÀªý¿Aª@7òžC@©©¼ ‡ Fü<<Ä2ü<<ÄÄ2991/ìô<Äü<Ü<ì20²¯]!!!!;#"'&=#535#53w{þ…{þ…%&s½½ÕQQ‡‡‡‡žþÂéŽé‰''šPOÒéŽé>ÿÿ²ÿã)^'îu8´ '+@ ]1ÿÿ®ÿãX7'žƒX´&+1ÿÿ²ÿã)1'qî;8´ +@ / ]1ÿÿ®ÿãXõ'qƒÿÿX´+1ÿÿ²ÿã)m'îu8´+@]1ÿÿ®ÿãXH'šƒX´+1ÿÿ²ÿã)o&8œðiÿÿ®ÿãXÊ&Xœ|Ä @@@!]1ÿÿ²ÿã)k'îu8ÿÿ®ÿã^f'Ÿ°Xÿÿ²þu)Õ&8úÿÿ®þuè{&X'ÿÿD¦t'õ|:´+1ÿÿV5m'ˆEZ´+1ÿÿÿüçt'r|<´ +1ÿÿ=þVm&ˆ^\´+1ÿÿÿüçN&<su´ +1ÿÿ\l'•v=ÿÿXÛm&vB]ÿÿ\P'¾u=ÿÿXÛ'¸]@ O _ ¯ ß ]1ÿÿ\m&=¾uÿÿXÛf&]‰´ +@ ]1/ø#@ ‡ —©¼ Lü<ÌüÌ1/ôìôì0!##53546;#"˜¹°°®½®°c'&ÑN»«™()g ÿã¤,D@%¹ ¹ Œ¸")%©,$'—".EG* ,(%#'F-ü<Ìì222Ìôìì1/ôÜ<ì2äôÄìÆî04'&#"327667632#"'&'##5353!!åST’’TSST’’TSýŽ:YX{Ì€€Ì{XY:¹šš¹Eþ»/ËtsstËËtsstRd01¢¢þøþø¢¢10d¨}““}ÿ—PÕ)C@#• •• ­ . *üì2üìÔì9991/ììôìî90²"]!2654&#!2654&#%!2#!"#546÷D££þ¼+”‘‘”þ çú€|•¥þðûýè„vœÀÉý݇‹Œ…fþ>orqp¦À±‰¢ ˘ÈÚ0_i1Fµ£ÿÿÉìÕ¥ºÿã¤&8@¹#¹ Œ¸©—(EGF'üì22ôìÄì1/ôìäôÄìÆî067632#"'&'#!%4'&#"3276s:YX{Ì€€Ì{XY:¹NýkrST’’TSST’’TS¶d01¢¢þøþø¢¢10d¨¦üÀËtsstËËtsstìÕ 3@  . /Üì2üìÄÌ1@ • ­ •/ìäôì³ 9/04'&#!!276!2#!#ON£þ¼D£NOý|NûþðûýèÉ8·‹DCýÝDC¨ýšÚÞÝÚD‘ÿã¤>@  G /Üì22ôìÄÌ1@¹¸ ¹ Œ—/äôìÄôìij9/0>32#"&'##34&#"326s:±{ÌÿÿÌ{±:¹º"Qr§’’§§’’§¶daþ¼þøþøþ¼ad¨DÑüËççËËççsÿã'ð0@†ˆ•‘ † ˆ• Œ0 Ü<ôìì1ôìôìôìôì0>3 !"&'53 !"shí†S†þzþ­„íjfç‚þðÿ‚çfbGGþaþ˜þ™þaHHÓ_^9'(9^_sÿãZd$D@"!• % ¡® •¡®•‘Œ%  0%üü2ììÄ1äôìôìîöîÜì0´&&].# !267# !2676;#"'fç‚ÿþð‚çfjí„þ­þz†S`œ SfãM?†nbÕ_^þÇþØþÙþÇ^_ÓHHŸghŸ$Ãbzª–qÿãÌ"N@$†ˆ† ˆ ¹¹¸Œ#‡—# HE#üô2Ììì1ôìäôìþôîõî0@ $$€$$ $].#"3267#"!2546;#"çNP³ÆÆ³PNM¥]ýþÖ-GF¡µE0iL~õ++ãÍÍã++ª$$>: ÖÀœaÿÿ ºÕ’ÿ—Õ.@• •  2 üìôì99991/ìôì0²`]3 !%! )"#546÷ô5þáþËþBŸ²–þhþPþa„vœÀ/ûw.,¦þ—þ€þ~þ–0_i1Fµ£ÉìÕ.@  .üìôì2ÄÄ1@ • •­• /ìôìôì0)!"!!"$54$3!!ž@Dþ¼£NýèûþðûNý|·þï#‡“ú+ÚÞÝÚÀqÿãZ?@¹¹Œ¸‡—G EüìÄôì221/üìäôÄìÄî0¶` €   ]5!#5#"3232654&#" M¸:±|ËÿÿË|±:ý§’’¨¨’’§n¦ùì¨daDDad¹üÀËççËËççqþVtc'T@ )E Q E(üìÄô²]ìÔìì99@   ¹¹¶(ôìÔüÔÌ99@%S ì910%!"'53254%&'&326&#">kþGÝxfööþøÐuŽïð›'«””¬¼~@3cnBOþðF™Fu\0%p‡9þÇþíœþü ËåèÃÂÇ *܃EÕ +@    ÜÄÄÔì2Ä1@ • •­•/ìôìôì0!5!!5!!5Eü>øý9ÇýÕú+ªªºªuÿãÙðD@&¡®•••­• ‘Œ3üÄìôì91äôìôäîîôî90!!"56$3 ! 7327uþíþî‹üpo’^‹þˆþÆþ·þ—Ü ÿÊÊÿ   2`_×FHþgþ’þŸþ[·ÌÃþääÿã{ð(@@$ † ˆ •‘)•­)† ˆ•#Œ)* &)üìÔìÔÄÄÌ1ôìôìôì9ôìôì0.54$32.#";#"3267# $546؃Ž æYÉsr¾S˜£ž•¶®¥¹Ç¾mÈTjÇ^þèþУ%!«|²Ñ ´&${spw¦•„–21Ã%%òÝÄÿ–þf#ÕA@ • °••­ üì2ÔÄÄ991ìôìîôì990² ]!!!!+53265ÉZýpPý°ÍãM?†nÕªþHªýŸþòôª–ÂÿþVøe@# ‡ ½©‡—¼ LüK° TX¹@8YK°TX¹ÿÀ8Y<Äü<ÄÄ991ä2üìî299ôì990¶@P ]#"!!+53265#535463ø°cM/þÑ®½®°cM°°®½™Phcû뻫™Ph*N»«sÿã—d&I@43! F'üìüôìüÄÄ1@•'$•$•¡®•‘Œ'äôìôìþÔî99Üì0%!5!# !246;#".# !26Ãþ¶uþæ þ¢þu‹^[£DÉãM?†npü‹þîþík¨Õ‘¦ýSU™mn™¼êª–Â×_`þÎþÑþÒþÎ%þRvÕ%•@ 'P $&ÔÔìÔìÔ]ĵ 91@ •½%$&ä222ôì³990@ #%$$ì<ì<¶$ì¶#$ì´%#@$"! #9927654'&'3#"'&547673¿6,3,,3,6ÙÞýºhC.Kd››dK.ChýºÞþý B9Iy\\yI9B z^ûÏÈ®wB‹AWWA‹Bw®È1ºG*O@, *&NF+üì2ôìÄÄÌÔì91@‡ '&‡& ‡ #¸—/<ìô<Äì9ì99ì0%27654'&'5+"&54&#"#3>323L•TWJ>yàmoþàÝF»||•¬¹¹B³uÁÆLiœbe›Þp_!”‘þìõþæÈΟž¾¤ý‡ýžedïèþò“gÉÆÕ .@ • üK°TX¹@8YìÄ991/äì9903;#"&ÉÊn†?MãÍÕü-–ªô RÕ E@ •¯  ü<ÄK°TX»@@88Yì2Ä1/ìÜ<ô20@ 0 @ P ` Ÿ ]33###53ÉÊ¿¿Ê¿¿Õýªý¿AªÉ÷ðf@ üì2ÔÄ9Ôì1@%    B  •‘¯ /<ìôì9990KSXííííY"#54&#" !#3632÷ªI&F%ýÝþöý3ÊÊlUqˆUUHy6P#ýùüãÏý1Õý‰CO\[n¹œË@   Füì2ÔÄ9Ä1@B  •— ¼/<äüä90KSX@     ííííY²]@5 ( ' ( ++@h `‰ … ‰ š —ª § ¶ÅÖ÷ ð ÷ ð ]´ q@%  ' ) +V f gs w ‚ ‰ Ž“ – —£ ]46;#"3 ##¹£µ¿¨iL%ëý®kðýǹ~ÖÀœa™ýÿãýôý¬#ýÝ * 2@F ü<ì21@ ©—/ìÔ<ì20@  @ P ` p ð ]33###53Á¸±±¸··ý8ýD¼= @     ÔIJ€]ÔÄÄÌ9´ @ ]1@  — /<ôÄÄ90@2 ©© ©        ìììììììììì<<ììü<3''%'3%# =ëGþÔ!)KÈ4:!þÉíÃþÆþ~2¼eccÅŠhahú×<üIJÿã'Õ'J@ )PP (üìüüüÌü<91@ !•!$Œ( /ô<<ô<Äì2909%#"'&5332653327653#5#"'&¦EÀ‚¯__Ë'9u¦Ë99w{SSËË?°yzVUÕ|v{zâûïº5N¾¤ìûï¢NM_`£ìú)®gb>>ÿ–þf3ÕŒ@)B • °¯6  9üìä99üì991/ì299üì990KSXííY"² ]@068HGif€ FIWXeiy…Š•šŸ]]!3!+53265É–ÄþðýjÍãG?†nÕûáú+áû‡þòôª–ÂÿÿºþVd{KsÿãÙð 1@ 3üì2ôì21@• •­ •‘ Œäôìôìì0! ! "!&32sy:;xþˆþÅþÆþ‡µÊÿ ¬þýVûÜÜøéb¥þ[þŸþžþ[¤ÅþäÃÃýzþÿþÂ=ÿÿgÿã&2ôÌ¢4ÿÿvÿãÓë'ÌX RsÿãÏð3@•¯• ‘•Œ!  üìÔ<ìÜìÄ1/ôìôìôì0!4&#! !2!2"327&nz¼þÅþÆþ‡y;pa'ãÍüXÜþýܯ€ŠÓ–û‹Ó¤bb¥ôþòü-Lþ¸þæþåþ¸gFqþVY{!:@ ‡¼"¹¸"¹Œ½"# E"üìÔìÜìÄ91äôìôìôì04'&##"3232"327&¡&&i‰ðñþïñdRصRQý”¬«•@TþVt™10ü¼98``ÖûŒ‰çÉÉç:ð6ÿ—ñÕ:@••   ? üì2üì91/ôìÔì0@ ?_¯]32654&#%!2+#"#546÷þššþ8ÈûþÿûþÊ„vœÀ/ýÏ’‡†’¦ãÛÝâý¨0_i1Fµ£¹þV¤$O@$#¹¹¸Œ½% ©—%G  F%üì22Ì99ôì1ôì99ääôÄìÄî0@ `&€& &à&]%#46;#">32#"&4&#"326sº£µþçiL:±{ÌÿÿÌ{±8§’’§§’’§¨ý®(ÖÀœa™Èdaþ¼þøþøþ¼aëËççËËççÉþøTÕV@  ?  üì22üÄì99991@• • /ìÜôìÔì9990@ @u|]#.+#33 326&#A{>ÍÙ¿J‹xÜÊÊþüƒý‰þš™Ž´~þh–bþ‘ÕþøÖغOýÑ’ ‘rÿãð!d@ -" "ÜìäüìÄ99991@B!¡” • •”‘Œ"äôäìîöîÎ90KSX@ ííY6 327# '&546?6764'& ÌäÆÊâ{š‡¼­áøþýÖþç’‘×âz¦<;YZþ¡ä¤LäþÀ-|숋Ð_ppÙ¶Ù+23Ù@@mdÿã¼{'Ï@  !! RE(üäìÔìÄ99991@ †'‰$†‰¹$¹¸Œ(äôìþõîõî90@S !S BKSXí9í9Y"²]@/)?)_))€)) )ð)]@% '$&((*//*( ( ))$††††]@.,,,;;;; q>323267#"&546?>54&#" L´fÎà˜«@«eŒ‚aÆflÃZØ÷¥Ä?”b‰‰Z¨N?¬ž‚•$%PKQY55¾##¶œ‰™*!I@TT((ÿÿÉ‹Õ7þòþV×6@   O ü2ü2ÌÌÔÌ1@‡ ‡— ‡½ üìôìÔ<ì20;#"&5# 54!23%&'&#"3wMc°®½®¾þò/µR5¿þ†!n|wjû=hP™«»®ÒØ`@o›š,0A37þVòž?@ Fü<Äü<Ü29üÌ1@©¼‡‡½/üììô<Ìì2990!!;+53276="&5#53w{þ…Ks½¤´F0j&&Õ§‡‡žþÂý ‰N®ÖÀœ01™ŸÒ`>éÕX@ •@  ÔÔìüä991/ôì2Ä990K° TX½@ÿÀ878Y@@pŸ ]!!##"#546®;ýîË^„vœÀÕªúÕ+Zi1Fµ£7òI@  Fü<Äü<Ä2291@‡— ©¼‡ /ìô<ì299ôì990²¯]!!;#"&5#53546;#"w{þ…Ks½½Õ¢‡‡®½®°cMÃcý ‰NšŸÒ`N»«™QÿúþféÕT@• ½•@@ ÔäüäÄ1ôì2ôì0K° TX½@ÿÀ878Y@@pŸ ]!!;#"&!ïýîn†?NãÍýîÕªû=–ªôÃÿÿ­ÿ÷_&8ûÌä4ÿÿ°ÿãië'Ìî XNÿãÏÊ:@!3   üÄüÄôÄìüÄ1@ • •Œ ôìü<ì2220!! 47!5!3254'5!ÏþÀ¡ŽþþÑþÏþ‘žþÁX²Ç ØØƱXþØÂþËþwŠ>¸*‹²²aþ´ÊïþÝ"ðÊLa²ÉÿávÕ-@   üìÔì/<91@ •ŒôììÄ0%254'&'5!'&'&33ÆØcAn³¡ŽÀ¿þÏMèagÊn†"ðʦmWDþØÂþËÅÄtzðü–ÿüððd@  @ @Ôäüä9Ä9/ì1@ •‘ ¯/ì9ôìÌ990@        BKSXííííY""#3 632#54&×9%þ„ËýðÙžNZ£ˆUUªIGý¿ý9Çýšùˆ\[nƒy6P=þVØ{j@  ÔK° TK°T[X¹ @8YK°TX¹ ÿÀ8YÄÄ9Ôì991@:        B ‡½ ¹¸ ¼ Ääôìôì9990KSXíííííí2Y"@      '$$  )( % $ $ ' 755008 6 6 8 A@@@@@@@@B E G TQQUPPVUVW W U U ffh {‰Š … … ‰ ™ • • ¤ ¤ F]@%     # 5 I O N Z Z j ‡ € “ ]+5326?3 67632#54&#"“N”|“lLT3!þ;Ã^0X‡ƒ¹²Q99) hÈzšH†TNü”À43`¿†rr:T*\ÕÀ@5    B ••• B ÜK° TK° T[X¹ ÿÀ8YÄÔä99ÄÄ91/ìôìÔ<ì20KSXíí<<<323#‰ÁüL:sþ§â_%'ST†_ijxzÔXè"Jhì0ªªª@umHLIwKK!!CÌ12èÂ\RI`1]ÿÁùÕ5@ FüÔììÔÔìÌ1@ •• • ôìÔìÌÔì0 4&#!!!%$ $5& ¹¥ý÷¡ý)s¢Q;-˜ýÄþÐþÛ%†“,ªþ%ÐhþàV)$yòÝhþL?`3@  FüÄìÔÔìÌ1@‡½‡ ‡ ¼ôìÔìüÌ2ì03 4&#!!!32!"'hªÎ–¹¥þŸýŸÝiä¦;-˜þè»Ô§c%†“,ªþ&cÔþàV)$yJXÿ㥞$!"'&'5327674'&+#5333!ªpln‰þíUQQLITNP³c9:VÀ>ååÊçæ}wsªº}#¬(rA…bLr¤þ줺þV¤{@@  Füì22ÔìÌ1@ B‡ Œ¼½ìÄôôÌì0KSX¶‡íÌY#36763254'&#"s¹¹4‡QÒ¸MNüÏr98xÜ­zþÐ ªBR1pq™þWþäù…BAïÉþV“Õ&@ —½Füì1ìì0@ @P`pð]3#ÉÊÊÕøÿÿÉþV'Õ'‚”‚þVœÕ:@ ©© — ½  Ô<<Ì2ü<<Ì21ìì9/<ì2Ü<ì203!!!!#!5!5!5!sÊ_þ¡_þ¡Êþ¡_þ¡_Õý—¨ðªý,Ôªð¨ÿÿɔՔÿÿÉ Ðm'?±'ÿÿÉ °f'@Õ'ÿÿqÿã‘f'@¶GÿÿÉþf$Õ'-‘/ÿÿÉþVÞ'Me/ÿÿÁþVï'MvOÿÿÉþfòÕ'-_1ÿÿÉþV·'M>1ÿÿºþVÞ'MeQÿÿhm&$¾u±<1ÿÿ{ÿã-f&D‰Z´ +'+1ÿÿÿþ`m&,/u ´ Ic:1ÿÿÿà^f&ó‰ÿ ´ Ic:1ÿÿsÿãÙm&2'uÿÿqÿãuf&R‰v± <1ÿÿ²ÿã)m&8öu±<1ÿÿ®ÿãXf&X‰v ´ Ic:1ÿÿ²ÿã)3&I08ÿÿ®ÿãX1'q{;¾ÿÿ²ÿã)Z&8L6ÿÿ®ÿãX"&XLÿ¾þÈÿÿ²ÿã)Z&8Q0ÿÿ®ÿãX"&XQÿÄþÈÿÿ²ÿã)`&8M0ÿÿ®ÿãX"&XMÿ¾þÈÿÿqÿã{ÿÿh3&$Iÿÿ{ÿã-1&¦qR;ÿÿh3&$Kÿÿ{ÿã-ô&DKÿ“þÁÿÿH4'q×>ˆÿÿ{ÿãoò'qèÿü¨sÿãð%T@!$"43 &üìü<ÌäüÄÄ1@"#•%•¡®•‘Œ&äôìôìþÔî99ܰ KTX±"@8Y<Ì203## !2.# !2675#535!5‹yyuþæ þ¢þu‹^’opü‹þîþík¨Cýýþ¶ þÖXÿSU™mn™HF×_`þÎþÑþÒþÎ%'µX„¦qþVú{ 4X@"2% G,E5üÄìôì22ÄÄ1@ #% ) †¹¹2/¸3¼ ¹½&)/ÄäìäôÄìþÕî99Ô<Ì20¶`6€6 6]4&#"3263#!"&'532767!5!6=#"3253¢¥•”¥¥”•¥¸³Æ:þúa¬QQžRµZý„š9²|ÎüüÎ|²9¸=ÈÜÜÈÇÜÜënXF]@Œ³,*_EG^[cb::bcªÿÿsÿã‹m&*Ju±!<@”!T!$!]1ÿÿqþVZc&‰JýJÿÿÉjm'¢u.ÿÿÿéœm&Nu*´ +1K°QX»ÿÀÿÀ88Y@ €€@@]ÿÿsþuÙð'42ÿÿqþuu{'€RÿÿsþuÙ1'q';¬ÿÿqþuuõ&qsÿ­ÿÿ ÿÁøm'¾uyÿÿXþL/f&‰TÿÿÿÛþVdf'‰ÿ%ù ´ Ic:1ÿÿÉ ÐÕ'=±'ÿÿÉ °Õ']Õ'ÿÿqÿã‘']¶Gÿÿsÿã‹l'v*ÿÿqþVZc&JvýÉÿã-Õ5@8üì2üì2Ôì1@•­ •Œ/äìä2üìÄ03!327653! '&5!#ÉÊÞÊ>=™”B>Êd`þæþígdý"ÊÕýœdûìŸPNOK¤ŸýZ߀xxvé ý9ÉþVð@@  üì22ÔìÌ1@ B• Œ½ìÄôôÌì0KSX¶‡íÌY%#3676324'&#"“ÊÊ8‘WâÆSTü‘¡=<íºœýº¹HW5xz¤þ7þή GFþÿÿÿÉ3k'u1ÿÿºdd&QCÿþÿÿhs&‡\}ÿÿ{ÿãÜs&§ì}ÿÿHl'\vˆÿÿ{ÿãoc&¨veÿýÿÿfÿºål'þvšÿÿHÿ¢œc&ºvýÿÿhp&$ åzÿÿ{ÿã-d'À˜ÿþDÿÿh6&$¼>ÿÿ{ÿã-H'ÂeDÿÿÉ‹p&( ¥zÿÿqÿãc'ÀºÿýHÿÿÉ‹6&(¦>ÿÿqÿãH'©Hÿÿÿ§sp&, YzÿÿÿÃc'Àfÿýóÿÿw6&,>>ÿÿÿãUH'Â$óÿÿsÿãÙp&2 Azÿÿqÿãud'ÀŸÿþRÿÿsÿãÙ6&2>ÿÿqÿãuH'˜RÿÿÇTp&5 yzÿÿ‚Jc'À%ÿýUÿÿÉT6&5€>ÿÿº^H'Â-Uÿÿ²ÿã)p&8 zÿÿ®ÿãXd'ÀÔÿþXÿÿ²ÿã)6&8ì>ÿÿ®ÿãXH'«Xÿÿ‡þ¢ð'×v6ÿÿoþÇ{'×,VÿÿÿúþéÕ'×S7ÿÿ7þòž'×WœþRsð. 56$>54&#"57>54.#"5632?4o¹ÿþê™È1¹\}p_s£ø54&#"57>54.#"5$32§Fp>!Bl˜³•J¢õžc(v];?Øß"AW?-1CA#E¨“ †p¸tgÍDZX%KŠlaF='‚.`[b[3XpV‹U 2#Pš™³×ÊÊQÌãéÉ×ÕÿÞü²Õñ‡†þÁþÌúÙqÿpD(4%3254'"632!"'#67&5#"'&76323 76'& ¶% 44ÊnˆôþªI5"ÄC0:XY|Ë€€Ë|YX:¸üÕST$TTTTþÜT‚¯- ¸Îþ¿H:E“<$d01¢¢¢¢10d^üæþjtsst–tssqÿã%ð ;W@$3=E (B!8;7B/E<üìôì̲ ;]ôìÌôìì91@$3•­< ;‘<,Œ<ôìôÌÔÌôì990" 7654&327654'&'52 '&54767&'&5476!˸jkkjpkkÔô‚ª_;̨_`Lm‚ä–‹ª˜¬_`œ›ýº›œ`a««CU‚tÅMMþòMMMN†‡š'|OEH-AAˆž+Mdhaº€² "ccÙttttÙcc"FYX‚SJqÿãq 4C@6E B42()+&BE5üìôìÌ2ÔìÌ2ôìì1@4)"¹.­5¹Œ5ôìôì99Ì20" 7654'& '&5467&'&5473327654'qSRRS SSSRþ:4H‚’RQ…„þ„…¤’;4?¡+IHƒ‚IJ,ÅMMþòMMMN†‡MMJ@b™@Y "ccÙttttÙÆ"#VKŽYIAèAAAAtw>\þVÕŸ@ B  ÜK° TK° T[X¹ ÿÀ8YÄÄÔìä991@ B• •• /ìôìÜì0KSX@ ííY@@ )&8HGH  /59?GJOUYfiowxŸ]]+53276=!5!5!!žHrþéi&&ûõ°üg•üPÇþßP%œ01™š‘ªšûoXþVÛ`¬@   ÜK° TK° T[X¹ ÿÀ8YK°TX¹ @8YÄÄ´@`]Ä99Ô´@`]ì1@ B© ©¼© /ìôìÜì0KSX@ ííY@2&GI + 690EIWY_fh€¯]]+53276=!5!5!!ÛžHrþéi&&ý5´ýejýL´þßP%œ01™¨%“¨üÛÿÿhP'¼u$ÿÿ{ÿã-'¸JDÿÿÉþu‹Õ&(z¢ÿÿqþu{&Hz{ÿÿsÿãÙ3&2Ibÿÿqÿãu1&¸qs;ÿÿsÿãÙ3&2Piÿÿqÿãué&RPÿµþ¶ÿÿsÿãÙP''u2ÿÿqÿãu'¸sRÿÿsÿãÙ3&2Kjÿÿqÿãu1&ñqs;ÿÿÿüç1'qr;<ÿÿ=þVõ&q^ÿ\Šÿp\%3254'"632!"'#67&73Î% 44ÊnˆôþªI5"ÄC1¸‚¯- ¸Îþ¿H:E“þÂÿÛþVy` 8@ ‡½¼  OF üìä991äôì990@  @ P ` p ]3+53265Á¸£µF1iL`ûŒÖÀœa™qÿ㌠#/A@1E%G +G!E0üìô<<ü<<ôìì1@(¹ .¹Œ ¸ —/ìä2ô2ì2ì20 6& 23632#"'#5#"'&76'&  7/ST$¨¨þÜT¹õr¹rôÌÿÿÌôr¹rõË€€]STþÜTSST$Túþjtsç–çs Å^ý¢Åþ¼ýðþ¼Å¨¨Å¢¢¢¢üé–tsstþjtssqþVŒ{ %/D@1E$G+G'E0üìô<<ü<<ôìì1@ *¹.¹!¸ Œ½¼0äää2ô<ì2ì20'&  7"'##"'&763253632 6& ÍSTþÜTSST$T¹ôr¹rõË€€Ëõr¹rôÌÿÿú¢ST$¨¨þÜTd–tsstþjtssþóÅý®RÅ¢¢¢¢ÅªªÅþ¼ýðþ¼þjtsç–çsÿýÿº|3 #!#'#7'7 3!Jå†afþp|ÒˆýÖÍ2F;R/þîo½]jÕþ¡¡Yþ'üñŽFF8Äý±þO ÿºŠ",'&76!27&'!2767# '#&# rfÜuÃÃS†v=:efc.1üô ˆ‚tsfjwv„þ´Â9Øt‚ÿˆˆFX»hÏÐ$xYv»+!üf //_ÓH$$Ç\/œþØ­ ÿ¢]¼"+'7&576!27&'32767#"'&#"i`½U—–UQ.-Y_výÓc³PNONMRS]ð“7îGG³cc^NæÌ lOU ý^q+ª$VqrÍg jÕ ;@  • •: ü<Ììü<Ì1/äìÔ<ì20@ 0P€€]33#!!#53ÉÊ¿¿×ü_¿¿Õýwýÿ²ÿº1##'!5!7 !é4þ"Ëþ gZýî™8fý¦,þÔi>ýÌý ý³XÇRªBYþ boþ{=4'&/&'&54632.#"3#"'&/&'&'&'53276 23«@«LLàÎf´LN¨Z‰DE11”?ÆPS{W„Ÿ“*L'TrGYí$alfcca‚FF'K((%$JK‚ž¬®((**T@%$!,KL‰œ[@Ÿ~$š=&[ó#¾5-,Xþ3`!;#"'&/&+=!qjýN\1“*Ll“TrGYí=Z^´ýe`¨üÝ1þø~$š=&[ó?œ %PÕ6@ ÔÔìÔì9991@ •• •/ôìÔìÔì0##32654&+"56;2‘'ÊñššþE¯O˜«þôþ÷Zý¦‘‡ˆ*,¶FÜá×çP{7@   ÔÔìÔì991@ ¹ † ˆ¹¸/ôìôîÔì032654'&#"5632##/dšLU†IVVN˜«û}„ÔÂʦ‘‡AH+¶FntÛÕåþü ìÕ (\@ #  . &%)ü<Ìì22ÌüìÔì9991@(•%• ••­#/ììôìî99/<ì20²*]!!!2654&#!2654&#%!2#!#53“[þ¥D££þ¼+”‘‘”þ çú€|•¥þðûýè¿¿ÉÉʇ‹Œ…fþ>orqp¦À±‰¢ ˘ÈÚp ÿãÎÕ_@ 8AüK°TX¹ÿÀ8Y<Ìì2ü<Ìì21@ • • Œä2ôì9/<<ì2299990¶Ÿ]3!33#! 5#53!3265²ËáË¥¥þßþæþåþߦ¦¬ý®Ã®Õý–jý–¤–þÜþÖ*$–¤¤}ðÓÓðÿÿhÕ0ÉÿB‹“33#!!!!#7#!#!¸ªAX’— þ¼¹.ý˜AªA°®þ<¹Ù—þV“¾ªþFªý㪾¾ÕúÕýãǺþFqÿB&-1&'&'!3267#"'#&'&3273&#"#ÇSošþ+”JajÇbcÐk{cPªm!)ü81Gª\9/ƒý¼‡š¹ZoÏ ”—Z þò6Zþ—44®*,! œ C ¬à"2’ÅJ®žþc¬ÿ–þfRÕY@   ••° 9 üK°TX¹@8Y<ì2ä99ÄÄ1äüìÔ<ì2990@ 0@P`Ÿ]#+53265#5333R¿ÍãM?†n¿¿Ê¿wýñþòôª–¦¸ýHÿÛþVS@$¾± ‡ ½©¼  OFü<<ì22ä991äÜ<ä2ôì99ôì0@ @P`p]33#+53265#533#Á¸£££µF1iLµµ¸¸`þ¤þ(ÖÀœa™ؤ¬ésþf°ñ$C@$ • °%"•• Œ‘¯%  %üìÔì22Ì991ìäôÄìÄîäì99053;#"&5# !232#"³Än†EMãÍMì¥þòþ¬T¥ìüßêÌÍëëÍÌêíèú“–ªô„€«\\«€ýxþãþ»EEþ»qþV@{$H@"‡½%"¹¹Œ¸¼%G E%üìôì22Ì991ìäôÄìÄîôì0¶`&€& &]#"&=#"3253;32654&#"@Fµ£:±|ËÿÿË|±:¸Li1ûï§’’¨¨’’§þVÀÖ¼daDDadªûŒ™a=ËççËËçç TÕ »@  ?  !ü<Ìì2üÄì99991@!  B• • /<ôìÔ2ì29990KSXíí9Y"²@"]@Bz%%%&'&&& "66FFhuuwˆˆ˜˜]]#.+##53! 32654&#A{>ÍÙ¿J‹xÜÊ¿¿Èüƒý‰þ’••’¼~þh–bý‰w¦¸ÖغOýƒ…J{=@ Fü<ÄÄü<<1@ ‡¸© ¼/äÔ<ì2ôìÄÔÌ0´PŸ]###533>32.#"«¹¬¬¹:º….I,œ§h¤þ<Ĥø®fc½ΡÿöìÕ3!733!#!53!Ù— –Ù—œþõþöËþöþôwþјÕààà¤þvý9ÇФ¤â þVµ`+5326?!533!33!+“N”|“lLT3!ÍþÖð¾Ã¸L¸Ã¹ïþ×ÁÚmhÈzšH†TòÍþ3Íþ3þð®ÿã`{ %²@ '  F&üì22ÔìÌÄ991@© ¹¸& †º¹#Œ ¼&äôìüìôìÄÔä¶  9990@1??? ?!OOO O!___ _!ooo o! ! !]@%???? ?!?"OOOO O!O"____ _!_"]2654&#"3>32#!3267#"&߬o™¹¸¸?¼ˆ¬Ëýûþþ§—`¶Te¾Zóð+f{bsÙ´)LªfaÁ¢½À‹..ª''üqÿãZ{8@¹¹Œ¸¼G Eüìôì221/ìäôÄìÄî0¶`€ ]53#5#"3232654&#"¢¸¸:±|ËÿÿË|±ýǧ’’¨¨’’§¶ªû ¨daDDaþËççËËççºÿã£{ 8@¹  ¹Œ¸¼G Füì22ôì1/ìäôÄìÆî0¶`€ ]4&#"326>32#"&'#3å§’’¨¨’’§ý:±|ËÿÿË|±:¸¸/ËççËËççRdaþ¼þøþøþ¼adª`ºÿ㤠$C@¹  ¹Œ¸!©—G! F%üì22Ä99ôì1/üìäôÄìÆî0¶`&€& &]4&#"326>32#"&'#46;#"å§’’§§’’§ýŽ:±{ÌÿÿÌ{±:¹³¥þéZ[/ËççËËççRdaþ¼þøþøþ¼ad¨~ÃÓœ}}ÿãõ{0@†ˆ¹¸ † ˆ¹ ŒEH Ü<ôìì1ôìôìôìôì0>32!"&'532654&#"M¥]ý*þÓþúU¢LNP³ÆÆ³PN3$$þÂþòþîþÆ##¬++ãÍÍã++qÿsç{'/O@( ,,H"E0üä2ìì991@†ˆ¹.*¹¹%¸Œ0äÌôìüÜìõî0@ 11€11 1].#"67632#"'#47&'&!23254#"çNP³Æc'>Ij£J?_S›PI™ 9/•-U¢þŠ:M’„e5¬++ãÍÍrQ,3H=Y}/)9DhQ#3¡ :#ü:9KqþV@$K@$©½%"¹¹Œ¸—%OG E%üìôì22ä1ìäôÄìÄîüì990¶`€ ]#"&=#"323;32654&#"@Fµ£:±|ËÿÿË|±:¸Li1ûï§’’¨¨’’§þVÀÖ¼daDDad^ùØ™a=ËççËËççqÿã¹$=@"¹¹ Œ¸%©—%  GE%üìôì221üääôÄìÄî0¶`€ ]546;#"#5#"3232654&#"¢£µ¿ªiL¸:±|ËÿÿË|±ýǧ’’¨¨’’§¶ÈÖÀœa™û‚¨daDDaþËççËËççqÿã{"r@ KE#üÄìôì91@†ˆ©¹ »¹¸ Œ#äôìäììôì90@)?$p$ $Ð$ð$?????,//,ooooo ]q]47632!"&'532767!7&'&#"qƒ„âü”•œþôkÐcbdcj·fg ü²¸]\šˆRS^ú’‘¡¢þíþöœœ,*®4cd¾žWWZZqÿã{A@$ †ˆ©¹»¹ ¸ŒKEüÄìôì91äôìäîîôî905!.#"5>3 #"73267qN Í·jÇbcÐk 9þ×üâþù¸¥ˆš¹Z¾Ç44®*,þÈþöþíþ½#Ä—´®ž|ÿã„{ 4w@6.('4 KE5üÄìüìÜ<üÜĶ&  91@/©.'"¹"¸5 ¹Œ5ôìôìÔÜì´†ˆôì@  &"90@ 4 &'<<ü<<<%6'6'32#"'&'&'&5>3 73;#"'&5Nf ý— Rˆ¨`•”üä‚\þLÑladbcÐk œ$˸&&i+@¯WRÖŠÏ>8þœE#Z`vþí¢¡‘gœ»'#d4®*,œ#)u”™10œ`ZÈÿÿ…ÿãÈ|Iÿÿ…ÿãÈ|Ë…ÿã*|>i@@603273;#"'&5Â|ŠþþîPUTZGUU]—UTNH‰”›tCDFEwGQPabªLÄq_ì¸&&i+@¯WRþà@\’l­¶«%88ZX83˜,-F@.. §NBj†”™10œ`ZȦFqÿãÅ|/;@ 1 &,E0üìÔìÄÄÔì1@¹¸0©0¹)Œ0ôìÔìôì²#90"327654'&+5327654'&'2# 76ñû`cchÒ—UTNH‰”›tCDFEhÄqr<žÿÛþV`K@ ‡ ½©¼  OFü<<ì22ä991äÜ<ä2ôì990@ @P`p]33#+53265#53Á¸£££µF1iLµµ`þ¤þ(ÖÀœa™ؤqþV¸ 0U@)  †¹¹&#¸-©*— ¹½*-+& G E1üÄìôì22Ä991/ÄäìôìôÄìþÕî990¶`2€2 2]4&#"326!"&'5326=#"32546;#"¢¥•”¥¥”•¥¸þþúa¬QQžRµ´9²|ÎüüÎ|²9£µ¾©iL=ÈÜÜÈÇÜÜëþâþé³,*½¿[cb::bcÈÖÀœa™qþVZ` #C@ †¹¹#¼¹½ GE$üÄìôì21/ÄäìôìþÕî990¶`%€% %]!"326!"&'5326=#"43!¢þª‡–¥”•¥¸þþúa¬QQžRµ´9²|ÎüüÎ=ˆÍ»ÇÜÜëþâþé³,*½¿[cb:ù*qÿãO{8@©¹†ˆ¹¸Œ4 EüìÜäüÄ1äôìôìþÔî990%#5!#"!2.#"326©›Ae×{ýþÖ-hÅ]_Àc³ÆÆ³O|žŒýð$$>:77ª>>ãÍÍã`þRd`#y@ %  $ÔÔìÔìÔĵ 91@ ¹ ½¼$ä222ôì³  990´ì³<´ìµ<<³<³< 3#"&54767327654'&'bBÀþ_j&;––––;&jþ_ÀBC(::(èxüܱS€c‚‚c€S±$úŽ-EIdccdIE-`ÿãd`#y@ %  $ÔÔìÔìÔĵ 91@ ¹ Œ¼$ä222ôì³  990´ì³<´ìµ<<³<³< 3#"&54767327654'&'b)ÙþrG,E––––E,GþrÙ)C'88'ÑýêbLx>‚‚>xLbü-!@2FF2@!-®þVX`9@ ‡Œ ¼ ½  NFüìôì21ää2ôÄì90´`Ï]332653##"&®¸||•­¸¸C±uÁȺ¦ýaŸŸ¾¤{ùöVfcðºdC@! ‡¸ ©— N  Füì2Ä99ôì1/<üì99ôÄì90²`]#4&#"#46;#">32d¸||•¬¹£µþçiMB³uÁƤý\žŸž¾¤ý‡~ÖÀœa™ÌedïºþVd!J@%  ‡¸"©—‡ NF"üì2Ä99ôìÄ1/Üìüì99ôÄì90²`#]+53265#"#46;#"632d£µþéiLø•¬¹£µþçiMƒçÁƤýHÖÀœa™²=¾¤ý‡~ÖÀœa™ÌÉï >@¾ ± ©¼  Fü<<<ì2221/äÜ<ì2üì0@ @P`p]33###533#¸¤¤¸´´¸¸`þ¤þ<Ĥ¬éÿÿ¦n`Mt„` '@   Üì2üì21@  ©¼ ©/ì2üì205!#3!53t¨¨ý𰼤¤ü褤Kß#<@ % V V$ÜüÜ<ü<ÜüÔ1@#!à !×/ä/ì2Ô<ì903327673#"'#&'&#"#67632=¸ &}33[¸ &}33[üí %$R‡IJý… %$R‡IJMT5@  ÜÜÔ<2ü<ÜÄ1@¹ ©—/ä9/<ì2ÔìÄ033##4'# 7632&#"3¢¸úú¸=þèõ5*7M\üþ ýŽT½öú„K9ÁþV_ (@  F üüÔÄ1@  — ‡½ ôìä990;#"&5y=x1F¿™ùÎ|tœÌÊ(ÁþL6$²@#&#" F%üü<ÔÄÔÄì̲#91@B©"©"† “¹ ½"¼ —/ääüìôìì9/ìì³ 990@$#ìì@  **8;ILT[q ]@$$%$$5$7E$FT$\ ]@    ]2!"'&'5327654'&+5!#3!CicUQþÐþè^cdjTÈm¾cd\[§®®ýj¸¸eÜ8+lhŠÝò%Ã12KK„KJ¦óü3þL¨ºÿæb&^@PP F'üìüüüü<91@  ‡#Œ'¼'ô<<ô<Äì290@0(P(p(( ( (¿(ß(ÿ( ]%#"&5332765332653#5#"'&®Cb`‚¯¾¹ruSS¹rw¦¹¹=ZXyzVUØy=<öâ¤ýb¢œ`^¤zýb¢œÀ¢zûž°e32>>ºþVb&a@PP F'üìüüüü<91@  ‡#Œ'¼½'ìô<<ô<Äì290@0(P(p(( ( (¿(ß(ÿ( ]%#"&5332765332653##"'&®Cb`‚¯¾¹ruSS¹rw¦¹¹=ZXyzVUØy=<öâ¤ýb¢œ`^¤zýb¢œÀ¢zùôZe32>>ºþV{0c@PP)%'F1üì2üüüì9Ì1@‡ %*!‡*-¸(¼&/<äô<Äì29Ôì0@02P2p22 2 2¿2ß2ÿ2 ]>32+5327654&#"#4'&#"#3>32)EÀ‚¯__RQµþéi&&ru¦¹99wSS¹¹?°yzUV‰|v{zâýHÖ``œ01™²¡œ¾¤ý‡ž¢NM_`£ý‡`®gb>>ÿÛþVk{Q@N O Füì2ä99ôì1@ ‡¸¼/äôÄì9@  ‡ ½ôì990´`Ï]#4&#"+532653>32k¸||•­£µF1iL¹B³uÁƤý\žŸž¾¤ýsÖÀœa™t®edïºþVJ{;@ N  Füì2ôìÜÄ1@ ‡¸ ¼ ©½ /üìäôÄìµ  90&54&#"#3>32;#"þR||•¬¹¹B³uÁÆ&&i1Fµþ¶`Ö²Ÿž¾¤ý‡`®edïèýH™10œ³d` y@B¼NF üìüì991/<ì2990KSXííY"² ]@068HGif€ FIWXeiy…Š•šŸ ]]!3!#³ÝÄþðþ#Ä`üy‡û lü”qÿãu{ ,@© ¹¹¸Œ Q Eüì2ôì21äôìîÜì0"!.265!2#"q“•t•’•¨ý†¨–ðþîðñþïßÁÁü è””èüþÈþìþíþÇ98q$`I@  EüìÔì2ÔÄÄij 991@ ©¼ © /ü<ôü<@© 9Ð/ì0!!!!! '&76!#";ýÔýë:üáþ»§¨¨§E*%ðxxxxð%`šþÝ›þ”œŽŽ‚lkØÙlm”ÿÜ>|$2@ &E E%üìÔüÔìì1@ ‡‡#Œ¸%äô<ì2ìÄ02765 26= "&'"&H`k&IÐþnÊI&k`þB"F:.a×¢ Öהģµ0[1þÐþð[0µ£ÄÈT\þ¤þ€l²6p£uyŸíÿÿpþVÑiÿå`/@   /Üì2991@ ‡Œ ¼ /ìôìÄÔÌ90%!"/32653#×rþù%832JI,œ§¹¹:º….´˾ü ®fcºþVJ{:@ ‡ ½‡¸¼ FüÄì2Ä1äôìÄÔÌôì90´PŸ].#";#"&53>32JI,§Liéþµ£¹:º….´˾ýž™aœÀÖt®fc„~{%@ ÜÌì2Ì1@  ‡ ¼‡/ì2üì9903!5346;#"à¤þ¤£µþéiLåý¿¤¤AÖÀœat~{%@ ÜÌÌüÌ1@  ‡ ¼‡/ì2üì9903!534&+532Ê´ýð¤Liéþµ£åý¿¤¤A™aœÀº—`°@4  B© © ¼     Füì2ÜÄì99991/<ôìÔì9990KSXíí9Y"²@]@Bz%%%&'&&& 66FFhuuwˆˆ˜˜]]#.+#!232654&#0s2®Ã¢J{Q©¹„ÚÖpýõÆwu t]þ΀:þ'`ž¥iŒþ¯VNM`º—`E@  Füì2ÜÄì99991@  ©©¼/ä2ìÔì9990332673#!32654&#º¹©Q{J¢Ã®2s0jpÖÚþ|¹Æuw`þ':€þÎ]t Œi¥žìþ¯`MNVoþVÇ{0€@C  S('  S'('B©½1 '(†‰‰!¹¹.¸Œ1' ($R$+E1üÄìÔìä9999ìÌ1äôìþõõî9üì0KSXí9í9Y"²0].#"#"/;#"&=32654&/.54632‹N¨Z‰‰b”?Ä¥÷ØdXLiéþµ£ÌÁ‚Œe«@«˜àÎf´?®((TT@I!*™‰œ¶ ™aœÀÖûjYQKP%$•‚ž¬ÿÙþV×4@ O Fü<ì22ä991@ ‡½ ‡—üì99ôì046;#"+5326¾®½®°cM£µF1iK»«™Phû)ÖÀœaÿÙþV× O@ !O F!ü<<ì22ä99Ì2Ä1@©¼! ©‡½! ‡—!üì99ôìÔ<ì2ôì0546;#"3#+53265#53#5¾®½®°cM¢££µF1iK´´¯`N»«™Phý¨¤þ(ÖÀœa™ؤi7þV5e"¶O ÔÜüì1@ ‡½‡¼ôìôì04&+532;#"&—Mc°®½®Ki1Fµ£(hP™«»üí™aœÀþòþV×2@   O ü2ü2ÌÌÔÌ1@ ‡‡— /<ôìì2ÔÌ0!3## 54!346;#"#"3276w·¿5RµþѾ®½®°cMów|n!›o@`ØÒ®»«™Phú£3A07þÀò^3@   /<Ô<ì2991@ © ¼©/<ì2ôìÄ990²¯]!5!4&+5323#²þ…{Ks½½Õ¢‡‡þÀ>`‰NšŸÒý þÂ7þVöž=@©¼‡ ½  Fü<Äü<Ä2991üìô<Äì2990²¯]!!;#"&5#53w{þ…LiÊൣ‡‡žþÂü™aœÀÖå>ÿã`C@ ‡©  Œ¼  NFüì2ôì221/ä2ôÄÜ22ì22ü0´` Ï ]3!33##5#"&=#5!326®¸:¸ºº¸C±uÁÈ®ŸýÇ||²høþøþ¤þ<¬fcðç ¤¥ŸŸºqÿâ„`S@ !  üÄüÄÔÄÌüÄ1@ ©¼ ¹Œ ôìü<ì2220@ààïïÐÐßß@@OO ]##"5467#5!32654&'7!„ìaþäááþäaíºfˆ°°ˆf´¼Hë˜ëþÜ$ë˜ëH¤ÜB׋ŸÂŸ‹×BÜÁ\b,@   FüüÄÄÄÔì91@ ¹¹¸ ¼/ìôìì0+"'&53732654'&'5\Ž‘ÞFµRQ¸&(g3°JInhX§3"î’``ÖÊý6™12Äžèec–0[«s=`h@'B¿ÔK° TX¹@8YK°TK°T[X¹ÿÀ8YÄ91/ì290KSXííííY"33# =¤ú¤Ãþ¢þ¢`û ¬üTV5` ï@   ÔK° TK°T[K°T[K°T[K° T[X¹@8YK° TK° T[K°T[X¹ÿÀ8YÌ91@  ¿/<<ì290@0U U U U   BKSXííííííííY"@ÿ - : FFI O TTZ _ aai vpvpˆ–—› ³³ÁÈÀ       %%#'!%""% ' $ ! #966 90FHF@B@@@ D D D @@VVVPQRRP S T U cdejejjjn a gouuy}x}zzx y  { v }‡ˆ——”“œ›˜˜™ @/–Ÿ¦¦¤¤««©©« ¤¯µ±½»¸ ¿ÄÃÌÊy]]!# # #335¸æåÙæå¸%ÙñòÙjü–jü–`üj–=F´ÔÔÄÄ1µ©—/<ôì0· ü<<<¶  9@   ìì3676;#"# =ìPHJ|“lL*./!ÅÃþ¡þ£ÒÇ>=š$#‡^û²lü”fk`8@   ÔÜüÔÄ91³¼/ä20@ ììì3 3#fÙ%.Ùþ]Ë`þ8ÈýþðXþV¿`ª@"B © ½©¼© OÜK° TK° T[X¹ÿÀ8YK°TX¹@8YÄ2Ä99ì1/ìôìüì0KSXííY"@B&GI + 690@@E@@CWY_``f``b€¯]]!!;#"&=!5!qjýL´Li/Fµ£ý7´ýe`¨üÛ§™aœÀÖ¨%Xÿ‘Û`!±@  "ÜKTK° T[X¹ÿÀ8YK°TX¹@8YÄ2Ä99ìÜ<ì21@ ©¼¹ ©/ü<ÜìÌôì0@ BKSXííY"@:&GI #+ #690#@@ECWY_#``fb#€#¯#]]!367632+#47!5!3254qjýL¯"TA`„:&>R~i™þ–´ýeÿ8ŠFX`¨üÛ¢G7W9W`/=3<;4¨%üÆ6]XþL/` ©@ "!ÜÔÄÔÄì̲91@B©!©† “¹ ½¼!äüìôìì9/ìì³ 990@ ìì@  **8;ILT[q ]@  %$ 5 7E FT \ ]@    ]2!"'&'5327654'&+5!5!`ÆqÿãÅ|/=@1 %,%E0üìÔìÄÔìÄ1@¹¸0 © 0¹"Œ0ôìÔìôì²( 90";#"327654'&% !"$5467&'&5476EwEFDCt›”‰HNTU—Òhcc`þöa——þÖþÆîþþŠ|p<:!ÖÀœa™þå>>ãÍÍãÿÿº`ÑþòþV.9@ Fü<ü<ÜÄÜì991@  ½¼± /<Ì2ääüÄ03#33## 54!3#"3276Á¸¸¸µ½7K¼þÑÁ¸u_+éËû ‹xG`ÝÍ‹BA0 ºþLœ` ## 33œ¹ýÛëRý•ð9¹þL—þ TýÝ#ºñ`@ ¿©FüüÌÄ1/ìì03!!º¸üÉ`ü3“qþVø $C@¹  ¹¸Œ#½%‡—% "GE%üìôì221üìääôÄìÆî0@ `&€& &à&]32654&#"#"32546;#"#/§’’¨¨’’§s:±|ËÿÿË|±:£µþçiM¹/ËççËËççý®daDDadÆÖÀœa™ùÚX¥$L@ & %ÜÜ<ü<Üìij#ÌÌ1@ † $©! ¹—©/ÔäôìÜ<ì2KPXÜÔYì032765&'&#"56763 3###53T?ÀV:9c³PONNLQQUŠmlpªççÊåärLb…Ar+¬#}ºªswÔ¤þì¤X¥$M@ &"#E%üìÜ<ü<Üij "#ÌÌ1@† ©$!#¹ —#©#/ÔäôìÜ<ì2KPXÜÔYì0535&'&5476!2&'&#";3##÷çªpln‰UQQLNONP³c9:VÀ>ååʤÔwsªº}#¬+rA…bLrþš¤þìqÿãà &) 76'& %3!!!+5#"'&7632/ST$TTTTþÜT ¸iýL´ü—ž:XY|Ë€€Ë|YXòšúþjtsst–tssH^þL¨üÛ“¨d01¢¢¢¢10MüùqþL4@#5#"'&76323!2!"'&'5327654'&+5 76'& Z¸:XY|Ë€€Ë|YX:¸jþej€bVQþÐþè^cdjTÈm¾cd\]¥®®ú:ST$TTTTþÜTÍü3¨d01¢¢¢¢10d^þL¨þ$8*mhŠÝò%Ã12KK„KJ¦óÓþjtsst–tssqÿ‘ 3: 76'& %%!332!##47!#5#"'&763233254#/ST$TTTTþÜTØ™ýghýL¯<Ûãþ²)™þ–:XY|Ë€€Ë|YX:¸ý®FXúþjtsst–tss_üú“¨üÛ ö½3<;4¨d01¢¢¢¢10d^ú6[7@ž7!!3!27654&/.54632.#")"'&5#53w{þ…%&s@‚FF^²@«˜àÎf´LN¨Z‰‰b”?Æ£|LþùýÄÕQQ‡‡žþÂý ‰''-,4IM*$•‚ž¬®((TT@I!,—‰’e>POÒ`>7þV&/!05476;#"+53276=#"'&5#53!3wxWQî°c&'QRµF1i&&½ÕQQ‡‡3þˆ%&sžþÂNµ[V™((hû)Ö``œ01™POÒ`>úü¢•ý ‰''7ÿpÉž-9D!6!2&'&#"63 #"'47!"'&5#533276'&#"&57!3w{•ÿUQQLNONP³cccOÎ+eKTI™þëÕQQ‡‡;BS_ƒr(þÖ€‹þ™%&sžþÂz•#¬+qrþfr «öv)2LOAPOÒ`>úù 'KV ø›ý ‰''/þVo5+5327654&#"#!##535476;#"!;67632oRQµþéi&&||•¬¹þÓ¹°°WW½®°c'&-·BYZuÁcc¤ýHÖ``œ01™²Ÿž¾¤ý‡Ñü/ÑN»UV™((hc®e22wxÁA'3!27654&/.54632.#")Á¸ý‚FF^²@«˜àÎf´LN¨Z‰‰b”?Æ£|LþùýOú†-,4IM*$•‚ž¬®((TT@I!,—‰’e>Áâ Ž@   Füü<ÔÄ2991@ B ©¼©—/ììôì0KSX@  ííY@B &GI   + 09 @@@@@C EWY `````b f¯¿ß]]3!!!+Á¸iýL´ü—ž¸šþL¨üÛ“Íüù6ÿâé 333# #333# #6t‘‰‘t¹ˆ˜™ˆ¹t‘‰‘t¹ˆ˜™ˆUþéþéýýþ=þéþéýýþ6­é3@    Ü<ì2Ô<ì2Ä1@  ©©ÔüÌ2ÔüÌ20!#!#!#!#6³ýk³ýkUþXþûrþXþûþJ3@ NF Ôüìôì2Ì1@‡Œ ‡ —¼½ììôìôÌì0%#"&54&+53232653#׃çÁÆLi1Fµ£ø•¬¹¹¬ÉïèÄ™aœÀÖýBþþ¤yùìþVv!:@ #NF "Ôüìôì2ÌÌ1@‡Œ" ‡ —"‡½¼"ìüìôìôÌì0%#"&54&+53232653;#"&'׃çÁÆLi1Fµ£ø•¬¹Ph2F¶ž¬ÉïèÄ™aœÀÖýBþþ¤yûŽ”fœ¹ÝuœÄ0@ ÔÜ32ÄtNN^luu)qJy}þ…wYYk\þžgþ«88†uœÄ:K°SX@ ÔÜ<Ì/ÌÌK° QX±@8Y1²]@ Ô<ÔÌÔÌ0Y#4&#"#46;#">32ÄtNN^lugr ’B0)qJy}þ…wYYk\þž„xkW6Vr88†ÿé­î #@Ü<ÌÜ<Ì1@ÔÔÌÜÌ03+5327653#zt43r,Bttý‚x66XVr‚uœ@ ÜÌÌ1@ /ÄÔÌÔÌ0.#"#3>32.biuu$uT ¯ qkþ¶sa97Hä´ ÜÜ<Ì1µ /ÌÔÌÔÌ032653#5#"&'H.bitt$uT ü qkJýa97H­u'¶ ÜÜ<ÜÜ1@  /<ÌÔÌÔÌÜÌ032653;#"&=#"&'H.bit0B,rg$uT ü qkJý V6Xlx a97 œ!+33276?3327654'&+›CFCD‰ôtk=%%(f{n!!"þ×}K'))'K}éN;[--sþ÷?¡«5ÿ/.6œé 333# #6t‘‰‘t¹ˆ˜™ˆþéþéýýþ&­Õ+53276?33Ÿ1/.N]D0 þâ{ÝÜ{bp"#WK/iþêÿÿ tŸfÿÿ tf&tÿÿ®éÓÕ úÿÿ²þ×Õ ûÄîéÚ@ žÜüÔÌ1Ôì0#5—R¤Ú¬þÀ@¬uï‡1´ Ü´? O ]Ìܶ ]<1¶—ôÌܲ]9Ì0526544u@XX@sPOOPï{X@?X{POæPPuï‡1´ ÔÌÜ@    ]<1¶ —ôÌÔ²]9Ì0"'&4763"3‡sPOOPs@XX@ïPPæOP{X?@Xuœ‰+@ ÔÄÜÜÌ91@   ÔÔÌÔÌÜÌ032765&'&#"567632#'y7$#?q22110335®WDDFk€[@*7K$@ ` XFh_@Cþ“uœ‰-@ ÜÌÜÌÄ91@   ÔÔÌÔÌÜÌ0#&'&547632&'&#"3êkGDEW­53301212q>$%6y[þAmC@_hFX ` @$K7*@ 2õ°% % êþ™gþ»õ‹´´‹õ 2õ°5-5õþgþ™ê'õ‹´´‹õÁ|?f=´uÜì91µ³ôÌ2´]90K° TK°T[X½ÿÀ@878Y3# #¶”õ‹´´‹fþgþ™Á|?fL´uÜì91µ³ô<Ô²]90K° TK°T[X½ÿÀ@878Y@ 5:5:3]]33¶õ‹´´‹õ|êþ™gþÁî?f7@ ´³uÜì91ôì290K° TK°T[X½ÿÀ@878Y3#'#¶”õ‹´´‹fþˆõõÁî?f7@ ´³uÜì91ô<ì90K° TK°T[X½ÿÀ@878Y373¶õ‹´´‹õîxõõþˆÖç^@ÜÜÌ1@/Ä0#^ˆýÕ+ÿÿÕb+öqsîRf3#‹Çþº™fþˆªð‰f #o™þºfþŠvÖþÑ^ü@ÜÜÌ1@/Ä0%#^ˆüýÕ+ÿÿÕþÀ+ÿTqù^ªþ‰ÿ’#o™þºnþŠvsþRÿ”3#‹Çþº™lþˆoÔ#E@ Ô<ÄK°PX³@@88Y2991/ÄÔÄ0@ `o]@ P```dd]!!!²e³³þ›ÙJý'þ¶oÙÔ#4¶ÔÄK°PX³@@88Y91ÔÄ0@`]@ P``d]!!²eÙJÿÿuþ‡#€þÿÿuþ‡#þÔá–!533áþ>––j––,þÔÔá–5!##––––þÔ,dÿºU 533##5#5D–àà–àuàà–àà–dß&u!5!&þ>Âß–Ç)9H W@ ð³VVÜìÔì1ô<Ôì0K° TX½ÿÀ@878YK°TK°T[K°T[X½@ÿÀ878Y332673#"&Çv aWV` v ž‘‘žHKKJLšDfN@ ÎÍdÔì1üì0K° TK° T[X½@ÿÀ878Y° KT°KT[X½@ÿÀ878Y3#šÌÌÌîá  @Áò ÁñV xVÔìôì1ôìôì04&#"3267#"&54632˜X@AWWA@XzŸssŸŸssŸô?XW@AWX@s  ssŸŸLþuÁ @  óô 'ÔìÄÔÌ1/üüÄ90!33267#"&546¸w-+76 >&Dzs5=X..… W]0i¶J7c@$  Ãà íVwVvôìüì99991ü<üÔ<ì99990K° TK° T[X½ÿÀ@878Y'.#"#>3232673#"&ü9! &$}f[&@%9! &$}f[&@Z7IR‡“!7IR‡“ðî®fB@´³ÔÜÔÌ991ô<ì20K° TK°T[X½ÿÀ@878Y3#3#ü²ø‡ªß‰fþˆxþˆÿÿÞ­%3;#"'&5¸&&i+@¯WRþëd¤”™10œ`ZÈ¢ïîf '#7'373\\]´µµ´]\´¶¶îaa»½``½»u«ý # 5473733254²òþõµú‰¿·‰þ¼‰ˆÜù´„„¿ò/ààþŠ®˜MM‰zœî ±/Ì1±/Ä03#zttü™uœ/2&'&#"#"'&'532654'&/&'&547632j1549W++](}24NMˆ9>=D@?>=RX o(l00GF‚@99 a /$*+MW33 k2-*)*IX01 uœ! #'#37ÿ ‰Í͉û‰»»þÏþ¾ööH+ßßÿÿuœ‰ƒÖX@ ©ÄÔì1/Ôì0!!5!•þAGЈú¨ÖX'@??//©ÄÔì21/ÔÜì]0!!5!3•þA¿ˆœˆ4ú¨ÖX@ ©ÄÔì21/ÔÜì0!!5!3•þA¿ˆhˆhú¨ÖX'@pp00©ÄÔì21/ÔÜì]0!!5!3•þA¿ˆ4ˆœú¨ÖX@ ©ÄÔì1/ìÄ0%3!5•ˆý¹ˆÐú¨ˆÿÿÁýì?ÿÖ‡ùpÿÿÕâ+v'q€q€ÿÿ®émÕ ÿÿÿîþ9œù3¶þvJÿ!_@ Vw V v"ôìüì99991@  à Ã"Ô<üÔ<ì99990K° TX½ÿÀ@878Y'&'&#"#67632327673#"&ü9 &}33[&@%9 &}33[&@þ³7 %$R‡IJ!7 %$R‡IJü¨{þ‡f6@ ´³¸DÜì91äôì0K° TK°T[X½ÿÀ@878Y # ým™þºXfþŠvþýq{ÿPf6@ ´³¸DÔì91äôì0K° TK°T[X½ÿÀ@878Y3#þ‰Çþº™fþˆsüÁ{ÿ?f<@´³¸uÜì991äôì290K° TK°T[X½ÿÀ@878Y3#'#ý¶”õ‹´´‹?fþˆõõsÿÿü´ÿH7žûþÿÿüÙbÿ/öqüÿÿûì|  üÿÿü¿)ÿ1Hšûøý¢{þZ%@ ¾±¸Ôì91äüì0@4D]3#ý¢¸¸^é°ü×{ÿ)I@Î͸ dd ÜüÔ9ì1äü<ì20@#4D`````````ppppp]3#%3#þ^ËËþyËË)ÊÊÊËý7òþ÷{"@ V@€ V /ÌìÜì1@Á@À /Üì0632#546?654&#"ý7pihX,#w3-.>GZdH3UC=A   (6%""($4ÿÿüìáÿœûþÿÿüôîÿ²fŸüüÅ{ÿCf<@´³¸uÜì991äô<ì90K° TK°T[X½ÿÀ@878Y373ýºõ‹´´‹õNîxõõþˆsý¼ìþD¨²/ì1±/Ì0#þDˆ¨þD¼ÿÿüðìÿ¨'¾ÿ4¾Ìü]îÿfB@´³ÔÜÔÌ991ô<ì20K° TK°T[X½ÿÀ@878Y#!#ý͇ø¾‰ßfþˆxþˆxÿÿü¿)ÿ1V'¸Bšûøü¿)ÿ1H µVV/ìÔì1´ ð/<Üì0#.#"#> Ïv aWV` v ž"ž)KKJLþéÿD( @ÔÌ0#3þòÓ¤é?ýÂþ‚Á#55#53þ‚òppòÃþÿ{‰þýÂþ‚Á53#7"ýñopòÃþþ‰{ÿyš‡3#@Çu™þˆÿÿü¨ýßþ‡ÿUCûþøïÿÿýqýÝÿPÿUvûþøïý$þþ<ÿÎ#5353#ýÄ  xxþµx¡þFýÄþþÜÿÎ33##ýÄx  x2¡x¡þU†?p!5!#Iþžêˆèˆþþðk{à1@V/K° TK° T[K°T[X¹@8YÜ2Üì1@ Á/ÄüÌ0532654&'3#"&þð=X..… W]0i×w-+76 >&Dzs5ý€þþVÿ¾ @  VÔüÌ21@Á Á/üÜì0"&5463"3þVZ||Z(55(þ}ZY|x5'(5ý þþõÿM3!5353þD±þ±ˆþœˆˆ±ý þþõÿM#5!##ý¼±걈þňˆ±ý$þþÜÿÎ #53533##ýÄ  x  xþµx¡¡x¡ý þˆþõÿ5!ý êþˆˆˆýzþVÿЀ '+53276=0RQµþéi&&€”Ö``œ01™”ýwþVÿÍ€ %3;#"'&5ýw¸&&iéþµQR€”™10œ``Öý¢þ‰þZÿs3#ý¢¸¸êÿÿüÕþ‰ÿ'ÿSjûþùCý(þþÔÿ¾ @V xVÔìôì1@Á Á/üÜì04&#"3267#"&54632þ[6'(55('6y|ZZ||ZZ|þê&65'(56&Z}}ZY||ýjþþÿT @ÔÌ03#ý¼Ó¤¬þÀÿÿý#þuþÁzüÿÿýLþuþÁüý¼þþDÿ ²/ì1±/Ì0#þDˆ`þtŒüðþPÿÿš#5!#é‰þë‰fþ¶ÂÂJücþ9ÿ˜ÿX#"4533273273"ýþ Ïv aWV` v ž"žþ6KKJLÿÿü´þ9ÿHÿSžûþùÿÿüÙþÀÿ/ÿTüÿÿûìþþ¬Büÿÿûìþÿî ùüûŒìÿ­ #"'&'.#"5>32326SKOZq Mg3OIN’S5dJ t]F‰ ®;73 !;?®<6 7=ýxÄÿˆh!5xýðh¤¤úíÄÿÿh5!úíĤ¤ûhÿ¢ÿ¼¼'ûÈ`õ_^NÌOúÿºÿ‘'úygfFXYý¬þþ‚ÿ¾ @  VÔüÌ21@Á Á/üÜì02#52654&#ý¬Z||Z(55(B}ZY|x5'(5üñþ[ÿÿ¥3!53üñ‰‰þ[JÂÂþ¶ý!þþãÿÖ!5#þãþ>JÒ*þ>Âþ¶ÒÒücþ9ÿ˜ÿX632#&#"#&'"#72ýþ;tÚv gfv ifvÜtúRþæ––•–ý+óþå­ '7'77þ}`}}`}}`}}`p}`}}`}}`}}`þÂÿ Ò.54675>54'&'þC!“‡RI 7!“‡RI Ç0PQn +0PQn ÿÿûì: ' ü üþ¾ÿÿü¨ðþ‡fCûþÿÿýqîÿPfvûþÿÿü´ÿH7žûþÿÿýÂþ‚ÁÄÿÿüçFÿbÒüÿÿýÆþVþ¢ÿ¤üüÕÿ+I#5!#!Õ–þÖ–V––,ýþ2þáÿ¸!5!5!5!þáþ>Âþ>Âþ2x–xýþþëÿ 3#3#ý––@––`þtŒþtýþþáÿÖ!#!ý–þÔ*þ>,ü¶îÿJf'73327673#"'&'#7&'&#"#67632ýÿBmk  &}33[& !Bnk  &}33[& ÿg©  $%R‡JI g¨ $%R‡JI ü¶‰ÿJÌ!%'.#"#4632326=3#"&3#3#ýü9 $(}gV$=09" (}gT";è––Ò––h! 2-ev 3)dw.–C–ÿÿü¶ÅÿJ"·§ücþ(ÿÿ 7!#'73!'3þp„þ„¯¯„ç„~¯¯þ(››ÍÍ››ÍÍý3þþÍÿ¤#557'þ2d›ÍÍ›þç„~¯¯~„ýxáþˆ&'&4767þˆ@*,,*@rNPPNr‹*,@A++{OPæPNÿÿü¿`ÿ1Ø'¸åÿÿý+þþåÿÎîù!ýxáþˆ050567654'&ýxrNPPNr@*,,*‹{NPæPO{++A@,*ÿÿÿ.Dÿú›ý”üþÿoÿ¿2>&"762"'"&46264&"ý 5O57O5÷>µ||¶=>¶||¶þ66O55þÃ55M75m?|³}A@}³|þÎ6M65O5ÿÿüpþÿ… !üÉÿÿüpkÕ !üÉPüp×k!!üp øàk”üpþÀÿT!!üp øà¬”ý* Ö'#'&'&#"#67632327673#"'&O,$e5F¢qpÈ[?9ZO,$a9G¢qpÈ[?9J7  $0G‡JI "7  $,K‡JI ÿÿüpn "üÉüwþ(“ÿÂ5!'3#7üws„~¯¯~„þÃd›ÍÍ›ÿÿÉqÕðÿÿÁÐ`ñÉÕ !#!#!#ÉSÊþ†Ëþ†ÊÕüôbúÕ+ýžÉeÕ !#####Éœ¸¹¹¹¹ÕüôbúÕ+ýž tŸf@ÔÌ1ÔÌ03 A¾ntòþ þVŸH@ÔÌ1ÔÌ0%#ŸA¾nHþòÿÿÉ3Õ¬ÿÿºy`̶þV’ÿ¤ #"'&=3;’”• #þV!.åå ÿÿÿãõ{ÿÿqÿãç{'yOÿ„Fÿÿÿãõ{'yŽÿ„ÿÿžÿÃ#sîRf1@ ´³DÔì1ôì0K° TK°T[X½ÿÀ@878Y3#‹Çþº™fþˆÿÿ×FRÒ&jl@¯Ÿ_]@_q0ÿÿhf'þÚ&ÿÿÛH®Fyÿÿÿçuf'þt*êÿÿÿóf'þ€,äÿÿÿí}f'þz.êÿÿÿòÿãf'þ4(ÿÿÿá‘f'þn9ªÿÿÿÛf'þh=6ÿÿ€Ò'ÿ.MÿÿhÕ$ÿÿÉìÕ%ÉjÕ@ •üüÌÄ1/ôì03!!É¡ý)ÕªúÕhÕ=@ B••ÔÄÄ1/ìôì0KSX@ììììY !3¼þf5û¹:å9ûš¨Õú+ÿÿÉ‹Õ(ÿÿ\Õ=ÿÿÉ;Õ+sÿãÙð!2@•‘"•­" •Œ"#3"üìÄôìÄì1ôìôìôì0!!"3276'&' ! '&76ÅÂý>bÜ‚ÜÜ€€Ü:x¼¼þÆþż½½¼pª†¤¤þåþæþ¸¤¤¤¤¤þ[þžþŸÒÓÒÒbbÓÒÿÿÉ“Õ,ÿÿÉjÕ.hÕ<@ B•ÔÄÄ1/<ôì0KSX@ììììY3#3#åÕ:å9Òþ&Õú+ÿÿÉÕ0ÿÿÉ3Õ1ÉbÕ *@• •­•   ü<ÄÔ<Äì1/ìôìôì0!!!!!!2Çý9i™üg™ügqªªûªÿÿsÿãÙð2ÿÿÉ;Õ³ÿÿÉÕ3É‹Õ F@B ••  ü<Ô<Ì1/ì2ôì20KSX@   ììììY%!!5 5!!±Úü>ßþ!°ý8ߪªªpªªýóÿÿÿúéÕ7ÿÿÿüçÕ<sÙÕ'<@) !%(üìÔ<<ü<<ÔìÄ1@•' •%'/Ô<ü<ôÔ<ü<0367654'&'&'&76753#–b‚‚b–Ê–b€€b–Êôž½½õÊô¼¼ôÊŽWsÆÅsWWsÅÆsWü† ¡‡ŸŸ†¡þñþò¡†ÿÿ=;Õ;sÛÕ.@ •ÜìÔ<ü<ÔìÌ1/ä22Ü<ì20!6'"'&336763#ÂÖ¼¸Õ‚nŠÊŠn‚Õ¸¼Ö†°ÒÌh™þgþ椌ñüŒ¤™þgþ˜ÌÒHîNÏç&3@ •‘&•("3'üÄüÄôÄìüÄ1/<ì222ôì0%!567654'&#"!5!&'&576! Ïý¨±cc„„ØØþ÷cd²ý¨?žIHÀ¿1/ÁÀGG¡²²²a¦¦Êð‘‘þÝïʦ¦a²²‹••¸>ÅÅÅÄþË””ÿÿXN'/u.´ +1ÿÿÿüçN'qu9´ +1ÿÿqÿçäf&Enÿÿ…ÿãÈf&PIÿÿºþVdf'ÆKÿÿ¦˜f&MÿFÿÿ•ÿã*Ò&Yqÿçäy *È@ ,%E+üìÔÄÄ99@ ?/]q@ ¹)¸ ¹!Œ¼‡/ìäôìôì99@<ììì<ìì10@ „†ˆ‰ €]@IIIJN LNIK ]@:9:88? <>]@ + +*))]@  ]@++]'&#"3273;#"'&'#"'&763 N,-²†=MKLy†H¤c¤Í( #) Xn^T).^,ëruÆ7 çínжÜikÕç%ý¡Û1)0œT*XoW)˜&ŠšÀþVˆ!7@E Füì2ÄÔìäÔì1@¹ ¹¹ Œ½ìôìÔü9Ôì0%#! !"3 5 4# y¹ª²¬þÔYoÅ þ0kêþûEþÈþþîdZþõþ&J­:ª@ÛþÈ þV`@@ ÔÔüÔÄ1@ ¿½/<ìä20@ ìì99ìì3#&+532iõ^Ãþ;¸þÚ,_1FŰýLdû þVªD~žqÿãuð-T@(/E( Q!E.üìÔìô² ]ìÄì99@%¹%¹Œ.ôìÔüÔÌ99@Sì910&#"#"'&4767&5!232654'&'&ìfïýÐuމ‰ð‰5Kœ¹ÝxþD7VUV•“¬[a~@Fu\0%p‡þëþ÷œœÌ¥@$OFþ(IqÌËrsè¾Ç`g …ÿãÈ|2=@" † ˆ¹¸3©3'†(ˆ#¹,Œ34 '0E3üìÔìÔÄÄÄ1ôìôìÔìôìôì0&'&547632&'&#";#"32767#"'&546‹p<@ ÔìÔÔÔÄüÌK°QX¹@8Y1@¹ ¹Œ‡—ôì2ôìÜì0%#457654'&# !5!Ê„OTJP£E* :ý¢;ýìfý,KOxsPWKL,#%5,*3ìY¹¹þ”þ'þiºþVd{1@‡¸ ¼½ FN  Füì2ôìì1/ìäôÄì0@ €]#4&#"#367632d¸||•¬¹¹BYZuÁcc¤û²HŸž¾¤ý‡`®e22wxqÿéu$!O@ ¹—"•"¹Œ"#E QE"üì2ô²]ì2ì1ôìÔ@?]ìôì0@ w #€#]!3276'&#"2#"'&76±ýƒEV•–SI 6V“™Q@=ð‰‰‰‰ðñˆ‰‰ˆÆþÕœŠÉdžœ~þü´ÔÓþŠþ‹ÔÕÕÔuvÓÔ¦n` @ FüüÔÄ1@ ¼‡/ìä0;#"'&5c"$lYo´RR`ý+‘.0œ`bÔÊ¿…` I@   F üì2ÄÔÄ1@¼ /<ä20@   ìì <<ìì33 ##¿¾ãàþGþáþb‰¾`þ/ÑþZýFBþ?= F@ ÔÄÔÄ1@ ‡ —/<ôì0@ì ììììì # #'&+5zÃþÆþ~ÃëJ/k`uâeú›<üÄ2Æ~žÿÿ®þVå`wJ`B@ÔÄÔìÄ1@ ¼/ä20@ì ì9ì9!367676'&'31 þªÆ!xdLjºE.*ˆ±{`üT|¬p5dwƒY|rNįätkþR&@@ (" %'ÔìÔìÔÔÄÔÄüÌ1@¹ ¹Œ'#‡"‡—'ôü<Ôì9ôìÜì0%#457654'&# %$47#5! $Ú„OTJP£E* :ý‘MþèÜÐý‹ýÆKOxsPWKL,#%5,*µ,X$ÅR¹¹þÝ¿ ªþ¼þñÿÿqÿãu{RJÿÙ˜`/@  ÜÄìÔìÄÄÌ1@ ‡Œ‡¼/ôì22ôì0!#3267#"&5!##J117,#J%x\þc¼`¸ýPH?… ƒ°œüX¨ºþV¤{1@¹¸¹ Œ½EQ Füììô²]ìì1ìôìôì067632#"&'#44&#"326=—;¶ÌÿÿÌ{±:¹+§’’§§’’§˜fZ#þ¼þøþøþ¼adý®ÏçÝËççËËççqþRç{$6@ !& HE%üìôÌÔüÄ1@¹¹Œ% † ˆ ¹¸%ôüôìôìÜì0 !2.#"32#457654'&¨þóþÖ-U¢LNP³ÆÆ¯ƒPTJP£E* >:##¬++ãÍÍãLOxsPWKL,#%5,*qÿãÖ` 1@  QEüìô²]ìÔÄ1@ ¹Œ‡¹¼ôììôì0"32654'&'!##"'&76s˜RV«•“¬VOšcÎm‰‰ðñˆ‰‰qÎns¾ÉçèÈ·zn’¸œÝþ휜›dm`#@  ÔÄüÄÄÄ1@ ‡ ¼¹/ìôì20%;#"'&5!5!!æ$lYo´RRþ\ þWÌ0œ`bÔ¸¸ýã‘•ÿã*`+@ E FüìÔìä@?? ?]1@ ¼¹/ìô<0327676'&'31'"'&5R27k–i;jºF-*€œþ³eb`ý+‡@EÐv»f€wƒZ{sšý»äxvÅÊpþVÑh )=@+E(#E*üìÔ<Ìü<Ôìì1@¹ ¸*'‡Œ½*ìô<ì2ô<ì20"27654'&'2##"'&7673=A__UVF6Œ‰‰Ë·Ç†ˆˆf¦B:VVMpË‘ýRh]ßÐp[„þÙþñ¡˜þn‘™œ’m£Ns¾Êsg¯.;þUda®@    Ô<Ô<9±Ä1@ © ¼©½ü<ìü<ì90°%KSX@ ìììì´ ´´ ´´9´9´  9´ 9Y#&+53;'$Ü•þÍÙ²¶1š1FA”3ÙþN¶1š1FþþúýÐ×~ž§þ0üèþ)~žpþVÑ`6@   ÜìÔ<ü<ÔìÌ1@ ¼ ‡Œ½ìô<ì2ô<<0&'&53367653#EçkƒºUJ|·ƒCUºƒvÜ·%awó‰ý~·LBÕü,BT¯ýxünc#þn‡ÿã'`8@E  EüÜììÔüÔììÜì1@ ¼ ‡/<ì2ô<Ä0 433233243! &þa›ÆÞ˪ËÞÆ›þaþð!)Rë@þÀðþOýæ±ð@þÀëý®+þÕÿÿ}&Mjÿ.ÿÿ•ÿã*&jYÿÿqÿãuf&}Sÿÿ•ÿã*f&"Yÿÿ‡ÿã'f&]YÉþVjÕ 3! # #ÉÊžýþ’†ý ÊÕý‰wýHüãþV„õý1§ÿéM$ 'G@)E& F(üì2ÔììÔ²?]ì1@ ¹("¹Œ(¹—(ôìôìÔ¶?]ì990267656#" '&76#327>&iPËDyÌz]6îö;~þ‹ox†Ò¤Ú]ûYß:P®W­p=l“Þºlþǧé‚_ÕÕ¨,¾Õâþå¶–þꀰœ-Ñžqÿéu$ 7@ !EE üìÌÜììü<1@‡— ‡ ‡Œ ÌôìÜìôì04'&#" '&4632  ®1B•SxyJþ̃ÓЯÚõþäþ#þõ¼°/¥pö~ª‰ZªZ7ªAi6 Þþdüüþe¶Ò þóþ½BWQß I@ "!ÜÌü9ÜÄ´?@]Ì1@•• •‘/ô<ÌììÌÔì99@ oÏ]0#4''&"562%62#"F R*Ë*R Mw(oUCHk&_*SK…Hþó¥ývŠ¥ H# ª 0þr{C @[)/Bÿÿÿá¡f'þnfPÿÿWQN'ÅufpþVÑ'A@)   $E(üìÔ<<ü<<ÔìÄ1@ ‡¸(‡ Œ— ½(ìäô<ü<ô<ü<02##"'&76327676'&#"üÇ…‰‰…Ƿdžˆˆ†Ç·qMTVMq·qLWULþc™œþíþ휙þo‘™œœ™úwgsÊÈugü¸HguÈÊsgAÿãm`E@ EEüÄìÔüÔìÄì91@‡¼‡ Œô<ì2ôì22Ì05!#%$! 47)323764A,“Mþaþñ")þøþaM:ü’GÞϪÏÞ¨¸¸Ï¤ý­*þÕR¤ÏѧþOýã®§pþ[Íg9&'&47#"54654'&#"563277632327"'532ùö! ½`È7"7$>Ž9[@[½`È7"7þÜ>Ž9[&ÍF¢]_I¤ ðI5lþ÷|"Oš Šz:6hlà0'þÃ[Ml |"Ošþ÷Šz:6hlýàf$1 1sþXÙðD@!  üìܶ0]ü9ܶ0]ìì1@ • ‘ •½ ìÔ<ìôì0#&'&76!   76'„¸ü ½½¼;:¼¼¼Ÿ{þH‚‚¸€€þp³ÒÄÓÒÒÓþžþŸÒ³I¤¤þåþ椤¤¤¤qþVu{ <@!E E üìܲ0]ü999Üìì1@ ¹¸ ¹Œ½ ìô<ìôì0"32654'&#&'&7632s”VVUV•“¬VV9ª¾k‰‰ˆñð‰jßstþntsèÈÇtuü þn’}œœœþÈþìþíœ{‹þR«Õ$.@ & #%ÜìÌÔÌüÄ1@ ••Œ%•"%ôìôìÜì0 32#457654'&# '&76)Fþó`{[mÈzYTJP£E* :þÀŽ•¹Šxe+w˜þÍþµ˜TOxsPWKL,#%5,*ËÖeNí±ªqþRQ` 4@ " E!üìÌÔÌüIJ]1@ ¹¹Œ! ¹¸!ôìôìÜì0")!"32#457654'&gÌþÖ-­þ[³ÆÅoƒPTJP£E* >œÇÎÍãLOxsPWKL,#%5,*ÿÿÉ#Õ)ÿ@þVF'6·  (ÜÌü<ÌÌ1@‡ ‡ ‡—( ‡$‡½(üìÔìôìÌÔìì0347632&'&#"!!#"'&'53276îˆ`©1213$)),x:KAþ¿‹b­933.1220W@R‚ Žd ¤>QoþÉý?’¥s ¤K_³ÿüÔÕ7"'&76'&526n ê'BƒæQ_šý¬'BƒæQ_‡þ[~ý,`*l#½FR¶Úþ‘`*l#½FR¿ˆB@ ÜÌ91¶B©—/äÔì0KSX@ììììY #!3ˆþç¸âý&¸âpüÆMý]rþV`ð!#56! #'#64?!"QªÍhЂÙíÖöáRR_@Ͷ»Ðþ¤0:ýŒIKiÆÏþÎþìýÂþXþ’LÊÑ}/M4ÐýÆ!÷wþ–x#&'#&' #'nï¹d2þF¹b.¼Ó-òà¬t¨`4þÌÀ#Mýа!„¤ØÈþPþßþ‰^ösþKÕ=W@< 9:?5 +,">üÜììÔü9Ô9ììÜìÜKSX° +9> &1•Œ>ôì29ô<ÌÌ90'6767&'&'#"'&46733276=332764''3=DÛ´þìvŒaŠyͤgDd''de’Óy{d;]ùT‡CHI}rHGÇFFt†AGC‡Tú_8dàþïËæ¦ˆd*…0Q€A^­­^^±´˜ÉŸFþ¿Ÿ·þÍkmihÆññÆhimw'·ŸAF‚œþë‡þU'`%S@!'E  E&üÜììÔü9Ô9ììÜìÜKSX°"Pe^Ò8*ˆ7D˜ ! ! 12ÀÔ°œˆ.#A“L.#^YŒq4+& "H4B;;=/?"+ŸVhP’OþV ö!! 7654'&#"#676! 3 7úÿþíþ¯þ¹º³llc¤´^#ð,V£¡¢¢þ÷þœÕ)èì¾£ñÛ„œe]’6?¡f‘ñضþòþ…µ³dþVj{ # 7654'&#"#67632327\ÚêþîþÞB§\\T‹™PÌ%I‹îèНþ/‘©ýÅþï™yYÂk}oSKu,2Rœè¤œÅþàºs¶ï5%! &'&#"567632 67632'&#" ;!53276ÚnþÍþ€þÜ"?E! rK,/ 4'Kr !D<&þÒtEGúÃGH ªÊþh=»" » C(FþK#C » "&þEýà !ªª!6Ë{5%! &'&#"56763267632'&#";!53276šÌäþ[9ï6:ƒ@%(ÅÅ(%@ƒ:6ö-:IûkI:ž8þî¤=35þú53þ¸þgžžsÿã%+$67632! '&76!2767&#"327*þÖW8QU{‚õ2þÎþùþΤ£‹|°s• K^—lŽÈº¼hiie¿¼b-sJ V"1þ¼ýðþ¼œ›PÞÒ» '±$üA‚æstÀ½xssqÿã[/&67632#"'&76!27674'&#"3276›ãI,)e[xÌ€€Ûÿ‰ˆtgO_\SG]EZ¨ST’•VXXT—”RS7xJ©F61¢¢ý𢢜›PÞÒ» '§'üøÍrsstËÇxsst,þV·Õ4@  Ü<Üìü<Üì1@  • ¼ ½ììô<ì2Ì20#5!#!#!3·ËþëËþëËàË`þòdú `duþ‹7þUÏ3@  Ü<Üìü<Üì1@  ‡ ¼ ½ìÌô<ì2Ì20#5####!3­å¹å­’¹_ÿpú†zppþpÿòÍg3#"54654'&#"563277632327#"'$47(`È7"7$>Ž9[@[½`È7"7þÜ>Ž9[@[þã™þ÷|"Oš Šz:6hlà0%þÁ[Ml |"Ošþ÷Šz:6hlà0%?[MºþV¤{$:@&E QF%üììô² ]ììÄ1@¹¹¸%"¹ Œ½%ìôìôìì04767632#"'&')! $'&  7ºZ6ž;¶Ì€€Ìx[Y: ôþþ+STþÜTSST$T%Уb^#¢¢ýð¢¢10dþXªÚ4–tsstþjtssÿÿqÿãç{FÿÿÿÛþVyMÿÿsÿãÙðaqÿãØ{!&'&#"!!32?# '&76!2Ø%%cj·f_¥ý[_f·€MJOhkþôœœ en('® c\©©\c§œœ(œœ Äÿã+{!56763 !"/532767!5!&'&#"Ä'(ne œœþôkhOJM€·f_ý[¥_f·jc%®£ œœýØœœ§c\©©\c ÿÿÉÕ ÿÿºþV¤Àÿÿsÿã'ð&ÉÕ ”@  >  üìüì91@ B ¯ /<Äì290KSX@  ííííY²p]@ 6II YY @  &)5:EJ ]]! !###É-}-ÅþËþÄÕþ!ßú+þçúáþV³` O@ F  ÜìÜìì1@ B  ¼ ½/ìÄì290KSX@   ííííY!!###þ¹þì™þë¹`þ{…û ²þ` ú¤UþV¤{'4767632#"'&'!!#5#5'&  7ºZ=—;¶Ì€€Ì{XY:åþ¹eSTþÜTSST$TµçŒfZ#¢¢ýð¢¢10dþȪppªô–tsstþjtssÿÿsÿã'ðHÿÿsÿã'ð&y3ÿÿsÿã'ð'yä‘ÿÿÉ‹k&©îuÿÿÉ‹N&©u…±’—B°“°˜B±€B±B|°°#I°°#Ia°€bh°Fa°F`°’C°`#B°’C°`C°UX°°’C°`C8°°5Y±€B±B°°°°#Ih;°°5°°#I°@PX°°@8°°5°5Yÿúþf¬Õ4@  ÔÌü<ÌÜüÌ1@•°••/ôì2Ôìôì0%+532654&#!#!5!!!2¬ÌäL>†o||þˆËþR‹ýÞhþòôª–Â"Ÿžý9+ªªþFéîÿÿÉjk&§®usÿã'ðN@  Üì2Ô<ÌÌ1@•­ ¡ ®• ‘¡®•Œôìôìôìôìôì±I±IPX³@8Y0! ! &! !!! 'Ôþõþ±þz†OÐÓÿþøîüâîFÓŸhgŸŽÕ½þãïªïþäÿÿ‡ÿã¢ð6ÿÿÉ“Õ,ÿÿXN‘ÿÿÿ–þf“Õ-T/Õ3@   ÔÔìÔ<ìÜì1@• ­• •/<ì2ôìüì0!565!32#!% 4&+pþÈþ‘Ù•xêûþðûþLª@£à+¸ýÊýû8ª/¦XþýšÚÝÞÚ¦‹‡ýÝÉÌÕ5@ üì2Ü<ì2Üì1@ • ­ •/<ìä2ü<ì20!!#3!332#4&+326 ý†ÊÊzÊêûþðû6£à࡟Çý9ÕýœdýšÚÞÝÚ·‹‡ý݇ÿú¬Õ,@   ÔÌü<ÌÜì1@ •  • /<ôì2Ôì02#4&#!#!5!!ºÞÉ||þˆËþR‹ýîqéîþfŠŸžý9+ªªþFÿÿɆk&®îuÿÿÉ3k&¬åuÿÿ#½m'ru·Éþ¿;Õ )@  •  üìÔüÔìì1· • /<ä2ìÌ0)3!3!#­þÊÞÊþªÕúÕ+ú+þ¿ÿÿhÕ$ÉìÕ.@  . üì2ôìÄÌ1@ •• ­•/ìôìôì04&#!!26!!2)£þ¼D£lýNûþùþüýè·‹‡ý݇¨¦þ@ÚÞÝÚÕÿÿÉìÕ%ÉjÕ@ •üüÌÄ1/ôì03!!É¡ý)ÕªúÕeþ¿ÛÕ4@• •ÜìÔìÔÌü<ì1@ • •/ì22Ì2ôì0%!!67!3#!#Ó”þpþ±†&axªªûÞªªÔþ þµD+?x4&úÕþAþ¿ëÿÿÉ‹Õ((vÕ˜@   Ü<ì2ÔÄ991@B  ¯ /<<ì2290KSX@    <<ííííY@ I:I:I:I:I:I:@  <<<<33 # # # 3êʪõýßDÓþþþÊþþþÓDýßõªÕýâý³üxþéþêüÿˆMý‡ÿãšð(?@ * %)ü2ÔìÌÔüÌ1@• ¡®• %¡&®"•‘ Œ)äôìôììôìÔì02#"$'532654&+532654&#"5>Iö8Žƒ‘£þîzþä,™©|¼Ð¹ÃÌÔ³ž£Æ†\ÍqìðѲ|«!ÄæéBÐY+•„•¦wps{MÅ("É3Õ y@ B ¯ 6 üìüì991/<ì2990KSXííY"² ]@068HGif€  FI WX ei y …Š •š Ÿ ]]#!33ÄýjþðÄ–Õú+áûÕûáÿÿÉ3m&¬õu#´ +° KT° KT[°KT[X»@ ÿÀ88Y1É†Õ Y@   üì2ÔÄ991@ B ¯ /<ì290KSX@    <<ííííY3! # #ÉÊÒý¿_ÜýúþïÊÕýâý²üyþéþT:Õ%@   ÔÔìÔìì1@ •• /<ìôì035675!#!TÙ>WxÊþfbª/¤Xþú++¸ýÊþøýÿÿÉÕ0ÿÿÉ;Õ+ÿÿsÿãÙð2É;Õ@• üìÔìì1/<ôì0#!#;Êý"ÊÕú++úÕÕÿÿÉÕ3ÿÿsÿã'ð&ÿÿÿúéÕ7#½Õ>´ ÔÄÔÄ1¶B •/ìì20KSX@   ììììY%+53276?3 3 OûM?w.-þ!ÙsuÙµ2&]ª*jkü”lyjÕ =@!   üìÔ<<ü<<Ôìì1@ ••/Ü<ì2ôÜ<ì203>54&'$%53# ÙææÙËÙääÙËþÃþ©W=Ë=Uþ«þÃË¢ÌÅÅËËÅÅÌü+  -‹‹þÕþõþ÷þÕ²ÿÿ=;Õ;Éþ¿åÕ )@ • üìÔì<üÌ1@ •/ì2Ìô<0)3!33#;ûŽÊÞʪªÕúÕ+úÕþ¯³Õ$@  ÜìÔì2ì1·• ­ /ä2ôì0!!"&533!3èþ_ºÞÉ||xËdéîšþvŸžÇú+ÉÅÕ *@    üìÔüÔìì1@ •/ì2ô<<0%!3!3!3¬OÊùÊOʪ+ú+ÕúÕ+Éþ¿oÕ2@ •  üìÔüÔì<üÌ1@   •/ì22Ìô<<0)3!3!33#ÅùÊOÊOʪªÕúÕ+úÕ+úÕþ<Õ *@••­•  ÌÜì2ÔìÌ1/ìôìôì0!!5!!2#4'&#!!276õþGƒNûþðû6ON£þ¼D¡PO+ªýšÚÞÝÚ·‹DCýÝDCÿÿÉFÕ&À,³ÉìÕ $@• ­ •  üì2ÔìÌ1/ìäôì04'&#!!2763!2#!ON£þ¼D£NOü²ÊNûþðûýè·‹DCýÝDC¨ýšÚÞÝÚoÿã#ðN@ Ü<ÌÔì2Ì1@•­ ¡® •‘¡®•Œôìôìôìôìôì± I±IPX³@8Y0! 7!5!&! 56! ! 'oÓîüâîþøÿÓÐO†þzþ±þõÔF½ïªï½ÕŽþaþ™þ˜þaÓÿã0ð&8@•‘'•Œ'!•&­$#(  !%$'üì2Ô<ìÔìÌ1/äôìôìôì0"3276'&76! ! '&!#3~Ü‚‚ÜÜ€€üs´´;:¼¼¼¼þÆþÅ´´þÐÊÊL¤¤þåþ椤¤¤¤¤ýóÍÌÒÓþžþŸÒÓÍÍýkÕýjˆÆÕ@@  ÔÄìÔì2ì1@ B• •­ /<ôìôì0KSX·  ììY3!!" &$54$)#!›•’:þÆ’•þí˜dÿÊþòþv'ƒ‡…ûV©×Îàú+wý‰ÿÿ{ÿã-{Dpÿã7):@+E'Q! E*üì2ôììÔÄ1@©—*$¹¹ ¸Œ*äô99ìîôì02#"'&5476$%676"32654&}ðþîðñþö:[;z631-ú~LǂӔ¬«•“¬¬{þÈþìþíþÇ0åw) v¹ ’ ,u™8wœçÉÉçèÈÇéº>` /@ " F!üì2ÔìÌÔì1@ © ©¼© /ìôìÔì0!2654&#32654&#%!2#!r~„„~þúòh„„hþV¶ÅÔljŒçÖþ9þ_ZZ^ÉþÊSJJO“…gy˜r–¤ºÐ`¶FüüÜÌ1´©¼/ôì03!!ºý£`“ü3kþå`4@ © ©ÜìÔìÔÄü<ì1@ © ¼©/ì22Ì2ôì0%!!6765!3#!#»þ}vþØ[(bõ““üt““:ŒþdÜ6(UÓ©Ôü3þRþå®ÿÿqÿã{HFï`˜@   Ü<ì2ÔÄ991@B  ¼ /<<ì2290KSX@    <<ííííY@ I:I:I:I:I:I:@  <<<<33 ##'# 3?·éÖþnÌÅþ‡»·»þ‡ÅÌþnÖé`ýòþQýO6Éþ“mÉýʱ¯ýò…ÿãÈ|(N@ &* )ÜÄÄÔìÌÔì1@ †ˆ¹#¸)©) † ˆ ¹Œ)ôü° KQXüôYìÔìôü° KQXüôYì0#"&'532654&+532654&#"5>32Â|ŠþþîP©ZGª]—©–‰”›t‡‹wG¡abªLÄãx\’l­¶«%%pZXk˜YF@\§]ºy` ?@B ¼ F F üìÔì99ì1/<ä2990KSX@  ììY##3y·ýäì·`û ƒü}`üÿÿºy&ÌššÿÌ#´ +°KT°KT[°KT[X»@ ÿÀ88Y1º‘` Y@  F üì2ÔÄ991@ B ¼ /<ì290KSX@    <<ííííY33 ##º·âþTãÎþsÅ·`ýòþOýQ5Èþ“Ls`$@ F  ÔÔìÔìì1· ©¼© /<ìôì0356765!#!L¶8Dõ¸þ{X^™~±Å·û ÍoþPÂϺO` M@B ¼  F F üìÜìì1/<Äì290KSX@   ííííY! !###º >? ¹þ˸þʹ`ýîû °ý'ÙüPº` '@ ©¼ F F üì2Üì2ì1/<ä2Üì03!3#!#º¹U¹¹ý«¹`þ7Éû ýüÿÿqÿãu{Rº`@©¼ FFüìÔìì1/<ôì0#!#¹ý«¹`û Íü3`ÿÿºþV¤{Sÿÿqÿãç{F<m`¶ ÜÔüÜÌ1µ©¼/ôì20!!#!<1þBµþB`“ü3Íÿÿ=þV`\pþVgÕ (3B@5E)! '.E4üìÔ<<ü<<Ôìì1@,¹¸—41¹$Œ ½4ìô<ì2äô<ì20327&#"#"323>32#"&'4&#"326/‘{brrb{‘à9ƒS§éé§Sƒ9¹9ƒS§éé§Sƒ9à‘{brrb{‘/ëǨ¨Çû<9^N5=L^ýü^LþÃþíþíþËN^ýÇÙëǨýì¨Çÿÿ;y`[ºþå` (@ ©F üìÔ<ìüÌ1·¼ ©/ì2Ìô<0)3!33#ü9¹U¹““`ü3Íü3þR–`;@© ¼FÜìÔì2ì1/ä2Ôì°°#I° °#IRX± ¸ÿÀ°8Y0!!"'&533!3Hþ©™f\¸45h)¸×_V¸þõu;;öû º˜` )@ F  F üìÔüÔìì1· ¼©/ì2ô<<0%!3!3!3Ú¹ú"¹Ù¹“Íû `ü3ͺþå+`2@ ©  FüìÔüÔ<ìüÌ1@  ¼ ©/ì22Ìô<<0)3!3!33#˜ú"¹Ù¹Ú¹““`ü3Íü3Íü3þR>.` ,@ E  ÄÜì2Ôìì1@ © ¼© ©/ìÔìôì02#!!5!!!2654&qÖççÖþ8þ•$þù~ƒƒ—£¨¨¤Í“þ7“þ_ZZ^ÿÿº›{'ó"àº>`%@ E  Füì2Ôìì1·© ¼©/ìäÔì04&#!!263!2#!zƒ~þú~ƒý@¹ÖççÖþ9LZ^þ_nþ7£¨¨¤qÿãç{M@ HÜ<Ìôì21@† ˆ †ˆ¹©» ¹¸Œäôìôîþôîõî± I±IPX³@8Y073267!5!.#"563 !"'qž“ÒýÈ2 ŸÇš¡¦-þÛþÿ½“ÕV«Ú“ißV¬FþÃþñþòþÂHÁÿãL{ :@ E  Füì2Ô<ìÔìì1@¹¸¹Œ©¼/äÔìôìôì0"32654&632#"'##3J”¬«•“¬¬ýqùððþîðñþù и¸ßçÉÉçèÈÇéþ¾þÈþìþíþÇ.øý÷`þAt"`<@  ÔÄìÔì21@ B©¼ © /<Ôìôì0KSX·  ììY;#" .5463!##z€wøøw€þúVtš×Ù¶¹åþ¶S^a\ü뉢¡û Ùþ'ÿÿqÿãk&ÉCZÿÿqÿã&Éj–…±’—B°“°˜B±€B±B|°°#I°#°#Ia°€bh°#Fa°F`°’C°`#B°’C°`C°UX°°’C°`C8°°5Y±€B±B°°#°°#Ih;°#°5°°##I°@PX°#°@8°#°5°5Y/þV?@N F ü<Ìì22ÌôüÌ1@©©‡ —/ìÔÄìÜ<ì2Ôì0#533!!>325654&#"#ß°°¹ýãB²v¶Øþ©×zõ||š§¹Ñ´þLþmedéþêâþY)Œ.ÒПĞþûÿÿºØm&Çv†qÿãç{N@ HEüä2ü2Ì1@†ˆ†ˆ¹ © »¹¸Œäôìôîþôîõî± I± IPX³ @8Y02&#"!!327# ¤¦¡šÇŸ 2ýÈÒ“ž“½þÿþÛ-{F¬Vßi“Ú«VªH>=ÿÿoÿãÇ{VÿÿÁyLÿÿÿôF±ÿÿÿÛþVyML¿`6@!E  ÔÔìÔ<ìÔìì1@© ©©¼©/<ìôììÔì0356765!32#!!%2654&+L¶8DØ«ÖèçÖþ›þšX^x~„„~£™~±Å·þ7£¨¨¤ÍoþPÂÏv_ZZ^þº·`8@E   Füì2Ü<ì2Ôì1@ ©  ©¼ /<ä2Ü<ì2ì032#!!#3!2654&+N«ÖèçÖþ›ýÞ¹¹"\~„„~£`þ7£¨¨¤ýü`þ7Éü3_ZZ^þ/‰:@N Fü<Ìì22ôìÌ1@©‡ —/<ìÔÄìÜ<ì20#533!!>32#4&#"#ß°°¹ýãB³u½Ê¸||˜©¹Ñ´þLþmedêíþÐ*ŸžÁ¡þûÿÿº‘m&Îvoÿÿºyk&ÌC]ÿÿ=þV&ך^̺þå` )@ F © F üìÔüÔìì1· ©¼ /<ä2ìÌ0)3!3!#Tþf¹U¹þf“`ü3Íû þåsÿãÕ48@$%6 )  5üÜììÔüÔììÜì1@ $•-/<ì2ô<Ì0"'&46733276=332764''3#"'&':Óy{d;]ùT‡CHI}rHGÇFFt†AGC‡Tú_8d{{Ñ’ed''de±´˜ÉŸFþ¿Ÿ·þÍkmihÆññÆhimw'·ŸAF‚œþç¾þf²±^^­­^^ÿÿ‡ÿã'`]±Õ:@  Ü<Ìü<<ÌÔìÌ1@ •  •­• /ìôìôÔ<ì20!2#!!5!53!4'&#!!276XNûþðûýèþpÊqON£þ¼D£NOQâÚÞÝÚQ¤àà¤ýf‹DCýÝDCç:@E  Ü<Ìü<<ÌÔìì1@ ©  © —©/ìäÔìÔ<ì20$4&#!!2!5!3!!!2##ƒ~þú~ýÃþ»E¹©þWÖççÖò´^þ“Í“´þL“þÊ£þ°¤Óÿãð+#3376!2&'&# !!!2767# '&ÊÊÒÃS†vwhfst‚ÿˆg²ýF‰ÿ‚tsfjwv„þ­Ãº Çý9Õýœ§Ð$#GÕ_//œwƪþó”//_ÓH$$ÏÆOÁÿã{#2&#"!!327# '&'##33676>¦¡šæ\" Ìþ, žUxž“¼þó”{ “¸¸˜z—{F¬V´AWô^3VªH­äýü`þ3Ê€žøÕ !#!#!#3 øáþêþéÊþçþêáå±þÜþÜýåýåÕüó7ýÉ3` !#####3 Ãìã¸åìÎÑóó•þk•þk`ý¹¡þ_É Õ!#!#!#!#3!3  áþêþéÊþçþêáoýøÊÊ_<å±þÜþÜýåýåÇý9Õýœdüó7ýÉÁÐ`!#####!#3!3 ÐÃìã¸åìÃþk¸¸éÑóó•þk•þkçþ`þéý¹¡þ_sÙÕ‚@   Üì9ÌÜ´O]9ìÌܶ@@]9ì991@B • /<<ô9ìÔ<ì20KSX@  ííííY²@]##767!#'&'!‹Ê“d‚Õ½xªþQþP¤t¼Õ€`ø>ýƒYý§Y~¤þåbÒ†1êý2‚Òþž¡zÊ(k{`~@   Üì9Ìܲ€]9ìÌܲ0]9ì991@B •¼ /<<ô9ìÔ<ì20KSX@ííííY´p]! #4'&'##767Eþ]Ñþ»kK‰ÃV:V¸S8V‰Jlþ»¶þ–ýÌ&VœþìÇtOþ\¢KtÉœU'4ÉÄÕ! !#'&'##767!#3!ïþŸþP¤t¼Õ€`™Ê“d‚Õ½UnýµÊÊ„>ýƒqdý2‚Òþž¡z ý§Y~¤þåbÒ_4ý9Õýœn(Á.`! !#4'&'##767!#3!7þçþ»kK‰ÃV:V¸S8V‰þ’¸¸þ]ÑwéýÌ&VœþìÇtOþ\¢KtÉœþ`þ?þ–sþVszS#"&#"3276&#"#"'&54763!27654'4327654!"567376767632'&#"ss˜ÆDº#`ÜA€t bTDt;ü<}J£5?u_hFA»XùV£RuþÅ¥Þ Ÿs j#B#' "2Z¦brþïRU¾Ïgˆ‚r %§',a’zQ^XRj½7¦&6îJ´- ƒþƒÞ@' WoÊWd§þýE\`[þtÈO#"&#"32632&#"#"'&53!2654'&'"#5223 54'&#"5673767632&#"Èvm¢D¨Pb!',²-cX;b1Ò2i?‰Ä,ZnN .ër‚‚rë. >þ.þ¡˜½½˜_- > ^˜¼¼˜þ¢ >‘¤òó¤‘ ‘¤óò¤‘ ¡ªÒtÓª ªÓþÆþÇÒ« qÿã¡{&P%327654'&+"&'&'#";67>2# '&5476!36767623 !#"'&'&r-¡HVV?ª- ,4, -£GVUH£- ,4 É.þÿx‰‰t. 4 .w‰‰tþû. 4 ¤`t·§ƒa  _t¸¼p_   “‰œî颈   ˆœï袉   ÿÿvÿãút&Ò'—0'ÿÿ˜ÿã¡&Ó'üþœ•ÿÃÿÿsÿã3'àcSôÿÿ‡ÿã'à&àõsþV'ð9@  0üìüÔ´/?]ì1@ ¡ ®• ‘•/ìÌôìôì0´]!# '&76!2&'&# 3!#ú®þ¥»ÃÃÃS†vwhfst‚ÿˆˆˆ˜ðkÉÆÐShÏÐ$#GÕ_//œþØþÓ‚”ý°qþVç{9@  HEüìôÔì1@ † ˆ¹¸©/ìÌôüõî0@ € ]! '&576!2&'&#";#˜þû•—–UQQLNONP³cccc³õÉ–Ÿú#¬+qr͹rqýê;ÿ¥Ê§'''7'77'77ÊdØiØdØ}®}ØdØiØdØi®i®}µ}®}ØdØ}®}µ}®}µdµûÚÞÿBz/!"'&'&'&547676763!47676762þ¹þ3 8 Í 8 g    ý) M #&#"56763 v¢][“ˆ‹Jw}$)›/K†'*Cý³Âþ¥a"53#7þ¥òñ…†Â ”žý³Âþ¥a#55#53þ¥ò†…ñÍþõgžùÊÙ M !2%$'$'&ùʇ¯rE2 þ_ïþÙfݘL{t†\q Ï÷ÖþF` &3@MZg#.#"#> #.#"#> #.#"#> #.#"#> #.#"#> #.#"#> #.#"#> #.#"#> þÇv aWV` v ž"ž8v aWV` v ž"žù®v aWV` v ž"žfv aWV` v ž"žù®v aWV` v ž"ž·v aWV` v ž"ž÷ v aWV` v ž"ž‰v aWV` v ž"žAKKJLþQKKJLKKJLúKKJLKKJL)KKJLKKJLû˜KKJLøXýÃÂ- #)/'7'7'7%'%53-#%5#53 3#k–yo\©ûw–yo\©–zV\þãúL•yþ©[`¬@þÀøÂ¬þÀ@_Ó¤RÓÓ¤RZ–yþ©\µ–yW\þãþñ•zn[©ûw–yo\¨Ô¤‚RÔÔ¤‚R߬@þÀøÂ¬þÀ@ÿÿÉþVüm&áõuÿÿÁþV8&âš ÿÌ!ìÕ:@  Ü<Ìü<<ÌÔìÌ1@ •  •­• /ìôìôÔ<ì20!2#!#535334'&#!!276“Nûþðûý訨ʨÜON£þ¼D£NOQâÚÞÝÚQ¤àà¤ýf‹DCýÝDC&Ež 9@ E Ü<Ìü<<ÌÔìì1@ ©© ©/ìÄÔìÔ<ì204'&#!!276!2#!#5333>C€þùB>ýøÐyttsÖþ9››¸L^*.þ—.+ßþÊURþ°RRÑ>þÂÉáÕ'+#!2'674&+327'7UŒj’~ÖþÊÈû€â šþþrG×j#u~{Sý¨ÕqrÛ’-,9†’ýÏ/´~ºþV¤{)%'7654'& 32'#"'&'#367632*ŒnŠOSTþÜTSST’F“o•Wl{XY:¹¹:YX{Ì€€ ˜§]¥sÅËtstsþjts®]³.01dý® ªd01¢¢ýð¢Éj@ •üüÜÌ1/ôìÌ03!3!É÷ªý)Õ2þ$úպК· FüüÜÌÌ1µ©¼/ôìÌ03!3!ºƒ“ý¢`:þ3ü3GïÕ )@ • • Ü<Ìü<ÌÌÄ1/ôüÜ<ì20!!5!!!!!Nþù¡ý)#ýÝ”ª—ªþªýl8U` +@  Ü<Ìü<ÌÜÌ1@  © ©¼/ôüÜ<ì20!!5!!!!!?þùý¢ þ`ôªÂþÛªþ ÉþfÌÕ3@  üü<ÜÌÄüÌ1@•°••/ôìÔìôì0#!!!2+5327654&#“Ê¡ý)¡ºqmÌäL>†87||Çý9ÕªþFwrîþÎþòôªKKÂ"ŸžºþV `3@  Füü<ÜÌÄüÌ1@©½©©¼/ôìÔìüì0#!!3 +5327654'&#r¸ý¢úFRRQµÁ¬n!&&1†çþ`ªþÁGQåþòÖ``œ07“ª )(þ¿‘Õ33 3## # # 3êʪõýß׈Å)þþþÊþþþÓDýßõªÕýâý³ý"þAþéþêüÿˆMýFþå`33 3###'# 3?·éÖþnfz¸!þ‡»·»þ‡ÅÌþnÖé`ýòþQýèþL6Éþ“mÉýʱ¯ýòÿÿ‡þušð&z9«ÿÿ…þuÈ|&zÎËÉþ¿´Õ3! 3## #ÉÊÒý¿í ÅEýúþïÊÕýâý²ý#þAþéþºþå³`33 3###º·âþTwޏ8þsÅ·`ýòþOýêþL5Èþ“ɆÕ373! ###ÉÊ­dÁý¿_Üýúd­ÊÕý±TîËý²üyþ%u±þº‘`37533 ##5#º·`eBâþTãÎþse`·`ýòaÝvFþOýQ5þÅÔaþ“!†Õ33#! # ##53Éʨ¨Òý¿_Üýúþïʨ¨ÕàþŽâý²üyþéþe=‘3!!3 ###53º·dþœâþTãÎþsÅ·}}z}ý5þOýQ5Èþ“}2²Õ _@   ÔÜì2ÔÄ991@B   ¯ /<ì29ì0KSX@    <<ííííY!! # #!2Òý¿_ÜýúþïÊþ=Õýâý²üyþéþ+*‚` _@   ÔÜì2ÔÄ991@B   ¼ /<ì29ì0KSX@    <<ííííY!3 ##!*8âþTãÎþsÅ·þ`ýòþOýQ5Èþ“ÆÉþ¿Õ6@ •­•  • 8 üì2üì2<ì1/<Ììä2üì0²P]3!33##!#ÉÊÞÊÉÉÊý"ÊÕýœdúÕþAÇý9Áþå@`1@ ©¼© F ©  Füì2Ü<ìì2ì1/<Ììä2Üì03!33##!#Á¸W¸¸¸¸ý©¸`þ3Íü9þLýüÉÕ -@• •­  8 üì2üì2Ä1/<ä2üìì03!!!#!#ÉÊÞ¡ý)Êý"ÊÕýœdªúÕÇý9Áæ` +@© ©¼   Füì2Üì2Ä1/<ä2Üìì03!!!#!#Á¸Wý¢¸ý©¸`þ3ͪüJýüÉþftÕ8@üìÔ<ìÜÌüÌ1@• ­••/<Üìôìôì0#!#!!2+5327654&#;Êý"Êr¡ºqmÌäL>†87||Çý9+úÕÕýœwrîþÎþòôªKKÂ"ŸžÁþV!`3@!F üìÔ<ìÜÌüÌ1@  ©¼/<ÜÌôìÜÌ0#!#!3 +5327654'&ˆ¸ý©¸ÇúFRRQµÁ¬n!&&1†çþÆü:`þGQåþòÖ``œ07“¤&.sÿã÷ñAY%.54>323267#".'#"$&54>73267>54.#"+9lR2*DaSN}aF-?jQ&h;>e3.x=&QUW+BÃyªþô¼c[¬÷s«p8<{¾R€±?S0 $0>&1H3!(BT®1‰ªÄkBŠƒtW22Tp{:S´²ªJ¨#&4tϨ Ë}§fšÍ|}Þ§bm:†Ž‘E/fcYC(+G[`_&b«Žnqÿãxz?P4>73267.54>3232>7#"&'#".>54.#"qKц]Š[-2`ŠX'V$?/(PtMBpP-\_#D-)*%-8%7‚CFIG‡Ô‘LV"- !(,!(ƒØœX›Fr˜Xb r> %gx‚@]ŸsA9h’Y›ñ^    , T™Ö¸&^dc+KiB&HiC÷ÿÿsþu'ð'z-µÿÿqþuç{'zÕÿúþ¿éÕ ,@ @ @ ÄÜìü<ìüÄ1@ • •/Ììôì20%3##!5!!×ÉÉËýîïýîªþA+ªª<þåm` (@   ÜÜü<ìÜÌ1@ ©¼©/Ììôì20%3##!5!!¯¸¸µþB1þB™þL¶ªªÿÿÿüçÕ<=þV`o@¼  ÔK° TK°T[X¹ @8YK°TX¹ ÿÀ8YÔüI:91Ìä20@BKSXííííY"%#3 3ÅÃþ;Ã^^ÃþD¼Nü”lÿüçÕ!#!5!53 3!ßþøËþùýðÙž›Ùýðsþsªªýšfüòª=þV` !!#5!5!53 þFþúÃþïþ;Ã^^`û²XªººªXNü”l=þ¿;Õ%3## # 3 3ËpÅþ\þYÚþ/ÙsuÙþ ªþA{ý…¸ýÕ+ý3;þåy`%3## # 3 3q¸!þºþºÙ³þrÙ))Ùþk™þL¸þHJþqýßÿúþ¿GÕ5@• @ @ ÔäüäÔì<üÌ1@  • • /ì2Ìô<ì20%!33#!!5!!ÖÞÊÉÉûŽýîïýîª+úÕþA+ªªþåB`3@©  ÜÄüÄÔ<ìüÌ1@  © ¼© /ì2Ìô<ì20%!33#!!5!!xZ¸¸¸ü9þB1þB™Çü9þL¶ªª¯þ¿|Õ.@   ÜìÔ<ì2ì21@ •­ •/Ììä2ôì0%3##!"'&533!3³ÉÉËþ_ºqmÉ||x˪þAÇwrî7þÙŸžd–þå¸`F@ F  ÜìÔ<ì2ì21@ © ¼©/Ììä2Ôì°°#I°°#IRX±¸ÿÀ°8Y0%3##!"'&=33!3¸¸¸þ©™f\¸45h)¸™þL _V¸êÓu;;¾¯³Õ#"'&53;333###‚;ºqmÉ||ÖËËÖÇwrî7þÙŸž9þÇdú+ÇþÏ–`5333###5#"'&=3ù ¯¸¸¯ ™f\¸4+¤Âľû  ÄÄ_V¸êÓu;0¯³Õ$@  üì2ÔìÌ1·• ­/<ôôì0!2#4&#!#z¡ºÞÉ||þˆËÕýœéîþfŠŸžý9ÕÿÿºdKÿãð"*I@#$ $3 +Ü2ÜììôìÄ91@¡® •$­ •(•‘Œ+äôììô<ì2Ìôì076! !!267# '&'&=3%!&'& ²"–¼:Cµ»ûp‹üpoƒ„’þ¢Å¼ ªvzªKB@­b‚þH€am §ÒÒÛþ„þôþÎ`_×F$$ÍÂUgkßL> A9¿|¤¤|ÿãf{%.i@.&&K /Ü2ìÜ@ p0°0Ï0]ìôìÄ91@&†ˆ &©¹"»*¹¸"Œ/äôìä²o]2ìü<Ìô²/]ì90"'&=33676!2!32767# '&&'&#"XY`œ09Jt’ÿ⃄ü² fg·jdcbhcneþóœ”NRSˆš]\RZ¬F1—!&Å‚¡‘’úZ¾dc4®,œ”—ZZWWžþ‡ð-!&'& 76! !!267#$'&'&=3‹­b‚þH€añ"–¼:Cµ»ûp‹üpoƒmw²þý ¼ ªvzªKBm¿|¤¤|¿ §ÒÒÛþ„þôþÎ`_×F$þ£c ¦ÃTgkßL> A9þ·f{1&'&#""'&=33676!2!32767#&'&®RSˆš]\ÆY`œ09Jt’ÿ⃄ü² fg·jdcbhcOJ¦Â{””—ZZWWžRZ¬F1—!&Å‚¡‘’úZ¾dc4®,þÒ3{”ÿÿÉ“Õ,ÿÿ(vm'[uªÿÿFïH'š¨ÊÉþf5Õ32+5327654&#!#3!©‹ºqmÌäL>†87||þˆÊÊžqwrîþÎþòôªKKÂ"Ÿžý9Õý‰w¿þVˆ`3 +5327654'&#!#33^HRRQµÁ¬n!&&,‹þü¹¹%ëwGQåþòÖ``œ07“¦$)þ`þã6þVÕ!#!567!3#:Êþ„bþ‘ÔCuxÉþ’†+Ôþþªý8§.¨%5úÕªþV.þV+`%3##!56765!s¸þÞ{å¸þ{v^þ̳;bõ™™þVªdžþ’þüϙϧÔÉþf;Õ1@ 8üì2üìü<Ì1@ •­ /ä2üìÜÌ0%!#3!3+53276qý"ÊÊÞÊÎãL>†87h_ý9Õýœdú“þòôªKKÁþVˆ`/@ F Füì2Üìü<Ì1@ © ¼/ô<ÜìÜÌ0!#3!3+53276Ðý©¸¸W¸RQµÁ¬n!&ýü`þ3ÍûŒÖ``œ07ÉþVÕ!#!#3!33#;Êý"ÊÊÞÊÉþ’†Çý9ÕýœdúÕªþVÁþV@`!#!#3!33#ˆ¸ý©¸¸W¸¸þÞ{ýü`þ3Íü9™þV¯þ¿³Õ/@ ÜìÔìü22ì1@ • ­•/Ììä2ôì0%!"'&533!3##èþ_ºqmÉ||xËËɪwrî7þÙŸždú+þ¿ë–þå`G@ FÜìÔìü22ì1@ © ¼©/Ììä2Ôì°°#I° °#IRX± ¸ÿÀ°8Y0%!"'&=33!3##Hþ©™f\¸45h)¸¸¸™p_V¸êÓu;;¾û þå´ÉþVèÕ%3####! !Éþ’†+ÅþËþÄ-}-ªªþVªüúáÕüøÁþV`%3####! !H¸þÞ{å²þ˸þʲ>?™™þVª°ý'ÙüP`ýîÿÿÁyOÿÿh’'šÎJ¤´+1@oo]0ÿÿ{ÿã-&šO×Ä´"+1ÿÿhN&¤¼u´  +@ 0?  ]1ÿÿ{ÿã-&ÄjR ´-( +@(o(P-_(@-O(0-?(-( ]1ÿÿHÕˆÿÿ{ÿão{¨ÿÿÉ‹m'¡u©@@]1ÿÿqÿãH'š–É@p]1ÿÿuÿãÙðQÿÿqÿã{ÿÿuÿãÙN' ulÿÿqÿã&jTmÿÿ(vN'QuªÿÿFï'jžÊÿÿ‡ÿãšN'‡u«ÿÿ…ÿãÈ&j:Ëÿÿ ÿÁøÕyÿÿXþL/`TÿÿÉ31'qõ;¬ÿÿºyõ'q’ÿÿÌÿÿÉ3N'õu¬ÿÿºy'j’ÌÿÿsÿãÙN&²'u´ +@ @O]1ÿÿqÿãu&Òjs´ +@ @O0?]1ÿÿsÿãÙðaÿÿqÿãu{7ÿÿsÿãÙN&|'uÿÿqÿãu&}jsÿÿoÿã#N'guÁÿÿqÿãç&jâáÿÿ#½1'qr;·ÿÿ=þVõ&q^ÿ×ÿÿ#½N'ru·ÿÿ=þV&j^×ÿÿ#½k'ru·ÿÿ=þVf&Ÿ^×ÿÿ¯³N'Ìu»ÿÿ–&j^ÛÉþ¿jÕ #@ •  üü<ìÌÄ1¶•/ÌÌôì03!!3#É¡ý)ÉÉÕªûþAºþåÐ` #@ © F üü<ìÜÌ1¶©¼/ÌÌôì03!!3#ºý¢¸¸`ªüãþLÿÿÉFN&¿·uÿÿº›&ßjGþVïÕ9@  Ü<<Ìü<ÌÌÄÜÌ1@ • •/ôüÜ<ì2ÌÜÌ0!!5!!!!!!+53265Nþù¡ý)#ýÝiGR¿þéiL”ª—ªþªýì”È`nœa­8þVU`;@  Ü<ÄÌü<ÌÜÌÜÌ1@ © ©¼/ôìÜ<ü<ÌÜÌ0!!5!!!!!!+53265?þùý¢ þ`nFRÀþéjKôªÂþÛªþŒ”È`nœa­=þf*Õ%+532767 # 3 3*SfäL>‡7( þ^þYÚþ/ÙsuÙþ ¾bzªK5sxý…¸ýÕ+ý3;þVd` +527>5 # 3 dþkkCQÄÁÄO5þ½þºÙ³þrÙ))`ýßþ&9Íasœ m˜´þHJþq=;Õ3 3!!# #!5!ÙsuÙþNtþÎÙþ\þYÚÔþŒ–ÕýÕ+ýwýD{ý…¼;y` 3 3!!# #!5·þ©Ù))Ùþª þà~ÙþºþºÙþß”Ìþqþ4ýü¸þH‘´Õ &@  ÜìÔì2ì1@ •­ • /ìäôì03!!"!"$54$3!fON£Dþ¼£NONýèûþðûN·ŠCD#CD“ú+ÚÝÞÚfqõ` %@ F EüìÔì2ì1·© ¼© /ìäÔì03!!"!"'&763!5>Bþù€C>Àþ9ÖsttyÐLZ+.i.*¶û RRPRUÅ‘ÿãCÕ 09@2&)  1ÜìÔì29Ôìì1@"••­-Œ(¼1ììä2ôìì20!"32765#"'&54$3!3327653#"'&êþ¼£NOO_´KV! 3j^nîˆûNÉ?4pi;?Ênh×Ùf1ÉCDþêP_m}ŸþÝ`61‰ÊÞÚfûì[JJO›ŸýZàxx9qÿãs` 08@2F&) E1üìÔì29Ôìì1@" ©1©-Œ(¼1ìÌä2Ôìì20!"32765#"'&54763!3327653#"'&=þù€C>A@j”\-1C]^ˆ¬fetyи>¸dhÎÓd.*^\:9m4œþöl01a`¦ªRUÅýaŸPOORAþ¸ìsxx%Éÿãð7@@9., ,#8üÔìÌÔüÌìÌ1@•'•2¡®•‘-2Œ8äÌôìôììÔì904'&+5327654'&#"567632327653#"'&'&ª\]¥®¶•OOQR˜S¾rsdeY憆GGƒ‘RQ?4pi;?Ênh×Ùf0!²„JK¦;$&´ hi²|UV!bb€[JJO›ŸýZàxx8Pa«ÿãF|5G@7., ,#6ÜÄÔìÌÔììÌ1@†ˆ¹¸6©6'¹2Œ,6ÌôìÔìôü° KQXüôYì04'&+5327654'&#"5>32327653#"'&NH‰”›tCDFEwGQPabªLÄqr<=ih<>¸dhÎÇpb8f83˜,-F@.. §NO]@AHOHXDEORAþ¸ìsxueÉþV<ð):@  '+%*üÔìÌìÔüÌ1@!•¡®•‘'•(½/ììôìôìÔì90!#4'&+5327654'&#"5676323#sÉ\]¥®¶•OOQR˜S¾rsdeY憆GGƒ‘RQÉɱ…JK¦;$&´ hi²|UV!ba’þùý¬«þVƒ|)?@ !+) *ÜÄÔìÌìÔì1@†ˆ¹¸ © ©½/ììÔìôü° KQXüôYì0%3##4'&+5327654'&#"5>32È»¸¸NH‰”›tCDFEwGQPabªLÄqr<¸dhÎÇpbþ{v^þ̳;b`ýWŠORAþ¸ìsxue{†þ’þüϙϧÔÿÿÉÿã-Õ¸Áÿã`6@F  Füì2Üì2Ôüì1@ ©¼©Œ /Ìôìä2Üì0327653#"'&=!#3!ˆzgh<>¸dhÎÇpbý©¸¸W`ýWŠORAþ¸ìsxue{Ìýü`þ3Ísÿã‰ð0@  üìÜìÄì1@••• ‘ŒäôìÔüÌì0# '&76! &! !2653‰d-‰|—þ›ÄÀ¿Åe'ááþêýÛ%×{ʺà9!ÒÌÐÍҎ׿ýŸý ”¤ðqÿãF{0@ E EüìÔìÄì1@¹¹ ¹¸ŒäôìÔüÌì076!2&#"3253# '&q’– к¾Ä½bZZb½â¸Éåþü•Ž/¡nª||rþ|r|>¾Åì禞ÿúÿãfÕ/@  @@ÔäüäÌÜì1@ ••Œ Ìäôì2ì0327653#"'&5!5!×?4oi;?Ênh×Öinýîï+ü–[JJO›ŸýZàxx}âqªªÿãö`2@  ÔÜüÌÌÜì1@ ©Œ©¼ Ìôì2ôì² ]0327653#"'&5!5!x>=ih<>¸dhÎÇpbþB1¶ý®VFEORAþ¸ìsxue{~ªªÿÿ¤ÿã{ðRÿÿ…ÿãÈ|ITþf:Õ/@ ÔÔìÔììÌ1@ • ½••2ìôìôì0356765!+532765!TÝ:WxÍãM?†77þfbª0£ödþú“þòôªKLÁøýÊþøýLþVs`/@ FÔÔìÔììÌ1@ © ½©¼©2ìôìôì0356765!+532765!L»3Dõ£µF1a.&þ{X^™}¦зûŒÖÀœ0)¡áoþPÂÏT Õ35675! 3 # # !TÙ>WysuÙþ Ùþ\þYÚþ ý¸fbª/¤XþýÕ+ý3üø{ý…¸ýÊþøýL²` # # !56765! þkªÙþºþºÙ³þßþ0X^þ̶8Dõ')`ýßýÁ¸þHJƒoþPÂÏ™~±Å·þtÉèÕ32654&#!##!23 #“þšš•þêþÊÈûhÙþ Ù/ýÏ’‡†’ý³Šý¨ÕãÛ0*ý3üøºþV¨{ ##"&'#3>32&  “þkªÙþË\Ì{±:¹¹:±{ÌT%þ+§þܧ§$`ýßýÁ¡¨t¢adý® ªda¢k—‰ý–ççþj爼Õ3&$54$)!!!!!!3!!"ˆ˜dÿèýÅý;öü>þôþv7•’8þÈ’©×ÎàªþFªýãªwý‰ªþú‡tÿãw{&/!3267# '&'##.5463!632.#"%;#"wü² Í·jÇbcÐkþô˜åþ¶ÆVtš×ÙeVg⸥ˆš¹ýK€wøøw€^Z¾Ç44®*,œ˜Âþ'뉢¡þÝÄ—´®žŠS^a\ÿÿsþøÙð4ÿÿqþVZ{TÿÿD¦Õ:ÿÿV5`ZɆÕ37!#'# #3'j‡—Ýþ£ÈŽ€ž_ÜýúþïÊʯۊ—âþ›È€¡üyþéþÕý¸Üº‘`373#'##35ŒAvâæ“ŽLãÎþsÅ··K)@wé“LýQ5Èþ“`ýòPTþfsÕ%9@' !&ÔÔìÔ<ìÜÄÌì1@••!•½/<Ììôììì035675!!2+5327654&#!#!TÙ>Wx¡ºqmÌäL>†87||þˆÊþfbª/¤XþýœwrîþÎþòôªKKÂ"Ÿžý9+¸ýÊþøýLþV `'9@)"#(ÔÔìÔ<ìÜÄÌì1@©©#©¼½!/<Ììôììì0356765!3 +5327654'&#!#!L¶8DõúFRRQµÁ¬n!&&,‹þü¸þ{X^™~±Å·þGQåþòÕa`œ07“¦$)þÍoþPÂÏÉþftÕ!?@ #8"üì2ü<ì2ÔÌìÌ1@•½•­ /<ä2ü<ì2üì03!3!2+5327654&#!#!#ÉÊÞÊ¡ºqmÌäL>†87||þˆÊý"ÊÕýœdýœwrîþÎþòôªKKÂ"Ÿžý9Çý9ºþV`#@@ % !F$üì2Ü<ì2ÜÄÌì1@©©!©¼½#/Ìì<ä2Üììì03!33 +5327654'&#!#!#º¹U¹úFRRQµÁ¬n!&&,‹þü¹ý«¹`þ7ÉþGQåþòÕa`œ07“¦$)þýüÉþ¿Õ !!#!3#qý"ÊrÉÉ+úÕÕúÕþAºþå9` 3##!#¸¸¹ý«¹`ü9þLÍü3`²ÿÄpÕ#653&'# 33267.'ˆ'U.,ËaOYFqlE¯kþëþÙË*YŒb?f)6^&ã4Z)e¹‹ü\å3'ž4H./)%¤üux«m3-`4²3ò3! #54.#"!!²"$Ë+Z‹`b‹Z*¶üJ¤%)þÙþÙ9 y«m22m«yþç¯þ=]Õò#3##!".4>3 4.#"3ÛúúËþ‘‹Ø”MM”ØŒ"Ë*ZŠ`iV%,[‹_r¯þ=ÃPŽÄèÅQþÖþÜþÎy«m2:dˆž„_5ZËò!4.#"#5! 3#*ZŒa`‹Z+Ë$"úú‹y«m22m«y 9''þ×þÛþίþ=²ÿã3Õ!!32>=3! }¶üJ*Z‹b`‹Z+ËþÜþçþèþÞÕþ‹¯þ™y«m22m«y 9þÙþÙ)%¤²Šó)!!332>54."#54> Š3Tmqn,äûdËV=™—uG0fžÜœc.ËL™å2ëŸRg´™|]= ªL¢+S{¢Çug«yC@p—VGKyÒšXZ¥ç¼íÕ %!!3!!‡ÛüZËfüš¯¯Õþ‹¯²3ò3! #54.#"!²"$Ë+Z‹`b‹Z*¶¤%)þÙþÙ9 y«m22m«yý$¯²ÿã®ò)8"#4> 3##".4>;54.2>5#"Ãð¯q6Ë[«ö6ö«[ÎÎBt¡^_ŸtADuŸ[ê5oþÈ%AXhV>"ê9Z>N2m«yüu¤“Ý”JJ”Ý“4¯þ×k£n9:s¯ê¨l3z­müá¨pBAkP#?]ÿãÕÕ##".4>3!33#!"3265ÛIÕ‹ŒØ”MM”Ø‹oËúúýÅ_‹[,%ViÀ®W’é¢W]ÑèО\uþ‹¯Bnž”sE÷òA¼3Õ3>32#54."#¼Ë?¼vŠÔ’KË+Z‹À‹[+ËÕþ MIH“Ý–K2y«m22l¬yýó¼DÕ!!‡½üxÕúÚ¯Õ¼ÿãËÕ2>53".5!#3Ê6Tf`bQ3ËH€°Ò³„KþˆËË`ý1Kf>>fKÏýIw«o55o«wüOÕþ‹ÿæð+>33>32.#"#".5467#32>54.$+ ËNB™£¨R=3)ËE¶vŠÔ’KË+Z‹À‹[+Ëã?CH“Ý–&ýóy«m22l«z˜FÿÊÕ%.>76$73ü>g? ;‹w›8¤ÏîqËÁ»`g_ 8/˜Î@9L`uŠPh¦G/þ‰+Xam@E\>&¨ÿЀó5C4>32>54."#54> .'#".%"3267.·;e„Hxív(A//dŸàb,ËNšå,ë T"?W68m8ˆ6o8nù~G„f=l!?1XXV°Q^¯ IrN(`P2s|†Fg®}F@p—VGKyÒšXX£çV¥œŽ?-_3Ž4e0Yd$KqÜ$3 AOH@BPdÕò%3!4.#"#5! Ûúþ;+ZŒab‹Y)Ë !¯¯‹y«m24m«w 9''þÖþÜi¹â$"!".>7>73>33!&-p|…CtûÄBnK#QMC¡Yþäó¼PŸ–ˆ8ü‘PDYMôýêG)#@[9ür¤ El™È~mÉX—þîBkJ(ü~…©`#ûJ¦²ÿã#Õ! 332>5!)þßþæþäþàË*YŒbaŒY*Å&ý þÝþÕ''¤üux«m33m«x‹¯’ÿãYñ7 .5332>54&#!5!2>54& #4>2YM™æþÎå˜LË+`›qp›^*ÊÉý°PQwM%ŸþÊ ËJˆ¿êÀ‰L%@T.DuW2¼g­~GJ‚¯eArW22Vp>€¯'C\5vqr{_•g65f“];hS<?[vÿãqÕ32>=3! #5Å)ZŒcb‹Y)ËþßþåþæþßúÕüux«m33nªx 9þÜþÖ-!ô° ÿâyÕ..+532%.#"32>=3#".54>7d8ŠUÛj¢Gkþ–@*oº‡KÐÓi›e2ËRœä‘’é£XNнoªþþÔ” H†Àyðø54&#"#54> MÃüûíJ*r»„IÒÐh›f2ËRœã$é£WK‰½éUÎEÔg V”Æqßï32#4.gËV‹b4Ëf¶ø“ÿµcË8fŽGü”l Ip•X*9‚ÙœWWœÙ‚ü\•O•vO¨}ó";".5&>32!!332676&%4.#"32>VxP.Oœå“ ìœML…·lÙûdËNQÃ_(¢Õ0ežokže.+K;y±m'+H5›#9GG@k”X^§åˆyݼ”1ªL¢?=²Ãædª{E9d‡M&7%@rœ[-jx‡²#ò!4.#"#! 3#^*ZŒa`‹Z+Ë$"úú‹y«m22m«yüu¤''þ×þÛþίþ=ÿÿ²ÿã)Õ8dÕÕ)#".=32>533Õþ;AºvŠÔ’KË+Z‹À‹[+ËúóHJH“Ý–±˜y«m22l«z úÚ–ÿãî=332>54.'.'&>2#.#" .–Ë5`‡RPˆd86a‰TCq_F(I‡¿êÃNË'NzVOxO$&KqPˆÕ”NR–ÕþüÒ•PÃDtT0 DiI:U=( -?XsKZšr@=l‘T,TB)'F_72I5% Bi™nf¤s=K‚¯²)ò3! #54.#"²"(Ë,\Œ`bŠX)¤%)þÝþÕ9 y«m22m«yüu ÿãgñ1@ .5332>54&#!53.54>22>54& gM™æþÎå˜LË+`›qp›^*ÊÉý°à 7(Jˆ¿êÀ‰L%@T.DuW2ý›QwM%ŸþÊ D|¼g­~GJ‚¯eArW22Vp>€¯2?J)_•g65f“];hS<?[vg'C\5vst{&UJ0¼MÕ!!#‡Æý:ËÕþ‹¯üOÕxÕ'3>4.'.>753#×ÁÑÑÁË]•h88h•]ˇà XX à‡Ë‡à¡ZZ¡à‡ËŽÙþvØ;k˜Ä™l;üT–Õ Ö˜TŸŸT˜ÖþôÕ˜T2nò+".'!!#5#53!22>4."*>n^K˜üh˾¾"‹Ù”MM”Øþ$VÒŽU%&WŽÐŒV×%4þ毚š¯e$ N‹ÂèÁŠMZœ\22[ž…a67aÿÿsÿãÙð2nÿæøÕ)3 $.=3".546;2%"4.#>ødºþùþºþú·bË7>53o:Z=z3^†SB[9z.ZˆÃ$9H(@{b?%9H(G{^;ÿÿÿÿðÞfCÿUè5í)#&>32#".'332>54.'&umG~®f?z`< =[<'OC1†& 0B&J…e;ðy¾‚D"FnL0R>#+G3 %'<*.c“Zñ²3!ZŒÌñ#©z®ÿä`*%#".5332>5332>53#5#"&¢E¿ƒWˆ]1¹:V;GrQ+¹qxFrP+¹¹?°y|¨Ö~t?x°q¤ýNQqH 1\ƒRzýb£›2]‚Qzû ®iazºþVd{5#"!!#3>32¬ø•¬ñý¹¹B²vÂÅÂÜ=¾¤þ' þV ®fcîéâqþV/{(2>54."##".>32533#/+Qt’uQ+,Qt’tQ¸:°}f¨yCCy¨f}°:¸ÕՔʡp<323e¹ø•¬¹¹B²vÂÆÕþVH=¾¤ý‡`®fcîéýü ®ÿãb3!!3276=3#5#"'&®¸üý>=}˜TV¸¸C°vÁddºZþL þŸPO_b¡ëý0¬gbxwqþV/{-3!#".>325332>54.#"ZÕþs:°}f¨yCCy¨f}°:¸üÕ!IxW<]F0 !KwW<]E0 þö RdaU›ÙÙ›UadªýÏNœ{M%AUaf0N›|M&@V`fºì )3!!!—ý#¸zý†%þL üàºþVd{!#"!!3>32¬ø•¬ñüV¹B²vÂÅž=¾¤ü}  ®fcîéý\ºþVè{,<!4.#"#3>323##".4>!"32>f1Hv—ORŒg;¹¹*cmv=Dˆ~mQ.’–`”FH`87ZsfþÖ2(+@)QQD/d¡p=)ZŽeûë ª5".54>3!33¢þÆItQ++QtIQvM&¸Bºò»B@»{<¸ÕÀ5f•ae¡p<32d¸ø•¬¹¹B²vÂŤý\ž=¾¤ûݾýžfcîºþVl`3!3rúþN¸þö  ºþV*32>53#5#".5#"#3>32HqxFrP+¹¹?°y=kD÷KnH$¹¹AWh;ÃĤ⣛2]‚Qzû ®ia)e©=2\ƒQûݾýž'I7"ìqÿãt-3!#".54>732>54.'#"ÂÔ¤B7}C=DƒÀöÀ‚D>oš[á(QwPOxP(+G4‡NxQ)  âÒ NׄzΗUU—ÎzxÆ”^ýÀS•oAAo•SMwcV,Euš®þVX3327653##"&®¸ø•VW¸¸C°vÂǺZû­þÂ_^¥{ùöVgbïÿÿºdKjÿâ0-B#5#".7>7.54?37>32>=4.'<4©³¸H\pCbœj7>mš^D];"$Ç*.GW(9þ !CeDMxR+EpQ=lR0,± dþå¹ýÿ¬-J6Bxªi`·­£K 4GS)D59?;-?""ü EsS-7]{DV5wuh&2u‡šºþV9{!#"#3>329þsø•¬¹¹B²vÂÅþö H=¾¤ý‡`®fcîéüRŒÿãZ$(>53>32&#"32#5#".'&732>=4.+ŒÄ7§Ák-42Grb*wÑœZ¸F\tEf—f568V-Ia8FsS.*bŸuG* ¶ª`¥zE½*Kh=LŠÂwý¯®,J6Ar›Zƒ‹ýýXuF3[|Ih@†mEA‡„~®ÿã-332>5!##5#"&®¸øKwS-Õ¸C°vÃÆº¦ýaþÂ2\ƒQ/ úŒ¬gbîÿÔþVr` 3+53265º¸£µF1iL`ûŒÖÀœa™ÿÙÿãX!32>53#5#"&5#'øKwS-¸¸C°vÃÆÕû­þÂ2\ƒQ{û ¬gbîéºþV{{13!!".54>54.#"5>32Á Pýt*D07.54>737>7üúýÖ$F7!#0D(·YËȸE  ®þV`*%#".5332>5332>53##"&¢E¿ƒWˆ]1¹:V;GrQ+¹qxFrP+¹¹?°y|¨Ö~t?x°q¤ýNQqH 1\ƒRzýb£›2]‚QzùöXiaznþVô|,D3!!".5467>'.54>32%">54.ô32!!5>54.ÁO|V-¹¹?½yc¢t?!=V5)ýý?`B"#GlÛ4ZzFýs`¬afF}®gS‹{q9 „4myŠPIa8ÿÿ®ÿãX{X®þV-332>533!#"&®¸øKwS-¸ÕþsC°vÃÆº¦ýaþÂ2\ƒQ/øâ Vgbî®ÿã{'3>32##"#5#"&5332>¸!OW[,Ãĸø32d¸øKwS,¹¹B²vÃĤý\ž=2\ƒQûÝ ®gbìÿÿoþVX{Jþº˜`%!!3r&ý"¸  `®þV'3>32##"##"&5332>¸!OW[,Ãĸø9jQ1¸C±dÃÆ¸ø?oS0å/ýž3K2ìëý\ž=/Z„UûÝVgbîé¦ýaþÂ/[„)þV¤{,%!!#5#533>32#"&4."2>sü빑‘¹:°|f¨zCCz¨f|°8+Qt’tQ++Qt’uP+¨þ¨›__›ªdaV›ØþúØ›Vaëd¡p=;2%"4.#2>!g´ó‹¸W¤‘xV0´Pƒ©Zbœo;;oœb¸Žó²ý}t{ E}°jj°}ÇþøÖ—RþVª'Ig€•S]VW˜rB+OnCHpM'þLF‰Ï&OHBMý€À_/üæ9k®ÿã~%!!5#"&5332>73X&ý"C°vÃÆ¸øIuT.¸  ¬gbîéZû­þÂ/X}MŒðÃR73#3#ðÓÓÓÓþþRþd²ƒ%$'d ˆþõˆƒZZ¤-,DþCÚÿÓ´ Ü<Ì21¶ÜÜÜI:03#3#D––––-–d–ÿÿ«þC‚ÿÓ'¨þä°KRX»@8<1YÿþC¢ÿÓ %¶  Ü<Ü<ÜÌ1@  Ü<Ü<ÜI:05!73#3#ÿ}––––Ö–––d–ÿþC¢ÿÓ.@ Ü<Ü<ÜÜÜÌ1@   Ü<Ü<<ÌÜI:03#3#'#5#5! ––––ú–}-–d–úÈÈ––Dþ»ÚÿQµÜÌ1ÜÌ03#D––¯–ÿÿÇþ»WÿQ&}ƒ²ISX¹@8Y1ÇþCWÿÓ O@   ÔÌÜÌÜI:1²ISXA @ÿÀ88Y@    Ü<Ü<ÜI:03#3#73#D––}––ú––þÙ––––cþ»»ÿQµÜÌ1ÜÌ0!!cXý¨¯–cþu»ÿ¡´ ÜÜÜÌ1´ÜÜ<Ì0#5#5!Ú–áXõ––––––µÔÌ1ÜÌ03#––––ÿÿ––ÿÿ/þ¹ÿÝ'ßÿ`&åöþëŒ=² ISX¹ ÿÀ8Y³ I:1² ISX¹ ÿÀ8Y² ISX¹ÿÀ8Y³ I:0Nåä{µÔÌ1ÜÌ03#N––{–DþCÚÿÓµÜÌ1ÜÌ03#D––-þpdÆj!!dýåj¤c»–µÔÌ1ÜÌ0!!cXý¨––Ñÿ8‹(´ÔìÌ1²ÌÌ0´@P]3#Ѻº(ú¯–µÔÌ1ÜÌ03#––––Å[–µÔÌ1ÜÌ03#Å––––Ñ‹`#¶ Ô2ì2Ì1´¼/ÌôÌ0´@ P ]3#3#Ѻººº`Êý4ÊfÜ` ¶  ÔìÔÌÌ1¶©¼ © /ìôì06;#"!!fÍã’”†n¼ýŠ^ô–ÂþcþC»ÿÓ´ ÜÜÜÌ1´ÜÜ<Ì0#5#5!Ú–áXÃúú––ºŸ`'o·)F·  F(üìÔüÜ·o_²?]ìÔK°SX¹ÿÀ8Yüü·J:)z²D]K° QX¹)ÿÀ8Y1´¼ //üÄ·::U[ ¶ejy ]0 ##54>73>53€Ùþ`#8!¸2-A,þäÙ #8"¸2.@,›þeX5AnEþô¹QŠ`Q2, ›ý¨ 6AnE ¹R‰aQ1,XH`6·ÜÔÜüÜÜ´t o]1K° QX¹ÿÀ8Y·© ¼©©°/ììüì0%4.#!5!23!5è &EyWþ¶J{±tE¦üÏKcf:%.U‹¦rþUXÿö`?·!± ÜÔÔìÜìÌ´t\]K°QK° SZX}°/Y1·©¼ © °//ìüì0#&'#"'532>54.+532EMÇ:!FPP7.3"$,EV8(3e\Z`ÝË^þÀއpQg6© 4[ªu—¡;ôX`(¶ ÜÜüÜÜ1K° QX¹ ÿÀ8Yµ©¼/üüÄ0##!5!ƺýÁ¿Ñü/Ѻ€`<·F ²FüìÔÔüü´p j ]K° QX¹ÿÀ8Y1· © ¼°//ÔÄüü0##4&#!5! ˆ¹±¹ºþ.Ðá¬ýT`&ýÆ`Ø™úºt`!¶FFüüüK° QX¹ÿÀ8Y1²¼/ä0#tº`û `Xm` E¶ ÜÜüÜÜ1K°SK°QZX|°/³jZ´j Z ]1YK° QX¹ÿÀ8Yµ © ¼/üüÄ0#"#467#5mPWAºM8ø`›½ý‡y²'º€` 7·F ±FüüÜüü²p ]K° QX¹ÿÀ8Y1µ© ¼//üì²t]0#4&#!#! €º‚¸þç¹Ðâ^ý¢yÆ’ü/`ð¹ÿã¿k[·! ±F üüÜÜ·tp / ²  ]üÜ1K° QX¹!ÿÀ8Y·©¼ ©°/ìüÄìµl nnµ\ ^^·D D4 4° ]02>54.#"5632 r-Yt tY-0ZCB]rWfT%üýòü`ý´t¢[(([¢tq}=QŸÒþÔþó ,Dˆ¢B`#´ÜüÜ1K° QX¹ÿÀ8Y´¼ä/Ä0Bº`ýŽL¾XþV’`8¶F ÜÜüü´a _ ]K° QX¹ÿÀ8Y1¶ © ¼½ìüì¶_O?]0#4.#!5!2’º2X]þû¨Ö†5îüh˜r›uB=—èXÊ`5¶ÜÔÜüÜ·OO??°]1K° QX¹ÿÀ8Y¶©¼© /ìüì0!2#!5!2>4.#!XXu»xP""Px»uþ¨XdN""Ndþ¨`@k’¬’k@Ž>u‘¼‘u>XðÕ6· ² ÜüÜüÔ²]üÜ1K° QX¹ ÿÀ8Y¶©¼/üÌüÄ0!!3”ýC»ÝþWÑþ‹nüº•`4·F ±FüüÜüü1K° QX¹ÿÀ8Y¶ ©¼ ©/ìôì´o ~ ]0)!2!4&#•ü%ãÀw4üßg‚¹`:½Šsü¾êÆ’Xµp%d·'F ´&ÜìÔ²p]üÜÜüü·J#:#*##·h#Z#Jh´s #]K° QX¹'ÿÀ8Y1·© ¼©°//ìüÔü·Xl\v²]03>3 !5!4&#"#>54XÙBMLbL3’ýÎxza´V0*bºP]` NFd6ýîý¢ŽÐû [Îþ¢I3'@ºþVt`$¶FFüüüK° QX¹ÿÀ8Y1´½¼ää0#tº`ùö Xx` 1·F  ÜÔÜüüK° QX¹ÿÀ8Y1¶©¼ © /ìüì´ ]0%4&+532!5¾dj~~Í»ýàX{o±Ýý.¹ÿã¿` ]·  F°üüܲ]üܶJ < `]1·YTid°]K° QX¹ÿÀ8Y· ©¼©/ìüü·44 && ·BB Rd°]0!  ! 4.¹çÿýúÿçþÒ”-_`úþÔþÐþÙ'0þkþI¿uœX$XÿBH`K·F ±ÜÄüÜüü¶>   ]1K° QX¹ÿÀ8Y·© © ¼±¼ääÔìä´]0´g G ]35%3>ˆÀ1XˆÂ‚þ€$þÔ„FDþäv²¯ˆj/‹©h ü29–ºþVd`^·F ²FüüÔÜüü1K° QX¹ÿÀ8Y·© ©¼±½ìüüÜ·J  / °]K°PK°SZX¹ @8Yü·j\J°]0#4&+327#"&5! dº‘©ýGJ)CRC†›¶ä^ûø СðIE ˜”°dõºŽ`j· ²FüÄüÔÜ´_ ? ]üÜ·== KK °]1K° QX¹ÿÀ8Y·©©¼ ±©/ìüü}ܲ_q¶pPJ]K°PK°SZX¹@8Yü0! )5!2654&+327#"&5ºª(þ×þÿþV^ìÑØä¥HJ)CRC†›`þÜýèþÜŽÀîÛºÞIE ˜”°XþVùcG·³ÜüÔüÄܲ]üÜ·6DT°]1K° QX¹ÿÀ8Yµ¼½ìüIJ7]0>=3#4.'%Ÿf:uh¸=h€Hº9=1Ócä’™.ׄ„oº~Sü†&P«jI9X`l·F  ²ÜÄüܰ KQ°KSZX¹ @8± /YüÄü·<;?H·lY_J¶i|= ]1K° QX¹ÿÀ8Yµ ¼©/ìüÄ·T8Tt°]0%367>53!5ôýdÚƒ,¸.&=$üSŽÒýÉ47Z7 ¹J}XM./þŽGŽºþV_ R°·  ´F üÔüÜüÔ·O_o°]üÌ1K° QX¹ ÿÀ8Y·©¼½°/ìüüÜIJ¯]´@ P q0 !5!ŒºÓ”üWþWþVVLûöªÑŽnüXÊ`@¶F ÜÜüì1°KT°KT[X° /1YK° QX¹ÿÀ8Y´ © ¼/üì0K°PX±//0Y#4.#!5!2ʺ3P~Rþ°O~¿zM:ýÆ:IviF)5]¡XS`(¢·* ¶)ÜÔüüÜ´]üÜ·H;+·P`p°]üÜK° PX»ÿÀÿÀ881±/}/Y· 0WW°]1·fgwv²‡]K° QX¹*ÿÀ8Y·©¼±©/ìüÄÄÜ·¯/Ÿ°]ì¶CC"H%]0!#3>732>73®¼š¹I0K8( ¥)l_§+b—’kcE8" ¹*=Ki«Ë`ýñ!#@5]Ey+þüg«E=þÍ(Ci’Åú¦ü䣉W=ÿøˆ`I· F ³ÜÔüüÜüü1´ÐÐ]K° QX¹ ÿÀ8Y·© ©©²¼/üìüÔü¶j[]0#4.+#"'53265#5!2ˆº $@pPö{˜5NA&G.­]Ál,^ý¢`Jce:%ýÍÖÐr£3CŠ´ÿÿº `'+–+ÿÿˆ¨`'+4/ÿÿˆ¢`'/=/ºä™`@ ´¼DÔì1ôì03#ÒÇþº™`þ„ºän`@´¼DDÔìÜì1ô<ì203#3#§Çþº™½Çþº™`þ„|þ„ÿ×Ü"%0#4'&'37676537653#"'% '##5± rb{ .q & q-aT !ýö}þÁBý®s12jÿî{¢Í@E#$]} q«!<"iúÅbP-üF`ÿ×Ü)*5"2767#"'&54767&'&5&76 '##5¨M@V:118UF%/>7P6.N@?^G?D)7-#ŽFý–}þÁBý®s)^ &# \*$@.") n F>]KH*!#TH#úÅbP-üF`…z %3#%3#3#%3#Æ´´þ>´´ý´´” ý^ úúúúúúúì…< %3#%3#%3#3#%3#ˆ´´þ>´´þ>´´ý´´” ý^ úúúúúúúúúìÛì!#53®Ó¤R¬@þÀüýñ 327654'&+533676Í7N5G4¯pQf$h?FA@6b ! ¨eþ¿I(R[2*Û #53 3#®Ó¤RÓÓÓ%¬@þÀý-þ“°ð$%#5754&'./.54632.#"¼Ë'/XZH߸gÁ^a³Olƒ39ZZ8þþþ“{4<5/VV‰LŸÂ89¼CFnY1^5YV‚eš£UÞ"756767&'&54767632&767£/SD4Ž35gcbnZdF31`È9:H:ZÍçU°!LOTAKv?=¹0ps2#¹pÿÿlþ Ã'}ÿTÿÿ‚þóÀµ'|ÿôþ>qÁy3#Á¸¸ùìÿÿ‚þ¢ë&Ž!9þ¢ÿÿ‹ÿÆ &o"ú„ÿÿ‚ÿìë &Ž"¼Šÿÿ‚ÿìë&Ž#¼Šÿÿþ (f&Z!þ (f$3  !27# '&5767"Ã$ÄþÚ×àJKÁÔ–úþ^©ƒÔ`‰eŸ~h'?6š§®þû‡`¤v¸c–àße4-ÿÿþ (°&Z!?}ÿÚR%67654'&'3#"'532‡¬#þ¢›—¸€Šÿÿÿ«þ b¶&^!q ‚þ î?%#&'$473327676'&/3327653323#"'&'üT…ÁPx€mþíi¸l“_Qb_y^@@¸$;sR,%¸@nޏ\Kf% I0Š1_2F„,³kª>GHö´Îܳ&%0žlŽ}=êœJ"5Œþ^ó.327654'&'&#"&#4763&547632#bzL,5;(.;Dn2KÈxAZ¢M\MO¶bxX²'*9:X DD(ÁNOþì­f7*(”„?$S§-8’APÿÿ“þµH¶&Ó!? ‹ÿÆ Þ"327654'&'2#"'&5476»B!799[]KB{˜Æ¶“¥„`Q§%T*WE{R,,9.UMAx³ |”ÈKU#JïµN¹ÿ«þ @† &"34'&!5 767"'&'&547632î?,3/ÀV%.¬_]Àþ“g†¨>v-–(tYh‰YH‚Ä9!$3/,¸;þôþÌ X*V¸L_” !"b‰Wg3Zf‚þóÀJ6%#"'$47376767654'&'&'&'4762#&'&'&Vfþ©±xHþÛ?¸B¤a=~±T;~BrC:@¾_Ð`¸ B(EN><}ø9M ªI&huqƒc“- !P85J.39s–J%*=­=!'&"7*S@UYDÿÿ‚þ ÀJ&q"ôþ ܺ$š5%5%ÜHý¸Hªn‚nþŽn‚nܺ$ý&567&'&54763233"/#"'&5332767654&#" %!lE?I(7 /4KU^r8Z #08Ÿ " -d$* 9^W4'6O'&n=NVš)qaKî" %Üþ$ÿö5%%5%ÜHý¸Hþn‚nnn‚nܺ$ª5%ÜHºn‚nܹ$ý-&'&5476323"'&'#5276767654&#") lE?I(7$# +EÈ“˜‹V " -º 8_W4'6O -n=*{nmp" %Üþè$ÿØ5%ÜHþèn‚nÈË8ô(#"'&54737676533254'3'&!9EO)"a 2=`YG g -SG„L(E?4mmb}8T"ªRY$6îs9It…6Y !ìá 4&#"32>"&462–X@AWWA@XzŸæŸŸæô?XW@AWX³æ  æŸ˜¹hÁ732767#"'&'˜ gC*6:)kXZZC5"LMD¥6{S )L}@F€ÿÿO¿¦w‘ÕÿÿÿOþ ¦ÿđոÚÜë$/-#"'&547.#526763"327654'&× lE?I(7$# +EÈ“˜‹V " -. 8_W4'6O -n=*{nmp" %óî 4373¶Ã‹‚‚‹ÃîFÃÃþº¸Â”¼3#¸Üܼú¼ !#'3¼´%1œÄyI ©Ü!nþÝþ”›Rð#'337673#"¦ ´%1œÇBR´{6´)cóoajr›þ©Ü!n›˜•UPymþúL%#'37676537653#"'« ´%1œÄ/(/H´/; ´'G›… 44.5WY¾þ9©Ü!nr|> @2¦Þ%,*ÊþÏ;l>3 ¯ÿì§ *"2767#"'&54767&'&'&76#zfˆ\MOY‡p0;JcX~VI|ee•pdkAXH,7âp ¨4C@#90¤L@rRiUZ‡hÔÀ®ÇsBBsÇ®Àþ¡ë³þËuu5³ëaUò#'#"'532N%bÄU`޲§´¥ÒþÜþŸþëþ†DK*‘2´2<!&'3673ÌbŸ~ÄšZ00ZšÄ¥xUö:þæþÊþŨ ¨;6þÓþIþÊú<3#&'#6Ì´Ux¥ÄšZ00ZšÄ~ŸbúþÊþIþÓ6;¨ ¨þÅþÊæþ:dò#"'&'&547632#54'&#"¿Î=­:i_{•š\ %ZÄ[,,G\O98<SGU37e{a}Uw¦‡–þÍþ¤œnWl42@B^!xþ©–$%-`+-!d! M fMÿÿ‚ÿìë™&ŽK„ý¨ÿÿ‚ÿìë&Ž%9„ÿÿ‚þ ë&Ž%9ÿÿÿ‚þë &Ž'"¼Š2©þÿÿ‚ÿìë¶&Ž$¼ ÿÿ‚þ ë&Ž$¼ÿÿÿ‚ÿìë&Ž&¼„ÿÿ‚þ ë&Ž&¼ÿÿÿþ (¯&Z|Šÿ8ÿÿþ (ª&Z%?ÿÿþ (f&Z"Šÿÿþ (f&Z%¯ÿÿþ (ª&Z#Âÿÿþ (f&Z$––ÿÿþ (f&Z&–¯ÿÿ}ÿÚ÷&\KÿÂÿÿÿ}þR&\2þÿÿ}þ¢R&\!©þ¢ÿÿ}þ¢÷'!©þ¢&\KÿÂÿÿÿ}ÿÚ°&\"úÿÿ}þÔR&\"+þÔÿÿ}ÿÚª&\#úÿÿ}ÿÚx&\$úâÿÿ}ÿÚª&\&úÿÿÿ«þ Á/'K¼þ>^ÿÿÿ«þ Ér'¼þ>^ÿÿÿ«þ &&^2Xþ ÿÿÿ«þ Ê&&^!4þHÿÿÿ«þ &'ù^ÿÿÿ«þ Ê&'!4þH&^!´(ÿÿÿ«þ „¶&^"ô ÿÿÿ«þ „°&^#ô ÿÿÿ«þ „°&^&ôÿÿ‚þ ¶&`'!_ !õþ¢ÿÿ‚þ î&`$xÿÿÿ‚þ °&`'#â $xÿÿÿ‚þ å&b"xþ¢ÿÿ‚þ °&b#~ ÿÿÜ&d#„Rÿÿuþ ²@&f#,°‚ÿ¤žÙ:654'&32! '$&73! 76767#"'&54767632µ)B,4((7(*H³nþÃþïþáþÙ‚þ·@¸AËZAÑ×d#?z…Kb–NLZB`.+M;3*)3P&þÚ´F=)d Š\^ˆtL"9;l&NKCW4,”E$2Hf6‰âÿÿ‚þ¢žÙ&º!kþ¢ÿÿ‚þ¢ž&º'!õ~!kþ¢ÿÿ‚ÿ¤ž&º#x~ÿÿ‚ý¨žÙ&º$îþ¢ÿÿ‚ÿ¤ž&º&xxÿÿkþH›&!Ï~ÿÿkþH›&#R~‚ÿ§)-%2767654'&54767#"'$473¸Â$6þÊ2 #déý­Gf>5þ÷ã¡À€þ¶?¸AËhXPA7.EB|=Q#!w*6ºú(  %þ¶{{qeVUI&b Š\^ˆ~B"‚ÿ§.54767!#!"'$4733!2$6=4'%$Ç ¢°`üh_ ®Êø>5þ¡þ À€þ¶?¸AËh—ô¸m/yüYþk>ba›ýè7# #5–&øqeVž&b Š\^ˆ~B"–jj‘7ÿÿ‚ÿ§)&Â2F„ÿÿÿÉÇ&k!îFÿÿÿÉÇÖ&k#qFÿÿý¨Ç&k$Xþ¢ÿÿ‚ÿ§)+&ÂEÊÿÿ‚ÿ§)+&È2F„ÿÿ‚ÿ§):&È"„¤ÿÿ‚þ¢)+&È"Xþ¢ÿÿ‚ý¨)+&È%Õþ¢ÿÿ‚ÿ§)4&È#„¤ÿÿþÈÉÄ&l¼ÿÿþÈž&l!jÿÿþÈx4&l#è¤ÿÿüà&l$&ýÚÿÿ“ývH¶&Ó'!? !¼ýv“þµHî#"'$47332767654'3HdnùaP„mþ¸/¸1É]]LGÁL"f¸h8­²ÅD%jdëQ¬í45Þb`¸Þœÿÿ“þµH&ÓKÈþ%ÿÿ“ý]H¶&Ó'!? 2&ý]ÿÿ“þµH°&Ó#ô ÿ½å 2?4#">#"'&54733267&'&547632&'5#"32764&__A-D$Il–n9eÁ¸|8-H,-C,QÚÝN(J¯„b41}>í‡XA%v3ˆþhO =¬J6>(E& !B„QHJQS'¹Bµþïþõg=q?%'“i!.C]“ÿÿþ (°'$––&Z!?ÿÿÿ«þ @r'ÿôþ>pÿÿÿ«þ @Õ'wÿ¤ýØpÿÿÿ«þ @4'ÿìþpÿÿÿ«þ @°'#, pÿÿ‚þóÀJqÿÿ‚þóÀr&qÿôþ>ÿÿ‚üþÀJ'%Šýøqÿÿ‹ÿÆ Þoÿÿ¸Â”¼€ÿÿ¼ÿÿRð‚ÿÿLƒRÅ%'&547632&767#"'#'3ÈX\lTX\D8/0EÃ=’ ´%1œÇBx:=œ$!"4'´Qjr›þ©Ü!n›8jÿõâ$(327654'&#"327#"'&5732#"€-2!WZWXZV%2-Z(‘ .5_³ªŸ¾_52œ‘Z¡JkVרààÕÚ<…J¡Ð•ž¸y&ÄvþŠ»þÑ‹¦žÐ 3767"'&547632&#"327ÐAoDdN.†bpŒxXWs>0B7,gŒ`áp†5ÿµoU%m—®ao´3/AbM3))´I˜·áÿÿ<‡ÿÿ<ˆÿÿdò‰‡ÿãð (@  üìôìì1@    ‘Œäôìì0"32$  ‹œœþhö þ÷þ þ÷PþÍþÌþÍþÍ3343 þsþ†þ‡þsyzáZÕ (@  ÔìÌüü1@     /ì2ôìÔì0%!5!3%=ü¤JÊeþ™ªªª+H¸Hûá=Õ · Üì2Ôì1¶  /ä2Ôì03!#3uÈýlÈÈçîýhüÃÕþá=Õ ¶  Ü2Ôì21·   /ìôÔì0)5!!5!3=ü¤”ýl”Ȫ¹ªÈá=Õ ·  ÜìÔ2ì1·  /ìäÔì0%!!!3!©”ü¤”Èýlªª ÈüŽá=ÕµÜì2Ä1¶  /äÔì0!#3!=ýlÈÈ”Öý*Õý«á=Õ¶ÜìÔì1µ /äÔì0!#!3!=ÈýlÈ”crý8ÖAÕ'µÜüÌ91´/ìÜÌ0¶‡‡ìì#3Aý“þÉSuÃüNÕúÛÅÖAÕ (¶  Üü<Ü̵  /ôÜì´Ü<10%!3!#ŸþþÉÉ¢ý“þ°þ ÃüN{î 2@ EEüìܲ@]ü9Üìì1@ • •‘ /ôìÔ<ì02>4."#&'.4>329[œ¸ZZ¸œ_ÈPGr……䆇䄄rEM»p`77`p_88úæ 1§Å§bb§Å§1 ÁyÕ@ ¯üüì1/ì03#Á¸¸Õú+qÿã!“/@ E  EôìÔ¶ 0   ]ìì1@    ŒôìÔì0 6&    ¹¹¹þúþ«†þëþz>þú¹¹¹þ†þëþzþë='Ù+@  ÜÄ2üÄ291@ /ì2903#3²³Âþç¸þçÂ6£ýQüÖ*¯=q33# =¤ú¤Ãþ¢þ¢qü½ýCºq @ üìÔüì1µ£ /ìô<0)3!3ü9¹U¹qý"Þºq @ ü<Ôüì1¶ £ /ìôì0!5!!5ü9üòqü“K“qOâ!>@#E E"üÄìܲ@]üܲ@]ìÄì1@ • •‘ /ì2ôìÔ<ì0%!!5!&'.4> 2>4."¼‡ü:‡RJr……ä 惃sKRþQ[œ¸ZZ¸œ“““{ 1¨Å©bb©Å¨1 Ÿp`88`p`88º¦ %@    ìÜüÔÌÌ21¶   /ìÜÜÜÌ03"3#!5!ò„…ñpü9Çœ fšžüø“qçî2@ EüìÔ<ì2ÔüÌ1@    ‘/ôìÔ<ì2Ì0!#!##"&6 54'&"3qv¹þCœø¼°±f^‹œ]8Æmr^:ÉüÞþÄ<ÖUåf˜þɃ]8˜ÆƒÁDÕ '@   üü<ü<Ì1@    ¯/ôìÜì0#!!!y¸ƒþ5Ëßý!Õ“þ/’=ÀÕ '@   Ü<ü<üì1@   ¯/ôìÜì0!5!!5!#þ5Ëþ5ƒ¸ß’Ñ“ú+ºÕ %@ üü<Ôìì1·   /ììÔì0!!27654'&'2#!3œþÐ,R4,,=iXXXlýιÞýµ]Oz}I_“‡_Ò­‡…ÕýœÁ$Õ;@   ôܲ_]9üÔì@    /ôì999@ ìì10#4'&'5!½ˆ4B ¸5M‰ÃcAþïê¸æþÉq™_–ÜÜ9V“= Õ4·ÔÜü9Ì1@ /ô̲]ìì´]0 53#Tþ麸ßþÇö9ú+Áë!-@ #"üìÔìÔüì1@    ! /ì2ÔìÔì03432>324&#"!4&#"!ÁôÆ}x5%–ÓÒ^ˆº¤ZþýH¤Zl”þî¦ÿK--ÒX€hý&|‚€Å•þncƒ§Òò=‹Õ &@   Üü<ü<üÌ1¶  /ôÜ<Ü<0!5!3!!#ˆþµK¸Kþµ¸€”Áþ?”ü€=Õ9@  Üü<ü<Ü<ü<üÌ1@     /<ô<Ü<<ü<<0!!5!3!3!!#!ˆþµK¹øLþ´¸þ=“Áþ?Áþ?“üüºq!@ üìÔüì1¶ £ /ìôì0!!ü9¹Uqüq“ýµK=ÃÕ=³ÔÄÄ1·B••/ìôì0KSX@ììììY! #ÆýtFCþ0æþ0Bû~ú+ÕÁnÕ 4@ üìÜ<ü<Ôìì1@       /ìôìÜ<ì20327654'&+!!2/!!m¨]%i¤þ ;°„@ED\ŒÔýTôqQE=4."þµXEr„„rJS¸RJr…CEoJ¥[œ¸ZZ¸œOó“þ{ 2¦Æ¦1 þ{† 1¦ÆSV/þÞp_88_p`88Á}Õ @ üìÔìì1µ /ôüÌ0#!#}¸þµ¹Õú+BþÅÎÁ}æ #@   üü<Üüì1µ /ÔÌüÌ0#!#3}¸þµ¹¹âüOþü›þüÁmÕ +@   ü<ìÜ<üì1@      /ìôìÔì0!%!!5!!z;þ ôþ ¬ýTÞýµK“Ñ“ú+qOÕ $=@&E "E%üìܲ@]<ü<ܲ@]ìì1@ • • "#/ìÔ<ìÔ<ì02>4."%#&'.4767673 [œ¸ZZ¸œTXEr„„rJS¸RJr…CEoJR¸"p_88_p`88Î 2¦Æ¦1 þ{† 1¦ÆSV/ †qOÕ(#&'.4767675!5!!2>4."¼XEr„„rJS¸RJr…CEoJRþµNþµþQ[œ¸ZZ¸œP 2¦Æ¦1 þ{† 1¦ÆSV/ ó““ýàp_88_p`88Ùb/ö²ÜÌ1² /ì0!!ÙVýªö”Bà¾f#"&/#332?¾¢E=9Qc´‹õ”t2 %xfþ¼" %/¯õxà $â¤Dp²/ì1²/ì03#¤ÌÌÌ¿î=f7´uÜì91¶´³ôì290K° TK°T[X½ÿÀ@878Y3#'#´”õ‹´´‹fþˆõõ[î¥fE³ÜÌ91¶ ÜüÌ90·  ìì@ Ueu…@ )9IUe]]!5'3¥ü¶{ì¶î”æäBà¾f3326?3#'#"&'B‹x% 2t”õ‹´cQ9=Efâ$ àþˆõ¯/% "[î¥fC³ÜÌ91¶ ÜüÌ90·  ìì@Ueu…&6FZj]]5%3%[¶ì{î”äæ”šþ‡fÿS²/ì1²/ì03#šÌÌ­ÌÕF'µ/üÜì1´/<ü<03#%3#\ËËþyËËÊÊÊÈuº·  ü<ÜÜì1´ /ìÜÌ0#527#53ºò„…ñ€þõgšžÈuº·  üÜÜ<ì1´ /ìÜÌ03"3#Èò„…ñ  gšždû¶ ÜÜüÜÌ1µ /ìÔì03#!!×ÌÌþ³üMûÌýd“dÞ '@  ÜÜ<ü<ÜÌ1@   /ìÔìÔì03#3#!!×ÌÌÌÌþ³üM„ÌìÌÞ’ÿì÷“³ÄÜÄ1² /ì0'!! üõ““°þæ‘''/33!!3'#67654'&67654&nÍÍÍþu‹dÑruxt‹›€ñddx>DD>x˜II’‰þvŠýçþ!ßý þóRTšxޱ…¯`aþæ£þw,0dc1-ýëþ!:;z{t‚ÿëÛ{*L@$% E+ü<ô<Ô<<ìÜü@!#91@‡Œ$+<ôìÔÄ@ ‡(‡¸+üììÔÄ0%"3254"3254#"54!#"543263 #4#"h??AA??A¸ùæ'+ææ¨,L½–¸â‰Wð@@@@@@@@üÁÍÉÐpØ·QQþ¾üÇ9ªŽ‹ÿ݇Œ/@@1(. #E0üì<ÌÜÌÜü<Ì1@‡‡!Œ0‡%*‡ ¸0üìÌÜÌÜôôìÔì0"3254"54$3  !2632&#"# 54-654!"`@@@CÒv»Bþ™þîþĉըŸŠ†iUvË«þ:Ö×þknL?o@@@@þìä‰Äþ«þìN;EjfŽÕa‘ùïe:.šº88U؉ÿìôŒ8327&'"254"%47&5476! #4'&# 63 #"'632# i60IKhhþ¯*)…“7!‹o¸^R¿þýX;*:ú9«ÌÌþu`þ/'"­€6OÔfq³þ÷ý¿A¼…tqLIþ¶ $\9.ȶmþQŒ!6@   E"üÌÜÌÔüÜü1@‡¸" ‡ ½"üìÌüìÄÜÄ0463 #"&'7325#'&&7'6m¢ÝešÍÖt ½"x¯‚ØÐÖCBC¦quýôýþùðÐ Ñóßh!Ï ACBBÿÿ—š )2@  #&E*üìÔÌÔÌÜ<ì1@ ‡ ¸*%/ÔÌÔÄÌôì0"32654& 4''&5432#5476°$ % U%|{¸eÈÙÚô6þ™ãL¸j` %"%:yxþÙý~)ŽR¦·Àh–††KKª>Ü‹þ †Œ 65@$- 3 (E7ü<ìÌÔÌÔ<ü<1@ 5/‡¸7‡&Œ7ôìôìÌÔÌ"32654&4763  !27632! 54-654!"#"`$ % õçºBþ™þ­ûïy#x—”¾Jþiþ:•O×þknLI¿Òo %"%0‰yKþéþpjNdfïD×þüþ”QcwþõùØiC‘|85s½sÿïô• *;@&%   E+ü<ìÜÌÌÔÌÜì1@"‡)Œ+‡¸&¼+ìôÌÔÌÔìôì02654&'&47&7'73%$æ$!% þ­¥¦lÜÝ6ZA“‹|¸ýÌý³• $! $ý˜Vmê-·Æˆ½G4 ¡p¨¾?ýÁý´ºÿã¼{1@ FüìÌÜÌÜì1@ ‡¸<üì@ŒôÄÜÄ0%"32544!  #"54$32¥@@@þ¹þµæëäÖ)ë@@@@ëÆÆþPÄÈÈŽÌvvÌüÇÿ⃡ .<@- " 'E/üìÌÔÌÜ<Üì1@ $Œ/‡-‡)¸/ô<ì2ÜìôÌÔÌ0%"32654&672#4#"#"'&#" #"53232l$ % L ™ò¸7*>(€z*M#6Õûò—&8"$ñ %"%3|þ©ü¶0Û¯qi½áþPÄÚÒ–Wu«þ²{+?@-$'+ ,<ÌÜÌüÌÜÌÜüÌ1@ )‡!¸,Œ&½,ìôÄÜÄü<ìÄÜÄ0%"3254"3254 #"5#&767663 #4!" @@@þ™@@@®äï!ÙÓ¢7yÁ-ž¸þæ²^õ@@@@ö@@@@ý˜ÝÃã×ÇedÕmúÛ%£‹WÿïË‘ ,9@. $  )E-ü<ìÌÔÌÔüÜüÜ1@ ‡'Œ-+"‡¸ô<ìÌÔÌôì0"32654&4323254#4#"%$7"@$ % þùæì‹µ¶'(¸ujþ‘þ’ÕÓø %"%@ÙÕ¯ˆ¨Ì°Xþûüsghý©þ¹\—_ÿ㾌"9@ $ E#üÌÜÌüÌÜìÌ1@¸¼#‡ ©Œ#ô<ìììüÄÜÄ0254#"53265$54767653!"'#W@@>¸z]Uþèâî]ƒã¸þi¹TrÙs@@@@üpeœgÌÝÛýu©±/üÑþ²ssIÿïs|2@  Eüì<ÌÜÌÜü1@  ¸¼‡ŒôüìüÄÜÄ0"325447&763! 3%$5@@@þÔ¶·åíþìMg¸ýáýõî@@@@ýRÚÄ&¶Â¼—þѨË'´ýLþBIÿïs2@  Eüì<ÌÜÌÜü1@  ¸—‡ŒôüìüÄÜÄ0"325447&76! 3%$5@@@þÔ¶·åíþìMg¸ýáýõ@@@@ý<ïÅ%·Â½­þÒ¨Ë'hû˜þBYÿïÌé E"32654&!"32654&&''"&5623253765$7465&'7$ % ý$ % K”fg´¦œüÔþ饤¸£›þçÓרIJÒ %"% %"%üIK£šbáëÇþv„„4þË‹‚ŒËî˜42@7-]fÅnþ9¥™ºÿãh%A@'$ F&üìÌÜÌÜüÜüÌ1@‡Œ&ô<ü<Ì@" ¸—&ìüÄÜÄ0!"'# 432!32533253"3254hþ©”fg´þ¾ýÓþ襤¸¢›¸ü>@@@ þÃJJ=|ßëÌþ\¤¤@þ¿¦§ôýÌ@@@@hÿï} -?@, (,$ E.ü<ìÌÔÌÔüÔì1@"&¸¼. ‡Œ.ô<ü<ÄäôÌÔÌ0"32654&2533253!"'# 47&5432d$ % A¤¸¢›¸þ©”fg´þ¾™‰æìèBÒ %"%ü³§4þË©ª/üÑþÃJJ=ð¦%žøÜ‰þñM§hÿï -?@, (,$ E.ü<ìÌÔÌÔüÔì1@"&¸—. ‡Œ.ô<ü<ÄäôÌÔÌ0"32654&2533253!"'# 47&5432d$ % A¤¸¢›¸þ©”fg´þ¾™‰æìèBÒ %"%ü³§4þË©ªèûþÃJJ=ð¦%žøÜ‹þóL‘§@ÿã`$@ÜìÜì1@ ¼‡ Œô<üü<03!23! '#"543225“¸ù¸þOþ³)3¶Æœ)`ý,þíÔüÅþ¾88œ–{‹sÿïô *;@&%   E+ü<ìÜÌÌÔÌÜì1@"‡)Œ+‡¸&—+ìôÌÔÌÔìôì02654&'&47&7'73%$æ$!% þ­¥¦lÜÝ6ZA“‹|¸ýÌý³• $! $ý˜Vmê-·Æˆ½G4 ¡p¨¾Úü&ý´‹ÿïŒ ,7@  '#E-ü<ÌìÔÌÔü1@+‡Œ.%‡‡¸.ôüÔüÔÜÌôì0"32654&4! ! &# ! ! '&54323 c$ $ ½þ€ýÔ6bæuøåþŒ’ýÄþ«‡UÓàK·X $ $è8$Ü{»ŒŸþþ›nE{ËÒN%Oÿ戴 0@@2, %&E1ü<ÌìÔÌÜìÔìÜ1@‡%‡/Œ1!‡*¸ôìô<ìÌÔÌÔÌì0%"32654&&'&'&5! 765! '676%&4% $  ,«D ãÏù)@ ' 1#-E5ü<ÌìÔÌÔü<1@ ‡)Œ6/‡%‡!‡¸6ôìÜìÔüÔÜÄôì0"32654& 4%$54!232#"'&#"! '&5432h$ % $—þ{ýÝ¡Ëajjh@”Mó§qKÍy)ý«þLJmá×_œ‹ %"%þù½1EæüYl0þ”xP^b8RþÂþsu_|ÞÚ]FËþ­ð¡'"2''&'$!32'&547"32?6A€€ñS2;9ŠÂ’ þhhÍÔÓÔ¤ÚNU×~œõþ± €û †+;9j–qÎÖÐ!þþæB¦a¦©þÈÿÿoÿå¶€'?ýu?úÉû`ÿ§ +@   /ÌÜÌÜü991@ /üÌÌÜÌ0! &7623$'4'74"YýÇþ¶Ãåò#!A[VЍüÞB8?<þÿ¨kÙØP$U.FŠM?>={É{+@  EüÌÜÌÜì1@   ‡¸<üìÜÌÜÌ0 ##"2#"53254#"·¸ÿn=Úåá¦;C>@{þjýËVÁÇÇ®þR777ÿÿüšÉr&V@û@ìÿji·  /ìÔÜÔì1µ  /<Ì2ÔÌ0! ! !5 74! ûþ%þ&þ?þºþ˜%»~?>þÂþÁ~»Åû@ìi$@  /ÌìÔÜÔì1¶ /<Ì22ÔÌ0! ! 3!5 76! ûþ%þ&>Ôý©þ¹þ˜%»~?>þÂwJ~~»Åû@ìÿji*@   /ìÜÄÜÄÜì1@    /<Ì2ÜüÜÌ0! ! !5 74! #5ûþ%þ&þ?þºþ˜ßî%»~?>þÂþÁ~»ÅNÜÜû@ìi.@  /ÌìÔÄÜÄÔì1@   /<Ì22ÜüÜÌ0! ! 3!5 76! #5ûþ%þ&>Ôý©þ¹þ˜ßî%»~?>þÂwJ~~»ÅTÜÜüþý3þ¶ÿ²"36654'#"5432ýî‚AA\(D³ªeN[̼þÏo[$žºN[‹uÖü§ýŽþÈÿ¯%@ /ÌÔÌÜÌÜÌ1@ /ÌÌÜÄÜÄ0"3254"547&54323253ýró>Juum‚ž„²þ@’s> [yu?{EBXFþºÃû`ÿ§ '656%"'&76! 4"3Y¨ŠVþ¥A!. Ùå{x9üá322674&#"ŽCC›òèÌjFPˆH OQ²µ$!%!¢p'(FnäJv-Oý!3]ï $ $ÿÿzÿãÈ{&KK0ÿÓÿö0, ("32654&&3 #"4/&5432N$ % þ¤s $ËŒeÓû‹qɘzm… %"%þù´ƒµþçÏ82®º´‘y¦œþ,v\ÿãë#"6@ E#üìÜì@! ÜìÜÜÌ1@ ‡˜#Œ#ôÄÜÄüü04$54%&&5! $#"57"3254ÂiþØó xÜ«äþâïï@@@ç¸ÜXº¸4 |ì`Pþ°¤Ù³ý÷ åÜÝ?@@@@¼ÿê ""32654&5&'7!$#"47#®$ % þdt¦„.;àÕûœï %"%ȈÄ_øp•½¬˜þ‰ ñÐ8>™u“þ%˜t/;4#"#"'&#"$#&532327632! '&57"32654&à"3C2z7J,"Óû¶…/IN\=0‚¶BWþ–þ¡TO½3Hý©$ % Xt\DD\t] ñÏ5ö<\UCþþüªþ÷fˆwpv Ê gH %"%ýñýÆV@/ü1/Ì03#ý´´Vþ›ûàÿ£ '@ /ÔÌÜÌÌÜÌ1@  /Ü<ÌÜÄÜÄ0'6"%)56574 65ü+*+µ×þ„þU·‘G±óm++),}åþÝ….pˆƒ·\(úû>È.ó4"!27676327673!#5654#"'&'&#";&543ü.ð%2~*&IHHÜ„BO™g(þâÅÐLBC]i%>’e>.`h>3È‚A?×~= h‚\$…kb8:;-F¡_Zkf2)üNàþŒ !@© /<Ìü<Ü1@© /<Ìü<Ü053533##5üNØŽØØŽ¸ŽØØŽØØÿÿû IPüšöþ>r@ /ÌÜÌ1@ /ÌÜÌ0432#"73254#"üšÔÐÔЄLTPP¾´´ÈÈHHH‡ÿã` " 7654&' ! '&476‹^L:NbX1ˆcoŒþ÷þí€qo’À„h³½`™W®£ü Ä’éý޳¥”æ•Äcÿg¨›&24764'&#"676'&'&5476 ¶€ òÒpH¼’gc/5pØä†I´u ¦þÎö€€ýê‡uËpHECle\gâÔUÔÜš‰su—ÈýϨ‡cÿy\±$24"27#&5432# '&5?$5+€€rÐ%3Ýàí]fÜþͦÏÓ¸þ”Ù|pHF€þP¶ÆØþäðfou—ÈT¢¥àéþÇþå©aþûpHÿ튤/%24'$5432327#"'&#"%$'#"5432253â¶þ¶ï¡3]L/|€t¾kZ1„AQ½þfþÜ(3¶Æœ)¸ƒDj¾R—Ææ:jÄTþûh8KOÈpÆþtþ$68œ–{‹‘ýÖþícÿWα%24"$'&5?$532&'&32!€€­þâþñþ¾rŠÏÓ¸þ”Ù|T9ïlcÙÔì ~x¢˜€ý?Lv§T¢¥àéþÇþå©aþûmY<ÅÐäØÉÇKcÿWα-224"7&5&326532&'&32$'&324!€€ýBå‘äûœ¸³}b$|T9ïlcÙÔì ~x¢þâþñþ¾rŠø=C˜€Ëh¡(ªç­­¢½ë¤ ?fXþòmY<ÅÐäØÉÇKLvÈttYÿïô4@'&''"&54323253765'$543227#"$#""32654&²¥”fg´¦œýÔþ饤¸£›Ùþ¬úu ^|€u½IþòSL\ßü>$ % ,¥™IK£šbßëÇþv„„4þË‹‚jEašØÑüÃTþûùW8Ò‹þ¾ %"%‚þÛ{ &%"324"324#"54!#"543263 #4#"h??AA??A¸ùæ'+ææ¨,L½–¸â‰Wð€€€€üÁÍÉÐpØ·QQþ¾úÛ%ªŽ–þRpt MU"32654&254"#&76767%4#"#"'&#"$#&3232763276'767‰$ % ånnþ´vp†+-•"2D2z7J,"Óû¶„0IN\=0‚¶ŽJØ%•.3?­5xvþ„'ªQœ %"%ýž933¹hk//3wá±t\DD\tþß ñÏ5º<\UCþþýÈrT­«”F-2bG;þÐ"‚b,iÿ÷÷‘ $5354#" #"524"Åm~¸þÀþŶ¥Óý¬€€‘þ¹ý©ejüsûþX°¤þ\Ìëß|9ü€ÿè“™ I"327$"3273653%"'%5254%$7&76%$5#0#&7626¨€A?à€A?‘ Tc¸þéb*@þÖÛRX6&$þHþ£ÂåîuŠ æÓ¢5r—ý@@@@@@@mýo6 Jü¶þ½,/¸Ìáƒ7'ýÖþ³- Ó/™×Ô‹uŠþꟵ² îÉcdÿèÉ™ LX"327$"3273253!"''&76324%$7&76%$5#0#&76262654&'&¨€A?à€A?‘fx¸þÔ…$8ŸÙÄ$+Rb,7þHþ£ÂåîuŠ æÓ¢5r—ýô$!% @@@@@@@mýÓ”žJü¶þ¾ceÆÁã“$3ýÖþ³- Ó/™×Ô‹uŠþꟵ² îÉcdûê $! $xÿᆟ! !5!!%64'7†þ;þ·þ±þOÜþtJýuý¯4úSS›vþ–þ;øX¨©çþ"þòþ]| …¿KÅnÿÿ¢Ÿ#"57!3273!Á¼–âþá¾þñÌqžº´-ÁJLß÷÷ø½ÝX1ú¢oþÑ2³!6&#"&5&632!~þpoƒ~d‘þ·½ßsþÑ.†xsgd{²®àï°ûŒþ1nÿâ?Ÿ #"327%%5!5!!‚þ¢ÍÑþ¦Iæë<½þPþÌþÓþ@—ýÐýÑ“Þ =þÂþ÷þýþ¦`ýþ¸þI´I=œ?©©<¥dj³!&#"&432¶Î‚”±ŠyÎòä Y·«‘Ó…¿°4þÔþÓû¦P¶³!#4&#"&54632!þ¨µ’_k‹X„’ýµºî õü#‰gi’Mk| ªô謃ýl<ÿ០!3>4&#"!5!! >þþž³ƒÀáŸþçæïþêþ³ Fýþ+û¬Ô ú¡þWþßþ®5ç ýþþÞyÿá³%# !!!)!Y€þ¢þºF^Šþ¬þÖþeþ.Ȥ*”þzþÀþåþMjûåᎃâýéýO<ý%!3!kýѳ/¹C¤ù¨x}Ÿ 4&#"36#&3632Ê´œ•º°ŸtÜÑõþ÷´Þlõµ}ß9þ^äþDoUD<þËNþ·îü<ÿáF  &#">!#!63 ˆä‚™¶ŽwÏþÁëþíþ¦³À¤þÃ8 »=þ€þúµ¤þ¹10¿ýëµýÀ<þ¿ýœþêxÿâ—Ÿ "3265!%"3!!5!!«‚ò»‡µšþžôþîÇþÆ5þýLiüÁþÛàßÜ¿üçþAþìþ¸-*'=Xªýþûx‚‡Ÿ%4&#"#463!!&632Ê½š±Œ´åñ¿þ„t§ªüwâ¢aüf ÌɪX¥­PþÒþý‘dþ©r³ !#"3 3!  ! 36´þ­ûïþ«_æJ ´þ¾þÔþ»þ?Ë89Òþ辕ŒbŸþiþåþÊþVÉýµþ©Gejçþþ–þíþ4Tð2ÿâ½³#"5!5!3>53½þæäáþØþ{9ˉ¾³ÿàþÃ=ê ŸûR­×Õ®®P‡ %#"547#5!3273Ô¢­òþð¥ØØè²“‘¾³ÊV-çŸØ “vþ湯V4ùbnÿâÓ %!#"5732653!!þIþæÜãþݼsrÇ€®”´iƒyþ8þÒþÜ/ÓquÅšÈßÓlýûûè‚ÿ≠# 533>54'7‰þпþôþö³ ±—_ö*þõþÃjëiû”ÅîÝÛÑŽÁ‚ÿÿˆ³6&#!!>7)!!! ÊÛœþà Ù½þÑþüþàÂü‹Ó3‹¾Ëý¶¿ÚþÄþ+¡´þÁdþ‹r³ !#"32!527&'! ! ´þ°øúþ°açõU¾þmæ}Øþüþ³þEÂI=ÆÉÉa þ]þñþÓþM¸ý¨þ©ž¼v8±"`_ðþþœþÈþØ€d‰¬"#327&%#;!###) 7bb´ÜÔþ6e³îÿ¢eaþ±þýb­eþüþ¥^tNü4 ÊÒþñÐÎþãëþËþ´þL´NhBþÄZp !#!3!3!´þˆ³ýѽr³4fQüJµÙþÐAýÁþƒÿሳ#4&"#&32ˆ´¿‹ŠË²(á嬬ÜÛ¬ûT¨éAþ¸Ønu %#"533273ÁÒüõ´– ¸³´ÂMÛ=ýűžU5ùaxÿá~ &$=3326=#"533273~ôþêÑþÕ½¶‡ŽË¶©öþ´§¦¤­³θþÍðà$!¤¥§ûS9¹8ýÈ—»X2‚‡Ÿ%6&#"#3632ԙχ°´³®œÙ/«“½0ü5žýÍ0ÿþØýŒyÿá³5#$!&# %73gö£þuþ6ßwöfÛÀþüþr€ ý¶an‡Õ¥°¸þ‘þ²þÑþXž÷üéxÿâ{  "3265!# !33!ÇÇÊÇ›ˆ  þ«þõÏþûþâGùµüþôžÚöÇ×Üüéþ$þÚþèP ;ýüûw‚ÿÿˆŸ4&#!!>7#!!#5!#!2Êp]þ9ÇP~½Ò¹þ9³þ˜´{¹Òmþ€ª÷ÿþ{çþ( âdÿ☳ # 5332654%$432#6&#"˜þëäþôþÑ¿ͬ¤šþ]þ`þÔây€ŠDÑÓþäeüµþô©šÈªª þáÑÆ‹–vÎþ¢‚ÿÿˆŸ#"'!!33263ˆþÞð¥›Ìü€´¾„Ï´ÒþÌþØþ¬ ü ã<Ÿ ! ## #5!zýž®×ëþkÜþ{ÿTýïöýøüÎöýO_–©üœ<ÿâG # 5!#!32653GþÕÐþÿþóþ°´·³¨Ã³ óþÉZÐôþ‰û^‹ñÑ«ž‚ˆ 54&+#3!23X„ý´´½×¾7Ÿ›‹üŸýü½§b oÿâ³!#"&7326554632#&#"þ˜ôóþª·‰æ¨ÓÇüúÃ}‘Ñ}5þçþÆ:#æÃƒ‰Ÿä×çÌLöŸŸŽŽ}¸þÅ<B %#&=#5!;3îÖѾv ZŸñ³t´ŸmfùŠùanR #&$3;>53RþÂL»[þ¼´£aƒ^•µ‡þÙáýƒ}å#ýåÇ©¤ËPÿᘳ 3#"32654&#"3267+!!.546;!5!5>32œÂE…HPw=xXca³hx¿ÞÀ³Zþ¦Ö”°ÚÕµÂþ‚~¸¡¾â9]~}_h` dY‡ZµydŸÓþç—ïœËDz“ᕵ¾Â¼dÿ⬽! 7332&53¬þ[þ]&°"òïþz»~ªþ8ÒÏÏþº<ÔkÔ¤þ–dÿãÀ³! %76'&53'!2ÀþYþK‹/““·‚0>´öþó!ýÂ<AC§ijŽAˆ…´I{þ2·þHþPZþLi$%#"5%674#"'! 4&'326LþÿóèþêÒ«³œ ES©}´‘§©ª·‘„¿*×þË6Ö¦w‚“†1(Wþä‚©þ‡•öþÿ‰®ÔÕdþ(a'! 47&#"#&%'67$!26! # !2þ^þNWuöe+Ç þh–tzkœþž…³ofÿ£´ïþõ ïPýã(ŽB¤þ­þ ÁÊÔžc¢lq/ýã쬱ýùzþ‡þbdþ˜`! 7332#"#'! ˜þtþX!¬ôâáÈ7¬1n‹?þ\¦áãþèôâ܆þodþ¬`"! 73!54'#53654#"#'! ¬þoþI%® ݪ¦ÈëȰyŸÓÚ=þZ ååþì†Ø˜\ÙÏ¿¥›Tþ¢Ò…hþ)ÿã´! 7&%&326#"6þ\þZÁì[FxL´òñó±¯® ýÖ*qaqEþ¬±tDþ'¥þ\þaÉúÜþådÿã`!263 ##"! #"32d¤õh~’åàèeoþsþ`”òîìô U¼·ýìþÀþæ@ŽºJ½ýÔ(Êþ6þddÀ`# # À·’þ ‘¸\DþôþÉ #þmþàþß8Zþ¥V! 73!54+53$54'3¥þmþF2ª( Úè´g)¶éyï>þ[˜ïæþëþ”FÀ³¬¨·Ïa[þódþ( j0#5#"#'#"#'#"#&%'67$!263263  Ç×ìÛØ — ÊÅ – ÞÛ²C¯1þCþ°„m‚æýÅÕ\`¼ÍX^Ϊìþôô+þùáá þôááþ£þ>àfþ¸çT˜€o'åÕãËÕÙÏdÿ⬳! !4#"#5! &' !2¬þoþIºeÐÙ·zªD–þðã¼þ&?! 1NÓÈ//Tþ þ-, þjþNY‚ÿáÊ©! )!"67 #32ÊþRþfN¢þ0v‹’´û{tíýýÈñ{\’Žþn@ ý× ;þkþ‘dÿÿå`##"#5#"#!263 åþíÑ/Òç¥çÓ8ÑþæˆáWaÜ…VþÒþØ@~þ§ÒÒYþ‚þÎþÛ$3 ããdÿ⬩! 7332+53274$53¬þ[þ]²ïñÇ®Âþ¯Á-´áýáÙÈÆþ±“m–«Ÿ™ÂdȨ¯H”dþ«i! 73325 '6%5%«þcþW´ò÷þdãþ9)þ×*@þ]¢””þê÷O‡rþܤ–uGv²dú©###"#5#"#%7263 úþâåOäÞ§ÜèPîþêþþ¨þvþĶÙ[`Ü’KþÛþÛB‰þžÃÃbþwþ¾þ÷+ IH@§þQ)Mýý‚ÿâÊž! 3!26573ÊþfþRªæÈ¶Úãýÿ¬ûTþ|u©ª¤]þÌZþâp %3! 32%#Z²ÿþÅþûþøþÀ´ܸ­æþ¯±þ¯:È_þí\ý2þÁþ)ÒKþÒþ[60’ý~ þ¶’ ! 73!2&#"#4+'73263 ¶þnþG²è‡{ œRmWPOC 0@þ]£ããþég¶Œþ¥[x(¡2»»þÇdþ!`2:! 63 ! $=46326=4+5326'#"! #"32d¡]x¼‰ûßþØþêþâþècd™Öë ·PS¹ÔŸa þ]þY–õííõeûÆÁþRú£j˜\´á¼wCD4sšoX§—µ›7®<\"þåqþ‘þ¦dþ˜Ÿ! 7332&'"#'!3˜þwþU!¶#÷ßg­¤2±*>§|ª?þ\¤ááþè¾K ÉöÎ| P™dþ)æ_%67!263 #5#"#'#"#4'&P³þQŒØ`[Ê™¨ÉÀàÛžàÚn³æ¿Â³<5)•ãççþ5ÙúÐAþéÄÄþ§þ)áªñ§q+­dþ¬N! 7332 4733673¬þgþQ¸ýí|€þz¯ÏËÓ‘kªBþ_ –“þév? ­ÜÖàÒþÞ >Š<ÿ⢳(! !4#"&=6#53263 .'"32¢þƒþ5¢‡z¤€GN~‹†ZXR¤8ª6zHòþì©þ9!? ,™Œ–V5''5X€4ʸ¸þîûäþMþk‚ʳ74#"63 ##"#! Z ¤”t–­ÓËï„vªNA%˜tÏþ™Gþ4þÛþ°SD9üƒS`õ™Zþ8A ! 53! +532'6&'3Çåþþt»{>@×­¦Ç× º Ä«§`WþÌþ£(;þÌþƘýnl=‡ÎW¶„•dÿ㫟 ! !63&#"32«þ[þ]£\Ÿ©©„xîïû÷ýì4+G£û.§BþaþXƒÿâè³'!26;'"&=4#"63 ! 3 #&ƒ9¤RXZ…Š~NG€Ÿ}¢þ+þªâòy¡¸¸Ê4€X5'(4V––þ`GýÕýËù$þ·©Ÿ>dþÅž%3!!! 733245#";#!3 ¨þí þ^þ[ ¯òîÿV¾š//þÔUQžý¤‚KúþÎþ_¡åïþõ¦ K·¦†+;‚ÿâÊž ! 363 #"32ÊþbþVª‰–´ï`›þì(ýº/ýƒ?ýȬ;þLþ‰þŽ“#%#5265&/%77654&+532ŽQþè þ³î æÀsÖþˆQfV?LED‘OR#\Õ€°þÒxµ¼Ð–sp˜2E ºŒÂš"%-4‡.-ŒUAœdÿ⬳'! 73324'#53256+53274$53¬þaþW(´(ïñq££eg£¢Zþ‚§£·±½þa³””þÙ Ü‚œ€…’m•¥VŠ· =Eˆ‘HqxÿâÀ³'! 3324+53256+53274&53Àþ[þ]ªó÷w··oq·¶düºï­·±¼þaï¸ûHþ ãx—{¿mQÁˆY¢³>E’‡Hqdþàª`27$! 3&'6#"—Fþú¦ þíR‘ᑞߋòìîðTs²_0ýÐþ¢³sÌIÑÏKSþzyd¡dþ¬_! 73325#53$=#%¬þYþ_»'òïݵo#þB®þÚ&=þZ¤âÝþ㤃ZôyôuýÓ?€þôdþ«³%! 733254+53$#$! 727«þ_þZ ´ òìòCM\ŽþW©ÿýÄÝþäAþ^¨ÞâþÝ!Ñýе)‡v„òü°þåþ€Twüdÿâ³'! %!! ! 3#3!"3253!54#"­þYþ^Ÿ þöþa¦£rrrþéþûëöúþëúö6îþšfwwiþ—ïˆþíŠæâíîíïÝdþ9`$!"'!525#"!$!263 #"729þYˆ`þ^øøòþH¦ç]Yí§µ÷ãèò'ý»ˆÇþzŒø“¡þSþeŠ"8ììýÇ®þÅçþ¹Zþ`! %$54#"#'! ! 4'3þþ676Ÿ¿œ bOþËþÊ4`¾Vþ6Ê9¼½¯ª"µý×ÛþS+þ®þáþ\§PþBh$43 32/7! 47$3254&#"Põýøþƒ³œ þ»þ­•þ™´“¨ÂŽ˜²´Hã=þ¾ÞþFew‚“†1(Wþø~ƒªd€þö ºÜÝdÿc¬a54'&#"'67$% #7#"é;;_ƒCƒCˆþί™ ÃâþB|MKOm0Á„¿þTËÇ$þ¼þ©—,nÿì'à 3#3#3#nÍÍòÇÇþÊÊà½Êºø»d\(³2"4;!"4#"32JßäàÆûþìAê{ntv²þÜþÏ2cÂ`L©Ð·½ÃhØ=@ B••ÔÄÄ1/ìôì0KSX@ììììY %##™œýÇåýÆ.ûœdªú+ÕÿÿhK'œÀE¸ÿÿhÕ)ÿÿhO'Àt¸É°Õ@·üìÔì1µB¯/ì990KSX@ííííY s£û³çÂüNÚýÕý‡äÿÿɰO')tºÿÿɰN')uºÿÿɰÕ'Úeºw^Õ?¶ÜìÔì1µB¯/ì990KSX@ííííY 5´ü]£ªûçÂþ(þ&þðxäyÿÿw^O'1t¾ÿÿÉØ'¶5Úÿÿ6Ø'Ú¡¶ÿÿÉÕ&Ú¸5ÿÿ6Õ'Ú¡¸ÿÿÉO'¹5Úÿÿ6O&¹Ú¡ÿÿÉEÕ'º•ÚÿÿÉEÕ'Ú°ºÿÿÉEO'»•ÚÿÿÉEO&»Ú°ÿÿɰO'É0»ÿÿÉóÕ'¾•ÚÿÿwEÕ&¾Ú°ÿÿÉóO'¿•ÚÿÿwEO&¿Ú°ÿÿw^O'?0¿É •Õ3#ÉÌÌÕ̉œçß!38öîýYgg`ýªnCü½^Úå·^nýç7€]ý€^Úå·7ånýçn7]€]‰0­d"&533265453­ŸæŸzWA@XzCs  s!þßAWX@+ö‰!­U#454&#"#462­zX@AWzŸæŸBþßö+@XWAþß!s  ‰0µU!5!2654&#!5!2£þæ@XX@þæsŸŸ0{X@?X{Ÿæ ‰0­U 4&#"32>"&4623X@AWWA@XzŸæŸŸæC?XW@AWX³æ  æŸH>Þ %™‡þãþ'‡þãÎ1üð11üð‰œ¥ß· ]]ÜìÜìÄ1¶÷‘ô<ì203!3ýäœCü½Cü½É~•K3#ÉÌÌK͉­!5!­ýÜ${‰1­V #5#53533ØzÕÕzÕÕÕ{ÕÕ{‰1­‡##5!ØzÕ$ þ%Û{{ÿÿ:Ø'ÓU¶ÿÿÇÕ'Óâ¸ÿÿÉ"Õ'Ó=ºÿÿwqÕ'ÓŒ¾ÿÿhÕ9ÿÿhK'œÀEäÿÿhÕ0ÿÿhO'Àtäw^Õ:µÜ<Ôì1³B¯/ì0KSX@ííííY7 5wMû³çû¶40»ý‡äýˆÿÿw^O')tæÿÿw^N')uæÿÿw^Õ'Ú¶æw^Õ:µÜìÌ21³B¯/ì0KSX@ííííY%5^ûçû³¶¶xäy»ýÐÿÿw^O'1têÿÿÉÕ'â5Úÿÿ6Õ&9Ú¡ÿÿÉÕ'ä5Úÿÿ6Õ&äÚ¡ÿÿÉO'å5Úÿÿ6O&åÚ¡ÿÿÉóÕ'æ•ÚÿÿwEÕ&æÚ°ÿÿÉóO'ç•ÚÿÿwEO&çÚ°ÿÿÉóÕ'ê•ÚÿÿwEÕ&êÚ°ÿÿÉóO'ë•ÚÿÿwEO&ëÚ°ÿÿw^N'1uꉛ ß<´ÜÌ291µB÷‘ôä0KSX@}}}}ííííY5 üéý`sb€bsþщœß³]Üì1´÷‘ôì03‰œCü½ÿÿ²ÿã)Õ8ÿÿ²)K'œðEÿ²)ò*@ 8AüK°TX¹ÿÀ8Yìüì1µ •‘ /<ôì03! #4&#"²!!Ë®Âî¤$*þÖþÜü\‹ðÓÓðüuÿÿ²)O'çtÿw^Õ¶ 2 Ü<ôì1¶• •/ìôì07! )5! )w¾5þáþËþBŸ²–þhþPþa¦.,¦þ—þ€þ~þ–ÿÿw^O'Çtÿÿw^N'Çuÿÿw^Õ'Ú¶y`Õ· 2üìô<1¶ ••/ìôì0%! )! !`þaþPþh–²ŸþBþËþá5¦¦j‚€i¦þéþÔþÒþèÿÿy`O'"tÿÿÉÿã¬Õ&Úýƒÿÿ²ÿã¥Õ'Úýÿÿɬò'ÿƒÚÿÿ²¥ò&ÿÚÿÿɬO'ƒÚÿÿ²¥O&ÚÿÿÉóÕ'•Úÿÿw½Õ'Ú(ÿÿÉóO'•Úÿÿw½O&Ú(ÿÿÉÕ'½Úÿÿy½Õ'Ú(ÿÿÉO'½Úÿÿy½O&Ú(ÿÿðÕ'½r‰œßµ ~ÜìÌ21@ Ý÷ Ý‘ôìôì0# $54$!3#"3nþðþÿnÍ™¾¨ nË××Ên“ ¹{ÿÿ²ÿã•ß'ü|ýÿÿ²•ò'ü|ÿÿÿw}ß'üdÿÿy¯ß'ü–F>ò %@ üìÜì21@ • •‘/ôìÜ9î0"32654&"$54$32#Bz­È_€²ÌÌ€²ëþï#ÙìÊR¤—¨”©“¤—ý3IðìúáðìûêÿÿÉÁK'œÀEÉÁò %@  üì2Üì1@ • •‘/ôìÜ9î0"32654&#4$32#&Åf̲€_È­þTÊìÙ#þïë²R—¤“©”¨—¤ý3ý{ìðáúìðÿÿÉÁO'ÀtFÿã>Õ (@  üìÜì21@ • •Œ‘ìôîÔ9ì0%2654&#"3#"$54$3Bf̲€_È­¬ÊþðìÙþÝ벃—¤“©”¨—¤Í…ûêìðáúìðÿÿFÿã>O'ÓtÿÿFÿãüN'ÓuÉÿãÁÕ (@  üì2Üì1@ • •Œ‘ìôîÔ9ì0%2654&#"672#"$53Åz­È_€²ÌÌ€²ëþÝÙìþðʃ¤—¨”©“¤—ÍIðìúáðìÿÿÉÿãÁO'5t"ÿÿÉò'ÚÚÿÿF³ò'ÚÿÿÉ?ò'~ÚÿÿÉò'Ú|ÿÿÉ?O&Ú~ÿÿÉO&Ú|ÿÿÉÿãÕ'ÚÚÿÿFÿã³Õ&ÚÿÿÉÿãO' ÚÚÿÿFÿã³O& ÚÿÿÉÿã?Õ'"~ÚÿÿÉÿãÕ&"Ú|ÿÿÉÿã?O'#~ÚÿÿÉÿãO&#Ú|ÿÿðÿã?Õ&r"~‰‹ ß $·~ ]Üì2Ôì1@ ÝÝ÷‘ôôüÔì02654&#"632#"&53ÉXP^J\TaaQ_”¬·‰•«ùVFTHUGQK})†„Œ~†„J8‹¸ß 2654&#"03#"&54632xOaT\J^P«•‰·¬”_ùKQGUHTFV}iý¶„†~Œ„†ÿÿF‘ò'üxÿÿÉÃò'üªÿÿFÿã‘ß'üxÿÿÉÿãÃß'üª"F>ò¶ ÜìÜì1µ •‘/ôìÌ0#4$32#4&#"Ê#ÙìÊÌf€²úáðìûꤗ©ÿÿÉÁK'œÀE;ÉÁò· üìÜì1µ• ‘/ôìÌ04&#"#4$32÷²€fÌÊìÙ#’©—¤ûéìðáúÿÿÉÁO'Àt;Fÿã>Õ¶ ÜìÜì1·• Œ‘äôîÌ032653#"$5²€fÌÊþðìÙþݾ’©—¤ûêìðáúÿÿFÿã>O'Ót=ÿÿFÿãüN'Óu=ÉÿãÁÕ· üìÜì1· •Œ‘äôîÌ03#"$53326÷ÊþÝÙìþðÊÌf€²¾úáðìû餗©ÿÿÉÿãÁO'5t@ÿÿÉò'9ÚÚÿÿF³ò&9ÚÿÿÉ?ò';~ÚÿÿÉò&;Ú|ÿÿÉ?O'<~ÚÿÿÉO&<Ú|ÿÿÉÿãÕ'=ÚÚÿÿFÿã³Õ&=ÚÿÿÉÿãO'>ÚÚÿÿFÿã³O&>ÚÿÿÉÿã?Õ'@~ÚÿÿÉÿãÕ&@Ú|ÿÿÉÿã?O'A~ÚÿÿÉÿãO&AÚ|ÿÿðÿã?Õ&r@~‰‹ ß¶] ]ÜìÔì1· Ý÷‘ôôüÌ03#"&53326y·‰•«aO\T•Œ~†„Jý¶PML‰‹ ß32653#"&5T\Oa«•‰·•QLMPJý¶„†~ŒwÕµ:Üüì1´•/ôì0!#!5!Êý)¡+ªÿÿÉjK'œ©EUÉjÕ@ •:üìì1/ôì03!!É¡ý)ÕªúÕÿÿÉjO'©tUwÕµ:Üüì1´•/äì0!5!ü_×Õú+ª+ÿÿwO'³tWÿÿwÜN'³uWÿÿÉjÕ/ÿÿÉjO'5tZÿÿÉ5Õ&ÚSÿÿw¯Õ'ÚSÿÿÉíÕ&ÚUƒÿÿÉ¥Õ'ÚUÿÿÉíO'VƒÚÿÿÉ¥O&VÚÿÿÉ5Õ'WÚÿÿw¯Õ&WÚÿÿÉ6O'XÚÿÿw¯O&XÚÿÿÉíÕ'ZƒÚÿÿÉ¥Õ&ZÚÿÿÉíO'[ƒÚÿÿÉ¥O&[ÚÿÿðíÕ&rZƒ‰œ¥ß´]ÜìÌ1¶Ý÷‘ôôì0!!3Œýä nC‰œ ßµ ~ÜìÌ21@ Ý÷ Ý‘ôìôì0! $54$)!"3 þúþðþÿþçÍ™¾¨ nË××Ên“ ¹{‰œ¥ß3!5ýä Õü½nwÿãŠ} (@  ÜÔìÔ9ì1@ •Œ• Ôì2ôî0"32654&'2#"$547!5œ‹È__ȘúþïìëþïLýšÓ¦n¨””¨ƒ‘ªáÝìððìªjªÿÿFÿãY 'œiÿpFÿãY} )@  üÄìÔ9ì1@ •Œ• Ôì2ôî0"32654&'!!#"$54$C™È`^È‹›ý™MþïëìþïÓ‘ƒ¨””¨n¦ªªjªìððìÝáÿÿ ÿã'iÿ<pÅwŠš "@  ÜÔìÔ9ì1¶•• /ì2Ôì0%2654&#"!5!&54$32˜È__È‹œûêfLëìþýª‘ƒ¨””¨n¦ªªjªìððìÝáÿÿwŠ'ªÿ<rÿÿwŠ'ªÿ<rFYš #@  üÄìÔ9ì1¶•• /ì2Ôì0%2654&#""$54$32!C›‹È^`È™úþýìëMgª¦n¨””¨ƒ‘ªáÝìððìªjªÿÿFY'Tÿ<uÿÿÉÿãH}'n¾ÚÿÿwÿãÐ}'Ú;nÿÿÉ3š'uÚÚÿÿFYš'ÚyuÿÿÉ3'vÚÚÿÿFY&vÚyÿÿFY'Tÿ<u‰ß\ä 2654&#""&546 !Éj>_IEcI_£¬(¬0ƒMJBSKFXCIn~|„‡‡„Q;n‰‹.ß"&5332653ܨ«abaa«‹†„Jý¶PMMPJý¶„†‰ß\ä 2654&#"0!5!&546 _IcEI_>jýmƒ0¬(¬£MICXFKSBJnn;Q„‡‡„|~wŠšµ ÜÔìÌ1µ• •/ìÔì0%2654&#!5!2#bŘûêúþï쥒¥ƒ‘ªáÝìðÿÿFY 'œ¤ÿƒFYš¶ üÄìÌ1µ ••/ìÔì0%"$54$3!!"Cìþïúûê™Æ¥¥ðìÝ᪑ƒ¥’ÿÿFY'¤ÿ<ƒwŠšµ  ÜÔìÌ1µ• •/ìÔì052#!5!2654&ìþýúûê˜Åõ¥ðìÝ᪑ƒ¥’ÿÿwŠ'ªÿ<…ÿÿwŠ'ªÿ<…FYš¶ üÄìÌ1µ•• /ìÔì0"3!!"$54$3CbÆ™ûêúþýìõ’¥ƒ‘ªáÝìðÿÿFY'¤ÿ<ˆÿÿÉHš'¾ÚÿÿwК&Ú;ÿÿÉ3š'ƒÚÚÿÿFÆš&ƒÚ1ÿÿÉ3'„ÚÚÿÿFÆ&„Ú1ÿÿÉHš'…¾ÚÿÿwК&…Ú;ÿÿÉH'†¾ÚÿÿwÐ&†Ú;ÿÿÉ3š'ˆÚÚÿÿFÆš&ˆÚ1ÿÿÉ3'‰ÚÚÿÿFÆ&‰Ú1‰ß\ä"3!!"&5463ÜRiPY’ýnž£¬§vDZHCn~ƒ}‡w^Õ %5-5 ^ûjü–çüìü¶¶2äÔÕä2»éì¸éF Õ ·? Üìüì1µ• /ôÔì0!3#$53TCcÊþúþ ʨþ™þ½ýXonÿÿÉ2K'œ EœÉÕ @ ? üìüì1µ •/ôÔì053#3 ÃÊþ þúÊcCT¨-nþcþ‘ý¨þCÿÿÉO' tœF Õ · ? Üìüì1µ •/äÔì0%#5%3# ÊôÊcþ½þ¬--noXýþ½ÿÿF O'£tžÿÿFÌN'£užÉÕ @  ? üìüì1µ• /äÔì0%!#3#Ãþ¬þ½cÊôÊ-gCþý¨þ‘þcnÿÿÉO'3t¡ÿÿÉäÕ'šÚÚÿÿF‘Õ'ÚüšÿÿÉÕ'œƒÚÿÿÉ´Õ'ÚœÿÿÉO'ƒÚÿÿÉ´O&ÚÿÿÉäÕ'žÚÚÿÿF‘Õ&žÚüÿÿÉäO'ŸÚÚÿÿF‘O&ŸÚüÿÿÉÕ'¡ƒÚÿÿÉ´Õ&¡ÚÿÿÉO'¢ƒÚÿÿÉ´O&¢ÚÿÿðÕ&r¡ƒ‰œèß ¶ ] ] ÜìÔì1·Ý ÷‘ ôôÜì04&+3#X¸ÏHãìÆÇœ¶þ¹å¬V‰‹ìî+.#"#"&'532654'&/&'&54632¸Cw7Bh#-8GC>©¤=‹JG‰BAm'./G?;¢=~ÇH)@@V\`RʺªÒV\`RʺªÒ¾ÓhZáþç·%XÓhZá·þÛFÿãlò632#4&#"#"&3326tҪºÊR`\VҪºÊR`\V¾X%·ÂþçáZhÓý¨þÛ·ÂáZhÿÿFÿãlO'ót¶FÿãÜ·'32654 !"/.#"3"54!2ú!„rz|K«È£þÙ¬×42 „swU¡ùÒ¤'­Ö4°X˧|`å¥þí•þÈ~pX˧|`å¥J š3þç~ÿÿFÿãÜ'‹ÿ<¸FÿãÜ·'763 #52654&#"# '4!"326(24׬'£Òù¡Uv€r„!24Ö­þ٣ȫK|zs„°p~þÈ•¦þ¼¥å`|§ËXp~þç8•­=¥å`|§ËÿÿFÿãÜ'‹ÿ<ºÿÿÉÿãò&Úµ•ÿÿFÿãƒò&µÚîÿÿÉÿãò'¶•ÚÿÿFÿãƒò&¶ÚîÿÿÉÿãO'·•ÚÿÿFÿãƒO&·ÚîÿÿÉÿãÙ·'¸ýÚÿÿFÿãU·'ÚÀ¸ÿÿÉÿãÙ'¹ýÚÿÿFÿãU&¹ÚÀÿÿÉÿãÙ·'ºýÚÿÿFÿãU·&ºÚÀÿÿÉÿãÙ'»ýÚÿÿFÿãU&»ÚÀ‰Ï¯æ'>72#52654&#"#"&'463"326[*'so¾b„I=J>",BˆþRðÓÓð‹ü\þÜþÖ*$²j¥t_UV²ÿã)ò '2654&"#"'&54632! 33265ð,B:d:B–0<~JI§jŠ­þßþåþæþßË®Âî€B,">>",BˆVU_t¥jýNþÜþÖ*$¤üuðÓÓð²ÿã)ò '"2654&'632#"&5! #4&#"ë,B:d:B–0<~JI§jŠ­!!Ë®ÂîUB,">>",BˆVU_t¥j²$*þÖþÜü\‹ðÓÓð²ÿã)ò '"2654&74&#"#! #"&547632ð(B:d:BB®Ã®Ë!!­Šj§IJ~<UB,">>",Bˆ®ðÓÓðüu¤$*þÖþÜýNj¥t_UVÿÿ²ÿã)O'çtÿÿ²ÿã)O'çtS^Õ$264&"&546; )5! '&óVšþhþÞÌf€²Ê#Ùì¾ fýœ¤—©’úáðìw_ò:@ ÜÜ9ìÜì1@ B •‘/Ìô9ìÌ0KSX·ííY%4$32#4&#"!7gìÙ#ʲ€fÌþÞþhš¾Xìðáú’©—¤ûédfFÿã.Õ=@ ÜìÜì1@ B •Œ‘ä9ôîÌÌ0KSX·ííY#"$533265!>þðìÙþÝʲ€fÌ"˜šü¨ìðáú’©—¤ýœfwÿã_Õ?@  ÜÜ9ìÜì1@ B •Œ‘ä9ôîÌÌ0KSX·ííY '!32653#"$5gþªš˜"Ìf€²ÊþÝÙìþðýôfdû餗©’úáðìÿÿ‰ ÍK': +ÿÿ‰ Íò'; +ÿÿ‰ ÍO'< +ÿÿ‰ÿã;ä'=ý+ÿÿ‰ÿã;O'>ý+ÿÿ‰ÿã Íä'@ +ÿÿ‰ÿã ÍO'A +‰¨(ä (2654&""&546323326=3#"&=ÉbFntnPX”¬¬”•«/¹Q,CE«ma¬ZT:KMMKFHn…|p‡‡pX;§oBGj§§„‡ˆƒ9‰¨$ä 3>2654&"!&546323326=3#"&=!"&54632!2654&"ÉbFntnP?+¬”•«/¹Q,CE«ma¬ûÊ”¬¬”•«/ëbFntnPZT:KMMKFH;Xp‡‡pX;§oBGj§§„‡ˆƒ9…|p‡‡pX;T:KMMKFHFY‰<@   üÄìÌÌ91·B•• /ìÔìÌ0KSX@ ííY!"3"$54$3!7Yûê™ÆbìþïúXýòhòþþ‘ƒ¥’¥ðìÝáUšÿÿFY‰'¤ÿ<-wþŠš8·  Ì9ÜÔìÌ1·B• •/ÌìÔì0KSX@ ííY!26544#!w™Æbìþýúü¨ gX‘ƒ¥’¥ðìÝáþ«šÿÿwþŠ'\ÿ</FþYš:@  üÌìÔÌ91·B • •/ÌìÔì0KSX@ ííY'!"$54$3"3!Yýœhü¨úþýìbÆ™XþišUáÝì𥒥ƒ‘ÿÿFþY'iÿ<1‰µ\ä'%!"&5463"3!\þ±=.ýÌž£¬§RiPY’¬÷Bè~ƒ}‡nDZHCwÕ%#535!53!3##qÉÉý=ÊýÃúÉÉÊà¤Ô­Ðý-þ‚¤à!®Õ%#5#53!3!3´ÊÉÉúýÃÊ=ýÉààà¤~Óý0­Ô¤ÿÿ!®O't5wÕ533#!#5!5#5qÊÉÉý=ÊýÃúÉõàà¤þ‚ý-ЭԤÿÿwO'Út7!®Õ3#!#!#5353´ÉÉúýÃÊ=ýÉÉÊõ¤Ô­ý0Ó~¤àÿÿ!®O'Vt9 ›èß33#!#!5#53‰Ïþ¥‘mþ ßunfyþ~ÔnÉÿãÁÕ ,@  üì22Üì1@ • •Œ‘/ìôîÔ99ì0%2654&#"672#"'"#3Åz­È_€²ÌÌ€²ëþÝÙ·{O{ʃ¤—¨”©“¤—ÍIðìúáH+ÕÿÿɰÕ'sZÕ@  2üìôì1¶• • /ìôì0# !3! !ôþËþá5ôÊþaþPþh–²/þéþÔþÒþè/ú+j‚€i‰œNß !!!5!—©ýùý;þßVýnV‰ìN#5!5!5!53!!75$iþÎ2þÜ$iþä*þÖmÖ‚œ°°Vxn°°Vþ¢þßnÕ††ý™  u!s #'#37ÿ ‰Í͉û‰»»sþÏþ¾ööH+ßßÿÿ‰—ò'Yôÿÿ‰ ±ò&+9sÿÿ‰ Éò&,;ÿÿ‰ ÉO&,<ÿÿ‰ÿã 7ä&,=ùÿÿ‰ÿã 7O&,>ùÿÿ‰ÿã Éä&,@ÿÿ‰ÿã ÉO&,Aÿì÷åŸ!!ùüŸ¨ÿìÿŸ!!#!þYÊþXŸ¨ý öÿìÿÆŸ !!###!ÚþYÊ÷ÊþXŸ¨ý öý öÿìÿ‡Ÿ!!#####!›þYÊ÷Ê÷ÊþXŸ¨ý öý öý öÿìÿ HŸ!!#######! \þYÊ÷Ê÷Ê÷ÊþXŸ¨ý öý öý öý öÿìÿ Ÿ!!#########! þYÊ÷Ê÷Ê÷Ê÷ÊþXŸ¨ý öý öý öý öý öÿì÷”!3!!¨Ê§ûçŸõý ¨ÿì÷Æ” !333!!¨Ê÷ʧú&Ÿõý õý ¨ÿì÷‡”!33333!!¨Ê÷Ê÷ʧøeŸõý õý õý ¨ÿì÷ G”!3333333!!¨Ê÷Ê÷Ê÷ʦö¥Ÿõý õý õý õý ¨ÿì÷ ”!333333333!!¨Ê÷Ê÷Ê÷Ê÷ʧôãŸõý õý õý õý õý ¨ÿìÿ” !3!!#!ÂêÕêþ?êÕêþrŸõý ¨ý öÿìÿÓ”!333!!###!ÂêÕêîêÕêþ?êÕêîêÕêþrŸõý õý ¨ý öý öÿìÿ–”!33333!!#####!ÂêÕêîêÕêîêÕêþ?êÕêîêÕêîêÕêþrŸõý õý õý ¨ý öý öý öÿìÿ Y”#!3333333!!#######!ÂêÕêîêÕêîêÕêîêÕêþ?êÕêîêÕêîêÕêîêÕêþrŸõý õý õý õý ¨ý öý öý öý öÿìÿ ”+!333333333!!#########!ÂêÕêîêÕêîêÕêîêÕêîêÕêþ?êÕêîêÕêîêÕêîêÕêîêÕêþrŸõý õý õý õý õý ¨ý öý öý öý öý öÿìSC !3!!#!¨Ê§þYÊþXŸ¤þ\¨þ\¤ÿìSÆC!333!!###!¨ÊöʨþXÊöÊþXŸ¤þ\¤þ\¨þ\¤þ\¤ÿìS„C!33333!!#####!¨ÊöÊøÊ¤þ\ÊøÊöÊþXŸ¤þ\¤þ\¤þ\¨þ\¤þ\¤þ\¤ÿìS FC#!3333333!!#######!¨ÊöÊøÊöʦþZÊöÊøÊöÊþXŸ¤þ\¤þ\¤þ\¤þ\¨þ\¤þ\¤þ\¤þ\¤ÿìS C+!333333333!!#########!¨ÊöÊøÊöÊøÊ§þYÊøÊöÊøÊöÊþXŸ¤þ\¤þ\¤þ\¤þ\¤þ\¨þ\¤þ\¤þ\¤þ\¤þ\¤ÿìÿ”!33!!# #!êÕššÕêþrêÕ™™ÕêþrŸõþòý ¨ý ïþöÿìÿ”%!3!!#!!2ÐÑü^DéD^þ£þ»éþ»þ£ÏŸ÷þæ¨õý ¨ý öþÿìÿWcŸ !!!5!5!!!wûûùþÑùüsþXŸ¨þ¨¨þ ÿìþ ·Ÿ#5!! !!'!%'! !7%!77'7! Ëþºýô þúþwƒþúƒƒþúƒþwþú ýô‰ƒþúƒƒþúƒƒƒƒƒ‰þú÷¨¨þþu|ù||ù|þ‹ññþ‹|ù||þ|||||u ÿì÷ G7+/37;?CGKO!5#535#535#53533533533533#3#3#!!#3%#3%#3#3%#3%#3#3%#3%#3¨ÊÊÊÊÊÊÊ÷Ê÷Ê÷ÊÊÊÊÊÊʦö¥ë÷÷þ?÷÷þ?÷÷‚÷÷þ?÷÷þ?÷÷‚÷÷þ?÷÷þ?÷÷Ÿ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨𨨨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ÿì§‹Ÿ!!!!¶øüÊŸúaO¨ø¨q:#[!' 7#þ}þCrŸþar¼Ÿ¨þCrŸžrþDÿì:ž[! !„¼rþaŸrþCþ}Ÿ¼rþbþar½=` !#!#3!ÃfþfäúþÀÀþí`ýG [`3!!!!!!!! Ùjýöóþ ý/þ¾tšè`”þÓ”þˆ“þíÍýÚ&{ÿão{4=J%#"'&=!.#"5>32>32#!3267#"'&32767%2654'&#"JÔ„â„„N Ì·hddddÐj§||MIؽii~ûþþST—`¶Te__ZŽjkü÷SR‰™\]i߬A@o™\]›Z^‘’úZ¿È5®*,=>` #% 54)3#4+327#!5#53!2xþþþúÜÜÞìòòì¹ÖŒçÖþ9||¶ÅÔ™µ´f¤_‘þڪИr–¤ø¤Äÿÿqÿãç{Fºg`32654&#%! )sÙËËÙþº7F0þÎþ¼þÉÍüÇÇÖÕÇ“þñþàþßþð$g` ! )#53!#32654&+º7F0þÎþ¼þÉ––zÁÙËËÙ`þñþàþßþðõ¤¤þŸÇÖÕÇþ̺‹` !!!!!!ºÄýöóþ ý/`”þÓ”þˆ“‚ÿãÅ|1#"&'5327654'&+5327654'&#"567632¿p<54& #.54! ì++ãþfã++ª$$>:#tNP³ÆÆ³PNM¥]ý*þÓþúU¢3MY + 3267>54&#"'>3 '# 5467'7²ý°*(èÈOuš))ëÓHn.—MÅw834¨O³MÆxþíþÇ43¨Nç)gA“¬\*g>—©}66þïñ]ŸC‹_’56ð`¡?‹`qÿãÃ{&/=5!&'&#"5>3267632#"'&'#"'&732767276'&#"qN ff·jÈbdÐj òQGhiŒñˆ‰‰ˆñŒijBNèâ„„¹RR‰™\]”VVUV•“¬VVZ¾dc44®*,nmn67œþíþ윜78lkp‘’ĘZYWWžþ´st’tsèÈÇtuq/u{ 4&#"#32²¬“”¬Âñð/ÇéçÉ8þÈþìqÿãu/ 32653#"4¬“”¬Âþïñðþî/ÇéçÉþìþÈ8—Ì`!264&#%!2#!#N[cc[þH¸¼ÁÁ¼þÿ·Åþ˜^¬^›ªþ¶ªþ>2`!.54763!##"#676#";µjpklÙ„¹©a;;?¢Ã®545ØÆw?@@?wÆ Œi¢QPû Ù%$qþá2^66É**TS++2`!&'&'3;3!"'&546#"3µ7545®Ã¢?;;a©¹þ|Ùlkp Æw?@@?wS66^2þáq$%Ùû PQ¢iŒþcQ++ST**ÿÿ<m`Öºÿà`$ 653 &53æs¹ÙþXÙ¹}Ž¢³ý;ÛààÛÅýM¢®L+ö%!5!2654&#!5!#TýZŸŸŸ¾¤ý…`¬fcðL¸||–¬¸¸B²tÂÈ®NÛø5353!5!2654&#!5!#®ÊÊÊŒýZŸŸŸ¾¤ý…`¬fcðxÌÌþzÊʤ¸||”®¸¸D°vÀÈ/þª{&#!5!2654&#!5!27654'&#!5!#¸|vz{âý\ž¡œ¾¤ý‡ž¢MN`_£ý‡`®gb>> EÀ‚¯__¹ru¦¹99wSS¹¹?°yzVUÿÿ=`YÿÿV5`ZÿÿXÛ`]xÿãº`73264&+5%5!2 'СӀ„{n ýÔþöF—oäþ}ɽBd»d>““þÂJŸm ¶7³ü{3!!³Iý{ªü/ÿÿ=`N—ì`#!#ì¶þ¶`û ·üI`ÿÿ—Ì`~Z^`367653#5&'&3¸U9Vˆm±¸¯mŠÄV9S`ý1MsÉ,þÔþìœ}îî}œ,þÔÇuMÿÿLs`Ï œhà !3#'!#¹­Zõg„VþXV†qþ`ü¼ÖÖœ–à!!!!!5!#!Šþ.¿þAÞý¢þ³eŠWÐ"à_ø_þÑ_ÖÖDXþI·œà &327654'&#327654'&#%!2#!þÌg1221g̼^-..-^þÅE‘OO)(N^h¬žþ¯+þÎ&&MO%%Xü@? ]65dL.- rUpzœ•à 327654'&#%! )þšÂ[ZZ[Âþ瀀þðþûƒývNO©¨NN]eeרfeœÝà !!!!!!Rþ-Àþ@ßý¢à_ø_þÑ_Sœ±à !5!!5!5!5±ý¢Þþ@Àþ-àü¼_/_ø_HŒ~ï$5#5!#"'&547632&'&#"326ÐNJYXeÝ|}}|Ý\SRFFPOW­WVVW­Cjá]þ™/rsÌÍsr'y5UVª©VUœLà 3!3#!#΀€þ2àþ©Wü¼Žþrœþà3#àü¼ÿ½¶þà 3+53265A@1(TFàüö—DE`Tlœià 33 ##¦¤þ-ô§þ<àþŸaþzþB“þmœÈà3!!Êý·àý_œÛà 33###½ðò½|ò€ó{àýÇ9ü¼ÞýÃ=ý"œGà 33##«¡|¬þ_{àýE»ü¼»ýEœGà ##3G|þ_«{¡àü¼»ýEDýE»HŒ¯ï"327654'&$  '&üŠRQQRŠ‹QQQQþ¯Œwvvwþtww“[\Ÿž\[[\žŸ\[\vvÆÅvvuvŒGŒ>ï@"327654'&327654'&'52#"&54767&'&54763ÂsCDDCstDCCBšR65<%€j<=0ER^X65`l<=ca¸·Ä==ll*6RI¢)++LK,++,KL++5##,&)$%LY+8:6iG2278PyAA‚yP87'21I.*œÞà 32764'&#%!2+#þ Y0110YþážQQQQž ƒþÆ))–))]?@ö@?þ°œ[à #'&'&+#!232654&#=)&''ˆy.,,LŠ¡PO)*þs \^^\$ )(GäÖTþŸD<32#"&'#3t45¸5445¸5þª$pMPPPPMp$uucä@AA@ä@AA86Z[þØ[Z68^gGŒ¾3#5#"'&76322764'&"Jtt%78N€PQQP€N87þš45¸5555¸5°Sü™^8Z[([Z¡ä@AA@ä@AAGŒÕ#!32767#"'&547632&'&#"Õýë@AsC?>>>BAD©bc^]ŸŽSSt44Va:: ï2j88a WW•š[ZQRmT3210XGŒÕMK° SX@ ÔÌÄÔÌ2K°SK°QZK°T[X½ÿÀÿÀÿÀ888Y1@   ÔÌ/ÌÔÌÔÌ0Y5!.#"5>32#"&73267G‚sC}>?ƒC©Å»ŸŽ¦thVau»2koa®•šµ£mTebXTŒb2&'&547632.#";#"32767#"&5476ùG&%HG{065>=f,K,,+*Ib]W-155_;65-9553–¢+,î$$4O,, ^$'U13 `fa<))RŒ`1#"'&'532654'&+5327654'&#"5>32»FLHG{065>=23-KX+*Ib]V.156_:65-9j2–RQ,+¼ H4O-+]4$'U 12  `33a<))G­¾ 14'&#"327#"'&'53276=#"'&763253J44^]4444]^4¨PP¥=7633223r99$88N‚OPPO‚N88$tmà=>>=à=>>F NO e 45k37XX"XX7_z¨î3#53ztttýô‚‚uœç 33 ##uuZ”þ‰†—þšuýþþÛþ²2þÎuœ{"4@ $ #ÔÜ32>32#4&#"²tHKYhuu'oMLl+yRowtHJZiþþžw[Wk\þžsa97EBEB‰~þ…wZXku­Ä4@ ÔÜþzx66X6V‚YYk\þžsa8BDGŒÏ 6@ ÔÌÔÌK°SK°QZK°T[X»ÿÀ ÿÀ88Y1@ ÔÌ/Ì0"32654&'2#"&546‹]ml^]ll]—­­—˜¬¬Çqq‚poƒW®›š¯¯š›®GŒu 67632#"'&'532764'&#"G0336¥^_]^ :5311213p?>>?p3121÷ XX™—YY _ ?@æ@? GÕÏ4'&"#46320T66º67z¬˜—WVÕoBAA@q›®WW›GŒÏÕ27653#"'&50Â66º67z¬˜—VWÕoBAA@q›®WW›u­ì#3>32#"&$4'&"27êuu$pMPPPPMpf45¸5445¸5úþ³b_86Z[þØ[Z6¡ä@AA@ä@AA#œÛÁ3#;#"'&5#535ìïï0Hww†33UUÁ²Pþ¬M,V-,vTP²nŒ½3327653#5#"&nt''N^67tt+78Jy~”{þˆY,-65\cý`9†nÇAÔ!5!27654'&#!5!#þU¦e22<KLÇg#"FS10gg%dAl88u{(#"&53327653327653#5#"&Q+<=Rnxu$$IZ54t$$KY45tt(78LMlE!"Šzþ‰[+,64\cþ‰[+,66Zcýb;F&œÕ33#&{ÝÜ{þøžýòýy­Û #! !&'3254554#"ít n°þÏ…9F}µþÛæ”¥Ãþê^Ø™83•þö¸a°ž _·{¯­Õ3#5&+532ã›Ü{þãt¹<,|­þ|æýïïÔGXGŒÏï+&#" '&54767&54!232654'&'&yA– §‚JZVWþÒVWW!/b‹LþÌ+"766^]l9=P(r(B4?Kœ”WXXWšr]$,O˜'þø(@ä?A‚jp69G­  )"27654'&'2##5"'&5476734 )=;67-!XQVVQs~SVV@h)%661F¼Qþ:5}t?3XJO¥˜ZUâáUXš R=\ ,Ajq@:©%­Ä'#&+53;'&Í^Á‰sa,£(^Á‰þïra,£×þƼGX]×:þDþøFYÿÿzîg Nýdÿÿu‚uýdÿÿnÿð½s»ýdÿÿ&Õs¾ýdÿÿyÿÛo¿ýdÿÿÿÕsÀýdyÿï‚67632#"&'#44&#"326²&_%s€  €No%tþi\[jj[\i92µþض78þ³"{q‚‚qrÿÿGÿ xÂýdÿÿ%ÿÄtÃýdºþV£{(!2.#">32#"&'#32654&#"ºþa¬QQžRµ´9²|ÎüüÎ|²9¸¸¥•”¥¥”•¥F³,*½¿[cbþÆþýþüþÆbcª#ÈÜÜÈÇÜÜÿÿœLà—t„`5!#3#3!53#53t¨¨¨¨ýð°°°¼¤¤þ¬¤þत ¤T2þV${"+%##533>323##"&!3276!&'&#"s¹ˆˆ¹:±{Ë€f… t€Ë{±7ýJT’’TJýf>T’’T>¨ý®®̪da¢‚Ãê•¢aÀ®fttf>„VttV‘þV/%+53276'7#3/¤´F0j&*¸¸š®ÖÀœ06”ú†GŒ¾#367632#"'&$4'&"27»tt%87N€PQQP€N78f54¸5555¸4ú_s^8Z[þØ[Z¡äA@@AäA@@GŒu&'&#"32767#"&54632u1122q>??>q22110h;Ÿ¼¾¥533÷` @?æ?@ _²—™° GKu+325&#"47&'&54632&'&#"632#"Z%0\R@5`$^¾¥4412/412q>??5{¼Ò3î *š &;/Z–™° ` ?@æ@bŠiGŒÏ.&'&#"32654'&7#"&54632''7'37 i:;n\[nO$$ZY‘’²®‹ dɱrPѺœ =67TŒb1#"'&'5327654'&+532654'&#"5>32½N+,QR–2658-56:_651.V]aIV-+K-32==l/|GHLî ))¿¿unn77wU:8PýÝ#P,i/0ÿé­\+53276=#5333î43r,Brrtnœ x66XU P#ýÝPG­¾ ,5#"3276#"'&'53276=#"'&54763JÆ]4444]^44tPP¥=7633223r99$88N‚OPPO‚Ýë>=à=>>=¢ýÛ NO e 45k37XX‘‚XXn­½3327653##"&nt''N^67tt+87Jy~”{þˆY,-65\cüžO9†Iœ– 5333##53#Irtggttt™\þæ\ýýj‚zœ~ ;#"&5îC,rfþpUWlwIœ– 5!#3!53IMjjþ³o³\\þE\\»Iœ–5!#3#3!535#535IMjjjjþ³ooo³\\¾\¡\\¡\¾ÿV­`3#"54;33#'#"3276ztte¿ªztry "3rKNB ‚ü,|ssýW?#5˜$ z­~3;#"&5ztC,rfäüáSVXlx[­`+53276'7#3`34r,Bttòax66XS güïqœƒ3!!q“ýîýÝ_u­{467632+53265&7454&#"#4'&#"#367632Ÿ+=32#4'&#"î43r,B0t*pJz>?t'(N^66‘x66X6V~a88BDþ…wY,-56\u­U 4'&#"#367632;#"'&5P''N^66uu)89Jy?>0B,r34Y,-56\þžsa8BDþzV6X66xqœÄ 33##q«-{«þÓ{þùý~úþGŒÏ 2#"'&5476"!&'!3276‹—WVVW—˜UWWUõº6/‘/1þw &6^]6&WW›šWXXWš›WWW@9\[8ïE-AA.G®Ï&.#5!#3!535&'&5476767654'&O—¢—pFVVFp—þ^—nCWWCnt6%66%ª4#76$§\\ŒFW›šWG…\\†FWš›WE[þ*,ApoA-þ9Ô*Aâ@+F­a:.#"#"/;#"'&=32654'&/.547632;1j8W*,]({44MNˆ9> 0B“ r34@?>=RX l)k`GF‚@rýb/$+*MW33 V6X66x"j2-*TIX00ÿé­Ê476;#"+5326z73zno>43r,B0‘]Me30U:ýJx66X6#­ÛÁ3#;+5326=#"'&5#535ìïï0Hw43r,B0†33UUÁ²Pþ¬M,ax66X6V -,vTP²^Œ!533!33##5#"&=)3276^ntgtuut+87Jy~Úþš''N^61™\þæþæ\ý`9†‚Y,-6/G‹Ø&5!327654'&'5!# '&54767GE()78Z[78*,?”G$"ZYþäYZ!"J³\{':?KY7667YR8>#{\8?>LƒRRQR€R<=:uŠ’2653#"'&53„QHuDE…†EDuHâPZƒþs{>??>{þ}ZPzœ¿3+"&53?27654'&'&gËH#"YZŽ,rftA Z87)2:0Ä8?>LƒRRlwþpU67YQ8C&œÕ# #3Õ{ÜÝ{ žœýòs7œn !!!5!G'þL´ýÉ´þ\^þ=R^Ã7­ý!!#;#"&=!5!G'þL´C,rfþ>´þ\^þ=R VXlx ^Ã7^n#47#5!5!3632#'3254#|`å´þ\'þLn&ŠÒ m,7œ!!^ÃR^þ=¢ŠjR37¨£!2#"'&'5327654'&+5!5!hCQ>63``°;??C5~Ex>?::hnþ\&§ =;M|CD m**PJ*)]R^GÏ !32767&'&"2#"&76Sþo/6^]6/ +6º6,Ç—WVVW—˜¬VV*€MWXMÞmGYXFoƒvwþ^wwî¢wvü[îÿ¥f!5!73þ°ý«¨‹î”äü[îÿ¥f3!ýPõ‹¨îxä”ü[îÿ¥f#'!5þ°õ‹¨ýéfþˆä”ü[îÿ¥f!!#ýPUý騋f”äüBîÿ¾f 3#'#3þ5”õ‹´´”õ‹´fþˆõõxõüBîÿ¾f 73#'#ýË´´‹õ”´´‹õfõõþˆõõxÿÿþhÕ'Ö¼$ÿÿ{þ-{'ÖTDÿÿÉìP'¼u%ÿÿ¸ÿã¤R'¸>EÿÿÉþ‰ìÕ&%Ô¥ÿÿºþ‰¤&EÔšÿÿÉþÀìÕ&%—ÿÿºþÀ¤&Eÿÿsþu'l'Lv‰ÿÿqþuçf&©vCÿÿɰP'ìu'ÿÿqÿãZ‰'¸þuGÿÿÉþаÕ'Ôì'ÿÿqþŠZ'ÔfGÿÿÉþÁ°Õ'âì'ÿÿqþÁZ'âfGÿÿÉþw°Õ&'z[ÿÿqþuZ&GzöÿÿÉþ°Õ'Þì'ÿÿqþZ'ÞfGÿÿÉ‹Z&(Oîÿÿqÿã^'OÿÙÿHÿÿÉ‹Z&(Nìÿÿqÿã^&HNÿ×ÿÿÿÉþK‹Õ&(Þ±7ÿÿqþK{&HÞ°7ÿÿÉþv‹Õ&(°³ÿÿqþv{&H°›ÿÿÉþu‹m'¡u&(z¾ÿÿqþuH&H'š‡zKÿÿÉ#O'vt)ÿÿ/ø‰'¸àuIÿÿsÿã‹&*‹2"ÿÿqþVZö&J‹IÿÿÉ;N's+ÿÿ¸dR'¸>KÿÿÉþ‰;Õ'Ô+ÿÿºþ‰d'ÔKÿÿÉ;P&+j@ÿÿÿídN'¹>Kÿÿþt;Õ&+zþîÿÿÿÿþtd&KzþßÿÿÿÿÉþ9;Õ&+ß ÿÿºþ9d&Kß•ÿÿþv”Õ&,°ÿJÿÿÿÓþvg'°ÿLÿÿYZ&,LþtÿÿÿôF&óLþaþ¼ÿÿÉjl'âv.ÿÿºœl'ZvNÿÿÉþ‰jÕ&.ÔÜÿÿºþ‰œ&NÔ‘ÿÿÉþÀjÕ&. ÿÿºþÀœ&NvÿÿÉþ‰jÕ'Ôš/ÿÿÉþ‰„'Ô'O ÿÿþŠjk'µ*u'Ô™/ÿÿÿýþ‰S1'qÿ(; 4ÿÿÉþÀjÕ&/ŽÿÿÿôþÀJ'ÿOÿÿÉþjÕ'ˆ—ù&/ÿÿÿÞþ\'ˆÿù&OÿÿÉl'sv0ÿÿºf&Pv”ÿÿÉO'wt0ÿÿº'¸éPÿÿÉþ‰Õ'Ôt0ÿÿºþ‰{'ÔæPÿÿÉ3P'õu1ÿÿºd'¸‰QÿÿÉþ‰3Õ'Ôþ1ÿÿºþ‰d{'ÔQÿÿÉþÀ3Õ&1÷ÿÿºþÀd{&QŒÿÿÉþ3Õ'ˆþù&1ÿÿºþd{'ˆ•ù&QÿÿsÿãÙZ&2Tfÿÿqÿãu &RTÿ²þ²ÿÿsÿãÙV&2Rlÿÿqÿãu&R'joÿrÿÿsÿãÙZ&2Ojÿÿqÿãu^&ROÿµÿÿÿsÿãÙZ&2Nhÿÿqÿãu^'Nÿ¹ÿRÿÿÉl'žv3ÿÿºþV¤f&Sv2ÿÿÉO'„t3ÿÿºþV¤'¸¦SÿÿÉTN'ƒs5ÿÿºJ'¸UÿÿÉþ‰TÕ'Ô}5ÿÿºþ‰J{'Ô UÿÿÉþ‰T1'q}; Wÿÿºþ‰Jõ&qÿ XÿÿÉþÀTÕ&5åÿÿTþÀJ{&Uÿÿÿ‡ÿã¢O'¸t6ÿÿoÿãÇ'¸'Vÿÿ‡þ‰¢ð'ÔŠ6ÿÿoþŠÇ{'Ô%Vÿÿ‡ÿã¢m'âv'¤’6ÿÿoÿãâf&V&›ŒVvÿÿ‡ÿã¢W&Sä6ÿÿoÿãÇÉ'¸-µ#ÿÿ‡þ‰¢O'›t _ÿÿoþŠÇÞ'¸'ÿÊ `ÿÿÿúéO'rt7ÿÿ7ò‰'¸uWÿÿÿúþ‰éÕ'Ôq7ÿÿ7þ‰òž'ÔèWÿÿÿúþÀéÕ&7bÿÿ7þÀž&ôWÿÿÿúþéÕ'ˆrù&7ÿÿ7þ'ž'ˆÿèù&Wÿÿ²þ‰)Õ'Õð8ÿÿ®þ‰X{'Õ{Xÿÿ²þv)Õ&8°òÿÿ®þvX{&X°ÿÿ²þK)Õ&8Þà7ÿÿ®þKX{&XÞu7ÿÿ²ÿã)Z&T.8ÿÿ®ÿãXì&+v–†ÿÿ²ÿã)4&J28ÿÿ®ÿãXô'JÿÈþÀXÿÿh}&9žíFÿÿ=7&Yžmÿÿþ‰hÕ&9Ô¼ÿÿ=þ‰`&YÔ^ÿÿD¦r'õ|:ÿÿV5k'C ZÿÿD¦r'õ|:ÿÿV5m'v†ZÿÿD¦N'jõ>:ÿÿV5'jEZÿÿD¦N'õs:ÿÿV5'¸GZÿÿDþ‰¦Õ&:ÔûÿÿVþ‰5`&ZÔJÿÿ=;O'Ês;ÿÿ;y'¸b[ÿÿ=;N&;jÊ>ÿÿ;y&[jfÿÿÿüçP'ru<ÿÿ=þV'¸`\ÿÿ\m'¾u=ÿÿXÛf&]ˆÿÿ\þ‰Õ&=ÔÙÿÿXþ‰Û`&]Ô1ÿÿ\þÀÕ&=ÇÿÿXþÀÛ`&]ÿÿºþÀd&KfÿÿòN&Wjÿ->ÿÿV5&ZœBÿÿ=þV&\œÿÿ{ÿãa&D€Úÿÿ/ø‰'¸àuAø!#'7#53546;#"7˜¹“Jݰ°®½®°d&&ÖKþßhjN»«™()gþt˜iÏ/ø!##535#53676;#"3#˜¹°°°³ GW½®°d&ýÿEŒ‰FV™( D²ÿã´ò7&#"#4>32"#"'532654.546m®@f_@&Ë9d¦cÙ07ÏþÿCjjCþ÷Ó´Ém±ob—)F[dd[F)ßôZ@h§oüˆ‘ƒÏ‹\(Ž}_-C-->TŒ\¤É_ÐEFvX5P3) $2BgC»ÿÿqÿãuðHÿÿþ‰hÕ'Ô·$ÿÿ{þ‰-{'Ô!Dÿÿhð&$º¼uÿÿ{ÿã-{&DºTÿÿh:&$Uÿÿ{ÿã¯Å'Uÿ—þ‹Dÿÿh:&$Vÿÿ{ÿã-Æ&DVÿ”þŒÿÿh[&$\ÿÿ{ÿãæ'\ÿ–þ‹Dÿÿhu&$Wÿÿ{ÿã-'Wÿ–þ‹Dÿÿþ‰hm&„Ô¯ÿÿ{þ‰-f&¤Ô"ÿÿhZ&$Yÿÿ{ÿã-'Yÿ‘þªDÿÿhZ&$Zÿÿ{ÿã-'Zÿ’þªDÿÿh‹&$[ÿÿ{ÿã-5'[ÿ”þªDÿÿhY&$Xÿÿ{ÿã-&DXÿ’þªÿÿþ‰h’&ÄÔÀÿÿ{þ‰-&ÅÔ3ÿÿÉþ‰‹Õ&(Ôžÿÿqþ‰{&HÔ‹ÿÿÉ‹ð&(ºžuÿÿqÿã{&HºÿÿÉ‹^'žu(ÿÿqÿã7'ž—HÿÿÉ:&(UÿÿqÿãèÅ'UÿÐþ‹HÿÿÉ‹:&(VîÿÿqÿãÆ'VÿÐþŒHÿÿÉõ[&(\îÿÿqÿã׿&H\ÿÐþ‹ÿÿÉ‹u&(Wêÿÿqÿã'WÿÑþ‹HÿÿÉþ‰‹m&ŒÔžÿÿqþ‰f'Ô‹& ¶ˆ‹ÿÿZð&,º#uÿÿD|&óº ÿÿÉþ‰“Õ&,Ô.ÿÿ¿þ‰y&LÔÿÿsþ‰Ùð&2Ô'ÿÿqþ‰u{&RÔsÿÿsÿãÙð&2º'uÿÿqÿãu{&Rº}ÿÿsÿãÙ:&2UlÿÿqÿãÎÅ'Uÿ¶þ‹RÿÿsÿãÙ:&2VjÿÿqÿãuÆ'VÿµþŒRÿÿsÿãÙ[&2\jÿÿqÿã½æ'\ÿ¶þ‹RÿÿsÿãÙu&2Weÿÿqÿãu'Wÿ¶þ‹Rÿÿsþ‰Ùm&–Ô'ÿÿqþ‰uf'Ôs& ʈsÿÿgÿãk''ubÿÿvÿãÓf&vscÿÿgÿãk''ubÿÿvÿãÓf&Cscÿÿgÿãð&bº'uÿÿvÿãÓ{&cº}ÿÿgÿã^''ubÿÿvÿãÓ7&žscÿÿgþ‰&bÔ'ÿÿvþ‰Óë&cÔsÿÿ²þ‰)Õ&8Ôõÿÿ®þ‰X{&XÔ{ÿÿ²ÿã)ð&8ºîuÿÿ®ÿãX{&Xº}ÿÿ­ÿ÷_k'îuqÿÿ°ÿãif&v{rÿÿ­ÿ÷_k'îuqÿÿ°ÿãif&C{rÿÿ­ÿ÷_ð&qºîuÿÿ°ÿãi{&rº}ÿÿ­ÿ÷_^'îuqÿÿ°ÿãi7'ž€rÿÿ­þ‰_&qÔõÿÿ°þ‰ië&rÔ{ÿÿÿüçr&<r|ÿÿ=þVk&\C!ÿÿÿüþ‰çÕ'Ôv<ÿÿ=þV`'Ôt\ÿÿÿüç÷&<ºr|ÿÿ=þV‚&\º`ÿÿÿüç^'ru<ÿÿ=þV7&žw\ÉÕ 333!!ÉÊèÊ×ú­ÕúÕ+úÕª ²33533#####53Á¸à¸¡¡¸à¸¡¡“““}úüúü}ÿÿqÿçäa&E ©pÿÿqÿçäa&E áHÿÿqÿçäf&E ¶”ÿÿqÿçäf&E Äÿÿqÿçäf&E ·„ÿÿqÿçäf&E Ä ÿÿqÿçäm&E ¸vÿÿqÿçäm&E ÅDÿÿha&& ©ÿ#ÿÿha&& áþóÿÿôf'&Œ ¶ÿ|ÿÿôf'&Œ Èÿÿf'&® ·ÿSÿÿXf'&ð Äÿoÿÿ™m&&1 ¸ÿQÿÿàm&&x ÅÿNÿÿ…ÿãÈa&I ©Dÿÿ…ÿãÈa&I á9ÿÿ…ÿãÈf&I ¶ ÿÿ…ÿãÈf&I Ã%ÿÿ…ÿããf&I ·Oÿÿ…ÿãf&I ÄRÿÿ-a'*¢ ©þÿÿ-a'*¢ áþÿÿ7f'*¬ ¶ÿ|ÿÿIf'*¾ Èÿÿ­f'*" ·ÿSÿÿéf'*^ ÄÿoÿÿºþVda&K ©¦ÿÿºþVda&K á¢ÿÿºþVdf&K ¶€ÿÿºþVdf&K ÃpÿÿºþVdf&K ·„ÿÿºþVdf&K Ä®ÿÿºþVdm&K ¸œÿÿºþVdm&K Ňÿÿéa',® ©þÿÿæa',« áþÿÿçf',¬ ¶ÿ|ÿÿíf',² Èÿÿnf',3 ·ÿSÿÿŸf',d Äÿoÿÿ¯m',t ¸ÿQÿÿÊm', ÅÿNÿÿ›na&M ©ÿÿÿ‘na&M áÿ ÿÿÿ°¹f&M ¶ÿ'ÿÿÿºÇf&M Ãÿ<ÿÿåf&M ·ÿQÿÿÿÒîf&M Äÿ=ÿÿÿËnm&M ¸ÿÿÿÿÆnm&M ÅÿÿÿAa'.® ©þÿÿ5a'.¢ áþÿÿKf'.¸ ¶ÿ|ÿÿKf'.¸ ÈÿÿÇf'.4 ·ÿSÿÿf'.p Äÿoÿÿ"m'. ¸ÿQÿÿ)m'.– ÅÿNÿÿqÿãua&S ©xÿÿqÿãua&S ánÿÿqÿãuf&S ¶eÿÿqÿãuf&S ÃTÿÿqÿãuf&S ·ˆÿÿqÿãuf&S Ä‘ÿÿÿãüa&4# ©þÿÿÿãVa&4} áþÿÿÿãOf'4v ¶ÿ|ÿÿÿãYf'4€ Èÿÿÿãf'46 ·ÿSÿÿÿãPf'4w Äÿoÿÿ•ÿã*a&Y ©=ÿÿ•ÿã*a&Y áÿÿ•ÿã*f&Y ¶'ÿÿ•ÿã*f&Y Ã!ÿÿ•ÿã*f&Y ·`ÿÿ•ÿã*f&Y ÄWÿÿ•ÿã*m&Y ¸8ÿÿ•ÿã*m&Y ÅÿÿIa'9b áþÿÿÿf'9 Èÿÿf'96 Äÿoÿÿ3m'9L ÅÿNÿÿ‡ÿã'a&] ©^ÿÿ‡ÿã'a&] áTÿÿ‡ÿã'f&] ¶Yÿÿ‡ÿã'f&] Ã^ÿÿ‡ÿã'f&] ·¤ÿÿ‡ÿã'f&] Ä‹ÿÿ‡ÿã'm&] ¸cÿÿ‡ÿã'm&] Å^ÿÿa&=N ©þÿÿqa'=¢ áþÿÿif'=š ¶ÿ|ÿÿuf'=¦ ÈÿÿCf'=t ·ÿSÿÿyf'=ª Äÿoÿÿm'=B ¸ÿQÿÿPm'= ÅÿNÿÿqÿçäf&E Õtÿÿqÿçäf@ÿÿ…ÿãÈf&I ÕTÿÿ…ÿãÈfAÿÿºþVdf&K ÕÆÿÿºþVdfBÿÿÿnf&M Õþãÿÿ¦˜fCÿÿqÿãuf&S Õ{ÿÿqÿãuf`ÿÿ•ÿã*f&Y Õ0ÿÿ•ÿã*faÿÿ‡ÿã'f&] ÕMÿÿ‡ÿã'fbÿÿqþVäa& ùHÿÿqþVäa& úHÿÿqþVäf& ûHÿÿqþVäf& üHÿÿqþVäf& ýHÿÿqþVäf& þHÿÿqþVäm& ÿHÿÿqþVäm& HÿÿþVha&  ¨ºÿÿþVha&  ¨ºÿÿþVôf&  ¨FÿÿþVôf&  ¨FÿÿþVf&  ¨hÿÿþVXf&  ¨ªÿÿþV™m&  ¨ëÿÿþVàm&  ¨2ÿÿºþVda& ÿ8ÿÿºþVda& ÿ8ÿÿºþVdf& ÿ8ÿÿºþVdf& ÿ8ÿÿºþVdf& ÿ8ÿÿºþVdf& ÿ8ÿÿºþVdm& ÿ8ÿÿºþVdm& ÿ8ÿÿþVéa&  ¨žÿÿþVæa&  ¨›ÿÿþVçf&  ¨œÿÿþVíf&  ¨¢ÿÿþVnf& ! ¨#ÿÿþVŸf& " ¨TÿÿþV¯m& # ¨dÿÿþVÊm& $ ¨ÿÿ‡þV'a& MYÿÿ‡þV'a& NYÿÿ‡þV'f& OYÿÿ‡þV'f& PYÿÿ‡þV'f& QYÿÿ‡þV'f& RYÿÿ‡þV'm& SYÿÿ‡þV'm& TYÿÿþVa& U ¨\ÿÿþVqa& V ¨°ÿÿþVif& W ¨¨ÿÿþVuf& X ¨´ÿÿþVCf& Y ¨‚ÿÿþVyf& Z ¨¸ÿÿþVm& [ ¨PÿÿþVPm& \ ¨ÿÿqÿçäH&Ešzÿÿqÿçäö&EqyÿÿqþVäf& ]HÿÿqþVäy&EHÿÿqþVäf&@Hÿÿqÿçä7&E ªnÿÿqþVä7&  Hÿÿhm&&ºuÿÿh1&&q¼;ÿÿÿüªf&&B ÕÿRÿÿhfÿÿþVhÕ&& ¨ºÿÿ†Âxa ©ÿÿ¶þV’ÿ¤†ÂxaH´ Ô<ܲ?]À1¶ Ô´?_]°KPXÌÀYÌ̲?]90±I±IPX³@@88Y#55#53xò†…ñÍþõgžÿÿ¶J7žÿÿ¶FJm'„jÿÿºþVdf& aÿ8ÿÿºþVd{&Kÿ8ÿÿºþVdf&Bÿ8ÿÿºþVd7&K ªÿÿºþVd7& ¯ÿ8ÿÿÿüíf'*b ÕÿRÿÿÿçufÿÿÿü©f',n ÕÿRÿÿÿóf ÿÿÉþV;Õ&, ¨ÿÿÿ‰Â’f' ©ÿ Õ ÿÿ´Â”f' ©ÿ. àBÿÿ¶ÂJm'„ ©ÿÿÿënH&Mšÿ$ÿÿÿãnö&MqÿÿÿÿØnÒ&M Óÿ.ÿÿ€Ò%ÿÿÿäx7&M ªÿ.ÿÿÿæzm&M «ÿ0ÿÿÿõgm&..uÿÿY1&.qÿ.;ÿÿÿüf'.q ÕÿRÿÿÿí}f!ÿÿ~‹f' áþø Õÿÿ•±f' áÿ à_ÿÿ¶ÂJm'„ áÿÿ•ÿã*H&Yš'ÿÿ•ÿã*ö&Yq$ÿÿ•ÿã*Ò&Y Óÿÿ•ÿã*ÒDÿÿºþV¤a&U ©»ÿÿºþV¤a&U á±ÿÿ•ÿã*7&Y ª'ÿÿ•ÿã*m&Y «ÿÿÿüçm&9vuÿÿÿüç1&9q€;ÿÿÿüÇf'9à ÕÿRÿÿÿá‘f#ÿÿ5a'6¨ áþÿÿªF)Ò&j Õlÿÿ×FRÒÿÿªð‰fCÿÿ‡þV'f& iYÿÿ‡þV'`&]Yÿÿ‡þV'f&bYÿÿ‡ÿã'7&] ªOÿÿ‡þV'7& ÙYÿÿÿüÿãf'4; ÕÿRÿÿÿòÿãf"ÿÿÿüf'=D ÕÿRÿÿÿÛf$ÿÿNþVÏç&= ¨ÿÿsîRfv†ÂxaH´ ÔÀܲ?]<1¶ Ô´?_]°KPXÌÀYÌ̲?]90±I±IPX³@@88Y53#7"†ò††òÍ”žgd߃¶œÜÌ1Ôì0!!dý僤ÿÿd߃ òdé³y¶©é/Æ1üì0!!dOû±ydéœy¶©é/Æ1üì0!!d8üÈydéœyµ©/Ì1Ôì0!!d8øÈyéyµ©/Ì1Ôì0!!øyÿÿþø&__Jÿÿÿìþÿî&BBB®éÓÕ@ žÜüÔÌ1ôì0#53Ó¤Ré­?þÁ²þ×Õ@ žÜìÔÌ1ôì03#Ó¤RÕ˜þÁ?®ÿÓþ@ žƒÔìÔÌ1üì0%3#Ó¤Rþ¬þÀ@²þ×Õ#5…R¤Õ˜þÁ?˜®émÕ '@ž   ÜüÌÔÌþÔÎ1ô<ì20#53#53Ó¤RšÓ¤Ré­?þÁ­­?þÁ®émÕ '@ ž  ÜìÔÌÜîÔÎ1ô<ì203#%3#Ó¤RšÓ¤RÕ¬þÀ@¬¬þÀ@®ÿmþ '@ žƒ   ÜìÔÌÜîÔÎ1ü<ì20%3#%3#šÓ¤RþfÓ¤Rþ¬þÀ@¬¬þÀ@®émÕ #5!#5R¤mR¤Õ­þÁ?­­þÁ?­9ÿ;ÇÕ '@¹  YW Y Ô<ìü<ì1äôÔ<ì203!!#!5!¨°oþ‘°þ‘oÕþ\™û£]™9ÿ;ÇÕ>@ ¹¹  ÂY W Y Ô<<ì2ü<<ì21äôÄ2Ä2î2î20%!#!5!!5!3!!!Çþ‘°þ‘oþ‘o°oþ‘oßþ\¤š™¤þ\™ýá3Ñ…! · Ç \ Ôì1Ôì04632#"&3­~|«¬}}¬ú|««|}¬¬3Õq3¢ðþˆìÁþ³Ôì1²ƒ/ì073#ìÕÕþþìkþ¶ÔüÔì1´ƒ/<ì20%3#%3#–ÕÕýVÕÕþþþþìþ #@ƒ   ÔüÔìÔì1/<<ì220%3#%3#%3#–ÔÔ©ÕÕú­ÕÕþþþþþþÜk¯i3#ÜÓÓiþqÿã Lð #'3?K®@D$%&%&'$'B@’ .’(’F’4 :&Œ$‘L%IC'1+C =  1 =I 7+ ! LüäìÔÄìäîîöîî991ä2ô<<ä2ì2îöîî20KSXííY"K°TK° T[K° T[K° T[K° T[K°T[X½L@LLÿÀ878Y"32654&'2#"&5462#"&546!3#"32654&2#"&546"32654&ôWddWUccUžº» º»ùtž¼»ŸŸ¹º% üZ VcbWWcd²žº» º»ŸWccWUcc‘”„‚••‚ƒ•Ü»»ÛÛ»¼ÛàÛ»½ÚÛ¼ºÜùóŽ•‚„””„–ýŸÜ»»ÛÛ»¼Û”„‚••‚ƒ• qÿã rð "-7;EP\"32654&'2#"&546"32654&'2#"&546  &54%3#"26542#"&546"32654& WddWUccUžº» º»ýyWddWUccUžº» º»øÖ<¼»þ¹ß üZ u¬cb®cNžº» º»ŸWccWUcc‘”„‚••‚ƒ•ÜþŠÛÛ»¼Û”„‚••‚ƒ•ÜþŠÛÛ»¼ÛàÛ»½ÚÛ¼ºÜùóŽ•‚„””„þ5ÜþŠÛÛ»¼Û”„‚••‚ƒ•(` Õ3(­Ëþß`uþ‹ÿÿ(`ÌÕ&  ,ÿÿ(`øÕ' ,&  X(` Õ#3 WþßË`uÿÿ(`ÌÕ&  ,ÿÿ(`øÕ& ' X , þ«ÿÃ#'#«”»¼•Rþùù¦žs#G@%èèèèBç¦onüì291ôì90KSXííííY" 5sþÓ-þ+#¿þôþô¿¢RÁ–#I@&èèèèBç¦opü<ì91ôì90KSXííííY"5 ÁÕþ+-þÓ#þ^Rþ^¿  ÿÿÃëÌ&™K'ÿèN''=NÎÿÿ“OÕ'ÿ^O“°ð$#5>323#7>54'&L¿ Za^Ág¸ßHZX/'ÅËËÅ-93A%‘­ #C¼98ŸL‰VV/5<4þòþBþR-5^1Y7ÿÿÿì| B_ÿ§þÇÿ… %³ ÄÔij991@  ÔÜÜ<Ì202$7#"$'56çÅåëþ:àßþ<ìæÂþµhh~vvuw~igÿ§Çn %³ ÄÔij991@  ÔÜÜ<Ì202&$#"56$6àÆëåþ;ççþ>æìÄnvv~hhgi~wuÿªþIÕ3 # #çbþâbíícÕþ$þ$Šþvÿÿ=ÿÅÃ' ý{' ý{ “Ý3_!!ÝVýª_Þþ‰ÿãÍð+@BŒ‘ÔÌ1ää0KSXííY"3#- ü\ ðùó°þòX 3!!#3hðþX¨ðð^ý#"ý#J°þòX 53#5!!53°ðð¨þXð^JÝøÞÝÿÿJð&"·"gÿÿ“Jð&"Jÿÿ“Jð'ÿ^"šdÿ–] 7· ÜÔ91@ B ©¼ Ìô<Äì20KSX·ììY327# 'dšêû³þà˜uþÃÈ]€û(®ìÿ;‡Õ 2###¬×ë׎¾Õ辸Ýü²ùášØÂ( 3+"&5463y¯¯v}¬­~ý±¬}|«ØÂ( ';2+‡¯¯v~­¬}ÂO«|}¬ÿÿ=ÿÅÃk ý{ÿB# #5#5ðÓÓR¤#þþüÛ¬þÀ@¬ÿÿÿ§þÇn& ! "ÿÿ=ÿòÃo' ý¨ ÿÿ‘ÿBCÕ'‘'ŽÿÙHdÓœ1#"'&'&'&#"5>32326œžæ’”ì 錄ܔžæ’°Ò 錂×1²OD;>MS²OE<>Lÿÿÿ§þÇÿ~ "ø8È| #'7!5!'737!!ª ùqùþŸaúqú úqúaþŸúq)þŸ`ùrù úrûbþžúqú ùrú2¶¶ 535353úÈ,ÈÈÈÈÈþ¢ÈȼÈÈÿÿ(`$Õ' ,& ' „ XfNè 53!535353fÈXÈý¨ÈÈÈÈÈÈÈþpÈÈ ÈÈföNÞ 5353535353öÈÈÈÈÈü,ÈÜȆÈÈþpÈÈ ÈÈüôÈÈ ÈÈÛ®Õ3#3#ÛÓÓÓÓÕþü'þdþåýï 3#%3#3#3#dÓÓÆÓÓýÓÓÓÓiþþþ„þùòþpDÕ %53535353#!5!3!†ÈÈÈü,ÈÜÈ| ýfš šöÈÈ ÈÈüôÈÈ ÈÈþ„ýfš ›ýe ÛP®> 3#3#3#ÛÓÓÓÓÓÓ>þýþöþÛ®w 3#3#3#3#ÛÓÓÓÓÓÓÓÓ‰þìþü–þðþWîð "27654/2#"&546Ê2332Ê233—¡ªª¡¢ªª—VV¬­VVVV­¬V¯ÞÓÔÞÞÔÓÞzœî@ Ü<Ü<Ì1@ÔÄÜÌ03#3#zttttýg‚?œôß Ô@ Ý ÷‘ ] ÜÔ<Äì291ôüÔ<ì290K°TK°T[K°T[K°T[K° T[K° T[X½@ÿÀ878YK°TK°T[X½ÿÀ@878Y@T /9IFYi‹«»       "5GK S[ e„¥µ]] !33##5!5ÝþË5¦‡‡þbfþ]ýämººyfÓß !!67632#"&'53264&#"Žþþy¡^^a`°<~B9>>Eo‚‚o4h6ß_Ì MLƒ‡KJq f®f\óð/"327654'&&'&#"67632#"&547632³X3333XW3333«1221€DD &9:D‘TTXW‘§°ll¶122m45[Z4554Z[54bg KL™1LM„ONÞÔÆuv lœÕß!#!liþ¤ˆHþ3ß0üíäYìð *:"32764'%&'&546 #"'&54767327654'&#"º55j]\655þìT./¤RQ./SZ85UVžŸUV56-/.UQ100/SS0/*,+KLV,+–+]12Hdt::dJ01:7PyAAAAyN98Æ?&%%$A?&%%$Séð.532767#"&547632#"'&2654'&#"‘1220DC #<9E¨WX‘§WXkl¶122ÌXf33XU5443®g KKš/˜„MNooÔÆuv rh\Z4554Z\44‰œ°k !!#!5!Q_þ¡iþ¡_kþÈ_þÈ8_8‰Ô°3!!‰'üÙ3_‰a°¥!!!!‰'üÙ'üÙ¥^‡_o #&'&4767TRRTe^///._üþþþ€ƒ€ú~„gˆ3#676'&ge_/../_eT)**)„~ú€ƒ€~~uœÄ0@ ÔÜ32ÄtNN^luu)qJy}þ…wYYk\þžsa88†ÿÿWÿñîT Mýdÿÿ‰ÅC{ýdÿÿ^´TtýdÿÿbÿñÍTuýdÿÿ?ôC OýdÿÿfÿñÓC Pýdÿÿ\ÿñóT QýdÿÿlÕC RýdÿÿYÿñìT SýdÿÿSÿñéT Týdÿÿ‰°Ï Uýdÿÿ‰8°— Výdÿÿ‰Å°  Wýdÿÿoÿif Xýdÿÿgÿiˆf YýdÿÿMÿ𡂦ýdÿÿGÿðÕ‚¬ýdÿÿGÿðÏ‚µýdÿÿu!s¥ýdÿÿGÿðÕ‚­ýdÿÿuÄgrýdÿÿuçg²ýdÿÿzîg£ýdÿÿu{‚³ýdÿÿuÄ‚ Zýdÿÿuÿ삹ýdÿÿu“¤ýdÿÿ#Û%ºýdV®Ö##"32.#"3267!!!!!!ÝO²cþþÛ%þe±NL­bÀÌÌÀb­LÄýÓýê:ý/¸667756ŸGFêþDêFG €þµ€þk€sÿ¦¾9'.473&'3267#"'#7&'#7&'&76%73&'hA>›/(%:@þÁwÓ]aØy›A9&›A²² œã‘X}R4>CþÁ5Aëi¥Õ<)û—^_ÓHH?W‡æÏghйKüpþØî”Ëû•(`ÿä³ð,%6767# !2.#"3>32.#".aXj]aÙyþÊþ›e6{Ù_]Ôwêù|^™˜0šn&<$€‹Š'/_ÓHGžghŸGGÕ_^þÇþØþÙœu]\Yª¶«…ËÕ!!!!3###5qZýpPý°úúÊì~WªþHªþµEþÇ9Ebð#!!53#535#535632.#"!!!5-üì¿¿ÇÇÖè=—OLˆ=”t‡þyìþ¾ªªB_ó¶))›ÔHºÿB+#&'&#"#3676323632#4&#"#̪m49wSS¹¹>YXyzU6%…ªX\x¯¾¹ru¦¹¾xGM_a¢ý‡`®f21>&>EÖ3öáý\ž¡œ¾¤ý‡"ôÕ"&)''#!333#3#!###535#53355ØP·8ÄÔæÄ¢¢¢¢þðÔæÄ¢¢¢¢8PP¯ÎÎþò““4ýÚ&ýÚ{“{ýÚ&ýÚ&{“{{““þòÎÎÉÿã ÎÕP32654&#+#!233!!;532654&/.54632.#"#"&'5#"&5‡ï…‘‘…Ýqzìï¾­ìzWQ®eþ›Gl«`»[z„_¡<¡ÓÂ`©HJžU]‹;¹›éËU·f«É˜/ýÏ’‡†’þÌÈjqý¨ÕqRˆ>þÂý ‰N#55YQKP%$•‚ž¬®((TT@I!*™‰œ¶##ŸÒ`Éÿã3ÕE326&##.+#! 32654&/.54632.#"#"'&“þ’••’¿Ù¿J‹xÜÊÈüƒ}A{>[b`ca‚Œe«@«˜àÎf´LN¨Z‰‰b”?Ä¥÷ØZa,/ýúØ–bý‰ÕÖØº$~´3YQKP%$•‚ž¬®((TT@I!*™‰œ¶;®Õ"&)-1'#53'3!73!733#3#####5!73'!!7¶]:1Ì00ã00Í19]zžáþÚÃÜþàŸÀ¥¥þu‘û ¥¥å}ýL‘uÂÂÂÂÂÂuü€€ü€€ýg™uuþüýg™uuuu_ÿãñÕ % #4&#!#)"33!3_ÿ¸°þ±¸Žýýÿþú¸°S¸ÒþÖþÜþ‘VðÓú²*$oþªðÓNÿÿqþÀô&ÓŠÿãð1@: Ó"+Ó ¡®•¡®•/‘Œ) 2+"!)#&  , & &*!/<ÔÄ2üÄÄ99999999991Ä2äôìôìîöîî2Ý<î20K° TK° T[K° T[K°T[K°T[K°T[X½2ÿÀ22@878Y@z  1Ti lnooooiko o!o"o#n$l%i'i-ŸŸŸ Ÿ Ÿ Ÿ Ÿ ŸŸŸŸŸŸ–Ÿ Ÿ!Ÿ"Ÿ#Ÿ$Ÿ%Ÿ&Ÿ'Ÿ(Ÿ)Ÿ*Ÿ+Ÿ,-2   USjg ]].#"!!!!3267#"#734&5465#7332[©fÊ A7ýæ¾8þŠ Êf©[Y¹`íþË(Ó7‹Â7œ(6ìb¹bÕiZÈ»{.# .{»ÊZiÓHH"{/ #/{"G(Õ33!!###5¿½uóý€ªþX°ùý_½—Tý‰wýsýÏý1ásÕ!5!!77#'%5'&ýîïýîåPþËæPþÊËçM4èMžªªþñ¡o؈¢oÙý¸º¡nÙˆ¢nÐþ9 ¤ð-bwƒ'67>32#"'&'"326767654'&'&67'>7632#"'.'&/#"'&54632326767654'&'&&#"32¹¢">1–aJ{%A01Q[W7>/÷W1   >$< ù¹ ´. #®dCw¯Ë-^URB$`>DL_K>.3b @N\uLM„iIä±(S395lš9,8„ýG(/&  -þ9)ЗiRm:3X’wdg7? 2øj7#=5(6$ 629T/ ·(2M !:5S}$@{mbõqŒ‚~Es/4 -& "TAB`]…’ü›|@8†nR€kcd]aCœû ".ÿãŽð)5'632327&547632#527654'#"'&#"%654'&#"¹‹“o|@X"07ãPYˆtaTkµ~jü†[Iw‰mqJ2530D#24!`ðNkB±þ¬X``S±ã«£¿Â†q¢J<“Xr~hFÙl¯V1??0W¦D¢Õ$+15#53!23#3#+##5!3276!&'&+!!64—RRÈûL\HGZMûþÊSþþMþÿMþ#ýÝ#ìVtqDjt,tkDqý¨xttzIYIíV,]ÿ[±x$-#5&'&76753&'&'6767#5!'ùŒß‰¨¨‰ßŒi`p^_kbkN?H9x"cxhuŒ…OooO¥§Ìmnͦ‰$F×_0,û?'‘¦ýS*%²§ l™þÑþÒ™lÕ5!3!!3##!##5373!/331µåµ0þûG¾“µÒªþªÕµ’½IÁC©DúÒiR{ýø{Ï{ýøýø{ÏÏÏ{Auÿã¼ð66767!5!67654&#"5>323!!!3267# $547#5\J€þ5’ ;³¥_ÌsrÚiõ¯þýgØC…üS1¼­rì{€ïjþçþݨ¡J,{ +kv€67Å&&äÆUB{\* {;^~ˆFEÐ/0àÙK?{¥þÓr*.#267#&'&576753r\¨ee¨\Z\X[d¹tÔÔy²e]X\þ‹[CvlC¤ÕiZûñZiÓH$"þðvÖ9BËtèâ"$û¤ùCuª¡f´lCÕ !!!!#!ïûïýîËýîÕªxªû÷ j¯Õ&7!!!##&'&+532767!7!&'&#j77þžO57ö=A}A=;AÍÙ¿KDFxÜþ’JDý¾7-J’Z{{N{~U]$HD‚þh—01¦C>r{C4X âÚ!#'%5'%3772âþhþ ¬æN4èL4ÊæPþÊèPþÈåñþ~þ–¡n؉¢nÙäþª¢oÙˆ£oÚýû.CÑÕ!2+!!##535#5;2654&+ Èûþÿûþ*ýÖÊÊÊÊÊÊþššþÕãÛÝ⦦þô ¦¦¦’‡†’üÿË3!üÚ~„åÿ›dü=ÿö!5!'3 üGå„~d›ü=zÿË!#'73!5ý„~¯¯~„å›ÍÍ›ü=zÿË5!'3#7ü=å„~¯¯~„d›ÍÍ›ü{ÿì 3#%3#%3#üËËËËþyËËfÊÊÊÊÊËûP{° 3#%3#%3#%3#ËËûkËËËËþyËË)ÊÊÊÊÊÊÊËü=zÿË #'73!'3#7üæ„~¯¯~„<„~¯¯~„›ÍÍ››ÍÍ›CÿÏØ $(B"326=7#5#"&54634&#"5>32%3#.#"3267#"&54632 pSHf¼¼™m¦ÍÆ©ogDc\”GÂÁ°ØüDØ©^o8y‰‰y8o^I‚IÊìîÑC€öBRCI”‚ Mþ >Ož–›W\ 7²$ÊúùË„²4œ”“4±"úÑÔùCÿÏþ +EI.46'&#"#&'53254&'"326=7#5#"&54634&#"5>32%3#V‡¹Nz$p´;i0™‰Êª¯‘%“‹±={û‰ pSHf¼¼™m¦ÍÆ©ogDc\”GÂÁ°ØüDØ}|ïŽ4¼9d$, !ó•5ÊLf,1„BRCI”‚ Mþ >Ož–›W\ 7²$ÊúùËsÿã'ð!.#"3267# !2'Yè—£yy£—èYjí„þ­þz†S†íý #bvAZ4û-4ZBuHHŸghŸGû[!¬þºþ»¬!ÿÿÃÿãmð&r&FÿÖÕ+™¸,/¸-/¸ܸܸ,¸(и(/¸ÜA&6FVfv†–¦¶ÆÖ ]Aåõ]¸¸ и¸ и¸и¸#и /º!"+¸!0153&'&'6767!!5&'&76wI3cc3IÊ86QLNN7887NNMR48×ü_¡k•—i³:rÍÍq;Ôzn #¬+ü¤+ª$ *ªÞ rŸn<ÿÏå(2.#"3267#"&54632%3#"326&$  &54^o8y‰‰y8o^I‚IÊìîÑC€ÝØüDØkavva`wwþß‚ÚÚþ~Ù—²4œ”“4±"üÑÔùKùËž’‘Ÿ   øÕÔøøÔÕ<ÿÏM-1332653#5#"&.#"3267#"&54632%3#\¼QPcu¼¼`ž¡ýª^o8y‰‰y8o^I‚IÊìîÑC€ÝØüDØLýõriuðüD PÁÿ²4œ”“4±"üÑÔùKùËÿÿ¤ÿã{ðRÿÿoþÖ#ãÁþóÿÿÃ&ð&r)IÿãŒûo!6767632#"'&#"32767#"'&'&547!#"'&54632327676"#"'&'&54767632¿lø(9BKc{=&%%03!((!,739%7`lG;7 þ25]­¹hB4,'5  'B[QF$%ˆ]c'G  %! }Kr~“,§ê1ý¼ÑŒ˜Ig)*!&!(D;wÖþ½¥‚},75;!_']7:y}©[´Ïž£\®@4>#,!, 'QFª§ÿj(JG4$$,*)/9„yK#%þù‹ÙP73276767654'&'&#"&'&"'632654'&'&54767767#"'&'672#"*i(X%# 1F‚S°E/ ËO.55Fu½PU[QF[00rlÓ~œ"‘KI}!;IFs;n¡íò;_þéT^ÍŒQ79}w²–^l.G‰yr\[4þúO9%#i#Þ^MX;€¥yv@c„“}e.ID\7I;>2V秉uÓ°þ¢ÓþþÉÕ3!3%!!!!!!ÕÊûŽÊþÒ’’þnýêþnqúó úó dýˆxú+Ûý%H‡#>54&#"#3>32uƒ¹ƒ j_”Ù y¸/¸wFÚx”£ ¤ý\/HT^Ȧý“ýœ^m ‘$RZ‡3%632##"#'7ˆ¹-þP4ªçÁ—-ƒ¸‚>ø•Ñ {¹ßÑõê|aˆþõÉïèý\ž=¾¤ý‡BcL;ÿátð9#"'&5476323276765"#"'&54767632thÁ‚n<7# ;KQ>!|Za,4(XM‹•µ!}ã,üþþ†Â‚<7D9#7.M=†„¾.1?@ '(MXI(' jÿãFð!2?632327654'&54?#"'&#"632327#"&#"jŒou9„!ydG>PPÕPP5ʺò6…8^nm{z€}}È‹oÖz€Z¥'PV‰aK~p’md Œ‹yk”b¼^òÞOP681/:ª:b:DÿãnòJ327654'7#"'&'$#5"'47676766767632#"'&'&'&#"32ÛnZS_n0VBšR„äny#H‰B?„ÁX!$9B©„€Mw>7l. ;7%,;(Ó§½uy,D0ÿäÿãÒð&3273#"'#67&5477632654#0)W:K…32#"&'####53&  Á¸¸¹±ýO:±{ÌÿÿÌ{±:¹¸¸¡¡›§þܧ§$“““}þ²daþ¼ýðþ¼ad¨úü}ûã–ççþjçÆ¢Õ %# !3!# ýîêü”¨ÐdþXý0dd úóqûáú+áû6ÁÕ+/±’—B°“°˜B°/³,/°<±•í°°-ݰ.<°-°Þ°#ͱ?± °<± •í°#° °9° FhH°°)°#°#Ii;±€B±B=°°#I°€bi°F`°Fa°’C°`#B°’C°`C°UX°°’C°`C8Y°²& °<±€B±B0°0±þ°<°Ä°±ý°<°± 6ü°<° ±ý°<°9° FhH° ° °°#Ih;° <° °Ö°° ݰ,9°, FhH° °&Ö°&°°° #Ii;°/°,°#Ih:°°1#I°’C°`#B°’C°`C°PXµ& ,/°’C°`C°8K° RX° °#I°’C°`#B°’C°`C°@PX°’C°`C°@a°’C°`#B´ °’C°`C°8YYY±€B±B=°°#I°€bi°F`°Fa°’C°`#B°’C°`C°UX°°’C°`C8Y°²#)°<±€B±B1°°#I°RX ±°±í°±ý  ±°°<  ±°°< Y3525!463"!4632#"&732654&#"5!6“–º“þðýjãggggŒ92299229ŒîªkÀûÌ€•ªkû@áü4€•nŠ¿¿ŠŠ¿¿ŠNggNNggýD{{åÊ "-! ! ! ! '32654&#%!2+# ÚþJþÑþÏþR´12)þ÷þúþ†uy»ýÓ²ckkcþÁ?°´´°²ñÛþÎþÐþL´00¶eþ…þùþûþ‡y »wþ¯XQPXd‰ƒ…‡þ˜nþ;Cö0<67632#"'67327654'&#"#"'&57&547276545ˆ[«Û„ƒFIœy®eL )qz]E& J½þŸ‡EYƒq:?ß.è”0.A Æ‚¾Mke”½LP«Ú×§<+(ŒhÃ|H=þyþÞ|nŽ=B† üžî¤üïÆ{u.F/4_NÈTÕ 33!27&#%!2+!67654'&,Êd.ý@‘úþÿûþþnX<-]\,qúó ýj’dÛÓÕÚýˆZý™)VŸžV)sþøÙð!)%#'# ! % 7& 676'&B ôÝ3þÅþ‡y;:xÑý+lllþðli$ ›› Þ#››þÝï¥ab¥þ[þžþüþŽ 22×22ûjT%¶ýœµ%5û¯$¶c¶$Bÿî2 _327654'&'&'#"'&5476323276765""'&5476!6?232767#"'&B=]iS\Z—ÎV30FŸ¹n7;#FfS9!!ç< #5,h½";<¶‰„2XngšZR{,##9>;K!Q¡ýIag£Sûæ Àˆ‰D£5@7*'S:y}ž*‚7H0 5#!,I‘l» @3X§¿nh0ÞÍ{(2r:=OSÿãlñIX&54'&#"#"'&527654'&#"3"'&547632763227767654'&#"R(O*\xggŒfg-.@@?@@?\QA@@@S6—fggf—¢eÓ»p/$~AB}:1$ -*ü¤šMJJ@f·ŸŒ[¦+8ÇÎvuuv° zVWWW–›•XWWVÊVW\uvœuuu# bW1±W{|^1$h{ƒ€vC[SK\þ•GChfy— /È2Õ &.2&'&+3!.+!! !27&#676'&%3ûLDEx-MeÇþø5q>ÍþH¿J‹xþn§üu1ý•E˜A+ZY*ü²Ê—01/ÉþåO„~þh–bý‰ÕÖØÐb)¥ýj’ý™)V>U)-úó ©ƒÕ§¸ /¸!/¸ ¸и/¸ ܸи!¸ܸÜAêú]A)9IYiy‰™©¹ÉÙ ]¸ и /º9¸ /¸/¸/º+¸º +¸0132654&#+#!273 # #sþšš s­þÊÈûN®¾èþÍCéÏÔèI/ýÏ’‡†’ý_6ý¨ÕãÛ¬kÛêþ†þkþü•Éÿ%TÇ$+.3&##&'&''7#!27%7 67654#“ÑÈ?\üA>:AÍÙ¿KE6Tþ®oF^È~_ þº,¶8~ƒ|§T3JýÛ/ýîøýHD‚þh—0& ü°,¯Õ‚o®Œkغçþ]-Dƒbü‡g‹(Ø'4.#"#"&'532654&/.54632733###æUW'AG/E8piŒ4sG[d/EK7?8pcŠ|3iи¡¢¸ŠŒ‡‰·Y"*/( VAO[`*,2,* M=H\þ¬TýÈ”þØ(þlÿü0`!!#!!!!!!!3!!³þr˜þsàoþÕþ+öý…ï…àý›`€ü à`fþ÷fþ»f€üæf'“FÕ >@!  É  b b cbcÔäüäÔìÔì91ô<<ì2Ô<<Ä903#######5J®¤ªqÃ7ËrqËrÉÕÿý¾äþÑ/þB^þä^ÿ"hÄ %73# ' 3×þº,¶þ¢¦ÚÒýÇåžýo-þ£ÓM†‚o®üþFéú+žý„,õ’\™Õ %#!!!5!È8êüÈküÈOúÃ8üßd úóqdúódd XþL/ 654&#!5!5!5!!2!"'Xª£Á¹¥þð÷þ ÷ýÄ$þ'Ùþ'¬ß¦¹þþ»Ô§c£Ì†“¦e“e“¨þ°¨þ°aÔŠþÓf†JÿÿNÏç=ÿÿNÿãÏÊsþΕDU767654'&#"#"'&5733272632632!"'4'&'&#"'6763232767654'&'&#"Ž_}yj#1Q€–\$˜####‚,TGG\<‚„lG2ûe$°òþ×sa#0EKXQn#?QY>™k›DMý4þëÇgiàMq«Ìþí¢ÿã†ðE#"'&'&5476?&'&547632#"'&547654'&#"3"32767'_²ûilE_†m²l=Oc{ñˆT3-2") %+fa@aP/Z_|«{w:maZÂu> IhA¬"%@_©®Šl$=P”‹czS2VN-2!$+%$+@e—}N069n™¦a[u>_Tÿß M#"'&'!#!"'&547632327676=!7!&#"#"'&5476!27327î#X':'7á?<=ÿ**MÆþô€_4. B^l{>!þ—'Ba>ÁnG#&#w§4$Bš»00!ò£K=ýÜDc˜„€KÊ_4B( 03B{>ce‚¹DInFT=I,F´w§7K. 0É#Õ )5!!5!3#ü¦ý°Pʪ¸ªÉ9ÿÇBk32767"'&'&47'&'&'#"'&547632326765&#"6767632377632#"'&'&'&#"×,5(.'*'E`Ÿ97®y{7a;f7;>F3.^PeMD*#7@,j!HhH<=.%_yi¥pp3 T}€œ˜²B',$ *ý5Ü€/,,@!;Da97žT‘³þÄþÉþVMæ;©nwFþí»³^O?/,%!;>jytŸÖX<;}f?E'_n¥þúþôþ± Hô—˜''#  .hÿçJ) 4&#"322#"&54©WOmVPm˜ËÝ¢˜ËÝ÷t}þþÏt{ýØ£ÆþÿØ£Ægÿã²ð4 4'+5654/&4?'&547 '&5474/Ä‹c2üû›>B¬d=VEõÄ/b5Œšñc2ltc2¶c2Ðþuc1‚LS2œ?B¬dÖ,>8?]/c6¼›ñc1‚LS2ý–tc1‚LS2¶c1‚LS2ÿûÿã9ñ03#!".54?>3!4'.#!".54>323!2¾O,‡"ûô"…$„%@ý;5H *ÖY[¶ü#$‡"†x2 1[G(  Wÿ¸Að,!2#"&/#!"54?>3!!"&5462TPl 0%= -d,þmF"…$…þºmG- .7#*(/ ‚ý$þû"Sae(!‡Íq~B;Vÿ¸ºð&!"&54>323!2#"&'&5 ýmG * 5G 0%9 . ¦q~( 0 (/ ‚&ýJ“s!S'DQIF× 4632#"&3!53#5!¼pQOooOQpƒ˜ýo——ùTQooQOonûuyy5yZÿÕR; ! ! ! ! þHHþ¸þæþåé#ïþ[þŸþžþ[¥breþHþý¸Â ôÝ!#þÅþ‡y;:xÑ— L`  !!!!#!3#'!#33 # #—ƒþ¼þD—ƒµjÿ—wŠZþDZŒÖõöþÃRþëþé``€þ¶ýéþC5ü€ææ€þ³MþRþ.}þƒÞ$ÿðz`-1%5"'&'&5#2327#"'&5#!#"#463!#3#‰, †9áYl(Ht„ý*§þ²=Z2dr¥¶ý!††Z4@'!8¢ ýÖ¦zEB¯ ñÊbýãüüLs¨{dþYþ¯˜þsZ{3#"#4763 3×®UE‚El4FŒÅ©dGQõ´‰n ‚ËCFÁþ\þ§þxŸBýú¾*WŸbOZý=šþþÉþ¾ýýÈ0Õ 3%!!,Ê:ý*þnqúó ddúÕÉÕ3!3!!!!ÓÊûÊ þnýìþn8qúó úó úqúÕþwSÁ ! ! !!5 5¦ýþüúüð—üúüðùÆýþÚY*üÖü§çdüÖü§ccS£ÿã»ð!!6$3 !"$'53 !"kJýîu ^‹þuþ¢’þùopü‹þíþîk¨þþo¦SUþgþ“þ’þgHF×_`2/.2%©Õµ:Üüì1´•/ôì0!#!5!©Êý)¡+ª¨Õµ:Üüì1´•/äì0!5!¨ü_×Õú+ª+ÿüçÕ!# #3çÙþbþeÙËfýšÇý9WJÕ " )327&#!3676654'&|²¨tKþ"þPýý"ûcõ­â“öþoûÊû¯ÍÐAfÕµ|ßcvþ~þ–ÕdúóA‹Aúó xûãPfUÂmZÿã­ #2!7#"547632!3 32767654'&#"ç* 6¯B8wxþ²!Nbb|Ëž"#>Ë|OO'vNþþ÷† ý2½¥wx87¥tžKsO= † =‚üí¨d01 ”P²²D10d^dú¬Tþdü6‚‚ŸžJthi[ÿã“{ (232767# '&5477632!7!654'&#"Ú N¡&# ¨G_yZ\klmkþô}Z5µ³üäfFý 9N©JC0<7h:‚ýJ(u*œo¦DM¢¡‘c“FPZd82vRsO 3#3#!!ɸ.¸Ô†²†$þ²ÚNéû9˜ü`ÿþV 3##676#732767!ɸ.¸fʆÐ#5H2KþÜÜ1i0/éNÞ)deéú¿ûеT0Hôd01™¬ûŒÖ``;ÿã¸ð&0 #473>32#"&'532654&7>54&#"ºþ;Hºt]þéühäƒñ2††02Þ¸S¥UWžDiƒ;2[UÔ _¦I@YËr„~•YWþí×€ác?}<¢Å$$¶/1oX3gÎQ¡X’Â?@Qˆ` $@   F ÄÄÔìì21@‡‡¼/äìÔì0!5!!5!ˆüÉþù`û “o“Ëÿÿ‰ÿã`ð' &5&{ R‹ýdÿÿ‰ÿãtð' &5&{ T‹ýdÿÿ‰ÿã ®ð' &5&{'{‹ýd MÀýdÿÿ‰ÿãXð&{' &5u‹ýdÿÿ^ÿãXð&t' &5u‹ýdÿÿ‰ÿã^ð&{' &5 P‹ýdÿÿ^ÿã^ð&t' &5 P‹ýdÿÿbÿã^ð&u' &5 P‹ýdÿÿ?ÿã^ð& O' &5 P‹ýdÿÿ‰ÿã~ð&{' &5 Q‹ýdÿÿfÿã~ð& P' &5 Q‹ýdÿÿ‰ÿãwð&{' &5 S‹ýdÿÿbÿãwð&u' &5 S‹ýdÿÿfÿãwð& P' &5 S‹ýdÿÿlÿãwð& R' &5 S‹ýdÿÿ‰ÿãð&{ &5ÿÿÉ“Õ,ÿÿÉ'Õ&,,”ÿÿÉ»Õ&,',”,(ÿÿÉQÕ&,9éÿÿhÕ9ÿÿ˜Õ&9,ÿÿ,Õ&9',,™ÿÿ ÀÕ&9',',™,-ÿÿÉÕ&,;Üÿÿ=;Õ;ÿÿ=®Õ&;,ÿÿ=BÕ&;',,¯ÿÿÉjÕ/ÿÿsÿã'ð&ÿÿɰÕ'ÿÿÉÕ0ÿÿÁyLÿÿÁé&LLpÿÿÁY&L'LpLàÿÿÁA&LYÂÿÿ=`Yÿÿ=½&YLDÿÿ=-&Y'LDL´ÿÿ=&Y'LD'L´L$ÿÿÁJ&L[Ñÿÿ;y`[ÿÿ;Ô&[L[ÿÿ;D&['L[LËÿÿÁyOÿÿqÿãç{FÿÿqÿãZGÿÿº{Py }Õ  ) !3 !## !5²–þhþPýŒþPþh–²Ÿô5þáþËôÊôþËþá5Õþ—þ€þ~þ–j‚€iúÑ.,ûw‰þéþÔþÒþèɰÕ#ûº +¸ º+¸º+¸¸ ¸ÐAêú]A)9IYiy‰™©¹ÉÙ ]¸ ¸ÐAêú]A)9IYiy‰™©¹ÉÙ ]¸¸%ܺ"+¸º+¸º+¸º +¸ 013 !#3 #32654&#! )“ô5þáþËôHðñÿHNŸ““Ÿþ蟲–þhþPþaY³.,²ÂÏÐÞý茊Þþ—þ€þ~þ–y }Õ(1C3 +3 !32654&+! ) #"35# !35#"&546!`HðñÿHô5þáþËôNŸ““ŸNÕýŒþPþh–²t²–þhü±NŸ““ŸNôþËþá5ôHÿñð/²ÂÏÐó.,ü°ŒŠü j‚€iþ—þ€þ~þ–ߊŒž²þéþÔþÒþè³ÃÐÏÂÿÿsÿã'ðHÿÿÿãõ{sþV'ð.# !267## !2'fç‚ÿþð‚çfÉ v„þ­þz†S†íbÕ_^þÇþØþÙþÇ^_ý¹$ŸghŸGÿÿWÿãXð' &5'u‹ýd MdÌ?8 ´  ÔÔÌ2@ @@ 00 ]1@  œ Ôì99ÌÌ0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY5!!d‰xéÃû=éxUZ‰xéªéx£Ü @  œ Ôì99ÌÌ1´  ÔÔÌ2@ OO ?? ]0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY3'#'-ZˆxèªêxÜþvxêû<ÄêxuÌP8 ´  ÔÔÌ2@ OO __ ]1@ œ Ôì99ÌÌ0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY'7!5!'7Pþwxéû=Ãéx¯Zþwxéªéx£ÿùÕ @ œ Ôì99ÌÌ1´  ÔÔÌ2@ @@ PP ]0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY#737‡ZþvxêªèxŠxêÄû<êxdÌP8Ú¶ ÔÌ2ÔÌ2@ PP_ _O O]1@   œ Ôì9Ì2Ì20@   œü<<@ œü<<@ œ ü<<@ œü<<°KSX· <<<<´œì´œì´ œ ì´œìY5!'7'7!d‰xé¼éx‰þwxéüDéxUZ‰xééxþwZþwxééx£ÿïÜÞ@   œ Ôì9Ì2Ì21¶ ÔÌ2ÔÌ2@__P POO@ @]0@   œü<<@ œü<<@ œ ü<<@ œü<<°KSX· <<<<´œì´œì´ œ ì´œìY3'7#7'-ZˆxèèxþxZþvxêêxÜþvxêüCêxþvŠxê½êx 4Ÿ³ 7!!# ?,þ¶^xü¢©t?©ü¢x^þ¶ 4Ÿ³ #'!5`?©ü¢x^þ¶³?ýÔJü¢x^© 4Ÿ³ %!5!73Ÿ?ýÔJü¢x^©s?©^xü¢J 4Ÿ³ %'3!_?©^xü¢J4?,þ¶^xü¢©dÌ?8'!5!!BÈ”—ýÿéxþw‰xédÈ”—š-þ¥Uéx‰Z‰xé[UþúªuÌP8!'7'7!'!5rÈ”—éx‰þwxéýœÈ”—þf×[UþúéxþwZþwxéþ¥Uª,ÓžP4327>76767632&'&'&#"#"'&/#7!í#/)85,0F"<;NJX[GR7<"#!2)85,/$#?2WG[XJN; ©?,þ¶ô!F0O<:" %7xþŸýéxUZ‰xéaxþÂþÂxaéxuÌP8 '7!' 7!'7PþwxéýþŸx>þÂxaêéx‰UþwxéþŸx>>xþŸéxþwdÌ?8 !5!3#•ûçéxþw‰x骪-éx‰Z‰xéYü¤¥Ü %'3'!!5èxˆZˆxèZü¤ªêxŠþvxêû檪uÌP8 †· œÔì2ÔÌ2@ O O _ _ ]1@  œ ÔÌÌü99ÌÌ0@  œ ü<<@ œ ü<<°KSX³  <<´œ ì´ œ ìY!#3!'7'8û窪éx‰þwx-þ§\þ§éxþwZþwx¥ÿùÕ !5!!7#7þ¨\þ¦èxþxZþxxè+ªªûæêxþvŠxê¥Ü7!!5!7'3'¯èxþx‚ü¤€þxxèèxˆZˆxèÂêxþvªªŠxêêxŠþvxêdÌ>†%52#!5! 767>54&'&'&>42/+-+-':1 üHéxþw‰xéÙÙܪ-)o=Ü  éxþwZþwxé(.46<=69)-dÌ>†>3276767654'&'&'&"5476767632+#5!5‘‚ 6 ©+/24>A1:'-+/24>‚©ý”éxþw‰xé×  ‚‚=69)-(.46=<69)-ÜÜéx‰Z‰xévÌP†>54'&'&'&"3)'7'7!#5#"'&'&'&5476767632# 6 +léx‰þwxéý”©‚>42/+-':1A>42/+ׂ  éxþwZþwxéÜÜ-)96<=64.(-)96=dÌP8X#532267676767632267676;'7'7#""'&'&'&'&'&""'&'&'&† éxþw‰xé 0$#$   "%'-0$' !  ' '- éx‰þwxé  ('Z&("  "(&Z'( -éx‰Z‰xé$ -#%"&* 'éxþwZþwxé ""&*  *&"" d¾PF%'!5!!'7'7! pþœéxþw‰x领 pdéx‰þwxéþ^¾:5éx‰Z‰xéo:þËéxþwZþwxé*ÿüØ %'7 ý!§^ßÁ bþ9YþÁ‹¾þXxýî¨û¸¾‹þÀÈbþñZ ò #!5 ªþéxþw‰xé‘ûoçéx‰Z‰xé¬[ò !'7'7!#¬—éx‰þwxéþª‘éxþwZþwxéüZÿã Õ !5!3 ýiéxþw‰xéíªDéx‰Z‰xéç¬ÿã[Õ 3!'7'7¬ªíéx‰þwxéD‘üéxþwZþwxéÝÿùÔ 7#7!5³éxþwZþwxéýÔÔü=éxþw‰xéªdÌ? !5!3?ü=éxþw‰xéª-éx‰Z‰xé,- eX&7#754767676 #4&'&'&"9èxþxZþvxê.-\ZnllnZ\-.ªBB54'&/#7!!#"'&'&'&54767D !BB54'&´x\-..0YXpl€…gtTY0../Z#þ¶,@ª#B"!BB@RN¾JV°]xþw‰x]TQ>°]x‰þwx]þ¬xL iiþ þ`iiTÁ4¬]x‰Z‰x]à4¬]xþwZþwx]JÒiiiiuÌP8!7'!7!5!7!'7'7!'7!5½giiþþÚyýìYu‚I0]x‰þwx]ýÌu‚Iþ«iiÒÒxÊK]xþwZþwx]ÊKxdÌ?8!!5!!¯ûÉ]xþw‰x]7ûQix]x‰Z‰x]xi¥Ü#'3'#'ñx\xˆZŠx^xh°ûP8^xŠþvx^ûȰhuÌP87'!5!'7'7!5$iiûQ7]x‰þwx]ûÉiix]xþwZþwx]x¥ÿùÕ737#73ñjhx^xþvZþxx\x%hh°ûÈ^xþvŠx^8dÌP8!7'!!5!'7'”iiüli…ý\]xþw‰x]¤]x‰þwxiiiá]x‰Z‰x]]xþwZþwx¤ÿðÜ7''3'7#7ñiiiá]x‰Z‰x]]xþwZþwx°ülii”iü{¤]x‰þwx]ý\]xþw‰x ÿѳ #7!##ÉPUý©?,ƒûUü°•vü°Uû„,?©ýUP¼ÿÑŸ³5#'#5!#5'ö•ü°Uûƒ,?©ýUv”ü°Uû©?ýÔ„ýU¼4Ÿ 753!5373öü°Uû©?ýÔƒýUP•qPUý„ýÔ?©ûUü° 433!'3É•PUýƒýÔ?©ûUq”PUý©?,„ûUdÌ?8!!!!5!!cÜû$ŠRü&xþw‰xÚû®¾xŠxx‰Z‰xxuÌP8!5!'!5!7'!5!Qû$ÜŠû®Úx‰þwxü&RFxŠxxþwZþwxxdÌ?8#''''#53777?(F´´´´´ncéxþw‰xé‹F´´´´´n-F´´´´´néx‰Z‰xéF´´´´´nuÌP8577773'7'7#'''un´´´´´F‹éx‰þwxécn´´´´´F-ªn´´´´´FéxþwZþwxén´´´´´F£Ü3'!!!!#!5!5!5!'-Zˆxè(þØ(þتþÚ&þÚ&êxÜþvxêþŽªªªþ¬Tªªªrêx£ÿùÕ#7!5!5!5!3!!!!7…ZþxxèþØ(þØ(ª&þÚ&þÚêxŠxêrªªªTþ¬ªªªþŽêxdÌ?8 5!!5!35!d‰xéqþéxªÿªÿUZ‰xéªéxaªªªª£Ü 3'#'3#3#-ZŠxêªêxbªªªªÜþvxêþŽrêxþVþªÿuÌP8  '7!5!'7%!#'#5Pþwxéþqéx‰ûÎÿÿªÿUþwxéªéxþw(ªªªª£ÿùÕ 737533-þvxêªêxþv‚ªªªŠxêrþŽêxþv4þþ¨ÿkË?9 !#3?ûîêxþvªªŠxêתêxŠþ~\þ€ŠxêuËI9 !'73#'7!uêxŠªªþvxêûî×êxþv€ü¤‚þvxê7†?~ 5!! !!Ïþö  ûôdþü ûôŒþöþöƒý}üüþïþ*^V 3! !!dþöþöƒý}üüþïþ*p þöûô düþûô H†P~ !! !!¸ûô  þ’ûô üŒƒþòƒ þÖþ^ÿÍVÕ #!# !!!dƒþòƒ þÖþe ûôþön ûôþ^V !! !3 3!!!Eþ*þïüüþïdƒþöþöƒrþ*rþò$èüþþ|è þöþþÔþ¤\d”^V )3! !3#!5#3 3 üšÈþïüüþïÈýÆÈžÈƒþöþöƒ\°üþýPd””x þö@t %#!5#3'!3!3! !33'ÓȞȡdþxd¡:üšÈþÑþÑÈýÙètø””Zddû®\’ýæýnªt^V%#!3!3! !3!5#3ĹØtIüš¹þþüüþþ¹þ¹tø”äØû\°üþýPìû”x^V%3 3!!! !!3 37áƒþöþöƒrþ*þïþèüüþèþïkŠþöþöŠ€dô þöý dôüþþè| þö€^V %#!5#3 3!3!! !!33 37ÓȞȃþöþöƒ:üšÈþïþèüüþèþïÈþÍŠþöþöŠ€ø””` þöü¨\˜üþþèþh þö€u†}~ 7!! !5#35! u\°üþýPd””x þöÏfÈþþÈ:Èýbȃ  ƒzMÕ!#7!!#Múc"?,þ¶^xü¢©ÕcúŽÕþŸ?©ü¢x^þ¶zMÕ35!3!5!73zpcþÞ?ýÔJü¢x^©crú+a?©^xü¢J^ÿÍV 3 3# '! !! !áƒþöþöƒƒ  þþþïüüþïe  þöüõþö dþüCüþuÌP8)5A '7!"'&'&'&'#5367676762!'7$"!&'&'!27676Pþwxéþ¡ 21@=“:C.2 ¾¾ 21@=“:C.2 _éx‰ü_R#)l$hþ˜$#R#$Uþwxé@21.2@ª@21.2@éxþw#þðÿÿwÿù;Ü' , þÔuþtP'7!5!'7!5!'7!5!'7Pÿÿþwxéû=Ã××û=Ã××û=Ãéx‰ÿÿUÿÿZþwxéª×ת×תéxþwZÿÿdÀ?D5!3!!#!d‰xé3ªæþªýÍéxUZ‰xémþ“ªþ“méxuÀPD '7!#!5!3!'7Pþwxéýͪþæª3éx‰Uþwxéþ“mªmþ“éxþwdÀPD3!'7'7!#!5ª‰éx‰þwxéþwªþwéxþw‰xé×mþ“éxþwZþwxéþ“méx‰Z‰xédÀ?D5!333!!###!d‰x駪ªªþ⪪ªþYéxUZ‰xémþ“mþ“ªþ“mþ“méxuÀPD '7!###!5!333!'7PþwxéþYªªªþ⪪ª§éx‰Uþwxéþ“mþ“mªmþ“mþ“éxþwdÀPD333!'7'7!###!5œŒdŒ éx‰þwxéþàŒdŒþàéxþw‰xé×mþ“mþ“éxþwZþwxéþ“mþ“méx‰Z‰xé7Ä?@  !¥úJþB¾JˆôúAþƒ¾¾þƒ‚uÄ}@ 7'!5! úúPû¶J¾þBˆúúþÅ‚}þBþB7Ä}@7'! ! úúü–úý6þB¾Ê¾þBˆúúþ ôúAþƒ¾¾þƒ}þBþBhÕ %!3!3¼ýÛ ýÆÕˆ¡ˆÒýÇÇçüRÕþú+‡ÿãnðmº+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]º+¸º +¸0132#&'&#"327673#"‡ ûû…B!ÊOœœOÊ!B…ûûþ÷ézÆcI7™þÍþÌþÌþÍ™7IcÅŒ_ÿãÄL 0"'&547632654'&#"563 3276767&#"µ\m`c²u\6% G¼Gnth r5?£€þÁ,/H@3H5,Yš„:$Ue·¾”˜I+HQ\‡N­,¨öt­qƒþ¸œzSd69->eSY×®lÉ‹Õ !5!!5!!5‹ü>øýøýÕú+ªìªëªÉÿ¢‹5!#7#53!5!!5!733!‹ýKªc˜˜þÐd˜þ0ª4˜êþ☶Õú+^^ªìªëª``ªþëýkþì›ÿì]®(673#"'&'#7&'&$32 '&#" 32$767&'&Yj€iEdÈþ ¹»°80~iª?/cÆ`»¹°üÉô‘™šþÝRQQ$gý'-‘š™"SRR:;nSz²þ€þ¾_'œÒBT±€c¾_ ûé¥N“‘››‘@DüRO“‘››‘gÿú`Á8@ÔÌ91/ÄÌ90@cmpxyvn]] !3!¬þ^DýïàCúšîûÄú?ÿú`Á%! !¬¢ü¼3ý½fý½Ó<úñÁú?¯ÿìI®!!"$54$3!!!W?JŒ‰”¹ýGÀþ¾¾cÀ¹ýG”‰‹K@ õsJx‹NLŸÆ`»¹`ÈŸMOŠx] ¯þåI¯&/!!!!3!!"''&'&54$;7#"Ø–I$þ¢¹ý¯°$$¹ýGA?d–`,,±¾¾cÀêüÝFU ;¸°“Š}YI¯7ÊŸþ þŸ þî7c`»¹`ÈüÅJx‘H ¸ üNG’x]Ù›åg% $54$)!!3!+þØþÖ*(ºþFèiNvüŠ%Frߺ›öððöŽO:…Ž‘0QޝÿìI®&'&'&'!5!2#!5!676767!5¡?JŒ‰”ýG¹Àc¾¾þÀýG¹”‰‹K@ û 'Jx‹NLŸÆþ »¹þ ÈŸMOŠx] ¯þåI¯&/'7!5!!5!&#!5!2+4'&'&'3276765 –IþÜ^¹ýéQ°$$ýG¹A?d–`,,±¾¾þÀê#FT‚ ;¸°“Š}YIþå7ÊŸü ãŸ 7þøcþ »¹þ È;Jx‘H þH þNG’x]Ù›åg )5%2767!5&'&!5“(*þÖþØþFºèiNüŠv%FtÝþFgöñïöŽP:…Ž‘1RŽ,ëâ ¸/¸/01!!,¿âüœþwqÁ@×Ö¯ggÔìÔì1üìì20!#!#œÕðý ïÁø¶}ùƒœþwqÁ@ÖׯggÔìÔì1ü<üü03!3œïöðþwJùƒ}ø¶þw;Á ]@    ÔÄ91ÄÔÌÎ990@0QVPZ spvupz €€ Z pp{ t €€ ]]!! !!5 7êüA ýJïúÞÕýIÁÁý3ýÀ•!ãÙ-Û×¶œÔÄ1Ôì0!!ÙúþתÙÛ !#!5!3!!5!®¨ýÓ-¨-ýÓý+ƒªƒþ}ªתªÙÛÕ Wº+¸¸Ð¸¸ и¸ и¸ и/º +¸ º+¸¸¸и¸ Ð01!!#!5!3#®-ýÓ¨ýÓ-¨¨ þªþûªû5ÌÿÿÿB²ÕÿÿŠÿ’<%?ŠP¯%73% %#'±þTU¬¨¬UþT¬UþT¨þTU‚÷“÷ïþ÷“÷÷“÷þï÷“ÿÿDG¾ÂrýÒÿÿXYª© %ˆ=ÿ×} *@    ÔÌ91ÔÌÄ903##'%\½sý®BþÁ}}`ùºs-Pbý;ÿÿ=ÿ×v& ¤us†ÿÿ=ÿ×e& ¤ Os†ÜåÛå 127#"#"'&'&'#"'&547632676;#"3¥c‰d3668+MI6641C;It‡Y^^SI6?+((C;ItK@”t‰kðHMfpEF„?$Tx5@ej¯¨re!93Ex5@ƒðþúÜåÎå#/;&'#"'&54763267632#"'&%27#""327654'&¥1C;Js‡Y^^TŽI6?+((C;Js‡Y^^TŽI66þ6¥c‰d3778ë•s~Šd3778]$Tx5@ej¯¨re!93Ex5@ej¯¨reMðHMfpEFôðþúHMfpEFË™I%!3!™û‚ªÔË~ü,¯IÕ%!3Iúf¹òüËÊÊÕúõ¯ÿ”IÕA¸/¸/º+¸¸Ðº9º9¸¸к901%&'&'3!!#4'!&'7`'JAWþÎã`òþLqR]+XþÉŒü* PÊ‹†s^þã(ýRs“§°Ê57756uíÿúÜÑ5º +¸ ¸ /¸/º 9º 9º 901 7&'7%%'6 676rý{Ž‹ÔþŠEG…þ%†yýÝ44RÀW!L!$îÒ¾³Æ ¡“¿Òñ&!L éþçþð{ž°þJP+3#°  +øfþJ›+ 7º+¸¸и¸и/¸/º9º 90137#'° ûPþµ ýMVÕüœ°oçü)g±nþJð+3#3#  @  +øáøfþJ›+{¸/¸/¸¸Ð¸/¸ܸи¸ ܸܸ ¸и¸ и¸и/¸/¸ /¸/º 9º 9º 9º 9013737##'   [P«   ]MæEü+qdý @oxûº×pü™÷AnÓ¢!3# iúhÃþÞþÝ¢û^¬üTÓ¢3 3#Ã#"Ãþ˜ú¢üT¬û^Ó¢32#4&#"#õñðõ¬”¥¦”¬P(*þÖþØý°7ôÓÓôýÉÓ¢332653#"¬”¦¥”¬õðñõRPýÉôÓÓô7ý°þØþÖ*uþM¶>2&#""&'7327㢗~”9GA¢—~”9Gâ§…}Œ‚¯ú°§…}Œ‚¯ÿÿuþMÛ& µ µ%ÿÿuþM& µ' µ% µJuþM¶-6?67632&#"#"'&'7327&'&5476767654'&'ãSOJMG7”9GcBnnVsSOJMG7”9G]InoSuŠ=,EG%,½=,HK%â§DAF7Œ‚¯þÖK|’œoUþ¾§DAF7Œ‚¯1Io›œsVý›/HgjG$þ4Ö.JhgH$uþMÛMQZc67632&#"!67632&#"#"'&'7327!#"'&'7327&'&54767!!67654'&ãSOJMG7”9G~SOJMG7”9GcBnnVsSOJMG7”9Gþ‚SOJMG7”9G]InoSu‰~þ‚¾=,HK% =,EG%â§DAF7Œ‚¯þâ7§DAF7Œ‚¯þÖK|’œoUþ¾§DAF7Œ‚¯$þçDAF7Œ‚¯0Io›œsVý’ñþ!Ö.JhgH$ºþ+/HgjG$uþMmqu~‡67632&#"!67632&#"!67632&#"#"'&'7327!#"'&'7327!#"'&'7327&'&54767!)!67654'&ãSOJMG7”9G~SOJMG7”9G~SOJMG7”9GcBnnVsSOJMG7”9Gþ‚SOJMG7”9Gþ‚SOJMG7”9G]InoSu,þ‚ýÛ~þ‚¾=,HK%2=,EG%â§DAF7Œ‚¯þâ7§DAF7Œ‚¯þâ7§DAF7Œ‚¯þÖK|’œoUþ¾§DAF7Œ‚¯$þçDAF7Œ‚¯$þçDAF7Œ‚¯0Io›œsVý’ñþñþ!Ö.JhgH$ºþ+/HgjG$uþL.3&#"7#'754'&'#"&'7327#4767>32";EY?w^H¾6¼H\O3,, HO€”;E+@/VfmVm HO€ö‚¯þ³?uœ]H½½H]sM3 üg¥‡z‚¯ˆ.Vr›mV_¥‡zuþM<%4'>7'7&#"7"&'7327&'&54767>2·=,HK%€˜=Q ‡Hl;EYLmHH§7'&#"'"&'7327&'&54767>2·=,HK%m#6,=iSH²;Ec‹¤HKÂsŸ˜€”;E]InoSuŸ˜€JÖ.JghH$6B0þ+‚@THþÖ?¤HK|Àþ¾¥‡z‚¯1Io›œsV<¤ˆzÿÿyÍžÕ' Oÿžþ…' Oðþ… OGÿÿyÍžÕ' OGþ…' Oð Oÿžÿÿ¡ÍtÖ' OÿÆ OÿÆþ…ÿÿyÍžÕ' Oð' Oÿž' Oðþ… Oÿžþ…ÿÿÙ-Ûj' O$ œÙŸÜj 3#3#!!ÓÓÓÓûÐXü¨þËþ•ªÿÿØŸÜj& œ' OÿýþW' Oÿþ$' O-þW O.$ÿÿÙŸÛj& Æ' OþW O$ÙÓÛ2#"'&'&'&#"5>32326Ûi³an’ ›^X¬bi³an“ ›^V©2³NE;=LT³NE;=KÙÓÛ23276767632.#"#"&'Ùg©V^› “na³ib¬X^› ’na³i2UK=;EN³TL=;EN¢1Ô).#"3".54>323265.#72#"&:QŸHRdhNiœ\dŽnxÂ>@°HRdhNiœ\dŽnxÄ.ttlH=Y›OšHL¢\}X[lH=Y›OšHL¢\}ÙWÛ­#"'"#322Û{ûædfftXª{ûædfftX×ý€ÖÜþ#€þ*þ$ÝÐ0!#.5476767654&'30´ND:323267#"''æcDX¬bi³a]y¬›¨eEV©gi³a`y«›S LT³NE+~FþŒ KU³NE,þ…FÙÛ¢ #"/&'&#"5>32326!!Ûi³an’›^X¬bi³an“ ›^V©ûeúþo³NE;=LT³NE;=Kˆ¨Ù`Ûô#"/&'&#"5>32326!!Ûi³an’›^X¬bi³an“›^V©ûeúþô²OE;=LS²NE; =KþkªÙbÛÓ%&32767#"'!!'7!5!7&#"5>32Ë%H\¯ i³aBPŸü﹉lþ噸‘ZX¬bi³an“3ïý}oþé -X"²OEºªþdšªó8LS²NE;IüÙ¸ÛÁ"#"/&'&#"5>32326!!!!Ûi³an’›^X¬bi³an“›^V©ûeúþúþÁ²OE;=LS²NE;?KþkªËªÙÛÁ.#"/&'&#"5>32326#5!7!5!7!!!!'Ûi³an’›^X¬bi³an“›^V©üLç•ÑýšŒoþKÐ…üɦoÁ²OE;=LS²NE;?KüLªËªŠsªËª sÙÿöÛB.32767#"'!!!!'7#5!7!5!7'&#"5>327b K`Jqi³a'+\+ýzlòü³h’>ùTmþ?u2›^X¬bi³an“c†’"%]²OE«ªËªÂNtªËªÚ=LS²NE;%úNÙÛô;?@.9*-" *œ19œ"œ œ<-<Ô<Ä21ÔìÔìÜüÔìÀ9999990#"'&'&'&#"5>32326#"'&'&'&#"5>32326Ûi³an’ ›^X¬bi³an“ ›^V©gi³an’ ›^X¬bi³an“ ›^V©o³NE;=LT³NE;=KÚ²OE;=LS²NE;=KÙÛÿ43267#"'3267#"/'&#"5>327&#"5>29+V©gi³a@LJ“ZV©gi³aƒ}¤‰9+X¬bi³a@MH’ZX¬bi³Â ¤a KU²OE»8KU³NE; þ˜@^ LT³NE»8LS²NE;f@Ù¸ÛÉ59#"/&'&#"5>32326#"/&'&#"5>32326!!Ûi³an’›^X¬bi³an“›^V©gi³aq›^X¬bi³an“Æ3V©ûeúþL²OE;=LS²NE;?KÒ²OE;=LS²NE;?KüîªÙyÛÑ5P#"/&'&#"5>32326#"/&'&#"5>32326#"/&'&#"5>32326Ûi³an’›^X¬bi³an“›^V©gi³an’›^X¬bi³an“›^V©gi³aq›^X¬bi³an“Æ3V©ײOE;=LS²NE;?KÒ²OE;=LS²NE;?KÒ²OE;=LS²NE;?KÙ¸ÛÁ"32?632.#"#"&'!5!5Ùg©V^›“na³ib¬X^›’na³iúþúþÁUK?;EN²SL=;EOþȪªþ‹ªªØ×Û+  %5 % $%5$[þáþœg&Yþ¢þà%Zþ£þÞþàþhÓ¦²•¦²—³¦²—¤²—Ù6ÛÎ9%676767!!"'&'&'!5!!5!676762!!&'&'&[C-8›þö7VYÎYW6 þöœ8.CC.8þd 6WYÎYV7 þe8-Ù,CE[¨<0[2332[39¨\DD+N+DD\¨93[2332[0<¨[EC,Ù`ÛÎ !5!676762!!&'&'&!![C.8þd 6WYÎYV7 þe8-ý;úþ++DD\¨93[2332[0<¨[EC,ýãªÿÿÙ`Ûÿ' O¹ ÿÿÙÛÿ' Oýº&  O¹ÿÿÙÞÿ' Oÿþ¹&  O0ý½ÿÿÙÝÿ' Oÿþý½&  O.¹ÿÿÏ62Ï' Oÿôþî' Oÿô‰ WÿÿÍ63Ì& ô' O…† O…þîÙ`Û¢ 3654'!!5!&547!5!!æ44ò34wúþ~þ€þ‰ú0IG00GG2ðªª?8>;¨¨_8Ù`Û !!!!"264&'2#"&546Ùúþúþ…Hdd‘deH;k'**¨z{¤§¢¨ðªDbFE``‹bq+((d:s¡žvv£Ù`ÛK!!!! &!56Ùúþúþ‚áàþÿþæé¢¨ðªë—²—•²—Ù`Û!!!! 3# Ùúþúþ$´Ÿ¾¸¢¨ðª‚ýcÙþ'Ù`Û!!!!33#Ùúþúþ$¦¸¾Ÿþý´¢¨ðªþ'ÙýcÙ`ÛÊ!!!!!!'Ùúþúþú+]^*ò^ôó]¢¨ðªNþä°þä°°Ù`ÛÔ !!!!!3!Ùúþúþ‚¦Nßp!ýN¢¨ðªÀþNfýÙ`Û07GO!!!!#"3###535463!3267#"&546324&#"'53#5#"&4632264&"Ùúþúþ¤?$mmC???DíþÏNB&H#$J'`qk[Q_C<17HÆBB@,I\\I,@Íp`ctiG6B?9iÚýÐ=$#t¾u#g“SS“SÙ`Û*!!!!>32#4&#"#4&#"#3>32ÙúþúþŸ!]?U\Z79EPZ7:DPZZV:;S¢¨ðª==:xoþµHOM]QþÊHPL^PþÊ%U20=Ù`ÛÚ ,!!!!3#7#546?>54&#"5>32Ùúþúþ4eeb_--B6'Z0/`4\o$-,¢¨ðªÈN2A+,/-7#!^aO&E++ Ù'ÛÝ>@" Ïœ Ï œ  Ü<Ä291Ô<Ì2ü<ìþ<ì990!!!!!'7!5!7!Ù}®/þHÃ{üúþþ}®þÕ¶Ãý‡¢;fÕ¨ðªþÇfÓªðÙ¸ÛL !@  Ü<<Ü<<1ÔÜÜÜÜÜ0!!!!!!ÙúþúþúþתªýÀªÙÿÎÛ4!5!7!!!!!!'7!5!7!5!•ýD€™Q"þrñýµn¹üé™RþÝoþL¢ªèT”ªËªËªêT–ªËªÙÛ  )@    Ü<Ü<1ÔÜÜÜÜÜÜÜ0!!!!!!!!Ùúþúþúþúþ”ªªüKªªÙÛ¨ T@.œœœœBѧœ $# ü<ì2291/ìôì90KSXííííY" 5 !!Ûü@Àúþúþúþøþëþî²pªoüªÙÛ¨ V@/œœœœBѧœ$ # ü<<ì291/ìôì90KSXííííY"55 !5ÙúþÁAúþø°þ‘ªþ²ýǪªÚÿVÜ 3!! 5 !!Úúþü@Àúþúþúþªþëþî²pªoüªÚÿVÜ !!555 !5ÜúþúþÀBúþªªk°þ‘ªþ²ýǪªÚþ±Ü!5!7!5!7!!!!' 5'þ³Ú`ýÆȉŠ)Pþ"_=ý6ŠŠÞü@Àúþªªsª¤s1ªsª¥tFþëþî²pªoÚþ±Ü!5!7!5!7!!!!'55'þ³Ú`ýÆȉŠ)Pþ"_=ý6ŠŠþÜúþÀªªsª¤s1ªsª¥tF°þ‘ªþ²”.Ìß 5 5ÌüÆ:ûÊ6üþüÆ:ûÊ6þpþrÅŸ ÎþpþrÅŸ ”.Ìß 5555”6ûÊ:86ûÊ:ÎýöŸýøÅŽÎýöŸýøÅްþò'!67&'&54767&'676'&'{)#Y4JJ4Y#)þÀ)#Y4JJ4Y#) AAAAGF£žâßà㞢GGGG¢žãàß➣FGú2;;âÎá;<<;áþ2â;ØÜè5$?$%5%67$'W´É ßeþöþ»²Ä”‡·Èþûäd?þNÿÄ”])]²o&¶—²¯ bRô)`²q%µ ˜²¯ þŸRÙÛd%'%5% >ýz™‡“þ­ˆmþzÈþF<ß˶êþ½@6´¦ o@æh¶‹GpÙÿ Ûÿ%5'75%7-ý†™‡“ïüå­ˆmþá†ÈºþÄ%˶êC@þÊ´¦þàþ‘@æh¶‹GpÙÿ/ÛV !5!%5%%%!!'’þ‰/ôþƒ½xýËv¤H-þ‰réýÛf‹ý5L¤OlUýrªC¢ªÝ@=ÇV°lþÑŒ²žþíªÑ=Ùÿ/ÛV%'!5!75%7%5!!'‘ ÖþþøGWþbè[ý½„¤ÚýmmüÁN¤—L>üߪìw²‹õ§°·e=þ¨ˆª½þتÑ=Ùÿܨ$%#"'&'&'&#"5>32326 5Üj²bn’ š^X¬bh´`n” œ^V¨gü@Àúþð´ND:3232655Üj²bn’ š^X¬bh´`n” œ^V¨ûfúþÁ²NF<>LT²NF<>L>°þ‘ªþ²Ùÿ)ÜP14%&#"5>32%5%%%3267#"'&'&/' k X¬bh´`'+kýÆu¥E%þsäýák œ^V¨hj²bn’ "P¥vþ„1-LT´ND£ªÞ9A»T°jþÍŠ²œþãLT²NF<þñ=ß &T²N#¡w²‹ô¨°¸f=ý€J;ÐÿNÜ} 55 5ÚúþÀ8ü@Àúþ'°þ‘ªþ²»þëþî²pªoÐÿNÜ} 5 55Òü@ÀúþûúþÀ'þëþî²pªoö°þ‘ªþ²ÐþmÜ`!-%5%%%'5%%5 MMþÜ`ýºÂZ¦D„þOAòýè@ýFZ¦Dþt¸@þmþ¬*³_TW§ªÊˆ&þÔo°}þ䎲š¥ªÈþw&-r²~‘°›ÞbUÐþmÜ`!7/%5%%'%5%75%À®˜J¦’¤ýv±a¦d®ýì",ý©,ƒýV`¦bþL"ýÌ_D2,£/*/¼°Å¨&þO{ª˜”Ÿ°­Â¸²Äþ[&®}ªš”¢²­Ùÿ²ÛP %5$Ûþrýó ’þoüsaþa^þ~ï|¦|Ùÿ²ÛP 55%$Ùsüþo’ ýóaïþ|¦|þï‚^aÙÿ)ÛW!%5%5$Ûþgü—V¬þþ$Üþü}ƒ×¾‘®…ßþå]]þå×x„¦|€Ùÿ)ÛW3%55%$Ù¬Vü—þgƒü}þÜþ$¡…®‘þBW×þ€|¦„þˆ×]]ÙÿRÛW(%#"'&'&'&#"5>32326%5$Ûi³an’ ›^X¬bi³an“ ›^V©gþþ$Üþü}ƒ±³NE;=LT³NE;=K$þå]]þå×x„¦|€ÙÿRÛW(%#"'&'&'&#"5>3232655%$Ûi³an’ ›^X¬bi³an“ ›^V©ûeƒü}þÜþ$±³NE;=LT³NE;=K$×þ€|¦„þˆ×]]ÙÿƒÛ&%5$%67%'îðþÛÃEƒ¹žtºÖ‹$÷ãþ‚ë‚k—¡}u°U)¦?¥eKþtu•ï³uþÔíï"¦þ K 9'ÙþåÛ'567$'567&'Æð%þ=þ»þ⃹žtºÖ‹þÜ÷ã~ë‚þ•—¡}uRU)¦?¥ý›KŒu•ï³u,íïþÞ¦÷Küö9'Ì£è_%!"54763!!"3!èüÂÊþ슊È@üÀˆ¾^`ˆ@£ÈÆ‹–ÀˆŠ^`Ì£è_75!27654&#!5!2#Ì@ˆ`^¾ˆüÀ@ÈŠŠþìÊ£–`^ŠˆÀ–‹ÆÈþêÌÿ;èÏ #";3!!!!#"54763¢úˆ¾^`ˆ0ørªrnþdÊfýlpªpÈþꊊÈÉÀˆŠ^`&pþ–ýp–þ˜hÈÆ‹Ìÿ3èÇ 32654'&+ #!5!!5!32#úˆ¾^`ˆ0ørªrþ’œÊýš”pªpÈŠŠÈ9ÀˆŠ^`üÚþp––hþ˜þêÈÆ‹¾Ûè7!!!"'&54763!!"3!òéûéüÁÉŠ‹‹ŠÈ@üÀ‰¾_`ˆ@––,‹‹ÈÆ‹–ÀˆŠ^`Ùöè7!!5!27654&#!5!2#Ùéû@ˆ`_¾‰üÀ@ÈŠ‹‹ŠÉ––,–`^ŠˆÀ–‹ÆÈ‹‹¾ÿÛ× '!";!!!!'7!5!7&'&54763!7!!Ñþʉ¾_`ˆ'œ}ýE=øüÉa†LþéT>¹‚‹‹ŠÈsc†L0þ’RÀˆŠ^`–––í5¸––ƒ‹ÈÆ‹ï7¸–Ùÿö× '327654'&/!5!7+!!'7!5!7!5!^»ˆ`__BV™ý 5c†TpX‹‹ŠÉ÷?àüãb†LþÐm>þUéÂ`^Šˆ`C –ï7Ë XÆÈ‹‹––í5¸–––¾ÿjÛé )5!7!!'!"'&54763!!"3!Äþ.Bqx-ëý¥qxDüÁÉŠ‹‹ŠÈ@üÀ‰¾_`ˆ@––Z<––Zi‹‹ÈÆ‹–ÀˆŠ^`¾ÿjÛé )5!7!!'5!27654&#!5!2#Äþ.Bqx-ëý¥qxþ'@ˆ`_¾‰üÀ@ÈŠ‹‹ŠÉ––Z<––Zi–`^ŠˆÀ–‹ÆÈ‹‹Ó¢332653#"757!!¬”¦¥”¬õðñõîÄ54&'&'$  &'&'&547676!!#!5!ÅÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbÍdþœªþœdŽ''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb„þ›ªþ›eªe»ÿãù$7!!"2767>54&'&'$  &'&'&547676¡rüŽ$Ö]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbתa''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$3?"2767>54&'&'$  &'&'&547676''7'77ÅÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbíýüxüüyýüxüüŽ''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcbþ¾üüxüýyüüxüý»ÿãù$7 "2767>54&'&'$  &'&'&547676æpxýgÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cb†pxý€''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$73#"2767>54&'&'$  &'&'&547676ðÔÔÕÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbþ‹''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$ 2L"264&'2#"&54>"2767>54&'&'$  &'&'&547676ZPnn noO@v+..¹†‡´¸ðÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbAoPOmmžp1.-rB„·´‡†ºÌ''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$+E %#'-73%"2767>54&'&'$  &'&'&547676ðþ½C4þÑfþÑ4Cþ½4/f/÷Ö]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cb1¯°X·þ­S·X°¯Y·Sþ­·''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$!;!!!!"2767>54&'&'$  &'&'&547676€ý€€ý€«Ö]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbjˆÀˆô''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$37"2767>54&'&'$  &'&'&547676!!ÅÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cb8€ý€Ž''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcbþª»ÿãù$!%!!!!#!5!QûX>úÂôdþœªþœd‰ûð›ú¿Yþ›ªþ›eªe»ÿãù$ !!!%!!¡rüŽPûX>úÂת\ûð›ú¿»ÿãù$   ' 7 %!%!!=þ•kyþ–þ–ykþ•yjjüûX>úÂìþ–þ–xjþ•yjjyþ•k$ûð›ú¿»ÿãù$ 3#!%!!ðÔÔþaûX>úÂþ†ûð›ú¿¯Jš@ ÜÜ<Ü1<ÜÜÜ033!!¯úäšýuýp¯Jš!#!5!3Jú䋯Iš!#!5Iýs€ýsšúå¯Iš35!3!¯€úå¯|š33!!¯Ný²šýuýp¯|š !#3!!!!.Ný²Ný²šþ$ä¯Jš !#3!!!!.úäúäšþ$ä¯Jš !3!!!#3¹üGþšýuýpš¯Jš !#33!!!#3.GVýªþšúfšýuýpš¯Jš!#3#3!!!!.c¹üG¹üGšúfšþ$ä¯ÿ¯Jë33!!!'!¯'SsþÅjý\þªs=þšýuÜ5ýYý6«ýp¯ÿ¯Jë!!!!'!#3!7!¨sêý­j½ýþþséþhx¥jýÃë5þäýÓ6÷þ$šþ$þää¯ÿ¯Jë!!'!#3!#3‚sþÅþ6þªs=þžüÿë5ýYý6«ýpšýuüñš¯ÿ¯Jë!#3!!!!!'!#37!‘ôsê:þŒjÞýçþþséþìþ²jþGšþ$-5þäýÓ6÷þ$šüÁääÙÿ§Ë]*5$%67654&#"'632#"'732654'&'$Ù›@Èe=M>P7sZ ˆ°”ãþ‰wã”°ˆ Zs7P>M=eÈþÀ.¨(Y7O0<0:>~j yŸ[Œ<<Œ[Ÿy j~>:0<0O7YÙÿ§Ë]*327#"&5476%$'&54632&#"ËþeþÀÈe=M>P7sZ ˆ°”ãwþ‰ã”°ˆ Zs7P>M=eÈ@›.(Y7O0<0:>~j yŸ[Œ<<Œ[Ÿy j~>:0<0O7Y(ÙÛæ 51ü¢úþ Äþžýœ¦ÙÛæ ƒ^ü¢ª bbü:Èýï¦ÙÿžÛd 5! 5Ùªü¢úþbªªÄþžýœ¦ÙÿžÛd 5! Ùû¨^ü¢ªbªªbbü:Èýï¦yg‡¢62"'&'!"&462!6"264ŸS몧òQ3ýQ3Tò¢¦ëW4¯üdrOOsOOS¨ï¤Q3CB3R¢ò§U4CDPrOOqyg‡¢"&462!6762"'&'!$264&"aS몧òQ3¯3Tò¢¦ëW4ýQœrOOsOºS¨ï¤Q3CB3R¢ò§U4CDPrOOqbgR¢ 7!6762"'&'$&"26bÀ1[륢òS4šOsPOtO.¨D/Y§ò¢R3BŽPQqOOyÿ ;d 3#!!#3%!5!¨¨( ý󀨨þØýó dýó€ªýs €ªî<›!##5!#T~èNèÈì 35!3 3#ÈKûõÃ#"Ãþ˜úªªìüT¬û^Èì !!3# ÈKûµ@iúhÃþÞþÝìªú¾¢û^¬üTÈì !!3 3#ÈKûµ@Ã#"Ãþ˜ú쪠üT¬û^™~ )3!!&'.'&™û‚ªZV¥îF%ü,E=Î?~þë%Fî¤VZDý¼A?Î=™~ !53ïüÖ*ü,ÔªÔüÖªªÔû‚ÿúþw–Á # #·ßËý}ý}ËÝÁø¶wù‰Jÿúþw–Á 3 3Ùý!˃ƒËý#þwJù‰wø¶ŒþwÁ@ ÜÜÜÜ1@ ÜÌÌ0"# #4$HÛþÌ­½þ½­þÏãüû9àB(þØþ¾û ÇúåŒþwÁ@ ÜÜÜÜ1@ ÜÌÌ02$53 3HÛ4­þCþþC­1åãüÇû þ¾þØ(Bàû9úå‚‚€€ rþðþþþ‚þðþòþþþÛH®F·ƒÔì1Ôì03#ÛÓÓFþù1  !!'ù+]^*ò^ôó]ýþä°þä°°ÙÛç3#3#!5!7 !! 'ßööööRþL´þ‹xÊÊxþ‹´þLuxþ6þ6xõÉöþ<ªuxþ6Êxþ‹ªþ‹xÊþ6xÙÿÂ'B  ' Ù''üÙ›þâ>€ý°Pú€Nq^ýD^þ¢ÆÙÿÂ'B %  !'üÙüÙ''ýtþÊþ¢àNý²€ý°PÝþ^ýDÙÿÂ'B 5  5!Ù''üÙüÙŒ6âbàý²Nú€Pý°Ýäþ¢¼ÙÿÂ'B5 5ÙŒýtNüÙ>àáâÝû]ÝPÙÿÂ'B 5 'üÙüÙNýtŒ>Pý°Ý£ÝþþÙ`Ûô32?632.#"#"&'!5Ùg©V^›“na³ib¬X^›’na³iúþôUK= ;EN²SL=;EOþȪªcy¢ 33#c×u?Ik×þ8fºf¢þþ%ÚqþüÝ#cy¢ 33#cÈfºfÈ×þ•I?þ‹#üÝþqÚþ%þ¾ÿúÛ )!"3!!"'&5463!! '&76)!"3!Ûýk:((P:•ýj€ZY²–ýkþñ¼½½º—ýjÈŠ‹‹ŠÉ• ()9:PªZX‚€´üD½¾  ¿½ª‹ÆÈ‹‹Ùÿúö )5!2#!5!2654'&#5!27654'&#!5! !Ù–²YZ€ýj•:P((:ýk•ÉŠ‹‹ŠÈýj—º½½¼þñ ª´€‚XZªP:9)(ü‹ÈÆ‹ª½¿þôþó¾½ÒâN$!4&"#47632! #4'& äPtPªZX‚€´üD|À¼ªŠŒþpŠŒÆ:PP:ý:È€ZX²€ý8Æx¼ºþðý8ÈÈŠŠŠŠÊý:Òÿãâ1$2653#"&5! '&3 765ÐPtPªZX‚€´¼þ„ýèÀ¼ªŠŒŠŒ1ý::PP:Æý8€ZX²€Èý:þðþˆ¼ºÈý8ÈŠŠŠŠÊÆ|8Õ4'&'##47673#ŽZ:KªK:ZªŒl‘ª“lŠªŸ€Y:ü:Æ:Z€ýaÈŒlaþŸlŠÈýaÙÿ4ÛÕ###!5!5!5!333!!!!'5#Yªªªþ~‚þ~‚ªªª‚þ~‚þ~ªªÌ,ýÔ,ªð¨3ýÍ3ýͨðªªððÙ^Û¦ 3# 5¤ÓÓ7ûøúþþîþ‘þ“¶ѦÑÙ^Û¦ 3#55=ÓÓdúþþî¶þ/¦þ/¶m”. Ìß  5 5 5 ÌüÆ:ûÊ6ýüÆ:ûÊ6üþüÆ:ûÊ6þpþrÅŸ ÎþpþrÅŸ ÎþpþrÅŸ ”. Ìß 555555”6ûÊ:86ûÊ::6ûÊ:ÎýöŸýøÅŽÎýöŸýøÅŽÎýöŸýøÅŽÙþ.ÛÔ  5 !5! 5ÙÁü?úþúþü@ÀúþþÞ²þªþ‘þªNþëþî²pªoÙþ.ÛÔ 5 5!55Ûúþü?þ¿úþúþÀþÞ°oªp²þî9ªªø°þ‘ªþ²ÙÛ¨ %5 5!Ûúþü@þ¾°°oªp²þî9ªªÙÛ¨ 7 5 !5!ÙÁü?úþúþ°²þªþ‘þªÙÿ)ÛW5$%5$ÛþTüªi™þü}ƒþþ$Ü€þ_…®‘¾ú©×€|¦„x×þå]]Ùÿ)ÛW5$%$5Ù™iüªþTÜþ$þƒü}þ€×þB‘®…ý!]]×þˆ„¦|þ€Ùþ“Û!&!%'&'57&%5$%67&%7Ûþóþ*þズÕÿÚ?ðþص;öƒ¦½‚ÈâiöÚþ€@šþ]0qw^×%¤ý¡KA6#®(A‡F+¦3273267#"'' 5æcCX¬bh´`^xn›ieEV¨hj²b_zl›]ü@ÀúþLT´ND*óFé JV´ND+ðFÍþëþî²pªoÙþåܨ"%&#"5>3273267#"''55æcCX¬bh´`^xn›ieEV¨hj²b_zl›þ[úþÀLT´ND*óFé JV´ND+ðFͰþ‘ªþ²Ùþ¦ÛW&&#"5>3273267#"''%5$æcDX¬bi³a]ym›ieEV©gi³a`yl›]þþ$Üþü}ƒ. LT³NE+óFé KU³NE,ñF”þå]]þå×x„¦|€áþ¢ãW&&#"5>3273267#"''55%$îcDX¬bi³a]ym›ieEV©gi³a`yl›þ[ƒü}þÜþ$3 LT³NE+ôFê KU³NE,ðF˜×þ€|¦„þˆ×]]ÙþöÛ 7%'%5 '瞃Ùý¹ÛžÜýâL ‹Ðž‘þ  @þÁYû8ðýè@à¦\üïÄ9þ@aÎÙþöÛ ' 7%ÍžƒÙGÛžÜü´þô‹Ðž‘öþö@?YÈð@ýçà¦þ¤ý<9ü@þŸÎÙþ}Û…5!%57%!!'71ŽÏý| ýäIÁžÛý·…Îüìvž\'þ žÄ:þýqª†ß¦[×@þÅZû8ñþ»ªþß@áÐ_ÍÕþ}×…7!!'7#5!7%%%Õ¥éžé¿ý9ƒJüpvž\º]þFGjqœÈþé8@ýǹ¦þÛþÀªþß@áªäµý  &vvýŠýŠrèèýþn66\]Ú]\6666\]Ú]\6¨Šîîþèî5þ•kØkþ•üæ\­þSü¤þSÈÚ]\6666\]Ú]\6666\þªîþèÿÿš!ŽˆYþ÷ÏZ  "27654/2#"&546573éÊ2332Ê233—¡ªª¡¢ªªþVßæ‰VV¬­VVVV­¬V¯ÞÓÔÞÞÔÓÞü¬Ñ)t'ü½ÿ‚ÿã¤>32#"&'#'%53%&  s:±{ÌÿÿÌ{±:¹þé!8¹#!þ¼r§þܧ§$¶daþ¼ýðþ¼ad¨æ]chÀƒaamü@–ççþjç’þ.‚Ð!3!3: ¨ü¨þØøý^¢˜ÿì”è &Ûº+¸º#+¸#º+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]º+¸º +¸ º$%+¸$¸Ð01! 4$32! 4$#"35%33!”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶|Ùì¡Úý—êþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹ýÿ~+˜/ü掘ÿì”è 8?º+¸º3&+¸3º+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]¸3¸и/Aê&ú&]A&)&9&I&Y&i&y&‰&™&©&¹&É&Ù& ]º,9º+¸º +¸ º+¸º0)+¸001! 4$32! 4$#"!!56$7>54&#"5>32”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶O´ý\R!>/_N;„sa‘=£Å0>²êþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹ýÿŽMñ"?U(?N&:«$—}:iF§˜ÿì”è Dµº+¸ºB5+¸Bº+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]Aê5ú5]A5)595I5Y5i5y5‰5™5©5¹5É5Ù5 ]º5B9º,5B9¸,/Aê,ú,]A,),9,I,Y,i,y,‰,™,©,¹,É,Ù, ]¸ܺ&9º;9º+¸º +¸ º)"+¸)º?8+¸?º2/+¸2º/2901! 4$32! 4$#"#"&'532654&+532654&#"5>32”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶¹ vØÃ@ˆX[}DuskcŒ‘ZX\[4yk_ˆ=¡ÁhêþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹–]œ¨0OLGNŒ<:,+¸>º2+¸201! 4$32! 4$#""32654&.#"632#"&5432”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶¡N\\NN\\ÔTa/w €N ºÂ ¹ÀêÈ5jêþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹Ÿb[ZbbZ[bœ#”P =±”‘³ýçÚ ˜ÿì”è "ë¸#/¸$/¸Ü¸#¸и/¸ÜA&6FVfv†–¦¶ÆÖ ]Aåõ]¸¸ÜAêú]A)9IYiy‰™©¹ÉÙ ]º 9º!9º+¸º +¸ º!+¸01! 4$32! 4$#"!#!”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶k«þ”ÁQþ1êþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹Kü£˜ÿì”è '?K º+¸º=+¸º1F+¸1º+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]A&6FVfv†–¦¶ÆÖ ]Aåõ]AêFúF]AF)F9FIFYFiFyF‰F™F©F¹FÉFÙF ]º%F19¸%/Aê%ú%]A%)%9%I%Y%i%y%‰%™%©%¹%É%Ù% ]º+=9¸+/º4F19¸%¸7ܸ+¸@ܺ+¸º +¸ º":+¸"º.I+¸.ºC+¸Cº4C901! 4$32! 4$#""32654&%.54632#"&546732654&#"”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶¯T__TT__þÆj·¶iv¾­­¾vWQMKRRKMQêþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹æPIIPQHIPIvStˆˆtSvƒ\Š——Š\ƒÁ=BB=>BB˜ÿì”è 4@‘º+¸º>)+¸>º+¸º/8+¸/A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]A>&>6>F>V>f>v>†>–>¦>¶>Æ>Ö> ]Aå>õ>]º)>9Aê8ú8]A8)898I8Y8i8y8‰8™8©8¹8É8Ù8 ]º+¸º +¸ º 2+¸ º,;+¸,º5&+¸501! 4$32! 4$#"532676#"&54632#"&2654&#"”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶Ua.w €OŸºÂ ¹¿éÈ5kÙN[[NN\\êþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹ý‹œ$“O <¯”‘´ýèÚþö´b[[bb[[b˜ÿì”è &2>›º+¸º#+¸#º*<+¸*º60+¸6º+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]Aê0ú0]A0)090I0Y0i0y0‰0™0©0¹0É0Ù0 ]Aê<ú<]A<)<9<I<Y<i<y<‰<™<©<¹<É<Ù< ]º+¸º +¸ º-9+¸-º$%+¸$º3'+¸3¸$¸Ð01! 4$32! 4$#"35733!"32654&'2#"&546”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶Íž¬¼uŸþ>@EE@?FF?‚ˆˆ‚ƒˆˆêþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹þ>>'‰*ý6€Þ—£¢——¢£—{äÑÐääÐÑäÿìjå5!ùj¬¬ÿìål!ùXþ¨þ¸3 þ öÈþ!È@þ ö<j• 5!!5!!5!r#ýB#ýB#j¬¬¬¬¬¬<•l !!!!!r#ýB#ýB#Xþ¨Xþ¨Xþ¨þm¸ 333     þmjý–jý–jý–Èþm !!!È@þÀ@þÀ@þmjý–jý–jý–<j• 53353353353<¼x¼x¼x½j¬¬¬¬¬¬¬¬<•l 3333333<¼x¼x¼x½Xþ¨Xþ¨Xþ¨Xþ¨þn¸ 3333       p¢þ^øþ¢þ^¬¢þ^ýª¢þ^Èþn !!!!È@þÀ@þÀ@þÀ@p¢þ^øþ¢þ^¬¢þ^ýª¢þ^þå!!ÍýÓþ¬û–þål!!ÍýÓþlþ¨ûìÈþå!!Èþ#þ¬û–Èþål!!Èþ#þlþ¨ûìÿìþ¸!5!ýÔÌþj¬úêÿìþ¸l!!ýÔÌþXú”ÿìþ!5!Èþ$þj¬úêÿìþl!!Èþ$þXú”jå3! -jû•¬å3! -mûëþ¨Èjå!!È@Ýjû•¬Èå!!È@Ýmûëþ¨ÿìj¸5!3, j¬kúéÿì¸!3, Xú“ÿìj5!!Ü@j¬kúéÿì!!Ü@Xú“þå3!! -ýÓþ û•¬û–þå3!! -ýÓþ ûëþ¨ûìÈþå #!!!P@ÝýÓþjû•¬û–Èþå 33!!ÈP -þ#þkû•¬û–Èþå!!!È@Ýþ#þ û•¬û–Èþå #!!!P@ÝýÓþmûëþ¨ûìÈþå 33!!ÈP -þ#þlûëþ¨ûìÈþå!!!È@Ýþ#þ ûëþ¨ûìÿìþ¸!5!3ýÔ, þj¬köÿìþ¸!!3ýÔ, þXöÿìþ !5!!#ýÔÜ@Pþj¬kúéû–ÿìþ !5!33Èþ$, Pþj¬kû•úêÿìþ!5!!Èþ$Ü@þj¬köÿìþ !!!#ýÔÜ@PþXú“ûìÿìþ !!33Èþ$, PþXûëú”ÿìþ!!!Èþ$Ü@þXöÿìþå!5!!ýÔùýÓþj¬¬û–ÿìþål !!!!ýÔÌ-ýÓþXV¬û–ÿìþål !5!5!!ýÔ,ÍýÓþj¬Vþ¨ûìÿìþål!!!ýÔùýÓþXþ¨ûìÿìþå!5!!Èþ$ùþ#þj¬¬û–ÿìþål !!!!Èþ$Ýþ#þXV¬û–ÿìþål !5!5!!Èþ$Üþ#þj¬Vþ¨ûìÿìþål!!!Èþ$ùþ#þXþ¨ûìÿìjå5!3!, -j¬kû•¬ÿìå !3!!, -ýÓXû•¬Vÿìå 5!3!!5, -ý3j¬kûëþ¨Vÿìå!3!, -Xûëþ¨ÿìjå5!!!Ü@Ýj¬kû•¬ÿìå !!!!Ü@Ýþ#Xû•¬Vÿìå 5!!!!5Ü@Ýüãj¬kûëþ¨Vÿìå!!!Ü@ÝXûëþ¨ÿìþå #!5!3!¸ ýÔ, -jû–j¬kû•¬ÿìþå !!3!!ýÔ, -ýÓþXû•¬û–ÿìþå !5!3!!ýÔ, -ýÓþj¬kûëþ¨ûìÿìþå !!3!!ýÔ, -ýÓþXûëþ¨ûìÿìþå !5!!!!ýÔÜ@ÝýÓþj¬kû•¬û–ÿìþå !5!3!!Èþ$, -þ#þj¬kû•¬û–ÿìþå !5!!!!Èþ$Ü@Ýþ#þj¬kû•¬û–ÿìþå !!!!!#ýÔÜ@Ýþ#PþXû•¬Vûìÿìþå #5!5!!!!Pþ$Ü@ÝýÓþV¬kûëþ¨ûìÿìþå !!33!!Èþ$, PÝþ#þXûëV¬û–ÿìþå !5!533!!Èþ$ÜP -þ#þj¬Vûëþ¨ûìÿìþå !!!!!ýÔÜ@ÝýÓþXûëþ¨ûìÿìþå !!3!!Èþ$, -þ#þXûëþ¨ûìÿìþå !!!!!Èþ$Ü@Ýþ#þXû•¬û–ÿìþå !5!!!!Èþ$Ü@Ýþ#þj¬kûëþ¨ûìÿìþå !!!!!Èþ$Ü@Ýþ#þXûëþ¨ûì<j•5!35!<ðyðj¬¬¬¬<•l!!!¥ðû§ðXþ¨Xþ¨þÀ¸Á33   lUü«ûTTü¬ÈþÀÁ!!È@þÀ@lUü«ûTTü¬ÿì¾åÂ5!5!ùûù¬¬þ¨¬¬xþX333x   þ ö öþå !!!!ÍýÓ-ýÓþ¬¬¬üBxþå !!##xmþs  þ¬û–jû–xþå !!3!!xmý3 -þsþ¬úêj¬üBÿìþ¸ !5!5!5!ýÔ,ýÔÌþ¾¬¬¬ú>ÿìþX 5!###l   j¬úêjû–jÿìþX !5!!!5!¸ý4lþ þt,þ¬ú>¾¬û–¾å 3!!! -ýÓ-¾ÃüA¬¬¬xjå 333!x   jû•kû•¬x¾å 3!3!¸ ü“ ÍküA¬þ¨Ãúé¬ÿ쾸 5!5!5!3,ýÔ, ¾¬¬¬¿ú=ÿìjX 5!333Œ   j¬kû•kúéÿì¾X 5!35!3Œ ýÔÌ ¬¿û•þ¨¬ú=þå 3!!!! -ýÓ-ýÓþ üA¬¬¬üBxþå 333!!x   þsþ ö û•¬û–xþå 3!33!!¸ ü“  -þsküA¬úê öj¬üBÿìþ¸ !5!5!5!3ýÔ,ýÔ, þ¾¬¬¬¿öÿìþX !5!333xþtŒ   þj¬kö öÿìþX 5!3!5!33Œ  þt,  ¬¿û•ú꾬û– öÿìþå !5!!5!ýÔùýÓý4ùþ¾¬¬üB¬¬ÿìþå 5!!###ùþs   j¬¬û–jû–jÿìþå 5!!5!3!!ùü“þt, -þs¬¬ú꾬û–j¬üBÿì¾å 5!5!3!ùû, -¾¬¬X¬¿üA¬ÿìjå 5!333!Œ   j¬kû•kû•¬ÿì¾å 5!5!333!ùûŒ   ¾¬¬X¬¿û•küA¬ÿìþå!5!5!5!3!!!!ýÔ,ýÔ, -ýÓ-ýÓþ¾¬¬¬¿üA¬¬¬üBÿìþå5!333!!###Œ   þs   j¬kû•kû•¬û–jû–jÿìþå !!!!5!5!333!¸-þsþ þt,ýÔŒ   þj¬üB¾¬û–¬¿û•küA¬þå 43!!"ªªyþ‡Y[þp¥¬~|üÿìþ¸ 4&#!5!2[Yþˆx¨¬þp~|¬þ¨üÿìj¸ 5!2653#xY[ ¬¨j¬~|qü¨þjå !"&533!åþ‡¨¬ [Yyjþ¨qü|~ÿ§þ*m3YѲû/þ Yö§ÿ§þ*m#3*²û/²þ Yÿ§þ*m # # 3 3*²ýðýñ²iý—²²ý˜þü¬­üûSÿìjh5!|j¬¬À¸3 ÀÁû?hjå5!h}j¬¬þ¸À3 þÀû@ÿìhl|Xþ¨ÈÀ!È@ÀÁû?hål!h}Xþ¨ÈþÀ!È@þÀû@ÿìål5!5!!5iý—j¬Vþ¨VÈþ333ÈP PþÀÁû?û@ÿìål!!!iý—XV¬VÈþ#!#P@PþÀÁû?û@ÿÿÿì;([ÿìþ;ÿ!Oþþûÿìþ;ÿö!Oþöþ ÿìþ;!Oþüñÿìþ;!Oþûìÿìþ;!Oþúçÿìþ;!Oþùâÿìþ;#!Oþ#øÝÿìþ;(!Oþ(÷Øÿìþq(!…þ(÷Øÿìþ§(!»þ(÷ØÿìþÝ(!ñþ(÷Øÿìþ(!'þ(÷ØÿìþI(!]þ(÷Øÿìþ(!“þ(÷Øÿìþµ(3Éþ(÷Øÿÿþ:(c' ÿìþq( #'+/3!33!33!33!33!33!3§ÊüÊÊÊüÉòÊüÊÊÊüÉòÊüÊÊÊüÉþþûþûmþûþûnþûþûmþûþûnþûþûmþûþû ÿìþ4('/7?GOW_gow‡—Ÿ§¯·¿ÇÏ×ßçï÷ÿ#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573µ¿¿’¿¿’¿¿’¿¿ü¿¿’¿¿’¿¿’¿¿ú¿¿’¿¿’¿¿’¿¿ü¿¿’¿¿’¿¿’¿¿ú¿¿’¿¿’¿¿’¿¿ü¿¿’¿¿’¿¿’¿¿ú¿¿’¿¿’¿¿’¿¿ü¿¿’¿¿’¿¿’¿¿(ûûûûûûûþûûûûûûûþûûûûûûûþûûûûûûûþûûûûûûûþûûûûûûûþûûûûûûûþûûûûûûûÿìþ;(!%)-13#3#3!3!##!#3#3#3#3#3#3#ÉÉÉÉÉ^Ê^ÊÊý¢ÊÊÊ(ÊÊþlÊÊþlÊÊ(ÊÊþlÊÊþmÖÖþû÷Øþûþû¶þûýýŽþûýÿÿÿì#;(X#ÿÿqþ:(f…ÿìþ!(þûìþ;!(þûìÿì(!(ûìÿìþ;(!!!;ù±('þ(ûìÿìþ;(!!!('üØûìûìÿìþ;(!!;üÙüØ(ûìûì(ÿìþ;(!!!OüØüÙ(÷Ø;(!(ûìÿìþ;(!!!!'(üÙüØûìûìÿìþ;(!!'(þ÷غÿÕ$!ºü ùàºÿÕ$!!!,7úÉrŠ<úR ùàºÿÕ$ %3!254#!") ) ,äoääü‘ärVoVþªü‘þªZäätääüŒtVþªüŒþªÿÿºÿÕ$'xºÿÕ$ !%!5!5!5!5!5!5!5!5!5!ºúW7úÉ7úÉ7úÉ7úÉ7úÉü ùàr°r²r°r²r°ºÿÕ$ !%3#3#3#3#3#ºþá°°þܲ²þÞ°°þܲ²þÞ°°ü ùàt8úÈ8úÈ8úÈ8úÈ8ºÿÕ$ #'+/37;?CGKOSW[_cg35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#!L²²$°°"²²üš®®®®®®®®®® ²²²²²²²²$°°°°°°°°"²²²²²²²²$­­­­­­­­­­ûˆ®®®®®Ü®þ.²þ,°þ,²þ.®Ü®þ.²þ,°þ,²¸®þ.²þ,°þ,²¸®þ.²þ,°þ,²¸®þ.²þ,°þ,²þ.®þÞ ùàºÿÕ$ !33775353535ºúWââ„ûý!ûûä¾yûB¢üߢþ|¢âü ùàTâüþ}üüß<ûB½ûäü ýüƒââºÿÕ$ !%353555#5#5#57#ºþ¬âýû„ûäû!úÉy¾yûBûüßûþ|ââü ùàrââƒüý!üûä¾ûC¡üà¡þ}¡âºÿÕ$  $(-159=AFKOSW\aejos7'#7'7'#7'7'7'#7'7'7'75#7'7'7'7'7'37'75'7'7'7'37'75'7'37'35'!,2|5y2~~2O~~5’þþ~|~þ2~~2ì~~5’þý~}}þµ}}~þµ~~~‰}1yþý|~|þ³|~|þµ}||þµ|~|þ³}}|ÿz4|2ˆ~12þ´~~~þµ~|~þ¶~~~þ³5“4~»}22þµ~}~þµ4“5~4z2ú‰31|4ýä2~~1O~~4þÿ~|~üÌ1~}1ì~~4þý}}~þµ~}}þ¶~~~ì|1þý|~|þ´}~|þ¶|||þµ|~|þ´|}}þ4|1í~2™1þ´~~~þµ~|~þµ~~~þ´44~~1™1þµ}|~þµ44~~41þÞ ùາ7!ºøüüº²%!!!,üìrøˆüvüüºšÕŽ%!!ÕùåšôºšÕŽ!!!cúÉ©ùå ýðrôºÿ­"!ºóúùäºÿ­"!!!,ýñróˆ8úVùäš!Ž%!!˜ûnŠ‘šôš!Ž !!!büSþïäûnŠ‘ ýðrôÿ!$  ü ùàÿ!$! ±Åýüó ŠÊúÄ ùàþ7 üüüüþ7! ±¢þ¯þüüˆ¦üèüüÿ!$ü üðÿ!$ xÅû;rRffúŠ üðþ7øüþþ7 x¢ý^røÁSSü¯üþ!7üþ!7 xŒûtrÁSSü¯üþÿ!$!üò$ùàÿ!$ %!±bcúüò²û6Êrùàþ!øþüþ %!±QQü³øþ ýZ¦rüÿ!$ùàÿ!$ êÅúWýšÌýšùàþøþüþ ê¢üzøþ­¦þ­þü!þü!  #ŒúWþ­¦þ­þüÿ!$  üòüðüðÿ!$ žuvýŠüó üòýˆxxýˆüðüðÿ!$ >ÕÕþ+ý‹uvýŠüó üò×þ)þ)×ýˆxxýˆüðüðpþÿ‹) )$7632#"'327$%&#"%632#"'‚þ~€~þþ~€~þeM¥¦§¥Mþ³¥§¦¥þ>‡ÃÃÄÇþyÃÄÃÃïJ’JJ’ý¶’JJ6ýÀ``ÀþÀ``ûÿ„âqqâü|âqqþ#îu"@ÔÌ91ÔÌ990 úþþôþ þ üÏüÇ9%ûÛûÓ-pþÿ‹) 327$%&#"%632#"'åM¥¦§¥Mþ³¥§¦¥þ>‡ÃÃÄÇþyÃÄÃÓýÀ``ÀþÀ``ûÿ„âqqâü|âqqrÿ‰' '/7?G%&'&'6767&'&'7%'676727"'64'7&"'62&47\+;.81F9K5Ú8.42d;E9Gœ,:.80G9J6ü&8.;+d1O9FíLšL&_À`Jný¡LšL'`À_ü¸n<1& j(0=Ju &,A=N:0('<1& j(0=Ju &1<>EB0(úÔn_I I'[Ê[Jný¡I I'[Ê[pþÿ‹) %/36%632#"'327&#"6767&'&6p‡ÃÃÄÇþyÃÄÃà AAAA‰««–,+-,,-+öA@@ãªR„âqqâü|âqqÅû¾%ö%m±ýܱ[úÐ0$û %@%¢ü|±"pþÿ‹) )73276'&#"7632#"'327$%&#"%632#"'™r99:9rr9:99í°XWXX°°XXWXþM¥¦§¥Mþ³¥§¦¥þ>‡ÃÃÄÇþyÃÄÃØþøB!!BB!!þo–e33eþje33¯ýÀ``ÀþÀ``ûÿ„âqqâü|âqqpÿ‹ @ ÜÔÌ1ÔÄ04767632#"'&'&pih¶µÒѵ¶hiih¶µÑÒµ¶hiѶµiiiiµ¶ÑѶµiiiiµ¶pÿ‹ $32#"$27$%&#pÑkÒÑkÑÑþ•ÑÒþ•<§¥Mþ³¥§A¢kÒÒþ•þ^þ•ÒÒa`ÀþÀ`pÿ‹ $32#"$"3pÑkÒÑkÑÑþ•ÑÒþ•<¦¥þ³M¥¦A¢kÒÒþ•þ^þ•ÒÒÝ`ÀýÀ`pÿ‹ $32#"$%&#"pÑkÒÑkÑÑþ•ÑÒþ•Õþ³¥§¦¥þ³A¢kÒÒþ•þ^þ•ÒÒ>À``Àþpÿ‹ $32#"$327$pÑkÒÑkÑÑþ•ÑÒþ•\M¥¦§¥MA¢kÒÒþ•þ^þ•ÒÒ>þÀ``Àpÿ‹ $  $"327$!pÑk£kÑÑþ•þ]þ•<¦¥þ³M¥¦§¥MýgA¢kÒÒþ•þ^þ•ÒÒÝ`ÀýÀ``Àpÿ‹ $  $"!pÑk£kÑÑþ•þ]þ•<¦¥þ³˜A¢kÒÒþ•þ^þ•ÒÒÝ`Àþpþÿ})6%63"'p‡ÃÃÃÃR„âqùÖqºþÿÇ)#2ÇþyÃÃÃÃÖü|âq*qºÿìš( 2654&#"!¬ú¬«|~­þ¹àú}¬¬}|««üv<ùĺþ ( $%632#"'327$%&#"!IM¥¦§¥Mþ³¥§¦¥þ>‡ÃÃÄÇþyÃÄÃÃþ_O•þÀ``ÀýÀ``ü|âqqâ„âqqùH(÷غ ( !#%&#")%632ºOþyÃÄÃÃþy¦úÏM¦¥¦¦MûìÂâqqâþ>~Á``Áºþ  3327$3!#"'$º‡ÃÃÄÇú@1þ³¦¦¥¦þ³þþ>âqqâÂûìþ‚Á``Á) %63"‡Ãæ¥þ³Ââqv`Àþ) 2#%&#ÃÇuþ³¥¦)qâþ>À`þÿ 527$3¦¥MuþyÃþÿv`Àþ>âqþÿ "'$33ÃÃþyuM¥¦þÿqâÂþÀ`p‹)%632#%&#"p‡ÃÃÄÇuþ³¥§¦¥þ³Ââqqâþ>À``Àþpþÿ‹03327$3#"'$puM¥¦§¥MuþyÃÄÃÃþyþÀ``Àþ>âqqâÿ!$ü ùàÿ!$ü ùàÿ!$!ü ÿ!$!$ùà3Ñ…! 2654&#"4632"&nŠÈЉce‹;­~|«¬ú¬údŠŠdc‰‰c|««|}¬¬ºÿÕ$!%!!ºüòœýdü ùàr<ºÿÕ$!%!!ºúW›ýeü ùàr<ºÿÕ$!%!ºúW7ü ùàr<ºÿÕ$!%!ºúW7úÉü ùàr<ºÿÕ$ !%!!!!ºý+cýý,býžü ùàr<úÄ<ÿ!$ 462"! W|VV}ýÜÅýüó ,|VV|Vþ ÊúÄ ùàÿ!$! cýüó ŠÊúÄ ùàÿ!$! ±büó ŠÊúÄ ùàpþ„(  7& $  %ñÅâÄâÅþ;âþ<âýºýûþýýüþýûìþûƒƒƒƒú¨*––þÖûXþÖ––ºÿÕ$ !!!!!!,7ýý,rúWbýžŠ<ý)ý) ùàIeºÿÕ$ !!!!%!!,ÔcúÉrúWbýžMý)<úR ùàreºÿÕ$ !!!!%!!,bÕúÉrý+cýŠ×eúR ùàreºÿÕ$ !!!!!!,7ý+ýžrý+cýŠe×úR ùàIepÿ‹  $32#"$!327$%&'pÑkÒÑkÑÑþ•ÑÒþ•‰‰þÌ]ý£4¦¥¦¦Mþ³‰ŠA¢kÒÒþ•þ^þ•ÒÒÚO²þ¬rþ¬²``ÁüÁOý+pÿ‹  $32#"$67$%&#"!pÑkÒÑkÑÑþ•ÑÒþ•uЉMþ³¦¦¥¦þÌÏý14‰‰A¢kÒÒþ•þ^þ•ÒÒ^OÁüÁ``²þ¬rþ¬²Ocpÿ‹  $32#"$!%&#"67$!pÑkÒÑkÑÑþ•ÑÒþ•\M‰‰Ðþ̦¦¥¦„Љ4ý¢A¢kÒÒþ•þ^þ•ÒÒ¼ýÁOÕT²``û%O²Tpÿ‹  $32#"$327$!%&'pÑkÒÑkÑÑþ•ÑÒþ•\M¦¥¦¦4ý0‰‰âþ̉ŠA¢kÒÒþ•þ^þ•ÒÒ¼ýÁ``²TÕOýúT²Oýÿ!$7!!xŒûtr ’úR ÿ!$ %!#ŒúW²ûn’rùàÿ!$!xŒûtrŠ’úü ùàºÿyê¯!!!,Lû´r0Rû<6úʺÿyê¯!º0‡6úʺÿÝ"K%!!!,„ü|rhOŠünû’ºÿÝ"K!ºh#nû’ÿ!$! #ŒúWŠ’úü ùà «€Õ "*2:AI3#''%#&'52#"'&5476!!'5%!!'53'5%3'5%3#'sMM7:ø=üýü=È-0ÐY ¾G.¯b#·CýKSþ­uYþ§G†r=øýµ;ö>MMÕþ¢^›?þ?îþ@Ç7µá`½d§?\µgþíOOOOþè‚y>ý*<þ?vþ¢^hÿû—á"3263#!5276;'4?'4?26õÙu'6‡"gPù39†.4!  '*ÌC0.xáèV#m14He ®'1l1 “Z+ddÈÕ?33 #&'&+"'&#"/573;2?"#'57#&'#"#5676!5‹:¸+#9,–p!—ˆj[%+ > 7ÓVCÅCc":Àï8Õ}þV .e3B=ýSe` e9*¤=9 3@=Úß}ªÿÿ‚k %C`Œ·ã:d»æ;emu}©Óý'S3273&'3327&'67&'67&'67'32654'&'2327654&#"3672 $54767&'&47'&327632#"/#"57#"54?'&5432'&27632#"/#"57#"54?'&5432'&327632#"/#"57#"54?'&5432'&27632#"/#"57#"54?'&5432'&327632#"/#"57#"54?'&5432'&27632#"/"57#"54?'&5432'4327632#"/#"57#"54?'&5432'&27632#"/#"57#"54?'&5432'&27632#"/#"57#"54?'&5432'&27632#"/#"57#"4?'&54327'4327632#"/#"57#"54?'&54327'&27632#"/"57#"54?'&5432&'67&'67&'67'&327632#"/#"57#"54?'&5432'&27632#"/"57#"54?'&5432'&27632#"/"57#"54?'&5432'&27632#"/"57#"54?'&5432'&327632#"/#"57#"54?'&5432üB€~ %<z*+'þë)+(@&'$Ê|÷¯®ø|e‹<-A}]\ŠB-7“„1SLoWŽþäþjþã\vLLý©)(0/ (( .1(%%,* # $ )*f$% +) $ #*+f%%,* $ $ )*ûË  ü»\o÷  [ ®%)#þ·&'%ü&)#`#$ *) $ #+,üU  þQ  0 üE%% +) $ $*+‰&EC&V*,)-)-*,þ%&%&žf“‘ÐБ“fU 3HhfeefhH2Ùpu^èQFs¥£ææ£¥sKQèGýh!99!  !77!  Ñ4 4 22 K44 22 22  11  š  þã     ¨      ¡    7   Ù     úà%&%&â%'%&%'%&22  //  g     û     ‚     ý44 22 ƒ© ->O`q‚“¤µÆ×èù +&'&54?632332?654/&#"2#"/54762#"/54762#"/54762#"/54762#"/54762#"/54762#"/547672#"/54762#"/54762#"/5476%2#"/5476%2#"/5476%2#"/5476D.2`{4&/<) eˆ>þúO ,4H3R 07K÷ $  ¨ $  Š # › #  # ½ $  Š #  $   $  ýU $   # " $   #  7Q=KG<s-8PZy9z €_e""#/2dt0&2j ,: . 4 . = , ý , þü  -  - ú -  -  û  . Ó . ç  , Ê  -  …ÿ÷§É !! …Wº»Vþºþþ¹9ýÇþŸýÈ`þ 8…ÿ÷§É !! 7 ! !…Wº»Vþºþþ¹DŒu€˜þ‘Žþ9ýÇþŸýÈ`þ 8þN þæÂ·þIªëÕ 7%7&5476°9 ý}îV&þ7àýÝA“ Õ6$ ý…ýôæþ8'^4?† ªÙ!2 7%7&547!&'6íI@ýÁçY%þ1çýï4åû¨HFÙS"ýÅþÕþ="l-2ßúüDC[9ª‚Ø &! 4$32 4$ #"&54>2‚þJþÉþËþJÉhº½hÈúqŠ0Š´þ¼þ¬þ¼´^mNMn2Z^Z2ìþÉþKµ7ÂiÁÁþ™Äþèþw‰±B®®þ¾±NmmN1Z00Z}ŸÑ C"32654%"32654&%#"&54767654$ #"&767&54! ±”ggJIhûœIhhIJgg[¶‚¶ZQoyþ±þ þ±y}WZ¶‚€·[zÀADÀégJIggIJggJIhhIJgU\‚··‚\Q s™´ýý´™rW\þü··\޶ø^þ¢ø±}ŸÉ A4&#"26%4&#"326! 547&'&632 $54'&'&632hIJgg”güMgJIhhIJg#þ@þ¼þ¿þ@z[·€‚¶ZW}yOàOyoQZ¶‚¶[s‘IhhIJggJJggJIggþ ÷þ£]÷´[¶¶þþ[Xr—´ûû´˜q Q\¶¶þþ\‹}ÿýâÆ "32654&7#"32†ÉÉŽÉǾ˜þÎÙ×þÎ/Ú`Tš_ÈŽÉÉŽÈ;™þPþÏ1°2ÓY}žÉ1"264&"3264#"54327&5432#"'&'3x©©ð©¨³ò¨¨yx©ü¾&þÿ·µþÿÿ·¹€Üÿ·¸þÿ·µ Ú©ð©©ð©Z©ð©©ðýäTdµþÿµ·€‰IU·þÿ·µþÿ Œ kÕ#5AMYer€š§µÅÙ3#"'%&547654'!#"'4%$53!76=332654&#"#"&54632'#"&54632#"&54632&'&67632#"&'&676'.547>'.76$6&'&54%6&'&6>#"'.54>32#"'.54÷ [$gþi< D"ûœ"D =þif%LñçùWèð‘«ì¥¨êé©§êrƒ^]ƒƒ]^ƒŸ !! !! Ñ.› .þ *)X,)ý¯,*))+þ. } Õ›¤ª™Œ+G  G+Œ™ª¤™þvK˜K9_þâþê_9K˜Kýݧêꧦìì¥]„„]_ƒƒÞ""""ýs!!""W&. - ýì. - a)," Ã"  ))  ì  !)þ” /    ‘ pÕ%-5AMYdp|ˆ”¦Êð5#!4'&'5#2#"&546"264"264"2647>'.7>'.676&'&>&'&7>'.%7>'.676&'&676&'&53!76=3%#"'676%27+%&547654'7327&'$%'#327%654'&547ì1ËÃÄÊ8þú¦å楣çæ¸¸¼. . . . þò - -Y - -ýü))G))ý«))U*)þ>- - ~- - V†áØùÉØá†þ©K;þŠ yA øøC0Bøø Ax þ‰;K'6FJ> ìþÇþ$06þ#þÇë >JF6&Â@Ž@1Añþe›ñA1@Ž@Hç£¤ææ¤£ç­¸€€¸ . .ýµ . .E - -ýÿ- ,1))Õ),(9)(©))þu- ,æ - - Gœ77Wþõþ6Ê W77œGå D&& ¥ËÇe‹‹eÇË¥ &&D "(=ˆ—pp—ˆ=("¸uÕ !!'!¾°úPnàÕú8Èhûø·vÕ "!!'!##+572367676½³úMoà‡L)þ¹>u eÍ¢—I3?b›aÕú8ÈhûøžA:þFþ½;/Iƒ¦t³»x·vÕ !!'!  ##' ½³úMoàû÷›—_þh˜[þeþi[—þiÕú8Èhûø†þi—[þeþf[—þl[š›š §@36273 ##'5ñ) UþÒ.WþÔþÒW1þÏ@þ ÞUþþS÷þ Vùõdõv#,5>~3+&=43+&=4%3+&=43+&=43+&=43+&=43+&=4%33 #&'&+"'&#"/573;2?"#'57#&'#"#5676!5Ö\:V\9\:÷\:]:&]9[\:ý«:¸+#9,–p!—ˆj[%+ > 7ÓVCÅCc":Àï8Ï #8dÏ#7ãÏ$6¹Ï$8;Î$7iÏ$7ëÏ #9špþPL  )Z. ;6ýŸZV Z3%Y63 .87€ÂÆp ˜“Ù 3DMy!674#!!6?676545&#'323276767654#3#&'&'454632767!672!&=75$/563&43!32+'!67#>54&53# û ?ô I :W0 96;E,Q 2:&l6xý0 bˆm! oþÛ¸½®±"\ü>%Eþfþ™~ýñþe2UÖÉ6g!6V#p5Cü+ C þ˜? P9 @´7H4XþÍÇm†M7RV /‚M(=H: ,qLUD)8ˆWqk±’e-Pexúó —NW =$ U  þ/0c›™)H?õ2@[nDF8T$.J?¬Ù !' !žTú4X—ýÍKóGýÏÙþwû´L†þ5ü_¡K¬Ð !'7›ŒWú4Z~Ðþwû¿D€ŸÔS&5476322632%632#"'&'#64'#"'&'&54654&'&54767632xØJX%&XA,B:\8 [ÇEMH95##Fl% !9@!#jLÏ p_’ÎMi#"?8" %lF##58HN4hok@RRr*%tþëe BB9'7*$%) "fXSþÝçò5EIþêf" )%#,7'9CB «˜>E3#"'4332327$'#"$4727%672567654&5&§oJ°7.˜b9M þúƒD† þ²ý™,B3 qY 5*Ä*]d=HN9%‡å ˜sW$,þðJ ® ]T-MMñm@eöd: ,'Z MÞ 'cM&T)$$ <þ¥ „Iµ¬ç2%!"&54676737#&'&54>;7!"&546767!7!"&54>3!6763!26ýP+=6ˆ/2´þÿD>Rý+>2,+v*>ç>+2  ,2 =,2  =,3>,¬ç2463!2!2#!!#!32#3#!¬>*v+,1>+ýR=Dþÿ³20‡6=+ýP#,>3,=  2,= 2,  2+>²Ô{"D%4&#!"!0#"3!!"3!#";#"3&'6737#&'6737!"'67!7!&'63!67!2I0!þŸ6üÙOSÿ þžSS: ÝSS®>SS]]J«]]äþÆ]]hý\\, Bv*>Kñ%39’LKIOKHLKIhghghghgE?-ü³“LÊ!D72654'6#"'4#"'54#"'54#"'675674767#%±$4:JILLHOKHLKIhghgighgD>-ü²sJ1 b6'SSý cRRþÄ ßSS®?SS\\K¬\\ä;\\þ–ý]]üÔ!AþŠ*>K›±Ó{!C%254+'3254+'!254#!'!24+!&#!"463!!2!!#!3#3ÁSS?®SSß *vA!,]]ýj\\þÅä\\¬K\\ñIKLHKOIKL’93%üëN-?Eghghghgi“ÿùLÂ!C32=732=7325732'654&#'%2&'&5&'5&'±IKLHKOHLLIJ:4$üëN->Dghgighgh³SS=®SSÝ þÆSSb ýSS'6a!0J)K>*þŠB üÔ\\üþ˜]]:ä]]«J]]}¯ØO€‹•¤³ºÁÖÜãçëïó÷ûÿ &*.26:> 3656;2#'7+"/#"'+"5&54775%"'5476;25'7&56%635&56;374765'75'76=4'&+ +"'4!#"'4543$365&5&#%#754'&5&&547'5367&547+&'&'735&2?"5%75537'7'3533553535'32767&5%2?&#%55'575775775§1’:e ,$?F?Yø>êF_LA3E¾L¬¯HÑ3,8LYLäþÐlEF'!0<… k#gþšF  ™EeYÄ!! Gà€p&þ­iq.8ZN$ÏË%`BCëf F4ùü"4._?ñeËe3&{E(1þõ-ÖÙ+$Kt8¿ - ‡ þ–$þÖÌGs ¥sM ýùrEF›"ºã2 >_ý£pÌØÁlTErf^5.>=9|5"-l)d ,&>vv]cccWpC-+ d•8 Bpp>W]oØæaþxvuPp82,ŽD¨ ^8, ^B$K»œ+ "1®R[+Òe*ñ;Ð 2 ››W Q—›Pþ‚ I&? gpëo% w ^SA$ Ÿ2 9i-5n02¢þ†Ç¿ Ai&®IY^P]D›%ˆ\??\OWC ,,1 /211/=;7777=321811{908hN%b\Dh,)h?Ì17I21!122223 21¬Ø&2%2#"'&=477654'#"'5473Bq4|ýl anN iü¡¡l‹m b üµ9 bØMOŠbý >YÑaYÆ®58Šl7P ÌP@ ª‚Ø$0<FX + &=6&# 3 6=%&#"';27!5%67%!&'&'2+"'&=476‰rþÃÂÔ þ„þúcR¹¦§þÔë~²ßUêYþ­þÔ¨Ñ082.Ôþà_þWÒ†_þV"+Ò}þIR8D).P9H'Øþ¯Öþ°ý“ƒ®²S„¬]þÙ±ÂþÄâŠZ–¦YàûHYoþ’X(I_ Û þ’‘°;.2lOþÏP%.G6R%&I8dÈØ)Nl>54'67&54&#"&'632.547#"'&'#"'3267654'7327323.#'654'567654&&5476;'&'%&+"#"8DH$$yU ?L[>!Wt…Jþ([Fho*Ám¦.2¤\=w\`|€UP7¸:/E" @7? EPþ¦¢]Eixà Òp·‚F@¶T5û†ym´,±"&e¿B@q¦€²‘(‹A _Ã% #+B7!þêN &".ËOý²S$ªXE/K(Aa]dLP*'FCaYr= CÙ44mo C‚þÿ ¶ “(FKœWYŽüF•¡vb‰ph´'UD˜'R< $ˆ“dÿüöÑ#+?Vmƒ¢­²·¼ÁÉÐÕÚßåíô#327&"#"'7'632&'$54#&73254'&#"'5&567#&''5$'67'654'6'5$'67'654$'67&'654'''5$56732#"'&#"&'$'63&47"7&'7&'7&'7&'54'6546767675477&545?&''5&#" '6%35&'.54>23#67!&#"W  OB7[l#> Ì Fþˆ_Vh "ï "®@.,=6tJþè€4V®¶p1EQJþ“qMiÎ v–h£ýþópHI£®!:¯½JJJþ Í=4m\8B*Ò®?o þv!"ºt,`—s&*_~P1>5='g=>24<+ý-s[,*&sd1PT>3J@='h<42åJ-H#*þõYT_Y)*)X^TYþõ*$D  ?>}>  *0üt"J. ™Œ ‰&b54CUE ''¤!`9 !,(MTE *!… }q~=/+)f[4f !B" <@0&9c?"V+€GoM“K~a„? }b‰9e\ P&0@k"?c*‰G€E‰JŽX ?„e}9‰ \«ÎÂ4 ¥\6 '''' 6\¥ ªNÙ(&'65&'67327&+!65+"3yyys{Åw Êʃ£µ®©³¤cþ¦c¨³©®µÞ±±ŽqXŸþñe¸óó·Xcþ÷6þ µ®®µô6 cªÿýˆÙ ,35'533#3!'#'5!5!5#53!5!5#!!-Ê·«}} ”þcˆ±††þk–v¤G þôGþõ @<<3ff¢X¯ý苜…þ›‚q°X¢üÏ»GccGª›J 326&#!2+73 ### 3(ÑttþŠvÎÔÔÎÑÚÜþg®Ûï¦þÛ·þnܧýØüŸßØÙÞþÍíþBþ(þúþéᵪ²×33#!!#'!'57!5#'5735׫¥¥$þÜ«þÞ"££×›”q˜ü‚~˜q”›ªÿý‚Õ+!#!573#'5!3!'573!#'73!#'5»¶ ;jjýÅ þJªýÄss<ªÕwýÑ¡þIžýÈjj8ž·¡/w²{Ø,32#' 3%+ &5%6323'#57'53œÝÒïþ©Ñ^Vˆœ ŠQ6þ‘¬>ѨA±©B¬ÕØ’6þÊž¹þ’ÖG2k >ÀéªîYþ3É~»||É~ªƒÙObs32732753"'#"'4323$4'5;+"'#"'53275'&'&5?5572%#&'&5%634%476=%ê@.!%,BE,#!-Q²2" $nÞàL/P¥uHED8ˆ32#"&546324&"26%! ! – Å’ÉþbþäþÞþ{±•ÆÊ=&*<<*(;ýE;R::R;åþKþÉþÊþJ¶67µøŽÁÏš˜þ{þɬ²Àž)::)*<<**<<*):<'þÊþL´67·þIÿÿª‚Õ&a'a†a ÿÿªƒÔ&a'a…b ÿÿª‚Õ&a'b…a ÿÿª‚Õ&a'b…b ÿÿª‚Õ&b'a…a ÿÿª‚Õ&b'a…b ÿÿª‚Õ&b'b…a ÿÿª‚Õ&b'b…b ‡ÿê¥á @FLRX^djp3264'&#"&47367'676756273#'#'5&'&'7&'677&'67'%%&'&'%6767%&'ô0/CB^0/AC/ýpkTcR|Â'N(¶‰OfUippqUfOж''NµŠQaQhû!$ Žb€)·dŒþ¯ËL÷Qýk þðK´ÌRþt!% cþ'¸d&„//^„000Ã'N'·|P_PfppoQ`Qy¹'N'°ƒP\ QgppmQ \Pyº,  Mª ÆNþ>&«`‚7" bþK*ŒVô&"¬g{‰ þðM¥ ÂMªÿj­n !-=4632#"&%462#"&! ! ! ! 676 &'& ‚Q;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAì$3¶¶2%s'ŽþlŽ(ý;QQvRS:;QQ;:SSÙuýñþ‹þŒýô tþÄþC½<=Àþ@ý%83µµ38H,'Ž(+ªÿj­n !-=4632#"&%462#"&! ! ! ! 7 767 '&‚Q;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAìs(Ž”Ž's%2¶ýü¶3ý;QQvRS:;QQ;:SSÙuýñþ‹þŒýô tþÄþC½<=Àþ@ýªG+'ŽŽ',H83µµ3ªÿj­n !13264&#"32654&"! ! % 767' '&'‚Q;:RR:;QBQ;:SStRûætu ýôþ‹þŒýòs$3¶¶2%s'ŽþlŽ(ý:SRvQQ;:SS:;QQþ²uýñþ‹þŒýô [83µµ38H,'ŽŽ'+ ª‚Ø "*2:AIX3#''%#&'52#"'&5476!!'5%!!'53'5%3'5%3#'32765'&#"sNN99ø=üûý>È-1×\ ÄH0µe%½FýKSþ­wZþ¦G†r=øý´;÷=NN$‚E| 1† ?’'Øþ¡_œ>ÿ?îþ@Ç7µâ`½d¨@\´hþíPPPPþç‚y?ý+<þ>wþ¡_VG{?,rC‚AšÝƒ×+ +"'5$76%&'547327676=&#~‹jþt³°1/Q}›þ²ˆ]•(Éþ¯+VžéRþ¥£ž×þ‡­ÆþxþÿbO±Ê àP >ÅþþnèS˜ô]] =fªPØ+! &56;2'5$%75#"3¯þuþïiŒ³±1.Pþì~šNˆ]•(þ7P,VŸèSZ¤žy­ÆˆcO±ËþõþpáO >Åí‘èS–õ\^ þÂþüf¯ÿ0:Û1>7#'#53'&'&54767&'&=33676=3#326'&i($…„lØÜÊÊ“m……$(($…Ž[Uu&tU[Ž…$þ÷&uU[·‚·[UV$ƒ½¼|dÑdÊËbÑ e|¼½ƒ$%ƒ¼ ‚ZSSZ‚ ¼ƒ%_TYþüªªYT¯þÿ-Ú #"32654&&5432!!#!5!&î¤ç礡êêýÉ©PïìS©ˆ´þð´þðµ'ä¤£ØØ£¤äüíîïLþ´þ"œ~þø|þÿ| ¯ÿã-¾ #%2654&#"#"767!5!3!!î¤ç礡êê7©þ°ïìþ­©ˆ´þñ´þðµ–ä¤£ØØ£¤äîïþ´LÞœ~|þÿ|þ÷¢ÿã¥à "326&#"!7!á¤ç礡êêû¨ôëþ¬YæäpiþŒîþšp–äþ¸ØØHäüñ¤=ÜU g\Žþuþ¤’ÁèSר5264&#"#43233#!5 zª©{y«–¸»mã——ü«ò««y¹þü¹¨{Åú(|—ÀjØ#53533#632#4654&#"#*jj˜²²o˜²ïŒ—›onš˜—´´—þ}mþþ»Zåy„îH{©ªzþFø2Ø 1"32654'#"&4767!!53#5!!3!!#3!!ÍpOO87O:=0L˜mk™L/>þàþΛ›2 — 1™™þÏþàŒO79NN97Â0LØ™™ØL1ŒþK—Ó˜þJ¶þJ¶˜ý-—µ'Ø<%#5#535&'&'5'73'3#'73'676=35'73'33â—°°¥z–‘˜hNg‘’—‘‘eMj‘˜–z¥¯»»»—‹z–×TŽŒ™™ŒŽT—hOÊ‹šš‹ý7Nj–YŽŒ™™ŒŽYÓ–y‹—ì?Ø! #!!!'!27674'&#ô™.d û;6þªzüý‘F‚H¢%QØÐM_þö\ý­‚ǃþ$‚P¤<]ÎÚ$!#"#&5463 67!2#654&#"Vþâ©"T†]£’tƒ„s“¢]†U"‚¨þâXÅ"€€„¡„»üû1((1»„¡„€"Äüûý¨·uØ." 6&'67>3"#"54767&'&#52•“ÎÎ&ÏÍ•ƒLVa¡¹{§ƒ.+’þÙÓÐþØ”)0«z¹ºHUM\ÏþÚÎÎ&Ï–=B´®lþÈl)•ÒÑþÙ'ÑÒ•*l8l®´B=ÀjÚ&'5 %$ 56?63#'¨ª[øW°¦¦°þ©ýþ¥ª¨˜tuétuéü4”ZZ—/ûâ/˜[[”5  ç@Eo&<"3264,'532'&54632264&" &$#"#"&547>B¾„„_^…þ^þÈþ”™ýl;‚ƒÍ“•ÎhIöý«^……¼†…9l™ýþ–:…ƒÍ“•ÎhIõ¸„¾……¾þ (+|Tl§“ÏÏþÚgML¶„¾„„¾„x)+{Tl¦”ÏÏ”’gMM ØM>54'.#"32463227#"&5454&#"#"&'&54767632254&”K2q'$#K1o'#0ß´¬ÚþÞ†GdAoc¤„–.% 3t88<­/3u77LJMŒq'##K2o'#$L1ð¡Éݰ»þ ´|XHwyoÇᆥ›<‘>b€WDs-Kx68<32>32#&'567'45'#&+"#4'3>$4&+"¨?w(ÆK>R0ƒD32>32gYYËËYËD,.:…?—#)³•˜Žv$·E?w(ÆK>Ro}v­¯vxJvÙÈüašAjâ×ütA¾¿O°]¼Æ€wϧÛÊý„©ÿÿ‚Ø  / ? !5!êý?=lþÃþXj¨þÃj=ÁþØüý?þÃl=þXj¨=jþÃÁ˜ýÀjØ)127632#"'#576&#"4'5267>327&'"SkQmÃy™Ž›z,~Ѝšzi2@:$šž„“¡(.-)zW]‚¡ Ÿ˜Øüžݾg‘«… ×vxþ-ÃýðaÞþíÉX[–ü&‘Ű9{¢'Q32263227632&#""'&#"#"'&#"#'3232762327632&#"#"'&#"#"'&"#'°Es- p¬86rV+)|m^?_354.#"!&'.54>325467675#53533#63232>54.#"P#3Jœ“TRJWVJQS“OMJ4"þ?õü¹*&ElnÆhPL$ llill %LOhÆnlD')ýÖ----Ç+)Q•PQ’((’QP•Q)+ý¸þÑ/þ 6ÄklÅj$?6FWWF6?$jÅlkÄ6 þ}++--âJØHNRh|¥»&'4>32"'4>32&'4>32&54>32&54>32#!5!'!567>54.#"32767>4.#"327732>4.#"327>54.#"732>54.#"M_ 669ï4S55.½+C55C&¹.66 V\+55 c ü£$µþ•·×üÿMç##$ 6ˆ»$#$­s`%#$þšd0"%)h¦ #"#û_33@þ¾]22-"ý40446üÊä/*33UýJ"+33^þ1ýÑ/þßáK=Ó0¤¤T* ####ýø ù #&$$&#ýÑ#&$$&# ý B #### üÚ*ê"$$" UÿþÖÖ!'-2!35!#3!53573#'5#5!35!75!!5'57!«s\\sûs]]s ª—ûîJRüÚRIJý~Ö››¢–ý·•££˜E—¢›úû77êƒ__ƒývt€€t4!ýݶvØ7CQ^&54767&'&'5676767&'&54>32! 535#5##3654."!2>4.#"Ë  <$))+N-N*)N-M,**%:  ü@ ¬¬v¬¬¢<-MTM-?ÞŠþK5:664”59<5&?HPPIK* ')+K**K+)' *KIPPH>&5<:6þu”N|l||l|þ²-I+N))N+@6þ¬:55:5QÛØ)5>o654&547!&54='&'654'67.5476;+"'5#"=6&'76767%25#654&'Fzê-ü6 ŠZ8.ž ,‹N0H!h6¢%`+EH )Ø#M ;,Jga#‡iR þ‚ k'þ Mè +1^hgþ½üo8: (@sŽ.PùÀmz nxþë?.#1þp#41§`&>%!ac,,ÅÀLHJ ­xþì}647| + OJJ)!0ÿÿû× P[32>4.#"32>54.#"!5&54767&'&546767&'&4>32'&'.#"¿:e79e89f76e`[ûÙS ¥’&(*UM,N)(N-KV)&&“¦ \@Eõ€õCAÁpd88dpg66ú»9: %N&KRS—* 'TM**MT' *—SRK&NþÛ :9„}qyƒƒyq}ÉcØ $TdhyŠ67&'&"!3!67>54.#"!&'.54>325467675#53533#63232>54.#"!57!&'.54>3234'67632!P#3Jœ“TRJWVJQS“OMJ4"þ?õü¹*&ElnÆhPL$ llill %LOhÆnlD')ýÖ----¤ýsÎþè=BDw@>=)ñ)==AwDB=þéÇ+)Q•PQ’((’QP•Q)+ý¸þÑ/þ 6ÄklÅj$?6FWWF6?$jÅlkÄ6 þ}++--ü¶ÈÈÎ !yCB{C!$$!C{BCy! âJØHLP&'4>32"'4>32&'4>32&54>32&54>32#!5!5!M_ 669ï4S55.½+C55C&¹.66 V\+55 c ü£$ý)×ý)û_33@þ¾]22-"ý40446üÊä/*33UýJ"+33^þ1ýÑ/ËNNþÖOOUÿþÖÖ%)5!5!!35!#3!53573#'5#5!35!Öý€Êüìü«s\\sûs]]s ª—ûî„^^ü/oo#››¢–ý·•££˜E—¢›úû77¶vØ4@4767&'&'5676767&'&54>32!&535#5##3¬  <$))+N-N*)N-M,**%:  ü@%¬¬v¬¬<5&?HPPIK* ')+K**K+)' *KIPPH>&5<:6þn”5|l||l|LàØ3?HN654&5473#!&5454'+#"#7&'654'67654&547;2547#";65'"3%:U"-ü6 •Bu Zg0krX0c-h8ªE+`%s H>É4wM-æ'9.QY / þ¬üo8: q§’hPSå¾mh #%Bzÿ1"0@þ)5"@YþóýR0ÿÿû×.&54767&'&546767&'&4>32; ¥’&(*UM,N)(N-KV)&&“¦ 9: %N&KRS—* 'TM**MT' *—SRK&NþÛ :9CèÔ##"'##56'##"/547?˜^Øí'¢5@š_*S×U&/U»L »;YÔ§þìþê9UP(§`Ý þå–—X…ÑI.·Ë‚¥¹sÑ222732#&547636=4'&# #4'&#"*Út pëÑz&Ýþ=<ý xÇQåÐÛ>h½G:þøV He½®k%ÑþíPF5ÓNP þþçýÙBí²¶Ò|-þÛäý¼»¡—&¬pþA&NÑà±FXÒÔ &&5 –<ýãþF:þþ^Ôýý;" €V –ýgýdœäGÔ7236;2"##'65##"'&5476;235&'&=476—Öe x<JTî`Ñ(GòeRÐUdõ¿föB3 VNT<×GÔã48u <ÊB<Íh  þ©m€MþëÉD:éS GEnQÉhBêÕ"<B+"'##56#+"'&575477;2732;276=4'3&'"—~Vµ"0‘b*S×V*8Ui QÎ"_|þ®Q ”)w`·Sg‰A ËæŽ? Õáþ6‹†ÑNÚ þè›—#eu®B? ÈÔgIÇþo‚…»5 ÚF”§(°ÏûpZR¶wÔ2367632#&5476(Ët*#\l‡Ñ~ ÐýïýΨÇTÔë]1¢klàSIúãý…±ÍÚÓ|-XÒÔ &47–÷EýÄ ýÎoÔýsU ýÝŠäHÜ2`g26;2"##'65##"'&5476;2&'5476&+"326733276=4/#"567654'&#"35&5›Ëhr=)ø\Ò"IñfRÑUdöÀg÷C3&=cØGð© kv ó=ˆ=NÒr%SZž¨U ý6vk »6)¸S<ÜÎF9„¦×8:Ód  þ§m€OþèËE:ëR p±&Ëiþ³›Ì  ÔC”]&'Ax†…¾.+Þ0 ‰nM,¶WÈûÎ`cØÿþTÔ!1M3#&'&'0546%3#&'&'45463#&'&'546 $&54673 $64'&'v ‘Ì £0¥A ’Í ¢1¦Y ’Í £1¦,¨¾¹þ±þ”þ±¹½¨ƒKV§.J/¦VLƒ9?›c‚yɦt3Zrˆí`í—Å»þÎû²N‹ ±Ñ[OÄ}¡šýБBr‘­þ1±a`°bb°`a±1)EM¨˜UU˜¨ME)¬ÿö·Õ3#"/4?23hHÄ0#ÔÓ!cZÕúý£-…‚@Ô¬ÿöoÕ3#'654'&'#"54732XW­ðz=ä\à9òÔ`YÕ'6?FŠ’` 1TFG*ûÖ™-¨ƒ@Öxÿ/³Õ#"=4?2%#"=4?2ý³À6Õ±'VQýÜ–Cت+YPÕÊúí›*¤~: ©ûÛ‰8›z"CÓ¼ÿöoÕ"'4723!# 5472!5kþûéémOü¥òþþìdXX[ÕûÕ¤Š;•ýZÏ$±}@áÏœœµÿú"Ù 3363'$654'"»-ª‘ãý³8¢•wÙü?íþÿþWXÖûÔþc1 ”¬0Ù 3%#'#3%#±)N(þ¯4Ùþ/¡ûcå Šý™þ}­4Ù(,377#'#'547#5773%%‡.wwzy.þà** þà ÙþÐ<<þ‹7‡Cþ׌þ¦A<Ž<{8‹Aþú†Mý–þ‡‹t¬PÙH#0#"#"'5654'5673;54'56732733273+&+#&"#&'565¶¨³P8 cc 9Sµ§ƒ:-Œ-:ƒ£µS8!cc 7P³¤ƒ:-Œ-:ƒZ#;17F-:ƒ¯µS8!cc!8Sµ¯ƒ:-F71;#ZþRµS9 cc 9Sµ„œÙ ;G7567&'&'3#6737'#&'7#&'6735'67#3335#5;0/_í^//þ†,/,-D--C-,.-äÐ zz Ðä~jihh~äÐ zz Ðä~hihj~ntt6tt´-.,-C..C.,.-n//_üR_//÷~ijhh~þNÐ yy в~hiii~ÖÑ zz ÑsŸ.þ€€.Ÿ ¬¬#.6CMhwŒ—¦¯!2732!'5675'&=32#$'57637&/&+"+&532?4/%32#'#&&=4?#'57335'3!273+#='!"/547354;2?!&=!(‹:Mb­þ¤R».qp7°þÓž,ÊÊ_qýð >MT,›•P$’ ´6œ…6$0_äý u3d´­Ud€tœÈ_}s*$Ä"ìRþÖt0XX__ç/iþký¸=Z¬G†8þÔ*F €1 þƬ.þ­ Å þÑŠfþõþï)MC =þêg9E¢k×O 9þË!(-ƒ);& Æ þ]¬þÔt!þ±y" ³þ¥†& 2| ¬ªb³a$ U+œ Ù #8M35733!&54?'7'327!!"'&%#'7367654'77'7'&#"'676Õ«ºÊ«þýó,&T>ë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?ê7>54&#"5>32&54?'7'327!!"'&%#'7367654'77'7'&#"'676]Týñ@Í1$Jë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?ê32&54?'7'327!!"'&%#'7367654'77'7'&#"'676Z _­3lFHe5^\VOosHGJI)`VKm1šSüj,&T>ë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?ê32#"&–¼eËÅþ›þ|þ›ÅÉeþ(®<X<®³þħ¨þñ“"32#"&$2#".46–¼eËÅþ›þ|þ›ÅÉeþ(®<X<®³þħ¨þñ“"@<#"4.#"–¼eËÅþ›þ|þ›ÅÉe:<#"< !<"#;ÙÁþ˜þzþÆÆc†hÁü– =B4.#"$32>4."–¼eËÅþ›þ|þ›ÅÉe:<#"< !<"#;ü¥"< !<"#<@;ÙÁþ˜þzþÆÆc†hÁü– =B54.#"##"'5##"$'&'0!5!5&'.4>32!!676767'%''H&(G()G'%H(ã%'©þËV W3WI„muþ‰w>DE}AB|GE=mþ“d^„JW4W V›sÖ'H''H'(H''Húò`XAK|@X1(Ô3"|ˆ}DD}ˆ|" 2ý/ "1X@|þµAX1# Ö/ 673&/'67 &'"&'6?&'3 ' âK[]œ><+Gg['fBôòBe&\hœ?(K?œ]\Kýã ˆŠ!½þÐ;32T $ù #µ¤ACÅþâ«,þí¶ÅMMMþv ÕA5p_9D-ïþ–þãM**¤  û”B@0"@R//>wA·&oc/D&3.YaQ/5"1'"þ´þuŠE62/uŠ= =!m- .... yÿì²Û 7%  %  32+#".=!"&'&'#&=4;7337_þìþì‹ý%þíþìŠ Ö8)Â0/­_^«^ýM^¬¼­1/Ì 9×53üü4í<üÄ&&<üÄ&Ñ*(üÇD>?GGzB6üÊC{GG?>D9/››Cþ½›}®Û&632#"&'.#"'#!#!#Ò¸ž62ÉK#+~KF0R!9'/N£Çxåí_TþâŠþãV_‡T '¦NQ9;:#8³HL"CþßD™ý|ý¦×þ)×þ)Z)Û 532>4.#";267#&=&$32735&'.4>2æ2[02[24Z1/[»–á­þ)'5*+þXÇë A323#67#&"#"/&'&547&#""'6%676V ón*[‘n%'ZxL0<{2;&b;0&8a>!U*~EmL‘K}`? {aˆ7c[ O&0>j!>a)†E~CˆK‘W‹ ={d{7ˆ [+M57LL75M-Z '*''*' Y (€5[£ J5( üÖ\d (5J £[4Œ ''Ó/7O_Ÿ«³»ËÓÛãï2#".54>&'32367&%2327654'&''67&'&'&'676765467654'&#"7>326323#"'##"'&'#"&'&54767&'&54767232&'&#"6&%6767&'&'&#"676&5467&'&6732767&–$$$$áOG3%V c˜â™c V%4GL944m/122102/.303112.OF}6&V eý´"w?>v"¤pt #8ˆŠ7! vn¤":;@A<:"¢nx !6Šˆ6# sp%./13/.UVT\<>"$!!þ• !"#">k•c V &6|FO 93399 <>#"#Ö><  "$ZTU./43..V5$##$Ù59gT;&'9Z^^Z9'':Tg9§'(''&()I8:9889: Z_59eU;'( ³ÀÀ³:8.>euvc>-7:°bccb°;7-?cwud?/8K¢WZZW¢ **D@@D+8(':Te95^&)(&''(ÖDA:AD.*!žY[[Yž!&Ö !-x†”67&'67&'4&6%67.'%4'6&#"&'6767&54?67&'&#"#&'#&'5&'"'67&'&47632>4.#"%2#".4>Î'7,3 3%/0þÜ),7ß=*#þ×0*+3.22'þ÷8  Yf·©T,1'¥¤').U¨¸fY >98 "2 B2;F_ XB?2C 3" 894i¼hg¼ik¾ce½"SŸ[XŸVWŸXZŸ„£§#eªjpÍMcNTvJKrZ1VlLWMI ©p jª…k%§nA V{ww[1‡ôô‡1[ ww{V @#fÜd-#JM 7B/"‰‰"0C7 NK",dÜf#ˆÎ½hh½Î¿ggQU ®XX® UíSèž !!Y,ûq@·ûI@,ûqžþȤ7þTªþU7¤þÈíSèž '!57|,ûq,ûûIw,ûq,ž¥þɤþ窪ý«¥8¤dÈÔ %3!'#!52#"62#".54>Ÿ"ù­ ýh9ý|M463%&$$Ôú5 ª›ûO ÂDý›n;ý $$$$ªôØ33'554#$/ÑýŽ[ƒüQ‡wþ“ØýâGSGýUW GJG¯þÿZÚ*1=C&32632!!#!#!5!&"327&7&!&7326&#"6'X©Pï™}}›ìR¨ˆ´þð´þ†´þðµ¤çç¤?9Š‹9×XezfH9? êê A:Œþ×uutÝLFFþ´þ"œ~þø|þÿþÿ| ‘äþ¹Ø•®ü”- þø ¥ØGäþP8lGrrþ¹¢þ[0à $,8>& 67& '&'&'&!7!!! 6'&265"÷uþ»çt.77Ì…þµþ!ªu$†lªYËoiþŒî‹þšp•þš@qDiþí÷þÐÞ4tEêu.ý¡ê¤ã$räþ¸l,Î36ýèþ½Ÿl’%ežÜUg\Žþxþuþ¤’vþ¤Sc?\þ7Ìþ× =1lØHr-þÉØ¤à¯þƒßÙ-9E6'#"'!!#!5!&'&326!7!%"327&7&326&#"’suuWþ³óš~Wdþð´þ𵇩Pï—|€šåojþŒŒîŽþšpû“¤çç¤?9‰‹:v8?¢êê¢A:Èþ¸llGrþëçþ¼E, þø|þÿ| ~ÝLDJg\Žþuþ¤’Æäþ¹Ø•¬Ÿý ØHäþO¯þÿ²U(&  6&32!7!!!#!5!&yêþ»ççEêüß©PïÀ•hþŒîþšp©ˆ´þð´þðµCääþ¹ØØèÝLn[Žþuþ¤’Âïœ~þø|þÿ|  ÿãÐô+D#"'&'&'&47>76327'7'%'27>764'&'."(F3"D"&%#}bV`ZZ^;D"&&$ƒ[X]:3Gþ9þ†á:ÎÀ‹]†þ:ýF=~=HS]³^X‚&% «iŠiD^‹¿þ29áþ½i‹üü\=<€<92-1X?:„<91*Ïþ£î=X62'%'!!#5!5!5&'&'.546767''7'''7"2767>54&'&'&î4p6³â9ÎÀŒ]³.(EGGE@Z-<þí–þí81VDEGFF'1þ9þT]ŒÀÎ9âTþ:þŠG5>+.11./:9Š5>+.11./:9‡ ž\Š¿þ2:âþa(E«b_«E@( ¸–ðð–¸ %CE«_b©G(HiŠjËâ:οŠ\ËiŠjÓ+.wBAw./+.wABw./€ÿã4ô+F!!#"'&'.546767675!5!' 2767>54&'&'&"¥þí<-Z@EGGEDVRbfNZ@EGGEDV18þí¬kbbjøC9:/.11.+>5Š9:/.11.+>5Õþç–‘ (@E«_b«EC%##(@E«b_«EC% ‘–­kaþŸjûP/.wBAw.+/.wABw.+ ¡Ä+F####"&'&'&54767>32333'7 '%32676764'&'.#"‚Ü–U (@E«_b«EC%##(@E«b_«EC% U–Ü­kaþŸjûÉ/.wBAw.+/.wABw.+Ÿþí<-Z@EGGEDVRbfNZ@EGGEDV18þí¬kþžþžjøC9:/.11.+>5Š9:/.11.+>55Å @  ÜìÔìÄ1ÔìÔì0432#"732654&#"ÄÄþéÄÄþ陽……½½……½ëÄþêÄÅþêÂ…½½…†½½5Å @  ÜÔÌ1ÔÄ0432#"ÄÄþéÄÄþéëÄþêÄÅþêúºK +@kk k kÜìÔK°TX¹ÿÀ8YìÄ1ÔìÔì04632#"&732654&#"úÏ‘‘ÏÏ‘‘ϘuSSuuSSuì’ÍÍ’‘ÎÎSuuSSvvdPK!)7eK° RX@ *.,&"($ k3,k($kk8ÔìÔìÔìÔì991@&"6k0k 8Ô<ì2Ô<ì299990Y4632632#"'#"&7323&547&#"%6547232654&#"dÏ‘RDDR‘ÏÏ‘RDDR‘ϘuS?>Su^222Z>?SuuSì’Í Í’‘Î!!ÎSuXqpWv28ML88LM{WpqXuSSvTZ`z8Rm3#"2767>54&'&/2"'&'.5467676"2767>54&'&/2"'&'.5467676––R#)$#R#$ $LK:C.25521@=“:C.25521@=ýR#)$#R#$ $LK:C.25521@=“:C.25521@=züàZF)(JG()K¥.2IF21.2FI21–F)(JG()K¥.2IF21.2FI21 ªJ7Qk>767632"'&'.'!"'&'.546767632$"2767>54&'&'$"2767>54&'&'÷#61@=HK:C.25521@=“:C.5%þÅ'21@=“:C.25521@=HK:C.6#¹R#$$#R#$$û÷R#)$#R#$ $5[51.2IF21.4`]21.2FI21.5[F)(GG()FF)(JG()KÒæR 5%%%xüÌÜÜþŽrÊü6þŽ׊eMºM^‚xþ„x‚±V–)7654'&'575#!&54767'5!s_vR$N:È:N$Rv_£þì¤{aT,X@X,Ta{´ß4b\)1¢%==%¢1)\b4ß´»:ê`¾\KDúúDK\¾`ê¯þÿ-Ú&  6& #&yêþ»ççEêüß©PÛS©ˆ´´µCääþ¹ØØèÝLþ´þ"œ~ý{†Yþÿ,Ú!#!5!326& '6 !Iµþð(4¡èèþ»~u¨ÛP§‰³þÿ|²ØGäjt¦þ´þ š~þø|°þÿ,Ú 23"#"#"#5237 °>>þ!‡ˆˆ‡[ZˆˆˆˆVLþ´þ´Ÿ;ýÅýéþô|þÿ| ¨oJþ¶°þÿ,Ú737!!'!!#!5!'!5!{ý³ü{þä‰þ~zýþð´þðýzþ~‰ùzýdþüzþä|þë{ýý®|þÿ|Rý{|xÿT% ! !5! #!7!# #TþÓþ?þ?þÓ¢LLñ¬þwÖÖŽþ´þ´ŽJ|þA¿|þ¶JÛý¦ZýtÕÕ|þ¶JŽÿ,¯$264&"&7673% %&u¦uu¦>ÏhH]¬%Vþ™gVþÛYFhÏݦuu¦výÙÎ#gGÎþέ”ÑÒ”®þÒEgþÝÎDþÿXÚ!#!5!&'&5%676'!H´þðœfN)]®H;ËbtúWUJnþÿ|3L˜u¡.¹:;…ÄþÍ¢8%ÿ|V^m3 76= '&  7654'7! '.54676! º«ÎNΫ.8ðýlí?ý²Î««ÎNΫ«,spppæþÂþÇèspppæ>9“`VhhV`’"xx  hVc`VhhV`cVY9ˆQþ¢Nˆ9ss9ˆN^Qˆ9sV^Ë -E  7654' 76= '& 76= '&! '.54676! ý²Î««ÎNΫ«ûk«ÎNΫ.8ðýlí?*«ÎNΫ.8ðýlí?—spppæþÂþÇèspppæ>9ghVc`VhhV`cVþ|“`VhhV`’"xx þÁ“`VhhV`’"xx Z9ˆQþ¢þ¢Nˆ9ss9ˆN^^Qˆ9sV^m !1?U! '&'!  '&'&76767 76= '&  7654'7! '.54676! x8¸þñþï¶;ì41ýÀ ¶::¸ýà¶; 9Ù«ÎNΫ.8ðýlí?ý²Î««ÎNΫ«,spppæþÂþÇèspppæ>9d]]c£]]] þÕ“`VhhV`’"xx  hVc`VhhV`cVY9ˆQþ¢Nˆ9ss9ˆN^Qˆ9sV^Ë!-;K[s  '&'&76767! '&'! ! '&'!   7654' 76= '& 76= '&! '.54676! K ¶::¸ýà¶; 9å8¸þñþï¶;ì41í8¸þñþï¶;ì41 ý²Î««ÎNΫ«ûk«ÎNΫ.8ðýlí?*«ÎNΫ.8ðýlí?—spppæþÂþÇèspppæ>9]]] þ]]cü]]cehVc`VhhV`cVþ|“`VhhV`’"xx þÁ“`VhhV`’"xx Z9ˆQþ¢þ¢Nˆ9ss9ˆN^^Qˆ9s¯ÿã-¾ ,"&54632#"767' 2654&#"î@a^CF[^µ‡©þ°ïìþ­©ˆ´þùccþ÷Z¤ç礡êê}[D>XUAB]»~îïþ´LÞœ~gþúÇ]þ£Çú÷ä¤£ØØ£¤ä…lPj…'#"'&#"'&'&'&47>7632327>76&'&'&/&'&'&47>762!2!%327>764'&'.#"&#"327>764'&'&ÍÖs®* 0$+$$$ 1#*# ZaZ%% NT12 4 #HH  ")mR‹èOeýbÕü  , 0  +  …Í ) . $J . %'.D"&B 1 $C mR )KÏy   µ !   V!Eµdz267>54&'."#"'%"'&'.5467676;27>4.'&+"'&'.54676762%632$"267>54&'&ý.&&.&m,mQÛþ‘j–P(!N!"(! aVf&&bZ55!("!N!(P–joÛQm,úæ.&&.&q    lü?W’,>&#< A#"< " (( " <"#A <#&>,’W?~    ÀlOOj…3!#!"'.'&47676?6767>'.'&#"#"'.'&47>763276;%32676764'.'&#"676764'.'&#"32ÍÖÕžeOèþuRd2!  HH# 7   ZTN +Za21#+$0 4$$$+$0 '±sý¹  *   * OÏK) Rd#!>& 3"9*$"D. ' - D! 2 . , T% #ý: & (  Iô˜èZx–´Òþ-4H67&'&'&+"'&'&'&476767632%632 #"'%#"'&'&'&54767676;276276767654'&'&'&"276767654'&'&'&""'&'&'&547676762"'&'&'&547676762'&'&'&547654'&'&'&";276-&#"+"276767654'&5476%327%&"'&'&476762I  Q\C--%("(/*0.,+"( /ŽX]â\ˆ9þþ<…\âþ£XŽ/"$)0*3')"* %1*0CR[þë        22 2 2 2 †%•'   &J  &%C\d#½í_*]OÙþ‘”hXC%&  J&   “ÙO]*ýÝÙ    Ù   ")&`&"'$"/' <%‹ZS  ÏÏ % SZ‹%< /'* "%5"-($# þÒ;ý‚8\= !  !  " þòÂ÷/V’C "  !  !  [uV/á+    Vÿã^ðau‡ 767>54&'&'&#"&54767632 '.5467&54732#"#"676767#"'&#"'67654 ozwbda_f_zxІ|wbdaM,krnulŒœšŽ†spsnun‹þÇŠ*D$ lµ©Q$" 6*D?"5'K(2- # ž>   :72 331cdíˆèi`4331cd퇼>˜mœwn<;;8roþ졘þðwp:;;BV0/MÍï8:D@*|sa  -F(7 "*=8&0!2  1-5$& 6:B4Vÿã^ð (B\w.'%&'&"632%6767>54$2"'&'.546767" 767>54&'&'&'2 '&'&547676©?'*&$ 1ó$-+h+-$F3782ˆ**?þ’1 $&þç>>9†|wbdabc`òzwbda_f_zxŠšŽ†spsnun‹þËŽ†spsnulŒwI_ý"2[$  £""ƒ þ ýgIƒ $[2!v 55 55 31cdí…ñcaf31cdíˆèi`43d;8roþ졘þðwp:;;8roœwn<;x,Aª-57'36%33#3#!2#!3#3##$'#7”$@d’’5«{s”Vdš]˜F0 0Fþø˜]šdV”s{«5þâ’’d@×(ÚÉ j–P‚PÆ,ÆP‚P–` ÉÚ„Ü0ù ")- !676762!"'&'&'&54!ö¸ûX¸$#R#+/®þRþŸþF¨þF$#R#$1þS­ýò¬h,þÔ  ªþÞþÝkþÓ-ª"ýs!ýßûã³|ïPÐãó476?6763&'&'&547632676767654'&547632!54'&'&54'&&#"'&/&'&'&#"#"'&'&/&'&#"&'&'&?6'&'#"'&'&#"!'476='654'&545454'327654'&'&327654'&/³%4-)"$0JK&  )7   ýß %0‡'# #6 +-L _ˆ_^/s4* 1( .266 |/(1   \«   ýþ#:7  l€S&   xë71]/~[#<$  o»_%@,†: $";vRþÔ $X$+|‰‰¶!5DX&PY;¶9Do6 b'n•2  83þeF] 4T&  &  /50$?- 1@& 3l K  C"P1Ö Ÿ·:03<D:5XI.)D&þ[+-1:   q/A8   g+©jl9Lp{‰7654'"'&#"+"'&54?67676763276323273#5%6767'&#"6"/67#"27632327654'73654'676547&Øp/l0&–J!cS%YþøE]{@C"$4>™-;% ¾Ì,(6áY>ømü¼!N$Xì6"/,(«4òsS?X$U>"sJ?K(`./4‰+2K2.ž0>ü°S ¢Zp0+þ 1^ð' þÇ;cs  /è^"|Y/ 4«28Û‡ƒ´Ï•l%é%oté5oA='Y$ a…£T* ''G+- %_kj~r}jL`І|ï\gÃK@/.85–c($¶šË¯ (2LS>54/##326?%%3254'654'3>7632#"&547>32'% ;66Ií ü€™ ’™ ƒ }¸ýgý„½ ?ý¤6ýûqýn   -> 9@ îH67; ù˜’ ˜’zýƒýh¸| ýó8 >ü¶6!qýúê    ôýÂB5–Ž>%+?F4&'&/76765'7! !'!654'!4'!!$467>2"&'&!654'£ Ò33Ò û¦^^^¯¯RXý¨ü®¯I´#ýJ2ýVªülÅPú#Þ ~!88!~ KØppØphÈþ¬þ¬È,þÄp <(##(#id¶šË¯ (2LS.#"227654&'''%'654+.#"65.'&54632#"'.6#"%  íI66; üo’ ™’ ¨Æ|™¸ýƒ>?%6!ýûqý   9 ý ;76Hî ý ’˜ ’ÕÆ |¸ýhýƒì> 8ˆ6ýúqým    BýÂX{[%G'23 %%.'&"27>7%$!"#232%"'&'.4676762%#"#Š2%ký¿      Aý•ýéþÛ™±·þœ>>dþIýñ±ID`nþíS   SþínGŠYn¹ 5>5 ¹nŠ­)(%$#"#64'232%%&'&'&"27676è&ý•ýìø22økýÚ**Å!þín`à`nþí!##3ÆW 2327632#"'&'&5476Å'( ï>‡ !þ~þ¶GH ".4F+Ž@xÂH )þ0ýü$Š™'*'í²Å 23277632#"'&'&54763Å'( ïe` ý}{*˜279HF`0@x¯JýÞL ²†1 ,”±A  ' 7 çÉŽþ8þ7ŽÉþ7ŽÉÉŽêþ7Éþ7ÉÉþ8ɯ?– ‘tþÉþŒþŒþÉtþŒ7tt7êþŒþÉtþŒ7tt7þŒuþÉñÿîœÜB2632#"'&'#"'&54767'&54763267632676ø ÐÄQ   x€¬Þ L$3 Ìäz(   6XŽÌÜ3âþñÆï  šÐàþŠ6*=P*> "#  ¨˜¸ÌüêR26#"'#"'&'+"'&'#"'&547&'&54767&&5476326763276T ñë””% $$YyæX$ ‚Äzc0 + j–çù ê:  (ÛþÇÌ¢1#: _¿þû‡$ #- °Ô½ =1 '2ĺÚ pDÕ #!!!!!%!!!!!!!!#!5!36þHþVª¸ªþ¦¾þBý¨þB¾XȾþBÈþB¾ÈÆ«þUþHþVª¸Pý¨þB¾X¿ýyÈþB¾È¿pDÕ !!!!!!""ýÞþpýÞ"²þpýÞ"#pDÕ35#7!!#!5!3ãîîïrýŽðýŽrðsîðýŽrðspDÕ!!%!!!!!!“Žþr"ýÞþpýÞ"#ŽþpýÞ"#RbÕ !!#!5!3ÒþpðþpðEðü«Uð lÕ3!!'#'!!#!!3!5@––þÔþŽ–––,r–ÈÜþÔ,Ü,©–þŽý_– –r,–ú,þÔÜý_¡Ü>vÕ #!!!!!'!!!!!!!!#!5!3þ˜þèhÈþèýøþè þèÈþèÈmþèþ„ý_¡|Pýäý_¡þHÜý_¡ÜpDÕK#";54&'&'&#'!326767657'&'&'.+3!76767>5{d³IB,$2$*DE³h{LGC_RQ|66R_CIJ{h³ED*$2$,BF¶d{LGC_RQû„66R_CIJ KIB`OT|87O\FGKzd¶GB+%2%+BI´dzKGF\OTû„87O`BHL{d¶GB+%2%+BI´d»ÿåùó  #!! !!! 373#'7#Zà¿ààþAààþAàà¿:¦¦L¦¦¦lØ­mllmÙþzØlþçmllmÙóþ|þ}þ}þ|„ƒƒdþáþà »d»»þ}¼c¼¼¼„»Tÿã`ðC54'&54762327632#"'&+"'&5476=#"#"'&476323(L,68x86,L ºzFvd0000dvFzº L,68x86,L ºzFvd0000dvFzº ºzFvd0000dvFzº L,68x86,L »yFvd0110dvFy» L,68x86,LVÿç^ðƒ&'##"&'&'&4767>32367675&'&'.5467676236767>32#"&'&'&'#"'&'.546767675& Ô  R.-R  R-.R " Ô *!""! ((\(( !""!#%  Ô " R.-R  R-.R  Ô  %#!""! ((\(( !""!*“*!""! ((\(( !""!#%  Õ  R.-R  R-.R " Õ  %#!""! ((\(( !""!* Ô " R.-R  R-.R  Ô Sÿãaðƒ4&'&'&'.546767622676767>32#"&'&'&'.#"'&'.54676767>5"#"&'&'&4767>32(,$ ((*& :.r06$&**& )'De!  'd8:b&$$&b:8d'  )a@/!  ')*&$6/r/6$&*)'  ')?c'  &d8:b&!$&b:=_& (bCc"  &d8:b& $&b:=_& (a?/!  ')*&$6/r/6$&*)'  ')De!  'd8:b&$$&b:8d'  )a@)' ((*& :.r06$&**& ((Tÿå`ò0267632#"'&'&'!&'&'&54676763267632#"'&'#"'&'&'&5476767!6767632#"'&'"'&'&'&54767#"'&'&'&5476767632!#"'&'&'&54767#"'&'&'&476767632&'&5476767632!#"'.'&5476767632&'&54767676Z   ( &        þÛ    <   4 þÛ         % (   ò   (  þÛ 2     6  þÚ         %    <    %  (   Wÿã_õ2767653"4'&'&W›†spsnulŒœœŒlunsps†ì;8ro¡þðwn<;;¬¢þ²þj¢¬þ>-¬¢›œý'†þO^†__†^þOqþ¸ýï4óþÙ4H4þ"hþdÿþdÿÿœÿ„0Õ!% %!-º@– þj– þjþÀþj •þk Õþ*ëþëêëþëëþ*Öëëê˜Õ37'73 #'ãxxîxxþ™þ.xÒðÒxþ.Òxþ.ðþ.x¹ÎÐÐÎÎ ÐþòýåÐþóþòÐ ýæþóÐpDÕ #'!5!73!Ô¹GþFdþFGºýrþEGºdºGþEr¸þFG»ýŽqþFGºd»GþFqýºGþEd@ÿãLð     - FOÔþFýºcþ,OOþ,cýºFþÔðý¹dþ,POþ,dý¹GþœÔOPÔþœ Tÿã`ð '%%%%%% % -õþÝwDþÛþáš{þáwwþe#wý¼%þf{wwŸ„¤‡þy¤þ|ŸŸþ|¤þy‡¤„…{þàxxþe#wý¼%þf{wwœþÝxEþÛþàþy¤þ| Ÿþ|¤þy‡¤„Ÿ „¤»ÿãùð % %  Zp/þA¿ýÑppýÑ¿þA/ðý¼Áþ}þ}Áý»EÁƒƒÁTÿã`ð     - Zq²þïôþ þNqqþNþ ôþï²ðþ þNrqþNþ õþî²qr²þîTÿã`ð% % -Zªy‰lþ”‰þ‡ªªþ‡‰þ”l‰yðþ”‰þ‡«ªþ‡‰þ”l‰yª«y‰Tÿã`ð%% %% -ZtGcïVþªïþGþñttþñGþïþªVïcGðþ©ïþGþñstþñGþïþ©WïcGtsGcïpDÕ/3%!!%#'''%!5!%777xªoª:UþÅœ.þc¾þF™.þd;UþÇ©oªxªoªþÆU:þe.šþE¾þc.™þÈU9©o¾þE™.þf:UþÅ«o«xªo¬þÄU9þg.˜þF¼þf.›þÅU:ªoªx«o©9UþÇ™.§ÿã ð›54'&5476276767632+"#"32;2#"'&'&/"'&5476=&'&'#"'&'&547676;232?&547'&#"+"'&'&54767632676'K,68x86,L qA'C<4GW>L ƒd  f‚ L>WG4L „d  dƒ L>WG454&'&/54'&5476276767632+"#"32;2#"'&'&/"'&5476=&'&'#"'&'&547676;232?&547'&#"+"'&'&54767632676o**YK,68x86,L qA'C<4GW>L ƒd  f‚ L>WG4L „d  dƒ L>WG42#'"372"'&'&/"'&476="'&547>µŸQ!//V–Z¢ *nN™+G80j@6R¨R6@j0/P1“N± ¢TžP#00V–Z¢ ,lO@W+G80j@6R¬N6@j03L/•N² ¡Ä ]H,`,H Yc¢!77™\Ê4OO4ÐVA7§gU3š',H^ ]H,`,L&3c¢!77™\Ê4OO7ÍVA7¥fV4š&,H^¡ÿãð™±É67654'&"327632#"'&'&/#"'&5476=#"'&'&5476763232?'&#"#"'&'&5476763254'&5476276767632#"'&#"#"'&#"327676%32767654'&'&#"#"Z8%1T1%8¨5e %ZF\ +m8BS/?JV@6RTXN6@VGB1QB8n* \FZ% e53e!&ZFZ *n8BS/?JV@6R¨R6@VGB1QB8m+ \FZ&!e3þ˜DA 5<; > +F$ÜH$F+ > ;<5 AÓcJ2QD++DQ2Jþ´ (5H,'9,J&0f‰) T|\`j4OO7g`\|T '‹g/& H,9',I4( (3J,&9-H &0f‰) T|\`j4OO4j`\|T '‹g/&J,9',H5(€""'!$(:UJJU:($!'""nF­w"2767>54&'&'767632"'"'&'.'"'&'.546767"'&'.546767632.546767632¢=>343343>==>343343>x>%85670-),(-%8/[0!-(,)-02y/8%0%)-02y/8%-(.'&$W/:#-(,)-02;>/;),)-02;>/8%-( 06{IF{6006{FI{605+'g>:c.&".c;=g'+&1N%&W'+&.c:>k#"$.c:>g'+,B:>g'+&.c;=?nF­\v¦½Ö%"'&'.546767"'&'.546767632.5467676267632"'"'&'.27654&'&'&"67&'&'&'276767&5467'&'&#"32767>54&/76767>54&'&'&#"Z0%8/y20-),(-!0[/8%-(,)0-<1:3%>(-%8/|/8%-(>%85670-),(-%8/[0!-(,)-02y/8%0M=  H C# B/g H Ö/*x#$  8## H g/B õPP  $#x*/ø%N1&+'g=;c."&.c:>g'.5 ?=;c.&&.c;=? 5+'g>:c.&".c;=g'+&1N8GG$> >$ ‚ýc.,bB$#>  ºIr0C >'#> þÂLM >#$Bb,.$ >#'> C0rI Tÿã`ð)T½æ:e©Ó&'#"&'&'&4767>3267'&#"327%32676764'&'.#"7632#"#.4767676324676762>322##"&'"'&'.5#"'.'&467"&'&'&4767>&'&'.'&'>76?&'326767767>5&'&'.#"767>7.'&/32>7674&'&'67'&'.#"67'&'.'67676767"2767>54&'&'"'&'.54?&'2767>54'7654&'&'&"67'&54676762:ä    äÎ$4 4$ww4 4 åxy   ûÊ%" !()-+U$"! ((\(( !"&S+-)(! '7M"# V2% A()-.R$"! ((\(( !"(O-,*(A"#2P"# "MÁŽ   ´ ¸! *4 2ë kk  4 2 uKK   ¦ ´    Ži2 4* !ý‰== 2 4  Í `_  wR#$$#R#$$  8 < c !<>  š   8 < d!!<>   "%UV*) !!$3R  R3&!-(-%Z& "#%(.2$( &&S+,))A!$3R  R3'A))XT$""#%(`$( " þ ´     Ži3+!x== 3 Í _`   þŽ    ´ ¹!+3ë kk 3 uKJ   ßF)(GG()Fþ$ä    äÍ%3 3%ww3 3 åxy   Vÿã^ð3N^"2767>54&'&/2"'&'.4676762 '&'&547676% %-—z35++++++53z35++++++5pWDM69?=;9JHªDM69?=;9JHSšŽ†spsnun‹þËŽ†spsnulŒœþ£þ}ƒ££ƒþ}£þ(.h<;h.((.h; +F$þ$þ‚> +F$Hþ‚ ;<5 AØ~ ;<5 AÓ¹+DQ2Jþ´ (5H,'9,J&0f‰) T|\`j4OO7g`\|T '‹g/& H,9',I4( (3J,&9-H &0f‰) T|\`j4OO4j`\|T '‹g/&J,9',H5(õþG+DQ2JÁÝ$(:UþÍÝ$(:U3Ý!'""ûÝ!'""¶þÕA''7'753'75377537'7'#5''#5'7#5'7'7âðÂ<†Ä<ÄxðÂ<†x†<ÂðxÄ<Ć<ÂððÂ<†Ä<ÄxðÂ<†x†<ÂðxÄ<Ć<ÂëŠphMrhr›à‹ohMããMhoþëŠà›rhrMhpŠ‹phMrhr›à‹þêohMããMho‹à›rhrMhpœÕ!%)-153%% %%#'-75%77%7?5x# <þö$þÝ <þ÷þÝxþÝþ÷< þÝ$þö< #««#««ý÷¬««šª««ýö««x«ÕþÌ©þ°šhš¨¨™hšþ¯©þÍ3©Qšh™¨¨šhšP©'ÅcÅccÅchcbbccbbgcÆcÆÆcÆ‚0ÕA37%37' 7'#%'#5'7#5'7'7-'7'753'7xŒdð ÈX<[Œdðþö ðdŒY<\ÈþùðdŒxŒdðþ÷È[ÿB-ÏDH2#"2767>5!"&54$3!57!#"'&'.5467676#Ý_>I-74þÍÞý×3TŒÈP>CPN±DG-2.1/&D9¨¾Ð 88 '.* !-8D_èÈ2ú{ûÛj·@F'%.3r@Md7+4VýªžÿÝð/2&'&54676762"'&'.546767Z y*,&'ˆ²‚†®ˆ'&%1]~|45,-++-,54|45,-++-,5ð(+&a4|dƒÎ΃fz4a&$(üF*.j=3"&'&'&54767>32Ôîòr²JŠ6464ˆNNˆ4646ŠJ´pòêŠþ`Â684F@NLBD64:866D@NLBD668Âþ^~*Ëž i654'&#"632327632!"'&5!267&'&#"#"'&54763247632327654'&547632#"— 6+Jo.^V|;-þË™it36?þÅ̺ÆfQMeæEJS?(*$ s]vh2K)*NL13^Úv:Mc*„Zœ™£þe—C0ª3N35%&-Kt\K%9S >BWN=!$?$8(F!5{^? Z„ Q67654 547&'&+327#"'#536767&'&'&5432&5476323254'&5432ß?-BO>=þþ‹v06&%K`dC+(‘k$'eM?$#=Hb B=)+8=.mØ9eb PB÷°>$3g:84þ!þEB7WPfG+1K«HŽP<Ff#&T'0P+A'þ“š<þú›œ¸±œ›ƒ}DC‘þä/'"05276767654'&'4‘rceNS((((¦`hmº©§„Œ@DDF†Š¡©þä/CD}ƒ›œ±¸œ›>C/GF†©½»¤§…‰CGþñ˜ !&547˜†‚ƒ…þ°–•”—æþ>þ2þ;åëÆàßÄìþñ˜ 0!!6P—”•–þ°…ƒ‚ìþ<ßàþ:ëåÅιþÛ! !ÛþÜþþ$þþüÛþü ! Ûÿþ"þþþüü#þ{! !{þ<ýl”Äý`þü9þ‘ ! 9 ý`Ä”ýlþüüUþ?! !?þþþìþþüwþ` ! wÿþêþþþüüÄþHZîjþæjî•îjÍjîlþð'7'7Zîjþæjî¼îjþæú3þæjîfþ²$#"&=4&+5326=46;#"3Ôù©lŽ==k©ùÔDV[noZV¾”Ýï—ts•ðÝ“XøŽŽœøX¡þ²N$326=467.=4&+532;#"+¡DVZon[VDÔù©k==Žl©ùÔ¾XøœŽŽøX“Ýð•st—ïÝ”˜ÿì”è º+¸º +¸ 01! 4$32!5##7#”þ?þÂþÄþ?Îq¾ÁqÍûÓiÚ¡þÿìÙêþÁþA¿?ÆrÆÆþý\Ž/˜+ý‚˜ÿì”è *º%+¸%º +¸ 01! 4$32>54&#">32!5!>”þ?þÂþÄþ?Îq¾ÁqÍýæ>0Å£=‘as„;N_/>!þúR¤þL}²êþÁþA¿?ÆrÆÆþéFi:}—$«:&N?(U?"ñMŽt§˜ÿì”è 6™º+Aêú]A)9IYiy‰™©¹ÉÙ ]¸1ܺ.+¸.º +¸ º!'+¸!º+¸º9º*'!901! 4$32%4&#">32+32#"&'32654&'26”þ?þÂþÄþ?Îq¾ÁqÍþ|Á¡=ˆ_ky4[\XZ‘ŒcksuD}[Xˆ@ÃØv hêþÁþA¿?ÆrÆÆþs‰— ?<:<ŒNGLO0¨œ]r˜ÿì”è º+¸º +¸ 01! 4$32! !3535##”þ?þÂþÄþ?Îq¾ÁqÍýþó þC½¶ÎêþÁþA¿?ÆrÆÆþþ¼~þƒŽÓÓH˜ÿì”è +‹º!+Aê!ú!]A!)!9!I!Y!i!y!‰!™!©!¹!É!Ù! ]º+¸º ++¸ º+¸º($+¸(º901! 4$32>32#"&'32654&#"75!5!”þ?þÂþÄþ?Îq¾ÁqÍûïYe2hvvhDw_X…@¾Õϰ?‘ýÃêþÁþA¿?ÆrÆÆþó%aVUa/¬¬˜•° «Ž˜ÿì”è 2ñ¸3/¸4/¸3¸и/¸4¸ܸÜAêú]A)9IYiy‰™©¹ÉÙ ]¸¸ÜA&6FVfv†–¦¶ÆÖ ]Aåõ]º +¸ º +¸ º+¸º,&+¸,º/&,901! 4$32#"&54632"32654&#"7>325.”þ?þÂþÄþ?Îq¾ÁqÍý¢\NN\\NN\qÈêÀ¹ Âº N€ w/aTJjêþÁþA¿?ÆrÆÆþþZbbZ[bb*þõÚçý³‘”±= P”#œ˜ÿì”è º+¸º +¸ 01! 4$32%!35!”þ?þÂþÄþ?Îq¾ÁqÍûÂÏþ¯ÁlýUêþÁþA¿?ÆrÆÆþvüæ]K˜ÿì”è 1=‹º+¸º+¸º +¸Aêú]A)9IYiy‰™©¹ÉÙ ]A&6FVfv†–¦¶ÆÖ ]Aåõ]Aê ú ]A ) 9 I Y i y ‰ ™ © ¹ É Ù ]º/9º;9¸;/Aê;ú;]A;);9;I;Y;i;y;‰;™;©;¹;É;Ù; ]¸5ܺ+¸º )+¸ º+¸º28+¸201! 4$32#"&5463232654&'>54&#"2#"&546”þ?þÂþÄþ?Îq¾ÁqÍý¹_TT__TT_ýâ¾­­¾vi¶·jvkKRRKMQQêþÁþA¿?ÆrÆÆþþlHQPIIPPIŠ——Š\ƒvStˆˆtSvƒÄB>=BB=>B˜ÿì”è &2é¸3/¸4/¸Ü¸ÜAêú]A)9IYiy‰™©¹ÉÙ ]¸3¸'и'/¸-ÜA-&-6-F-V-f-v-†-–-¦-¶-Æ-Ö- ]Aå-õ-]º+¸º +¸ º +¸º*0+¸*º# 901! 4$32254&#"326#"&'4632#"&”þ?þÂþÄþ?Îq¾ÁqÍüÑÈ鿹 ÂºŸO€ w.aUJk<\NN[[NN\êþÁþA¿?ÆrÆÆþýK Úèý´‘”¯< O“$œ„[bb[[bb˜ÿì”è $0Óº%+¸%º+¸º++¸Aêú]A)9IYiy‰™©¹ÉÙ ]Aê+ú+]A+)+9+I+Y+i+y+‰+™+©+¹+É+Ù+ ]º+¸º .+¸ ¸¸(Ü01! 4$32!5##7##"&5463232654&#"”þ?þÂþÄþ?Îq¾ÁqÍû$Ÿu¼¬ž‰F?@EE@?Fþpˆƒ‚ˆˆ‚ƒˆêþÁþA¿?ÆrÆÆþý©€Ê*‰'ýÂ$¢——¢£——£ÐääÐÑää ÿ–«=$>  767654'&'!5%3!!  '&'&54767ôþ̆„mommom„†4†„mommom„ý¥þá¡ýP\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6û}9“:û݈¨@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=6P  767654'&'!!567>54&#"5>32  '&'&54767ôþ̆„mommom„†4†„mommom„þ)4ý \=)N=…kP¥`aªFºÝ7I׺\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6û€ˆˆ_A.Xx;_x55£'(º›I„ZÞV@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=B\  767654'&'#"&'532654&+532654&#"5>32  '&'&54767ôþ̆„mommom„†4†„mommom„ttƒóàLŸUD W˜Ÿ”„‹‘x~‚zB˜\R«GºÕrþ=\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6ýyœt°Âœ'(xrjw…_Z\b§Ždˆ @>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«='A  767654'&'!33##!5  '&'&54767ôþ̆„mommom„†4†„mommom„Þþh˜*˪ª¡ýå+\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6íý‚ üõ†þæœò@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=7Q  767654'&'!!>32#"&'532654&#"  '&'&54767ôþ̆„mommom„†4†„mommom„ý£zþ#G#ÈéðÚKœSL•VŠ¢¢ŠAC\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6cˆþÛ Û»ÁÖ£)%’}|’X@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=%>X  767654'&'"32654&.#">32#"32  '&'&54767ôþ̆„mommom„†4†„mommom„þÖl€€lmÔ=|< © /ŽV´ÑÚµÏÛ â=|þ^\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6ý‹•‚€––€‚•ú“ØÚEKÛ¼¸Þ>-O@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= :  767654'&'!#!  '&'&54767ôþ̆„mommom„†4†„mommom„ý\þN¨˜ýÂÖ\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6`Eûš#…@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=#9E_  767654'&'"2654&%.546  &54632654&#"  '&'&54767ôþ̆„mommom„†4†„mommom„þßs„„æ…„þêhtÌdÌthuƒÔþtÔ„9tihvvhit0\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6ý,{Ø{|kl{EŽg¦¦gŽžs­ºº­sž\hh\]hhÐ@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=2>X  767654'&'53267#"&54632#"&2654&#"  '&'&54767ôþ̆„mommom„†4†„mommom„ý§=|< © .VµÏÚ´ÐÚþôâ=}þmml€€J\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6û“×ÛDJÙ¼¸ÞþÃþÑþæþ¯•‚••‚••@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=+8Ca  76767654'&'&'"32654'.  735733!  '&'&'&5476767ôþ̆„mo5885om„†4†„mo5885om„T,+VUVV++ï2QPPQþΠPþ3–•ƒþp\˜–|~-,¡üg%“&û݈¨@>}~•—±¬—•~}>@@>}~•—¬±—•~}> ÿ–«= $!5!#%  '&'&54767°þø¡þâ{\˜–|~{{~|–˜þ¤˜–|~{{~|–ˆˆ#:“9üq @>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=6>7>54&#">32!5  '&'&54767£Ã×I7ݺFªa`©Lk…=N)þÃ\öýÕ\˜–|~{{~|–˜þ¤˜–|~{{~|– ÇÞZ„I›º('£55x_;xX.þ¿_ˆˆ@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=(B>54&#">32+32#"&'32654&  '&'&54767ir׸G¡\\˜Bz‚~x‘‹„”Ÿ˜W DUŸLàóƒþ2\˜–|~{{~|–˜þ¤˜–|~{{~|–ˆdާb\Z_…wjrx('œ°tœ=@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= '! !335#$  '&'&54767œþhnþ¡ªªþo\˜–|~{{~|–˜þ¤˜–|~{{~|–³ý‚ ý œþæ† ý@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=7>32#"&'32654&#"!5  '&'&54767CAŠ¢¢ŠV™HSœKÚðéÈ#G#æþ\˜–|~{{~|–˜þ¤˜–|~{{~|–=ý¨’|}’''£ÖÁ»Û %ˆ@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= $>2#"&546.#"32654&#">32  '&'&54767Pmml€€­C|=âþóÛϵÚÑ´VŽ/ © <|=þ\˜–|~{{~|–˜þ¤˜–|~{{~|–+•‚€––€‚•úþ¯þåþÓþÂÞ¸¼ÛKEÚØ«@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= !35$  '&'&54767Ö>þh¨²ýÖ\˜–|~{{~|–˜þ¤˜–|~{{~|–@ˆûÝfEý@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= +E2"&46' 654&'>54& 74632#"&  '&'&54767Yt„…æ„„/t„ԌԃuhtÌþœÌt-tihvvhit0\˜–|~{{~|–˜þ¤˜–|~{{~|–Ì{lk|{Ø{Ežs­ºº­sžŽg¦¦gŽå]hh]\hh‰@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=$>%32#"3267#"&'"&54632  '&'&54767!C}=â ÚдÚѳV. © <|=Al€€lmþÝ\˜–|~{{~|–˜þ¤˜–|~{{~|–®Q/=Þ¸¼ÙJDÛ×g•‚••‚••@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=  :2#"&546$  !5##7  '&'&54767™eddedddþ¾©©Bªû‘¡³´–\˜–|~{{~|–˜þ¤˜–|~{{~|–Õõ÷õööõ÷õ€þÃþÑþÓþÂ>-/ýˆˆ#&“%üq @>}~þÔ±¬þÔ~}>@@>}~,¬±,~}>ušPj !!5!!PþþÀpûÝ#þ@‚þpðpüpté 7%÷ý©µÔFýN‹´ªý4ýNGuÌP85 zûûDýæ<2ð2pþJþJüt” '-ZýK©ûþ˲Fýª´ÔGýNuPü!!u»¨\lý”þ¤¨ýE¾>ü~~ü>uu+"&'.546?!".4>3!'.5467>2þp4,ºü€,$$,€º,4›2.þp ,.º".2."º., þpuÌP8!5! šûÛ%¶þJZPŽþJþJuÌP8!5! šûÛ%¶þJÜHþJþJuÌP8 #3#3#3!!5 ¹ððþÀxxÈ<<éþo‘¶þJºþpþpþpîþJþJuÌP8 55!#3#3#3š¸þþ¸þoPððþÀxxÈ<<®Šþ΄„þΊXý¨Xý¨Xý¨Xu†}~ !!üþûô ~þþÖäÀPD! 6ü¼–þ>lú”‚þñÂþ>þ>äÀPD ! þòDýRþ>lú”‚þñÂþ>þ>äÿøP  Bþ¢lú”‚ŠývývuÌPb3!5 5! '&'.u$##+* Z¶þJþMþM*+##$‚à0U%!ÆþJþJÆ!%Uu¢P84676763!5 5! u$##+* Z¶þJþMþM*+##$‚0U%!ÆþJþJÆ!%U0ìÿñÙ!! ^þŽr{þ…VXeýoýouÌP855!¼þDüqšžþ΄„þΞ0ušj%5!!53  !<ý9Çúèþª˜þhý9šîôîþþ>îþ¬ušj%5!!53  !<ý9Çúèþ˜þhý9šîôîþþ>îþ¬+Z° !73#57!!+ IŠdØý&–ý+ÑŠ„¬Šü·ÄÎôîýþÈþ2È&îþ¬+Z° 5!'53#'!!!+Õ–ÚØdŠü·±ü·ÄIЬý|úÈ&Èþ2Èýþî¤þ¬î˜˜2˜ !'!'!53 !ÜOýìdcnèdþ‚˜þhýžÈ”žþÈþ¶ž˜˜žþ 2˜ 3#5!7!!! Ünèdþnýd;ýc˜þh˜þÈþž”Èþèþ ž˜˜dd˜ !53#'5!'! !–]nè2þn2üÕ2òr-˜þhüÓ°Jžþdþc;dJúž˜˜ždd˜ 7!573#5!! !–2+2nè2þnü£òr-˜þhüÓLJd;cþdþžJúž˜˜ž<ÿØÄ¯6767632"'&'&'! <'CZmo~yti^Z\X^Vqo÷ti^?)XÊþ6nGCZ.//+]YÝ€zÚ_X0//+]>IžÊÊž ‚BP "&*.37#37#37#37#5!!!!3'#3'#3'#3'#á < ´ < ´ < ´ < x»»‡­Ãíþy»ýä_< <(< <(< <(< <ZððððððððPþ輂‚¼þèhððððððð¥pt> 7&#"7'7 !%¢¯*ޤBF¯þ8þ©þåþWU¨{°FC£*°þ9oþX¨:þWþæubP¢ 55!5!!'!þš¸¸šþ˜ý§XÈý¨ÈÈXȪø¼dd¼øPRÈÈȧÿÅt” '327'' !!i¯FB¤Ž*¯ÿ8þ‘¨þX:þå¨Á°*¢CF°ÿ9þ¨þåþXU¨§pt>*%&#">7'&'&">327&5467>7t¥BEH€¦¦#&NKþX$W/,0$"¨ D5Hp*G6¦¦¨$"!0,0Y"þW!F&'&#þ»GGC£uaP£'467#"!4676?'&'.5!3!.5P·›5ëê#$ý¨%"//"%X$# Ë5›‚e¼eJ(0Y! "X0(Je¼§ÿÆt”*.'.54?'#"&'2767.'32t)H5§§ þX"$ #0,0X"¨KN&#E€HEB¥”Ž£CGG¨¨&'&KþW"Y0,0$"¨E6Gs¬PX'<6%"'&'.54676$4676762"'&'&&'.54676762$/ö+ãz >ü_ $#R#afü‚þ·#R#)ž>xåþ”ÎbQuþý 88—RK…68ƒ# 88  þþvc–<å*676767632#"'&'&'&%.5467.546–A ''+/54<3¢‘þo¢8n23'9%%%%büüb%%%‚&:?$ fLLf#&#/:&'X23X'ñrrñ'X32X¢V2®c"'&'.54?654&'&'&#!"#!".4?64/&4676763!23!2767>54/&546767622ð þæZýœ ;:td Z ð‹ð  c ´  uuè ´ c  ð¢ñ2c"'&'.54?654&'&'&+"#!".4?64'&4676763!2;2767>54/&546767622þpW\xýj IJœ– ‚\W‹þ˜ Ûð  ““8 þüÛ þ˜u¦P^'#76767&'&/3#>7!5!!5!.'PˆSŒJl.. &GG& GlHŽSýÌi7*üÖånK Knü**7‚OU©nm¤'66'¤1ª¤”UýÕ=…HdŽ·)·ŽdH…=nþ²Ð&*'$&'&#"'67667Ð h7þHm^:-ˆ3ÕÞþ° REþ² SR®õQO‰1ØÌ¡üLÜHOþ²±&57$'&54&#""OER þ°ÞÕ3ˆ-:^mþH7hþ²HÜ´¡ÌØ1‰OQü ®þ®S þ#îu ! !ùõþ þ óþ˜Òþ–jý.uûÛûÓ-1ýüްþò0 3%!#3!ÈþÔ€ððý€°ù¦Zddù¦d¯þò/ #3!53#5ËÈÈdý€ðð°ù¦¾øÞdZd·þò{3 #·ªþ檂üpüp¤þòh # 3hþæªþ檂üpÿÿ·þòÏ&GGTÿÿ¤þò¼&HHT[[Ü '#'#'##'‰Òx\xÒxjjxÒx\xÒÜý,x\ýeÓûȰhhûP8Óü›ì\xÔYÿùYÕ73373737+ý.x\xÒxjjxÒx\xý.Ôx\ìü›Ó8ûPhh°ûÈÓeý\xý,Ol„D=072767>54'&'&'&"7#7676767632#"'&ew@RN¾JV !'7$"!3!&'&'&'!#!2767676Þþwxéþ  !1cbîþìîbc1! ½½ "1cbîîbc1" `éxüâÖ]\LM& ®ª® &ML\;þRªþR &ML\]Ö]\LM&¯ZþwxéZQvcbddbcvQZª[RwcbddbcwR[éxV''LM\7=eþ›=7\ML'ýÆþ›e;6\ML''''LM\6dÌ 8 ´  ÔÔÌ2@ @@ 00 ]1@  œ Ôì99ÌÌ0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY5!!d‰xé ‡öyéxUZ‰xéªéxuÌ 8 ´  ÔÔÌ2@ OO __ ]1@ œ Ôì99ÌÌ0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY'7!5!'7 þwxéöy ‡éx¯ZþwxéªéxdÌ 8Ú¶ ÔÌ2ÔÌ2@ PP_ _O O]1@   œ Ôì9Ì2Ì20@   œü<<@ œü<<@ œ ü<<@ œü<<°KSX· <<<<´œì´œì´ œ ì´œìY5!'7'7!d‰xé€éx‰þwxé÷€éxUZ‰xééxþwZþwxééxdÌ 8!!5!! s÷]xþw‰x]ûöix]x‰Z‰x]xiuÌ 87'!5!'7'7!5 èiiöû]x‰þwx]÷iix]xþwZþwx]xdÌ 8!7'!!5!'7'Xii÷¨iIø˜]xþw‰x]h]x‰þwxiiiá]x‰Z‰x]]xþwZþwxdÌ 8 !5!3# Y÷#éxþw‰xéݪª-éx‰Z‰xéYü¤uÌ 8 #3!'7'7ªªÝéx‰þwxé-þ§\þ§éxþwZþwxédÌ 8 !5!53#5! Y÷¯]xþw‰x]Qªª÷7ii¡]x‰Z‰x]Íü¤EÒiiuÌ 8 !'7'7!#3!7'Q]x‰þwx]÷¯ªªÉiic]xþwZþwx]Í\þ»ÒiiuÌ 8%77777773'7'7#'''''''uF´´´´´´´´´´´´F‹éx‰þwxécn´´´´´´´´´´´´F×F´´´´´´´´´´´´FéxþwZþwxén´´´´´´´´´´´´Fÿÿ,X@^,ÿÿ,ÝX ^,Ýÿÿ,ÝX@'^,^,Ýÿÿ,§XÓ^,§ÿÿ,§X@'^,^,§ÿÿ,§X '^,Ý^,§ÿÿ,§X@'^,'^,Ý^,§ÿÿ„°@^„ÿÿ,°@'^,^„ÿÿ,ݰ@'^,Ý^„ÿÿ,ݰ@'^,'^,Ý^„ÿÿ,§°@'^,§^„ÿÿ,§°@'^,'^,§^„ÿÿ,§°@'^,Ý'^,§^„ÿÿ,§°@'^,'^,Ý'^,§^„ÿÿ„ݰ ^„Ýÿÿ,ݰ@'^,^„Ýÿÿ,ݰ '^,Ý^„Ýÿÿ,ݰ@'^,'^,Ý^„Ýÿÿ,§° '^,§^„Ýÿÿ,§°@'^,'^,§^„Ýÿÿ,§° '^,Ý'^,§^„Ýÿÿ,§°@'^,'^,Ý'^,§^„Ýÿÿ„ݰ@'^„^„Ýÿÿ,ݰ@'^,'^„^„Ýÿÿ,ݰ@'^,Ý'^„^„Ýÿÿ,ݰ@'^,'^,Ý'^„^„Ýÿÿ,§°@'^,§'^„^„Ýÿÿ,§°@'^,'^,§'^„^„Ýÿÿ,§°@'^,Ý'^,§'^„^„Ýÿÿ,§°@'^,'^,Ý'^,§'^„^„Ýÿÿ„§°Ó^„§ÿÿ,§°@'^,^„§ÿÿ,§° '^,Ý^„§ÿÿ,§°@'^,'^,Ý^„§ÿÿ,§°Ó'^,§^„§ÿÿ,§°@'^,'^,§^„§ÿÿ,§° '^,Ý'^,§^„§ÿÿ,§°@'^,'^,Ý'^,§^„§ÿÿ„§°@'^„^„§ÿÿ,§°@'^,'^„^„§ÿÿ,§°@'^,Ý'^„^„§ÿÿ,§°@'^,'^,Ý'^„^„§ÿÿ,§°@'^,§'^„^„§ÿÿ,§°@'^,'^,§'^„^„§ÿÿ,§°@'^,Ý'^,§'^„^„§ÿÿ,§°@'^,'^,Ý'^,§'^„^„§ÿÿ„§° '^„Ý^„§ÿÿ,§°@'^,'^„Ý^„§ÿÿ,§° '^,Ý'^„Ý^„§ÿÿ,§°@'^,'^,Ý'^„Ý^„§ÿÿ,§° '^,§'^„Ý^„§ÿÿ,§°@'^,'^,§'^„Ý^„§ÿÿ,§° '^,Ý'^,§'^„Ý^„§ÿÿ,§°@'^,'^,Ý'^,§'^„Ý^„§ÿÿ„§°@'^„'^„Ý^„§ÿÿ,§°@'^,'^„'^„Ý^„§ÿÿ,§°@'^,Ý'^„'^„Ý^„§ÿÿ,§°@'^,'^,Ý'^„'^„Ý^„§ÿÿ,§°@'^,§'^„'^„Ý^„§ÿÿ,§°@'^,'^,§'^„'^„Ý^„§ÿÿ,§°@'^,Ý'^,§'^„'^„Ý^„§ÿÿ,§°@'^,'^,Ý'^,§'^„'^„Ý^„§ÿÿ,þpXÿœ^,þpÿÿ,þpX@'^,^,þpÿÿ,þpX '^,Ý^,þpÿÿ,þpX@'^,'^,Ý^,þpÿÿ,þpXÓ'^,§^,þpÿÿ,þpX@'^,'^,§^,þpÿÿ,þpX '^,Ý'^,§^,þpÿÿ,þpX@'^,'^,Ý'^,§^,þpÿÿ,þp°@'^„^,þpÿÿ,þp°@'^,'^„^,þpÿÿ,þp°@'^,Ý'^„^,þpÿÿ,þp°@'^,'^,Ý'^„^,þpÿÿ,þp°@'^,§'^„^,þpÿÿ,þp°@'^,'^,§'^„^,þpÿÿ,þp°@'^,Ý'^,§'^„^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„^,þpÿÿ,þp° '^„Ý^,þpÿÿ,þp°@'^,'^„Ý^,þpÿÿ,þp° '^,Ý'^„Ý^,þpÿÿ,þp°@'^,'^,Ý'^„Ý^,þpÿÿ,þp° '^,§'^„Ý^,þpÿÿ,þp°@'^,'^,§'^„Ý^,þpÿÿ,þp° '^,Ý'^,§'^„Ý^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„Ý^,þpÿÿ,þp°@'^„'^„Ý^,þpÿÿ,þp°@'^,'^„'^„Ý^,þpÿÿ,þp°@'^,Ý'^„'^„Ý^,þpÿÿ,þp°@'^,'^,Ý'^„'^„Ý^,þpÿÿ,þp°@'^,§'^„'^„Ý^,þpÿÿ,þp°@'^,'^,§'^„'^„Ý^,þpÿÿ,þp°@'^,Ý'^,§'^„'^„Ý^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„Ý^,þpÿÿ,þp°Ó'^„§^,þpÿÿ,þp°@'^,'^„§^,þpÿÿ,þp° '^,Ý'^„§^,þpÿÿ,þp°@'^,'^,Ý'^„§^,þpÿÿ,þp°Ó'^,§'^„§^,þpÿÿ,þp°@'^,'^,§'^„§^,þpÿÿ,þp° '^,Ý'^,§'^„§^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„§^,þpÿÿ,þp°@'^„'^„§^,þpÿÿ,þp°@'^,'^„'^„§^,þpÿÿ,þp°@'^,Ý'^„'^„§^,þpÿÿ,þp°@'^,'^,Ý'^„'^„§^,þpÿÿ,þp°@'^,§'^„'^„§^,þpÿÿ,þp°@'^,'^,§'^„'^„§^,þpÿÿ,þp°@'^,Ý'^,§'^„'^„§^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„§^,þpÿÿ,þp° '^„Ý'^„§^,þpÿÿ,þp°@'^,'^„Ý'^„§^,þpÿÿ,þp° '^,Ý'^„Ý'^„§^,þpÿÿ,þp°@'^,'^,Ý'^„Ý'^„§^,þpÿÿ,þp° '^,§'^„Ý'^„§^,þpÿÿ,þp°@'^,'^,§'^„Ý'^„§^,þpÿÿ,þp° '^,Ý'^,§'^„Ý'^„§^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„Ý'^„§^,þpÿÿ,þp°@'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,Ý'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,'^,Ý'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,§'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,'^,§'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,Ý'^,§'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„Ý'^„§^,þpÿÿ„þp°ÿœ^„þpÿÿ,þp°@'^,^„þpÿÿ,þp° '^,Ý^„þpÿÿ,þp°@'^,'^,Ý^„þpÿÿ,þp°Ó'^,§^„þpÿÿ,þp°@'^,'^,§^„þpÿÿ,þp° '^,Ý'^,§^„þpÿÿ,þp°@'^,'^,Ý'^,§^„þpÿÿ„þp°@'^„^„þpÿÿ,þp°@'^,'^„^„þpÿÿ,þp°@'^,Ý'^„^„þpÿÿ,þp°@'^,'^,Ý'^„^„þpÿÿ,þp°@'^,§'^„^„þpÿÿ,þp°@'^,'^,§'^„^„þpÿÿ,þp°@'^,Ý'^,§'^„^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„^„þpÿÿ„þp° '^„Ý^„þpÿÿ,þp°@'^,'^„Ý^„þpÿÿ,þp° '^,Ý'^„Ý^„þpÿÿ,þp°@'^,'^,Ý'^„Ý^„þpÿÿ,þp° '^,§'^„Ý^„þpÿÿ,þp°@'^,'^,§'^„Ý^„þpÿÿ,þp° '^,Ý'^,§'^„Ý^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„Ý^„þpÿÿ„þp°@'^„'^„Ý^„þpÿÿ,þp°@'^,'^„'^„Ý^„þpÿÿ,þp°@'^,Ý'^„'^„Ý^„þpÿÿ,þp°@'^,'^,Ý'^„'^„Ý^„þpÿÿ,þp°@'^,§'^„'^„Ý^„þpÿÿ,þp°@'^,'^,§'^„'^„Ý^„þpÿÿ,þp°@'^,Ý'^,§'^„'^„Ý^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„Ý^„þpÿÿ„þp°Ó'^„§^„þpÿÿ,þp°@'^,'^„§^„þpÿÿ,þp° '^,Ý'^„§^„þpÿÿ,þp°@'^,'^,Ý'^„§^„þpÿÿ,þp°Ó'^,§'^„§^„þpÿÿ,þp°@'^,'^,§'^„§^„þpÿÿ,þp° '^,Ý'^,§'^„§^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„§^„þpÿÿ„þp°@'^„'^„§^„þpÿÿ,þp°@'^,'^„'^„§^„þpÿÿ,þp°@'^,Ý'^„'^„§^„þpÿÿ,þp°@'^,'^,Ý'^„'^„§^„þpÿÿ,þp°@'^,§'^„'^„§^„þpÿÿ,þp°@'^,'^,§'^„'^„§^„þpÿÿ,þp°@'^,Ý'^,§'^„'^„§^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„§^„þpÿÿ„þp° '^„Ý'^„§^„þpÿÿ,þp°@'^,'^„Ý'^„§^„þpÿÿ,þp° '^,Ý'^„Ý'^„§^„þpÿÿ,þp°@'^,'^,Ý'^„Ý'^„§^„þpÿÿ,þp° '^,§'^„Ý'^„§^„þpÿÿ,þp°@'^,'^,§'^„Ý'^„§^„þpÿÿ,þp° '^,Ý'^,§'^„Ý'^„§^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„Ý'^„§^„þpÿÿ„þp°@'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,Ý'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,'^,Ý'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,§'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,'^,§'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,Ý'^,§'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„Ý'^„§^„þpÿÿ,þp°ÿœ'^,þp^„þpÿÿ,þp°@'^,'^,þp^„þpÿÿ,þp° '^,Ý'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,þp^„þpÿÿ,þp°Ó'^,§'^,þp^„þpÿÿ,þp°@'^,'^,§'^,þp^„þpÿÿ,þp° '^,Ý'^,§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^,þp^„þpÿÿ,þp°@'^„'^,þp^„þpÿÿ,þp°@'^,'^„'^,þp^„þpÿÿ,þp°@'^,Ý'^„'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„'^,þp^„þpÿÿ,þp°@'^,§'^„'^,þp^„þpÿÿ,þp°@'^,'^,§'^„'^,þp^„þpÿÿ,þp°@'^,Ý'^,§'^„'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^,þp^„þpÿÿ,þp° '^„Ý'^,þp^„þpÿÿ,þp°@'^,'^„Ý'^,þp^„þpÿÿ,þp° '^,Ý'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„Ý'^,þp^„þpÿÿ,þp° '^,§'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^,§'^„Ý'^,þp^„þpÿÿ,þp° '^,Ý'^,§'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„Ý'^,þp^„þpÿÿ,þp°@'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,Ý'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,§'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^,§'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,Ý'^,§'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„Ý'^,þp^„þpÿÿ,þp°Ó'^„§'^,þp^„þpÿÿ,þp°@'^,'^„§'^,þp^„þpÿÿ,þp° '^,Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„§'^,þp^„þpÿÿ,þp°Ó'^,§'^„§'^,þp^„þpÿÿ,þp°@'^,'^,§'^„§'^,þp^„þpÿÿ,þp° '^,Ý'^,§'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„§'^,þp^„þpÿÿ,þp°@'^„'^„§'^,þp^„þpÿÿ,þp°@'^,'^„'^„§'^,þp^„þpÿÿ,þp°@'^,Ý'^„'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„'^„§'^,þp^„þpÿÿ,þp°@'^,§'^„'^„§'^,þp^„þpÿÿ,þp°@'^,'^,§'^„'^„§'^,þp^„þpÿÿ,þp°@'^,Ý'^,§'^„'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„§'^,þp^„þpÿÿ,þp° '^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^„Ý'^„§'^,þp^„þpÿÿ,þp° '^,Ý'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„Ý'^„§'^,þp^„þpÿÿ,þp° '^,§'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,§'^„Ý'^„§'^,þp^„þpÿÿ,þp° '^,Ý'^,§'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,Ý'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,§'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,§'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,Ý'^,§'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„Ý'^„§'^,þp^„þpdÌ?8 !5!53#5!•üs]xþw‰x]ªªûûii¡]x‰Z‰x]Íü¤EÒiiuÌP8 !'7'7!#3!7']x‰þwx]üsªªiic]xþwZþwx]Í\þ»Òii´Ü 3'#'##-Z-x\xÒxÒx\®.ýÒx\ün Óû#ÝÓûö’\ÿù´Õ733737#x\xÒxÒx\xýÓZ'x\’ûöÓÝû#Ó ün\xýÒO€'µ=%"'&'&'&767670327676764'&'&'&½pk_V1..1Vbr‰xé`Xk_V1..1V_kpIêxþ¸XE?#!!';B¢]YQS@?#!!';BQ9€.-\ZnllnZ_.‰xé$-\ZnlÿlnZ\-.)èxF!F@RN¾JV>Žl§ùï˜mGСBk˜ðþî>DôdWŽû0Xd”Ýï—ts•ðÝ“þ²ß.W@#.  -&.%)/ÜK° TX¹)ÿÀ8YÌ299ÌÜ´]<Ü<Ì999991@© &$À-±/ôÌ2ÄôÌ2ì907&54&'>5!2;#"#!532654&+C­­I°02°Ký½ù§lŽ>>Žl§ùþù5ŒUUŒ5D>ð˜kB¡û0Gm˜ñ“Ýð•st—ïÝ”dXÐŽWÙþ2Ûù  5 1üªúþû¨VüªªÌdþÎýÌá¦á22üšhþ¦Ù'æ %#3 5'ªªþ ü¢úþÈü:Äþžýœ¦Ù'æ 73 ÙªL^ü¢ªÈû8bbü:Èýï¦ÙÿÂ'B 7Ù''üÙ›â>€ý°Pú€Nqþ¢ÆÙÿÂ'B 'Ù''üÙ›þ>€ý°Pú€Nq^ýDÙÿÂ'B Ù''üÙ>€ý°Pú€NÙÿÂ'B%  'üÙüÙ''ýt¢àNý²€ý°PÝþÙÿÂ'B5  5Ù''üÙüÙŒbàý²Nú€Pý°Ýäþ#îu úôþ þ uûÛûÓ-ÙÛ3!3!!#!#!5 ¨L¨3þͨþ´¨þÍ×-ýÓ-ýÓªýÓ-ýÓ-ªÙÛ333333#######5¨¨¶¨¶¨ÏϨ¶¨¶¨Ï×-ýÓ-ýÓ-ýÓªýÓ-ýÓ-ýÓ-ª:þkÆû7!!  767654'&'$  $'&'&547676h0þÐ8þÀŒ‰rtrrtr‰Œ@Œ‰rtrrtr‰þ ŽVŽŽGFFGŽŽþªþrþªŽŽGFFGŽŽèþ’È;:rsþ죟þìsr:;;:rsŸ£sr:ôެªÉŬªŽŽª¬Åɪ¬Ž:þkÆû3?  767654'&'$  $'&'&547676!!#!5! þÀŒ‰rtrrtr‰Œ@Œ‰rtrrtr‰þ ŽVŽŽGFFGŽŽþªþrþªŽŽGFFGŽ€ýs¨ýsB;:rsþ죟þìsr:;;:rsŸ£sr:ôެªÉŬªŽŽª¬Åɪ¬Ž€Kýsªýsª:þkÆû3?  767654'&'$  $'&'&547676   '  þÀŒ‰rtrrtr‰Œ@Œ‰rtrrtr‰þ ŽVŽŽGFFGŽŽþªþrþªŽŽGFFGŽ€]ÍÎxþ3Íwþ3þ2xÍþ3B;:rsþ죟þìsr:;;:rsŸ£sr:ôެªÉŬªŽŽª¬Åɪ¬Ž€èþ3Íxþ2þ3wÍþ3xÎÍÿÿuþM %' µo& µ' µ% µJuþM¶327!5!>2&#"!!"&' ;E þ€”2&#"!!!!"&' ;Eþø þä$Ÿ˜€”;Eþð þÜŸ˜€›‚¯Ϊð¨@¥‡z‚¯þÙ¨ðªþ¥‡zuþM¶&#"%"&'73275%>2";ECþµŸ˜€”;Eþ¾JŸ˜€ö‚¯ýç¶ ºým¥‡z‚¯¶ º“¥‡zuþM¶*3&#"&'67"&'7327&'&54767>2";E™Iq(P >6DŸ˜€”;E]InoSuŸ˜€þ=,HK%ö‚¯þÖ)ˆAH!þ+p$ þ¾¥‡z‚¯1Io›œsV<¤ˆzüEÖ.JghH$uþM-2&#"676='73'"&'7327&'&53>2";E+@/V]H½6¼H\nUm —€”;D [>wfP3,, —I6ö‚¯üx/Ur]H½½H]œlVþ¡¥‡z‚¯M>wšrN3 ™¥‡F4uþM¶!3#!!>2&#"!!"&'732²ÓÓwþ¥¢—~”9F 9þ¡ ©‘}”9G¦þýêr0®§…}Œ‚¯þõü¼þÿ­}Œ‚uþM¶+3#>2&#""&'73273264&²ÓÓc)¢—~”9GcBnnVs¢—~”9F (6o‡”¦þ~ç…|‚¯þÖK|þÒoUþ¾§…}Œ‚¯¶“ØuþMp.3#327264&#">2&#"632#"'"&'ÓÓþz;E-8pÆ–ŠqÕS¢—€”;E;D©ÎÜ›WI —€®þýµ‚¯3>6‘Ñ¡]¤ˆz‚¯þËéþÒÛ!þ£¥‡zuþM¶ 13#64&"327&'&767>2&#""&'­ÓÓË”ŠÖ¢;E]InoSuŸ˜€”;EcBnnVsŸ˜€°þzÑ‘Ïþ-‚¯1Io7sV<¤ˆz‚¯þÖK|þÒoUþ¾¥‡zuþM¶!%7!>2&#"!!"&'73273!#3˜;¢—~”9GþÄ©”9G ŬþÅ«“›þI§…}Œ‚¯þÐýþÞ­{Ž‚¯ tþêþÿ¾þMm-&#"!2#567&'!"&'7327!5!>2";Ed‹_``þë!Ÿ˜€”;D þÜ»`þÅ;`»*Ÿ˜I6ö‚¯ýïÆŒˆebýI¥‡z‚¯žº`:H:`º*¥‡F4uþM¶#&#"7'"&'7327'7'7>2";Exüüx±Ÿ˜€”;EŸzþüx²Ÿ˜€ö‚¯þXyüüx°ýô¥‡z‚¯â yüüx³Ø¥‡zuþM¶*327#467>2&#"#4'"&' ;E-A 4y›yŸ˜€”;E Z>Vy|-Ÿ˜€›‚¯¦2PœþÈIϼ+¥‡z‚¯þæEaÖþ·8ó2üJ¥‡zuþM¶'&#"63"&'7327&'&53>2";E*’yþ€”;E\?Vy~+Ÿ˜€ö‚¯ü&8þ·þŒ'þ¢¥‡z‚¯LFaÖIþÈõ1…¥‡zuþMÀù>32&#"#"&'7327!5ã¢KL~”9GA¢LK~”9Güïâ§…}Œ‚¯ú°§…}Œ‚¯g  kýb¶>32&#"#"&'73275!ã¢KL~”9GA¢LK~”9GþÉâ§…}Œ‚¯ú°§…}Œ‚¯ýР ÿÿ?œÅ™ÿÿÙÓÛj& Æ O$ÿÿÙŸÛj& Æ' OçþW O@$ÙÿÛ¦ 5 5ÛúþûøúþF¶Ѷeþ‘þ“¶ѦÑÙÿÛ¦ 55ÙúþúþFѶþ/ì¶þ/¦þ/¶mÿÿÙÿݦ' O/ÿ»…ÿÿÙÿÛ¦& Oþ»†ÿÿÙÿÛ'' Oá…ÿÿÙÿÛ'' Oá†ÿÿÙÿÝ' O/Ì…ÿÿÙÿÛ ' OÿþdžÙþñÜN:A%#"'&'&'&#"5>32326#"'&'&'&#"5>32326 5Üj²bn’ š^X¬bh´`n” œ^V¨hj²bn’ š^X¬bh´`n” œ^V¨gü@ÀúþP³NE;=LT³NE;=K›²PD:32326#"'&'&'&#"5>3232655Üj²bn’ š^X¬bh´`n” œ^V¨hj²bn’ š^X¬bh´`n” œ^V¨ûeúþÀP³NE;=LT³NE;=K›²PD:327&#"56767326 5Üj²bDS4ŒWV¨hj²bm“\¤Y@/X¬bh´`ES3‹VX¬bhZmM’p[¤Y@1V¨gü@Àúþ–²PDƒ4KU³NE;é@âLT³NE‚4LR²N"*,é@ãJ^þëþî²pªoÙþ_ÜN5<#"'3267#"/'7&#"5>327&#"5>32732655Üj²bDS4ŒWV¨hj²bm“\¤Y@/X¬bh´`ES3‹VX¬bh´`n”[¤Y@1V¨ûeúþÀ–²PDƒ4KU³NE;é@âLT³NE‚4LR²ND:é@ãJ^°þ‘ªþ²Ùý„ÛT 5!5!-5 !5!Ûúþü‹uúþúþuü‹úþúþû°/ª0²Òý\ªû^ÕÒ²þЪþÑ~ªÙý„ÛT -55!55!Ùuü‹úþúþü‹þsûÕÒ²þЪþÑþ᪪ü°/ª0²ÒùªªÙÿÜN%#"/&'&#"5>32326!! 5Üj³an’š^X¬bh´`n”œ^V¨ûfúþü@Àúþ–²PD:32326!!55Üj³an’š^X¬bh´`n”œ^V¨ûfúþúþÀ–²PD:323265-5Ûi³an’›^X¬bi³an“›^V©gúþü‹þsuü‹úþ¾²OE;=LS²NE; =KJ°/ª0²Òú:ÕÒ²þЪþÑÙþÛ !(#"/&'&#"5>32326-5 5Ûi³an’›^X¬bi³an“›^V©ûeuü‹úþúþü‹¾²OE;=LS²NE; =KJÕÒ²þЪþÑû¿°/ª0²ÒÙþ,Û× -55!55!Ùuü‹úþúþü‹þs%ÕÒ²þЪþÑþ᪪(°/ª0²ÒùÙªªÙþ,Û× 5!5!-5 !5!Ûúþü‹uúþúþuü‹úþúþ%°/ª0²Òý\ª~ÕÒ²þЪþÑû^ªÙþ6Ûî 5 5 -55Ûúþü‹uúþúþuü‹úþ•°/ª0²ÒýV/°þÑý¦ÕÒ²þЪþÑþа/°Ùþ6Ûî -555 5Ùuü‹úþúþü‹uúþ•ÕÒ²þЪþÑþÛ°/°ý'°/ª0²ÒýK/°þÑÙÿ„Û& 55Ûúþúþûøpþ/¶Ñû¶ѦѶþ“Ùÿ„Û& 5 5Ùúþûøúþp¶þ/¶ý›om¶þ/¦þ/ÿÿÙÿ„Ý&' O/þîÿÿÙÿ„Û&' OÿþþäžÚÿ¶Ü{ 5!5 5!Úúþü@þ¾Ѫªû•°oªp²þî9ªªÚÿ¶Ü{ !5! 5 !5!ÜúþúþÀü@úþúþѪúë²þªþ‘þªÙÿÀÛÍ555Ùúþúþü@«²p²ýN²p²ü—°oªp²þîÙÿÀÛÍ 55 5ÛúþúþúþÀü@úþ«p²þþ p²þýU²þªþ‘ÙÜ(".#"#"&'5327>76325Üh¨V^œ ”n`´hb¬X^š ’nb²júþü@ÊTL>7632 5Üh¨V^œ ”n`´hb¬X^š ’nb²júýÁü?úþÊTL>ªªþÖªªÜVJ<:DN´TL<:DNüD°oªp²þîÙþ˜ÜÔ$+5!5!.#"#"&'53276767632 5Ùúþh¨V^œ ”n`´hb¬X^š ’nb²júýÀü@úþ>ªªþÖªªÜVJ<:DN´TL<:DNüD²þªþ‘ÙfÛÎ $!!!5!676762!!&'&'&!!Ùúþ‚C.8þd 6WYÎYV7 þe8-ý;úþZª{+DD\¨93[2332[0<¨[EC,üéªÙÿÏÛW7!!%5$Ùúþþþ$Üþü}ƒyª±þå]]þå×x„¦|€ÙÿÏÛW%!5505%$Ûúþƒü}þÜþ$yªª×þ€|¦„þˆ×]]Ùþ×ÛW !!'7!5!%5$¬–Zóý²…–Zþ N´þþ$Üþü}ƒqP¨ªøP¨ªþå]]þå×x„¦|€Ùþ×ÛW !!'7!5!55%$¬–Zóý²…–Zþ Ný²ƒü}þÜþ$qP¨ªøP¨ª×þ€|¦„þˆ×]]Ùÿ ÛK75!5!%5$ÙúþþÍýØ!:þ£ü[¥]3ªªþÖªªkþå-Q÷×tX¦VvÙÿ ÛK75!5!55$%$Ùúþúþ]¥ü[þ£:!ýØ3ªªþÖªªk×þŠV¦XþŒ×÷Q-ÙþqÛK!5!7!5!7!!!!'%5$&þ³Ú`ýÆȉŠ)Pþ"_=ý6ŠŠÞþÍýØ!:þ£ü[¥]êªsª¤s1ªsª¥tþå-Q÷×tX¦VvÙþqÛK!5!7!5!7!!!!'55$%$&þ³Ú`ýÆȉŠ)Pþ"_=ý6ŠŠþÜ]¥ü[þ£:!ýØêªsª¤s1ªsª¥t×þŠV¦XþŒ×÷Q-ÙþyÛ‹:E#"'&'&'&#"5>76326#"'&'&'&#"5>32>%5$Ûi³an’ ›^X¬bi²b`¡ ›^V©gi³an’ ›^X¬bi³an“ ªž°gþÍýØ!:þ£ü[¥](³NE;=LT³N9 A=Kš²OE;=LS²NE;C Eìþå-Q÷×tX¦VvÙþyÛ‹:E#"'&'&'&#"5>76326#"'&'&'&#"5>32>55$%$Ûi³an’ ›^X¬bi²b`¡ ›^V©gi³an’ ›^X¬bi³an“ ªž°ûe]¥ü[þ£:!ýØ(³NE;=LT³N9 A=Kš²OE;=LS²NE;C Eì×þŠV¦XþŒ×÷Q-ÙýíÜ‹6A#"'3267#"/'7&#"5>327&#"56767326%5$Üj²bDS4ŒWV¨hj²bm“\¤Y@/X¬bh´`ES3‹VX¬bhZmM’p[¤Y@1V¨gþÍýØ!:þ£ü[¥]$²PDƒ4KU³NE;é@âLT³NE‚4LR²N"*,é@ãJæþå-Q÷×tX¦VvÙýíÜ‹6A#"'3267#"/'7&#"5>327&#"5676732655$%$Üj²bDS4ŒWV¨hj²bm“\¤Y@/X¬bh´`ES3‹VX¬bhZmM’p[¤Y@1V¨ûe]¥ü[þ£:!ýØ$²PDƒ4KU³NE;é@âLT³NE‚4LR²N"*,é@ãJæ×þŠV¦XþŒ×÷Q-Ùþ¡Û®7 5Ùúþúþü@ÀúþÃþ²pôþ²p«þëþî²pªoÙþ¡Û®%5555ÛúþúþúþÀòþ²²²þ²i°þ‘ªþ²µÿÉŸ³ ' '!Â]ý#¿Ý\eÁý#þ´ÝÂÏN\ý#¿Ý]xý–Âý#LÝÁ ÿÉ ³ !77 ! ýþˆ\Ý¿ý#þ€ÏÂÝþ´ý#Nþˆ]ý#¿ÝýòÏÁý#þ´Ýµ4Ÿ !7 7:\ý#¿Ý]xý–Âý#LÝÁ]Ý¿ý#\eÁÝLý#Âý1 4  %''' !ý]Ý¿ý#\eÁÝLý#Âý1™\Ý¿ý#]þˆjÂÝþ´ý#Á7†P~ % ! !!5 5!3þü!üþýß…ýþö é †üüþïþþõƒƒþöþöƒƒ 7†?~% !!3þü ûô†üüþïþ*^V !!^üüþïþ* üþûô ^ÿÍVÕ!!!^ÖþÉ ûôþµÿÉŸ³' '!ŸÁý#þ´ÝÂÏäÂý#LÝÁ ÿÉ ³!  ÏÂÝþ´ý#äÏÁý#þ´Ýµ4Ÿ%7 7ÐÂý#LÝÁ4ÁÝLý#Âý1 4  ! ÁÝLý#Âý1ÂÝþ´ý#Á7†P~ % ! !3þü!üþý߆üüþïþþ^ÿÍV ! !! !EþþþïüüþïÉþüCüþuÿùR× #7!5!7ÈZþxxèü/{êxŠxêªþ:êxu-R '!5!'ÈŠxêû…Ñèxˆ þvxêþ:ªêxŠHÿù%× 7!!7Òþvxê{ü/èxþxŠxêƪþäêxþvH-% 3'!!'ÒZˆxèÑû…êx þvxêþäªÆêxºÿÕ$!%!!ºúW7úÉü ùàržºÿÕ$!!!ºúW7úÉü ùàžºÿÕ$!!,7úÉrŠ<úR ùàºÿÕ$!!cúÉrŠ<úR ùàÿ!$ výŠüó üòdxxýˆüðüðÿ!$ žuüó üòýˆðýˆüðüðÿ!$ ! žuvú} üòýˆxüðüðÿ!$! žëýŠüó üòxýˆüðüð ºÿÕ$ #)-17#535#5#5#5##5#5#5##5##53#5#5#5##5Õãqrrrrþ¥ÌêÊMrqêÌêÊþ¤rärrrrärrætr¶ÌÌ´ÊÊü$tttt¬ærtttttúÆrtæ¶ÌÌ´ÊÊÐtræ$ÿÊÐ# !$VVþºûà¶mý“ü$ÿÊÐ# ! !ªzý0üªVVþºûà‹ü±O þmý“ü–ÿFfü   vvýŠýŠrèèý5þ•kØkþ•üæ\­þSü¤þS–ÿFfü7 –èèýó\­þSü¤þS"ÿ¹Ù‰ ! ÐþR®[®þRGèèýýpþ„( $  %pýûþýýüþý@¨*––þÖûXþÖ––Mÿ §M :lý”üLüªüªF Mÿ §M  ü²N þ lý”üÆþîü†þìÐVüªüªF  jÕ3!!!!!!#535#53ÉÊ[þ¥[þ¥×ü_¿¿¿¿Õþþ~ª, *3###535#5333#y±±¸····¸±±¼ýÔ,8ýÈÿ×jÕ#3327673#"'!!&'&#"#>32ÉÊ &}f[×ü_ &}f[Õý, %$R†”þ/ª %$R†” Õ!2+##5332654&+!ÉÈû€€ûþÊ¿¿Êþššþ[ÕqrÛÝqqý¨ÏÑ’‡†’ÐÉþfTÕ$Ç@  $ !? %üì2üÄì9999Ì991@&  B •°• $•/ôìÔì999ôì990KSXíí9Y"²@&]@Bz%%%&'&&& &66FFhuuwˆˆ˜˜]]#.+;#"&! 32654&#A{>ÍÙ¿J‹xÜn†?MãÍÈüƒý‰þ’••’¼~þh–býñ–ªômÖØºOýƒ…Hÿ¢œ¼#(07#5#"''7&546;7&'&#"5>327354326=-¸?¼ˆ‡\g`n;ýû)ž T—`¶Te¾Zçx”_¨9»58¯þ¼>c™¹ýÅåc3Výªfa<}N…V{½À¿ E..ª''r³OËs+Aºþx.Ù´)þâ 3{ ÿèÿB“333#;#"'&'##53w1ÀªÀ ÑªKs½½ÕQ fªÖ‡‡žþÂ3ýÍþo‰NšP þÖr>ÿÿÉþ¿Õ6ºþå!#4&#"#3676323#d¸||•¬¹¹BYZuÁcc¸¸žŸž¾¤ý‡ýže22wxèýõþLÉþ¿jÕ%3###3!Á©ÅEý3ÊÊžýªþAÏý1Õý‰wýHºþåœ33 3###º¹%ëý®ÌŸ¸8ýǹüiãýôþEþL#ýÝ\þ¿èÕ !!#!5!s•üPÉû=°ügÕšûoþAš‘Xþå“` !!#!5!qjýLl¸ü}´ýe`¨üÛþR¨%sÿãwñ-@••Œ‘¯ üìÔì221/ìäôÄìÄî053#5# !232#"³ÄÄMì¥þòþ¬T¥ìüßêÌÍëëÍÌêíèú+ç„€«\\«€ýxþãþ»EEþ»ÉþfÕ! !+53265##É-}-ÍãMD†nþËþÄÕüøú“þòôª–·üúáhÕ %!#3!3¼ýÛ…åýÇÒˆ¡ˆÕÇçüRÕþsÿãwñ%#3>3 !"&#" 7ÄÄMì¥Tþ¬þò¥ì!êÌÍëëšçèÕç„€þUýHþU€k:Eþ»ýÆþ»=à{0#3 632#54&"$þ·úþ\Ã^TÞƒ¹²Qr)mü“`üTæá¿†rr:T*D ð # #3 3 67632#54&#"fþÉþþÅþÂþþŠÌ:9ã:76&7#"733%3úhþôÒþÿþݺ “ÙkÀjþw”Ó˜¼„rq¿-xÑž‡¡«–D|Hv`ÓQ°¯~ý®°ûPþH_##"$'5332654&76#"#3$32¨¿þ¾Ò°þØ »Ÿ”•·Ç$Zh‘ü9¾d½RÔ™¶°½ËŸ¬YP[yƒ„è¸f®®ýãP°°°ÿë”u .63 ?# 6%#"?3327632#5&7$ªùþÔ'Ež‹ ÂÛÛ¬þœ99 …Z….¤ Ä IBÊÑa¡uy¤h$4Q´ Êþ(¼×  dcŽáZe~ˆPA45Gx=%'þ” þƒiþK_#6#"#3$324ÑRhi‡þÑFÄu¿~Òuþf¨®®ýƒ°°°°üÕPþå_#6#"#3$32$32#6#"ËUlh’þâQ¾tÀxÊl“ÕžÁ‰o‘þìkþg¨®®üÔ_°°°°°üQ,®®ýXÿ $6#"72767#"7#"'53;73$32ÉiþÙO_Ô{k¿'þÍþøˆÓjh¶°Æ jW°z{Ó+®®ýΆ8B~÷BA¯ÖDæéýk6þY±±l4_ "6#"3%$32#6#"#7#"73$32©eþ»Rr;'iŽÔ›¾‡hþ삸þ{«Ú$¿™Ö,®²þ ®°}°°üQ,®®üÔÈȯ°´´ŽW_!#6#"#3$32¾¿ˆh“þÜ5¾^À‰Ø ,®®þ‘¢°°Àhþs‡ 6#"32%##"73$32¡oþÇNq¯ªmÍ]þЬÓIÓ4’Ó,®®ýõ®¿ý‰‘À¯ãýïǰ°P9_ "6#"32%#7#"76##3$32$36eo‚þ´NmˆIÁþy»·[fyþ¸_¿ˆÁŽÈ–°Â,®ýõ®®þο¿¯}®¬üÔ_°°³³±mÿïÇ )32767$76%&#"#"=3326323¢ýïE¶syx cÀ»Òþ·VÏ&J]ÕzÃ7S²r¬#1XÛ-ƒþõ;=m¤ý; @@û]¦kr•¢w?|ÀþÓ†P[‡!#6#"#'! #5&#"$36¶À“iþÚs¿™" …¼­þ ~ŽÛ ,®®üÔ8Ó|¡{aA£þ¹t°±h_%#"7332%332%3#7#",þ’œÒ¦¾“r‡ÀŠ\iÀ“Áþ€Š¾¯¯¯°üÓ®®-üÓ®®-û¡¯¯hr_%#"7332%3#,þ’œÒšÀ‰rsÀœÂ¯¯¯°üÓ®®-û¡Žþ#‡#7#"7#"73327332%3ÒLþ½ÊBþì©\ÎNt2Ö¾Q BizÌhþN„Áºˆ—×þºsýã^yÜ®ý'üŽh ‡3$32#6#"#7#"73325mTÍ@ rÕœ¾‡hþæsÀþœœÒ˜ÃŠr2Uý¡y°°üQ,®®üÔ¯¯¯°üÓ®h]‡332%3#7#"7íMÜ7ph^ʈÊþœœÒa&ý×üÔ®®-û¡¯¯¯fþJ_6#"$7327! 3$36ˆjþÙeü¼!ýDu˜ŽÎcÂþàþú¥2нx‘Ö-+®®ý9KžìF›Æº…¶F4DZ±þËhþJ%#"7#"7332%332%'3#Þþ€ŠÈþœœÒ¤À“r‡ÀŠ\h$ËxmЯ¯¯¯¯°üÓ®®-üÓ®®,ìþçüiý„{þ"_ -6&32%6#2%#7#'#7!"3$32$32ožþçGp¯ }Yþ¯H••·þÖ–t UÎ@þýþñÔ,t¿SÔÀP×Ã-mn°þ­®ú¯¯þ®¯þϯ¯-;þ,Ìů1.±±±±þÍdþE‡%##3%3%73#mgÎQ6þZÄ{ÇO¦BUÂE3 Ë{ÌPþ\oý¯R„{íoýø†»Sý{þ«xÀüŸ~P\_$32#6#"#3–{ŽÕ›É‡^þÙqÁž¿¯°°üQ,®®üÔ_hþr`%#"733273#þ¯›Ò”¾róˆÉœƒÚ¯¯¯°üÓ®®.ü@ý~hþh_%#"7332%3!#532$þœ™Ò˜Â‰riÀr;þ.þÛUIçY¥¥¯°üÓ®®-ü‘þWþ׋ßPþT‡#3$32#6#"|jcÚK—JÄ={Õ‹½th,ýýØ8ý³‹°°üQ,®VþA`27#73$32 #6#"[wËXÐÚûþâ$’½(æÔ+‚¾~£sþ÷e¡þ­z²3ö±°þÍýæ®®ýÎÚzÿîŇ3 7# %33–ýüCÍ8id,ýÛþ©*>'ÂjÒKpð'µþ2Ö²·ý\þæ-XºC)ýÙPþö`!6#"#3$32$32#6#"ôs_‘þà`\ÚDˆÀuÉi–ћ‰qþët,®®üõýýâ`±±±±±üQ,®®üÔ<þ\_ #6#"6 %'73 &!"#3$6"À)gþÜ]ê—³ý´éëÝå þسÅÅÆ,ßÐ*#®±ý—sþþ^Q¾zßn(±²þË`þa_3 73!Èý8`”¾‹!TÀ^$ý97çþCÿü%ðëüÓþÿþ‹Fþ`‰$# /33 73$'#%&'R$w­þËòþèØ¡a‘¡ýõÖ°;þÿ¹Ë"›,ƒ«ØÜÒdíRmQ”ýrþ¾®<‰z°¾þ–×¿ËøP_!#7#"6#"#3$3232%3xÂþ–ŸÊ,IkƒþàfÃŽ¿ äÐZgiC^¿¯¯2ù®®üÖ^±±±ý„®®-dþ[‡6#"#!3#"$7#ˆi|þÆ]öþ1³*p®ê‘2xšË^À,®ªýýofÀCйþx£¯ýàzN! 33 767537632ÿ,ý¬þÑ*#Ë&Å8Oý|І…†ñ$2þÎ2þ÷­¹2šÂçÔ¤v;<ü|þm‡%#7#"33%3ãnÜOþ›Í,оŒ‡h*sNÓ;„ýš%l¯1.üÒ­¯!5ýÍhþÒ_%#7##"7332%3E½ÔmËJÅ@¿†roÃF_Eý¾3¯°ü´™Bzÿﻈ%3 7#6! 6%!#5&"% •ýþB«G½seþŸf)ý¹þÖ*IÄWÊ©À^3*Ù+½þ0²²³½Ê ýJþÎ2Á9R¾M?[–þº'þàqÿã» $@ E EüìÔìì1@¹ ¹ŒôìÔì0"32654&'2#"$54$–™··™™··™ù,þÔùùþÔ,g}ss}}ss}¤ÓÁÁÓÓÁÁÓsÿã§ð+2@ -! ‘ ,üì2ôì2ì1@• ­•&•‘Œ,äôììôì046$32#"$&%!327676%!&'.#"s~Ô&¢¢&Ô~~ÔþÚ¢¢þÚÔ~YûŠNÖwwkØ]ûŒ~ŠNÖwwkØ]êÑzzÑþâžþâÑzzÑIÊ‘S`0aäJùÉ’R`0aåIsÿã§ð"'I@"•$$#) ‘#(üì2ôì2ì9/<ì21@•"#­•!%•‘Œ(äôì2ì2ô<ì2046$32#"$&7)6&')s~Ô&¢¢&Ô~~ÔþÚ¢¢þÚÔ~Û µ¤þ&µ þõµý\ÚµþõêÑzzÑþâžþâÑzzÑIÉþæ!ýû!tÉ!ýü!þæ@5Õ c@  •  ÜÄÔÄ1/<ôì990@    BKSXíííí@   Y"5! # #7!v•þ(ðþvþuðyTýW+ªšýýFý麣ÎC8Õ c@  •ÜÄÔÄ1/ä2ì990@    BKSXíííí@   Y"%!5 3 3!ûkÌýþð‹Šðýþxþ«©ššªqºýéýF£þ2@ÕÕj@ • •  Ü<Ô<Ì1/ì99ôì990@   BKSXíííí@   Y"! !7!5 5!ÙýWXþ´©þ¨wÑûkÑþ/•+þWý(©–ýÁª L?ª –èÕ #@‘   ÜüÜüÜì1/ô<<Ì203#3#3#ÌÌýzÌÌDÊÊÕÿÿÿÿú+ÿÿhÕ0ÿÿhÕ9ÿÿÉ‹Õ(ÿÿƒEÕP–ÿãàð #/3H@5E1-0 !'E4ü<ì2ÄÔ<ì2Äì1@3¹00* ¹ ¹‘4¹*¹$Œ4ôìÔìôìÔì9/ì02654&#""$54$322654&#""$54$32!!»™¹¹™™¹¹™ùþÔ,ùù,þÔù™¹¹™™¹¹™ùþÔ,ùù,þÔý7 ü`s94488449¤Žƒ‚ŽŽ‚ƒŽü¸94488449¤Žƒ‚ŽŽ‚ƒŽ\ªÛ}Õ:@   ÜÌ2ì2Üì2Ì21@• •­‘• /<ì2ä2ôìì20!!!!!!!!5!!Û ‹ þ¿AýõþuýõAþ¿ÕýœdªûªÇý9ª\RÕ T@ •   ôì2ÔÄ91/<ôì0@  BKSXí<<íííY"!#! #!&ʬþ,ïþPþsæýÕšývýOÓç–~Õ -@ •¯•­•  Ü<Ì2ÜÌ´? ?]1/ìüìüì03#3#3#€þþþþþþþQÍþIÍÕÍ\RÕ T@ •   ôì2ÔÄ91/ìô<0@  BKSXí<<íííY"3 !3%!cïýÔâûTÊþsæÕýOývšÕýéÓüsÿã§ð+7@ •&-& ‘,üìôìì9/ì1@ !• •‘Œ,äôì2ì2046$32#"$&767>54'&'&s~Ô&¢¢&Ô~~ÔþÚ¢¢þÚÔ~Õ.]Ø=@µN\ªµN\.]Ø=êÑzzÑþâžþâÑzzÑž}qäa ³!ˆSáÝûM!‰Rá}|påasÿ•§?#-n@.  '&$ /$ ‘.üìôììÄ9999991@ .'& ) )••‘Œ.äôìì/Ä9999999046$327#"''7&7&#"4'32>s~Ô&¢ãÄ ‚n€~ÔþÚ¢äÄ œnÕ‘ê§wÖœ\Š‘ý§wÖœ\êÑzvÄiÂjþÞžþâÑzwÅkÁj!žæ®˜^`¥á|å¯üg^`¥á–”Õ .@••• •¯  Ü<<<Ì2221/äìÜììÜì03#3#3#3#–þþþþþþþþÕÍßÍáÍáÍ)áÕ:@ ¯ ÜÜÄÌ1/<ä0@íí22íí # #3².èþ]þºæèºýFýâÕÉ;Õ -@    üüÜüÜüü1@ ‘• ­ /<ô<ìä03!#!#!ÊÔÊý"ÊÔÕýœüÇý9q><Õ@  ÔÄÜÄÄ9/ì1´€ ]@¯ /<ì220K°BPX@     ìììì@     @ ííY333 # #‚ÚÊ Øþ Øþ\þXÚÕþdœþsý3üø{ý…–¢Õ 1@• ¯•  Ü<Ì2Ü<Ì2´??]1/<ì2ô<ì20%3#3#3#3#¤þþþþýòþþþþÍÍÕÍûÅÍÕÍ\Õ 7@••  ôìÔÄ91/ìôì0@ BKSXííY" !!!!&æýâûT¬üœdDçúÕÕšûo–h’h $@    ÜìÜìÜìÌ1/<<Ì2203#3#3#ÆÌÌþhÌÌþhÌÌhÿÿÿÿÿÉ‹Õ7o–Õ !@ •¯• /Ì2üÌ21/ì2ôì20!!!!5!!o&þÓ.üÚ-þÒÕªûªªoÿâ1ð/,@!•‘ '•,Œ01*$ 0Ì2ÜìÜ2Ì1ä2ì2ô<ì20!"'53 !"563 676!2&# !27# '&Ð%4Âþ¬€rmyþðÿymr€OÇ4%%4ÂT€rmyÿþðymr€þ²È4*B6Ð!¯*:'(8)¯ Ï6AB6Ï ¯)þÈþØþÙþÆ*¯!Ð6oÌÕP@   Ô<<Ì2ì22Ô<<ü<<Ì21@ • • ¯/<ä2Ü<<ì22Ü<<ì2203!3!!!!#!#!5!!5!!‘Ê’ÊþëþëÊþnÊþÞ"þÞ"Ê’ÕþxˆþxªþŽªþy‡þy‡ªrªªþŽrÿÿÉ3լ̈Õ@•¯•üìÄ21/ìüì03!!!̼ýòÕªûªÿÿÉ“Õ,oÌÕ7@   /<<Ì2ü<<Ì21@•• ¯ /äÜ<ì2Ü<ì203!!!!#!5!!5!¿ÊCý½Cý½Êý°Pý°PÕþxªþŽªþy‡ªrªÉ•Õ7@ ¯üK°TX¹@8Y2ì21/ìÌÌ0@ 0 @ P ` Ÿ ]73#3#ÉÌÌÊÊÍÍÕû¦Ÿÿã¤Õ>@••‘Œ üÄìÔÄìÔì1äôììÄ0@ BKSXíY"47!5!32654'3! $Ÿ¾»ü¤¬ýx·ÅÛÉâÕË¿áþ»þ¹þÎþ¹ßwNªªþetäw–¤ˆˆ³Îà¡Îæùcÿã­ð #/9@1E- !'E0ü<ì2Ô<ì2ì1@¹ ¹‘0¹*¹$Œ0ôìÔìôìÔì02654&#""$54$322654&#""$54$32ˆ™··™™··™ùþÔ,ùù,þÔù™··™™··™ùþÔ,ùù,þÔPIIPPIIP¤¥˜—¦¦—˜¥ýPIIPPIIP¤¦—˜¥¥˜—¦sÿã§ð'(@ ) ‘(üìôìì1@ •#•‘Œ(äôìì046$32#"$&732>54.#"s~Ô&¢¢&Ô~~ÔþÚ¢¢þÚÔ~Õ\œÖwwÖœ\\œÖwwÖœ\êÑzzÑþâžþâÑzzÑž}á¥``¥á}|á¥``¥ásÿ‘§ð,P@  ! #.# ‘-üìôììÄ9991@ ! (•(•‘Œ-äôììÀ99046$32'#"$&73277654.#"s~Ô&¢¢&Ô~l¢§Äå¢þÚÔ~Õ\œÖw§þ‘ƒj\œÖwwÖœ\êžÐzzÐþâžžþàiÇkÊwzО|â¤`^¾jþI®å|â¤``¤âÉ;Õ -@   üüÜüÜüü1@ ‘ •­ /ôì2ä203!3!#ÉÊÞÊþ,Êdqý9ÇüýœdÉÇÕ (@ •¯•­•  Ü<<Ü<<Ì1/ìüìüì03#3#3#ÉþþþþþþQÍþIÍÕÍ–hÕ ?@•¯ •­ •   Ü<Ì2ÜÌÜ<Ì2¶??? ]1/<ì2üìü<ì20#53#533#3#3#hþþþþýþþþþþþþÍú+Í„ÍþIÍÕÍsÿã§ð'+>@- )(( ‘,üìôì9/Ìì²/)]1@+Î(­•#•‘Œ,äôììôì046$32#"$&732>54.#"3#s~Ô&¢¢&Ô~~ÔþÚ¢¢þÚÔ~Õ\œÖwwÖœ\\œÖwwÖœ\ÆþþêÑzzÑþâžþâÑzzÑž}á¥``¥á}|á¥``¥áÍsÿä§>,P@  %$#& !.! ‘-üìôììÄ9991@ #&$%(•(•‘Œ-äôììÄ99046$327#"$&732>54''&#"s~Ô&¢äÄ ƒžn~ÔþÚ¢¢þÚÔ~Õ\œÖwwÖœ\þ”‚p§wÖœ\êžÐzvÄiÂkþàžžþâÐzzО|â¤``¤â|å®þ?lÆ^`¤âsÿãrï%1=G@8&,20>üìô<ì2Ü<ì21@/•;• 5 )•#•‘#Œ>äôìì9/ì/ì0! #"&547 !&54632! 32654&#"4&#"326s†S“_ ™…„™þþþû™„…™ _þmþ­þz™,,,,,,,,égŸs'O;‘‘H6þ¾þâþâþ¾6H‘‘;O'sŸz<11<;22‡<11<;//dÀÕ #@• ­¯  Ô<Äü<Ä1/äô<ì203!!#!5!­ÊIý·Êý·IÕýjªýk•ªÿÿ=;Õ;sÿãrï3?Kf@•F4%+6:0Lüì2ô<ì2Ü<ì29/<ü<Ì1@•=•(I• C (7##•1•‘1ŒLäôìì9/ì/ì/<ì2ÌÄ0! #"&547"333###3&54632! 32654&#"4&#"326s†S“_ ™…„™î—»ÌééÌ»—…™A;…þïþ­þz™,,,,,,,,égŸs'O;‘‘H6¢Šßÿÿªÿÿߊ¢6H‘‘;OO4Ÿz<11<;22‡<11<;//É‹Õ;@ •••­•  üì2ÔÄÄÜ<ì21/ì2ìôìî20²]!!!33##!!!ɰýÌêêÌþïøü>ÕªþFÿÿªÿÿýãªÿÿhÕ)É;Õ@• üìÔìì1/ìô<0)3!3;ûŽÊÞÊÕúÕ+ÉyÕ=@ B• ü<Ô1/ôì20KSX@ììììY!# 5!!±èßþ!°ý8ßÀkªªýšsÛÕ#O@%$!  /<<ì22Ô<ì2ìÔ<ì2ì1@• • /<<Ô<ì2ô<<Ô<ì2032653#2#4&##"#3"3ÂÊŠòÓþ‡ÖÖyÓòŠÊŠòÓyÖÖþ‡Óò+ªþVâÈþîþºþÛþºþîÈâþVªâÈF%FÈâÉöÕ.@ ¯üK°TX¹@8YìÄÄ1/ìÄ0´í!##ÉÞþuÄÕý-úásÛÕ+f@- ,&'  #+ /<<<ì222Ô<ì2ÄìÔ<ì2ìÄ1@+¹* •  #•*'"/<<Ô<ì2ô<<Ô<ì29/<ì205!5"3332653#!!2#4&##"#35ÁÖþ‡ÓòŠÊŠòÓþ‡Ö¿þAÖyÓòŠÊŠòÓyÖ•ª>FÈâªþVâÈþîþº>ª=þºþîÈâþVªâÈF=6-éÕ@ ÜÌÜÌ1/ÌÄ20!3!3éüM•-¨þûþn¬^$36767#"&546?>7>5#53ó¿ Ya^Ág¸ßHZX/'ÅËËÅ-93B$ÍüS #C¼98ŸL‰VV/5<4þú¾®-5^1Y7ÿÿÙŸÛ2& Æ OþW°:X!##°¨ð¸ýµÇ:o#5!#¶ï¨¹…ý&°þòXÌ3!3hðþX¸ÚÇþòoÌ!533oþXï¹þòKÿÿ“°ðMÿÿªþ¼‚Õ'Øü6Øÿÿªþ¼‚Õ'ßü6ßÿÿªþ¼‚Õ'Ûü6Ýÿÿªþ¼‚Õ'Ýü6Þÿÿªþ¼‚Õ'Øü6Ýÿÿªþ¼‚Õ&ØÝü6ÿÿªþ¼‚Õ'Ýü6ßÿÿªþ¼‚Õ&Ýßü6ÿÿªþ¼‚Õ'Øü6Üÿÿªþ¼ƒÕ&ØÙü6ÿÿªþ¼‚Õ&ߨü6ÿÿªþ¼‚Õ'ßü6Øÿÿªþ¼‚Õ&ØÚü6ÿÿªþ¼‚Õ'Øü6Úÿÿªþ¼‚Õ&ßÞü6ÿÿªþ¼‚Õ&Ûßü6ÿÿªþ¼ƒÕ'Ûü6Ùÿÿªþ¼‚Õ'Üü6Þÿÿªþ¼ƒÕ'Ùü6ßÿÿªþ¼‚Õ&Üßü6ÿÿªþ¼‚Õ'Ûü6Úÿÿªþ¼‚Õ&ÞÚü6ÿÿªþ¼‚Õ&Þßü6ÿÿªþ¼‚Õ'Ûü6ßÿÿªþ¼‚Õ'Ûü6Øÿÿªþ¼‚Õ&ÞØü6ÿÿªþ¼‚Õ&ÞÛü6ÿÿªþ¼ƒÕ&ÙÜü6ÿÿªþ¼‚Õ&ÝÝü6ÿÿªþ¼‚Õ&ÚÚü6ÿÿªþ¼ƒÕ&ÙÞü6ÿÿªþ¼‚Õ&ÛÜü6ÿÿªþ¼‚Õ'Þü6Øÿÿªþ¼‚Õ&ÛØü6ÿÿªþ¼‚Õ'ßü6Úÿÿªþ¼‚Õ&ßÚü6ÿÿªþ¼‚Õ&ÜÚü6ÿÿªþ¼ƒÕ&ÚÙü6ÿÿªþ¼‚Õ&ÝÞü6ÿÿªþ¼‚Õ'Ýü6Ûÿÿªþ¼ƒÕ&ÞÙü6ÿÿªþ¼‚Õ&ÜÛü6ÿÿªþ¼ƒÕ&ÙØü6ÿÿªþ¼‚Õ&ØÜü6ÿÿªþ¼ƒÕ&Ùßü6ÿÿªþ¼‚Õ&ßÜü6ÿÿªþ¼ƒÕ'Ýü6Ùÿÿªþ¼‚Õ&ÝÜü6ÿÿªþ¼ƒÕ&ÙÚü6ÿÿªþ¼‚Õ&ÚÜü6ÿÿªþ¼‚Õ&ÛÛü6ÿÿªþ¼‚Õ&ÞÞü6ÿÿªþ¼‚Õ&ÜÞü6ÿÿªþ¼ƒÕ&ÛÙü6ÿÿªþ¼‚Õ&ÛÚü6ÿÿªþ¼‚Õ&ÚÞü6ÿÿªþ¼‚Õ&ÜÜü6ÿÿªþ¼ƒÕ&ÙÙü6ÿÿªþ¼‚Õ&ÜÝü6ÿÿªþ¼ƒÕ&ÝÙü6ÿÿªþ¼ƒÕ&ÜÙü6ÿÿªþ¼‚Õ&ÛÞü6ÿÿªþ¼‚Õ&ÝÚü6ÿÿªþ¼‚Õ'Ýü6ÚÿÿÉìÕ%ÿÿÉÕ3F Õ%#"3!"$54$;3@þššÈþ8ûþÿûþʦ1’‡†’¦ãÛÝâXÿÿɰÕ'ÿÿÿúéÕ7ÿúéÕ)5!3!éû˪+úÕÿÿsÿã‹ð*ÿÿÉjÕ.ÿÕvÕ !#! !3vÊýbþüåüæ ÍÊwý‰¸ý1ÏÿÿÿãOÕ_ÿÿsÿã'ð&ÿÿsÿã'ðHÿÿ\Õ=ÿÿÉ#Õ)ÿÿÉ#Õ ÉÿÿÉÕ0ÿÿÉ3Õ1ÿÿÉjÕ/ÿÿ‡ÿã¢ð6ÿÿÉTÕ5;ÆÕ.'3;3! &546#"3A{>ÍÙ¿J‹xÜÊþ8ÿüƒwþ’••’~˜þ–bwú+ÖØºý±‡þú…ÿÿhÕÿÿhÕ9ÿÿÉ;Õ+ÿÿ£ÿã»ð ØÉò.#"#632[ÂhqÊÓ÷`¾˜ìQQ•Ëüîê,ÿÿD¦Õ:ÿÿ=;Õ;ÿÿÿüçÕ<‘´Õ !"3!"3!"&5467.54$3!êþ¼££DþÕ”‘‘”õýüçú€|•¥û #‡‹Œ…ýšÂorqp¦À±‰¢ ˘ÈÚÿÿhÕ$ÿÿhÕêÿÿÉ‹Õ(ƒEÕ )5!!5!!5!EüPæý9ÇýªºªªÿÿÉ“Õ,ÿÿsÿãÙð2ÿÿ²ÿã)Õ8²)ò*@ 8AüK°TX¹ÿÀ8Yìüì1µ •‘ /<ôì03! #4&#"²!!Ë®Âî¤$*þÖþÜü\‹ðÓÓðüuÿÿ©Õ ÙsZÕ@  2üìôì1¶• • /ìôì0# !3! !ôþËþá5ôÊþaþPþh–²/þéþÔþÒþè/ú+j‚€i¯·>!!¯þø>þÂ’þÀ·>!##¯¤¤‡>þÂþÀ@ÿÿ¯>'Æ_Æÿÿ¯þÀ>'Ç_Æ’þÀ·# !##!!¯¤¤‡þø>þÂþÀ@#þ¯·#!!!!¯þøþø>þÂ#þ¯Ö!!!!ýþøý²Vüª>þÂÖ¨¯`¢!!!!¯VüªVüª¢¨ðªÿÿrÿãðiÿÿdÿã¼{jÿÿÉÆÕXÿÿ¦n`+vÿãú)4>@01, *$6E5üìÌÌ9ÔÌìÔÌ1@ $• *•Œ05Ì2ô2ì2Üì0#"'&'&#"#"'&547673!27676323 4'&'3úftê[na`zxz{Ân[êtfCGoù~[UŠ]LKf›dKJ]ŠU[~úoFCþò‹žD@@DD€D‹òÆâì˜kóâ¶þº63366336F¶âók˜ìâ˜ÿã¡Å!<@!  # E"üìÌÌ9ÔÌìÔÌ1@ ©© Œ! "Ì2ô2ì2Üì0!"$"# 33276762324ŠþrTþÕðþÔRþrŠÆ’Ð>IxdüdyI?Ð’ÅþãþëþPââ±þ¹úþû8[ 77 [8øGÿÿ<rÕ&¾,ßÿÿ>Š{&ÞósÿãÐð   !3#!! ! þHþÿ¸Ò0ÊÊþÐþ˜þÅþÆþˆx:;hLþ¸þåþæþ¸HÅ–ú+•þèþf¥ab¥þgpÿãû{ "326&33###" r“¬¬“•«¬hÕ¸¸Ð þùñðþîàùßéÇÈèç’çþ¿û  øþÒ98þäÓ¿Õ3#!#!#3! !¡å9Òˆý_ˆÕüþ:ÊÊoþî%Õú+þ•ýkÕýjÏýÁÿã{"-#5#"&547!#3!63!54&#"5>32"326=¸?¼ˆ¬Ë/þø¸¸Òj•§—`¶Te¾Zóðþ‘߬o™¹ýªfaÁ¢sPý÷`þA"‹..ª''üþ´f{bsÙ´)eþ¿Õ767!!3##!#!!¬†&aOý)ªªÊü¨ªþp(”ª?x4&ªûþAþ¿ëÔþ þµD+kþåç`76765!!3##!#!!°[(bRý£““¹ý-“fþ}v“(UÓ©Ô“üÆþRþå®:ŒþdÜ6TÕ356765!!#!TÝ:WOý)Êþfbª0£ödþªúÕ+¸ýÊþøýLÑ`356765!!+!L»3DSý£¸þ{X^™}¦з“ü3ÍoþPÂÏÉöÕ! !!+##É-}ý)Åþ„ËþÄÕüøªúÕü úẬ`! !!###º >?hý£¹þ˸þʹ`ýî“ü3°ý'ÙüPÿÿsÿãÙð'yâ2ÿÿqÿãu{&Ry.ÿ„sÿãeð3#%3# '&76   1ÓÓ¤ÓÓñýLÐÏÏдÐÏÏþÈþþà æ Fþþþý›ÒÒÄÓÒÒÓý<Ò—þ¸þåþæþ¸HqÿãC{3#%3#"32654&' ! ¼ÓÓhÓÓJÃãáÅÂãã Iþ·þàþßþ¸HÊþþþçþnçèÈÇéœþÈþìþíþÇ98ÿÿsÿã jð&#'yryâÿÿqÿã¶{'yoÿ„'y.ÿ„$:þWÎñ '/7?GO€„%3#%3#3#%3#3#%3#"264"264$"264"264$"264"264$"2642+ '&' &547"#"&546;&546 676 3#J††ý††ýþø††"††ü{´ii´h ´ii´h©´ii´h¡´ii´hý†´ii´hþ´ii´h©´ii´hG««4«þãUUþâ©3««2©UU«4ý¯††œœœIœœœþFœœœ]Ž÷ŽŽ÷äöŽŽööŽŽöþ9Ž÷ŽŽ÷ŽŽ÷ŽŽ÷þ7Ž÷ŽŽ÷ŽŽ÷ŽŽ÷R̬©Ì\…«Ëdfʬ…\Ê«¬ÌZ…«ÌeeÌ«…ZþÒœÿúþfÕ!!!2+5327654&#!#!ïýqmÌäL>†87||þˆËýîÕªþFwrîþÎþòôªKKÂ"Ÿžý9+<þVH`!!3 +5327654'&#!#!<1þBúFRRQµÁ¬n!&&,‹þüµþB`“þªGQåþòÕa`œ07“¦$)þÍÿúéÕ!!;#"&!ïýîm†?MãÍýîÕªü×–ªô)<m`!!;#"'&5!<1þF##mXn¶PSþE`“ý¾‘.0œ`bÔ7¯³Õ*@  üì2ÌÔìÌ1@ • ­•/<ôìôì0!2#4&#!#463!#"z¡ºÞÉ||þˆË£µ àiM?ÎéîþfŠŸžý9?ÖÀœaÿÿºd(ÖX3#3Öªª¿ˆXˆû0Xú¨ÖX3#3Öªª¿ˆ$ˆüdXú¨ÖX3#3Öªª¿ˆðˆý˜Xú¨ÖX3#3Öªª¿ˆ¼ˆþÌXú¨ÖX73#3#Öªª¿ˆˆˆˆXú¨ÖX3##3sªªþ눈Xˆû0XÖX3##3sªªþ눈$ˆüdXÖX3##3sªªþ눈ðˆý˜XÖX3##3sªªþ눈¼ˆþÌXÖX%3#!#3sªªþ눈ˆˆXÖX!#!!^ˆGþAXˆÖX!#3!!^ˆˆ¿þAXþ̈ÖX!#3!!^ˆˆ¿þAXý˜ˆÖX!#3!!^ˆˆ¿þAXüdˆÖX%!!3^¿ý¹ˆˆˆXfœŽä 3'#'^9÷L’k“LäÝCƒýU«ƒCf˜Žà #'737—9øL“k’L˜ÝCƒ«ýUƒCÜCà 3#3#'À€€ f *ŽDþ‘ÈÈÜCà #53#73C€€€ fRŽü¼oÈÈÿÿÃCDÿýd‰ÍÔ35 !5 !5 ÏJþ¶Jþ¢ ®¸ £'£Å¢þŒåcmþûþZ‰‘`35 !5 !5 »,þÔ,þÔá„ ™|™˜þèžMY¼þ¸sËJð 5! -u¤‹×ýãÍþþÒ.1Ô ÛsVJ{ 5! -u¤‹×ýãXþþÒ.1Ô ½Éþf;Õ3!3+53265!#ÉÊÞÊÍãM?†ný"ÊÕýœdú“þòôª–Â_ý9ºþVd4&#"#3>32+532765¬||•¬¹¹B³uÁÆ£µF1n!&žŸž¾¤ý‡ýžedïèýHÖÀœ08’ÿúþLÕ*!!!2!"'&'5327654'&+5!#!ïýî^þeicUQ˜˜þès‚‚j~‰Àcd\]¥®ýžËýîժ˚þ8+lhŠÜzy$Ã1KK†IJ˜êüJ+7þL4ž02!"'&'5327654'&+5!;#"&5#533!AicUQþÐþè^cdjTÈm¾cd\[§®®ýjKs½½Õ¢‡‡¹eÜ8+lhŠÝò%Ã12KK„KJ¦óý¤‰NšŸÒ`>þ¨ÿÿ¤ÿã{ðR…þgÈ|1&'&547632&'&#";#"32767#"$546‹p<HmmFE˜MU…ˆUU8¾%ðåÁº~` !!!!#ºÄýöÕþ+º`”þÓ”ýõÿÿoÿãÇ{V îÕ3 3#!+!# ! !JåÐÑå9Òˆý_ˆÒˆý_ˆÕ¬þî%sþî%Õû>Âú+þþýçý{ÿã'{ 5@M"326=%#5#"'#5#"&5463!54&#"5>3205>32"326=63!54&#"¾ß¬o™¹²¸?¼ˆnQ¸?¼ˆ¬Ëýû§—`¶Te¾Zóxe¾Zóðþ‘߬o™¹ýˆ5yǧ—`[A3f{bsÙ´)Lýªfa' ªfaÁ¢½À‹..ª''~D''üþ´f{bsÙ´)hn¦<‹ÿã -ð 3676! ! '&'!# !  Jå¸-p¼;:xþˆþÆþżP.ýgˆÕ¬þî%ˆþHþý¸Õþ®}Òþ[þžþŸþ[ÒXrþý%þ¸þåþæþ¸H{ÿã{{"-82 '&'#"&5463!54&#"5>3 6"326="32654&yðþîþˆ7!`Œ²±Ìýû§—`¶Te¾Z*qŠþO߬o™¹”¬«•“¬¬{þÈþìþíþÇ>RE‡aÁ¢½À‹..ª''½½ý¸f{bsÙ´)¬çþnçèÈÇéÿãqÕ !3!2653! '!#¼þî%þ{å¼J®Ëþßþæþsv%ý_ˆÕý®ûrÀÓð‹ü\þÜþÖ4hþ{ÿã{(3%#"&5463!54&#"5>3232653#5# "326=“H¢²±Ëýû§—`¶Te¾Zóð||•­¸¸C±uþåþÛ߬o™¹ßoÁ¢½À‹..ª''üÿ¾ŸŸ¾¤{û ¬fcPf{bsÙ´)´Õ !!#3 3¼þî%Ljý_ˆÕ:åÜ×ÒýÇýýÙþÕûáú+{ÿãN{ ("326=5#"&5463!54&#"5>323¾ß¬o™¹?¼ˆ¬Ëýû§—`¶Te¾Zóð^Ãþ\3f{bsÙ´)ýͪfaÁ¢½À‹..ª''üÿþ5¬û ´Õ )!#!#333#¼þî%~gþY’åˆý_ˆÕ:ågécÒý‹i5ý¨þþÕüR®ûª‹{ÿãN{"-0!5#"&5463!54&#"5>32333#"326=!#u?¼ˆ¬Ëýû§—`¶Te¾ZóxgƚÛ›ÑÓþ߬o™¹GªfaÁ¢½À‹..ª''~mÍþcýÍ3f{bsÙ´)þþV›Õ !+53276?!#3 3¼þî%lKMJ|Ø«L*+2ˆý_ˆÕ:åÏËÒýýqÆ?=ª$%…2þÕû@À{þVN{'2!5#"&5463!54&#"5>323+5326?"326=u?¼ˆ¬Ëýû§—`¶Te¾Zóð^ÃþN”|“lLT3þô߬o™¹ªfaÁ¢½À‹..ª''üÿþwjû8ÈzšH†B3f{bsÙ´)ÿÿsÿã'ð“ÿÿÿãõ{ jÕ33#! !##53ÉÊ¿¿žýþöý3Ê¿¿Õ¹ªþìwýHüãÏý1rª¤3!!3 ###53¹"þÞ%ëý®kðýǹ´´¬¤ý¹ãýôý¬#ýÝĤÉfÕ 37!!ÉÊü×ü_­(ý^Mý*ªúÁc37#Á¸ê¸œxýIüžåSœÕ 33#!!#53ûʨ¨×ü_¨¨Õà¤üYªQ¤xò 33###53Y¸áá¸ááþâ¤û®R¤ ÿãjð% 3#! '&#5376 !&'! 76;:¼¡~ °¼þÆþż± ~¢¼þHj´iüF w¸vðÒµþãþ¾ÄÓÒÄCµÒ¤¤†ÖÖ†þú—¤¤— ÿãŽ{'23##"'&'#53676"!&'&!3276Íð‰oÄÀ ~‰ðñˆ~ ÂÆoˆñ”V?s?V«ýƒLV•“VM{œ~ÍôôÍ~œœsUƒUuþ%«gstgsÿã jð$. 676! ! '&'!     ':¼/##.½;:xþˆþÆþŽ.$#.¼þÆþÅþ‡yþHþý¸þHþý¸ðÒ5==5Òþ[þžþŸþ[Ò4=<4Ӥĥ¤þ¸þåþæþ¸HHþ¸þåþæþ¸Hqÿã¶{ 1"32654&!"32654&'267632#"'&'#"´”¬«•“¬¬ü,”¬«•“¬¬“ð‰‰ñðþîðñ‰‰ðñþïßçþnçèÈÇéçþnçèÈÇ霜œþÈþìþíþÇ98 Õ32654&#%!2+3###53“þššþ8Èû€€ûþííÊ¿¿/ýÏ’‡†’¦qrÛÝqqÄþüÿûþV¤{&  533>32#"&'3##5å§þܧ§$ü½¿¹:±{ÌÿÿÌ{±:þþ¹d–ççþjçþgìªdaþ¼ýðþ¼adþÌŽŽ2™Õ'!2+##"&'&5476;2654&+ÕÈûþÿûþÊ-\0:32#"'#‘ ’ŽXS§þܧ¹3),4:32#"&å§þܧ§$þ5¹¿¿¹þþ:±{ÌÿÿÌ{±d–ççþjç+ý®›““þÅdaþ¼ýðþ¼a Õ326&#332+3##5#53“þš™Žþ8ÊþûþÿûþííÊ¿¿'ýÑ’ ‘®þøáþHâ^ddÿûþV¤&  533>32#"&'3##5å§þܧ§$ü½¿¹:±{ÌÿÿÌ{±:þþ¹d–ççþjçþg ý¢daþ¼ýðþ¼adþÌŽŽ ¬Õ!#!5!¬Êý)¡+ªÁþVy{3#\¸¸{ùöÉþVð3"&4&#"#367632o†ñÍš™³×ÊÊQfežãé}þ…–ªô}×ÕÿÞûñ‡CBþÁºþV{3"&'4&#"#3>32dJlÊ£||•¬¹¹B³uÁƤþçŽaœÁÕŸž¾¤ûÝ ®edïÿÿðÃ# Ib !5!5!5!bþ>Âþ>ÂI–––5áÕ:@ üK° TX¹ÿÀ8Yì991äÌ@ _°ï]0¶ P]3#5Ë¢Õýqþ›eŪoÕ7@ „üK°TK°T[X¹ÿÀ8Yì1ôì0@ @P`p ]#oªÕýÕ+ÿÿ¯³Õ»MþVT&#"3733#;#"&50# 7632’7M\P¸úú=x1F¿™<þèõ5„K9úüþ ýp|tœÌʆ½öÉþ¿ÝÕ !33#!#É–ĪªþðýjÄÕûáúÕþAáûºþå÷{3##4&#"#3>32d““¸||•¬¹¹B³uÁƤýïþRžŸž¾¤ý‡`®edïÿã9ð(%!5!#$'&''7&5!2.# !26Ãþ¶uþæ þ¢Æ(T+p‹^’opü‹þÆ+ûjŠk¨Õ‘¦ýSUÌ’â%n™HF×_`™—þÙ•þ_Ïw™%þV{&0:%!"&'5326=#"'&''7&53253732654'&'&#"Zþþúa¬QQžRµ´9²|Î~Ch!tüÎ|²9¸•!¶¹ýŸ.R”•¥ 2R–”¥‹þâþé³,*½¿[cbSp#c'8>:bcªþ±2c==ËW367'&'&#"d¸ýǹ•!¶¹B³uÁcJ‘!¬º 3>|•¬¤ý\j¾þTo2c=ƒ®edxY™1c90u@O¾¤_‹Õ$+#.+#'7! 7-&'&'#3767A{>ÍÙ¿J‹xÜÊš+ÅÈ~Ié+ÿƒý‰,J“þþ“J= ¼~þh–bý‰3BFk>dNU ºò³?(Bþ(D8cJ{.#"%#'73>32JI,œ§²!þ-¹•!¶¹:º….´˾4bœþTo2c<„®fcÿãð/.#"%!"&'532654&/'%&'&54$32HsÌ_¥³w¦T"+þ™W6lþÝþçjï€{ìr­¼‡šaýâ+eM0eõiÚ¤Å76€vceµw'8l¶Ùà0/ÐEFˆ~n|´w".`«Æä&ÿã'{/.#"%#"&'532654&/'%&'&54632‹N¨Z‰‰b”-º!þÖK,R÷ØZÃlfÆa‚Œe«$þO!#>&LàÎf´?®((TT@I! “cc (L‰œ¶##¾55YQKP%ca&Jƒž¬ÿ—ŸÕ#546;!3#!#-„vœÀÖÊÞÊÊý"Ê0^i1Fµ£ýœdú+Çý9œà3!533##!##53!5è€Îjjþ2€ii€Îà}}}\ý•Žþrk\\~~GŒä'1.#"!3267#"&'#"&54632>32$"32654ogW`uýë€sC~>?ƒCe˜3-„X˜¬¬˜X…*1’Zާýºml^]lUdaY2jpa==><¯š›®><<>£Lâ‚poÿÿº˜`ÜwÑÕ #!5!!5ÑÊý°PýpÕú+ɪ¸ªF Õ#";##"$54$3@þššþÊÊþûþÿû/’†‡’×ú+XâÝÛãÉÕ 3333! ÉÄËÅþÓþþƒÕúáüú+øüÉ“m3#ÉÊÊmø“D UÕ%3 3# # #3ô>ã:9Íþ‰þþÅþÂãþÆþÇÍwþÅûîú+úðîûÕÂЕX¶©ÄÔ1Ôì0!5!•þ-ÓЈœ½X'3ÖI(œsIˆnhäX#'3äþh'OÐý˜W™`4òX#'3òýòv5]ÐüdDàZùX#'3ù ýè|;dÐû07!œ½X#Öç(ýøXþ̈Iÿÿœ•$NþÌÿÿh½$OþÌÿÿn4ä$PþÌÿÿ`ò$QþÌnhäX#7äOýÙhþðˆ™Wý˜ÿÿh½$SþÌÿÿÂh•ðNý˜ÿÿ4½ðOý˜ÿÿnäðPý˜`4òX#7ò]ýËv¼ˆàDüdÿÿn4ä$XþÌÿÿ4½ðSý˜ÿÿÂ4•¼Nüdÿÿ½¼OüdZùX%#7ùdýÅ|ˆˆ!7û0ÿÿ`ò$]þÌÿÿnäðXý˜ÿÿ½¼Südÿÿ•ˆNû0±<0Ö^XµÔì1ÄÄ33ÖˆXú¨–:Ü #'+/37Ú·/$0(7,48Ü<Ü<<<<¶#+ 3'Ü<<<<Ü<¶ Ü<Ü<<<<¶ Ü<<<<Ü<°9̰XKRX°8K° bf °TX±30<xÖN\ašÄdþÁ‹Urn¯³$.%675!26! $547&# !&'$! $ cþ¹©ŸeÙþ'þ4'T­þû¨Ô‡8þø îþþõ…þåþïÃN!VÆmø³©ýÿ•ýÒ0w_Œšþ·cþ-þ±SÖR@@´]þžšþwloÿâ6³! 3!4!"#! 6þþ"ZÐn':þäóS¾E²·Èþé/þÑþ·OsÑþÿö ‰þ‹nÿâ6³! 3! 54'#5364##'! Íúü85Ä<'0¾ª[Üüþþ%º³»æ|sþ}þþàþ¨NsÍ(©P Úõšžnÿâ˳ &"673! ! 7! 547&5! 3ÑÖÑhfÀ=þÈþ´G=Âýÿýýe¾…‘ HÞ6ß´_c ýåˆþvKþ]›XKý¸RF¼”ÎŽþ.%@nÿâ ³ "! ! %!$#"! !663 Iþóþí W Ìþ÷ò×þ.þ<Îà•s÷ƒ’‚þ~ý“þ\¤›þFþúåÛÒyþíý-ý½Cm!æÚýén³## #! ›Æ¤õþۮȤã²ûþŠþ{C¸š~þ‚þfþSþ²y‚šýânÿâ6 ! 3 5+53$54'!6þþ+Î<'0ÒܯÿÈdúúÆþó$þÜþ®Dx<¨¯•¹¾mþ÷dcþžnë³5%67$5!26 63 #=# ###&!"6!&%$]s‘þ=0·èpdžm^ó®ßÍüýÿ¬ãÛ­þþø-²zþÐ(þ™þ›þɦxCóð{ë²»»²þgºþd±È?GçþZ¦þþZ¦çþ·yþAé #þv¥\[þÃnÿâ4³ &'  ! 5%254!"#! ‹j¸þÃ:%©þ2þãžþá™{²ºÔÚË?þÁ¸þ•býþ®îJÑùql|þc‚ÿâJ  !"! 7! )!"63 –þɨ5+´þþ#Qþ¬©Œé«OKþ&þ­DþúþèT‚ æÇUn†³ #!"#!"#!263 †þÇà^þòå·þ÷ë>×þÚ¾Þx‚¹ÉÂþfþØnUσþÏý‚‡(þ}þ1þ§þ–(›Ï!ððýßnÿâ6Ÿ! 73! 54'#53$54$536þ0þÇ5!°Úsþ]Ü{ëÿ×%þ0ß³³þÁ?CÀ-¶?°£rô–ŽÝ²ynnÿâ5Á% 3! %5'6%5%5þþ!¾!3ý×`ý¸¢þ]ÆÑþJþVO;2xÖþ}²ΰ_§‚ná³&#5% #! #5%$!$7 63 áþ¢ï‡þûþõÀþæþü”ëþ™Êüò°} ŠuÛÜ|þbþübIŒKþ×þ¢^(þ´•þÁþžw£üû þØ4ôô‚ÿâJŸ! 3! 54'73Jþþ#´+5ü-ÈJ-þRkûmþvIK³&™Ùæ|þûnÿâj³$3254'##533! 547 „XÑñïÍÖ’»“.úþ×þ©þ¼þÇÀܧ/ð³þ½˜þˆw™@¶DüíçD\þu±þ¶Ñþ&ÖÕI°R2ÿá'³! 3! &#"#&'#53263 'þ4þ8ËDB§Ÿž“Œ›Ki©qîýóê.þ×þ²5´©TþhMŒŸŸŸþ†nÿ⌳ 7! ! !#"$53;265+5765!"%5!263 Fþïþ÷2þ¿þédÏþµËÚ‚JÆè|;Ôþ÷…o&þIþ+ÃýmŒ»ªìØžvþ‹þy‡ýÀÔþÞÙ;€Í‰—‰ß5€p”rý×)‹ÇÁþZþå’{nÿâ5Ÿ! 73! '#'235þþ#7ÌE!?дÄB³<m¬Ý©ÊþèÝÜþ·N$²¨þÿù^þª¢nÿ⻳*7675!23 #=! # !&'$üxšþ`ÆÙ‰xæÆ¯åÖþýþñ«ýì³vS¥8þøýþïþß±b" K÷þùþ aëþ”`òTTþrþÀ@þ¨mþMþ­páRcE¾nÿâ4¡! 3! 54736734þþ!Â"!?¥þ5᳤›¨Åþ» þóþéDøc ¹(©ÉÔ”(þÚ t9nÿâ4³#&#  ! 5!4#"#54!5 63 ŒsÇþÛ`¨þ1þ ㈲®³¤þç6UÔKËÆIþrþŠ]þ ù=`|´::´ŸÀÀþ³ƒJ³74#"6#=&#! ¥Ä®›ÌÀÜèþÚ¹³U’uþæáhþ=^þýþ§u°®bü|ðÃþí’pÿâà# 325&+53$54$73‘ø(þåþþÆr׆Ì«¯¬ÀÒZ þã¸$®Œ{þöþâþ¸Hp,=þ‹ôþcþöþò­û£e‘ŒTˆnÿâ4Ÿ &# ! ! 5!63ŒzÊþäD¨þþ䦔¨£PþpYþqlýô>J=RIƒÿâI³$!26! #54#"67 ! 3! 5!"ƒ[È`%þ礧¯¦Šáþ þ0³Iþω¦y:½½Ÿ DD ›þžUþwýÛþ…q‹R`nÿâ\ ##3#! 73! # !3'33;#"[Ü?ž~Wþþ#;ÌH 5^áþgœ^%È"òüîòÕDŽõiþ¹þ5þèÝÜþ·NÅ-6¨¨þÏ¥G‚ÿâJŸ !! 7! 363–þË¢ˆ9&´þ&þµ¡‰éUþXþv€n_ýÑ%˜ý¼N2ÿâï³!%!5 65&%'%7764&#532ïMþ§‘PþÉþ™ÉþúséþyPjJ@‚œ„JKpÌŠ«þënÜÆæ zÀ(E•¾ŒÅÂS8›KJ²7Änÿâ5³&! 3! 4+53254'#53254!#53 35þþ!¾!-šçÓššççƒþmvvQ—©ƒ–™þIþœų„yµ™¸žþª›aN‡”Gnxÿâ>²& 3! 4'#5327&+53654!5 #\þµ0'ƒ©©lƒ¦¦oþ×矶­ÀæMû³þºà±ƒ}·´žþÒ¥Sg~€\VáþNnÿ_6³ $! 27#! 3"%#',$*þ×þÛ¾Ù?þêâäþå.ïÃþçþîÅÒþhxx˜¢ þ`û©S^¦;ýÁþ^þ¢þøO¾æçnÿâ4µ! 53! 5+53$#%4þþ%½%(òä{[ýµÁÆþºF–þLÔÓÝþÖ›¤­xìý¿žqþÒnÿâB´ ! 53! !#53$#3!2735þþ!¿ -þêÀng§ƒþ!¾!Þ}š þÕ)Èþ掎þºF`­»owÆÅáþ€¦œnÿâÁ³%!$! 5)4! ! %#$! 3#3„þÇþá&2ý¨9þÎþÚ þþ# þõä㌌ŒÞþÎþÔôbþºŸãûÚxþlÌ!j`?Ûþ~—¾þʸnÿâ6´ ,4&#  !"'!5 5!"! 5$7 6!|¦þÞ 'ºþ€šþ/þÚ‹™%þˉv'ºµÚþÙþkþÔ„ý݇žþl ôx'›Âýþ¯¥öýúØØþÄ¿zþù‡#32%$76#"##"6%3$32šýüBpr.«HZþãd ýD]Ï]þÇ©Ó*H$¼O¾H5ÁÔ*üN¨þ,®®®Fhú®Iý¡à(ýô‘¯2ùú:(ýjnþÍdþ(Ó0<$47'&'#&%'67$%&573265&5#"6kVoþrþb32#4&#"#9þó`M1¸C±uÁȸ||•­MM 7ÑÔB³uÁƸ||•¬¹e,'"¼xMü¬fcðç¦ýaŸŸ¾¤‘?'¼»Gzýžedïèý\žŸž¾¤ûÝ®þVã5<!"'&76763!!32653#5#"&5#3!#"&5332765!"3 þÛ•^SWsvÝ™||•­¸¸C±uÁÈáÕþsC±uÁȸ||•WVþÛƒƒ¶^S‘ƒBWþLýaŸŸ¾¤{û ¬fcðçüûB¢Vfcðçfþ¡ŸŸ__¤{{Š®þV ›H!&#5#"&5332654/&763!6763232653#5#"'&=4&#"#9þó`M1¸C±uÁȸ||•­MM 7ÑÔc%ZkÁÆ>8nŒ­¸¸C±l¯bd||x¬¹e,'"¼xMü¬fcðç¦ýaŸŸ¾¤‘?'¼»Gzýž2ïèã—XO¾¤{û ¬fcx{ä䟞¾¤ûÝÿÿˆ[B`&/þN VÈ 332673 &Vv aWV` v žþÞžKKJLÿÿJ[¢`&Cþç N~`27676=3#!5!cÁú\@º&@e‹¾xþjÁ`üQ£qò73>53³zíýK-b[;¸Iwz?þ‡í´-b\;¸2Nh`iþ——8^—Xþô d­wNjýi8^—X öVšnZ7X½`##!5!½ÊºüeÑü/Ѻ`#4.#!5!2%#¹ '>nŒiý+Õ…Ä”^;ûk¹íþíj‹t@,?]‘²EýT`X»`!2#!5!2>4.#!X×–è\##\ç–ý(Øq¨f==f¨qý(`Ai•™°™•iAŽ*HnušunH*X»!!3! \û\»¨ý¤ÑCþL„ü$º`)!2!4.#ú5£Óƒ5ûWï !3WmO`<Ù§½ü¾…^‚h=)X»`#4.#!5!2»ºTŒtüÈ7¢Ó‚5ý송m)<Ù`ÿøº`#4.#!#"'53265#5!2ºº $@pPþ${˜5NA&G.­CÁl,^ý¢`Jce:%ýÍÖÐr£3CŠ´Ù-Û!5!3!Ûúþ-¨--ª-ýÓÿÿXS–&!¡?ÿÿNS–&N?ÿÿXS–'Xü&!—?ÿÿXS–'Xü'!ûL?ÿÿºþ»Ÿ`&&ÿÿºþuŸ`&&ÿÿºþ»Ÿ`&&ÿÿXH`'þá'ÿÿXÿö`'þ!(ÿÿX`'þ)ÿÿº€`&*ÿÿY`'þ +ªÿÿYç`'þ ,zÿÿ¹ÿã¿k&.ÿÿY¢`'þ  /ÚÿÿXþV’`'þ±0ÿÿXÊ`'þ±1ÿÿXðÕ'þQ2ÿÿXµp&04ÿÿXx`'þ!6ÿÿ¹ÿã¿`&7ÿÿºþVd`&q9ÿÿºŽ`&|:ÿÿX`'þQ<ÿÿºþV_&Ñ=ÿÿXÊ`'þ±>ÿÿXS`'9ü ?ÿÿÿøˆ`&@ÿÿºt–'!û´+ÿÿXH–'ÿq'ÿÿXÊ–'ÿA1ÿÿºŽ–&:X‘, ##54>7#33>53rÙþ`#8!¸2-A,º¸»xž#8"¸2.@,›þeX5AnEþô¹QŠ`Q2,  BþLý« 6AnE ¹R‰aQ1,ÿÿ‚þ ë'%9ÿŽÿÿ‚þ ï'%9ÿ'ÿÿÿìþ ‡X&(%àÿÿÿÿìþ ~X'%àÿ)ÿÿ‚þ ë'$¼ÿŽÿÿ‚þ ï'$¼ÿ'ÿÿÿìþ óX&($cÿÿÿÿìþ ~X&)$cÿÿÿ‚þ ë'&¼ÿŽÿÿ‚þ ï'&¼ÿ'ÿÿÿìþ óX&(&cÿÿÿÿìþ ~X&)&cÿÿÿ‚ÿìë'%9„Žÿÿ‚ÿìï'%9„'ÿÿÿì‡â&(%àLÿÿÿì~â&)%àLÿÿ‚ÿìë'&¼„Žÿÿ‚ÿìï&'&¼„ÿÿÿìóâ&(&cLÿÿÿì~â&)&cLÿÿ‚ÿìë™'K„ý¨Žÿÿ‚ÿìï™&'K„ý¨ÿÿÿì0a&(Kÿ+þpÿÿÿì~a&)Kÿ+þpÿÿ‚ÿ¤ž'#x~ºÿÿ‚ÿ¥\F&*#x¶ÿÿÿì?&+#,~ÿÿÿì x&,#>èÿÿ‚ÿ¤ž'&xxºÿÿ‚ÿ¥\F&*&x°ÿÿÿì?&+&,xÿÿÿì x&,&>âÿÿþ (f'%¯Zÿÿþ >f'%£}™ÿÿÿìþ>\/&š% ÿ8ÿÿÿìþ>>/&›% ÿ8ÿÿþ (f'"ŠZÿÿþ >f'"&ÿç™ÿÿÿìÿ8\/&š"ÿ8ÿÿÿìÿ8>/&›"ÿ8ÿÿþ (f'$––Zÿÿþ >f'$2™ÿÿÿìþ>\/&š$ÿ8ÿÿÿìþ>>/&›$ÿ8ÿÿþ (f'&–¯Zÿÿþ >f'&2™ÿÿÿìþ>\/&š&ÿ8ÿÿÿìþ>>/&›&ÿ8ÿÿ}þÔR'"+þÔ\ÿÿ}þÔGR'"+þÔ¡ÿÿ}ÿÚ°'"ú\ÿÿ}ÿÚG°'"ú¡ÿÿ}ÿÚª'#ú\ÿÿ}ÿÚGª'#ú¡ÿÿ}ÿÚ÷'KÿÂÿ\ÿÿ}ÿÚG÷'KÿÂÿ¡ÿÿÿ«þ „°'#ô ^ÿÿÿ«þ ~°&¥#ô ÿÿÿ«þ Á/&^K¼þ>ÿÿÿ«þ ~/&¥K¼þ>ÿÿ‚ÿ§)‚ÿ§Ù7%#"'$47332767654'&54767;#"'&/œc©Í·À€þ¶?¸AËh—¸Âž#6þÊ2 #déý­GG&+@X„A:g!axL54#"%473303576 !! &5"'&3254&'±?ÐTKJ&ý߸|ŠtD.^(þ¨£.Eþôò:qÁ!&PET¿*Ÿ¤4pHuJ6>(E&7 kcCryb¸lâBcÞß5/iCp4— ÿÿÿìÿ½½åâÿÿÿìþ Ä«ãÿÿÿÉÇÖ'#qFkÿÿÿÉÒÖ&Ñ#qFÿÿÿìÏl&Ò#KÜÿÿÿìl&Ó#KÜÿÿÿ«þ @Õ&pwÿ¤ýØÿÿÿ«þ 6Õ&åwÿ¤ýØÿÿÿ«þ @r'ÿôþ>pÿÿÿ«þ 6r'ÿôþ>åÿÿÿ«þ @4&pÿìþÿÿÿ«þ 64&åÿìþÿÿÿ«þ @°&p#, ÿÿÿ«þ 6°&å#, ÿÿ‚üþÀJ&q%Šýøÿÿ‚üþ¿'%Šýøçÿÿÿìþ ‡X'%àÿ(ÿÿÿìþ ~X&)%àÿÿì‡X %+53276=3+HZ#c,1¸VV¸,1jÙÙ»ÿì~X%+53276=3;#"+M˜Z#c,1¸1,c7n–VV¸,1jÙÙj1,¸ÿÿ‚þóÀJqÿÿ‚þð¿çÿÿÿìþÔóX&N"cþÔÿÿÿìþÔ~X&O"cþÔüpn"56$3çþ=æìÅßÔgi~wun52&$ßÅìæþ=Ôšuw~igý* '/&'&#"#67632O,$e5F¢qpÈ[?8WH7  $0G‡JI  Ö'327673#"'&'O,$a9G¢qpÈ[?8Wì7  $,K‡JI ÿÿºPšsÿ,ÿÿÿìlš&hsÿ,ÿÿºPýtÿ,i,k ;#"'&=3!1,cK‚Ž\W¸L71,¸\W+ÿÿþPÿöuÿ,ÿÿºPªvÿ,ÿÿÿìlª'vÿ,hÿÿ¹Pýwÿ,ÿÿÿìlý'wÿ,hÿÿþèPÿØxÿ,ÿÿÿìþèl¸'xÿ,hÿÿÿôËdôyÿ,ÿÿÿìlô'yÿ,hÿÿá<zÿ,ÿÿÿìl&hzÿ,ÿÿ£UÞNÿÿÿµ…ƒ'{ÿÂTÿÿÿµ…ƒ&…{ÿÂÿÿlÃ9'|ÿÂTÿÿl„9&…|ÿÂÿÿÿ«þ @µ'|ÿÂþ>pÿÿÿ«þ 6µ&å|ÿÂþ>ÿÿlþ Ã'}ÿTÿÿlþ „&…}ÿÿÿ‚þóÀµ'|ÿôþ>qÿÿ‚þð¿»&ç|XýDÿÿÿìÑç&N|ÿ+þpÿÿÿì~ç&O|ÿ+þpÿÿÁyTÁ„ 3;#"'&Á¸1,cK‚šPWs¡ûkj1,¸\eÿÿ‚þ¢ë'!9þ¢Žÿÿ‚þ¢ï&'!9þ¢ÿÿÿìþÔ‡X&(!àþÔÿÿÿìþÔ~X&)!àþÔÿÿ‹ÿÆ '"ú„oÿÿ‘^&á"^„ÿÿ‚ÿìë '"¼ŠŽÿÿ‚ÿìï &'"¼Šÿÿÿìóè&("cRÿÿÿì~è&)"cRÿÿ‚ÿìë'#¼ŠŽÿÿ‚ÿìï&'#¼Šÿÿÿìóâ&(#cRÿÿÿì~â&)#cRÿÿþ (f'!Zÿÿþ >f&™!¼ÿÎÿÿÿìþÔ\/&š! þÔÿÿÿìþÔ>/&›! þÔÿÿþ (fZþ >f0%3#"'&'&'!27# '&5767"#"5$3 "(1{R=IrbàJIÁÔ–úþ^©ƒÔ`‰ _Œ‡_Á&Èm3HZ¸¸–dœ²P·ü‰^¤v¸c–àße4)¸?6š [ _wÿì\/&'&'&5672+5327676SSgU´R¡HK¢¬ÜLX¦J‘KÝ£€dãht^¸#4bš4bBP¸H:jVÿì>/);#"'&'+53276767&'&'&5672~ÜAI2hrBVÑ~(;E)‘KÝ£€dãht^eSgU´R¡HK¢ 4bš)N"w¸¨6a.%P¸H:jV#¸ÿÿþ (°'!?Zÿÿþ >°&™!?ÿÿÿì\L&š! ¶ÿÿÿì>L&›! ¶ÿÿ}ÿÚR\}ÿÚGR &'3;#"'#"'532767654"9¶ãaRQS,cK‚“a]Ï.-fgsT!"¬#?z™N‰†uIS,¸‚€!&¸* 1p*Dÿÿ}ÿÚ°'!E\ÿÿ}ÿÚG°&¡!Eÿÿÿ«þ b&^ÿ«þ ~&3;#"'!5 767654x¸ I*eK‚‚2Dûþäþ¾0ËÚ# &pgM,¸>þê…—¸€ŠÐ:H~ÿÿÿ«þ b¶'!q ^ÿÿÿ«þ ~¶&¥!q ÿÿ‚þ î`‚þ GîF%7653323;#"'#"'&''&'#&'$473327676'&/3¸N0%¸@nޏS,cK‚‘vDm% I0Š1_@8‰'T…ÁPx€mþíi¸l“_Qb_y^@@¸$:µ|_ÊÍ2©&þªaS,¸`[ F{Ÿ<³kª>GHö´Îܳ&%0žlŽ}=êœJ<~ÿìÿã î1%+53276=3327653763#"'&'#"'&€+8Lc‚Kc,P¸,+hm,%¸@nޏ\Kf%#?7‰0`DAbH<Š;!.¸,PdÀœ@dczgÂÍ2ª&þªÇq\ =„œ!1(ÿìÿã7î8#"'&'#"'&'+53276=3327653763;#"'ý%#?7‰0`DAbH<)+8Lc‚Kc,P¸,+hm,%¸@nޏS,cK‚‘vD =„œ!1(I;!.¸,PdÀœ@dczgÂÍ2ª&þªaS,¸`Zÿÿ‚þ °'#â `ÿÿ‚þ G°&©#â ÿÿÿìÿã °&ª#Š ÿÿÿìÿã7°&«#Š ÿÿ‚þ åb‚þ áå<I)"'&5#&'$47332767654'367676;#"/"3276'&'&uþì&4-JXîPx€mþíi¸l“_Qf[¢+!'« (s{l“HX}aº*=RK‚ƒgÌL~¨‘»í»‰%º€›MGHö´Îܳ&%DŠl“Š7(2’l^F"%GéMF ,¸\v7QlÂ?[F‡ÿì2å .327654'&#"!"'&'+53276=36767632Ш‘»íº‹%0LºþìJNA'f¬‚Kc,P¸-e_™KUskº¸ÊælÂ?[F‡ýÉ*#=Џ,PdrNP2†T‰?!'Dì©mxÿìå+8)"'&'+53276=36767632;#"/327654'&#"˜þèJNA'f¬‚Kc,P¸-e_™KUqm¾*=RK‚ƒgÌ਑»íº‹%0L*#=Џ,PdrNP2†T‰?!'DìKH ,¸\vælÂ?[F‡ÿÿ‚þ ¶'!û bÿÿ‚þ á¶&±!û ÿÿÿì2¶&²!Û ÿÿÿì¶&³!Û ÿÿÜd¬))5!3%632;#"/%3276'&'&#"@ý¿þ‘o¸Ù\Dui¼*=RK‚ƒgÌýé»í»‰%0Pz±¸\û?c!'EëMF ,¸\v¸?]D‡QxÿìÔ %3276'&'&#")5!3%6329»í»‰%0Pz±uýÁþõ ¸Ù\Duiº¸Ê¸?]D‡Qxþ’¸\û?c!'Eë©mxÿì¤))5!3%632;#"/%3276'&'&#"8ý¿þõ ¸Ù\Dui¼*=RK‚ƒgÌýé»í»‰%0Pz±¸\û?c!'EëMF ,¸\v¸?]D‡QxÿÿÜ'!ÏRdÿÿ¬&¹!ÏRÿÿÿìÔ&º!ÇRÿÿÿì¤&»!ÇRÿÿuþ ²*fuþ ²%+! '&7.54762;# '!2764"²˜þÿþ[b»=D}aî_[9^D¶U þöøš)k_ÁÔý1ˆÎþoc¼z’Œ2t*n@00@p[C+ @M¸äkl=žv–8`3$ÿìø*727&'&5763"327%+5<¡ÊK4XÌ}ûÚº>SF7J þ\þ¢²X¸];dŒ}M©‰ÿ4F!¸Å¤¸ÿìð$/%+532767&'&5476762;#""654'îÂÊv`kB;(aD hYîYh MXD=p`vʨ4/gg/¹¹¸($'UZ'-)74--47)-'bM,(¸U __ ÿÿuþ ²F'!w°fÿÿuþ ²L&Á!©¶ÿÿÿìøF&Â!w°ÿÿÿìðL&Ã!£¶ÿÿ‚ÿ¤ž'!õ~ºÿÿ‚ÿ¥\L&*!õ¶ÿÿÿì?&+!©~ÿÿÿì ~&,!»èÿÿkþH›'"R~ÿÿkþ À&-"„kÿÿÿì?&.",~ÿÿÿì ~&/"8èÿÿÿÉÇkÿÉÒ!D#"'5327654'&'&7676'&'$54733276763;#"'ÐJ&P DfXRNB8D-<9_¸h$$EB|=Q#!v+6ºú(  %þ¶{{qe›ÿì))5!27654'&54767;#"'&/6þ¶6”-6þÊ2 héý­GG&+@X„A:g!a_¸h$$EB|=Q#!v+6ºú(  %ý?¸+)x.›ÿÿþÈlþÈ#$%653;#"'#"'$&733276N¸1,cK‚pNyþû†UcEþÜ@¸A¦(IPm®I~ãjûkj1,¸3.(±B"[Š\ss~B"5ÿì¯ +5327653¯WPš‚Kc,1¸s²e\¸,1j•ÿìº%+5327653;#"SM˜‚Kc,1¸1,cK‚–VV¸,1j•ûkj1,¸ÿÿŒþ^ómŒþgt5%327654'&'&#"#"'&#4763&547632;#"bzL,5;(.;DÀ …Kµ2KÈxAZ¢M\HTª((&iK‚¯¨*9:X DD(©PNNOþ“m­f7*(”„?$G³C,,¸ÿìÿͦm$%#"'+5326767632%327654'&#"da“În@h t4W‡^Q°[aýð>Ÿ/4(*X.[4fb0¸G1µP8TY¸NE5EK&)Ÿ/4:''5)24fb0¸$#1µP8S§1>,¸ÄE5EX !a%ÿÿ“þµH¶'!? Óÿÿ“þ +¼&5!?&ÿÿÿì‡è'!àR(ÿÿÿì~è'!àR)ÿÿ‹ÿÆ Þo‘^î $&'&'&'3;#"'&'#"'&5476¤ xRo´t¸$8pK‚ZI-&Šœ8:½Ìm*12e CY>)2Ñ'+¨®eO,¸3;I0š­Dÿìÿ½½å-=67654'&#"27&'&5476&'5#"'+5327654'&”$"':Aù4N--0M,Qߨ@(J¯ƒšx’‰«b 41}! @H=.%4-+#%vˆ iEN@TSZ '¹D³ÑÞ49g=ql)¸D%'“i.C!v-‹3j  °;AWE… ¸L9P)8K6(¸œS/V¸L_”+Y‡9›K1\Sÿÿ‚þóÀJq‚þð¿765&'&'&54767632;#"'&#"#"'$4733276L[/,4PT*uW€ ##rpl$-AIq€ÚYh¼uþÛ?¸A¦B³[M•!3!+ (;=A<^†Ä¸¬¥#0{bV` )g™ZZ™rNÿÿ‚þ ÀJ'"ôþ qÿÿ‚þ ¿'"ôþ çÿÿÿìþÔóX&N"cþÔÿÿÿìþÔ~X&O"cþÔÿÿÿ.ÿì¿í&ò{þ–,ÿÿÿ.ÿìÚí&ó{þ–,ÿÿÿåÿì¿£&ò|þ–,ÿÿÿåÿìÚ£&ó|þ–,ÿÿþ ¿&ò}þÈÿÿþ Ú&ó}þÈTÿì¿#"'5327367653¿‹7MÍžjK`Uqˆþ³ª%¸BþÔÚUG´ ¸ ˜FüA+7‰¸®TÿìÚ#"'5327367653;#"'&4;IÊ¡jK`Uqˆþ³ª%¸"@Pi¯f<[A´ ¸ ˜FüA+7‰¸®üD®Tž¸ó)ÿTL* 35'5467676?67654&#">32üüü–Ë,X\"$߸gÁ^a³Olƒ39ZZ8Lüüüý®þþ“{4<+VZ@ELŸÂ89¼CFnY1^5YV‚ešdÿãªÕ 73!!d0æ0¨ÁýŒÁêõ#²úN@öþ ª|Èÿíè $327654&#632!"'327654&#|4ûw=ƯþÞˆdð¢Î×Öu«þ½d„´oê^,ì¿~þ#r;BY•Wa{ÐÕzzäŽp¤4þ€=8hŽdÿãêó  küùýxˆýwýwÈÒ 33 !7>'.'ÈZ„žŸ '8þ¹þÂZÎÇA ¼þÒxzùeþb¸­ÀcÔz\¬‘ Èœò #%%|´Ôýü ýü 6þÊòu²SþÃX²SþÃX²Èœò #%|´Ôýü *üÖòu²SþÃX²–îÕ !#3!53#–XÒÒý¨ÒÒÕ´û“´´mÈ8Õ !!!!!Èpü¼ýøýøÕú+EÜþ$´þ#–ÿã¤ó# $&6$ 67!!!!&¤zÐþàþÆþàÐzzÐ : ÐzýSÂþ´þþÐòÂþîˆòþîNþàÐ{{Ð : Ð{{ÐþàýÃþ óÃþî‰óþî0þ ÃÈ|Õ3#È´´Õú+Èÿãƒó !#3 |´´ˆxý.ÙxýqÕýá=†ýý{†CÈûÕ #3|ÿ€ýM€´3€ýMÕÈ Ôó 3  #Ètƒ8/.€ýRýÒýÑý³´Õýå9ýÑ/€ýS.ýÒîûLÈwó3  #Ètƒ8€ýRý³´Õýå9€ýSîûLÈœÕ !!!!!!!|ÜýpÔú,DÜû”Ü´Üþ$ÜEú+!þ$Üþ$Üýoþ$Ü–ÿã¤ó'64."26 $&6$ "&462’^^ŸÞðÞŸ^^ŸÞðÞ±zÐþàþÆþàÐzzÐ : Ðzý…RtRRtR”ßðßž__žßðßž__XþàÐ{{Ð : Ð{{Ðþà×RRtRRÈçè$54$!"#63 ( þÓþâ57´¢~bþYfÔ¶ùúÄÔþ¿þìþ°’È*Õ 33 3# È´ýý´´þþÕý¢^ú+½ý¡_ûC–ò 4."2>#&'.4>2fH}’}HH}’}üzf@H´GAhxyÏôÏyç“|HH|“}HHLÑ;%ý‰w%<ÐôÏyyÏÈDé ##63 7654'&#"ØlÈÿv‹´¢~l …†‹r¾+.éþåüþÑN$þ\Õüosr–žlX–ÿòòê  ”^þ¢€þc^þ¢€Lþ¢þ¢þ„^^ž€düò%#%7ü8þ2´þ"8Ь•û­™¬È´ê#34€üÈ´´ê€üÉýÍÕý\–ÿãçò 7   'QþE–’“–þE»–þmþn–í£bý¡_bý]ýXbdýœb–âÕ$!#5&'&76753676'&´ª¡¡€«´ª¡¡€«`KmmKþì`KmmKÌ€¡Ç¢€ËË€¡þ9¢€‡ý0Ll2lKýHÐLn˜–nLdò !#73—´ý€ÿ´ÿ€ýô~€þãþ€ý‚–ÿñ¢¹%4&"2$ &767&'&6 4&"2î{®{{®/åþ¾år/77/råBår/77/r´{®{{® ®{{®{1ååBs/.rCååþ¾s/.rî{{®{Èàè 3632!2654&#"È„ó þ©þóÊæ´¢*0Õæ½ÐÜýgNvcœÈÿíàÕ 3 #"'032654&È´ Wþàó„´0*¢´æÕýgÜнæ‡þœcvd¼Õ5!3#d¤´´‘´ú+‘dªò #7 "&462ªýÐæýШûûþ‘RtRRtR²úN²@úÚ&ýØRRtRRÿÿÈ|ÕdÿãªÕ73 d0æ0¨þþ#²úN@&úÚÿÿ–ÿãçòd'ó #dÈûzýÛ´þ,Çý;„þûXþªà‚¨ !5!5!)5!ýþ­S2Sý½þ®RàÈÈÈÈÈÿÿª=‚ 'aCÿ]ÿÿª7‚'ÿXbFÿÿª:‚ 'ba:ÿÿª;‚ 'b<bÿÿª=‚ 'ÿ]bÿÿª‚H'a€&a'a€aÿÿª‚H'a€'a€'abÿÿª‚H'þ 'a€'a€aÿÿª‚H'a€&a'ab€ÿÿª‚H'b€'a€'abÿÿª‚H'b€'a'a€þ ÿÿª‚H&a& 'a€aÿÿª‚H&b& 'a€aÿÿª‚H'þ 'a'a€ ÿÿª‚H'b'a€&aa€ÿÿª‚H'b'a€'a€bÿÿª‚H'þ 'a€'a€bÿÿª‚H&a'b€'ba€ÿÿª‚H&b'a€'bb€ÿÿª‚H'þ 'b€'ba€ÿÿª‚H& 'a€'baÿÿª‚H& &b'a€bÿÿª‚H& 'a€'bþ ÿÿª‚H' 'a€&aa€ÿÿª‚H&b'a€'a€ ÿÿª‚H'þ ' 'a€a€ÿÿª‚H'b€'a€&a ÿÿª‚H' &b'a€b€ÿÿª‚H' 'þ 'a€b€ÿÿª‚H' 'a€& aÿÿª‚H' 'a€& bÿÿª‚H' & 'a€þ ÿÿª‚H'b€'a'a€aÿÿª‚H'b€&b'aa€ÿÿª‚H'b€'a'a€þ ÿÿª‚H'b€'b€'aaÿÿª‚H'b€&b'ab€ÿÿª‚H'b€'þ 'ab€ÿÿª‚H'b€'a& aÿÿª‚H'b€'a& bÿÿª‚H'b€& 'aþ ÿÿª‚H'b€&a'a€bÿÿª‚H'b€&b'a€bÿÿª‚H'b€'b'a€þ ÿÿª‚H'b€'b'b€aÿÿª‚H'b€'b€'bbÿÿª‚H'b€'b'b€þ ÿÿª‚H'b€&a'b ÿÿª‚H'b€'b&b ÿÿª‚H'b€'þ 'b ÿÿª‚H'b€&a'a€ ÿÿª‚H'b€' 'a€bÿÿª‚H'b€'a€' þ ÿÿª‚H'b€' &ab€ÿÿª‚H'b€'b€&b ÿÿª‚H'b€'b€'þ  ÿÿª‚H'b€&a&  ÿÿª‚H'b€&b&  ÿÿª‚H'b€'þ &  ÿÿª‚H' &a'a€aÿÿª‚H' 'a€'abÿÿª‚H' 'þ 'a€aÿÿª‚H' &a'ab€ÿÿª‚H' 'b€'abÿÿª‚H' 'b€'aþ ÿÿª‚H' &a& aÿÿª‚H' &b& aÿÿª‚H' 'þ 'a ÿÿª‚H' 'b'a€aÿÿª‚H' 'b'a€bÿÿª‚H' 'þ 'a€bÿÿª‚H' &a'b€bÿÿª‚H' &b'bb€ÿÿª‚H' 'þ 'b€bÿÿª‚H' & 'baÿÿª‚H' & &bbÿÿª‚H' & 'bþ ÿÿª‚H' ' 'a€aÿÿª‚H' &b'a€ ÿÿª‚H' 'þ ' a€ÿÿª‚H' 'b€&a ÿÿª‚H' ' &bb€ÿÿª‚H' ' 'þ b€ÿÿª‚H' ' & aÿÿª‚H' ' & bÿÿª‚H' ' & þ ÜÕ #3 !!#!]ÍîÍþW:þ\˜ý€™w9þã8qúóqú+¡þ_ÕÇü÷ÉNÕ  %*!2#!327&#363&#!3654/654'ÉfçúÀþþðûý†ê;33;êÖ$ $ýþÊ#ÐÐ>ÐÐÕÀ±å]aþáÈÚéý{wˆýÜúó ûDÜåD–6ÍÄ6è3Õ! )327&#!36'è²–þhþPýý’cõ  öþpÊÆßßÕþ—þ€þ~þ–qúóA‹Aúó ûk•{qœÉSÕ3%!!!!!!-ÊþÒxýÇý9øûvqúó ddýädýsdÉìÕ !!!!!#3É#ýoQý¯þn.ÊÊÕdýädýqúósÿã‹ð&&$#"32767!5!# !2dþü…»‡‡»‘eVþRuþæ þ¢þu‹^’oüR©©äaG@û;@&5çdýSU™mn™HFûcI¯þºþ»¯f¾Õ3%!#3!53#.ÊþnXddý¨ddqúó ddúódd ÿ–þfYÕ6765%!#!53265-V?OþÔÍãþí?†nqú±òd J^ê dú“þòôd–ÂÉ0Õ !3 #!3ÉŸü£’™üÂþpdÊÕý‰wý@üëÏý1qúó É2Õ !!!3É’×û—dÊÕúdoúó ÄoÕ !#!! !3!3Ýþ_GþbþnØ}×þÒÊúÊqû®RúÕüøú+qúó úó rÿãÚð'( ! '&76 7& 676'&&:¼¾½½þÆþż½½¼Glllþðli$ ›› Þ#››ûÌðÒÕþ þ¡ÔÓÓÒabÓÒúŽ22×22ûjT%¶ýœµ%5û¯$¶c¶$ýôˆÿÜŸö-6&/.4%&  %5 64&/.$ Pdˆ¬o©¨&œªn°žÎþÅ¢m”nÊÉþàþþûßg©zŠoÊ·Æ-[þÊš)'¹þÿNXd»''ã´pu‰éi$2ëþXîf|•’ý† /ÏŒôÿú°Õ 3%!!!!rÈüÀ¶ýîþpýìqúó ddúq±ÿãóÕ $!&%! 65! ÆX!û†!YþÓ‘€ €‘þ¬ýfþ¬qü™þæ‚ba@üÀþž`|gdü5ðÓÓðËü\þÜþÖ*$·Õ 3%! 3!šîÈþþ®ÙÚdýÇþÌqúó dûéú+D®Õ 3!3%! ! 3! !ÄDÈþ¼û5DÈþ¼þ»:9:9dþ‰þ|þÅþÂþ€qúó úó dûîûîú+úðlÕ 3%! 3 ! #(\Æü¤þ~¸v„bþL:þHþŠþ|d¶qúó dýÎ2ý„ü§2ýÎ{ÿü¬Õ 3!! #3nÚdýðþpýð”ªþ2ÈÌÊÂüòý9ÇüòªýVý{ÿã“{",34&'3!5#"&546;54&#"5>3 5#">76/–=Kˆdþ°?¼V¬ËýûÐu—`¶Twß8þ°Ð6/^b;:þgCˆzÓ†]ˆýYýªfaÁ¢½ÀH‹..t''üþ‹UýíNHGÜýg‹wt”ÿã-!>32#"&'!4'&'676763&#"327”N:±|ËÿÿË|±:þ²^,<<,9üR†ù¥KM_]¥ý¢daþ¼ýðþ¼ad¨tŸ‚= üz =OsKÚú¬TþdihtJžŸ‚‚qÿãç{#%#"!2&'&#"3276%çM¥]ýþÖ-U¢LEmGJXHCQRHVþ,${z$d$$>:##düWS%€êæƒ&”ÿã-!!5#"323327654'&'&#"ÅNþ²:±|ËÿÿË|±ýv9,<<,^(†ý¥]_MK¥¶^ùì¨daDDaþZžKsO= † =‚ú¬Tþdü6‚‚ŸžJthioÿã}{!327# 32!.#"}ý‹K_ÙÃmÃkþôþÇ)üåý#ÆÅiÌ©J@þb]u-)8 CþÚ÷qzþÛþóŽÓ¾ç/ã 3476%#"!!!#5354763g.9‡ñ®”:9„þ|þ±°°WX¼® -8‘û¶J_D8‹d97’ddüædd¼TVqþVð{#.=65326=#"325!!"&32767654'&#"jëülQžRµ´:±|ËÿÿË|±:NþÖþÍrÊy^,<<,9/¥KM_]¥úü=ÊŒoú—€,*½¿qdaDDad¨ü-þâþéwŸ‚= † =OsKýÂihtJžŸ‚‚ºH "34'&3'!>32!4&#"! GŒS5ü‡ëOIÆÔÛþ¬kk€•þ± h¾ý”@Á[:¶ú´Ldýžedïèý\Пž¾¤ýUæ5 33#!!J‡ ¹¹KOþ±üüh˜éËû ÿ×þV #676#532765!3#¨‡%G(=ôÝ1l$%OQRa¸¸ûеT0Hôd01™¬ûŒÖ``¾éº2 !3 #!3ºO„ŒýHÑ–ýmþ±d‡üiãýöýª#ýݰú´Læê&5#"'&5!3J=(G%‡õ¶RQOLi” H0Tµ0úZ``Ö~ûJœ^dº‡{"&1<!>32>32!4&#"!4&#"!3%34'&%34'&ºOIÆÔTÞÔÛþ¬kk€•þ¬kk€•þ±d‡[ GŒS5ã GŒS5`®ed¬J€vïèý\Пž¾«ý\Пž¾¤ýUüüh˜ h¾ý”@Á[: h¾ý”@Á[:ºH{ "34'&%3'!>32!4&#"! GŒS5ü‡ëOIÆÔÛþ¬kk€•þ± h¾ý”@Á[:üh˜d®edïèý\Пž¾¤ýUqÿãu{ #2#"27&"676'&sðþîðñþï‚3x33x3d4'pp'Ú3(pp({þÈþìþíþÇ98û× º ükp-€þ$€-Rü’-Û€-qþVð{-%!!>32#"&4'&'&'676#&#"32¿þ²N:±|ËÿÿË|±Š9,<<,^ü؆¥]_MK¥¨ý®¨daþ¼ýðþ¼a¦žKsO= üz =‚ýoHú¸Ê‚‚ŸžJthiqþVð{-%#"325!!3#32767654'&#"¢:±|ËÿÿË|±:Nþ²ý<^,<<,9(††þ¥KM_]¥¨daDDad¨ùø”Ÿ‚= † =OsKü2HüHihtJžŸ‚‚ºß{3'!>32.#"!†êN:º…4I,œ§þ²üüh˜d®fc…˾ýzoÿãÇ{E67654'&/&'&5432654&/.54632.#"#"&'i'K&'q4¥=B%%U+.„39GÓS OjqL‘4vàÎf´LJ\_opPx3¡„÷ØZÃlù=vf03"3;@{R?Bsl37'*7CoTüþ78^UNO,,—ˆ¦µ z1$YXDL#/ž¤À%%7ˆž%&7#!!;!"&5#53Ð*‡\{þ…Ks½þ­Õ¢‡‡jU|ÿü7­N(þ¬dýU‰NdŸÒudT±ÿåD` "%&'&5##!5#"&5!3265!ù GŒS5C‡ëþ¬IÆÔÛTkk€•TS h¾lýÀÁ[:˜ühd®edïè¤ý0Ÿž¾¤«=±` 3%! 3!ÍYƒþ£þñT^^dþ\þÔüüh˜düT¬û Vò`3!3%!!3! !ñð‡òübð‡òþùTæåNæådþÛþÊñòþÇüüh˜üh˜dü–jü–jû –üjL` 3%! 3 ! #«—ýUþ¢|þ¥åþpþãþã|[üüh˜dþþ-ýsþÓ=þVÃ`7%! 3+53267Ò²>þ•þæ^]_lþP’|““XQ+üûÛ™Œdü—iû8Ç{dCYXb` 3%!!!5!\ývŒŠü‰ñýw‰ûö‰ýüüh˜ddühdd˜ÿÿhÕ$ÿÿÉìÕ%ÿÿsÿã'ð&ÿÿɰÕ'ÿÿÉ‹Õ(ÿÿÉ#Õ)ÿÿsÿã‹ð*ÿÿÉ;Õ+ÿÿ—öÕsÿÿÿ–þf“Õ-ÿÿÉjÕ.ÿÿÉjÕ/ÿÿÉÕ0ÿÿÉ3Õ1ÿÿsÿãÙð2ÿÿÉÕ3ÿÿsþøÙð4ÿÿÉTÕ5ÿÿ‡ÿã¢ð6ÿÿÿúéÕ7ÿÿ²ÿã)Õ8ÿÿhÕ9ÿÿD¦Õ:ÿÿ=;Õ;ÿÿÿüçÕ<ÿÿ\Õ=ÿÿ{ÿã-{Dÿÿºÿã¤Eÿÿqÿãç{FÿÿqÿãZGÿÿqÿã{Hÿÿ/øIÿÿqþVZ{JÿÿºdKÿÿÁyLÿÿÿÛþVyMÿÿºœNÿÿÁ9iÿÿº{Pÿÿºd{Qÿÿqÿãu{RÿÿºþV¤{SÿÿqþVZ{TÿÿºJ{UÿÿoÿãÇ{Vÿÿ7òžWÿÿ®ÿãX{Xÿÿ=`YÿÿV5`Zÿÿ;y`[ÿÿ=þV`\ÿÿXÛ`]ˆÿãð   6/&"27ö þöþ þøØÌÌd3{44{3þºÊÊðþsý þsóü#ÔÕ0úÙ÷þ,þ-k¬Õ37!!5!5%6ÊbJûÜJþ™gqúó dúdd HdH‚šð(7!676'&'$32!!7676&#"û)`"LlDbZE‚Ñþçµó0Q]þú(ûèž=y‡m˜ÁdÍ•@9\9p¨dºÏþÝ9hôÌb¬–‘þiddAb¿¨•œÿãsð$*0"'5327&+5327&#"56325654&'>54+»Ô!ĪeO6?ÌÔ;2:LœÙæ¯æ €Ž¢þÐÌuWEdJj D• d <h@Ѳ|ª!ÅÝò’Uèl$–þyX¬Z¸Õ#3 !!3#!!5§ËÈþÔþQ¯“­­þpýßqúóÁüãÍü3dþ\¤”ÿãŒÕ#66'&#"!! !"'532ÿÈg¶ÌÌd1j´ÎKþEþÔþ½¹Ð½Ü‘àýýüæ\Ü`ýI× Kïdþ# õþFù<ˆdqÿãªð %%6'27&"2'& 632# |ÊÊþ&ÍÍd:«-(«?ô§¨"™þÖ^BhõþðöþßþîPpc \ʳþ‘þ#•2"Œ_¸h$$EB|=Q&v+6ºú(  %þ¶z|qe›ÿì© #!5!27653©WPšþ„Ec,1¸s²e\¸,1j•ÿìÿÎ<m%%#"'#!5!26767632%327654'&#"úa“În@hþÊ 4W‡^Q°[aýð>Ÿ/4(*X-.*4fb0¸G1µP8TY¸NE5EK&)d%ÿÿÿìè&<!ÚRÿìÿãnî1%+53276=3327653763#"'&'#"'&ä+8Lcæ¯c,P¸,+hm,%¸@nޏ\Kf%#?7‰0`DAbH<Š;!.¸,PdÀœ@dczgÂÍ2ª&þªÇq\ =„œ!1(ÿÿÿìø*Âÿÿÿì?'!©~+ÿì–å .327654'&#"!"'&'+53276=367676324¨‘»íº‹%0LºþìJNA'f¬æ¯c,P¸-e_™KUskº¸ÊælÂ?[F‡ýÉ*#=Џ,PdrNP2†T‰?!'Dì©mxÿÿÿì?Îÿÿÿìÿãn°&#î ÿÿÿìíè&<"]Rÿÿÿìíâ'#]R<ÿÿÿìÀL& !q¶ÿÿÿì–¶'!? ÿÿÿìøFÆÿÿÁþÔ'!æþÔ1ÿÿÁþÔÌ'!}þÔÁÿ½-'7G3;27&'&5476&'5#"'+"'&327654'&67654'&#"Á¸1,cŽ4N--0M,Qߨ@(J¯ƒšx’ãšPWFb 41}!þº$"':As¡ûkj1, iEN@TSZ '¹D³ÑÞ49g=ql)\e;%'“i.C!_ßþ\šPWs¡ûkj1,h$$EB|=Q&v+6ºú(  %þ¶z|qe›\eÁÿÎ/%327654'&#"#"'+"'&53;26767632>Ÿ/4(*X-.*Äa“În@húšPW¸1,c—4W‡^Q°[aÇE5EK&)d%²fb0\e²¡ûkj1,G1µP8TY¸ÿÿÁ'!æR1Áÿãz;3;276=3327653763#"'&'#"'&'+"'&Á¸1,cnc,P¸,+hm,%¸@nޏ\Kf%#?7‰0`DAbH<)+8LcÜšPWs¡ûkj1,,PdÀœ@dczgÂÍ2ª&þªÇq\ =„œ!1(I;!.\eÁh$3;27&'&5763"327%+"'&Á¸1,cs¡ÊK4XÌ}ûÚº>SF7J þ\þ¢²²šPWs¡ûkj1,];dŒ}M©‰ÿ4F!¸Å¤\eÿÿÁ¯'!~2Á¢+83;276=36767632)"'&'+"'&327654'&#"Á¸1,cnc,P¸-e_™KUskº¸ÊþäþìJNA'f¬ÜšPW¨‘»íº‹%0Ls¡ûkj1,,PdrNP2†T‰?!'Dì©mx*#=Š\e%lÂ?[F‡ÿÿÁ¯'"œ~2ÿÿÁÿãz'#ú %ÿÿÁù'"iR1ÿÿÁù'#iR1ÿÿÁÌ'!}¶ÿÿÁ¢'!K (ÿÿÁD'!7R ÿÿÁh'!ç°&Á%#!"'&53;276=31Hþ¶šPW¸1,cÜc,1¸VV\e²¡ûkj1,,1jÙÙ»Á¯*:33!276767'&54767632#!"'&654'&32Á¸1,cT—O<?a‚Nb–NLZB`.NJ|m‘þešPW)B,4((7(*Hs¡ûkj1, ]027EW-3”E$2Hf3ŒÐˆ,'\eX+M;3*)3P&ÈF !;3#!.ûš Y_Ãü$õû ÈF !; 7!'!%3È Y÷ÁÙFõû Ûü%ŒÃý=ÈF !;"4767632"'&'&!'!%30&$Iù˜ Y÷ÁÙÃ$$%ý¨õû Ûü%ŒÃý=ÈF !;,048"'&'&4767632"'&'&4767632!'!%3±$$%ýÅ$%$ú Y÷ÁÙ?H%$HGüöõû Ûü%ŒÃý=ÈF !;+AEIM"'&'&4767632"'&'&476762"'&'&4767632!'!%3±$$%þÎ$HþÒ$%$ú Y÷ÁÙ?H%$ JHHGüöõû Ûü%ŒÃý=ÈF !;+AW[_c476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&!'!%3'H$%$%HýÞH$%$%Hø Y÷ÁÙÌ$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=ÈF !;+AWnrvz476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3'H$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙÌ$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý= ÈF !;*@Uiƒ‡‹"'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3¤$H%$HþÍJ&$UJHJHý~J&$ú Y÷ÁÙRHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=ÈF !;!476762"'&'&!'!%3ÊJHýþ Y÷ÁÙÃ$$%ý¨õû Ûü%ŒÃý=ÈF !;,048476762"'&'&%4767632"'&'&!'!%3ÌJHd&$Iù˜ Y÷ÁÙÃ$$%%$$%ý¨õû Ûü%ŒÃý=ÈF !;,BFJN476762"'&'&"'&'&4767632"'&'&4767632!'!%3ÊJHç$$%ýÅ$%$ú Y÷ÁÙÃ$$%þ¡H%$HGüöõû Ûü%ŒÃý=ÈF !;,AW[_c476762"'&'&"'&'&4767632"'&'&476762"'&'&4767632!'!%3ÊJHç$$%þÎ$HþÒ$%$ú Y÷ÁÙÃ$$%þ¡H%$ JHHGüöõû Ûü%ŒÃý=ÈF !;+AWmquy476762"'&'&476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&!'!%3ÊJH]H$%$%HýÞH$%$%Hø Y÷ÁÙÃ$$%.$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý= ÈF !;+AWm„ˆŒ476762"'&'&476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3ÊJH]H$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙÃ$$%.$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý= ÈF !;*@Vk•™¡476762"'&'&%"'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3ÊJHÚ$H%$HþÍJ&$UJHJHý~J&$ú Y÷ÁÙÃ$$%´HJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=ÈF !;+/37"'&'&4767632"'&'&5476762!'!%3rJ%$ý­$Jþm Y÷ÁÙ@H$%$%Hüôõû Ûü%ŒÃý=ÈF !;"8N4767632"'&'&!'!%3"'&'&4767632"'&'&54767620&$Iù˜ Y÷ÁÙþ·J%$ý­$JÃ$$%ý¨õû Ûü%ŒÃý=H$%$%HÈF !;,048Nd"'&'&4767632"'&'&4767632!'!%3"'&'&4767632"'&'&5476762±$$%ýÅ$%$ú Y÷ÁÙþ·J%$ý­$J?H%$HGüöõû Ûü%ŒÃý=H$%$%HÈF !;+AEIMcy"'&'&4767632"'&'&476762"'&'&4767632!'!%3"'&'&4767632"'&'&5476762±$$%þÎ$HþÒ$%$ú Y÷ÁÙþ·J%$ý­$J?H%$ JHHGüöõû Ûü%ŒÃý=H$%$%H ÈF !;)>SW[_t‰476762"'&'&476762"'&'$476762"'&'476762"'&'&!'!%3"'&'&4767632"'&'&476762'HIIHýÞHIIHø Y÷ÁÙþ·I%$ý­$IÌ$IýéI%$I%$S$IüŸõû Ûü%ŒÃý=HIIH ÈF !;+AWnrvz¦476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3"'&'&4767632"'&'&5476762'H$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙþ·J%$ý­$JÌ$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=H$%$%H ÈF !;*@Uiƒ‡‹¡·"'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3"'&'&4767632"'&'&5476762¤$H%$HþÍJ&$UJHJHý~J&$ú Y÷ÁÙþ·J%$ý­$JRHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=H$%$%HÈF !;+AEIM"'&'&4767632%"'&'&4767632"'&'&5476762!'!%3rJ%$þ¶$$%þÒ$Jþm Y÷ÁÙ@H$%ùJI $%Hüôõû Ûü%ŒÃý=ÈF !;+AX\`d"'&'&4767632%"'&'&4767632"'&'&54767624767632"'&'&!'!%3rJ%$þ¶$$%þÒ$JÕ&$Iù˜ Y÷ÁÙ@H$%ùJI $%H$$%ý¨õû Ûü%ŒÃý=ÈF !;+AXnrvz"'&'&4767632%"'&'&4767632"'&'&5476762"'&'&4767632"'&'&4767632!'!%3rJ%$þ¶$$%þÒ$JV$$%ýÅ$%$ú Y÷ÁÙ@H$%ùJI $%HýíH%$HGüöõû Ûü%ŒÃý= ÈF !;+AXmƒ‡‹"'&'&4767632%"'&'&4767632"'&'&5476762"'&'&4767632"'&'&476762"'&'&4767632!'!%3rJ%$þ¶$$%þÒ$JV$$%þÎ$HþÒ$%$ú Y÷ÁÙ@H$%ùJI $%HýíH%$ JHHGüöõû Ûü%ŒÃý= ÈF !;+AWmƒ™¡¥"'&'&4767632%"'&'&4767632"'&'&5476762%476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&!'!%3rJ%$þ¶$$%þÒ$JÌH$%$%HýÞH$%$%Hø Y÷ÁÙ@H$%ùJI $%Hz$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý= ÈF !;+AWmƒ™°´¸¼"'&'&4767632%"'&'&4767632"'&'&5476762%476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3rJ%$þ¶$$%þÒ$JÌH$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙ@H$%ùJI $%Hz$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý= ÈF !;+AVl‚—«ÁÅÉÍ"'&'&4767632%"'&'&4767632"'&'&5476762!"'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3rJ%$þ¶$$%þÒ$JI$H%$HþÍJ&$UJHJHý~J&$ú Y÷ÁÙ@H$%ùJI $%HHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=ÈF !;)>SW[_476762"'&'&476762"'&'$476762"'&'476762"'&'&!'!%3ÁHIIHýÞHIIHüõ Y÷ÁÙÌ$IýéI%$I%$S$IüŸõû Ûü%ŒÃý=ÈF !;!6K`u4767632"'&'&!'!%3476762"'&'&476762"'&'$476762"'&'476762"'&'&0&$Iù˜ Y÷ÁÙüHIIHýÞHIIHÃ$Iý¨õû Ûü%ŒÃý=m$IýéI%$I%$S$I ÈF !;,048Ndz"'&'&4767632"'&'&4767632!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&±$$%ýÅ$%$ú Y÷ÁÙüH$%$%HýÞH$%$%H?H%$HGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$J ÈF !;+AEIMcy¥"'&'&4767632"'&'&476762"'&'&4767632!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&±$$%þÎ$HþÒ$%$ú Y÷ÁÙüH$%$%HýÞH$%$%H?H%$ JHHGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$J ÈF !;+AW[_cy¥»476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&'H$%$%HýÞH$%$%Hø Y÷ÁÙüH$%$%HýÞH$%$%HÌ$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=m$JýéJ%$J%$S$J ÈF !;+AWnrvz¦¼Ò476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&'H$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙüH$%$%HýÞH$%$%HÌ$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=m$JýéJ%$J%$S$J ÈF !;*@Uiƒ‡‹¡·Íã"'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&¤$H%$HþÍJ&$UJHJHý~J&$ú Y÷ÁÙüH$%$%HýÞH$%$%HRHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=m$JýéJ%$J%$S$JÈF !; !7Mcy7!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&È Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JHFõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$% ÈF !;"8Ndz4767632"'&'&!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&0&$Iù˜ Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JHÃ$$%ý¨õû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$% ÈF !;,048Ndz¦"'&'&4767632"'&'&4767632!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&±$$%ýÅ$%$ú Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JH?H%$HGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$% ÈF !;+AEIMcy¥»"'&'&4767632"'&'&476762"'&'&4767632!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&±$$%þÎ$HþÒ$%$ú Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JH?H%$ JHHGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$% ÈF !;+AW[_cy¥»Ñ476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&'H$%$%HýÞH$%$%Hø Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JHÌ$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$% ÈF !;+AWnrvz¦¼Òè476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&'H$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JHÌ$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%ÈF !;*@Uiƒ‡‹¡·Íãù"'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&¤$H%$HþÍJ&$UJHJHý~J&$ú Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JHRHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$% ÈF !; ":Pf|’7!'!%3"'&'&54767632"'&'&54767632 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632È Y÷ÁÙý„$$%%$$%þÍJ%$0$H%$Hý•J%$Fõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H ÈF !;"9Qg}“©4767632"'&'&!'!%3"'&'&54767632"'&'&54767632 "'&'&4767632"'&'&'476762"'&'.76762"'&'&547676320&$Iù˜ Y÷ÁÙý„$$%%$$%þÍJ%$0$H%$Hý•J%$Ã$$%ý¨õû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H ÈF !;,048Og}“©¿"'&'&4767632"'&'&4767632!'!%3"'&'&54767632"'&'&54767632 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632±$$%ýÅ$%$ú Y÷ÁÙý„$$%%$$%þÍJ%$0$H%$Hý•J%$?H%$HGüöõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H ÈF !;+AEIMd|’¨¾Ô"'&'&4767632"'&'&476762"'&'&4767632!'!%3"'&'&54767632"'&'&54767632 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632±$$%þÎ$HþÒ$%$ú Y÷ÁÙý„$$%%$$%þÍJ%$0$H%$Hý•J%$?H%$ JHHGüöõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H ÈF !;+AW[_cz’¨¾Ôê476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&!'!%3"'&'&54767632"'&'&54767632 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632'H$%$%HýÞH$%$%Hø Y÷ÁÙý„$$%%$$%þÍJ%$0$H%$Hý•J%$Ì$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%HÈF !;+AWnrvz‘©¿Õë476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3"'&'&54767632"'&'&54767632 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632'H$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙý„$$%%$$%þÍJ%$0$H%$Hý•J%$Ì$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%HÈF !;*@Uiƒ‡‹¡·Ìáö "'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3"'&'&5476762"'&'&5476762 "'&'&4767632"'&'.76762"'&'.76762"'&'&4767632¤$H%$HþÌI&$UIHIHý}I&$ú Y÷ÁÙý„$I%$IþÌI%$0$H%$Hý”I%$RHIýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=ò%$Iýï&$IHIIHýîHIIHÈþ½m!5!!áÃü$õû fö§Èþ½m !!7!!!!Èõû Ûü%ŒÃý=mö§?ü'Èþ½m"2#"'&'&47676!!7!!!!E$$%ý¨õû Ûü%ŒÃý=&$Ihö§?ü'Èþ½m+/37476762#"'&'&476762"'&'&!!7!!!!ÁH%$HGüöõû Ûü%ŒÃý=|$I;$%$øö§?ü'Èþ½m+AEIM476762#"'&'&476762"'&'&476762"'&'&!!7!!!!ÁH%$ JHHGüöõû Ûü%ŒÃý=|$$%2$H.$%$øö§?ü'Èþ½m+AW[_c2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!N$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=H$%ýî$%H"H$%ýþ$%Hqö§?ü'Èþ½m+AWnrvz2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676!!7!!!!N$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=H$%ýî$%H"H$%ýþ$%H &$Ihö§?ü' Èþ½m*@Uiƒ‡‹%476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!ÔHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=‘$H%$H3J&$ý«JHJH‚J&$äö§?ü'Èþ½m!2#"'&'&47676!!7!!!!E$$%ý¨õû Ûü%ŒÃý=kJHö§?ü'Èþ½m,0482#"'&'&476762#"'&'&47676!!7!!!!E$$%%$$%ý¨õû Ûü%ŒÃý=iJHûœ&$Ihö§?ü'Èþ½m,BFJN2#"'&'&47676476762#"'&'&476762"'&'&!!7!!!!E$$%þ¡H%$HGüöõû Ûü%ŒÃý=kJHú$$%;$%$øö§?ü'Èþ½m,AW[_c2#"'&'&47676476762#"'&'&476762"'&'&476762"'&'&!!7!!!!E$$%þ¡H%$ JHHGüöõû Ûü%ŒÃý=kJHú$$%2$H.$%$øö§?ü'Èþ½m+AWmquy2#"'&'&476762"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!E$$%.$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=kJHü£H$%ýî$%H"H$%ýþ$%Hqö§?ü' Èþ½m+AWm„ˆŒ2#"'&'&476762"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676!!7!!!!E$$%.$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=kJHü£H$%ýî$%H"H$%ýþ$%H &$Ihö§?ü' Èþ½m*@Vk•™¡2#"'&'&47676476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!E$$%´HJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=kJHû&$H%$H3J&$ý«JHJH‚J&$äö§?ü'Èþ½m+/37476762#"'&'4767632"'&'&!!7!!!!ÂH$%$%Hüôõû Ûü%ŒÃý=ÃJ%$S$J“ö§?ü'Èþ½m"8N2#"'&'&47676!!7!!!!476762#"'&'4767632"'&'&E$$%ý¨õû Ûü%ŒÃý=H$%$%H&$Ihö§?ü'IJ%$S$JÈþ½m,048Nd476762#"'&'&476762"'&'&!!7!!!!476762#"'&'4767632"'&'&ÁH%$HGüöõû Ûü%ŒÃý=H$%$%H|$$%;$%$øö§?ü'IJ%$S$JÈþ½m+AEIMcy476762#"'&'&476762"'&'&476762"'&'&!!7!!!!476762#"'&'4767632"'&'&ÁH%$ JHHGüöõû Ûü%ŒÃý=H$%$%H|$$%2$H.$%$øö§?ü'IJ%$S$J Èþ½m+AW[_cy2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!476762#"'&'4767632"'&'&N$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=H$%$%HH$%ýî$%H"H$%ýþ$%Hqö§?ü'IJ%$S$J Èþ½m+AWnrvz¦2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676!!7!!!!476762#"'&'4767632"'&'&N$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=H$%$%HH$%ýî$%H"H$%ýþ$%H &$Ihö§?ü'IJ%$S$J Èþ½m*@Uiƒ‡‹¡·%476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!476762#"'&'4767632"'&'&ÔHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=H$%$%H‘$H%$H3J&$ý«JHJH‚J&$äö§?ü'IJ%$S$JÈþ½m+AEIM476762#"'&'476762"'&'&4767632"'&'&!!7!!!!ÂH$%ùJI $%Hüôõû Ûü%ŒÃý=ÃJ%$J$$%.$J“ö§?ü'Èþ½m+AX\`d476762#"'&'476762"'&'&4767632"'&'&2#"'&'&47676!!7!!!!ÂH$%ùJI $%H$$%ý¨õû Ûü%ŒÃý=ÃJ%$J$$%.$Jû+&$Ihö§?ü'Èþ½m+AXnrvz476762#"'&'476762"'&'&4767632"'&'&476762#"'&'&476762"'&'&!!7!!!!ÂH$%ùJI $%HýíH%$HGüöõû Ûü%ŒÃý=ÃJ%$J$$%.$Jùª$$%;$%$øö§?ü' Èþ½m+AXmƒ‡‹476762#"'&'476762"'&'&4767632"'&'&476762#"'&'&476762"'&'&476762"'&'&!!7!!!!ÂH$%ùJI $%HýíH%$ JHHGüöõû Ûü%ŒÃý=ÃJ%$J$$%.$Jùª$$%2$H.$%$øö§?ü' Èþ½m+AWmƒ™¡¥476762#"'&'476762"'&'&4767632"'&'&2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!ÂH$%ùJI $%Hz$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=ÃJ%$J$$%.$Jü4H$%ýî$%H"H$%ýþ$%Hqö§?ü' Èþ½m+AWmƒ™°´¸¼476762#"'&'476762"'&'&4767632"'&'&2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676!!7!!!!ÂH$%ùJI $%Hz$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=ÃJ%$J$$%.$Jü4H$%ýî$%H"H$%ýþ$%H &$Ihö§?ü' Èþ½m+AVl‚—«ÁÅÉÍ476762#"'&'476762"'&'&4767632"'&'&476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!ÂH$%ùJI $%HHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=ÃJ%$J$$%.$Jú·$H%$H3J&$ý«JHJH‚J&$äö§?ü'Èþ½m)>SW[_2"'&'&476762#"'&'&47672#"'&'&47672"'&'&47676!!7!!!!N$IýéI%$I%$S$IüŸõû Ûü%ŒÃý=tHIýîIH"HIýþIH ö§?ü'Èþ½m!6K`u2"'&'&47676!!7!!!!2"'&'&476762#"'&'&47672#"'&'&47672"'&'&47676E$Iý¨õû Ûü%ŒÃý=m$IýéI%$I%$S$I&$Ihö§?ü'úHIýîIH"HIýþIH Èþ½m,048Ndz476762#"'&'&476762"'&'&!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676ÁH%$HGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$J|$$%;$%$øö§?ü'úH$%ýî$%H"H$%ýþ$%H Èþ½m+AEIMcy¥476762#"'&'&476762"'&'&476762"'&'&!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676ÁH%$ JHHGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$J|$$%2$H.$%$øö§?ü'úH$%ýî$%H"H$%ýþ$%H Èþ½m+AW[_cy¥»2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676N$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=m$JýéJ%$J%$S$JH$%ýî$%H"H$%ýþ$%Hqö§?ü'úH$%ýî$%H"H$%ýþ$%H Èþ½m)>SimquŠŸ´É2"'&'&476762#"'&'&47672#"'&'&47672"'&'&476762"'&'&47676!!7!!!!2"'&'&476762#"'&'&47672#"'&'&47672"'&'&47676N$IýéI%$I%$S$Iä$Iý¨õû Ûü%ŒÃý=m$IýéI%$I%$S$IHIýîIH"HIýþIH &$Ihö§?ü'úHIýîIH"HIýþIH Èþ½m*@Uiƒ‡‹¡·Íã%476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676ÔHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=m$JýéJ%$J%$S$J‘$H%$H3J&$ý«JHJH‚J&$äö§?ü'úH$%ýî$%H"H$%ýþ$%HÈþ½m !7Mcy!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676Èõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%mö§?ü'úH$%ýî$%H"H$%ýþ$%H JH Èþ½m"8Ndz2#"'&'&47676!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676E$$%ý¨õû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%&$Ihö§?ü'úH$%ýî$%H"H$%ýþ$%H JH Èþ½m+/37Lav‹ 476762#"'&'&476762"'&'&!!7!!!!2"'&'&476762#"'&'&47672#"'&'&47672"'&'&476762"'&'&47676ÁH%$HGüöõû Ûü%ŒÃý=m$IýéI%$I%$S$Iä$I|$I;$%$øö§?ü'úHIýîIH"HIýþIH JH Èþ½m+AEIMcy¥»476762#"'&'&476762"'&'&476762"'&'&!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676ÁH%$ JHHGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%|$$%2$H.$%$øö§?ü'úH$%ýî$%H"H$%ýþ$%H JH Èþ½m+AW[_cy¥»Ñ2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676N$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%H$%ýî$%H"H$%ýþ$%Hqö§?ü'úH$%ýî$%H"H$%ýþ$%H JH Èþ½m+AWnrvz¦¼Òè2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676N$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%H$%ýî$%H"H$%ýþ$%H &$Ihö§?ü'úH$%ýî$%H"H$%ýþ$%H JHÈþ½m*@Uiƒ‡‹¡·Íãù%476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676ÔHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%‘$H%$H3J&$ý«JHJH‚J&$äö§?ü'úH$%ýî$%H"H$%ýþ$%H JH Èþ½m ":Pf|’!!7!!!!4767632"'&'&%4767632#"'&'&476762"'&'4767672"'&'&%4767>#"'&'&4767632'&'Èõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%Hmö§?ü'|$$%%$$%3J%$ýÐ$H%$HkJ%$ Èþ½m"9Qg}“©2#"'&'&47676!!7!!!!4767632"'&'&%4767632#"'&'&476762"'&'4767672"'&'&%4767>#"'&'&4767632'&'E$$%ý¨õû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H&$Ihö§?ü'|$$%%$$%3J%$ýÐ$H%$HkJ%$ Èþ½m,048Og}“©¿476762#"'&'&476762"'&'&!!7!!!!4767632"'&'&%4767632#"'&'&476762"'&'4767672"'&'&%4767>#"'&'&4767632'&'ÁH%$HGüöõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H|$$%;$%$øö§?ü'|$$%%$$%3J%$ýÐ$H%$HkJ%$ Èþ½m+AEIMd|’¨¾Ô476762#"'&'&476762"'&'&476762"'&'&!!7!!!!4767632"'&'&%4767632#"'&'&476762"'&'4767672"'&'&%4767>#"'&'&4767632'&'ÁH%$ JHHGüöõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H|$$%2$H.$%$øö§?ü'|$$%%$$%3J%$ýÐ$H%$HkJ%$ Èþ½m+AW[_cz’¨¾Ôê2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!4767632"'&'&%4767632#"'&'&476762"'&'4767672"'&'&%4767>#"'&'&4767632'&'N$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%HH$%ýî$%H"H$%ýþ$%Hqö§?ü'|$$%%$$%3J%$ýÐ$H%$HkJ%$Èþ½m)>Simqu‹¡¶Ëàõ2"'&'&476762#"'&'&47672#"'&'&47672"'&'&476762"'&'&47676!!7!!!!4767632"'&'&%4767632"'&'&476762'&'4767>"'&'&%4767>"'&'&476762'&'N$IýéI%$I%$S$Iä$Iý¨õû Ûü%ŒÃý=ò%$Iýï&$IHIIHýîHIIHHIýîIH"HIýþIH &$Ihö§?ü'|$I%$I4I%$ýÐ$H%$HlI%$Èþ½m*@Uiƒ‡‹¡·Ìáö %476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!4767632"'&'&%4767632"'&'&476762'&'4767>"'&'&%4767>"'&'&476762'&'ÔHIýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=ò%$Iýï&$IHIIHýîHIIH‘$H%$H4I&$ý«IHIHƒI&$äö§?ü'|$I%$I4I%$ýÐ$H%$HlI%$Èþgm "3!254#%!2#!"54!¸xx¿xxûA¿ððûAð,Gõxø‡xxyxxðø‡ððyð÷ÓøÿÈþgm$03;#"'##65##"5476"3!254#%!2#!"54!3#'!#×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðK† Òš „Dþ¶D„yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðþ¬þUü¼ÚÚÈþgm$0I#"'##65##"5476"3!254#%!2#!"54!!56754&#"5>32×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðž¨ýª"?XhU4zHM…9‘®þµ8yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðü?rn81^BQ##{„l‹þä0Èþgm$0Y#"'##65##"5476"3!254#%!2#!"54#"&'532654&+532654&#"5>32×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðš\e¾±9}F4wCmxolV^^ad_(fQI€7©Zyþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðý‘mR|†yOFJLl?<:=svcE`Èþgm$03>#"'##65##"5476"3!254#%!2#!"54 !33##5!5×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðŽþË5¦‡‡þbyþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðþ—þ]ýämººyÈþgm$0Q#"'##65##"5476"3!254#%!2#!"54!!67632#"&'53264&#"×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðþþy¡^^a`°<~B9>>Eo‚‚o4h6yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðð_Ì MLƒ‡KJq f®fÈþgm$0@`#"'##65##"5476"3!254#%!2#!"54"327654'&&'&#"67632#"&547632×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðGX3333XW3333«1221€DD &9:D‘TTXW‘§°ll¶122yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðýž45[Z4554Z[54bg KL™1LM„ONÞÔÆuv Èþgm$07#"'##65##"5476"3!254#%!2#!"54!#!×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAððiþ¤ˆHþ3yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðð0üíäÈþgm$0=[j#"'##65##"5476"3!254#%!2#!"54"32764'%&'&546 #"'&54767327654'&"×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAð—º55j]\655þìT./¤RQ./SZ85UVžŸUV56-/.UQ100/¦0/yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðý[,+KLV,+–+]12Hdt::dJ01:7PyAAAAyN98Æ?&%%$A?&%%$Èþgm$0P_#"'##65##"5476"3!254#%!2#!"54532767#"&547632#"'&2654'&#"×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAð.1220DC #<9E¨WX‘§WXkl¶122ÌXf33XU5443yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðûßg KKš/˜„MNooÔÆuv rh\Z4554Z\44Èþgm$0>JQ#"'##65##"5476"3!254#%!2#!"54"27654/2#"&546573×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðêŽ2332Ž233yƒªªƒ¢ŒŒþt…Œ‰yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðþÈVV¬­VVVV­¬V¯ÞÓÔÞÞÔÓÞü¬Ñ)t'ü½Èþgm$0=#"'##65##"5476"3!254#%!2#!"543+53265×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAð²A@1(TFyþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyððýÜ•FE`TlÈþgm$0J#"'##65##"5476"3!254#%!2#!"54#"&54632.#"3267×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAð<1e9µÈÉ´9f0/j6||{}7j.yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðûëãÎÍåt"$ª¬««$"Èþgm4@L"#"&54632&#"32#"'##65##"5476"3!254#%!2#!"54ûž›œžŸœVX~_ Ua`UU`a”A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAð,×ÚÛ××Û¥É(j8€pžžþžnyþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðÈþgm$0;#"'##65##"5476"3!254#%!2#!"5433 ##×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAððj¤þi¸§þxyþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyððþŸaþzþB“þmÈþgm!-0867632 &547632"3!254#%!2#!"54!3#'!#Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðK† Òš „Dþ¶D„¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðþ¬þUü¼ÚÚÈþgm!-F67632 &547632"3!254#%!2#!"54!!56754&#"5>32Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðž¨ýª"?XhU4zHM…9‘®þµ8¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðü?rn81^BQ##{„l‹þä0Èþgm!-V67632 &547632"3!254#%!2#!"54#"&'532654&+532654&#"5>32Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðš\e¾±9}F4wCmxolV^^ad_(fQI€7©Z¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðý‘mR|†yOFJLl?<:=svcE`Èþgm!-0;67632 &547632"3!254#%!2#!"54 !33##5!5Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðŽþË5¦‡‡þb¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðþ—þ]ýämººyÈþgm!-N67632 &547632"3!254#%!2#!"54!!67632#"&'53264&#"Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðþþy¡^^a`°<~B9>>Eo‚‚o4h6¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðð_Ì MLƒ‡KJq f®fÈþgm!-=]67632 &547632"3!254#%!2#!"54"327654'&&'&#"67632#"&547632Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðGX3333XW3333«1221€DD &9:D‘TTXW‘§°ll¶122¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðýž45[Z4554Z[54bg KL™1LM„ONÞÔÆuv Èþgm!-467632 &547632"3!254#%!2#!"54!#!Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAððiþ¤ˆHþ3¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðð0üíäÈþgm!-:Xg67632 &547632"3!254#%!2#!"54"32764'%&'&546 #"'&54767327654'&"Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAð—º55j]\655þìT./¤RQ./SZ85UVžŸUV56-/.UQ100/¦0/¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðý[,+KLV,+–+]12Hdt::dJ01:7PyAAAAyN98Æ?&%%$A?&%%$Èþgm!-M\67632 &547632"3!254#%!2#!"54532767#"&547632#"'&2654'&#"Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAð.1220DC #<9E¨WX‘§WXkl¶122ÌXf33XU5443¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðûßg KKš/˜„MNooÔÆuv rh\Z4554Z\44Èþgm!-;GN67632 &547632"3!254#%!2#!"54"27654/2#"&546573Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðêŽ2332Ž233yƒªªƒ¢ŒŒþt…Œ‰¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðþÈVV¬­VVVV­¬V¯ÞÓÔÞÞÔÓÞü¬Ñ)t'ü½Èþgm!-:67632 &547632"3!254#%!2#!"543+53265Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAð²A@1(TF¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyððýÜ•FE`TlÈþgm!-G67632 &547632"3!254#%!2#!"54#"&54632.#"3267Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAð<1e9µÈÉ´9f0/j6||{}7j.¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðûëãÎÍåt"$ª¬««$"Ùþxm1=I"#"&54632&#"3267632 &547632"3!254#%!2#!"54ûž›œžŸœVX~_ Ua`UU`a‰7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAð,×ÚÛ××Û¥É(j8€pžžþžþ0v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðÈþgm!-867632 &547632"3!254#%!2#!"5433 ##Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAððj¤þi¸§þx¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyððþŸaþzþB“þmÈþgm!)0 00"3!254#%!2#!"54!3#'!#ʘþhþfþˆxx¿xxûA¿ððûAðK† Òš „Dþ¶D„ùýòýú xø‡xxyxxðø‡ððyðþ¬þUü¼ÚÚÈþgm70 00"3!254#%!2#!"54!!56754&#"5>32ʘþhþfþˆxx¿xxûA¿ððûAðž¨ýª"?XhU4zHM…9‘®þµ8ùýòýú xø‡xxyxxðø‡ððyðü?rn81^BQ##{„l‹þä0ÈþgmG0 00"3!254#%!2#!"54#"&'532654&+532654&#"5>32ʘþhþfþˆxx¿xxûA¿ððûAðš\e¾±9}F4wCmxolV^^ad_(fQI€7©Zùýòýú xø‡xxyxxðø‡ððyðý‘mR|†yOFJLl?<:=svcE`Èþgm!,0 00"3!254#%!2#!"54 !33##5!5ʘþhþfþˆxx¿xxûA¿ððûAðŽþË5¦‡‡þbùýòýú xø‡xxyxxðø‡ððyðþ—þ]ýämººyÈþgm?0 00"3!254#%!2#!"54!!67632#"&'53264&#"ʘþhþfþˆxx¿xxûA¿ððûAðþþy¡^^a`°<~B9>>Eo‚‚o4h6ùýòýú xø‡xxyxxðø‡ððyðð_Ì MLƒ‡KJq f®fÈþgm.N0 00"3!254#%!2#!"54"327654'&&'&#"67632#"&547632ʘþhþfþˆxx¿xxûA¿ððûAðGX3333XW3333«1221€DD &9:D‘TTXW‘§°ll¶122ùýòýú xø‡xxyxxðø‡ððyðýž45[Z4554Z[54bg KL™1LM„ONÞÔÆuv Èþgm%0 00"3!254#%!2#!"54!#!ʘþhþfþˆxx¿xxûA¿ððûAððiþ¤ˆHþ3ùýòýú xø‡xxyxxðø‡ððyðð0üíäÈþgm+IX0 00"3!254#%!2#!"54"32764'%&'&546 #"'&54767327654'&"ʘþhþfþˆxx¿xxûA¿ððûAð—º55j]\655þìT./¤RQ./SZ85UVžŸUV56-/.UQ100/¦0/ùýòýú xø‡xxyxxðø‡ððyðý[,+KLV,+–+]12Hdt::dJ01:7PyAAAAyN98Æ?&%%$A?&%%$Èþgm>M0 00"3!254#%!2#!"54532767#"&547632#"'&2654'&#"ʘþhþfþˆxx¿xxûA¿ððûAð.1220DC #<9E¨WX‘§WXkl¶122ÌXf33XU5443ùýòýú xø‡xxyxxðø‡ððyðûßg KKš/˜„MNooÔÆuv rh\Z4554Z\44Èþgm,8?0 00"3!254#%!2#!"54"27654/2#"&546573ʘþhþfþˆxx¿xxûA¿ððûAðêŽ2332Ž233yƒªªƒ¢ŒŒþt…Œ‰ùýòýú xø‡xxyxxðø‡ððyðþÈVV¬­VVVV­¬V¯ÞÓÔÞÞÔÓÞü¬Ñ)t'ü½Èþgm+0 00"3!254#%!2#!"543+53265ʘþhþfþˆxx¿xxûA¿ððûAð²A@1(TFùýòýú xø‡xxyxxðø‡ððyððýÜ•FE`TlÈþgm80 00"3!254#%!2#!"54#"&54632.#"3267ʘþhþfþˆxx¿xxûA¿ððûAð<1e9µÈÉ´9f0/j6||{}7j.ùýòýú xø‡xxyxxðø‡ððyðûëãÎÍåt"$ª¬««$"Èþgm".:0 00"#"&54632&#"32"3!254#%!2#!"54ʘþhþf5ž›œžŸœVX~_ Ua`UU`aþuxx¿xxûA¿ððûAðùýòýúA×ÚÛ××Û¥É(j8€pžžþžoxø‡xxyxxðø‡ððyðÈþgm)0 00"3!254#%!2#!"5433 ##ʘþhþfþˆxx¿xxûA¿ððûAððj¤þi¸§þxùýòýú xø‡xxyxxðø‡ððyððþŸaþzþB“þmÈþgm !! !"3!254#%!2#!"54ŽÑþ‰þ‰þ‡þ‰Ðþ0xx¿xxûA¿ððûAð1þGþïþGþï¹}xø‡xxyxxðø‡ððyðÈþgm#/;>F65'&'&547632&54 632'"3!254#%!2#!"54!3#'!#U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðK† Òš „Dþ¶D„üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðþ¬þUü¼ÚÚÈþgm#/;T65'&'&547632&54 632'"3!254#%!2#!"54!!56754&#"5>32U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðž¨ýª"?XhU4zHM…9‘®þµ8üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðü?rn81^BQ##{„l‹þä0Èþgm#/;d65'&'&547632&54 632'"3!254#%!2#!"54#"&'532654&+532654&#"5>32U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðš\e¾±9}F4wCmxolV^^ad_(fQI€7©ZüLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðý‘mR|†yOFJLl?<:=svcE`Èþgm#/;>I65'&'&547632&54 632'"3!254#%!2#!"54 !33##5!5U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðŽþË5¦‡‡þbüLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðþ—þ]ýämººyÈþgm#/;\65'&'&547632&54 632'"3!254#%!2#!"54!!67632#"&'53264&#"U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðþþy¡^^a`°<~B9>>Eo‚‚o4h6üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðð_Ì MLƒ‡KJq f®fÈþgm#/;Kk65'&'&547632&54 632'"3!254#%!2#!"54"327654'&&'&#"67632#"&547632U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðGX3333XW3333«1221€DD &9:D‘TTXW‘§°ll¶122üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðýž45[Z4554Z[54bg KL™1LM„ONÞÔÆuv Èþgm#/;B65'&'&547632&54 632'"3!254#%!2#!"54!#!U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAððiþ¤ˆHþ3üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðð0üíäÈþgm#/;Hfu65'&'&547632&54 632'"3!254#%!2#!"54"32764'%&'&546 #"'&54767327654'&"U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAð—º55j]\655þìT./¤RQ./SZ85UVžŸUV56-/.UQ100/¦0/üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðý[,+KLV,+–+]12Hdt::dJ01:7PyAAAAyN98Æ?&%%$A?&%%$Èþgm#/;[j65'&'&547632&54 632'"3!254#%!2#!"54532767#"&547632#"'&2654'&#"U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAð.1220DC #<9E¨WX‘§WXkl¶122ÌXf33XU5443üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðûßg KKš/˜„MNooÔÆuv rh\Z4554Z\44Èþgm#/;IU\65'&'&547632&54 632'"3!254#%!2#!"54"27654/2#"&546573U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðêŽ2332Ž233yƒªªƒ¢ŒŒþt…Œ‰üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðþÈVV¬­VVVV­¬V¯ÞÓÔÞÞÔÓÞü¬Ñ)t'ü½Èþgm#/;H65'&'&547632&54 632'"3!254#%!2#!"543+53265U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAð²A@1(TFüLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyððýÜ•FE`TlÈþgm#/;U65'&'&547632&54 632'"3!254#%!2#!"54#"&54632.#"3267U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAð<1e9µÈÉ´9f0/j6||{}7j.üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðûëãÎÍåt"$ª¬««$"Èþgm#/;MW65'&'&547632&54 632'"3!254#%!2#!"54"#"&54632&#"32U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAð3ž›œžŸœVX~_ Ua`UU`aüLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðû¿×ÚÛ××Û¥É(j8€pžžþžÈþgm#/;F65'&'&547632&54 632'"3!254#%!2#!"5433 ##U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAððj¤þi¸§þxüLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyððþŸaþzþB“þmÈþgm +!%%!%%"3!254#%!2#!"54dþ¼ecþ»b­²þ¸`þ‰þ‡bþ·³þMxx¿xxûA¿ððûAðnþξþ;¾3¾õþo(þâþTßߨ"(Uxø‡xxyxxðø‡ððyð™ÿj¿V#+3·462"7"32654$"&462"32654462"6"&4622>7>54&'&'>54&#"&547&"'654.#"'72>32%%"&''%&/'%.547&54632æB\BB\t- .¯B\BB\, -þo  ì  ¡lN. † ;qsV6C70AIbbOS‚C‚*¨*‚C‚SObbIA07C6Vsq; † .8˜L+Ê‹­]œKƒ˜YŸýìûþ ©ú© þ ûýìŸY˜ƒKœ]­‹Ê+8ggg‚=>ugggÜ=>ý"6''6']6''6'à$9]W>:ûLkt“LJ˜73(#ƒXQik¤\B?&STTS&?B\¤kiQXƒ#(37˜JL“tkLûþÆ>W]9†¾·ŒŠr¬ÈlÈ¡~3D#®@¬mŠŠm¬@®#D3~¡ÈlȬrŠŒ·¾† Kÿj -Š "(,Ž™Ÿý"&4632'2654#"3#"&46327'7#5%32767654'&'7>732>7>54'.#"&$ &/.#"3276%2654#"'747'&'#".'.54>7>32676 767>32+"&'&'&'&'& '326y2>=32>=-5nnI3=>23=>ûS3Å9?*”nýÒB?94±‹iE€B9?B  R' 8%/6 1.4&++ #?Y=þ÷þ¾þ÷=Y?# ++&4.1 6/%8 'R  -íª*?9ÅúË 9 !;+57? B:),#3‡A32%A(7¤¤¤7(A%23A‡3#,):B ?75+;! 9 "`  B6ˆÄˆ6B  _# 4aþºa7k~Ñn‚nn‚nAÔÒ‹n‚nn‚nµ-Úº”ýMÒÒ“v$DK;7" D;KD$v h5WM' 1 *L7.4(#"NƒemmeƒN"#(4.7L* 1 'MW5hNAš»”ºÚûï*,PÝI  ,9 :kR4_5"2S''RNNR''S2"5_4Rk: 9,  IÝP,*0(sBD0H.&&.H0DBs(þà$'&=ÿj(2AN¸7327327#"'#""'72#"'&547632">7&>32#"'&327654'&#"654.'&'&#"&'%% 767%767%7&54>76?62>?''! '&'7&''¦\E[:TT:[E\lJDEI¸>zÂz>Z†þü+Q (F65/AFeN$0+E¸dFB/56F( Qy 0( ,@“ *ó™t›t™ó* B þ¿þág¤µ굤gþáþÀ úÀ &<ý]iâi]ý;& l m nmuÃÙþàþßÙÁvmmm Œb@,,@bd¨x==x.L #$-G0,a&0$4%Ca,0G-$#  ;§‚t.f>v¡§:ÄÄ:§¡rAe.t‚+B,E@y>zçw„„wçz>y9L,B=|9jwA“uŒ: ‰a a‰ :Œu“Awj9|BQW.>.þ÷ŽžžŒ .>.QWB ªÿj– %1;Gh˜ª¼462"7"32654"547632"&462432#"'&"3265473267!"& 7654'>54'&#".#" 632+ '.'&'#"&'&'&54632676&#";67&%32767654&'&#"RtRRt‘78,%,% RtRRtþÿ%,%,78üãj‚Î`´;j¨þî€êŠÀ¥|TVZ‚GqpG‚ZVT|Ðj7aij "†Y:8«m”þà”m«8:Y†" jiaÖ (+G&<5t5<&G+( tRRtRh11þR $ $ tRRtRþ$ $k11ý¨T¤XLTÖrþÞËš¸†•,0^1ŠioE55EoiŠ1^0,•†¸š¤|ˆ›¤‡,6[?Ki{pn­7LL7­np{iK?[6,‡¤›ˆ|ýÌR:3—/‡{W``W{‡/—3:R ªÿj­n ".49>BF4632#"&%462#"&! ! ! ! ! 67##%67#5#‚Q;:RR:;QBRtSS:;Qüm¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýòÛþ•ýüþ”²XL¤ˆ¤L Hdý eÿ;QQ;:SS:;QQ;:SSÛþÄþC½<=Àþ@þÃuýñþ‹þŒýô jþþþ–jß *%þ¦ZþÛ*™Rd¸¸f ªÿj­n #/5:?CG! ! ! ! 462#4&"!462#4&"! 67##%67#5#1¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò¼ŒÄŒ‡=T=ý)ŒÄŒ‡=T=ßÛþ•ýüþ”²XL¤ˆ¤L Hdý eêþÄþC½<=Àþ@þÃuýñþ‹þŒýô ‹ÅÅ‹SwwS‹ÅÅ‹SwwS¬þþþ–jß *%þ¦ZþÛ*™Rd¸¸f _ÿjùn #/Y~5#67##67#%! 462#4&"!462#4&"! "'&/! &"&5476?&7! 4'#"'&/&'&! 6?"'462#4&"!462#4&"! ! ! ! ! %!7276ŒÄŒ‡=T=Ɍȇ=T=û½tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAÛþ•ýüþ”BüW!\ŽÊÊŽ\Œ‹ÅÅ‹SwwS‹ÅÅ‹SwwS¢uýñþ‹þŒýô tþÄþC½<=Àþ@þ¹þþþ–j{u\ŽŽ\ªÿj­n #/;AJ"&547462#4&"!462#4&"! ! ! ! ! %!7276¨AL6û¯ŒÄŒ‡=T=Ɍȇ=T=û½tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAÛþ•ýüþ”BüW!\ŽÊÊŽ\,€8"+6,#5 ‹ÅÅ‹SwwS‹ÅÅ‹SwwS¢uýñþ‹þŒýô tþÄþC½<=Àþ@þ¹þþþ–j{u\ŽŽ\ªÿj­n %+3%%''7'7! ! ! ! ! %!$76|'MÆÆMþÙ þÙMÆÆMýõtu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAÛþ•ýüþ”BüW!\Ž”Ž\'În‹ŠnÎUUÎnŠ‹nýõuýñþ‹þŒýô tþÄþC½<=Àþ@þ¹þþþ–j{u\ŽŽ\ÿjÈc*5IW_7767 '&! /! '462#"&%4632#"&4$! ! 7&%654$! 6! &#"32s(“Ž's%2¶ýü¶2þï¿<=½Þåþ×þØæà”RtSS:;Qý¾Q;:RR:;Qþ €ýâýôþ‹þŒýòãþÛ¼þCþÃþÄþA½ôJKC°Þݰ°ÝÞÑG,&Ž',H92µµ3QþÄþC½<=à99à*;QQ;:SS:;QQvRS\†¾¾†‚\üþ¥þŒýô t[ü\6JQrrQJ6Ïõnnªÿj­0-9J%462#"&%4632#"&'7 767 '&! ! 6 %! 7Ò/MþÑ?RtSS:;Qý¾Q;:RR:;QMþÑMýÆs(Ž”Ž's%2¶ýü¶2þï¿<=½þCþÃþÄþAâ„*„»­ýôþ‹þŒýò®gÔoÕþ¼;QQ;:SS:;QQvRSìnÕoý>G,&ŽŽ',H92µµ3QþÄþC½<=Àþ@**ìýÐçþÑþŒýô t/ç0ªÿj­n'297 767 '&! ! ! ! 4632#"&-%s(Ž”Ž's%2¶ýü¶2þï¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýòØQ;:RR:;Qú'MÆÆMþÙÑG,&ŽŽ',H92µµ3QþÄþC½<=Àþ@þÃuýñþ‹þŒýô ‡;QQvRSdÎn‹ŠnΪÿj­n'3?7 767 '&462#4&"!462#4&"! ! ! ! s(Ž”Ž's%2¶ýü¶2,ŒÄŒ‡=T=Ɍȇ=T=û½tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAÑG,&ŽŽ',H92µµ3ó‹ÅÅ‹SwwS‹ÅÅ‹SwwS¢uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n 7CQ462#4&"!462#4&"!27&'# 3 536! ! ! 327674'&fŒÄŒ‡=T=ý)ŒÄŒ‡=T=þ”¿<ˆveA+-þþþ”‡”‡{7ÑþCþÃþÄþA‡tu ýôþ‹þŒýòO\&$ !Œ‹ÅÅ‹SwwS‹ÅÅ‹SwwS¢þÄþC)0ljÊþåÉÕ dcÚ3=Àþ@þÃuýñþ‹þŒýô 6C$(9.ªÿj­n'3?7 767 '&"&53265!"&53265! ! ! ! s(Ž”Ž's%2¶ýü¶2ŒÄŒ‡=T=þ7ŒÄŒ‡=T=ý?tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAÑG,&ŽŽ',H92µµ3ï‹ÅÅ‹SwwS‹ÅÅ‹SwwSþbuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n/;GW2#'&5&7633476!2367672#'&'476! ! ! ! 7 767 '&¦<2¨Ÿ> &?)   #ýI=#   )?& >Ÿ¨2<þtu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAìs(Ž”Ž's%2¶ýü¶2À%?A>ϾDLD 1GG1 DLD¾Ï>A?%þ*uýñþ‹þŒýô tþÄþC½<=Àþ@ýªG,&ŽŽ',H92µµ3ªÿj­n#3<! 4'#"&5"&=#! ! %7767 '&!&'&! 1¿<=½Tn¦ì¦¦ì¦nU‡tu ýôþ‹þŒýòss(“Ž's%2¶ýü¶2`”ÞþÂþÄàêþÄþC½<àOdŽŽddŽŽdO Ãuýñþ‹þŒýô [G,&Ž',H92µµ3;ààªÿj­n)5!!5!2767!! ! ! ! ˜ªûÔªlÊŽ's%2¶þþü~tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAŒ‡‡‡‡ý¬Ž',H92µ9uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n%15!4632#"&%462#"&! ! ! ! LÀüvQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAq‡‡Œ;QQvRS:;QQ;:SSÙuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n #5!!5!5!! ! ! ! ˜ªûÔªþŒÀúžtu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAŒ‡‡‡‡ý凇yuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n )7! ! ! ! 5!5!2#"&545!5!2#"&5451¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò¢Àüx:RR:;QVx:SS:;QêþÄþC½<=Àþ@þÃuýñþ‹þŒýô ‡‡-‡Q;:SS:‡Q;:SS:ªÿj­n *6B"&475!%7 '%4632#"&%462#"&! ! ! ! PA6L6ü=À þ¨MXûÝMXMþéQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþA¬€5O66O5þE‡‡¥ðoñnnñoþ¯;QQvRS:;QQ;:SS‘uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n'35!"&53265!"&53265! ! ! ! LÀ6ŒÄŒ‡=T=þ7ŒÄŒ‡=T=ý?tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAq‡‡‹ÅÅ‹SwwS‹ÅÅ‹SwwSþbuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n%1%'4632#"&%462#"&! ! ! ! •9g9ü†Q;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþA¬{–{»;QQvRS:;QQ;:SSÙuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­nB'! ! ! ! 7"'&'&#"'67623276762&É__ýZ¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýòåþò_š4) FÄF "58 yFÄF "54( FÄFy\__þ€þÄþC½<=Àþ@þÃuýñþ‹þŒýô æ_þòþWi"bc(!__9("bb("_i"bb"(9_ªÿj­n #/;4632#"&%462#"&7'7'7'! ! ! ! ‚Q;:RR:;QBRtSS:;QÎPA<<þýAPü´tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAÿ;QQ;:SS:;QQ;:SSþ$>NvX..XvN>#uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n")6BN2#'&5&76334764632#"&-%7'7'7'! ! ! ! j<2¨ž> &@(   "üVQ;:RR:;Qú'MÆÆMþÙ†PA<<þýAPü´tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþA¯%?A>ϾDLD 1GN;QQvRSdÎn‹ŠnÎþ>NvX..XvN>#uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n $0<462#4&"!462#4&"7'7'7'! ! ! ! ŒÄŒ‡=T=Ɍȇ=T=÷PA<<þýAPü´tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAŒ‹ÅÅ‹SwwS‹ÅÅ‹SwwSþ]>NvX..XvN>#uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n $0<7'7'7'"&53265!"&53265! ! ! ! öPA<<þýAPLŒÄŒ‡=T=þ7ŒÄŒ‡=T=ý?tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAé>NvX..XvN>Á‹ÅÅ‹SwwS‹ÅÅ‹SwwSþbuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n ".8>4632#"&%462#"&! ! ! ! %5!#"&5!#26‚Q;:RR:;QBRtSS:;Qüm¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò¢ÀòŒÄŒUÎ=T=ÿ;QQ;:SS:;QQ;:SSÛþÄþC½<=Àþ@þÃuýñþ‹þŒýô c‡‡‹ÅÅ‹Swwªÿj­n )394632#"&-%! ! ! ! %5!#"&5!#26‚Q;:RR:;Qú'MÆÆMþÙüµ¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò¢ÀòŒÄŒUÎ=T=ý;QQvRSdÎn‹ŠnÎèþÄþC½<=Àþ@þÃuýñþ‹þŒýô c‡‡‹ÅÅ‹Swwªÿj­n %/5! ! ! ! '7'7%%5!#"&5!#261¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò2þÙMÆÆMÇ'MÆÆMþÙýÐÀòŒÄŒUÎ=T=êþÄþC½<=Àþ@þÃuýñþ‹þŒýô ±UÎnŠ‹nÎÎn‹ŠnÎþ‡‡‹ÅÅ‹Swwªÿj­n)5F%7 '%4632#"&%462#"&! ! ! ! 676 &'&#&þ¨MXûÝMXMþéQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAì%2¶¶3$s(ŽÊÊŽ'ðoñnnñoþ¯;QQvRS:;QQ;:SS‘uýñþ‹þŒýô tþÄþC½<=Àþ@ý%83µµ38H,'ŽŽ',ªÿj­n"-9EV%'6762&'&"%7 '%4632#"&%462#"&! ! ! ! 676 &'&#&ÕyFÄFyT;þ¨MXûÝMXMþéQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAì%2¶¶3$s(ŽÊÊŽ'Ÿ9("bb"(9<<dðoñnnñoþ¯;QQvRS:;QQ;:SS‘uýñþ‹þŒýô tþÄþC½<=Àþ@ý%83µµ38H,'ŽŽ',ªÿj­n)5F'4632#"&%462#"&%! ! ! ! 676 &'&#&†MþÑMþ+Q;:RR:;QBRtSS:;Qþ/MþÑþ%tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAì%2¶¶3$s(ŽÊÊŽ'gnÕoÞ;QQvRS:;QQ;:SSìÔoÕýñuýñþ‹þŒýô tþÄþC½<=Àþ@ý%83µµ38H,'ŽŽ',ªÿj­n(,7BFV676 &'&#&! ! ! ! %462#"&%4632#"&''6762&'&"%2¶¶3$s(ŽÊÊŽ'þ¡¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò(/MþÑ?RtSS:;Qý¾Q;:RR:;QMþÑM‚yFÄFyTL83µµ38H,'ŽŽ',åþÄþC½<=Àþ@þÃuýñþ‹þŒýô ñÔoÕþ¼;QQ;:SS:;QQvRSìnÕoü 9("bb"(9<<ªÿj­n #4O! ! ! ! "&53265676 &'&#&"&54?&'&532651¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýòHŒÄŒ‡=T=þ²%2¶¶3$s(ŽÊÊŽ'²F:M L6 M:F‡=T=êþÄþC½<=Àþ@þÃuýñþ‹þŒýô ‹ÅÅ‹SwwSüÄ83µµ38H,'ŽŽ',ƒŒbQ?7#+6,#5? RbŒSwwSªÿj­n*6676 &'&#&%%''7'7! ! ! ! %2¶¶3$s(ŽÊÊŽ'ì'MÆÆMþÙ þÙMÆÆMýõtu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAL83µµ38H,'ŽŽ',"În‹ŠnÎUUÎnŠ‹nýõuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n!-9' 7 676 &'&#&"&47! ! ! ! É__¸þò_ü/%2¶¶3$s(ŽÊÊŽ'ÚB6L6û¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò\__þò_þòý‘83µµ38H,'ŽŽ',#€5O66O5¾þÄþC½<=Àþ@þÃuýñþ‹þŒýô ªÿj­n ".4<4632#"&%462#"&! ! ! ! !4 !&'& ‚Q;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAóü'£'ü©½EkþÒjEÿ;QQ;:SS:;QQ;:SSÛuýñþ‹þŒýô tþÄþC½<=Àþ@ü¤èFþºa`LtuLªÿj­n)5;C%7 '%4632#"&%462#"&! ! ! ! !4 !&'& þ¨MXûÝMXMþéQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAóü'£'ü©½EkþÒjEðoñnnñoþ¯;QQvRS:;QQ;:SS‘uýñþ‹þŒýô tþÄþC½<=Àþ@ü¤èFþºa`LtuLªÿj­n NZflx„Š–œ¢32654&#"!&'& !4 ! 4'#&'#5"'#5&47&'##"&'##5! ! 4632#"&%6754&#"326'#"&546325&'&'67%&'%67%–tJUioOLrþ7½EkþÒjE?ü'£'û ¿<=½5D%DmŽ8D++!"D"!++D8ŽnD%D6‡tu ýôþ‹þŒýòq"!#ýž ##  rLOoiUJt…#!"$ g!"$!"+üO# *"!$RluIOooüé`LtuLæèFþº7þÄþC½<›…º;.)þnY6G$@<œ<=ýj–þÃ<œ<@$F7Y“*.þż†œuýñþ‹þŒýô ¤!!# ü ¢þ‘OooOIulR #!!y£ Œ( ò &„!-Òœ-!ý à ªÿj­n '-5' 7 ' 7! ! ! ! !4 !&'& É__¸þò_üÛ__¸þò_ú¼tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAóü'£'ü©½EkþÒjE__þò_þòþX__þò_þò?uýñþ‹þŒýô tþÄþC½<=Àþ@ü¤èFþºa`LtuLªÿj­n)5AGO767632#"&53265!"&53265! ! ! ! !4 !&'& ÄU% $  ';ŒÄŒ‡=T=þ7ŒÄŒ‡=T=ý?tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAóü'£'ü©½EkþÒjEÈt2  "$À‹ÅÅ‹SwwS‹ÅÅ‹SwwSþbuýñþ‹þŒýô tþÄþC½<=Àþ@ü¤èFþºa`LtuLªÿj­n %+3%%''7'7! ! ! ! !4 !&'& |'MÆÆMþÙ þÙMÆÆMýõtu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAóü'£'ü©½EkþÒjE'În‹ŠnÎUUÎnŠ‹nýõuýñþ‹þŒýô tþÄþC½<=Àþ@ü¤èFþºa`LtuL_ÿjùn =b%!4 '7'7%%! "'&/! &"&5476?&7! 4'#"'&/&'&! 6?"'¤ü'£'ý¸þÙMÆÆMÇ'MÆÆMþÙü.tu ];6L *Ñþúþ‹þŒþùÑ+ L6<\‡¿<=½%&-ˆ)/šÞþÂþÄàš/)ˆ-LËèFþºtUÎnŠ‹nÎÎn‹ŠnÎèuýñþ‹%&69 þéÑþúÐ96&%þÄþC½<9ˆ-Çšàà›Æ -ˆ9ªÿj­n*6462"4632#"&%462#"&! ! ! ! ,–Ô––ÔþÀQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAZÔ––Ô–;;QQ;:SS:;QQ;:SSÛuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n%1=%7 '%4632#"&%462#"&462"! ! ! ! þ¨MXûÝMXMþéQ;:RR:;QBRtSS:;QþèKjKKjü³tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAðoñnnñoþ¯;QQvRS:;QQ;:SSþjKKjK¦uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n#.:F"&47462"%7 '%4632#"&%462#"&! ! ! ! PA6L6ý–Ô––ÔUþ¨MXûÝMXMþéQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþA¬€5O66O5þ.Ô––Ô–Rðoñnnñoþ¯;QQvRS:;QQ;:SS‘uýñþ‹þŒýô tþÄþC½<=Àþ@#ÿ<5nk”&462 &462%'%%7462"5.'46767 #5476764&"#5 '#54&/&'&'."% 7547676767>76767&'& QRtSSýIQQuRRþùMXM~þ¨MXüÈ–Ô––Ôý¡HVŠh=;®é®;=hŠVH‡&z':%i)8^'ˆnþûyˆ'^8)i%:'z&Lw l0‘8< 32Þý†à33<8‘0(SuQQuSSuQQvRînñoððoñüÖÔ––Ô–þxË>[1'Sk ß°þø¯à kSþÙþé1[>Ëç$n9ð(#móq,%@76?62>?''! '&&''7&''%4."#462!4."#462&'32?67#5#"'ì‚\>xcev> rtž’6þíþœþì;#• yý]Mþ´4þÈf£µ굡gþÍ.þºG *ó™t›t™ó* € &<ý]iâi]ý;& ikhdtÀÙþàþßÙÀt^b e11B1‡ŒÄŒÉ1B1‡ŒÄŒþ:$(2+$) ˆ`3H:þG??4ü.x==xü%B DG“}KSBÇ$bCJAi?l:1âw„„vã85j?g>LCR4.f>v¡§:ÄÄ:§¡rAe½ME9jwA“uŒ: ‰a a‰ :Œu“Awj9DMDVW$@"<<þýŒžžŒ@6 @"O`DQ+ZEEY,ŒÄÄŒ+ZEEY,ŒÄÄŒþ  ‘„c'F aa C `ÿjø?H]¨¶ÄÎÔÚ654.'&'& &'6?#"'% 76767%767#"&/27#"'7327 $'&54732"&546?4''7&54>76?62>?'#"&/ '&&'4."#462!4."#462&'32?67#5#"'º *òštþÈt˜ô* Pˆ,3,04þÈf¤µé¶¢fþÌ.0,4.ŠRüÈ‚\>xbfv> rtž’6þîþœþì<"– xü|%7>4Zfd &<ý^iáj]ýŽ<& hjZ4<6$,4,tÀØýÀÚÀt*$ä0B2ˆŒÄŒÊ0B2ˆŒÄŒþ:$(2,$( ˆ`4H:þF>@4|(,.f>v¡§:ÄÄ:§¡rAe.*',,ˆ3<%WLi?l:1âw„„vã85j?gD`(<3ˆ,¯.x==xü%B DG“}KSBA6%,4JDME9jwA“uŒ: ‰a a‰ :Œu“Awj9DMD44,%6<3*hbþýŒžžŒ]p-oÄ+ZEEY,ŒÄÄŒ+ZEEY,ŒÄÄŒþ  ‘„c'F aa C :ÿj&*_œª´ÃÐ27#"'7327 $'&54732#"'267#"%% 76767%767%7654.'&'&#"&'&54>76?62>?''! '&&''7&''%4632#"'&7">7&#"'&'67632327654'&#"ì‚\>xcev> rtž’6þíþœþì;#• yprw??5Àê½2H:uü}Mþ´4þÈf£µ굡gþÍ.þºG *ó™t›t™ó* € &<ý]iâi]ý;& ikhdtÀÙþàþßÙÀt^b eâcC>]0L!(C8ý$0+Eÿ8C%$M/2-;Cc¤ .* ,@ü.x==xü%B DG“}KSBh ELME N$bCJAi?l:1âw„„vã85j?g>LCR4.f>v¡§:ÄÄ:§¡rAe½ME9jwA“uŒ: ‰a a‰ :Œu“Awj9DMDVW$@"<<þýŒžžŒ@6 @"O`DŸF_W;E !I+ /!-! CB*&_z 5=ÿjJƒ˜­7327327#"'#""'72%654.'&'&#"&'%% 767%767%7&54>76?62>?''! '&'7&''>32#'&'4632%2347632#'&546¦\E[:TT:[E\lJDEI¸>zÂz>Z†º *ó™t›t™ó* B þ¿þág¤µ굤gþáþÀ úÀ &<ý]iâi]ý;& l m nmuÃÙþàþßÙÁvmmm ã :-.>>Ÿ¨1@/=# ¨-:  #=/@1¨Ÿ>>Œb@,,@bd¨x==x.8‚t.f>v¡§:ÄÄ:§¡rAe.t‚+B,E@y>zçw„„wçz>y9L,B=|9jwA“uŒ: ‰a a‰ :Œu“Awj9|BQW.>.þ÷ŽžžŒ .>.QWB•0B=1JJ¾Ï=B*HGrB0GH*B=ϾJJ1= =ÿj(7Du®¸-'"'72#"'&547632">7&>32#"'&327654'&#"654.'&'&#"&'%% 767%767%7&54>76?62>?''! '&'7&''2767!Ò/MþÑMþÑMs>zÂz>Z†þü+Q (F65/AFeN$0+E¸dFB/56F( Qy 0( ,@“ *ó™t›t™ó* B þ¿þág¤µ굤gþáþÀ úÀ &<ý]iâi]ý;& l m nmuÃÙþàþßÙÁvmmm ïÊŽ(s"5µþýgÔoÕnnÕoþ=x==x.L #$-G0,a&0$4%Ca,0G-$#  ;§‚t.f>v¡§:ÄÄ:§¡rAe.t‚+B,E@y>zçw„„wçz>y9L,B=|9jwA“uŒ: ‰a a‰ :Œu“Awj9|BQW.>.þ÷ŽžžŒ .>.QWBþŽ(+H65µ=ÿj'4i¨µ¾#"'&547632">7&>32#"'&327654'&#"654.'&'&#"&'%% 76?%767%72>?''! '&''7&''7&'54>76?7'7'7'27#"'7l+Q (F65/AFeN$0+E¸dFB/56F( Qy 0( ,@“ *ó™t›t™ó*  B þ¿þáf£µ굡gþáþÀ ýÓâi]ý;&  l m nmtÀÙþàþßÙÀtmmm l &<ý]£PA<<þýAP „[>wdev>¨L #$-G0,a&0$4%Ca,0G-$#  ;§ƒs.f>v¡§:ÄÄ:§¡rAe.$‚A+B,E@y>zâw„„vãz>y9L,B a‰ :Œu“Awj9ŠWBQW.>.þýŒžžŒ.>.QWB`*9jwA“uŒ: ‰aû:=NwY.-YwN=Ú.x==x =ÿj'4ež¦¯¸¼À#"'&547632">7&>32#"'&327654'&#"654.'&'&#"&'%% 767%767%7&54>76?62>?''! '&'7&''62&"%6 &#"27#"'7'%%l+Q (F65/AFeN$0+E¸dFB/56F( Qy 0( ,@“ *ó™t›t™ó* B þ¿þág¤µ굤gþáþÀ úÀ &<ý]iâi]ý;& l m nmuÃÙþàþßÙÁvmmm GFÄF`Tþµµ`ŽÊÈ„[>wdev>öMþÑMþ{/MþѨL #$-G0,a&0$4%Ca,0G-$#  ;§‚t.f>v¡§:ÄÄ:§¡rAe.t‚+B,E@y>zçw„„wçz>y9L,B=|9jwA“uŒ: ‰a a‰ :Œu“Awj9|BQW.>.þ÷ŽžžŒ .>.QWBþcc_<<õµµ`ŽŽú.x==x=nÕoÔÔoÕ=ÿj ,4dŽ"&545"'7276?.53265!"&532656 & &6?6?62>?'' '7&''!2$7%767%7654/&'& &'%%B€M 6L6nÂv>[„[3 M€‡=T=þ7ŒÄŒ‡=T=÷µµ`ŽþnýÕ &<ý]iâi]ý;&+ l m nmuþdý¿þfvmmm ;×ÞõYgþáþÀ A+ó™tþÈt™ó* B þ¿ˆ‹´?5O66,5=x..c?´‹SwwS‹ÅÅ‹SwwSüÚµµ`ŽŽÆ|ÄjauŒ: ‰a a‰ :ŒuaÌ È|BQW.>.þ÷þÔ* .>.QWBæþûçz>y9L,B+‚Qˆ®b§:ÄÄ:§¡T¨nk‚+B,E@y>=ÿj4s{ƒ‡‹654.'&'&#"&'%% 76?%767%72>?''! '&''7&''7&'54>76?!&'& !476327'* *ó™t›t™ó*  B þ¿þáf£µ굡gþáþÀ ýÓâi]ý;&  l m nmtÀÙþàþßÙÀtmmm l &<ý]†½EkþÒjE?ü““ÒÑ(•þò_üÛ__Úƒs.f>v¡§:ÄÄ:§¡rAe.$‚A+B,E@y>zâw„„vãz>y9L,B a‰ :Œu“Awj9ŠWBQW.>.þýŒžžŒ.>.QWB`*9jwA“uŒ: ‰aûGaKtuKç礣þº~_þò___ÿ¹šÇ @ÔÌ03#Çu™þˆü×ÿ)Ù¥@ ÎddÔüÜì1Ô<ì20K°TK°T[X½@ÿÀ878YK°TK° T[K°T[X½ÿÀ@878YK°TK°T[X½@ÿÀ878YK°TX½ÿÀ@878Y@````pppp]3#%3#þ^ËËþyËËÙËËËýsîþðö@BúÄÀ1ôÌ0KSXÉÉY"K° TX½ÿÀ@878YK°TX½@ÿÀ878Y@ %%6FVjg //]]3#þ7¹ä™öþøü¶ÿJéu@!  ÃÃúVV ÔìÔì99991ô<ìÔì2990K° TX½ÿÀ@878YK°TX½@ÿÀ878Y´ ]'.#"#4632326=3#"&ýü9 $(}gV$=09" (}gT";9! 2-ev 3)dwý îþ‹ö‰@BúÄÀ1ôÌ0KSXÉÉY"K° TX½ÿÀ@878YK°TX½@ÿÀ878Y@*$$5CUUŸŸ¯¯//]]#ýÇÄ™æöþøüÏîÿ1øw@ úÔÄ91ô<Ä90K° TX½ÿÀ@878YK°TX½@ÿÀ878YK°TX½ÿÀ@878Y@ //- ]3#'#ý¢¼Ó‹¦¦‹øþö²²üÏîÿ1ø†@ úÔÄ91ôÄ290K° TK° T[K° T[K° T[X½ÿÀ@878YK°TX½@ÿÀ878YK°TX½ÿÀ@878Y@ "  ]373ý¢Ó‹¦¦‹Óî ²²þöüÇÿ9ø #.#"#>32Çv cSRav  Ÿ6978w{züÇÿ9ø j@à úVVÔìÔì1ôüÌ20K° TX½ÿÀ@878YK°TX½@ÿÀ878YK°TK°T[X½ÿÀ@878Y332673#"&üÇv cSRav  Ÿø6978w{zýšþfÛG·ÎdÔì1Ôì0K°TK°T[X½@ÿÀ878YK°TX½ÿÀ@878Y3#ýšÌÌÛÍüæîÿ²ö@Ì1Ô<Ì203#3#þù¹ä™‹¹ä™öþøþøüNîÿö#!#ýÄ™äÄ™äöþøþø––53#–––––73#'3#ú––ú–––––– 3#3#'3#}––}––ú–––d–––ÿ– 3#3#'3#}––}––ú––d––––ÿ––3#3#––––d––ÿ– 3#3#3#3#ú––––ú––––d––d––‚ÿìï&;#"'&'#"'$&733$767654'3ïF??7Kÿÿÿì‡XNÿÿÿì~XO‚ÿ¥\,>%!$'$&73!2%7&'&547676323!!"'654'&'&#"xhnþèþðþÏ}þ·@¸AËQ+è"R¼:4RQ‰P þôioh4"(=)1$+<'gŠ\^ˆsM6,|y$›K2S–%j¸ßAzG' <8BNÿì?Ù0654'&323276767'&54767632#!V)B,4((7(*Hý®ñT—O<?a‚Nb–NLZB`.NJ|m‘þ¿+M;3*)3P&þ· ]027EW4,”E$2Hf3ŒÐˆ,'ÿì !5;#"'+5327&'&54767632"67654'&'&f·$'“Ùˆ¹¹ˆÙ“'$¹A??8 D?$ 9úP–2*I1C2¸99¸(M.L,0W¸ 5+5DE2.4! kþ Àä.@%&'&'&547676323!!#'$'&5473!2766'&'&#"¸B.y9“(“)Wp8c2þô0-=€ž¯ÍþŽ^E>¸><Œ–Õl/"'"3 9Ld/  #+m¹=¥E2X‘:Ö¸zF‘NV¾Š}¦`k›L:‚DbZzWK# :<,; ÿÿÿì?Ù+ÿÿÿì ,ÿÿÿì‡è&(!àRÿÿÿì~è&)!àR¶· %4'&"2>"'&4762<R8R8z?@¸?@@?¸@Ü(8)*8…¸@@@@¸@??ÿÿ‚þï '"¼Š'2©þ'ÿÿÿìþôè&('"cR2Pþôÿÿÿìþô~è&)'"cR2Pþôÿÿ‚ÿìï¶'$¼ 'ÿÿÿìóâ&($cLÿÿÿì~â&)$cLÿÿþ >¯&™|Šÿ8ÿÿÿì\K&š|XþÔÿÿÿì>K&›|XþÔÿÿþ >ª&™%?ÿÿÿì\F&š% °ÿÿÿì>F&›% °ÿÿþ >ª&™#Âÿÿÿì\F&š#¶ÿÿÿì>F&›#¶ÿÿþ >°&™'!?$çÿÿÿìþ>\L&š'$ÿ8! ¶ÿÿÿìþ>>L&›'$œÿ8! ¶3_+ 5_ü¡_•þž–bÕþV'ÕJ@!B • ¯ 6Üìüì99Ì1/<ì299Üì0KSXííY"²]33+532765#Õ¸â¸RQµþéi&&ý¸Õûƒ}úÖ``œ01­}ûƒ` 2@ ©¼ F ü<<ì221/äÜ<ì20@  @ P ` p ]33###53ø¤¤¸´´`þ¤þ<ĤþòþV.` 54!333##"3276!þÑÁ¸µ¿5R µw{i&þVÝÍ`û ›p?`3A0ÿÿ’cè3'q½=¼Uÿÿ’aè4'q½ÿ¼[ÿÿ’^è3'¼Pq½=ÿÿ“cåZ'ðd¼Uÿÿ“cåZ'Œd¼Uÿÿ’aèZ'ðdq½ÿÿÿ’aèZ'Œdq½ÿÿÿvj 3'À\q½=ÿÿ‹cíZ'¼b¼Uÿÿvj V'¼}À\ÿÿ‹cíW'¼u¼|ÿÿvj0Z'@dÀ\ÿÿ‹c:'¼u(Dÿÿ‹cm:'âD¼uÿÿvc u'¼uÀŒÿÿvV Y'¼PÀpÿÿƒVõZ'¼PðdÿÿƒVõZ'¼PŒdÿÿƒVõ‹'º«¼Pÿÿ‹c['ºà¼uÿÿüš{ÿPn&²¸þøZ,,!!,þÔ,þÔÿãOÕ=32653#"&[ÂhqÊÓ÷`¾=ìQQ•Ëîüþæê,ÿÿÿ«þ &&aùÿ«þ ö&3;#"'!5 767654x¸ I*eÃú‚2Dûþäþ¾0ËÚ# &pgM,¸>þê…—¸€ŠÐ:H~ÿÿþÈ#Ä'¼Õÿÿÿì`Ä'ÿSÖÿÿÿìºÄ'ÿS×ÿÿ‚þð¿F'¼ýçÿÿÿìþÔ8@'ÿ+þ '"cþÔNÿÿÿìþÔ~@'ÿ+þ '"cþÔOÿÿÿ«þ ~r'¼þ>¥Á9 9µF üìÄK°SK°QZX¹ÿÀ8Y1´—‡/ìä0@  @ P ` p ð ]3;#"&5Á¸Li µ£û‚™aœÀÖÿÿ‘^îáÿÿqÿã%ðäÿÿqÿãqåÿÿ–þu {&óÿJOw`73#!!dž²†$þ²ÚNd˜ü`ÿþVw`#676#732767!5ʆÐ#5H2KþÜÜ1i0/éNÞ)deûеT0Hôd01™¬ûŒÖ``ÿÿÿÓþvg{'°ÿóÿÿ¿þ‰y{&óÔðØÃû3#3#ðÓÓÓÓÖþ#þ—öÕ +@ • •   Ô2ì2ü2ì21/ì2ôì20!#3!53#—^ÊËý¢ÉÊÕªûªª­• ?!5 ü¤?ªªÿÿÈË8ò'sXyÿÿÈË8 U'tXyÿÿȺ8è'yôsÿÿÈË8'vXyÿÿÈË8 U'wXyÿÿȺ8 'y,vÿÿÜ¿$ž'vô|ÿÿÜ¿$ñ'wô|ÁNÕ@ T¯üüüÄ1/ìì0333Á¸ÕÕú¾“ÿìNÕ@T¯ ÄüüüÄ1/ìì20%3!533yÕýžÕ¸“““BÿìyÕ@ T¯Äüüì1/ìì0)533yþsÕ¸“Bqÿ㦓8@ E EôìÔ¶0 ]99ìüÄ1@    Œ /ìôìÔì0 6& #" 3 ¹¹¹þú*NYÃþë†hí>þú¹¹¹ý †þëé“ÿìÿ㦓A@E E ÄôìÔ¶0 ]9ìüÄ1@     Œ  /<ì2ôìÔì0 6& "'!53&54 3 ¹¹¹þú*N²NþJíh†hí>þú¹¹¹ý “©Ãþëé“ÿìÿã!“8@ E EÄôìÔ¶0 ]99ìì1@    Œ /ìôìÔì0 6& &54 #"'!5 ¹¹¹þúíh†þëÃYNþJ>þú¹¹¹ýœ©Ãþëþzþë“=xÙ 4@   ÜÄ2üÄ2ÜÄ91@  ‡/ìì290)33!xýÞþç³³Âþçj*¯þ]£ýQýiÿìxÙ 6@   ÄÜÄ2üÄ2ÜÄ91@    ‡/ì2ì290%!5!33xütjþç³³Âþç“““—¯þ]£ýQýiÿì'Ù 4@     ÄÜÄ2üÄ2Ì91@   ‡ /ìì290#5!33jþç³³Âþç“—¯þ]£ýQüÖ=Ðq) #33Ðþìþ¢þ¢Ã¤úmˆ½ýCqý"ÿìÐq )5333!þìˆmúmˆþìþ¢“Þý"“½ÿìq)533#þìˆmú¤Ãþ¢“Þü½ºOq $@  üìÔüüÄ1¶£‡/ì2ô<0)3!33Oûk¹U¹Îqý"Þý"ÿìOq (@   ÄüìÔüüÄ1·£ ‡/ì22ô<0)533!33OúιU¹Î“Þý"Þý"ÿìq $@  ÄüìÔüì1¶£‡/ì2ô<0)533!3ûkιU¹“Þý"ÞºOq $@   ü<ÔüüÄ1· £ /ì2ôì035!!5!3ºüòÇΓK“ý"“ÿìOq $@   ÄüÔüüÄ1· £ /ì2ôì0#5!!5!3ÜüòÇΓK“ý"“ÿìq @ ÄüÔüì1¶ £ /ìôì0!5!!5ûkÜüòqü“K“qÔâ:@!E E üìܲ@]üܲ@ ]ìüÄ1@ •• ‘ /ìôìÔ<ì0!&'.4> !2>4."RJr……ä 惃sKRü9[œ¸ZZ¸œ 1¨Å©bb©Å¨1 ý…“­p`88`p`88ÿìÔâ!>@#E E"Äüìܲ@]üܲ@]ìüÄ1@ • •‘ /ì2ôìÔ<ì0%!!5!&'.4> 2>4."¼ûRJr……ä 惃sKRþQ[œ¸ZZ¸œ“““{ 1¨Å©bb©Å¨1 Ÿp`88`p`88ÿìOâ:@!EE Äüìܲ@]üܲ@]ìì1@ •• ‘ /ìôìÔ<ì0#5!&'.4> 2>4."RJr……ä 惃sKRþQ[œ¸ZZ¸œ“{ 1¨Å©bb©Å¨1 üò­p`88`p`88ºO¦ &@    ÔÄüÜÌÌ21¶   /ìÜÜÜÌ03"3#!5!ò„…ñ>ûk•œ fšžüø“ÿìO¦ "·  ÄÔÄÜÌÌ21¶   /ìÜÜÜÌ03"3#!5!ò„…ñ>úcœ fšžüø“ÿì¦ $@   ÄÜüÜÌÌ21¶   /ìÜÜÜÌ03"3#!5!ò„…ñpûk•œ fšžüø“qµî7@ EüìÔ<ì2ÔüÜÄ1@    ‘ /ìôìÔ<ì2Ì0!!##"&6 !354'&"3.þCœø¼°±f^‹vÎü ]8Æmr^ÞþÄ<ÖUåf˜¶Éý"“qɃ]8˜Æƒÿìµî;@! E ÄüìÔ<ì2ÔüÜÄ1@   ‘ /ì2ôìÔ<ì2Ì0%!##"&6 !3!554'&"3.þCœø¼°±f^‹vÎù7é]8Æmr^“KþÄ<ÖUåf˜¶Éý"““ÞɃ]8˜Æƒÿìçî7@ EÄüìÔ<ì2ÔüÌ1@    ‘ /ìôìÔ<ì2Ì0%!##"&6 !!554'&"3.þCœø¼°±f^‹vúé]8Æmr^“KþÄ<ÖUåf˜¶Éü“ÞɃ]8˜ÆƒÁ•Õ ,@   üü<ü<ÜÄ1@   ¯  /ìôìÜì03!!!!!Áƒþ5Ëþ5Õ“þ/’ý´“ÿì•Õ 0@   Äüü<ü<ÜÄ1@    ¯  /ì2ôìÜì0#53!!!!!Õƒþ5Ëþ5“B“þ/’ý´“ÿìDÕ ,@    Äüü<ü<Ì1@    ¯ /ìôìÜì0)53!!!!yþsÕƒþ5Ëþ5“B“þ/’=•Õ ,@  Ü<ü<üüÄ1@   ¯  /ìôìÜì0!!5!!5!3þ5Ëþ5ƒÕß’Ñ“ú¾“ÿì•Õ 0@  ÄÜ<ü<üüÄ1@    ¯  /ì2ôìÜì0#5!!5!!5!3þ5Ëþ5ƒÕ“L’Ñ“ú¾“ÿìÀÕ ,@    ÄÜ<ü<üì1@    ¯ /ìôìÜì0)5!!5!!5!Àý,þ5Ëþ5ƒ“L’Ñ“ºŒÕ *@  üü<ÔìüÄ1@     ì2ìÔì0!!27654'&3!23œþÐ,R4,,=ýÙ¹UiXOÓÞýµ]Oz}I_ý"Õýœ‡_Ò¤‚“ÿìŒÕ.@  Äüü<ÔìüÄ1@    /ì22ìÔì0#533!23!!27654'&ιUiXOÓþþÐ,R4,,=“Býœ‡_Ò¤‚“Þýµ]Oz}I_ÿìÕ *@  Äüü<Ôìì1@     /ì2ìÔì0!!27654'&533!2#œþÐ,R4,,=ý ιUiXXXlÞýµ]Oz}I_ý"“Býœ‡_Ò­‡…ÁùÕ@@  ôܲ_]9üÔüÄ@    /ìôì999@  ìì10!4'&'5!!ª5M‰Ãcý™ˆ4B˜™_–ÜÜ9V“þïê¸æœ@9“ÿìùÕD@   Äôܲ_]9üÔüÄ@     /ì2ôì999@  ìì10#5!&'&'&'5!!» 5M‰Ãcý™ˆ4B˜“X]°–ÜÜ9V“þïê¸æœ@9“ÿì$Õ@@   Äôܲ_]9üÔì@     /ìôì999@  ìì10#5!&'&'&'5!» 5M‰Ãcý™ˆ4B “X]°–ÜÜ9V“þïê¸æþÉq=áÕ:@   ÔÜü9ÜÄ1@  /ìô̲]ìì´]0!533TþéºÕßþÇö9ú¾“ÿìáÕ >@  ÄÔÜü9ÜÄ1@  /ì2ô̲]ìì´]0#5!533hþéºÕ“LþÇö9ú¾“ÿì Õ:@  ÄÔÜü9Ì1@  /ìô̲]ìì´]0#5!53hþ麓LþÇö9ú+ÁÀ#1@%!$üìÔìÔüüÄ1@    # /ì22ÔìÔì03432>3234&#"!4&#"!ÁôÆ}x5%–ÓÒ^ˆÕþq¤ZþýH¤Zl”þî¦ÿK--ÒX€hý¹“|‚€Å•þncƒ§ÒòÿìÀ%5@'#&ÄüìÔìÔüüÄ1@    $ /ì222ÔìÔì0#53432>3234&#"!4&#"!ÕôÆ}x5%–ÓÒ^ˆÕþq¤ZþýH¤Zl”þ“[¦ÿK--ÒX€hý¹“|‚€Å•þncƒ§Òòÿìë#1@%!$ÄüìÔìÔüì1@    " /ì22ÔìÔì0#53432>324&#"!4&#"!ÕôÆ}x5%–ÓÒ^ˆº¤ZþýH¤Zl”þ“[¦ÿK--ÒX€hý&|‚€Å•þncƒ§Òò=ÜÕ -@   Üü<ü<üÜÄ1@    /ìüÜ<ü<0!!5!3!!!ˆþµK¸Kþµœ“Áþ?“ý“ÿìÜÕ1@   ÄÜü<ü<üÌÄ1@    /ì2ôÜ<ü<0#5!!5!3!!!œþµK¸Kþµœ“î“Áþ?“ý“ÿì‹Õ -@   ÄÜü<ü<üÌ1@    /ìôÜ<ü<0)5!!5!3!!@ý¬œþµK¸Kþµ“î“Áþ?“=XÕ>@ Üü<ü<Ü<ü<üÜÄ1@    /ì2ô<Ü<<ì220%!!5!3!3!!!þ=¹þµK¹øLþ´œ“îý““Áþ?Áþ?“ý“ÿìXÕB@  ÄÜü<ü<Ü<ü<üÜÄ1@    /ì22ô<Ü<<ì220#5!!5!3!3!!!%!œþµK¹øLþ´œý¬þ=“î“Áþ?Áþ?“ý““îýÿìÕ>@  ÄÜü<ü<Ü<ü<üÌ1@    /ì2ô<Ü<<ü<<0)5!!5!3!3!!!¼û0œþµK¹øLþ´¸þ=“î“Áþ?Áþ?“ýîýºOq %@   üìÔüüÄ1· £ /ì2ôì03!3!ºÇÎü$Uqý"“ÞýµKÿìOq *@    ÄüìÔüüÄ1@  £  /ì22ôì0#53!3!ÎÇÎü$U“Þý"“ÞýµKÿìq %@  ÄüìÔüì1·  £ /ì2ôì0)53!!ûkÎÇüòU“Þ“ýµK=ÕC´  ÔÄÄÄ1@ B•• /ììôì0KSX@ììììY!!!ÆýtFsþ0†þhéBû~ÀÕú¾“ÿìÕ Fµ  ÄÔÄÄ1@ B••  /ì2ìôì0KSX@ììììY!5!!!ÆýtFýléþh†þhéBû~À“Bú¾“ÿìÃÕC´  ÄÔÄÄ1@ B•• /ììôì0KSX@ììììY!5!!ÆýtFýléþh†þ0Bû~À“Bú+ÁóÕ 8@!  üìÔ<ü<ÔìüÄ1@       /ì2ôìÜ<ì20327654'&+!!!2/!m¨]%i¤þ ;þ ô°„@ED\ŒÔ†qQE=4."RJr…CEoJRþµXEr„„rJSü9[œ¸ZZ¸œ† 1¦ÆSV/ ó“þ{ 2¦Æ¦1 ò“"p_88_p`88ÿìÔÕ*#5!5&'.4767675!5!!2>4."RJr…CEoJRþµXEr„„rJSü9[œ¸ZZ¸œ“ó 1¦ÆSV/ ó“þ{ 2¦Æ¦1 ò“"p_88_p`88ÿìOÕ(#5!5&'.4767675!5!2>4."RJr…CEoJRþµXEr„„rJSþQ[œ¸ZZ¸œ“ó 1¦ÆSV/ ó“þ{ 2¦Æ¦1 þ{"p_88_p`88ÁQÕ %@   üìÔìüÄ1·  /ìôüÌ0!!#!3Åþµ¹¼ÔBþÅÎú¾“ÿìQÕ *@  ÄüìÔìüÄ1@    /ì2ôüÌ0#5!!#!3Ùþµ¹¼Ô“¯þÅÎú¾“ÿì}Õ %@   ÄüìÔìì1·  /ìôüÌ0#5!!#!Ùþµ¹¼“¯þÅÎú+ÁQæ (@   üü<ÜüüÄ1·   /ìÔÌüÌ0!!#3!3Åþµ¹¹ÔOþü›þüü±“ÿìQæ -@   Äüü<ÜüüÄ1@     /ì2ÔÌüÌ0#5!!#3!3Ùþµ¹¹Ô“¼þü›þüü±“ÿì}æ (@    Äüü<Üüì1·   /ìÔÌüÌ0#5!!#3!Ùþµ¹¹“¼þü›þüüÁBÕ /@   ü<ìÜ<üüÄ1@      /ì2ôìÔì0!!!5!3z;þ ôþ ¬ÕÞýµKý"qÑ“ú¾“ÿìBÕ3@   Äü<ìÜ<üüÄ1@      /ì22ôìÔì0!53!!5!3z;ý7Õôþ ¬ÕÞýµKý"“ÞÑ“ú¾“ÿìmÕ /@    Äü<ìÜ<üì1@      /ì2ôìÔì0!53!!5!z;ý7Õôþ ¬ÞýµKý"“ÞÑ“ú+qÔÕ &B@%(E# E'üìܲ@ ]<ü<ܲ@]ìüÄ1@ •# •$  /ììÔ<ìÔ<ì02>4."&'.4767673! [œ¸ZZ¸œœRJr…CEoJR¸XEr„„rJS"p_88_p`88ü~† 1¦ÆSV/ †þ{ 2¦Æ¦1 ò“ÿìÔÕ (F@ *E#'E)Äüìܲ@]<ü<ܲ@#]ìüÄ1@•' •( /ì2ìÔ<ìÔ<ì02>4."!5!5&'.4767673 [œ¸ZZ¸œlûRJr…CEoJR¸XEr„„rJS"p_88_p`88ý““ó 1¦ÆSV/ †þ{ 2¦Æ¦1 òÿìOÕ &B@(E# E&'Äüìܲ@ ]<ü<ܲ@]ìì1@ •# •  %/ììÔ<ìÔ<ì02>4."5&'.4767673!5 [œ¸ZZ¸œœRJr…CEoJR¸XEr„„rJSý0"p_88_p`88ýó 1¦ÆSV/ †þ{ 2¦Æ¦1 þ{“qÔÕ*!&'.4767675!5!!!2>4."RJr…CEoJRþµNþµXEr„„rJSü9[œ¸ZZ¸œ† 1¦ÆSV/ ó““ò 2¦Æ¦1 ò“"p_88_p`88ÿìÔÕ ,%!5!5&'.4767675!5!!2>4."ÔûRJr…CEoJRþµNþµXEr„„rJSþQ[œ¸ZZ¸œ“““ó 1¦ÆSV/ ó““ò 2¦Æ¦1 òp_88_p`88ÿìOÕ*)5!5&'.4767675!5!!2>4."¼ý0RJr…CEoJRþµNþµXEr„„rJSþQ[œ¸ZZ¸œ“ó 1¦ÆSV/ ó““ò 2¦Æ¦1 p_88_p`88ÿÿüìûÿ œûþÿÿÿª†‚Õ'a†'aÊa ÿÿª†ƒÕ'a†'aÉb ÿÿª†‚Õ'a†'bÉa ÿÿª†‚Õ'a†'bÉb ÿÿª†‚Õ'b†'aÉa ÿÿª†‚Õ'b†'aÉb ÿÿª†‚Õ'b†'bÉa ÿÿª†‚Õ'b†'bÉb —à :@   Ô@ ? o ]Ü99ÔÜ99ÔÌ991¶ ÔÌ2Ü<Ì0#'##'##'d22¯222¯22dàÈddddÈÉþVüÕ!#!3!3#3ÄýjþðÄ–Éþ’†áûÕûáúÕªþVÁþV8`!##333#€·ýäì·í¸þÞ{ƒü}`üü9™þV®þVX{ %5#"&5332653!"&'5326 C±uÁȸ||•­¸þþúa¬QQžRµ´þÝjBfcðç¦ýaŸŸ¾¤{ü+þâþé³,*½Ðÿÿ}þGR'2þ¡ÿÿ}þ¢GR'!©þ¢¡ÿÿ}þ¢G÷'KÿÂÿ'!©þ¢¡ÿÿ}ÿÚGx'$úâ¡ÿÿ}ÿÚGª'&ú¡ÿÿÿ«þ ~&'2Xþ ¥ÿÿÿ«þ ~&'!4þH¥ÿÿÿ«þ ~&'!´('!4þH¥ÿÿÿ«þ ~¶'"ô ¥ÿÿÿ«þ ~°'&ô¥ÿÿ‚þ G¶&©'!_ !õþ¢ÿÿÿìþ¢ è&ª'!R!þ¢ÿÿÿìþ¢7è&«'!R!þ¢ÿÿ‚þ Gî&©$xÿÿÿÿìþ  î&ª$ ÿÿÿÿìþ 7î&«$ ÿÿÿ‚þ G°&©'#â $xÿÿÿÿìþ  °&ª'#Š $ ÿÿÿÿìþ 7°&«'#Š $ ÿÿÿ‚þ áå&±"xþ¢ÿÿÿìþ¢2å&²"Xþ¢ÿÿÿìþ¢å&³"Xþ¢ÿÿ‚þ á°&±#~ ÿÿÿì2°&²# ÿÿÿì°&³# ÿÿ¬&¹#„RÿÿÿìÔ&º#|Rÿÿÿì¤&»#|Rÿÿuþ ²F&Á#,¶ÿÿÿìø@&Â#,°ÿÿÿìðF&Ã#,¶ÿÿ‚þ¢\&*!kþ¢ÿÿÿìþÔ?Ù&+!¨þÔÿÿÿìþÔ &,!¨þÔÿÿ‚þ¢\L&*'!õ¶!kþ¢ÿÿÿìþÔ?&+'!©~!¨þÔÿÿÿìþÔ ~&,'!»è!¨þÔÿÿ‚ý¨\&*$îþ¢ÿÿÿìýÚ?Ù&+$,þÔÿÿÿìýÚ &,$,þÔÿÿkþ À&-!kÿÿÿì?&.!©~ÿÿÿì ~&/!»èÿÿkþ Àû&-#„kÿÿÿì?&.#,~ÿÿÿì x&/#>è‚ÿ§‚7%2$6=4'%$=4767!;#"&'#!"'$4733ö¸k1yüYþ  °`üh_ ®Êø/.Z\9 Sþl¡þ À€þ¶?¸AËh—X–l k‘7¾>c`›ýè7# #5–&øE^¸209‚&b Š\^ˆ~B"ÿì„ #5!276'&'%$=4767!#“. cüYþ ¢°`üh_ ®Êø>_߸h,n‘7¾>ba›ýè7# #5–&øqe›ÿì)#5!27654'%$=4767!;#"&'#ˆ9püYþ ¢°`üh_ ®Êø/.ZZ8 `§¸h‘7¾?ba›ýè7# #5–&øE_¸/(Wÿÿ‚ÿ§Ù&%2F„ÿÿÿìÏ&Ò2ô„ÿÿÿì&Ó2ô„ÿÿÿÉÒ&Ñ!îFÿÿÿìÏr&Ò!ÈÜÿÿÿìr&Ó!ÈÜÿÿý¨Ò&Ñ$Xþ¢ÿÿÿìýÚÏ&Ò$ÈþÔÿÿÿìýÚ&Ó$ÈþÔÿÿ‚ÿ§Ù+&)2F„ÿÿÿìÏ+&*2ô„ÿÿÿì+&+2ô„ÿÿ‚þ¢Ù+&)"Xþ¢ÿÿÿìþÔÏ+&*"ÈþÔÿÿÿìþÔ+&+"ÈþÔÿÿ‚ÿ§Ù4&)#„¤ÿÿÿìÏ4&*#K¤ÿÿÿì4&+#K¤ÿÿþÈ#ž&Õ!jÿÿÿ쯞&Ö!ÿÿÿ캞&×!ÿÿþÈ#4&Õ#è¤ÿÿÿì4&Ö#¤ÿÿÿìº4&×#¤ÿÿüà#&Õ$&ýÚÿÿÿìþ ó&Ö$cÿÿÿÿìþ º&×$ÿÿÿ“üÇ+¼&5'!?&!¼üÇÿÿÿìþÔ‡è'!àR&(!àþÔÿÿÿìþÔ~è'!àR&)!àþÔÿÿ“ü®+¼&5'!?&2&ü®ÿÿÿìþôè'!àR&(2Pþôÿÿÿìþô~è'!àR&)2Pþôÿÿ“þ +¶&5#ô&ÿÿÿìóâ&(#cRÿÿÿì~â&)#cR5Õ b@ƒ ü<ì2991/ôüÌ0K° TX½ @ ÿÀ878YK°TK°T[K°T[X½ ÿÀ @878Y¶ P ]#53#3ËËË¢×þú+eþ›ÿã¬Õ $†@/ †ˆ !ƒ# •Œ#%" " "!& %ÜìÔüìÔì99991äôìþÍôî9990K°TK°T[K°T[X½%ÿÀ%%@878Y@ ttttv]33267#"&546?>7>5#53ô¾7ZZ:3ƒmN´`^Àg¸àIYX0&ÄÊÊDœe‚WX5^1YnFC¼98ŸL‰VV/5<6þÿÿÿã¬ÓWuÿìX %#!5!276=3%Hþ¬c,1¸VV¸,1jÙÙ»ÝýÔ²#!!!!ÝÕþ­ûÐþ®#õ± -öÓÝýÔ²#!!!ÝR0SýÔ OöÓ -õ±#ýÔf# !! !!5 Nóú´¶ü+ø½ü)#þïü ûÈþðÓm¥ý™@>2&#"#"&'7327« äÖ³ÒPd \ æjk³ÒPd è켰Ǹøø}켰Ǹ÷ÿÿ¥ý™H&@@ÿÿ¥ý™ Q'@'@@¥ý™@-6?67632&#"#"'&'7327&'&54767676'4'&'« uphmdNÒPd Œ]œœz¢ vphmdNÒPd „fœu¦ÃV?bd4?þõV?fj4èì`\cMǸøþ["j¯ÏÝœxþ9ì`\cMǸ÷°"gÛÝ¢züBf’–d3ýv˜Ai’’f3¥ý™HMQZc67632&#"!67632&#"#"'&'7327!#"'&'7327&'&54767!!676'4'&« uphmdNÒPd  upimdNÑQd Œ^œ›z¢ upimdNÑQd ýä vphmdNÒPd „fœu¦Â"ýäþóV?fj4Q V?bd4èì`\cMǸøþl¸ì`\cMǸøþ["j¯ÏÝœxþ9ì`\cMǸ÷þ@ì`\cMǸ÷®#hÛÝ¢zü¿ý[˜Ai’’f3qýiBf’–d3¥ý™ Pmqu~‡67632&#"!67632&#"!67632&#"#"'&'7327!#"'&'7327!#"'&'7327&'&54767!)!67654'&« uphmdNÒPd  upimdNÑQd  uphmdNÑQd Œ]œœz¢ vphmeNÒPd ýä upimdNÑQd ýä vphmdNÒPd „fœu¦æ"ýä"üø"ýäþóV?fj4YV>be4èì`\cMǸøþl¸ì`\cMǸøþl¸ì`\cMǸøþ["j¯ÏÝœxþ9ì`\cMǸ÷þ@ì`\cMǸ÷þ@ì`\cMǸ÷®#hÛÝ¢zü¿ýA¿ý[˜Ai’’f3qýiBf’–d3¥ý™é3&#"7#754'&'#"&'7327#4767>32nSb ~Y¨…fþôMþöf‚pH>> âfpµÒSb =[Bzšzš âfpµ¸øþ)"X§Ü*ƒeþô eƒ*£mHúé鿬˸÷ÿBx¢Û›zñé¿­Ê¥ý™Ñ>4'>7'7&#"7#"&'7327&'&54767>32mV?fj4×Vs ¿e™Sb ~kšefì%Uz¢ álkµÒSb „fœu¦ álkµÓ˜Ai‘“f3EØTýiŽÁeX¸øþ[m¯eeí_Xþ9鿬˸÷°"gÛÝ¢z¿èÀ­Ê¥ý™Ô=.'>7'&#"'#"&'7327&'&54767>32mV?fj41M>V• vfüSb ŒÅèfjþî£ álkµÒSb „fœu¦ álkµÓ˜Ai‘“f3·]Dýi·[wf&¸øþ["ÞYèfj¯þðþ9鿬˸÷°"gÛÝ¢z¿èÀ­ÊÿøýÔ P# ! !Aþáüsüsþá #õ± %öÛ OÿøýÔ P# ! !ûñûôýÔ OöÜ $õ±ÆýÔ‚# # #¤þËþKôuÒuôþO;þÀþ›ù>åÈ¢þ^þ8ùÂbCÆýÔ‚# 3 3¤5µôý‹ý.ý‹ô±þ¼AeÁùþ8þ^£Çåù?þžþ¼Rýà þu7!!  767654'&'  $'&'&7676Ñ®þR¹þ<ÆÂ¡¤¡¡¤¡ÂÆÄÆÂ¡¤¢¢¤¡Âý?3ãÉÉdccdÉÉþýÍþÉÉdccdÉÉýûYTR¡£þzçáþz¢¡SSSR¢£†à熣¡RYËÈÉóðþãþéòðÊÇÌÌÇÉñóñóÉÇRýà þu3?  767654'&'  $'&'&7676!!#!5!Šþ<ÆÂ¡¤¡¡¤¡ÂÆÄÆÂ¡¤¢¢¤¡Âý?3ãÉÉdccdÉÉþýÍþÉÉdccdɵˆ›üeîüe›pTR¡£þzçáþz¢¡SSSR¢£†à熣¡RYËÈÉóðþãþéòðÊÇÌÌÇÉñóñóɵjüeñüe›ñ›Rýà þu3?  767654'&'  $'&'&7676   ' Šþ<ÆÂ¡¤¡¡¤¡ÂÆÄÆÂ¡¤¢¢¤¡Âý?3ãÉÉdccdÉÉþýÍþÉÉdccdɵƒªýs¨ýsýsªýspTR¡£þzçáþz¢¡SSSR¢£†à熣¡RYËÈÉóðþãþéòðÊÇÌÌÇÉñóñóɵþ¸ýsªýsýs¨ýsªÿÿ¥ý™Y&@'@'@ @¥ý™@327!5!>32&#"!!#"&'wSb -þ}# álkµÒTb "ƒþr/ álkµÛ¸÷®ñå鿭ʸøý?ñü/鿬Ë¥ý™@'327!5!!5!>32&#"!!!!#"&'wSb þ‹þn álkµÒSb uþ€‘þc álkµÛ¸÷ŽðTíÅ鿭ʸøþ_íþ¬ðýO鿬Ë¥ý™@&#"#"&'73275>32nSb %Éþ,, álkµÒSb %þ9Ò, álkµ¸øý âþùü\鿬˸÷øþþã¤é¿­Ê¥ý™@,5&#"&'67#"&'7327&'&54767>32nSb Øh 9q-XLa álkµÒSb „fœu¦ álkµý-V?fj4¸øþ[:À\f.ýiž3 þ9鿬˸÷°"gÛÝ¢z¿èÀ­Êúº˜Ai‘“f3¥ý™è4&#"676='3'#"&'7327&'&53>32nSb =[Bz„f L f‚œxš ãjkµÒS` X¨qH?> ãjkgL¸øûBx¡+„f þôf„+ݘzþ鿬˸÷×#X¨Ú¡nHé¿cJÊ¥ý™@!!!!!>2&#"!!"&'732f*þÖþ åÖ²ÒPc »þ ïΰÒPe¿þ™ý  `켱Ƹøþ‡ûbþ”õ³±Æ¸¥ý™@,!!>2&#"#"&'7327326&f*þÖŒ:, åÖ²ÒPd Œ]œœz¢ æjk²ÒPc 9L¿Ñ¿þ™~켯ȸøþ["j¯þUxþ9켱Ƹ÷lÐ2³¥ý™G1!!327326&# >32&#"632#"'#"&'ž+þÕýÙSb &@OžŒÔàþÓv"æjkµÒSb S`ï$þÈÛ{g ãjkµÊþ™ü¸÷X(LÍ(ÊäXèÀ­Ê¸øþKþ·þTþË/þ鿬Ë¥ý™@ 4!!6& 327&'&767>32&#"#"&'_*þÖÑÃþÒÌÊåSb „fœu¦ álkµÒSb Œ]œœz¢ álkµÍþ™­Ì(ÊÍ“’Ìýl¸÷°"g¸¢z¿èÀ­Ê¸øþ["j¯þTœxþ9鿬Ë¥ý™@"&7!>2&#"!!#"&'73273!#3×½ åÖ²ÒPd ŒþA ïfe³ÒPd "óþCòÐÛ;Ò켱ƸøþRûÅþfõ³®É¸÷wxýKµýKÿ£ý™B/&#"!2#567&'!#"&'7327!5!>32nSb $~Ŏˆ ˆþy/ álkµÒS` -þc ˆþC½ˆþ÷¦& álkgL¸øýÊþèÆÀ‹ü)鿬˸÷´þùˆ¼f¼ˆþùé¿cJÊ¥ý™@%&#"7 '#"&'7327' 7>32nSb Þ©þœd©û# álkµÒSb !á­gþœªü álkµ¸øý©Þ«þ›þœªùý鿬˸÷ªâ«de©ýœé¿­Ê¥ý™@,327#7>32&#"#'#"&'wSb @\-J«Û« álkµÒSb Xz«¯@ álkµÛ¸÷)FqÝþGÑ% §é¿­Ê¸øþr"b‰þÑþ/¹XGúÀ鿬Ë¥ý™@)&#"63#"&'7327&'&3>32nSb <Ϋþ~ álkµÒSb ‚Yz«²= álkµ¸øû 6sºþ.ýò7þ鿬˸÷Ö!b‰/ÒþFþ¦Eúé¿­Ê¥ý™N Ü>2&#"#"&'7327!5« åÖ²ÒPd \ ækj²ÒPd ÿû©è켱Ƹøø}켱Ƹ÷ xââ—üL@>2&#"#"&'73275!« åÖ²ÒPd \ ækj²ÒPd þHVè켱Ƹøø}켱Ƹ÷üèããY™õ‡[”_<õÑ~äÑ~ä÷ÖüLY Ümþþ÷ÖúQYRÍfª‹55®Å´žªšq=3ۤ=´Ù‹žãd‹Û²‡á–œdž¨‹²ð²ž´Ù´Ù´Ù?“‡y}É–s)ÉÉšÉ3sÉ\É\ÿ–?ÉuÉçÉüÉLsÓÉLsɇãÿúÛ²yéD{=ãÿü{\°²Ç´Ùÿìªç{ºfqqìqÑ/qº9Á9ÿÛ¢º9Á˺ºåqºqJº+o#7®¼=‹V¼;¼=3X²´Ù‹55¬^R²\×Åsåž´ÙãdÕôÙ5^5bs®ž‹Û#5‰Å`åÁÁ‰Á‰Áb?yyyyyyË–sÉÉÉÉ\;\¢\ÿþ\3 üÉLsLsLsLsLs´LfÛ²Û²Û²Û²ãÿü×É ºç{ç{ç{ç{ç{ç{Û{fqìqìqìqìq9ÿÇ99ÿÞ9ÿôåqºåqåqåqåqåq´ÙåH®®®®¼=º¼=yç{yç{yç{–sfq–sfq–sfq–sfq)Éq3 qÉìqÉìqÉìqÉìqÉìq3sq3sq3sq3sqÉÿåTÉx\ÿä9ÿÓ\9ÿò\ÿõ9ÿä\°9–\É9Á¸ÉrÁ\ÿ–9ÿÛ?É¢º¢ºuÉ9ÁuÉ9ˆuÉÁuɼÁÿòFüɺüɺüɺ‚ÍüɺLsåqLsåqLsåqs/qÉJºÉJ‚ÉJº‡+o‡+o‡+o‡+oãÿú#7ãÿú#7ãÿú#7Û²®Û²®Û²®Û²®Û²®Û²®éD‹Vãÿü¼=ãÿü{\3X{\3X{\3XÑ/ áÿ—}ɺ} s–sfq3 ÿ—}ÉqåqƒLuꤚÿ–Ñÿ3s~ߺÔÉ\ ÷É¢¹9 ¼=˲üÿ–ºLsNgåv—sq7ÿ—¹Ér+dɰþò#7ã#7ãÿúÝ­°NÄÉóÿüØ={\3XT T\Ÿh3q–T]ŸhXº\Éðɬ]É `É dÉ <q¯ÉKɧÁsÉdÉaºyç{\ÿþ9ÿàLsåqÛ²®Û²®Û²®Û²®Û²®ìqyç{yç{ËÛ{3sq3sq?É¢ÿéLsåqLsåqT ŸX9ÿÛ `É dÉ <q3sqçÉuÉüɺyç{ËÛ{LfåHyç{yç{ÉìqÉìq\ÿ§9ÿÃ\9ÿãLsåqLsåqÇJ‚ÉJºÛ²®Û²®‡+oãÿú#7œ,GÉÿðâÉ´q–qâq{\3Xyç{ÉìqLsåqLsåqLsåqLsåqãÿü¼=ÌŠ¾ºÑ79ÿÛüqüqyÿý– f u ãÿ²+o3XÓPÕP} Û yÉìq\ÿ–9ÿÛ@sq Jãÿö¼ Í®qººefqq’qìqìqŽ|S…A…4…Pq9ÿÛ‘qq qÄ`Ä`®ºº9µ¦ùt*KæM:Á¦Á˺˺˺+ÿÛ#º³åqÝqÓ”GpPPOJºIº>„>tÔºÔº+o°ÿÙ°ÿÙ±7°þò#7#7ñqÉÁ¼=‹V¼=ãf3X3XŸXŸmXXXXLs£ºPqªq;ºVþòVººÑqXXqvqq¤7á7:7É/¥Á<Á66JO<u1ufÿéu]H^H 6û&: ® ‹®‹²‹Äuuuuõuõu  ÁÁÁÁ3ÖÕsª3ÖÕªs²o²ouuuudŠdÇšîL¶ð†ÿÿïhuTzüuuõuòÖòÖòÖòÖòÖÁÕ%®î¶ü¨ýqüÁü´üÙûìü¿ý¢ü×ý7üìüôüÅý¼üðü]ü¿ü¿þýýÿyü¨ýqý$ýÄþUþðý€ý ý ý$ý ýzýwý¢üÕý(ýjý#ýLý¼üðücüÅü¿ü¿ü¿ü´üÙûìûìûŒýxúíûhúý¬üñý!ücý+þûìü¨ýqü´ýüçýÆüÕýýýü¶ü¶ü¶ücý3ýxü¿ý+ýxÿ.üüpüpüpüpý*üpüw<É‹ÁåÉ.É: : üÉ3º¶efqe²žs׊‹ÛøÿçøÿóDÿí€ÿò™ÿá›ÿÛµy}ÉuÉyÉ{\ÉLs\É?ÉyçÉüÉÉLsÉÓÉÉãÿúãÿüLs{=LsN\ãÿüFqS…ºµ¦¡•FqÀ¼ åqS…Zkºåqµ¦·¿¼=®xJvkåqÑJº²qqÑd¡•GpŸ;Gp³‡µ¡•åq¡•³‡?Éê§ôq—W½ÿá—WGp³AOpLsåq0‹²qšÉ«ÿ@G³G¿ìrwxs³‡sFqUÉë-~OÛd$s6˜såqã,J7Opºfq9ÿÛLsìqìÄ×ɺ–sçÉ5U s–s sÉÉJÿúáÉ–s‡\É\\ÿ–ÀT\ÉJÿú®ÉüÉà#Éy}É}ÉáÉ@eÉž(!‡üÉüÉ®ÉTçÉÉLsÉÓÉ–sãÿúà#ãy{=6É|¯ŽÉÀÉ©<É}É–o£Óˆç{ïp·º4ºˆkìq5FA…3º3ºÕºL º;ºåq;ººfq©<¼=×p¼;rºº–Rº‰º§>Qº·ºdq¼ÁÐtìqìq/4ºdq+o9Á9ÿô9ÿÛ8L0º7/Õº3º¼=;ºxs³‡*`ŠÓþÁ D3 GÉÁLsåk7ɘÁsS[Ú2Lsåq@R2@R2ðs<q sq pv9˜xs³‡–sfq;ûÚýý³ý³ùÊX÷ÖXøX.ÉjÁ}!·&ÓɺáÉ4ºfG¹8þÉ=ºž(5F!‡A…®ÉÕº®ÉÕº®!Õ=Ú2§*ÉIÁÉÁ¦ÉSÁs‹q–sfqãÿú©<ãÿü¼=ãÿü¼={=¼;yÿút|¯º–|¯º–|¯º‡Ó‡Ó\Éž(5F?ÉÕ¿56].ÉIÁ6ÉrÁ|¯º–É2Á9Áyç{yç{ËÛ{ÉìqLuìqLuìqž(5F!‡A…T ŸXüÉ3ºüÉ3ºLsåqLsåqLsåq–odqà#¼=à#¼=à#¼=|¯º–áÉ4ºÉQºfG¹8{=¼;{=¼;}‘·q ‘-qÌÉô«nɵ«“6¨.çɽÁ3sGq/ÿú°ê¤S…TL ZTóL'ÉêºAˆãtLsqéD‹V®ÉÕº¥T>L¦ÉLºXÉvº!²Û²]ZÛ²-²¼Û²à²]‡¼D¼`¼èÛ²ºF ¨d#iU²Ò’Õ Û²´xgZ%¨U²Û²d¤–²ó M¼|x2LsRnuu‹²àäçÿÿ>ZË®ºCqNº®qººèºCqº,º׺ûq®ºÝjºŒ®,ÿÔÿÙýº< Ë®{n0º®®Ê®ºozºÊ®)àoqF~®²ðãdD«ÿÿDÇÇcc/NDãdc\ÑÅ\шfcYº XLX^X:º.ºÅX:º0¹ʈLX;XŒXOºoX.º4X1¹XºÿºQX¿X­º„X«XBĺbˆ¥ˆSº(º…Ð…•Ûü‹Û?“ã9ÿµ9lÝÿ«9lC‚9Áˆ‚1‹ˆ‚ˆ‚***}}Ýÿ«Ýÿ« Ä‚ Ä‚ ¬‚ ¬‚ffÆuÆuXÿìK‚5k˜ÐôŒà“1‹Ýÿ«C‚C‚ÜÜÜÜÜÜÈì˜OOÜóL¸LLRLLL¯L‡LUL<L<LdL…™‹²\Wˆ‚5kÉVzˆ‚ˆ‚ˆ‚ˆ‚ˆ‚ˆ‚ˆ‚ˆ‚*******}}}}}}}}}Ýÿ«Ýÿ«üÿ«=ÿ«âÿ«=ÿ«Ýÿ«Ýÿ«Ýÿ« Ä‚ Ä‚ Ä‚ ¬‚ ¬‚fÆuK‚K‚K‚K‚K‚K‚5k5k)‚n‚)‚˜˜˜)‚)‚)‚)‚)‚)‚ÐÐÐÐà“à“à“à“à“–*Ýÿ«Ýÿ«Ýÿ«Ýÿ«C‚C‚C‚1‹L¸LLRLLLRLjLÐL<L<Ld‡ááááááÖÖ9Á’qd=¼=;º;ºÀq;º¡qÁ=xºåÁÍ=¬ÁÈ=D=;º=ßÁ=ÁËpÈ==Àq=Á=Á.ÁÀqÀqÙB¤¿[B[šÕ‚È‚È{d{dãÿì°]‚x‹‰Ümx‹€s[º")>WE_IIöY"º~h~h@€sx‹2Os Osx‹MËoû`P{Püšû@û@û@û@üþü§û`ûNzBz®ÿÓa\î¼d“ýûû>üNûüš‡ c c]cc Y]‚d–ji::þxÞnno­nìd$P<Py <õx¾<xÿ‚Öd@2 PKn÷‚ö‚ÖdídÊZ ƒ÷nxõ‚‹yýxì‚üd‚Ì<Á<Ä‚‚oÄ<ÀnèPd$d¦Z‹ddd)hd$dZ„d.d.‚Jdd$d^d.‚<Z. šddJd$d$<.‚’Z.d$ƒ)d.‚¢d$xdd$dodŸdjZd’Pd•n—dyyyy'É'É'É'É'w'w®É­®É­®É­¼ÉɼÉÉ'ɼÉw¼Éw'w ÉX‰c^c^‰‰%‰‰ºH‰ ɉ‰‰¸E ÉïwyyyyÕwÕwÕwÕwÕwÕw®Éy®É­®É­¼Éw¼Éw¼Éw¼ÉwÕw‰‰‰Û²Û²Û²Û²×w×w×w×w×y×y^ɲ^ɲ^ɲlÉ4wlÉ4w”É4y”É4y”ðy‰²²íwyFÉÉÉFFFÉÉáÉ*F…ɇɅɇÉáÉ*FáÉ*F…ɇɅɇɅðA‰A8F3ÉF3ÉFÉÉÉFFFÉÉáÉ*F…ɇɅɇÉáÉ*FáÉ*F…ɇɅɇɅðz‰z‰áwuÉuÉuÉáwáwáwuÉuÉþÉ&wøÉÉøÉÉþÉ&wþÉ&wøÉÉøÉÉøð‰‰‰ÐwÐFÐFÐ ÐwÐwÐwÐFÐFŽÉGwyÉÐFyÉÐFÐF͉Ÿ‰͉ÐwÐFÐFÐFÐwÐwÐwÐFÐFŽÉGwyÉ=FyÉ=FŽÉGwŽÉGwªÉ=FªÉ=F͉ÕwÓFÓÉÓÉÓÉÓFÓFÓFÓÉÓÉ­ÉFVÉ+ÉVÉ+É­ÉF­ÉFVÉ+ÉVÉ+ÉVðY‰]‰Y‰²F²F²F"F"F"F"FGÉúFGÉúFGÉúF ÉÌF ÉÌF ÉÌF ÉÌF ‰wÉÉÉwwwÉÉÁÉ?w‡ÉŒÉ‡ÉŒÉÁÉ?wÁÉ?w‡ÉŒÉ‡ÉŒÉ‡ðY‰‰à‰SÉSwSwSÉSÉSÉÓÉÓÉÓÉÓFÓFÓF­ÉFY‰Õwy–y–y–y–ÏMÏMÏwÏwdÉw‰Û²Û²Û²Û²Û²Û²×S×S×y×y”É4y‰¥F¥w¥w¥F¥F¥w¥w‚‰Éà‰`‰`‰`‰`‰`‰`‰`‰š‰¥F¥w¥F¥w ‰ ‰ ‰‰‰ ‰ ‰™‰•‰ÐFÐFÐwÐwÐFÐF͉%w%!%!%w%w%!%!Y É)É#s¿‰¿‰u`‰ z‰ ‰ ‰ ‰ ‰ ‰ ‰Ñÿìñÿì²ÿìsÿì 4ÿì õÿìñÿì²ÿìsÿì 3ÿì õÿìüÿì¿ÿì‚ÿì Eÿì ÿìñÿì²ÿìpÿì 2ÿì õÿìüÿìÿìOÿì £ÿì 3ÿìwÿìqÿì¼=½ Û{°>fq׺×$íºS‚9Á(¢ºª º3ºåqfyqyqy3/qåqåq2—Ð2Ð2©<˜ºå®•®/¼=‹V3X5xª³¼=ƒ—2—¹ZLr èuá//SçHÊ||ÿ½NÎYÅÅ÷H„G €ÿü°pû+"M"M>G/Mmu>GVGVGâTàR>GnzhuüuEuOGöGOGOGmu\#=nÂnüuV&7yûGSGé%nzu=nV&7yûKySGé%ºÊùtV29‘>GöGöGOGâT_Ýÿé>G=nIÿzIIàÿVÿzá[qüuüuIÿéÖuEqOGOGâFKÿé\#^YGäu@zV&î7~7î7#7OGü[ü[ü[ü[üBüByç{}ɸ}ɺ}ɺ–sfq)Éq)Éq)Éq)Éq)ÉqÉìqÉìqÉìqÉìqÉìqšÉÑ/3sqɸɺÉÿíɺ\9ÿÓ\9ÿô?É¢º?É¢º?É¢ºuÉMÉuMÿýuÉ9ÿôuÉ9ÿÞçÉ˺çÉ˺çÉ˺üɺüɺüɺüɺLsåqLsåqLsåqLsåqÓɺÓɺÉJºÉJºÉJºÉJT‡+o‡+o‡+o‡+o‡+oãÿú#7ãÿú#7ãÿú#7ãÿú#7Û²®Û²®Û²®Û²®Û²®y¼=y¼=éD‹VéD‹VéD‹VéD‹VéD‹V{=¼;{=¼;ãÿü¼={\3X{\3X{\3Xº#‹V¼=ç{Ñ/ÑÑ/&²åqyç{yç{yç{yç{yç{yç{yç{yç{yç{yç{yç{yç{ÉìqÉìqÉìqÉìqÉìqÉìqÉìqÉìq\Z9D\É9¿LsåqLsåqLsåqLsåqLsåqLsåqLsåqNgåvNgåvNgåvNgåvNgåvÛ²®Û²®Ý­°Ý­°Ý­°Ý­°Ý­°ãÿü¼=ãÿü¼=ãÿü¼=ãÿü¼='ÉÑ FqFqFqFqFqFqFqFqyy'iªñS…S…S…S…S…S…°°ºÌ0lºººººººº²¯°¶7hx“µ›µ‘µÿ±µÿ»µµÿÓµÿ˵ÿÆ þÌêñåqåqåqåqåqåqoÉÂ̂á•¡•¡•¡•¡•¡•¡•¡•Eû.³‡³‡³‡³‡³‡³‡³‡³‡k¿·Ã‘Ç_žFqFqS…c…º<ºµÿµ¦åqåq¡•¡•³‡³‡FqFqFqFqFqFqFqFqyy'iªñºººººººº²¯°¶7hx“³‡³‡³‡³‡³‡³‡³‡³‡k¿·Ã‘Ç_žFqFqFqFqFqFqFqyy»ÿüŠy†¶†¶¶ºº<ºººpÿüøÿçrÿüøÿóɉ´¶µÿëµÿãµÿصµÿäµÿæ\ÿõ\ÍÿüDÿí~•¶¡•¡•¡•¡•ºº¡•¡•ãÿüãÿüÃÿü™ÿá{ª×ª³‡³‡³‡³‡³‡‡ÿü€ÿòaÿü›ÿÛNs†£V‹™Ìãdãddddÿì‹®‹²‹®‹²%®%®%®%®99¸3¸3­ìWìì‹Ü™ ¼q âqÑ(ý()(Ñ(ý()(¶ 3ž3Á´Ãâ“?“ÿìnÿ§nÿ§ÿª=ÝVþ‰°°`JݓݓúdìØØ=²nÿ§=™‘dnÿ§´8°úN(´f´f‹Ûad´p‹Û‹ÛÇ5Wnz5?5f5\5l5Y5S9‰9‰9‰÷o÷g0u5W5‰5^5b5?5f5\5l5Y5S9‰9‰9‰÷o÷g"MVGOGuVG<uhuTzüu0umuüu\#Vs`…˺" .É—Éé;F_q( .Ð.D]1u¥j Cüü=ü=ü=üûPü=&C&C–süÃ#ÿÖ&<‰<ꤖoÃèI ÌÉHZÂ;”jÃDNÿä‹ hÆR6”nœÈLsbBƒSVÈ,©yÉ(˜ÿü'yõ\ŸXNNîµD?ÉyJ\ ‚Ö}¼WØ¢JTšÉŽ9²högdÿûº(V FhZ —ž$Ò<ÈÊÉ|3£uuãÿüWªZì[ÏOÏÿ=;6QÁ‰Á‰ ö‰Á‰Á^Á‰Á^ÁbÁ?Á‰ÁfÁ‰ÁbÁfÁl‹‰\ÉðÉ„ÉbÉyaõ ‰WÉ{=w= =uÉ–s)ÉçÉ9Á©ÁÁ~Á¼=}=í= ]=Á¼;”;;9Áfqq˺ öy)É öy se–sÁW´d´£´u´£´d´£´ ´ ´ ´ ´d´u´,´´d´¥´u´¥´d´u´d´¥´u´¥´¥´d´v´d´v´d´d´*´Z´¬´Z´¬´Ý´d´-´O´Þ´p´Ó´´d´d´´£´u´u´´£´d´w´d´d´x´v´x´d´d´d´d´u´d´¥´u´¥´d´¤´ ´¼´¼´ ´d´u´d´u´£´£´d´£´u´£´k´u´7´^´H´^´^´^´@´^´^´^´u´z´z´^´u´w´u´d´u´d´d´u´d´7´u´7y‡#_ÉÉø›ZÿúZÿúø¯ø¯¾Ùø¯ø¯¾Ù,œœd´Ù´Ù´Ù²Š´DX===·ÜªÜ´,¯,¯´í°ffÛÛÛÛ+uPuuu+uPuuu+u+u+uyy¡y´Ù´Ù´Ø´Ù´Ù´Ù´¢´ÙдٴٴٴٴٴٴٴٴٴٴٴٴشٴٴٴٶٶÙÏʹٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴڴڴڴÚ`”`”¶°´Ø´Ù´Ù´Ù´Ù´Ù´Ú´Ù´Ù´Ð´Ð´Ð´Ð´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ì´Ì´Ì´Ì´¾´Ù´¾´Ù´¾´¾ÛÛ۴ٴٴٴÙ>Ù>Ù´»´»´»´»´»´»´»´»´»´»´»´»´»ø¯ø¯ø¯ø¯*¯*¯ø¯ø¯ø¯ø¯ø¯ø¯ø¯ø¯´Ù´Ù´Ù´Ù´Ù´Ùyy´b´y*îÛÈÛÈÛÈ´´ÿúÿúŒŒ‚‹Ûù´ÙÙÙÙÙÙ´ÙÜcÜc´¾´Ù´Ò´Ò´|´Ù´Ù´Ù a” a”´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´á´Ù´Ù´Ù´Õ–ìììXø¯¾Ùø¯ø¯¾Ùø¯ø¯Xø¯¾Ùø¯¾ÙøÙÑJÑr’´£´£´£´£è;°Ç°Çxôxdxôxd´Ù÷´ÙÀ°À†À°À†+¯+* 8œ 8œ Pœ 8œ Œx Pü–µ¦º³‡Fq 8œü#°°°°°°°°°°£¨££¨£¨+¯´7ºü–'Yÿƒ’,˜,˜,˜,˜,˜,˜,˜,˜,˜,˜ÑÿìÑÿìÑÑÈÑ<Ñ<ÑÑÈÑ<Ñ<ÑÑÈÑÑÑÈÑÈÑÿìÑÿìÑÿìÑÿìÑÑÑÈÑÈÑÿìÑÿìÑÿìÑÿìÑÑÑÈÑÈÑÈÑÈÑÈÑÈÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑ<Ñ<ÑÑÈÑÿìÑxÑÑxÑxÑÿìÑÿìÑÿìÑÑxÑxÑÿìÑÿìÑÿìÑÑxÑxÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÑÿìÑÿìÑÑÿ§Ñÿ§Ñÿ§ÑÿìÑÑhÑÑÿìÑÈÑhÑÈÑÿìÑÈÑÿìÑÈ'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì''ÿì'ÿì'ÿì'ÿì'q'ÿì''ÿì'ÿì'ÿì'ÿì'ÿì''ÿì'ÿ캺ººººººººlºlºººgºgº'''''''''''''''''ûpôûpûrûpûpûpûpûpûpûpûpûp7p7ºTºúúúûpûp''''¸3ººººº'''ôpººººûpûpûpûp'''¤º¤ºܺܺ',«h,d,ª,ƒ,…,…•ª+ª,ª}}_}} ÷Œ ‘,¸,·,·Bš,d,˜,¬,¬,Ÿ,«,¬,¬,²ß“,±ß“,},¬,ª,dZdøª2ªEª\ª,ª,²,ª¯ª,«,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,‡WªWªWª,ª,Ý,ªé¯ܯܯ,¢,S,À,ø,,ì,],·,À,ç,,m,«,E,©,À,°,A,É,â,U,¶,Q,0,É,â,U,¶,L,0,C,¹,X,ä,B,¶,X,ä,ØƬ¬,x,¼Ƶܬß­ü¬ „,¬,œ,œ,œ,œ,œ,œ,œ,œ,¬,ª,ª,ª,1ô–ô–ô–ô–ô–ô–,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,X,X,j,Æ, T},y,},),Â,,,,í,í,džª ¯·¢ f¯9¯´ ´Ï´€´ ´´´ú´d´T´ ÀÒ´±ܯÜYܰܰÌxÜŽÜD´V´V´V´Vܯ´´V´´I´V´V´x´„´³´+´¶´5´¶´X´Š´3´í´´¯´ñ´ü´p´p´p´p´R´ ´>´p´»´T´V´S´T´W´W´/´V´0´/´0´0´0´2´„´˜´p´@´T´»´T´T´T´p´§´§´¡´¡´n´n´T´V´¡´¶´œ´‚´¡´a´a´T´T,f,z,z,z,z,ª´´°´”®”xN®Nx´>´ž´N´n´X´~´ ´‘´‘´´´¹´Û´#´9´U´w´Ä´l´f´¡,˜,˜,˜,˜,˜,˜,˜,˜,˜,˜´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´u´ü´u´ü´u´u´u´u´u´u´u´ä´ä´ä´u´u´ì´u´u´u´+´+´´´´´<´‚´¥´u´§´§´u´§´s´–´¢´¢´unOôö°ö¯·¤s·s¤´[´Y´O´O Bu xd xu xd xd xu xd xd xu xd xu xuÜÜ,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,´d´u´´wOwOßß´ÙÙÙÙÙÙÙÙô´Ù´Ù::: šu+u+u+u+u+u+u+u+u+u+u+ÿ¾+u+u+u+u+k´´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ú´Ú´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´µ´ ´µ´ ´7´7´^´^´µ´ ´µ´ ´7´^°u°u°H°Hºººº''''ºô$ô$ü–ü–ü"ôpôMôMu 9 uÿ×Ó ÉçH#ÿèɺ?É¢º{\3X@sçÉy@sà= D±V¼h<É‹ÁGpPåqíbfÿér ‡{\º{Â2„PгiIPlÃŽÛh¡PõmÃPihÂhsŽsh­h½fchŸ{ŸdÄPÂh¸h¼P¼V÷z]P·<±`¦FPPÄdÂz½|"h5z,qssu@xC@~–yyɃv–ÿÛ{\í–{\ssg–)É?>8–{\(–ÉoŸo:oüÉ÷Ì\É:o\ÉŸcssÉÉþ–ss–s$d{=–súÉyÉÉNs‰ÉNs6?´Ù°Ç°Ç?“,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª}ÉÓÉÓF)Éãÿúãÿú3s?É?ÿÕ–s s{\šÉšÉçÉüÉuɇÉ;yyÉ3£ÉéD{=ãÿü}‘yyɃ\ÉLsÛ²Û²u#sf¯f’ůůf’f¯´¯´¯r+dÔɵ¦ pv9˜;<@>£s¼pÐÓ¾ÁeKkˆT5L mɺLsåqØs³q Ýs&q:Bÿúz<ãÿú©<|¯ºòÖòÖòÖòÖòÖòÖòÖòÖòÖòÖòÖòÖòÖòÖòÖôfôfÃÃÉىÆsÆsɺÿú­7ê¤S…íº+o ÿá{  ë{ #Ù{Å‹{Å‹{¬‹{ se? ªqÉ#Á§Sjxt ¢ Ýs&qÓ ÿûß222Lsq× ÿû× ÿûu 9Áâɺ²ð 553Å|¯æM.ÉUº3?¢üJ+hÿ—'GRºšwÓFçÉ\É ˜DµÂçn`#ZçµÂçn`nçµÂçn`nçµÂç#Z`nçµÂ3ÖЖЖЖЖ¤n¤nýnn®o¤n9nnqn¤n Yn¶n¸‚ôn¤n·nOn¸‚Ùnª2ún·n)n¶n¶n¹ƒ1p¶n·ƒÊn¸‚!2£n¬x¤n¤n¥nn¤nszwddddddddddd$d$d$dKdKdKdKdKd_<_<_<_<_<_<åqƒ/ / /¼/¼/}/ão « ® ‘® }® <®ʈV¥JNÙ®1X?º,X¿X׺uX`´Ù«X«N«X«XYºYºYº XLX^X:ºØY?Y0¹¤YLX;XŒXoX2X1¹ºÿº¿X­º„X«XB.º X;XÿºXˆ‚Û‚:ÿìjÿ숂ۂ:ÿìjÿ숂ۂ:ÿìjÿ숂ۂ:ÿìjÿ숂ۂ:ÿìjÿ숂ۂ:ÿìjÿìK‚H‚Óÿì ÿìK‚H‚Óÿì ÿì**òÿì*ÿì**òÿì*ÿì**òÿì*ÿì**òÿì*ÿì}3}}3}}3}}3}Ýÿ«jÿ«Ýÿ«jÿ«)‚)‚Ïÿìkÿì)‚)‚Ïÿìkÿì)‚)‚Ïÿìkÿì)‚)‚Ïÿìkÿìà““à““:ÿìjÿì–8ÿì°ÿ옾ÏÿìkÿìÝÿ«"ÿ«Ýÿ«"ÿ«Ýÿ«"ÿ«Ýÿ«"ÿ«C‚«‚:ÿìjÿì:ÿìjÿìC‚«‚:ÿìjÿìüpý*XXÿìXiXXXÿìXXÿìXXÿìXÿôXÿìXXÿìã9ÿµpÿµ9lplÝÿ«"ÿ«9lplC‚«‚:ÿìjÿì9ÁpÁˆ‚Û‚:ÿìjÿì1‹J‘ˆ‚Û‚:ÿìjÿ숂ۂ:ÿìjÿì**òÿì*ÿì**òÿì*ÿì**òÿì*ÿì}3}}3}Ýÿ«jÿ«Ýÿ«jÿ« Ä‚ 3‚´ÿì#ÿì Ä‚ 3‚´ÿì#ÿì ¬‚ Í‚Ëÿìðÿì ¬‚ Í‚Ëÿìðÿìf˜^ÿìÿìf˜^ÿìÿìÆuBuÆÿìÜÿìÆuBu/ÿìÜÿìK‚H‚Óÿì ÿì5k¬kÓÿì ÿ옾ÏÿìkÿìÐpÿì¦ÿìôŒSŒIÿì ÿìà““:ÿìjÿì1‹J‘8ÿì°ÿìÝÿ«"ÿ«C‚«‚C‚«‚:ÿìjÿìÿ.Æÿ.ÿåÆÿåÆTÆT4dÜÈ€dÎÈdÈdÈ„–È:–DÈÈ_È jÈ ÈdÈ:–}ÈòȰ–ÚȈ–’dÈ}–x–zd8–vÈvÈ„ddDÈd}–‹d,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ªíÙÉèÖÉcÉ3s$f"ÿ–É=É3ÄLrˆªÿú¤±ÈÝDrl¨ÿüK{ª”fqª”ìo¹/ªqåºÏæÏÿ×5ºÏæ "ºåºåqªqªqߺ+o¹7ê±Ü=HVhLÿ=¸Xy}É–s)ÉÉšÉ3sÉŒ—\ÿ–?ÉuÉçÉüÉLsÓÉLsɇãÿúÛ²yéD{=ãÿü{\ç{ºfqqìqÑ/qº9Á9ÿÛ¢º9Á˺ºåqºqJº+o#7®¼=‹V¼;¼=3Xˆk‚œZ”qA‹j‡á–œdž¨‹9Áˆ‚*}Ýÿ«Ýÿ«*fC‚˜ÐôŒà“ Ä‚ÆuK‚ ¬‚5kÝÿ« Ä‚ˆ‚ˆ‚*} ¬‚fÆuˆ‚à“K‚5k4ÿìVÿìÎÿìVÿì4ÿìÉÿìjÿìßÿì4ÿìÿìÆÿìÓÿì/ÿìÓÿìÿì4ÿì4ÿìVÿì/ÿì/ÿì@ÁbÁ¨ÁbÁÍÁ@Á?Á¹Á@Á $Á6ÁCÁ ;ÁCÁ $Á@Á@ÁbÁ ;ÁÍÁ6Á@ÁCÁ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È@Ù/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/ÈX™ xKW= @ªWªWª Y_WªWªWªWªWWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWª Y_WªWªWªW#WªWª ÕªWªWªWªW: Y`W:W=W=W=W=W=W=ÿ¹ü×ýsü¶ý üÏüÏüÇüÇýšüæüN––Û‚:ÿìjÿìH‚Óÿì ÿì¬kÓÿì ÿì:ÿìjÿì¶Û‚:ÿìjÿìÛ‚:ÿìjÿì*òÿì*ÿì*òÿì*ÿì*òÿì*ÿì*òÿì*ÿì_üÕ9îþòx’x’x’x“x“x’x’xvx‹xvx‹xvx‹x‹xvxvxƒxƒxƒx‹üš,âÿ«âÿ«pÿì¦ÿì«‚:ÿìjÿìjÿ«9ÁJ‘–qâq9–ÏOÏÿ9ÿÓ9¿²ðŒ—´­ÈÈÈÈÈÈÜÜ:Á:ÿì:ÿì’q’ÿì’ÿìd=dÿìdÿì¼=¼ÿì¼ÿì;º;ÿì;ÿì;º;ÿì;ÿìÀqÀÿìÀÿì;º;ÿì;ÿì¡q¡ÿì¡ÿìÁÿìÿì=ÿìÿìxºxÿìxÿìåÁåÿìåÿìÍ=ÍÿìÍÿì¬Á¬ÿì¬ÿìÈ=ÈÿìÈÿìD=DÿìDÿì;º;ÿì;ÿì=ÿìÿìßÁßÿìßÿì=Á=ÿì=ÿìËpËÿìËÿìÈ=ÈÿìÈÿì=ÿìÿìÀqÀÿìÀÿì=Á=ÿì=ÿì=Á=ÿì=ÿì.Á.ÿì.ÿìÀqÀÿìÀÿìÀqÀÿìÀÿìüì,ª,ª,ª,ª,ª,ª,ª,ª³—.ÉjÁ®3}3}3}3}3}jÿ«jÿ«jÿ«jÿ«jÿ« 3‚´ÿì#ÿì 3‚´ÿì#ÿì 3‚´ÿì#ÿì Í‚Ëÿìðÿì Í‚Ëÿìðÿì˜^ÿìÿìBuÆÿìÜÿìH‚Óÿì ÿìH‚Óÿì ÿìH‚Óÿì ÿì¬kÓÿì ÿì¬kÓÿì ÿìn‚òÿìòÿì)‚Ïÿìkÿì¾Ïÿìkÿì¾Ïÿìkÿì)‚Ïÿìkÿì)‚Ïÿìkÿì)‚Ïÿìkÿìpÿì¦ÿìpÿì¦ÿìpÿì¦ÿì“:ÿìjÿì“:ÿìjÿì“:ÿìjÿì55??4ÿìÝÝŸ#ä¥í¥ õ¥ä¥í¥ õ¥ä¥ä¥ä¥ Gÿø Gÿø GÆ GÆ PR PR PRþ¥䥥¥¥¥¥¥¥¥¥ÿ£¥¥¥¥—?ø §0 ê$ÿÓ%ÿ·*K-r294K7ÿD9ÿˆ:ÿ­;ÿš<ÿ R&YÿÉ\ÿÜ‚ÿÓƒÿÓ„ÿÓ…ÿÓ†ÿÓ”9•9–9—9˜9Ÿÿ ´&µ&¶&·&¸&¿ÿÜÁÿÜÂÿÓÄÿÓÆÿÓàK&ÿD:ÿ $ÿÓ$ÿÜ$ÿÜ$$9$&ÿÜ$*ÿÜ$2ÿÜ$4ÿÜ$7ÿa$9ÿ}$:ÿ$<ÿa$FÿÜ$GÿÜ$HÿÜ$Iÿ·$RÿÜ$TÿÜ$WÿÜ$Yÿˆ$Zÿ­$\ÿu$mÿ·$‚9$ƒ9$„9$…9$†9$‰ÿÜ$”ÿÜ$•ÿÜ$–ÿÜ$—ÿÜ$˜ÿÜ$Ÿÿa$©ÿÜ$ªÿÜ$«ÿÜ$¬ÿÜ$­ÿÜ$´ÿÜ$µÿÜ$¶ÿÜ$·ÿÜ$¸ÿÜ$¿ÿu$Áÿu$Â9$Ä9$Æ9$ÈÿÜ$ÉÿÜ$ÊÿÜ$ËÿÜ$ÌÿÜ$ÍÿÜ$ÎÿÜ$ÏÿÜ$ÑÿÜ$ÓÿÜ$ÕÿÜ$×ÿÜ$ÙÿÜ$ÛÿÜ$ÝÿÜ$ÞÿÜ$àÿÜ$âÿÜ$ÿÜ$ÿÜ$ÿÜ$ÿÜ$ÿÜ$ÿÜ$$ÿa$%ÿÜ$&ÿa$'ÿÜ$6ÿ$7ÿ­$8ÿa$9ÿu$:ÿa$ˆÿÜ$¬ÿÜ$­ÿÜ$®ÿÜ$¯ÿÜ$Üÿa$ÝÿÜ$ðÿÜ$óÿÜ$ôÿa$õÿu$ }ÿ$ ~ÿ­$ ÿ$ €ÿ­$ ÿ$ ‚ÿ­$ ïÿa$ ðÿu$ þþø$ ÿÿ$ /%&ÿÜ%*ÿÜ%2ÿÜ%6ÿÜ%9ÿÁ%:ÿ·%<ÿ%mÿÁ%}ÿÜ%‰ÿÜ%”ÿÜ%•ÿÜ%–ÿÜ%—ÿÜ%˜ÿÜ%Ÿÿ%ÈÿÜ%ÊÿÜ%ÌÿÜ%ÎÿÜ%ÞÿÜ%àÿÜ%âÿÜ%äÿÜ%ÿÜ%ÿÜ%ÿÜ%ÿÜ%ÿÜ% ÿÜ%"ÿÜ%6ÿ·%8ÿ%:ÿ%¬ÿÜ%®ÿÜ%ÚÿÜ%ðÿÜ% }ÿ·% ÿ·% ÿ·% ïÿ% þÿ% ÿÿ% ÿ­&<ÿÜ&mÿÜ&}ÿÜ&ŸÿÜ&8ÿÜ&:ÿÜ&ôÿÜ& ïÿÜ& ÿ&'$ÿÜ'9ÿÜ'<ÿ'mÿÜ'}ÿÜ'‚ÿÜ'ƒÿÜ'„ÿÜ'…ÿÜ'†ÿÜ'Ÿÿ'ÂÿÜ'ÄÿÜ'ÆÿÜ'8ÿ':ÿ'ôÿ' ïÿ' þÿÓ' ÿÿÉ' ÿD)þ·)ÿa)$ÿD)6ÿÜ)7ÿÜ)DÿD)Hÿ)Lÿk)Rÿ·)Uÿk)Xÿ)\ÿD)‚ÿD)ƒÿD)„ÿD)…ÿD)†ÿD)¢ÿD)£ÿD)¤ÿD)¥ÿD)¦ÿD)§ÿD)ªÿ)«ÿ)¬ÿ)­ÿ)´ÿ·)µÿ·)¶ÿ·)·ÿ·)¸ÿ·)»ÿ)¼ÿ)½ÿ)¾ÿ)¿ÿD)ÁÿD)ÂÿD)ÃÿD)ÄÿD)ÅÿD)ÆÿD)ÇÿD)Õÿ)×ÿ)Ùÿ)Ûÿ)Ýÿ)ñÿk)õÿk)ÿ·)ÿ·)ÿ·)ÿk)ÿk)ÿk)ÿÜ)ÿÜ) ÿÜ)"ÿÜ)$ÿÜ)&ÿÜ)(ÿÜ)+ÿ)-ÿ)/ÿ)1ÿ)3ÿ)5ÿ)9ÿD)­ÿ·)¯ÿ·)ÚÿÜ)ÜÿÜ)ñÿ·)õÿD) ðÿD) þÿÓ) þˆ*7ÿ·*<ÿš*mÿÜ*}ÿÜ*Ÿÿš*&ÿ·*:ÿš* þÿÓ* ÿÿÓ* ÿÉ+ÿÜ+ þÿ·+ ÿÿÁ+ ÿ·-ÿ·-$ÿÜ-mÿÜ-}ÿÜ-‚ÿÜ-ƒÿÜ-„ÿÜ-…ÿÜ-†ÿÜ- þÿ·- ÿÿÁ- ÿ.ÿ).$ÿÜ.&ÿ.2ÿ.7ÿa.8ÿÉ.:ÿ·.<ÿ·.DÿÜ.Hÿš.Rÿš.Xÿš.\ÿk.mÿ}.‚ÿÜ.ƒÿÜ.„ÿÜ.…ÿÜ.†ÿÜ.‰ÿ.”ÿ.•ÿ.–ÿ.—ÿ.˜ÿ.›ÿÉ.œÿÉ.ÿÉ.žÿÉ.Ÿÿ·.¢ÿÜ.£ÿÜ.¤ÿÜ.¥ÿÜ.¦ÿÜ.§ÿÜ.ªÿš.«ÿš.¬ÿš.­ÿš.´ÿš.µÿš.¶ÿš.·ÿš.¸ÿš.»ÿš.¼ÿš.½ÿš.¾ÿš.¿ÿk.Áÿk.Èÿ.Îÿ.Ýÿš.&ÿa.0ÿÉ.1ÿš.:ÿ·. þÿÁ. ÿÿÁ/ÿÜ/$//2ÿ·/7þæ/8ÿš/9ÿ/:ÿD/<þð/HÿÜ/RÿÜ/XÿÜ/\ÿD/‚//ƒ//„//…//†//”ÿ·/•ÿ·/–ÿ·/—ÿ·/˜ÿ·/›ÿš/œÿš/ÿš/žÿš/Ÿþð/ªÿÜ/«ÿÜ/¬ÿÜ/­ÿÜ/´ÿÜ/µÿÜ/¶ÿÜ/·ÿÜ/¸ÿÜ/»ÿÜ/¼ÿÜ/½ÿÜ/¾ÿÜ/¿ÿD/ÁÿD/ÝÿÜ/&þæ/0ÿš/1ÿÜ/:þð/ þþa/ ÿýæ292ÿ­2ÿÜ2$ÿÜ29ÿÜ2;ÿ}2<ÿ2mÿÜ2‚ÿÜ2ƒÿÜ2„ÿÜ2…ÿÜ2†ÿÜ2Ÿÿ2:ÿ2 þÿÓ2 ÿÿÜ2 ÿD3ÿÓ3þÁ3$ÿ}3<ÿÓ3Dÿ¤3Hÿ·3LÿÓ3QÿÜ3Rÿ·3UÿÜ3VÿÜ3XÿÜ3mÿÜ3‚ÿ}3ƒÿ}3„ÿ}3…ÿ}3†ÿ}3ŸÿÓ3¢ÿ¤3£ÿ¤3¤ÿ¤3¥ÿ¤3¦ÿ¤3§ÿ¤3ªÿ·3«ÿ·3¬ÿ·3­ÿ·3³ÿÜ3´ÿ·3µÿ·3¶ÿ·3·ÿ·3¸ÿ·3»ÿÜ3¼ÿÜ3½ÿÜ3¾ÿÜ3Ýÿ·3 ÿÜ3ÿÜ3ÿÜ3!ÿÜ3#ÿÜ31ÿÜ3:ÿÓ3 þ&3 ÿ&3 þ·494 þÿÓ4 ÿÿÜ4 ÿ}5ÿ­5ÿ·5ÿÁ5$ÿ­5&ÿš57ÿk59ÿ5:ÿ­5<ÿ}5DÿÓ5Hÿ¤5Rÿ¤5Xÿ¤5\ÿ5mÿ5}ÿÜ5‚ÿ­5ƒÿ­5„ÿ­5…ÿ­5†ÿ­5‰ÿš5Ÿÿ}5¢ÿÓ5£ÿÓ5¤ÿÓ5¥ÿÓ5¦ÿÓ5§ÿÓ5ªÿ¤5«ÿ¤5¬ÿ¤5­ÿ¤5´ÿ¤5µÿ¤5¶ÿ¤5·ÿ¤5¸ÿ¤5»ÿ¤5¼ÿ¤5½ÿ¤5¾ÿ¤5¿ÿ5Áÿ5Èÿš5Îÿš5Ýÿ¤5&ÿk51ÿ¤5:ÿ}5 þÿk5 ÿÿ}5 ÿÜ6$&6‚&6ƒ&6„&6…&6†&7ÿD7ÿ 7ÿ7$ÿa7&ÿˆ77ÿÜ7Dþ­7Fþ¤7Hþ¤7LÿÁ7Rþ¤7UþÓ7Vþ­7XþÉ7Zþ­7\þÁ7mÿD7}ÿ7‚ÿa7ƒÿa7„ÿa7…ÿa7†ÿa7‰ÿˆ7¢ÿ7£þ­7¤ÿ7¥ÿ7¦ÿ7§ÿ7©þ¤7ªþà7«þ¤7¬þà7­þà7´þô7µþ¤7¶þô7·þô7¸þô7»þç7¼þÉ7½þç7¾þç7¿þÁ7ÁþÁ7Èÿˆ7Éþ¤7Îÿˆ7Ïþ¤7Ýþ¤7þÓ7þÓ7!þ­7#þ­7&ÿÜ71þÉ7 ÿÿÓ7 þø8=ÿÜ8?ÿÜ9ÿˆ9þø9ÿY9$ÿ}92ÿÜ9Dÿa9Hÿa9LÿÓ9Rÿa9Xÿu9\ÿÉ9mÿN9}ÿ9‚ÿ}9ƒÿ}9„ÿ}9…ÿ}9†ÿ}9”ÿÜ9•ÿÜ9–ÿÜ9—ÿÜ9˜ÿÜ9¢ÿa9£ÿa9¤ÿa9¥ÿa9¦ÿa9§ÿa9ªÿa9«ÿa9¬ÿa9­ÿa9´ÿa9µÿa9¶ÿa9·ÿa9¸ÿa9»ÿu9¼ÿu9½ÿu9¾ÿu9¿ÿÉ9ÁÿÉ9Ýÿa91ÿu9 þæ:ÿ­:ÿ:ÿˆ:$ÿ:Dÿ}:Hÿˆ:LÿÓ:Rÿˆ:Uÿ¤:Xÿ·:\ÿÜ:mÿ:}ÿÜ:‚ÿ:ƒÿ:„ÿ:…ÿ:†ÿ:¢ÿ}:£ÿ}:¤ÿ}:¥ÿ}:¦ÿ}:§ÿ}:ªÿˆ:«ÿˆ:¬ÿˆ:­ÿˆ:´ÿˆ:µÿˆ:¶ÿˆ:·ÿˆ:¸ÿˆ:»ÿ·:¼ÿ·:½ÿ·:¾ÿ·:¿ÿÜ:ÁÿÜ:Ýÿˆ:ÿ¤:ÿ¤:1ÿ·: þÿÜ: þø;ÿš;&ÿk;2ÿ};7ÿÜ;Hÿ¤;mÿ;‰ÿk;”ÿ};•ÿ};–ÿ};—ÿ};˜ÿ};ªÿ¤;«ÿ¤;¬ÿ¤;­ÿ¤;Èÿk;Îÿk;Ýÿ¤;&ÿÜ; þÿa; ÿÿ­; ÿÓ<ÿ <þa<þð<$ÿa<&ÿ<2ÿ<Dþæ<Hþð<Lÿ·<Rþð<Xÿ<mÿ<}ÿk<‚ÿa<ƒÿa<„ÿa<…ÿa<†ÿa<‰ÿ<”ÿ<•ÿ<–ÿ<—ÿ<˜ÿ<¢þæ<£þæ<¤þæ<¥þæ<¦þæ<§þæ<ªþð<«þð<¬þð<­þð<´þð<µþð<¶þð<·þð<¸þð<»ÿ<¼ÿ<½ÿ<¾ÿ<Èÿ<Îÿ<Ýþð<1ÿ< þÿ< ÿÿÜ< þø=ÿÜ= þÿÜ= ÿÿÜ= ÿÜH[ÿÜIÿIÿkIÿ·IWÿÜIZÿÜI\ÿÜImÿ·I}ÿÜI¿ÿÜIÁÿÜI'ÿÜI þAI ÿNDÿÜNHÿ·NRÿ·NXÿÁN\ÿ·N¢ÿÜN£ÿÜN¤ÿÜN¥ÿÜN¦ÿÜN§ÿÜNªÿ·N«ÿ·N¬ÿ·N­ÿ·N´ÿ·Nµÿ·N¶ÿ·N·ÿ·N¸ÿ·N»ÿÁN¼ÿÁN½ÿÁN¾ÿÁN¿ÿ·NÁÿ·NÝÿ·N1ÿÁQ þÿkQ ÿÿQ ÿ¤R&RÿÜR[ÿÁR þÿkR ÿÿ·R ÿ}Uÿ}UÿDUÿÜUFÿÓUGÿÜUHÿÓUJÿÜUKÿÜUPÿÜUQÿÜURÿÓUTÿÜUUÿÜU[ÿÉUmÿ·U©ÿÓUªÿÓU«ÿÓU¬ÿÓU­ÿÓU³ÿÜU´ÿÓUµÿÓU¶ÿÓU·ÿÓU¸ÿÓUÉÿÓUÏÿÓUÑHUÝÿÓUáÿÜU ÿÜUÿÜUÿÜU ÿVU þÉYÿÉYÿaYÿYmÿÜY}ÿÜY ÿÿÜY þðZÿDZÿZmÿÜZ}ÿÜZ ÿ)[FÿÜ[HÿÁ[RÿÁ[©ÿÜ[ªÿÁ[«ÿÁ[¬ÿÁ[­ÿÁ[´ÿÁ[µÿÁ[¶ÿÁ[·ÿÁ[¸ÿÁ[ÉÿÜ[ÏÿÜ[ÝÿÁ\ÿÜ\þÜ\ÿk\mÿÜ\}ÿÜ\ þÓm%ÿÜm&ÿÜm'ÿÜm*ÿÜm-ÿÜm7ÿm9ÿm:ÿÜm<ÿkmYÿÜmZÿÜm\ÿÜmˆ—m‰ÿÜmŸÿkm¿ÿÜmÁÿÜmÈÿÜmÎÿÜmÐÿÜmàÿÜm&ÿm:ÿk}$ÿ·}%ÿ·}&ÿÜ}'ÿÜ}-ÿÜ}2ÿÜ}7ÿD}9ÿN}:ÿ};ÿ}<ÿ}YÿÜ}ZÿÜ}\ÿÜ}‚ÿ·}ƒÿ·}„ÿ·}…ÿ·}†ÿ·}‰ÿÜ}”ÿÜ}•ÿÜ}–ÿÜ}—ÿÜ}˜ÿÜ}Ÿÿ}¿ÿÜ}ÁÿÜ}ÈÿÜ}ÎÿÜ}ÐÿÜ}&ÿD}:ÿ‚ÿÓ‚ÿÜ‚ÿÜ‚$9‚&ÿÜ‚*ÿÜ‚2ÿÜ‚4ÿÜ‚7ÿa‚9ÿ}‚:ÿ‚<ÿa‚FÿÜ‚GÿÜ‚HÿÜ‚Iÿ·‚RÿÜ‚TÿÜ‚WÿÜ‚Yÿˆ‚Zÿ­‚\ÿu‚mÿ·‚‚9‚ƒ9‚„9‚…9‚†9‚‰ÿÜ‚”ÿÜ‚•ÿÜ‚–ÿÜ‚—ÿÜ‚˜ÿÜ‚Ÿÿa‚©ÿÜ‚ªÿÜ‚«ÿÜ‚¬ÿÜ‚­ÿÜ‚´ÿÜ‚µÿÜ‚¶ÿÜ‚·ÿÜ‚¸ÿÜ‚¿ÿu‚Áÿu‚Â9‚Ä9‚Æ9‚ÈÿÜ‚ÉÿÜ‚ÊÿÜ‚ÌÿÜ‚ÍÿÜ‚ÎÿÜ‚ÏÿÜ‚ÑÿÜ‚ÕÿÜ‚×ÿÜ‚ÙÿÜ‚ÛÿÜ‚ÝÿÜ‚ÞÿÜ‚àÿÜ‚âÿÜ‚ÿÜ‚ÿÜ‚ÿÜ‚ÿÜ‚ÿÜ‚ÿÜ‚$ÿa‚%ÿÜ‚&ÿa‚'ÿÜ‚6ÿ‚7ÿ­‚8ÿa‚9ÿu‚:ÿa‚ðÿÜ‚ñÿÜ‚ }ÿ‚ €ÿ­‚ ÿ‚ ‚ÿ­‚ ïÿa‚ ðÿu‚ þþø‚ ÿÿ‚ /ƒÿÓƒÿ܃ÿ܃$9ƒ&ÿ܃*ÿ܃2ÿ܃4ÿ܃7ÿaƒ9ÿ}ƒ:ÿƒ<ÿaƒFÿ܃Gÿ܃Hÿ܃Iÿ·ƒRÿ܃Tÿ܃Wÿ܃YÿˆƒZÿ­ƒ\ÿuƒmÿ·ƒ‚9ƒƒ9ƒ„9ƒ…9ƒ†9ƒ‰ÿ܃”ÿ܃•ÿ܃–ÿ܃—ÿ܃˜ÿ܃Ÿÿaƒ©ÿ܃ªÿ܃«ÿ܃¬ÿ܃­ÿ܃´ÿ܃µÿ܃¶ÿ܃·ÿ܃¸ÿ܃¿ÿuƒÁÿuƒÂ9ƒÄ9ƒÆ9ƒÈÿ܃Éÿ܃Êÿ܃Ìÿ܃Íÿ܃Îÿ܃Ïÿ܃Ñÿ܃Õÿ܃×ÿ܃Ùÿ܃Ûÿ܃Ýÿ܃Þÿ܃àÿ܃âÿ܃ÿ܃ÿ܃ÿ܃ÿ܃ÿ܃ÿ܃$ÿaƒ%ÿ܃&ÿaƒ'ÿ܃6ÿƒ7ÿ­ƒ8ÿaƒ9ÿuƒ:ÿaƒðÿ܃ñÿ܃ }ÿƒ ÿƒ €ÿ­ƒ ÿƒ ‚ÿ­ƒ ïÿaƒ ðÿuƒ þþøƒ ÿÿƒ /„ÿÓ„ÿÜ„ÿÜ„$9„&ÿÜ„*ÿÜ„2ÿÜ„4ÿÜ„7ÿa„9ÿ}„:ÿ„<ÿa„FÿÜ„GÿÜ„HÿÜ„Iÿ·„RÿÜ„TÿÜ„WÿÜ„Yÿˆ„Zÿ­„\ÿu„mÿ·„‚9„ƒ9„„9„…9„†9„‰ÿÜ„”ÿÜ„•ÿÜ„–ÿÜ„—ÿÜ„˜ÿÜ„Ÿÿa„©ÿÜ„ªÿÜ„«ÿÜ„¬ÿÜ„­ÿÜ„´ÿÜ„µÿÜ„¶ÿÜ„·ÿÜ„¸ÿÜ„¿ÿu„Áÿu„Â9„Ä9„Æ9„ÈÿÜ„ÉÿÜ„ÊÿÜ„ÌÿÜ„ÍÿÜ„ÎÿÜ„ÏÿÜ„ÑÿÜ„ÕÿÜ„×ÿÜ„ÙÿÜ„ÛÿÜ„ÝÿÜ„ÞÿÜ„àÿÜ„âÿÜ„ÿÜ„ÿÜ„ÿÜ„ÿÜ„ÿÜ„ÿÜ„$ÿa„%ÿÜ„&ÿa„'ÿÜ„6ÿ„7ÿ­„8ÿa„9ÿu„:ÿa„ðÿÜ„ñÿÜ„ }ÿ„ ÿ„ €ÿ­„ ÿ„ ‚ÿ­„ ïÿa„ ðÿu„ þþø„ ÿÿ„ /…ÿÓ…ÿÜ…ÿÜ…$9…&ÿÜ…*ÿÜ…2ÿÜ…4ÿÜ…7ÿa…9ÿ}…:ÿ…<ÿa…FÿÜ…GÿÜ…HÿÜ…Iÿ·…RÿÜ…TÿÜ…WÿÜ…Yÿˆ…Zÿ­…\ÿu…mÿ·…‚9…ƒ9…„9……9…†9…‰ÿÜ…”ÿÜ…•ÿÜ…–ÿÜ…—ÿÜ…˜ÿÜ…Ÿÿa…©ÿÜ…ªÿÜ…«ÿÜ…¬ÿÜ…­ÿÜ…´ÿÜ…µÿÜ…¶ÿÜ…·ÿÜ…¸ÿÜ…¿ÿu…Áÿu…Â9…Ä9…Æ9…ÈÿÜ…ÉÿÜ…ÊÿÜ…ÌÿÜ…ÍÿÜ…ÎÿÜ…ÏÿÜ…ÑÿÜ…ÕÿÜ…×ÿÜ…ÙÿÜ…ÛÿÜ…ÝÿÜ…ÞÿÜ…àÿÜ…âÿÜ…ÿÜ…ÿÜ…ÿÜ…ÿÜ…ÿÜ…ÿÜ…$ÿa…%ÿÜ…&ÿa…'ÿÜ…6ÿ…7ÿ­…8ÿa…9ÿu…:ÿa…ðÿÜ… }ÿ… ÿ… €ÿ­… ÿ… ‚ÿ­… ïÿa… ðÿu… þþø… ÿÿ… /†ÿÓ†ÿ܆ÿ܆$9†&ÿ܆*ÿ܆2ÿ܆4ÿ܆7ÿa†9ÿ}†:ÿ†<ÿa†Fÿ܆Gÿ܆Hÿ܆Iÿ·†Rÿ܆Tÿ܆Wÿ܆Yÿˆ†Zÿ­†\ÿu†mÿ·†‚9†ƒ9†„9†…9††9†‰ÿ܆”ÿ܆•ÿ܆–ÿ܆—ÿ܆˜ÿ܆Ÿÿa†©ÿ܆ªÿ܆«ÿ܆¬ÿ܆­ÿ܆´ÿ܆µÿ܆¶ÿ܆·ÿ܆¸ÿ܆¿ÿu†Áÿu†Â9†Ä9†Æ9†Èÿ܆Éÿ܆Êÿ܆Ìÿ܆Íÿ܆Îÿ܆Ïÿ܆Ñÿ܆Õÿ܆×ÿ܆Ùÿ܆Ûÿ܆Ýÿ܆Þÿ܆àÿ܆âÿ܆ÿ܆ÿ܆ÿ܆ÿ܆ÿ܆ÿ܆$ÿa†%ÿ܆&ÿa†'ÿ܆6ÿ†7ÿ­†8ÿa†9ÿu†:ÿa†ðÿ܆ñÿ܆ }ÿ† ÿ† €ÿ­† ÿ† ‚ÿ­† ïÿa† ðÿu† þþø† ÿÿ† /ˆ þÿ­ˆ ÿÿ¤ˆ ÿ‰<ÿ܉mÿ܉}ÿ܉Ÿÿ܉:ÿ܉ ÿ&’$ÿÜ’9ÿÜ’<ÿ’mÿÜ’}ÿÜ’‚ÿÜ’ƒÿÜ’„ÿÜ’…ÿÜ’†ÿÜ’Ÿÿ’ÂÿÜ’ÄÿÜ’ÆÿÜ’8ÿ’:ÿ’ôÿ’ ïÿ’ þÿÓ’ ÿÿÉ’ ÿD”9”ÿ­”ÿÜ”$ÿÜ”9ÿÜ”;ÿ}”<ÿ”mÿÜ”‚ÿÜ”ƒÿÜ”„ÿÜ”…ÿÜ”†ÿÜ”Ÿÿ”:ÿ” þÿÓ” ÿÿÜ” ÿD•9•ÿ­•ÿÜ•$ÿÜ•9ÿÜ•;ÿ}•<ÿ•mÿÜ•‚ÿÜ•ƒÿÜ•„ÿÜ•…ÿÜ•†ÿÜ•Ÿÿ•:ÿ• þÿÓ• ÿÿÜ• ÿD–9–ÿ­–ÿÜ–$ÿÜ–9ÿÜ–;ÿ}–<ÿ–mÿÜ–‚ÿÜ–ƒÿÜ–„ÿÜ–…ÿÜ–†ÿÜ–Ÿÿ–:ÿ– þÿÓ– ÿÿÜ– ÿD—9—ÿ­—ÿÜ—$ÿÜ—9ÿÜ—;ÿ}—<ÿ—mÿÜ—‚ÿÜ—ƒÿÜ—„ÿÜ—…ÿÜ—†ÿÜ—Ÿÿ—:ÿ— þÿÓ— ÿÿÜ— ÿD˜9˜ÿ­˜ÿܘ$ÿܘ9ÿܘ;ÿ}˜<ÿ˜mÿܘ‚ÿܘƒÿܘ„ÿܘ…ÿܘ†ÿܘŸÿ˜:ÿ˜ þÿÓ˜ ÿÿܘ ÿD›=ÿÜ›?ÿÜœ=ÿÜœ?ÿÜ=ÿÜ?ÿÜž=ÿÜž?ÿÜŸÿ ŸþaŸþðŸ$ÿaŸ&ÿŸ2ÿŸDþæŸHþðŸLÿ·ŸRþðŸXÿŸmÿŸ}ÿkŸ‚ÿaŸƒÿaŸ„ÿaŸ…ÿaŸ†ÿaŸ‰ÿŸ”ÿŸ•ÿŸ–ÿŸ—ÿŸ˜ÿŸ¢þ柣þ柤þ查þ柦þ柧þ柪þðŸ«þðŸ¬þðŸ­þðŸ´þðŸµþðŸ¶þðŸ·þðŸ¸þðŸ»ÿŸ¼ÿŸ½ÿŸ¾ÿŸÈÿŸÎÿŸÝþðŸ1ÿŸ þÿŸ ÿÿÜŸ þø ÿk ÿ·  þÿÜ  ÿD¡&¡ þÿ¡ ÿÿ¡ ÿ­ª[ÿÜ«[ÿܬ[ÿÜ­[ÿܲ þÿ¤² ÿÿ² ÿ·³ þÿk³ ÿÿ³ ÿ¤´&´ÿÜ´[ÿÁ´ þÿk´ ÿÿ·´ ÿ}µ&µÿܵ[ÿÁµ þÿkµ ÿÿ·µ ÿ}¶&¶ÿܶ[ÿÁ¶ þÿk¶ ÿÿ·¶ ÿ}·&·ÿÜ·[ÿÁ· þÿk· ÿÿ·· ÿ}¸&¸ÿܸ[ÿÁ¸ þÿk¸ ÿÿ·¸ ÿ}¿ÿÜ¿þÜ¿ÿk¿mÿÜ¿}ÿÜ¿ þÓÁÿÜÁþÜÁÿkÁmÿÜÁ}ÿÜÁ þÓÂÿÓÂÿÜÂÿÜÂ$9Â&ÿÜÂ*ÿÜÂ2ÿÜÂ4ÿÜÂ7ÿaÂ9ÿ}Â:ÿÂ<ÿaÂFÿÜÂGÿÜÂHÿÜÂIÿ·ÂRÿÜÂTÿÜÂWÿÜÂYÿˆÂZÿ­Â\ÿuÂmÿ·Â‚9ƒ9„9Â…9†9”ÿÜ•ÿÜ–ÿÜ—ÿܘÿÜŸÿa©ÿܪÿÜ«ÿܬÿÜ­ÿÜ´ÿܵÿܶÿÜ·ÿܸÿÜ¿ÿuÂÁÿuÂÂ9ÂÄ9ÂÆ9ÂÈÿÜÂÊÿÜÂÌÿÜÂÍÿÜÂÎÿÜÂÑÿÜÂÓÿÜÂÕÿÜÂ×ÿÜÂÙÿÜÂÛÿÜÂÝÿÜÂÞÿÜÂâÿÜÂÿÜÂÿÜÂÿÜÂÿÜÂÿÜÂÿÜÂ$ÿaÂ%ÿÜÂ&ÿaÂ'ÿÜÂ6ÿÂ7ÿ­Â8ÿaÂ9ÿuÂ:ÿaÂðÿÜÂñÿÜ }ÿ ÿ €ÿ­Â ÿ ‚ÿ­Â ïÿa ðÿu þþøÂ ÿÿ /ÄÿÓÄÿÜÄÿÜÄ$9Ä&ÿÜÄ*ÿÜÄ2ÿÜÄ4ÿÜÄ7ÿaÄ9ÿ}Ä:ÿÄ<ÿaÄFÿÜÄGÿÜÄHÿÜÄIÿ·ÄRÿÜÄTÿÜÄWÿÜÄYÿˆÄZÿ­Ä\ÿuÄmÿ·Ä‚9ă9Ä„9Ä…9Ć9Ä”ÿÜÄ•ÿÜÄ–ÿÜÄ—ÿÜĘÿÜÄŸÿaÄ©ÿÜĪÿÜÄ«ÿÜĬÿÜÄ­ÿÜÄ´ÿÜĵÿÜĶÿÜÄ·ÿÜĸÿÜÄ¿ÿuÄÁÿuÄÂ9ÄÄ9ÄÆ9ÄÈÿÜÄÊÿÜÄÌÿÜÄÍÿÜÄÎÿÜÄÑÿÜÄÓÿÜÄÕÿÜÄ×ÿÜÄÙÿÜÄÛÿÜÄÝÿÜÄÞÿÜÄâÿÜÄÿÜÄÿÜÄÿÜÄÿÜÄÿÜÄÿÜÄ$ÿaÄ%ÿÜÄ&ÿaÄ'ÿÜÄ6ÿÄ7ÿ­Ä8ÿaÄ9ÿuÄ:ÿaÄðÿÜÄñÿÜÄ }ÿÄ ÿÄ €ÿ­Ä ÿÄ ‚ÿ­Ä ïÿaÄ ðÿuÄ þþøÄ ÿÿÄ /ÆÿÓÆÿÜÆÿÜÆ$9Æ&ÿÜÆ*ÿÜÆ2ÿÜÆ4ÿÜÆ7ÿaÆ9ÿ}Æ:ÿÆ<ÿaÆFÿÜÆGÿÜÆHÿÜÆIÿ·ÆRÿÜÆTÿÜÆWÿÜÆYÿˆÆZÿ­Æmÿ·Æ‚9ƃ9Æ„9Æ…9Ɔ9Æ”ÿÜÆ•ÿÜÆ–ÿÜÆ—ÿÜÆ˜ÿÜÆŸÿaÆ©ÿÜÆªÿÜÆ«ÿÜÆ¬ÿÜÆ­ÿÜÆ´ÿÜÆµÿÜÆ¶ÿÜÆ·ÿÜÆ¸ÿÜÆÂ9ÆÄ9ÆÆ9ÆÈÿÜÆÊÿÜÆÌÿÜÆÍÿÜÆÎÿÜÆÑÿÜÆÓÿÜÆÕÿÜÆ×ÿÜÆÙÿÜÆÛÿÜÆÝÿÜÆÞÿÜÆâÿÜÆÿÜÆÿÜÆÿÜÆÿÜÆÿÜÆ$ÿaÆ%ÿÜÆ&ÿaÆ'ÿÜÆ6ÿÆ7ÿ­Æ8ÿaÆ:ÿaÆðÿÜÆñÿÜÆ }ÿÆ ÿÆ €ÿ­Æ ÿÆ ‚ÿ­Æ ïÿaÆ þþøÆ ÿÿÆ /È<ÿÜÈmÿÜÈ}ÿÜÈŸÿÜÈ:ÿÜÈ ÿ&Î<ÿÜÎmÿÜÎ}ÿÜΟÿÜÎ:ÿÜÎ ÿ&Ð$ÿÜÐ9ÿÜÐ<ÿÐmÿÜÐ}ÿÜЂÿÜЃÿÜЄÿÜÐ…ÿÜІÿÜПÿÐÂÿÜÐÄÿÜÐÆÿÜÐ8ÿÐ:ÿÐôÿÐ ïÿÐ þÿÓÐ ÿÿÉÐ ÿDÒ$ÿÜÒ9ÿÜÒ<ÿÒmÿÜÒ}ÿÜÒ‚ÿÜÒƒÿÜÒ„ÿÜÒ…ÿÜÒ†ÿÜÒŸÿÒ:ÿÒ þÿÓÒ ÿÿÉÒ ÿDÝ[ÿÜà7ÿ·à<ÿšàmÿÜà}ÿÜàŸÿšà&ÿ·à:ÿšà þÿÓà ÿÿÓà ÿÉûÿÜû$/û2ÿ·û7þæû8ÿšû9ÿû:ÿDû<þðûHÿÜûRÿÜûXÿÜû\ÿDû‚/ûƒ/û„/û…/û†/û”ÿ·û•ÿ·û–ÿ·û—ÿ·û˜ÿ·û›ÿšûœÿšûÿšûžÿšûŸþðûªÿÜû«ÿÜû¬ÿÜû­ÿÜû´ÿÜûµÿÜû¶ÿÜû·ÿÜû¸ÿÜû»ÿÜû¼ÿÜû½ÿÜû¾ÿÜû¿ÿDûÁÿDûÝÿÜû&þæû0ÿšû1ÿÜû:þðû þþaû ÿýæÿÿÜÿ$/ÿ2ÿ·ÿ7þæÿ8ÿšÿ9ÿÿ:ÿDÿ<þðÿHÿÜÿRÿÜÿXÿÜÿ\ÿDÿ‚/ÿƒ/ÿ„/ÿ…/ÿ†/ÿ”ÿ·ÿ•ÿ·ÿ–ÿ·ÿ—ÿ·ÿ˜ÿ·ÿ›ÿšÿœÿšÿÿšÿžÿšÿŸþðÿªÿÜÿ«ÿÜÿ¬ÿÜÿ­ÿÜÿ´ÿÜÿµÿÜÿ¶ÿÜÿ·ÿÜÿ¸ÿÜÿ»ÿÜÿ¼ÿÜÿ½ÿÜÿ¾ÿÜÿ¿ÿDÿÁÿDÿÝÿÜÿ&þæÿ0ÿšÿ1ÿÜÿ:þðÿ þþaÿ ÿýæOÿ? þÿk ÿÿ ÿ¤ÿ­ÿ·ÿÁ$ÿ­&ÿš7ÿk9ÿ:ÿ­<ÿ}DÿÓHÿ¤Rÿ¤Xÿ¤\ÿmÿ}ÿÜ‚ÿ­ƒÿ­„ÿ­…ÿ­†ÿ­‰ÿšŸÿ}¢ÿÓ£ÿÓ¤ÿÓ¥ÿÓ¦ÿÓ§ÿÓªÿ¤«ÿ¤¬ÿ¤­ÿ¤´ÿ¤µÿ¤¶ÿ¤·ÿ¤¸ÿ¤»ÿ¤¼ÿ¤½ÿ¤¾ÿ¤¿ÿÁÿÈÿšÎÿšÝÿ¤&ÿk1ÿ¤:ÿ} þÿk ÿÿ} ÿÜÿ}ÿDÿÜFÿÓGÿÜHÿÓJÿÜKÿÜPÿÜQÿÜRÿÓTÿÜUÿÜ[ÿÉmÿ·©ÿÓªÿÓ«ÿÓ¬ÿÓ­ÿÓ³ÿÜ´ÿÓµÿÓ¶ÿÓ·ÿÓ¸ÿÓÉÿÓÏÿÓÑHÝÿÓáÿÜ ÿÜÿÜÿÜ ÿV þÉÿ­ÿ·ÿÁ$ÿ­&ÿš7ÿk9ÿ:ÿ­<ÿ}DÿÓHÿ¤Rÿ¤Xÿ¤\ÿmÿ}ÿÜ‚ÿ­ƒÿ­„ÿ­…ÿ­†ÿ­‰ÿšŸÿ}¢ÿÓ£ÿÓ¤ÿÓ¥ÿÓ¦ÿÓ§ÿÓªÿ¤«ÿ¤¬ÿ¤­ÿ¤´ÿ¤µÿ¤¶ÿ¤·ÿ¤¸ÿ¤»ÿ¤¼ÿ¤½ÿ¤¾ÿ¤¿ÿÁÿÈÿšÎÿšÝÿ¤&ÿk1ÿ¤:ÿ} þÿk ÿÿ} ÿÜÿ}ÿDÿÜFÿÓGÿÜHÿÓJÿÜKÿÜPÿÜQÿÜRÿÓTÿÜUÿÜ[ÿÉmÿ·©ÿÓªÿÓ«ÿÓ¬ÿÓ­ÿÓ³ÿÜ´ÿÓµÿÓ¶ÿÓ·ÿÓ¸ÿÓÉÿÓÏÿÓÑÿÜÝÿÓáÿÜ ÿÜÿÜÿÜ ÿV þÉ $& ‚& ƒ& „& …& †&"$&"‚&"ƒ&"„&"…&"†&&ÿD&ÿ &ÿ&$ÿa&&ÿˆ&7ÿÜ&Dþ­&Fþ¤&Hþ¤&LÿÁ&Rþ¤&UþÓ&Vþ­&XþÉ&Zþ­&\þÁ&mÿD&}ÿ&‚ÿa&ƒÿa&„ÿa&…ÿa&†ÿa&‰ÿˆ&¢þ­&£þ­&¤þ­&¥þ­&¦þ­&§þ­&©þ¤&ªþ¤&«þ¤&¬þ¤&­þ¤&´þ¤&µþ¤&¶þ¤&·þ¤&¸þ¤&»þÉ&¼þÉ&½þÉ&¾þÉ&¿þÁ&ÁþÁ&Èÿˆ&Éþ¤&Îÿˆ&Ïþ¤&Ýþ¤&þÓ&þÓ&!þ­&#þ­&&ÿÜ&1þÉ& ÿÿÓ& þø0=ÿÜ0?ÿÜ:ÿ :þa:þð:$ÿa:&ÿ:2ÿ:Dþæ:Hþð:Lÿ·:Rþð:Xÿ:mÿ:}ÿk:‚ÿa:ƒÿa:„ÿa:…ÿa:†ÿa:‰ÿ:”ÿ:•ÿ:–ÿ:—ÿ:˜ÿ:¢þæ:£þæ:¤þæ:¥þæ:¦þæ:§þæ:ªþð:«þð:¬þð:­þð:´þð:µþð:¶þð:·þð:¸þð:»ÿ:¼ÿ:½ÿ:¾ÿ:Èÿ:Îÿ:Ýþð:1ÿ: þÿ: ÿÿÜ: þø?ÿÜ? þÿÜ? ÿÿÜ? ÿÜ ò$ÿÓ ò%ÿ· ò*K ò-r ò29 ò4K ò7ÿD ò9ÿˆ ò:ÿ­ ò;ÿš ò<ÿ òR& òYÿÉ ò\ÿÜ ò‚ÿÓ òƒÿÓ ò„ÿÓ ò…ÿÓ ò†ÿÓ ò”9 ò•9 ò–9 ò—9 ò˜9 òŸÿ ò´& òµ& ò¶& ò·& ò¸& ò¿ÿÜ òÁÿÜ òàK ò&ÿD ò:ÿ þ$þø þ%ÿÁ þ&ÿ· þ'ÿÁ þ)ÿÁ þ*ÿ· þ+ÿÁ þ-ÿÁ þ.ÿÁ þ/ÿÁ þ2ÿ· þ3ÿÁ þ4ÿ· þ5ÿÁ þ;ÿˆ þ=ÿÜ þIÿ· þQÿ þRÿk þUÿ þYÿ· þZÿ· þ\ÿ· þ‚þø þƒþø þ„þø þ…þø þ†þø þˆþ} þ‰ÿ· þ”ÿ· þ•ÿ· þ–ÿ· þ—ÿ· þ˜ÿ· þ ÿÁ þ¡ÿÁ þ²ÿ· þ³ÿ þ´ÿk þµÿk þ¶ÿk þ·ÿk þ¸ÿk þ¿ÿ· þÁÿ· þÈÿ· þÎÿ· þÐÿÁ þàÿ· þûÿÁ þÿÿÁ þ ÿ þÿÁ þÿ þÿÁ þÿ þ?ÿÜ þÿÁ $& %ÿ· &ÿ 'ÿ· )ÿ· *ÿ· +ÿ· -/ .ÿ· /ÿ· 2ÿ 3ÿ· 4ÿ 5ÿ· 7þæ 9þˆ :ÿ ;ÿ· <þˆ IÿÜ Qÿ· Rÿ· Uÿ· Yÿ Zÿ< \ÿ ‚& ƒ& „& …& †& ˆ& ‰ÿ ”ÿ •ÿ –ÿ —ÿ ˜ÿ Ÿþˆ  ÿ· ¡ÿ· ²ÿ· ³ÿ· ´ÿ· µÿ· ¶ÿ· ·ÿ· ¸ÿ· ¿ÿ Áÿ Èÿ Îÿ Ðÿ· àÿ· ûÿ· ÿÿ·  ÿ· ÿ· ÿ· ÿ· ÿ· &þæ :þˆ ÿ·ÿDÿ ÿ$ÿa&ÿˆ7ÿÜDþ­Fþ¤Hþ¤LÿÁRþ¤UþÓVþ­XþÉZþ­\þÁmÿD}ÿ‚ÿaƒÿa„ÿa…ÿa†ÿa‰ÿˆ¢ÿ£þ­¤ÿ¥ÿ¦ÿ§ÿ©þ¤ªþà«þ¤¬þà­þà´þôµþ¤¶þô·þô¸þô»þç¼þɽþç¾þç¿þÁÁþÁÈÿˆÉþ¤ÎÿˆÏþ¤Ýþ¤þÓþÓ!þ­#þ­&ÿÜ1þÉ ÿÿÓ þøÿ)$ÿÜ&ÿ2ÿ7ÿa8ÿÉ:ÿ·<ÿ·DÿÜHÿšRÿšXÿš\ÿkmÿ}‚ÿ܃ÿÜ„ÿÜ…ÿ܆ÿ܉ÿ”ÿ•ÿ–ÿ—ÿ˜ÿ›ÿÉœÿÉÿÉžÿÉŸÿ·¢ÿÜ£ÿܤÿÜ¥ÿܦÿܧÿܪÿš«ÿš¬ÿš­ÿš´ÿšµÿš¶ÿš·ÿš¸ÿš»ÿš¼ÿš½ÿš¾ÿš¿ÿkÁÿkÈÿÎÿÝÿš&ÿa0ÿÉ1ÿš:ÿ· þÿÁ ÿÿÁDÿÜHÿ·Rÿ·XÿÁ\ÿ·¢ÿÜ£ÿܤÿÜ¥ÿܦÿܧÿܪÿ·«ÿ·¬ÿ·­ÿ·´ÿ·µÿ·¶ÿ··ÿ·¸ÿ·»ÿÁ¼ÿÁ½ÿÁ¾ÿÁ¿ÿ·Áÿ·Ýÿ·1ÿÁOgÿØPgÿ±Qgÿ£RgÿœSgÿØUgÿØVgÿ±Wgÿ£Xgÿ±YgÿØ[gÿØ\gÿ±]gÿ£^gÿ±_gÿØagÿØbgÿœcgÿ£dgÿ±egÿØDDDD¨ìDlÔ(˜ðŒà  D l ¸ < ¬ ¬ ” PètH\¬$hà¸84ä|ü\°X´ül”ØÔ|ˆT h!`!Ð"T#4$ð%”&X''x'Ä((\(ˆ(Ø**œ+4+Ì, -8..x.È/D040p141¬2P2ð345`5Ü6`7„9¨;,<ø=Ä> >Ð?¼@@@@@ÔA BXCpD”DÜF$FÜHHÜI¨IàJ KXK¤LLŒM,MèN8NìOHOtOÔP,P´Q„Q¤QÄQäRÜRôS S8ShS˜TØU°UÈUàUøVV@VXVpV”V¸W„W´WÌWäXXDXtY<ZtZŒZ¤ZÔ[ [$[¬\Ô\ø]]<]h] ]à_œ_´_Ì_ä``,`D`\`€`¤bTblb„bœb¼bèccpdädüee4ede|ffLfxf fÌfìggg4gLgpgˆg g¸gÜgôh h4hDiii<i`i„iœi´iÌiäjj4jXj|j”j¬jÐjèkkkHkŒll¨lÌlðmm8m\m€m˜m°màn,nPntn˜n¼nÔnìoÜoôp,pDphp€p¤p¼pðqlqür rDr\rtr¤rÐrès€ttHtht”t´tÌtäu„v¬vÄvÜvôw w0wXwpwˆw°wÔwìxx,xTxlx„x°xÔyXyôz zDztz˜zÄzè{{${<{T{l{„{¨{Ì{ð||4|L|d|||¤|¼|ä}<~~Ð~à”€ €ÈX‚‚Ô‚äƒxƒô„œ…t…І€‡8‡¸ˆp‰<ŠP‹ ‹|‹ìŒ¨¼ŽÄ”¤‘H‘`‘x’ ’Ì“d”$”à•´–ü— —¨˜@˜Ð™l™øšš(šÔ›`œìžô  à¡°¢À£,£ ¤4¤À¥4¥È¦¦ ¦ ¦°¦È¦à¦ø§§(§@§X§p§ˆ§¨§È§ð¨¨0¨P¨p¨”¨¬¨Ä¨Ü¨ô© ©$©<©T©d©|©”©¬©Ä©Ü©ôªÈ«¼«è¬¬¬\¬t¬Œ¬¤¬¼¬Ô¬ì­­,­D­\­t­Œ®$®¼®Ô®ì¯¯¯4¯L¯d¯|¯”¯¬¯Ä¯Ü¯ô° °$°<°T°l°„°œ°´°Ì°ä°ü±±,±D±\±t±Œ±¤±¼±Ô±ì²²²¨³<³T³˜´ ´°µ¼¶ ·Œ¸„¸œ¸´¸Ì¸ä¸ü¹¹,¹D¹\¹t¹Œ¹¤¹¼¹Ôº(º¬»»x¼X½<½¬¾D¾Ô¿@¿”ÀLÀ¤Á(Á°ÂŒÃLÃ\ÃÄÄpŠŨÆhÇ$ÈLÈØÉ(ɈʬËDËÜÌ”ÍÍüμÏlÐPÐôÒÒ$Ò4ÓPÔÔ¤ÕˆÖ@ÖÜ×ÐØÄÙ@ÙØÚ„ÚøÛÛ\ÜÜÜèÞÞàß´à¤áLáàâˆããÈäxäˆäðåXåäæXæäç@çœè°éTê`êÔë€ëàìtìèíhî îÄïTïäò ò˜óóðõö$ö´÷H÷Üøtùùœù¬ú|û<ûLûÜüüPýýÄþ€ÿÿØ”8Ä”( lÐ@Ä`ÔdÄ$|ø d œ à ð   ( ` È 0 ¸ D l ” ø l È$Td€ Ðä ŒÜð(Lx” ˆôT€¸ì8`ø0@tÀL€”¬¼ÐœøP¸ÌàôLÀ4H\Äð |˜ä 4XtˆœÀàtÄè 8T„´ÌàLp„˜Àä , h ¤ ¸ ì!!!(!<!˜!´!Ð!ð""\"€"¨"ð#$#„# #´#È#Ü#ì$$$8$`$ˆ$¨%$%˜%°%è&&&P&h&|&¼&Ð'4'H'\'x'”(((D(T(d(”(Ä(ô)$)4)D)x)ˆ) )¸)È**H*`*p*Œ*¨*Ä*Ü*ø++(+8+H+€+ì+ü, ,,Ì,Ü,ì-P-`-p-Ð-à-ð..|.Œ.œ/\/l00°0Ô0ø11(1@1X1p2À3\3Ü4À5646°7x7È8H8Ì8Ü9l:(:8:´;H;ô<ˆ<è=t>4?@?Ô@h@€@˜@°@È@àA AðB˜CPClC„DLDüE¨F`G G°HLH\I IhIØJPJ¬KÄLœM0M¼NpOXOÐP@PôQ¤R8RÐS@S¬THUUU U0U V VV,V<W W˜XX(X@XXXpYYœY´Z`ZpZ€ZZ [8[È\8\P\h\€\Ø\è]h]x]°^<^L_@_ø`¤`äaxaØaèaøbbPb`bpb€cc¸cÈd d|dØeDeÄeÜfPfüg¼hXhhi0iÌjjŒjœkŒlPlÀmmmðnxnÐnào(o8oHoŒoœp„p”pìqhqÄr0r¬rÄs4sØt|u u$uÄvhv€w$w4wDwTwdxx”y$y<yTylyÄzœz¬{L{à|p|à}$}d}À~ä€`€ØÄ‚ ƒƒhƒxƒˆƒÔ„$„<„T„ø…|†t‡`‡€‡ ‡¸‡Ðˆl‰‰P‰èŠŠDŠlЬ‹ðŒ¬ŒÄŒÜxŽŽx@„äDБ`‘Ä’$’<’T’˜’Ü“(“p“¼””¨•H•¸–$–ˆ–è—€˜™ ™èššštšÌšÜ›x›ÀœœLœ”tèžtžÄŸŸpŸ€ \¡X¡ô¢Œ¢œ¢´¢Ì£(£Œ£Ø¤$¤œ¥¥P¥Œ¦¦”¦à§,§<§h§ˆ§¸§ð¨¨¨4¨X¨h¨x¨¨¨¨À¨Ø¨ð©©©(©@©X©p©ˆ©¸©ä©ôªªª4ªLªdª|ª”ª¬ªÄªÜªô« «$«p«¼«Ô«ì¬x­­d­Ä®®d®Ü¯X°(°ô±Ô²¸³l´(´Ìµlµ|¶¶ ·(·¬¸4¸D¸T¸Ô¹T¹¸º º€ºø»d»ü¼ ¼¼,¼<¼¼Ü½ˆ¾8¾à¿Œ¿¼¿ìÀdÀ¼Á,Á€ÁØÂPÂ|ÂÌÃpÃÜÄ(ÄLĬÅ`ŬÆÆÈÇǘÇìȈÈÜÉdɰÊ Ê|Ë(Ë€ËËäÌÌÜÍ”ͼÎ<ÎÄÎÔÏtϬÏÐÏìÐ4ÐHÐÀÐàÑ\ѨÒ$ÒlÒÀÓHÓtÓ¸Ô`ÔÔÕÕ8Õ´Ö@Ö„Ö”×X× ØPØœØÈÙٜ٬Ú<Ú¸ÛtÛàÛðÜ<ܰÜøÝÝ(Ý Þ$Þ4ÞÜß(ßLßtß´ßäà8àœàÄàìálá˜áÔáüâ âlâ˜âÄâàã ãDãpã˜ãàä0älåTåÐæpæÀç<çxçðè`é é`éÔê\êÀë4ììPì´ídíüî¨ïpððÌñXñØòðó˜ó°óÈóàôôXôøõ¨õèö4öTö°öà÷P÷À÷Ø÷ðøø ø8øTølø„øœø´øÌù4ùLù ù¸ùüúúÔúìû°ûÈü4üLüÌüäüüýý,ýèþHþÔþìÿTÿÔ€˜ÄdŒ¨4PÌXl€ 4P€ØTØ@ˆØ( Ô8lÐ € œ ð   8 X p ˆ   ¸ Ð è   0 H ` x  ¨ È à ø  ( @ X p ˆ   ¸ Ø ð   @ X x  ¨ À Ø”¬Ìäü,DØpˆ ¸Ðè0H`x¨Àà@XxPpˆ ¸Ðàø 0@P`à`ÄÔäôxÐd°ô4„à|¬(€¨ì4ä@Ð$xðpÌhÀ @ Œ ø!”!ì"x"¼#(#¨#ð$@$¤%\%ä&&X&€&Ü'H''ø( (`(¤(ä)()„)°*P++ä,Œ-4-è.Ä/00à1¤2d3 3¨4D55Ä6ˆ7L7À8Œ9L:,:Ô;œ|>˜?(?¤?¼@ @AAŒAÔBPB´C,CÈD\DtDøEœFFÄFìGtHH\HpH¼I I JJ¤K(KÌLŒLüNNlOTPdPÌQQhQÜR$RxRÜS@ShSÌT<T°UUŒUÔV$V€VÌW$W¨X,XlX°XðYTY”YüZhZÀ[0[x[À\\L\¼\ü]L]è^0^”__œ_ì`X`Ða<a€aàb€bècDc¬ddddäe0eœff°gg„gàh`h¼i,ixiôjlj¸k0k¤llxlÜmTmÔnLn¸oooðp plpØpðqqq„qœq´qÌr<rTrlr„rœr´rÌrärüss,sDs\stsŒs¤s¼sÔsìtt8tXt”tÐu uPu„uÌuävv,vPvhv€v˜v°vÀvØvèwwdw|w”w¬xx(x@xXxpxˆx x¸xÐxèyyy0yHy`yxyyôz$z4zLz¸zÐ{8{P{h{€{è|||0|H|`|x||¨|À|Ø|ð}} }8}P}h}Ä}Ü}ô~ ~$~ ~¸4LÌäü€|€”€¬€Ä€Ü€ô $<Tl„œ´Ìäü‚t‚È‚à‚øƒƒ(ƒ|ƒ”ƒì„„\„t„Œ„ä„ü……,…D…\…t…Œ…¤…¼…ԅ솆†4†L†d†¼†ô‡,‡D‡|‡”‡Ì‡ä‡üˆ ˆ$ˆ<ˆTˆlˆ„ˆœˆ´ˆÌˆäˆü‰‰,‰D‰\‰t‰Œ‰ÈŠ(ŠHŠÄŠÜ‹\‹t‹ìŒŒŒ”Œ¬ŒÄŒÜŒô $<T¤äŽ8ŽŒޤŽød|”è0H`x¨ÀØð‘‘ ‘8‘P‘ˆ‘Ä’’0’ˆ’ ’ô“ “$“|“”“¬“ēܓô” ”$”<”T”l”„”œ”´”Ì”ä”ü•L•Ж–\–´–Ì—H—`—à—ø˜˜(˜@˜X˜p˜ˆ˜ ˜¸˜Ð˜è™™™0™H™¼šš,šˆš šü››,›ˆ› ›¸›Ð›èœœœ0œHœ`œxœœ¨œÀœØœðhx´ž žŒžðŸŸlŸ„Ÿì  l Ô ì¡P¡h¡€¡ì¢(¢Ü¢ô£¨£À¤x¤¥D¥\¥t¥Œ¥ø¦t¦ð§l§è¨¨¨”¨¬©,©D©\©t©ìªPª¸ªÐ«4«L«°«È¬(¬8¬H¬`¬x¬¬¨¬À¬Ø¬ð­­ˆ®®Œ¯¯,¯D¯\¯t¯Œ¯¤¯¼°0°Ü±\±t±ð²²ˆ² ²ä³ ³\³t³°³È´´´X´Ü´ìµ\µŒµì¶$¶<¶T¶l¶„¶œ¶´¶Ì¶ä··(·X·”·Ø¸(¸P¸€¸¼¹¹P¹„¹Ðº4º°»D»t»¸¼¼|¼ü½D½œ½Ô¾l¿D¿l¿ ¿ÔÀ À\Á8Á¤Á´ÁüÂT„ÃÃ8ÃtÄüÃÌÃÜÃìÃüÄTĬÅ<ÅøÆ0ÆhƬÇÇŒÇœÇØÈÈxÈìÈüÉ ÉÉlɌɜÉÄÉÔÊ0Ê@ÊtÊÀË<ËŒ˼ËìÌ\ÌŒ̨ÌØÍ Í,ÍdÍ”ÍÄÎ$ÎàÏ,ϘÏÀÐÐ<мÑDѬÒ„ÒèÓPÓÄÔlÕÕÖ$ÖHÖ|×׬Ø0ؘØÔÙ ÙpÙ°ÙüÚHÚÄÚìÛLÛ„Ü ܈ÜàÜôÝÝÝ0ÝDÝXÝ´ÝÈÝÜÞ\ÞlÞ¬ß8ßtßÜà<àÀáPáàâ$âhâðã<ãtã¤ãÐä ädä˜äØäøåæ ælæÐççpèè¨èøéPé¸ê0êtêØëë0ë|ëØìDì°ìÐìôíí8ídí”í¬íÄíÜíôî î$î<îTîlî„îœî´îÌîäîüïï,ïDï\ïtïŒï¤ï¼ïÔïìððð4ðTðtðŒð¤ð¼ðÔðìñññ4ñLñdñ|ñ”ñ¬ñÄñÜñôò ò$ò<òTòlò„òœò´òÌòäóóó4óLódó|ó”ó¬óÄóÜóôô ô$ô<ôTôlô„ôœô´ôÌôäôüõõ4õLõdõ|õ”õ¬õÄõÜõôö ö$ö<öTölö„öœö´öÌöäöü÷÷4÷T÷l÷„÷œ÷´÷Ì÷ä÷üøø,øDø\øtøŒø¤ø¼øÔøìùùù4ùLùdù|ù”ù¬ùÄùÜùôú ú$ú<úTúlú„úœú´úÌúäúüûû,ûDû\ûtûŒû¤û¼ûÔûìüüü4üLüdü´üüý”ý¤ý¼ýÔýìþþþ4þLþdþ|þ”þ¬þÄþÜþôÿ ÿ$ÿ<ÿTÿlÿ„ÿœÿ´ÿÌÿäÿü,D\tŒ¤¼Ôì4Ll„œ´Ìäü,D\tŒ¤¼Ôì$<Tl„œ´Ìäü,D\tŒ¤¼Ôì4Ld|”¬ÄÜô $PŒ¤¼Ôì4Ld|˜°Ìè0H`x¨Äàü  0 L d | ” ¬ Ä Ü ô  ( D ` x ” ° Ì è   0 H ` x  ¨ Ä à ü  0 L h „ œ ´ Ì ä ü  , D ` x ” ° È à ø(@XpŒ¤ÀÜô $<Tl„œ´Ðì <XtŒœ´ÄÜì,<Td|Œ¤¼Ôì4Ld|”¬ÄÜô $<Tl„œ´Ìäü,D\tŒ¤¼Ôì4Ld|”¬ÄÜô $<Tl„œ´Ìäü $4D´ÄÜô $<Tp€œ¬Äàø(@Xh€˜°Èäô(@Xpˆ˜°Èàø(DTpˆ˜¨ÀØð <Lhx                  8Ht Ìô $`œÔøT°  @ ˜!!\!x! !à"4"L"L"L"L"L"L"L"L"L#Ø$è%% %@%\%t%”%¸&(&œ&Ì&è'd'x'Ø(8(d(ˆ(¤(ì))L)d)|)˜**<*l*œ*°*à*ø++8+˜+¬,,4,\,œ,è- -H-¬-Ü..............l.°/¼0 0°0Ø1ˆ22H2d2Œ2Ä33t3ˆ3œ3°3Ä3Ø3ì444(4<4P4d4x4Œ4 4´4È4Ü4ð555,5@5T5h5|55¤66È7X7˜88„99ì:¼;h;Ì;ä=˜=à>8?Ä@`@øAŒAøB˜C(C\CÜD@D DÄDäE E4ElE°EèF¨G€GøHI8IÔJlJ|JJ¨KèLØM(M„MäNO$PP„QQDSìT”UHU¸VXWpXlYZ4ZÜ[|[Ü\h\¼\ü]h]x]ˆ^|^°^À^Ð_È`ŒaabXc8cdd¨düe f0f¼g4g|gðhtii|i¬iðjDj´jìk$kPkÔl„m$m\mÄn\n¬nÌnìoo4oToto”o´oÔoôpp4pTptp”p¬p¼pÔpôq qq4qTq|q”q¤q¼qÜqìqür rr,rDrdr|rŒr¤rÄrìsss,sLs\sls|sŒtuŒvlv|vŒvøwwÈxxy(yØzø||L|||¬|Ü}(}t~~Ä\¨ô€<€ˆ€ÄÄ‚‚T‚Ôƒ`„$„è…ü†\†¤†Ü‡‡L‡„‡¼‡ôˆxˆø‰4‰ ŠHŠð‹`‹Ð‹øŒ Œ”(Lh„ èŽ0ŽxŽÀŽÜŽø`àHˆÈ‘‘H‘¤’’@’€’À““@“€“Ü”8””è•0•x•Ä––L–ˆ–Ì——P——ô˜H˜¨™™t™ôšHšŒšÐ›,œœ$œ„œÈlÄž žžÄžøŸHŸ„ X ð¡$¡Œ¢L¢°¢à£D£è¤<¤ ¥D¥˜¥À¦¦H¦à§ §H§Ü§ì¨¨L¨`¨p¨Ð¨è©©˜ªPªpª”«@«ì¬¬t¬œ­`­Œ­´­ô®4®„®œ®¼¯ˆ°À²h³³Ð´˜´¼´à´üµ(µ@µtµ¤µÄ¶$¶„··H·¨¸¸t¸Ü¹\¹Ðºdºô»è¼ˆ½8¾ ¾”¾ì¿¨ÀÀ4ÀTÀtÀ”À¸ÀØÁ4Á ÁèÂ,Âl¸ÂüÃÜÄ`ÄìÅxÅÐÆ0ÆœÇ,ǸÈÈ@ȨÉ ÉTɘÊ ÊŒÊàË4Ë Ì ÌŒÍ͸ÎlΰÎøÏ„Ð ÐHЀÐÔÑ$Ñ´Ò@Ò°Ó ÓdÓ¨ÔÔ€ÔÔÕ$Õ Ö ÖŒÖø×X×p×ÐØØT؈ؼØäÙÙÔÚˆÛXÜÜÈݰÞ”ßTààXà”àøá0áláá¸áÜââ0â`ââÐã ãPã¬ääläðåxå¨åÔæ æDæ°ççlç°çÔèè@ètèÈèøé$éPé´êêHêtê¨ëëXë˜ëØìì4ì˜ìÐííŒîîˆïï\ïÀïøð,ð”ðôñLñ ñØòòdò¸óLóàôHô°ôüõHõÀö8öÀ÷H÷ ÷øøløÜùù ùDùhùÜúDúœú´û(ûˆûüühüÜýDý þþxþ¬ÿ$ÿPÿˆÿ¸ÿäÿüt”´ÔôDl”´(LlŒ¬\¨àL¬ d Ð D T d t „ ´  D | ˜ Ð  $ \ | ˜ ¼ à üP¨àü4ŒÀÜ0\€ôŒ °¼ ˜"”$ü'h'„' '¼'Ø( (D(|(¸(ð)0)x)Ä)è* *0*T*x*œ*À*ä++(+L+p++°+Ð+ô,,D,p,œ,Ä,ô- -H-p-˜-Ä-ð..H.t.œ.Ä.ð//D/l/˜/Ä/ì00<0h00¸0ä1181h1œ1Ð2282l2 2Ø33H3€3´3è44P4„4¨4Ô55,5T5|5¨5Ô6646`6”6À6ì7 7L7x7¬7Ü88T8„8¸8ø9,9\9œ9Ð::@:ˆ:Ì;(;X;ˆ;¸;è<<$ >(>D>`>|>˜>´>Ð>ì??$?@?\?x?”?¨@\CpDD,D@D\DxD”D¸DàEE(EDElEE¬EØF,FDFœFüH8HÀIHKK$KPKlK˜K´KàLL4LPLxL”L¼LØMM MLMhM”M°MÜMøN$N@NlNˆN´NÐNüOOPO”P$PxPàQØRŒSHS¬TT\T¸UU|UÌUôVVXVÐW$WxW¤WÐWüX,XpX´XÐXìYYYdYY¼YäZ ZHZŒZ¸Zà[L[Œ[Ì\ \L\Ì]L]Ì^L^t^œ^Ä^ð_ _8_T_|`l`ØajtmXmmônDn¨o<ppÔq8qÜt`w@wxwðxdx¼z{È||D}8~ ~¤<€€ÈŒ‚P…؆T‡x‰Œ€ˆüŽ`Žät¼‘ì’ˆ““Гð””0”P”p””°”ЖD— —ü˜¨™ÄšXšè› œœ\¸žLžøŸ`ŸÔ l Ð¡¢p£@£´¤X¤´¥P¦<¦¼§äªª¬«È­®$¯¸°°±0±ø²à³t³è´Œ´Ôµt¶<¶¶À·ä¸Ð¹¹l¹Ðº0º„ºÐ»d¼$½ ¿À Á0ÂlÃlÄÅÄÆ´LjÈ”ÉÌË$Ì(ÌÄÍ4ÍèÎÜÐÑÓPÓìÔ¬ÕÕ Õ¼ÕäÕüÖÖ,ÖDÖÄ×טØÙ<Ú`ÛÛ¤ÜHÝPß8áüã¼ää@äÄååðæØçÀèPé0êDë ëüìpì¸í0î4ï€ðÄññ„ñÜò8òóóhóÐô8ôàõÀöÔøDøÜúlûÐý\¨ ¬\ ´ Ì ¸ Ì ´< LŒXPÐ@„´”xÌLÐ0@¨4Ä„  ! !|!Ð"8"œ"ô#¸#ü$T$¤%%Ð'|)p*œ,Ì.,0¤5ø709€:D; ;à=d>ä@DA¤BðD\DÈE4EœFFhF„F F¼FüGHG`GxHTHìI¨JJŒK¬L”MMpM¬MèNN<NdNN¸NäOO<O PP€Q,RlRôT U VX`Yì[`\4]8^P_,`,aDbc<dTe„ff´g|hh¸i€iøjÐk˜l\lŒl¸lämm@mÌmônnpnÄnìooLolo¼p p8php°pøqLqœqèr8rrèsTsøtPt˜tðu|uüvˆwXwèyz<zÈ{({ˆ{Ä{ø|,|T|||”|¬}}X~~ÜØ€ˆ8‚X‚˜‚؃4ƒpƒ¬ƒø„D„È„È„Ü„ð… … …<…X…|……¬…ȅ솆,†P†|††¬†È†ì‡‡,‡P‡|‡˜‡¼‡àˆ ˆ0ˆ\ˆˆˆ¼ˆÐˆì‰‰,‰H‰l‰‰¼‰Ø‰üŠ ŠLŠpŠœŠÈŠü‹‹<‹`‹Œ‹°‹ÜŒŒ<Œ`ŒŒŒ¸ŒìL€¼Ð쎎,ŽHŽlŽ޼ŽØŽü LpœÈü<`Œ°Ü‘‘<‘`‘Œ‘¸‘ì’’L’€’¼’Ø’ü“ “L“p“œ“È“ü” ”L”x”¬”Ø• •@•|• •Ì•ø–,–X–Œ–À–ü—(—\——̘˜<˜x˜¼˜Ð˜ì™™,™H™l™™¼™Ø™üš šLšpšœšÈšü››<›`›Œ›°›Üœœ<œ`œŒœ¸œìL€¼Øüž žLžpžœžÈžüŸ ŸLŸxŸ¬ŸØ   @ |   Ì ø¡,¡X¡Œ¡À¡ü¢(¢\¢¢Ì££<£x£¼£Ø£ü¤ ¤L¤p¤œ¤È¤ü¥ ¥L¥x¥¬¥Ø¦ ¦@¦|¦ ¦Ì¦ø§,§X§Œ§À§ü¨(¨\¨¨Ì©©<©x©¼©àª ª8ªlª˜ªÌ««<«h«œ«Ð¬ ¬@¬|¬¸¬ü­(­\­­Ì®®<®x®¼®ð¯,¯h¯¬¯è°,°p°¼±±T±œ±à²¬³t´Xµ8µ„µÀµü¶0¶d¶Œ¶À¶ô··\·´¸t¹Hº,ºTº¼»8»¤¼P¼ð½d½ô¾ˆ¿,¿°ÀHÀÄÁLÁÐÂ0 ¸ÂØÃÃLÃdÃ|ÔìÃÄÃÜĬÅxÅÈÆÆÜǘÇüÈXÈÜÉ\ÉìÊ|ÊØË<ˤÌÌDÌ€̘̰ÌôÍ<Í„ÍÔÎLÎÈÏ\ÏôÐxÐÀÑÑhÑÈÒÒpÒèÓ\Ô<ÕÕìÖ¼××Pט×àØ(ØpØÌØôÙÙDÙpÙœÙÈÙôÚ,ÚdÚ˜ÚÐÛÛ<ÛhÛ”ÛÀÛèÜÜHÜxܨÝTÝxÝ´ÝøÞ ÞLÞˆÞ¬Þèß0ßpßàà<áxâ(â„â”âäã$ãdã˜ãÌädä´äìåLå˜ææhæÈæðçç˜çäè`è”è¨èÔé€éØê@ê´ë(ëÄì ìtìðílí¨î îˆïïtïÔðð„ððñ8ñ¤òò´óóTó˜óìô<ôœôüõdõØöööð÷L÷¨÷øøDøÐùDú úðû˜ü@üøýPý`ýpý€ýþ|ÿÿÿð€PX¼$„L¸$€ä¬hx¸ÈH¤ D  ¸ œ ü T Ü ¨Œäô0°Àp4ˆt´0Hhˆ¨ÈØð 8Ph€˜°Èàø(@Xpˆ ¸Ðè0H`x¨ÀØð 8Ph€˜°Èàø(@Xpˆ ¸Ðè0H`x¨ÀØèø@P`„”¤Üìü ,<L\l|Œð 0l|Œœ ,<l|Œœ   ˆ ¤ È à ø!,!X!„!¬!¼!Ì!Ü!ì"È#x##¨$ $ˆ$Ø%`%À&&\&œ&à' '8'P'Ä(8(X(x**`*Ä*ü+<+´+Ä+ì,,<,d,Œ,´,Ü--,-P-p-”-¸-Ü-ü.(.T.€.¬.À//H/x/¨/ì0D0È1X1h1ø2$242˜3t3ü4¬55œ5ä6`6¼7L7°8H8X8h8°8ø9$9L9|9¨:0:´;l<t>Ü?8? ?ø@d@„@¤@üAPA`AˆAäB8BHB¨BäC0CÀDtDÔE0EœF F FøGH$HlH¸IPI`IŒIÔJJ,JxJ¤JÄJèK K0KPKdKxKŒK KÄKØKìLLL8LLL`LtLˆL¬LÀLÔLèMM,OØRˆU4WäX8X YY¼ZZˆ[ [Œ[à\D\ô]`]À^4^˜^ð_|_Ì`L`´adaÄbXbÀc4cœddpdäe\e°f(f˜ggˆgìh\hàitjjÐk$k„kôlLl°mmtmØnHn¸oohoÌpDpÄqTqÌrTrÌsPsàtXtàuduØvˆw,w¬xŒyLyÌzÄ{|8|Ô}„~L~d~˜~°~ühà€4€`€¨€äDl„œ¼Üô‚ ‚$‚<‚T‚l‚„‚ ‚¸‚Ђ샃ƒ4ƒLƒdƒ|ƒ”ƒ¬ƒÄƒÜƒô„ „$„<„T„l„„…… …8…P…h…€…˜…°…È…à…ø††(†@†X†p†ˆ† †¸†Ð†è‡‡‡0‡H‡`‡x‡‡¨‡À‡Ø‡ðˆˆ ˆ8ˆPˆhˆ€ˆ˜ˆ°ˆÈˆàˆø‰‰(‰@‰X‰p‰ˆ‰ ‰¸‰Ð‰èŠŠŠ0ŠHŠ`ŠxŠЍЏ‹d‹t‹„‹œ‹´‹Ì‹ä‹üŒŒ,ŒDŒ\ŒtŒŒŒ¤Œ´,D\tŒœŽ@ŽPŽ`ŽxŽލŽÀŽØŽð 8Ph€˜°ÈàP`pˆ                 Èð‘8‘€‘”‘¬‘À‘ô’’’4’H’`’t’Œ’ ’¸’Ì’ä’ô“ “$“<“T“l“„“œ“´“Ì“ä“ü””$”X”p”ˆ” ”¸”Д蕕•0•H•`•x••¨•À•ؕ𖖖¬——˜—°—È—à—ø˜˜l˜„˜œ˜¬™™™0™@šš¤›D›\›t›Œ›¤›´œÀØðžž ž0ž´Ÿ Ÿ¤Ÿ¼ŸÔŸì   œ ô¡„¡œ¡´¡Ì¡ä¡ü¢¢,¢D¢\¢t¢Œ¢¤¢´£€£ì¤t¤„¤ø¥,¥p¥€¦ ¦§ §8§P§h§€§¨¨Ä©T©d©øªª¬ªÄªÜªô« «$«<«T«l«„«œ«ð¬X¬X¬X¬X¬X¬X¬ä­ ­˜­Ä®®T®„®°®ì¯ˆ¯¤¯Ü°°D°t°Ð±`±¨±à²H² ²Ø³³,³p³ì´$´¤´èµ0µTµœµ¬µØµè¶¶T¶p¶Œ¶¨¶Ä¶à··0·\·„·¬·Ø¸¸(¸P¸x¸ ¸Ì¸ô¹¹H¹p¹˜¹À¹èºº<ºdºŒº¸ºà»»0»X»€»¬»Ô»ü¼(¼P¼x¼ ¼È¼ð½½D½l½˜½À½è¾¾8¾`¾Œ¾´¾Ü¿¿0¿X¿€¿¨¿Ð¿üÀ$ÀLÀxÀ ÀÈÀðÁÁ@ÁlÁ”Á¼ÁèÂÂ8Â`ˆ°ÂÜÃÃ,ÃXÀèÃÐÄĬÅÅXÅ”Æ Æ\ƨÆìÇÇxÈȰÈèÉ\ɘÊÊTÊœË@ËÜÌTÌðÍhÍÐΘÏ ÏDÏ ÏäÐ0ÐìÑ`ÑìÒˆÓ$ÓpÔ<Ô˜Õ ÕHÕ¨ÕüÖLÖÖ Ö°ÖÀÖÐÖàÖð××× ×0×@×P×`×p×€×× ×°×À×Ð×à×ðØØØ Ø0Ø@ØPØ`ØpØ€ØØ ذØÀØÐØàØðÙÙÙ Ù0Ù@ÙPÙ`ÙpÙ€Ù٠ٰÙÀÙÐÚ<Ú|Û Û ÛìÜ\ÜèÝ$Þތޜެ޼ÞÌÞÜÞìÞüß ßß,ß<ßLß\ßlß|ߌßœ߬ß¼ßÌßÜßìßüà àà,à<àLà\àlà|àŒàœà¬à¼àÌàÜàìàüá áá4áLââpâˆâôã(ã ã¸äHäXäpäüå å$å<åTålå„å”å¬åÄæ˜ççœç´è<èÌèäéêêêÄêÜêôë ë$ë<ëTëlë„ëÐì„ì°ìèídî ïðXñÔóˆôôÀõÀöüøxú4ü(üäýàÿ˜HDxt° 0 ì è$˜Ì@ü8´ h!à#œ%œ'Ø*T-01Ä3Ì68œ;`>hA˜AÄAüBxC4D0ElFèHœIIÔJÔLMŒOHQ<QøRôT0U¬WhYd[˜\”]Ð_Pa ceDg¸hìj`lnpTrÀutvìx¨z˜|ÔP‚ …†ÄˆÌ‹˜\“L–|–Ø—”˜p™lš,›œ0œÜžŸ$  È¡ ¢€£<£ô¤Ì¥Ä¦€§h¨|©$ªT«d¬P­­Ô®°¯h¯ø°¨±x²²È³°´0µ8¶ ¶ä·l¸¸Ì¹X¹Ôº¬»¤¼¼½”¾œ¿ÌÀ”ÁäÃÄ ÄðÅäÆàÇ´ÈXÊ`ÍHÏpÑÒÓÕ(ÖÖè×ìØÀÙüÛÛàÜÀÝÌÞ¬ßÔà¨áPââœã\äPååÀæ¸çŒè éxêPë(ëøìÄíÄîôïôñ(ò8ó óðôÐõÐ÷Ìø¸ùÌú ûìü°ý”þ”`  @¼œä h ØàX¨h(L´„,Èt¨H¨ä  ( L | ¬ Ð!!„!”!¤"d## $h$x$ˆ$ $¸%%(%H%h%€%˜%°%È%à%ø&&(&@&X&p&ˆ&¨&È&è''˜'ø(H(d(€(œ(¸(Ô(ð) )()D)`)|)˜)´)Ð)ì**$*@*\*x**¬*ä*ü+P+h+€+˜+°+Ð+ð,,l,|,Œ,œ,´,à-8-P-h-Œ-ä...0.H.`.x..¨.À.ø/8/p00 101˜22p2 2Ð2ü3L3¤3ð4<4ˆ4Ð5x6(6Ì7(7€7Ø8p99°: :p:Ì;(;Œ;è”? ?„?ð@T@øA¤BHB¬CC|DDœE(E|EØF,F¤G$GœHDHôIœJJlJÐKhL L¤LôMLMœNNˆNüO€PPŒPÜQ4Q„QÜR<R”SStSàT¤UpV4V¼WHWÐWäXX,XPXtX˜X¼XàYYpY¬YèZTZlZ„Z¤Z¼ZÔZì[[$[<[T[t[”[´[Ì[ä[ü\\<\\\t\Œ\¤\¼\Ô\ì]]]4]L]d]|]”]¬]Ä]ä^^$^<^T^l^„^œ^´^Ì^ä^ü_¨``œ`´`Ì`ä`üaa,aDa\ataŒa¤a¼aÔaìbbb4bLbdb|b”b¬bÄbÜbôc c$cDcdc„c¤cÄcäcüdd,d¼e´eÈeüf$fLfˆfØfðggàijÄkhl8mm8mhm´nnÄoœpˆp°qq rrÈspsèt€u$uÔvXvøw€xxœxüy\aT+h ™>˜2 ãù  : ` ƒ²  (Z4;b ;¯;Å 0 Ë ï þ " F m "Ž :Ä %: h:ø ;— ;»Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. DejaVu changes are in public domain Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. DejaVu changes are in public domain DejaVu SansDejaVu SansBookBookDejaVu SansDejaVu SansDejaVu SansDejaVu SansVersion 2.35Version 2.35DejaVuSansDejaVuSansDejaVu fonts teamDejaVu fonts teamhttp://dejavu.sourceforge.nethttp://dejavu.sourceforge.netFonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) Bitstream Vera Fonts Copyright ------------------------------ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. Arev Fonts Copyright ------------------------------ Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the modifications to the Bitstream Vera Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Tavmjong Bah" or the word "Arev". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Tavmjong Bah Arev" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the name of Tavmjong Bah shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from Tavmjong Bah. For further information, contact: tavmjong @ free . fr.Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) Bitstream Vera Fonts Copyright ------------------------------ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. Arev Fonts Copyright ------------------------------ Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the modifications to the Bitstream Vera Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Tavmjong Bah" or the word "Arev". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Tavmjong Bah Arev" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the name of Tavmjong Bah shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from Tavmjong Bah. For further information, contact: tavmjong @ free . fr.http://dejavu.sourceforge.net/wiki/index.php/Licensehttp://dejavu.sourceforge.net/wiki/index.php/LicenseDejaVu SansDejaVu SansBookBookÿ~Za  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a¬£„…½–膎‹©¤ŠÚƒ“òó—ˆÃÞñžªõôö¢­ÉÇ®bcdËeÈÊÏÌÍÎéfÓÐѯgð‘ÖÔÕhëí‰jikmln oqprsutvwêxzy{}|¸¡~€ìîºýþ    ÿ øù !"#$%&'()*+ú×,-./0123456789:âã;<=>?@ABCDEFGHI°±JKLMNOPQRSûüäåTUVWXYZ[\]^_`abcdefghi»jklmæçnopqrstuvwxyz{|}~€¦‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³Øá´µ¶·¸¹º»¼½¾¿ÀÁÂÃÛÜÝàÙßÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`Ÿabcdefghijklmnopqrstuv›wxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ                 ²³   ¶·Ä ´µÅ ‚‡   «  ! " # $ % & 'Æ ( ) * + , - . /¾¿ 0 1 2 3 4 5 6 7 8¼ 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹÷ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È ÉŒ Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š ›˜ œ ž¨ Ÿ   ¡ ¢ £ ¤ ¥ ¦š §™ï ¨ © ª « ¬ ­ ®¥ ¯ ° ±’ ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½œ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù§ Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó”• ô õ ö ÷ ø ù ú û ü ý þ ÿ                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¹¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±ÀÁ²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a sfthyphenAmacronamacronAbreveabreveAogonekaogonek Ccircumflex ccircumflex Cdotaccent cdotaccentDcarondcaronDcroatEmacronemacronEbreveebreve Edotaccent edotaccentEogonekeogonekEcaronecaron Gcircumflex gcircumflex Gdotaccent gdotaccent Gcommaaccent gcommaaccent Hcircumflex hcircumflexHbarhbarItildeitildeImacronimacronIbreveibreveIogonekiogonekIJij Jcircumflex jcircumflex Kcommaaccent kcommaaccent kgreenlandicLacutelacute Lcommaaccent lcommaaccentLcaronlcaronLdotldotNacutenacute Ncommaaccent ncommaaccentNcaronncaron napostropheEngengOmacronomacronObreveobreve Ohungarumlaut ohungarumlautRacuteracute Rcommaaccent rcommaaccentRcaronrcaronSacutesacute Scircumflex scircumflex Tcommaaccent tcommaaccentTcarontcaronTbartbarUtildeutildeUmacronumacronUbreveubreveUringuring Uhungarumlaut uhungarumlautUogonekuogonek Wcircumflex wcircumflex Ycircumflex ycircumflexZacutezacute Zdotaccent zdotaccentlongsuni0180uni0181uni0182uni0183uni0184uni0185uni0186uni0187uni0188uni0189uni018Auni018Buni018Cuni018Duni018Euni018Funi0190uni0191uni0193uni0194uni0195uni0196uni0197uni0198uni0199uni019Auni019Buni019Cuni019Duni019Euni019FOhornohornuni01A2uni01A3uni01A4uni01A5uni01A6uni01A7uni01A8uni01A9uni01AAuni01ABuni01ACuni01ADuni01AEUhornuhornuni01B1uni01B2uni01B3uni01B4uni01B5uni01B6uni01B7uni01B8uni01B9uni01BAuni01BBuni01BCuni01BDuni01BEuni01BFuni01C0uni01C1uni01C2uni01C3uni01C4uni01C5uni01C6uni01C7uni01C8uni01C9uni01CAuni01CBuni01CCuni01CDuni01CEuni01CFuni01D0uni01D1uni01D2uni01D3uni01D4uni01D5uni01D6uni01D7uni01D8uni01D9uni01DAuni01DBuni01DCuni01DDuni01DEuni01DFuni01E0uni01E1uni01E2uni01E3uni01E4uni01E5Gcarongcaronuni01E8uni01E9uni01EAuni01EBuni01ECuni01EDuni01EEuni01EFuni01F0uni01F1uni01F2uni01F3uni01F4uni01F5uni01F6uni01F7uni01F8uni01F9 Aringacute aringacuteAEacuteaeacute Oslashacute oslashacuteuni0200uni0201uni0202uni0203uni0204uni0205uni0206uni0207uni0208uni0209uni020Auni020Buni020Cuni020Duni020Euni020Funi0210uni0211uni0212uni0213uni0214uni0215uni0216uni0217 Scommaaccent scommaaccentuni021Auni021Buni021Cuni021Duni021Euni021Funi0220uni0221uni0222uni0223uni0224uni0225uni0226uni0227uni0228uni0229uni022Auni022Buni022Cuni022Duni022Euni022Funi0230uni0231uni0232uni0233uni0234uni0235uni0236dotlessjuni0238uni0239uni023Auni023Buni023Cuni023Duni023Euni023Funi0240uni0241uni0242uni0243uni0244uni0245uni0246uni0247uni0248uni0249uni024Auni024Buni024Cuni024Duni024Euni024Funi0250uni0251uni0252uni0253uni0254uni0255uni0256uni0257uni0258uni0259uni025Auni025Buni025Cuni025Duni025Euni025Funi0260uni0261uni0262uni0263uni0264uni0265uni0266uni0267uni0268uni0269uni026Auni026Buni026Cuni026Duni026Euni026Funi0270uni0271uni0272uni0273uni0274uni0275uni0276uni0277uni0278uni0279uni027Auni027Buni027Cuni027Duni027Euni027Funi0280uni0281uni0282uni0283uni0284uni0285uni0286uni0287uni0288uni0289uni028Auni028Buni028Cuni028Duni028Euni028Funi0290uni0291uni0292uni0293uni0294uni0295uni0296uni0297uni0298uni0299uni029Auni029Buni029Cuni029Duni029Euni029Funi02A0uni02A1uni02A2uni02A3uni02A4uni02A5uni02A6uni02A7uni02A8uni02A9uni02AAuni02ABuni02ACuni02ADuni02AEuni02AFuni02B0uni02B1uni02B2uni02B3uni02B4uni02B5uni02B6uni02B7uni02B8uni02B9uni02BAuni02BBuni02BCuni02BDuni02BEuni02BFuni02C0uni02C1uni02C2uni02C3uni02C4uni02C5uni02C8uni02C9uni02CAuni02CBuni02CCuni02CDuni02CEuni02CFuni02D0uni02D1uni02D2uni02D3uni02D4uni02D5uni02D6uni02D7uni02DEuni02DFuni02E0uni02E1uni02E2uni02E3uni02E4uni02E5uni02E6uni02E7uni02E8uni02E9uni02ECuni02EDuni02EEuni02F3uni02F7 gravecomb acutecombuni0302 tildecombuni0304uni0305uni0306uni0307uni0308 hookabovecombuni030Auni030Buni030Cuni030Duni030Euni030Funi0310uni0311uni0312uni0313uni0314uni0315uni0316uni0317uni0318uni0319uni031Auni031Buni031Cuni031Duni031Euni031Funi0320uni0321uni0322 dotbelowcombuni0324uni0325uni0326uni0327uni0328uni0329uni032Auni032Buni032Cuni032Duni032Euni032Funi0330uni0331uni0332uni0333uni0334uni0335uni0336uni0337uni0338uni0339uni033Auni033Buni033Cuni033Duni033Euni033Funi0340uni0341uni0342uni0343uni0344uni0345uni0346uni0347uni0348uni0349uni034Auni034Buni034Cuni034Duni034Euni034Funi0351uni0352uni0353uni0357uni0358uni035Auni035Cuni035Duni035Euni035Funi0360uni0361uni0362uni0370uni0371uni0372uni0373uni0374uni0375uni0376uni0377uni037Auni037Buni037Cuni037Duni037Etonos dieresistonos Alphatonos anoteleia EpsilontonosEtatonos Iotatonos Omicrontonos Upsilontonos OmegatonosiotadieresistonosAlphaBetaGammauni0394EpsilonZetaEtaThetaIotaKappaLambdaMuNuXiOmicronPiRhoSigmaTauUpsilonPhiChiPsi IotadieresisUpsilondieresis alphatonos epsilontonosetatonos iotatonosupsilondieresistonosalphabetagammadeltaepsilonzetaetathetaiotakappalambdauni03BCnuxiomicronrhosigma1sigmatauupsilonphichipsiomega iotadieresisupsilondieresis omicrontonos upsilontonos omegatonosuni03CFuni03D0theta1Upsilon1uni03D3uni03D4phi1omega1uni03D7uni03D8uni03D9uni03DAuni03DBuni03DCuni03DDuni03DEuni03DFuni03E0uni03E1uni03E2uni03E3uni03E4uni03E5uni03E6uni03E7uni03E8uni03E9uni03EAuni03EBuni03ECuni03EDuni03EEuni03EFuni03F0uni03F1uni03F2uni03F3uni03F4uni03F5uni03F6uni03F7uni03F8uni03F9uni03FAuni03FBuni03FCuni03FDuni03FEuni03FFuni0400uni0401uni0402uni0403uni0404uni0405uni0406uni0407uni0408uni0409uni040Auni040Buni040Cuni040Duni040Euni040Funi0410uni0411uni0412uni0413uni0414uni0415uni0416uni0417uni0418uni0419uni041Auni041Buni041Cuni041Duni041Euni041Funi0420uni0421uni0422uni0423uni0424uni0425uni0426uni0427uni0428uni0429uni042Auni042Buni042Cuni042Duni042Euni042Funi0430uni0431uni0432uni0433uni0434uni0435uni0436uni0437uni0438uni0439uni043Auni043Buni043Cuni043Duni043Euni043Funi0440uni0441uni0442uni0443uni0444uni0445uni0446uni0447uni0448uni0449uni044Auni044Buni044Cuni044Duni044Euni044Funi0450uni0451uni0452uni0453uni0454uni0455uni0456uni0457uni0458uni0459uni045Auni045Buni045Cuni045Duni045Euni045Funi0460uni0461uni0462uni0463uni0464uni0465uni0466uni0467uni0468uni0469uni046Auni046Buni046Cuni046Duni046Euni046Funi0470uni0471uni0472uni0473uni0474uni0475uni0476uni0477uni0478uni0479uni047Auni047Buni047Cuni047Duni047Euni047Funi0480uni0481uni0482uni0483uni0484uni0485uni0486uni0487uni0488uni0489uni048Auni048Buni048Cuni048Duni048Euni048Funi0490uni0491uni0492uni0493uni0494uni0495uni0496uni0497uni0498uni0499uni049Auni049Buni049Cuni049Duni049Euni049Funi04A0uni04A1uni04A2uni04A3uni04A4uni04A5uni04A6uni04A7uni04A8uni04A9uni04AAuni04ABuni04ACuni04ADuni04AEuni04AFuni04B0uni04B1uni04B2uni04B3uni04B4uni04B5uni04B6uni04B7uni04B8uni04B9uni04BAuni04BBuni04BCuni04BDuni04BEuni04BFuni04C0uni04C1uni04C2uni04C3uni04C4uni04C5uni04C6uni04C7uni04C8uni04C9uni04CAuni04CBuni04CCuni04CDuni04CEuni04CFuni04D0uni04D1uni04D2uni04D3uni04D4uni04D5uni04D6uni04D7uni04D8uni04D9uni04DAuni04DBuni04DCuni04DDuni04DEuni04DFuni04E0uni04E1uni04E2uni04E3uni04E4uni04E5uni04E6uni04E7uni04E8uni04E9uni04EAuni04EBuni04ECuni04EDuni04EEuni04EFuni04F0uni04F1uni04F2uni04F3uni04F4uni04F5uni04F6uni04F7uni04F8uni04F9uni04FAuni04FBuni04FCuni04FDuni04FEuni04FFuni0500uni0501uni0502uni0503uni0504uni0505uni0506uni0507uni0508uni0509uni050Auni050Buni050Cuni050Duni050Euni050Funi0510uni0511uni0512uni0513uni0514uni0515uni0516uni0517uni0518uni0519uni051Auni051Buni051Cuni051Duni051Euni051Funi0520uni0521uni0522uni0523uni0524uni0525uni0531uni0532uni0533uni0534uni0535uni0536uni0537uni0538uni0539uni053Auni053Buni053Cuni053Duni053Euni053Funi0540uni0541uni0542uni0543uni0544uni0545uni0546uni0547uni0548uni0549uni054Auni054Buni054Cuni054Duni054Euni054Funi0550uni0551uni0552uni0553uni0554uni0555uni0556uni0559uni055Auni055Buni055Cuni055Duni055Euni055Funi0561uni0562uni0563uni0564uni0565uni0566uni0567uni0568uni0569uni056Auni056Buni056Cuni056Duni056Euni056Funi0570uni0571uni0572uni0573uni0574uni0575uni0576uni0577uni0578uni0579uni057Auni057Buni057Cuni057Duni057Euni057Funi0580uni0581uni0582uni0583uni0584uni0585uni0586uni0587uni0589uni058Auni05B0uni05B1uni05B2uni05B3uni05B4uni05B5uni05B6uni05B7uni05B8uni05B9uni05BAuni05BBuni05BCuni05BDuni05BEuni05BFuni05C0uni05C1uni05C2uni05C3uni05C6uni05C7uni05D0uni05D1uni05D2uni05D3uni05D4uni05D5uni05D6uni05D7uni05D8uni05D9uni05DAuni05DBuni05DCuni05DDuni05DEuni05DFuni05E0uni05E1uni05E2uni05E3uni05E4uni05E5uni05E6uni05E7uni05E8uni05E9uni05EAuni05F0uni05F1uni05F2uni05F3uni05F4uni0606uni0607uni0609uni060Auni060Cuni0615uni061Buni061Funi0621uni0622uni0623uni0624uni0625uni0626uni0627uni0628uni0629uni062Auni062Buni062Cuni062Duni062Euni062Funi0630uni0631uni0632uni0633uni0634uni0635uni0636uni0637uni0638uni0639uni063Auni0640uni0641uni0642uni0643uni0644uni0645uni0646uni0647uni0648uni0649uni064Auni064Buni064Cuni064Duni064Euni064Funi0650uni0651uni0652uni0653uni0654uni0655uni0657uni065Auni0660uni0661uni0662uni0663uni0664uni0665uni0666uni0667uni0668uni0669uni066Auni066Buni066Cuni066Duni066Euni066Funi0670uni0674uni0679uni067Auni067Buni067Cuni067Duni067Euni067Funi0680uni0681uni0682uni0683uni0684uni0685uni0686uni0687uni0688uni0689uni068Auni068Buni068Cuni068Duni068Euni068Funi0690uni0691uni0692uni0693uni0694uni0695uni0696uni0697uni0698uni0699uni069Auni069Buni069Cuni069Duni069Euni069Funi06A0uni06A1uni06A2uni06A3uni06A4uni06A5uni06A6uni06A7uni06A8uni06A9uni06AAuni06ABuni06ACuni06ADuni06AEuni06AFuni06B0uni06B1uni06B2uni06B3uni06B4uni06B5uni06B6uni06B7uni06B8uni06B9uni06BAuni06BBuni06BCuni06BDuni06BEuni06BFuni06C6uni06C7uni06C8uni06CBuni06CCuni06CEuni06D0uni06D5uni06F0uni06F1uni06F2uni06F3uni06F4uni06F5uni06F6uni06F7uni06F8uni06F9uni07C0uni07C1uni07C2uni07C3uni07C4uni07C5uni07C6uni07C7uni07C8uni07C9uni07CAuni07CBuni07CCuni07CDuni07CEuni07CFuni07D0uni07D1uni07D2uni07D3uni07D4uni07D5uni07D6uni07D7uni07D8uni07D9uni07DAuni07DBuni07DCuni07DDuni07DEuni07DFuni07E0uni07E1uni07E2uni07E3uni07E4uni07E5uni07E6uni07E7uni07EBuni07ECuni07EDuni07EEuni07EFuni07F0uni07F1uni07F2uni07F3uni07F4uni07F5uni07F8uni07F9uni07FAuni0E3Funi0E81uni0E82uni0E84uni0E87uni0E88uni0E8Auni0E8Duni0E94uni0E95uni0E96uni0E97uni0E99uni0E9Auni0E9Buni0E9Cuni0E9Duni0E9Euni0E9Funi0EA1uni0EA2uni0EA3uni0EA5uni0EA7uni0EAAuni0EABuni0EADuni0EAEuni0EAFuni0EB0uni0EB1uni0EB2uni0EB3uni0EB4uni0EB5uni0EB6uni0EB7uni0EB8uni0EB9uni0EBBuni0EBCuni0EBDuni0EC0uni0EC1uni0EC2uni0EC3uni0EC4uni0EC6uni0EC8uni0EC9uni0ECAuni0ECBuni0ECCuni0ECDuni0ED0uni0ED1uni0ED2uni0ED3uni0ED4uni0ED5uni0ED6uni0ED7uni0ED8uni0ED9uni0EDCuni0EDDuni10A0uni10A1uni10A2uni10A3uni10A4uni10A5uni10A6uni10A7uni10A8uni10A9uni10AAuni10ABuni10ACuni10ADuni10AEuni10AFuni10B0uni10B1uni10B2uni10B3uni10B4uni10B5uni10B6uni10B7uni10B8uni10B9uni10BAuni10BBuni10BCuni10BDuni10BEuni10BFuni10C0uni10C1uni10C2uni10C3uni10C4uni10C5uni10D0uni10D1uni10D2uni10D3uni10D4uni10D5uni10D6uni10D7uni10D8uni10D9uni10DAuni10DBuni10DCuni10DDuni10DEuni10DFuni10E0uni10E1uni10E2uni10E3uni10E4uni10E5uni10E6uni10E7uni10E8uni10E9uni10EAuni10EBuni10ECuni10EDuni10EEuni10EFuni10F0uni10F1uni10F2uni10F3uni10F4uni10F5uni10F6uni10F7uni10F8uni10F9uni10FAuni10FBuni10FCuni1401uni1402uni1403uni1404uni1405uni1406uni1407uni1409uni140Auni140Buni140Cuni140Duni140Euni140Funi1410uni1411uni1412uni1413uni1414uni1415uni1416uni1417uni1418uni1419uni141Auni141Buni141Duni141Euni141Funi1420uni1421uni1422uni1423uni1424uni1425uni1426uni1427uni1428uni1429uni142Auni142Buni142Cuni142Duni142Euni142Funi1430uni1431uni1432uni1433uni1434uni1435uni1437uni1438uni1439uni143Auni143Buni143Cuni143Duni143Euni143Funi1440uni1441uni1442uni1443uni1444uni1445uni1446uni1447uni1448uni1449uni144Auni144Cuni144Duni144Euni144Funi1450uni1451uni1452uni1454uni1455uni1456uni1457uni1458uni1459uni145Auni145Buni145Cuni145Duni145Euni145Funi1460uni1461uni1462uni1463uni1464uni1465uni1466uni1467uni1468uni1469uni146Auni146Buni146Cuni146Duni146Euni146Funi1470uni1471uni1472uni1473uni1474uni1475uni1476uni1477uni1478uni1479uni147Auni147Buni147Cuni147Duni147Euni147Funi1480uni1481uni1482uni1483uni1484uni1485uni1486uni1487uni1488uni1489uni148Auni148Buni148Cuni148Duni148Euni148Funi1490uni1491uni1492uni1493uni1494uni1495uni1496uni1497uni1498uni1499uni149Auni149Buni149Cuni149Duni149Euni149Funi14A0uni14A1uni14A2uni14A3uni14A4uni14A5uni14A6uni14A7uni14A8uni14A9uni14AAuni14ABuni14ACuni14ADuni14AEuni14AFuni14B0uni14B1uni14B2uni14B3uni14B4uni14B5uni14B6uni14B7uni14B8uni14B9uni14BAuni14BBuni14BCuni14BDuni14C0uni14C1uni14C2uni14C3uni14C4uni14C5uni14C6uni14C7uni14C8uni14C9uni14CAuni14CBuni14CCuni14CDuni14CEuni14CFuni14D0uni14D1uni14D2uni14D3uni14D4uni14D5uni14D6uni14D7uni14D8uni14D9uni14DAuni14DBuni14DCuni14DDuni14DEuni14DFuni14E0uni14E1uni14E2uni14E3uni14E4uni14E5uni14E6uni14E7uni14E8uni14E9uni14EAuni14ECuni14EDuni14EEuni14EFuni14F0uni14F1uni14F2uni14F3uni14F4uni14F5uni14F6uni14F7uni14F8uni14F9uni14FAuni14FBuni14FCuni14FDuni14FEuni14FFuni1500uni1501uni1502uni1503uni1504uni1505uni1506uni1507uni1510uni1511uni1512uni1513uni1514uni1515uni1516uni1517uni1518uni1519uni151Auni151Buni151Cuni151Duni151Euni151Funi1520uni1521uni1522uni1523uni1524uni1525uni1526uni1527uni1528uni1529uni152Auni152Buni152Cuni152Duni152Euni152Funi1530uni1531uni1532uni1533uni1534uni1535uni1536uni1537uni1538uni1539uni153Auni153Buni153Cuni153Duni153Euni1540uni1541uni1542uni1543uni1544uni1545uni1546uni1547uni1548uni1549uni154Auni154Buni154Cuni154Duni154Euni154Funi1550uni1552uni1553uni1554uni1555uni1556uni1557uni1558uni1559uni155Auni155Buni155Cuni155Duni155Euni155Funi1560uni1561uni1562uni1563uni1564uni1565uni1566uni1567uni1568uni1569uni156Auni1574uni1575uni1576uni1577uni1578uni1579uni157Auni157Buni157Cuni157Duni157Euni157Funi1580uni1581uni1582uni1583uni1584uni1585uni158Auni158Buni158Cuni158Duni158Euni158Funi1590uni1591uni1592uni1593uni1594uni1595uni1596uni15A0uni15A1uni15A2uni15A3uni15A4uni15A5uni15A6uni15A7uni15A8uni15A9uni15AAuni15ABuni15ACuni15ADuni15AEuni15AFuni15DEuni15E1uni1646uni1647uni166Euni166Funi1670uni1671uni1672uni1673uni1674uni1675uni1676uni1680uni1681uni1682uni1683uni1684uni1685uni1686uni1687uni1688uni1689uni168Auni168Buni168Cuni168Duni168Euni168Funi1690uni1691uni1692uni1693uni1694uni1695uni1696uni1697uni1698uni1699uni169Auni169Buni169Cuni1D00uni1D01uni1D02uni1D03uni1D04uni1D05uni1D06uni1D07uni1D08uni1D09uni1D0Auni1D0Buni1D0Cuni1D0Duni1D0Euni1D0Funi1D10uni1D11uni1D12uni1D13uni1D14uni1D16uni1D17uni1D18uni1D19uni1D1Auni1D1Buni1D1Cuni1D1Duni1D1Euni1D1Funi1D20uni1D21uni1D22uni1D23uni1D26uni1D27uni1D28uni1D29uni1D2Auni1D2Buni1D2Cuni1D2Duni1D2Euni1D30uni1D31uni1D32uni1D33uni1D34uni1D35uni1D36uni1D37uni1D38uni1D39uni1D3Auni1D3Buni1D3Cuni1D3Duni1D3Euni1D3Funi1D40uni1D41uni1D42uni1D43uni1D44uni1D45uni1D46uni1D47uni1D48uni1D49uni1D4Auni1D4Buni1D4Cuni1D4Duni1D4Euni1D4Funi1D50uni1D51uni1D52uni1D53uni1D54uni1D55uni1D56uni1D57uni1D58uni1D59uni1D5Auni1D5Buni1D5Duni1D5Euni1D5Funi1D60uni1D61uni1D62uni1D63uni1D64uni1D65uni1D66uni1D67uni1D68uni1D69uni1D6Auni1D77uni1D78uni1D7Buni1D7Duni1D85uni1D9Buni1D9Cuni1D9Duni1D9Euni1D9Funi1DA0uni1DA1uni1DA2uni1DA3uni1DA4uni1DA5uni1DA6uni1DA7uni1DA8uni1DA9uni1DAAuni1DABuni1DACuni1DADuni1DAEuni1DAFuni1DB0uni1DB1uni1DB2uni1DB3uni1DB4uni1DB5uni1DB6uni1DB7uni1DB8uni1DB9uni1DBAuni1DBBuni1DBCuni1DBDuni1DBEuni1DBFuni1DC4uni1DC5uni1DC6uni1DC7uni1DC8uni1DC9uni1E00uni1E01uni1E02uni1E03uni1E04uni1E05uni1E06uni1E07uni1E08uni1E09uni1E0Auni1E0Buni1E0Cuni1E0Duni1E0Euni1E0Funi1E10uni1E11uni1E12uni1E13uni1E14uni1E15uni1E16uni1E17uni1E18uni1E19uni1E1Auni1E1Buni1E1Cuni1E1Duni1E1Euni1E1Funi1E20uni1E21uni1E22uni1E23uni1E24uni1E25uni1E26uni1E27uni1E28uni1E29uni1E2Auni1E2Buni1E2Cuni1E2Duni1E2Euni1E2Funi1E30uni1E31uni1E32uni1E33uni1E34uni1E35uni1E36uni1E37uni1E38uni1E39uni1E3Auni1E3Buni1E3Cuni1E3Duni1E3Euni1E3Funi1E40uni1E41uni1E42uni1E43uni1E44uni1E45uni1E46uni1E47uni1E48uni1E49uni1E4Auni1E4Buni1E4Cuni1E4Duni1E4Euni1E4Funi1E50uni1E51uni1E52uni1E53uni1E54uni1E55uni1E56uni1E57uni1E58uni1E59uni1E5Auni1E5Buni1E5Cuni1E5Duni1E5Euni1E5Funi1E60uni1E61uni1E62uni1E63uni1E64uni1E65uni1E66uni1E67uni1E68uni1E69uni1E6Auni1E6Buni1E6Cuni1E6Duni1E6Euni1E6Funi1E70uni1E71uni1E72uni1E73uni1E74uni1E75uni1E76uni1E77uni1E78uni1E79uni1E7Auni1E7Buni1E7Cuni1E7Duni1E7Euni1E7FWgravewgraveWacutewacute Wdieresis wdieresisuni1E86uni1E87uni1E88uni1E89uni1E8Auni1E8Buni1E8Cuni1E8Duni1E8Euni1E8Funi1E90uni1E91uni1E92uni1E93uni1E94uni1E95uni1E96uni1E97uni1E98uni1E99uni1E9Auni1E9Buni1E9Cuni1E9Duni1E9Euni1E9Funi1EA0uni1EA1uni1EA2uni1EA3uni1EA4uni1EA5uni1EA6uni1EA7uni1EA8uni1EA9uni1EAAuni1EABuni1EACuni1EADuni1EAEuni1EAFuni1EB0uni1EB1uni1EB2uni1EB3uni1EB4uni1EB5uni1EB6uni1EB7uni1EB8uni1EB9uni1EBAuni1EBBuni1EBCuni1EBDuni1EBEuni1EBFuni1EC0uni1EC1uni1EC2uni1EC3uni1EC4uni1EC5uni1EC6uni1EC7uni1EC8uni1EC9uni1ECAuni1ECBuni1ECCuni1ECDuni1ECEuni1ECFuni1ED0uni1ED1uni1ED2uni1ED3uni1ED4uni1ED5uni1ED6uni1ED7uni1ED8uni1ED9uni1EDAuni1EDBuni1EDCuni1EDDuni1EDEuni1EDFuni1EE0uni1EE1uni1EE2uni1EE3uni1EE4uni1EE5uni1EE6uni1EE7uni1EE8uni1EE9uni1EEAuni1EEBuni1EECuni1EEDuni1EEEuni1EEFuni1EF0uni1EF1Ygraveygraveuni1EF4uni1EF5uni1EF6uni1EF7uni1EF8uni1EF9uni1EFAuni1EFBuni1F00uni1F01uni1F02uni1F03uni1F04uni1F05uni1F06uni1F07uni1F08uni1F09uni1F0Auni1F0Buni1F0Cuni1F0Duni1F0Euni1F0Funi1F10uni1F11uni1F12uni1F13uni1F14uni1F15uni1F18uni1F19uni1F1Auni1F1Buni1F1Cuni1F1Duni1F20uni1F21uni1F22uni1F23uni1F24uni1F25uni1F26uni1F27uni1F28uni1F29uni1F2Auni1F2Buni1F2Cuni1F2Duni1F2Euni1F2Funi1F30uni1F31uni1F32uni1F33uni1F34uni1F35uni1F36uni1F37uni1F38uni1F39uni1F3Auni1F3Buni1F3Cuni1F3Duni1F3Euni1F3Funi1F40uni1F41uni1F42uni1F43uni1F44uni1F45uni1F48uni1F49uni1F4Auni1F4Buni1F4Cuni1F4Duni1F50uni1F51uni1F52uni1F53uni1F54uni1F55uni1F56uni1F57uni1F59uni1F5Buni1F5Duni1F5Funi1F60uni1F61uni1F62uni1F63uni1F64uni1F65uni1F66uni1F67uni1F68uni1F69uni1F6Auni1F6Buni1F6Cuni1F6Duni1F6Euni1F6Funi1F70uni1F71uni1F72uni1F73uni1F74uni1F75uni1F76uni1F77uni1F78uni1F79uni1F7Auni1F7Buni1F7Cuni1F7Duni1F80uni1F81uni1F82uni1F83uni1F84uni1F85uni1F86uni1F87uni1F88uni1F89uni1F8Auni1F8Buni1F8Cuni1F8Duni1F8Euni1F8Funi1F90uni1F91uni1F92uni1F93uni1F94uni1F95uni1F96uni1F97uni1F98uni1F99uni1F9Auni1F9Buni1F9Cuni1F9Duni1F9Euni1F9Funi1FA0uni1FA1uni1FA2uni1FA3uni1FA4uni1FA5uni1FA6uni1FA7uni1FA8uni1FA9uni1FAAuni1FABuni1FACuni1FADuni1FAEuni1FAFuni1FB0uni1FB1uni1FB2uni1FB3uni1FB4uni1FB6uni1FB7uni1FB8uni1FB9uni1FBAuni1FBBuni1FBCuni1FBDuni1FBEuni1FBFuni1FC0uni1FC1uni1FC2uni1FC3uni1FC4uni1FC6uni1FC7uni1FC8uni1FC9uni1FCAuni1FCBuni1FCCuni1FCDuni1FCEuni1FCFuni1FD0uni1FD1uni1FD2uni1FD3uni1FD6uni1FD7uni1FD8uni1FD9uni1FDAuni1FDBuni1FDDuni1FDEuni1FDFuni1FE0uni1FE1uni1FE2uni1FE3uni1FE4uni1FE5uni1FE6uni1FE7uni1FE8uni1FE9uni1FEAuni1FEBuni1FECuni1FEDuni1FEEuni1FEFuni1FF2uni1FF3uni1FF4uni1FF6uni1FF7uni1FF8uni1FF9uni1FFAuni1FFBuni1FFCuni1FFDuni1FFEuni2000uni2001uni2002uni2003uni2004uni2005uni2006uni2007uni2008uni2009uni200Auni200Buni200Cuni200Duni200Euni200Funi2010uni2011 figuredashuni2015uni2016 underscoredbl quotereverseduni201Funi2023onedotenleadertwodotenleaderuni2027uni2028uni2029uni202Auni202Buni202Cuni202Duni202Euni202Funi2031minuteseconduni2034uni2035uni2036uni2037uni2038uni203B exclamdbluni203Duni203Euni203Funi2040uni2041uni2042uni2043uni2045uni2046uni2047uni2048uni2049uni204Auni204Buni204Cuni204Duni204Euni204Funi2050uni2051uni2052uni2053uni2054uni2055uni2056uni2057uni2058uni2059uni205Auni205Buni205Cuni205Duni205Euni205Funi2060uni2061uni2062uni2063uni2064uni206Auni206Buni206Cuni206Duni206Euni206Funi2070uni2071uni2074uni2075uni2076uni2077uni2078uni2079uni207Auni207Buni207Cuni207Duni207Euni207Funi2080uni2081uni2082uni2083uni2084uni2085uni2086uni2087uni2088uni2089uni208Auni208Buni208Cuni208Duni208Euni2090uni2091uni2092uni2093uni2094uni2095uni2096uni2097uni2098uni2099uni209Auni209Buni209Cuni20A0 colonmonetaryuni20A2lirauni20A5uni20A6pesetauni20A8uni20A9uni20AAdongEurouni20ADuni20AEuni20AFuni20B0uni20B1uni20B2uni20B3uni20B4uni20B5uni20B8uni20B9uni20BAuni20BDuni20D0uni20D1uni20D6uni20D7uni20DBuni20DCuni20E1uni2100uni2101uni2102uni2103uni2104uni2105uni2106uni2107uni2108uni2109uni210Buni210Cuni210Duni210Euni210Funi2110Ifrakturuni2112uni2113uni2114uni2115uni2116uni2117 weierstrassuni2119uni211Auni211BRfrakturuni211D prescriptionuni211Funi2120uni2121uni2123uni2124uni2125uni2126uni2127uni2128uni2129uni212Auni212Buni212Cuni212D estimateduni212Funi2130uni2131uni2132uni2133uni2134alephuni2136uni2137uni2138uni2139uni213Auni213Buni213Cuni213Duni213Euni213Funi2140uni2141uni2142uni2143uni2144uni2145uni2146uni2147uni2148uni2149uni214Buni214Euni2150uni2151uni2152onethird twothirdsuni2155uni2156uni2157uni2158uni2159uni215A oneeighth threeeighths fiveeighths seveneighthsuni215Funi2160uni2161uni2162uni2163uni2164uni2165uni2166uni2167uni2168uni2169uni216Auni216Buni216Cuni216Duni216Euni216Funi2170uni2171uni2172uni2173uni2174uni2175uni2176uni2177uni2178uni2179uni217Auni217Buni217Cuni217Duni217Euni217Funi2180uni2181uni2182uni2183uni2184uni2185uni2189 arrowleftarrowup arrowright arrowdown arrowboth arrowupdnuni2196uni2197uni2198uni2199uni219Auni219Buni219Cuni219Duni219Euni219Funi21A0uni21A1uni21A2uni21A3uni21A4uni21A5uni21A6uni21A7 arrowupdnbseuni21A9uni21AAuni21ABuni21ACuni21ADuni21AEuni21AFuni21B0uni21B1uni21B2uni21B3uni21B4carriagereturnuni21B6uni21B7uni21B8uni21B9uni21BAuni21BBuni21BCuni21BDuni21BEuni21BFuni21C0uni21C1uni21C2uni21C3uni21C4uni21C5uni21C6uni21C7uni21C8uni21C9uni21CAuni21CBuni21CCuni21CDuni21CEuni21CF arrowdblleft arrowdblup arrowdblright arrowdbldown arrowdblbothuni21D5uni21D6uni21D7uni21D8uni21D9uni21DAuni21DBuni21DCuni21DDuni21DEuni21DFuni21E0uni21E1uni21E2uni21E3uni21E4uni21E5uni21E6uni21E7uni21E8uni21E9uni21EAuni21EBuni21ECuni21EDuni21EEuni21EFuni21F0uni21F1uni21F2uni21F3uni21F4uni21F5uni21F6uni21F7uni21F8uni21F9uni21FAuni21FBuni21FCuni21FDuni21FEuni21FF universaluni2201 existentialuni2204emptysetgradientelement notelementuni220Asuchthatuni220Cuni220Duni220Euni2210uni2213uni2214uni2215uni2216 asteriskmathuni2218uni2219uni221Buni221C proportional orthogonalangleuni2221uni2222uni2223uni2224uni2225uni2226 logicaland logicalor intersectionunionuni222Cuni222Duni222Euni222Funi2230uni2231uni2232uni2233 thereforeuni2235uni2236uni2237uni2238uni2239uni223Auni223Bsimilaruni223Duni223Euni223Funi2240uni2241uni2242uni2243uni2244 congruentuni2246uni2247uni2249uni224Auni224Buni224Cuni224Duni224Euni224Funi2250uni2251uni2252uni2253uni2254uni2255uni2256uni2257uni2258uni2259uni225Auni225Buni225Cuni225Duni225Euni225F equivalenceuni2262uni2263uni2266uni2267uni2268uni2269uni226Auni226Buni226Cuni226Duni226Euni226Funi2270uni2271uni2272uni2273uni2274uni2275uni2276uni2277uni2278uni2279uni227Auni227Buni227Cuni227Duni227Euni227Funi2280uni2281 propersubsetpropersuperset notsubsetuni2285 reflexsubsetreflexsupersetuni2288uni2289uni228Auni228Buni228Cuni228Duni228Euni228Funi2290uni2291uni2292uni2293uni2294 circleplusuni2296circlemultiplyuni2298uni2299uni229Auni229Buni229Cuni229Duni229Euni229Funi22A0uni22A1uni22A2uni22A3uni22A4 perpendicularuni22A6uni22A7uni22A8uni22A9uni22AAuni22ABuni22ACuni22ADuni22AEuni22AFuni22B0uni22B1uni22B2uni22B3uni22B4uni22B5uni22B6uni22B7uni22B8uni22B9uni22BAuni22BBuni22BCuni22BDuni22BEuni22BFuni22C0uni22C1uni22C2uni22C3uni22C4dotmathuni22C6uni22C7uni22C8uni22C9uni22CAuni22CBuni22CCuni22CDuni22CEuni22CFuni22D0uni22D1uni22D2uni22D3uni22D4uni22D5uni22D6uni22D7uni22D8uni22D9uni22DAuni22DBuni22DCuni22DDuni22DEuni22DFuni22E0uni22E1uni22E2uni22E3uni22E4uni22E5uni22E6uni22E7uni22E8uni22E9uni22EAuni22EBuni22ECuni22EDuni22EEuni22EFuni22F0uni22F1uni22F2uni22F3uni22F4uni22F5uni22F6uni22F7uni22F8uni22F9uni22FAuni22FBuni22FCuni22FDuni22FEuni22FFuni2300uni2301houseuni2303uni2304uni2305uni2306uni2307uni2308uni2309uni230Auni230Buni230Cuni230Duni230Euni230F revlogicalnotuni2311uni2318uni2319uni231Cuni231Duni231Euni231F integraltp integralbtuni2324uni2325uni2326uni2327uni2328uni232Buni232Cuni2373uni2374uni2375uni237Auni237Duni2387uni2394uni239Buni239Cuni239Duni239Euni239Funi23A0uni23A1uni23A2uni23A3uni23A4uni23A5uni23A6uni23A7uni23A8uni23A9uni23AAuni23ABuni23ACuni23ADuni23AEuni23CEuni23CFuni23E3uni23E5uni23E8uni2422uni2423uni2460uni2461uni2462uni2463uni2464uni2465uni2466uni2467uni2468uni2469SF100000uni2501SF110000uni2503uni2504uni2505uni2506uni2507uni2508uni2509uni250Auni250BSF010000uni250Duni250Euni250FSF030000uni2511uni2512uni2513SF020000uni2515uni2516uni2517SF040000uni2519uni251Auni251BSF080000uni251Duni251Euni251Funi2520uni2521uni2522uni2523SF090000uni2525uni2526uni2527uni2528uni2529uni252Auni252BSF060000uni252Duni252Euni252Funi2530uni2531uni2532uni2533SF070000uni2535uni2536uni2537uni2538uni2539uni253Auni253BSF050000uni253Duni253Euni253Funi2540uni2541uni2542uni2543uni2544uni2545uni2546uni2547uni2548uni2549uni254Auni254Buni254Cuni254Duni254Euni254FSF430000SF240000SF510000SF520000SF390000SF220000SF210000SF250000SF500000SF490000SF380000SF280000SF270000SF260000SF360000SF370000SF420000SF190000SF200000SF230000SF470000SF480000SF410000SF450000SF460000SF400000SF540000SF530000SF440000uni256Duni256Euni256Funi2570uni2571uni2572uni2573uni2574uni2575uni2576uni2577uni2578uni2579uni257Auni257Buni257Cuni257Duni257Euni257Fupblockuni2581uni2582uni2583dnblockuni2585uni2586uni2587blockuni2589uni258Auni258Blfblockuni258Duni258Euni258Frtblockltshadeshadedkshadeuni2594uni2595uni2596uni2597uni2598uni2599uni259Auni259Buni259Cuni259Duni259Euni259F filledboxH22073uni25A2uni25A3uni25A4uni25A5uni25A6uni25A7uni25A8uni25A9H18543H18551 filledrectuni25ADuni25AEuni25AFuni25B0uni25B1triagupuni25B3uni25B4uni25B5uni25B6uni25B7uni25B8uni25B9triagrtuni25BBtriagdnuni25BDuni25BEuni25BFuni25C0uni25C1uni25C2uni25C3triaglfuni25C5uni25C6uni25C7uni25C8uni25C9circleuni25CCuni25CDuni25CEH18533uni25D0uni25D1uni25D2uni25D3uni25D4uni25D5uni25D6uni25D7 invbullet invcircleuni25DAuni25DBuni25DCuni25DDuni25DEuni25DFuni25E0uni25E1uni25E2uni25E3uni25E4uni25E5 openbulletuni25E7uni25E8uni25E9uni25EAuni25EBuni25ECuni25EDuni25EEuni25EFuni25F0uni25F1uni25F2uni25F3uni25F4uni25F5uni25F6uni25F7uni25F8uni25F9uni25FAuni25FBuni25FCuni25FDuni25FEuni25FFuni2600uni2601uni2602uni2603uni2604uni2605uni2606uni2607uni2608uni2609uni260Auni260Buni260Cuni260Duni260Euni260Funi2610uni2611uni2612uni2613uni2614uni2615uni2616uni2617uni2618uni2619uni261Auni261Buni261Cuni261Duni261Euni261Funi2620uni2621uni2622uni2623uni2624uni2625uni2626uni2627uni2628uni2629uni262Auni262Buni262Cuni262Duni262Euni262Funi2630uni2631uni2632uni2633uni2634uni2635uni2636uni2637uni2638uni2639 smileface invsmilefacesununi263Duni263Euni263Ffemaleuni2641maleuni2643uni2644uni2645uni2646uni2647uni2648uni2649uni264Auni264Buni264Cuni264Duni264Euni264Funi2650uni2651uni2652uni2653uni2654uni2655uni2656uni2657uni2658uni2659uni265Auni265Buni265Cuni265Duni265Euni265Fspadeuni2661uni2662clubuni2664heartdiamonduni2667uni2668uni2669 musicalnotemusicalnotedbluni266Cuni266Duni266Euni266Funi2670uni2671uni2672uni2673uni2674uni2675uni2676uni2677uni2678uni2679uni267Auni267Buni267Cuni267Duni267Euni267Funi2680uni2681uni2682uni2683uni2684uni2685uni2686uni2687uni2688uni2689uni268Auni268Buni268Cuni268Duni268Euni268Funi2690uni2691uni2692uni2693uni2694uni2695uni2696uni2697uni2698uni2699uni269Auni269Buni269Cuni269Euni269Funi26A0uni26A1uni26A2uni26A3uni26A4uni26A5uni26A6uni26A7uni26A8uni26A9uni26AAuni26ABuni26ACuni26ADuni26AEuni26AFuni26B0uni26B1uni26B2uni26B3uni26B4uni26B5uni26B6uni26B7uni26B8uni26C0uni26C1uni26C2uni26C3uni26E2uni2701uni2702uni2703uni2704uni2706uni2707uni2708uni2709uni270Cuni270Duni270Euni270Funi2710uni2711uni2712uni2713uni2714uni2715uni2716uni2717uni2718uni2719uni271Auni271Buni271Cuni271Duni271Euni271Funi2720uni2721uni2722uni2723uni2724uni2725uni2726uni2727uni2729uni272Auni272Buni272Cuni272Duni272Euni272Funi2730uni2731uni2732uni2733uni2734uni2735uni2736uni2737uni2738uni2739uni273Auni273Buni273Cuni273Duni273Euni273Funi2740uni2741uni2742uni2743uni2744uni2745uni2746uni2747uni2748uni2749uni274Auni274Buni274Duni274Funi2750uni2751uni2752uni2756uni2758uni2759uni275Auni275Buni275Cuni275Duni275Euni2761uni2762uni2763uni2764uni2765uni2766uni2767uni2768uni2769uni276Auni276Buni276Cuni276Duni276Euni276Funi2770uni2771uni2772uni2773uni2774uni2775uni2776uni2777uni2778uni2779uni277Auni277Buni277Cuni277Duni277Euni277Funi2780uni2781uni2782uni2783uni2784uni2785uni2786uni2787uni2788uni2789uni278Auni278Buni278Cuni278Duni278Euni278Funi2790uni2791uni2792uni2793uni2794uni2798uni2799uni279Auni279Buni279Cuni279Duni279Euni279Funi27A0uni27A1uni27A2uni27A3uni27A4uni27A5uni27A6uni27A7uni27A8uni27A9uni27AAuni27ABuni27ACuni27ADuni27AEuni27AFuni27B1uni27B2uni27B3uni27B4uni27B5uni27B6uni27B7uni27B8uni27B9uni27BAuni27BBuni27BCuni27BDuni27BEuni27C5uni27C6uni27E0uni27E6uni27E7uni27E8uni27E9uni27EAuni27EBuni27F0uni27F1uni27F2uni27F3uni27F4uni27F5uni27F6uni27F7uni27F8uni27F9uni27FAuni27FBuni27FCuni27FDuni27FEuni27FFuni2800uni2801uni2802uni2803uni2804uni2805uni2806uni2807uni2808uni2809uni280Auni280Buni280Cuni280Duni280Euni280Funi2810uni2811uni2812uni2813uni2814uni2815uni2816uni2817uni2818uni2819uni281Auni281Buni281Cuni281Duni281Euni281Funi2820uni2821uni2822uni2823uni2824uni2825uni2826uni2827uni2828uni2829uni282Auni282Buni282Cuni282Duni282Euni282Funi2830uni2831uni2832uni2833uni2834uni2835uni2836uni2837uni2838uni2839uni283Auni283Buni283Cuni283Duni283Euni283Funi2840uni2841uni2842uni2843uni2844uni2845uni2846uni2847uni2848uni2849uni284Auni284Buni284Cuni284Duni284Euni284Funi2850uni2851uni2852uni2853uni2854uni2855uni2856uni2857uni2858uni2859uni285Auni285Buni285Cuni285Duni285Euni285Funi2860uni2861uni2862uni2863uni2864uni2865uni2866uni2867uni2868uni2869uni286Auni286Buni286Cuni286Duni286Euni286Funi2870uni2871uni2872uni2873uni2874uni2875uni2876uni2877uni2878uni2879uni287Auni287Buni287Cuni287Duni287Euni287Funi2880uni2881uni2882uni2883uni2884uni2885uni2886uni2887uni2888uni2889uni288Auni288Buni288Cuni288Duni288Euni288Funi2890uni2891uni2892uni2893uni2894uni2895uni2896uni2897uni2898uni2899uni289Auni289Buni289Cuni289Duni289Euni289Funi28A0uni28A1uni28A2uni28A3uni28A4uni28A5uni28A6uni28A7uni28A8uni28A9uni28AAuni28ABuni28ACuni28ADuni28AEuni28AFuni28B0uni28B1uni28B2uni28B3uni28B4uni28B5uni28B6uni28B7uni28B8uni28B9uni28BAuni28BBuni28BCuni28BDuni28BEuni28BFuni28C0uni28C1uni28C2uni28C3uni28C4uni28C5uni28C6uni28C7uni28C8uni28C9uni28CAuni28CBuni28CCuni28CDuni28CEuni28CFuni28D0uni28D1uni28D2uni28D3uni28D4uni28D5uni28D6uni28D7uni28D8uni28D9uni28DAuni28DBuni28DCuni28DDuni28DEuni28DFuni28E0uni28E1uni28E2uni28E3uni28E4uni28E5uni28E6uni28E7uni28E8uni28E9uni28EAuni28EBuni28ECuni28EDuni28EEuni28EFuni28F0uni28F1uni28F2uni28F3uni28F4uni28F5uni28F6uni28F7uni28F8uni28F9uni28FAuni28FBuni28FCuni28FDuni28FEuni28FFuni2906uni2907uni290Auni290Buni2940uni2941uni2983uni2984uni29CEuni29CFuni29D0uni29D1uni29D2uni29D3uni29D4uni29D5uni29EBuni29FAuni29FBuni2A00uni2A01uni2A02uni2A0Cuni2A0Duni2A0Euni2A0Funi2A10uni2A11uni2A12uni2A13uni2A14uni2A15uni2A16uni2A17uni2A18uni2A19uni2A1Auni2A1Buni2A1Cuni2A2Funi2A6Auni2A6Buni2A7Duni2A7Euni2A7Funi2A80uni2A81uni2A82uni2A83uni2A84uni2A85uni2A86uni2A87uni2A88uni2A89uni2A8Auni2A8Buni2A8Cuni2A8Duni2A8Euni2A8Funi2A90uni2A91uni2A92uni2A93uni2A94uni2A95uni2A96uni2A97uni2A98uni2A99uni2A9Auni2A9Buni2A9Cuni2A9Duni2A9Euni2A9Funi2AA0uni2AAEuni2AAFuni2AB0uni2AB1uni2AB2uni2AB3uni2AB4uni2AB5uni2AB6uni2AB7uni2AB8uni2AB9uni2ABAuni2AF9uni2AFAuni2B00uni2B01uni2B02uni2B03uni2B04uni2B05uni2B06uni2B07uni2B08uni2B09uni2B0Auni2B0Buni2B0Cuni2B0Duni2B0Euni2B0Funi2B10uni2B11uni2B12uni2B13uni2B14uni2B15uni2B16uni2B17uni2B18uni2B19uni2B1Auni2B1Funi2B20uni2B21uni2B22uni2B23uni2B24uni2B53uni2B54uni2C60uni2C61uni2C62uni2C63uni2C64uni2C65uni2C66uni2C67uni2C68uni2C69uni2C6Auni2C6Buni2C6Cuni2C6Duni2C6Euni2C6Funi2C70uni2C71uni2C72uni2C73uni2C74uni2C75uni2C76uni2C77uni2C79uni2C7Auni2C7Buni2C7Cuni2C7Duni2C7Euni2C7Funi2D00uni2D01uni2D02uni2D03uni2D04uni2D05uni2D06uni2D07uni2D08uni2D09uni2D0Auni2D0Buni2D0Cuni2D0Duni2D0Euni2D0Funi2D10uni2D11uni2D12uni2D13uni2D14uni2D15uni2D16uni2D17uni2D18uni2D19uni2D1Auni2D1Buni2D1Cuni2D1Duni2D1Euni2D1Funi2D20uni2D21uni2D22uni2D23uni2D24uni2D25uni2D30uni2D31uni2D32uni2D33uni2D34uni2D35uni2D36uni2D37uni2D38uni2D39uni2D3Auni2D3Buni2D3Cuni2D3Duni2D3Euni2D3Funi2D40uni2D41uni2D42uni2D43uni2D44uni2D45uni2D46uni2D47uni2D48uni2D49uni2D4Auni2D4Buni2D4Cuni2D4Duni2D4Euni2D4Funi2D50uni2D51uni2D52uni2D53uni2D54uni2D55uni2D56uni2D57uni2D58uni2D59uni2D5Auni2D5Buni2D5Cuni2D5Duni2D5Euni2D5Funi2D60uni2D61uni2D62uni2D63uni2D64uni2D65uni2D6Funi2E18uni2E1Funi2E22uni2E23uni2E24uni2E25uni2E2Euni4DC0uni4DC1uni4DC2uni4DC3uni4DC4uni4DC5uni4DC6uni4DC7uni4DC8uni4DC9uni4DCAuni4DCBuni4DCCuni4DCDuni4DCEuni4DCFuni4DD0uni4DD1uni4DD2uni4DD3uni4DD4uni4DD5uni4DD6uni4DD7uni4DD8uni4DD9uni4DDAuni4DDBuni4DDCuni4DDDuni4DDEuni4DDFuni4DE0uni4DE1uni4DE2uni4DE3uni4DE4uni4DE5uni4DE6uni4DE7uni4DE8uni4DE9uni4DEAuni4DEBuni4DECuni4DEDuni4DEEuni4DEFuni4DF0uni4DF1uni4DF2uni4DF3uni4DF4uni4DF5uni4DF6uni4DF7uni4DF8uni4DF9uni4DFAuni4DFBuni4DFCuni4DFDuni4DFEuni4DFFuniA4D0uniA4D1uniA4D2uniA4D3uniA4D4uniA4D5uniA4D6uniA4D7uniA4D8uniA4D9uniA4DAuniA4DBuniA4DCuniA4DDuniA4DEuniA4DFuniA4E0uniA4E1uniA4E2uniA4E3uniA4E4uniA4E5uniA4E6uniA4E7uniA4E8uniA4E9uniA4EAuniA4EBuniA4ECuniA4EDuniA4EEuniA4EFuniA4F0uniA4F1uniA4F2uniA4F3uniA4F4uniA4F5uniA4F6uniA4F7uniA4F8uniA4F9uniA4FAuniA4FBuniA4FCuniA4FDuniA4FEuniA4FFuniA644uniA645uniA646uniA647uniA64CuniA64DuniA650uniA651uniA654uniA655uniA656uniA657uniA662uniA663uniA664uniA665uniA666uniA667uniA668uniA669uniA66AuniA66BuniA66CuniA66DuniA66EuniA68AuniA68BuniA68CuniA68DuniA694uniA695uniA708uniA709uniA70AuniA70BuniA70CuniA70DuniA70EuniA70FuniA710uniA711uniA712uniA713uniA714uniA715uniA716uniA71BuniA71CuniA71DuniA71EuniA71FuniA722uniA723uniA724uniA725uniA726uniA727uniA728uniA729uniA72AuniA72BuniA730uniA731uniA732uniA733uniA734uniA735uniA736uniA737uniA738uniA739uniA73AuniA73BuniA73CuniA73DuniA73EuniA73FuniA740uniA741uniA746uniA747uniA748uniA749uniA74AuniA74BuniA74EuniA74FuniA750uniA751uniA752uniA753uniA756uniA757uniA764uniA765uniA766uniA767uniA780uniA781uniA782uniA783uniA789uniA78AuniA78BuniA78CuniA78DuniA78EuniA790uniA791uniA7A0uniA7A1uniA7A2uniA7A3uniA7A4uniA7A5uniA7A6uniA7A7uniA7A8uniA7A9uniA7AAuniA7F8uniA7F9uniA7FAuniA7FBuniA7FCuniA7FDuniA7FEuniA7FF uni02E5.5 uni02E6.5 uni02E7.5 uni02E8.5 uni02E9.5 uni02E5.4 uni02E6.4 uni02E7.4 uni02E8.4 uni02E9.4 uni02E5.3 uni02E6.3 uni02E7.3 uni02E8.3 uni02E9.3 uni02E5.2 uni02E6.2 uni02E7.2 uni02E8.2 uni02E9.2 uni02E5.1 uni02E6.1 uni02E7.1 uni02E8.1 uni02E9.1stemuniF000uniF001uniF002uniF003uniF400uniF401uniF402uniF403uniF404uniF405uniF406uniF407uniF408uniF409uniF40AuniF40BuniF40CuniF40DuniF40EuniF40FuniF410uniF411uniF412uniF413uniF414uniF415uniF416uniF417uniF418uniF419uniF41AuniF41BuniF41CuniF41DuniF41EuniF41FuniF420uniF421uniF422uniF423uniF424uniF425uniF426uniF428uniF429uniF42AuniF42BuniF42CuniF42DuniF42EuniF42FuniF430uniF431uniF432uniF433uniF434uniF435uniF436uniF437uniF438uniF439uniF43AuniF43BuniF43CuniF43DuniF43EuniF43FuniF440uniF441uniF6C5uniFB00uniFB03uniFB04uniFB05uniFB06uniFB13uniFB14uniFB15uniFB16uniFB17uniFB1DuniFB1EuniFB1FuniFB20uniFB21uniFB22uniFB23uniFB24uniFB25uniFB26uniFB27uniFB28uniFB29uniFB2AuniFB2BuniFB2CuniFB2DuniFB2EuniFB2FuniFB30uniFB31uniFB32uniFB33uniFB34uniFB35uniFB36uniFB38uniFB39uniFB3AuniFB3BuniFB3CuniFB3EuniFB40uniFB41uniFB43uniFB44uniFB46uniFB47uniFB48uniFB49uniFB4AuniFB4BuniFB4CuniFB4DuniFB4EuniFB4FuniFB52uniFB53uniFB54uniFB55uniFB56uniFB57uniFB58uniFB59uniFB5AuniFB5BuniFB5CuniFB5DuniFB5EuniFB5FuniFB60uniFB61uniFB62uniFB63uniFB64uniFB65uniFB66uniFB67uniFB68uniFB69uniFB6AuniFB6BuniFB6CuniFB6DuniFB6EuniFB6FuniFB70uniFB71uniFB72uniFB73uniFB74uniFB75uniFB76uniFB77uniFB78uniFB79uniFB7AuniFB7BuniFB7CuniFB7DuniFB7EuniFB7FuniFB80uniFB81uniFB82uniFB83uniFB84uniFB85uniFB86uniFB87uniFB88uniFB89uniFB8AuniFB8BuniFB8CuniFB8DuniFB8EuniFB8FuniFB90uniFB91uniFB92uniFB93uniFB94uniFB95uniFB96uniFB97uniFB98uniFB99uniFB9AuniFB9BuniFB9CuniFB9DuniFB9EuniFB9FuniFBA0uniFBA1uniFBA2uniFBA3uniFBAAuniFBABuniFBACuniFBADuniFBD3uniFBD4uniFBD5uniFBD6uniFBD7uniFBD8uniFBD9uniFBDAuniFBDBuniFBDCuniFBDEuniFBDFuniFBE4uniFBE5uniFBE6uniFBE7uniFBE8uniFBE9uniFBFCuniFBFDuniFBFEuniFBFFuniFE00uniFE01uniFE02uniFE03uniFE04uniFE05uniFE06uniFE07uniFE08uniFE09uniFE0AuniFE0BuniFE0CuniFE0DuniFE0EuniFE0FuniFE20uniFE21uniFE22uniFE23uniFE70uniFE71uniFE72uniFE73uniFE74uniFE76uniFE77uniFE78uniFE79uniFE7AuniFE7BuniFE7CuniFE7DuniFE7EuniFE7FuniFE80uniFE81uniFE82uniFE83uniFE84uniFE85uniFE86uniFE87uniFE88uniFE89uniFE8AuniFE8BuniFE8CuniFE8DuniFE8EuniFE8FuniFE90uniFE91uniFE92uniFE93uniFE94uniFE95uniFE96uniFE97uniFE98uniFE99uniFE9AuniFE9BuniFE9CuniFE9DuniFE9EuniFE9FuniFEA0uniFEA1uniFEA2uniFEA3uniFEA4uniFEA5uniFEA6uniFEA7uniFEA8uniFEA9uniFEAAuniFEABuniFEACuniFEADuniFEAEuniFEAFuniFEB0uniFEB1uniFEB2uniFEB3uniFEB4uniFEB5uniFEB6uniFEB7uniFEB8uniFEB9uniFEBAuniFEBBuniFEBCuniFEBDuniFEBEuniFEBFuniFEC0uniFEC1uniFEC2uniFEC3uniFEC4uniFEC5uniFEC6uniFEC7uniFEC8uniFEC9uniFECAuniFECBuniFECCuniFECDuniFECEuniFECFuniFED0uniFED1uniFED2uniFED3uniFED4uniFED5uniFED6uniFED7uniFED8uniFED9uniFEDAuniFEDBuniFEDCuniFEDDuniFEDEuniFEDFuniFEE0uniFEE1uniFEE2uniFEE3uniFEE4uniFEE5uniFEE6uniFEE7uniFEE8uniFEE9uniFEEAuniFEEBuniFEECuniFEEDuniFEEEuniFEEFuniFEF0uniFEF1uniFEF2uniFEF3uniFEF4uniFEF5uniFEF6uniFEF7uniFEF8uniFEF9uniFEFAuniFEFBuniFEFCuniFEFFuniFFF9uniFFFAuniFFFBuniFFFCuniFFFDu10300u10301u10302u10303u10304u10305u10306u10307u10308u10309u1030Au1030Bu1030Cu1030Du1030Eu1030Fu10310u10311u10312u10313u10314u10315u10316u10317u10318u10319u1031Au1031Bu1031Cu1031Du1031Eu10320u10321u10322u10323u1D300u1D301u1D302u1D303u1D304u1D305u1D306u1D307u1D308u1D309u1D30Au1D30Bu1D30Cu1D30Du1D30Eu1D30Fu1D310u1D311u1D312u1D313u1D314u1D315u1D316u1D317u1D318u1D319u1D31Au1D31Bu1D31Cu1D31Du1D31Eu1D31Fu1D320u1D321u1D322u1D323u1D324u1D325u1D326u1D327u1D328u1D329u1D32Au1D32Bu1D32Cu1D32Du1D32Eu1D32Fu1D330u1D331u1D332u1D333u1D334u1D335u1D336u1D337u1D338u1D339u1D33Au1D33Bu1D33Cu1D33Du1D33Eu1D33Fu1D340u1D341u1D342u1D343u1D344u1D345u1D346u1D347u1D348u1D349u1D34Au1D34Bu1D34Cu1D34Du1D34Eu1D34Fu1D350u1D351u1D352u1D353u1D354u1D355u1D356u1D538u1D539u1D53Bu1D53Cu1D53Du1D53Eu1D540u1D541u1D542u1D543u1D544u1D546u1D54Au1D54Bu1D54Cu1D54Du1D54Eu1D54Fu1D550u1D552u1D553u1D554u1D555u1D556u1D557u1D558u1D559u1D55Au1D55Bu1D55Cu1D55Du1D55Eu1D55Fu1D560u1D561u1D562u1D563u1D564u1D565u1D566u1D567u1D568u1D569u1D56Au1D56Bu1D5A0u1D5A1u1D5A2u1D5A3u1D5A4u1D5A5u1D5A6u1D5A7u1D5A8u1D5A9u1D5AAu1D5ABu1D5ACu1D5ADu1D5AEu1D5AFu1D5B0u1D5B1u1D5B2u1D5B3u1D5B4u1D5B5u1D5B6u1D5B7u1D5B8u1D5B9u1D5BAu1D5BBu1D5BCu1D5BDu1D5BEu1D5BFu1D5C0u1D5C1u1D5C2u1D5C3u1D5C4u1D5C5u1D5C6u1D5C7u1D5C8u1D5C9u1D5CAu1D5CBu1D5CCu1D5CDu1D5CEu1D5CFu1D5D0u1D5D1u1D5D2u1D5D3u1D7D8u1D7D9u1D7DAu1D7DBu1D7DCu1D7DDu1D7DEu1D7DFu1D7E0u1D7E1u1D7E2u1D7E3u1D7E4u1D7E5u1D7E6u1D7E7u1D7E8u1D7E9u1D7EAu1D7EBu1EE00u1EE01u1EE02u1EE03u1EE05u1EE06u1EE07u1EE08u1EE09u1EE0Au1EE0Bu1EE0Cu1EE0Du1EE0Eu1EE0Fu1EE10u1EE11u1EE12u1EE13u1EE14u1EE15u1EE16u1EE17u1EE18u1EE19u1EE1Au1EE1Bu1EE1Cu1EE1Du1EE1Eu1EE1Fu1EE21u1EE22u1EE24u1EE27u1EE29u1EE2Au1EE2Bu1EE2Cu1EE2Du1EE2Eu1EE2Fu1EE30u1EE31u1EE32u1EE34u1EE35u1EE36u1EE37u1EE39u1EE3Bu1EE61u1EE62u1EE64u1EE67u1EE68u1EE69u1EE6Au1EE6Cu1EE6Du1EE6Eu1EE6Fu1EE70u1EE71u1EE72u1EE74u1EE75u1EE76u1EE77u1EE79u1EE7Au1EE7Bu1EE7Cu1EE7Eu1F030u1F031u1F032u1F033u1F034u1F035u1F036u1F037u1F038u1F039u1F03Au1F03Bu1F03Cu1F03Du1F03Eu1F03Fu1F040u1F041u1F042u1F043u1F044u1F045u1F046u1F047u1F048u1F049u1F04Au1F04Bu1F04Cu1F04Du1F04Eu1F04Fu1F050u1F051u1F052u1F053u1F054u1F055u1F056u1F057u1F058u1F059u1F05Au1F05Bu1F05Cu1F05Du1F05Eu1F05Fu1F060u1F061u1F062u1F063u1F064u1F065u1F066u1F067u1F068u1F069u1F06Au1F06Bu1F06Cu1F06Du1F06Eu1F06Fu1F070u1F071u1F072u1F073u1F074u1F075u1F076u1F077u1F078u1F079u1F07Au1F07Bu1F07Cu1F07Du1F07Eu1F07Fu1F080u1F081u1F082u1F083u1F084u1F085u1F086u1F087u1F088u1F089u1F08Au1F08Bu1F08Cu1F08Du1F08Eu1F08Fu1F090u1F091u1F092u1F093u1F0A0u1F0A1u1F0A2u1F0A3u1F0A4u1F0A5u1F0A6u1F0A7u1F0A8u1F0A9u1F0AAu1F0ABu1F0ACu1F0ADu1F0AEu1F0B1u1F0B2u1F0B3u1F0B4u1F0B5u1F0B6u1F0B7u1F0B8u1F0B9u1F0BAu1F0BBu1F0BCu1F0BDu1F0BEu1F0C1u1F0C2u1F0C3u1F0C4u1F0C5u1F0C6u1F0C7u1F0C8u1F0C9u1F0CAu1F0CBu1F0CCu1F0CDu1F0CEu1F0CFu1F0D1u1F0D2u1F0D3u1F0D4u1F0D5u1F0D6u1F0D7u1F0D8u1F0D9u1F0DAu1F0DBu1F0DCu1F0DDu1F0DEu1F0DFu1F42Du1F42Eu1F431u1F435u1F600u1F601u1F602u1F603u1F604u1F605u1F606u1F607u1F608u1F609u1F60Au1F60Bu1F60Cu1F60Du1F60Eu1F60Fu1F610u1F611u1F612u1F613u1F614u1F615u1F616u1F617u1F618u1F619u1F61Au1F61Bu1F61Cu1F61Du1F61Eu1F61Fu1F620u1F621u1F622u1F623u1F625u1F626u1F627u1F628u1F629u1F62Au1F62Bu1F62Du1F62Eu1F62Fu1F630u1F631u1F632u1F633u1F634u1F635u1F636u1F637u1F638u1F639u1F63Au1F63Bu1F63Cu1F63Du1F63Eu1F63Fu1F640 dlLtcaronDieresisAcuteTildeGrave CircumflexCaron uni0311.caseBreve Dotaccent Hungarumlaut Doublegrave arabic_dot arabic_2dots arabic_3dotsarabic_3dots_aarabic_2dots_a arabic_4dots uni066E.fina uni066E.init uni066E.medi uni06A1.fina uni06A1.init uni06A1.medi uni066F.fina uni066F.init uni066F.medi uni06BA.init uni06BA.medi arabic_ring uni067C.fina uni067C.init uni067C.medi uni067D.fina uni067D.init uni067D.medi uni0681.fina uni0681.init uni0681.medi uni0682.fina uni0682.init uni0682.medi uni0685.fina uni0685.init uni0685.medi uni06BF.fina uni06BF.init uni06BF.mediarabic_gaf_barEng.altuni0268.dotlessuni029D.dotless uni03080304 uni03040308 uni03070304 uni03080301 uni03080300 uni03040301 uni03040300 uni03030304 uni0308030C uni03030308 uni030C0307 uni03030301 uni03020301 uni03020300 uni03020303 uni03060303 uni03060301 uni03060300 uni03060309 uni03020309 uni03010307 brailledotJ.alt uni0695.finauniFEAE.fina.longstart uni06B5.fina uni06B5.init uni06B5.medi uni06CE.fina uni06CE.init uni06CE.medi uni0692.final.alt uni06D5.finauni0478.monographuni0479.monographiogonek.dotlessuni2148.dotlessuni2149.dotlessuni1E2D.dotlessuni1ECB.dotlessdcoI.alt arrow.base uni0651064B uni0651064C uni064B0651 uni0651064E uni0651064F uni064E0651 uni0654064E uni0654064F uni07CA.fina uni07CA.medi uni07CA.init uni07CB.fina uni07CB.medi uni07CB.init uni07CC.fina uni07CC.medi uni07CC.init uni07CD.fina uni07CD.medi uni07CD.init uni07CE.fina uni07CE.medi uni07CE.init uni07CF.fina uni07CF.medi uni07CF.init uni07D0.fina uni07D0.medi uni07D0.init uni07D1.fina uni07D1.medi uni07D1.init uni07D2.fina uni07D2.medi uni07D2.init uni07D3.fina uni07D3.medi uni07D3.init uni07D4.fina uni07D4.medi uni07D4.init uni07D5.fina uni07D5.medi uni07D5.init uni07D6.fina uni07D6.medi uni07D6.init uni07D7.fina uni07D7.medi uni07D7.init uni07D8.fina uni07D8.medi uni07D8.init uni07D9.fina uni07D9.medi uni07D9.init uni07DA.fina uni07DA.medi uni07DA.init uni07DB.fina uni07DB.medi uni07DB.init uni07DC.fina uni07DC.medi uni07DC.init uni07DD.fina uni07DD.medi uni07DD.init uni07DE.fina uni07DE.medi uni07DE.init uni07DF.fina uni07DF.medi uni07DF.init uni07E0.fina uni07E0.medi uni07E0.init uni07E1.fina uni07E1.medi uni07E1.init uni07E2.fina uni07E2.medi uni07E2.init uni07E3.fina uni07E3.medi uni07E3.init uni07E4.fina uni07E4.medi uni07E4.init uni07E5.fina uni07E5.medi uni07E5.init uni07E6.fina uni07E6.medi uni07E6.init uni07E7.fina uni07E7.medi uni07E7.init Ringabove uni2630.alt uni2631.alt uni2632.alt uni2633.alt uni2634.alt uni2635.alt uni2636.alt uni2637.alt uni047E.diacuni048A.brevelessuni048B.brevelessy.alt uni0689.fina uni068A.fina uni068B.fina uni068F.fina uni0690.fina uni0693.fina uni0694.fina uni0696.fina uni0697.fina uni0699.fina uni069A.fina uni069A.init uni069A.medi uni069B.fina uni069B.init uni069B.medi uni069C.fina uni069C.init uni069C.medi uni069D.fina uni069D.init uni069D.medi uni069E.fina uni069E.init uni069E.medi uni069F.fina uni069F.init uni069F.medi uni06A0.fina uni06A0.init uni06A0.medi uni06A2.fina uni06A2.init uni06A2.medi uni06A3.fina uni06A3.init uni06A3.medi uni06A5.fina uni06A5.init uni06A5.medi uni06A7.fina uni06A7.init uni06A7.medi uni06A8.fina uni06A8.init uni06A8.medi uni06AA.fina uni06AA.init uni06AA.medi uni06AB.fina uni06AB.init uni06AB.medi uni06AC.fina uni06AC.init uni06AC.medi uni06AE.fina uni06AE.init uni06AE.medi uni06B0.fina uni06B0.init uni06B0.medi uni06B2.fina uni06B2.init uni06B2.medi uni06B4.fina uni06B4.init uni06B4.medi uni06B6.fina uni06B6.init uni06B6.medi uni06B7.fina uni06B7.init uni06B7.medi uni06B8.fina uni06B8.init uni06B8.medi uni06B9.fina uni06B9.init uni06B9.medi uni06BC.fina uni06BC.init uni06BC.medi uni06BD.fina uni06BD.init uni06BD.mediexclamdown.casequestiondown.case uni2E18.caseuni066E.init.mathproduct.displayuni2210.displaysummation.displayintegral.displayuni222C.displayuni222D.displayuni222E.displayuni222F.displayuni2230.displayuni2231.displayuni2232.displayuni2233.displayuni22C0.displayuni22C1.displayuni22C2.displayuni22C3.displayuni2A00.displayuni2A01.displayuni2A02.displayuni2A0C.displayuni2A0D.displayuni2A0E.displayuni2A0F.displayuni2A10.displayuni2A11.displayuni2A12.displayuni2A13.displayuni2A14.displayuni2A15.displayuni2A16.displayuni2A17.displayuni2A18.displayuni2A19.displayuni2A1A.displayuni2A1B.displayuni2A1C.display¸€@ÿûþúù%ø2÷–öõþôþó%òñ–ð%ïŠAïþî–í–ìúëúêþé:èBçþæ2åäSå–äŠAäSãâ/ãúâ/áþàþß2ÞÝ–ÜþÛÚ}Ù»ØþÖŠAÖ}ÕÔGÕ}ÔGÓÒÓþÒÑþÐþÏþÎþÍ–ÌËÌþËÊ2ÉþÆ…ÆÅÄþÃþÂþÁþÀþ¿þ¾þ½þ¼þ»þº¹†%¹þ¸·»¸þ·¶]·»·€¶µ%¶]@ÿ¶@µ%´þ³–²þ±þ°þ¯þ®d­¬«%¬d«ª«%ª©ŠA©ú¨þ§þ¦þ¥¤þ£¢£2¢¡d ŠA –Ÿþž žþ œ›œd›š›š™ ˜þ—– —þ– •ŠA•–”“”(“’ú‘»‘þ]»€Ž%]@Ž%þŒ‹.Œþ‹.І%ŠA‰ˆ ‰ˆ ‡†%‡d†…†%…„þƒ‚ƒþ‚þ€þþ@ÿ~}}~þ}}|d{T{%zþyþxw v uþtúsúrúqúpþoþnþl!kþjBjSiþh}gBfþeþdþcþbþa:`ú^ ]þ[þZþYX YúX WW2VþUTUBTSSRQJQþP OþNMNþMLþKJKþJIJI IH GþF–E–DþC-CúB»AK@þ?þ>=>=<=<; <@ÿ; :þ9þ878ú76765 65 43 21 2þ1 0/ 0 / .- .- ,2+*%+d*)*%)('%(A'%&% &% $þ#þ"!! dú d BþúBBþdþþþþBþ-B}dþ  þ   þ  þ-þdþ@-þ-þ¸d…++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1453652090.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/DejaVuSans.txt0000664000175000017500000001132012651174172021430 0ustar00tomtomFonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) Bitstream Vera Fonts Copyright ------------------------------ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. Arev Fonts Copyright ------------------------------ Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the modifications to the Bitstream Vera Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Tavmjong Bah" or the word "Arev". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Tavmjong Bah Arev" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the name of Tavmjong Bah shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from Tavmjong Bah. For further information, contact: tavmjong @ free . fr. $Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1592152666.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/__init__.py0000664000175000017500000001042713671451132021001 0ustar00tomtom# Copyright 2014 Tom Rothamel # Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from __future__ import division, print_function, absolute_import import sys import importlib class MissingModule(object): def __init__(self, name, reason): self.__name__ = name self.reason = reason def __getattr__(self, attr): raise NotImplementedError(self.reason) def try_import(name): full_name = "pygame_sdl2." + name try: module = importlib.import_module(full_name) except (IOError, ImportError) as e: module = MissingModule(full_name, "Could not import {}: {}".format(full_name, str(e))) globals()[name] = module sys.modules[full_name] = module # Lists of functions that are called on init and quit. init_functions = [ ] quit_functions = [ ] def register_init(fn): init_functions.append(fn) return fn def register_quit(fn): quit_functions.append(fn) return fn def init(): numpass = 0 numfail = 0 for i in init_functions: try: i() numpass += 1 except: numfail += 1 return numpass, numfail def quit(): # @ReservedAssignment for i in quit_functions: try: i() except: pass # Import core modules. from pygame_sdl2.error import * from pygame_sdl2.surface import Surface from pygame_sdl2.rect import Rect import pygame_sdl2.color import pygame_sdl2.display import pygame_sdl2.event import pygame_sdl2.key import pygame_sdl2.locals # @ReservedAssignment import pygame_sdl2.time import pygame_sdl2.version import pygame_sdl2.locals as constants # Import optional modules. try_import("controller") try_import("draw") try_import("font") try_import("image") try_import("joystick") try_import("mixer") try_import("mouse") try_import("power") try_import("transform") try_import("scrap") try_import("sprite") try_import("sysfont") # Optional imports should be included in this function, so they show up # in packaging tools (like py2exe). def _optional_imports(): import pygame_sdl2.compat import pygame_sdl2.controller import pygame_sdl2.rwobject import pygame_sdl2.gfxdraw import pygame_sdl2.draw import pygame_sdl2.font import pygame_sdl2.image import pygame_sdl2.joystick import pygame_sdl2.mixer import pygame_sdl2.mouse import pygame_sdl2.power import pygame_sdl2.transform import pygame_sdl2.scrap import pygame_sdl2.sprite import pygame_sdl2.sysfont # Fill this module with locals. from pygame_sdl2.locals import * def import_as_pygame(): """ Imports pygame_sdl2 as pygame, so that running the 'import pygame.whatever' statement will import pygame_sdl2.whatever instead. """ import os import warnings if "PYGAME_SDL2_USE_PYGAME" in os.environ: return if "pygame" in sys.modules: warnings.warn("Pygame has already been imported, import_as_pygame may not work.", stacklevel=2) for name, mod in list(sys.modules.items()): name = name.split('.') if name[0] != 'pygame_sdl2': continue name[0] = 'pygame' name = ".".join(name) sys.modules[name] = mod sys.modules['pygame.constants'] = constants def get_sdl_byteorder(): return BYTEORDER def get_sdl_version(): return SDL_VERSION_TUPLE get_platform = pygame_sdl2.display.get_platform # We have new-style buffers, but not the pygame.newbuffer module. HAVE_NEWBUF = False ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1415242907.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/color.pxd0000664000175000017500000000254712426562233020531 0ustar00tomtom# Copyright 2014 Tom Rothamel # Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * cdef Uint32 map_color(SDL_Surface *surface, color) except? 0xaabbccdd cdef object get_color(Uint32 pixel, SDL_Surface *surface) cdef to_sdl_color(color, SDL_Color *out) cdef class Color: # Allow weak references. cdef object __weakref__ cdef public Uint8 r, g, b, a cdef uint8_t length cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a) cdef from_name(self, c) cdef from_hex(self, c) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1495488396.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/color.pyx0000644000175000017500000003074513110653614020550 0ustar00tomtom# Copyright 2014 Tom Rothamel # Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * import binascii import struct include "color_dict.pxi" cdef Uint32 map_color(SDL_Surface *surface, color) except? 0xaabbccdd: """ Maps `color` into an RGBA color value that can be used with `surface`. """ cdef Uint8 r, g, b, a if isinstance(color, (tuple, list, Color)) and len(color) == 4: r, g, b, a = color elif isinstance(color, (tuple, list, Color)) and len(color) == 3: r, g, b = color a = 255 elif isinstance(color, int): return color else: raise TypeError("Expected a color.") return SDL_MapRGBA(surface.format, r, g, b, a) cdef object get_color(Uint32 pixel, SDL_Surface *surface): cdef Uint8 r cdef Uint8 g cdef Uint8 b cdef Uint8 a SDL_GetRGBA(pixel, surface.format, &r, &g, &b, &a) return Color(r, g, b, a) cdef to_sdl_color(color, SDL_Color *out): if not isinstance(color, Color): color = Color(color) out.r = color.r out.g = color.g out.b = color.b out.a = color.a cdef class Color: cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): self.r = r self.g = g self.b = b self.a = a cdef from_hex(self, c): # Handle short hex strings. if len(c) == 3 or len(c) == 4: c = "".join(map(lambda x: x*2, c)) try: if len(c) == 6: r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) a = 255 elif len(c) == 8: r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) else: raise ValueError(c) except TypeError as e: raise ValueError(c) self.from_rgba(r, g, b, a) cdef from_name(self, c): # Remove all whitespace. c = "".join(c.split()).lower() try: r, g, b = colors[c] except KeyError as e: raise ValueError(c) self.from_rgba(r, g, b, 255) def __richcmp__(Color x, y, int op): if op == 3: return not (x == y) if isinstance(y, tuple): y = Color(y) if not isinstance(y, Color): return False if op == 2: return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a def __cinit__(self): self.length = 4 self.r = 0 self.g = 0 self.b = 0 self.a = 255 def __init__(self, *args): self.length = 4 if len(args) == 1: c = args[0] if isinstance(c, basestring): if c.startswith('#'): self.from_hex(c[1:]) elif c.startswith('0x'): self.from_hex(c[2:]) else: self.from_name(c) elif isinstance(c, (tuple, list, Color)): if len(c) == 4: self.from_rgba(c[0], c[1], c[2], c[3]) elif len(c) == 3: self.from_rgba(c[0], c[1], c[2], 255) else: raise ValueError(c) else: self.from_hex("%08x" % c) elif len(args) == 3: r, g, b = args self.from_rgba(r, g, b, 255) elif len(args) == 4: r, g, b, a = args self.from_rgba(r, g, b, a) def __repr__(self): return str((self.r, self.g, self.b, self.a)) def __int__(self): packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) return struct.unpack('>L', packed)[0] def __hex__(self): return hex(int(self)) def __oct__(self): return oct(int(self)) def __float__(self): return float(int(self)) def __reduce__(self): d = {} d['rgba'] = (self.r, self.g, self.b, self.a) return (Color, (), d) def __setstate__(self, d): self.r, self.g, self.b, self.a = d['rgba'] def __setitem__(self, key, val): if not isinstance(val, int): raise ValueError(val) if key >= self.length: raise IndexError(key) if val < 0 or val > 255: raise ValueError(val) if key == 0: self.r = val elif key == 1: self.g = val elif key == 2: self.b = val elif key == 3: self.a = val else: raise IndexError(key) def __getitem__(self, key): if isinstance(key, slice): return tuple(self)[key] if key >= self.length: raise IndexError(key) if key == 0: return self.r elif key == 1: return self.g elif key == 2: return self.b elif key == 3: return self.a else: raise IndexError(key) def __len__(self): return self.length def __mul__(self not None, Color rhs not None): # Multiplying this way doesn't make much sense, # but it's how pygame does it. r = min(255, self.r * rhs.r) g = min(255, self.g * rhs.g) b = min(255, self.b * rhs.b) a = min(255, self.a * rhs.a) return type(self)(r, g, b, a) def __add__(self not None, Color rhs not None): r = min(255, self.r + rhs.r) g = min(255, self.g + rhs.g) b = min(255, self.b + rhs.b) a = min(255, self.a + rhs.a) return type(self)(r, g, b, a) def __sub__(self not None, Color rhs not None): r = max(0, self.r - rhs.r) g = max(0, self.g - rhs.g) b = max(0, self.b - rhs.b) a = max(0, self.a - rhs.a) return type(self)(r, g, b, a) def __mod__(self not None, Color rhs not None): def mod(l, r): if r == 0: return 0 return l % r r = mod(self.r, rhs.r) g = mod(self.g, rhs.g) b = mod(self.b, rhs.b) a = mod(self.a, rhs.a) return type(self)(r, g, b, a) def __div__(self not None, Color rhs not None): r = min(255, self.r / rhs.r) g = min(255, self.g / rhs.g) b = min(255, self.b / rhs.b) a = min(255, self.a / rhs.a) return type(self)(r, g, b, a) def __floordiv__(self not None, Color rhs not None): def div(a, b): if b == 0: return b return min(255, a // b) r = div(self.r, rhs.r) g = div(self.g, rhs.g) b = div(self.b, rhs.b) a = div(self.a, rhs.a) return type(self)(r, g, b, a) property cmy: def __get__(self): return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) def __set__(self, val): c, m, y = val self.r = (1 - c) * 255 self.g = (1 - m) * 255 self.b = (1 - y) * 255 property hsva: def __get__(self): cdef double r = self.r / 255.0 cdef double g = self.g / 255.0 cdef double b = self.b / 255.0 cdef double cmax = max(r, g, b) cdef double cmin = min(r, g, b) cdef double delta = cmax - cmin cdef double h, s, v, a if r == g == b: h = 0.0 s = 0.0 else: if cmax == r: h = 60.0 * ((g - b) / delta % 6) elif cmax == g: h = 60.0 * ((b - r) / delta + 2) else: h = 60.0 * ((r - g) / delta + 4) if cmax == 0.0: s = 0.0 else: s = delta / cmax * 100 v = cmax * 100 a = self.a / 255.0 * 100 return h, s, v, a def __set__(self, val): cdef double h, s, v, a if len(val) == 3: h, s, v = val a = 0.0 else: h, s, v, a = val h = h % 360.0 # These should be in a range of [0.0, 1.0] s /= 100.0 v /= 100.0 a /= 100.0 cdef double c = v * s cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) cdef double m = v - c cdef double r, g, b if 0 <= h < 60: r, g, b = c, x, 0 elif 60 <= h < 120: r, g, b = x, c, 0 elif 120 <= h < 180: r, g, b = 0, c, x elif 180 <= h < 240: r, g, b = 0, x, c elif 240 <= h < 300: r, g, b = x, 0, c elif 300 <= h < 360: r, g, b = c, 0, x else: raise ValueError() self.r = int(255 * (r + m)) self.g = int(255 * (g + m)) self.b = int(255 * (b + m)) self.a = int(255 * a) property hsla: def __get__(self): cdef double h, s, l, a cdef double r, g, b cdef double cmin, cmax, delta h = self.hsva[0] % 360.0 r = self.r / 255.0 g = self.g / 255.0 b = self.b / 255.0 cmin = min(r, g, b) cmax = max(r, g, b) delta = cmax - cmin l = (cmax + cmin) / 2.0 if delta == 0: s = 0.0 else: s = delta / (1 - abs(2 * l - 1)) a = self.a / 255.0 * 100 s = min(100.0, s * 100) l = min(100.0, l * 100) return h, s, l, a def __set__(self, val): cdef double h, s, l, a if len(val) == 3: h, s, l = val a = 0.0 else: h, s, l, a = val s /= 100.0 l /= 100.0 a /= 100.0 cdef double c = (1 - abs(2*l - 1)) * s cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) cdef double m = l - c / 2.0 cdef double r, g, b if 0 <= h < 60: r, g, b = c, x, 0 elif 60 <= h < 120: r, g, b = x, c, 0 elif 120 <= h < 180: r, g, b = 0, c, x elif 180 <= h < 240: r, g, b = 0, x, c elif 240 <= h < 300: r, g, b = x, 0, c elif 300 <= h < 360: r, g, b = c, 0, x else: raise ValueError() self.r = int(255 * (r + m)) self.g = int(255 * (g + m)) self.b = int(255 * (b + m)) self.a = int(255 * a) property i1i2i3: def __get__(self): # Take the dot product as described here: # http://de.wikipedia.org/wiki/I1I2I3-Farbraum cdef double i1, i2, i3 cdef double r, g, b r = self.r / 255.0 g = self.g / 255.0 b = self.b / 255.0 i1 = (r + g + b) / 3.0 i2 = (r - b) / 2.0 i3 = (2*g - r - b) / 4.0 return i1, i2, i3 def __set__(self, val): # Dot product with the inverted matrix. cdef double i1, i2, i3 cdef double r, g, b i1, i2, i3 = val r = i1 + i2 - (2.0/3.0 * i3) g = i1 + (4.0/3.0 * i3) b = i1 - i2 - (2.0/3.0 * i3) # Don't change alpha. self.r = int(r * 255) self.g = int(g * 255) self.b = int(b * 255) def normalize(self): return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 def correct_gamma(self, gamma): m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) c = type(self)(tuple(m)) return c def set_length(self, n): if n > 4 or n < 1: raise ValueError(n) self.length = n ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1573966073.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/compat.py0000644000175000017500000000550013564150371020521 0ustar00tomtom"""Python 2.x/3.x compatibility tools""" import sys __all__ = ['geterror', 'long_', 'xrange_', 'ord_', 'unichr_', 'unicode_', 'raw_input_', 'as_bytes', 'as_unicode', 'file_type' ] if sys.version_info[0] >= 3: import io file_type = io.FileIO else: file_type = file def geterror (): return sys.exc_info()[1] try: long_ = long except NameError: long_ = int try: xrange_ = xrange except NameError: xrange_ = range def get_BytesIO(): try: from cStringIO import StringIO as BytesIO except ImportError: from io import BytesIO return BytesIO def get_StringIO(): try: from cStringIO import StringIO except ImportError: from io import StringIO return StringIO def ord_(o): try: return ord(o) except TypeError: return o try: unichr_ = unichr except NameError: unichr_ = chr try: unicode_ = unicode except NameError: unicode_ = str try: bytes_ = bytes except NameError: bytes_ = str try: raw_input_ = raw_input except NameError: raw_input_ = input if sys.platform == 'win32': filesystem_errors = "replace" elif sys.version_info >= (3, 0, 0): filesystem_errors = "surrogateescape" else: filesystem_errors = "strict" def filesystem_encode(u): return u.encode(sys.getfilesystemencoding(), filesystem_errors) # Represent escaped bytes and strings in a portable way. # # as_bytes: Allow a Python 3.x string to represent a bytes object. # e.g.: as_bytes("a\x01\b") == b"a\x01b" # Python 3.x # as_bytes("a\x01\b") == "a\x01b" # Python 2.x # as_unicode: Allow a Python "r" string to represent a unicode string. # e.g.: as_unicode(r"Bo\u00F6tes") == u"Bo\u00F6tes" # Python 2.x # as_unicode(r"Bo\u00F6tes") == "Bo\u00F6tes" # Python 3.x try: unicode def as_bytes(string): """ '' => '' """ return string def as_unicode(rstring): """ r'' => u'' """ return rstring.decode('unicode_escape', 'strict') except NameError: def as_bytes(string): """ '' => b'' """ return string.encode('latin-1', 'strict') def as_unicode(rstring): """ r'' => '' """ return rstring.encode('ascii', 'strict').decode('unicode_escape', 'stict') # Include a next compatible function for Python versions < 2.6 try: next_ = next except NameError: def next_(i, *args): try: return i.next() except StopIteration: if args: return args[0] raise # itertools.imap is missing in 3.x try: import itertools.imap as imap_ except ImportError: imap_ = map ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1676447549.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/controller.pyx0000664000175000017500000001565114373107475021631 0ustar00tomtom# Copyright 2015 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from pygame_sdl2.error import error import pygame_sdl2 from pygame_sdl2.rwobject cimport to_rwops @pygame_sdl2.register_init def init(): """ Initializes game controller support. """ pygame_sdl2.display.sdl_main_init() if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): raise error() @pygame_sdl2.register_quit def quit(): # @ReservedAssignment """ Shuts down game controller support. """ SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) def get_init(): """ Returns true if game controller support has been initialized. """ return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 def get_count(): """ Returns the number of joysticks and game controllers connected to the system. This is one more than the maximum index that can be passed to Controller. While every game controller is a joystick, not every joystick is a game controller. To check that index `i` corresponds to a game controller, use code such as:: if pygame_sdl2.controller.Controller(i).is_controller(): ... """ return SDL_NumJoysticks() def add_mapping(mapping): """ Adds a game controller mapping from the string in `mapping`. """ if SDL_GameControllerAddMapping(mapping) == -1: raise error() def add_mappings(mapping_file): """ Adds game controller mappings from `mapping_file`, which can be a string filename or a file-like object. This file should be gamecontrollerdb.txt, downloaded from: https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt This should be called before creating a Controller object. It can be called multiple times to add multiple database files. """ cdef SDL_RWops *rwops = to_rwops(mapping_file) if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: raise error() def get_axis_from_string(name): """ Returns the axis number of the controller axis with `name`, or pygame.CONTROLLER_AXIS_INVALID if `name` is not known. """ if not isinstance(name, bytes): name = name.encode("utf-8") return SDL_GameControllerGetAxisFromString(name) def get_button_from_string(name): """ Returns the button number of the controller button with `name`, or pygame.CONTROLLER_BUTTON_INVALID if `name` is not known. """ if not isinstance(name, bytes): name = name.encode("utf-8") return SDL_GameControllerGetButtonFromString(name) def get_string_for_axis(axis): """ Returns a string describing the controller axis `axis`, which must be an integer. Returns None if the axis is not known. """ cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) if rv != NULL: return rv.decode("utf-8") else: return None def get_string_for_button(button): """ Returns a string describing the controller button `button`, which must be an integer. Returns None if the button is not known. """ cdef const char *rv = SDL_GameControllerGetStringForButton(button) if rv != NULL: return rv.decode("utf-8") else: return None cdef class Controller: # Allow weak references. cdef object __weakref__ cdef SDL_GameController *controller cdef int index cdef public int instance_id def __cinit__(self): self.controller = NULL def __init__(self, index): """ Represents a game controller object corresponding to the joystick with `index`. """ self.index = index def init(self): """ Opens the game controller, causing it to begin sending events. """ self.instance_id = SDL_JoystickGetDeviceInstanceID(self.index) if self.controller == NULL: self.controller = SDL_GameControllerOpen(self.index) if self.controller == NULL: raise error() def quit(self): # @ReservedAssignment """ Closes the game controller, preventing it from sending events. """ if self.controller and SDL_GameControllerGetAttached(self.controller): SDL_GameControllerClose(self.controller) self.controller = NULL def get_init(self): """ Returns true if the controller has been initialized, false otherwise. """ if self.controller: return True else: return False def get_axis(self, axis): """ Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS constants. Axes return values from -32768 to 32678, triggers return 0 to 32768. 0 is returned on failure. """ if self.controller == NULL: raise error("controller not initialized.") return SDL_GameControllerGetAxis(self.controller, axis) def get_button(self, button): """ Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON constants. Returns 1 if the button is pressed, 0 if not or the button does not exist. """ if self.controller == NULL: raise error("controller not initialized.") return SDL_GameControllerGetButton(self.controller, button) def get_name(self): """ Returns an implementation-dependent name for this game controller, or None if no name could be found. """ cdef const char *rv = SDL_GameControllerNameForIndex(self.index) if rv == NULL: return None return rv.decode("utf-8") def is_controller(self): """ Returns true if this Controller object corresponds to a supported game controller, or False otherwise. """ return SDL_IsGameController(self.index) def get_guid_string(self): """ Returns the guid string corresponding to this controller. """ cdef SDL_JoystickGUID guid cdef char s[33] guid = SDL_JoystickGetDeviceGUID(self.index) SDL_JoystickGetGUIDString(guid, s, 33) return s.decode("utf-8") ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1453102865.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/display.pxd0000664000175000017500000000253712647113421021053 0ustar00tomtom# Copyright 2014 Patrick Dawson # Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from pygame_sdl2.surface cimport Surface cdef class Window: # Allow weak references. cdef object __weakref__ cdef SDL_Window *window cdef SDL_Surface *window_surface cdef public Surface surface # The OpenGL context corresponding to this window. cdef SDL_GLContext gl_context # The flags the window was created with. cdef Uint32 create_flags cdef Window main_window = None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740628608.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/display.pyx0000664000175000017500000005170014757761200021104 0ustar00tomtom# Copyright 2014 Patrick Dawson # Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from pygame_sdl2.surface cimport * from pygame_sdl2.rect cimport to_sdl_rect from libc.stdlib cimport calloc, free from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL from pygame_sdl2.error import error import pygame_sdl2 import warnings import os # True if we are on ios. ios = ("PYGAME_IOS" in os.environ) # This inits SDL proper, and should be called by the other init methods. # A map from a PYGAME_SDL2 hint to what it was set to. _pygame_hints = { } def hint(hint, value, priority=1): if str(hint).startswith("PYGAME_SDL2"): _pygame_hints[str(hint)] = str(value) return if not isinstance(hint, bytes): hint = hint.encode("utf-8") if not isinstance(value, bytes): value = value.encode("utf-8") SDL_SetHintWithPriority(hint, value, priority) def _get_hint(hint, default): hint = str(hint) if hint in _pygame_hints: return _pygame_hints[hint] if hint in os.environ: return os.environ[hint] return default main_done = False def sdl_main_init(): global main_done if main_done: return SDL_SetMainReady() if SDL_Init(0): raise error() main_done = True # True if init has been called without quit being called. init_done = False @pygame_sdl2.register_init def init(): if init_done: return sdl_main_init() if SDL_InitSubSystem(SDL_INIT_VIDEO): raise error() pygame_sdl2.event.init() global init_done init_done = True @pygame_sdl2.register_quit def quit(): # @ReservedAssignment global init_done global main_window if main_window: main_window.destroy() main_window = None SDL_QuitSubSystem(SDL_INIT_VIDEO) init_done = False def get_init(): return init_done # The window that is used by the various module globals. main_window = None try: import androidembed except ImportError: androidembed = None cdef class Window: def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED), Surface shape=None): cdef SDL_WindowShapeMode shape_mode if not isinstance(title, bytes): title = title.encode("utf-8") self.create_flags = flags # If we do not get the AVOID_GL hint, we always create a GL-compatible # window. This lets us change the OPENGL flag later on. if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): gl_flag = 0 else: gl_flag = SDL_WINDOW_OPENGL self.window = NULL if androidembed is not None: self.window = SDL_GL_GetCurrentWindow() if self.window: # Android bug - a RGB_565 format is likely to mean the window # wasn't created properly, so re-make it. if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: SDL_DestroyWindow(self.window) self.window = NULL else: SDL_SetWindowTitle(self.window, title) if not self.window: flags |= SDL_WINDOW_HIDDEN if shape is not None: shape_mode.mode = ShapeModeDefault self.window = SDL_CreateShapedWindow( title, pos[0], pos[1], resolution[0], resolution[1], flags | gl_flag) SDL_SetWindowShape(self.window, shape.surface, &shape_mode) else: self.window = SDL_CreateWindow( title, pos[0], pos[1], resolution[0], resolution[1], flags | gl_flag) if pos != (SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED): SDL_SetWindowPosition(self.window, pos[0], pos[1]) SDL_ShowWindow(self.window) if not self.window: raise error() # From here on, the window exists. So we have to call self.destroy if # an exception occurs. try: if flags & SDL_WINDOW_OPENGL: self.gl_context = SDL_GL_CreateContext(self.window) if self.gl_context == NULL: raise error() SDL_GL_MakeCurrent(self.window, self.gl_context) if not ios: # Try setting the swap interval - first positive, then negated # to deal with the case where the negative interval isn't # supported. Then give up and carry on. if SDL_GL_SetSwapInterval(default_swap_control): if default_swap_control < 0: SDL_GL_SetSwapInterval(-default_swap_control) self.create_surface() except: self.destroy() raise def create_surface(self): """ Creates the surface associated with this window. """ cdef int w, h SDL_GetWindowSize(self.window, &w, &h) if self.gl_context: # For now, make this the size of the window so get_size() works. # TODO: Make this a bit less wasteful of memory, even if it means # we lie about the actual size of the pixel array. self.surface = Surface((w, h), SRCALPHA, 32) else: self.window_surface = SDL_GetWindowSurface(self.window) # If the surface is 32-bit, we can use it directly. Otherwise, # we need to create a 32-bit proxy surface. if self.window_surface.format.BitsPerPixel == 32: self.surface = Surface(()) self.surface.surface = self.window_surface self.surface.owns_surface = False self.surface.window_surface = True else: self.surface = Surface((w, h), 0, 32) self.surface.get_window_flags = self.get_window_flags def destroy(self): """ This should be called before the window is deleted. """ if self.gl_context != NULL: SDL_GL_DeleteContext(self.gl_context) if self.surface: # Break the cycle that prevents refcounting from collecting this # object. self.surface.get_window_flags = None # Necessary to collect the GL surface, doesn't hurt the window surface. self.surface = None SDL_DestroyWindow(self.window) def resize(self, size, opengl=False, fullscreen=None, maximized=None): """ Resizes the window to `size`, which must be a width, height tuple. If opengl is true, adds an OpenGL context, if it's missing. Otherwise, removes the opengl context if present. """ flags = SDL_GetWindowFlags(self.window) if fullscreen is None: fullscreen = flags & SDL_WINDOW_FULLSCREEN_DESKTOP if maximized is None: maximized = flags & SDL_WINDOW_MAXIMIZED if fullscreen: maximized = False # Prevents a loop between the surface and this object. self.surface.get_window_flags = None if self.gl_context and not opengl: SDL_GL_DeleteContext(self.gl_context) self.gl_context = NULL cdef int cur_width = 0 cdef int cur_height = 0 if (not fullscreen) and (not maximized) and (flags & SDL_WINDOW_MAXIMIZED): SDL_RestoreWindow(self.window) if fullscreen: if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): fullscreen = False if not fullscreen: SDL_SetWindowFullscreen(self.window, 0) if (not fullscreen) and (not maximized): width, height = size SDL_GetWindowSize(self.window, &cur_width, &cur_height) if (cur_width != width) or (cur_height != height): SDL_SetWindowSize(self.window, width, height) if maximized: SDL_MaximizeWindow(self.window) # Create a missing GL context. if opengl and not self.gl_context: self.gl_context = SDL_GL_CreateContext(self.window) if self.gl_context == NULL: raise error() self.create_surface() def recreate_gl_context(self, always=False): """ Check to see if the GL context was lost, and re-create it if it was. """ if not always: if SDL_GL_GetCurrentContext(): return False self.gl_context = SDL_GL_CreateContext(self.window) if self.gl_context == NULL: raise error() SDL_GL_MakeCurrent(self.window, self.gl_context) return True def get_window_flags(self): rv = SDL_GetWindowFlags(self.window) if self.gl_context: rv |= SDL_WINDOW_OPENGL else: rv &= ~SDL_WINDOW_OPENGL return rv def proxy_window_surface(self): SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) def flip(self): cdef const char *err if self.gl_context != NULL: with nogil: SDL_ClearError(); SDL_GL_SwapWindow(self.window) err = SDL_GetError() if err[0]: raise error(err) else: if self.surface.surface != self.window_surface: self.proxy_window_surface() with nogil: SDL_UpdateWindowSurface(self.window) def get_surface(self): return self.surface def update(self, rectangles=None): cdef SDL_Rect *rects cdef int count = 0 if rectangles is None: self.flip() return if self.surface.surface != self.window_surface: self.proxy_window_surface() if not isinstance(rectangles, list): rectangles = [ rectangles ] rects = calloc(len(rectangles), sizeof(SDL_Rect)) if rects == NULL: raise MemoryError("Couldn't allocate rectangles.") try: for i in rectangles: if i is None: continue to_sdl_rect(i, &rects[count]) count += 1 SDL_UpdateWindowSurfaceRects(self.window, rects, count) finally: free(rects) def get_wm_info(self): return { } def get_active(self): if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): return False else: return True def iconify(self): SDL_MinimizeWindow(self.window) return True def toggle_fullscreen(self): if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): if SDL_SetWindowFullscreen(self.window, 0): raise error() else: if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): raise error() return True def set_gamma(self, red, green=None, blue=None): if green is None: green = red if blue is None: blue = red cdef Uint16 red_gamma[256] cdef Uint16 green_gamma[256] cdef Uint16 blue_gamma[256] SDL_CalculateGammaRamp(red, red_gamma) SDL_CalculateGammaRamp(green, green_gamma) SDL_CalculateGammaRamp(blue, blue_gamma) if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): return False return True def set_gamma_ramp(self, red, green, blue): cdef Uint16 red_gamma[256] cdef Uint16 green_gamma[256] cdef Uint16 blue_gamma[256] for i in range(256): red_gamma[i] = red[i] green_gamma[i] = green[i] blue_gamma[i] = blue[i] if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): return False return True def set_icon(self, Surface surface): SDL_SetWindowIcon(self.window, surface.surface) def set_caption(self, title): if not isinstance(title, bytes): title = title.encode("utf-8") SDL_SetWindowTitle(self.window, title) def get_drawable_size(self): cdef int w, h SDL_GL_GetDrawableSize(self.window, &w, &h) return w, h def get_size(self): cdef int w, h SDL_GetWindowSize(self.window, &w, &h) return w, h def restore(self): SDL_RestoreWindow(self.window) def maximize(self): SDL_MaximizeWindow(self.window) def minimize(self): SDL_MinimizeWindow(self.window) def get_sdl_window_pointer(self): """ Returns the pointer to the SDL_Window corresponding to this window. """ import ctypes return ctypes.c_void_p( self.window) def get_position(self): cdef int x, y SDL_GetWindowPosition(self.window, &x, &y) return x, y def set_position(self, pos): SDL_SetWindowPosition(self.window, pos[0], pos[1]) # The icon that's used for new windows. default_icon = None # The title that's used for new windows. default_title = "pygame window" # The default gl_swap_control default_swap_control = 1 def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): global main_window RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP if main_window: if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP) return main_window.surface else: main_window.destroy() main_window = Window(default_title, resolution, flags, depth, pos=pos) if default_icon is not None: main_window.set_icon(default_icon) return main_window.surface def destroy(): global main_window if main_window is not None: main_window.destroy() main_window = None def get_surface(): if main_window is None: return None return main_window.get_surface() def get_window(): """ Returns the Window created by set_mode, or None if no such window exists. """ return main_window def flip(): if main_window: main_window.flip() def update(rectangles=None): if main_window: main_window.update(rectangles) def get_driver(): cdef const char *driver = SDL_GetCurrentVideoDriver() if driver == NULL: raise error() return driver class Info(object): def __init__(self): cdef SDL_DisplayMode dm cdef SDL_PixelFormat *format if SDL_GetCurrentDisplayMode(0, &dm): raise error() format = SDL_AllocFormat(dm.format) if format == NULL: raise error() self.bitsize = format.BitsPerPixel self.bytesize = format.BytesPerPixel self.masks = ( format.Rmask, format.Gmask, format.Bmask, format.Amask, ) self.shifts = ( format.Rshift, format.Gshift, format.Bshift, format.Ashift, ) self.losses = ( format.Rloss, format.Gloss, format.Bloss, format.Aloss, ) SDL_FreeFormat(format) if main_window: self.current_w, self.current_h = main_window.surface.get_size() else: self.current_w = dm.w self.current_h = dm.h self.refresh_rate = dm.refresh_rate # The rest of these are just guesses. self.hw = False self.wm = True self.video_mem = 256 * 1024 * 1024 self.blit_hw = False self.blit_hw_CC = False self.blit_hw_A = False self.blit_sw = False self.blit_sw_CC = False self.blit_sw_A = False def __repr__(self): return "".format(self.__dict__) def get_wm_info(): if main_window: return main_window.get_wm_info() return {} def get_num_video_displays(): """ Returns the number of video displays connected to the system. """ rv = SDL_GetNumVideoDisplays() if rv < 0: raise error() return rv def list_modes(depth=0, flags=0, display=0): """ Returns a list of possible display modes for the display `display`. `depth` and `flags` are ignored. """ cdef int num_modes, i cdef SDL_DisplayMode mode rv = [ ] num_modes = SDL_GetNumDisplayModes(display) if num_modes < 0: raise error() for 0 <= i < num_modes: if SDL_GetDisplayMode(display, i, &mode) == 0: t = (mode.w, mode.h) if t not in rv: rv.append(t) return rv def mode_ok(size, flags=0, depth=0): """ Returns true if size is in the result of list_modes(). """ return tuple(size) in list_modes() def gl_reset_attributes(): SDL_GL_ResetAttributes() def gl_set_attribute(flag, value): if flag == GL_SWAP_CONTROL: if ios: return global default_swap_control # Try setting the swap interval - first positive, then negated # to deal with the case where the negative interval isn't # supported. Then give up and carry on. if SDL_GL_SetSwapInterval(value): SDL_GL_SetSwapInterval(-value) default_swap_control = value return if SDL_GL_SetAttribute(flag, value): raise error() def gl_get_attribute(flag): cdef int rv if flag == GL_SWAP_CONTROL: return SDL_GL_GetSwapInterval() if SDL_GL_GetAttribute(flag, &rv): raise error() return rv def gl_load_library(path): if path is None: if SDL_GL_LoadLibrary(NULL): raise error() else: if SDL_GL_LoadLibrary(path): raise error() def gl_unload_library(): SDL_GL_UnloadLibrary() def get_active(): if main_window: return main_window.get_active() return False def iconify(): if main_window: return main_window.iconify() return False def toggle_fullscreen(): if main_window: return main_window.toggle_fullscreen() return True def set_gamma(red, green=None, blue=None): if main_window: return main_window.set_gamma(red, green, blue) return False def set_gamma_ramp(red, green, blue): if main_window: return main_window.set_gamma_ramp(red, green, blue) return False def set_icon(surface): global default_icon default_icon = surface.copy() if main_window is not None: main_window.set_icon(default_icon) def set_caption(title, icontitle = None): global default_title default_title = title if main_window: main_window.set_caption(default_title) def get_caption(): return default_title def get_drawable_size(): if main_window: return main_window.get_drawable_size() return None def get_size(): if main_window: return main_window.get_size() return None def get_position(): if main_window: return main_window.get_position() return None def set_position(pos): if main_window: return main_window.set_position(pos) return False def get_num_video_displays(): rv = SDL_GetNumVideoDisplays() if rv < 0: raise error() return rv def get_display_bounds(index): cdef SDL_Rect rect rv = SDL_GetDisplayBounds(index, &rect) return (rect.x, rect.y, rect.w, rect.h) def set_screensaver(state): """ Sets the screenslaver to `state`. """ if state: SDL_EnableScreenSaver() else: SDL_DisableScreenSaver() def get_platform(): return SDL_GetPlatform().decode("utf-8") cdef api SDL_Window *PyWindow_AsWindow(window): """ Returns a pointer to the SDL_Window corresponding to `window`. If `window` is None, a pointer to the main window is returned. NULL is returned if there is no main window. """ if window is None: window = main_window if window is None: return NULL return ( window).window ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724476523.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/draw.pyx0000664000175000017500000001161514662266153020377 0ustar00tomtom# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from pygame_sdl2.surface cimport Surface import pygame_sdl2.gfxdraw as gfxdraw from pygame_sdl2.rect import Rect from pygame_sdl2.error import error def rect(Surface surface, color, rect, width=0): if not isinstance(rect, Rect): rect = Rect(rect) if width == 0: gfxdraw.box(surface, rect, color) else: gfxdraw.rectangle(surface, rect, color) n = 1 while n < width: r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) gfxdraw.rectangle(surface, r, color) r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) gfxdraw.rectangle(surface, r, color) n += 1 dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) return dirty.clip(surface.get_rect()) def polygon(Surface surface, color, pointlist, width=0): if width == 0: gfxdraw.filled_polygon(surface, pointlist, color) dirty = Rect(pointlist[0], (1, 1)) n = 1 while n < len(pointlist): dirty.union_ip(Rect(pointlist[n], (1,1))) n += 1 return dirty.clip(surface.get_rect()) else: return lines(surface, color, True, pointlist, width) def circle(Surface surface, color, pos, radius, width=0): x, y = pos if width == 0: gfxdraw.filled_circle(surface, x, y, radius, color) dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) return dirty.clip(surface.get_rect()) else: gfxdraw.circle(surface, x, y, radius, color) n = 1 while n < width: gfxdraw.circle(surface, x, y, radius - n, color) gfxdraw.circle(surface, x + 1, y, radius - n, color) gfxdraw.circle(surface, x - 1, y, radius - n, color) n += 1 dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) return dirty.clip(surface.get_rect()) def ellipse(Surface surface, color, rect, width=0): x, y, rx, ry = rect if width == 0: gfxdraw.filled_ellipse(surface, x, y, rx, ry, color) dirty = Rect((x - rx, y - ry), (rx*2, ry*2)) else: gfxdraw.ellipse(surface, x, y, rx, ry, color) n = 1 while n < width: gfxdraw.ellipse(surface, x, y, rx - n, ry - n, color) gfxdraw.ellipse(surface, x + 1, y, rx - n, ry - n, color) gfxdraw.ellipse(surface, x - 1, y, rx - n, ry - n, color) n += 1 dirty = Rect(x - rx - width, y - ry - width, (rx*2) + width, (ry*2) + width) return dirty.clip(surface.get_rect()) def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): raise error("Not implemented.") def line(Surface surface, color, start_pos, end_pos, width=1): gfxdraw.thick_line(surface, start_pos[0], start_pos[1], end_pos[0], end_pos[1], width, color) dirty = Rect(start_pos, (width, width)) dirty.union_ip(Rect(end_pos, (width, width))) return dirty.clip(surface.get_rect()) def lines(Surface surface, color, closed, pointlist, width=1): n = 0 dirty = Rect(pointlist[0], (width, width)) while n < len(pointlist) - 1: line(surface, color, pointlist[n], pointlist[n+1], width) dirty.union_ip(Rect(pointlist[n+1], (width, width))) n += 1 if closed: line(surface, color, pointlist[n], pointlist[0], width) return dirty.clip(surface.get_rect()) def aaline(Surface surface, color, startpos, endpos, blend=1): x1, y1 = startpos x2, y2 = endpos gfxdraw.aaline(surface, x1, y1, x2, y2, color) dirty = Rect(x1, y1, x2 - x1, y2 - y1) return dirty.clip(surface.get_rect()) def aalines(Surface surface, color, closed, pointlist, blend=1): n = 0 dirty = Rect(pointlist[0], (1,1)) while n < len(pointlist) - 1: r = aaline(surface, color, pointlist[n], pointlist[n+1]) dirty.union_ip(r) n += 1 if closed: aaline(surface, color, pointlist[n], pointlist[0]) return dirty.clip(surface.get_rect()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1639882689.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/error.pyx0000664000175000017500000000265714157517701020576 0ustar00tomtom# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * class error(RuntimeError): def __init__(self, message=None): if message is None: message = bytes(SDL_GetError()) message = message.decode("utf-8") RuntimeError.__init__(self, message) def get_error(): cdef const char *message = SDL_GetError() if message: return message.decode("utf-8") else: return '' def set_error(message): if isinstance(message, unicode): message = message.encode("utf-8") SDL_SetError("%s", message) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752384544.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/event.pyx0000664000175000017500000003767315034642040020562 0ustar00tomtom# Copyright 2014 Patrick Dawson # Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from cpython.ref cimport Py_INCREF, Py_DECREF from sdl2 cimport * from pygame_sdl2.display cimport Window, main_window import threading import pygame_sdl2 import sys if sys.version_info[0] >= 3: unichr = chr include "event_names.pxi" # Add events to emulate SDL 1.2. These also need to be added in locals. ACTIVEEVENT = SDL_LASTEVENT - 1 VIDEORESIZE = SDL_LASTEVENT - 2 VIDEOEXPOSE = SDL_LASTEVENT - 3 WINDOWMOVED = SDL_LASTEVENT - 4 # (Do not add events here.) event_names[ACTIVEEVENT] = "ACTIVEEVENT" event_names[VIDEORESIZE] = "VIDEORESIZE" event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" event_names[WINDOWMOVED] = "WINDOWMOVED" # This is used for events posted to the event queue. This won't be returned # to the user - it's just used internally, with the event object itself # giving the type. cdef unsigned int POSTEDEVENT POSTEDEVENT = SDL_LASTEVENT - 5 # The maximum number of a user-defined event. USEREVENT_MAX = SDL_LASTEVENT - 6 # If true, the mousewheel is mapped to buttons 4 and 5. Otherwise, a # MOUSEWHEEL event is created. cdef bint mousewheel_buttons = 1 cdef unsigned int SDL_TOUCH_MOUSEID SDL_TOUCH_MOUSEID = -1 class EventType(object): def __init__(self, type, dict=None, **kwargs): self._type = type if dict: self.__dict__.update(dict) self.__dict__.update(kwargs) def __repr__(self): if SDL_USEREVENT <= self.type < WINDOWMOVED: ename = "UserEvent%d" % (self.type - SDL_USEREVENT) else: try: ename = event_names[self.type] except KeyError: ename = "UNKNOWN" rest = [ ] for k, v in sorted(self.__dict__.items()): if k == "_type" or k == "timestamp": continue rest.append("%s=%r" % (k, v)) return '' % (self.type, ename, ", ".join(rest)) @property def dict(self): return self.__dict__ @property def type(self): return self._type def __eq__(self, other): return self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) def __nonzero__(self): return self.type != 0 Event = EventType cdef get_textinput(): cdef SDL_Event evt SDL_PumpEvents() if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: return evt.text.text.decode('utf-8') return u'' cdef make_keyboard_event(SDL_KeyboardEvent *e): dargs = { 'scancode' : e.keysym.scancode, 'key' : e.keysym.sym, 'mod' : e.keysym.mod, 'unicode' : '', 'repeat' : e.repeat, } if not pygame_sdl2.key.text_input: if e.type == SDL_KEYDOWN: # Be careful to only check for a TEXTINPUT event when you know that # there will be one associated with this KEYDOWN event. if e.keysym.sym < 0x20: dargs['unicode'] = unichr(e.keysym.sym) elif e.keysym.sym <= 0xFFFF: dargs['unicode'] = get_textinput() else: if e.type == SDL_KEYDOWN and not(e.keysym.mod & KMOD_NUM): if SDLK_KP_1 <= e.keysym.sym <= SDLK_KP_0: get_textinput() dargs['unicode'] = '' return EventType(e.type, dict=dargs, repeat=e.repeat) cdef make_mousemotion_event(SDL_MouseMotionEvent *e): buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, 1 if e.state & SDL_BUTTON_MMASK else 0, 1 if e.state & SDL_BUTTON_RMASK else 0) return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons, touch=(SDL_TOUCH_MOUSEID == e.which)) cdef make_mousebtn_event(SDL_MouseButtonEvent *e): btn = e.button # SDL 1.x maps wheel to buttons 4/5 if mousewheel_buttons and btn >= 4: btn += 2 return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which, touch=(SDL_TOUCH_MOUSEID == e.which)) cdef make_mousewheel_event(SDL_MouseWheelEvent *e): cdef int x, y # SDL2-style, if the user has opted-in. if not mousewheel_buttons: return EventType(e.type, which=e.which, x=e.x, y=e.y, touch=(SDL_TOUCH_MOUSEID == e.which)) # Otherwise, follow the SDL1 approach. y = e.y # TODO: Implement when 2.0.4 becomes widespread. # if e.direction == SDL_MOUSEWHEEL_FLIPPED: # y = -y if y > 0: btn = 4 elif y < 0: btn = 5 else: return EventType(0) # x axis scrolling produces no event in pygame # This is not the mouse position at the time of the event SDL_GetMouseState(&x, &y) # MOUSEBUTTONUP event should follow immediately after event_queue.insert(0, EventType(SDL_MOUSEBUTTONUP, which=e.which, button=btn, pos=(x,y), touch=(SDL_TOUCH_MOUSEID == e.which))) return EventType(SDL_MOUSEBUTTONDOWN, which=e.which, button=btn, pos=(x,y), touch=(SDL_TOUCH_MOUSEID == e.which)) cdef make_joyaxis_event(SDL_JoyAxisEvent *e): return EventType(e.type, joy=e.which, instance_id=e.which, axis=e.axis, value=e.value/32768.0) cdef make_joyball_event(SDL_JoyBallEvent *e): return EventType(e.type, joy=e.which, instance_id=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) cdef make_joyhat_event(SDL_JoyHatEvent *e): return EventType(e.type, joy=e.which, instance_id=e.which, hat=e.hat, value=e.value) cdef make_joybtn_event(SDL_JoyButtonEvent *e): return EventType(e.type, joy=e.which, instance_id=e.which, button=e.button) cdef make_textinput_event(SDL_TextInputEvent *e): try: return EventType(e.type, text=e.text.decode("utf-8")) except UnicodeDecodeError: return EventType(e.type, text='') cdef make_textediting_event(SDL_TextEditingEvent *e): try: return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) except UnicodeDecodeError: return EventType(e.type, text='', start=e.start, length=e.length) cdef make_drop_event(SDL_DropEvent *e): if e.file: file = e.file.decode("utf-8") SDL_free(e.file) else: file = None return EventType(e.type, file=file, window_id=e.windowID) cdef make_window_event(SDL_WindowEvent *e): # SDL_APPMOUSEFOCUS if e.event == SDL_WINDOWEVENT_ENTER: return EventType(ACTIVEEVENT, state=1, gain=1) elif e.event == SDL_WINDOWEVENT_LEAVE: return EventType(ACTIVEEVENT, state=1, gain=0) # SDL_APPINPUTFOCUS elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: return EventType(ACTIVEEVENT, state=2, gain=1) elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: return EventType(ACTIVEEVENT, state=2, gain=0) # SDL_APPACTIVE elif e.event == SDL_WINDOWEVENT_RESTORED: return EventType(ACTIVEEVENT, state=4, gain=1) elif e.event == SDL_WINDOWEVENT_MINIMIZED: return EventType(ACTIVEEVENT, state=4, gain=0) elif e.event == SDL_WINDOWEVENT_RESIZED: return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) elif e.event == SDL_WINDOWEVENT_EXPOSED: return EventType(VIDEOEXPOSE) elif e.event == SDL_WINDOWEVENT_MOVED: return EventType(WINDOWMOVED, pos=(e.data1, e.data2), x=e.data1, y=e.data2) return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) cdef make_event(SDL_Event *e): cdef object o if e.type == SDL_MOUSEMOTION: return make_mousemotion_event(e) elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): return make_mousebtn_event(e) elif e.type == SDL_MOUSEWHEEL: return make_mousewheel_event(e) elif e.type in (SDL_KEYDOWN, SDL_KEYUP): return make_keyboard_event(e) elif e.type == SDL_JOYAXISMOTION: return make_joyaxis_event(e) elif e.type == SDL_JOYBALLMOTION: return make_joyball_event(e) elif e.type == SDL_JOYHATMOTION: return make_joyhat_event(e) elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): return make_joybtn_event(e) elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): return EventType(e.type, which=e.jdevice.which) elif e.type == SDL_WINDOWEVENT: return make_window_event(e) elif e.type == SDL_TEXTINPUT: return make_textinput_event( e) elif e.type == SDL_TEXTEDITING: return make_textediting_event( e) elif e.type == SDL_CONTROLLERAXISMOTION: return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): return EventType(e.type, which=e.cdevice.which) elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, touch_id=e.tfinger.touchId, finger_id=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) elif e.type == SDL_MULTIGESTURE: return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers, touch_id=e.mgesture.touchId, rotated=e.mgesture.dTheta, pinched=e.mgesture.dDist, num_fingers=e.mgesture.numFingers) elif e.type in (SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE): return make_drop_event( e) elif e.type == POSTEDEVENT: o = e.user.data1 Py_DECREF(o) return o elif e.type >= SDL_USEREVENT: # Can't do anything useful with data1 and data2 here. return EventType(e.type, code=e.user.code) return EventType(e.type) # The event queue - a list of pending events from oldest to newest. cdef public event_queue = list() # The lock that protects the event queue. lock = threading.RLock() # This is the object that is returned when no event exists. NOEVENT_EVENT = EventType(0) cdef bint has_event(kinds): """ Returns true if at least one event in the queue has a type in `kinds`, which must support the in operator. The lock must be held when calling this function """ for i in event_queue: if i._type in kinds: return True cdef object get_events(kinds): """ Returns a list containing all events in the event queue with type `kinds`. Removes those events from the event queue. The lock must be held when calling this function. """ if isinstance(kinds, int): kinds = [ kinds ] global event_queue cdef list rv = [ ] cdef list new_queue = [ ] for i in event_queue: if i._type in kinds: rv.append(i) else: new_queue.append(i) event_queue = new_queue return rv cdef int poll_sdl() except 1: """ Polls SDL for pending events, and places those events onto the event q queue. """ cdef SDL_Event evt with lock: while SDL_PollEvent(&evt): e = make_event(&evt) e.timestamp = evt.common.timestamp event_queue.append(e) return 0 def pump(): with lock: poll_sdl() def get(t=None): global event_queue with lock: poll_sdl() if t is None: rv = event_queue event_queue = [ ] elif isinstance(t, int): rv = get_events(( t, )) else: rv = get_events(t) return rv def poll(): with lock: poll_sdl() if event_queue: return event_queue.pop(0) return NOEVENT_EVENT def wait(): cdef SDL_Event evt cdef int result with lock: poll_sdl() if event_queue: return event_queue.pop(0) with nogil: result = SDL_WaitEvent(&evt) if result: return make_event(&evt) else: return NOEVENT_EVENT def peek(t=None): with lock: poll_sdl() if t is None: return len(event_queue) != 0 elif isinstance(t, int): return has_event(( t, )) else: return has_event(t) def clear(t=None): # Clear is implemented in terms of get. get(t) def get_standard_events(): """ Returns a list of standard events that pygame_sdl2 knows about. """ return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] def event_name(t): try: return event_names[t] except KeyError: return "UNKNOWN" def set_blocked(t=None): if t == None: for et in event_names.keys(): SDL_EventState(et, SDL_ENABLE) elif isinstance(t, int): SDL_EventState(t, SDL_IGNORE) else: for et in t: SDL_EventState(et, SDL_IGNORE) def set_allowed(t=None): if t == None: for et in event_names.keys(): SDL_EventState(et, SDL_IGNORE) elif isinstance(t, int): SDL_EventState(t, SDL_ENABLE) else: for et in t: SDL_EventState(et, SDL_ENABLE) def get_blocked(t): return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE def set_grab(on): SDL_SetWindowGrab(main_window.window, on) if SDL_ShowCursor(SDL_QUERY) == SDL_DISABLE: SDL_SetRelativeMouseMode(on) def get_grab(): return SDL_GetWindowGrab(main_window.window) def set_mousewheel_buttons(flag): """ If true (the default), the mousewheel will generate events involving mouse buttons 4 and 5, and mousebuttons 4 and higher will be mapped to 6 and higher. If false, MOUSEWHEEL events are generated, and the mousebuttons are not remapped. """ global mousewheel_buttons mousewheel_buttons = flag def get_mousewheel_buttons(): """ Returns the value set by mousehweel buttons,. """ return mousewheel_buttons def post(e): """ Posts event object `e` to the event queue. """ cdef SDL_Event event; if not isinstance(e, EventType): raise pygame_sdl2.error("event.post must be called with an Event.") if get_blocked(e.type): return Py_INCREF(e) event.type = POSTEDEVENT event.user.data1 = e SDL_PushEvent(&event) def register(name): """ Registers a unique event number and returns that number. `name` A string name for the event. This is used when calling `repr` on the event. """ rv = SDL_RegisterEvents(1) event_names[rv] = name return rv def copy_event_queue(): """ Returns a copy of the event queue. The copy cannot be used for modifying the event queue. """ return event_queue[:] # Usually called by display.init. def init(): if not SDL_WasInit(SDL_INIT_EVENTS): pygame_sdl2.display.sdl_main_init() if SDL_InitSubSystem(SDL_INIT_EVENTS): raise pygame_sdl2.error.error() _types = """ Event = EventType """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1453653586.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/font.pyx0000664000175000017500000001030412651177122020373 0ustar00tomtom# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_ttf cimport * from pygame_sdl2.surface cimport * from pygame_sdl2.color cimport * from pygame_sdl2.rwobject cimport to_rwops from pygame_sdl2.sysfont import SysFont, match_font, get_fonts from pygame_sdl2.error import error import pygame_sdl2 @pygame_sdl2.register_init def init(): TTF_Init() @pygame_sdl2.register_quit def quit(): # @ReservedAssignment TTF_Quit() def get_init(): return TTF_WasInit() != 0 def get_default_font(): import os default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") if os.path.exists(default): return default return match_font("sans") cdef class Font: cdef TTF_Font *font cdef int style def __cinit__(self): self.font = NULL self.style = TTF_STYLE_NORMAL def __dealloc__(self): if self.font: TTF_CloseFont(self.font) def __init__(self, fi, size): if fi is None: fi = get_default_font() self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) if self.font == NULL: raise error() def render(self, text, antialias, color, background=None): cdef SDL_Surface *surf cdef SDL_Color fg if not text: w, h = self.size(" ") return Surface((0, h)) to_sdl_color(color, &fg) TTF_SetFontStyle(self.font, self.style) if antialias: surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) else: surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) if surf == NULL: raise error() cdef Surface rv = Surface(()) rv.take_surface(surf) if rv.surface.format.BitsPerPixel != 32: rv = rv.convert() if background is not None: bgsurf = rv.copy() bgsurf.fill(background) bgsurf.blit(rv, (0,0)) return bgsurf return rv def size(self, text): cdef int w, h if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: raise error() return w, h cdef set_style(self, flag, on): if on: self.style |= flag else: self.style &= ~flag def set_underline(self, on): self.set_style(TTF_STYLE_UNDERLINE, on) def get_underline(self): return self.style & TTF_STYLE_UNDERLINE def set_bold(self, on): self.set_style(TTF_STYLE_BOLD, on) def get_bold(self): return self.style & TTF_STYLE_BOLD def set_italic(self, on): self.set_style(TTF_STYLE_ITALIC, on) def get_italic(self): return self.style & TTF_STYLE_ITALIC def get_linesize(self): return TTF_FontLineSkip(self.font) def get_height(self): return TTF_FontHeight(self.font) def get_ascent(self): return TTF_FontAscent(self.font) def get_descent(self): return TTF_FontDescent(self.font) def metrics(self, text not None): cdef int minx, maxx, miny, maxy, advance cdef uint16_t chnum rv = [] for ch in text: chnum = ord(ch) if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: rv.append((minx, maxx, miny, maxy, advance)) else: rv.append(None) return rv ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1487825819.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/gfxdraw.pyx0000664000175000017500000001650613053465633021105 0ustar00tomtom# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_gfx cimport * from libc.stdlib cimport malloc, free from pygame_sdl2.surface cimport Surface from pygame_sdl2.color cimport Color from pygame_sdl2.error import error from pygame_sdl2.rect import Rect def pixel(Surface surface, x, y, color): cdef Color c = Color(color) pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) def hline(Surface surface, x1, x2, y, color): cdef Color c = Color(color) hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) def vline(Surface surface, x, y1, y2, color): cdef Color c = Color(color) vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) def rectangle(Surface surface, rect, color): cdef Color c = Color(color) if not isinstance(rect, Rect): rect = Rect(rect) rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) def rounded_rectangle(Surface surface, rect, rad, color): cdef Color c = Color(color) if not isinstance(rect, Rect): rect = Rect(rect) roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) def box(Surface surface, rect, color): cdef Color c = Color(color) if not isinstance(rect, Rect): rect = Rect(rect) boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) def rounded_box(Surface surface, rect, rad, color): cdef Color c = Color(color) if not isinstance(rect, Rect): rect = Rect(rect) roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) def line(Surface surface, x1, y1, x2, y2, color): cdef Color c = Color(color) lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) def aaline(Surface surface, x1, y1, x2, y2, color): cdef Color c = Color(color) aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) def thick_line(Surface surface, x1, y1, x2, y2, width, color): cdef Color c = Color(color) # This locks up in c code when trying to draw a zero-length line. So make # sure that doesn't happen. cdef int x1int, y1int, x2int, y2int x1int = x1 y1int = y1 x2int = x2 y2int = y2 if x1int == x2int and y1int == y2int: return thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) def circle(Surface surface, x, y, r, color): cdef Color c = Color(color) circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) def arc(Surface surface, x, y, r, start, end, color): cdef Color c = Color(color) arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) def aacircle(Surface surface, x, y, r, color): cdef Color c = Color(color) aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) def filled_circle(Surface surface, x, y, r, color): cdef Color c = Color(color) filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) def ellipse(Surface surface, x, y, rx, ry, color): cdef Color c = Color(color) ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) def aaellipse(Surface surface, x, y, rx, ry, color): cdef Color c = Color(color) aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) def filled_ellipse(Surface surface, x, y, rx, ry, color): cdef Color c = Color(color) filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) def pie(Surface surface, x, y, r, start, end, color): cdef Color c = Color(color) pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) def filled_pie(Surface surface, x, y, r, start, end, color): cdef Color c = Color(color) filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): cdef Color c = Color(color) trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): cdef Color c = Color(color) aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): cdef Color c = Color(color) filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) def polygon(Surface surface, points, color): cdef Color c = Color(color) cdef Sint16 *vx cdef Sint16 *vy cdef size_t num_points = len(points) vx = malloc(num_points * sizeof(Sint16)) vy = malloc(num_points * sizeof(Sint16)) for n, pt in zip(range(num_points), points): vx[n], vy[n] = points[n] polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) free(vx) free(vy) def aapolygon(Surface surface, points, color): cdef Color c = Color(color) cdef Sint16 *vx cdef Sint16 *vy cdef size_t num_points = len(points) vx = malloc(num_points * sizeof(Sint16)) vy = malloc(num_points * sizeof(Sint16)) for n, pt in zip(range(num_points), points): vx[n], vy[n] = points[n] aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) free(vx) free(vy) def filled_polygon(Surface surface, points, color): cdef Color c = Color(color) cdef Sint16 *vx cdef Sint16 *vy cdef size_t num_points = len(points) vx = malloc(num_points * sizeof(Sint16)) vy = malloc(num_points * sizeof(Sint16)) for n, pt in zip(range(num_points), points): vx[n], vy[n] = points[n] filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) free(vx) free(vy) def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): cdef Sint16 *vx cdef Sint16 *vy cdef size_t num_points = len(points) vx = malloc(num_points * sizeof(Sint16)) vy = malloc(num_points * sizeof(Sint16)) for n, pt in zip(range(num_points), points): vx[n], vy[n] = points[n] texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) free(vx) free(vy) def bezier(Surface surface, points, steps, color): cdef Color c = Color(color) cdef Sint16 *vx cdef Sint16 *vy cdef size_t num_points = len(points) vx = malloc(num_points * sizeof(Sint16)) vy = malloc(num_points * sizeof(Sint16)) for n, pt in zip(range(num_points), points): vx[n], vy[n] = points[n] bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) free(vx) free(vy) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1680145045.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/image.pyx0000664000175000017500000001174514411175225020517 0ustar00tomtom# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_image cimport * from pygame_sdl2.surface cimport * from pygame_sdl2.rwobject cimport to_rwops from pygame_sdl2.error import error from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode import sys import os import pygame_sdl2 cdef int image_formats = 0 def init(): # Attempt to initialize everything. Only fail loudly if all formats fail global image_formats image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP | IMG_INIT_JXL | IMG_INIT_AVIF) if image_formats == 0: raise error() init() # Make it possible for python to check individual formats INIT_JPG = IMG_INIT_JPG INIT_PNG = IMG_INIT_PNG INIT_TIF = IMG_INIT_TIF INIT_WEBP = IMG_INIT_WEBP INIT_JXL = IMG_INIT_JXL INIT_AVIF = IMG_INIT_AVIF def has_init(int flags): return (flags & image_formats) == flags def quit(): # @ReservedAssignment IMG_Quit() cdef process_namehint(namehint): # Accepts "foo.png", ".png", or "png" if not isinstance(namehint, bytes_): namehint = namehint.encode("ascii", "replace") if not namehint: return b'' ext = os.path.splitext(namehint)[1] if not ext: ext = namehint if ext[0] == b'.': ext = ext[1:] return ext.upper() def load(fi, namehint="", size=None): """ `size` A width, height tuple that specifies the size the image is loaded at. This is only supported for SVG images. """ cdef SDL_Surface *img cdef SDL_RWops *rwops cdef char *ftype cdef int width cdef int height # IMG_Load_RW can't load TGA images. if isinstance(fi, str): if fi.lower().endswith('.tga'): namehint = "TGA" rwops = to_rwops(fi) if namehint == "": with nogil: img = IMG_Load_RW(rwops, 1) else: namehint = process_namehint(namehint) ftype = namehint if namehint == b".SVG" and size is not None: width, height = size with nogil: img = IMG_LoadSizedSVG_RW(rwops, width, height) SDL_RWclose(rwops) else: with nogil: img = IMG_LoadTyped_RW(rwops, 1, ftype) if img == NULL: raise error() cdef Surface surf = Surface(()) surf.take_surface(img) if img.format.BitsPerPixel == 32: return surf cdef int n = 0 has_alpha = False if img.format.Amask: has_alpha = True elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: has_alpha = True elif img.format.palette != NULL: # Check for non-opaque palette colors. while n < img.format.palette.ncolors: if img.format.palette.colors[n].a != 255: has_alpha = True break n += 1 try: if has_alpha: return surf.convert_alpha() else: return surf.convert() except error: return surf cdef extern from "write_jpeg.h": int Pygame_SDL2_SaveJPEG(SDL_Surface *, char *, int) nogil cdef extern from "write_png.h": int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil def save(Surface surface not None, filename, compression=-1): if not isinstance(filename, unicode_): filename = filename.decode(sys.getfilesystemencoding()) ext = os.path.splitext(filename)[1] ext = ext.upper() ext = ext.encode("utf-8") err = 0 utf8_filename = filename.encode("utf-8") cdef char *fn = utf8_filename cdef SDL_RWops *rwops cdef int compression_level = compression if ext == b'.PNG': with nogil: err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) elif ext == b'.BMP': rwops = to_rwops(filename, "wb") with nogil: err = SDL_SaveBMP_RW(surface.surface, rwops, 1) elif ext == b".JPG" or ext == b".JPEG": with nogil: err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) else: raise ValueError("Unsupported format: %s" % ext) if err != 0: raise error() def get_extended(): # This may be called before init. return True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1639882047.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/joystick.pyx0000664000175000017500000001022614157516477021304 0ustar00tomtom# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from pygame_sdl2.error import error import pygame_sdl2 @pygame_sdl2.register_init def init(): pygame_sdl2.display.sdl_main_init() if SDL_InitSubSystem(SDL_INIT_JOYSTICK): raise error() @pygame_sdl2.register_quit def quit(): # @ReservedAssignment SDL_QuitSubSystem(SDL_INIT_JOYSTICK) def get_init(): return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 def get_count(): return SDL_NumJoysticks() cdef class Joystick: # Allow weak references. cdef object __weakref__ cdef SDL_Joystick *joystick cdef int joyid def __cinit__(self): self.joystick = NULL def __init__(self, id): self.joyid = id def init(self): if self.joystick == NULL: self.joystick = SDL_JoystickOpen(self.joyid) if self.joystick == NULL: raise error() def quit(self): # @ReservedAssignment if self.joystick != NULL: SDL_JoystickClose(self.joystick) self.joystick = NULL def get_init(self): if self.joystick: return True else: return False def get_id(self): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickInstanceID(self.joystick) def get_name(self): cdef char *rv if self.joystick == NULL: raise error("joystick not initialized") rv = SDL_JoystickName(self.joystick) if rv: return rv.decode("utf-8") else: return None def get_numaxes(self): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickNumAxes(self.joystick) def get_numballs(self): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickNumBalls(self.joystick) def get_numbuttons(self): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickNumButtons(self.joystick) def get_numhats(self): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickNumHats(self.joystick) def get_axis(self, axis_number): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 def get_ball(self, ball_number): cdef int dx, dy if self.joystick == NULL: raise error("joystick not initialized") if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: return (dx, dy) else: raise error() def get_button(self, button): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickGetButton(self.joystick, button) == 1 def get_hat(self, hat_number): if self.joystick == NULL: raise error("joystick not initialized") state = SDL_JoystickGetHat(self.joystick, hat_number) hx = hy = 0 if state & SDL_HAT_LEFT: hx = -1 elif state & SDL_HAT_RIGHT: hx = 1 if state & SDL_HAT_UP: hy = 1 elif state & SDL_HAT_DOWN: hy = -1 return (hx, hy) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1687919490.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/key.pyx0000664000175000017500000000627114446715602020232 0ustar00tomtom# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from libc.stdlib cimport malloc, free from libc.string cimport memcpy from pygame_sdl2.display cimport Window, main_window from pygame_sdl2.rect cimport to_sdl_rect from pygame_sdl2.error import error cdef class KeyboardState: # Allow weak references. cdef object __weakref__ cdef uint8_t *data cdef int numkeys def __cinit__(self): self.data = NULL def __dealloc__(self): if self.data != NULL: free(self.data) def __init__(self): cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) if state == NULL: raise error() # Take a snapshot of the current state, rather than saving the pointer. self.data = malloc(self.numkeys) memcpy(self.data, state, self.numkeys) def __getitem__(self, int key): if SDLK_DELETE < key < SDLK_CAPSLOCK: raise IndexError("Out of range.") cdef int sc = SDL_GetScancodeFromKey(key) if sc > self.numkeys: raise IndexError("Out of range.") return self.data[sc] def get_focused(): return SDL_GetKeyboardFocus() != NULL def get_pressed(): """ No longer returns a tuple. Use the returned object to check for individual keys, but don't loop through it. """ return KeyboardState() def get_mods(): return SDL_GetModState() def set_mods(state): SDL_SetModState(state) def set_repeat(delay=0, interval=0): # Not possible with SDL2. pass def get_repeat(): # Not possible with SDL2. return (0,0) def name(key): return SDL_GetKeyName(key) text_input = False def start_text_input(): global text_input text_input = True if SDL_HasScreenKeyboardSupport(): SDL_StartTextInput() def stop_text_input(): global text_input text_input = False if SDL_HasScreenKeyboardSupport(): SDL_StopTextInput() def set_text_input_rect(rect): cdef SDL_Rect sdl_rect; if rect is not None: to_sdl_rect(rect, &sdl_rect) SDL_SetTextInputRect(&sdl_rect) else: SDL_SetTextInputRect(NULL) def has_screen_keyboard_support(): return SDL_HasScreenKeyboardSupport() def is_screen_keyboard_shown(Window window=None): if window is None: window = main_window return SDL_IsScreenKeyboardShown(window.window) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1722822722.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/locals.pyx0000664000175000017500000000672114654030102020701 0ustar00tomtomfrom sdl2 cimport * cimport sdl2 from pygame_sdl2.rect import Rect from pygame_sdl2.color import Color include "event_list.pxi" ACTIVEEVENT = SDL_LASTEVENT - 1 VIDEORESIZE = SDL_LASTEVENT - 2 VIDEOEXPOSE = SDL_LASTEVENT - 3 WINDOWMOVED = SDL_LASTEVENT - 4 include "keycode_list.pxi" include "glattr.pxi" GL_SWAP_CONTROL = -1 GL_CONTEXT_PROFILE_CORE = SDL_GL_CONTEXT_PROFILE_CORE GL_CONTEXT_PROFILE_COMPATIBILITY = SDL_GL_CONTEXT_PROFILE_COMPATIBILITY GL_CONTEXT_PROFILE_ES = SDL_GL_CONTEXT_PROFILE_ES RLEACCEL = SDL_RLEACCEL SRCCOLORKEY = 0 # Surface flags. SRCALPHA = 0x80000000 HWSURFACE = 0x40000000 SWSURFACE = 0 # Window flags. FULLSCREEN = SDL_WINDOW_FULLSCREEN OPENGL = SDL_WINDOW_OPENGL NOFRAME = SDL_WINDOW_BORDERLESS RESIZABLE = SDL_WINDOW_RESIZABLE DOUBLEBUF = 0 WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN WINDOW_SHOWN = SDL_WINDOW_SHOWN WINDOW_HIDDEN = SDL_WINDOW_HIDDEN WINDOW_OPENGL = SDL_WINDOW_OPENGL WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP WINDOW_FOREIGN = SDL_WINDOW_FOREIGN WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED # Blend modes BLEND_RGB_ADD = BLEND_ADD = 0x1 BLEND_RGB_SUB = BLEND_SUB = 0x2 BLEND_RGB_MULT = BLEND_MULT = 0x3 BLEND_RGB_MIN = BLEND_MIN = 0x4 BLEND_RGB_MAX = BLEND_MAX = 0x5 BLEND_RGBA_ADD = 0x6 BLEND_RGBA_SUB = 0x7 BLEND_RGBA_MULT = 0x8 BLEND_RGBA_MIN = 0x9 BLEND_RGBA_MAX = 0x10 BLEND_PREMULTIPLIED = 0x11 # Scrap types. SCRAP_TEXT = "text/plain" BYTEORDER = SDL_BYTEORDER LIL_ENDIAN = SDL_LIL_ENDIAN BIG_ENDIAN = SDL_BIG_ENDIAN SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) globals().update(dict( KMOD_NONE = sdl2.KMOD_NONE, KMOD_LSHIFT = sdl2.KMOD_LSHIFT, KMOD_RSHIFT = sdl2.KMOD_RSHIFT, KMOD_SHIFT = sdl2.KMOD_SHIFT, KMOD_LCTRL = sdl2.KMOD_LCTRL, KMOD_RCTRL = sdl2.KMOD_RCTRL, KMOD_CTRL = sdl2.KMOD_CTRL, KMOD_LALT = sdl2.KMOD_LALT, KMOD_RALT = sdl2.KMOD_RALT, KMOD_ALT = sdl2.KMOD_ALT, KMOD_LGUI = sdl2.KMOD_LGUI, KMOD_RGUI = sdl2.KMOD_RGUI, KMOD_GUI = sdl2.KMOD_GUI, KMOD_LMETA = sdl2.KMOD_LGUI, KMOD_RMETA = sdl2.KMOD_RGUI, KMOD_META = sdl2.KMOD_GUI, KMOD_NUM = sdl2.KMOD_NUM, KMOD_CAPS = sdl2.KMOD_CAPS, KMOD_MODE = sdl2.KMOD_MODE, K_FIRST = 0, K_LAST = sdl2.SDLK_SLEEP, K_BREAK = sdl2.SDLK_PAUSE, K_EURO = sdl2.SDLK_CURRENCYUNIT, K_KP0 = sdl2.SDLK_KP_0, K_KP1 = sdl2.SDLK_KP_1, K_KP2 = sdl2.SDLK_KP_2, K_KP3 = sdl2.SDLK_KP_3, K_KP4 = sdl2.SDLK_KP_4, K_KP5 = sdl2.SDLK_KP_5, K_KP6 = sdl2.SDLK_KP_6, K_KP7 = sdl2.SDLK_KP_7, K_KP8 = sdl2.SDLK_KP_8, K_KP9 = sdl2.SDLK_KP_9, K_LMETA = sdl2.SDLK_LGUI, K_LSUPER = sdl2.SDLK_LGUI, K_RMETA = sdl2.SDLK_RGUI, K_RSUPER = sdl2.SDLK_RGUI, K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, K_PRINT = sdl2.SDLK_PRINTSCREEN, )) TOUCH_MOUSEID = -1 include "controller.pxi" POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740708525.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/mixer.pyx0000664000175000017500000002027114760215255020560 0ustar00tomtom# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_mixer cimport * from pygame_sdl2.rwobject cimport to_rwops from libc.string cimport memset import sys import threading from pygame_sdl2.error import error import pygame_sdl2.mixer_music as music import pygame_sdl2 cdef object preinit_args = None cdef object output_spec = None cdef dict channel_events = {} cdef dict channel_queued = {} cdef dict current_sounds = {} # The lock protects channel_queued and current_sounds. _lock = threading.Lock() def _play_current(int channel): """ Caled by channel_callback to play the next sound. This has to be called from a different thread, as the channel callback isn't allowed to call MIX functions. """ cdef Sound next_sound with _lock: next_sound = channel_queued[channel] current_sounds[channel] = next_sound channel_queued[channel] = None if next_sound: with nogil: Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) cdef void channel_callback(int channel) noexcept with gil: cdef int etype = 0 cdef SDL_Event e etype = channel_events.get(channel, 0) if etype != 0: memset(&e, 0, sizeof(SDL_Event)) e.type = etype SDL_PushEvent(&e) with _lock: next_sound = channel_queued.get(channel) if next_sound: threading.Thread(target=_play_current, args=(channel,)).start() # A list of errors that occured during mixer initialization. errors = [ ] @pygame_sdl2.register_init def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): if get_init() is not None: return for flag in (MIX_INIT_FLAC, MIX_INIT_MP3, MIX_INIT_OGG): if Mix_Init(flag) != flag: errors.append("{}\n".format(SDL_GetError())) if preinit_args: frequency, size, channels, buffer = preinit_args if Mix_OpenAudio(frequency, size, channels, buffer) != 0: raise error() global output_spec output_spec = get_init() Mix_ChannelFinished(channel_callback) def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): global preinit_args preinit_args = (frequency, size, channels, buffersize) @pygame_sdl2.register_quit def quit(): # @ReservedAssignment Mix_CloseAudio() Mix_Quit() def get_init(): cdef int frequency cdef Uint16 format cdef int channels if Mix_QuerySpec(&frequency, &format, &channels) == 0: return None else: return frequency, format, channels def stop(): with nogil: Mix_HaltChannel(-1) def pause(): with nogil: Mix_Pause(-1) def unpause(): with nogil: Mix_Resume(-1) def fadeout(time): cdef int ms = time with nogil: Mix_FadeOutChannel(-1, ms) def set_num_channels(count): Mix_AllocateChannels(count) def get_num_channels(): return Mix_AllocateChannels(-1) def set_reserved(count): Mix_ReserveChannels(count) def find_channel(force=False): cdef int chan chan = Mix_GroupAvailable(-1) if chan == -1: if not force: return None chan = Mix_GroupOldest(-1) if chan == -1: raise error() return Channel(chan) def get_busy(): return Mix_GroupNewer(-1) != -1 cdef class Sound: cdef Mix_Chunk *chunk def __cinit__(self): self.chunk = NULL def __dealloc__(self): if self.chunk: Mix_FreeChunk(self.chunk) def __init__(self, fi): self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) if self.chunk == NULL: raise error() def play(self, loops=0, maxtime=-1, fade_ms=0): cdef int cid cdef int _loops = loops cdef int _maxtime = maxtime cdef int _fade_ms = fade_ms with nogil: if _fade_ms != 0: cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) else: cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) if cid == -1: raise error() return Channel(cid) def stop(self): cdef int i = 0 while i < Mix_AllocateChannels(-1): if Mix_GetChunk(i) == self.chunk: with nogil: Mix_HaltChannel(i) i += 1 def pause(self): cdef int i = 0 while i < Mix_AllocateChannels(-1): if Mix_GetChunk(i) == self.chunk: with nogil: Mix_Pause(i) i += 1 def unpause(self): cdef int i = 0 while i < Mix_AllocateChannels(-1): if Mix_GetChunk(i) == self.chunk: with nogil: Mix_Resume(i) i += 1 def fadeout(self, time): cdef int i = 0 cdef int ms = time while i < Mix_AllocateChannels(-1): if Mix_GetChunk(i) == self.chunk: with nogil: Mix_FadeOutChannel(i, ms) i += 1 def set_volume(self, value): Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) def get_volume(self): return Mix_VolumeChunk(self.chunk, -1) def get_num_channels(self): cdef int i = 0 cdef int n = 0 while i < Mix_AllocateChannels(-1): if Mix_GetChunk(i) == self.chunk: n += 1 i += 1 return n def get_length(self): # TODO: Adjust for actual format, rather than assuming 16-bit. return self.chunk.alen / output_spec[0] / 2 / output_spec[2] def get_raw(self): # return self.chunk.abuf raise error("Not implemented.") cdef class Channel(object): cdef int cid def __init__(self, cid): self.cid = cid def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): cdef int _loops = loops cdef int _maxtime = maxtime cdef int _fade_ms = fade_ms with nogil: if _fade_ms != 0: cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) else: cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) if cid == -1: raise error() with _lock: current_sounds[self.cid] = sound def stop(self): with nogil: Mix_HaltChannel(self.cid) def pause(self): with nogil: Mix_Pause(self.cid) def unpause(self): with nogil: Mix_Resume(self.cid) def fadeout(self, time): cdef int ms = time with nogil: Mix_FadeOutChannel(self.cid, ms) def set_volume(self, volume): Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) def get_volume(self): cdef int vol = Mix_Volume(self.cid, -1) return vol / MIX_MAX_VOLUME def get_busy(self): return Mix_Playing(self.cid) != 0 def get_sound(self): with _lock: return current_sounds.get(self.cid) def queue(self, Sound sound): if self.get_busy(): with _lock: channel_queued[self.cid] = sound else: self.play(sound) def get_queue(self): with _lock: return channel_queued.get(self.cid) def set_endevent(self, type=None): channel_events[self.cid] = type or 0 def get_endevent(self): return channel_events.get(self.cid, 0) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740708525.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/mixer_music.pyx0000664000175000017500000000516314760215255021763 0ustar00tomtom# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_mixer cimport * from pygame_sdl2.rwobject cimport to_rwops from libc.string cimport memset from pygame_sdl2.error import error cdef Mix_Music *current_music = NULL cdef object queued_music = None cdef int endevent = 0 cdef void music_finished() noexcept: global queued_music if queued_music: load(queued_music) play() queued_music = None cdef SDL_Event e if endevent != 0: memset(&e, 0, sizeof(SDL_Event)) e.type = endevent SDL_PushEvent(&e) def load(fi): global current_music # Free any previously loaded music. if current_music != NULL: Mix_FreeMusic(current_music) current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) if current_music == NULL: raise error() def play(loops=0, double start=0.0): Mix_FadeInMusicPos(current_music, loops, 0, start) def rewind(): Mix_RewindMusic() def stop(): Mix_HaltMusic() def pause(): Mix_PauseMusic() def unpause(): Mix_ResumeMusic() def fadeout(time): Mix_FadeOutMusic(time) def set_volume(double value): Mix_VolumeMusic((MIX_MAX_VOLUME * value)) def get_volume(): return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME def get_busy(): return Mix_PlayingMusic() def set_pos(double pos): Mix_SetMusicPosition(pos) def get_pos(): # TODO: Use a Mix_SetPostMix callback to track position. raise error("Not implemented.") def queue(fi): Mix_HookMusicFinished(music_finished) if get_busy(): global queued_music queued_music = fi else: load(fi) play() def set_endevent(type=None): Mix_HookMusicFinished(music_finished) global endevent endevent = type or 0 def get_endevent(): return endevent ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1722822803.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/mouse.pyx0000664000175000017500000000505114654030223020553 0ustar00tomtom# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from pygame_sdl2.display cimport main_window from pygame_sdl2.surface cimport Surface def init(): global active_cursor active_cursor = None def quit(): global active_cursor active_cursor = None def reset(): SDL_SetCursor(SDL_GetDefaultCursor()) global active_cursor active_cursor = None def get_pressed(): cdef Uint32 state = SDL_GetMouseState(NULL, NULL) return (1 if state & SDL_BUTTON_LMASK else 0, 1 if state & SDL_BUTTON_MMASK else 0, 1 if state & SDL_BUTTON_RMASK else 0) def get_pos(): cdef int x, y SDL_GetMouseState(&x, &y) return (x, y) def get_rel(): cdef int x, y SDL_GetRelativeMouseState(&x, &y) return (x, y) def set_pos(pos): (x, y) = pos SDL_WarpMouseInWindow(NULL, x, y) def set_visible(visible): SDL_ShowCursor(1 if visible else 0) if SDL_GetWindowGrab(main_window.window) == SDL_ENABLE: SDL_SetRelativeMouseMode(SDL_FALSE if visible else SDL_TRUE) def get_focused(): return SDL_GetMouseFocus() != NULL def set_cursor(size, hotspot, xormasks, andmasks): # Does anyone use this? SDL2 has much improved custom cursor support. pass def get_cursor(): return None # The ColorCursor that is currently in use. active_cursor = False cdef class ColorCursor(object): cdef SDL_Cursor *cursor def __init__(self, Surface surface, x, y): self.cursor = SDL_CreateColorCursor(surface.surface, x, y) def __dealloc__(self): SDL_FreeCursor(self.cursor) def activate(self): global active_cursor if active_cursor is not self: active_cursor = self SDL_SetCursor(self.cursor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1511274147.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/power.pyx0000644000175000017500000000337313205033243020556 0ustar00tomtom# Copyright 2017 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from pygame_sdl2.locals import POWERSTATE_UNKNOWN, POWERSTATE_ON_BATTERY, POWERSTATE_NO_BATTERY, POWERSTATE_CHARGING, POWERSTATE_CHARGED from sdl2 cimport * powerstate_to_name = { POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", POWERSTATE_CHARGING : "POWERSTATE_CHARGING", POWERSTATE_CHARGED : "POWERSTATE_CHARGED", } class PowerInfo(object): def __repr__(self): return "".format( powerstate_to_name.get(self.state, "INVALID"), self.seconds, self.percent) def get_power_info(): cdef int seconds cdef int percent state = SDL_GetPowerInfo(&seconds, &percent) rv = PowerInfo() rv.state = state rv.seconds = seconds rv.percent = percent return rv ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1416113532.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/pygame_sdl2.h0000664000175000017500000000075112432026574021250 0ustar00tomtom#ifndef PYGAME_SDL2_H #define PYGAME_SDL2_H #include "pygame_sdl2/pygame_sdl2.rwobject_api.h" #include "pygame_sdl2/pygame_sdl2.surface_api.h" #include "pygame_sdl2/pygame_sdl2.display_api.h" /** * This imports the pygame_sdl2 C api. It returns 0 if the import succeeds, or * 1 if it fails. */ static int import_pygame_sdl2(void) { int rv = 0; rv |= import_pygame_sdl2__rwobject(); rv |= import_pygame_sdl2__surface(); rv |= import_pygame_sdl2__display(); return rv; } #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1611642694.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/pygame_time.pyx0000664000175000017500000000677114003733506021737 0ustar00tomtom# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. import cython import math from sdl2 cimport * from pygame_sdl2.error import error import pygame_sdl2 cdef int timer_id = 0 @pygame_sdl2.register_init def init(): pygame_sdl2.display.sdl_main_init() if SDL_InitSubSystem(SDL_INIT_TIMER): raise error() @pygame_sdl2.register_quit def quit(): # @ReservedAssignment SDL_QuitSubSystem(SDL_INIT_TIMER) def get_ticks(): return SDL_GetTicks() def wait(int milliseconds): cdef int start start = SDL_GetTicks() with nogil: SDL_Delay(milliseconds) return SDL_GetTicks() - start def delay(milliseconds): # SDL_Delay() should be accurate enough. return wait(milliseconds) cdef Uint32 timer_callback(Uint32 interval, void *param) nogil: cdef SDL_Event e e.type = param e.user.code = 0 e.user.data1 = NULL e.user.data2 = NULL SDL_PushEvent(&e) return interval # A map from eventid to SDL_Timer_ID. cdef dict timer_by_event = { } def set_timer(eventid, milliseconds): cdef int timer_id = timer_by_event.get(eventid, 0) if timer_id != 0: SDL_RemoveTimer(timer_id) timer_id = 0 if milliseconds > 0: timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) if timer_id == 0: raise error() timer_by_event[eventid] = timer_id class Clock: def __init__(self): self.last = SDL_GetTicks() self.last_frames = [] self.frametime = 0 self.raw_frametime = 0 def tick(self, framerate=0): cdef int now = SDL_GetTicks() self.raw_frametime = now - self.last while len(self.last_frames) > 9: self.last_frames.pop(0) if framerate == 0: self.last = now self.last_frames.append(self.raw_frametime) return self.raw_frametime cdef int frame_duration = 1.0 / framerate * 1000 if self.raw_frametime < frame_duration: delay(frame_duration - self.raw_frametime) now = SDL_GetTicks() self.frametime = now - self.last self.last = now self.last_frames.append(self.frametime) return self.frametime def tick_busy_loop(self, framerate=0): return self.tick(framerate) def get_time(self): return self.frametime def get_rawtime(self): return self.raw_frametime @cython.cdivision(True) def get_fps(self): cdef int total_time = sum(self.last_frames) cdef float average_time = total_time / 1000.0 / len(self.last_frames) cdef float average_fps = 1.0 / average_time return 0 if math.isnan(average_fps) else average_fps ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1415194826.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/rect.pxd0000664000175000017500000000220012426424312020325 0ustar00tomtom# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * cdef class Rect: # Allow weak references. cdef object __weakref__ cdef public int x cdef public int y cdef public int w cdef public int h cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1573970065.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/rect.pyx0000644000175000017500000002572613564160221020372 0ustar00tomtom# Copyright 2014 Tom Rothamel # Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. import collections def flatten(*args): if len(args) == 1: return args[0] else: return args cdef class Rect: def __init__(self, *args): cdef int x, y, w, h cdef int len_args cdef Rect rect len_args = len(args) if len_args == 1 and isinstance(args[0], Rect): rect = args[0] x = rect.x y = rect.y w = rect.w h = rect.h elif len_args == 1 and len(args[0]) == 4: x, y, w, h = args[0] elif len_args == 1 and len(args[0]) == 2: x, y = args[0] w = 0 h = 0 elif len_args == 2: x, y = args[0] w, h = args[1] elif len_args == 4: x, y, w, h = args else: raise TypeError("Argument must be a rect style object.") self.x = x self.y = y self.w = w self.h = h def __reduce__(self): return (Rect, (self.x, self.y, self.w, self.h)) def __repr__(self): return "" % (self.x, self.y, self.w, self.h) def __len__(self): return 4 def __iter__(self): return iter((self.x, self.y, self.w, self.h)) def __richcmp__(Rect a, b, int op): if not isinstance(b, Rect): b = Rect(b) if op == 2: return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h def __getitem__(self, key): return (self.x, self.y, self.w, self.h)[key] def __setitem__(self, key, val): if key == 0: self.x = val elif key == 1: self.y = val elif key == 2: self.w = val elif key == 3: self.h = val else: raise IndexError(key) property left: def __get__(self): return self.x def __set__(self, val): self.x = val property top: def __get__(self): return self.y def __set__(self, val): self.y = val property width: def __get__(self): return self.w def __set__(self, val): self.w = val property height: def __get__(self): return self.h def __set__(self, val): self.h = val property right: def __get__(self): return self.x + self.width def __set__(self, val): self.x += val - self.right property bottom: def __get__(self): return self.y + self.height def __set__(self, val): self.y += val - self.bottom property size: def __get__(self): return (self.w, self.h) def __set__(self, val): self.w, self.h = val property topleft: def __get__(self): return (self.left, self.top) def __set__(self, val): self.left, self.top = val property topright: def __get__(self): return (self.right, self.top) def __set__(self, val): self.right, self.top = val property bottomright: def __get__(self): return (self.right, self.bottom) def __set__(self, val): self.right, self.bottom = val property bottomleft: def __get__(self): return (self.left, self.bottom) def __set__(self, val): self.left, self.bottom = val property centerx: def __get__(self): return self.x + (self.w / 2) def __set__(self, val): self.x += val - self.centerx property centery: def __get__(self): return self.y + (self.h / 2) def __set__(self, val): self.y += val - self.centery property center: def __get__(self): return (self.centerx, self.centery) def __set__(self, val): self.centerx, self.centery = val property midtop: def __get__(self): return (self.centerx, self.top) def __set__(self, val): self.centerx, self.top = val property midleft: def __get__(self): return (self.left, self.centery) def __set__(self, val): self.left, self.centery = val property midbottom: def __get__(self): return (self.centerx, self.bottom) def __set__(self, val): self.centerx, self.bottom = val property midright: def __get__(self): return (self.right, self.centery) def __set__(self, val): self.right, self.centery = val def copy(self): return Rect(self) def move(self, *args): r = self.copy() r.move_ip(*args) return r def move_ip(self, *args): x, y = flatten(args) self.x += x self.y += y def inflate(self, *args): r = self.copy() r.inflate_ip(*args) return r def inflate_ip(self, *args): x, y = flatten(args) c = self.center self.w += x self.h += y self.center = c def clamp(self, other): r = self.copy() r.clamp_ip(other) return r def clamp_ip(self, other): if not isinstance(other, Rect): other = Rect(other) if self.w > other.w or self.h > other.h: self.center = other.center else: if self.left < other.left: self.left = other.left elif self.right > other.right: self.right = other.right if self.top < other.top: self.top = other.top elif self.bottom > other.bottom: self.bottom = other.bottom def clip(self, other, y=None, w=None, h=None): if type(other) == int: other = Rect(other, y, w, h) if not isinstance(other, Rect): other = Rect(other) if not self.colliderect(other): return Rect(0,0,0,0) r = self.copy() # Remember that (0,0) is the top left. if r.left < other.left: d = other.left - r.left r.left += d r.width -= d if r.right > other.right: d = r.right - other.right r.width -=d if r.top < other.top: d = other.top - r.top r.top += d r.height -= d if r.bottom > other.bottom: d = r.bottom - other.bottom r.height -= d return r def union(self, other): r = self.copy() r.union_ip(other) return r def union_ip(self, other): if not isinstance(other, Rect): other = Rect(other) x = min(self.x, other.x) y = min(self.y, other.y) self.w = max(self.right, other.right) - x self.h = max(self.bottom, other.bottom) - y self.x = x self.y = y def unionall(self, other_seq): r = self.copy() r.unionall_ip(other_seq) return r def unionall_ip(self, other_seq): for other in other_seq: self.union_ip(other) def fit(self, other): if not isinstance(other, Rect): other = Rect(other) # Not sure if this is entirely correct. Docs and tests are ambiguous. r = self.copy() r.topleft = other.topleft w_ratio = other.w / float(r.w) h_ratio = other.h / float(r.h) factor = min(w_ratio, h_ratio) r.w *= factor r.h *= factor return r def normalize(self): if self.w < 0: self.x += self.w self.w = -self.w if self.h < 0: self.y += self.h self.h = -self.h def contains(self, other): if not isinstance(other, Rect): other = Rect(other) return other.x >= self.x and other.right <= self.right and \ other.y >= self.y and other.bottom <= self.bottom and \ other.left < self.right and other.top < self.bottom def collidepoint(self, x, y=None): if type(x) == tuple: x, y = x return x >= self.x and y >= self.y and \ x < self.right and y < self.bottom def colliderect(self, other): if not isinstance(other, Rect): other = Rect(other) return self.left < other.right and self.top < other.bottom and \ self.right > other.left and self.bottom > other.top def collidelist(self, other_list): for n, other in zip(range(len(other_list)), other_list): if self.colliderect(other): return n return -1 def collidelistall(self, other_list): ret = [] for n, other in zip(range(len(other_list)), other_list): if self.colliderect(other): ret.append(n) return ret def collidedict(self, other_dict, rects_values=0): # What is rects_values supposed to do? Not in docs. for key, val in other_dict.items(): if self.colliderect(val): return key, val return None def collidedictall(self, other_dict, rects_values=0): ret = [] for key, val in other_dict.items(): if self.colliderect(val): ret.append((key,val)) return ret cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=None) except -1: """ Converts `rectlike` to the SDL_Rect `rect`. `rectlike` may be a Rect or a (x, y, w, h) tuple. """ cdef int x, y, w, h cdef Rect rl try: if isinstance(rectlike, Rect): rl = rectlike rect.x = rl.x rect.y = rl.y rect.w = rl.w rect.h = rl.h return 0 elif len(rectlike) == 4: rect.x, rect.y, rect.w, rect.h = rectlike return 0 elif len(rectlike) == 2: rect.x, rect.y = rectlike rect.w, rect.h = rectlike return 0 except: pass if argname: raise TypeError("Argument {} must be a rect style object.".format(argname)) else: raise TypeError("Argument must be a rect style object.") ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1573970065.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/render.pyx0000644000175000017500000003402213564160221020701 0ustar00tomtom# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_image cimport * from libc.string cimport memcpy, memset from pygame_sdl2.display cimport * from pygame_sdl2.surface cimport * from pygame_sdl2.rwobject cimport to_rwops from pygame_sdl2.rect cimport to_sdl_rect from pygame_sdl2.rect import Rect from pygame_sdl2.error import error from pygame_sdl2.color import Color import json import warnings BLENDMODE_NONE = SDL_BLENDMODE_NONE BLENDMODE_BLEND = SDL_BLENDMODE_BLEND BLENDMODE_ADD = SDL_BLENDMODE_ADD BLENDMODE_MOD = SDL_BLENDMODE_MOD cdef bint DEBUG_DRAW_BBOX = True cdef rinfo_to_dict(SDL_RendererInfo *rinfo): # Ignore texture_formats for now. return { "name" : rinfo.name, "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, "max_texture_width" : rinfo.max_texture_width, "max_texture_height" : rinfo.max_texture_height, } def get_drivers(): cdef SDL_RendererInfo rinfo cdef int num_drivers rv = [] num_drivers = SDL_GetNumRenderDrivers() for n in range(num_drivers): if SDL_GetRenderDriverInfo(n, &rinfo) != 0: raise error() rv.append(rinfo_to_dict(&rinfo)) return rv cdef class Renderer: cdef SDL_Renderer *renderer cdef dict _info def __cinit__(self): self.renderer = NULL def __dealloc__(self): if self.renderer: SDL_DestroyRenderer(self.renderer) def __init__(self, Window window=None, vsync=False, driver=-1): if window is None: window = main_window cdef uint32_t flags = SDL_RENDERER_ACCELERATED if vsync: flags |= SDL_RENDERER_PRESENTVSYNC self.renderer = SDL_CreateRenderer(window.window, driver, flags) if self.renderer == NULL: self.renderer = SDL_GetRenderer(window.window) if self.renderer == NULL: raise error() cdef SDL_RendererInfo rinfo if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: raise error() self._info = rinfo_to_dict(&rinfo) if not self.info()["accelerated"]: warnings.warn("Renderer is not accelerated.") def load_texture(self, fi): cdef SDL_Texture *tex cdef Texture t = Texture() if isinstance(fi, Surface): tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) else: tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) if tex == NULL: raise error() t.set(self.renderer, tex) return TextureNode(t) def load_atlas(self, filename): """ Loads a file in the popular JSON (Hash) format exported by TexturePacker and other software. """ return TextureAtlas(self, filename) def render_present(self): with nogil: SDL_RenderPresent(self.renderer) def info(self): return self._info cdef set_drawcolor(self, col): if not isinstance(col, Color): col = Color(col) SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) def clear(self, color): self.set_drawcolor(color) SDL_RenderClear(self.renderer) def draw_line(self, color not None, x1, y1, x2, y2): self.set_drawcolor(color) if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: raise error() def draw_point(self, color not None, x, y): self.set_drawcolor(color) SDL_RenderDrawPoint(self.renderer, x, y) def draw_rect(self, color not None, rect): cdef SDL_Rect r to_sdl_rect(rect, &r) self.set_drawcolor(color) SDL_RenderDrawRect(self.renderer, &r) def fill_rect(self, color not None, rect): cdef SDL_Rect r to_sdl_rect(rect, &r) self.set_drawcolor(color) SDL_RenderFillRect(self.renderer, &r) def set_viewport(self, rect=None): cdef SDL_Rect vprect if rect is None: SDL_RenderSetViewport(self.renderer, NULL) else: to_sdl_rect(rect, &vprect) SDL_RenderSetViewport(self.renderer, &vprect) def create_texture(self, size): if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: raise error() cdef class Texture: """ Mostly for internal use. Users should only see this for RTT. """ cdef SDL_Renderer *renderer cdef SDL_Texture *texture cdef public int w, h def __cinit__(self): self.texture = NULL def __dealloc__(self): if self.texture: SDL_DestroyTexture(self.texture) cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): cdef Uint32 format cdef int access, w, h self.renderer = ren self.texture = tex if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: raise error() self.w = w self.h = h cdef class TextureNode: """ A specified area of a texture. """ cdef Texture texture # The absolute rect within the texture. cdef SDL_Rect source_rect # The relative rect within the original tile. cdef SDL_Rect trimmed_rect # The dimensions of the original tile. cdef int source_w cdef int source_h def __init__(self, tex): if isinstance(tex, Texture): self.texture = tex to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) self.source_w = tex.w self.source_h = tex.h elif isinstance(tex, TextureNode): self.texture = (tex).texture else: raise ValueError() def render(self, dest=None): cdef SDL_Rect dest_rect if dest is None: with nogil: SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) else: to_sdl_rect(dest, &dest_rect) with nogil: if dest_rect.w == 0 or dest_rect.h == 0: dest_rect.w = self.trimmed_rect.w dest_rect.h = self.trimmed_rect.h SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) cdef class TextureAtlas: cdef object frames def __init__(self, Renderer ren, fi): jdata = json.load(open(fi, "r")) image = jdata["meta"]["image"] cdef TextureNode tn = ren.load_texture(image) self.frames = {} cdef TextureNode itex for itm in jdata["frames"].items(): iname, idict = itm itex = TextureNode(tn) f = idict["frame"] to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") f = idict["spriteSourceSize"] to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") if idict["rotated"]: raise error("Rotation not supported yet.") itex.source_w = idict["sourceSize"]["w"] itex.source_h = idict["sourceSize"]["h"] self.frames[iname] = itex def __getitem__(self, key): return self.frames[key] def keys(self): return self.frames.keys() cdef class Sprite: """ One or more TextureNodes, with possible transforms applied. """ cdef list nodes cdef SDL_Rect _pos cdef SDL_Rect bounding_box cdef double _rotation cdef int _flip cdef SDL_Color _color cdef double _scalex cdef double _scaley def __init__(self, nodes): self._color.r = 255 self._color.g = 255 self._color.b = 255 self._color.a = 255 self._scalex = 1.0 self._scaley = 1.0 self._flip = SDL_FLIP_NONE memset(&self._pos, 0, sizeof(SDL_Rect)) memset(&self.bounding_box, 0, sizeof(SDL_Rect)) if isinstance(nodes, TextureNode): nodes = [nodes] self.nodes = [] # TODO: Check that they're all from the same texture. for node in nodes: if not isinstance(node, TextureNode): raise ValueError("Invalid argument: %s" % node) SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, &self.bounding_box) self.nodes.append(node) cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: rout.x = dest.x + (self._scalex * rin.x) rout.y = dest.y + (self._scaley * rin.y) rout.w = (self._scalex * rin.w) rout.h = (self._scaley * rin.h) def render(self, dest=None): cdef Texture tex = (self.nodes[0]).texture cdef SDL_Rect dest_rect cdef SDL_Rect real_dest cdef SDL_Point pivot if dest is None: memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) else: to_sdl_rect(dest, &dest_rect) with nogil: SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) SDL_SetTextureAlphaMod(tex.texture, self._color.a) if DEBUG_DRAW_BBOX: # TODO: Adjust for rotation. self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) SDL_SetRenderDrawColor(tex.renderer, 0x00, 0x00, 0x00, 0x00) cdef TextureNode tn for x in self.nodes: tn = x with nogil: pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) SDL_RenderCopyEx(tex.renderer, tex.texture, &tn.source_rect, &real_dest, self._rotation, &pivot, self._flip) def collides(self, Sprite other not None): cdef SDL_Rect r1, r2 self.adjust_rect(&self._pos, &self.bounding_box, &r1) other.adjust_rect(&other._pos, &other.bounding_box, &r2) return SDL_HasIntersection(&r1, &r2) == SDL_TRUE property pos: def __get__(self): return self._pos.x, self._pos.y def __set__(self, val): self._pos.x = val[0] self._pos.y = val[1] property color: def __set__(self, val): if not isinstance(val, Color): val = Color(val) self._color.r = val.r self._color.g = val.g self._color.b = val.b self._color.a = val.a property alpha: def __get__(self): return self._color.a def __set__(self, val): self._color.a = val property rotation: def __get__(self): return self._rotation def __set__(self, val): self._rotation = val property scale: def __get__(self): if self._scalex == self._scaley: return self._scalex else: return self._scalex, self._scaley def __set__(self, arg): if type(arg) == tuple: x, y = arg else: x = y = arg self._scalex = x self._scaley = y property hflip: def __get__(self): return self._flip & SDL_FLIP_HORIZONTAL def __set__(self, val): if val: self._flip |= SDL_FLIP_HORIZONTAL else: self._flip &= ~SDL_FLIP_HORIZONTAL property vflip: def __get__(self): return self._flip & SDL_FLIP_VERTICAL def __set__(self, val): if val: self._flip |= SDL_FLIP_VERTICAL else: self._flip &= ~SDL_FLIP_VERTICAL cdef class Container: """ Multiple sprites, positioned relative to the container. """ cdef SDL_Rect _rect cdef list sprites def __init__(self, rect): """ Parameter may be a position (no clipping) or a rect (clipped). """ self.sprites = [] to_sdl_rect(rect, &self._rect) if len(rect) == 2: self._rect.w = self._rect.h = 0 def add(self, Sprite sprite not None): self.sprites.append(sprite) def render(self, dest=None): # TODO: Something other than this to get the SDL_Renderer. cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer if self._rect.w != 0 and self._rect.h != 0: SDL_RenderSetClipRect(ren, &self._rect) for s in self.sprites: s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) # TODO: Save and restore previous clip rect instead? SDL_RenderSetClipRect(ren, NULL) property pos: def __get__(self): return self._rect.x, self._rect.y def __set__(self, val): self._rect.x = val[0] self._rect.y = val[1] property rect: def __get__(self): return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) def __set__(self, val): to_sdl_rect(val, &self._rect) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1722822803.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/rwobject.pxd0000664000175000017500000000175014654030223021217 0ustar00tomtom# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport SDL_RWops cdef SDL_RWops *to_rwops(filelike, mode=*, base=*, length=*) except NULL ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740708509.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/rwobject.pyx0000664000175000017500000004726114760215235021261 0ustar00tomtom# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from cpython.ref cimport Py_INCREF, Py_DECREF from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_CONTIG, PyBUF_CONTIG_RO from libc.string cimport memcpy from libc.stdio cimport FILE, fopen, fclose, fseek, ftell, fread, SEEK_SET, SEEK_CUR, SEEK_END from libc.stdlib cimport calloc, free from libc.stdint cimport uintptr_t from pygame_sdl2.compat import file_type, bytes_, unicode_ import sys import io # The fsencoding. fsencoding = sys.getfilesystemencoding() or "utf-8" cdef extern from "SDL.h" nogil: Sint64 SDL_RWtell(SDL_RWops* context) Sint64 SDL_RWseek(SDL_RWops* context, Sint64 offset, int whence) size_t SDL_RWread(SDL_RWops* context, void* ptr, size_t size, size_t maxnum) size_t SDL_RWwrite(SDL_RWops* context, const void* ptr, size_t size, size_t num) int SDL_RWclose(SDL_RWops* context) SDL_RWops* SDL_RWFromFile(const char *file, const char *mode) cdef extern from "python_threads.h": void init_python_threads() cdef set_error(e): cdef char *msg e = str(e) msg = e SDL_SetError("%s", msg) cdef Sint64 python_size(SDL_RWops *context) noexcept with gil: f = context.hidden.unknown.data1 try: cur = f.tell() f.seek(0, 2) rv = f.tell() f.seek(cur, 0) except Exception as e: return -1 return rv cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept with gil: f = context.hidden.unknown.data1 try: f.seek(seek, whence) rv = f.tell() except Exception as e: set_error(e) return -1 return rv cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept with gil: f = context.hidden.unknown.data1 try: data = f.read(size * maxnum) except Exception as e: set_error(e) return -1 memcpy(ptr, data, len(data)) return len(data) cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) noexcept with gil: f = context.hidden.unknown.data1 data = ( ptr)[:size * maxnum] try: f.write(data) except Exception as e: set_error(e) return -1 return len(data) cdef int python_close(SDL_RWops *context) noexcept with gil: if context != NULL: if context.hidden.unknown.data1 != NULL: f = context.hidden.unknown.data1 try: f.close() except Exception as e: set_error(e) return -1 Py_DECREF(f) context.hidden.unknown.data1 = NULL SDL_FreeRW(context) return 0 cdef struct SubFile: SDL_RWops *rw Sint64 base Sint64 length Sint64 tell cdef Sint64 subfile_size(SDL_RWops *context) noexcept nogil: cdef SubFile *sf = context.hidden.unknown.data1 return sf.length cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: cdef SubFile *sf = context.hidden.unknown.data1 if whence == RW_SEEK_SET: sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base elif whence == RW_SEEK_CUR: sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base elif whence == RW_SEEK_END: sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base return sf.tell cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: cdef SubFile *sf = context.hidden.unknown.data1 cdef Sint64 left = sf.length - sf.tell cdef size_t rv if size * maxnum > left: maxnum = left // size if maxnum == 0: return 0 rv = SDL_RWread(sf.rw, ptr, size, maxnum) if rv > 0: sf.tell += size * rv return rv cdef int subfile_close(SDL_RWops *context) noexcept nogil: cdef SubFile *sf if context != NULL: sf = context.hidden.unknown.data1 if sf.rw != NULL: SDL_RWclose(sf.rw) if sf != NULL: free(sf) context.hidden.unknown.data1 = NULL SDL_FreeRW(context) return 0 cdef struct SplitFile: SDL_RWops *a SDL_RWops *b Sint64 split Sint64 tell cdef Sint64 splitfile_size(SDL_RWops *context) noexcept nogil: cdef SplitFile *sf = context.hidden.unknown.data1 cdef Sint64 rv return SDL_RWsize(sf.a) + SDL_RWsize(sf.b) cdef Sint64 splitfile_seek(SDL_RWops *context, Sint64 seek, int whence) noexcept nogil: cdef SplitFile *sf = context.hidden.unknown.data1 cdef Sint64 rv if whence == RW_SEEK_SET: sf.tell = seek elif whence == RW_SEEK_CUR: sf.tell += seek elif whence == RW_SEEK_END: sf.tell = splitfile_size(context) + seek if sf.tell < sf.split: rv = SDL_RWseek(sf.a, sf.tell, RW_SEEK_SET) SDL_RWseek(sf.b, 0, RW_SEEK_SET) else: SDL_RWseek(sf.a, sf.split, RW_SEEK_SET) rv = SDL_RWseek(sf.b, sf.tell - sf.split, RW_SEEK_SET) if rv < 0: return rv else: return sf.tell cdef size_t splitfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: cdef SplitFile *sf = context.hidden.unknown.data1 cdef Sint64 left = splitfile_size(context) - sf.tell cdef size_t rv cdef size_t total_read cdef size_t left_read cdef size_t right_read cdef size_t ret total_read = size * maxnum left_read = min(total_read, sf.split - sf.tell) left_read = max(left_read, 0) if left_read > 0: left_read = SDL_RWread(sf.a, ptr, 1, left_read) if left_read < 0: return left_read right_read = total_read - left_read if right_read > 0: right_read = SDL_RWread(sf.b, ptr + left_read, 1, right_read) if right_read < 0: return right_read sf.tell += left_read + right_read return (left_read + right_read) // size cdef int splitfile_close(SDL_RWops *context) noexcept nogil: cdef SplitFile *sf if context != NULL: sf = context.hidden.unknown.data1 if sf.a != NULL: SDL_RWclose(sf.a) if sf.b != NULL: SDL_RWclose(sf.b) if sf != NULL: free(sf) context.hidden.unknown.data1 = NULL SDL_FreeRW(context) return 0 cdef struct BufFile: Py_buffer view Uint8 *base Uint8 *here Uint8 *stop cdef Sint64 buffile_size(SDL_RWops *context) noexcept nogil: cdef BufFile *bf = context.hidden.unknown.data1 return bf.stop - bf.base cdef Sint64 buffile_seek(SDL_RWops *context, Sint64 offset, int whence) noexcept nogil: cdef BufFile *bf = context.hidden.unknown.data1 cdef Uint8 *newpos if whence == RW_SEEK_SET: newpos = bf.base + offset elif whence == RW_SEEK_CUR: newpos = bf.here + offset elif whence == RW_SEEK_END: newpos = bf.stop + offset else: with gil: set_error("Unknown value for 'whence'") return -1 if newpos < bf.base: newpos = bf.base if newpos > bf.stop: newpos = bf.stop bf.here = newpos return bf.here - bf.base cdef size_t buffile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) noexcept nogil: cdef BufFile *bf = context.hidden.unknown.data1 cdef size_t total_bytes = 0 cdef size_t mem_available = 0 total_bytes = maxnum * size if (maxnum == 0) or (size == 0) or ((total_bytes // maxnum) != size): return 0 mem_available = bf.stop - bf.here if total_bytes > mem_available: total_bytes = mem_available SDL_memcpy(ptr, bf.here, total_bytes) bf.here += total_bytes return (total_bytes // size) cdef size_t buffile_write(SDL_RWops *context, const void *ptr, size_t size, size_t num) noexcept nogil: cdef BufFile *bf = context.hidden.unknown.data1 if bf.view.readonly != 0: return 0 if (bf.here + (num * size)) > bf.stop: num = (bf.stop - bf.here) // size SDL_memcpy(bf.here, ptr, num * size) bf.here += num * size return num cdef int buffile_close(SDL_RWops *context) noexcept with gil: cdef BufFile *bf if context != NULL: bf = context.hidden.unknown.data1 if bf != NULL: PyBuffer_Release(&bf.view) free(bf) bf = NULL SDL_FreeRW(context) return 0 cdef SDL_RWops *to_rwops(filelike, mode="rb", base=None, length=None) except NULL: """ This accepts, in order: * An io.BufferedIOBase object, which is unwrapped to get the underlying file object. (Which is then processed as below.) * A RWopsIO object, which is closed and the underlying SDL_RWops object is returned. * A filename, which is opened. * An object with the name, base, and length attributes. The name is interpreted as a filename, and the base and length are used to create a subfile. * An object with a name fileld. The name is interpreted as a filename. and opened. The object will be closed. * An object that supports the buffer protocol. * A file-like object, which is wrapped in a Python file-like object It returns an SDL_RWops object, or NULL on error. """ cdef FILE *f cdef SubFile *sf cdef SDL_RWops *rv cdef SDL_RWops *rw cdef char *cname cdef char *cmode cdef RWopsIOImpl rwopsio if not isinstance(mode, bytes_): mode = mode.encode("ascii") name = filelike # Handle turning BufferedIOBase and RWopsIO objects into their underlying # objects. try: while True: filelike = filelike.raw except AttributeError: pass if isinstance(filelike, RWopsIOImpl): rwopsio = filelike if not rwopsio.ops: raise ValueError("I/O on closed file.") rv = rwopsio.ops rwopsio.ops = NULL return rv if isinstance(filelike, (file_type, io.IOBase)) and mode == "rb": name = getattr(filelike, "name", None) # Try to open as a file. if isinstance(name, bytes_): name = name.decode(fsencoding) elif isinstance(name, unicode_): pass else: name = None if (mode == b"rb") and (name is not None): dname = name.encode("utf-8") cname = dname cmode = mode with nogil: rv = SDL_RWFromFile(cname, cmode) if rv == NULL: raise IOError("Could not open {!r}: {}".format(name, SDL_GetError())) if base is None and length is None: try: base = filelike.base length = filelike.length except AttributeError: pass if base is not None and length is not None: # If we have these properties, we're either an APK asset or a Ren'Py-style # subfile, so use an optimized path. rw = rv SDL_RWseek(rw, base, RW_SEEK_SET); sf = calloc(sizeof(SubFile), 1) sf.rw = rw sf.base = base sf.length = length sf.tell = 0 rv = SDL_AllocRW() rv.size = subfile_size rv.seek = subfile_seek rv.read = subfile_read rv.write = NULL rv.close = subfile_close rv.type = 0 rv.hidden.unknown.data1 = sf try: filelike.close() except: pass return rv if not (hasattr(filelike, "read") or hasattr(filelike, "write")): raise IOError("{!r} is not a filename or file-like object.".format(filelike)) Py_INCREF(filelike) rv = SDL_AllocRW() rv.size = python_size rv.seek = python_seek rv.read = python_read rv.write = python_write rv.close = python_close rv.type = 0 rv.hidden.unknown.data1 = filelike return rv whence_mapping = { io.SEEK_SET : RW_SEEK_SET, io.SEEK_CUR : RW_SEEK_CUR, io.SEEK_END : RW_SEEK_END, } cdef class RWopsIOImpl: """ This wraps an SDL_RWops object in a Python file-like object. """ cdef SDL_RWops *ops cdef public object name cdef public object base cdef public object length def __dealloc__(self): if self.ops != NULL: SDL_RWclose(self.ops) self.ops = NULL def __init__(self, filelike, mode="rb", base=None, length=None, name=None): """ Creates a new RWopsIO object. All parameter are passed to to_rwops to create the SDL_RWops object. """ if name is not None: self.name = name elif isinstance(filelike, basestring): self.name = filelike else: self.name = getattr(filelike, "name", name) self.base = base self.length = length if filelike is not None: self.ops = to_rwops(filelike, mode, base, length) else: self.ops = NULL def close(self): # A closed file may be closed again. if self.ops: SDL_RWclose(self.ops) self.ops = NULL def is_closed(self): return not self.ops def seek(self, long long offset, whence=0): cdef int whence_rw cdef long long rv if not self.ops: raise ValueError("I/O operation on closed file.") whence_rw = whence_mapping.get(whence, RW_SEEK_SET) with nogil: rv = SDL_RWseek(self.ops, offset, whence_rw) if rv < 0: raise IOError("Could not seek: {}".format(SDL_GetError())) return rv def tell(self): cdef long long rv with nogil: rv = SDL_RWtell(self.ops) return rv def readinto(self, b): cdef Py_buffer view cdef long long rv = 0 if not self.ops: raise ValueError("I/O operation on closed file.") if not PyObject_CheckBuffer(b): raise ValueError("Passed in object does not support buffer protocol") try: PyObject_GetBuffer(b, &view, PyBUF_CONTIG) with nogil: rv = SDL_RWread(self.ops, view.buf, 1, view.len) finally: PyBuffer_Release(&view) if rv < 0: raise IOError("Could not read: {}".format(SDL_GetError())) return rv def write(self, b): cdef Py_buffer view cdef long long rv = 0 if not self.ops: raise ValueError("I/O operation on closed file.") if not PyObject_CheckBuffer(b): raise ValueError("Passed in object does not support buffer protocol") try: PyObject_GetBuffer(b, &view, PyBUF_CONTIG_RO) with nogil: rv = SDL_RWwrite(self.ops, view.buf, 1, view.len) finally: PyBuffer_Release(&view) if rv < 0: raise IOError("Could not write: {}".format(SDL_GetError())) return rv cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: return to_rwops(filelike, "rb", None, None) class RWopsIO(io.RawIOBase): def __init__(self, filelike, mode='rb', base=None, length=None, name=None): """ Creates a new RWopsIO object. All parameter are passed to to_rwops to create the SDL_RWops object. """ io.RawIOBase.__init__(self) self.raw = RWopsIOImpl(filelike, mode=mode, base=base, length=length, name=name) self.close = self.raw.close self.seek = self.raw.seek self.tell = self.raw.tell self.write = self.raw.write self.readinto = self.raw.readinto def __repr__(self): if self.raw.base is not None: return "".format(self.raw.name, self.raw.base, self.raw.length) else: return "".format(self.raw.name) # Implemented class: io.IOBase # close is taken from RWopsIOImpl. @property def closed(self): return self.raw.is_closed() def fileno(self): raise OSError() # inherited flush is used # inherited isatty is used def readable(self): return True # inherited readline is used # inherited readlines is used # seek is taken from RWopsIOImpl. def seekable(self): return True # tell is taken from RWopsIOImpl. def truncate(self, size=None): raise OSError() def writable(self): return True # inherited writelines is used # inherited __del__ is used # Implemented class: io.RawIOBase # inherited read is used # inherited readall is used # readinto is taken from RWopsIOImpl. # write is taken from RWopsIOImpl. @staticmethod def from_buffer(buffer, mode="rb", name=None): """ Creates a new RWopsIO object from a buffer. """ cdef BufFile *bf cdef SDL_RWops *rw if not PyObject_CheckBuffer(buffer): raise ValueError("Passed in object does not support buffer protocol") bf = calloc(sizeof(BufFile), 1) if bf == NULL: raise MemoryError() if PyObject_GetBuffer(buffer, &bf.view, PyBUF_CONTIG_RO) < 0: free(bf) raise ValueError("Could not get buffer.") bf.base = bf.view.buf bf.here = bf.base bf.stop = bf.base + bf.view.len rw = SDL_AllocRW() rw.size = buffile_size rw.seek = buffile_seek rw.read = buffile_read rw.write = buffile_write rw.close = buffile_close rw.type = 0 rw.hidden.unknown.data1 = bf rv = RWopsIO(None, name=name) ( rv.raw).ops = rw return rv @staticmethod def from_split(a, b, name=None): """ Creates a new RWopsIO object from two other RWopsIO objects, representing the concatenation of the two. """ cdef SplitFile *sf cdef SDL_RWops *rw sf = calloc(sizeof(SplitFile), 1) if sf == NULL: raise MemoryError() sf.a = to_rwops(a) sf.b = to_rwops(b) sf.split = SDL_RWsize(sf.a) sf.tell = 0 rw = SDL_AllocRW() rw.size = splitfile_size rw.seek = splitfile_seek rw.read = splitfile_read rw.write = NULL rw.close = splitfile_close rw.type = 0 rw.hidden.unknown.data1 = sf rv = RWopsIO(None, name=name) ( rv.raw).ops = rw return rv init_python_threads() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740708480.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/scrap.pyx0000664000175000017500000000411414760215200020530 0ustar00tomtom# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from pygame_sdl2.error import error from pygame_sdl2.locals import SCRAP_TEXT from pygame_sdl2.compat import bytes_ try: import emscripten except ImportError: emscripten = None def init(): pass def get(type): cdef char *text = NULL if type == SCRAP_TEXT: text = SDL_GetClipboardText() if text == NULL: raise error() rv = bytes_(text) SDL_free(text) return rv else: raise error("Not implemented.") def get_types(): return [SCRAP_TEXT] def put(type, data): if type != SCRAP_TEXT: raise error("Not implemented.") if emscripten is not None: # SDL_SetClipboardText() is not implemented for Web import re text = data.decode('utf-8') script = 'navigator.clipboard.writeText(`%s`)' % (re.sub(r'([\\`$])', r'\\\1', text),) emscripten.run_script(script) return data = bytes_(data) if SDL_SetClipboardText(data) != 0: raise error() def contains(type): if type != SCRAP_TEXT: return False return SDL_HasClipboardText() == SDL_TRUE def lost(): return False def set_mode(mode): pass _types = """ SCRAP_TEXT : int """././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1522804649.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/sprite.py0000644000175000017500000015454313261023651020552 0ustar00tomtom## pygame - Python Game Library ## Copyright (C) 2000-2003, 2007 Pete Shinners ## (C) 2004 Joe Wreschnig ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (at your option) any later version. ## ## This library is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## Library General Public License for more details. ## ## You should have received a copy of the GNU Library General Public ## License along with this library; if not, write to the Free ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## ## Pete Shinners ## pete@shinners.org """pygame module with basic game object classes This module contains several simple classes to be used within games. There are the main Sprite class and several Group classes that contain Sprites. The use of these classes is entirely optional when using Pygame. The classes are fairly lightweight and only provide a starting place for the code that is common to most games. The Sprite class is intended to be used as a base class for the different types of objects in the game. There is also a base Group class that simply stores sprites. A game could create new types of Group classes that operate on specially customized Sprite instances they contain. The basic Sprite class can draw the Sprites it contains to a Surface. The Group.draw() method requires that each Sprite have a Surface.image attribute and a Surface.rect. The Group.clear() method requires these same attributes and can be used to erase all the Sprites with background. There are also more advanced Groups: pygame.sprite.RenderUpdates() and pygame.sprite.OrderedUpdates(). Lastly, this module contains several collision functions. These help find sprites inside multiple groups that have intersecting bounding rectangles. To find the collisions, the Sprites are required to have a Surface.rect attribute assigned. The groups are designed for high efficiency in removing and adding Sprites to them. They also allow cheap testing to see if a Sprite already exists in a Group. A given Sprite can exist in any number of groups. A game could use some groups to control object rendering, and a completely separate set of groups to control interaction or player movement. Instead of adding type attributes or bools to a derived Sprite class, consider keeping the Sprites inside organized Groups. This will allow for easier lookup later in the game. Sprites and Groups manage their relationships with the add() and remove() methods. These methods can accept a single or multiple group arguments for membership. The default initializers for these classes also take a single group or list of groups as argments for initial membership. It is safe to repeatedly add and remove the same Sprite from a Group. While it is possible to design sprite and group classes that don't derive from the Sprite and AbstractGroup classes below, it is strongly recommended that you extend those when you create a new Sprite or Group class. Sprites are not thread safe, so lock them yourself if using threads. """ ##todo ## a group that holds only the 'n' most recent elements. ## sort of like the GroupSingle class, but holding more ## than one sprite ## ## drawing groups that can 'automatically' store the area ## underneath so they can "clear" without needing a background ## function. obviously a little slower than normal, but nice ## to use in many situations. (also remember it must "clear" ## in the reverse order that it draws :]) ## ## the drawing groups should also be able to take a background ## function, instead of just a background surface. the function ## would take a surface and a rectangle on that surface to erase. ## ## perhaps more types of collision functions? the current two ## should handle just about every need, but perhaps more optimized ## specific ones that aren't quite so general but fit into common ## specialized cases. import pygame_sdl2 from pygame_sdl2 import Rect from pygame_sdl2.time import get_ticks from operator import truth # Python 3 does not have the callable function, but an equivalent can be made # with the hasattr function. if 'callable' not in dir(__builtins__): callable = lambda obj: hasattr(obj, '__call__') # Don't depend on pygame_sdl2.mask if it's not there... try: from pygame_sdl2.mask import from_surface except: pass class Sprite(object): """simple base class for visible game objects pygame.sprite.Sprite(*groups): return Sprite The base class for visible game objects. Derived classes will want to override the Sprite.update() method and assign Sprite.image and Sprite.rect attributes. The initializer can accept any number of Group instances that the Sprite will become a member of. When subclassing the Sprite class, be sure to call the base initializer before adding the Sprite to Groups. """ def __init__(self, *groups): self.__g = {} # The groups the sprite is in if groups: self.add(*groups) def add(self, *groups): """add the sprite to groups Sprite.add(*groups): return None Any number of Group instances can be passed as arguments. The Sprite will be added to the Groups it is not already a member of. """ has = self.__g.__contains__ for group in groups: if hasattr(group, '_spritegroup'): if not has(group): group.add_internal(self) self.add_internal(group) else: self.add(*group) def remove(self, *groups): """remove the sprite from groups Sprite.remove(*groups): return None Any number of Group instances can be passed as arguments. The Sprite will be removed from the Groups it is currently a member of. """ has = self.__g.__contains__ for group in groups: if hasattr(group, '_spritegroup'): if has(group): group.remove_internal(self) self.remove_internal(group) else: self.remove(*group) def add_internal(self, group): self.__g[group] = 0 def remove_internal(self, group): del self.__g[group] def update(self, *args): """method to control sprite behavior Sprite.update(*args): The default implementation of this method does nothing; it's just a convenient "hook" that you can override. This method is called by Group.update() with whatever arguments you give it. There is no need to use this method if not using the convenience method by the same name in the Group class. """ pass def kill(self): """remove the Sprite from all Groups Sprite.kill(): return None The Sprite is removed from all the Groups that contain it. This won't change anything about the state of the Sprite. It is possible to continue to use the Sprite after this method has been called, including adding it to Groups. """ for c in self.__g: c.remove_internal(self) self.__g.clear() def groups(self): """list of Groups that contain this Sprite Sprite.groups(): return group_list Returns a list of all the Groups that contain this Sprite. """ return list(self.__g) def alive(self): """does the sprite belong to any groups Sprite.alive(): return bool Returns True when the Sprite belongs to one or more Groups. """ return truth(self.__g) def __repr__(self): return "<%s sprite(in %d groups)>" % (self.__class__.__name__, len(self.__g)) class DirtySprite(Sprite): """a more featureful subclass of Sprite with more attributes pygame.sprite.DirtySprite(*groups): return DirtySprite Extra DirtySprite attributes with their default values: dirty = 1 If set to 1, it is repainted and then set to 0 again. If set to 2, it is always dirty (repainted each frame; flag is not reset). If set to 0, it is not dirty and therefore not repainted again. blendmode = 0 It's the special_flags argument of Surface.blit; see the blendmodes in the Surface.blit documentation source_rect = None This is the source rect to use. Remember that it is relative to the top left corner (0, 0) of self.image. visible = 1 Normally this is 1. If set to 0, it will not be repainted. (If you change visible to 1, you must set dirty to 1 for it to be erased from the screen.) _layer = 0 A READ ONLY value, it is read when adding it to the LayeredUpdates group. For details see documentation of sprite.LayeredUpdates. """ def __init__(self, *groups): self.dirty = 1 self.blendmode = 0 # pygame 1.8, referred to as special_flags in # the documentation of Surface.blit self._visible = 1 self._layer = 0 # READ ONLY by LayeredUpdates or LayeredDirty self.source_rect = None Sprite.__init__(self, *groups) def _set_visible(self, val): """set the visible value (0 or 1) and makes the sprite dirty""" self._visible = val if self.dirty < 2: self.dirty = 1 def _get_visible(self): """return the visible value of that sprite""" return self._visible visible = property(lambda self: self._get_visible(), lambda self, value: self._set_visible(value), doc="you can make this sprite disappear without " "removing it from the group,\n" "assign 0 for invisible and 1 for visible") def __repr__(self): return "<%s DirtySprite(in %d groups)>" % \ (self.__class__.__name__, len(self.groups())) class AbstractGroup(object): """base class for containers of sprites AbstractGroup does everything needed to behave as a normal group. You can easily subclass a new group class from this or the other groups below if you want to add more features. Any AbstractGroup-derived sprite groups act like sequences and support iteration, len, and so on. """ # dummy val to identify sprite groups, and avoid infinite recursion _spritegroup = True def __init__(self): self.spritedict = {} self.lostsprites = [] def sprites(self): """get a list of sprites in the group Group.sprite(): return list Returns an object that can be looped over with a 'for' loop. (For now, it is always a list, but this could change in a future version of pygame.) Alternatively, you can get the same information by iterating directly over the sprite group, e.g. 'for sprite in group'. """ return list(self.spritedict) def add_internal(self, sprite): self.spritedict[sprite] = 0 def remove_internal(self, sprite): r = self.spritedict[sprite] if r: self.lostsprites.append(r) del self.spritedict[sprite] def has_internal(self, sprite): return sprite in self.spritedict def copy(self): """copy a group with all the same sprites Group.copy(): return Group Returns a copy of the group that is an instance of the same class and has the same sprites in it. """ return self.__class__(self.sprites()) def __iter__(self): return iter(self.sprites()) def __contains__(self, sprite): return self.has(sprite) def add(self, *sprites): """add sprite(s) to group Group.add(sprite, list, group, ...): return None Adds a sprite or sequence of sprites to a group. """ for sprite in sprites: # It's possible that some sprite is also an iterator. # If this is the case, we should add the sprite itself, # and not the iterator object. if isinstance(sprite, Sprite): if not self.has_internal(sprite): self.add_internal(sprite) sprite.add_internal(self) else: try: # See if sprite is an iterator, like a list or sprite # group. self.add(*sprite) except (TypeError, AttributeError): # Not iterable. This is probably a sprite that is not an # instance of the Sprite class or is not an instance of a # subclass of the Sprite class. Alternately, it could be an # old-style sprite group. if hasattr(sprite, '_spritegroup'): for spr in sprite.sprites(): if not self.has_internal(spr): self.add_internal(spr) spr.add_internal(self) elif not self.has_internal(sprite): self.add_internal(sprite) sprite.add_internal(self) def remove(self, *sprites): """remove sprite(s) from group Group.remove(sprite, list, or group, ...): return None Removes a sprite or sequence of sprites from a group. """ # This function behaves essentially the same as Group.add. It first # tries to handle each argument as an instance of the Sprite class. If # that failes, then it tries to handle the argument as an iterable # object. If that failes, then it tries to handle the argument as an # old-style sprite group. Lastly, if that fails, it assumes that the # normal Sprite methods should be used. for sprite in sprites: if isinstance(sprite, Sprite): if self.has_internal(sprite): self.remove_internal(sprite) sprite.remove_internal(self) else: try: self.remove(*sprite) except (TypeError, AttributeError): if hasattr(sprite, '_spritegroup'): for spr in sprite.sprites(): if self.has_internal(spr): self.remove_internal(spr) spr.remove_internal(self) elif self.has_internal(sprite): self.remove_internal(sprite) sprite.remove_internal(self) def has(self, *sprites): """ask if group has a sprite or sprites Group.has(sprite or group, ...): return bool Returns True if the given sprite or sprites are contained in the group. Alternatively, you can get the same information using the 'in' operator, e.g. 'sprite in group', 'subgroup in group'. """ return_value = False for sprite in sprites: if isinstance(sprite, Sprite): # Check for Sprite instance's membership in this group if self.has_internal(sprite): return_value = True else: return False else: try: if self.has(*sprite): return_value = True else: return False except (TypeError, AttributeError): if hasattr(sprite, '_spritegroup'): for spr in sprite.sprites(): if self.has_internal(spr): return_value = True else: return False else: if self.has_internal(sprite): return_value = True else: return False return return_value def update(self, *args): """call the update method of every member sprite Group.update(*args): return None Calls the update method of every member sprite. All arguments that were passed to this method are passed to the Sprite update function. """ for s in self.sprites(): s.update(*args) def draw(self, surface): """draw all sprites onto the surface Group.draw(surface): return None Draws all of the member sprites onto the given surface. """ sprites = self.sprites() surface_blit = surface.blit for spr in sprites: self.spritedict[spr] = surface_blit(spr.image, spr.rect) self.lostsprites = [] def clear(self, surface, bgd): """erase the previous position of all sprites Group.clear(surface, bgd): return None Clears the area under every drawn sprite in the group. The bgd argument should be Surface which is the same dimensions as the screen surface. The bgd could also be a function which accepts the given surface and the area to be cleared as arguments. """ if callable(bgd): for r in self.lostsprites: bgd(surface, r) for r in self.spritedict.values(): if r: bgd(surface, r) else: surface_blit = surface.blit for r in self.lostsprites: surface_blit(bgd, r, r) for r in self.spritedict.values(): if r: surface_blit(bgd, r, r) def empty(self): """remove all sprites Group.empty(): return None Removes all the sprites from the group. """ for s in self.sprites(): self.remove_internal(s) s.remove_internal(self) def __nonzero__(self): return truth(self.sprites()) def __len__(self): """return number of sprites in group Group.len(group): return int Returns the number of sprites contained in the group. """ return len(self.sprites()) def __repr__(self): return "<%s(%d sprites)>" % (self.__class__.__name__, len(self)) class Group(AbstractGroup): """container class for many Sprites pygame.sprite.Group(*sprites): return Group A simple container for Sprite objects. This class can be subclassed to create containers with more specific behaviors. The constructor takes any number of Sprite arguments to add to the Group. The group supports the following standard Python operations: in test if a Sprite is contained len the number of Sprites contained bool test if any Sprites are contained iter iterate through all the Sprites The Sprites in the Group are not ordered, so the Sprites are drawn and iterated over in no particular order. """ def __init__(self, *sprites): AbstractGroup.__init__(self) self.add(*sprites) RenderPlain = Group RenderClear = Group class RenderUpdates(Group): """Group class that tracks dirty updates pygame.sprite.RenderUpdates(*sprites): return RenderUpdates This class is derived from pygame.sprite.Group(). It has an enhanced draw method that tracks the changed areas of the screen. """ def draw(self, surface): spritedict = self.spritedict surface_blit = surface.blit dirty = self.lostsprites self.lostsprites = [] dirty_append = dirty.append for s in self.sprites(): r = spritedict[s] newrect = surface_blit(s.image, s.rect) if r: if newrect.colliderect(r): dirty_append(newrect.union(r)) else: dirty_append(newrect) dirty_append(r) else: dirty_append(newrect) spritedict[s] = newrect return dirty class OrderedUpdates(RenderUpdates): """RenderUpdates class that draws Sprites in order of addition pygame.sprite.OrderedUpdates(*spites): return OrderedUpdates This class derives from pygame.sprite.RenderUpdates(). It maintains the order in which the Sprites were added to the Group for rendering. This makes adding and removing Sprites from the Group a little slower than regular Groups. """ def __init__(self, *sprites): self._spritelist = [] RenderUpdates.__init__(self, *sprites) def sprites(self): return list(self._spritelist) def add_internal(self, sprite): RenderUpdates.add_internal(self, sprite) self._spritelist.append(sprite) def remove_internal(self, sprite): RenderUpdates.remove_internal(self, sprite) self._spritelist.remove(sprite) class LayeredUpdates(AbstractGroup): """LayeredUpdates Group handles layers, which are drawn like OrderedUpdates pygame.sprite.LayeredUpdates(*spites, **kwargs): return LayeredUpdates This group is fully compatible with pygame.sprite.Sprite. New in pygame 1.8.0 """ _init_rect = Rect(0, 0, 0, 0) def __init__(self, *sprites, **kwargs): """initialize an instance of LayeredUpdates with the given attributes You can set the default layer through kwargs using 'default_layer' and an integer for the layer. The default layer is 0. If the sprite you add has an attribute _layer, then that layer will be used. If **kwarg contains 'layer', then the passed sprites will be added to that layer (overriding the sprite._layer attribute). If neither the sprite nor **kwarg has a 'layer', then the default layer is used to add the sprites. """ self._spritelayers = {} self._spritelist = [] AbstractGroup.__init__(self) self._default_layer = kwargs.get('default_layer', 0) self.add(*sprites, **kwargs) def add_internal(self, sprite, layer=None): """Do not use this method directly. It is used by the group to add a sprite internally. """ self.spritedict[sprite] = self._init_rect if layer is None: try: layer = sprite._layer except AttributeError: layer = sprite._layer = self._default_layer elif hasattr(sprite, '_layer'): sprite._layer = layer sprites = self._spritelist # speedup sprites_layers = self._spritelayers sprites_layers[sprite] = layer # add the sprite at the right position # bisect algorithmus leng = len(sprites) low = mid = 0 high = leng - 1 while low <= high: mid = low + (high - low) // 2 if sprites_layers[sprites[mid]] <= layer: low = mid + 1 else: high = mid - 1 # linear search to find final position while mid < leng and sprites_layers[sprites[mid]] <= layer: mid += 1 sprites.insert(mid, sprite) def add(self, *sprites, **kwargs): """add a sprite or sequence of sprites to a group LayeredUpdates.add(*sprites, **kwargs): return None If the sprite you add has an attribute _layer, then that layer will be used. If **kwarg contains 'layer', then the passed sprites will be added to that layer (overriding the sprite._layer attribute). If neither the sprite nor **kwarg has a 'layer', then the default layer is used to add the sprites. """ if not sprites: return if 'layer' in kwargs: layer = kwargs['layer'] else: layer = None for sprite in sprites: # It's possible that some sprite is also an iterator. # If this is the case, we should add the sprite itself, # and not the iterator object. if isinstance(sprite, Sprite): if not self.has_internal(sprite): self.add_internal(sprite, layer) sprite.add_internal(self) else: try: # See if sprite is an iterator, like a list or sprite # group. self.add(*sprite, **kwargs) except (TypeError, AttributeError): # Not iterable. This is probably a sprite that is not an # instance of the Sprite class or is not an instance of a # subclass of the Sprite class. Alternately, it could be an # old-style sprite group. if hasattr(sprite, '_spritegroup'): for spr in sprite.sprites(): if not self.has_internal(spr): self.add_internal(spr, layer) spr.add_internal(self) elif not self.has_internal(sprite): self.add_internal(sprite, layer) sprite.add_internal(self) def remove_internal(self, sprite): """Do not use this method directly. The group uses it to add a sprite. """ self._spritelist.remove(sprite) # these dirty rects are suboptimal for one frame r = self.spritedict[sprite] if r is not self._init_rect: self.lostsprites.append(r) # dirty rect if hasattr(sprite, 'rect'): self.lostsprites.append(sprite.rect) # dirty rect del self.spritedict[sprite] del self._spritelayers[sprite] def sprites(self): """return a ordered list of sprites (first back, last top). LayeredUpdates.sprites(): return sprites """ return list(self._spritelist) def draw(self, surface): """draw all sprites in the right order onto the passed surface LayeredUpdates.draw(surface): return Rect_list """ spritedict = self.spritedict surface_blit = surface.blit dirty = self.lostsprites self.lostsprites = [] dirty_append = dirty.append init_rect = self._init_rect for spr in self.sprites(): rec = spritedict[spr] newrect = surface_blit(spr.image, spr.rect) if rec is init_rect: dirty_append(newrect) else: if newrect.colliderect(rec): dirty_append(newrect.union(rec)) else: dirty_append(newrect) dirty_append(rec) spritedict[spr] = newrect return dirty def get_sprites_at(self, pos): """return a list with all sprites at that position LayeredUpdates.get_sprites_at(pos): return colliding_sprites Bottom sprites are listed first; the top ones are listed last. """ _sprites = self._spritelist rect = Rect(pos, (0, 0)) colliding_idx = rect.collidelistall([sprite.rect for sprite in _sprites]) colliding = [_sprites[i] for i in colliding_idx] return colliding def get_sprite(self, idx): """return the sprite at the index idx from the groups sprites LayeredUpdates.get_sprite(idx): return sprite Raises IndexOutOfBounds if the idx is not within range. """ return self._spritelist[idx] def remove_sprites_of_layer(self, layer_nr): """remove all sprites from a layer and return them as a list LayeredUpdates.remove_sprites_of_layer(layer_nr): return sprites """ sprites = self.get_sprites_from_layer(layer_nr) self.remove(*sprites) return sprites #---# layer methods def layers(self): """return a list of unique defined layers defined. LayeredUpdates.layers(): return layers """ return sorted(set(self._spritelayers.values())) def change_layer(self, sprite, new_layer): """change the layer of the sprite LayeredUpdates.change_layer(sprite, new_layer): return None The sprite must have been added to the renderer already. This is not checked. """ sprites = self._spritelist # speedup sprites_layers = self._spritelayers # speedup sprites.remove(sprite) sprites_layers.pop(sprite) # add the sprite at the right position # bisect algorithmus leng = len(sprites) low = mid = 0 high = leng - 1 while low <= high: mid = low + (high - low) // 2 if sprites_layers[sprites[mid]] <= new_layer: low = mid + 1 else: high = mid - 1 # linear search to find final position while mid < leng and sprites_layers[sprites[mid]] <= new_layer: mid += 1 sprites.insert(mid, sprite) if hasattr(sprite, 'layer'): sprite.layer = new_layer # add layer info sprites_layers[sprite] = new_layer def get_layer_of_sprite(self, sprite): """return the layer that sprite is currently in If the sprite is not found, then it will return the default layer. """ return self._spritelayers.get(sprite, self._default_layer) def get_top_layer(self): """return the top layer LayeredUpdates.get_top_layer(): return layer """ return self._spritelayers[self._spritelist[-1]] def get_bottom_layer(self): """return the bottom layer LayeredUpdates.get_bottom_layer(): return layer """ return self._spritelayers[self._spritelist[0]] def move_to_front(self, sprite): """bring the sprite to front layer LayeredUpdates.move_to_front(sprite): return None Brings the sprite to front by changing the sprite layer to the top-most layer. The sprite is added at the end of the list of sprites in that top-most layer. """ self.change_layer(sprite, self.get_top_layer()) def move_to_back(self, sprite): """move the sprite to the bottom layer LayeredUpdates.move_to_back(sprite): return None Moves the sprite to the bottom layer by moving it to a new layer below the current bottom layer. """ self.change_layer(sprite, self.get_bottom_layer() - 1) def get_top_sprite(self): """return the topmost sprite LayeredUpdates.get_top_sprite(): return Sprite """ return self._spritelist[-1] def get_sprites_from_layer(self, layer): """return all sprites from a layer ordered as they where added LayeredUpdates.get_sprites_from_layer(layer): return sprites Returns all sprites from a layer. The sprites are ordered in the sequence that they where added. (The sprites are not removed from the layer. """ sprites = [] sprites_append = sprites.append sprite_layers = self._spritelayers for spr in self._spritelist: if sprite_layers[spr] == layer: sprites_append(spr) elif sprite_layers[spr] > layer:# break after because no other will # follow with same layer break return sprites def switch_layer(self, layer1_nr, layer2_nr): """switch the sprites from layer1_nr to layer2_nr LayeredUpdates.switch_layer(layer1_nr, layer2_nr): return None The layers number must exist. This method does not check for the existence of the given layers. """ sprites1 = self.remove_sprites_of_layer(layer1_nr) for spr in self.get_sprites_from_layer(layer2_nr): self.change_layer(spr, layer1_nr) self.add(layer=layer2_nr, *sprites1) class LayeredDirty(LayeredUpdates): """LayeredDirty Group is for DirtySprites; subclasses LayeredUpdates pygame.sprite.LayeredDirty(*spites, **kwargs): return LayeredDirty This group requires pygame.sprite.DirtySprite or any sprite that has the following attributes: image, rect, dirty, visible, blendmode (see doc of DirtySprite). It uses the dirty flag technique and is therefore faster than pygame.sprite.RenderUpdates if you have many static sprites. It also switches automatically between dirty rect updating and full screen drawing, so you do no have to worry which would be faster. As with the pygame.sprite.Group, you can specify some additional attributes through kwargs: _use_update: True/False (default is False) _default_layer: default layer where the sprites without a layer are added _time_threshold: treshold time for switching between dirty rect mode and fullscreen mode; defaults to updating at 80 frames per second, which is equal to 1000.0 / 80.0 New in pygame 1.8.0 """ def __init__(self, *sprites, **kwargs): """initialize group. pygame.sprite.LayeredDirty(*spites, **kwargs): return LayeredDirty You can specify some additional attributes through kwargs: _use_update: True/False (default is False) _default_layer: default layer where the sprites without a layer are added _time_threshold: treshold time for switching between dirty rect mode and fullscreen mode; defaults to updating at 80 frames per second, which is equal to 1000.0 / 80.0 """ LayeredUpdates.__init__(self, *sprites, **kwargs) self._clip = None self._use_update = False self._time_threshold = 1000.0 / 80.0 # 1000.0 / fps self._bgd = None for key, val in kwargs.items(): if key in ['_use_update', '_time_threshold', '_default_layer']: if hasattr(self, key): setattr(self, key, val) def add_internal(self, sprite, layer=None): """Do not use this method directly. It is used by the group to add a sprite internally. """ # check if all needed attributes are set if not hasattr(sprite, 'dirty'): raise AttributeError() if not hasattr(sprite, 'visible'): raise AttributeError() if not hasattr(sprite, 'blendmode'): raise AttributeError() if not isinstance(sprite, DirtySprite): raise TypeError() if sprite.dirty == 0: # set it dirty if it is not sprite.dirty = 1 LayeredUpdates.add_internal(self, sprite, layer) def draw(self, surface, bgd=None): """draw all sprites in the right order onto the given surface LayeredDirty.draw(surface, bgd=None): return Rect_list You can pass the background too. If a self.bgd is already set to some value that is not None, then the bgd argument has no effect. """ # speedups _orig_clip = surface.get_clip() _clip = self._clip if _clip is None: _clip = _orig_clip _surf = surface _sprites = self._spritelist _old_rect = self.spritedict _update = self.lostsprites _update_append = _update.append _ret = None _surf_blit = _surf.blit _rect = Rect if bgd is not None: self._bgd = bgd _bgd = self._bgd init_rect = self._init_rect _surf.set_clip(_clip) # ------- # 0. decide whether to render with update or flip start_time = get_ticks() if self._use_update: # dirty rects mode # 1. find dirty area on screen and put the rects into _update # still not happy with that part for spr in _sprites: if 0 < spr.dirty: # chose the right rect if spr.source_rect: _union_rect = _rect(spr.rect.topleft, spr.source_rect.size) else: _union_rect = _rect(spr.rect) _union_rect_collidelist = _union_rect.collidelist _union_rect_union_ip = _union_rect.union_ip i = _union_rect_collidelist(_update) while -1 < i: _union_rect_union_ip(_update[i]) del _update[i] i = _union_rect_collidelist(_update) _update_append(_union_rect.clip(_clip)) if _old_rect[spr] is not init_rect: _union_rect = _rect(_old_rect[spr]) _union_rect_collidelist = _union_rect.collidelist _union_rect_union_ip = _union_rect.union_ip i = _union_rect_collidelist(_update) while -1 < i: _union_rect_union_ip(_update[i]) del _update[i] i = _union_rect_collidelist(_update) _update_append(_union_rect.clip(_clip)) # can it be done better? because that is an O(n**2) algorithm in # worst case # clear using background if _bgd is not None: for rec in _update: _surf_blit(_bgd, rec, rec) # 2. draw for spr in _sprites: if 1 > spr.dirty: if spr._visible: # sprite not dirty; blit only the intersecting part _spr_rect = spr.rect if spr.source_rect is not None: _spr_rect = Rect(spr.rect.topleft, spr.source_rect.size) _spr_rect_clip = _spr_rect.clip for idx in _spr_rect.collidelistall(_update): # clip clip = _spr_rect_clip(_update[idx]) _surf_blit(spr.image, clip, (clip[0] - _spr_rect[0], clip[1] - _spr_rect[1], clip[2], clip[3]), spr.blendmode) else: # dirty sprite if spr._visible: _old_rect[spr] = _surf_blit(spr.image, spr.rect, spr.source_rect, spr.blendmode) if spr.dirty == 1: spr.dirty = 0 _ret = list(_update) else: # flip, full screen mode if _bgd is not None: _surf_blit(_bgd, (0, 0)) for spr in _sprites: if spr._visible: _old_rect[spr] = _surf_blit(spr.image, spr.rect, spr.source_rect, spr.blendmode) _ret = [_rect(_clip)] # return only the part of the screen changed # timing for switching modes # How may a good threshold be found? It depends on the hardware. end_time = get_ticks() if end_time-start_time > self._time_threshold: self._use_update = False else: self._use_update = True ## # debug ## print " check: using dirty rects:", self._use_update # emtpy dirty rects list _update[:] = [] # ------- # restore original clip _surf.set_clip(_orig_clip) return _ret def clear(self, surface, bgd): """use to set background Group.clear(surface, bgd): return None """ self._bgd = bgd def repaint_rect(self, screen_rect): """repaint the given area LayeredDirty.repaint_rect(screen_rect): return None screen_rect is in screen coordinates. """ if self._clip: self.lostsprites.append(screen_rect.clip(self._clip)) else: self.lostsprites.append(Rect(screen_rect)) def set_clip(self, screen_rect=None): """clip the area where to draw; pass None (default) to reset the clip LayeredDirty.set_clip(screen_rect=None): return None """ if screen_rect is None: self._clip = pygame_sdl2.display.get_surface().get_rect() else: self._clip = screen_rect self._use_update = False def get_clip(self): """get the area where drawing will occur LayeredDirty.get_clip(): return Rect """ return self._clip def change_layer(self, sprite, new_layer): """change the layer of the sprite LayeredUpdates.change_layer(sprite, new_layer): return None The sprite must have been added to the renderer already. This is not checked. """ LayeredUpdates.change_layer(self, sprite, new_layer) if sprite.dirty == 0: sprite.dirty = 1 def set_timing_treshold(self, time_ms): """set the treshold in milliseconds set_timing_treshold(time_ms): return None Defaults to 1000.0 / 80.0. This means that the screen will be painted using the flip method rather than the update method if the update method is taking so long to update the screen that the frame rate falls below 80 frames per second. """ self._time_threshold = time_ms class GroupSingle(AbstractGroup): """A group container that holds a single most recent item. This class works just like a regular group, but it only keeps a single sprite in the group. Whatever sprite has been added to the group last will be the only sprite in the group. You can access its one sprite as the .sprite attribute. Assigning to this attribute will properly remove the old sprite and then add the new one. """ def __init__(self, sprite=None): AbstractGroup.__init__(self) self.__sprite = None if sprite is not None: self.add(sprite) def copy(self): return GroupSingle(self.__sprite) def sprites(self): if self.__sprite is not None: return [self.__sprite] else: return [] def add_internal(self, sprite): if self.__sprite is not None: self.__sprite.remove_internal(self) self.remove_internal(self.__sprite) self.__sprite = sprite def __nonzero__(self): return self.__sprite is not None def _get_sprite(self): return self.__sprite def _set_sprite(self, sprite): self.add_internal(sprite) sprite.add_internal(self) return sprite sprite = property(_get_sprite, _set_sprite, None, "The sprite contained in this group") def remove_internal(self, sprite): if sprite is self.__sprite: self.__sprite = None if sprite in self.spritedict: AbstractGroup.remove_internal(self, sprite) def has_internal(self, sprite): return self.__sprite is sprite # Optimizations... def __contains__(self, sprite): return self.__sprite is sprite # Some different collision detection functions that could be used. def collide_rect(left, right): """collision detection between two sprites, using rects. pygame.sprite.collide_rect(left, right): return bool Tests for collision between two sprites. Uses the pygame.Rect colliderect function to calculate the collision. It is intended to be passed as a collided callback function to the *collide functions. Sprites must have "rect" attributes. New in pygame 1.8.0 """ return left.rect.colliderect(right.rect) class collide_rect_ratio: """A callable class that checks for collisions using scaled rects The class checks for collisions between two sprites using a scaled version of the sprites' rects. Is created with a ratio; the instance is then intended to be passed as a collided callback function to the *collide functions. New in pygame 1.8.1 """ def __init__(self, ratio): """create a new collide_rect_ratio callable Ratio is expected to be a floating point value used to scale the underlying sprite rect before checking for collisions. """ self.ratio = ratio def __call__(self, left, right): """detect collision between two sprites using scaled rects pygame.sprite.collide_rect_ratio(ratio)(left, right): return bool Tests for collision between two sprites. Uses the pygame.Rect colliderect function to calculate the collision after scaling the rects by the stored ratio. Sprites must have "rect" attributes. """ ratio = self.ratio leftrect = left.rect width = leftrect.width height = leftrect.height leftrect = leftrect.inflate(width * ratio - width, height * ratio - height) rightrect = right.rect width = rightrect.width height = rightrect.height rightrect = rightrect.inflate(width * ratio - width, height * ratio - height) return leftrect.colliderect(rightrect) def collide_circle(left, right): """detect collision between two sprites using circles pygame.sprite.collide_circle(left, right): return bool Tests for collision between two sprites by testing whether two circles centered on the sprites overlap. If the sprites have a "radius" attribute, then that radius is used to create the circle; otherwise, a circle is created that is big enough to completely enclose the sprite's rect as given by the "rect" attribute. This function is intended to be passed as a collided callback function to the *collide functions. Sprites must have a "rect" and an optional "radius" attribute. New in pygame 1.8.0 """ xdistance = left.rect.centerx - right.rect.centerx ydistance = left.rect.centery - right.rect.centery distancesquared = xdistance ** 2 + ydistance ** 2 if hasattr(left, 'radius'): leftradius = left.radius else: leftrect = left.rect # approximating the radius of a square by using half of the diagonal, # might give false positives (especially if its a long small rect) leftradius = 0.5 * ((leftrect.width ** 2 + leftrect.height ** 2) ** 0.5) # store the radius on the sprite for next time setattr(left, 'radius', leftradius) if hasattr(right, 'radius'): rightradius = right.radius else: rightrect = right.rect # approximating the radius of a square by using half of the diagonal # might give false positives (especially if its a long small rect) rightradius = 0.5 * ((rightrect.width ** 2 + rightrect.height ** 2) ** 0.5) # store the radius on the sprite for next time setattr(right, 'radius', rightradius) return distancesquared <= (leftradius + rightradius) ** 2 class collide_circle_ratio(object): """detect collision between two sprites using scaled circles This callable class checks for collisions between two sprites using a scaled version of a sprite's radius. It is created with a ratio as the argument to the constructor. The instance is then intended to be passed as a collided callback function to the *collide functions. New in pygame 1.8.1 """ def __init__(self, ratio): """creates a new collide_circle_ratio callable instance The given ratio is expected to be a floating point value used to scale the underlying sprite radius before checking for collisions. When the ratio is ratio=1.0, then it behaves exactly like the collide_circle method. """ self.ratio = ratio def __call__(self, left, right): """detect collision between two sprites using scaled circles pygame.sprite.collide_circle_radio(ratio)(left, right): return bool Tests for collision between two sprites by testing whether two circles centered on the sprites overlap after scaling the circle's radius by the stored ratio. If the sprites have a "radius" attribute, that is used to create the circle; otherwise, a circle is created that is big enough to completely enclose the sprite's rect as given by the "rect" attribute. Intended to be passed as a collided callback function to the *collide functions. Sprites must have a "rect" and an optional "radius" attribute. """ ratio = self.ratio xdistance = left.rect.centerx - right.rect.centerx ydistance = left.rect.centery - right.rect.centery distancesquared = xdistance ** 2 + ydistance ** 2 if hasattr(left, "radius"): leftradius = left.radius * ratio else: leftrect = left.rect leftradius = ratio * 0.5 * ((leftrect.width ** 2 + leftrect.height ** 2) ** 0.5) # store the radius on the sprite for next time setattr(left, 'radius', leftradius) if hasattr(right, "radius"): rightradius = right.radius * ratio else: rightrect = right.rect rightradius = ratio * 0.5 * ((rightrect.width ** 2 + rightrect.height ** 2) ** 0.5) # store the radius on the sprite for next time setattr(right, 'radius', rightradius) return distancesquared <= (leftradius + rightradius) ** 2 def collide_mask(left, right): """collision detection between two sprites, using masks. pygame.sprite.collide_mask(SpriteLeft, SpriteRight): bool Tests for collision between two sprites by testing if their bitmasks overlap. If the sprites have a "mask" attribute, that is used as the mask; otherwise, a mask is created from the sprite image. Intended to be passed as a collided callback function to the *collide functions. Sprites must have a "rect" and an optional "mask" attribute. New in pygame 1.8.0 """ xoffset = right.rect[0] - left.rect[0] yoffset = right.rect[1] - left.rect[1] try: leftmask = left.mask except AttributeError: leftmask = from_surface(left.image) try: rightmask = right.mask except AttributeError: rightmask = from_surface(right.image) return leftmask.overlap(rightmask, (xoffset, yoffset)) def spritecollide(sprite, group, dokill, collided=None): """find Sprites in a Group that intersect another Sprite pygame.sprite.spritecollide(sprite, group, dokill, collided=None): return Sprite_list Return a list containing all Sprites in a Group that intersect with another Sprite. Intersection is determined by comparing the Sprite.rect attribute of each Sprite. The dokill argument is a bool. If set to True, all Sprites that collide will be removed from the Group. The collided argument is a callback function used to calculate if two sprites are colliding. it should take two sprites as values, and return a bool value indicating if they are colliding. If collided is not passed, all sprites must have a "rect" value, which is a rectangle of the sprite area, which will be used to calculate the collision. """ if dokill: crashed = [] append = crashed.append if collided: for s in group.sprites(): if collided(sprite, s): s.kill() append(s) else: spritecollide = sprite.rect.colliderect for s in group.sprites(): if spritecollide(s.rect): s.kill() append(s) return crashed elif collided: return [s for s in group if collided(sprite, s)] else: spritecollide = sprite.rect.colliderect return [s for s in group if spritecollide(s.rect)] def groupcollide(groupa, groupb, dokilla, dokillb, collided=None): """detect collision between a group and another group pygame.sprite.groupcollide(groupa, groupb, dokilla, dokillb): return dict Given two groups, this will find the intersections between all sprites in each group. It returns a dictionary of all sprites in the first group that collide. The value for each item in the dictionary is a list of the sprites in the second group it collides with. The two dokill arguments control if the sprites from either group will be automatically removed from all groups. Collided is a callback function used to calculate if two sprites are colliding. it should take two sprites as values, and return a bool value indicating if they are colliding. If collided is not passed, all sprites must have a "rect" value, which is a rectangle of the sprite area that will be used to calculate the collision. """ crashed = {} SC = spritecollide if dokilla: for s in groupa.sprites(): c = SC(s, groupb, dokillb, collided) if c: crashed[s] = c s.kill() else: for s in groupa: c = SC(s, groupb, dokillb, collided) if c: crashed[s] = c return crashed def spritecollideany(sprite, group, collided=None): """finds any sprites in a group that collide with the given sprite pygame.sprite.spritecollideany(sprite, group): return sprite Given a sprite and a group of sprites, this will return return any single sprite that collides with with the given sprite. If there are no collisions, then this returns None. If you don't need all the features of the spritecollide function, this function will be a bit quicker. Collided is a callback function used to calculate if two sprites are colliding. It should take two sprites as values and return a bool value indicating if they are colliding. If collided is not passed, then all sprites must have a "rect" value, which is a rectangle of the sprite area, which will be used to calculate the collision. """ if collided: for s in group: if collided(sprite, s): return s else: # Special case old behaviour for speed. spritecollide = sprite.rect.colliderect for s in group: if spritecollide(s.rect): return s return None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1455264087.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/surface.pxd0000664000175000017500000000354512657310527021045 0ustar00tomtom# Copyright 2014 Patrick Dawson # Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport SDL_Surface cdef class Surface: # Allow weak references. cdef object __weakref__ # The SDL surface that corresponds to this surface. cdef SDL_Surface* surface # True if we own our surface. False if some other Surface owns our # surface. cdef bint owns_surface # True if this surface is owned by a window. cdef bint window_surface # A list of locks involving the surface. cdef object locklist # If this surface is a subsurface, the surface this surface is a subsurface # of. cdef Surface parent # If this surface has no parent, self. Otherwise, self.parent.root. The # ultimate parent. cdef Surface root # The offset of this surface within its parent. cdef int offset_x cdef int offset_y # If not None, a function that returns the window flags. cdef object get_window_flags cdef void take_surface(self, SDL_Surface *) cdef bint has_alpha ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740708525.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/surface.pyx0000664000175000017500000005605414760215255021074 0ustar00tomtom# Copyright 2014 Patrick Dawson # Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from libc.string cimport memmove from sdl2 cimport * from pygame_sdl2.color cimport map_color, get_color from pygame_sdl2.rect cimport to_sdl_rect from pygame_sdl2.rect import Rect from pygame_sdl2.error import error from pygame_sdl2.locals import SRCALPHA import pygame_sdl2 import warnings cdef extern from "src/surface.h" nogil: int pygame_Blit (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args); cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) noexcept nogil: if src < dst: src += (h - 1) * srcpitch; dst += (h - 1) * dstpitch; srcpitch = -srcpitch; dstpitch = -dstpitch; while h: h -= 1 memmove(dst, src, span); src += srcpitch; dst += dstpitch; # The total size of all allocated surfaces total_size = 0 cdef class Surface: def __cinit__(self): self.surface = NULL self.owns_surface = False self.window_surface = False self.has_alpha = False def __dealloc__(self): global total_size if self.surface and self.owns_surface: if total_size: total_size -= self.surface.pitch * self.surface.h SDL_FreeSurface(self.surface) return elif self.window_surface: return elif self.parent: SDL_FreeSurface(self.surface) return warnings.warn("Memory leak via Surface in pygame_sdl2.") def __sizeof__(self): if self.surface and self.owns_surface: return self.surface.pitch * self.surface.h else: return 0 def __init__(self, size, flags=0, depth=32, masks=None): self.locklist = None self.parent = None self.offset_x = 0 self.offset_y = 0 self.get_window_flags = None # When size is an empty tuple, we do not create a surface, and # expect our caller to set this object up. if size == (): return cdef int w cdef int h w, h = size assert w >= 0 assert h >= 0 cdef Uint32 Rmask, Gmask, Bmask, Amask cdef SDL_Surface *sample cdef Surface pysample cdef int depth_int if masks is not None: Rmask, Gmask, Bmask, Amask = masks depth_int = depth elif isinstance(depth, Surface): pysample = depth sample = pysample.surface Rmask = sample.format.Rmask Gmask = sample.format.Gmask Bmask = sample.format.Bmask Amask = sample.format.Amask depth_int = sample.format.BitsPerPixel else: pysample = pygame_sdl2.display.get_surface() if pysample and pysample.surface.format.BitsPerPixel == 32: sample = pysample.surface Rmask = sample.format.Rmask Gmask = sample.format.Gmask Bmask = sample.format.Bmask Amask = sample.format.Amask else: # RGB(A) if SDL_BYTEORDER == SDL_BIG_ENDIAN: Rmask = 0xff000000 Gmask = 0x00ff0000 Bmask = 0x0000ff00 Amask = 0 else: Rmask = 0x000000ff Gmask = 0x0000ff00 Bmask = 0x00ff0000 Amask = 0 if (flags & SRCALPHA): if not Amask: Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) else: Amask = 0 depth_int = 32 cdef SDL_Surface *surface with nogil: surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) if not surface: raise error() self.take_surface(surface) cdef void take_surface(self, SDL_Surface *surface): if not surface: raise error("A null pointer was passed in.") self.surface = surface self.owns_surface = True global total_size total_size += self.surface.pitch * self.surface.h def __repr__(self): return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) def blit(self, Surface source, dest, area=None, int special_flags=0): cdef SDL_Rect dest_rect cdef SDL_Rect area_rect cdef SDL_Rect *area_ptr = NULL cdef Surface temp cdef int err cdef Uint32 key cdef Uint8 alpha cdef bint colorkey colorkey = (SDL_GetColorKey(source.surface, &key) == 0) if not source.surface.format.Amask: if SDL_GetSurfaceAlphaMod(source.surface, &alpha): raise error() if alpha != 255 and (self.surface.format.Amask or colorkey): if area: source = source.subsurface(area) area = None if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): raise error() temp = Surface(source.get_size(), SRCALPHA) with nogil: err = SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) if err: raise error() source = temp colorkey = False if colorkey: if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE): raise error() else: if SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND): raise error() to_sdl_rect(dest, &dest_rect, "dest") if area is not None: to_sdl_rect(area, &area_rect, "area") area_ptr = &area_rect with nogil: if source.surface.format.Amask or special_flags: err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) else: err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) if err: raise error() dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) return dirty.clip(self.get_rect()) def convert(self, surface=None): if not isinstance(surface, Surface): surface = pygame_sdl2.display.get_surface() cdef SDL_PixelFormat *sample_format if surface is None: sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRX8888) else: sample_format = ( surface).surface.format cdef Uint32 amask cdef Uint32 rmask cdef Uint32 gmask cdef Uint32 bmask cdef Uint32 pixel_format cdef SDL_Surface *new_surface # If the sample surface has alpha, use it. if not sample_format.Amask: use_format = sample_format with nogil: new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) if not new_surface: raise error() else: rmask = sample_format.Rmask gmask = sample_format.Gmask bmask = sample_format.Bmask amask = 0 pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) with nogil: new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) if not new_surface: raise error() cdef Surface rv = Surface(()) rv.take_surface(new_surface) return rv def convert_alpha(self, Surface surface=None): if surface is None: surface = pygame_sdl2.display.get_surface() cdef SDL_PixelFormat *sample_format if surface is None: sample_format = SDL_AllocFormat(SDL_PIXELFORMAT_BGRA8888) else: sample_format = ( surface).surface.format cdef Uint32 amask = 0xff000000 cdef Uint32 rmask = 0x00ff0000 cdef Uint32 gmask = 0x0000ff00 cdef Uint32 bmask = 0x000000ff cdef Uint32 pixel_format cdef SDL_Surface *new_surface # If the sample surface has alpha, use it. if sample_format.Amask: use_format = sample_format with nogil: new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) if not new_surface: raise error() else: if sample_format.BytesPerPixel == 4: rmask = sample_format.Rmask gmask = sample_format.Gmask bmask = sample_format.Bmask amask = 0xffffffff & ~(rmask | gmask | bmask) pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) with nogil: new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) if not new_surface: raise error() cdef Surface rv = Surface(()) rv.take_surface(new_surface) return rv def copy(self): if self.surface.format.Amask: return self.convert_alpha(self) else: return self.convert(self) def fill(self, color, rect=None, special_flags=0): cdef SDL_Rect sdl_rect cdef Uint32 pixel = map_color(self.surface, color) cdef int err if rect is not None: to_sdl_rect(rect, &sdl_rect) if sdl_rect.x < 0: sdl_rect.w = sdl_rect.w + sdl_rect.x sdl_rect.x = 0 if sdl_rect.y < 0: sdl_rect.w = sdl_rect.h + sdl_rect.y sdl_rect.y = 0 if sdl_rect.w <= 0 or sdl_rect.h <= 0: return Rect(0, 0, 0, 0) with nogil: err = SDL_FillRect(self.surface, &sdl_rect, pixel) if err: raise error() return Rect(sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) else: with nogil: err = SDL_FillRect(self.surface, NULL, pixel) if err: raise error() return Rect(0, 0, self.surface.w, self.surface.h) def scroll(self, int dx=0, int dy=0): cdef int srcx, destx, move_width cdef int srcy, desty, move_height cdef int width = self.surface.w cdef int height = self.surface.h cdef int per_pixel = self.surface.format.BytesPerPixel if dx >= 0: srcx = 0 destx = dx move_width = width - dx else: srcx = -dx destx = 0 move_width = width + dx if dy >= 0: srcy = 0 desty = dy move_height = height - dy else: srcy = -dy desty = 0 move_height = height + dy cdef Uint8 *srcptr = self.surface.pixels cdef Uint8 *destptr = self.surface.pixels srcptr += srcy * self.surface.pitch + srcx * per_pixel destptr += desty * self.surface.pitch + destx * per_pixel self.lock() with nogil: move_pixels( srcptr, destptr, move_height, move_width * per_pixel, self.surface.pitch, self.surface.pitch) self.unlock() def set_colorkey(self, color, flags=0): if color is None: if SDL_SetColorKey(self.surface, SDL_FALSE, 0): raise error() else: if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): raise error() def get_colorkey(self): cdef Uint32 key if SDL_GetColorKey(self.surface, &key): return None return get_color(key, self.surface) def set_alpha(self, value, flags=0): if value is None: value = 255 self.has_alpha = False else: self.has_alpha = True if SDL_SetSurfaceAlphaMod(self.surface, value): raise error() def get_alpha(self): cdef Uint8 rv if self.has_alpha or self.surface.format.Amask: if SDL_GetSurfaceAlphaMod(self.surface, &rv): raise error() return rv else: return None def lock(self, lock=None): cdef Surface root = self while root.parent: root = root.parent if lock is None: lock = self if root.locklist is None: root.locklist = [ ] root.locklist.append(lock) if SDL_LockSurface(root.surface): raise error() def unlock(self, lock=None): cdef Surface root = self while root.parent: root = root.parent if lock is None: lock = self if root.locklist is None: root.locklist = [ ] root.locklist.remove(lock) SDL_UnlockSurface(root.surface) def mustlock(self): cdef Surface root = self while root.parent: root = root.parent return SDL_MUSTLOCK(root.surface) def get_locked(self): if self.locklist: return True def get_locks(self): cdef Surface root = self while root.parent: root = root.parent if root.locklist is None: root.locklist = [ ] return root.locklist def get_at(self, pos): cdef int x, y cdef Uint8 *p x, y = pos if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): raise IndexError("Position outside surface.") if self.surface.format.BytesPerPixel != 4: raise error("Surface has unsupported bytesize.") self.lock() p = self.surface.pixels p += y * self.surface.pitch p += x * 4 cdef Uint32 pixel = ( p)[0] self.unlock() return get_color(pixel, self.surface) def set_at(self, pos, color): cdef int x, y cdef Uint8 *p cdef Uint32 pixel x, y = pos if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): raise ValueError("Position outside surface.") if self.surface.format.BytesPerPixel != 4: raise error("Surface has unsupported bytesize.") pixel = map_color(self.surface, color) self.lock() p = self.surface.pixels p += y * self.surface.pitch p += x * 4 ( p)[0] = pixel self.unlock() def get_at_mapped(self, pos): cdef int x, y cdef Uint8 *p x, y = pos if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): raise ValueError("Position outside surface.") if self.surface.format.BytesPerPixel != 4: raise error("Surface has unsupported bytesize.") self.lock() p = self.surface.pixels p += y * self.surface.pitch p += x * 4 cdef Uint32 pixel = ( p)[0] self.unlock() return pixel def map_rgb(self, color): return map_color(self.surface, color) def unmap_rgb(self, pixel): return get_color(pixel, self.surface) def set_clip(self, rect): cdef SDL_Rect sdl_rect if rect is None: SDL_SetClipRect(self.surface, NULL) else: to_sdl_rect(rect, &sdl_rect) SDL_SetClipRect(self.surface, &sdl_rect) def get_clip(self): cdef SDL_Rect sdl_rect SDL_GetClipRect(self.surface, &sdl_rect) return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) def subsurface(self, *args): cdef SDL_Rect sdl_rect if len(args) == 1: to_sdl_rect(args[0], &sdl_rect) else: to_sdl_rect(args, &sdl_rect) if sdl_rect.w < 0 or sdl_rect.h < 0: raise error("subsurface size must be non-negative.") if ((sdl_rect.x < 0) or (sdl_rect.y < 0) or (sdl_rect.x + sdl_rect.w > self.surface.w) or (sdl_rect.y + sdl_rect.h > self.surface.h)): raise error("subsurface rectangle outside surface area.") cdef Uint8 *pixels = self.surface.pixels pixels += sdl_rect.y * self.surface.pitch pixels += sdl_rect.x * self.surface.format.BytesPerPixel cdef SDL_Surface *new_surface = SDL_CreateRGBSurfaceFrom( pixels, sdl_rect.w, sdl_rect.h, self.surface.format.BitsPerPixel, self.surface.pitch, self.surface.format.Rmask, self.surface.format.Gmask, self.surface.format.Bmask, self.surface.format.Amask) if not new_surface: raise error() cdef Surface rv = Surface(()) rv.surface = new_surface rv.parent = self rv.offset_x = sdl_rect.x rv.offset_y = sdl_rect.y if self.has_alpha: rv.set_alpha(self.get_alpha()) return rv def get_parent(self): return self.parent def get_abs_parent(self): rv = self while rv.parent: rv = rv.parent return rv def get_offset(self): return (self.offset_x, self.offset_y) def get_abs_offset(self): cdef Surface surf = self cdef int offset_x = 0 cdef int offset_y = 0 while surf: offset_x += surf.offset_x offset_y += surf.offset_y surf = surf.parent return (offset_x, offset_y) def get_size(self): return self.surface.w, self.surface.h def get_width(self): return self.surface.w def get_height(self): return self.surface.h def get_rect(self, **kwargs): rv = Rect((0, 0, self.surface.w, self.surface.h)) for k, v in kwargs.items(): setattr(rv, k, v) return rv def get_bitsize(self): return self.surface.format.BitsPerPixel def get_bytesize(self): return self.surface.format.BytesPerPixel def get_flags(self): if self.get_window_flags: rv = self.get_window_flags() else: rv = 0 if self.surface.format.Amask or self.has_alpha: rv = rv | SRCALPHA return rv def get_pitch(self): return self.surface.pitch def get_masks(self): cdef SDL_PixelFormat *format = self.surface.format return (format.Rmask, format.Gmask, format.Bmask, format.Amask) def set_masks(self, masks): warnings.warn("Surface.set_masks is not supported.") def get_shifts(self): cdef SDL_PixelFormat *format = self.surface.format return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) def set_shifts(self, shifts): warnings.warn("Surface.set_shifts is not supported.") def get_shifts(self): cdef SDL_PixelFormat *format = self.surface.format return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) def get_losses(self): cdef SDL_PixelFormat *format = self.surface.format return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) def get_bounding_rect(self, min_alpha=1): cdef Uint32 amask = self.surface.format.Amask cdef Uint32 amin = (0x01010101 * min_alpha) & amask cdef int x cdef int y cdef int w cdef int h cdef int minx = self.surface.w - 1 cdef int maxx = 0 cdef int miny = self.surface.h - 1 cdef int maxy = 0 cdef Uint32 *row cdef Uint32 topleft cdef Uint32 botright if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): return Rect((0, 0, self.surface.w, self.surface.h)) self.lock() cdef Uint8 *pixels = self.surface.pixels with nogil: topleft = ( pixels)[0] botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] if ((topleft & amask) > amin) and ((botright & amask) > amin): # Bounding box covers image. minx = 0 miny = 0 maxx = self.surface.w - 1 maxy = self.surface.h - 1 else: # Bounding box is smaller than image. for 0 <= y < self.surface.h: row = (pixels + self.surface.pitch * y) for 0 <= x < self.surface.w: if (row[x] & amask) >= amin: if minx > x: minx = x if miny > y: miny = y if maxx < x: maxx = x if maxy < y: maxy = y self.unlock() # Totally empty surface. if minx > maxx: return Rect((0, 0, 0, 0)) x = minx y = miny w = min(maxx - minx + 1, self.surface.w - x) h = min(maxy - miny + 1, self.surface.h - y) return Rect((x, y, w, h)) def get_view(self, kind='2'): raise error("Surface.get_view is not supported.") def get_buffer(self): cdef Uint8 *pixels = self.surface.pixels return pixels[self.surface.h * self.surface.pitch] property _pixels_address: def __get__(self): return self.surface.pixels def from_data(self, data): if len(data) != self.surface.w * self.surface.h * self.surface.format.BytesPerPixel: raise ValueError("The data must fill the surface.") cdef Uint8 *d = data cdef Uint8 *pixels = self.surface.pixels cdef int i for 0 <= i < self.surface.h: memmove(pixels, d, self.surface.w * self.surface.format.BytesPerPixel) d += self.surface.w * self.surface.format.BytesPerPixel pixels += self.surface.pitch cdef api SDL_Surface *PySurface_AsSurface(surface): return ( surface).surface cdef api object PySurface_New(SDL_Surface *surf): cdef Surface rv = Surface(()) rv.take_surface(surf) return rv ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1453347392.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/sysfont.py0000664000175000017500000006356512650051100020745 0ustar00tomtom## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (at your option) any later version. ## ## This library is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## Library General Public License for more details. ## ## You should have received a copy of the GNU Library General Public ## License along with this library; if not, write to the Free ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## ## Pete Shinners ## pete@shinners.org import glob "sysfont, used in the font module to find system fonts" import os, sys #Python 3 compatibility try: bytes except NameError: def toascii(raw): return raw.decode('ascii', 'ignore').encode('ascii') else: def toascii(raw): return raw.decode('ascii', 'ignore') #create simple version of the font name def _simplename(name): return ''.join([c.lower() for c in name if c.isalnum()]) #insert a font and style into the font dictionary def _addfont(name, bold, italic, font, fontdict): if name not in fontdict: fontdict[name] = {} fontdict[name][bold, italic] = font #read the fonts on windows # Info taken from: # http://www.microsoft.com/typography/fonts/winxp.htm # with extra files added from: # http://www.ampsoft.net/webdesign-l/windows-fonts-by-version.html # File name, family, (Bold, Italic) _XP_default_font_files = [ ('ahronbd.ttf', 'Aharoni', True, False), ('andlso.ttf', 'Andalus', False, False), ('angsa.ttf', 'Angsana New', False, False), ('angsab.ttf', 'Angsana New', True, False), ('angsai.ttf', 'Angsana New', False, True), ('angsaz.ttf', 'Angsana New', True, True), ('angsau.ttf', 'AngsanaUPC', False, False), ('angsaub.ttf', 'AngsanaUPC', True, False), ('angsaui.ttf', 'AngsanaUPC', False, True), ('angsauz.ttf', 'AngsanaUPC', True, True), ('artro.ttf', 'Arabic Transparent', False, False), ('artrbdo.ttf', 'Arabic Transparent', True, False), ('agatha.ttf', 'Agatha', False, False), ('arial.ttf', 'Arial', False, False), ('arialbd.ttf', 'Arial', True, False), ('ariali.ttf', 'Arial', False, True), ('arialbi.ttf', 'Arial', True, True), ('ariblk.ttf', 'Arial Black', False, False), ('browa.ttf', 'Browallia New', False, False), ('browab.ttf', 'Browallia New', True, False), ('browai.ttf', 'Browallia New', False, True), ('browaz.ttf', 'Browallia New', True, True), ('browau.ttf', 'BrowalliaUPC', False, False), ('browaub.ttf', 'BrowalliaUPC', True, False), ('browaui.ttf', 'BrowalliaUPC', False, True), ('browauz.ttf', 'BrowalliaUPC', True, True), ('comic.ttf', 'Comic Sans MS', False, False), ('comicbd.ttf', 'Comic Sans MS', True, False), ('cordia.ttf', 'Cordia New', False, False), ('cordiab.ttf', 'Cordia New', True, False), ('cordiai.ttf', 'Cordia New', False, True), ('cordiaz.ttf', 'Cordia New', True, True), ('cordiau.ttf', 'CordiaUPC', False, False), ('cordiaub.ttf', 'CordiaUPC', True, False), ('cordiaui.ttf', 'CordiaUPC', False, True), ('cordiauz.ttf', 'CordiaUPC', True, True), ('cour.ttf', 'Courier New', False, False), ('courbd.ttf', 'Courier New', True, False), ('couri.ttf', 'Courier New', False, True), ('courbi.ttf', 'Courier New', True, True), ('david.ttf', 'David', False, False), ('davidbd.ttf', 'David', True, False), ('davidtr.ttf', 'David Transparent', False, False), ('upcdl.ttf', 'DilleniaUPC', False, False), ('upcdb.ttf', 'DilleniaUPC', True, False), ('upcdi.ttf', 'DilleniaUPC', False, True), ('upcdbi.ttf', 'DilleniaUPC', True, True), ('estre.ttf', 'Estrangelo Edessa', False, False), ('upcel.ttf', 'EucrosialUPC', False, False), ('upceb.ttf', 'EucrosialUPC', True, False), ('upcei.ttf', 'EucrosialUPC', False, True), ('upcebi.ttf', 'EucrosialUPC', True, True), ('mriamfx.ttf', 'Fixed Miriam Transparent', False, False), ('framd.ttf', 'Franklin Gothic Medium', False, False), ('framdit.ttf', 'Franklin Gothic Medium', False, True), ('frank.ttf', 'FrankRuehl', False, False), ('upcfl.ttf', 'FreesialUPC', False, False), ('upcfb.ttf', 'FreesialUPC', True, False), ('upcfi.ttf', 'FreesialUPC', False, True), ('upcfbi.ttf', 'FreesialUPC', True, True), ('gautami.ttf', 'Gautami', False, False), ('georgia.ttf', 'Georgia', False, False), ('georgiab.ttf', 'Georgia', True, False), ('georgiai.ttf', 'Georgia', False, True), ('georgiaz.ttf', 'Georgia', True, True), ('impact.ttf', 'Impact', False, False), ('upcil.ttf', 'IrisUPC', False, False), ('upcib.ttf', 'IrisUPC', True, False), ('upcii.ttf', 'IrisUPC', False, True), ('upcibi.ttf', 'IrisUPC', True, True), ('upcjl.ttf', 'JasmineUPC', False, False), ('upcjb.ttf', 'JasmineUPC', True, False), ('upcji.ttf', 'JasmineUPC', False, True), ('upcjbi.ttf', 'JasmineUPC', True, True), ('upckl.ttf', 'KodchiangUPC', False, False), ('upckb.ttf', 'KodchiangUPC', True, False), ('upcki.ttf', 'KodchiangUPC', False, True), ('upckbi.ttf', 'KodchiangUPC', True, True), ('latha.ttf', 'Latha', False, False), ('lvnm.ttf', 'Levenim MT', False, False), ('lvnmbd.ttf', 'Levenim MT', True, False), ('upcll.ttf', 'LilyUPC', False, False), ('upclb.ttf', 'LilyUPC', True, False), ('upcli.ttf', 'LilyUPC', False, True), ('upclbi.ttf', 'LilyUPC', True, True), ('lucon.ttf', 'Lucida Console', False, False), ('l_10646.ttf', 'Lucida Sans Unicode', False, False), ('mangal.ttf', 'Mangal', False, False), ('marlett.ttf', 'Marlett', False, False), ('micross.ttf', 'Microsoft Sans Serif', False, False), ('mriam.ttf', 'Miriam', False, False), ('mriamc.ttf', 'Miriam Fixed', False, False), ('mriamtr.ttf', 'Miriam Transparent', False, False), ('mvboli.ttf', 'MV Boli', False, False), ('nrkis.ttf', 'Narkisim', False, False), ('pala.ttf', 'Falatino Linotype', False, False), ('palab.ttf', 'Falatino Linotype', True, False), ('palai.ttf', 'Falatino Linotype', False, True), ('palabi.ttf', 'Falatino Linotype', True, True), ('raavi.ttf', 'Raavi', False, False), ('rod.ttf', 'Rod', False, False), ('rodtr.ttf', 'Rod Transparent', False, False), ('shruti.ttf', 'Shruti', False, False), ('simpo.ttf', 'Simplified Arabic', False, False), ('simpbdo.ttf', 'Simplified Arabic', True, False), ('simpfxo.ttf', 'Simplified Arabic Fixed', False, False), ('sylfaen.ttf', 'Sylfaen', False, False), ('symbol.ttf', 'Symbol', False, False), ('tahoma.ttf', 'Tahoma', False, False), ('tahomabd.ttf', 'Tahoma', True, False), ('times.ttf', 'Times New Roman', False, False), ('timesbd.ttf', 'Times New Roman', True, False), ('timesi.ttf', 'Times New Roman', False, True), ('timesbi.ttf', 'Times New Roman', True, True), ('trado.ttf', 'Traditional Arabic', False, False), ('tradbdo.ttf', 'Traditional Arabic', True, False), ('Trebuc.ttf', 'Trebuchet MS', False, False), ('Trebucbd.ttf', 'Trebuchet MS', True, False), ('Trebucit.ttf', 'Trebuchet MS', False, True), ('Trebucbi.ttf', 'Trebuchet MS', True, True), ('tunga.ttf', 'Tunga', False, False), ('verdana.ttf', 'Verdana', False, False), ('verdanab.ttf', 'Verdana', True, False), ('verdanai.ttf', 'Verdana', False, True), ('verdanaz.ttf', 'Verdana', True, True), ('webdings.ttf', 'Webdings', False, False), ('wingding.ttf', 'Wingdings', False, False), ('simhei.ttf', 'SimHei', False, False), ('simfang.ttf', 'FangSong_GB2312', False, False), ('kaiu.ttf', 'DFKai-SB', False, False), ('simkai.ttf', 'KaiTi_GB2312', False, False), ('msgothic.ttc', 'MS Gothic', False, False), ('msmincho.ttc', 'MS Mincho', False, False), ('gulim.ttc', 'Gulim', False, False), ('mingliu.ttc', 'Mingliu', False, False), ('simsun.ttc', 'Simsun', False, False), ('batang.ttc', 'Batang', False, False), ] def initsysfonts_win32(): try: import _winreg except ImportError: import winreg as _winreg if 'WINDIR' in os.environ: windir = os.environ['WINDIR'] elif 'windir' in os.environ: windir = os.environ['windir'] else: windir = "C:\\Windows\\" fonts = {} mods = 'demibold', 'narrow', 'light', 'unicode', 'bt', 'mt' fontdir = os.path.join(windir, "Fonts") #this is a list of registry keys containing information #about fonts installed on the system. keys = [] #add recognized fonts from the fonts directory because the default #fonts may not be entered in the registry. win_font_files_mapping = dict( [(file_name.lower(), (_simplename(name), bold, italic)) for file_name, name, bold, italic in _XP_default_font_files]) font_dir_path = os.path.join(windir, 'fonts') try: font_file_paths = glob.glob(os.path.join(font_dir_path, '*.tt?')) except Exception: pass else: for font in font_file_paths: file_name = os.path.basename(font) try: name, bold, italic = win_font_files_mapping[file_name] except KeyError: pass else: _addfont(name, bold, italic, font, fonts) #add additional fonts entered in the registry. #find valid registry keys containing font information. possible_keys = [ r"SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts", r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", r"SOFTWARE\Microsoft\Windows[NT]\CurrentVersion\Fonts", ] for key_name in possible_keys: try: key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, key_name) keys.append(key) except WindowsError: # @UndefinedVariable pass for key in keys: fontdict = {} for i in range(_winreg.QueryInfoKey(key)[1]): try: name, font, t = _winreg.EnumValue(key,i) except EnvironmentError: break # try and handle windows unicode strings for some file names. # here are two documents with some information about it: # http://www.python.org/peps/pep-0277.html # https://www.microsoft.com/technet/archive/interopmigration/linux/mvc/lintowin.mspx#ECAA try: font = str(font) except UnicodeEncodeError: # MBCS is the windows encoding for unicode file names. try: font = font.encode('MBCS') except: # no goodness with str or MBCS encoding... skip this font. continue if font[-4:].lower() not in [".ttf", ".ttc", ".otf"]: continue if os.sep not in font: font = os.path.join(fontdir, font) if name[-10:] == '(TrueType)': name = name[:-11] name = name.lower().split() bold = italic = 0 for m in mods: if m in name: name.remove(m) if 'bold' in name: name.remove('bold') bold = 1 if 'italic' in name: name.remove('italic') italic = 1 name = ''.join(name) name=_simplename(name) _addfont(name, bold, italic, font, fonts) return fonts _OSX_default_font_files = { 'albayan': {(False, False): '/Library/Fonts/AlBayan.ttf', (True, False): '/Library/Fonts/AlBayanBold.ttf'}, 'andalemono': {(False, False): '/Library/Fonts/Andale Mono.ttf'}, 'applebraille': {(False, False): '/System/Library/Fonts/Apple Braille Outline 6 Dot.ttf'}, 'applegothic': {(False, False): '/System/Library/Fonts/AppleGothic.ttf'}, 'applesymbols': {(False, False): '/System/Library/Fonts/Apple Symbols.ttf'}, 'arial': {(False, False): '/Library/Fonts/Arial.ttf', (False, True): '/Library/Fonts/Arial Italic.ttf', (True, False): '/Library/Fonts/Arial Bold.ttf', (True, True): '/Library/Fonts/Arial Bold Italic.ttf'}, 'arialblack': {(False, False): '/Library/Fonts/Arial Black.ttf'}, 'arialhebrew': {(False, False): '/Library/Fonts/ArialHB.ttf', (True, False): '/Library/Fonts/ArialHBBold.ttf'}, 'arialnarrow': {(False, False): '/Library/Fonts/Arial Narrow.ttf', (False, True): '/Library/Fonts/Arial Narrow Italic.ttf', (True, False): '/Library/Fonts/Arial Narrow Bold.ttf', (True, True): '/Library/Fonts/Arial Narrow Bold Italic.ttf'}, 'arialroundedmtbold': {(False, False): '/Library/Fonts/Arial Rounded Bold.ttf'}, 'arialunicodems': {(False, False): '/Library/Fonts/Arial Unicode.ttf'}, 'ayuthaya': {(False, False): '/Library/Fonts/Ayuthaya.ttf'}, 'baghdad': {(False, False): '/Library/Fonts/Baghdad.ttf'}, 'brushscriptmt': {(False, True): '/Library/Fonts/Brush Script.ttf'}, 'chalkboard': {(False, False): '/Library/Fonts/Chalkboard.ttf', (True, False): '/Library/Fonts/ChalkboardBold.ttf'}, 'comicsansms': {(False, False): '/Library/Fonts/Comic Sans MS.ttf', (True, False): '/Library/Fonts/Comic Sans MS Bold.ttf'}, 'corsivahebrew': {(False, False): '/Library/Fonts/Corsiva.ttf', (True, False): '/Library/Fonts/CorsivaBold.ttf'}, 'couriernew': {(False, False): '/Library/Fonts/Courier New.ttf', (False, True): '/Library/Fonts/Courier New Italic.ttf', (True, False): '/Library/Fonts/Courier New Bold.ttf', (True, True): '/Library/Fonts/Courier New Bold Italic.ttf'}, 'decotypenaskh': {(False, False): '/Library/Fonts/DecoTypeNaskh.ttf'}, 'devanagarimt': {(False, False): '/Library/Fonts/DevanagariMT.ttf', (True, False): '/Library/Fonts/DevanagariMTBold.ttf'}, 'euphemiaucas': {(False, False): '/Library/Fonts/EuphemiaCASRegular.ttf', (False, True): '/Library/Fonts/EuphemiaCASItalic.ttf', (True, False): '/Library/Fonts/EuphemiaCASBold.ttf'}, 'gb18030bitmap': {(False, False): '/Library/Fonts/NISC18030.ttf'}, 'geezapro': {(False, False): '/System/Library/Fonts/Geeza Pro.ttf', (True, False): '/System/Library/Fonts/Geeza Pro Bold.ttf'}, 'georgia': {(False, False): '/Library/Fonts/Georgia.ttf', (False, True): '/Library/Fonts/Georgia Italic.ttf', (True, False): '/Library/Fonts/Georgia Bold.ttf', (True, True): '/Library/Fonts/Georgia Bold Italic.ttf'}, 'gujaratimt': {(False, False): '/Library/Fonts/GujaratiMT.ttf', (True, False): '/Library/Fonts/GujaratiMTBold.ttf'}, 'gurmukhimt': {(False, False): '/Library/Fonts/Gurmukhi.ttf'}, 'impact': {(False, False): '/Library/Fonts/Impact.ttf'}, 'inaimathi': {(False, False): '/Library/Fonts/InaiMathi.ttf'}, 'kailasa': {(False, False): '/Library/Fonts/Kailasa.ttf'}, 'kokonor': {(False, False): '/Library/Fonts/Kokonor.ttf'}, 'krungthep': {(False, False): '/Library/Fonts/Krungthep.ttf'}, 'kufistandardgk': {(False, False): '/Library/Fonts/KufiStandardGK.ttf'}, 'liheipro': {(False, False): '/System/Library/Fonts/ Pro.ttf'}, 'lisongpro': {(False, False): '/Library/Fonts/ Pro.ttf'}, 'microsoftsansserif': {(False, False): '/Library/Fonts/Microsoft Sans Serif.ttf'}, 'mshtakan': {(False, False): '/Library/Fonts/MshtakanRegular.ttf', (False, True): '/Library/Fonts/MshtakanOblique.ttf', (True, False): '/Library/Fonts/MshtakanBold.ttf', (True, True): '/Library/Fonts/MshtakanBoldOblique.ttf'}, 'nadeem': {(False, False): '/Library/Fonts/Nadeem.ttf'}, 'newpeninimmt': {(False, False): '/Library/Fonts/NewPeninimMT.ttf', (True, False): '/Library/Fonts/NewPeninimMTBoldInclined.ttf'}, 'plantagenetcherokee': {(False, False): '/Library/Fonts/PlantagenetCherokee.ttf'}, 'raanana': {(False, False): '/Library/Fonts/Raanana.ttf', (True, False): '/Library/Fonts/RaananaBold.ttf'}, 'sathu': {(False, False): '/Library/Fonts/Sathu.ttf'}, 'silom': {(False, False): '/Library/Fonts/Silom.ttf'}, 'stfangsong': {(False, False): '/Library/Fonts/.ttf'}, 'stheiti': {(False, False): '/System/Library/Fonts/.ttf'}, 'stkaiti': {(False, False): '/Library/Fonts/.ttf'}, 'stsong': {(False, False): '/Library/Fonts/.ttf'}, 'tahoma': {(False, False): '/Library/Fonts/Tahoma.ttf', (True, False): '/Library/Fonts/Tahoma Bold.ttf'}, 'thonburi': {(False, False): '/System/Library/Fonts/Thonburi.ttf', (True, False): '/System/Library/Fonts/ThonburiBold.ttf'}, 'timesnewroman': {(False, False): '/Library/Fonts/Times New Roman.ttf', (False, True): '/Library/Fonts/Times New Roman Italic.ttf', (True, False): '/Library/Fonts/Times New Roman Bold.ttf', (True, True): '/Library/Fonts/Times New Roman Bold Italic.ttf'}, 'trebuchetms': {(False, False): '/Library/Fonts/Trebuchet MS.ttf', (False, True): '/Library/Fonts/Trebuchet MS Italic.ttf', (True, False): '/Library/Fonts/Trebuchet MS Bold.ttf', (True, True): '/Library/Fonts/Trebuchet MS Bold Italic.ttf'}, 'verdana': {(False, False): '/Library/Fonts/Verdana.ttf', (False, True): '/Library/Fonts/Verdana Italic.ttf', (True, False): '/Library/Fonts/Verdana Bold.ttf', (True, True): '/Library/Fonts/Verdana Bold Italic.ttf'}, 'webdings': {(False, False): '/Library/Fonts/Webdings.ttf'}, 'wingdings': {(False, False): '/Library/Fonts/Wingdings.ttf'}, 'wingdings2': {(False, False): '/Library/Fonts/Wingdings 2.ttf'}, 'wingdings3': {(False, False): '/Library/Fonts/Wingdings 3.ttf'}} def _search_osx_font_paths(fonts): for name, details in _OSX_default_font_files.items(): for k, apath in details.items(): if os.path.exists(apath): bold, italic = k _addfont(name, bold, italic, apath, fonts) def initsysfonts_darwin(): """ read the fonts on OSX. """ # if the X11 binary exists... try and use that. # Not likely to be there on pre 10.4.x ... # so still need to do other OSX specific method below. # if os.path.exists("/usr/X11/bin/fc-list"): # fonts = initsysfonts_unix("/usr/X11/bin/fc-list") # else: # On recent OSX, the above code will ask the user to install X11. Since # that's crazy, we disable it, and use the default font list. fonts = {} # we look for the default paths. _search_osx_font_paths(fonts) return fonts paths = ['/Library/Fonts', '~/Library/Fonts', '/Local/Library/Fonts', '/Network/Library/Fonts'] fonts = {} for p in paths: if os.path.isdir(p): pass #os.path.walk(p, _fontwalk, fonts) return fonts #read the fonts on unix def initsysfonts_unix(path = "fc-list"): import subprocess fonts = {} # we use the fc-list from fontconfig to get a list of fonts. try: # note, we capture stderr so if fc-list isn't there to stop stderr printing. flout, flerr = subprocess.Popen('%s : file family style' % path, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True).communicate() except Exception: return fonts entries = toascii(flout) try: for line in entries.split('\n'): try: filename, family, style = line.split(':', 2) if filename[-4:].lower() in ['.ttf', '.ttc', '.otf']: bold = style.find('Bold') >= 0 italic = style.find('Italic') >= 0 oblique = style.find('Oblique') >= 0 for name in family.split(','): if name: break else: name = os.path.splitext(os.path.basename(filename))[0] _addfont(_simplename(name), bold, italic or oblique, filename, fonts) except Exception: # try the next one. pass except Exception: pass return fonts #create alias entries def create_aliases(): aliases = ( ('monospace', 'misc-fixed', 'courier', 'couriernew', 'console', 'fixed', 'mono', 'freemono', 'bitstreamverasansmono', 'verasansmono', 'monotype', 'lucidaconsole'), ('sans', 'arial', 'helvetica', 'swiss', 'freesans', 'bitstreamverasans', 'verasans', 'verdana', 'tahoma'), ('serif', 'times', 'freeserif', 'bitstreamveraserif', 'roman', 'timesroman', 'timesnewroman', 'dutch', 'veraserif', 'georgia'), ('wingdings', 'wingbats'), ) for set in aliases: found = None fname = None for name in set: if name in Sysfonts: found = Sysfonts[name] fname = name break if not found: continue for name in set: if name not in Sysfonts: Sysalias[name] = found Sysfonts = {} Sysalias = {} #initialize it all, called once def initsysfonts(): if sys.platform == 'win32': fonts = initsysfonts_win32() elif sys.platform == 'darwin': fonts = initsysfonts_darwin() else: fonts = initsysfonts_unix() Sysfonts.update(fonts) create_aliases() if not Sysfonts: #dummy so we don't try to reinit Sysfonts[None] = None # pygame.font specific declarations def font_constructor(fontpath, size, bold, italic): import pygame_sdl2.font font = pygame_sdl2.font.Font(fontpath, size) if bold: font.set_bold(1) if italic: font.set_italic(1) return font #the exported functions def SysFont(name, size, bold=False, italic=False, constructor=None): """pygame.font.SysFont(name, size, bold=False, italic=False, constructor=None) -> Font create a pygame Font from system font resources This will search the system fonts for the given font name. You can also enable bold or italic styles, and the appropriate system font will be selected if available. This will always return a valid Font object, and will fallback on the builtin pygame font if the given font is not found. Name can also be a comma separated list of names, in which case set of names will be searched in order. Pygame uses a small set of common font aliases, if the specific font you ask for is not available, a reasonable alternative may be used. if optional contructor is provided, it must be a function with signature constructor(fontpath, size, bold, italic) which returns a Font instance. If None, a pygame.font.Font object is created. """ if constructor is None: constructor = font_constructor if not Sysfonts: initsysfonts() gotbold = gotitalic = False fontname = None if name: allnames = name for name in allnames.split(','): name = _simplename(name) styles = Sysfonts.get(name) if not styles: styles = Sysalias.get(name) if styles: plainname = styles.get((False, False)) fontname = styles.get((bold, italic)) if not fontname and not plainname: # Neither requested style, nor plain font exists, so # return a font with the name requested, but an # arbitrary style. (style, fontname) = list(styles.items())[0] # Attempt to style it as requested. This can't # unbold or unitalicize anything, but it can # fake bold and/or fake italicize. if bold and style[0]: gotbold = True if italic and style[1]: gotitalic = True elif not fontname: fontname = plainname elif plainname != fontname: gotbold = bold gotitalic = italic if fontname: break set_bold = set_italic = False if bold and not gotbold: set_bold = True if italic and not gotitalic: set_italic = True return constructor(fontname, size, set_bold, set_italic) def get_fonts(): """pygame.font.get_fonts() -> list get a list of system font names Returns the list of all found system fonts. Note that the names of the fonts will be all lowercase with spaces removed. This is how pygame internally stores the font names for matching. """ if not Sysfonts: initsysfonts() return list(Sysfonts.keys()) def match_font(name, bold=0, italic=0): """pygame.font.match_font(name, bold=0, italic=0) -> name find the filename for the named system font This performs the same font search as the SysFont() function, only it returns the path to the TTF file that would be loaded. The font name can be a comma separated list of font names to try. If no match is found, None is returned. """ if not Sysfonts: initsysfonts() fontname = None allnames = name for name in allnames.split(','): name = _simplename(name) styles = Sysfonts.get(name) if not styles: styles = Sysalias.get(name) if styles: while not fontname: fontname = styles.get((bold, italic)) if italic: italic = 0 elif bold: bold = 0 elif not fontname: fontname = list(styles.values())[0] if fontname: break return fontname ././@PaxHeader0000000000000000000000000000003100000000000010207 xustar0025 mtime=1753336711.1562 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/threads/0000775000175000017500000000000015040345607020317 5ustar00tomtom././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1415063883.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/threads/Py25Queue.py0000664000175000017500000001711712426024513022437 0ustar00tomtom"""A multi-producer, multi-consumer queue.""" from time import time as _time from collections import deque __all__ = ['Empty', 'Full', 'Queue'] class Empty(Exception): "Exception raised by Queue.get(block=0)/get_nowait()." pass class Full(Exception): "Exception raised by Queue.put(block=0)/put_nowait()." pass class Queue: """Create a queue object with a given maximum size. If maxsize is <= 0, the queue size is infinite. """ def __init__(self, maxsize=0): try: import threading except ImportError: import dummy_threading as threading self._init(maxsize) # mutex must be held whenever the queue is mutating. All methods # that acquire mutex must release it before returning. mutex # is shared between the three conditions, so acquiring and # releasing the conditions also acquires and releases mutex. self.mutex = threading.Lock() # Notify not_empty whenever an item is added to the queue; a # thread waiting to get is notified then. self.not_empty = threading.Condition(self.mutex) # Notify not_full whenever an item is removed from the queue; # a thread waiting to put is notified then. self.not_full = threading.Condition(self.mutex) # Notify all_tasks_done whenever the number of unfinished tasks # drops to zero; thread waiting to join() is notified to resume self.all_tasks_done = threading.Condition(self.mutex) self.unfinished_tasks = 0 def task_done(self): """Indicate that a formerly enqueued task is complete. Used by Queue consumer threads. For each get() used to fetch a task, a subsequent call to task_done() tells the queue that the processing on the task is complete. If a join() is currently blocking, it will resume when all items have been processed (meaning that a task_done() call was received for every item that had been put() into the queue). Raises a ValueError if called more times than there were items placed in the queue. """ self.all_tasks_done.acquire() try: unfinished = self.unfinished_tasks - 1 if unfinished <= 0: if unfinished < 0: raise ValueError('task_done() called too many times') self.all_tasks_done.notifyAll() self.unfinished_tasks = unfinished finally: self.all_tasks_done.release() def join(self): """Blocks until all items in the Queue have been gotten and processed. The count of unfinished tasks goes up whenever an item is added to the queue. The count goes down whenever a consumer thread calls task_done() to indicate the item was retrieved and all work on it is complete. When the count of unfinished tasks drops to zero, join() unblocks. """ self.all_tasks_done.acquire() try: while self.unfinished_tasks: self.all_tasks_done.wait() finally: self.all_tasks_done.release() def qsize(self): """Return the approximate size of the queue (not reliable!).""" self.mutex.acquire() n = self._qsize() self.mutex.release() return n def empty(self): """Return True if the queue is empty, False otherwise (not reliable!).""" self.mutex.acquire() n = self._empty() self.mutex.release() return n def full(self): """Return True if the queue is full, False otherwise (not reliable!).""" self.mutex.acquire() n = self._full() self.mutex.release() return n def put(self, item, block=True, timeout=None): """Put an item into the queue. If optional args 'block' is true and 'timeout' is None (the default), block if necessary until a free slot is available. If 'timeout' is a positive number, it blocks at most 'timeout' seconds and raises the Full exception if no free slot was available within that time. Otherwise ('block' is false), put an item on the queue if a free slot is immediately available, else raise the Full exception ('timeout' is ignored in that case). """ self.not_full.acquire() try: if not block: if self._full(): raise Full elif timeout is None: while self._full(): self.not_full.wait() else: if timeout < 0: raise ValueError("'timeout' must be a positive number") endtime = _time() + timeout while self._full(): remaining = endtime - _time() if remaining <= 0.0: raise Full self.not_full.wait(remaining) self._put(item) self.unfinished_tasks += 1 self.not_empty.notify() finally: self.not_full.release() def put_nowait(self, item): """Put an item into the queue without blocking. Only enqueue the item if a free slot is immediately available. Otherwise raise the Full exception. """ return self.put(item, False) def get(self, block=True, timeout=None): """Remove and return an item from the queue. If optional args 'block' is true and 'timeout' is None (the default), block if necessary until an item is available. If 'timeout' is a positive number, it blocks at most 'timeout' seconds and raises the Empty exception if no item was available within that time. Otherwise ('block' is false), return an item if one is immediately available, else raise the Empty exception ('timeout' is ignored in that case). """ self.not_empty.acquire() try: if not block: if self._empty(): raise Empty elif timeout is None: while self._empty(): self.not_empty.wait() else: if timeout < 0: raise ValueError("'timeout' must be a positive number") endtime = _time() + timeout while self._empty(): remaining = endtime - _time() if remaining <= 0.0: raise Empty self.not_empty.wait(remaining) item = self._get() self.not_full.notify() return item finally: self.not_empty.release() def get_nowait(self): """Remove and return an item from the queue without blocking. Only get an item if one is immediately available. Otherwise raise the Empty exception. """ return self.get(False) # Override these methods to implement other queue organizations # (e.g. stack or priority queue). # These will only be called with appropriate locks held # Initialize the queue representation def _init(self, maxsize): self.maxsize = maxsize self.queue = deque() def _qsize(self): return len(self.queue) # Check whether the queue is empty def _empty(self): return not self.queue # Check whether the queue is full def _full(self): return self.maxsize > 0 and len(self.queue) == self.maxsize # Put a new item in the queue def _put(self, item): self.queue.append(item) # Get an item from the queue def _get(self): return self.queue.popleft() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1415063883.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/threads/__init__.py0000664000175000017500000002100512426024513022421 0ustar00tomtom""" * Experimental * Like the map function, but can use a pool of threads. Really easy to use threads. eg. tmap(f, alist) If you know how to use the map function, you can use threads. """ __author__ = "Rene Dudfield" __version__ = "0.3.0" __license__ = 'Python license' import traceback, sys from pygame.compat import geterror if sys.version_info[0] == 3: from queue import Queue from queue import Empty elif (sys.version_info[0] == 2 and sys.version_info[1] < 5): from Py25Queue import Queue from Py25Queue import Empty else: # use up to date version from Queue import Queue from Queue import Empty import threading Thread = threading.Thread STOP = object() FINISH = object() # DONE_ONE = object() # DONE_TWO = object() # a default worker queue. _wq = None # if we are using threads or not. This is the number of workers. _use_workers = 0 # Set this to the maximum for the amount of Cores/CPUs # Note, that the tests early out. # So it should only test the best number of workers +2 MAX_WORKERS_TO_TEST = 64 def init(number_of_workers = 0): """ Does a little test to see if threading is worth it. Sets up a global worker queue if it's worth it. Calling init() is not required, but is generally better to do. """ global _wq, _use_workers if number_of_workers: _use_workers = number_of_workers else: _use_workers = benchmark_workers() # if it is best to use zero workers, then use that. _wq = WorkerQueue(_use_workers) def quit(): """ cleans up everything. """ global _wq, _use_workers _wq.stop() _wq = None _use_workers = False def benchmark_workers(a_bench_func = None, the_data = None): """ does a little test to see if workers are at all faster. Returns the number of workers which works best. Takes a little bit of time to run, so you should only really call it once. You can pass in benchmark data, and functions if you want. a_bench_func - f(data) the_data - data to work on. """ global _use_workers #TODO: try and make this scale better with slower/faster cpus. # first find some variables so that using 0 workers takes about 1.0 seconds. # then go from there. # note, this will only work with pygame 1.8rc3+ # replace the doit() and the_data with something that releases the GIL import pygame import pygame.transform import time if not a_bench_func: def doit(x): return pygame.transform.scale(x, (544, 576)) else: doit = a_bench_func if not the_data: thedata = [] for x in range(10): thedata.append(pygame.Surface((155,155), 0, 32)) else: thedata = the_data best = time.time() + 100000000 best_number = 0 last_best = -1 for num_workers in range(0, MAX_WORKERS_TO_TEST): wq = WorkerQueue(num_workers) t1 = time.time() for xx in range(20): print ("active count:%s" % threading.activeCount()) results = tmap(doit, thedata, worker_queue = wq) t2 = time.time() wq.stop() total_time = t2 - t1 print ("total time num_workers:%s: time:%s:" % (num_workers, total_time)) if total_time < best: last_best = best_number best_number =num_workers best = total_time if num_workers - best_number > 1: # We tried to add more, but it didn't like it. # so we stop with testing at this number. break return best_number class WorkerQueue(object): def __init__(self, num_workers = 20): self.queue = Queue() self.pool = [] self._setup_workers(num_workers) def _setup_workers(self, num_workers): """ Sets up the worker threads NOTE: undefined behaviour if you call this again. """ self.pool = [] for _ in range(num_workers): self.pool.append(Thread(target=self.threadloop)) for a_thread in self.pool: a_thread.setDaemon(True) a_thread.start() def do(self, f, *args, **kwArgs): """ puts a function on a queue for running later. """ self.queue.put((f, args, kwArgs)) def stop(self): """ Stops the WorkerQueue, waits for all of the threads to finish up. """ self.queue.put(STOP) for thread in self.pool: thread.join() def threadloop(self): #, finish = False): """ Loops until all of the tasks are finished. """ while True: args = self.queue.get() if args is STOP: self.queue.put(STOP) self.queue.task_done() break else: try: args[0](*args[1], **args[2]) finally: # clean up the queue, raise the exception. self.queue.task_done() #raise def wait(self): """ waits until all tasks are complete. """ self.queue.join() class FuncResult: """ Used for wrapping up a function call so that the results are stored inside the instances result attribute. """ def __init__(self, f, callback = None, errback = None): """ f - is the function we that we call callback(result) - this is called when the function(f) returns errback(exception) - this is called when the function(f) raises an exception. """ self.f = f self.exception = None self.callback = callback self.errback = errback def __call__(self, *args, **kwargs): #we try to call the function here. If it fails we store the exception. try: self.result = self.f(*args, **kwargs) if self.callback: self.callback(self.result) except Exception: self.exception = geterror() if self.errback: self.errback(self.exception) def tmap(f, seq_args, num_workers = 20, worker_queue = None, wait = True, stop_on_error = True): """ like map, but uses a thread pool to execute. num_workers - the number of worker threads that will be used. If pool is passed in, then the num_workers arg is ignored. worker_queue - you can optionally pass in an existing WorkerQueue. wait - True means that the results are returned when everything is finished. False means that we return the [worker_queue, results] right away instead. results, is returned as a list of FuncResult instances. stop_on_error - """ if worker_queue: wq = worker_queue else: # see if we have a global queue to work with. if _wq: wq = _wq else: if num_workers == 0: return map(f, seq_args) wq = WorkerQueue(num_workers) # we short cut it here if the number of workers is 0. # normal map should be faster in this case. if len(wq.pool) == 0: return map(f, seq_args) #print ("queue size:%s" % wq.queue.qsize()) #TODO: divide the data (seq_args) into even chunks and # then pass each thread a map(f, equal_part(seq_args)) # That way there should be less locking, and overhead. results = [] for sa in seq_args: results.append(FuncResult(f)) wq.do(results[-1], sa) #wq.stop() if wait: #print ("wait") wq.wait() #print ("after wait") #print ("queue size:%s" % wq.queue.qsize()) if wq.queue.qsize(): raise Exception("buggy threadmap") # if we created a worker queue, we need to stop it. if not worker_queue and not _wq: #print ("stoping") wq.stop() if wq.queue.qsize(): um = wq.queue.get() if not um is STOP: raise Exception("buggy threadmap") # see if there were any errors. If so raise the first one. This matches map behaviour. # TODO: the traceback doesn't show up nicely. # NOTE: TODO: we might want to return the results anyway? This should be an option. if stop_on_error: error_ones = list(filter(lambda x:x.exception, results)) if error_ones: raise error_ones[0].exception return map(lambda x:x.result, results) else: return [wq, results] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1418524001.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/time.py0000664000175000017500000000226012443172541020174 0ustar00tomtom# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. # This file exists because this file must be python, and not cython. That's # because the init function time.pyx is inittime, which conflicts with the # built-in inittime function (used by the time module) when everything is # statically linked, as it is on iOS. from pygame_sdl2.pygame_time import * ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1740708525.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/transform.pyx0000664000175000017500000001407014760215255021447 0ustar00tomtom# Copyright 2014 Patrick Dawson # Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_gfx cimport * from pygame_sdl2.surface cimport * from pygame_sdl2.error import error def flip(Surface surface, bint xbool, bint ybool): cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) cdef SDL_Surface *src = surface.surface cdef SDL_Surface *dest = rv.surface cdef Uint32 *src_pixel cdef Uint32 *src_end cdef Uint32 *dest_pixel cdef int dest_delta cdef int y with nogil: for 0 <= y < src.h: src_pixel = (( src.pixels) + y * src.pitch) src_end = src_pixel + src.w if ybool: dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) else: dest_pixel = (( dest.pixels) + y * dest.pitch) if xbool: dest_pixel += (src.w - 1) dest_delta = -1 else: dest_delta = 1 while src_pixel < src_end: dest_pixel[0] = src_pixel[0] src_pixel += 1 dest_pixel += dest_delta return rv def scale(Surface surface, size, Surface DestSurface=None): cdef Surface surf_out cdef int err = -1 if DestSurface == None: surf_out = Surface(size, 0, surface) else: surf_out = DestSurface with nogil: SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) if err != 0: raise error() return surf_out def rotate(Surface surface, angle): # rotateSurface90Degrees always returns NULL without setting an error?? # cdef SDL_Surface *rsurf # if angle % 90 == 0: # rsurf = rotateSurface90Degrees(surface.surface, angle / 90) # if rsurf == NULL: # raise error() return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) def rotozoom(Surface surface, double angle, double scale, int smooth=1): cdef SDL_Surface *rsurf = NULL cdef Surface rv with nogil: rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) if rsurf == NULL: raise error() rv = Surface(()) rv.take_surface(rsurf) return rv cdef uint32_t get_at(SDL_Surface *surf, int x, int y) noexcept nogil: if x < 0: x = 0 elif x >= surf.w: x = surf.w - 1 if y < 0: y = 0 elif y >= surf.h: y = surf.h - 1 cdef uint32_t *p = surf.pixels p += y * (surf.pitch // sizeof(uint32_t)) p += x return p[0] cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) noexcept nogil: cdef uint32_t *p = surf.pixels p += y * (surf.pitch // sizeof(uint32_t)) p += x p[0] = color def scale2x(Surface surface, Surface DestSurface=None): cdef int x, y cdef uint32_t a, b, c, d, e, f, g, h, i cdef uint32_t e0, e1, e2, e3 if surface.get_bytesize() != 4: raise error("Surface has unsupported bytesize.") cdef Surface surf_out = DestSurface if surf_out == None: surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) surface.lock() surf_out.lock() cdef int width, height width, height = surface.get_size() with nogil: for x in range(width): for y in range(height): # Get the surrounding 9 pixels. a = get_at(surface.surface, x - 1, y - 1) b = get_at(surface.surface, x, y - 1) c = get_at(surface.surface, x + 1, y - 1) d = get_at(surface.surface, x - 1, y) e = get_at(surface.surface, x, y) f = get_at(surface.surface, x + 1, y) g = get_at(surface.surface, x - 1, y + 1) h = get_at(surface.surface, x, y + 1) i = get_at(surface.surface, x + 1, y + 1) # Expand the center pixel. if b != h and d != f: e0 = d if d == b else e e1 = f if b == f else e e2 = d if d == h else e e3 = f if h == f else e else: e0 = e1 = e2 = e3 = e set_at(surf_out.surface, x*2, y*2, e0) set_at(surf_out.surface, (x*2)+1, y*2, e1) set_at(surf_out.surface, x*2, (y*2)+1, e2) set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) surf_out.unlock() surface.unlock() return surf_out def smoothscale(Surface surface, size, Surface DestSurface=None): cdef double scale_x = size[0] / surface.surface.w cdef double scale_y = size[1] / surface.surface.h cdef SDL_Surface *rsurf = NULL cdef Surface rv with nogil: rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) if rsurf == NULL: raise error() rv = Surface(()) rv.take_surface(rsurf) # This is inefficient. if DestSurface: with nogil: SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) return rv ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1453774560.0 pygame_sdl2-2.1.0+renpy8.4.1/src/pygame_sdl2/version.py0000664000175000017500000000176012651553340020730 0ustar00tomtom# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. import pygame_sdl2 vernum = (2, 1, 0) ver = ".".join(str(i) for i in vernum) rev = "pygame_sdl2-not-tracked" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1556070201.0 pygame_sdl2-2.1.0+renpy8.4.1/src/python_threads.h0000644000175000017500000000035313457737471017700 0ustar00tomtom#ifndef PYTHON_THREADS #define PYTHON_THREADS #ifdef __EMSCRIPTEN__ static inline void init_python_threads(void) { } #else #include "Python.h" static inline void init_python_threads(void) { PyEval_InitThreads(); } #endif #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1674803071.0 pygame_sdl2-2.1.0+renpy8.4.1/src/sdl_image_compat.h0000664000175000017500000000064114364673577020142 0ustar00tomtom#ifndef SDL_IMAGE_COMPAT_H #define SDL_IMAGE_COMPAT_H #include "SDL_image.h" #if ! SDL_IMAGE_VERSION_ATLEAST(2, 6, 0) #define IMG_INIT_JXL (0x00000010) #define IMG_INIT_AVIF (0x00000020) static SDL_Surface *mock_IMG_LoadSizedSVG_RW(void) { SDL_SetError("SDL_image is too old for SVG support."); return NULL; } #define IMG_LoadSizedSVG_RW(src, width, height) (mock_IMG_LoadSizedSVG_RW()) #endif #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1426456532.0 pygame_sdl2-2.1.0+renpy8.4.1/src/surface.h0000664000175000017500000003257412501377724016277 0ustar00tomtom/* pygame - Python Game Library Copyright (C) 2000-2001 Pete Shinners Copyright (C) 2007 Marcus von Appen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Pete Shinners pete@shinners.org */ #ifndef SURFACE_H #define SURFACE_H /* This is defined in SDL.h */ #if defined(_POSIX_C_SOURCE) #undef _POSIX_C_SOURCE #endif #include #define PYGAME_BLEND_ADD 0x1 #define PYGAME_BLEND_SUB 0x2 #define PYGAME_BLEND_MULT 0x3 #define PYGAME_BLEND_MIN 0x4 #define PYGAME_BLEND_MAX 0x5 #define PYGAME_BLEND_RGB_ADD 0x1 #define PYGAME_BLEND_RGB_SUB 0x2 #define PYGAME_BLEND_RGB_MULT 0x3 #define PYGAME_BLEND_RGB_MIN 0x4 #define PYGAME_BLEND_RGB_MAX 0x5 #define PYGAME_BLEND_RGBA_ADD 0x6 #define PYGAME_BLEND_RGBA_SUB 0x7 #define PYGAME_BLEND_RGBA_MULT 0x8 #define PYGAME_BLEND_RGBA_MIN 0x9 #define PYGAME_BLEND_RGBA_MAX 0x10 #define PYGAME_BLEND_PREMULTIPLIED 0x11 #if SDL_BYTEORDER == SDL_LIL_ENDIAN #define GET_PIXEL_24(b) (b[0] + (b[1] << 8) + (b[2] << 16)) #else #define GET_PIXEL_24(b) (b[2] + (b[1] << 8) + (b[0] << 16)) #endif #define GET_PIXEL(pxl, bpp, source) \ switch (bpp) \ { \ case 2: \ pxl = *((Uint16 *) (source)); \ break; \ case 4: \ pxl = *((Uint32 *) (source)); \ break; \ default: \ { \ Uint8 *b = (Uint8 *) source; \ pxl = GET_PIXEL_24(b); \ } \ break; \ } #define GET_PIXELVALS(_sR, _sG, _sB, _sA, px, fmt, ppa) \ _sR = ((px & fmt->Rmask) >> fmt->Rshift); \ _sR = (_sR << fmt->Rloss) + (_sR >> (8 - (fmt->Rloss << 1))); \ _sG = ((px & fmt->Gmask) >> fmt->Gshift); \ _sG = (_sG << fmt->Gloss) + (_sG >> (8 - (fmt->Gloss << 1))); \ _sB = ((px & fmt->Bmask) >> fmt->Bshift); \ _sB = (_sB << fmt->Bloss) + (_sB >> (8 - (fmt->Bloss << 1))); \ if (ppa) \ { \ _sA = ((px & fmt->Amask) >> fmt->Ashift); \ _sA = (_sA << fmt->Aloss) + (_sA >> (8 - (fmt->Aloss << 1))); \ } \ else \ { \ _sA = 255; \ } #define GET_PIXELVALS_1(sr, sg, sb, sa, _src, _fmt) \ sr = _fmt->palette->colors[*((Uint8 *) (_src))].r; \ sg = _fmt->palette->colors[*((Uint8 *) (_src))].g; \ sb = _fmt->palette->colors[*((Uint8 *) (_src))].b; \ sa = 255; #if SDL_BYTEORDER == SDL_LIL_ENDIAN #define SET_OFFSETS_24(or, og, ob, fmt) \ { \ or = (fmt->Rshift == 0 ? 0 : \ fmt->Rshift == 8 ? 1 : \ 2 ); \ og = (fmt->Gshift == 0 ? 0 : \ fmt->Gshift == 8 ? 1 : \ 2 ); \ ob = (fmt->Bshift == 0 ? 0 : \ fmt->Bshift == 8 ? 1 : \ 2 ); \ } #define SET_OFFSETS_32(or, og, ob, fmt) \ { \ or = (fmt->Rshift == 0 ? 0 : \ fmt->Rshift == 8 ? 1 : \ fmt->Rshift == 16 ? 2 : \ 3 ); \ og = (fmt->Gshift == 0 ? 0 : \ fmt->Gshift == 8 ? 1 : \ fmt->Gshift == 16 ? 2 : \ 3 ); \ ob = (fmt->Bshift == 0 ? 0 : \ fmt->Bshift == 8 ? 1 : \ fmt->Bshift == 16 ? 2 : \ 3 ); \ } #else #define SET_OFFSETS_24(or, og, ob, fmt) \ { \ or = (fmt->Rshift == 0 ? 2 : \ fmt->Rshift == 8 ? 1 : \ 0 ); \ og = (fmt->Gshift == 0 ? 2 : \ fmt->Gshift == 8 ? 1 : \ 0 ); \ ob = (fmt->Bshift == 0 ? 2 : \ fmt->Bshift == 8 ? 1 : \ 0 ); \ } #define SET_OFFSETS_32(or, og, ob, fmt) \ { \ or = (fmt->Rshift == 0 ? 3 : \ fmt->Rshift == 8 ? 2 : \ fmt->Rshift == 16 ? 1 : \ 0 ); \ og = (fmt->Gshift == 0 ? 3 : \ fmt->Gshift == 8 ? 2 : \ fmt->Gshift == 16 ? 1 : \ 0 ); \ ob = (fmt->Bshift == 0 ? 3 : \ fmt->Bshift == 8 ? 2 : \ fmt->Bshift == 16 ? 1 : \ 0 ); \ } #endif #define CREATE_PIXEL(buf, r, g, b, a, bp, ft) \ switch (bp) \ { \ case 2: \ *((Uint16 *) (buf)) = \ ((r >> ft->Rloss) << ft->Rshift) | \ ((g >> ft->Gloss) << ft->Gshift) | \ ((b >> ft->Bloss) << ft->Bshift) | \ ((a >> ft->Aloss) << ft->Ashift); \ break; \ case 4: \ *((Uint32 *) (buf)) = \ ((r >> ft->Rloss) << ft->Rshift) | \ ((g >> ft->Gloss) << ft->Gshift) | \ ((b >> ft->Bloss) << ft->Bshift) | \ ((a >> ft->Aloss) << ft->Ashift); \ break; \ } /* Pretty good idea from Tom Duff :-). */ #define LOOP_UNROLLED4(code, n, width) \ n = (width + 3) / 4; \ switch (width & 3) \ { \ case 0: do { code; \ case 3: code; \ case 2: code; \ case 1: code; \ } while (--n > 0); \ } /* Used in the srcbpp == dstbpp == 1 blend functions */ #define REPEAT_3(code) \ code; \ code; \ code; #define REPEAT_4(code) \ code; \ code; \ code; \ code; #define BLEND_ADD(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ tmp = dR + sR; dR = (tmp <= 255 ? tmp : 255); \ tmp = dG + sG; dG = (tmp <= 255 ? tmp : 255); \ tmp = dB + sB; dB = (tmp <= 255 ? tmp : 255); #define BLEND_SUB(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ tmp = dR - sR; dR = (tmp >= 0 ? tmp : 0); \ tmp = dG - sG; dG = (tmp >= 0 ? tmp : 0); \ tmp = dB - sB; dB = (tmp >= 0 ? tmp : 0); #define BLEND_MULT(sR, sG, sB, sA, dR, dG, dB, dA) \ dR = (dR && sR) ? (dR * sR) >> 8 : 0; \ dG = (dG && sG) ? (dG * sG) >> 8 : 0; \ dB = (dB && sB) ? (dB * sB) >> 8 : 0; #define BLEND_MIN(sR, sG, sB, sA, dR, dG, dB, dA) \ if(sR < dR) { dR = sR; } \ if(sG < dG) { dG = sG; } \ if(sB < dB) { dB = sB; } #define BLEND_MAX(sR, sG, sB, sA, dR, dG, dB, dA) \ if(sR > dR) { dR = sR; } \ if(sG > dG) { dG = sG; } \ if(sB > dB) { dB = sB; } #define BLEND_RGBA_ADD(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ tmp = dR + sR; dR = (tmp <= 255 ? tmp : 255); \ tmp = dG + sG; dG = (tmp <= 255 ? tmp : 255); \ tmp = dB + sB; dB = (tmp <= 255 ? tmp : 255); \ tmp = dA + sA; dA = (tmp <= 255 ? tmp : 255); #define BLEND_RGBA_SUB(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ tmp = dR - sR; dR = (tmp >= 0 ? tmp : 0); \ tmp = dG - sG; dG = (tmp >= 0 ? tmp : 0); \ tmp = dB - sB; dB = (tmp >= 0 ? tmp : 0); \ tmp = dA - sA; dA = (tmp >= 0 ? tmp : 0); #define BLEND_RGBA_MULT(sR, sG, sB, sA, dR, dG, dB, dA) \ dR = (dR && sR) ? (dR * sR) >> 8 : 0; \ dG = (dG && sG) ? (dG * sG) >> 8 : 0; \ dB = (dB && sB) ? (dB * sB) >> 8 : 0; \ dA = (dA && sA) ? (dA * sA) >> 8 : 0; #define BLEND_RGBA_MIN(sR, sG, sB, sA, dR, dG, dB, dA) \ if(sR < dR) { dR = sR; } \ if(sG < dG) { dG = sG; } \ if(sB < dB) { dB = sB; } \ if(sA < dA) { dA = sA; } #define BLEND_RGBA_MAX(sR, sG, sB, sA, dR, dG, dB, dA) \ if(sR > dR) { dR = sR; } \ if(sG > dG) { dG = sG; } \ if(sB > dB) { dB = sB; } \ if(sA > dA) { dA = sA; } #if 1 /* Choose an alpha blend equation. If the sign is preserved on a right shift * then use a specialized, faster, equation. Otherwise a more general form, * where all additions are done before the shift, is needed. */ #if (-1 >> 1) < 0 #define ALPHA_BLEND_COMP(sC, dC, sA) ((((sC - dC) * sA + sC) >> 8) + dC) #else #define ALPHA_BLEND_COMP(sC, dC, sA) (((dC << 8) + (sC - dC) * sA + sC) >> 8) #endif #define ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB, dA) \ do { \ if (dA) \ { \ dR = ALPHA_BLEND_COMP(sR, dR, sA); \ dG = ALPHA_BLEND_COMP(sG, dG, sA); \ dB = ALPHA_BLEND_COMP(sB, dB, sA); \ dA = sA + dA - ((sA * dA) / 255); \ } \ else \ { \ dR = sR; \ dG = sG; \ dB = sB; \ dA = sA; \ } \ } while(0) #define ALPHA_BLEND_PREMULTIPLIED_COMP(sC, dC, sA) (sC + dC - ((dC * sA) >> 8)) #define ALPHA_BLEND_PREMULTIPLIED(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ do { \ tmp = ALPHA_BLEND_PREMULTIPLIED_COMP(sR, dR, sA); dR = (tmp > 255 ? 255 : tmp); \ tmp = ALPHA_BLEND_PREMULTIPLIED_COMP(sG, dG, sA); dG = (tmp > 255 ? 255 : tmp); \ tmp = ALPHA_BLEND_PREMULTIPLIED_COMP(sB, dB, sA); dB = (tmp > 255 ? 255 : tmp); \ dA = sA + dA - ((sA * dA) / 255); \ } while(0) #elif 0 #define ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB, dA) \ do { \ if(sA){ \ if(dA && sA < 255){ \ int dContrib = dA*(255 - sA)/255; \ dA = sA+dA - ((sA*dA)/255); \ dR = (dR*dContrib + sR*sA)/dA; \ dG = (dG*dContrib + sG*sA)/dA; \ dB = (dB*dContrib + sB*sA)/dA; \ }else{ \ dR = sR; \ dG = sG; \ dB = sB; \ dA = sA; \ } \ } \ } while(0) #endif int surface_fill_blend (SDL_Surface *surface, SDL_Rect *rect, Uint32 color, int blendargs); void surface_respect_clip_rect (SDL_Surface *surface, SDL_Rect *rect); int pygame_AlphaBlit (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args); int pygame_Blit (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args); #endif /* SURFACE_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1458524299.0 pygame_sdl2-2.1.0+renpy8.4.1/src/write_jpeg.c0000664000175000017500000000513512673650213016767 0ustar00tomtom/* Copyright 2006 Rene Dudfield * Copyright 2014 Tom Rothamel * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. */ #include #include #include static int write_jpeg ( const char *file_name, JSAMPROW *rows, int width, int height, int quality) { struct jpeg_compress_struct cinfo; struct jpeg_error_mgr jerr; FILE * outfile; cinfo.err = jpeg_std_error(&jerr); jpeg_create_compress(&cinfo); if ((outfile = fopen(file_name, "wb")) == NULL) { SDL_SetError ("SaveJPEG: could not open %s", file_name); return -1; } jpeg_stdio_dest (&cinfo, outfile); cinfo.image_width = width; cinfo.image_height = height; cinfo.input_components = 3; cinfo.in_color_space = JCS_RGB; jpeg_set_defaults (&cinfo); jpeg_set_quality (&cinfo, quality, TRUE); jpeg_start_compress (&cinfo, TRUE); jpeg_write_scanlines(&cinfo, rows, height); jpeg_finish_compress (&cinfo); fclose (outfile); jpeg_destroy_compress (&cinfo); return 0; } int Pygame_SDL2_SaveJPEG(SDL_Surface *surface, const char *file, int quality) { SDL_Surface *rgb_surf; JSAMPROW *samples; int i, rv; if (quality < 0) { quality = 90; } rgb_surf = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_RGB24, 0); if (! rgb_surf) { return -1; } samples = (JSAMPROW *) malloc (sizeof(JSAMPROW) * rgb_surf->h); if (!samples) { SDL_FreeSurface(rgb_surf); return -1; } /* copy pointers to the scanlines... since they might not be packed. */ for (i = 0; i < rgb_surf->h; i++) { samples[i] = ((unsigned char*)rgb_surf->pixels) + i * rgb_surf->pitch; } rv = write_jpeg(file, samples, surface->w, surface->h, quality); free(samples); SDL_FreeSurface(rgb_surf); return rv; } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1458524263.0 pygame_sdl2-2.1.0+renpy8.4.1/src/write_jpeg.h0000664000175000017500000000020212673650147016770 0ustar00tomtom#ifndef WRITE_JPEG_H #define WRITE_JPEG_H int Pygame_SDL2_SaveJPEG(SDL_Surface *surface, const char *file, int quality); #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1458523706.0 pygame_sdl2-2.1.0+renpy8.4.1/src/write_png.c0000664000175000017500000001103412673647072016632 0ustar00tomtom/* Based on zlib license - see http://www.gzip.org/zlib/zlib_license.html This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. "Philip D. Bober" */ /** * 4/17/04 - IMG_SavePNG & IMG_SavePNG_RW - Philip D. Bober * 11/08/2004 - Compr fix, levels -1,1-7 now work - Tyler Montbriand */ #include #include #include #include "write_png.h" #ifndef png_voidp #define png_voidp voidp #endif int Pygame_SDL2_SavePNG(const char *file, SDL_Surface *surf,int compression){ SDL_RWops *fp; int ret; fp=SDL_RWFromFile(file,"wb"); if( fp == NULL ) { return (-1); } ret=Pygame_SDL2_SavePNG_RW(fp,surf,compression); SDL_RWclose(fp); return ret; } static void png_write_data(png_structp png_ptr,png_bytep data, png_size_t length){ SDL_RWops *rp = (SDL_RWops*) png_get_io_ptr(png_ptr); SDL_RWwrite(rp,data,1,length); } int Pygame_SDL2_SavePNG_RW(SDL_RWops *src, SDL_Surface *surf,int compression){ png_structp png_ptr; png_infop info_ptr; SDL_PixelFormat *fmt=NULL; SDL_Surface *tempsurf=NULL; int ret; int i; png_colorp palette; Uint8 *palette_alpha=NULL; png_byte **row_pointers=NULL; unsigned int target_format; png_ptr=NULL;info_ptr=NULL;palette=NULL;ret=-1; if( !src || !surf) { goto savedone2; /* Nothing to do. */ } row_pointers=(png_byte **)malloc(surf->h * sizeof(png_byte*)); if (!row_pointers) { SDL_SetError("Couldn't allocate memory for rowpointers"); goto savedone2; } png_ptr=png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL,NULL,NULL); if (!png_ptr){ SDL_SetError("Couldn't allocate memory for PNG file version: " PNG_LIBPNG_VER_STRING); goto savedone2; } info_ptr= png_create_info_struct(png_ptr); if (!info_ptr){ SDL_SetError("Couldn't allocate image information for PNG file"); goto savedone; } /* setup custom writer functions */ png_set_write_fn(png_ptr,(png_voidp)src,png_write_data,NULL); if (setjmp(png_jmpbuf(png_ptr))){ SDL_SetError("Unknown error writing PNG"); goto savedone; } if(compression>Z_BEST_COMPRESSION) compression=Z_BEST_COMPRESSION; if(compression == Z_NO_COMPRESSION) // No compression { png_set_filter(png_ptr,0,PNG_FILTER_NONE); png_set_compression_level(png_ptr,Z_NO_COMPRESSION); } else if(compression<0) // Default compression png_set_compression_level(png_ptr,Z_DEFAULT_COMPRESSION); else png_set_compression_level(png_ptr,compression); fmt=surf->format; if (fmt->Amask) { png_set_IHDR(png_ptr,info_ptr, surf->w,surf->h,8,PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE,PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); } else { png_set_IHDR(png_ptr,info_ptr, surf->w,surf->h,8,PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); } png_write_info(png_ptr, info_ptr); #if SDL_BYTEORDER == SDL_LIL_ENDIAN if (fmt->Amask) { target_format = SDL_PIXELFORMAT_ABGR8888; } else { target_format = SDL_PIXELFORMAT_BGR888; } #else if (fmt->Amask) { target_format = SDL_PIXELFORMAT_RGBA8888; } else { target_format = SDL_PIXELFORMAT_RGB888; } #endif if (surf->format->format != target_format) { tempsurf = SDL_ConvertSurfaceFormat(surf, target_format, 0); surf = tempsurf; if (!tempsurf){ SDL_SetError("Couldn't allocate temp surface"); goto savedone; } } for(i=0;i < surf->h;i++){ row_pointers[i]= ((png_byte*) surf->pixels) + i * surf->pitch; } png_write_image(png_ptr, row_pointers); if (tempsurf) { SDL_FreeSurface(tempsurf); } png_write_end(png_ptr, NULL); ret=0; /* got here, so nothing went wrong. YAY! */ savedone: /* clean up and return */ png_destroy_write_struct(&png_ptr,&info_ptr); savedone2: if (palette) { free(palette); } if (palette_alpha) { free(palette_alpha); } if (row_pointers) { free(row_pointers); } return ret; } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1423969304.0 pygame_sdl2-2.1.0+renpy8.4.1/src/write_png.h0000664000175000017500000000034012470006030016607 0ustar00tomtom#ifndef WRITE_PNG_H #define WRITE_PNG_H #include int Pygame_SDL2_SavePNG(const char *file, SDL_Surface *surf,int compression); int Pygame_SDL2_SavePNG_RW(SDL_RWops *src, SDL_Surface *surf,int compression); #endif